@meridianjs/admin-dashboard 0.1.18 → 0.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ProjectTimelinePage-CBA3foKj.js → ProjectTimelinePage-QtFa8ALJ.js} +1 -1
- package/dist/assets/index-CIeN_0VV.js +535 -0
- package/dist/assets/index-DB_2bNTx.css +1 -0
- package/dist/assets/{vendor-editor-Bc-lI3f8.js → vendor-editor-CLgv8mN6.js} +1 -1
- package/dist/index.html +3 -3
- package/package.json +3 -1
- package/dist/assets/index-DPCjp89Y.css +0 -1
- package/dist/assets/index-xgSB9sMI.js +0 -477
|
@@ -1,477 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProjectTimelinePage-CBA3foKj.js","assets/vendor-query-B9zjiv_I.js","assets/vendor-react-GAVzOgi0.js","assets/vendor-dnd-DY2LDzZ0.js","assets/vendor-radix-CvpS4Cp5.js","assets/vendor-editor-Bc-lI3f8.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{j as t,u as Ee,a as pe,b as xe,R as Cu,Q as Mu,c as Du}from"./vendor-query-B9zjiv_I.js";import{a as _u,c as N,r as x,b as Eu,u as pt,d as Wr,N as ln,e as ot,L as Kn,O as ml,f as fl,h as Tu,i as Ye,j as Ws,B as Ou}from"./vendor-react-GAVzOgi0.js";import{C as hl,R as Au,T as Pu,P as Ru,S as oo,a as xl,O as Qs,b as tr,c as Xs,d as Lr,e as vn,D as jn,f as sr,g as pl,h as gl,i as Iu,j as bl,I as yl,k as vl,l as jl,m as wl,L as Nl,n as kl,o as $u,p as zu,q as Sl,r as Cl,F as Ml,u as dn,t as Ds,s as Fu,v as Dl,w as _l,x as Wu,y as El,z as Tl,A as Lu,B as Ol,V as qu,E as Al,G as Pl,H as Bu,J as Uu,K as Rl,M as Yu,N as Hu,Q as Vu,U as Il,W as Ku,X as Gu,Y as $l,Z as Qu,_ as Xu,$ as zl,a0 as Zu,a1 as Fl,a2 as Ju,a3 as em,a4 as Wl,a5 as tm}from"./vendor-radix-CvpS4Cp5.js";import{u as Ll,a as ql,P as Bl,D as Ul,S as io,h as Yl,b as Ar,c as lo,C as co,d as sm,v as nm,r as rm,e as am,f as om}from"./vendor-dnd-DY2LDzZ0.js";import{E as im,u as Hl,i as Vl,a as Kl,b as Gl,c as Ql,d as lm,e as cm}from"./vendor-editor-Bc-lI3f8.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 Xl,mi=_u;Xl=mi.createRoot,mi.hydrateRoot;const dm="modulepreload",um=function(e){return"/"+e},fi={},mm=function(s,n,r){let a=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),l=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));a=Promise.allSettled(n.map(c=>{if(c=um(c),c in fi)return;fi[c]=!0;const d=c.endsWith(".css"),u=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${u}`))return;const m=document.createElement("link");if(m.rel=d?"stylesheet":dm,d||(m.as="script"),m.crossOrigin="",m.href=c,l&&m.setAttribute("nonce",l),document.head.appendChild(m),d)return new Promise((f,h)=>{m.addEventListener("load",f),m.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${c}`)))})}))}function o(i){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=i,window.dispatchEvent(l),!l.defaultPrevented)throw i}return a.then(i=>{for(const l of i||[])l.status==="rejected"&&o(l.reason);return s().catch(o)})};var fm=function(){return null},hm=e=>{switch(e){case"success":return gm;case"info":return ym;case"warning":return bm;case"error":return vm;default:return null}},xm=Array(12).fill(0),pm=({visible:e,className:s})=>N.createElement("div",{className:["sonner-loading-wrapper",s].filter(Boolean).join(" "),"data-visible":e},N.createElement("div",{className:"sonner-spinner"},xm.map((n,r)=>N.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),gm=N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},N.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"})),bm=N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},N.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"})),ym=N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},N.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"})),vm=N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},N.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"})),jm=N.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"},N.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),N.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),wm=()=>{let[e,s]=N.useState(document.hidden);return N.useEffect(()=>{let n=()=>{s(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Va=1,Nm=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:Va++,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 c=>{if(o=["resolve",c],N.isValidElement(c))a=!1,this.create({id:n,type:"default",message:c});else if(Sm(c)&&!c.ok){a=!1;let d=typeof s.error=="function"?await s.error(`HTTP error! status: ${c.status}`):s.error,u=typeof s.description=="function"?await s.description(`HTTP error! status: ${c.status}`):s.description;this.create({id:n,type:"error",message:d,description:u})}else if(s.success!==void 0){a=!1;let d=typeof s.success=="function"?await s.success(c):s.success,u=typeof s.description=="function"?await s.description(c):s.description;this.create({id:n,type:"success",message:d,description:u})}}).catch(async c=>{if(o=["reject",c],s.error!==void 0){a=!1;let d=typeof s.error=="function"?await s.error(c):s.error,u=typeof s.description=="function"?await s.description(c):s.description;this.create({id:n,type:"error",message:d,description:u})}}).finally(()=>{var c;a&&(this.dismiss(n),n=void 0),(c=s.finally)==null||c.call(s)}),l=()=>new Promise((c,d)=>i.then(()=>o[0]==="reject"?d(o[1]):c(o[1])).catch(d));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)||Va++;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}},jt=new Nm,km=(e,s)=>{let n=(s==null?void 0:s.id)||Va++;return jt.addToast({title:e,...s,id:n}),n},Sm=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Cm=km,Mm=()=>jt.toasts,Dm=()=>jt.getActiveToasts(),z=Object.assign(Cm,{success:jt.success,info:jt.info,warning:jt.warning,error:jt.error,custom:jt.custom,message:jt.message,promise:jt.promise,dismiss:jt.dismiss,loading:jt.loading},{getHistory:Mm,getToasts:Dm});function _m(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))}_m(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
3
|
-
`);function wr(e){return e.label!==void 0}var Em=3,Tm="32px",Om="16px",hi=4e3,Am=356,Pm=14,Rm=20,Im=200;function Lt(...e){return e.filter(Boolean).join(" ")}function $m(e){let[s,n]=e.split("-"),r=[];return s&&r.push(s),n&&r.push(n),r}var zm=e=>{var s,n,r,a,o,i,l,c,d,u,m;let{invert:f,toast:h,unstyled:g,interacting:v,setHeights:D,visibleToasts:b,heights:w,index:j,toasts:y,expanded:C,removeToast:p,defaultRichColors:_,closeButton:I,style:W,cancelButtonStyle:T,actionButtonStyle:R,className:E="",descriptionClassName:P="",duration:O,position:V,gap:Y,loadingIcon:H,expandByDefault:B,classNames:L,icons:te,closeButtonAriaLabel:Z="Close toast",pauseWhenPageIsHidden:S}=e,[$,Q]=N.useState(null),[F,M]=N.useState(null),[q,me]=N.useState(!1),[Ne,Ae]=N.useState(!1),[Xe,$t]=N.useState(!1),[gt,fe]=N.useState(!1),[it,zt]=N.useState(!1),[Ft,bt]=N.useState(0),[Kt,tt]=N.useState(0),Nt=N.useRef(h.duration||O||hi),ns=N.useRef(null),Ge=N.useRef(null),Wt=j===0,yt=j+1<=b,Re=h.type,qe=h.dismissible!==!1,Tt=h.className||"",bs=h.descriptionClassName||"",Ot=N.useMemo(()=>w.findIndex(U=>U.toastId===h.id)||0,[w,h.id]),rs=N.useMemo(()=>{var U;return(U=h.closeButton)!=null?U:I},[h.closeButton,I]),kt=N.useMemo(()=>h.duration||O||hi,[h.duration,O]),St=N.useRef(0),lt=N.useRef(0),st=N.useRef(0),Ze=N.useRef(null),[Gt,as]=V.split("-"),ce=N.useMemo(()=>w.reduce((U,ie,he)=>he>=Ot?U:U+ie.height,0),[w,Ot]),ee=wm(),re=h.invert||f,X=Re==="loading";lt.current=N.useMemo(()=>Ot*Y+ce,[Ot,ce]),N.useEffect(()=>{Nt.current=kt},[kt]),N.useEffect(()=>{me(!0)},[]),N.useEffect(()=>{let U=Ge.current;if(U){let ie=U.getBoundingClientRect().height;return tt(ie),D(he=>[{toastId:h.id,height:ie,position:h.position},...he]),()=>D(he=>he.filter(Ie=>Ie.toastId!==h.id))}},[D,h.id]),N.useLayoutEffect(()=>{if(!q)return;let U=Ge.current,ie=U.style.height;U.style.height="auto";let he=U.getBoundingClientRect().height;U.style.height=ie,tt(he),D(Ie=>Ie.find(Me=>Me.toastId===h.id)?Ie.map(Me=>Me.toastId===h.id?{...Me,height:he}:Me):[{toastId:h.id,height:he,position:h.position},...Ie])},[q,h.title,h.description,D,h.id]);let ne=N.useCallback(()=>{Ae(!0),bt(lt.current),D(U=>U.filter(ie=>ie.toastId!==h.id)),setTimeout(()=>{p(h)},Im)},[h,p,D,lt]);N.useEffect(()=>{if(h.promise&&Re==="loading"||h.duration===1/0||h.type==="loading")return;let U;return C||v||S&&ee?(()=>{if(st.current<St.current){let ie=new Date().getTime()-St.current;Nt.current=Nt.current-ie}st.current=new Date().getTime()})():Nt.current!==1/0&&(St.current=new Date().getTime(),U=setTimeout(()=>{var ie;(ie=h.onAutoClose)==null||ie.call(h,h),ne()},Nt.current)),()=>clearTimeout(U)},[C,v,h,Re,S,ee,ne]),N.useEffect(()=>{h.delete&&ne()},[ne,h.delete]);function we(){var U,ie,he;return te!=null&&te.loading?N.createElement("div",{className:Lt(L==null?void 0:L.loader,(U=h==null?void 0:h.classNames)==null?void 0:U.loader,"sonner-loader"),"data-visible":Re==="loading"},te.loading):H?N.createElement("div",{className:Lt(L==null?void 0:L.loader,(ie=h==null?void 0:h.classNames)==null?void 0:ie.loader,"sonner-loader"),"data-visible":Re==="loading"},H):N.createElement(pm,{className:Lt(L==null?void 0:L.loader,(he=h==null?void 0:h.classNames)==null?void 0:he.loader),visible:Re==="loading"})}return N.createElement("li",{tabIndex:0,ref:Ge,className:Lt(E,Tt,L==null?void 0:L.toast,(s=h==null?void 0:h.classNames)==null?void 0:s.toast,L==null?void 0:L.default,L==null?void 0:L[Re],(n=h==null?void 0:h.classNames)==null?void 0:n[Re]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:_,"data-styled":!(h.jsx||h.unstyled||g),"data-mounted":q,"data-promise":!!h.promise,"data-swiped":it,"data-removed":Ne,"data-visible":yt,"data-y-position":Gt,"data-x-position":as,"data-index":j,"data-front":Wt,"data-swiping":Xe,"data-dismissible":qe,"data-type":Re,"data-invert":re,"data-swipe-out":gt,"data-swipe-direction":F,"data-expanded":!!(C||B&&q),style:{"--index":j,"--toasts-before":j,"--z-index":y.length-j,"--offset":`${Ne?Ft:lt.current}px`,"--initial-height":B?"auto":`${Kt}px`,...W,...h.style},onDragEnd:()=>{$t(!1),Q(null),Ze.current=null},onPointerDown:U=>{X||!qe||(ns.current=new Date,bt(lt.current),U.target.setPointerCapture(U.pointerId),U.target.tagName!=="BUTTON"&&($t(!0),Ze.current={x:U.clientX,y:U.clientY}))},onPointerUp:()=>{var U,ie,he,Ie;if(gt||!qe)return;Ze.current=null;let Me=Number(((U=Ge.current)==null?void 0:U.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),De=Number(((ie=Ge.current)==null?void 0:ie.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ct=new Date().getTime()-((he=ns.current)==null?void 0:he.getTime()),Je=$==="x"?Me:De,Qt=Math.abs(Je)/ct;if(Math.abs(Je)>=Rm||Qt>.11){bt(lt.current),(Ie=h.onDismiss)==null||Ie.call(h,h),M($==="x"?Me>0?"right":"left":De>0?"down":"up"),ne(),fe(!0),zt(!1);return}$t(!1),Q(null)},onPointerMove:U=>{var ie,he,Ie,Me;if(!Ze.current||!qe||((ie=window.getSelection())==null?void 0:ie.toString().length)>0)return;let De=U.clientY-Ze.current.y,ct=U.clientX-Ze.current.x,Je=(he=e.swipeDirections)!=null?he:$m(V);!$&&(Math.abs(ct)>1||Math.abs(De)>1)&&Q(Math.abs(ct)>Math.abs(De)?"x":"y");let Qt={x:0,y:0};$==="y"?(Je.includes("top")||Je.includes("bottom"))&&(Je.includes("top")&&De<0||Je.includes("bottom")&&De>0)&&(Qt.y=De):$==="x"&&(Je.includes("left")||Je.includes("right"))&&(Je.includes("left")&&ct<0||Je.includes("right")&&ct>0)&&(Qt.x=ct),(Math.abs(Qt.x)>0||Math.abs(Qt.y)>0)&&zt(!0),(Ie=Ge.current)==null||Ie.style.setProperty("--swipe-amount-x",`${Qt.x}px`),(Me=Ge.current)==null||Me.style.setProperty("--swipe-amount-y",`${Qt.y}px`)}},rs&&!h.jsx?N.createElement("button",{"aria-label":Z,"data-disabled":X,"data-close-button":!0,onClick:X||!qe?()=>{}:()=>{var U;ne(),(U=h.onDismiss)==null||U.call(h,h)},className:Lt(L==null?void 0:L.closeButton,(a=h==null?void 0:h.classNames)==null?void 0:a.closeButton)},(o=te==null?void 0:te.close)!=null?o:jm):null,h.jsx||x.isValidElement(h.title)?h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title:N.createElement(N.Fragment,null,Re||h.icon||h.promise?N.createElement("div",{"data-icon":"",className:Lt(L==null?void 0:L.icon,(i=h==null?void 0:h.classNames)==null?void 0:i.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||we():null,h.type!=="loading"?h.icon||(te==null?void 0:te[Re])||hm(Re):null):null,N.createElement("div",{"data-content":"",className:Lt(L==null?void 0:L.content,(l=h==null?void 0:h.classNames)==null?void 0:l.content)},N.createElement("div",{"data-title":"",className:Lt(L==null?void 0:L.title,(c=h==null?void 0:h.classNames)==null?void 0:c.title)},typeof h.title=="function"?h.title():h.title),h.description?N.createElement("div",{"data-description":"",className:Lt(P,bs,L==null?void 0:L.description,(d=h==null?void 0:h.classNames)==null?void 0:d.description)},typeof h.description=="function"?h.description():h.description):null),x.isValidElement(h.cancel)?h.cancel:h.cancel&&wr(h.cancel)?N.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||T,onClick:U=>{var ie,he;wr(h.cancel)&&qe&&((he=(ie=h.cancel).onClick)==null||he.call(ie,U),ne())},className:Lt(L==null?void 0:L.cancelButton,(u=h==null?void 0:h.classNames)==null?void 0:u.cancelButton)},h.cancel.label):null,x.isValidElement(h.action)?h.action:h.action&&wr(h.action)?N.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||R,onClick:U=>{var ie,he;wr(h.action)&&((he=(ie=h.action).onClick)==null||he.call(ie,U),!U.defaultPrevented&&ne())},className:Lt(L==null?void 0:L.actionButton,(m=h==null?void 0:h.classNames)==null?void 0:m.actionButton)},h.action.label):null))};function xi(){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 Fm(e,s){let n={};return[e,s].forEach((r,a)=>{let o=a===1,i=o?"--mobile-offset":"--offset",l=o?Om:Tm;function c(d){["top","right","bottom","left"].forEach(u=>{n[`${i}-${u}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${i}-${d}`]=l:n[`${i}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):c(l)}),n}var Wm=x.forwardRef(function(e,s){let{invert:n,position:r="bottom-right",hotkey:a=["altKey","KeyT"],expand:o,closeButton:i,className:l,offset:c,mobileOffset:d,theme:u="light",richColors:m,duration:f,style:h,visibleToasts:g=Em,toastOptions:v,dir:D=xi(),gap:b=Pm,loadingIcon:w,icons:j,containerAriaLabel:y="Notifications",pauseWhenPageIsHidden:C}=e,[p,_]=N.useState([]),I=N.useMemo(()=>Array.from(new Set([r].concat(p.filter(S=>S.position).map(S=>S.position)))),[p,r]),[W,T]=N.useState([]),[R,E]=N.useState(!1),[P,O]=N.useState(!1),[V,Y]=N.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=N.useRef(null),B=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),L=N.useRef(null),te=N.useRef(!1),Z=N.useCallback(S=>{_($=>{var Q;return(Q=$.find(F=>F.id===S.id))!=null&&Q.delete||jt.dismiss(S.id),$.filter(({id:F})=>F!==S.id)})},[]);return N.useEffect(()=>jt.subscribe(S=>{if(S.dismiss){_($=>$.map(Q=>Q.id===S.id?{...Q,delete:!0}:Q));return}setTimeout(()=>{Eu.flushSync(()=>{_($=>{let Q=$.findIndex(F=>F.id===S.id);return Q!==-1?[...$.slice(0,Q),{...$[Q],...S},...$.slice(Q+1)]:[S,...$]})})})}),[]),N.useEffect(()=>{if(u!=="system"){Y(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Y("dark"):Y("light")),typeof window>"u")return;let S=window.matchMedia("(prefers-color-scheme: dark)");try{S.addEventListener("change",({matches:$})=>{Y($?"dark":"light")})}catch{S.addListener(({matches:Q})=>{try{Y(Q?"dark":"light")}catch(F){console.error(F)}})}},[u]),N.useEffect(()=>{p.length<=1&&E(!1)},[p]),N.useEffect(()=>{let S=$=>{var Q,F;a.every(M=>$[M]||$.code===M)&&(E(!0),(Q=H.current)==null||Q.focus()),$.code==="Escape"&&(document.activeElement===H.current||(F=H.current)!=null&&F.contains(document.activeElement))&&E(!1)};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[a]),N.useEffect(()=>{if(H.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,te.current=!1)}},[H.current]),N.createElement("section",{ref:s,"aria-label":`${y} ${B}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},I.map((S,$)=>{var Q;let[F,M]=S.split("-");return p.length?N.createElement("ol",{key:S,dir:D==="auto"?xi():D,tabIndex:-1,ref:H,className:l,"data-sonner-toaster":!0,"data-theme":V,"data-y-position":F,"data-lifted":R&&p.length>1&&!o,"data-x-position":M,style:{"--front-toast-height":`${((Q=W[0])==null?void 0:Q.height)||0}px`,"--width":`${Am}px`,"--gap":`${b}px`,...h,...Fm(c,d)},onBlur:q=>{te.current&&!q.currentTarget.contains(q.relatedTarget)&&(te.current=!1,L.current&&(L.current.focus({preventScroll:!0}),L.current=null))},onFocus:q=>{q.target instanceof HTMLElement&&q.target.dataset.dismissible==="false"||te.current||(te.current=!0,L.current=q.relatedTarget)},onMouseEnter:()=>E(!0),onMouseMove:()=>E(!0),onMouseLeave:()=>{P||E(!1)},onDragEnd:()=>E(!1),onPointerDown:q=>{q.target instanceof HTMLElement&&q.target.dataset.dismissible==="false"||O(!0)},onPointerUp:()=>O(!1)},p.filter(q=>!q.position&&$===0||q.position===S).map((q,me)=>{var Ne,Ae;return N.createElement(zm,{key:q.id,icons:j,index:me,toast:q,defaultRichColors:m,duration:(Ne=v==null?void 0:v.duration)!=null?Ne:f,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:n,visibleToasts:g,closeButton:(Ae=v==null?void 0:v.closeButton)!=null?Ae:i,interacting:P,position:S,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:Z,toasts:p.filter(Xe=>Xe.position==q.position),heights:W.filter(Xe=>Xe.position==q.position),setHeights:T,expandByDefault:o,gap:b,loadingIcon:w,expanded:R,pauseWhenPageIsHidden:C,swipeDirections:e.swipeDirections})})):null}))}),Lm=(e,s,n,r,a,o,i,l)=>{let c=document.documentElement,d=["light","dark"];function u(h){(Array.isArray(e)?e:[e]).forEach(g=>{let v=g==="class",D=v&&o?a.map(b=>o[b]||b):a;v?(c.classList.remove(...D),c.classList.add(o&&o[h]?o[h]:h)):c.setAttribute(g,h)}),m(h)}function m(h){l&&d.includes(h)&&(c.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{}},pi=["light","dark"],Zl="(prefers-color-scheme: dark)",qm=typeof window>"u",uo=x.createContext(void 0),Bm={setTheme:e=>{},themes:[]},Um=()=>{var e;return(e=x.useContext(uo))!=null?e:Bm},Ym=e=>x.useContext(uo)?x.createElement(x.Fragment,null,e.children):x.createElement(Vm,{...e}),Hm=["light","dark"],Vm=({forcedTheme:e,disableTransitionOnChange:s=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:a="theme",themes:o=Hm,defaultTheme:i=n?"system":"light",attribute:l="data-theme",value:c,children:d,nonce:u,scriptProps:m})=>{let[f,h]=x.useState(()=>Gm(a,i)),[g,v]=x.useState(()=>f==="system"?ga():f),D=c?Object.values(c):o,b=x.useCallback(C=>{let p=C;if(!p)return;C==="system"&&n&&(p=ga());let _=c?c[p]:p,I=s?Qm(u):null,W=document.documentElement,T=R=>{R==="class"?(W.classList.remove(...D),_&&W.classList.add(_)):R.startsWith("data-")&&(_?W.setAttribute(R,_):W.removeAttribute(R))};if(Array.isArray(l)?l.forEach(T):T(l),r){let R=pi.includes(i)?i:null,E=pi.includes(p)?p:R;W.style.colorScheme=E}I==null||I()},[u]),w=x.useCallback(C=>{let p=typeof C=="function"?C(f):C;h(p);try{localStorage.setItem(a,p)}catch{}},[f]),j=x.useCallback(C=>{let p=ga(C);v(p),f==="system"&&n&&!e&&b("system")},[f,e]);x.useEffect(()=>{let C=window.matchMedia(Zl);return C.addListener(j),j(C),()=>C.removeListener(j)},[j]),x.useEffect(()=>{let C=p=>{p.key===a&&(p.newValue?h(p.newValue):w(i))};return window.addEventListener("storage",C),()=>window.removeEventListener("storage",C)},[w]),x.useEffect(()=>{b(e??f)},[e,f]);let y=x.useMemo(()=>({theme:f,setTheme:w,forcedTheme:e,resolvedTheme:f==="system"?g:f,themes:n?[...o,"system"]:o,systemTheme:n?g:void 0}),[f,w,e,g,n,o]);return x.createElement(uo.Provider,{value:y},x.createElement(Km,{forcedTheme:e,storageKey:a,attribute:l,enableSystem:n,enableColorScheme:r,defaultTheme:i,value:c,themes:o,nonce:u,scriptProps:m}),d)},Km=x.memo(({forcedTheme:e,storageKey:s,attribute:n,enableSystem:r,enableColorScheme:a,defaultTheme:o,value:i,themes:l,nonce:c,scriptProps:d})=>{let u=JSON.stringify([n,s,o,e,l,i,r,a]).slice(1,-1);return x.createElement("script",{...d,suppressHydrationWarning:!0,nonce:typeof window>"u"?c:"",dangerouslySetInnerHTML:{__html:`(${Lm.toString()})(${u})`}})}),Gm=(e,s)=>{if(qm)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||s},Qm=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)}},ga=e=>(e||(e=window.matchMedia(Zl)),e.matches?"dark":"light");function Xm({children:e}){return t.jsx(Ym,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,children:e})}const Jl=x.createContext(null),As="meridian_token",Nr="meridian_user",kr="meridian_workspace";function gi(e){try{const s=e.split(".")[1],n=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),r=JSON.parse(atob(n));return Array.isArray(r.roles)?r.roles:[]}catch{return[]}}function Zm({children:e}){const[s,n]=x.useState(()=>{try{const u=localStorage.getItem(Nr),m=localStorage.getItem(As);if(!u)return null;const f=JSON.parse(u);return f.roles=m?gi(m):[],f}catch{return null}}),[r,a]=x.useState(()=>{const u=localStorage.getItem(As),m=localStorage.getItem(Nr);return u&&!m?(localStorage.removeItem(As),null):u}),[o,i]=x.useState(()=>{try{const u=localStorage.getItem(kr);return u?JSON.parse(u):null}catch{return null}}),l=(u,m)=>{const f=gi(m),h={...u,roles:f};n(h),a(m),localStorage.setItem(As,m),localStorage.setItem(Nr,JSON.stringify(h))},c=()=>{const u=localStorage.getItem(As);u&&fetch("/auth/logout",{method:"POST",headers:{Authorization:`Bearer ${u}`,"Content-Type":"application/json"}}).catch(()=>{}),n(null),a(null),i(null),localStorage.removeItem(As),localStorage.removeItem(Nr),localStorage.removeItem(kr)};x.useEffect(()=>{const u=()=>{localStorage.getItem(As)&&c()};return window.addEventListener("meridian:unauthorized",u),()=>window.removeEventListener("meridian:unauthorized",u)},[]);const d=u=>{i(u),u?localStorage.setItem(kr,JSON.stringify(u)):localStorage.removeItem(kr)};return t.jsx(Jl.Provider,{value:{user:s,token:r,workspace:o,isAuthenticated:!!r&&!!s,login:l,logout:c,setWorkspace:d},children:e})}function Te(){const e=x.useContext(Jl);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}const ec=x.createContext(null);function Jm({children:e}){const[s,n]=x.useState(!1);return x.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(ec.Provider,{value:{open:s,setOpen:n,toggle:()=>n(r=>!r)},children:e})}function tc(){const e=x.useContext(ec);if(!e)throw new Error("useCommandPalette must be used within CommandPaletteProvider");return e}function sc(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=sc(e[s]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function nc(){for(var e,s,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(s=sc(e))&&(r&&(r+=" "),r+=s);return r}const mo="-",ef=e=>{const s=sf(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const l=i.split(mo);return l[0]===""&&l.length!==1&&l.shift(),rc(l,s)||tf(i)},getConflictingClassGroupIds:(i,l)=>{const c=n[i]||[];return l&&r[i]?[...c,...r[i]]:c}}},rc=(e,s)=>{var i;if(e.length===0)return s.classGroupId;const n=e[0],r=s.nextPart.get(n),a=r?rc(e.slice(1),r):void 0;if(a)return a;if(s.validators.length===0)return;const o=e.join(mo);return(i=s.validators.find(({validator:l})=>l(o)))==null?void 0:i.classGroupId},bi=/^\[(.+)\]$/,tf=e=>{if(bi.test(e)){const s=bi.exec(e)[1],n=s==null?void 0:s.substring(0,s.indexOf(":"));if(n)return"arbitrary.."+n}},sf=e=>{const{theme:s,prefix:n}=e,r={nextPart:new Map,validators:[]};return rf(Object.entries(e.classGroups),n).forEach(([o,i])=>{Ka(i,r,o,s)}),r},Ka=(e,s,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const o=a===""?s:yi(s,a);o.classGroupId=n;return}if(typeof a=="function"){if(nf(a)){Ka(a(r),s,n,r);return}s.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([o,i])=>{Ka(i,yi(s,o),n,r)})})},yi=(e,s)=>{let n=e;return s.split(mo).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},nf=e=>e.isThemeGetter,rf=(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,af=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)}}},ac="!",of=e=>{const{separator:s,experimentalParseClassName:n}=e,r=s.length===1,a=s[0],o=s.length,i=l=>{const c=[];let d=0,u=0,m;for(let D=0;D<l.length;D++){let b=l[D];if(d===0){if(b===a&&(r||l.slice(D,D+o)===s)){c.push(l.slice(u,D)),u=D+o;continue}if(b==="/"){m=D;continue}}b==="["?d++:b==="]"&&d--}const f=c.length===0?l:l.substring(u),h=f.startsWith(ac),g=h?f.substring(1):f,v=m&&m>u?m-u:void 0;return{modifiers:c,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:v}};return n?l=>n({className:l,parseClassName:i}):i},lf=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},cf=e=>({cache:af(e.cacheSize),parseClassName:of(e),...ef(e)}),df=/\s+/,uf=(e,s)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=s,o=[],i=e.trim().split(df);let l="";for(let c=i.length-1;c>=0;c-=1){const d=i[c],{modifiers:u,hasImportantModifier:m,baseClassName:f,maybePostfixModifierPosition:h}=n(d);let g=!!h,v=r(g?f.substring(0,h):f);if(!v){if(!g){l=d+(l.length>0?" "+l:l);continue}if(v=r(f),!v){l=d+(l.length>0?" "+l:l);continue}g=!1}const D=lf(u).join(":"),b=m?D+ac:D,w=b+v;if(o.includes(w))continue;o.push(w);const j=a(v,g);for(let y=0;y<j.length;++y){const C=j[y];o.push(b+C)}l=d+(l.length>0?" "+l:l)}return l};function mf(){let e=0,s,n,r="";for(;e<arguments.length;)(s=arguments[e++])&&(n=oc(s))&&(r&&(r+=" "),r+=n);return r}const oc=e=>{if(typeof e=="string")return e;let s,n="";for(let r=0;r<e.length;r++)e[r]&&(s=oc(e[r]))&&(n&&(n+=" "),n+=s);return n};function ff(e,...s){let n,r,a,o=i;function i(c){const d=s.reduce((u,m)=>m(u),e());return n=cf(d),r=n.cache.get,a=n.cache.set,o=l,l(c)}function l(c){const d=r(c);if(d)return d;const u=uf(c,n);return a(c,u),u}return function(){return o(mf.apply(null,arguments))}}const Oe=e=>{const s=n=>n[e]||[];return s.isThemeGetter=!0,s},ic=/^\[(?:([a-z-]+):)?(.+)\]$/i,hf=/^\d+\/\d+$/,xf=new Set(["px","full","screen"]),pf=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,gf=/\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$/,bf=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,yf=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,vf=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ls=e=>un(e)||xf.has(e)||hf.test(e),ys=e=>wn(e,"length",Df),un=e=>!!e&&!Number.isNaN(Number(e)),ba=e=>wn(e,"number",un),An=e=>!!e&&Number.isInteger(Number(e)),jf=e=>e.endsWith("%")&&un(e.slice(0,-1)),ge=e=>ic.test(e),vs=e=>pf.test(e),wf=new Set(["length","size","percentage"]),Nf=e=>wn(e,wf,lc),kf=e=>wn(e,"position",lc),Sf=new Set(["image","url"]),Cf=e=>wn(e,Sf,Ef),Mf=e=>wn(e,"",_f),Pn=()=>!0,wn=(e,s,n)=>{const r=ic.exec(e);return r?r[1]?typeof s=="string"?r[1]===s:s.has(r[1]):n(r[2]):!1},Df=e=>gf.test(e)&&!bf.test(e),lc=()=>!1,_f=e=>yf.test(e),Ef=e=>vf.test(e),Tf=()=>{const e=Oe("colors"),s=Oe("spacing"),n=Oe("blur"),r=Oe("brightness"),a=Oe("borderColor"),o=Oe("borderRadius"),i=Oe("borderSpacing"),l=Oe("borderWidth"),c=Oe("contrast"),d=Oe("grayscale"),u=Oe("hueRotate"),m=Oe("invert"),f=Oe("gap"),h=Oe("gradientColorStops"),g=Oe("gradientColorStopPositions"),v=Oe("inset"),D=Oe("margin"),b=Oe("opacity"),w=Oe("padding"),j=Oe("saturate"),y=Oe("scale"),C=Oe("sepia"),p=Oe("skew"),_=Oe("space"),I=Oe("translate"),W=()=>["auto","contain","none"],T=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto",ge,s],E=()=>[ge,s],P=()=>["",ls,ys],O=()=>["auto",un,ge],V=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Y=()=>["solid","dashed","dotted","double","none"],H=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],B=()=>["start","end","center","between","around","evenly","stretch"],L=()=>["","0",ge],te=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Z=()=>[un,ge];return{cacheSize:500,separator:":",theme:{colors:[Pn],spacing:[ls,ys],blur:["none","",vs,ge],brightness:Z(),borderColor:[e],borderRadius:["none","","full",vs,ge],borderSpacing:E(),borderWidth:P(),contrast:Z(),grayscale:L(),hueRotate:Z(),invert:L(),gap:E(),gradientColorStops:[e],gradientColorStopPositions:[jf,ys],inset:R(),margin:R(),opacity:Z(),padding:E(),saturate:Z(),scale:Z(),sepia:L(),skew:Z(),space:E(),translate:E()},classGroups:{aspect:[{aspect:["auto","square","video",ge]}],container:["container"],columns:[{columns:[vs]}],"break-after":[{"break-after":te()}],"break-before":[{"break-before":te()}],"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:[...V(),ge]}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:W()}],"overscroll-x":[{"overscroll-x":W()}],"overscroll-y":[{"overscroll-y":W()}],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",An,ge]}],basis:[{basis:R()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ge]}],grow:[{grow:L()}],shrink:[{shrink:L()}],order:[{order:["first","last","none",An,ge]}],"grid-cols":[{"grid-cols":[Pn]}],"col-start-end":[{col:["auto",{span:["full",An,ge]},ge]}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":[Pn]}],"row-start-end":[{row:["auto",{span:[An,ge]},ge]}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ge]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ge]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...B()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...B(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...B(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[D]}],mx:[{mx:[D]}],my:[{my:[D]}],ms:[{ms:[D]}],me:[{me:[D]}],mt:[{mt:[D]}],mr:[{mr:[D]}],mb:[{mb:[D]}],ml:[{ml:[D]}],"space-x":[{"space-x":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ge,s]}],"min-w":[{"min-w":[ge,s,"min","max","fit"]}],"max-w":[{"max-w":[ge,s,"none","full","min","max","fit","prose",{screen:[vs]},vs]}],h:[{h:[ge,s,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ge,s,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ge,s,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ge,s,"auto","min","max","fit"]}],"font-size":[{text:["base",vs,ys]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ba]}],"font-family":[{font:[Pn]}],"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",ge]}],"line-clamp":[{"line-clamp":["none",un,ba]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ls,ge]}],"list-image":[{"list-image":["none",ge]}],"list-style-type":[{list:["none","disc","decimal",ge]}],"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:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ls,ys]}],"underline-offset":[{"underline-offset":["auto",ls,ge]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ge]}],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",ge]}],"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:[...V(),kf]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Nf]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Cf]}],"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:[...Y(),"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:Y()}],"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:["",...Y()]}],"outline-offset":[{"outline-offset":[ls,ge]}],"outline-w":[{outline:[ls,ys]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:P()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[ls,ys]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",vs,Mf]}],"shadow-color":[{shadow:[Pn]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...H(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":H()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",vs,ge]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[m]}],saturate:[{saturate:[j]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[j]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"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",ge]}],duration:[{duration:Z()}],ease:[{ease:["linear","in","out","in-out",ge]}],delay:[{delay:Z()}],animate:[{animate:["none","spin","ping","pulse","bounce",ge]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[y]}],"scale-x":[{"scale-x":[y]}],"scale-y":[{"scale-y":[y]}],rotate:[{rotate:[An,ge]}],"translate-x":[{"translate-x":[I]}],"translate-y":[{"translate-y":[I]}],"skew-x":[{"skew-x":[p]}],"skew-y":[{"skew-y":[p]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ge]}],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",ge]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ge]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ls,ys,ba]}],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"]}}},Of=ff(Tf);function A(...e){return Of(nc(e))}const fo=Ru,Ls=Au,qs=Pu,ks=x.forwardRef(({className:e,sideOffset:s=4,...n},r)=>t.jsx(hl,{ref:r,sideOffset:s,className:A("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}));ks.displayName=hl.displayName;const cc=x.createContext([]);function Af({widgets:e,children:s}){return N.createElement(cc.Provider,{value:e},s)}function Pf(e){return x.useContext(cc).filter(n=>n.zone===e).map(n=>n.component)}var dl;const dc=((dl=window.__MERIDIAN_CONFIG__)==null?void 0:dl.apiUrl)??void 0??"";class ho extends Error{constructor(s,n,r){super(n),this.status=s,this.data=r,this.name="ApiError"}}function uc(){return localStorage.getItem("meridian_token")}async function Rn(e,s={}){var o;const n=uc(),r={"Content-Type":"application/json",...s.headers};n&&(r.Authorization=`Bearer ${n}`);const a=await fetch(`${dc}${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 a.status===401&&window.dispatchEvent(new CustomEvent("meridian:unauthorized")),new ho(a.status,l,i)}if(a.status!==204)return a.json()}const se={get:e=>Rn(e,{method:"GET"}),post:(e,s)=>Rn(e,{method:"POST",body:JSON.stringify(s)}),put:(e,s)=>Rn(e,{method:"PUT",body:JSON.stringify(s)}),patch:(e,s)=>Rn(e,{method:"PATCH",body:JSON.stringify(s)}),delete:e=>Rn(e,{method:"DELETE"}),upload:async(e,s)=>{var o;const n=uc(),r={};n&&(r.Authorization=`Bearer ${n}`);const a=await fetch(`${dc}${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 a.status===401&&window.dispatchEvent(new CustomEvent("meridian:unauthorized")),new ho(a.status,l,i)}if(a.status!==204)return a.json()}},Le={all:["issues"],byProject:e=>[...Le.all,"project",e],detail:e=>[...Le.all,e],comments:e=>[...Le.all,e,"comments"],activities:e=>[...Le.all,e,"activities"]};function nr(e){return Ee({queryKey:e?Le.byProject(e):Le.all,queryFn:()=>{const s=e?`/admin/issues?project_id=${e}`:"/admin/issues";return se.get(s)},select:s=>s.issues})}function mc(e){return Ee({queryKey:Le.detail(e),queryFn:()=>se.get(`/admin/issues/${e}`),select:s=>s.issue,enabled:!!e})}function Rf(e){return Ee({queryKey:Le.comments(e),queryFn:()=>se.get(`/admin/issues/${e}/comments`),select:s=>s.comments,enabled:!!e})}function fc(){const e=pe();return xe({mutationFn:s=>se.post("/admin/issues",s),onSuccess:(s,n)=>{e.invalidateQueries({queryKey:Le.byProject(n.project_id)})}})}function qr(e,s){const n=pe();return xe({mutationFn:r=>se.put(`/admin/issues/${e}`,r),onMutate:async r=>{await n.cancelQueries({queryKey:Le.byProject(s)});const a=n.getQueryData(Le.byProject(s));return n.setQueryData(Le.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(Le.byProject(s),o.previous)},onSettled:()=>{n.invalidateQueries({queryKey:Le.byProject(s)}),n.invalidateQueries({queryKey:Le.detail(e)})}})}function If(e){return Ee({queryKey:Le.activities(e),queryFn:()=>se.get(`/admin/issues/${e}/activities`),select:s=>s.activities,enabled:!!e})}function $f(e){const s=pe();return xe({mutationFn:n=>se.post(`/admin/issues/${e}/comments`,{body:n}),onSuccess:()=>{s.invalidateQueries({queryKey:Le.comments(e)})}})}const vi=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ji=nc,rr=(e,s)=>n=>{var r;if((s==null?void 0:s.variants)==null)return ji(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:o}=s,i=Object.keys(a).map(d=>{const u=n==null?void 0:n[d],m=o==null?void 0:o[d];if(u===null)return null;const f=vi(u)||vi(m);return a[d][f]}),l=n&&Object.entries(n).reduce((d,u)=>{let[m,f]=u;return f===void 0||(d[m]=f),d},{}),c=s==null||(r=s.compoundVariants)===null||r===void 0?void 0:r.reduce((d,u)=>{let{class:m,className:f,...h}=u;return Object.entries(h).every(g=>{let[v,D]=g;return Array.isArray(D)?D.includes({...o,...l}[v]):{...o,...l}[v]===D})?[...d,m,f]:d},[]);return ji(e,i,c,n==null?void 0:n.class,n==null?void 0:n.className)},mn=rr("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",indigo:"bg-indigo text-indigo-foreground hover:opacity-90"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9","icon-sm":"h-7 w-7"}},defaultVariants:{variant:"default",size:"default"}}),J=x.forwardRef(({className:e,variant:s,size:n,asChild:r=!1,...a},o)=>{const i=r?oo:"button";return t.jsx(i,{className:A(mn({variant:s,size:n,className:e})),ref:o,...a})});J.displayName="Button";const ve=x.forwardRef(({className:e,type:s,...n},r)=>t.jsx("input",{type:s,className:A("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}));ve.displayName="Input";/**
|
|
4
|
-
* @license lucide-react v0.468.0 - ISC
|
|
5
|
-
*
|
|
6
|
-
* This source code is licensed under the ISC license.
|
|
7
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
8
|
-
*/const zf=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),hc=(...e)=>e.filter((s,n,r)=>!!s&&s.trim()!==""&&r.indexOf(s)===n).join(" ").trim();/**
|
|
9
|
-
* @license lucide-react v0.468.0 - ISC
|
|
10
|
-
*
|
|
11
|
-
* This source code is licensed under the ISC license.
|
|
12
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
13
|
-
*/var Ff={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
14
|
-
* @license lucide-react v0.468.0 - ISC
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the ISC license.
|
|
17
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/const Wf=x.forwardRef(({color:e="currentColor",size:s=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:o,iconNode:i,...l},c)=>x.createElement("svg",{ref:c,...Ff,width:s,height:s,stroke:e,strokeWidth:r?Number(n)*24/Number(s):n,className:hc("lucide",a),...l},[...i.map(([d,u])=>x.createElement(d,u)),...Array.isArray(o)?o:[o]]));/**
|
|
19
|
-
* @license lucide-react v0.468.0 - ISC
|
|
20
|
-
*
|
|
21
|
-
* This source code is licensed under the ISC license.
|
|
22
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
23
|
-
*/const G=(e,s)=>{const n=x.forwardRef(({className:r,...a},o)=>x.createElement(Wf,{ref:o,iconNode:s,className:hc(`lucide-${zf(e)}`,r),...a}));return n.displayName=`${e}`,n};/**
|
|
24
|
-
* @license lucide-react v0.468.0 - ISC
|
|
25
|
-
*
|
|
26
|
-
* This source code is licensed under the ISC license.
|
|
27
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
28
|
-
*/const Br=G("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
|
29
|
-
* @license lucide-react v0.468.0 - ISC
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the ISC license.
|
|
32
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/const xo=G("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
34
|
-
* @license lucide-react v0.468.0 - ISC
|
|
35
|
-
*
|
|
36
|
-
* This source code is licensed under the ISC license.
|
|
37
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
38
|
-
*/const Ur=G("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
39
|
-
* @license lucide-react v0.468.0 - ISC
|
|
40
|
-
*
|
|
41
|
-
* This source code is licensed under the ISC license.
|
|
42
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
43
|
-
*/const pn=G("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"}]]);/**
|
|
44
|
-
* @license lucide-react v0.468.0 - ISC
|
|
45
|
-
*
|
|
46
|
-
* This source code is licensed under the ISC license.
|
|
47
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
48
|
-
*/const xc=G("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"}]]);/**
|
|
49
|
-
* @license lucide-react v0.468.0 - ISC
|
|
50
|
-
*
|
|
51
|
-
* This source code is licensed under the ISC license.
|
|
52
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
53
|
-
*/const pc=G("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"}]]);/**
|
|
54
|
-
* @license lucide-react v0.468.0 - ISC
|
|
55
|
-
*
|
|
56
|
-
* This source code is licensed under the ISC license.
|
|
57
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
58
|
-
*/const Lf=G("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"}]]);/**
|
|
59
|
-
* @license lucide-react v0.468.0 - ISC
|
|
60
|
-
*
|
|
61
|
-
* This source code is licensed under the ISC license.
|
|
62
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
63
|
-
*/const po=G("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"}]]);/**
|
|
64
|
-
* @license lucide-react v0.468.0 - ISC
|
|
65
|
-
*
|
|
66
|
-
* This source code is licensed under the ISC license.
|
|
67
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
68
|
-
*/const Ht=G("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"}]]);/**
|
|
69
|
-
* @license lucide-react v0.468.0 - ISC
|
|
70
|
-
*
|
|
71
|
-
* This source code is licensed under the ISC license.
|
|
72
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
73
|
-
*/const qf=G("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]);/**
|
|
74
|
-
* @license lucide-react v0.468.0 - ISC
|
|
75
|
-
*
|
|
76
|
-
* This source code is licensed under the ISC license.
|
|
77
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
78
|
-
*/const Pt=G("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
79
|
-
* @license lucide-react v0.468.0 - ISC
|
|
80
|
-
*
|
|
81
|
-
* This source code is licensed under the ISC license.
|
|
82
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
83
|
-
*/const Nn=G("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
84
|
-
* @license lucide-react v0.468.0 - ISC
|
|
85
|
-
*
|
|
86
|
-
* This source code is licensed under the ISC license.
|
|
87
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
88
|
-
*/const go=G("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
89
|
-
* @license lucide-react v0.468.0 - ISC
|
|
90
|
-
*
|
|
91
|
-
* This source code is licensed under the ISC license.
|
|
92
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
93
|
-
*/const kn=G("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
94
|
-
* @license lucide-react v0.468.0 - ISC
|
|
95
|
-
*
|
|
96
|
-
* This source code is licensed under the ISC license.
|
|
97
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
98
|
-
*/const bo=G("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
99
|
-
* @license lucide-react v0.468.0 - ISC
|
|
100
|
-
*
|
|
101
|
-
* This source code is licensed under the ISC license.
|
|
102
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
103
|
-
*/const gc=G("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
|
|
104
|
-
* @license lucide-react v0.468.0 - ISC
|
|
105
|
-
*
|
|
106
|
-
* This source code is licensed under the ISC license.
|
|
107
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
108
|
-
*/const Bf=G("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
109
|
-
* @license lucide-react v0.468.0 - ISC
|
|
110
|
-
*
|
|
111
|
-
* This source code is licensed under the ISC license.
|
|
112
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
113
|
-
*/const Zs=G("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
114
|
-
* @license lucide-react v0.468.0 - ISC
|
|
115
|
-
*
|
|
116
|
-
* This source code is licensed under the ISC license.
|
|
117
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
118
|
-
*/const bc=G("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"}]]);/**
|
|
119
|
-
* @license lucide-react v0.468.0 - ISC
|
|
120
|
-
*
|
|
121
|
-
* This source code is licensed under the ISC license.
|
|
122
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
123
|
-
*/const yc=G("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"}]]);/**
|
|
124
|
-
* @license lucide-react v0.468.0 - ISC
|
|
125
|
-
*
|
|
126
|
-
* This source code is licensed under the ISC license.
|
|
127
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
128
|
-
*/const ts=G("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
129
|
-
* @license lucide-react v0.468.0 - ISC
|
|
130
|
-
*
|
|
131
|
-
* This source code is licensed under the ISC license.
|
|
132
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
133
|
-
*/const Uf=G("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"}]]);/**
|
|
134
|
-
* @license lucide-react v0.468.0 - ISC
|
|
135
|
-
*
|
|
136
|
-
* This source code is licensed under the ISC license.
|
|
137
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
138
|
-
*/const _s=G("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
139
|
-
* @license lucide-react v0.468.0 - ISC
|
|
140
|
-
*
|
|
141
|
-
* This source code is licensed under the ISC license.
|
|
142
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
143
|
-
*/const vc=G("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"}]]);/**
|
|
144
|
-
* @license lucide-react v0.468.0 - ISC
|
|
145
|
-
*
|
|
146
|
-
* This source code is licensed under the ISC license.
|
|
147
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
148
|
-
*/const jc=G("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
|
|
149
|
-
* @license lucide-react v0.468.0 - ISC
|
|
150
|
-
*
|
|
151
|
-
* This source code is licensed under the ISC license.
|
|
152
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
153
|
-
*/const Yf=G("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"}]]);/**
|
|
154
|
-
* @license lucide-react v0.468.0 - ISC
|
|
155
|
-
*
|
|
156
|
-
* This source code is licensed under the ISC license.
|
|
157
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
158
|
-
*/const Hf=G("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
|
|
159
|
-
* @license lucide-react v0.468.0 - ISC
|
|
160
|
-
*
|
|
161
|
-
* This source code is licensed under the ISC license.
|
|
162
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
163
|
-
*/const yo=G("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"}]]);/**
|
|
164
|
-
* @license lucide-react v0.468.0 - ISC
|
|
165
|
-
*
|
|
166
|
-
* This source code is licensed under the ISC license.
|
|
167
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
168
|
-
*/const ar=G("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"}]]);/**
|
|
169
|
-
* @license lucide-react v0.468.0 - ISC
|
|
170
|
-
*
|
|
171
|
-
* This source code is licensed under the ISC license.
|
|
172
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
173
|
-
*/const wc=G("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"}]]);/**
|
|
174
|
-
* @license lucide-react v0.468.0 - ISC
|
|
175
|
-
*
|
|
176
|
-
* This source code is licensed under the ISC license.
|
|
177
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
178
|
-
*/const vo=G("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"}]]);/**
|
|
179
|
-
* @license lucide-react v0.468.0 - ISC
|
|
180
|
-
*
|
|
181
|
-
* This source code is licensed under the ISC license.
|
|
182
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
183
|
-
*/const or=G("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"}]]);/**
|
|
184
|
-
* @license lucide-react v0.468.0 - ISC
|
|
185
|
-
*
|
|
186
|
-
* This source code is licensed under the ISC license.
|
|
187
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
188
|
-
*/const Vf=G("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"}]]);/**
|
|
189
|
-
* @license lucide-react v0.468.0 - ISC
|
|
190
|
-
*
|
|
191
|
-
* This source code is licensed under the ISC license.
|
|
192
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
193
|
-
*/const Kf=G("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"}]]);/**
|
|
194
|
-
* @license lucide-react v0.468.0 - ISC
|
|
195
|
-
*
|
|
196
|
-
* This source code is licensed under the ISC license.
|
|
197
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
198
|
-
*/const Gf=G("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"}]]);/**
|
|
199
|
-
* @license lucide-react v0.468.0 - ISC
|
|
200
|
-
*
|
|
201
|
-
* This source code is licensed under the ISC license.
|
|
202
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
203
|
-
*/const Qf=G("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"}]]);/**
|
|
204
|
-
* @license lucide-react v0.468.0 - ISC
|
|
205
|
-
*
|
|
206
|
-
* This source code is licensed under the ISC license.
|
|
207
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
208
|
-
*/const Xf=G("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"}]]);/**
|
|
209
|
-
* @license lucide-react v0.468.0 - ISC
|
|
210
|
-
*
|
|
211
|
-
* This source code is licensed under the ISC license.
|
|
212
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
213
|
-
*/const jo=G("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"}]]);/**
|
|
214
|
-
* @license lucide-react v0.468.0 - ISC
|
|
215
|
-
*
|
|
216
|
-
* This source code is licensed under the ISC license.
|
|
217
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
218
|
-
*/const Sn=G("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"}]]);/**
|
|
219
|
-
* @license lucide-react v0.468.0 - ISC
|
|
220
|
-
*
|
|
221
|
-
* This source code is licensed under the ISC license.
|
|
222
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
223
|
-
*/const Nc=G("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"}]]);/**
|
|
224
|
-
* @license lucide-react v0.468.0 - ISC
|
|
225
|
-
*
|
|
226
|
-
* This source code is licensed under the ISC license.
|
|
227
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
228
|
-
*/const Zf=G("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"}]]);/**
|
|
229
|
-
* @license lucide-react v0.468.0 - ISC
|
|
230
|
-
*
|
|
231
|
-
* This source code is licensed under the ISC license.
|
|
232
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
233
|
-
*/const Jf=G("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"}]]);/**
|
|
234
|
-
* @license lucide-react v0.468.0 - ISC
|
|
235
|
-
*
|
|
236
|
-
* This source code is licensed under the ISC license.
|
|
237
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
238
|
-
*/const eh=G("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"}]]);/**
|
|
239
|
-
* @license lucide-react v0.468.0 - ISC
|
|
240
|
-
*
|
|
241
|
-
* This source code is licensed under the ISC license.
|
|
242
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
243
|
-
*/const kc=G("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"}]]);/**
|
|
244
|
-
* @license lucide-react v0.468.0 - ISC
|
|
245
|
-
*
|
|
246
|
-
* This source code is licensed under the ISC license.
|
|
247
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
248
|
-
*/const Vt=G("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"}]]);/**
|
|
249
|
-
* @license lucide-react v0.468.0 - ISC
|
|
250
|
-
*
|
|
251
|
-
* This source code is licensed under the ISC license.
|
|
252
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
253
|
-
*/const Ir=G("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"}]]);/**
|
|
254
|
-
* @license lucide-react v0.468.0 - ISC
|
|
255
|
-
*
|
|
256
|
-
* This source code is licensed under the ISC license.
|
|
257
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
258
|
-
*/const wo=G("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"}]]);/**
|
|
259
|
-
* @license lucide-react v0.468.0 - ISC
|
|
260
|
-
*
|
|
261
|
-
* This source code is licensed under the ISC license.
|
|
262
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
263
|
-
*/const th=G("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"}]]);/**
|
|
264
|
-
* @license lucide-react v0.468.0 - ISC
|
|
265
|
-
*
|
|
266
|
-
* This source code is licensed under the ISC license.
|
|
267
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
268
|
-
*/const Sc=G("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"}]]);/**
|
|
269
|
-
* @license lucide-react v0.468.0 - ISC
|
|
270
|
-
*
|
|
271
|
-
* This source code is licensed under the ISC license.
|
|
272
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
273
|
-
*/const Bs=G("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"}]]);/**
|
|
274
|
-
* @license lucide-react v0.468.0 - ISC
|
|
275
|
-
*
|
|
276
|
-
* This source code is licensed under the ISC license.
|
|
277
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
278
|
-
*/const Cc=G("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"}]]);/**
|
|
279
|
-
* @license lucide-react v0.468.0 - ISC
|
|
280
|
-
*
|
|
281
|
-
* This source code is licensed under the ISC license.
|
|
282
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
283
|
-
*/const Yr=G("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"}]]);/**
|
|
284
|
-
* @license lucide-react v0.468.0 - ISC
|
|
285
|
-
*
|
|
286
|
-
* This source code is licensed under the ISC license.
|
|
287
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
288
|
-
*/const sh=G("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"}]]);/**
|
|
289
|
-
* @license lucide-react v0.468.0 - ISC
|
|
290
|
-
*
|
|
291
|
-
* This source code is licensed under the ISC license.
|
|
292
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
293
|
-
*/const nh=G("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
294
|
-
* @license lucide-react v0.468.0 - ISC
|
|
295
|
-
*
|
|
296
|
-
* This source code is licensed under the ISC license.
|
|
297
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
298
|
-
*/const Mc=G("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
|
|
299
|
-
* @license lucide-react v0.468.0 - ISC
|
|
300
|
-
*
|
|
301
|
-
* This source code is licensed under the ISC license.
|
|
302
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
303
|
-
*/const ir=G("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
|
|
304
|
-
* @license lucide-react v0.468.0 - ISC
|
|
305
|
-
*
|
|
306
|
-
* This source code is licensed under the ISC license.
|
|
307
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
308
|
-
*/const rh=G("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
309
|
-
* @license lucide-react v0.468.0 - ISC
|
|
310
|
-
*
|
|
311
|
-
* This source code is licensed under the ISC license.
|
|
312
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
313
|
-
*/const ah=G("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
|
|
314
|
-
* @license lucide-react v0.468.0 - ISC
|
|
315
|
-
*
|
|
316
|
-
* This source code is licensed under the ISC license.
|
|
317
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
318
|
-
*/const oh=G("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
|
|
319
|
-
* @license lucide-react v0.468.0 - ISC
|
|
320
|
-
*
|
|
321
|
-
* This source code is licensed under the ISC license.
|
|
322
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
323
|
-
*/const No=G("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"}]]);/**
|
|
324
|
-
* @license lucide-react v0.468.0 - ISC
|
|
325
|
-
*
|
|
326
|
-
* This source code is licensed under the ISC license.
|
|
327
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
328
|
-
*/const Gn=G("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"}]]);/**
|
|
329
|
-
* @license lucide-react v0.468.0 - ISC
|
|
330
|
-
*
|
|
331
|
-
* This source code is licensed under the ISC license.
|
|
332
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
333
|
-
*/const Hr=G("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
334
|
-
* @license lucide-react v0.468.0 - ISC
|
|
335
|
-
*
|
|
336
|
-
* This source code is licensed under the ISC license.
|
|
337
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
338
|
-
*/const Be=G("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
339
|
-
* @license lucide-react v0.468.0 - ISC
|
|
340
|
-
*
|
|
341
|
-
* This source code is licensed under the ISC license.
|
|
342
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
343
|
-
*/const ih=G("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"}]]);/**
|
|
344
|
-
* @license lucide-react v0.468.0 - ISC
|
|
345
|
-
*
|
|
346
|
-
* This source code is licensed under the ISC license.
|
|
347
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
348
|
-
*/const lh=G("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"}]]);/**
|
|
349
|
-
* @license lucide-react v0.468.0 - ISC
|
|
350
|
-
*
|
|
351
|
-
* This source code is licensed under the ISC license.
|
|
352
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
353
|
-
*/const Vr=G("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
354
|
-
* @license lucide-react v0.468.0 - ISC
|
|
355
|
-
*
|
|
356
|
-
* This source code is licensed under the ISC license.
|
|
357
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
358
|
-
*/const ch=G("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"}]]);/**
|
|
359
|
-
* @license lucide-react v0.468.0 - ISC
|
|
360
|
-
*
|
|
361
|
-
* This source code is licensed under the ISC license.
|
|
362
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
363
|
-
*/const ko=G("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"}]]);/**
|
|
364
|
-
* @license lucide-react v0.468.0 - ISC
|
|
365
|
-
*
|
|
366
|
-
* This source code is licensed under the ISC license.
|
|
367
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
368
|
-
*/const dh=G("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"}]]);/**
|
|
369
|
-
* @license lucide-react v0.468.0 - ISC
|
|
370
|
-
*
|
|
371
|
-
* This source code is licensed under the ISC license.
|
|
372
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
373
|
-
*/const Ga=G("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
|
|
374
|
-
* @license lucide-react v0.468.0 - ISC
|
|
375
|
-
*
|
|
376
|
-
* This source code is licensed under the ISC license.
|
|
377
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
378
|
-
*/const Dc=G("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"}]]);/**
|
|
379
|
-
* @license lucide-react v0.468.0 - ISC
|
|
380
|
-
*
|
|
381
|
-
* This source code is licensed under the ISC license.
|
|
382
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
383
|
-
*/const _c=G("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"}]]);/**
|
|
384
|
-
* @license lucide-react v0.468.0 - ISC
|
|
385
|
-
*
|
|
386
|
-
* This source code is licensed under the ISC license.
|
|
387
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
388
|
-
*/const uh=G("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
389
|
-
* @license lucide-react v0.468.0 - ISC
|
|
390
|
-
*
|
|
391
|
-
* This source code is licensed under the ISC license.
|
|
392
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
393
|
-
*/const Ec=G("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"}]]);/**
|
|
394
|
-
* @license lucide-react v0.468.0 - ISC
|
|
395
|
-
*
|
|
396
|
-
* This source code is licensed under the ISC license.
|
|
397
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
398
|
-
*/const mh=G("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"}]]);/**
|
|
399
|
-
* @license lucide-react v0.468.0 - ISC
|
|
400
|
-
*
|
|
401
|
-
* This source code is licensed under the ISC license.
|
|
402
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
403
|
-
*/const fh=G("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"}]]);/**
|
|
404
|
-
* @license lucide-react v0.468.0 - ISC
|
|
405
|
-
*
|
|
406
|
-
* This source code is licensed under the ISC license.
|
|
407
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
408
|
-
*/const hh=G("ThumbsUp",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]);/**
|
|
409
|
-
* @license lucide-react v0.468.0 - ISC
|
|
410
|
-
*
|
|
411
|
-
* This source code is licensed under the ISC license.
|
|
412
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
413
|
-
*/const xh=G("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"}]]);/**
|
|
414
|
-
* @license lucide-react v0.468.0 - ISC
|
|
415
|
-
*
|
|
416
|
-
* This source code is licensed under the ISC license.
|
|
417
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
418
|
-
*/const xs=G("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"}]]);/**
|
|
419
|
-
* @license lucide-react v0.468.0 - ISC
|
|
420
|
-
*
|
|
421
|
-
* This source code is licensed under the ISC license.
|
|
422
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
423
|
-
*/const ph=G("Underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);/**
|
|
424
|
-
* @license lucide-react v0.468.0 - ISC
|
|
425
|
-
*
|
|
426
|
-
* This source code is licensed under the ISC license.
|
|
427
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
428
|
-
*/const gh=G("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"}]]);/**
|
|
429
|
-
* @license lucide-react v0.468.0 - ISC
|
|
430
|
-
*
|
|
431
|
-
* This source code is licensed under the ISC license.
|
|
432
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
433
|
-
*/const bh=G("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"}]]);/**
|
|
434
|
-
* @license lucide-react v0.468.0 - ISC
|
|
435
|
-
*
|
|
436
|
-
* This source code is licensed under the ISC license.
|
|
437
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
438
|
-
*/const yh=G("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"}]]);/**
|
|
439
|
-
* @license lucide-react v0.468.0 - ISC
|
|
440
|
-
*
|
|
441
|
-
* This source code is licensed under the ISC license.
|
|
442
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
443
|
-
*/const lr=G("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"}]]);/**
|
|
444
|
-
* @license lucide-react v0.468.0 - ISC
|
|
445
|
-
*
|
|
446
|
-
* This source code is licensed under the ISC license.
|
|
447
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
448
|
-
*/const vh=G("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
|
|
449
|
-
* @license lucide-react v0.468.0 - ISC
|
|
450
|
-
*
|
|
451
|
-
* This source code is licensed under the ISC license.
|
|
452
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
453
|
-
*/const Hs=G("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"}]]);/**
|
|
454
|
-
* @license lucide-react v0.468.0 - ISC
|
|
455
|
-
*
|
|
456
|
-
* This source code is licensed under the ISC license.
|
|
457
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
458
|
-
*/const jh=G("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"}]]);/**
|
|
459
|
-
* @license lucide-react v0.468.0 - ISC
|
|
460
|
-
*
|
|
461
|
-
* This source code is licensed under the ISC license.
|
|
462
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
463
|
-
*/const Ve=G("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
464
|
-
* @license lucide-react v0.468.0 - ISC
|
|
465
|
-
*
|
|
466
|
-
* This source code is licensed under the ISC license.
|
|
467
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
468
|
-
*/const Cn=G("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function wh({issue:e}){const s=qr(e.id,e.project_id),[n,r]=x.useState(""),[a,o]=x.useState(""),[i,l]=x.useState(!1),c=e.metadata??{},d=Object.entries(c),u=()=>{if(!n.trim())return;const f={...c,[n.trim()]:a};s.mutate({metadata:f},{onSuccess:()=>{z.success("Metadata saved"),r(""),o(""),l(!1)},onError:()=>z.error("Failed to save metadata")})},m=f=>{const h={...c};delete h[f],s.mutate({metadata:Object.keys(h).length?h:null},{onSuccess:()=>z.success("Entry removed"),onError:()=>z.error("Failed to update metadata")})};return 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.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Hf,{className:"h-3.5 w-3.5 text-muted-foreground"}),t.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-widest",children:"Metadata"})]}),!i&&t.jsxs("button",{onClick:()=>l(!0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(Be,{className:"h-3.5 w-3.5"}),"Add field"]})]}),t.jsxs("div",{className:"px-5 py-3 space-y-2",children:[d.length===0&&!i&&t.jsx("p",{className:"text-xs text-muted-foreground/50 italic",children:"No metadata fields yet"}),d.map(([f,h])=>t.jsxs("div",{className:"flex items-center gap-2 group",children:[t.jsx("span",{className:"text-xs font-mono text-muted-foreground w-28 shrink-0 truncate",children:f}),t.jsx("span",{className:"text-xs text-foreground flex-1 truncate",children:String(h)}),t.jsx("button",{onClick:()=>m(f),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",children:t.jsx(xs,{className:"h-3 w-3"})})]},f)),i&&t.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[t.jsx(ve,{autoFocus:!0,placeholder:"key",value:n,onChange:f=>r(f.target.value),onKeyDown:f=>{f.key==="Enter"&&u(),f.key==="Escape"&&l(!1)},className:"h-7 text-xs font-mono w-28 shrink-0"}),t.jsx(ve,{placeholder:"value",value:a,onChange:f=>o(f.target.value),onKeyDown:f=>{f.key==="Enter"&&u(),f.key==="Escape"&&l(!1)},className:"h-7 text-xs flex-1"}),t.jsx(J,{size:"sm",className:"h-7 px-2 text-xs",onClick:u,disabled:!n.trim()||s.isPending,children:"Save"}),t.jsx(J,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs",onClick:()=>{l(!1),r(""),o("")},children:"Cancel"})]})]})]})}const Nh=[{zone:"issue.details.after",component:wh}];function Kr(e=!0){return Ee({queryKey:["workspaces"],queryFn:()=>se.get("/admin/workspaces"),select:s=>s.workspaces,enabled:e})}function kh(){const e=pe();return xe({mutationFn:s=>se.post("/admin/workspaces",s),onSuccess:()=>{e.invalidateQueries({queryKey:["workspaces"]})}})}function Sh(e){const s=pe();return xe({mutationFn:n=>se.put(`/admin/workspaces/${e}`,n),onSuccess:()=>{s.invalidateQueries({queryKey:["workspaces"]})}})}const So={list:e=>["workspaces",e,"invitations"]};function Ch(e){return Ee({queryKey:So.list(e),queryFn:()=>se.get(`/admin/workspaces/${e}/invitations`),select:s=>s.invitations,enabled:!!e})}function Mh(e){const s=pe();return xe({mutationFn:n=>se.post(`/admin/workspaces/${e}/invitations`,n),onSuccess:()=>{s.invalidateQueries({queryKey:So.list(e)})}})}function Dh(e){const s=pe();return xe({mutationFn:n=>se.delete(`/admin/workspaces/${e}/invitations/${n}`),onSuccess:()=>{s.invalidateQueries({queryKey:So.list(e)})}})}const Gr={list:e=>["workspaces",e,"members"]};function cr(e){return Ee({queryKey:Gr.list(e),queryFn:()=>se.get(`/admin/workspaces/${e}/members`),select:s=>s.members,enabled:!!e})}function _h(e){const s=pe();return xe({mutationFn:n=>se.post(`/admin/workspaces/${e}/members`,n),onSuccess:()=>{s.invalidateQueries({queryKey:Gr.list(e)})}})}function Eh(e){const s=pe();return xe({mutationFn:({userId:n,role:r})=>se.patch(`/admin/workspaces/${e}/members/${n}`,{role:r}),onSuccess:()=>{s.invalidateQueries({queryKey:Gr.list(e)})}})}function Th(e){const s=pe();return xe({mutationFn:n=>se.delete(`/admin/workspaces/${e}/members/${n}`),onSuccess:()=>{s.invalidateQueries({queryKey:Gr.list(e)})}})}const Ss={list:e=>["workspaces",e,"teams"],members:(e,s)=>["workspaces",e,"teams",s,"members"]};function Co(e){return Ee({queryKey:Ss.list(e),queryFn:()=>se.get(`/admin/workspaces/${e}/teams`),select:s=>s.teams,enabled:!!e})}function Oh(e){const s=pe();return xe({mutationFn:n=>se.post(`/admin/workspaces/${e}/teams`,n),onSuccess:()=>{s.invalidateQueries({queryKey:Ss.list(e)})}})}function Ah(e){const s=pe();return xe({mutationFn:n=>se.delete(`/admin/workspaces/${e}/teams/${n}`),onSuccess:()=>{s.invalidateQueries({queryKey:Ss.list(e)})}})}function Ph(e,s){return Ee({queryKey:Ss.members(e,s),queryFn:()=>se.get(`/admin/workspaces/${e}/teams/${s}/members`),select:n=>n.members,enabled:!!(e&&s)})}function Rh(e,s){const n=pe();return xe({mutationFn:r=>se.post(`/admin/workspaces/${e}/teams/${s}/members`,{user_id:r}),onSuccess:()=>{n.invalidateQueries({queryKey:Ss.members(e,s)}),n.invalidateQueries({queryKey:Ss.list(e)})}})}function Ih(e,s){const n=pe();return xe({mutationFn:r=>se.delete(`/admin/workspaces/${e}/teams/${s}/members/${r}`),onSuccess:()=>{n.invalidateQueries({queryKey:Ss.members(e,s)}),n.invalidateQueries({queryKey:Ss.list(e)})}})}function Tc(){return Ee({queryKey:["setup-status"],queryFn:()=>se.get("/auth/setup"),staleTime:6e4,retry:!1})}function $h(){const{login:e}=Te();return xe({mutationFn:s=>se.post("/auth/login",s),onSuccess:s=>{e(s.user,s.token)}})}function zh(){const{login:e}=Te();return xe({mutationFn:s=>se.post("/auth/register",s),onSuccess:s=>{e(s.user,s.token)}})}function Fh(e){const{login:s}=Te();return xe({mutationFn:n=>se.post(`/auth/invite/${e}`,n),onSuccess:n=>{s(n.user,n.token)}})}var ul;const Wh=((ul=window.__MERIDIAN_CONFIG__)==null?void 0:ul.apiUrl)??void 0??"";function Lh(e,s){const n=`${Wh}/admin/events?token=${encodeURIComponent(e)}&workspaceId=${encodeURIComponent(s)}`;return new EventSource(n)}function qh(){const{token:e,workspace:s}=Te(),n=pe(),r=x.useRef(null);x.useEffect(()=>{if(!e||!s)return;const a=Lh(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 ya=768;function Bh(){const[e,s]=x.useState(void 0);return x.useEffect(()=>{const n=window.matchMedia(`(max-width: ${ya-1}px)`),r=()=>{s(window.innerWidth<ya)};return n.addEventListener("change",r),s(window.innerWidth<ya),()=>n.removeEventListener("change",r)},[]),!!e}const Mo=x.forwardRef(({className:e,orientation:s="horizontal",decorative:n=!0,...r},a)=>t.jsx(xl,{ref:a,decorative:n,orientation:s,className:A("shrink-0 bg-border",s==="horizontal"?"h-px w-full":"h-full w-px",e),...r}));Mo.displayName=xl.displayName;const Uh=sr,Yh=tr,Oc=x.forwardRef(({className:e,...s},n)=>t.jsx(Qs,{className:A("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}));Oc.displayName=Qs.displayName;const Hh=rr("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"}}),Ac=x.forwardRef(({side:e="right",className:s,children:n,...r},a)=>t.jsxs(Yh,{children:[t.jsx(Oc,{}),t.jsxs(Xs,{ref:a,className:A(Hh({side:e}),s),...r,children:[n,t.jsxs(Lr,{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(Ve,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ac.displayName=Xs.displayName;const Pc=({className:e,...s})=>t.jsx("div",{className:A("flex flex-col space-y-1.5 px-6 pt-6 pb-4 border-b border-border",e),...s});Pc.displayName="SheetHeader";const Rc=x.forwardRef(({className:e,...s},n)=>t.jsx(vn,{ref:n,className:A("text-base font-semibold text-foreground",e),...s}));Rc.displayName=vn.displayName;const Ic=x.forwardRef(({className:e,...s},n)=>t.jsx(jn,{ref:n,className:A("text-sm text-muted-foreground",e),...s}));Ic.displayName=jn.displayName;function oe({className:e,...s}){return t.jsx("div",{className:A("animate-pulse rounded-md bg-muted",e),...s})}const Vh="sidebar_state",Kh=60*60*24*7,Gh="16rem",Qh="18rem",Xh="3rem",Zh="b",$c=x.createContext(null);function Do(){const e=x.useContext($c);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function Jh({defaultOpen:e=!0,open:s,onOpenChange:n,className:r,style:a,children:o,...i}){const l=Bh(),[c,d]=x.useState(!1),[u,m]=x.useState(e),f=s??u,h=x.useCallback(b=>{const w=typeof b=="function"?b(f):b;n?n(w):m(w),document.cookie=`${Vh}=${w}; path=/; max-age=${Kh}`},[n,f]),g=x.useCallback(()=>l?d(b=>!b):h(b=>!b),[l,h,d]);x.useEffect(()=>{const b=w=>{w.key===Zh&&(w.metaKey||w.ctrlKey)&&(w.preventDefault(),g())};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[g]);const v=f?"expanded":"collapsed",D=x.useMemo(()=>({state:v,open:f,setOpen:h,isMobile:l,openMobile:c,setOpenMobile:d,toggleSidebar:g}),[v,f,h,l,c,d,g]);return t.jsx($c.Provider,{value:D,children:t.jsx(fo,{delayDuration:0,children:t.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":Gh,"--sidebar-width-icon":Xh,...a},className:A("group/sidebar-wrapper has-[[data-variant=inset]]:bg-sidebar flex h-svh w-full",r),...i,children:o})})})}function ex({side:e="left",variant:s="sidebar",collapsible:n="offcanvas",className:r,children:a,...o}){const{isMobile:i,state:l,openMobile:c,setOpenMobile:d}=Do();return n==="none"?t.jsx("div",{"data-slot":"sidebar",className:A("bg-sidebar text-sidebar-foreground flex h-full w-[var(--sidebar-width)] flex-col",r),...o,children:a}):i?t.jsx(Uh,{open:c,onOpenChange:d,...o,children:t.jsxs(Ac,{"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":Qh},side:e,children:[t.jsxs(Pc,{className:"sr-only",children:[t.jsx(Rc,{children:"Sidebar"}),t.jsx(Ic,{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:A("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:A("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 tx({className:e,onClick:s,...n}){const{toggleSidebar:r}=Do();return t.jsxs(J,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:A("size-7",e),onClick:a=>{s==null||s(a),r()},...n,children:[t.jsx(ah,{}),t.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function sx({className:e,...s}){return t.jsx("main",{"data-slot":"sidebar-inset",className:A("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 nx({className:e,...s}){return t.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:A("flex flex-col gap-2 p-2",e),...s})}function rx({className:e,...s}){return t.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:A("flex flex-col gap-2 p-2",e),...s})}function ax({className:e,...s}){return t.jsx(Mo,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:A("bg-sidebar-border mx-2 w-auto",e),...s})}function ox({className:e,...s}){return t.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:A("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...s})}function va({className:e,...s}){return t.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:A("relative flex w-full min-w-0 flex-col p-2",e),...s})}function ix({className:e,asChild:s=!1,...n}){const r=s?oo:"div";return t.jsx(r,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:A("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 ja({className:e,...s}){return t.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:A("w-full text-sm",e),...s})}function Vn({className:e,...s}){return t.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:A("flex w-full min-w-0 flex-col gap-1",e),...s})}function Ns({className:e,...s}){return t.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:A("group/menu-item relative",e),...s})}const lx=rr("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"}}),us=x.forwardRef(function({asChild:s=!1,isActive:n=!1,variant:r="default",size:a="default",tooltip:o,className:i,...l},c){const d=s?oo:"button",{isMobile:u,state:m}=Do(),f=t.jsx(d,{ref:c,"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":a,"data-active":n,className:A(lx({variant:r,size:a}),i),...l});return o?(typeof o=="string"&&(o={children:o}),t.jsxs(Ls,{children:[t.jsx(qs,{asChild:!0,children:f}),t.jsx(ks,{side:"right",align:"center",hidden:m!=="collapsed"||u,...o})]})):f});us.displayName="SidebarMenuButton";const cx=250,dx=300,Us={all:["projects"],list:()=>[...Us.all,"list"],detail:e=>[...Us.all,e],byKey:e=>[...Us.all,"key",e]};function dr(){const{workspace:e}=Te();return Ee({queryKey:[...Us.list(),e==null?void 0:e.id],queryFn:()=>{const s=e!=null&&e.id?`?workspace_id=${e.id}`:"";return se.get(`/admin/projects${s}`)},select:s=>s.projects,enabled:!!(e!=null&&e.id)})}function Js(e){return Ee({queryKey:Us.byKey(e),queryFn:()=>se.get(`/admin/projects/by-identifier/${encodeURIComponent(e)}`),select:s=>s.project,enabled:!!e})}function ux(e,s={}){const[n,r]=x.useState(e),a=s.enabled!==!1;return x.useEffect(()=>{if(!a)return;const l=setTimeout(()=>r(e),cx);return()=>clearTimeout(l)},[e,a]),{...Ee({queryKey:["projects","suggest-identifier",n],queryFn:()=>se.get(`/admin/projects/suggest-identifier?name=${encodeURIComponent(n)}`),select:l=>l.identifier,enabled:a&&n.trim().length>0}),flush:()=>r(e)}}function mx(e,s={}){const n=e.toUpperCase().replace(/[^A-Z0-9]/g,""),[r,a]=x.useState(n),o=s.enabled!==!1&&n.length>=3;x.useEffect(()=>{if(!n){a("");return}const l=setTimeout(()=>a(n),dx);return()=>clearTimeout(l)},[n]);const i=Ee({queryKey:["projects","check-identifier",r],queryFn:()=>se.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 fx(){const e=pe();return xe({mutationFn:s=>se.post("/admin/projects",s),onSuccess:()=>{e.invalidateQueries({queryKey:Us.list()})}})}function hx(){const e=pe();return xe({mutationFn:s=>se.delete(`/admin/projects/${s}`),onSuccess:()=>{e.invalidateQueries({queryKey:Us.list()})}})}const en=$u,tn=zu,xx=x.forwardRef(({className:e,inset:s,children:n,...r},a)=>t.jsxs(pl,{ref:a,className:A("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(kn,{className:"ml-auto"})]}));xx.displayName=pl.displayName;const px=x.forwardRef(({className:e,...s},n)=>t.jsx(gl,{ref:n,className:A("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}));px.displayName=gl.displayName;const Es=x.forwardRef(({className:e,sideOffset:s=4,...n},r)=>t.jsx(Iu,{children:t.jsx(bl,{ref:r,sideOffset:s,className:A("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})}));Es.displayName=bl.displayName;const ut=x.forwardRef(({className:e,inset:s,...n},r)=>t.jsx(yl,{ref:r,className:A("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}));ut.displayName=yl.displayName;const gx=x.forwardRef(({className:e,children:s,checked:n,...r},a)=>t.jsxs(vl,{ref:a,className:A("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(jl,{children:t.jsx(Pt,{className:"h-4 w-4"})})}),s]}));gx.displayName=vl.displayName;const bx=x.forwardRef(({className:e,children:s,...n},r)=>t.jsxs(wl,{ref:r,className:A("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(jl,{children:t.jsx(ts,{className:"h-2 w-2 fill-current"})})}),s]}));bx.displayName=wl.displayName;const _o=x.forwardRef(({className:e,inset:s,...n},r)=>t.jsx(Nl,{ref:r,className:A("px-2 py-1.5 text-xs font-medium text-muted-foreground",s&&"pl-8",e),...n}));_o.displayName=Nl.displayName;const ur=x.forwardRef(({className:e,...s},n)=>t.jsx(kl,{ref:n,className:A("-mx-1 my-1 h-px bg-border",e),...s}));ur.displayName=kl.displayName;const Dt=x.forwardRef(({className:e,...s},n)=>t.jsx(Sl,{ref:n,className:A("relative flex h-8 w-8 shrink-0 overflow-hidden rounded-full",e),...s}));Dt.displayName=Sl.displayName;const yx=x.forwardRef(({className:e,...s},n)=>t.jsx(Cl,{ref:n,className:A("aspect-square h-full w-full",e),...s}));yx.displayName=Cl.displayName;const _t=x.forwardRef(({className:e,...s},n)=>t.jsx(Ml,{ref:n,className:A("flex h-full w-full items-center justify-center rounded-full bg-muted text-xs font-medium text-muted-foreground",e),...s}));_t.displayName=Ml.displayName;function vx(){var a;const{workspace:e,setWorkspace:s}=Te(),{data:n}=Kr(),r=ot();return t.jsx(Vn,{children:t.jsx(Ns,{children:t.jsxs(en,{children:[t.jsx(tn,{asChild:!0,children:t.jsxs(us,{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(gc,{className:"ml-auto size-4 shrink-0"})]})}),t.jsxs(Es,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:"bottom",align:"start",sideOffset:4,children:[t.jsx(_o,{className:"text-xs text-muted-foreground font-normal",children:"Workspaces"}),n==null?void 0:n.map(o=>t.jsxs(ut,{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(Pt,{className:"size-3.5 text-muted-foreground shrink-0"})]},o.id)),t.jsx(ur,{}),t.jsxs(ut,{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 jx(){var a,o;const{user:e,logout:s}=Te(),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(Vn,{children:t.jsx(Ns,{children:t.jsxs(en,{children:[t.jsx(tn,{asChild:!0,children:t.jsxs(us,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[t.jsx(Dt,{className:"h-8 w-8 rounded-lg shrink-0",children:t.jsx(_t,{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(gc,{className:"ml-auto size-4 shrink-0"})]})}),t.jsxs(Es,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:"top",align:"end",sideOffset:4,children:[t.jsx(_o,{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(Dt,{className:"h-8 w-8 rounded-lg",children:t.jsx(_t,{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(ur,{}),t.jsxs(ut,{className:"text-destructive focus:text-destructive cursor-pointer",onClick:s,children:[t.jsx(sh,{className:"size-4"}),"Sign out"]})]})]})})})}function wx({...e}){var h;const{workspace:s,projectKey:n}=pt(),{data:r}=dr(),{toggle:a}=tc(),{user:o}=Te(),i=Wr(),l=s??"",c=i.pathname===`/${l}/projects`,d=i.pathname.includes("/notifications"),u=i.pathname.includes("/settings"),m=i.pathname.includes("/roles"),f=((h=o==null?void 0:o.roles)==null?void 0:h.includes("super-admin"))??!1;return t.jsxs(ex,{collapsible:"offcanvas",...e,children:[t.jsx(nx,{children:t.jsx(vx,{})}),t.jsxs(ox,{children:[t.jsx(va,{children:t.jsx(ja,{children:t.jsxs(Vn,{children:[t.jsx(Ns,{children:t.jsxs(us,{onClick:a,tooltip:"Search",children:[t.jsx(Vr,{}),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(Ns,{children:t.jsx(us,{asChild:!0,isActive:c,tooltip:"Projects",children:t.jsxs(ln,{to:`/${l}/projects`,end:!0,children:[t.jsx(Vt,{}),t.jsx("span",{children:"Projects"})]})})}),t.jsx(Ns,{children:t.jsx(us,{asChild:!0,isActive:d,tooltip:"Notifications",children:t.jsxs(ln,{to:`/${l}/notifications`,children:[t.jsx(pn,{}),t.jsx("span",{children:"Notifications"})]})})})]})})}),r&&r.length>0&&t.jsxs(t.Fragment,{children:[t.jsx(ax,{}),t.jsxs(va,{children:[t.jsx(ix,{children:"Recent"}),t.jsx(ja,{children:t.jsx(Vn,{children:r.slice(0,5).map(g=>t.jsx(Ns,{children:t.jsx(us,{asChild:!0,isActive:g.identifier===n,tooltip:g.name,className:"data-[active=true]:bg-indigo-50 dark:data-[active=true]:bg-indigo-950/50 data-[active=true]:text-indigo-700 dark:data-[active=true]:text-indigo-300",children:t.jsxs(ln,{to:`/${l}/projects/${g.identifier}/board`,children:[t.jsx("span",{className:"font-mono text-[10px] text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-950/50 px-1 py-0.5 rounded shrink-0",children:g.identifier}),t.jsx("span",{className:"truncate",children:g.name})]})})},g.id))})})]})]}),t.jsx(va,{className:"mt-auto",children:t.jsx(ja,{children:t.jsxs(Vn,{children:[f&&t.jsx(Ns,{children:t.jsx(us,{asChild:!0,isActive:m,tooltip:"Roles & Permissions",children:t.jsxs(ln,{to:`/${l}/roles`,children:[t.jsx(Ga,{}),t.jsx("span",{children:"Roles"})]})})}),t.jsx(Ns,{children:t.jsx(us,{asChild:!0,isActive:u,tooltip:"Settings",children:t.jsxs(ln,{to:`/${l}/settings`,children:[t.jsx(ko,{}),t.jsx("span",{children:"Settings"})]})})})]})})})]}),t.jsx(rx,{children:t.jsx(jx,{})})]})}function Nx(){const{theme:e,setTheme:s}=Um();return t.jsxs(Ls,{children:[t.jsx(qs,{asChild:!0,children:t.jsxs(J,{variant:"ghost",size:"icon-sm",onClick:()=>s(e==="dark"?"light":"dark"),className:"text-muted-foreground hover:text-foreground",children:[t.jsx(mh,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),t.jsx(rh,{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(ks,{children:"Toggle theme"})]})}const mr={all:["notifications"],list:()=>[...mr.all,"list"]};function kx(){return Ee({queryKey:mr.list(),queryFn:()=>se.get("/admin/notifications"),select:e=>e.notifications})}function Sx(){return Ee({queryKey:[...mr.list(),"unread"],queryFn:()=>se.get("/admin/notifications?unread=true"),select:e=>e.count})}function Cx(){const e=pe();return xe({mutationFn:s=>se.post(`/admin/notifications/${s}/read`),onSuccess:()=>{e.invalidateQueries({queryKey:mr.all})}})}function Mx(){const e=pe();return xe({mutationFn:()=>se.post("/admin/notifications/read-all"),onSuccess:()=>{e.invalidateQueries({queryKey:mr.all})}})}function Dx(){const e=Wr(),{projectKey:s}=pt(),{data:n}=dr(),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:Sn,label:r?`${r.name} / Issues`:"Issues"}:a.endsWith("/projects")?{icon:Ir,label:"Projects"}:a.includes("/notifications")?{icon:pn,label:"Notifications"}:a.includes("/settings")?{icon:ko,label:"Settings"}:{icon:Ir,label:"Meridian"}}function _x(){const{data:e=0}=Sx(),{icon:s,label:n}=Dx(),{workspace:r}=Te(),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(tx,{className:"-ml-1"}),t.jsx(Mo,{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-indigo-600 dark:text-indigo-400",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(Nx,{}),t.jsx(J,{variant:"ghost",size:"icon",asChild:!0,className:"relative size-8 text-muted-foreground hover:text-foreground",children:t.jsxs(Kn,{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 Ex(){return t.jsxs(Jh,{children:[t.jsx(wx,{variant:"inset"}),t.jsxs(sx,{className:"flex flex-col min-w-0",children:[t.jsx(_x,{}),t.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-y-auto overflow-x-hidden",children:t.jsx(ml,{})})]})]})}const wi=["board","issues","sprints","timeline","access"];function Tx(){const{projectKey:e,workspace:s}=pt(),{data:n,error:r}=Js(e??""),a=ot(),o=Wr(),[i]=fl();x.useEffect(()=>{r&&r instanceof ho&&(r.status===403||r.status===404)&&a(`/${s}/projects`,{replace:!0})},[r,s,a]),x.useEffect(()=>{const d=i.get("tab");if(!d||!wi.includes(d))return;wi.every(m=>!o.pathname.endsWith(`/${m}`))&&a(`/${s}/projects/${e}/${d}`,{replace:!0})},[]);const l=`/${s}/projects/${e}`,c=[{to:`${l}/board`,label:"Board",icon:Ir,end:!0},{to:`${l}/issues`,label:"Issues",icon:Sn,end:!1},{to:`${l}/sprints`,label:"Sprints",icon:Cn,end:!0},{to:`${l}/timeline`,label:"Timeline",icon:po,end:!0},{to:`${l}/access`,label:"Access",icon:Yr,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-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-950/50 border border-indigo-200 dark:border-indigo-800 px-2 py-0.5 rounded",children:n.identifier}),t.jsx("h1",{className:"text-sm font-semibold",children:(n==null?void 0:n.name)??""})]}),t.jsx("div",{className:"flex -mb-px",children:c.map(({to:d,label:u,icon:m,end:f})=>t.jsxs(ln,{to:d,end:f,className:({isActive:h})=>`flex items-center gap-1.5 px-3 py-2 text-sm border-b-2 transition-colors ${h?"border-foreground text-foreground font-medium":"border-transparent text-muted-foreground hover:text-foreground"}`,children:[t.jsx(m,{className:"h-3.5 w-3.5",strokeWidth:1.5}),u]},d))})]}),t.jsx("div",{className:"flex flex-col flex-1 min-h-0",children:t.jsx(ml,{})})]})}var Ni=1,Ox=.9,Ax=.8,Px=.17,wa=.1,Na=.999,Rx=.9999,Ix=.99,$x=/[\\\/_+.#"@\[\(\{&]/,zx=/[\\\/_+.#"@\[\(\{&]/g,Fx=/[\s-]/,zc=/[\s-]/g;function Qa(e,s,n,r,a,o,i){if(o===s.length)return a===e.length?Ni:Ix;var l=`${a},${o}`;if(i[l]!==void 0)return i[l];for(var c=r.charAt(o),d=n.indexOf(c,a),u=0,m,f,h,g;d>=0;)m=Qa(e,s,n,r,d+1,o+1,i),m>u&&(d===a?m*=Ni:$x.test(e.charAt(d-1))?(m*=Ax,h=e.slice(a,d-1).match(zx),h&&a>0&&(m*=Math.pow(Na,h.length))):Fx.test(e.charAt(d-1))?(m*=Ox,g=e.slice(a,d-1).match(zc),g&&a>0&&(m*=Math.pow(Na,g.length))):(m*=Px,a>0&&(m*=Math.pow(Na,d-a))),e.charAt(d)!==s.charAt(o)&&(m*=Rx)),(m<wa&&n.charAt(d-1)===r.charAt(o+1)||r.charAt(o+1)===r.charAt(o)&&n.charAt(d-1)!==r.charAt(o))&&(f=Qa(e,s,n,r,d+1,o+2,i),f*wa>m&&(m=f*wa)),m>u&&(u=m),d=n.indexOf(c,d+1);return i[l]=u,u}function ki(e){return e.toLowerCase().replace(zc," ")}function Wx(e,s,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Qa(e,s,ki(e),ki(s),0,0,{})}var In='[cmdk-group=""]',ka='[cmdk-group-items=""]',Lx='[cmdk-group-heading=""]',Eo='[cmdk-item=""]',Si=`${Eo}:not([aria-disabled="true"])`,Xa="cmdk-item-select",$s="data-value",qx=(e,s,n)=>Wx(e,s,n),Fc=x.createContext(void 0),fr=()=>x.useContext(Fc),Wc=x.createContext(void 0),To=()=>x.useContext(Wc),Lc=x.createContext(void 0),qc=x.forwardRef((e,s)=>{let n=cn(()=>{var S,$;return{search:"",value:($=(S=e.value)!=null?S:e.defaultValue)!=null?$:"",filtered:{count:0,items:new Map,groups:new Set}}}),r=cn(()=>new Set),a=cn(()=>new Map),o=cn(()=>new Map),i=cn(()=>new Set),l=Bc(e),{label:c,children:d,value:u,onValueChange:m,filter:f,shouldFilter:h,loop:g,disablePointerSelection:v=!1,vimBindings:D=!0,...b}=e,w=dn(),j=dn(),y=dn(),C=x.useRef(null),p=Jx();Vs(()=>{if(u!==void 0){let S=u.trim();n.current.value=S,_.emit()}},[u]),Vs(()=>{p(6,P)},[]);let _=x.useMemo(()=>({subscribe:S=>(i.current.add(S),()=>i.current.delete(S)),snapshot:()=>n.current,setState:(S,$,Q)=>{var F,M,q;if(!Object.is(n.current[S],$)){if(n.current[S]=$,S==="search")E(),T(),p(1,R);else if(S==="value"&&(Q||p(5,P),((F=l.current)==null?void 0:F.value)!==void 0)){let me=$??"";(q=(M=l.current).onValueChange)==null||q.call(M,me);return}_.emit()}},emit:()=>{i.current.forEach(S=>S())}}),[]),I=x.useMemo(()=>({value:(S,$,Q)=>{var F;$!==((F=o.current.get(S))==null?void 0:F.value)&&(o.current.set(S,{value:$,keywords:Q}),n.current.filtered.items.set(S,W($,Q)),p(2,()=>{T(),_.emit()}))},item:(S,$)=>(r.current.add(S),$&&(a.current.has($)?a.current.get($).add(S):a.current.set($,new Set([S]))),p(3,()=>{E(),T(),n.current.value||R(),_.emit()}),()=>{o.current.delete(S),r.current.delete(S),n.current.filtered.items.delete(S);let Q=O();p(4,()=>{E(),(Q==null?void 0:Q.getAttribute("id"))===S&&R(),_.emit()})}),group:S=>(a.current.has(S)||a.current.set(S,new Set),()=>{o.current.delete(S),a.current.delete(S)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:w,inputId:y,labelId:j,listInnerRef:C}),[]);function W(S,$){var Q,F;let M=(F=(Q=l.current)==null?void 0:Q.filter)!=null?F:qx;return S?M(S,n.current.search,$):0}function T(){if(!n.current.search||l.current.shouldFilter===!1)return;let S=n.current.filtered.items,$=[];n.current.filtered.groups.forEach(F=>{let M=a.current.get(F),q=0;M.forEach(me=>{let Ne=S.get(me);q=Math.max(Ne,q)}),$.push([F,q])});let Q=C.current;V().sort((F,M)=>{var q,me;let Ne=F.getAttribute("id"),Ae=M.getAttribute("id");return((q=S.get(Ae))!=null?q:0)-((me=S.get(Ne))!=null?me:0)}).forEach(F=>{let M=F.closest(ka);M?M.appendChild(F.parentElement===M?F:F.closest(`${ka} > *`)):Q.appendChild(F.parentElement===Q?F:F.closest(`${ka} > *`))}),$.sort((F,M)=>M[1]-F[1]).forEach(F=>{var M;let q=(M=C.current)==null?void 0:M.querySelector(`${In}[${$s}="${encodeURIComponent(F[0])}"]`);q==null||q.parentElement.appendChild(q)})}function R(){let S=V().find(Q=>Q.getAttribute("aria-disabled")!=="true"),$=S==null?void 0:S.getAttribute($s);_.setState("value",$||void 0)}function E(){var S,$,Q,F;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let M=0;for(let q of r.current){let me=($=(S=o.current.get(q))==null?void 0:S.value)!=null?$:"",Ne=(F=(Q=o.current.get(q))==null?void 0:Q.keywords)!=null?F:[],Ae=W(me,Ne);n.current.filtered.items.set(q,Ae),Ae>0&&M++}for(let[q,me]of a.current)for(let Ne of me)if(n.current.filtered.items.get(Ne)>0){n.current.filtered.groups.add(q);break}n.current.filtered.count=M}function P(){var S,$,Q;let F=O();F&&(((S=F.parentElement)==null?void 0:S.firstChild)===F&&((Q=($=F.closest(In))==null?void 0:$.querySelector(Lx))==null||Q.scrollIntoView({block:"nearest"})),F.scrollIntoView({block:"nearest"}))}function O(){var S;return(S=C.current)==null?void 0:S.querySelector(`${Eo}[aria-selected="true"]`)}function V(){var S;return Array.from(((S=C.current)==null?void 0:S.querySelectorAll(Si))||[])}function Y(S){let $=V()[S];$&&_.setState("value",$.getAttribute($s))}function H(S){var $;let Q=O(),F=V(),M=F.findIndex(me=>me===Q),q=F[M+S];($=l.current)!=null&&$.loop&&(q=M+S<0?F[F.length-1]:M+S===F.length?F[0]:F[M+S]),q&&_.setState("value",q.getAttribute($s))}function B(S){let $=O(),Q=$==null?void 0:$.closest(In),F;for(;Q&&!F;)Q=S>0?Xx(Q,In):Zx(Q,In),F=Q==null?void 0:Q.querySelector(Si);F?_.setState("value",F.getAttribute($s)):H(S)}let L=()=>Y(V().length-1),te=S=>{S.preventDefault(),S.metaKey?L():S.altKey?B(1):H(1)},Z=S=>{S.preventDefault(),S.metaKey?Y(0):S.altKey?B(-1):H(-1)};return x.createElement(Ds.div,{ref:s,tabIndex:-1,...b,"cmdk-root":"",onKeyDown:S=>{var $;if(($=b.onKeyDown)==null||$.call(b,S),!S.defaultPrevented)switch(S.key){case"n":case"j":{D&&S.ctrlKey&&te(S);break}case"ArrowDown":{te(S);break}case"p":case"k":{D&&S.ctrlKey&&Z(S);break}case"ArrowUp":{Z(S);break}case"Home":{S.preventDefault(),Y(0);break}case"End":{S.preventDefault(),L();break}case"Enter":if(!S.nativeEvent.isComposing&&S.keyCode!==229){S.preventDefault();let Q=O();if(Q){let F=new Event(Xa);Q.dispatchEvent(F)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:I.inputId,id:I.labelId,style:tp},c),Qr(e,S=>x.createElement(Wc.Provider,{value:_},x.createElement(Fc.Provider,{value:I},S))))}),Bx=x.forwardRef((e,s)=>{var n,r;let a=dn(),o=x.useRef(null),i=x.useContext(Lc),l=fr(),c=Bc(e),d=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:i==null?void 0:i.forceMount;Vs(()=>{if(!d)return l.item(a,i==null?void 0:i.id)},[d]);let u=Uc(a,o,[e.value,e.children,o],e.keywords),m=To(),f=Ks(p=>p.value&&p.value===u.current),h=Ks(p=>d||l.filter()===!1?!0:p.search?p.filtered.items.get(a)>0:!0);x.useEffect(()=>{let p=o.current;if(!(!p||e.disabled))return p.addEventListener(Xa,g),()=>p.removeEventListener(Xa,g)},[h,e.onSelect,e.disabled]);function g(){var p,_;v(),(_=(p=c.current).onSelect)==null||_.call(p,u.current)}function v(){m.setState("value",u.current,!0)}if(!h)return null;let{disabled:D,value:b,onSelect:w,forceMount:j,keywords:y,...C}=e;return x.createElement(Ds.div,{ref:Qn([o,s]),...C,id:a,"cmdk-item":"",role:"option","aria-disabled":!!D,"aria-selected":!!f,"data-disabled":!!D,"data-selected":!!f,onPointerMove:D||l.getDisablePointerSelection()?void 0:v,onClick:D?void 0:g},e.children)}),Ux=x.forwardRef((e,s)=>{let{heading:n,children:r,forceMount:a,...o}=e,i=dn(),l=x.useRef(null),c=x.useRef(null),d=dn(),u=fr(),m=Ks(h=>a||u.filter()===!1?!0:h.search?h.filtered.groups.has(i):!0);Vs(()=>u.group(i),[]),Uc(i,l,[e.value,e.heading,c]);let f=x.useMemo(()=>({id:i,forceMount:a}),[a]);return x.createElement(Ds.div,{ref:Qn([l,s]),...o,"cmdk-group":"",role:"presentation",hidden:m?void 0:!0},n&&x.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),Qr(e,h=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},x.createElement(Lc.Provider,{value:f},h))))}),Yx=x.forwardRef((e,s)=>{let{alwaysRender:n,...r}=e,a=x.useRef(null),o=Ks(i=>!i.search);return!n&&!o?null:x.createElement(Ds.div,{ref:Qn([a,s]),...r,"cmdk-separator":"",role:"separator"})}),Hx=x.forwardRef((e,s)=>{let{onValueChange:n,...r}=e,a=e.value!=null,o=To(),i=Ks(u=>u.search),l=Ks(u=>u.value),c=fr(),d=x.useMemo(()=>{var u;let m=(u=c.listInnerRef.current)==null?void 0:u.querySelector(`${Eo}[${$s}="${encodeURIComponent(l)}"]`);return m==null?void 0:m.getAttribute("id")},[]);return x.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),x.createElement(Ds.input,{ref:s,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":d,id:c.inputId,type:"text",value:a?e.value:i,onChange:u=>{a||o.setState("search",u.target.value),n==null||n(u.target.value)}})}),Vx=x.forwardRef((e,s)=>{let{children:n,label:r="Suggestions",...a}=e,o=x.useRef(null),i=x.useRef(null),l=fr();return x.useEffect(()=>{if(i.current&&o.current){let c=i.current,d=o.current,u,m=new ResizeObserver(()=>{u=requestAnimationFrame(()=>{let f=c.offsetHeight;d.style.setProperty("--cmdk-list-height",f.toFixed(1)+"px")})});return m.observe(c),()=>{cancelAnimationFrame(u),m.unobserve(c)}}},[]),x.createElement(Ds.div,{ref:Qn([o,s]),...a,"cmdk-list":"",role:"listbox","aria-label":r,id:l.listId},Qr(e,c=>x.createElement("div",{ref:Qn([i,l.listInnerRef]),"cmdk-list-sizer":""},c)))}),Kx=x.forwardRef((e,s)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:o,container:i,...l}=e;return x.createElement(sr,{open:n,onOpenChange:r},x.createElement(tr,{container:i},x.createElement(Qs,{"cmdk-overlay":"",className:a}),x.createElement(Xs,{"aria-label":e.label,"cmdk-dialog":"",className:o},x.createElement(qc,{ref:s,...l}))))}),Gx=x.forwardRef((e,s)=>Ks(n=>n.filtered.count===0)?x.createElement(Ds.div,{ref:s,...e,"cmdk-empty":"",role:"presentation"}):null),Qx=x.forwardRef((e,s)=>{let{progress:n,children:r,label:a="Loading...",...o}=e;return x.createElement(Ds.div,{ref:s,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Qr(e,i=>x.createElement("div",{"aria-hidden":!0},i)))}),wt=Object.assign(qc,{List:Vx,Item:Bx,Input:Hx,Group:Ux,Separator:Yx,Dialog:Kx,Empty:Gx,Loading:Qx});function Xx(e,s){let n=e.nextElementSibling;for(;n;){if(n.matches(s))return n;n=n.nextElementSibling}}function Zx(e,s){let n=e.previousElementSibling;for(;n;){if(n.matches(s))return n;n=n.previousElementSibling}}function Bc(e){let s=x.useRef(e);return Vs(()=>{s.current=e}),s}var Vs=typeof window>"u"?x.useEffect:x.useLayoutEffect;function cn(e){let s=x.useRef();return s.current===void 0&&(s.current=e()),s}function Qn(e){return s=>{e.forEach(n=>{typeof n=="function"?n(s):n!=null&&(n.current=s)})}}function Ks(e){let s=To(),n=()=>e(s.snapshot());return Fu.useSyncExternalStore(s.subscribe,n,n)}function Uc(e,s,n,r=[]){let a=x.useRef(),o=fr();return Vs(()=>{var i;let l=(()=>{var d;for(let u of n){if(typeof u=="string")return u.trim();if(typeof u=="object"&&"current"in u)return u.current?(d=u.current.textContent)==null?void 0:d.trim():a.current}})(),c=r.map(d=>d.trim());o.value(e,l,c),(i=s.current)==null||i.setAttribute($s,l),a.current=l}),a}var Jx=()=>{let[e,s]=x.useState(),n=cn(()=>new Map);return Vs(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),s({})}};function ep(e){let s=e.type;return typeof s=="function"?s(e.props):"render"in s?s.render(e.props):e}function Qr({asChild:e,children:s},n){return e&&x.isValidElement(s)?x.cloneElement(ep(s),{ref:s.ref},n(s.props.children)):n(s)}var tp={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Xr=sr,sp=tr,Yc=x.forwardRef(({className:e,...s},n)=>t.jsx(Qs,{ref:n,className:A("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}));Yc.displayName=Qs.displayName;const hr=x.forwardRef(({className:e,children:s,...n},r)=>t.jsxs(sp,{children:[t.jsx(Yc,{}),t.jsxs(Xs,{ref:r,className:A("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(Lr,{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(Ve,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));hr.displayName=Xs.displayName;const Zr=({className:e,...s})=>t.jsx("div",{className:A("flex flex-col space-y-1.5",e),...s});Zr.displayName="DialogHeader";const Jr=x.forwardRef(({className:e,...s},n)=>t.jsx(vn,{ref:n,className:A("text-base font-semibold leading-none tracking-tight",e),...s}));Jr.displayName=vn.displayName;const Hc=x.forwardRef(({className:e,...s},n)=>t.jsx(jn,{ref:n,className:A("text-sm text-muted-foreground",e),...s}));Hc.displayName=jn.displayName;const fn=x.forwardRef(({className:e,...s},n)=>t.jsx(wt,{ref:n,className:A("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...s}));fn.displayName=wt.displayName;const np=({children:e,open:s,onOpenChange:n})=>t.jsx(Xr,{open:s,onOpenChange:n,children:t.jsx(hr,{className:"overflow-hidden p-0 shadow-lg max-w-[560px]",children:t.jsx(fn,{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})})}),Oo=x.forwardRef(({className:e,...s},n)=>t.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[t.jsx(Vr,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),t.jsx(wt.Input,{ref:n,className:A("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})]}));Oo.displayName=wt.Input.displayName;const hn=x.forwardRef(({className:e,...s},n)=>t.jsx(wt.List,{ref:n,className:A("max-h-[320px] overflow-y-auto overflow-x-hidden",e),...s}));hn.displayName=wt.List.displayName;const Ao=x.forwardRef((e,s)=>t.jsx(wt.Empty,{ref:s,className:"py-6 text-center text-sm text-muted-foreground",...e}));Ao.displayName=wt.Empty.displayName;const Ys=x.forwardRef(({className:e,...s},n)=>t.jsx(wt.Group,{ref:n,className:A("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}));Ys.displayName=wt.Group.displayName;const Vc=x.forwardRef(({className:e,...s},n)=>t.jsx(wt.Separator,{ref:n,className:A("-mx-1 h-px bg-border",e),...s}));Vc.displayName=wt.Separator.displayName;const Ut=x.forwardRef(({className:e,...s},n)=>t.jsx(wt.Item,{ref:n,className:A("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}));Ut.displayName=wt.Item.displayName;function rp(){const{open:e,setOpen:s}=tc(),n=ot(),{data:r}=dr(),{workspace:a}=Te(),o=(a==null?void 0:a.slug)??"",i=l=>{s(!1),l()};return t.jsxs(np,{open:e,onOpenChange:s,children:[t.jsx(Oo,{placeholder:"Search or jump to..."}),t.jsxs(hn,{children:[t.jsx(Ao,{children:"No results found."}),t.jsxs(Ys,{heading:"Navigation",children:[t.jsxs(Ut,{onSelect:()=>i(()=>n(`/${o}/projects`)),children:[t.jsx(Ir,{className:"text-muted-foreground"}),t.jsx("span",{children:"Projects"})]}),t.jsxs(Ut,{onSelect:()=>i(()=>n(`/${o}/notifications`)),children:[t.jsx(pn,{className:"text-muted-foreground"}),t.jsx("span",{children:"Notifications"})]}),t.jsxs(Ut,{onSelect:()=>i(()=>n(`/${o}/settings`)),children:[t.jsx(ko,{className:"text-muted-foreground"}),t.jsx("span",{children:"Settings"})]})]}),r&&r.length>0&&t.jsxs(t.Fragment,{children:[t.jsx(Vc,{}),t.jsxs(Ys,{heading:"Projects",children:[r.map(l=>t.jsxs(Ut,{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(Ut,{value:`${l.name} issues`,onSelect:()=>i(()=>n(`/${o}/projects/${l.identifier}/issues`)),children:[t.jsx(Sn,{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 ap(){const[e,s]=x.useState(""),[n,r]=x.useState(""),[a,o]=x.useState(!1),i=ot(),l=$h(),c=d=>{d.preventDefault(),l.mutate({email:e,password:n},{onSuccess:()=>i("/"),onError:u=>z.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:c,className:"space-y-2",children:[t.jsx(ve,{type:"email",placeholder:"Email",value:e,onChange:d=>s(d.target.value),autoComplete:"email",required:!0,className:"bg-white dark:bg-card h-10"}),t.jsxs("div",{className:"relative",children:[t.jsx(ve,{type:a?"text":"password",placeholder:"Password",value:n,onChange:d=>r(d.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(vo,{className:"h-4 w-4"}):t.jsx(or,{className:"h-4 w-4"})})]}),t.jsx("div",{className:"pt-1",children:t.jsx(J,{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(Kn,{to:"/register",className:"text-indigo hover:opacity-80 transition-opacity",children:"Create one"})]})]})})}function op(){const[e,s]=x.useState(""),[n,r]=x.useState(""),[a,o]=x.useState(""),[i,l]=x.useState(""),[c,d]=x.useState(!1),u=ot(),m=zh(),{data:f}=Tc(),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:D=>z.error(D.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(ve,{placeholder:"First name",value:e,onChange:v=>s(v.target.value),required:!0,className:"bg-white dark:bg-card h-10"}),t.jsx(ve,{placeholder:"Last name",value:n,onChange:v=>r(v.target.value),required:!0,className:"bg-white dark:bg-card h-10"})]}),t.jsx(ve,{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(ve,{type:c?"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:()=>d(!c),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",tabIndex:-1,children:c?t.jsx(vo,{className:"h-4 w-4"}):t.jsx(or,{className:"h-4 w-4"})})]}),t.jsx("div",{className:"pt-1",children:t.jsx(J,{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(Kn,{to:"/login",className:"text-indigo hover:opacity-80 transition-opacity",children:"Sign in"})]})]})})}function ip(){const[e,s]=x.useState(""),n=ot(),{setWorkspace:r}=Te(),a=kh(),o=i=>{i.preventDefault(),e.trim()&&a.mutate({name:e.trim()},{onSuccess:l=>{const c={id:l.workspace.id,name:l.workspace.name,slug:l.workspace.slug};r(c),n(`/${c.slug}/projects`,{replace:!0})},onError:l=>z.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(ve,{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(J,{type:"submit",className:"w-full h-10 font-medium",disabled:!e.trim()||a.isPending,children:a.isPending?"Creating workspace...":"Create workspace"})]})]})})}function lp(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 Kc=N.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}),xr=()=>{const e=N.useContext(Kc);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};lp(`[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(
|
|
469
|
-
[data-state=closed]
|
|
470
|
-
){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 cp(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function dp(){return Po(/^Mac/)}function up(){return Po(/^iPhone/)}function Ci(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function mp(){return Po(/^iPad/)||dp()&&navigator.maxTouchPoints>1}function Gc(){return up()||mp()}function Po(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const fp=24,hp=typeof window<"u"?x.useLayoutEffect:x.useEffect;function Mi(...e){return(...s)=>{for(let n of e)typeof n=="function"&&n(...s)}}const Sa=typeof document<"u"&&window.visualViewport;function Di(e){let s=window.getComputedStyle(e);return/(auto|scroll)/.test(s.overflow+s.overflowX+s.overflowY)}function Qc(e){for(Di(e)&&(e=e.parentElement);e&&!Di(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const xp=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let Sr=0,Ca;function pp(e={}){let{isDisabled:s}=e;hp(()=>{if(!s)return Sr++,Sr===1&&Gc()&&(Ca=gp()),()=>{Sr--,Sr===0&&(Ca==null||Ca())}},[s])}function gp(){let e,s=0,n=m=>{e=Qc(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;Za(f)&&f!==document.activeElement&&(m.preventDefault(),f.style.transform="translateY(-2000px)",f.focus(),requestAnimationFrame(()=>{f.style.transform=""}))},o=m=>{let f=m.target;Za(f)&&(f.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{f.style.transform="",Sa&&(Sa.height<window.innerHeight?requestAnimationFrame(()=>{_i(f)}):Sa.addEventListener("resize",()=>_i(f),{once:!0}))}))},i=()=>{window.scrollTo(0,0)},l=window.pageXOffset,c=window.pageYOffset,d=Mi(bp(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let u=Mi($n(document,"touchstart",n,{passive:!1,capture:!0}),$n(document,"touchmove",r,{passive:!1,capture:!0}),$n(document,"touchend",a,{passive:!1,capture:!0}),$n(document,"focus",o,!0),$n(window,"scroll",i));return()=>{d(),u(),window.scrollTo(l,c)}}function bp(e,s,n){let r=e.style[s];return e.style[s]=n,()=>{e.style[s]=r}}function $n(e,s,n,r){return e.addEventListener(s,n,r),()=>{e.removeEventListener(s,n,r)}}function _i(e){let s=document.scrollingElement||document.documentElement;for(;e&&e!==s;){let n=Qc(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+fp;o>i&&(n.scrollTop+=a-r)}e=n.parentElement}}function Za(e){return e instanceof HTMLInputElement&&!xp.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function yp(e,s){typeof e=="function"?e(s):e!=null&&(e.current=s)}function vp(...e){return s=>e.forEach(n=>yp(n,s))}function Xc(...e){return x.useCallback(vp(...e),e)}const Zc=new WeakMap;function Ke(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&&Zc.set(e,r)}function jp(e,s){if(!e||!(e instanceof HTMLElement))return;let n=Zc.get(e);n&&(e.style[s]=n[s])}const He=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function Cr(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(", ")[He(s)?13:12]):(a=r.match(/^matrix\((.+)\)$/),a?parseFloat(a[1].split(", ")[He(s)?5:4]):null)}function wp(e){return 8*(Math.log(e+1)-2)}function Ma(e,s){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,s),()=>{e.style.cssText=n}}function Np(...e){return(...s)=>{for(const n of e)typeof n=="function"&&n(...s)}}const $e={DURATION:.5,EASE:[.32,.72,0,1]},Jc=.4,kp=.25,Sp=100,ed=8,Ps=16,Ja=26,Da="vaul-dragging";function td(e){const s=N.useRef(e);return N.useEffect(()=>{s.current=e}),N.useMemo(()=>(...n)=>s.current==null?void 0:s.current.call(s,...n),[])}function Cp({defaultProp:e,onChange:s}){const n=N.useState(e),[r]=n,a=N.useRef(r),o=td(s);return N.useEffect(()=>{a.current!==r&&(o(r),a.current=r)},[r,a,o]),n}function sd({prop:e,defaultProp:s,onChange:n=()=>{}}){const[r,a]=Cp({defaultProp:s,onChange:n}),o=e!==void 0,i=o?e:r,l=td(n),c=N.useCallback(d=>{if(o){const m=typeof d=="function"?d(e):d;m!==e&&l(m)}else a(d)},[o,e,a,l]);return[i,c]}function Mp({activeSnapPointProp:e,setActiveSnapPointProp:s,snapPoints:n,drawerRef:r,overlayRef:a,fadeFromIndex:o,onSnapPointChange:i,direction:l="bottom",container:c,snapToSequentialPoint:d}){const[u,m]=sd({prop:e,defaultProp:n==null?void 0:n[0],onChange:s}),[f,h]=N.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);N.useEffect(()=>{function _(){h({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)},[]);const g=N.useMemo(()=>u===(n==null?void 0:n[n.length-1])||null,[n,u]),v=N.useMemo(()=>{var _;return(_=n==null?void 0:n.findIndex(I=>I===u))!=null?_:null},[n,u]),D=n&&n.length>0&&(o||o===0)&&!Number.isNaN(o)&&n[o]===u||!n,b=N.useMemo(()=>{const _=c?{width:c.getBoundingClientRect().width,height:c.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var I;return(I=n==null?void 0:n.map(W=>{const T=typeof W=="string";let R=0;if(T&&(R=parseInt(W,10)),He(l)){const P=T?R:f?W*_.height:0;return f?l==="bottom"?_.height-P:-_.height+P:P}const E=T?R:f?W*_.width:0;return f?l==="right"?_.width-E:-_.width+E:E}))!=null?I:[]},[n,f,c]),w=N.useMemo(()=>v!==null?b==null?void 0:b[v]:null,[b,v]),j=N.useCallback(_=>{var I;const W=(I=b==null?void 0:b.findIndex(T=>T===_))!=null?I:null;i(W),Ke(r.current,{transition:`transform ${$e.DURATION}s cubic-bezier(${$e.EASE.join(",")})`,transform:He(l)?`translate3d(0, ${_}px, 0)`:`translate3d(${_}px, 0, 0)`}),b&&W!==b.length-1&&o!==void 0&&W!==o&&W<o?Ke(a.current,{transition:`opacity ${$e.DURATION}s cubic-bezier(${$e.EASE.join(",")})`,opacity:"0"}):Ke(a.current,{transition:`opacity ${$e.DURATION}s cubic-bezier(${$e.EASE.join(",")})`,opacity:"1"}),m(n==null?void 0:n[Math.max(W,0)])},[r.current,n,b,o,a,m]);N.useEffect(()=>{if(u||e){var _;const I=(_=n==null?void 0:n.findIndex(W=>W===e||W===u))!=null?_:-1;b&&I!==-1&&typeof b[I]=="number"&&j(b[I])}},[u,e,n,b,j]);function y({draggedDistance:_,closeDrawer:I,velocity:W,dismissible:T}){if(o===void 0)return;const R=l==="bottom"||l==="right"?(w??0)-_:(w??0)+_,E=v===o-1,P=v===0,O=_>0;if(E&&Ke(a.current,{transition:`opacity ${$e.DURATION}s cubic-bezier(${$e.EASE.join(",")})`}),!d&&W>2&&!O){T?I():j(b[0]);return}if(!d&&W>2&&O&&b&&n){j(b[n.length-1]);return}const V=b==null?void 0:b.reduce((H,B)=>typeof H!="number"||typeof B!="number"?H:Math.abs(B-R)<Math.abs(H-R)?B:H),Y=He(l)?window.innerHeight:window.innerWidth;if(W>Jc&&Math.abs(_)<Y*.4){const H=O?1:-1;if(H>0&&g&&n){j(b[n.length-1]);return}if(P&&H<0&&T&&I(),v===null)return;j(b[v+H]);return}j(V)}function C({draggedDistance:_}){if(w===null)return;const I=l==="bottom"||l==="right"?w-_:w+_;(l==="bottom"||l==="right")&&I<b[b.length-1]||(l==="top"||l==="left")&&I>b[b.length-1]||Ke(r.current,{transform:He(l)?`translate3d(0, ${I}px, 0)`:`translate3d(${I}px, 0, 0)`})}function p(_,I){if(!n||typeof v!="number"||!b||o===void 0)return null;const W=v===o-1;if(v>=o&&I)return 0;if(W&&!I)return 1;if(!D&&!W)return null;const R=W?v+1:v-1,E=W?b[R]-b[R-1]:b[R+1]-b[R],P=_/Math.abs(E);return W?1-P:P}return{isLastSnapPoint:g,activeSnapPoint:u,shouldFade:D,getPercentageDragged:p,setActiveSnapPoint:m,activeSnapPointIndex:v,onRelease:y,onDrag:C,snapPointsOffset:b}}const Dp=()=>()=>{};function _p(){const{direction:e,isOpen:s,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:a}=xr(),o=N.useRef(null),i=x.useMemo(()=>document.body.style.backgroundColor,[]);function l(){return(window.innerWidth-Ja)/window.innerWidth}N.useEffect(()=>{if(s&&n){o.current&&clearTimeout(o.current);const c=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!c)return;Np(r&&!a?Ma(document.body,{background:"black"}):Dp,Ma(c,{transformOrigin:He(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${$e.DURATION}s`,transitionTimingFunction:`cubic-bezier(${$e.EASE.join(",")})`}));const d=Ma(c,{borderRadius:`${ed}px`,overflow:"hidden",...He(e)?{transform:`scale(${l()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${l()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{d(),o.current=window.setTimeout(()=>{i?document.body.style.background=i:document.body.style.removeProperty("background")},$e.DURATION*1e3)}}},[s,n,i])}let zn=null;function Ep({isOpen:e,modal:s,nested:n,hasBeenOpened:r,preventScrollRestoration:a,noBodyStyles:o}){const[i,l]=N.useState(()=>typeof window<"u"?window.location.href:""),c=N.useRef(0),d=N.useCallback(()=>{if(Ci()&&zn===null&&e&&!o){zn={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:`${-c.current}px`,left:`${-m}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const h=f-window.innerHeight;h&&c.current>=f&&(document.body.style.top=`${-(c.current+h)}px`)}),300)}},[e]),u=N.useCallback(()=>{if(Ci()&&zn!==null&&!o){const m=-parseInt(document.body.style.top,10),f=-parseInt(document.body.style.left,10);Object.assign(document.body.style,zn),window.requestAnimationFrame(()=>{if(a&&i!==window.location.href){l(window.location.href);return}window.scrollTo(f,m)}),zn=null}},[i]);return N.useEffect(()=>{function m(){c.current=window.scrollY}return m(),window.addEventListener("scroll",m),()=>{window.removeEventListener("scroll",m)}},[]),N.useEffect(()=>{if(s)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||u()}},[s,u]),N.useEffect(()=>{n||!r||(e?(!window.matchMedia("(display-mode: standalone)").matches&&d(),s||window.setTimeout(()=>{u()},500)):u())},[e,r,i,s,n,d,u]),{restorePositionSetting:u}}function Tp({open:e,onOpenChange:s,children:n,onDrag:r,onRelease:a,snapPoints:o,shouldScaleBackground:i=!1,setBackgroundColorOnScale:l=!0,closeThreshold:c=kp,scrollLockTimeout:d=Sp,dismissible:u=!0,handleOnly:m=!1,fadeFromIndex:f=o&&o.length-1,activeSnapPoint:h,setActiveSnapPoint:g,fixed:v,modal:D=!0,onClose:b,nested:w,noBodyStyles:j=!1,direction:y="bottom",defaultOpen:C=!1,disablePreventScroll:p=!0,snapToSequentialPoint:_=!1,preventScrollRestoration:I=!1,repositionInputs:W=!0,onAnimationEnd:T,container:R,autoFocus:E=!1}){var P,O;const[V=!1,Y]=sd({defaultProp:C,prop:e,onChange:ce=>{s==null||s(ce),!ce&&!w&&qe(),setTimeout(()=>{T==null||T(ce)},$e.DURATION*1e3),ce&&!D&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),ce||(document.body.style.pointerEvents="auto")}}),[H,B]=N.useState(!1),[L,te]=N.useState(!1),[Z,S]=N.useState(!1),$=N.useRef(null),Q=N.useRef(null),F=N.useRef(null),M=N.useRef(null),q=N.useRef(null),me=N.useRef(!1),Ne=N.useRef(null),Ae=N.useRef(0),Xe=N.useRef(!1),$t=N.useRef(!C),gt=N.useRef(0),fe=N.useRef(null),it=N.useRef(((P=fe.current)==null?void 0:P.getBoundingClientRect().height)||0),zt=N.useRef(((O=fe.current)==null?void 0:O.getBoundingClientRect().width)||0),Ft=N.useRef(0),bt=N.useCallback(ce=>{o&&ce===Ge.length-1&&(Q.current=new Date)},[]),{activeSnapPoint:Kt,activeSnapPointIndex:tt,setActiveSnapPoint:Nt,onRelease:ns,snapPointsOffset:Ge,onDrag:Wt,shouldFade:yt,getPercentageDragged:Re}=Mp({snapPoints:o,activeSnapPointProp:h,setActiveSnapPointProp:g,drawerRef:fe,fadeFromIndex:f,overlayRef:$,onSnapPointChange:bt,direction:y,container:R,snapToSequentialPoint:_});pp({isDisabled:!V||L||!D||Z||!H||!W||!p});const{restorePositionSetting:qe}=Ep({isOpen:V,modal:D,nested:w??!1,hasBeenOpened:H,preventScrollRestoration:I,noBodyStyles:j});function Tt(){return(window.innerWidth-Ja)/window.innerWidth}function bs(ce){var ee,re;!u&&!o||fe.current&&!fe.current.contains(ce.target)||(it.current=((ee=fe.current)==null?void 0:ee.getBoundingClientRect().height)||0,zt.current=((re=fe.current)==null?void 0:re.getBoundingClientRect().width)||0,te(!0),F.current=new Date,Gc()&&window.addEventListener("touchend",()=>me.current=!1,{once:!0}),ce.target.setPointerCapture(ce.pointerId),Ae.current=He(y)?ce.pageY:ce.pageX)}function Ot(ce,ee){var re;let X=ce;const ne=(re=window.getSelection())==null?void 0:re.toString(),we=fe.current?Cr(fe.current,y):null,U=new Date;if(X.tagName==="SELECT"||X.hasAttribute("data-vaul-no-drag")||X.closest("[data-vaul-no-drag]"))return!1;if(y==="right"||y==="left")return!0;if(Q.current&&U.getTime()-Q.current.getTime()<500)return!1;if(we!==null&&(y==="bottom"?we>0:we<0))return!0;if(ne&&ne.length>0)return!1;if(q.current&&U.getTime()-q.current.getTime()<d&&we===0||ee)return q.current=U,!1;for(;X;){if(X.scrollHeight>X.clientHeight){if(X.scrollTop!==0)return q.current=new Date,!1;if(X.getAttribute("role")==="dialog")return!0}X=X.parentNode}return!0}function rs(ce){if(fe.current&&L){const ee=y==="bottom"||y==="right"?1:-1,re=(Ae.current-(He(y)?ce.pageY:ce.pageX))*ee,X=re>0,ne=o&&!u&&!X;if(ne&&tt===0)return;const we=Math.abs(re),U=document.querySelector("[data-vaul-drawer-wrapper]"),ie=y==="bottom"||y==="top"?it.current:zt.current;let he=we/ie;const Ie=Re(we,X);if(Ie!==null&&(he=Ie),ne&&he>=1||!me.current&&!Ot(ce.target,X))return;if(fe.current.classList.add(Da),me.current=!0,Ke(fe.current,{transition:"none"}),Ke($.current,{transition:"none"}),o&&Wt({draggedDistance:re}),X&&!o){const De=wp(re),ct=Math.min(De*-1,0)*ee;Ke(fe.current,{transform:He(y)?`translate3d(0, ${ct}px, 0)`:`translate3d(${ct}px, 0, 0)`});return}const Me=1-he;if((yt||f&&tt===f-1)&&(r==null||r(ce,he),Ke($.current,{opacity:`${Me}`,transition:"none"},!0)),U&&$.current&&i){const De=Math.min(Tt()+he*(1-Tt()),1),ct=8-he*8,Je=Math.max(0,14-he*14);Ke(U,{borderRadius:`${ct}px`,transform:He(y)?`scale(${De}) translate3d(0, ${Je}px, 0)`:`scale(${De}) translate3d(${Je}px, 0, 0)`,transition:"none"},!0)}if(!o){const De=we*ee;Ke(fe.current,{transform:He(y)?`translate3d(0, ${De}px, 0)`:`translate3d(${De}px, 0, 0)`})}}}N.useEffect(()=>{window.requestAnimationFrame(()=>{$t.current=!0})},[]),N.useEffect(()=>{var ce;function ee(){if(!fe.current||!W)return;const re=document.activeElement;if(Za(re)||Xe.current){var X;const ne=((X=window.visualViewport)==null?void 0:X.height)||0,we=window.innerHeight;let U=we-ne;const ie=fe.current.getBoundingClientRect().height||0,he=ie>we*.8;Ft.current||(Ft.current=ie);const Ie=fe.current.getBoundingClientRect().top;if(Math.abs(gt.current-U)>60&&(Xe.current=!Xe.current),o&&o.length>0&&Ge&&tt){const Me=Ge[tt]||0;U+=Me}if(gt.current=U,ie>ne||Xe.current){const Me=fe.current.getBoundingClientRect().height;let De=Me;Me>ne&&(De=ne-(he?Ie:Ja)),v?fe.current.style.height=`${Me-Math.max(U,0)}px`:fe.current.style.height=`${Math.max(De,ne-Ie)}px`}else cp()||(fe.current.style.height=`${Ft.current}px`);o&&o.length>0&&!Xe.current?fe.current.style.bottom="0px":fe.current.style.bottom=`${Math.max(U,0)}px`}}return(ce=window.visualViewport)==null||ce.addEventListener("resize",ee),()=>{var re;return(re=window.visualViewport)==null?void 0:re.removeEventListener("resize",ee)}},[tt,o,Ge]);function kt(ce){lt(),b==null||b(),ce||Y(!1),setTimeout(()=>{o&&Nt(o[0])},$e.DURATION*1e3)}function St(){if(!fe.current)return;const ce=document.querySelector("[data-vaul-drawer-wrapper]"),ee=Cr(fe.current,y);Ke(fe.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${$e.DURATION}s cubic-bezier(${$e.EASE.join(",")})`}),Ke($.current,{transition:`opacity ${$e.DURATION}s cubic-bezier(${$e.EASE.join(",")})`,opacity:"1"}),i&&ee&&ee>0&&V&&Ke(ce,{borderRadius:`${ed}px`,overflow:"hidden",...He(y)?{transform:`scale(${Tt()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${Tt()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${$e.DURATION}s`,transitionTimingFunction:`cubic-bezier(${$e.EASE.join(",")})`},!0)}function lt(){!L||!fe.current||(fe.current.classList.remove(Da),me.current=!1,te(!1),M.current=new Date)}function st(ce){if(!L||!fe.current)return;fe.current.classList.remove(Da),me.current=!1,te(!1),M.current=new Date;const ee=Cr(fe.current,y);if(!ce||!Ot(ce.target,!1)||!ee||Number.isNaN(ee)||F.current===null)return;const re=M.current.getTime()-F.current.getTime(),X=Ae.current-(He(y)?ce.pageY:ce.pageX),ne=Math.abs(X)/re;if(ne>.05&&(S(!0),setTimeout(()=>{S(!1)},200)),o){ns({draggedDistance:X*(y==="bottom"||y==="right"?1:-1),closeDrawer:kt,velocity:ne,dismissible:u}),a==null||a(ce,!0);return}if(y==="bottom"||y==="right"?X>0:X<0){St(),a==null||a(ce,!0);return}if(ne>Jc){kt(),a==null||a(ce,!1);return}var we;const U=Math.min((we=fe.current.getBoundingClientRect().height)!=null?we:0,window.innerHeight);var ie;const he=Math.min((ie=fe.current.getBoundingClientRect().width)!=null?ie:0,window.innerWidth),Ie=y==="left"||y==="right";if(Math.abs(ee)>=(Ie?he:U)*c){kt(),a==null||a(ce,!1);return}a==null||a(ce,!0),St()}N.useEffect(()=>(V&&(Ke(document.documentElement,{scrollBehavior:"auto"}),Q.current=new Date),()=>{jp(document.documentElement,"scrollBehavior")}),[V]);function Ze(ce){const ee=ce?(window.innerWidth-Ps)/window.innerWidth:1,re=ce?-Ps:0;Ne.current&&window.clearTimeout(Ne.current),Ke(fe.current,{transition:`transform ${$e.DURATION}s cubic-bezier(${$e.EASE.join(",")})`,transform:He(y)?`scale(${ee}) translate3d(0, ${re}px, 0)`:`scale(${ee}) translate3d(${re}px, 0, 0)`}),!ce&&fe.current&&(Ne.current=setTimeout(()=>{const X=Cr(fe.current,y);Ke(fe.current,{transition:"none",transform:He(y)?`translate3d(0, ${X}px, 0)`:`translate3d(${X}px, 0, 0)`})},500))}function Gt(ce,ee){if(ee<0)return;const re=(window.innerWidth-Ps)/window.innerWidth,X=re+ee*(1-re),ne=-Ps+ee*Ps;Ke(fe.current,{transform:He(y)?`scale(${X}) translate3d(0, ${ne}px, 0)`:`scale(${X}) translate3d(${ne}px, 0, 0)`,transition:"none"})}function as(ce,ee){const re=He(y)?window.innerHeight:window.innerWidth,X=ee?(re-Ps)/re:1,ne=ee?-Ps:0;ee&&Ke(fe.current,{transition:`transform ${$e.DURATION}s cubic-bezier(${$e.EASE.join(",")})`,transform:He(y)?`scale(${X}) translate3d(0, ${ne}px, 0)`:`scale(${X}) translate3d(${ne}px, 0, 0)`})}return N.useEffect(()=>{D||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[D]),N.createElement(sr,{defaultOpen:C,onOpenChange:ce=>{!u&&!ce||(ce?B(!0):kt(!0),Y(ce))},open:V},N.createElement(Kc.Provider,{value:{activeSnapPoint:Kt,snapPoints:o,setActiveSnapPoint:Nt,drawerRef:fe,overlayRef:$,onOpenChange:s,onPress:bs,onRelease:st,onDrag:rs,dismissible:u,shouldAnimate:$t,handleOnly:m,isOpen:V,isDragging:L,shouldFade:yt,closeDrawer:kt,onNestedDrag:Gt,onNestedOpenChange:Ze,onNestedRelease:as,keyboardIsOpen:Xe,modal:D,snapPointsOffset:Ge,activeSnapPointIndex:tt,direction:y,shouldScaleBackground:i,setBackgroundColorOnScale:l,noBodyStyles:j,container:R,autoFocus:E}},n))}const nd=N.forwardRef(function({...e},s){const{overlayRef:n,snapPoints:r,onRelease:a,shouldFade:o,isOpen:i,modal:l,shouldAnimate:c}=xr(),d=Xc(s,n),u=r&&r.length>0;if(!l)return null;const m=N.useCallback(f=>a(f),[a]);return N.createElement(Qs,{onMouseUp:m,ref:d,"data-vaul-overlay":"","data-vaul-snap-points":i&&u?"true":"false","data-vaul-snap-points-overlay":i&&o?"true":"false","data-vaul-animate":c!=null&&c.current?"true":"false",...e})});nd.displayName="Drawer.Overlay";const rd=N.forwardRef(function({onPointerDownOutside:e,style:s,onOpenAutoFocus:n,...r},a){const{drawerRef:o,onPress:i,onRelease:l,onDrag:c,keyboardIsOpen:d,snapPointsOffset:u,activeSnapPointIndex:m,modal:f,isOpen:h,direction:g,snapPoints:v,container:D,handleOnly:b,shouldAnimate:w,autoFocus:j}=xr(),[y,C]=N.useState(!1),p=Xc(a,o),_=N.useRef(null),I=N.useRef(null),W=N.useRef(!1),T=v&&v.length>0;_p();const R=(P,O,V=0)=>{if(W.current)return!0;const Y=Math.abs(P.y),H=Math.abs(P.x),B=H>Y,L=["bottom","right"].includes(O)?1:-1;if(O==="left"||O==="right"){if(!(P.x*L<0)&&H>=0&&H<=V)return B}else if(!(P.y*L<0)&&Y>=0&&Y<=V)return!B;return W.current=!0,!0};N.useEffect(()=>{T&&window.requestAnimationFrame(()=>{C(!0)})},[]);function E(P){_.current=null,W.current=!1,l(P)}return N.createElement(Xs,{"data-vaul-drawer-direction":g,"data-vaul-drawer":"","data-vaul-delayed-snap-points":y?"true":"false","data-vaul-snap-points":h&&T?"true":"false","data-vaul-custom-container":D?"true":"false","data-vaul-animate":w!=null&&w.current?"true":"false",...r,ref:p,style:u&&u.length>0?{"--snap-point-height":`${u[m??0]}px`,...s}:s,onPointerDown:P=>{b||(r.onPointerDown==null||r.onPointerDown.call(r,P),_.current={x:P.pageX,y:P.pageY},i(P))},onOpenAutoFocus:P=>{n==null||n(P),j||P.preventDefault()},onPointerDownOutside:P=>{if(e==null||e(P),!f||P.defaultPrevented){P.preventDefault();return}d.current&&(d.current=!1)},onFocusOutside:P=>{if(!f){P.preventDefault();return}},onPointerMove:P=>{if(I.current=P,b||(r.onPointerMove==null||r.onPointerMove.call(r,P),!_.current))return;const O=P.pageY-_.current.y,V=P.pageX-_.current.x,Y=P.pointerType==="touch"?10:2;R({x:V,y:O},g,Y)?c(P):(Math.abs(V)>Y||Math.abs(O)>Y)&&(_.current=null)},onPointerUp:P=>{r.onPointerUp==null||r.onPointerUp.call(r,P),_.current=null,W.current=!1,l(P)},onPointerOut:P=>{r.onPointerOut==null||r.onPointerOut.call(r,P),E(I.current)},onContextMenu:P=>{r.onContextMenu==null||r.onContextMenu.call(r,P),I.current&&E(I.current)}})});rd.displayName="Drawer.Content";const Op=250,Ap=120,Pp=N.forwardRef(function({preventCycle:e=!1,children:s,...n},r){const{closeDrawer:a,isDragging:o,snapPoints:i,activeSnapPoint:l,setActiveSnapPoint:c,dismissible:d,handleOnly:u,isOpen:m,onPress:f,onDrag:h}=xr(),g=N.useRef(null),v=N.useRef(!1);function D(){if(v.current){j();return}window.setTimeout(()=>{b()},Ap)}function b(){if(o||e||v.current){j();return}if(j(),!i||i.length===0){d||a();return}if(l===i[i.length-1]&&d){a();return}const C=i.findIndex(_=>_===l);if(C===-1)return;const p=i[C+1];c(p)}function w(){g.current=window.setTimeout(()=>{v.current=!0},Op)}function j(){g.current&&window.clearTimeout(g.current),v.current=!1}return N.createElement("div",{onClick:D,onPointerCancel:j,onPointerDown:y=>{u&&f(y),w()},onPointerMove:y=>{u&&h(y)},ref:r,"data-vaul-drawer-visible":m?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},N.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},s))});Pp.displayName="Drawer.Handle";function Rp(e){const s=xr(),{container:n=s.container,...r}=e;return N.createElement(tr,{container:n,...r})}const ps={Root:Tp,Content:rd,Overlay:nd,Portal:Rp,Title:vn,Description:jn},sn=({shouldScaleBackground:e=!1,direction:s="right",...n})=>t.jsx(ps.Root,{shouldScaleBackground:e,direction:s,...n});sn.displayName="Drawer";const Ip=ps.Portal,ad=x.forwardRef(({className:e,...s},n)=>t.jsx(ps.Overlay,{ref:n,className:A("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}));ad.displayName=ps.Overlay.displayName;const nn=x.forwardRef(({className:e,children:s,...n},r)=>t.jsxs(Ip,{children:[t.jsx(ad,{}),t.jsx(ps.Content,{ref:r,className:A("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})]}));nn.displayName="DrawerContent";const Mn=({className:e,...s})=>t.jsx("div",{className:A("flex flex-col space-y-1.5 px-6 pt-6 pb-4 border-b border-border shrink-0",e),...s});Mn.displayName="DrawerHeader";const Dn=({className:e,...s})=>t.jsx("div",{className:A("flex-1 overflow-y-auto px-6 py-4",e),...s});Dn.displayName="DrawerBody";const pr=({className:e,...s})=>t.jsx("div",{className:A("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});pr.displayName="DrawerFooter";const _n=x.forwardRef(({className:e,...s},n)=>t.jsx(ps.Title,{ref:n,className:A("text-base font-semibold text-foreground",e),...s}));_n.displayName=ps.Title.displayName;const $p=x.forwardRef(({className:e,...s},n)=>t.jsx(ps.Description,{ref:n,className:A("text-sm text-muted-foreground",e),...s}));$p.displayName=ps.Description.displayName;const zp=rr("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Qe=x.forwardRef(({className:e,...s},n)=>t.jsx(Dl,{ref:n,className:A(zp(),e),...s}));Qe.displayName=Dl.displayName;const ea=x.forwardRef(({className:e,...s},n)=>t.jsx("textarea",{className:A("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}));ea.displayName="Textarea";const Ei=[{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}],_a=["#94a3b8","#64748b","#6366f1","#f59e0b","#10b981","#ef4444","#3b82f6","#8b5cf6"];function Fp(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")}function Wp({chip:e,onRemove:s}){const{attributes:n,listeners:r,setNodeRef:a,transform:o,transition:i,isDragging:l}=lo({id:e.key});return t.jsxs("div",{ref:a,style:{transform:co.Transform.toString(o),transition:i},className:A("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(Nc,{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(Ve,{className:"h-3 w-3"})})]})}const Lp=3;function qp({open:e,onClose:s}){var V;const[n,r]=x.useState(""),[a,o]=x.useState(""),[i,l]=x.useState(""),[c,d]=x.useState(!1),[u,m]=x.useState(!1),[f,h]=x.useState(Ei),[g,v]=x.useState(""),[D,b]=x.useState(_a[2]),{workspace:w}=Te(),j=fx(),y=ux(n,{enabled:e}),C=mx(a,{enabled:e});x.useEffect(()=>{e&&y.data&&!c&&o(y.data)},[e,y.data,c]);const p=C.available===!1||j.isError&&((V=j.error)==null?void 0:V.status)===409,_=a.trim().length>=Lp&&/^[A-Z0-9]+$/i.test(a.trim()),I=Ll(ql(Bl,{activationConstraint:{distance:5}})),W=Y=>{r(Y)},T=()=>{n.trim()&&!c&&y.flush()},R=()=>{r(""),o(""),l(""),d(!1),m(!1),h(Ei),v(""),b(_a[2]),j.reset(),s()},E=()=>{if(!g.trim())return;const Y=Fp(g.trim());if(f.some(H=>H.key===Y)){z.error("A status with this name already exists");return}h(H=>[...H,{name:g.trim(),key:Y,color:D,category:"started",position:H.length}]),v("")},P=Y=>{const{active:H,over:B}=Y;!B||H.id===B.id||h(L=>{const te=L.findIndex(S=>S.key===H.id),Z=L.findIndex(S=>S.key===B.id);return Ar(L,te,Z).map((S,$)=>({...S,position:$}))})},O=Y=>{Y.preventDefault(),!(!n.trim()||!a.trim()||!_||p)&&j.mutate({name:n.trim(),identifier:a.trim().toUpperCase(),description:i.trim()||void 0,workspace_id:w.id,initial_statuses:f},{onSuccess:()=>{z.success("Project created"),R()},onError:H=>{(H==null?void 0:H.status)===409?z.error("This project key is already in use."):z.error(H.message??"Failed to create project")}})};return t.jsx(sn,{open:e,onOpenChange:Y=>!Y&&R(),children:t.jsxs(nn,{className:"max-w-md",children:[t.jsx(Mn,{children:t.jsx(_n,{children:"New project"})}),t.jsxs("form",{onSubmit:O,className:"flex flex-col flex-1 overflow-hidden",children:[t.jsxs(Dn,{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(Qe,{htmlFor:"project-name",children:"Name"}),t.jsx(ve,{id:"project-name",placeholder:"My Project",value:n,onChange:Y=>W(Y.target.value),onBlur:T,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(Qe,{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(ve,{id:"project-id",placeholder:"PROJ",value:a,onChange:Y=>{o(Y.target.value.toUpperCase().replace(/[^A-Z0-9]/g,"")),d(!0)},maxLength:5,className:A("font-mono",p&&"border-destructive"),"aria-invalid":p}),p&&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(Qe,{htmlFor:"project-desc",children:["Description",t.jsx("span",{className:"ml-1.5 text-xs text-muted-foreground font-normal",children:"Optional"})]}),t.jsx(ea,{id:"project-desc",placeholder:"What is this project about?",value:i,onChange:Y=>l(Y.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(Nn,{className:"h-3.5 w-3.5"}):t.jsx(kn,{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(Ul,{sensors:I,onDragEnd:P,children:t.jsx(io,{items:f.map(Y=>Y.key),strategy:Yl,children:t.jsx("div",{className:"flex flex-wrap gap-1.5",children:f.map(Y=>t.jsx(Wp,{chip:Y,onRemove:()=>h(H=>H.filter(B=>B.key!==Y.key).map((B,L)=>({...B,position:L})))},Y.key))})})}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"flex items-center gap-1.5 shrink-0",children:_a.map(Y=>t.jsx("button",{type:"button",onClick:()=>b(Y),className:A("h-4 w-4 rounded-full border-2 transition-transform hover:scale-110",D===Y?"border-foreground scale-110":"border-transparent"),style:{backgroundColor:Y}},Y))}),t.jsxs("div",{className:"flex items-center gap-1.5 flex-1",children:[t.jsx(ve,{placeholder:"Status name…",value:g,onChange:Y=>v(Y.target.value),onKeyDown:Y=>{Y.key==="Enter"&&(Y.preventDefault(),E())},className:"h-7 text-xs flex-1"}),t.jsx(J,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 shrink-0",onClick:E,disabled:!g.trim(),children:t.jsx(Be,{className:"h-3.5 w-3.5"})})]})]})]})]})]}),t.jsxs(pr,{children:[t.jsx(J,{type:"button",variant:"ghost",onClick:R,children:"Cancel"}),t.jsx(J,{type:"submit",disabled:!n.trim()||!a.trim()||!_||p||j.isPending,children:j.isPending?"Creating...":"Create project"})]})]})]})})}const _e=Yu,Fe=Hu,Se=x.forwardRef(({className:e,children:s,...n},r)=>t.jsxs(_l,{ref:r,className:A("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(Wu,{asChild:!0,children:t.jsx(Nn,{className:"h-4 w-4 opacity-50"})})]}));Se.displayName=_l.displayName;const od=x.forwardRef(({className:e,...s},n)=>t.jsx(El,{ref:n,className:A("flex cursor-default items-center justify-center py-1",e),...s,children:t.jsx(bo,{className:"h-4 w-4"})}));od.displayName=El.displayName;const id=x.forwardRef(({className:e,...s},n)=>t.jsx(Tl,{ref:n,className:A("flex cursor-default items-center justify-center py-1",e),...s,children:t.jsx(Nn,{className:"h-4 w-4"})}));id.displayName=Tl.displayName;const Ce=x.forwardRef(({className:e,children:s,position:n="popper",...r},a)=>t.jsx(Lu,{children:t.jsxs(Ol,{ref:a,className:A("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(od,{}),t.jsx(qu,{className:A("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:s}),t.jsx(id,{})]})}));Ce.displayName=Ol.displayName;const Bp=x.forwardRef(({className:e,...s},n)=>t.jsx(Al,{ref:n,className:A("px-2 py-1.5 text-xs font-medium text-muted-foreground",e),...s}));Bp.displayName=Al.displayName;const be=x.forwardRef(({className:e,children:s,...n},r)=>t.jsxs(Pl,{ref:r,className:A("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(Bu,{children:t.jsx(Pt,{className:"h-4 w-4"})})}),t.jsx(Uu,{children:s})]}));be.displayName=Pl.displayName;const Up=x.forwardRef(({className:e,...s},n)=>t.jsx(Rl,{ref:n,className:A("-mx-1 my-1 h-px bg-border",e),...s}));Up.displayName=Rl.displayName;const gr={project:e=>["projects",e,"access"]};function ld(e){return Ee({queryKey:gr.project(e),queryFn:()=>se.get(`/admin/projects/${e}/access`),enabled:!!e})}function cd(e){const s=pe();return xe({mutationFn:({userId:n,role:r})=>se.post(`/admin/projects/${e}/members`,{user_id:n,role:r}),onSuccess:()=>{s.invalidateQueries({queryKey:gr.project(e)})}})}function dd(e){const s=pe();return xe({mutationFn:n=>se.delete(`/admin/projects/${e}/members/${n}`),onSuccess:()=>{s.invalidateQueries({queryKey:gr.project(e)})}})}function ud(e){const s=pe();return xe({mutationFn:n=>se.post(`/admin/projects/${e}/teams`,{team_id:n}),onSuccess:()=>{s.invalidateQueries({queryKey:gr.project(e)})}})}function md(e){const s=pe();return xe({mutationFn:n=>se.delete(`/admin/projects/${e}/teams/${n}`),onSuccess:()=>{s.invalidateQueries({queryKey:gr.project(e)})}})}function Yp({open:e,onClose:s,projectId:n,projectName:r}){const{workspace:a}=Te(),o=(a==null?void 0:a.id)??"",{data:i,isLoading:l}=ld(n),{data:c}=cr(o),{data:d}=Co(o),u=cd(n),m=dd(n),f=ud(n),h=md(n),[g,v]=x.useState(""),[D,b]=x.useState(""),w=new Set((i==null?void 0:i.members.map(p=>p.user_id))??[]),j=new Set((i==null?void 0:i.teams.map(p=>p.team_id))??[]),y=(c??[]).filter(p=>!w.has(p.user_id)),C=(d??[]).filter(p=>!j.has(p.id));return t.jsx(Xr,{open:e,onOpenChange:p=>!p&&s(),children:t.jsxs(hr,{className:"sm:max-w-[480px]",children:[t.jsx(Zr,{children:t.jsxs(Jr,{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(p=>t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(oe,{className:"h-7 w-7 rounded-full"}),t.jsx(oe,{className:"h-3.5 w-32"})]},p))}):(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(p=>{var E;const _=p.user,I=(_==null?void 0:_.first_name)??"",W=(_==null?void 0:_.last_name)??"",T=`${I} ${W}`.trim()||(_==null?void 0:_.email)||"Unknown",R=(I[0]??W[0]??((E=_==null?void 0:_.email)==null?void 0:E[0])??"U").toUpperCase();return t.jsxs("div",{className:"flex items-center gap-2.5 py-1 group",children:[t.jsx(Dt,{className:"h-7 w-7 shrink-0",children:t.jsx(_t,{className:"text-[11px] font-medium",children:R})}),t.jsx("span",{className:"flex-1 text-sm truncate",children:T}),t.jsx("span",{className:A("text-[11px] px-1.5 py-0.5 rounded font-medium shrink-0",p.role==="manager"?"bg-indigo/10 text-indigo":"bg-muted text-muted-foreground"),children:p.role}),t.jsx("button",{onClick:()=>m.mutate(p.user_id,{onSuccess:()=>z.success("Access removed"),onError:()=>z.error("Failed to remove")}),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",children:t.jsx(Ve,{className:"h-3.5 w-3.5"})})]},p.id)})}),y.length>0&&t.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[t.jsx(lr,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),t.jsxs(_e,{value:g,onValueChange:v,children:[t.jsx(Se,{className:"h-8 text-xs flex-1",children:t.jsx(Fe,{placeholder:"Add person…"})}),t.jsx(Ce,{children:y.map(p=>{const _=p.user,I=(_==null?void 0:_.first_name)??"",W=(_==null?void 0:_.last_name)??"",T=`${I} ${W}`.trim()||(_==null?void 0:_.email)||"Unknown";return t.jsx(be,{value:p.user_id,children:T},p.user_id)})})]}),g&&t.jsx(J,{size:"sm",className:"h-8 px-3 text-xs shrink-0",disabled:u.isPending,onClick:()=>u.mutate({userId:g},{onSuccess:()=>{z.success("Access granted"),v("")},onError:()=>z.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(p=>t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(oe,{className:"h-7 w-7 rounded-lg"}),t.jsx(oe,{className:"h-3.5 w-28"})]},p))}):(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(p=>{const _=p.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(Hs,{className:"h-3.5 w-3.5 text-muted-foreground"})}),t.jsx("span",{className:"flex-1 text-sm truncate",children:(_==null?void 0:_.name)??"Unknown team"}),_&&t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[_.member_count," ",_.member_count===1?"member":"members"]}),t.jsx("button",{onClick:()=>h.mutate(p.team_id,{onSuccess:()=>z.success("Team access removed"),onError:()=>z.error("Failed to remove team")}),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",children:t.jsx(Ve,{className:"h-3.5 w-3.5"})})]},p.id)})}),C.length>0&&t.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[t.jsx(Hs,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),t.jsxs(_e,{value:D,onValueChange:b,children:[t.jsx(Se,{className:"h-8 text-xs flex-1",children:t.jsx(Fe,{placeholder:"Add team…"})}),t.jsx(Ce,{children:C.map(p=>t.jsx(be,{value:p.id,children:p.name},p.id))})]}),D&&t.jsx(J,{size:"sm",className:"h-8 px-3 text-xs shrink-0",disabled:f.isPending,onClick:()=>f.mutate(D,{onSuccess:()=>{z.success("Team access granted"),b("")},onError:()=>z.error("Failed to add team")}),children:"Add"})]})]}),t.jsx("div",{className:"flex justify-end pt-1",children:t.jsx(J,{variant:"outline",size:"sm",onClick:s,children:"Close"})})]})]})})}const fd=6048e5,Hp=864e5,pj=36e5,Mr=43200,Ti=1440,Oi=Symbol.for("constructDateFrom");function We(e,s){return typeof e=="function"?e(s):e&&typeof e=="object"&&Oi in e?e[Oi](s):e instanceof Date?new e.constructor(s):new Date(s)}function je(e,s){return We(s||e,e)}function Ro(e,s,n){const r=je(e,n==null?void 0:n.in);return isNaN(s)?We((n==null?void 0:n.in)||e,NaN):(s&&r.setDate(r.getDate()+s),r)}function hd(e,s,n){const r=je(e,n==null?void 0:n.in);if(isNaN(s))return We((n==null?void 0:n.in)||e,NaN);if(!s)return r;const a=r.getDate(),o=We((n==null?void 0:n.in)||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 Vp={};function En(){return Vp}function gn(e,s){var l,c,d,u;const n=En(),r=(s==null?void 0:s.weekStartsOn)??((c=(l=s==null?void 0:s.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,a=je(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 Xn(e,s){return gn(e,{...s,weekStartsOn:1})}function xd(e,s){const n=je(e,s==null?void 0:s.in),r=n.getFullYear(),a=We(n,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const o=Xn(a),i=We(n,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const l=Xn(i);return n.getTime()>=o.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function $r(e){const s=je(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 Ts(e,...s){const n=We.bind(null,e||s.find(r=>typeof r=="object"));return s.map(n)}function Zn(e,s){const n=je(e,s==null?void 0:s.in);return n.setHours(0,0,0,0),n}function Io(e,s,n){const[r,a]=Ts(n==null?void 0:n.in,e,s),o=Zn(r),i=Zn(a),l=+o-$r(o),c=+i-$r(i);return Math.round((l-c)/Hp)}function Kp(e,s){const n=xd(e,s),r=We(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Xn(r)}function Gp(e,s,n){return Ro(e,s*7,n)}function Qp(e,s,n){return hd(e,s*12,n)}function Xp(e,s){let n,r=s==null?void 0:s.in;return e.forEach(a=>{!r&&typeof a=="object"&&(r=We.bind(null,a));const o=je(a,r);(!n||n<o||isNaN(+o))&&(n=o)}),We(r,n||NaN)}function Zp(e,s){let n,r=s==null?void 0:s.in;return e.forEach(a=>{!r&&typeof a=="object"&&(r=We.bind(null,a));const o=je(a,r);(!n||n>o||isNaN(+o))&&(n=o)}),We(r,n||NaN)}function Pr(e,s){const n=+je(e)-+je(s);return n<0?-1:n>0?1:n}function $o(e){return We(e,Date.now())}function zo(e,s,n){const[r,a]=Ts(n==null?void 0:n.in,e,s);return+Zn(r)==+Zn(a)}function pd(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Jp(e){return!(!pd(e)&&typeof e!="number"||isNaN(+je(e)))}function Fo(e,s,n){const[r,a]=Ts(n==null?void 0:n.in,e,s),o=r.getFullYear()-a.getFullYear(),i=r.getMonth()-a.getMonth();return o*12+i}function eg(e){return s=>{const r=(e?Math[e]:Math.trunc)(s);return r===0?0:r}}function tg(e,s){return+je(e)-+je(s)}function sg(e,s){const n=je(e,s==null?void 0:s.in);return n.setHours(23,59,59,999),n}function gd(e,s){const n=je(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 ng(e,s){const n=je(e,s==null?void 0:s.in);return+sg(n,s)==+gd(n,s)}function rg(e,s,n){const[r,a,o]=Ts(n==null?void 0:n.in,e,e,s),i=Pr(a,o),l=Math.abs(Fo(a,o));if(l<1)return 0;a.getMonth()===1&&a.getDate()>27&&a.setDate(30),a.setMonth(a.getMonth()-i*l);let c=Pr(a,o)===-i;ng(r)&&l===1&&Pr(r,o)===1&&(c=!1);const d=i*(l-+c);return d===0?0:d}function ag(e,s,n){const r=tg(e,s)/1e3;return eg(n==null?void 0:n.roundingMethod)(r)}function bd(e,s){const[n,r]=Ts(e,s.start,s.end);return{start:n,end:r}}function og(e,s){const{start:n,end:r}=bd(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 c=[];for(;+i<=o;)c.push(We(n,i)),i.setMonth(i.getMonth()+l);return a?c.reverse():c}function ig(e,s){const n=je(e,s==null?void 0:s.in);return n.setDate(1),n.setHours(0,0,0,0),n}function lg(e,s){const n=je(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 yd(e,s){const n=je(e,s==null?void 0:s.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function cg(e,s){const{start:n,end:r}=bd(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 c=[];for(;+i<=o;)c.push(We(n,i)),i.setFullYear(i.getFullYear()+l);return a?c.reverse():c}function vd(e,s){var l,c,d,u;const n=En(),r=(s==null?void 0:s.weekStartsOn)??((c=(l=s==null?void 0:s.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,a=je(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 dg(e,s){return vd(e,{...s,weekStartsOn:1})}const ug={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"}},mg=(e,s,n)=>{let r;const a=ug[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 Ea(e){return(s={})=>{const n=s.width?String(s.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const fg={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},hg={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},xg={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},pg={date:Ea({formats:fg,defaultWidth:"full"}),time:Ea({formats:hg,defaultWidth:"full"}),dateTime:Ea({formats:xg,defaultWidth:"full"})},gg={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},bg=(e,s,n,r)=>gg[e];function Fn(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 yg={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},vg={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},jg={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"]},wg={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"]},Ng={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"}},kg={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"}},Sg=(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"},Cg={ordinalNumber:Sg,era:Fn({values:yg,defaultWidth:"wide"}),quarter:Fn({values:vg,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Fn({values:jg,defaultWidth:"wide"}),day:Fn({values:wg,defaultWidth:"wide"}),dayPeriod:Fn({values:Ng,defaultWidth:"wide",formattingValues:kg,defaultFormattingWidth:"wide"})};function Wn(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],c=Array.isArray(l)?Dg(l,m=>m.test(i)):Mg(l,m=>m.test(i));let d;d=e.valueCallback?e.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const u=s.slice(i.length);return{value:d,rest:u}}}function Mg(e,s){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&s(e[n]))return n}function Dg(e,s){for(let n=0;n<e.length;n++)if(s(e[n]))return n}function _g(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 Eg=/^(\d+)(th|st|nd|rd)?/i,Tg=/\d+/i,Og={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},Ag={any:[/^b/i,/^(a|c)/i]},Pg={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Rg={any:[/1/i,/2/i,/3/i,/4/i]},Ig={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},$g={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]},zg={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},Fg={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]},Wg={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},Lg={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}},qg={ordinalNumber:_g({matchPattern:Eg,parsePattern:Tg,valueCallback:e=>parseInt(e,10)}),era:Wn({matchPatterns:Og,defaultMatchWidth:"wide",parsePatterns:Ag,defaultParseWidth:"any"}),quarter:Wn({matchPatterns:Pg,defaultMatchWidth:"wide",parsePatterns:Rg,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Wn({matchPatterns:Ig,defaultMatchWidth:"wide",parsePatterns:$g,defaultParseWidth:"any"}),day:Wn({matchPatterns:zg,defaultMatchWidth:"wide",parsePatterns:Fg,defaultParseWidth:"any"}),dayPeriod:Wn({matchPatterns:Wg,defaultMatchWidth:"any",parsePatterns:Lg,defaultParseWidth:"any"})},zs={code:"en-US",formatDistance:mg,formatLong:pg,formatRelative:bg,localize:Cg,match:qg,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Bg(e,s){const n=je(e,s==null?void 0:s.in);return Io(n,yd(n))+1}function Wo(e,s){const n=je(e,s==null?void 0:s.in),r=+Xn(n)-+Kp(n);return Math.round(r/fd)+1}function jd(e,s){var u,m,f,h;const n=je(e,s==null?void 0:s.in),r=n.getFullYear(),a=En(),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=We((s==null?void 0:s.in)||e,0);i.setFullYear(r+1,0,o),i.setHours(0,0,0,0);const l=gn(i,s),c=We((s==null?void 0:s.in)||e,0);c.setFullYear(r,0,o),c.setHours(0,0,0,0);const d=gn(c,s);return+n>=+l?r+1:+n>=+d?r:r-1}function Ug(e,s){var l,c,d,u;const n=En(),r=(s==null?void 0:s.firstWeekContainsDate)??((c=(l=s==null?void 0:s.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,a=jd(e,s),o=We((s==null?void 0:s.in)||e,0);return o.setFullYear(a,0,r),o.setHours(0,0,0,0),gn(o,s)}function Lo(e,s){const n=je(e,s==null?void 0:s.in),r=+gn(n,s)-+Ug(n,s);return Math.round(r/fd)+1}function ke(e,s){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(s,"0");return n+r}const js={y(e,s){const n=e.getFullYear(),r=n>0?n:1-n;return ke(s==="yy"?r%100:r,s.length)},M(e,s){const n=e.getMonth();return s==="M"?String(n+1):ke(n+1,2)},d(e,s){return ke(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 ke(e.getHours()%12||12,s.length)},H(e,s){return ke(e.getHours(),s.length)},m(e,s){return ke(e.getMinutes(),s.length)},s(e,s){return ke(e.getSeconds(),s.length)},S(e,s){const n=s.length,r=e.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return ke(a,s.length)}},an={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ai={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 js.y(e,s)},Y:function(e,s,n,r){const a=jd(e,r),o=a>0?a:1-a;if(s==="YY"){const i=o%100;return ke(i,2)}return s==="Yo"?n.ordinalNumber(o,{unit:"year"}):ke(o,s.length)},R:function(e,s){const n=xd(e);return ke(n,s.length)},u:function(e,s){const n=e.getFullYear();return ke(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 ke(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 ke(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 js.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 ke(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=Lo(e,r);return s==="wo"?n.ordinalNumber(a,{unit:"week"}):ke(a,s.length)},I:function(e,s,n){const r=Wo(e);return s==="Io"?n.ordinalNumber(r,{unit:"week"}):ke(r,s.length)},d:function(e,s,n){return s==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):js.d(e,s)},D:function(e,s,n){const r=Bg(e);return s==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):ke(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 ke(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 ke(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 ke(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=an.noon:r===0?a=an.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=an.evening:r>=12?a=an.afternoon:r>=4?a=an.morning:a=an.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 js.h(e,s)},H:function(e,s,n){return s==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):js.H(e,s)},K:function(e,s,n){const r=e.getHours()%12;return s==="Ko"?n.ordinalNumber(r,{unit:"hour"}):ke(r,s.length)},k:function(e,s,n){let r=e.getHours();return r===0&&(r=24),s==="ko"?n.ordinalNumber(r,{unit:"hour"}):ke(r,s.length)},m:function(e,s,n){return s==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):js.m(e,s)},s:function(e,s,n){return s==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):js.s(e,s)},S:function(e,s){return js.S(e,s)},X:function(e,s,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(s){case"X":return Ri(r);case"XXXX":case"XX":return Is(r);case"XXXXX":case"XXX":default:return Is(r,":")}},x:function(e,s,n){const r=e.getTimezoneOffset();switch(s){case"x":return Ri(r);case"xxxx":case"xx":return Is(r);case"xxxxx":case"xxx":default:return Is(r,":")}},O:function(e,s,n){const r=e.getTimezoneOffset();switch(s){case"O":case"OO":case"OOO":return"GMT"+Pi(r,":");case"OOOO":default:return"GMT"+Is(r,":")}},z:function(e,s,n){const r=e.getTimezoneOffset();switch(s){case"z":case"zz":case"zzz":return"GMT"+Pi(r,":");case"zzzz":default:return"GMT"+Is(r,":")}},t:function(e,s,n){const r=Math.trunc(+e/1e3);return ke(r,s.length)},T:function(e,s,n){return ke(+e,s.length)}};function Pi(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+ke(o,2)}function Ri(e,s){return e%60===0?(e>0?"-":"+")+ke(Math.abs(e)/60,2):Is(e,s)}function Is(e,s=""){const n=e>0?"-":"+",r=Math.abs(e),a=ke(Math.trunc(r/60),2),o=ke(r%60,2);return n+a+s+o}const Ii=(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"})}},wd=(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"})}},Yg=(e,s)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return Ii(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}}",Ii(r,s)).replace("{{time}}",wd(a,s))},Hg={p:wd,P:Yg},Vg=/^D+$/,Kg=/^Y+$/,Gg=["D","DD","YY","YYYY"];function Qg(e){return Vg.test(e)}function Xg(e){return Kg.test(e)}function Zg(e,s,n){const r=Jg(e,s,n);if(console.warn(r),Gg.includes(e))throw new RangeError(r)}function Jg(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 eb=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,tb=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,sb=/^'([^]*?)'?$/,nb=/''/g,rb=/[a-zA-Z]/;function ue(e,s,n){var u,m,f,h,g,v,D,b;const r=En(),a=(n==null?void 0:n.locale)??r.locale??zs,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=(D=r.locale)==null?void 0:D.options)==null?void 0:b.weekStartsOn)??0,l=je(e,n==null?void 0:n.in);if(!Jp(l))throw new RangeError("Invalid time value");let c=s.match(tb).map(w=>{const j=w[0];if(j==="p"||j==="P"){const y=Hg[j];return y(w,a.formatLong)}return w}).join("").match(eb).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const j=w[0];if(j==="'")return{isToken:!1,value:ab(w)};if(Ai[j])return{isToken:!0,value:w};if(j.match(rb))throw new RangeError("Format string contains an unescaped latin alphabet character `"+j+"`");return{isToken:!1,value:w}});a.localize.preprocessor&&(c=a.localize.preprocessor(l,c));const d={firstWeekContainsDate:o,weekStartsOn:i,locale:a};return c.map(w=>{if(!w.isToken)return w.value;const j=w.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&Xg(j)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&Qg(j))&&Zg(j,s,String(e));const y=Ai[j[0]];return y(l,j,a.localize,d)}).join("")}function ab(e){const s=e.match(sb);return s?s[1].replace(nb,"'"):e}function ob(e,s,n){const r=En(),a=(n==null?void 0:n.locale)??r.locale??zs,o=2520,i=Pr(e,s);if(isNaN(i))throw new RangeError("Invalid time value");const l=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:i}),[c,d]=Ts(n==null?void 0:n.in,...i>0?[s,e]:[e,s]),u=ag(d,c),m=($r(d)-$r(c))/1e3,f=Math.round((u-m)/60);let h;if(f<2)return n!=null&&n.includeSeconds?u<5?a.formatDistance("lessThanXSeconds",5,l):u<10?a.formatDistance("lessThanXSeconds",10,l):u<20?a.formatDistance("lessThanXSeconds",20,l):u<40?a.formatDistance("halfAMinute",0,l):u<60?a.formatDistance("lessThanXMinutes",1,l):a.formatDistance("xMinutes",1,l):f===0?a.formatDistance("lessThanXMinutes",1,l):a.formatDistance("xMinutes",f,l);if(f<45)return a.formatDistance("xMinutes",f,l);if(f<90)return a.formatDistance("aboutXHours",1,l);if(f<Ti){const g=Math.round(f/60);return a.formatDistance("aboutXHours",g,l)}else{if(f<o)return a.formatDistance("xDays",1,l);if(f<Mr){const g=Math.round(f/Ti);return a.formatDistance("xDays",g,l)}else if(f<Mr*2)return h=Math.round(f/Mr),a.formatDistance("aboutXMonths",h,l)}if(h=rg(d,c),h<12){const g=Math.round(f/Mr);return a.formatDistance("xMonths",g,l)}else{const g=h%12,v=Math.trunc(h/12);return g<3?a.formatDistance("aboutXYears",v,l):g<9?a.formatDistance("overXYears",v,l):a.formatDistance("almostXYears",v+1,l)}}function ib(e,s){return ob(e,$o(e),s)}function lb(e,s){const n=je(e,s==null?void 0:s.in),r=n.getFullYear(),a=n.getMonth(),o=We(n,0);return o.setFullYear(r,a+1,0),o.setHours(0,0,0,0),o.getDate()}function cb(e,s){return je(e,s==null?void 0:s.in).getMonth()}function db(e,s){return je(e,s==null?void 0:s.in).getFullYear()}function ub(e,s){return+je(e)>+je(s)}function mb(e,s){return+je(e)<+je(s)}function fb(e,s,n){const[r,a]=Ts(n==null?void 0:n.in,e,s);return r.getFullYear()===a.getFullYear()&&r.getMonth()===a.getMonth()}function hb(e,s,n){const[r,a]=Ts(n==null?void 0:n.in,e,s);return r.getFullYear()===a.getFullYear()}function xb(e,s){return zo(We(e,e),$o(e))}function pb(e,s,n){return Ro(e,-1,n)}function gb(e,s){return zo(We(e,e),pb($o(e)))}function bb(e,s,n){const r=je(e,n==null?void 0:n.in),a=r.getFullYear(),o=r.getDate(),i=We(e,0);i.setFullYear(a,s,15),i.setHours(0,0,0,0);const l=lb(i);return r.setMonth(s,Math.min(o,l)),r}function yb(e,s,n){const r=je(e,n==null?void 0:n.in);return isNaN(+r)?We(e,NaN):(r.setFullYear(s),r)}function vb(){const[e,s]=x.useState(!1),[n,r]=x.useState(null),[a,o]=x.useState(""),{workspace:i}=pt(),{data:l,isLoading:c}=dr(),d=hx(),u=ot(),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(J,{size:"sm",onClick:()=>s(!0),children:[t.jsx(Be,{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(J,{variant:"outline",size:"sm",className:"text-xs h-8",children:"Add filter"})}),t.jsxs("div",{className:"relative",children:[t.jsx(Vr,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),t.jsx(ve,{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",{})]}),c?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(oe,{className:"h-4 w-48"}),t.jsx(oe,{className:"h-4 w-12"}),t.jsx(oe,{className:"h-5 w-16 rounded-full"}),t.jsx(oe,{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(J,{size:"sm",onClick:()=>s(!0),children:[t.jsx(Be,{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:A("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:A("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:ue(new Date(f.created_at),"MMM d, yyyy")}),t.jsx("div",{className:"flex justify-end",onClick:h=>h.stopPropagation(),children:t.jsxs(en,{children:[t.jsx(tn,{asChild:!0,children:t.jsx(J,{variant:"ghost",size:"icon-sm",className:"h-7 w-7 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(ar,{className:"h-4 w-4"})})}),t.jsxs(Es,{align:"end",children:[t.jsxs(ut,{onClick:()=>u(`/${i}/projects/${f.identifier}/board`),children:[t.jsx(Vt,{className:"h-4 w-4"}),"Open board"]}),t.jsxs(ut,{onClick:()=>u(`/${i}/projects/${f.identifier}/issues`),children:[t.jsx(Sn,{className:"h-4 w-4"}),"View issues"]}),t.jsxs(ut,{onClick:()=>r({id:f.id,name:f.name}),children:[t.jsx(Yr,{className:"h-4 w-4"}),"Manage access"]}),t.jsx(ur,{}),t.jsxs(ut,{className:"text-destructive focus:text-destructive",onClick:()=>{confirm(`Delete "${f.name}"? This cannot be undone.`)&&d.mutate(f.id,{onSuccess:()=>z.success("Project deleted"),onError:()=>z.error("Failed to delete project")})},children:[t.jsx(xs,{className:"h-4 w-4"}),"Delete"]})]})]})})]},f.id))}),!c&&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(J,{variant:"ghost",size:"sm",className:"h-7 text-xs",disabled:!0,children:"Prev"}),t.jsx(J,{variant:"ghost",size:"sm",className:"h-7 text-xs",disabled:!0,children:"Next"})]})]})]}),t.jsx(qp,{open:e,onClose:()=>s(!1)}),n&&t.jsx(Yp,{open:!!n,onClose:()=>r(null),projectId:n.id,projectName:n.name})]})}const qo={byProject:e=>["projects",e,"statuses"]};function Tn(e){return Ee({queryKey:qo.byProject(e??""),queryFn:()=>se.get(`/admin/projects/${e}/statuses`),select:s=>s.statuses,enabled:!!e})}function jb(e){const s=pe();return xe({mutationFn:n=>se.post(`/admin/projects/${e}/statuses`,n),onSuccess:()=>{s.invalidateQueries({queryKey:qo.byProject(e)})}})}function wb(e){const s=pe();return xe({mutationFn:n=>se.post(`/admin/projects/${e}/statuses/reorder`,{orderedIds:n}),onSuccess:()=>{s.invalidateQueries({queryKey:qo.byProject(e)})}})}const Bo={all:["users"],list:()=>[...Bo.all,"list"]};function Nd(){return Ee({queryKey:Bo.list(),queryFn:()=>se.get("/admin/users"),select:e=>e.users,staleTime:1e3*60*5})}function kd(){return Ee({queryKey:[...Bo.list(),"map"],queryFn:()=>se.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 Gs={backlog:"Backlog",todo:"Todo",in_progress:"In Progress",in_review:"In Review",done:"Done",cancelled:"Cancelled"},hs={urgent:"Urgent",high:"High",medium:"Medium",low:"Low",none:"None"},Sd={urgent:"text-red-500",high:"text-orange-500",medium:"text-yellow-500",low:"text-blue-400",none:"text-zinc-400"},Cs={task:"Task",bug:"Bug",feature:"Feature",improvement:"Improvement",epic:"Epic"},Nb=({priority:e})=>{const s=A("h-3 w-3 shrink-0",Sd[e]);switch(e){case"urgent":return t.jsx(Cn,{className:s});case"high":return t.jsx(Ur,{className:s});case"medium":return t.jsx(ir,{className:s});case"low":return t.jsx(Br,{className:s});default:return t.jsx(ts,{className:"h-3 w-3 shrink-0 text-zinc-300"})}};function Cd({issue:e,childCount:s=0,onClick:n}){var m,f;const{data:r}=kd(),{attributes:a,listeners:o,setNodeRef:i,transform:l,transition:c,isDragging:d}=lo({id:e.id}),u={transform:co.Transform.toString(l),transition:c};return t.jsxs("div",{ref:i,style:u,...a,...o,onClick:n,className:A("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.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[t.jsx("span",{className:"text-[11px] font-mono text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-950/50 px-1 py-0.5 rounded shrink-0",children:e.identifier}),e.parent_id&&t.jsx("span",{className:"flex items-center text-zinc-400 dark:text-zinc-500 shrink-0",title:"Child issue",children:t.jsx(Bs,{className:"h-3 w-3"})}),s>0&&t.jsxs("span",{className:"flex items-center gap-0.5 text-[10px] font-medium text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-950/50 px-1 py-0.5 rounded shrink-0",children:[t.jsx(Bs,{className:"h-2.5 w-2.5"}),s]})]}),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(h=>{const g=r==null?void 0:r.get(h);return t.jsx(Dt,{className:"h-4 w-4 border border-background",children:t.jsx(_t,{className:"text-[8px] bg-indigo-100 text-indigo-700 dark:bg-indigo-900/50 dark:text-indigo-300",children:(g==null?void 0:g.initials)??"?"})},h)}),(((m=e.assignee_ids)==null?void 0:m.length)??0)>2&&t.jsxs("span",{className:"text-[9px] text-muted-foreground ml-1.5 self-center",children:["+",(((f=e.assignee_ids)==null?void 0:f.length)??0)-2]})]}),t.jsx(Nb,{priority:e.priority})]})]})]})}function Dr(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 kb=({category:e,color:s})=>{const n="h-3.5 w-3.5 shrink-0",r={color:s};switch(e){case"completed":return t.jsx(Zs,{className:n,style:r});case"started":return t.jsx(_s,{className:n,style:r});default:return t.jsx(ts,{className:n,style:r})}};function Sb({id:e,label:s,color:n,category:r,issues:a,childCounts:o,sortable:i,onIssueClick:l}){const{setNodeRef:c,isOver:d}=sm({id:e}),{attributes:u,listeners:m,setNodeRef:f,transform:h,transition:g,isDragging:v}=lo({id:e,disabled:!i}),D=i?{transform:co.Transform.toString(h),transition:g}:void 0,b=Dr(n,.08),w=Dr(n,.16),j=Dr(n,.35);return t.jsxs("div",{ref:f,style:D,className:A("flex flex-col min-w-[260px] max-w-[280px] w-full",v&&"opacity-50"),children:[t.jsxs("div",{className:A("flex items-center gap-2 mb-2 px-1",i&&"cursor-grab"),children:[i&&t.jsx("span",{...u,...m,className:"text-muted-foreground/40 hover:text-muted-foreground touch-none",children:t.jsx(Nc,{className:"h-3.5 w-3.5"})}),t.jsx(kb,{category:r,color:n}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:s}),t.jsx("span",{className:"ml-1 text-[11px] font-medium rounded-full px-1.5 py-0.5 tabular-nums min-w-[18px] text-center",style:{backgroundColor:Dr(n,.12),color:n},children:a.length})]}),t.jsxs("div",{ref:c,className:A("flex-1 flex flex-col gap-2 min-h-[200px] p-2 rounded-xl transition-colors"),style:{backgroundColor:d?w:b,boxShadow:d?`inset 0 0 0 1px ${j}`:void 0},children:[t.jsx(io,{items:a.map(y=>y.id),strategy:nm,children:a.map(y=>t.jsx(Cd,{issue:y,childCount:(o==null?void 0:o.get(y.id))??0,onClick:()=>l==null?void 0:l(y)},y.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 Ta=["#94a3b8","#64748b","#6366f1","#f59e0b","#10b981","#ef4444","#3b82f6","#8b5cf6"],Cb=[{value:"backlog",label:"Backlog"},{value:"unstarted",label:"Not Started"},{value:"started",label:"In Progress"},{value:"completed",label:"Done"},{value:"cancelled",label:"Cancelled"}];function Mb({open:e,onClose:s,projectId:n}){const[r,a]=x.useState(""),[o,i]=x.useState(Ta[0]),[l,c]=x.useState(""),[d,u]=x.useState("started"),m=jb(n),f=l||o,h=()=>{r.trim()&&m.mutate({name:r.trim(),color:f,category:d},{onSuccess:()=>{z.success("Status created"),a(""),i(Ta[0]),c(""),u("started"),s()},onError:()=>z.error("Failed to create status")})};return t.jsx(sn,{open:e,onOpenChange:g=>!g&&s(),children:t.jsxs(nn,{className:"sm:max-w-sm",children:[t.jsx(Mn,{children:t.jsx(_n,{className:"text-sm font-medium",children:"New Status"})}),t.jsx(Dn,{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(ve,{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:[Ta.map(g=>t.jsx("button",{onClick:()=>{i(g),c("")},className:A("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(ve,{placeholder:"#hex",value:l,onChange:g=>c(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(_e,{value:d,onValueChange:g=>u(g),children:[t.jsx(Se,{className:"h-8 text-xs",children:t.jsx(Fe,{})}),t.jsx(Ce,{children:Cb.map(g=>t.jsx(be,{value:g.value,className:"text-xs",children:g.label},g.value))})]})]})]})}),t.jsxs(pr,{className:"mt-2",children:[t.jsx(J,{variant:"ghost",size:"sm",onClick:s,className:"text-xs",children:"Cancel"}),t.jsx(J,{size:"sm",onClick:h,disabled:!r.trim()||m.isPending,className:"text-xs",children:"Create"})]})]})})}function Db({projectId:e}){const[s,n]=x.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(Be,{className:"h-3.5 w-3.5"}),"Add status"]})}),t.jsx(Mb,{open:s,onClose:()=>n(!1),projectId:e})]})}function Oa(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 _b(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 c=r.get(l.id);c&&c.status===i.key&&(a[i.key].push(c),r.delete(l.id))}for(const i of r.values()){const l=a[i.status];if(l)l.push(i);else{const c=(o=n[0])==null?void 0:o.key;c&&a[c].push(i)}}return a}function Eb({issues:e,projectId:s,statuses:n,onIssueClick:r,onColumnsReorder:a}){const[o,i]=x.useState(()=>n.map(T=>T.id)),[l,c]=x.useState(()=>Oa(e,n)),[d,u]=x.useState(null),[m,f]=x.useState(null),h=x.useRef(null),g=x.useRef(!1),v=pe(),D=x.useMemo(()=>{const T=new Map;for(const R of e)R.parent_id&&T.set(R.parent_id,(T.get(R.parent_id)??0)+1);return T},[e]);x.useEffect(()=>{g.current||c(T=>_b(T,e,n))},[e,n]);const b=[...n].sort((T,R)=>{const E=o.indexOf(T.id),P=o.indexOf(R.id);return E===-1&&P===-1?T.position-R.position:E===-1?1:P===-1?-1:E-P}),w=Ll(ql(Bl,{activationConstraint:{distance:5}})),j=x.useCallback(T=>{if(m){const R=T.droppableContainers.filter(E=>o.includes(E.id));return rm({...T,droppableContainers:R})}return am(T)},[m,o]),y=x.useCallback(T=>{for(const[R,E]of Object.entries(l))if(E.some(P=>P.id===T))return R;return null},[l]),C=x.useCallback(T=>n.some(R=>R.id===T),[n]),p=T=>{const R=T.active.id;if(g.current=!0,C(R)){f(R);return}for(const[E,P]of Object.entries(l)){const O=P.find(V=>V.id===R);if(O){u(O),h.current=E;return}}},_=T=>{const{active:R,over:E}=T;if(!E||m)return;const P=R.id,O=E.id;if(C(P))return;const V=y(P),Y=n.find(B=>B.key===O||B.id===O),H=(Y==null?void 0:Y.key)??y(O);!V||!H||V===H||c(B=>{const L=[...B[V]??[]],te=[...B[H]??[]],Z=L.findIndex(Q=>Q.id===P);if(Z===-1)return B;const[S]=L.splice(Z,1),$={...S,status:H};if(Y)te.push($);else{const Q=te.findIndex(F=>F.id===O);if(Q===-1)te.push($);else{const F=R.rect.current.translated!=null&&R.rect.current.translated.top>E.rect.top+E.rect.height/2;te.splice(F?Q+1:Q,0,$)}}return{...B,[V]:L,[H]:te}})},I=T=>{var B;const{active:R,over:E}=T;if(u(null),g.current=!1,m){if(f(null),!E||R.id===E.id)return;const L=o.indexOf(R.id),te=o.indexOf(E.id);if(L===-1||te===-1||L===te)return;const Z=Ar(o,L,te);i(Z),a==null||a(Z);return}if(!E){const L=h.current;h.current=null,L&&c(Oa(e,n));return}const P=R.id,O=E.id,V=h.current;h.current=null;const Y=n.find(L=>L.key===O||L.id===O),H=(Y==null?void 0:Y.key)??y(O);if(!(!V||!H))if(V===H)c(L=>{const te=L[V]??[],Z=te.findIndex($=>$.id===P),S=te.findIndex($=>$.id===O);return Z===-1||S===-1||Z===S?L:{...L,[V]:Ar(te,Z,S)}});else{if(!n.find(Z=>Z.key===O||Z.id===O))c(Z=>{const S=[...Z[H]??[]],$=S.findIndex(me=>me.id===P);if($===-1)return Z;const Q=T.active.rect.current.translated!=null&&T.active.rect.current.translated.top>T.over.rect.top+T.over.rect.height/2,[F]=S.splice($,1),M=S.findIndex(me=>me.id===O);if(M===-1)return S.splice($,0,F),Z;const q=Q?M+1:M;return S.splice(q,0,F),{...Z,[H]:S}});else{const Z=((B=T.active.rect.current.translated)==null?void 0:B.top)??1/0,S=T.over.rect.top+T.over.rect.height/2;Z<S&&c($=>{const Q=$[H]??[],F=Q.findIndex(M=>M.id===P);return F<=0?$:{...$,[H]:Ar(Q,F,0)}})}const te=v.getQueryData(Le.byProject(s));v.setQueryData(Le.byProject(s),Z=>Z&&{...Z,issues:Z.issues.map(S=>S.id===P?{...S,status:H}:S)}),se.put(`/admin/issues/${P}`,{status:H}).then(()=>{v.invalidateQueries({queryKey:Le.byProject(s)})}).catch(()=>{te&&v.setQueryData(Le.byProject(s),te),c(Oa((te==null?void 0:te.issues)??e,n)),z.error("Failed to update issue status")})}},W=m?n.find(T=>T.id===m):null;return t.jsxs(Ul,{sensors:w,collisionDetection:j,onDragStart:p,onDragOver:_,onDragEnd:I,children:[t.jsxs("div",{className:"flex gap-4 h-full overflow-x-auto px-6 py-4 pb-6",children:[t.jsx(io,{items:o,strategy:Yl,children:b.map(T=>t.jsx(Sb,{id:T.id,label:T.name,color:T.color,category:T.category,issues:l[T.key]??[],childCounts:D,sortable:!0,onIssueClick:r},T.id))}),t.jsx(Db,{projectId:s})]}),t.jsxs(om,{children:[d&&t.jsx(Cd,{issue:d}),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 bn={all:["sprints"],byProject:e=>["sprints","project",e],detail:e=>["sprints",e]};function On(e){return Ee({queryKey:e?bn.byProject(e):bn.all,queryFn:()=>{const s=e?`/admin/sprints?project_id=${e}`:"/admin/sprints";return se.get(s)},select:s=>s.sprints,enabled:!!e})}function Tb(e){const s=pe();return xe({mutationFn:n=>se.post("/admin/sprints",{...n,project_id:e}),onSuccess:()=>{s.invalidateQueries({queryKey:bn.byProject(e)})}})}function Ob(e,s){const n=pe();return xe({mutationFn:r=>se.put(`/admin/sprints/${e}`,r),onSuccess:()=>{n.invalidateQueries({queryKey:bn.byProject(s)}),n.invalidateQueries({queryKey:bn.detail(e)})}})}function Ab(e){const s=pe();return xe({mutationFn:n=>se.delete(`/admin/sprints/${n}`),onSuccess:()=>{s.invalidateQueries({queryKey:bn.byProject(e)})}})}const ta={byProject:e=>["task-lists","project",e]};function br(e){return Ee({queryKey:e?ta.byProject(e):["task-lists"],queryFn:()=>se.get(`/admin/projects/${e}/task-lists`),select:s=>s.task_lists,enabled:!!e})}function Pb(e){const s=pe();return xe({mutationFn:n=>se.post(`/admin/projects/${e}/task-lists`,n),onSuccess:()=>{s.invalidateQueries({queryKey:ta.byProject(e)})}})}function Rb(e){const s=pe();return xe({mutationFn:({id:n,...r})=>se.put(`/admin/task-lists/${n}`,r),onSuccess:()=>{s.invalidateQueries({queryKey:ta.byProject(e)})}})}function Ib(e){const s=pe();return xe({mutationFn:n=>se.delete(`/admin/task-lists/${n}`),onSuccess:()=>{s.invalidateQueries({queryKey:ta.byProject(e)}),s.invalidateQueries({queryKey:Le.byProject(e)})}})}const mt=Ku,ft=Gu,at=x.forwardRef(({className:e,align:s="center",sideOffset:n=4,...r},a)=>t.jsx(Vu,{children:t.jsx(Il,{ref:a,align:s,sideOffset:n,className:A("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})}));at.displayName=Il.displayName;function $i(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 zi(e,s,n){return`${e??""} ${s??""}`.trim()||n}function yr({value:e,onChange:s,disabled:n}){const[r,a]=x.useState(!1),[o,i]=x.useState(e),{data:l}=Nd(),c=e.slice().sort().join(",");x.useEffect(()=>{i(e)},[c]);const d=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(mt,{open:r,onOpenChange:a,children:[t.jsx(ft,{asChild:!0,disabled:n,children:t.jsx("button",{type:"button",className:A("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(lr,{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(Dt,{className:"h-5 w-5 border border-background ring-0",children:t.jsx(_t,{className:"text-[9px] bg-indigo-100 text-indigo-700 dark:bg-indigo-900/50 dark:text-indigo-300",children:$i(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?zi(u[0].first_name,u[0].last_name,u[0].email):`${u.length} assignees`})]})})}),t.jsx(at,{className:"w-60 p-0",align:"start",children:t.jsxs(fn,{children:[t.jsx(Oo,{placeholder:"Search users...",className:"h-8 text-xs"}),t.jsxs(hn,{children:[t.jsx(Ao,{className:"text-xs py-4",children:"No users found."}),t.jsx(Ys,{children:(l??[]).map(m=>{const f=o.includes(m.id),h=zi(m.first_name,m.last_name,m.email),g=$i(m.first_name,m.last_name,m.email);return t.jsxs(Ut,{value:h,onSelect:()=>d(m.id),className:"gap-2 py-1.5",children:[t.jsx(Dt,{className:"h-5 w-5 shrink-0",children:t.jsx(_t,{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(Pt,{className:A("h-3.5 w-3.5 shrink-0",f?"opacity-100 text-indigo-500":"opacity-0")})]},m.id)})})]})]})})]})}function $b(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 Aa={},Hn={};function Fs(e,s){try{const r=(Aa[e]||(Aa[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(s).split("GMT")[1];return r in Hn?Hn[r]:Fi(r,r.split(":"))}catch{if(e in Hn)return Hn[e];const n=e==null?void 0:e.match(zb);return n?Fi(e,n.slice(1)):NaN}}const zb=/([+-]\d\d):?(\d\d)?/;function Fi(e,s){const n=+(s[0]||0),r=+(s[1]||0),a=+(s[2]||0)/60;return Hn[e]=n*60+r>0?n*60+r+a:n*60-r-a}class es extends Date{constructor(...s){super(),s.length>1&&typeof s[s.length-1]=="string"&&(this.timeZone=s.pop()),this.internal=new Date,isNaN(Fs(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)),Md(this),eo(this)):this.setTime(Date.now())}static tz(s,...n){return n.length?new es(...n,s):new es(Date.now(),s)}withTimeZone(s){return new es(+this,s)}getTimezoneOffset(){const s=-Fs(this.timeZone,this);return s>0?Math.floor(s):Math.ceil(s)}setTime(s){return Date.prototype.setTime.apply(this,arguments),eo(this),+this}[Symbol.for("constructDateFrom")](s){return new es(+new Date(s),this.timeZone)}}const Wi=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!Wi.test(e))return;const s=e.replace(Wi,"$1UTC");es.prototype[s]&&(e.startsWith("get")?es.prototype[e]=function(){return this.internal[s]()}:(es.prototype[e]=function(){return Date.prototype[s].apply(this.internal,arguments),Fb(this),+this},es.prototype[s]=function(){return Date.prototype[s].apply(this,arguments),eo(this),+this}))});function eo(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-Fs(e.timeZone,e)*60))}function Fb(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()),Md(e)}function Md(e){const s=Fs(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 c=a-n;c&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+c);const d=new Date(+e);d.setUTCSeconds(0);const u=a>0?d.getSeconds():(d.getSeconds()-60)%60,m=Math.round(-(Fs(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=Fs(e.timeZone,e),h=f>0?Math.floor(f):Math.ceil(f),v=-new Date(+e).getTimezoneOffset()-h,D=h!==n,b=v-c;if(D&&b){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+b);const w=Fs(e.timeZone,e),j=w>0?Math.floor(w):Math.ceil(w),y=h-j;y&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+y),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+y))}}class rt extends es{static tz(s,...n){return n.length?new rt(...n,s):new rt(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} (${$b(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 rt(+this,s)}[Symbol.for("constructDateFrom")](s){return new rt(+new Date(s),this.timeZone)}}const Li=5,Wb=4;function Lb(e,s){const n=s.startOfMonth(e),r=n.getDay()>0?n.getDay():7,a=s.addDays(e,-r+1),o=s.addDays(a,Li*7-1);return s.getMonth(e)===s.getMonth(o)?Li:Wb}function Dd(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 qb(e,s){const n=Dd(e,s),r=Lb(e,s);return s.addDays(n,r*7-1)}const _d={...zs,labels:{labelDayButton:(e,s,n,r)=>{let a;r&&typeof r.format=="function"?a=r.format.bind(r):a=(i,l)=>ue(i,l,{locale:zs,...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)=>ue(a,o,{locale:zs,...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)=>ue(i,l,{locale:zs,...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)=>ue(a,o,{locale:zs,...s}),r(e,"cccc")}}};class Et{constructor(s,n){this.Date=Date,this.today=()=>{var r;return(r=this.overrides)!=null&&r.today?this.overrides.today():this.options.timeZone?rt.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 rt(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):Ro(r,a)},this.addMonths=(r,a)=>{var o;return(o=this.overrides)!=null&&o.addMonths?this.overrides.addMonths(r,a):hd(r,a)},this.addWeeks=(r,a)=>{var o;return(o=this.overrides)!=null&&o.addWeeks?this.overrides.addWeeks(r,a):Gp(r,a)},this.addYears=(r,a)=>{var o;return(o=this.overrides)!=null&&o.addYears?this.overrides.addYears(r,a):Qp(r,a)},this.differenceInCalendarDays=(r,a)=>{var o;return(o=this.overrides)!=null&&o.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,a):Io(r,a)},this.differenceInCalendarMonths=(r,a)=>{var o;return(o=this.overrides)!=null&&o.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,a):Fo(r,a)},this.eachMonthOfInterval=r=>{var a;return(a=this.overrides)!=null&&a.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):og(r)},this.eachYearOfInterval=r=>{var l;const a=(l=this.overrides)!=null&&l.eachYearOfInterval?this.overrides.eachYearOfInterval(r):cg(r),o=new Set(a.map(c=>this.getYear(c)));if(o.size===a.length)return a;const i=[];return o.forEach(c=>{i.push(new Date(c,0,1))}),i},this.endOfBroadcastWeek=r=>{var a;return(a=this.overrides)!=null&&a.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):qb(r,this)},this.endOfISOWeek=r=>{var a;return(a=this.overrides)!=null&&a.endOfISOWeek?this.overrides.endOfISOWeek(r):dg(r)},this.endOfMonth=r=>{var a;return(a=this.overrides)!=null&&a.endOfMonth?this.overrides.endOfMonth(r):gd(r)},this.endOfWeek=(r,a)=>{var o;return(o=this.overrides)!=null&&o.endOfWeek?this.overrides.endOfWeek(r,a):vd(r,this.options)},this.endOfYear=r=>{var a;return(a=this.overrides)!=null&&a.endOfYear?this.overrides.endOfYear(r):lg(r)},this.format=(r,a,o)=>{var l;const i=(l=this.overrides)!=null&&l.format?this.overrides.format(r,a,this.options):ue(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):Wo(r)},this.getMonth=(r,a)=>{var o;return(o=this.overrides)!=null&&o.getMonth?this.overrides.getMonth(r,this.options):cb(r,this.options)},this.getYear=(r,a)=>{var o;return(o=this.overrides)!=null&&o.getYear?this.overrides.getYear(r,this.options):db(r,this.options)},this.getWeek=(r,a)=>{var o;return(o=this.overrides)!=null&&o.getWeek?this.overrides.getWeek(r,this.options):Lo(r,this.options)},this.isAfter=(r,a)=>{var o;return(o=this.overrides)!=null&&o.isAfter?this.overrides.isAfter(r,a):ub(r,a)},this.isBefore=(r,a)=>{var o;return(o=this.overrides)!=null&&o.isBefore?this.overrides.isBefore(r,a):mb(r,a)},this.isDate=r=>{var a;return(a=this.overrides)!=null&&a.isDate?this.overrides.isDate(r):pd(r)},this.isSameDay=(r,a)=>{var o;return(o=this.overrides)!=null&&o.isSameDay?this.overrides.isSameDay(r,a):zo(r,a)},this.isSameMonth=(r,a)=>{var o;return(o=this.overrides)!=null&&o.isSameMonth?this.overrides.isSameMonth(r,a):fb(r,a)},this.isSameYear=(r,a)=>{var o;return(o=this.overrides)!=null&&o.isSameYear?this.overrides.isSameYear(r,a):hb(r,a)},this.max=r=>{var a;return(a=this.overrides)!=null&&a.max?this.overrides.max(r):Xp(r)},this.min=r=>{var a;return(a=this.overrides)!=null&&a.min?this.overrides.min(r):Zp(r)},this.setMonth=(r,a)=>{var o;return(o=this.overrides)!=null&&o.setMonth?this.overrides.setMonth(r,a):bb(r,a)},this.setYear=(r,a)=>{var o;return(o=this.overrides)!=null&&o.setYear?this.overrides.setYear(r,a):yb(r,a)},this.startOfBroadcastWeek=(r,a)=>{var o;return(o=this.overrides)!=null&&o.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):Dd(r,this)},this.startOfDay=r=>{var a;return(a=this.overrides)!=null&&a.startOfDay?this.overrides.startOfDay(r):Zn(r)},this.startOfISOWeek=r=>{var a;return(a=this.overrides)!=null&&a.startOfISOWeek?this.overrides.startOfISOWeek(r):Xn(r)},this.startOfMonth=r=>{var a;return(a=this.overrides)!=null&&a.startOfMonth?this.overrides.startOfMonth(r):ig(r)},this.startOfWeek=(r,a)=>{var o;return(o=this.overrides)!=null&&o.startOfWeek?this.overrides.startOfWeek(r,this.options):gn(r,this.options)},this.startOfYear=r=>{var a;return(a=this.overrides)!=null&&a.startOfYear?this.overrides.startOfYear(r):yd(r)},this.options={locale:_d,...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&&Et.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&&Et.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)}}Et.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 ss=new Et;class Ed{constructor(s,n,r=ss){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 Bb{constructor(s,n){this.date=s,this.weeks=n}}class Ub{constructor(s,n){this.days=n,this.weekNumber=s}}function Yb(e){return N.createElement("button",{...e})}function Hb(e){return N.createElement("span",{...e})}function Vb(e){const{size:s=24,orientation:n="left",className:r}=e;return N.createElement("svg",{className:r,width:s,height:s,viewBox:"0 0 24 24"},n==="up"&&N.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&N.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&N.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&N.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function Kb(e){const{day:s,modifiers:n,...r}=e;return N.createElement("td",{...r})}function Gb(e){const{day:s,modifiers:n,...r}=e,a=N.useRef(null);return N.useEffect(()=>{var o;n.focused&&((o=a.current)==null||o.focus())},[n.focused]),N.createElement("button",{ref:a,...r})}var le;(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"})(le||(le={}));var ze;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(ze||(ze={}));var Yt;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(Yt||(Yt={}));var Ct;(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"})(Ct||(Ct={}));function Qb(e){const{options:s,className:n,components:r,classNames:a,...o}=e,i=[a[le.Dropdown],n].join(" "),l=s==null?void 0:s.find(({value:c})=>c===o.value);return N.createElement("span",{"data-disabled":o.disabled,className:a[le.DropdownRoot]},N.createElement(r.Select,{className:i,...o},s==null?void 0:s.map(({value:c,label:d,disabled:u})=>N.createElement(r.Option,{key:c,value:c,disabled:u},d))),N.createElement("span",{className:a[le.CaptionLabel],"aria-hidden":!0},l==null?void 0:l.label,N.createElement(r.Chevron,{orientation:"down",size:18,className:a[le.Chevron]})))}function Xb(e){return N.createElement("div",{...e})}function Zb(e){return N.createElement("div",{...e})}function Jb(e){const{calendarMonth:s,displayIndex:n,...r}=e;return N.createElement("div",{...r},e.children)}function e0(e){const{calendarMonth:s,displayIndex:n,...r}=e;return N.createElement("div",{...r})}function t0(e){return N.createElement("table",{...e})}function s0(e){return N.createElement("div",{...e})}const Td=x.createContext(void 0);function vr(){const e=x.useContext(Td);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function n0(e){const{components:s}=vr();return N.createElement(s.Dropdown,{...e})}function r0(e){const{onPreviousClick:s,onNextClick:n,previousMonth:r,nextMonth:a,...o}=e,{components:i,classNames:l,labels:{labelPrevious:c,labelNext:d}}=vr(),u=x.useCallback(f=>{a&&(n==null||n(f))},[a,n]),m=x.useCallback(f=>{r&&(s==null||s(f))},[r,s]);return N.createElement("nav",{...o},N.createElement(i.PreviousMonthButton,{type:"button",className:l[le.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":c(r),onClick:m},N.createElement(i.Chevron,{disabled:r?void 0:!0,className:l[le.Chevron],orientation:"left"})),N.createElement(i.NextMonthButton,{type:"button",className:l[le.NextMonthButton],tabIndex:a?void 0:-1,"aria-disabled":a?void 0:!0,"aria-label":d(a),onClick:u},N.createElement(i.Chevron,{disabled:a?void 0:!0,orientation:"right",className:l[le.Chevron]})))}function a0(e){const{components:s}=vr();return N.createElement(s.Button,{...e})}function o0(e){return N.createElement("option",{...e})}function i0(e){const{components:s}=vr();return N.createElement(s.Button,{...e})}function l0(e){const{rootRef:s,...n}=e;return N.createElement("div",{...n,ref:s})}function c0(e){return N.createElement("select",{...e})}function d0(e){const{week:s,...n}=e;return N.createElement("tr",{...n})}function u0(e){return N.createElement("th",{...e})}function m0(e){return N.createElement("thead",{"aria-hidden":!0},N.createElement("tr",{...e}))}function f0(e){const{week:s,...n}=e;return N.createElement("th",{...n})}function h0(e){return N.createElement("th",{...e})}function x0(e){return N.createElement("tbody",{...e})}function p0(e){const{components:s}=vr();return N.createElement(s.Dropdown,{...e})}const g0=Object.freeze(Object.defineProperty({__proto__:null,Button:Yb,CaptionLabel:Hb,Chevron:Vb,Day:Kb,DayButton:Gb,Dropdown:Qb,DropdownNav:Xb,Footer:Zb,Month:Jb,MonthCaption:e0,MonthGrid:t0,Months:s0,MonthsDropdown:n0,Nav:r0,NextMonthButton:a0,Option:o0,PreviousMonthButton:i0,Root:l0,Select:c0,Week:d0,WeekNumber:f0,WeekNumberHeader:h0,Weekday:u0,Weekdays:m0,Weeks:x0,YearsDropdown:p0},Symbol.toStringTag,{value:"Module"}));function ms(e,s,n=!1,r=ss){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 Uo(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function sa(e){return!!(e&&typeof e=="object"&&"from"in e)}function Yo(e){return!!(e&&typeof e=="object"&&"after"in e)}function Ho(e){return!!(e&&typeof e=="object"&&"before"in e)}function Od(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function Ad(e,s){return Array.isArray(e)&&e.every(s.isDate)}function fs(e,s,n=ss){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(Ad(l,n))return l.some(c=>a(e,c));if(sa(l))return ms(l,e,!1,n);if(Od(l))return Array.isArray(l.dayOfWeek)?l.dayOfWeek.includes(e.getDay()):l.dayOfWeek===e.getDay();if(Uo(l)){const c=o(l.before,e),d=o(l.after,e),u=c>0,m=d<0;return i(l.before,l.after)?m&&u:u||m}return Yo(l)?o(e,l.after)>0:Ho(l)?o(l.before,e)>0:typeof l=="function"?l(e):!1})}function b0(e,s,n,r,a){const{disabled:o,hidden:i,modifiers:l,showOutsideDays:c,broadcastCalendar:d,today:u=a.today()}=s,{isSameDay:m,isSameMonth:f,startOfMonth:h,isBefore:g,endOfMonth:v,isAfter:D}=a,b=n&&h(n),w=r&&v(r),j={[ze.focused]:[],[ze.outside]:[],[ze.disabled]:[],[ze.hidden]:[],[ze.today]:[]},y={};for(const C of e){const{date:p,displayMonth:_}=C,I=!!(_&&!f(p,_)),W=!!(b&&g(p,b)),T=!!(w&&D(p,w)),R=!!(o&&fs(p,o,a)),E=!!(i&&fs(p,i,a))||W||T||!d&&!c&&I||d&&c===!1&&I,P=m(p,u);I&&j.outside.push(C),R&&j.disabled.push(C),E&&j.hidden.push(C),P&&j.today.push(C),l&&Object.keys(l).forEach(O=>{const V=l==null?void 0:l[O];V&&fs(p,V,a)&&(y[O]?y[O].push(C):y[O]=[C])})}return C=>{const p={[ze.focused]:!1,[ze.disabled]:!1,[ze.hidden]:!1,[ze.outside]:!1,[ze.today]:!1},_={};for(const I in j){const W=j[I];p[I]=W.some(T=>T===C)}for(const I in y)_[I]=y[I].some(W=>W===C);return{...p,..._}}}function y0(e,s,n={}){return Object.entries(e).filter(([,a])=>a===!0).reduce((a,[o])=>(n[o]?a.push(n[o]):s[ze[o]]?a.push(s[ze[o]]):s[Yt[o]]&&a.push(s[Yt[o]]),a),[s[le.Day]])}function v0(e){return{...g0,...e}}function j0(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 w0(){const e={};for(const s in le)e[le[s]]=`rdp-${le[s]}`;for(const s in ze)e[ze[s]]=`rdp-${ze[s]}`;for(const s in Yt)e[Yt[s]]=`rdp-${Yt[s]}`;for(const s in Ct)e[Ct[s]]=`rdp-${Ct[s]}`;return e}function Pd(e,s,n){return(n??new Et(s)).formatMonthYear(e)}const N0=Pd;function k0(e,s,n){return(n??new Et(s)).format(e,"d")}function S0(e,s=ss){return s.format(e,"LLLL")}function C0(e,s,n){return(n??new Et(s)).format(e,"cccccc")}function M0(e,s=ss){return e<10?s.formatNumber(`0${e.toLocaleString()}`):s.formatNumber(`${e.toLocaleString()}`)}function D0(){return""}function Rd(e,s=ss){return s.format(e,"yyyy")}const _0=Rd,E0=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:Pd,formatDay:k0,formatMonthCaption:N0,formatMonthDropdown:S0,formatWeekNumber:M0,formatWeekNumberHeader:D0,formatWeekdayName:C0,formatYearCaption:_0,formatYearDropdown:Rd},Symbol.toStringTag,{value:"Module"}));function T0(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...E0,...e}}function Vo(e,s,n,r){let a=(r??new Et(n)).format(e,"PPPP");return s.today&&(a=`Today, ${a}`),s.selected&&(a=`${a}, selected`),a}const O0=Vo;function Ko(e,s,n){return(n??new Et(s)).formatMonthYear(e)}const A0=Ko;function Id(e,s,n,r){let a=(r??new Et(n)).format(e,"PPPP");return s!=null&&s.today&&(a=`Today, ${a}`),a}function $d(e){return"Choose the Month"}function zd(){return""}const P0="Go to the Next Month";function Fd(e,s){return P0}function Wd(e){return"Go to the Previous Month"}function Ld(e,s,n){return(n??new Et(s)).format(e,"cccc")}function qd(e,s){return`Week ${e}`}function Bd(e){return"Week Number"}function Ud(e){return"Choose the Year"}const R0=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:A0,labelDay:O0,labelDayButton:Vo,labelGrid:Ko,labelGridcell:Id,labelMonthDropdown:$d,labelNav:zd,labelNext:Fd,labelPrevious:Wd,labelWeekNumber:qd,labelWeekNumberHeader:Bd,labelWeekday:Ld,labelYearDropdown:Ud},Symbol.toStringTag,{value:"Module"})),qt=(e,s,n)=>s||(n?typeof n=="function"?n:(...r)=>n:e);function I0(e,s){var r;const n=((r=s.locale)==null?void 0:r.labels)??{};return{...R0,...e??{},labelDayButton:qt(Vo,e==null?void 0:e.labelDayButton,n.labelDayButton),labelMonthDropdown:qt($d,e==null?void 0:e.labelMonthDropdown,n.labelMonthDropdown),labelNext:qt(Fd,e==null?void 0:e.labelNext,n.labelNext),labelPrevious:qt(Wd,e==null?void 0:e.labelPrevious,n.labelPrevious),labelWeekNumber:qt(qd,e==null?void 0:e.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:qt(Ud,e==null?void 0:e.labelYearDropdown,n.labelYearDropdown),labelGrid:qt(Ko,e==null?void 0:e.labelGrid,n.labelGrid),labelGridcell:qt(Id,e==null?void 0:e.labelGridcell,n.labelGridcell),labelNav:qt(zd,e==null?void 0:e.labelNav,n.labelNav),labelWeekNumberHeader:qt(Bd,e==null?void 0:e.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:qt(Ld,e==null?void 0:e.labelWeekday,n.labelWeekday)}}function $0(e,s,n,r,a){const{startOfMonth:o,startOfYear:i,endOfYear:l,eachMonthOfInterval:c,getMonth:d}=a;return c({start:i(e),end:l(e)}).map(f=>{const h=r.formatMonthDropdown(f,a),g=d(f),v=s&&f<o(s)||n&&f>o(n)||!1;return{value:g,label:h,disabled:v}})}function z0(e,s={},n={}){let r={...s==null?void 0:s[le.Day]};return Object.entries(e).filter(([,a])=>a===!0).forEach(([a])=>{r={...r,...n==null?void 0:n[a]}}),r}function F0(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 c=e.addDays(o,l);i.push(c)}return i}function W0(e,s,n,r,a=!1){if(!e||!s)return;const{startOfYear:o,endOfYear:i,eachYearOfInterval:l,getYear:c}=r,d=o(e),u=i(s),m=l({start:d,end:u});return a&&m.reverse(),m.map(f=>{const h=n.formatYearDropdown(f,r);return{value:c(f),label:h,disabled:!1}})}function L0(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=c=>{const d=typeof c=="number"||typeof c=="string"?new Date(c):c;return new rt(d.getFullYear(),d.getMonth(),d.getDate(),12,0,0,e)},i=c=>{const d=o(c);return new Date(d.getFullYear(),d.getMonth(),d.getDate(),0,0,0,0)};return{today:()=>o(rt.tz(e)),newDate:(c,d,u)=>new rt(c,d,u,12,0,0,e),startOfDay:c=>o(c),startOfWeek:(c,d)=>{const u=o(c),m=(d==null?void 0:d.weekStartsOn)??a,f=(u.getDay()-m+7)%7;return u.setDate(u.getDate()-f),u},startOfISOWeek:c=>{const d=o(c),u=(d.getDay()-1+7)%7;return d.setDate(d.getDate()-u),d},startOfMonth:c=>{const d=o(c);return d.setDate(1),d},startOfYear:c=>{const d=o(c);return d.setMonth(0,1),d},endOfWeek:(c,d)=>{const u=o(c),h=((((d==null?void 0:d.weekStartsOn)??a)+6)%7-u.getDay()+7)%7;return u.setDate(u.getDate()+h),u},endOfISOWeek:c=>{const d=o(c),u=(7-d.getDay())%7;return d.setDate(d.getDate()+u),d},endOfMonth:c=>{const d=o(c);return d.setMonth(d.getMonth()+1,0),d},endOfYear:c=>{const d=o(c);return d.setMonth(11,31),d},eachMonthOfInterval:c=>{const d=o(c.start),u=o(c.end),m=[],f=new rt(d.getFullYear(),d.getMonth(),1,12,0,0,e),h=u.getFullYear()*12+u.getMonth();for(;f.getFullYear()*12+f.getMonth()<=h;)m.push(new rt(f,e)),f.setMonth(f.getMonth()+1,1);return m},addDays:(c,d)=>{const u=o(c);return u.setDate(u.getDate()+d),u},addWeeks:(c,d)=>{const u=o(c);return u.setDate(u.getDate()+d*7),u},addMonths:(c,d)=>{const u=o(c);return u.setMonth(u.getMonth()+d),u},addYears:(c,d)=>{const u=o(c);return u.setFullYear(u.getFullYear()+d),u},eachYearOfInterval:c=>{const d=o(c.start),u=o(c.end),m=[],f=new rt(d.getFullYear(),0,1,12,0,0,e);for(;f.getFullYear()<=u.getFullYear();)m.push(new rt(f,e)),f.setFullYear(f.getFullYear()+1,0,1);return m},getWeek:(c,d)=>{var m;const u=i(c);return Lo(u,{weekStartsOn:(d==null?void 0:d.weekStartsOn)??a,firstWeekContainsDate:(d==null?void 0:d.firstWeekContainsDate)??((m=r==null?void 0:r.options)==null?void 0:m.firstWeekContainsDate)??1})},getISOWeek:c=>{const d=i(c);return Wo(d)},differenceInCalendarDays:(c,d)=>{const u=i(c),m=i(d);return Io(u,m)},differenceInCalendarMonths:(c,d)=>{const u=i(c),m=i(d);return Fo(u,m)}}}const jr=e=>e instanceof HTMLElement?e:null,Pa=e=>[...e.querySelectorAll("[data-animated-month]")??[]],q0=e=>jr(e.querySelector("[data-animated-month]")),Ra=e=>jr(e.querySelector("[data-animated-caption]")),Ia=e=>jr(e.querySelector("[data-animated-weeks]")),B0=e=>jr(e.querySelector("[data-animated-nav]")),U0=e=>jr(e.querySelector("[data-animated-weekdays]"));function Y0(e,s,{classNames:n,months:r,focused:a,dateLib:o}){const i=x.useRef(null),l=x.useRef(r),c=x.useRef(!1);x.useLayoutEffect(()=>{const d=l.current;if(l.current=r,!s||!e.current||!(e.current instanceof HTMLElement)||r.length===0||d.length===0||r.length!==d.length)return;const u=o.isSameMonth(r[0].date,d[0].date),m=o.isAfter(r[0].date,d[0].date),f=m?n[Ct.caption_after_enter]:n[Ct.caption_before_enter],h=m?n[Ct.weeks_after_enter]:n[Ct.weeks_before_enter],g=i.current,v=e.current.cloneNode(!0);if(v instanceof HTMLElement?(Pa(v).forEach(j=>{if(!(j instanceof HTMLElement))return;const y=q0(j);y&&j.contains(y)&&j.removeChild(y);const C=Ra(j);C&&C.classList.remove(f);const p=Ia(j);p&&p.classList.remove(h)}),i.current=v):i.current=null,c.current||u||a)return;const D=g instanceof HTMLElement?Pa(g):[],b=Pa(e.current);if(b!=null&&b.every(w=>w instanceof HTMLElement)&&D&&D.every(w=>w instanceof HTMLElement)){c.current=!0,e.current.style.isolation="isolate";const w=B0(e.current);w&&(w.style.zIndex="1"),b.forEach((j,y)=>{const C=D[y];if(!C)return;j.style.position="relative",j.style.overflow="hidden";const p=Ra(j);p&&p.classList.add(f);const _=Ia(j);_&&_.classList.add(h);const I=()=>{c.current=!1,e.current&&(e.current.style.isolation=""),w&&(w.style.zIndex=""),p&&p.classList.remove(f),_&&_.classList.remove(h),j.style.position="",j.style.overflow="",j.contains(C)&&j.removeChild(C)};C.style.pointerEvents="none",C.style.position="absolute",C.style.overflow="hidden",C.setAttribute("aria-hidden","true");const W=U0(C);W&&(W.style.opacity="0");const T=Ra(C);T&&(T.classList.add(m?n[Ct.caption_before_exit]:n[Ct.caption_after_exit]),T.addEventListener("animationend",I));const R=Ia(C);R&&R.classList.add(m?n[Ct.weeks_before_exit]:n[Ct.weeks_after_exit]),j.insertBefore(C,j.firstChild)})}})}function H0(e,s,n,r){const a=e[0],o=e[e.length-1],{ISOWeek:i,fixedWeeks:l,broadcastCalendar:c}=n??{},{addDays:d,differenceInCalendarDays:u,differenceInCalendarMonths:m,endOfBroadcastWeek:f,endOfISOWeek:h,endOfMonth:g,endOfWeek:v,isAfter:D,startOfBroadcastWeek:b,startOfISOWeek:w,startOfWeek:j}=r,y=c?b(a,r):i?w(a):j(a),C=c?f(o):i?h(g(o)):v(g(o)),p=s&&(c?f(s):i?h(s):v(s)),_=p&&D(C,p)?p:C,I=u(_,y),W=m(o,a)+1,T=[];for(let P=0;P<=I;P++){const O=d(y,P);T.push(O)}const E=(c?35:42)*W;if(l&&T.length<E){const P=E-T.length;for(let O=0;O<P;O++){const V=d(T[T.length-1],1);T.push(V)}}return T}function V0(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 K0(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 qi(e,s,n,r){const{month:a,defaultMonth:o,today:i=r.today(),numberOfMonths:l=1}=e;let c=a||o||i;const{differenceInCalendarMonths:d,addMonths:u,startOfMonth:m}=r;if(n&&d(n,c)<l-1){const f=-1*(l-1);c=u(n,f)}return s&&d(c,s)<0&&(c=s),m(c)}function G0(e,s,n,r){const{addDays:a,endOfBroadcastWeek:o,endOfISOWeek:i,endOfMonth:l,endOfWeek:c,getISOWeek:d,getWeek:u,startOfBroadcastWeek:m,startOfISOWeek:f,startOfWeek:h}=r,g=e.reduce((v,D)=>{const b=n.broadcastCalendar?m(D,r):n.ISOWeek?f(D):h(D),w=n.broadcastCalendar?o(D):n.ISOWeek?i(l(D)):c(l(D)),j=s.filter(_=>_>=b&&_<=w),y=n.broadcastCalendar?35:42;if(n.fixedWeeks&&j.length<y){const _=s.filter(I=>{const W=y-j.length;return I>w&&I<=a(w,W)});j.push(..._)}const C=j.reduce((_,I)=>{const W=n.ISOWeek?d(I):u(I),T=_.find(E=>E.weekNumber===W),R=new Ed(I,D,r);return T?T.days.push(R):_.push(new Ub(W,[R])),_},[]),p=new Bb(D,C);return v.push(p),v},[]);return n.reverseMonths?g.reverse():g}function Q0(e,s){let{startMonth:n,endMonth:r}=e;const{startOfYear:a,startOfDay:o,startOfMonth:i,endOfMonth:l,addYears:c,endOfYear:d,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 D=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=i(n):f?n=u(f,0,1):!n&&D&&(n=a(c(e.today??m(),-100))),r?r=l(r):h?r=u(h,11,31):!r&&D&&(r=d(e.today??m())),[n&&o(n),r&&o(r)]}function X0(e,s,n,r){if(n.disableNavigation)return;const{pagedNavigation:a,numberOfMonths:o=1}=n,{startOfMonth:i,addMonths:l,differenceInCalendarMonths:c}=r,d=a?o:1,u=i(e);if(!s)return l(u,d);if(!(c(s,e)<o))return l(u,d)}function Z0(e,s,n,r){if(n.disableNavigation)return;const{pagedNavigation:a,numberOfMonths:o}=n,{startOfMonth:i,addMonths:l,differenceInCalendarMonths:c}=r,d=a?o??1:1,u=i(e);if(!s)return l(u,-d);if(!(c(u,s)<=0))return l(u,-d)}function J0(e){const s=[];return e.reduce((n,r)=>n.concat(r.weeks.slice()),s.slice())}function na(e,s){const[n,r]=x.useState(e);return[s===void 0?n:s,r]}function ey(e,s){var y;const[n,r]=Q0(e,s),{startOfMonth:a,endOfMonth:o}=s,i=qi(e,n,r,s),[l,c]=na(i,e.month?i:void 0);x.useEffect(()=>{const C=qi(e,n,r,s);c(C)},[e.timeZone]);const{months:d,weeks:u,days:m,previousMonth:f,nextMonth:h}=x.useMemo(()=>{const C=K0(l,r,{numberOfMonths:e.numberOfMonths},s),p=H0(C,e.endMonth?o(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},s),_=G0(C,p,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},s),I=J0(_),W=V0(_),T=Z0(l,n,e,s),R=X0(l,r,e,s);return{months:_,weeks:I,days:W,previousMonth:T,nextMonth:R}},[s,l.getTime(),r==null?void 0:r.getTime(),n==null?void 0:n.getTime(),e.disableNavigation,e.broadcastCalendar,(y=e.endMonth)==null?void 0:y.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:g,onMonthChange:v}=e,D=C=>u.some(p=>p.days.some(_=>_.isEqualTo(C))),b=C=>{if(g)return;let p=a(C);n&&p<a(n)&&(p=a(n)),r&&p>a(r)&&(p=a(r)),c(p),v==null||v(p)};return{months:d,weeks:u,days:m,navStart:n,navEnd:r,previousMonth:f,nextMonth:h,goToMonth:b,goToDay:C=>{D(C)||b(C.date)}}}var Jt;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(Jt||(Jt={}));function Bi(e){return!e[ze.disabled]&&!e[ze.hidden]&&!e[ze.outside]}function ty(e,s,n,r){let a,o=-1;for(const i of e){const l=s(i);Bi(l)&&(l[ze.focused]&&o<Jt.FocusedModifier?(a=i,o=Jt.FocusedModifier):r!=null&&r.isEqualTo(i)&&o<Jt.LastFocused?(a=i,o=Jt.LastFocused):n(i.date)&&o<Jt.Selected?(a=i,o=Jt.Selected):l[ze.today]&&o<Jt.Today&&(a=i,o=Jt.Today))}return a||(a=e.find(i=>Bi(s(i)))),a}function sy(e,s,n,r,a,o,i){const{ISOWeek:l,broadcastCalendar:c}=o,{addDays:d,addMonths:u,addWeeks:m,addYears:f,endOfBroadcastWeek:h,endOfISOWeek:g,endOfWeek:v,max:D,min:b,startOfBroadcastWeek:w,startOfISOWeek:j,startOfWeek:y}=i;let p={day:d,week:m,month:u,year:f,startOfWeek:_=>c?w(_,i):l?j(_):y(_),endOfWeek:_=>c?h(_):l?g(_):v(_)}[e](n,s==="after"?1:-1);return s==="before"&&r?p=D([r,p]):s==="after"&&a&&(p=b([a,p])),p}function Yd(e,s,n,r,a,o,i,l=0){if(l>365)return;const c=sy(e,s,n.date,r,a,o,i),d=!!(o.disabled&&fs(c,o.disabled,i)),u=!!(o.hidden&&fs(c,o.hidden,i)),m=c,f=new Ed(c,m,i);return!d&&!u?f:Yd(e,s,f,r,a,o,i,l+1)}function ny(e,s,n,r,a){const{autoFocus:o}=e,[i,l]=x.useState(),c=ty(s.days,n,r||(()=>!1),i),[d,u]=x.useState(o?c:void 0);return{isFocusTarget:v=>!!(c!=null&&c.isEqualTo(v)),setFocused:u,focused:d,blur:()=>{l(d),u(void 0)},moveFocus:(v,D)=>{if(!d)return;const b=Yd(v,D,d,s.navStart,s.navEnd,e,a);b&&(e.disableNavigation&&!s.days.some(j=>j.isEqualTo(b))||(s.goToDay(b),u(b)))}}}function ry(e,s){const{selected:n,required:r,onSelect:a}=e,[o,i]=na(n,a?n:void 0),l=a?n:o,{isSameDay:c}=s,d=h=>(l==null?void 0:l.some(g=>c(g,h)))??!1,{min:u,max:m}=e;return{selected:l,select:(h,g,v)=>{let D=[...l??[]];if(d(h)){if((l==null?void 0:l.length)===u||r&&(l==null?void 0:l.length)===1)return;D=l==null?void 0:l.filter(b=>!c(b,h))}else(l==null?void 0:l.length)===m?D=[h]:D=[...D,h];return a||i(D),a==null||a(D,h,g,v),D},isSelected:d}}function ay(e,s,n=0,r=0,a=!1,o=ss){const{from:i,to:l}=s||{},{isSameDay:c,isAfter:d,isBefore:u}=o;let m;if(!i&&!l)m={from:e,to:n>0?void 0:e};else if(i&&!l)c(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(c(i,e)&&c(l,e))a?m={from:i,to:l}:m=void 0;else if(c(i,e))m={from:i,to:n>0?void 0:e};else if(c(l,e))m={from:e,to:n>0?void 0:e};else if(u(e,i))m={from:e,to:l};else if(d(e,i))m={from:i,to:e};else if(d(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 oy(e,s,n=ss){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 Ui(e,s,n=ss){return ms(e,s.from,!1,n)||ms(e,s.to,!1,n)||ms(s,e.from,!1,n)||ms(s,e.to,!1,n)}function iy(e,s,n=ss){const r=Array.isArray(s)?s:[s];if(r.filter(l=>typeof l!="function").some(l=>typeof l=="boolean"?l:n.isDate(l)?ms(e,l,!1,n):Ad(l,n)?l.some(c=>ms(e,c,!1,n)):sa(l)?l.from&&l.to?Ui(e,{from:l.from,to:l.to},n):!1:Od(l)?oy(e,l.dayOfWeek,n):Uo(l)?n.isAfter(l.before,l.after)?Ui(e,{from:n.addDays(l.after,1),to:n.addDays(l.before,-1)},n):fs(e.from,l,n)||fs(e.to,l,n):Yo(l)||Ho(l)?fs(e.from,l,n)||fs(e.to,l,n):!1))return!0;const i=r.filter(l=>typeof l=="function");if(i.length){let l=e.from;const c=n.differenceInCalendarDays(e.to,e.from);for(let d=0;d<=c;d++){if(i.some(u=>u(l)))return!0;l=n.addDays(l,1)}}return!1}function ly(e,s){const{disabled:n,excludeDisabled:r,selected:a,required:o,onSelect:i}=e,[l,c]=na(a,i?a:void 0),d=i?a:l;return{selected:d,select:(f,h,g)=>{const{min:v,max:D}=e,b=f?ay(f,d,v,D,o,s):void 0;return r&&n&&(b!=null&&b.from)&&b.to&&iy({from:b.from,to:b.to},n,s)&&(b.from=f,b.to=void 0),i||c(b),i==null||i(b,f,h,g),b},isSelected:f=>d&&ms(d,f,!1,s)}}function cy(e,s){const{selected:n,required:r,onSelect:a}=e,[o,i]=na(n,a?n:void 0),l=a?n:o,{isSameDay:c}=s;return{selected:l,select:(m,f,h)=>{let g=m;return!r&&l&&l&&c(m,l)&&(g=void 0),a||i(g),a==null||a(g,m,f,h),g},isSelected:m=>l?c(l,m):!1}}function dy(e,s){const n=cy(e,s),r=ry(e,s),a=ly(e,s);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return a;default:return}}function At(e,s){return e instanceof rt&&e.timeZone===s?e:new rt(e,s)}function on(e,s,n){return At(e,s)}function Yi(e,s,n){return typeof e=="boolean"||typeof e=="function"?e:e instanceof Date?on(e,s):Array.isArray(e)?e.map(r=>r instanceof Date?on(r,s):r):sa(e)?{...e,from:e.from?At(e.from,s):e.from,to:e.to?At(e.to,s):e.to}:Uo(e)?{before:on(e.before,s),after:on(e.after,s)}:Yo(e)?{after:on(e.after,s)}:Ho(e)?{before:on(e.before,s)}:e}function $a(e,s,n){return e&&(Array.isArray(e)?e.map(r=>Yi(r,s)):Yi(e,s))}function uy(e){var ce;let s=e;const n=s.timeZone;if(n&&(s={...e,timeZone:n},s.today&&(s.today=At(s.today,n)),s.month&&(s.month=At(s.month,n)),s.defaultMonth&&(s.defaultMonth=At(s.defaultMonth,n)),s.startMonth&&(s.startMonth=At(s.startMonth,n)),s.endMonth&&(s.endMonth=At(s.endMonth,n)),s.mode==="single"&&s.selected?s.selected=At(s.selected,n):s.mode==="multiple"&&s.selected?s.selected=(ce=s.selected)==null?void 0:ce.map(ee=>At(ee,n)):s.mode==="range"&&s.selected&&(s.selected={from:s.selected.from?At(s.selected.from,n):s.selected.from,to:s.selected.to?At(s.selected.to,n):s.selected.to}),s.disabled!==void 0&&(s.disabled=$a(s.disabled,n)),s.hidden!==void 0&&(s.hidden=$a(s.hidden,n)),s.modifiers)){const ee={};Object.keys(s.modifiers).forEach(re=>{var X;ee[re]=$a((X=s.modifiers)==null?void 0:X[re],n)}),s.modifiers=ee}const{components:r,formatters:a,labels:o,dateLib:i,locale:l,classNames:c}=x.useMemo(()=>{const ee={..._d,...s.locale},re=s.broadcastCalendar?1:s.weekStartsOn,X=s.noonSafe&&s.timeZone?L0(s.timeZone,{weekStartsOn:re,locale:ee}):void 0,ne=s.dateLib&&X?{...X,...s.dateLib}:s.dateLib??X,we=new Et({locale:ee,weekStartsOn:re,firstWeekContainsDate:s.firstWeekContainsDate,useAdditionalWeekYearTokens:s.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:s.useAdditionalDayOfYearTokens,timeZone:s.timeZone,numerals:s.numerals},ne);return{dateLib:we,components:v0(s.components),formatters:T0(s.formatters),labels:I0(s.labels,we.options),locale:ee,classNames:{...w0(),...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:d,mode:u,navLayout:m,numberOfMonths:f=1,onDayBlur:h,onDayClick:g,onDayFocus:v,onDayKeyDown:D,onDayMouseEnter:b,onDayMouseLeave:w,onNextClick:j,onPrevClick:y,showWeekNumber:C,styles:p}=s,{formatCaption:_,formatDay:I,formatMonthDropdown:W,formatWeekNumber:T,formatWeekNumberHeader:R,formatWeekdayName:E,formatYearDropdown:P}=a,O=ey(s,i),{days:V,months:Y,navStart:H,navEnd:B,previousMonth:L,nextMonth:te,goToMonth:Z}=O,S=b0(V,s,H,B,i),{isSelected:$,select:Q,selected:F}=dy(s,i)??{},{blur:M,focused:q,isFocusTarget:me,moveFocus:Ne,setFocused:Ae}=ny(s,O,S,$??(()=>!1),i),{labelDayButton:Xe,labelGridcell:$t,labelGrid:gt,labelMonthDropdown:fe,labelNav:it,labelPrevious:zt,labelNext:Ft,labelWeekday:bt,labelWeekNumber:Kt,labelWeekNumberHeader:tt,labelYearDropdown:Nt}=o,ns=x.useMemo(()=>F0(i,s.ISOWeek,s.broadcastCalendar,s.today),[i,s.ISOWeek,s.broadcastCalendar,s.today]),Ge=u!==void 0||g!==void 0,Wt=x.useCallback(()=>{L&&(Z(L),y==null||y(L))},[L,Z,y]),yt=x.useCallback(()=>{te&&(Z(te),j==null||j(te))},[Z,te,j]),Re=x.useCallback((ee,re)=>X=>{X.preventDefault(),X.stopPropagation(),Ae(ee),!re.disabled&&(Q==null||Q(ee.date,re,X),g==null||g(ee.date,re,X))},[Q,g,Ae]),qe=x.useCallback((ee,re)=>X=>{Ae(ee),v==null||v(ee.date,re,X)},[v,Ae]),Tt=x.useCallback((ee,re)=>X=>{M(),h==null||h(ee.date,re,X)},[M,h]),bs=x.useCallback((ee,re)=>X=>{const ne={ArrowLeft:[X.shiftKey?"month":"day",s.dir==="rtl"?"after":"before"],ArrowRight:[X.shiftKey?"month":"day",s.dir==="rtl"?"before":"after"],ArrowDown:[X.shiftKey?"year":"week","after"],ArrowUp:[X.shiftKey?"year":"week","before"],PageUp:[X.shiftKey?"year":"month","before"],PageDown:[X.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(ne[X.key]){X.preventDefault(),X.stopPropagation();const[we,U]=ne[X.key];Ne(we,U)}D==null||D(ee.date,re,X)},[Ne,D,s.dir]),Ot=x.useCallback((ee,re)=>X=>{b==null||b(ee.date,re,X)},[b]),rs=x.useCallback((ee,re)=>X=>{w==null||w(ee.date,re,X)},[w]),kt=x.useCallback(ee=>re=>{const X=Number(re.target.value),ne=i.setMonth(i.startOfMonth(ee),X);Z(ne)},[i,Z]),St=x.useCallback(ee=>re=>{const X=Number(re.target.value),ne=i.setYear(i.startOfMonth(ee),X);Z(ne)},[i,Z]),{className:lt,style:st}=x.useMemo(()=>({className:[c[le.Root],s.className].filter(Boolean).join(" "),style:{...p==null?void 0:p[le.Root],...s.style}}),[c,s.className,s.style,p]),Ze=j0(s),Gt=x.useRef(null);Y0(Gt,!!s.animate,{classNames:c,months:Y,focused:q,dateLib:i});const as={dayPickerProps:s,selected:F,select:Q,isSelected:$,months:Y,nextMonth:te,previousMonth:L,goToMonth:Z,getModifiers:S,components:r,classNames:c,styles:p,labels:o,formatters:a};return N.createElement(Td.Provider,{value:as},N.createElement(r.Root,{rootRef:s.animate?Gt:void 0,className:lt,style:st,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"],...Ze},N.createElement(r.Months,{className:c[le.Months],style:p==null?void 0:p[le.Months]},!s.hideNavigation&&!m&&N.createElement(r.Nav,{"data-animated-nav":s.animate?"true":void 0,className:c[le.Nav],style:p==null?void 0:p[le.Nav],"aria-label":it(),onPreviousClick:Wt,onNextClick:yt,previousMonth:L,nextMonth:te}),Y.map((ee,re)=>N.createElement(r.Month,{"data-animated-month":s.animate?"true":void 0,className:c[le.Month],style:p==null?void 0:p[le.Month],key:re,displayIndex:re,calendarMonth:ee},m==="around"&&!s.hideNavigation&&re===0&&N.createElement(r.PreviousMonthButton,{type:"button",className:c[le.PreviousMonthButton],tabIndex:L?void 0:-1,"aria-disabled":L?void 0:!0,"aria-label":zt(L),onClick:Wt,"data-animated-button":s.animate?"true":void 0},N.createElement(r.Chevron,{disabled:L?void 0:!0,className:c[le.Chevron],orientation:s.dir==="rtl"?"right":"left"})),N.createElement(r.MonthCaption,{"data-animated-caption":s.animate?"true":void 0,className:c[le.MonthCaption],style:p==null?void 0:p[le.MonthCaption],calendarMonth:ee,displayIndex:re},d!=null&&d.startsWith("dropdown")?N.createElement(r.DropdownNav,{className:c[le.Dropdowns],style:p==null?void 0:p[le.Dropdowns]},(()=>{const X=d==="dropdown"||d==="dropdown-months"?N.createElement(r.MonthsDropdown,{key:"month",className:c[le.MonthsDropdown],"aria-label":fe(),classNames:c,components:r,disabled:!!s.disableNavigation,onChange:kt(ee.date),options:$0(ee.date,H,B,a,i),style:p==null?void 0:p[le.Dropdown],value:i.getMonth(ee.date)}):N.createElement("span",{key:"month"},W(ee.date,i)),ne=d==="dropdown"||d==="dropdown-years"?N.createElement(r.YearsDropdown,{key:"year",className:c[le.YearsDropdown],"aria-label":Nt(i.options),classNames:c,components:r,disabled:!!s.disableNavigation,onChange:St(ee.date),options:W0(H,B,a,i,!!s.reverseYears),style:p==null?void 0:p[le.Dropdown],value:i.getYear(ee.date)}):N.createElement("span",{key:"year"},P(ee.date,i));return i.getMonthYearOrder()==="year-first"?[ne,X]:[X,ne]})(),N.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"}},_(ee.date,i.options,i))):N.createElement(r.CaptionLabel,{className:c[le.CaptionLabel],role:"status","aria-live":"polite"},_(ee.date,i.options,i))),m==="around"&&!s.hideNavigation&&re===f-1&&N.createElement(r.NextMonthButton,{type:"button",className:c[le.NextMonthButton],tabIndex:te?void 0:-1,"aria-disabled":te?void 0:!0,"aria-label":Ft(te),onClick:yt,"data-animated-button":s.animate?"true":void 0},N.createElement(r.Chevron,{disabled:te?void 0:!0,className:c[le.Chevron],orientation:s.dir==="rtl"?"left":"right"})),re===f-1&&m==="after"&&!s.hideNavigation&&N.createElement(r.Nav,{"data-animated-nav":s.animate?"true":void 0,className:c[le.Nav],style:p==null?void 0:p[le.Nav],"aria-label":it(),onPreviousClick:Wt,onNextClick:yt,previousMonth:L,nextMonth:te}),N.createElement(r.MonthGrid,{role:"grid","aria-multiselectable":u==="multiple"||u==="range","aria-label":gt(ee.date,i.options,i)||void 0,className:c[le.MonthGrid],style:p==null?void 0:p[le.MonthGrid]},!s.hideWeekdays&&N.createElement(r.Weekdays,{"data-animated-weekdays":s.animate?"true":void 0,className:c[le.Weekdays],style:p==null?void 0:p[le.Weekdays]},C&&N.createElement(r.WeekNumberHeader,{"aria-label":tt(i.options),className:c[le.WeekNumberHeader],style:p==null?void 0:p[le.WeekNumberHeader],scope:"col"},R()),ns.map(X=>N.createElement(r.Weekday,{"aria-label":bt(X,i.options,i),className:c[le.Weekday],key:String(X),style:p==null?void 0:p[le.Weekday],scope:"col"},E(X,i.options,i)))),N.createElement(r.Weeks,{"data-animated-weeks":s.animate?"true":void 0,className:c[le.Weeks],style:p==null?void 0:p[le.Weeks]},ee.weeks.map(X=>N.createElement(r.Week,{className:c[le.Week],key:X.weekNumber,style:p==null?void 0:p[le.Week],week:X},C&&N.createElement(r.WeekNumber,{week:X,style:p==null?void 0:p[le.WeekNumber],"aria-label":Kt(X.weekNumber,{locale:l}),className:c[le.WeekNumber],scope:"row",role:"rowheader"},T(X.weekNumber,i)),X.days.map(ne=>{const{date:we}=ne,U=S(ne);if(U[ze.focused]=!U.hidden&&!!(q!=null&&q.isEqualTo(ne)),U[Yt.selected]=($==null?void 0:$(we))||U.selected,sa(F)){const{from:Me,to:De}=F;U[Yt.range_start]=!!(Me&&De&&i.isSameDay(we,Me)),U[Yt.range_end]=!!(Me&&De&&i.isSameDay(we,De)),U[Yt.range_middle]=ms(F,we,!0,i)}const ie=z0(U,p,s.modifiersStyles),he=y0(U,c,s.modifiersClassNames),Ie=!Ge&&!U.hidden?$t(we,U,i.options,i):void 0;return N.createElement(r.Day,{key:`${ne.isoDate}_${ne.displayMonthId}`,day:ne,modifiers:U,className:he.join(" "),style:ie,role:"gridcell","aria-selected":U.selected||void 0,"aria-label":Ie,"data-day":ne.isoDate,"data-month":ne.outside?ne.dateMonthId:void 0,"data-selected":U.selected||void 0,"data-disabled":U.disabled||void 0,"data-hidden":U.hidden||void 0,"data-outside":ne.outside||void 0,"data-focused":U.focused||void 0,"data-today":U.today||void 0},!U.hidden&&Ge?N.createElement(r.DayButton,{className:c[le.DayButton],style:p==null?void 0:p[le.DayButton],type:"button",day:ne,modifiers:U,disabled:!U.focused&&U.disabled||void 0,"aria-disabled":U.focused&&U.disabled||void 0,tabIndex:me(ne)?0:-1,"aria-label":Xe(we,U,i.options,i),onClick:Re(ne,U),onBlur:Tt(ne,U),onFocus:qe(ne,U),onKeyDown:bs(ne,U),onMouseEnter:Ot(ne,U),onMouseLeave:rs(ne,U)},I(we,i.options,i)):!U.hidden&&I(ne.date,i.options,i))})))))))),s.footer&&N.createElement(r.Footer,{className:c[le.Footer],style:p==null?void 0:p[le.Footer],role:"status","aria-live":"polite"},s.footer)))}function Rt({className:e,classNames:s,showOutsideDays:n=!0,...r}){return t.jsx(uy,{showOutsideDays:n,className:A("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:A(mn({variant:"outline"}),"absolute left-1 top-0 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),button_next:A(mn({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:A(mn({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(go,{className:"h-4 w-4"}):t.jsx(kn,{className:"h-4 w-4"})},...r})}Rt.displayName="Calendar";function my(e){if(!e.start_date&&!e.end_date)return null;const s=e.start_date?ue(new Date(e.start_date),"MMM d"):"—",n=e.end_date?ue(new Date(e.end_date),"MMM d"):"—";return`${s} – ${n}`}function ra({open:e,onClose:s,projectId:n,defaultStatus:r="backlog",defaultTaskListId:a,defaultParentId:o}){const i=ot(),{workspace:l,projectKey:c}=pt(),{workspace:d}=Te(),[u,m]=x.useState(""),[f,h]=x.useState(""),[g,v]=x.useState(r),[D,b]=x.useState("medium"),[w,j]=x.useState("task"),[y,C]=x.useState([]),[p,_]=x.useState(""),[I,W]=x.useState(a??""),[T,R]=x.useState(void 0),[E,P]=x.useState(void 0),O=fc(),{data:V}=Tn(n),{data:Y}=On(n||void 0),{data:H}=br(n||void 0),B=(Y??[]).filter(S=>S.status!=="completed"),L=V&&V.length>0?Object.fromEntries(V.map(S=>[S.key,S.name])):Gs,te=()=>{m(""),h(""),v(r),b("medium"),j("task"),C([]),_(""),W(a??""),R(void 0),P(void 0),s()},Z=S=>{S.preventDefault(),u.trim()&&O.mutate({title:u.trim(),description:f.trim()||void 0,status:g,priority:D,type:w,project_id:n,workspace_id:d.id,assignee_ids:y.length>0?y:void 0,sprint_id:p||null,task_list_id:I||null,parent_id:o||null,start_date:T?ue(T,"yyyy-MM-dd"):null,due_date:E?ue(E,"yyyy-MM-dd"):null},{onSuccess:()=>{z.success("Issue created"),te()},onError:$=>z.error($.message??"Failed to create issue")})};return t.jsx(sn,{open:e,onOpenChange:S=>!S&&te(),children:t.jsxs(nn,{className:"max-w-md",children:[t.jsx(Mn,{children:t.jsx(_n,{children:"New issue"})}),t.jsxs("form",{onSubmit:Z,className:"flex flex-col flex-1 overflow-hidden",children:[t.jsxs(Dn,{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(Qe,{htmlFor:"issue-title",children:"Title"}),t.jsx(ve,{id:"issue-title",placeholder:"Issue title",value:u,onChange:S=>m(S.target.value),autoFocus:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsxs(Qe,{htmlFor:"issue-desc",children:["Description ",t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),t.jsx(ea,{id:"issue-desc",placeholder:"Add more context...",value:f,onChange:S=>h(S.target.value)})]}),t.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(Qe,{children:"Status"}),t.jsxs(_e,{value:g,onValueChange:v,children:[t.jsx(Se,{className:"h-8 text-xs",children:t.jsx(Fe,{})}),t.jsx(Ce,{children:Object.entries(L).map(([S,$])=>t.jsx(be,{value:S,className:"text-xs",children:$},S))})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(Qe,{children:"Priority"}),t.jsxs(_e,{value:D,onValueChange:b,children:[t.jsx(Se,{className:"h-8 text-xs",children:t.jsx(Fe,{})}),t.jsx(Ce,{children:Object.entries(hs).map(([S,$])=>t.jsx(be,{value:S,className:"text-xs",children:$},S))})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(Qe,{children:"Type"}),t.jsxs(_e,{value:w,onValueChange:j,children:[t.jsx(Se,{className:"h-8 text-xs",children:t.jsx(Fe,{})}),t.jsx(Ce,{children:Object.entries(Cs).map(([S,$])=>t.jsx(be,{value:S,className:"text-xs",children:$},S))})]})]})]}),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"}),(H??[]).length>0&&!o&&t.jsxs("div",{className:"space-y-1.5",children:[t.jsxs(Qe,{children:["List ",t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),t.jsxs(_e,{value:I||"none",onValueChange:S=>W(S==="none"?"":S),children:[t.jsx(Se,{className:"h-8 text-xs",children:t.jsx(Fe,{placeholder:"No list"})}),t.jsxs(Ce,{children:[t.jsx(be,{value:"none",className:"text-xs",children:t.jsx("span",{className:"text-muted-foreground",children:"No list"})}),(H??[]).map(S=>t.jsx(be,{value:S.id,className:"text-xs",children:S.name},S.id))]})]})]}),B.length>0&&t.jsxs("div",{className:"space-y-1.5",children:[t.jsxs(Qe,{children:["Sprint ",t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),t.jsxs(_e,{value:p||"none",onValueChange:S=>_(S==="none"?"":S),children:[t.jsx(Se,{className:"h-8 text-xs",children:t.jsx(Fe,{placeholder:"No sprint"})}),t.jsxs(Ce,{children:[t.jsx(be,{value:"none",className:"text-xs",children:t.jsx("span",{className:"text-muted-foreground",children:"No sprint"})}),B.map(S=>{const $=my(S);return t.jsx(be,{value:S.id,className:"text-xs",children:t.jsxs("div",{children:[t.jsx("span",{children:S.name}),$&&t.jsx("span",{className:"block text-[10px] text-muted-foreground leading-tight",children:$})]})},S.id)})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsxs(Qe,{children:["Assignees ",t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),t.jsx(yr,{value:y,onChange:C})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsxs(Qe,{children:["Start Date ",t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),t.jsxs(mt,{children:[t.jsx(ft,{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(Ht,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),t.jsx("span",{className:T?"text-foreground":"text-muted-foreground",children:T?ue(T,"MMM d, yyyy"):"No start date"}),T&&t.jsx("button",{type:"button",onClick:S=>{S.stopPropagation(),R(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:t.jsx(Ve,{className:"h-3.5 w-3.5"})})]})}),t.jsx(at,{className:"w-auto p-0",align:"start",children:t.jsx(Rt,{mode:"single",selected:T,onSelect:R,initialFocus:!0})})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsxs(Qe,{children:["Due Date ",t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),t.jsxs(mt,{children:[t.jsx(ft,{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(Ht,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),t.jsx("span",{className:E?"text-foreground":"text-muted-foreground",children:E?ue(E,"MMM d, yyyy"):"No due date"}),E&&t.jsx("button",{type:"button",onClick:S=>{S.stopPropagation(),P(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:t.jsx(Ve,{className:"h-3.5 w-3.5"})})]})}),t.jsx(at,{className:"w-auto p-0",align:"start",children:t.jsx(Rt,{mode:"single",selected:E,onSelect:P,initialFocus:!0})})]})]})]}),t.jsxs(pr,{className:"flex-col-reverse sm:flex-row sm:items-center sm:justify-between gap-2",children:[t.jsxs(J,{type:"button",variant:"ghost",size:"sm",className:"text-muted-foreground gap-1.5 justify-start sm:justify-center",onClick:()=>{te(),i(`/${l}/projects/${c}/issues/new`)},children:[t.jsx(wc,{className:"h-3.5 w-3.5"}),"Open full form"]}),t.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[t.jsx(J,{type:"button",variant:"ghost",onClick:te,children:"Cancel"}),t.jsx(J,{type:"submit",disabled:!u.trim()||O.isPending,children:O.isPending?"Creating...":"Create issue"})]})]})]})]})})}const Go={byIssue:e=>["attachments",e]};function Hd(e){return Ee({queryKey:Go.byIssue(e),queryFn:()=>se.get(`/admin/issues/${e}/attachments`),select:s=>s.attachments,enabled:!!e})}function Vd(e){const s=pe();return xe({mutationFn:({file:n,commentId:r})=>{const a=new FormData;return a.append("file",n),r&&a.append("comment_id",r),se.upload(`/admin/issues/${e}/attachments`,a)},onSuccess:()=>{s.invalidateQueries({queryKey:Go.byIssue(e)})}})}function fy(e){const s=pe();return xe({mutationFn:n=>se.delete(`/admin/issues/${e}/attachments/${n}`),onSuccess:()=>{s.invalidateQueries({queryKey:Go.byIssue(e)})}})}function Jn(e){return e.startsWith("image/")}function aa(e){return e.startsWith("video/")}function oa(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function zr(e){if(e.startsWith("/"))return!0;try{return new URL(e).origin===window.location.origin}catch{return!1}}function Qo(e,s){if(!zr(e)){console.error("downloadFile: blocked unsafe URL",e);return}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 Xo({mimeType:e,className:s}){return Jn(e)?t.jsx(Gf,{className:s}):aa(e)?t.jsx(Hr,{className:s}):e.startsWith("text/")||e.includes("json")?t.jsx(Kf,{className:s}):e.includes("zip")||e.includes("tar")||e.includes("gz")?t.jsx(Vf,{className:s}):e.includes("pdf")||e.includes("word")||e.includes("document")?t.jsx(Qf,{className:s}):t.jsx(Xf,{className:s})}function Kd({attachment:e,onClose:s}){return e?t.jsx(sn,{open:!0,onOpenChange:n=>!n&&s(),children:t.jsxs(nn,{className:"max-w-2xl w-full p-0 overflow-hidden",children:[t.jsxs(Mn,{className:"flex-row items-center justify-between px-4 py-3 border-b border-border shrink-0 pr-10",children:[t.jsx(_n,{className:"text-sm font-medium truncate",children:e.original_name}),t.jsxs(J,{variant:"ghost",size:"sm",className:"h-7 text-xs gap-1.5 shrink-0",onClick:()=>Qo(e.url,e.original_name),children:[t.jsx(yo,{className:"h-3.5 w-3.5"}),"Download"]})]}),t.jsxs(Dn,{className:"flex items-center justify-center bg-black/5 dark:bg-black/30 min-h-[320px] max-h-[75vh] overflow-auto p-0",children:[Jn(e.mime_type)&&zr(e.url)&&t.jsx("img",{src:e.url,alt:e.original_name,className:"max-w-full max-h-[75vh] object-contain"}),aa(e.mime_type)&&zr(e.url)&&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:oa(e.size)}),t.jsx("span",{children:"·"}),t.jsx("span",{children:e.mime_type}),t.jsx("span",{children:"·"}),t.jsxs("span",{children:["Uploaded ",ue(new Date(e.created_at),"MMM d, yyyy")]})]})]})}):null}function hy({attachment:e}){const[s,n]=x.useState(null),r=Jn(e.mime_type)||aa(e.mime_type),a=()=>{r?n(e):Qo(e.url,e.original_name)};return t.jsxs(t.Fragment,{children:[Jn(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:zr(e.url)?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(Xo,{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:oa(e.size)}),!r&&t.jsx(yo,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]}),s&&t.jsx(Kd,{attachment:s,onClose:()=>n(null)})]})}function xy({attachment:e,onOpen:s,onDelete:n,isDeleting:r}){const a=Jn(e.mime_type)||aa(e.mime_type),o=()=>{a?s(e):Qo(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(Xo,{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:oa(e.size)}),t.jsx("span",{children:"·"}),t.jsx("span",{children:ue(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(yo,{className:"h-2.5 w-2.5"}),"Click to download"]})]})]})]}),t.jsx(J,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100 text-muted-foreground hover:text-destructive transition-all",onClick:()=>n(e.id),disabled:r,children:t.jsx(xs,{className:"h-3.5 w-3.5"})})]})}function py({onFiles:e,isUploading:s}){const[n,r]=x.useState(!1),a=x.useRef(null),o=x.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:A("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(bh,{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 gy({issueId:e,className:s}){const[n,r]=x.useState(null),{data:a,isLoading:o}=Hd(e),i=Vd(e),l=fy(e),c=u=>{u.forEach(m=>{i.mutate({file:m},{onSuccess:()=>z.success(`${m.name} uploaded`),onError:()=>z.error(`Failed to upload ${m.name}`)})})},d=u=>{l.mutate(u,{onSuccess:()=>z.success("Attachment removed"),onError:()=>z.error("Failed to remove attachment")})};return t.jsxs("div",{className:A("px-6 py-4 space-y-4",s),children:[t.jsx(py,{onFiles:c,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(oe,{className:"h-8 w-8 rounded-md shrink-0"}),t.jsxs("div",{className:"flex-1 space-y-1.5",children:[t.jsx(oe,{className:"h-3 w-2/3"}),t.jsx(oe,{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(No,{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(xy,{attachment:u,onOpen:r,onDelete:d,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(Kd,{attachment:n,onClose:()=>r(null)})]})}const Ms={byIssue:e=>["time-logs",e],activeTimer:e=>["time-logs",e,"active-timer"]};function by(e){return Ee({queryKey:Ms.byIssue(e),queryFn:()=>se.get(`/admin/issues/${e}/time-logs`),enabled:!!e})}function yy(e){return Ee({queryKey:Ms.activeTimer(e),queryFn:()=>se.get(`/admin/issues/${e}/time-logs/timer`),select:s=>s.active_timer,enabled:!!e,refetchInterval:1e4})}function vy(e){const s=pe();return xe({mutationFn:n=>se.post(`/admin/issues/${e}/time-logs`,n),onSuccess:()=>{s.invalidateQueries({queryKey:Ms.byIssue(e)})}})}function jy(e){const s=pe();return xe({mutationFn:()=>se.post(`/admin/issues/${e}/time-logs/timer`,{action:"start"}),onSuccess:()=>{s.invalidateQueries({queryKey:Ms.activeTimer(e)}),s.invalidateQueries({queryKey:Ms.byIssue(e)})}})}function wy(e){const s=pe();return xe({mutationFn:()=>se.post(`/admin/issues/${e}/time-logs/timer`,{action:"stop"}),onSuccess:()=>{s.invalidateQueries({queryKey:Ms.activeTimer(e)}),s.invalidateQueries({queryKey:Ms.byIssue(e)})}})}function Ny(e){const s=pe();return xe({mutationFn:n=>se.delete(`/admin/issues/${e}/time-logs/${n}`),onSuccess:()=>{s.invalidateQueries({queryKey:Ms.byIssue(e)})}})}const ky=rr("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 ia({className:e,variant:s,...n}){return t.jsx("div",{className:A(ky({variant:s}),e),...n})}function to(e){const s=Math.floor(e/60),n=e%60;return s===0?`${n}m`:n===0?`${s}h`:`${s}h ${n}m`}function Hi(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 Sy({startedAt:e}){const[s,n]=x.useState(()=>Hi(e));return x.useEffect(()=>{const r=setInterval(()=>n(Hi(e)),1e3);return()=>clearInterval(r)},[e]),t.jsx("span",{className:"font-mono tabular-nums text-sm font-semibold text-foreground",children:s})}function Cy({onSubmit:e,isPending:s,onCancel:n}){const[r,a]=x.useState(""),[o,i]=x.useState(""),[l,c]=x.useState(""),[d,u]=x.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){z.error("Please enter a duration greater than 0.");return}e({duration_minutes:v,description:l.trim()||void 0,logged_date:d||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(ve,{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(ve,{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(ve,{type:"date",value:d,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(ve,{placeholder:"What did you work on?",value:l,onChange:f=>c(f.target.value),className:"h-8 text-sm"})]}),t.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[t.jsx(J,{type:"button",variant:"ghost",size:"sm",onClick:n,className:"h-7 text-xs",children:"Cancel"}),t.jsx(J,{type:"submit",size:"sm",disabled:s,className:"h-7 text-xs",children:s?"Saving…":"Log time"})]})]})}function My({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:A("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(xh,{className:"h-3.5 w-3.5 text-emerald-600"}):e.source==="timer"?t.jsx(_s,{className:"h-3.5 w-3.5 text-muted-foreground"}):t.jsx(Uf,{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(Sy,{startedAt:e.started_at}):t.jsx("span",{className:"text-sm font-semibold text-foreground tabular-nums",children:to(e.duration_minutes??0)}),t.jsx(ia,{variant:"muted",className:A("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:ue(new Date(e.logged_date),"MMM d, yyyy")})]}),!r&&t.jsx(J,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100 text-muted-foreground hover:text-destructive transition-all mt-0.5",onClick:()=>s(e.id),disabled:n,children:t.jsx(xs,{className:"h-3.5 w-3.5"})})]})}function Dy({issueId:e,className:s}){const[n,r]=x.useState(!1),{data:a,isLoading:o}=by(e),{data:i}=yy(e),l=vy(e),c=jy(e),d=wy(e),u=Ny(e),m=(a==null?void 0:a.time_logs)??[],f=(a==null?void 0:a.total_minutes)??0,h=i!=null,g=w=>{l.mutate(w,{onSuccess:()=>{r(!1),z.success("Time logged")},onError:()=>z.error("Failed to log time")})},v=()=>{c.mutate(void 0,{onSuccess:()=>z.success("Timer started"),onError:w=>z.error(w.message??"Failed to start timer")})},D=()=>{d.mutate(void 0,{onSuccess:w=>{const j=w.time_log.duration_minutes??0;z.success(`Timer stopped — ${to(j)} logged`)},onError:()=>z.error("Failed to stop timer")})},b=w=>{u.mutate(w,{onSuccess:()=>z.success("Time entry removed"),onError:()=>z.error("Failed to remove entry")})};return t.jsxs("div",{className:A("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?to(f):"—"})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[!n&&t.jsxs(J,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1.5",onClick:()=>r(!0),children:[t.jsx(Be,{className:"h-3.5 w-3.5"}),"Log time"]}),h?t.jsxs(J,{size:"sm",variant:"destructive",className:"h-8 text-xs gap-1.5",onClick:D,disabled:d.isPending,children:[t.jsx(uh,{className:"h-3.5 w-3.5 fill-current"}),"Stop"]}):t.jsxs(J,{size:"sm",className:"h-8 text-xs gap-1.5 bg-emerald-600 hover:bg-emerald-700 text-white",onClick:v,disabled:c.isPending,children:[t.jsx(Hr,{className:"h-3.5 w-3.5 fill-current"}),"Start"]})]})]}),n&&t.jsx(Cy,{onSubmit:g,isPending:l.isPending,onCancel:()=>r(!1)}),o?t.jsx("div",{className:"space-y-2",children:[1,2].map(w=>t.jsxs("div",{className:"flex items-center gap-3 px-3",children:[t.jsx(oe,{className:"h-7 w-7 rounded-full shrink-0"}),t.jsxs("div",{className:"flex-1 space-y-1.5",children:[t.jsx(oe,{className:"h-3 w-1/3"}),t.jsx(oe,{className:"h-2.5 w-1/4"})]})]},w))}):m.length>0?t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[t.jsx(_s,{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(w=>t.jsx(My,{entry:w,onDelete:b,isDeleting:u.isPending},w.id))})]}):t.jsx("p",{className:"text-sm text-muted-foreground/50 text-center py-1",children:"No time logged yet."})]})}function Rs({onClick:e,active:s,title:n,children:r}){return t.jsx("button",{type:"button",title:n,onMouseDown:a=>{a.preventDefault(),e()},className:A("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 Vi(){return t.jsx("span",{className:"mx-0.5 h-3.5 w-px shrink-0 bg-border"})}function Gd({issueId:e,compact:s,className:n,onSuccess:r}){const[a,o]=x.useState(!0),[i,l]=x.useState([]),[c,d]=x.useState(!1),u=x.useRef(null),m=x.useRef(async()=>{}),{user:f}=Te(),h=$f(e),g=Vd(e),v=(f==null?void 0:f.first_name)??"",D=(f==null?void 0:f.last_name)??"",b=`${v} ${D}`.trim()||(f==null?void 0:f.email)||"?",w=f&&`${v[0]??""}${D[0]??""}`.toUpperCase()||"?",j=eu(b),y=x.useMemo(()=>im.create({name:"submitShortcut",addKeyboardShortcuts(){return{"Mod-Enter":()=>(m.current(),!0)}}}),[]),C=Hl({extensions:[Vl,Kl,Gl.configure({placeholder:"Leave a comment…"}),y],editorProps:{attributes:{class:"meridian-editor"}},onUpdate({editor:E}){o(E.isEmpty)}}),p=!a||i.length>0,_=25*1024*1024,I=E=>{const P=E.filter(V=>V.size>_);P.length>0&&z.error(`Files must be under 25 MB: ${P.map(V=>V.name).join(", ")}`);const O=E.filter(V=>V.size<=_);l(V=>{const Y=new Set(V.map(H=>`${H.name}-${H.size}`));return[...V,...O.filter(H=>!Y.has(`${H.name}-${H.size}`))]})},W=E=>{l(P=>P.filter((O,V)=>V!==E))},T=async()=>{if(!(!p||c)){d(!0);try{const E=C!=null&&C.isEmpty?"":(C==null?void 0:C.getHTML())??"",O=(await h.mutateAsync(E||" ")).comment.id;for(const V of i)await g.mutateAsync({file:V,commentId:O});C==null||C.commands.clearContent(),o(!0),l([]),z.success("Comment added"),r==null||r()}catch{z.error("Failed to add comment")}finally{d(!1)}}};m.current=T;const R="h-3 w-3";return t.jsxs("div",{className:A("flex gap-3 items-start",n),children:[t.jsx(Dt,{className:"h-7 w-7 shrink-0 mt-1",children:t.jsx(_t,{className:A("text-[11px] font-semibold",j.bg,j.text),children:w})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:A("rounded-md border border-input overflow-hidden transition-shadow","focus-within:ring-1 focus-within:ring-ring",c&&"opacity-60 pointer-events-none"),children:[C&&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(Rs,{title:"Bold (⌘B)",active:C.isActive("bold"),onClick:()=>C.chain().focus().toggleBold().run(),children:t.jsx(xc,{className:R})}),t.jsx(Rs,{title:"Italic (⌘I)",active:C.isActive("italic"),onClick:()=>C.chain().focus().toggleItalic().run(),children:t.jsx(kc,{className:R})}),t.jsx(Rs,{title:"Strikethrough",active:C.isActive("strike"),onClick:()=>C.chain().focus().toggleStrike().run(),children:t.jsx(Ec,{className:R})}),t.jsx(Rs,{title:"Inline code",active:C.isActive("code"),onClick:()=>C.chain().focus().toggleCode().run(),children:t.jsx(jc,{className:R})}),t.jsx(Vi,{}),t.jsx(Rs,{title:"Bullet list",active:C.isActive("bulletList"),onClick:()=>C.chain().focus().toggleBulletList().run(),children:t.jsx(Cc,{className:R})}),t.jsx(Rs,{title:"Ordered list",active:C.isActive("orderedList"),onClick:()=>C.chain().focus().toggleOrderedList().run(),children:t.jsx(Sc,{className:R})}),t.jsx(Vi,{}),t.jsx(Rs,{title:"Code block",active:C.isActive("codeBlock"),onClick:()=>C.chain().focus().toggleCodeBlock().run(),children:t.jsx(vc,{className:R})})]}),t.jsx(Ql,{editor:C,className:A("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((E,P)=>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(Xo,{mimeType:E.type,className:"h-3 w-3 shrink-0 text-muted-foreground"}),t.jsx("span",{className:"truncate",children:E.name}),t.jsxs("span",{className:"text-muted-foreground shrink-0",children:["(",oa(E.size),")"]}),t.jsx("button",{type:"button",onClick:()=>W(P),className:"ml-0.5 rounded hover:text-destructive transition-colors shrink-0",children:t.jsx(Ve,{className:"h-3 w-3"})})]},P))}),t.jsxs("div",{className:"flex items-center justify-between mt-2",children:[t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(J,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>{var E;return(E=u.current)==null?void 0:E.click()},disabled:c,title:"Attach files",children:t.jsx(No,{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(J,{size:"icon",className:"h-8 w-8",onClick:T,disabled:!p||c,children:t.jsx(ch,{className:"h-3.5 w-3.5"})})]}),t.jsx("input",{ref:u,type:"file",multiple:!0,className:"hidden",onChange:E=>{const P=Array.from(E.target.files??[]);P.length>0&&I(P),E.target.value=""}})]})]})}/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */const{entries:Qd,setPrototypeOf:Ki,isFrozen:_y,getPrototypeOf:Ey,getOwnPropertyDescriptor:Ty}=Object;let{freeze:ht,seal:It,create:so}=Object,{apply:no,construct:ro}=typeof Reflect<"u"&&Reflect;ht||(ht=function(s){return s});It||(It=function(s){return s});no||(no=function(s,n){for(var r=arguments.length,a=new Array(r>2?r-2:0),o=2;o<r;o++)a[o-2]=arguments[o];return s.apply(n,a)});ro||(ro=function(s){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return new s(...r)});const _r=xt(Array.prototype.forEach),Oy=xt(Array.prototype.lastIndexOf),Gi=xt(Array.prototype.pop),Ln=xt(Array.prototype.push),Ay=xt(Array.prototype.splice),Rr=xt(String.prototype.toLowerCase),za=xt(String.prototype.toString),Fa=xt(String.prototype.match),qn=xt(String.prototype.replace),Py=xt(String.prototype.indexOf),Ry=xt(String.prototype.trim),Bt=xt(Object.prototype.hasOwnProperty),dt=xt(RegExp.prototype.test),Bn=Iy(TypeError);function xt(e){return function(s){s instanceof RegExp&&(s.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return no(e,s,r)}}function Iy(e){return function(){for(var s=arguments.length,n=new Array(s),r=0;r<s;r++)n[r]=arguments[r];return ro(e,n)}}function ye(e,s){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Rr;Ki&&Ki(e,null);let r=s.length;for(;r--;){let a=s[r];if(typeof a=="string"){const o=n(a);o!==a&&(_y(s)||(s[r]=o),a=o)}e[a]=!0}return e}function $y(e){for(let s=0;s<e.length;s++)Bt(e,s)||(e[s]=null);return e}function Zt(e){const s=so(null);for(const[n,r]of Qd(e))Bt(e,n)&&(Array.isArray(r)?s[n]=$y(r):r&&typeof r=="object"&&r.constructor===Object?s[n]=Zt(r):s[n]=r);return s}function Un(e,s){for(;e!==null;){const r=Ty(e,s);if(r){if(r.get)return xt(r.get);if(typeof r.value=="function")return xt(r.value)}e=Ey(e)}function n(){return null}return n}const Qi=ht(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Wa=ht(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),La=ht(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),zy=ht(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),qa=ht(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Fy=ht(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Xi=ht(["#text"]),Zi=ht(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Ba=ht(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Ji=ht(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Er=ht(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Wy=It(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ly=It(/<%[\w\W]*|[\w\W]*%>/gm),qy=It(/\$\{[\w\W]*/gm),By=It(/^data-[\-\w.\u00B7-\uFFFF]+$/),Uy=It(/^aria-[\-\w]+$/),Xd=It(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Yy=It(/^(?:\w+script|data):/i),Hy=It(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Zd=It(/^html$/i),Vy=It(/^[a-z][.\w]*(-[.\w]+)+$/i);var el=Object.freeze({__proto__:null,ARIA_ATTR:Uy,ATTR_WHITESPACE:Hy,CUSTOM_ELEMENT:Vy,DATA_ATTR:By,DOCTYPE_NAME:Zd,ERB_EXPR:Ly,IS_ALLOWED_URI:Xd,IS_SCRIPT_OR_DATA:Yy,MUSTACHE_EXPR:Wy,TMPLIT_EXPR:qy});const Yn={element:1,text:3,progressingInstruction:7,comment:8,document:9},Ky=function(){return typeof window>"u"?null:window},Gy=function(s,n){if(typeof s!="object"||typeof s.createPolicy!="function")return null;let r=null;const a="data-tt-policy-suffix";n&&n.hasAttribute(a)&&(r=n.getAttribute(a));const o="dompurify"+(r?"#"+r:"");try{return s.createPolicy(o,{createHTML(i){return i},createScriptURL(i){return i}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},tl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Jd(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ky();const s=de=>Jd(de);if(s.version="3.3.1",s.removed=[],!e||!e.document||e.document.nodeType!==Yn.document||!e.Element)return s.isSupported=!1,s;let{document:n}=e;const r=n,a=r.currentScript,{DocumentFragment:o,HTMLTemplateElement:i,Node:l,Element:c,NodeFilter:d,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:m,DOMParser:f,trustedTypes:h}=e,g=c.prototype,v=Un(g,"cloneNode"),D=Un(g,"remove"),b=Un(g,"nextSibling"),w=Un(g,"childNodes"),j=Un(g,"parentNode");if(typeof i=="function"){const de=n.createElement("template");de.content&&de.content.ownerDocument&&(n=de.content.ownerDocument)}let y,C="";const{implementation:p,createNodeIterator:_,createDocumentFragment:I,getElementsByTagName:W}=n,{importNode:T}=r;let R=tl();s.isSupported=typeof Qd=="function"&&typeof j=="function"&&p&&p.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:E,ERB_EXPR:P,TMPLIT_EXPR:O,DATA_ATTR:V,ARIA_ATTR:Y,IS_SCRIPT_OR_DATA:H,ATTR_WHITESPACE:B,CUSTOM_ELEMENT:L}=el;let{IS_ALLOWED_URI:te}=el,Z=null;const S=ye({},[...Qi,...Wa,...La,...qa,...Xi]);let $=null;const Q=ye({},[...Zi,...Ba,...Ji,...Er]);let F=Object.seal(so(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),M=null,q=null;const me=Object.seal(so(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ne=!0,Ae=!0,Xe=!1,$t=!0,gt=!1,fe=!0,it=!1,zt=!1,Ft=!1,bt=!1,Kt=!1,tt=!1,Nt=!0,ns=!1;const Ge="user-content-";let Wt=!0,yt=!1,Re={},qe=null;const Tt=ye({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let bs=null;const Ot=ye({},["audio","video","img","source","image","track"]);let rs=null;const kt=ye({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),St="http://www.w3.org/1998/Math/MathML",lt="http://www.w3.org/2000/svg",st="http://www.w3.org/1999/xhtml";let Ze=st,Gt=!1,as=null;const ce=ye({},[St,lt,st],za);let ee=ye({},["mi","mo","mn","ms","mtext"]),re=ye({},["annotation-xml"]);const X=ye({},["title","style","font","a","script"]);let ne=null;const we=["application/xhtml+xml","text/html"],U="text/html";let ie=null,he=null;const Ie=n.createElement("form"),Me=function(k){return k instanceof RegExp||k instanceof Function},De=function(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(he&&he===k)){if((!k||typeof k!="object")&&(k={}),k=Zt(k),ne=we.indexOf(k.PARSER_MEDIA_TYPE)===-1?U:k.PARSER_MEDIA_TYPE,ie=ne==="application/xhtml+xml"?za:Rr,Z=Bt(k,"ALLOWED_TAGS")?ye({},k.ALLOWED_TAGS,ie):S,$=Bt(k,"ALLOWED_ATTR")?ye({},k.ALLOWED_ATTR,ie):Q,as=Bt(k,"ALLOWED_NAMESPACES")?ye({},k.ALLOWED_NAMESPACES,za):ce,rs=Bt(k,"ADD_URI_SAFE_ATTR")?ye(Zt(kt),k.ADD_URI_SAFE_ATTR,ie):kt,bs=Bt(k,"ADD_DATA_URI_TAGS")?ye(Zt(Ot),k.ADD_DATA_URI_TAGS,ie):Ot,qe=Bt(k,"FORBID_CONTENTS")?ye({},k.FORBID_CONTENTS,ie):Tt,M=Bt(k,"FORBID_TAGS")?ye({},k.FORBID_TAGS,ie):Zt({}),q=Bt(k,"FORBID_ATTR")?ye({},k.FORBID_ATTR,ie):Zt({}),Re=Bt(k,"USE_PROFILES")?k.USE_PROFILES:!1,Ne=k.ALLOW_ARIA_ATTR!==!1,Ae=k.ALLOW_DATA_ATTR!==!1,Xe=k.ALLOW_UNKNOWN_PROTOCOLS||!1,$t=k.ALLOW_SELF_CLOSE_IN_ATTR!==!1,gt=k.SAFE_FOR_TEMPLATES||!1,fe=k.SAFE_FOR_XML!==!1,it=k.WHOLE_DOCUMENT||!1,bt=k.RETURN_DOM||!1,Kt=k.RETURN_DOM_FRAGMENT||!1,tt=k.RETURN_TRUSTED_TYPE||!1,Ft=k.FORCE_BODY||!1,Nt=k.SANITIZE_DOM!==!1,ns=k.SANITIZE_NAMED_PROPS||!1,Wt=k.KEEP_CONTENT!==!1,yt=k.IN_PLACE||!1,te=k.ALLOWED_URI_REGEXP||Xd,Ze=k.NAMESPACE||st,ee=k.MATHML_TEXT_INTEGRATION_POINTS||ee,re=k.HTML_INTEGRATION_POINTS||re,F=k.CUSTOM_ELEMENT_HANDLING||{},k.CUSTOM_ELEMENT_HANDLING&&Me(k.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(F.tagNameCheck=k.CUSTOM_ELEMENT_HANDLING.tagNameCheck),k.CUSTOM_ELEMENT_HANDLING&&Me(k.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(F.attributeNameCheck=k.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),k.CUSTOM_ELEMENT_HANDLING&&typeof k.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(F.allowCustomizedBuiltInElements=k.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),gt&&(Ae=!1),Kt&&(bt=!0),Re&&(Z=ye({},Xi),$=[],Re.html===!0&&(ye(Z,Qi),ye($,Zi)),Re.svg===!0&&(ye(Z,Wa),ye($,Ba),ye($,Er)),Re.svgFilters===!0&&(ye(Z,La),ye($,Ba),ye($,Er)),Re.mathMl===!0&&(ye(Z,qa),ye($,Ji),ye($,Er))),k.ADD_TAGS&&(typeof k.ADD_TAGS=="function"?me.tagCheck=k.ADD_TAGS:(Z===S&&(Z=Zt(Z)),ye(Z,k.ADD_TAGS,ie))),k.ADD_ATTR&&(typeof k.ADD_ATTR=="function"?me.attributeCheck=k.ADD_ATTR:($===Q&&($=Zt($)),ye($,k.ADD_ATTR,ie))),k.ADD_URI_SAFE_ATTR&&ye(rs,k.ADD_URI_SAFE_ATTR,ie),k.FORBID_CONTENTS&&(qe===Tt&&(qe=Zt(qe)),ye(qe,k.FORBID_CONTENTS,ie)),k.ADD_FORBID_CONTENTS&&(qe===Tt&&(qe=Zt(qe)),ye(qe,k.ADD_FORBID_CONTENTS,ie)),Wt&&(Z["#text"]=!0),it&&ye(Z,["html","head","body"]),Z.table&&(ye(Z,["tbody"]),delete M.tbody),k.TRUSTED_TYPES_POLICY){if(typeof k.TRUSTED_TYPES_POLICY.createHTML!="function")throw Bn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof k.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Bn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=k.TRUSTED_TYPES_POLICY,C=y.createHTML("")}else y===void 0&&(y=Gy(h,a)),y!==null&&typeof C=="string"&&(C=y.createHTML(""));ht&&ht(k),he=k}},ct=ye({},[...Wa,...La,...zy]),Je=ye({},[...qa,...Fy]),Qt=function(k){let K=j(k);(!K||!K.tagName)&&(K={namespaceURI:Ze,tagName:"template"});const ae=Rr(k.tagName),Pe=Rr(K.tagName);return as[k.namespaceURI]?k.namespaceURI===lt?K.namespaceURI===st?ae==="svg":K.namespaceURI===St?ae==="svg"&&(Pe==="annotation-xml"||ee[Pe]):!!ct[ae]:k.namespaceURI===St?K.namespaceURI===st?ae==="math":K.namespaceURI===lt?ae==="math"&&re[Pe]:!!Je[ae]:k.namespaceURI===st?K.namespaceURI===lt&&!re[Pe]||K.namespaceURI===St&&!ee[Pe]?!1:!Je[ae]&&(X[ae]||!ct[ae]):!!(ne==="application/xhtml+xml"&&as[k.namespaceURI]):!1},Xt=function(k){Ln(s.removed,{element:k});try{j(k).removeChild(k)}catch{D(k)}},Os=function(k,K){try{Ln(s.removed,{attribute:K.getAttributeNode(k),from:K})}catch{Ln(s.removed,{attribute:null,from:K})}if(K.removeAttribute(k),k==="is")if(bt||Kt)try{Xt(K)}catch{}else try{K.setAttribute(k,"")}catch{}},ni=function(k){let K=null,ae=null;if(Ft)k="<remove></remove>"+k;else{const Ue=Fa(k,/^[\r\n\t ]+/);ae=Ue&&Ue[0]}ne==="application/xhtml+xml"&&Ze===st&&(k='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+k+"</body></html>");const Pe=y?y.createHTML(k):k;if(Ze===st)try{K=new f().parseFromString(Pe,ne)}catch{}if(!K||!K.documentElement){K=p.createDocument(Ze,"template",null);try{K.documentElement.innerHTML=Gt?C:Pe}catch{}}const nt=K.body||K.documentElement;return k&&ae&&nt.insertBefore(n.createTextNode(ae),nt.childNodes[0]||null),Ze===st?W.call(K,it?"html":"body")[0]:it?K.documentElement:nt},ri=function(k){return _.call(k.ownerDocument||k,k,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},xa=function(k){return k instanceof m&&(typeof k.nodeName!="string"||typeof k.textContent!="string"||typeof k.removeChild!="function"||!(k.attributes instanceof u)||typeof k.removeAttribute!="function"||typeof k.setAttribute!="function"||typeof k.namespaceURI!="string"||typeof k.insertBefore!="function"||typeof k.hasChildNodes!="function")},ai=function(k){return typeof l=="function"&&k instanceof l};function os(de,k,K){_r(de,ae=>{ae.call(s,k,K,he)})}const oi=function(k){let K=null;if(os(R.beforeSanitizeElements,k,null),xa(k))return Xt(k),!0;const ae=ie(k.nodeName);if(os(R.uponSanitizeElement,k,{tagName:ae,allowedTags:Z}),fe&&k.hasChildNodes()&&!ai(k.firstElementChild)&&dt(/<[/\w!]/g,k.innerHTML)&&dt(/<[/\w!]/g,k.textContent)||k.nodeType===Yn.progressingInstruction||fe&&k.nodeType===Yn.comment&&dt(/<[/\w]/g,k.data))return Xt(k),!0;if(!(me.tagCheck instanceof Function&&me.tagCheck(ae))&&(!Z[ae]||M[ae])){if(!M[ae]&&li(ae)&&(F.tagNameCheck instanceof RegExp&&dt(F.tagNameCheck,ae)||F.tagNameCheck instanceof Function&&F.tagNameCheck(ae)))return!1;if(Wt&&!qe[ae]){const Pe=j(k)||k.parentNode,nt=w(k)||k.childNodes;if(nt&&Pe){const Ue=nt.length;for(let vt=Ue-1;vt>=0;--vt){const is=v(nt[vt],!0);is.__removalCount=(k.__removalCount||0)+1,Pe.insertBefore(is,b(k))}}}return Xt(k),!0}return k instanceof c&&!Qt(k)||(ae==="noscript"||ae==="noembed"||ae==="noframes")&&dt(/<\/no(script|embed|frames)/i,k.innerHTML)?(Xt(k),!0):(gt&&k.nodeType===Yn.text&&(K=k.textContent,_r([E,P,O],Pe=>{K=qn(K,Pe," ")}),k.textContent!==K&&(Ln(s.removed,{element:k.cloneNode()}),k.textContent=K)),os(R.afterSanitizeElements,k,null),!1)},ii=function(k,K,ae){if(Nt&&(K==="id"||K==="name")&&(ae in n||ae in Ie))return!1;if(!(Ae&&!q[K]&&dt(V,K))){if(!(Ne&&dt(Y,K))){if(!(me.attributeCheck instanceof Function&&me.attributeCheck(K,k))){if(!$[K]||q[K]){if(!(li(k)&&(F.tagNameCheck instanceof RegExp&&dt(F.tagNameCheck,k)||F.tagNameCheck instanceof Function&&F.tagNameCheck(k))&&(F.attributeNameCheck instanceof RegExp&&dt(F.attributeNameCheck,K)||F.attributeNameCheck instanceof Function&&F.attributeNameCheck(K,k))||K==="is"&&F.allowCustomizedBuiltInElements&&(F.tagNameCheck instanceof RegExp&&dt(F.tagNameCheck,ae)||F.tagNameCheck instanceof Function&&F.tagNameCheck(ae))))return!1}else if(!rs[K]){if(!dt(te,qn(ae,B,""))){if(!((K==="src"||K==="xlink:href"||K==="href")&&k!=="script"&&Py(ae,"data:")===0&&bs[k])){if(!(Xe&&!dt(H,qn(ae,B,"")))){if(ae)return!1}}}}}}}return!0},li=function(k){return k!=="annotation-xml"&&Fa(k,L)},ci=function(k){os(R.beforeSanitizeAttributes,k,null);const{attributes:K}=k;if(!K||xa(k))return;const ae={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:$,forceKeepAttr:void 0};let Pe=K.length;for(;Pe--;){const nt=K[Pe],{name:Ue,namespaceURI:vt,value:is}=nt,rn=ie(Ue),pa=is;let et=Ue==="value"?pa:Ry(pa);if(ae.attrName=rn,ae.attrValue=et,ae.keepAttr=!0,ae.forceKeepAttr=void 0,os(R.uponSanitizeAttribute,k,ae),et=ae.attrValue,ns&&(rn==="id"||rn==="name")&&(Os(Ue,k),et=Ge+et),fe&&dt(/((--!?|])>)|<\/(style|title|textarea)/i,et)){Os(Ue,k);continue}if(rn==="attributename"&&Fa(et,"href")){Os(Ue,k);continue}if(ae.forceKeepAttr)continue;if(!ae.keepAttr){Os(Ue,k);continue}if(!$t&&dt(/\/>/i,et)){Os(Ue,k);continue}gt&&_r([E,P,O],ui=>{et=qn(et,ui," ")});const di=ie(k.nodeName);if(!ii(di,rn,et)){Os(Ue,k);continue}if(y&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!vt)switch(h.getAttributeType(di,rn)){case"TrustedHTML":{et=y.createHTML(et);break}case"TrustedScriptURL":{et=y.createScriptURL(et);break}}if(et!==pa)try{vt?k.setAttributeNS(vt,Ue,et):k.setAttribute(Ue,et),xa(k)?Xt(k):Gi(s.removed)}catch{Os(Ue,k)}}os(R.afterSanitizeAttributes,k,null)},Su=function de(k){let K=null;const ae=ri(k);for(os(R.beforeSanitizeShadowDOM,k,null);K=ae.nextNode();)os(R.uponSanitizeShadowNode,K,null),oi(K),ci(K),K.content instanceof o&&de(K.content);os(R.afterSanitizeShadowDOM,k,null)};return s.sanitize=function(de){let k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},K=null,ae=null,Pe=null,nt=null;if(Gt=!de,Gt&&(de="<!-->"),typeof de!="string"&&!ai(de))if(typeof de.toString=="function"){if(de=de.toString(),typeof de!="string")throw Bn("dirty is not a string, aborting")}else throw Bn("toString is not a function");if(!s.isSupported)return de;if(zt||De(k),s.removed=[],typeof de=="string"&&(yt=!1),yt){if(de.nodeName){const is=ie(de.nodeName);if(!Z[is]||M[is])throw Bn("root node is forbidden and cannot be sanitized in-place")}}else if(de instanceof l)K=ni("<!---->"),ae=K.ownerDocument.importNode(de,!0),ae.nodeType===Yn.element&&ae.nodeName==="BODY"||ae.nodeName==="HTML"?K=ae:K.appendChild(ae);else{if(!bt&&!gt&&!it&&de.indexOf("<")===-1)return y&&tt?y.createHTML(de):de;if(K=ni(de),!K)return bt?null:tt?C:""}K&&Ft&&Xt(K.firstChild);const Ue=ri(yt?de:K);for(;Pe=Ue.nextNode();)oi(Pe),ci(Pe),Pe.content instanceof o&&Su(Pe.content);if(yt)return de;if(bt){if(Kt)for(nt=I.call(K.ownerDocument);K.firstChild;)nt.appendChild(K.firstChild);else nt=K;return($.shadowroot||$.shadowrootmode)&&(nt=T.call(r,nt,!0)),nt}let vt=it?K.outerHTML:K.innerHTML;return it&&Z["!doctype"]&&K.ownerDocument&&K.ownerDocument.doctype&&K.ownerDocument.doctype.name&&dt(Zd,K.ownerDocument.doctype.name)&&(vt="<!DOCTYPE "+K.ownerDocument.doctype.name+`>
|
|
471
|
-
`+vt),gt&&_r([E,P,O],is=>{vt=qn(vt,is," ")}),y&&tt?y.createHTML(vt):vt},s.setConfig=function(){let de=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};De(de),zt=!0},s.clearConfig=function(){he=null,zt=!1},s.isValidAttribute=function(de,k,K){he||De({});const ae=ie(de),Pe=ie(k);return ii(ae,Pe,K)},s.addHook=function(de,k){typeof k=="function"&&Ln(R[de],k)},s.removeHook=function(de,k){if(k!==void 0){const K=Oy(R[de],k);return K===-1?void 0:Ay(R[de],K,1)[0]}return Gi(R[de])},s.removeHooks=function(de){R[de]=[]},s.removeAllHooks=function(){R=tl()},s}var Qy=Jd();function Xy({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:A("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 Tr(){return t.jsx("span",{className:"mx-0.5 h-4 w-px shrink-0 bg-border"})}function Zo({content:e="",onChange:s,placeholder:n="Add a description…",className:r,toolbarClassName:a,editorClassName:o}){const i=Hl({extensions:[Vl.configure({heading:{levels:[1,2,3]}}),Kl,lm,cm.configure({nested:!0}),Gl.configure({placeholder:n})],content:e||"",editorProps:{attributes:{class:"meridian-editor"}},onUpdate({editor:d}){s&&s(d.isEmpty?"":d.getHTML())}});if(!i)return null;const l=(d,u,m,f,h)=>t.jsx(Xy,{title:d,onClick:m,active:f,disabled:h,children:u},d),c="h-3.5 w-3.5";return t.jsxs("div",{className:A("flex flex-col overflow-hidden",r),children:[t.jsxs("div",{className:A("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(gh,{className:c}),()=>i.chain().focus().undo().run(),!1,!i.can().undo()),l("Redo",t.jsx(lh,{className:c}),()=>i.chain().focus().redo().run(),!1,!i.can().redo()),t.jsx(Tr,{}),l("Bold (⌘B)",t.jsx(xc,{className:c}),()=>i.chain().focus().toggleBold().run(),i.isActive("bold")),l("Italic (⌘I)",t.jsx(kc,{className:c}),()=>i.chain().focus().toggleItalic().run(),i.isActive("italic")),l("Underline (⌘U)",t.jsx(ph,{className:c}),()=>i.chain().focus().toggleUnderline().run(),i.isActive("underline")),l("Strikethrough",t.jsx(Ec,{className:c}),()=>i.chain().focus().toggleStrike().run(),i.isActive("strike")),l("Inline code",t.jsx(jc,{className:c}),()=>i.chain().focus().toggleCode().run(),i.isActive("code")),t.jsx(Tr,{}),l("Heading 1",t.jsx(Zf,{className:c}),()=>i.chain().focus().toggleHeading({level:1}).run(),i.isActive("heading",{level:1})),l("Heading 2",t.jsx(Jf,{className:c}),()=>i.chain().focus().toggleHeading({level:2}).run(),i.isActive("heading",{level:2})),l("Heading 3",t.jsx(eh,{className:c}),()=>i.chain().focus().toggleHeading({level:3}).run(),i.isActive("heading",{level:3})),t.jsx(Tr,{}),l("Bullet list",t.jsx(Cc,{className:c}),()=>i.chain().focus().toggleBulletList().run(),i.isActive("bulletList")),l("Ordered list",t.jsx(Sc,{className:c}),()=>i.chain().focus().toggleOrderedList().run(),i.isActive("orderedList")),l("Task list",t.jsx(th,{className:c}),()=>i.chain().focus().toggleTaskList().run(),i.isActive("taskList")),t.jsx(Tr,{}),l("Blockquote",t.jsx(ih,{className:c}),()=>i.chain().focus().toggleBlockquote().run(),i.isActive("blockquote")),l("Code block",t.jsx(vc,{className:c}),()=>i.chain().focus().toggleCodeBlock().run(),i.isActive("codeBlock")),l("Divider line",t.jsx(ir,{className:c}),()=>i.chain().focus().setHorizontalRule().run())]}),t.jsx(Ql,{editor:i,className:A("flex-1 px-5 py-4",o)})]})}function Jo({html:e,className:s}){return e?t.jsx("div",{className:A("meridian-editor",s),dangerouslySetInnerHTML:{__html:Qy.sanitize(e)}}):null}const sl=[{bg:"bg-indigo-100 dark:bg-indigo-900/50",text:"text-indigo-700 dark:text-indigo-300"},{bg:"bg-violet-100 dark:bg-violet-900/50",text:"text-violet-700 dark:text-violet-300"},{bg:"bg-emerald-100 dark:bg-emerald-900/50",text:"text-emerald-700 dark:text-emerald-300"},{bg:"bg-amber-100 dark:bg-amber-900/50",text:"text-amber-700 dark:text-amber-300"},{bg:"bg-rose-100 dark:bg-rose-900/50",text:"text-rose-700 dark:text-rose-300"},{bg:"bg-sky-100 dark:bg-sky-900/50",text:"text-sky-700 dark:text-sky-300"},{bg:"bg-teal-100 dark:bg-teal-900/50",text:"text-teal-700 dark:text-teal-300"},{bg:"bg-orange-100 dark:bg-orange-900/50",text:"text-orange-700 dark:text-orange-300"}];function eu(e){let s=0;for(let n=0;n<e.length;n++)s=s*31+e.charCodeAt(n)&65535;return sl[s%sl.length]}function Zy({body:e}){const s=e.trim();return s?/^<[a-z][\s\S]*>/i.test(s)?t.jsx(Jo,{html:s,className:"text-xs"}):t.jsx("p",{className:"text-xs text-foreground leading-relaxed whitespace-pre-wrap",children:s}):null}const nl={created:{icon:Be,color:"text-emerald-600",bg:"bg-emerald-50 dark:bg-emerald-950/40"},status_changed:{icon:xo,color:"text-indigo-500",bg:"bg-indigo-50 dark:bg-indigo-950/40"},assigned:{icon:lr,color:"text-blue-500",bg:"bg-blue-50 dark:bg-blue-950/40"},unassigned:{icon:yh,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 Jy(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 c=(a=r==null?void 0:r.status)==null?void 0:a.from,d=(o=r==null?void 0:r.status)==null?void 0:o.to;return t.jsxs(t.Fragment,{children:["changed status",c&&t.jsxs(t.Fragment,{children:[" from ",t.jsx("strong",{className:"font-medium text-foreground",children:Gs[c]??c})]}),d&&t.jsxs(t.Fragment,{children:[" to ",t.jsx("strong",{className:"font-medium text-foreground",children:Gs[d]??d})]})]})}if(n==="assigned"||n==="unassigned"){const c=((i=r==null?void 0:r.assignee_ids)==null?void 0:i.to)??[],d=((l=r==null?void 0:r.assignee_ids)==null?void 0:l.from)??[],u=c.filter(h=>!d.includes(h)),m=d.filter(h=>!c.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 c=[];for(const[d,u]of Object.entries(r)){const{from:m,to:f}=u;d==="title"||d==="description"?c.push(t.jsxs("span",{children:["updated ",t.jsx("strong",{className:"font-medium text-foreground",children:d})]},d)):d==="priority"?c.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:hs[m]??String(m)})]}),f!=null&&t.jsxs(t.Fragment,{children:[" to ",t.jsx("strong",{className:"font-medium text-foreground",children:hs[f]??String(f)})]})]},d)):d==="type"?c.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:Cs[m]??String(m)})]}),f!=null&&t.jsxs(t.Fragment,{children:[" to ",t.jsx("strong",{className:"font-medium text-foreground",children:Cs[f]??String(f)})]})]},d)):c.push(t.jsxs("span",{children:["updated ",t.jsx("strong",{className:"font-medium text-foreground",children:d.replace(/_/g," ")})]},d))}return c.length===0?"made changes":t.jsx(t.Fragment,{children:c.reduce((d,u,m)=>m===0?[u]:[...d,t.jsx("span",{children:" and "},`sep-${m}`),u],[])})}return n.replace(/_/g," ")}function tu({issueId:e,className:s,compact:n,onViewMore:r,onTabChange:a,hideCommentInput:o}){const[i,l]=x.useState("comments"),c=b=>{l(b),a==null||a(b)},{user:d}=Te(),{data:u}=kd(),{data:m,isLoading:f}=Rf(e),{data:h,isLoading:g}=If(e),{data:v}=Hd(e),D=b=>{var w;if(d&&b===d.id){const j=d.first_name??"",y=d.last_name??"",C=`${j} ${y}`.trim()||d.email,p=(j[0]??y[0]??((w=d.email)==null?void 0:w[0])??"U").toUpperCase();return{name:C,initials:p}}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 px-6 pt-3 border-b border-zinc-100 dark:border-zinc-800",children:["comments","activity","attachments","time"].map(b=>{const w=b==="comments"?(m==null?void 0:m.length)??0:b==="activity"?(h==null?void 0:h.length)??0:void 0,j=b==="comments"?"Comments":b==="activity"?"Activity":b==="attachments"?"Attachments":"Time",y=i===b;return t.jsxs("button",{onClick:()=>c(b),className:A("pb-2.5 mr-5 text-xs font-medium transition-colors border-b-2 -mb-px",y?"text-indigo-700 dark:text-indigo-300 border-indigo-500 dark:border-indigo-400":"border-transparent text-zinc-500 dark:text-zinc-400 hover:text-zinc-800 dark:hover:text-zinc-200"),children:[j,w!=null&&w>0&&t.jsx("span",{className:A("ml-1.5 text-[10px] tabular-nums font-normal",y?"text-indigo-700 dark:text-indigo-500":"text-zinc-400"),children:w})]},b)})}),i==="comments"&&t.jsxs("div",{className:"px-6 pb-5 pt-4",children:[t.jsx("div",{className:"space-y-5 mb-5",children:f?t.jsxs("div",{className:"flex gap-3",children:[t.jsx(oe,{className:"h-7 w-7 rounded-full shrink-0"}),t.jsx(oe,{className:"h-16 flex-1"})]}):m&&m.length>0?(n?m.slice(-5):m).map(b=>{const w=D(b.author_id),j=eu(w.name),y=(v??[]).filter(C=>C.comment_id===b.id);return t.jsxs("div",{className:"flex gap-3",children:[t.jsx(Dt,{className:"h-7 w-7 mt-0.5 shrink-0",children:t.jsx(_t,{className:A("text-[11px] font-semibold",j.bg,j.text),children:w.initials})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-baseline gap-2 mb-1.5",children:[t.jsx("span",{className:"text-xs font-semibold text-zinc-900 dark:text-zinc-100",children:w.name}),t.jsx("span",{className:"text-[11px] text-zinc-400 dark:text-zinc-500",children:ue(new Date(b.created_at),"MMM d, h:mm a")})]}),t.jsx("div",{className:"rounded-lg bg-zinc-50 dark:bg-zinc-900 border border-zinc-100 dark:border-zinc-800 px-3 py-2.5",children:t.jsx(Zy,{body:b.body})}),y.length>0&&t.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:y.map(C=>t.jsx(hy,{attachment:C},C.id))})]})]},b.id)}):t.jsxs("div",{className:"flex flex-col items-center py-6 gap-2",children:[t.jsx("div",{className:"h-9 w-9 rounded-full bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center",children:t.jsx(Mc,{className:"h-4 w-4 text-zinc-400 dark:text-zinc-500"})}),t.jsx("p",{className:"text-xs text-zinc-400 dark:text-zinc-500",children:"No comments yet"})]})}),n&&m&&m.length>5&&r&&t.jsxs("button",{onClick:r,className:"text-xs text-indigo-700 hover:text-indigo-900 dark:text-indigo-300 dark:hover:text-indigo-100 mb-4 font-medium transition-colors",children:["View all ",m.length," comments →"]}),!o&&t.jsx(Gd,{issueId:e})]}),i==="activity"&&t.jsx("div",{className:"px-6 pb-6 pt-4",children:g?t.jsx("div",{className:"space-y-4",children:[1,2,3].map(b=>t.jsxs("div",{className:"flex gap-3",children:[t.jsx(oe,{className:"h-6 w-6 rounded-full shrink-0 mt-0.5"}),t.jsx(oe,{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-zinc-100 dark:bg-zinc-800"}),t.jsx("div",{className:"space-y-0",children:(n?h.slice(-5):h).map((b,w,j)=>{var I;const y=nl[b.action]??nl.updated,C=y.icon,p=((I=u==null?void 0:u.get(b.actor_id))==null?void 0:I.name)??"System",_=w===j.length-1;return t.jsxs("div",{className:A("relative flex gap-3",_?"pb-0":"pb-4"),children:[t.jsx("div",{className:A("relative z-10 flex h-6 w-6 shrink-0 items-center justify-center rounded-full mt-0.5",y.bg),children:t.jsx(C,{className:A("h-3 w-3",y.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-semibold text-zinc-900 dark:text-zinc-100",children:p})," ",t.jsx("span",{className:"text-zinc-500 dark:text-zinc-400",children:Jy(b,u)})]}),t.jsx("p",{className:"text-[11px] text-zinc-400 dark:text-zinc-500 mt-0.5",children:ue(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-indigo-700 hover:text-indigo-900 dark:text-indigo-300 dark:hover:text-indigo-100 mt-3 font-medium transition-colors",children:["View all ",h.length," events →"]})]}):t.jsx("p",{className:"text-xs text-zinc-400 dark:text-zinc-500 py-4",children:"No activity yet."})}),i==="attachments"&&t.jsx(gy,{issueId:e}),i==="time"&&t.jsx(Dy,{issueId:e})]})}const su=x.forwardRef(({className:e,children:s,...n},r)=>t.jsxs($l,{ref:r,className:A("relative overflow-hidden",e),...n,children:[t.jsx(Qu,{className:"h-full w-full rounded-[inherit]",children:s}),t.jsx(nu,{}),t.jsx(Xu,{})]}));su.displayName=$l.displayName;const nu=x.forwardRef(({className:e,orientation:s="vertical",...n},r)=>t.jsx(zl,{ref:r,orientation:s,className:A("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(Zu,{className:"relative flex-1 rounded-full bg-border"})}));nu.displayName=zl.displayName;function Mt({zone:e,props:s}){const n=Pf(e);return n.length?t.jsx(t.Fragment,{children:n.map((r,a)=>t.jsx(r,{...s},r.displayName??r.name??a))}):null}function ev(e){if(!e.start_date&&!e.end_date)return null;const s=e.start_date?ue(new Date(e.start_date),"MMM d"):"—",n=e.end_date?ue(new Date(e.end_date),"MMM d"):"—";return`${s} – ${n}`}const tv={urgent:"bg-red-500",high:"bg-orange-500",medium:"bg-amber-500",low:"bg-sky-500",no_priority:"bg-zinc-400"};function sv(e,s){return e==="completed"?"bg-emerald-500":e==="in_progress"?"bg-indigo-500":e==="cancelled"?"bg-red-400":s!=null&&s.includes("block")?"bg-red-500":"bg-zinc-400"}const cs=({children:e})=>t.jsx("p",{className:"text-[10px] font-semibold tracking-[0.08em] uppercase text-zinc-900 dark:text-zinc-100 mb-1.5",children:e}),Or=()=>t.jsx("div",{className:"border-t border-zinc-100 dark:border-zinc-800"});function ru({issue:e,projectId:s,open:n,onClose:r}){const a=ot(),{workspace:o,projectKey:i}=pt(),{data:l}=mc((e==null?void 0:e.id)??""),c=l??e,[d,u]=x.useState(!1),[m,f]=x.useState(""),[h,g]=x.useState(""),[v,D]=x.useState("comments"),[b,w]=x.useState(!1),j=qr((c==null?void 0:c.id)??"",s),{data:y}=Tn(s),{data:C}=On(s||void 0),{data:p}=br(s||void 0),{data:_}=nr(s||void 0),I=(C??[]).filter(M=>M.status!=="completed"),W=c!=null&&c.parent_id?_==null?void 0:_.find(M=>M.id===c.parent_id):null,T=(_==null?void 0:_.filter(M=>M.parent_id===(c==null?void 0:c.id)))??[],R=c!=null&&c.task_list_id?p==null?void 0:p.find(M=>M.id===c.task_list_id):null,E=y&&y.length>0?Object.fromEntries(y.map(M=>[M.key,M.name])):Gs;if(x.useEffect(()=>{c&&(f(c.title),g(c.description??"")),u(!1)},[c==null?void 0:c.id]),!c)return null;const P=()=>{m.trim()&&j.mutate({title:m.trim(),description:h.trim()||void 0},{onSuccess:()=>{u(!1),z.success("Issue updated")},onError:()=>z.error("Failed to update issue")})},O=()=>{f(c.title),g(c.description??""),u(!1)},V=M=>{j.mutate({status:M},{onSuccess:()=>z.success("Status updated"),onError:()=>z.error("Failed to update status")})},Y=M=>{j.mutate({priority:M},{onSuccess:()=>z.success("Priority updated"),onError:()=>z.error("Failed to update priority")})},H=M=>{j.mutate({type:M},{onSuccess:()=>z.success("Type updated"),onError:()=>z.error("Failed to update type")})},B=M=>{j.mutate({assignee_ids:M},{onSuccess:()=>z.success("Assignees updated"),onError:()=>z.error("Failed to update assignees")})},L=M=>{j.mutate({sprint_id:M},{onSuccess:()=>z.success(M?"Sprint assigned":"Removed from sprint"),onError:()=>z.error("Failed to update sprint")})},te=M=>{j.mutate({task_list_id:M},{onSuccess:()=>z.success(M?"Moved to list":"Removed from list"),onError:()=>z.error("Failed to update list")})},Z=M=>{j.mutate({start_date:M?ue(M,"yyyy-MM-dd"):null},{onSuccess:()=>z.success(M?"Start date set":"Start date cleared"),onError:()=>z.error("Failed to update start date")})},S=M=>{j.mutate({due_date:M?ue(M,"yyyy-MM-dd"):null},{onSuccess:()=>z.success(M?"Due date set":"Due date cleared"),onError:()=>z.error("Failed to update due date")})},$=y==null?void 0:y.find(M=>M.category==="completed"),Q=!!$&&c.status===$.key,F=(M,q,me)=>{const Ne=M;return t.jsx("button",{title:q,onClick:me,className:"h-8 w-8 flex items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-accent transition-colors",children:t.jsx(Ne,{className:"h-4 w-4"})},q)};return t.jsxs(t.Fragment,{children:[t.jsx(sn,{open:n,onOpenChange:M=>!M&&r(),children:t.jsxs(nn,{className:"flex flex-col p-0 w-full max-w-2xl overflow-hidden bg-white dark:bg-zinc-950",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-border shrink-0",children:[t.jsxs("button",{onClick:()=>{var M;$&&V(Q?((M=y==null?void 0:y.find(q=>q.category==="unstarted"||q.category==="backlog"))==null?void 0:M.key)??c.status:$.key)},className:A("flex items-center gap-1.5 px-3 py-1.5 rounded-md border text-xs font-medium transition-colors",Q?"border-emerald-500/40 text-emerald-600 dark:text-emerald-400 bg-emerald-50 dark:bg-emerald-950/30":"border-border text-muted-foreground hover:text-foreground hover:border-foreground/40"),children:[t.jsx(Pt,{className:"h-3.5 w-3.5"}),Q?"Completed":"Mark complete"]}),t.jsxs("div",{className:"flex items-center",children:[F(hh,"Upvote"),F(No,"Attachments"),F(Sn,"Add sub-issue",()=>w(!0)),F(wo,"Copy link",()=>{navigator.clipboard.writeText(`${window.location.origin}/${o}/projects/${i}/issues/${c.id}`),z.success("Link copied")}),F(nh,"Open full page",()=>{r(),a(`/${o}/projects/${i}/issues/${c.id}`)}),d?t.jsxs("div",{className:"flex items-center gap-1 ml-1",children:[t.jsx(J,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:O,children:"Cancel"}),t.jsxs(J,{size:"sm",className:"h-7 text-xs",onClick:P,disabled:!m.trim()||j.isPending,children:[t.jsx(Pt,{className:"h-3.5 w-3.5 mr-1"}),"Save"]})]}):t.jsxs(en,{children:[t.jsx(tn,{asChild:!0,children:F(ar,"More options")}),t.jsx(Es,{align:"end",className:"w-40",children:t.jsxs(ut,{onClick:()=>u(!0),children:[t.jsx(Gn,{className:"h-3.5 w-3.5 mr-2"}),"Edit"]})})]}),F(oh,"Open in full page",()=>{r(),a(`/${o}/projects/${i}/issues/${c.id}`)})]})]}),t.jsx("div",{className:"px-6 pt-5 pb-4 shrink-0",children:d?t.jsx(ve,{value:m,onChange:M=>f(M.target.value),className:"text-sm font-medium h-8",autoFocus:!0}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center gap-2 mb-2.5",children:[t.jsx("span",{className:"text-[11px] font-mono font-medium text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-950/60 px-1.5 py-0.5 rounded",children:c.identifier}),t.jsx("span",{className:"text-[10px] font-semibold tracking-widest uppercase text-violet-500 dark:text-violet-400",children:Cs[c.type]??c.type})]}),t.jsx("h2",{className:"text-[17px] font-semibold leading-snug text-zinc-900 dark:text-zinc-50",children:c.title})]})}),t.jsxs(su,{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"px-6 pb-4 space-y-5 min-w-0",children:[t.jsx(Mt,{zone:"issue.details.before",props:{issue:c}}),t.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx(cs,{children:"Status"}),t.jsxs(_e,{value:c.status,onValueChange:V,children:[t.jsx(Se,{className:"h-8 text-xs min-w-0",children:t.jsx(Fe,{})}),t.jsx(Ce,{children:Object.entries(E).map(([M,q])=>{const me=y==null?void 0:y.find(Ne=>Ne.key===M);return t.jsx(be,{value:M,className:"text-xs",children:t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:A("h-2 w-2 rounded-full shrink-0 flex-none",sv(me==null?void 0:me.category,M))}),t.jsx("span",{children:q})]})},M)})})]})]}),t.jsxs("div",{className:"min-w-0",children:[t.jsx(cs,{children:"Priority"}),t.jsxs(_e,{value:c.priority,onValueChange:Y,children:[t.jsx(Se,{className:"h-8 text-xs min-w-0",children:t.jsx(Fe,{})}),t.jsx(Ce,{children:Object.entries(hs).map(([M,q])=>t.jsx(be,{value:M,className:"text-xs",children:t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:A("h-2 w-2 rounded-full shrink-0 flex-none",tv[M]??"bg-zinc-400")}),t.jsx("span",{children:q})]})},M))})]})]}),t.jsxs("div",{className:"min-w-0",children:[t.jsx(cs,{children:"Type"}),t.jsxs(_e,{value:c.type,onValueChange:H,children:[t.jsx(Se,{className:"h-8 text-xs min-w-0",children:t.jsx(Fe,{})}),t.jsx(Ce,{children:Object.entries(Cs).map(([M,q])=>t.jsx(be,{value:M,className:"text-xs",children:q},M))})]})]})]}),t.jsx(Or,{}),t.jsxs("div",{children:[t.jsx(cs,{children:"Assignees"}),t.jsx(yr,{value:c.assignee_ids??[],onChange:B,disabled:j.isPending})]}),t.jsx(Or,{}),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(cs,{children:"Sprint"}),t.jsxs(_e,{value:c.sprint_id??"none",onValueChange:M=>L(M==="none"?null:M),children:[t.jsx(Se,{className:"h-8 text-xs 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(Fe,{placeholder:"No sprint"})]})}),t.jsxs(Ce,{children:[t.jsx(be,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),I.map(M=>{const q=ev(M);return t.jsx(be,{value:M.id,className:"text-xs",children:t.jsxs("div",{className:"flex items-baseline gap-1.5",children:[t.jsx("span",{children:M.name}),q&&t.jsx("span",{className:"text-[10px] text-muted-foreground font-normal",children:q})]})},M.id)})]})]})]}),(p??[]).length>0&&t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx(cs,{children:"List"}),t.jsxs(_e,{value:c.task_list_id??"none",onValueChange:M=>te(M==="none"?null:M),children:[t.jsx(Se,{className:"h-8 text-xs min-w-0",children:t.jsxs("div",{className:"flex items-center gap-1 min-w-0 overflow-hidden",children:[t.jsx(jo,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),t.jsx(Fe,{placeholder:"No list",children:R?R.name:"No list"})]})}),t.jsxs(Ce,{children:[t.jsx(be,{value:"none",className:"text-xs text-muted-foreground",children:"No list"}),(p??[]).map(M=>t.jsx(be,{value:M.id,className:"text-xs",children:M.name},M.id))]})]})]}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx(cs,{children:"Start Date"}),t.jsxs(mt,{children:[t.jsx(ft,{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 hover:bg-accent transition-colors overflow-hidden",children:[t.jsx(Ht,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),t.jsx("span",{className:`truncate ${c.start_date?"text-foreground":"text-muted-foreground"}`,children:c.start_date?ue(new Date(c.start_date),"MMM d, yyyy"):"No date"})]})}),t.jsxs(at,{className:"w-auto p-0",align:"start",children:[t.jsx(Rt,{mode:"single",selected:c.start_date?new Date(c.start_date):void 0,onSelect:Z,initialFocus:!0}),c.start_date&&t.jsx("div",{className:"border-t px-3 py-2",children:t.jsxs("button",{onClick:()=>Z(void 0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[t.jsx(Ve,{className:"h-3 w-3"}),"Clear date"]})})]})]})]}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx(cs,{children:"Due Date"}),t.jsxs(mt,{children:[t.jsx(ft,{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 hover:bg-accent transition-colors overflow-hidden",children:[t.jsx(Ht,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),t.jsx("span",{className:`truncate ${c.due_date?"text-foreground":"text-muted-foreground"}`,children:c.due_date?ue(new Date(c.due_date),"MMM d, yyyy"):"No date"})]})}),t.jsxs(at,{className:"w-auto p-0",align:"start",children:[t.jsx(Rt,{mode:"single",selected:c.due_date?new Date(c.due_date):void 0,onSelect:S,initialFocus:!0}),c.due_date&&t.jsx("div",{className:"border-t px-3 py-2",children:t.jsxs("button",{onClick:()=>S(void 0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[t.jsx(Ve,{className:"h-3 w-3"}),"Clear date"]})})]})]})]})]}),t.jsx(Or,{}),!c.parent_id&&t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-[10px] font-semibold tracking-[0.08em] uppercase text-zinc-900 dark:text-zinc-100",children:"Child Issues"}),t.jsxs("button",{onClick:()=>w(!0),className:"flex items-center gap-1 px-2 py-0.5 rounded-md bg-indigo-50 dark:bg-indigo-950/50 text-indigo-700 dark:text-indigo-300 text-[11px] font-medium hover:bg-indigo-100 dark:hover:bg-indigo-900/60 transition-colors",children:[t.jsx(Be,{className:"h-3 w-3"}),"Add"]})]}),W&&t.jsxs("button",{onClick:()=>a(`/${o}/projects/${i}/issues/${W.id}`),className:"flex items-center gap-2 w-full px-3 py-1.5 rounded-md bg-zinc-100 dark:bg-zinc-800/60 border border-zinc-200 dark:border-zinc-700 hover:border-indigo-300 dark:hover:border-indigo-700 transition-colors text-left",children:[t.jsx(bo,{className:"h-3.5 w-3.5 text-zinc-400 shrink-0"}),t.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-400 shrink-0",children:"Parent:"}),t.jsx("span",{className:"font-mono text-[11px] font-medium text-indigo-700 dark:text-indigo-300 shrink-0",children:W.identifier}),t.jsx("span",{className:"text-xs text-zinc-600 dark:text-zinc-300 truncate",children:W.title})]}),T.length===0?t.jsxs("button",{onClick:()=>w(!0),className:"w-full flex items-center justify-center gap-2 py-3.5 rounded-lg border-2 border-dashed border-zinc-200 dark:border-zinc-800 text-xs text-zinc-400 dark:text-zinc-500 hover:border-indigo-300 hover:text-indigo-500 dark:hover:border-indigo-700 dark:hover:text-indigo-400 transition-all",children:[t.jsx(Be,{className:"h-3.5 w-3.5"}),"Create child issue"]}):t.jsx("div",{className:"space-y-1",children:T.map(M=>t.jsxs("button",{onClick:()=>{r(),a(`/${o}/projects/${i}/issues/${M.id}`)},className:"w-full flex items-center gap-2.5 px-3 py-2 rounded-lg bg-indigo-50/40 dark:bg-indigo-950/30 border border-indigo-200 dark:border-indigo-800 hover:bg-indigo-100/70 hover:border-indigo-400 dark:hover:bg-indigo-950/50 dark:hover:border-indigo-600 hover:shadow-sm transition-all text-left group",children:[t.jsx(Bs,{className:"h-3.5 w-3.5 text-indigo-400 dark:text-indigo-500 shrink-0"}),t.jsx("span",{className:"font-mono text-[11px] font-medium text-indigo-700 dark:text-indigo-300 shrink-0",children:M.identifier}),t.jsx("span",{className:"text-xs text-zinc-700 dark:text-zinc-300 truncate group-hover:text-zinc-900 dark:group-hover:text-zinc-100 transition-colors",children:M.title})]},M.id))})]}),t.jsx(Or,{}),t.jsxs("div",{children:[t.jsx(cs,{children:"Description"}),d?t.jsx(Zo,{content:h,onChange:g,placeholder:"Add a description…",className:"min-h-[160px] rounded-md border border-input"},`${c.id}-edit`):c.description?t.jsx("div",{className:"rounded-lg bg-zinc-50 dark:bg-zinc-900/60 border border-zinc-100 dark:border-zinc-800 px-3.5 py-3",children:t.jsx(Jo,{html:c.description,className:"text-sm"})}):t.jsxs("button",{onClick:()=>u(!0),className:"w-full flex items-center justify-center gap-2 py-3.5 rounded-lg border-2 border-dashed border-zinc-200 dark:border-zinc-800 text-xs text-zinc-400 dark:text-zinc-500 hover:border-indigo-300 hover:text-indigo-500 dark:hover:border-indigo-700 dark:hover:text-indigo-400 transition-all",children:[t.jsx(Gn,{className:"h-3.5 w-3.5"}),"Add description"]})]})]}),t.jsx("div",{className:"px-6 py-4",children:t.jsx(Mt,{zone:"issue.details.after",props:{issue:c}})}),t.jsx(tu,{issueId:c.id,className:"border-t border-border",compact:!0,hideCommentInput:!0,onTabChange:D,onViewMore:()=>{r(),a(`/${o}/projects/${i}/issues/${c.id}`)}})]}),v==="comments"&&t.jsx("div",{className:"border-t border-border px-6 py-3 shrink-0",children:t.jsx(Gd,{issueId:c.id,compact:!0})})]})}),t.jsx(ra,{open:b,onClose:()=>w(!1),projectId:s,defaultParentId:c.id,defaultTaskListId:c.task_list_id})]})}function nv(){const{projectKey:e}=pt(),[s,n]=x.useState(null),[r,a]=x.useState(!1),{data:o}=Js(e??""),i=(o==null?void 0:o.id)??"",{data:l,isLoading:c}=nr(i||void 0),{data:d,isLoading:u}=Tn(i||void 0),m=wb(i);if(!e)return null;const f=c||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(J,{size:"sm",onClick:()=>a(!0),children:[t.jsx(Be,{className:"h-4 w-4"}),"Create"]})}),t.jsx(Mt,{zone:"project.board.before",props:{projectId:i}}),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(oe,{className:"h-5 w-24 mb-3 rounded"}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(oe,{className:"h-[82px] w-full rounded-lg"}),t.jsx(oe,{className:"h-[82px] w-full rounded-lg"})]})]},g))}):t.jsx(Eb,{issues:l??[],projectId:i,statuses:d??[],onIssueClick:n,onColumnsReorder:h})})]}),t.jsx(Mt,{zone:"project.board.after",props:{projectId:i}}),t.jsx(ru,{issue:s,projectId:i,open:!!s,onClose:()=>n(null)}),t.jsx(ra,{open:r,onClose:()=>a(!1),projectId:i})]})}const rl=({priority:e,className:s})=>{const n=A("h-3.5 w-3.5 shrink-0",Sd[e],s);switch(e){case"urgent":return t.jsx(Cn,{className:n});case"high":return t.jsx(Ur,{className:n});case"medium":return t.jsx(ir,{className:n});case"low":return t.jsx(Br,{className:n});default:return t.jsx(ts,{className:A("h-3.5 w-3.5 shrink-0 text-zinc-300",s)})}},ao="grid-cols-[70px_250px_150px_120px_130px_140px_130px_32px]";function au({issue:e,projectId:s,statuses:n,statusLabels:r,statusColorMap:a,sprints:o,workspace:i,projectKey:l,onOpen:c,isChild:d=!1,children:u=[],onAddChild:m}){const f=ot(),[h,g]=x.useState(null),[v,D]=x.useState(!1),b=qr(e.id,s);function w(p){b.mutate(p),g(null)}const j=(a==null?void 0:a[e.status])??"#94a3b8",y=o.find(p=>p.id===e.sprint_id),C=u.length>0;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{onClick:()=>c(e),className:A(`group grid ${ao} items-center py-3`,"hover:bg-[#f9fafb] dark:hover:bg-muted/30 cursor-pointer transition-colors",d&&"bg-muted/10",b.isPending&&"opacity-70"),children:[t.jsx("span",{className:A("text-xs font-mono text-muted-foreground truncate","sticky left-0 z-10 pl-6 transition-colors","bg-white dark:bg-card group-hover:bg-[#f9fafb] dark:group-hover:bg-muted/30",d&&"text-muted-foreground/60"),children:e.identifier}),t.jsxs("div",{className:A("flex items-center gap-1 min-w-0 pr-3","sticky left-[70px] z-10 transition-colors","bg-white dark:bg-card group-hover:bg-[#f9fafb] dark:group-hover:bg-muted/30",d&&"bg-[#f8f9fa] dark:bg-muted/20"),children:[!d&&C&&t.jsxs(Ls,{children:[t.jsx(qs,{asChild:!0,children:t.jsx("button",{onClick:p=>{p.stopPropagation(),D(!v)},className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors p-0.5 rounded",children:v?t.jsx(Nn,{className:"h-3.5 w-3.5"}):t.jsx(kn,{className:"h-3.5 w-3.5"})})}),t.jsx(ks,{side:"top",children:v?"Collapse":"Expand"})]}),!d&&!C&&t.jsx("span",{className:"w-4 shrink-0"}),d&&t.jsx(Bs,{className:"h-3 w-3 text-muted-foreground/40 shrink-0"}),t.jsx("span",{className:A("text-sm text-foreground truncate",d&&"text-muted-foreground"),children:e.title}),!d&&C&&t.jsxs("span",{className:"shrink-0 flex items-center gap-0.5 ml-1 text-[10px] font-medium text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-950/50 px-1 py-0.5 rounded",children:[t.jsx(Bs,{className:"h-2.5 w-2.5"}),u.length]})]}),t.jsx("div",{onClick:p=>p.stopPropagation(),children:t.jsxs(mt,{open:h==="status",onOpenChange:p=>g(p?"status":null),children:[t.jsx(ft,{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:j}}),t.jsx("span",{className:"text-xs text-muted-foreground truncate",children:r[e.status]??e.status})]})}),t.jsx(at,{className:"w-52 p-1",align:"start",onClick:p=>p.stopPropagation(),children:t.jsx(fn,{children:t.jsx(hn,{children:t.jsx(Ys,{children:n.map(p=>t.jsxs(Ut,{value:p.name,onSelect:()=>w({status:p.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:p.color}}),t.jsx("span",{className:"text-xs flex-1",children:p.name}),e.status===p.key&&t.jsx(Pt,{className:"h-3.5 w-3.5 text-indigo-500"})]},p.key))})})})})]})}),t.jsx("div",{onClick:p=>p.stopPropagation(),children:t.jsxs(mt,{open:h==="priority",onOpenChange:p=>g(p?"priority":null),children:[t.jsx(ft,{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(rl,{priority:e.priority}),t.jsx("span",{className:"text-xs text-muted-foreground",children:hs[e.priority]??e.priority})]})}),t.jsx(at,{className:"w-44 p-1",align:"start",onClick:p=>p.stopPropagation(),children:t.jsx(fn,{children:t.jsx(hn,{children:t.jsx(Ys,{children:Object.entries(hs).map(([p,_])=>t.jsxs(Ut,{value:_,onSelect:()=>w({priority:p}),className:"flex items-center gap-2 py-1.5 px-2 cursor-pointer",children:[t.jsx(rl,{priority:p}),t.jsx("span",{className:"text-xs flex-1",children:_}),e.priority===p&&t.jsx(Pt,{className:"h-3.5 w-3.5 text-indigo-500"})]},p))})})})})]})}),t.jsx("div",{onClick:p=>p.stopPropagation(),children:t.jsxs(mt,{open:h==="sprint",onOpenChange:p=>g(p?"sprint":null),children:[t.jsx(ft,{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:A("text-xs truncate",y?"text-foreground":"text-muted-foreground"),children:(y==null?void 0:y.name)??"No sprint"})]})}),t.jsx(at,{className:"w-56 p-1",align:"start",onClick:p=>p.stopPropagation(),children:t.jsx(fn,{children:t.jsx(hn,{children:t.jsxs(Ys,{children:[t.jsxs(Ut,{value:"no-sprint",onSelect:()=>w({sprint_id:null}),className:"flex items-center gap-2 py-1.5 px-2 cursor-pointer",children:[t.jsx(Ve,{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(Pt,{className:"h-3.5 w-3.5 text-indigo-500"})]}),o.filter(p=>p.status!=="completed").map(p=>t.jsxs(Ut,{value:p.name,onSelect:()=>w({sprint_id:p.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:p.name}),(p.start_date||p.end_date)&&t.jsxs("p",{className:"text-[10px] text-muted-foreground",children:[p.start_date?ue(new Date(p.start_date),"MMM d"):"—"," → ",p.end_date?ue(new Date(p.end_date),"MMM d"):"—"]})]}),e.sprint_id===p.id&&t.jsx(Pt,{className:"h-3.5 w-3.5 text-indigo-500 shrink-0"})]},p.id))]})})})})]})}),t.jsx("div",{onClick:p=>p.stopPropagation(),children:t.jsxs(mt,{open:h==="due",onOpenChange:p=>g(p?"due":null),children:[t.jsx(ft,{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(Ht,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),t.jsx("span",{className:A("text-xs",e.due_date?"text-foreground":"text-muted-foreground"),children:e.due_date?ue(new Date(e.due_date),"MMM d, yyyy"):"No due date"})]})}),t.jsxs(at,{className:"w-auto p-0",align:"start",onClick:p=>p.stopPropagation(),children:[t.jsx(Rt,{mode:"single",selected:e.due_date?new Date(e.due_date):void 0,onSelect:p=>w({due_date:p?ue(p,"yyyy-MM-dd"):null}),initialFocus:!0}),e.due_date&&t.jsx("div",{className:"border-t px-3 py-2",children:t.jsxs("button",{onClick:()=>w({due_date:null}),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[t.jsx(Ve,{className:"h-3 w-3"}),"Clear date"]})})]})]})}),t.jsx("div",{onClick:p=>p.stopPropagation(),children:t.jsx(yr,{value:e.assignee_ids??[],onChange:p=>b.mutate({assignee_ids:p})})}),t.jsxs("div",{className:"flex items-center gap-1 pr-6",onClick:p=>p.stopPropagation(),children:[!d&&m&&t.jsxs(Ls,{children:[t.jsx(qs,{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(Bs,{className:"h-3.5 w-3.5"})})}),t.jsx(ks,{side:"top",children:"Add child issue"})]}),t.jsxs(Ls,{children:[t.jsx(qs,{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(wc,{className:"h-3.5 w-3.5"})})}),t.jsx(ks,{side:"top",children:"Open full page"})]})]})]}),!d&&v&&u.map(p=>t.jsx(au,{issue:p,projectId:s,statuses:n,statusLabels:r,statusColorMap:a,sprints:o,workspace:i,projectKey:l,onOpen:c,isChild:!0},p.id))]})}function al({taskList:e,issues:s,childrenMap:n,projectId:r,statuses:a,statusLabels:o,statusColorMap:i,sprints:l,workspace:c,projectKey:d,onOpen:u,onAddIssue:m,onAddChild:f,onRenameList:h,onDeleteList:g}){const[v,D]=x.useState(!1),[b,w]=x.useState(!1),[j,y]=x.useState((e==null?void 0:e.name)??""),C=s.reduce((I,W)=>{var T;return I+(((T=n[W.id])==null?void 0:T.length)??0)},0),p=s.length+C,_=()=>{e&&j.trim()&&h&&h(e.id,j.trim()),w(!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(Ls,{children:[t.jsx(qs,{asChild:!0,children:t.jsx("button",{onClick:()=>D(!v),className:"text-muted-foreground hover:text-foreground transition-colors",children:v?t.jsx(kn,{className:"h-3.5 w-3.5"}):t.jsx(Nn,{className:"h-3.5 w-3.5"})})}),t.jsx(ks,{side:"right",children:v?"Expand":"Collapse"})]}),e?b?t.jsx("input",{autoFocus:!0,value:j,onChange:I=>y(I.target.value),onBlur:_,onKeyDown:I=>{I.key==="Enter"&&_(),I.key==="Escape"&&(w(!1),y(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:p}),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(Be,{className:"h-3 w-3"}),"Add issue"]}),e&&t.jsxs(en,{children:[t.jsxs(Ls,{children:[t.jsx(qs,{asChild:!0,children:t.jsx(tn,{asChild:!0,children:t.jsx("button",{className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:t.jsx(ar,{className:"h-3.5 w-3.5"})})})}),t.jsx(ks,{side:"top",children:"More options"})]}),t.jsxs(Es,{align:"end",className:"w-36",children:[t.jsxs(ut,{className:"text-xs gap-2 cursor-pointer",onClick:()=>{w(!0),y(e.name)},children:[t.jsx(Gn,{className:"h-3.5 w-3.5"}),"Rename"]}),t.jsxs(ut,{className:"text-xs gap-2 cursor-pointer text-destructive focus:text-destructive",onClick:()=>g==null?void 0:g(e.id),children:[t.jsx(xs,{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(I=>t.jsx(au,{issue:I,projectId:r,statuses:a,statusLabels:o,statusColorMap:i,sprints:l,workspace:c,projectKey:d,onOpen:u,children:n[I.id]??[],onAddChild:f},I.id))})]})}function rv(){var F;const{workspace:e,projectKey:s}=pt(),[n,r]=x.useState(null),[a,o]=x.useState({open:!1}),[i,l]=x.useState(""),[c,d]=x.useState(!1),[u,m]=x.useState(""),[f,h]=x.useState("all"),[g,v]=x.useState("all"),[D,b]=x.useState("all"),{data:w}=Js(s??""),j=(w==null?void 0:w.id)??"",{data:y,isLoading:C}=nr(j||void 0),{data:p}=Tn(j||void 0),{data:_}=On(j||void 0),{data:I}=br(j||void 0),W=Pb(j),T=Rb(j),R=Ib(j),E=p&&p.length>0?p:Object.entries(Gs).map(([M,q],me)=>({id:M,project_id:j,key:M,name:q,color:{backlog:"#94a3b8",todo:"#64748b",in_progress:"#6366f1",in_review:"#f59e0b",done:"#10b981",cancelled:"#9ca3af"}[M]??"#94a3b8",category:{backlog:"backlog",todo:"unstarted",in_progress:"started",in_review:"started",done:"completed",cancelled:"cancelled"}[M]??"backlog",position:me})),P=Object.fromEntries(E.map(M=>[M.key,M.name])),O=Object.fromEntries(E.map(M=>[M.key,M.color])),V=_??[];if(!s||!e)return null;const Y=(y??[]).filter(M=>{const q=!u||M.title.toLowerCase().includes(u.toLowerCase())||M.identifier.toLowerCase().includes(u.toLowerCase()),me=f==="all"||M.status===f,Ne=g==="all"||M.priority===g,Ae=D==="all"||(D==="none"?!M.sprint_id:M.sprint_id===D);return q&&me&&Ne&&Ae}).sort((M,q)=>{const me=parseInt(M.identifier.split("-")[1]??"0",10),Ne=parseInt(q.identifier.split("-")[1]??"0",10);return me-Ne}),H={};for(const M of y??[])M.parent_id&&(H[M.parent_id]||(H[M.parent_id]=[]),H[M.parent_id].push(M));const B=Y.filter(M=>!M.parent_id),L=Y.length,te=new Set((I??[]).map(M=>M.id)),Z={__none__:[]};for(const M of I??[])Z[M.id]=[];for(const M of B){const q=M.task_list_id&&te.has(M.task_list_id)?M.task_list_id:"__none__";Z[q].push(M)}function S(){i.trim()&&W.mutate({name:i.trim()},{onSuccess:()=>{l(""),d(!1),z.success("List created")},onError:()=>z.error("Failed to create list")})}function $(M,q){T.mutate({id:M,name:q},{onError:()=>z.error("Failed to rename list")})}function Q(M){const q=I==null?void 0:I.find(me=>me.id===M);confirm(`Delete list "${q==null?void 0:q.name}"? Issues in this list will be moved to No List.`)&&R.mutate(M,{onSuccess:()=>z.success("List deleted"),onError:()=>z.error("Failed to delete list")})}return t.jsxs("div",{className:"p-2",children:[t.jsx(Mt,{zone:"project.issues.before",props:{projectId:j}}),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:[c?t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ve,{autoFocus:!0,placeholder:"List name...",value:i,onChange:M=>l(M.target.value),onKeyDown:M=>{M.key==="Enter"&&S(),M.key==="Escape"&&(d(!1),l(""))},className:"h-8 text-xs w-36"}),t.jsx(J,{size:"sm",variant:"outline",className:"h-8 text-xs",onClick:S,disabled:!i.trim()||W.isPending,children:"Add"}),t.jsx(J,{size:"sm",variant:"ghost",className:"h-8 text-xs",onClick:()=>{d(!1),l("")},children:"Cancel"})]}):t.jsxs(J,{size:"sm",variant:"outline",onClick:()=>d(!0),children:[t.jsx(Be,{className:"h-4 w-4"}),"New List"]}),t.jsxs(J,{size:"sm",onClick:()=>o({open:!0}),children:[t.jsx(Be,{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(_e,{value:D,onValueChange:b,children:[t.jsx(Se,{className:"h-8 text-xs w-[140px] bg-transparent",children:t.jsx(Fe,{placeholder:"Sprint"})}),t.jsxs(Ce,{children:[t.jsx(be,{value:"all",className:"text-xs",children:"All sprints"}),t.jsx(be,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),V.map(M=>t.jsx(be,{value:M.id,className:"text-xs",children:M.name},M.id))]})]}),t.jsxs(_e,{value:f,onValueChange:h,children:[t.jsx(Se,{className:"h-8 text-xs w-[130px] bg-transparent",children:t.jsx(Fe,{placeholder:"Status"})}),t.jsxs(Ce,{children:[t.jsx(be,{value:"all",className:"text-xs",children:"All statuses"}),E.map(({key:M,name:q})=>t.jsx(be,{value:M,className:"text-xs",children:q},M))]})]}),t.jsxs(_e,{value:g,onValueChange:v,children:[t.jsx(Se,{className:"h-8 text-xs w-[130px] bg-transparent",children:t.jsx(Fe,{placeholder:"Priority"})}),t.jsxs(Ce,{children:[t.jsx(be,{value:"all",className:"text-xs",children:"All priorities"}),Object.entries(hs).map(([M,q])=>t.jsx(be,{value:M,className:"text-xs",children:q},M))]})]})]}),t.jsxs("div",{className:"relative",children:[t.jsx(Vr,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),t.jsx(ve,{placeholder:"Search...",value:u,onChange:M=>m(M.target.value),className:"pl-8 h-8 w-[200px] text-xs bg-transparent"})]})]}),t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("div",{className:"min-w-[1025px]",children:[t.jsxs("div",{className:A("grid items-center py-2.5 border-b border-border",ao),children:[t.jsx("span",{className:"text-xs font-medium text-[#6b7280] sticky left-0 z-10 bg-white dark:bg-card pl-6",children:"ID"}),t.jsx("span",{className:"text-xs font-medium text-[#6b7280] sticky left-[70px] z-10 bg-white dark:bg-card",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",{className:"pr-6"})]}),C?t.jsx("div",{className:"divide-y divide-border",children:[1,2,3,4].map(M=>t.jsxs("div",{className:A("grid items-center px-6 py-3 gap-4",ao),children:[t.jsx(oe,{className:"h-4 w-14"}),t.jsx(oe,{className:"h-4 w-56"}),t.jsx(oe,{className:"h-5 w-20"}),t.jsx(oe,{className:"h-4 w-16"}),t.jsx(oe,{className:"h-4 w-20"}),t.jsx(oe,{className:"h-4 w-24"}),t.jsx(oe,{className:"h-6 w-16"}),t.jsx("span",{})]},M))}):L===0&&(y??[]).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(J,{size:"sm",onClick:()=>o({open:!0}),children:[t.jsx(Be,{className:"h-4 w-4"}),"Create issue"]})]}):B.length===0&&(y??[]).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(fo,{delayDuration:200,children:t.jsxs("div",{className:"divide-y divide-border",children:[(I??[]).map(M=>t.jsx(al,{taskList:M,issues:Z[M.id]??[],childrenMap:H,projectId:j,statuses:E,statusLabels:P,statusColorMap:O,sprints:V,workspace:e,projectKey:s,onOpen:r,onAddIssue:q=>o({open:!0,defaultTaskListId:q}),onAddChild:q=>o({open:!0,defaultParentId:q}),onRenameList:$,onDeleteList:Q},M.id)),(((F=Z.__none__)==null?void 0:F.length)>0||(I??[]).length===0)&&t.jsx(al,{taskList:null,issues:Z.__none__??[],childrenMap:H,projectId:j,statuses:E,statusLabels:P,statusColorMap:O,sprints:V,workspace:e,projectKey:s,onOpen:r,onAddIssue:M=>o({open:!0,defaultTaskListId:M}),onAddChild:M=>o({open:!0,defaultParentId:M})})]})})]})}),!C&&L>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:[L," issue",L!==1?"s":""]})})]}),t.jsx(Mt,{zone:"project.issues.after",props:{projectId:j}}),t.jsx(ru,{issue:n,projectId:j,open:!!n,onClose:()=>r(null)}),t.jsx(ra,{open:a.open,onClose:()=>o({open:!1}),projectId:j,defaultTaskListId:a.defaultTaskListId,defaultParentId:a.defaultParentId})]})}function av(e,s=[]){let n=[];function r(o,i){const l=x.createContext(i),c=n.length;n=[...n,i];const d=m=>{var b;const{scope:f,children:h,...g}=m,v=((b=f==null?void 0:f[e])==null?void 0:b[c])||l,D=x.useMemo(()=>g,Object.values(g));return t.jsx(v.Provider,{value:D,children:h})};d.displayName=o+"Provider";function u(m,f){var v;const h=((v=f==null?void 0:f[e])==null?void 0:v[c])||l,g=x.useContext(h);if(g)return g;if(i!==void 0)return i;throw new Error(`\`${m}\` must be used within \`${o}\``)}return[d,u]}const a=()=>{const o=n.map(i=>x.createContext(i));return function(l){const c=(l==null?void 0:l[e])||o;return x.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return a.scopeName=e,[r,ov(a,...s)]}function ov(...e){const s=e[0];if(e.length===1)return s;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(o){const i=r.reduce((l,{useScope:c,scopeName:d})=>{const m=c(o)[`__scope${d}`];return{...l,...m}},{});return x.useMemo(()=>({[`__scope${s.scopeName}`]:i}),[i])}};return n.scopeName=s.scopeName,n}var iv=Symbol("radix.slottable");function lv(e){const s=({children:n})=>t.jsx(t.Fragment,{children:n});return s.displayName=`${e}.Slottable`,s.__radixId=iv,s}var ou="AlertDialog",[cv]=av(ou,[Wl]),gs=Wl(),iu=e=>{const{__scopeAlertDialog:s,...n}=e,r=gs(s);return t.jsx(sr,{...r,...n,modal:!0})};iu.displayName=ou;var dv="AlertDialogTrigger",uv=x.forwardRef((e,s)=>{const{__scopeAlertDialog:n,...r}=e,a=gs(n);return t.jsx(tm,{...a,...r,ref:s})});uv.displayName=dv;var mv="AlertDialogPortal",lu=e=>{const{__scopeAlertDialog:s,...n}=e,r=gs(s);return t.jsx(tr,{...r,...n})};lu.displayName=mv;var fv="AlertDialogOverlay",cu=x.forwardRef((e,s)=>{const{__scopeAlertDialog:n,...r}=e,a=gs(n);return t.jsx(Qs,{...a,...r,ref:s})});cu.displayName=fv;var xn="AlertDialogContent",[hv,xv]=cv(xn),pv=lv("AlertDialogContent"),du=x.forwardRef((e,s)=>{const{__scopeAlertDialog:n,children:r,...a}=e,o=gs(n),i=x.useRef(null),l=Fl(s,i),c=x.useRef(null);return t.jsx(Ju,{contentName:xn,titleName:uu,docsSlug:"alert-dialog",children:t.jsx(hv,{scope:n,cancelRef:c,children:t.jsxs(Xs,{role:"alertdialog",...o,...a,ref:l,onOpenAutoFocus:em(a.onOpenAutoFocus,d=>{var u;d.preventDefault(),(u=c.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[t.jsx(pv,{children:r}),t.jsx(bv,{contentRef:i})]})})})});du.displayName=xn;var uu="AlertDialogTitle",mu=x.forwardRef((e,s)=>{const{__scopeAlertDialog:n,...r}=e,a=gs(n);return t.jsx(vn,{...a,...r,ref:s})});mu.displayName=uu;var fu="AlertDialogDescription",hu=x.forwardRef((e,s)=>{const{__scopeAlertDialog:n,...r}=e,a=gs(n);return t.jsx(jn,{...a,...r,ref:s})});hu.displayName=fu;var gv="AlertDialogAction",xu=x.forwardRef((e,s)=>{const{__scopeAlertDialog:n,...r}=e,a=gs(n);return t.jsx(Lr,{...a,...r,ref:s})});xu.displayName=gv;var pu="AlertDialogCancel",gu=x.forwardRef((e,s)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=xv(pu,n),o=gs(n),i=Fl(s,a);return t.jsx(Lr,{...o,...r,ref:i})});gu.displayName=pu;var bv=({contentRef:e})=>{const s=`\`${xn}\` requires a description for the component to be accessible for screen reader users.
|
|
472
|
-
|
|
473
|
-
You can add a description to the \`${xn}\` by passing a \`${fu}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
474
|
-
|
|
475
|
-
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${xn}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
476
|
-
|
|
477
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return x.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(s)},[s,e]),null},yv=iu,vv=lu,bu=cu,yu=du,vu=xu,ju=gu,wu=mu,Nu=hu;const ei=yv,jv=vv,ku=x.forwardRef(({className:e,...s},n)=>t.jsx(bu,{className:A("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}));ku.displayName=bu.displayName;const la=x.forwardRef(({className:e,...s},n)=>t.jsxs(jv,{children:[t.jsx(ku,{}),t.jsx(yu,{ref:n,className:A("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 bg-background border border-border p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 rounded-lg",e),...s})]}));la.displayName=yu.displayName;const ca=({className:e,...s})=>t.jsx("div",{className:A("flex flex-col space-y-2 text-center sm:text-left",e),...s});ca.displayName="AlertDialogHeader";const da=({className:e,...s})=>t.jsx("div",{className:A("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...s});da.displayName="AlertDialogFooter";const ua=x.forwardRef(({className:e,...s},n)=>t.jsx(wu,{ref:n,className:A("text-base font-semibold",e),...s}));ua.displayName=wu.displayName;const ma=x.forwardRef(({className:e,...s},n)=>t.jsx(Nu,{ref:n,className:A("text-sm text-muted-foreground",e),...s}));ma.displayName=Nu.displayName;const fa=x.forwardRef(({className:e,...s},n)=>t.jsx(vu,{ref:n,className:A(mn(),e),...s}));fa.displayName=vu.displayName;const ha=x.forwardRef(({className:e,...s},n)=>t.jsx(ju,{ref:n,className:A(mn({variant:"outline"}),"mt-2 sm:mt-0",e),...s}));ha.displayName=ju.displayName;function wv({member:e,onRequestRemove:s}){var l;const n=e.user,r=(n==null?void 0:n.first_name)??"",a=(n==null?void 0:n.last_name)??"",o=`${r} ${a}`.trim()||(n==null?void 0:n.email)||"Unknown",i=(r[0]??a[0]??((l=n==null?void 0:n.email)==null?void 0:l[0])??"U").toUpperCase();return t.jsxs("div",{className:"flex items-center gap-4 px-6 py-4 hover:bg-muted/30 transition-colors group",children:[t.jsx(Dt,{className:"h-8 w-8 shrink-0",children:t.jsx(_t,{className:"text-xs font-medium",children:i})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:o}),(n==null?void 0:n.email)&&t.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:n.email})]}),t.jsx(ia,{className:A("shrink-0 text-[11px] border-0 w-20 justify-center",e.role==="manager"?"bg-indigo-100 text-indigo-700 dark:bg-indigo-900/30 dark:text-indigo-400":"bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400"),children:e.role}),t.jsx(J,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>s(e.user_id,o),children:t.jsx(Ve,{className:"h-3.5 w-3.5"})})]})}function Nv({teamEntry:e,onRemove:s}){const n=e.team;return t.jsxs("div",{className:"flex items-center gap-4 px-6 py-4 hover:bg-muted/30 transition-colors group",children:[t.jsx("div",{className:"h-8 w-8 rounded-lg bg-muted flex items-center justify-center shrink-0",children:t.jsx(Hs,{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:(n==null?void 0:n.name)??"Unknown team"}),n&&t.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:[n.member_count," ",n.member_count===1?"member":"members"]})]}),t.jsx(J,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>s(e.team_id),children:t.jsx(Ve,{className:"h-3.5 w-3.5"})})]})}function kv(){const{projectKey:e}=pt(),{workspace:s}=Te(),n=(s==null?void 0:s.id)??"",{data:r}=Js(e??""),a=(r==null?void 0:r.id)??"",{data:o,isLoading:i}=ld(a),{data:l}=cr(n),{data:c}=Co(n),d=cd(a),u=dd(a),m=ud(a),f=md(a),[h,g]=x.useState(""),[v,D]=x.useState(""),[b,w]=x.useState(null),j=new Set((o==null?void 0:o.members.map(T=>T.user_id))??[]),y=new Set((o==null?void 0:o.teams.map(T=>T.team_id))??[]),C=(l??[]).filter(T=>!j.has(T.user_id)),p=(c??[]).filter(T=>!y.has(T.id)),_=(o==null?void 0:o.members.length)??0,I=(o==null?void 0:o.teams.length)??0;function W(){b&&u.mutate(b.userId,{onSuccess:()=>{z.success("Access removed"),w(null)},onError:()=>z.error("Failed to remove")})}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-3 border-b border-border",children:[t.jsxs("div",{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."})]}),!i&&t.jsxs("p",{className:"text-xs text-muted-foreground shrink-0",children:[_," member",_!==1?"s":""," • ",I," team",I!==1?"s":""]})]}),i?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:"People"})}),t.jsx("div",{className:"divide-y divide-border",children:[1,2].map(T=>t.jsxs("div",{className:"flex items-center gap-4 px-6 py-4",children:[t.jsx(oe,{className:"h-8 w-8 rounded-full"}),t.jsx(oe,{className:"h-4 w-44"}),t.jsx("div",{className:"flex-1"}),t.jsx(oe,{className:"h-5 w-20"})]},T))}),t.jsx("div",{className:"px-6 py-2 border-y border-border bg-muted/20",children:t.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Teams"})}),t.jsx("div",{className:"divide-y divide-border",children:[1].map(T=>t.jsxs("div",{className:"flex items-center gap-4 px-6 py-4",children:[t.jsx(oe,{className:"h-8 w-8 rounded-lg"}),t.jsx(oe,{className:"h-4 w-32"}),t.jsx("div",{className:"flex-1"}),t.jsx(oe,{className:"h-4 w-20"})]},T))})]}):t.jsxs("div",{children:[t.jsxs("div",{children:[t.jsxs("div",{className:"px-6 py-2 border-b border-border bg-muted/20 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"People"}),C.length>0&&t.jsxs("div",{className:"flex items-center gap-2 w-full sm:w-auto",children:[t.jsxs(_e,{value:h,onValueChange:g,children:[t.jsx(Se,{className:"h-8 text-xs w-full sm:w-56",children:t.jsx(Fe,{placeholder:"Add person…"})}),t.jsx(Ce,{children:C.map(T=>{const R=T.user,E=(R==null?void 0:R.first_name)??"",P=(R==null?void 0:R.last_name)??"",O=`${E} ${P}`.trim()||(R==null?void 0:R.email)||"Unknown";return t.jsx(be,{value:T.user_id,children:O},T.user_id)})})]}),t.jsxs(J,{size:"sm",className:"h-8 px-3 text-xs shrink-0",disabled:!h||d.isPending,onClick:()=>d.mutate({userId:h},{onSuccess:()=>{z.success("Access granted"),g("")},onError:()=>z.error("Failed to grant access")}),children:[t.jsx(lr,{className:"h-3.5 w-3.5"}),"Add"]})]})]}),_===0?t.jsx("p",{className:"text-sm text-muted-foreground px-6 py-4",children:"No individual members."}):t.jsx("div",{className:"divide-y divide-border",children:o==null?void 0:o.members.map(T=>t.jsx(wv,{member:T,onRequestRemove:(R,E)=>w({userId:R,displayName:E})},T.id))})]}),t.jsxs("div",{className:"border-t border-border",children:[t.jsxs("div",{className:"px-6 py-2 border-b border-border bg-muted/20 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Teams"}),p.length>0&&t.jsxs("div",{className:"flex items-center gap-2 w-full sm:w-auto",children:[t.jsxs(_e,{value:v,onValueChange:D,children:[t.jsx(Se,{className:"h-8 text-xs w-full sm:w-56",children:t.jsx(Fe,{placeholder:"Add team…"})}),t.jsx(Ce,{children:p.map(T=>t.jsx(be,{value:T.id,children:T.name},T.id))})]}),t.jsxs(J,{size:"sm",className:"h-8 px-3 text-xs shrink-0",disabled:!v||m.isPending,onClick:()=>m.mutate(v,{onSuccess:()=>{z.success("Team access granted"),D("")},onError:()=>z.error("Failed to add team")}),children:[t.jsx(Hs,{className:"h-3.5 w-3.5"}),"Add"]})]})]}),I===0?t.jsx("p",{className:"text-sm text-muted-foreground px-6 py-4",children:"No teams have access."}):t.jsx("div",{className:"divide-y divide-border",children:o==null?void 0:o.teams.map(T=>t.jsx(Nv,{teamEntry:T,onRemove:R=>f.mutate(R,{onSuccess:()=>z.success("Team access removed"),onError:()=>z.error("Failed to remove team")})},T.id))})]}),_===0&&I===0&&C.length===0&&p.length===0&&t.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center border-t border-border",children:[t.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:t.jsx(Hs,{className:"h-5 w-5 text-muted-foreground"})}),t.jsx("p",{className:"text-sm font-medium mb-1",children:"No access entries yet"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Add workspace people or teams first to grant project access."})]})]})]}),t.jsx(ei,{open:!!b,onOpenChange:T=>{T||w(null)},children:t.jsxs(la,{className:"sm:max-w-md",children:[t.jsxs(ca,{children:[t.jsx(ua,{children:"Remove member access?"}),t.jsx(ma,{children:b?`${b.displayName} will lose access to this project.`:"This member will lose access to this project."})]}),t.jsxs(da,{children:[t.jsx(ha,{disabled:u.isPending,children:"Cancel"}),t.jsx(fa,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:T=>{T.preventDefault(),W()},disabled:u.isPending,children:u.isPending?"Removing...":"Remove"})]})]})})]})}function ol(e){if(!e.start_date&&!e.end_date)return null;const s=e.start_date?ue(new Date(e.start_date),"MMM d"):"—",n=e.end_date?ue(new Date(e.end_date),"MMM d"):"—";return`${s} – ${n}`}function ds({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 Sv={backlog:t.jsx(ts,{className:"h-3 w-3 text-zinc-400"}),todo:t.jsx(ts,{className:"h-3 w-3 text-zinc-500",strokeWidth:2.5}),in_progress:t.jsx(_s,{className:"h-3 w-3 text-indigo-500"}),in_review:t.jsx(or,{className:"h-3 w-3 text-amber-500"}),done:t.jsx(Zs,{className:"h-3 w-3 text-emerald-500"}),cancelled:t.jsx(yc,{className:"h-3 w-3 text-zinc-400"})},Cv={urgent:t.jsx(Cn,{className:"h-3 w-3 text-red-500"}),high:t.jsx(Ur,{className:"h-3 w-3 text-orange-500"}),medium:t.jsx(ir,{className:"h-3 w-3 text-yellow-500"}),low:t.jsx(Br,{className:"h-3 w-3 text-blue-400"})},Mv={bug:t.jsx(pc,{className:"h-3 w-3 text-red-500"}),feature:t.jsx(Dc,{className:"h-3 w-3 text-purple-500"}),task:t.jsx(_c,{className:"h-3 w-3 text-blue-500"}),chore:t.jsx(xo,{className:"h-3 w-3 text-zinc-500"})};function Ua({value:e,onValueChange:s,options:n,icons:r,placeholder:a}){return t.jsxs(_e,{value:e,onValueChange:s,children:[t.jsx(Se,{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(bc,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{children:n[e]??a??""})]})}),t.jsx(Ce,{children:Object.entries(n).map(([o,i])=>t.jsx(be,{value:o,className:"text-xs",children:t.jsxs("div",{className:"flex items-center gap-2",children:[r[o],i]})},o))})]})}function Dv(){const{workspace:e,projectKey:s,issueId:n}=pt(),r=ot(),[a,o]=x.useState(!1),[i,l]=x.useState(""),[c,d]=x.useState(""),[u,m]=x.useState(!1),{data:f}=Js(s??""),h=(f==null?void 0:f.id)??"",{data:g,isLoading:v}=mc(n??""),D=qr(n??"",h),{data:b}=Tn(h||void 0),{data:w}=On(h||void 0),{data:j}=br(h||void 0),{data:y}=nr(h||void 0),C=(w??[]).filter(O=>O.status!=="completed"),p=g!=null&&g.parent_id?y==null?void 0:y.find(O=>O.id===g.parent_id):null,_=(y==null?void 0:y.filter(O=>O.parent_id===n))??[],I=g!=null&&g.task_list_id?j==null?void 0:j.find(O=>O.id===g.task_list_id):null,W=b&&b.length>0?Object.fromEntries(b.map(O=>[O.key,O.name])):Gs,T=b&&b.length>0?Object.fromEntries(b.map(O=>[O.key,O.category==="completed"?t.jsx(Zs,{className:"h-3 w-3",style:{color:O.color}}):O.category==="started"?t.jsx(_s,{className:"h-3 w-3",style:{color:O.color}}):t.jsx(ts,{className:"h-3 w-3",style:{color:O.color}})])):Sv;if(x.useEffect(()=>{g&&(l(g.title),d(g.description??"")),o(!1)},[g==null?void 0:g.id]),!s||!n)return null;const R=()=>{i.trim()&&D.mutate({title:i.trim(),description:c.trim()||void 0},{onSuccess:()=>{o(!1),z.success("Issue updated")},onError:()=>z.error("Failed to update issue")})},E=()=>{g&&(l(g.title),d(g.description??"")),o(!1)},P=(O,V)=>{D.mutate(O,{onSuccess:()=>z.success(`${V} updated`),onError:()=>z.error(`Failed to update ${V.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(oe,{className:"h-7 w-3/4"}),t.jsx(oe,{className:"h-32 w-full"})]}),t.jsx(oe,{className:"h-24 w-full rounded-xl"}),t.jsx(oe,{className:"h-48 w-full rounded-xl"})]}),t.jsx(oe,{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(J,{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(go,{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(ia,{variant:"muted",className:"text-[10px] ml-1",children:Cs[g.type]??g.type})]}),t.jsx("div",{className:"flex items-center gap-2",children:a?t.jsxs(t.Fragment,{children:[t.jsx(J,{variant:"ghost",size:"sm",onClick:E,children:"Discard"}),t.jsx(J,{size:"sm",onClick:R,disabled:!i.trim()||D.isPending,className:"px-4",children:D.isPending?"Saving…":"Save changes"})]}):t.jsxs(J,{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.jsx(Mt,{zone:"issue.details.before",props:{issue:g}}),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:O=>l(O.target.value),onKeyDown:O=>{O.key==="Enter"&&O.preventDefault()},className:A("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(Zo,{content:c,onChange:d,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(Jo,{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(Be,{className:"h-3.5 w-3.5"}),"Add child issue"]})]}),_.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:_.map(O=>t.jsxs("div",{className:"flex items-center gap-2 py-2 text-xs",children:[t.jsx(Bs,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),t.jsx("button",{onClick:()=>r(`/${e}/projects/${s}/issues/${O.id}`),className:"font-mono text-muted-foreground hover:text-foreground transition-colors shrink-0",children:O.identifier}),t.jsx("button",{onClick:()=>r(`/${e}/projects/${s}/issues/${O.id}`),className:"text-foreground hover:text-foreground/70 truncate text-left transition-colors",children:O.title})]},O.id))})]}),t.jsx("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden shadow-sm",children:t.jsx(tu,{issueId:n})}),t.jsx(Mt,{zone:"issue.details.after",props:{issue:g}})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(Mt,{zone:"issue.details.sidebar",props:{issue:g}}),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(ds,{label:"Status",children:t.jsx(Ua,{value:g.status,onValueChange:O=>P({status:O},"Status"),options:W,icons:T})}),t.jsx(ds,{label:"Priority",children:t.jsx(Ua,{value:g.priority,onValueChange:O=>P({priority:O},"Priority"),options:hs,icons:Cv})}),t.jsx(ds,{label:"Type",children:t.jsx(Ua,{value:g.type,onValueChange:O=>P({type:O},"Type"),options:Cs,icons:Mv})}),t.jsx(ds,{label:"Assignees",children:t.jsx(yr,{value:g.assignee_ids??[],onChange:O=>P({assignee_ids:O},"Assignees"),disabled:D.isPending})}),t.jsx(ds,{label:"Sprint",children:t.jsxs(_e,{value:g.sprint_id??"none",onValueChange:O=>P({sprint_id:O==="none"?null:O},"Sprint"),children:[t.jsx(Se,{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 O=C.find(Y=>Y.id===g.sprint_id)??(w==null?void 0:w.find(Y=>Y.id===g.sprint_id));if(!O)return t.jsxs("span",{className:"truncate",children:[g.sprint_id.slice(0,8),"…"]});const V=ol(O);return t.jsxs("span",{className:"truncate",children:[O.name,V&&t.jsxs("span",{className:"text-muted-foreground ml-1",children:["· ",V]})]})})():t.jsx("span",{className:"text-muted-foreground",children:"No sprint"})]})}),t.jsxs(Ce,{children:[t.jsx(be,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),C.map(O=>{const V=ol(O);return t.jsx(be,{value:O.id,className:"text-xs",children:t.jsxs("div",{className:"flex items-baseline gap-1.5",children:[t.jsx("span",{children:O.name}),V&&t.jsx("span",{className:"text-[10px] text-muted-foreground font-normal",children:V})]})},O.id)})]})]})}),(j??[]).length>0&&t.jsx(ds,{label:"List",children:t.jsxs(_e,{value:g.task_list_id??"none",onValueChange:O=>P({task_list_id:O==="none"?null:O},"List"),children:[t.jsx(Se,{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(jo,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),t.jsx("span",{className:I?"truncate":"text-muted-foreground",children:(I==null?void 0:I.name)??"No list"})]})}),t.jsxs(Ce,{children:[t.jsx(be,{value:"none",className:"text-xs text-muted-foreground",children:"No list"}),(j??[]).map(O=>t.jsx(be,{value:O.id,className:"text-xs",children:O.name},O.id))]})]})}),t.jsx(ds,{label:"Start Date",children:t.jsxs(mt,{children:[t.jsx(ft,{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(Ht,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),t.jsx("span",{className:g.start_date?"text-foreground":"text-muted-foreground",children:g.start_date?ue(new Date(g.start_date),"MMM d, yyyy"):"No start date"})]})}),t.jsxs(at,{className:"w-auto p-0",align:"start",children:[t.jsx(Rt,{mode:"single",selected:g.start_date?new Date(g.start_date):void 0,onSelect:O=>P({start_date:O?ue(O,"yyyy-MM-dd"):null},"Start date"),initialFocus:!0}),g.start_date&&t.jsx("div",{className:"border-t px-3 py-2",children:t.jsxs("button",{onClick:()=>P({start_date:null},"Start date"),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[t.jsx(Ve,{className:"h-3 w-3"}),"Clear date"]})})]})]})}),t.jsx(ds,{label:"Due Date",children:t.jsxs(mt,{children:[t.jsx(ft,{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(Ht,{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?ue(new Date(g.due_date),"MMM d, yyyy"):"No due date"})]})}),t.jsxs(at,{className:"w-auto p-0",align:"start",children:[t.jsx(Rt,{mode:"single",selected:g.due_date?new Date(g.due_date):void 0,onSelect:O=>P({due_date:O?ue(O,"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:()=>P({due_date:null},"Due date"),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[t.jsx(Ve,{className:"h-3 w-3"}),"Clear date"]})})]})]})}),p&&t.jsx(ds,{label:"Parent",children:t.jsxs("button",{onClick:()=>r(`/${e}/projects/${s}/issues/${p.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(bo,{className:"h-3 w-3 text-muted-foreground shrink-0"}),t.jsx("span",{className:"font-mono text-muted-foreground shrink-0",children:p.identifier}),t.jsx("span",{className:"text-foreground truncate",children:p.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:ue(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:ue(new Date(g.updated_at),"MMM d, yyyy")})]})]})]})]})]})})]}),t.jsx(ra,{open:u,onClose:()=>m(!1),projectId:h,defaultParentId:n,defaultTaskListId:g.task_list_id})]})}function ws({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 _v={backlog:t.jsx(ts,{className:"h-3 w-3 text-zinc-400"}),todo:t.jsx(ts,{className:"h-3 w-3 text-zinc-500",strokeWidth:2.5}),in_progress:t.jsx(_s,{className:"h-3 w-3 text-indigo-500"}),in_review:t.jsx(or,{className:"h-3 w-3 text-amber-500"}),done:t.jsx(Zs,{className:"h-3 w-3 text-emerald-500"}),cancelled:t.jsx(yc,{className:"h-3 w-3 text-zinc-400"})},Ev={urgent:t.jsx(Cn,{className:"h-3 w-3 text-red-500"}),high:t.jsx(Ur,{className:"h-3 w-3 text-orange-500"}),medium:t.jsx(ir,{className:"h-3 w-3 text-yellow-500"}),low:t.jsx(Br,{className:"h-3 w-3 text-blue-400"})},Tv={bug:t.jsx(pc,{className:"h-3 w-3 text-red-500"}),feature:t.jsx(Dc,{className:"h-3 w-3 text-purple-500"}),task:t.jsx(_c,{className:"h-3 w-3 text-blue-500"}),chore:t.jsx(xo,{className:"h-3 w-3 text-zinc-500"})};function Ya({value:e,onValueChange:s,options:n,icons:r,placeholder:a}){return t.jsxs(_e,{value:e,onValueChange:s,children:[t.jsx(Se,{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(bc,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{children:n[e]??a??""})]})}),t.jsx(Ce,{children:Object.entries(n).map(([o,i])=>t.jsx(be,{value:o,className:"text-xs",children:t.jsxs("div",{className:"flex items-center gap-2",children:[r[o],i]})},o))})]})}function Ov(e){if(!e.start_date&&!e.end_date)return null;const s=e.start_date?ue(new Date(e.start_date),"MMM d"):"—",n=e.end_date?ue(new Date(e.end_date),"MMM d"):"—";return`${s} – ${n}`}function Av(){const{workspace:e,projectKey:s}=pt(),n=ot(),{workspace:r}=Te(),[a,o]=x.useState(""),[i,l]=x.useState(""),[c,d]=x.useState("backlog"),[u,m]=x.useState("medium"),[f,h]=x.useState("task"),[g,v]=x.useState([]),[D,b]=x.useState(""),[w,j]=x.useState(""),[y,C]=x.useState(void 0),[p,_]=x.useState(void 0),{data:I}=Js(s??""),W=(I==null?void 0:I.id)??"",T=fc(),{data:R}=Tn(W||void 0),{data:E}=On(W||void 0),{data:P}=br(W||void 0),O=(E??[]).filter(B=>B.status!=="completed"),V=R&&R.length>0?Object.fromEntries(R.map(B=>[B.key,B.name])):Gs,Y=R&&R.length>0?Object.fromEntries(R.map(B=>[B.key,B.category==="completed"?t.jsx(Zs,{className:"h-3 w-3",style:{color:B.color}}):B.category==="started"?t.jsx(_s,{className:"h-3 w-3",style:{color:B.color}}):t.jsx(ts,{className:"h-3 w-3",style:{color:B.color}})])):_v;if(!s||!W)return null;const H=()=>{if(!a.trim()){z.error("Title is required");return}T.mutate({title:a.trim(),description:i||void 0,status:c,priority:u,type:f,project_id:W,workspace_id:r.id,assignee_ids:g.length>0?g:void 0,sprint_id:D||null,task_list_id:w||null,start_date:y?ue(y,"yyyy-MM-dd"):null,due_date:p?ue(p,"yyyy-MM-dd"):null},{onSuccess:B=>{z.success("Issue created"),n(`/${e}/projects/${s}/issues/${B.issue.id}`,{replace:!0})},onError:B=>z.error(B.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(J,{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(go,{className:"h-3.5 w-3.5"}),(I==null?void 0:I.name)??"Issues"]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(J,{variant:"ghost",size:"sm",onClick:()=>n(`/${e}/projects/${s}/issues`),children:"Discard"}),t.jsx(J,{size:"sm",onClick:H,disabled:!a.trim()||T.isPending,className:"px-4",children:T.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:B=>o(B.target.value),onKeyDown:B=>{B.key==="Enter"&&B.preventDefault()},placeholder:"Issue title…",className:A("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(Zo,{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(ws,{label:"Status",children:t.jsx(Ya,{value:c,onValueChange:d,options:V,icons:Y})}),t.jsx(ws,{label:"Priority",children:t.jsx(Ya,{value:u,onValueChange:m,options:hs,icons:Ev})}),t.jsx(ws,{label:"Type",children:t.jsx(Ya,{value:f,onValueChange:h,options:Cs,icons:Tv})}),t.jsx(ws,{label:"Assignees",children:t.jsx(yr,{value:g,onChange:v})}),O.length>0&&t.jsx(ws,{label:"Sprint",children:t.jsxs(_e,{value:D||"none",onValueChange:B=>b(B==="none"?"":B),children:[t.jsx(Se,{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(Fe,{placeholder:"No sprint"})]})}),t.jsxs(Ce,{children:[t.jsx(be,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),O.map(B=>{const L=Ov(B);return t.jsx(be,{value:B.id,className:"text-xs",children:t.jsxs("div",{className:"flex items-baseline gap-1.5",children:[t.jsx("span",{children:B.name}),L&&t.jsx("span",{className:"text-[10px] text-muted-foreground font-normal",children:L})]})},B.id)})]})]})}),(P??[]).length>0&&t.jsx(ws,{label:"List",children:t.jsxs(_e,{value:w||"none",onValueChange:B=>j(B==="none"?"":B),children:[t.jsx(Se,{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(jo,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),t.jsx(Fe,{placeholder:"No list"})]})}),t.jsxs(Ce,{children:[t.jsx(be,{value:"none",className:"text-xs text-muted-foreground",children:"No list"}),(P??[]).map(B=>t.jsx(be,{value:B.id,className:"text-xs",children:B.name},B.id))]})]})}),t.jsx(ws,{label:"Start Date",children:t.jsxs(mt,{children:[t.jsx(ft,{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(Ht,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),t.jsx("span",{className:y?"text-foreground":"text-muted-foreground",children:y?ue(y,"MMM d, yyyy"):"No start date"}),y&&t.jsx("button",{type:"button",onClick:B=>{B.stopPropagation(),C(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:t.jsx(Ve,{className:"h-3 w-3"})})]})}),t.jsx(at,{className:"w-auto p-0",align:"start",children:t.jsx(Rt,{mode:"single",selected:y,onSelect:C,initialFocus:!0})})]})}),t.jsx(ws,{label:"Due Date",children:t.jsxs(mt,{children:[t.jsx(ft,{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(Ht,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),t.jsx("span",{className:p?"text-foreground":"text-muted-foreground",children:p?ue(p,"MMM d, yyyy"):"No due date"}),p&&t.jsx("button",{type:"button",onClick:B=>{B.stopPropagation(),_(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:t.jsx(Ve,{className:"h-3 w-3"})})]})}),t.jsx(at,{className:"w-auto p-0",align:"start",children:t.jsx(Rt,{mode:"single",selected:p,onSelect:_,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"]})})]})]})})]})}const Pv={issue:{icon:Sn,label:"Issue"},project:{icon:Vt,label:"Project"},comment:{icon:Mc,label:"Comment"},sprint:{icon:Cn,label:"Sprint"}};function Rv(e){const s=new Date(e);return xb(s)?ib(s,{addSuffix:!0}):gb(s)?`Yesterday ${ue(s,"h:mm a")}`:ue(s,"MMM d, yyyy")}function Iv(){const{workspace:e}=pt(),s=ot(),{data:n,isLoading:r}=kx(),{data:a=[]}=dr(),o=Cx(),i=Mx(),l=(n==null?void 0:n.filter(u=>!u.read).length)??0,c=Object.fromEntries(a.map(u=>[u.id,u]));function d(u){var m;if(u.entity_type==="issue"&&((m=u.metadata)!=null&&m.project_id)){const f=c[u.metadata.project_id];if(f)return`/${e}/projects/${f.identifier}/issues/${u.entity_id}`}if(u.entity_type==="project"){const f=c[u.entity_id];if(f)return`/${e}/projects/${f.identifier}/board`}return null}return t.jsx("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:"Notifications"}),l>0&&t.jsxs(J,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1.5",onClick:()=>i.mutate(void 0,{onSuccess:()=>z.success("All marked as read"),onError:()=>z.error("Failed")}),disabled:i.isPending,children:[t.jsx(qf,{className:"h-3.5 w-3.5"}),"Mark all read"]})]}),t.jsxs("div",{className:"grid grid-cols-[20px_130px_1fr_130px_88px] items-center px-6 py-2.5 border-b border-border",children:[t.jsx("span",{}),t.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Type"}),t.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Message"}),t.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Time"}),t.jsx("span",{})]}),r?t.jsx("div",{className:"divide-y divide-border",children:[1,2,3,4].map(u=>t.jsxs("div",{className:"grid grid-cols-[20px_130px_1fr_130px_88px] items-center px-6 py-3",children:[t.jsx("div",{}),t.jsx(oe,{className:"h-5 w-20 rounded-full"}),t.jsx(oe,{className:"h-4 w-3/4"}),t.jsx(oe,{className:"h-4 w-20"}),t.jsx("div",{})]},u))}):n!=null&&n.length?t.jsx("div",{className:"divide-y divide-border",children:n.map(u=>{const m=Pv[u.entity_type]??{icon:pn,label:u.entity_type},f=m.icon,h=d(u);return t.jsxs("div",{className:A("grid grid-cols-[20px_130px_1fr_130px_88px] items-center px-6 py-3 transition-colors",!u.read&&"bg-[#eff6ff] dark:bg-indigo-950/20","hover:bg-[#f9fafb] dark:hover:bg-muted/30",h&&"cursor-pointer"),onClick:()=>{h&&(u.read||o.mutate(u.id),s(h))},children:[t.jsx("div",{className:"flex items-center justify-center",children:!u.read&&t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-indigo-500 shrink-0"})}),t.jsx("div",{children:t.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[11px] text-muted-foreground bg-muted px-2 py-0.5 rounded-full",children:[t.jsx(f,{className:"h-3 w-3"}),m.label]})}),t.jsx("p",{className:A("text-sm truncate",u.read?"text-muted-foreground":"font-medium text-foreground"),children:u.message}),t.jsx("span",{className:"text-xs text-muted-foreground",children:Rv(u.created_at)}),t.jsx("div",{className:"flex justify-end",onClick:g=>g.stopPropagation(),children:!u.read&&t.jsx(J,{variant:"ghost",size:"sm",className:"h-7 text-xs text-muted-foreground px-2",onClick:()=>o.mutate(u.id,{onError:()=>z.error("Failed")}),children:"Mark read"})})]},u.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."})]}),!r&&!!(n!=null&&n.length)&&t.jsx("div",{className:"px-6 py-3 border-t border-border",children:t.jsxs("span",{className:"text-xs text-muted-foreground",children:[n.length," notification",n.length!==1?"s":"",l>0?` · ${l} unread`:""]})})]})})}function $v({open:e,onClose:s,projectId:n}){const[r,a]=x.useState(""),[o,i]=x.useState(""),[l,c]=x.useState(),[d,u]=x.useState(),[m,f]=x.useState(!1),[h,g]=x.useState(!1),v=Tb(n);function D(){a(""),i(""),c(void 0),u(void 0),s()}async function b(w){w.preventDefault(),r.trim()&&v.mutate({name:r.trim(),goal:o.trim()||void 0,start_date:l?ue(l,"yyyy-MM-dd"):null,end_date:d?ue(d,"yyyy-MM-dd"):null},{onSuccess:()=>{z.success("Sprint created"),D()},onError:()=>z.error("Failed to create sprint")})}return t.jsx(sn,{open:e,onOpenChange:w=>!w&&D(),children:t.jsxs(nn,{className:"sm:max-w-md",children:[t.jsx(Mn,{children:t.jsx(_n,{children:"New Sprint"})}),t.jsxs("form",{onSubmit:b,className:"flex flex-col flex-1 overflow-hidden",children:[t.jsxs(Dn,{className:"space-y-4 py-1",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsxs(Qe,{htmlFor:"sprint-name",children:["Name ",t.jsx("span",{className:"text-destructive",children:"*"})]}),t.jsx(ve,{id:"sprint-name",placeholder:"e.g. Sprint 1",value:r,onChange:w=>a(w.target.value),autoFocus:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsxs(Qe,{htmlFor:"sprint-goal",children:["Goal ",t.jsx("span",{className:"text-muted-foreground text-xs",children:"(optional)"})]}),t.jsx(ea,{id:"sprint-goal",placeholder:"What do you want to achieve in this sprint?",value:o,onChange:w=>i(w.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(Qe,{children:"Start Date"}),t.jsxs(mt,{open:m,onOpenChange:f,children:[t.jsx(ft,{asChild:!0,children:t.jsxs(J,{variant:"outline",className:A("w-full justify-start text-left font-normal text-sm h-9",!l&&"text-muted-foreground"),children:[t.jsx(Ht,{className:"mr-2 h-3.5 w-3.5 shrink-0"}),l?ue(l,"MMM d, yyyy"):"Pick date"]})}),t.jsx(at,{className:"w-auto p-0",align:"start",children:t.jsx(Rt,{mode:"single",selected:l,onSelect:w=>{c(w),f(!1)},disabled:w=>d?w>d:!1,initialFocus:!0})})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(Qe,{children:"End Date"}),t.jsxs(mt,{open:h,onOpenChange:g,children:[t.jsx(ft,{asChild:!0,children:t.jsxs(J,{variant:"outline",className:A("w-full justify-start text-left font-normal text-sm h-9",!d&&"text-muted-foreground"),children:[t.jsx(Ht,{className:"mr-2 h-3.5 w-3.5 shrink-0"}),d?ue(d,"MMM d, yyyy"):"Pick date"]})}),t.jsx(at,{className:"w-auto p-0",align:"start",children:t.jsx(Rt,{mode:"single",selected:d,onSelect:w=>{u(w),g(!1)},disabled:w=>l?w<l:!1,initialFocus:!0})})]})]})]})]}),t.jsxs(pr,{children:[t.jsx(J,{type:"button",variant:"ghost",onClick:D,children:"Cancel"}),t.jsx(J,{type:"submit",disabled:!r.trim()||v.isPending,children:v.isPending?"Creating…":"Create Sprint"})]})]})]})})}const zv={active:{label:"Active",icon:Hr,badge:"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400",section:"Active Sprint"},planned:{label:"Planned",icon:_s,badge:"bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400",section:"Planned"},completed:{label:"Completed",icon:Zs,badge:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",section:"Completed"}};function Fv({sprint:e,projectId:s,issueCount:n}){const r=Ob(e.id,s),a=Ab(s),o=zv[e.status],i=o.icon;function l(){r.mutate({status:"active"},{onSuccess:()=>z.success(`"${e.name}" started`),onError:()=>z.error("Failed to start sprint")})}function c(){r.mutate({status:"completed"},{onSuccess:()=>z.success(`"${e.name}" completed`),onError:f=>z.error((f==null?void 0:f.message)??"Failed to complete sprint")})}function d(){confirm(`Delete sprint "${e.name}"? This cannot be undone.`)&&a.mutate(e.id,{onSuccess:()=>z.success("Sprint deleted"),onError:()=>z.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:A("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:A("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(fh,{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(po,{className:"h-3.5 w-3.5 shrink-0"}),u||m?t.jsxs("span",{children:[u?ue(new Date(e.start_date),"MMM d"):"—"," → ",m?ue(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(ia,{className:A("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(J,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:l,disabled:r.isPending,children:[t.jsx(Hr,{className:"h-3 w-3"}),"Start"]}),e.status==="active"&&t.jsxs(J,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:c,disabled:r.isPending,children:[t.jsx(Zs,{className:"h-3 w-3"}),"Complete"]}),t.jsx(J,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",onClick:d,disabled:a.isPending,children:t.jsx(xs,{className:"h-3.5 w-3.5"})})]})]})}function Wv(){const{projectKey:e}=pt(),[s,n]=x.useState(!1),{data:r}=Js(e??""),a=(r==null?void 0:r.id)??"",{data:o,isLoading:i}=On(a||void 0),{data:l}=nr(a||void 0),c=(l??[]).reduce((m,f)=>(f.sprint_id&&(m[f.sprint_id]=(m[f.sprint_id]??0)+1),m),{}),d={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:d.active},{key:"planned",label:"Planned",items:d.planned},{key:"completed",label:"Completed",items:d.completed}];return t.jsxs("div",{className:"p-2",children:[t.jsx(Mt,{zone:"project.sprints.before",props:{projectId:a}}),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(J,{size:"sm",onClick:()=>n(!0),children:[t.jsx(Be,{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(oe,{className:"h-7 w-7 rounded-full"}),t.jsx(oe,{className:"h-4 w-40"}),t.jsx("div",{className:"flex-1"}),t.jsx(oe,{className:"h-4 w-32"}),t.jsx(oe,{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(po,{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(J,{size:"sm",onClick:()=>n(!0),children:[t.jsx(Be,{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(Fv,{sprint:g,projectId:a,issueCount:c[g.id]??0},g.id))})]},m))})]}),t.jsx(Mt,{zone:"project.sprints.after",props:{projectId:a}}),t.jsx($v,{open:s,onClose:()=>n(!1),projectId:a})]})}const yn={all:["roles"],list:()=>[...yn.all,"list"],detail:e=>[...yn.all,e]};function ti(){return Ee({queryKey:yn.list(),queryFn:()=>se.get("/admin/roles"),select:e=>e.roles,staleTime:1e3*60*2})}function Lv(){const e=pe();return xe({mutationFn:s=>se.post("/admin/roles",s),onSuccess:()=>{e.invalidateQueries({queryKey:yn.list()})}})}function qv(e){const s=pe();return xe({mutationFn:n=>se.put(`/admin/roles/${e}`,n),onSuccess:()=>{s.invalidateQueries({queryKey:yn.list()})}})}function Bv(){const e=pe();return xe({mutationFn:s=>se.delete(`/admin/roles/${s}`),onSuccess:()=>{e.invalidateQueries({queryKey:yn.list()})}})}function Uv(){const e=pe();return xe({mutationFn:({userId:s,appRoleId:n})=>se.patch(`/admin/users/${s}/role`,{app_role_id:n}),onSuccess:()=>{e.invalidateQueries({queryKey:["workspaces"]})}})}const Fr=[{group:"Members & Invitations",permissions:[{key:"member:invite",label:"Invite members"},{key:"member:remove",label:"Remove members"},{key:"member:update_role",label:"Change member roles"}]},{group:"Workspaces",permissions:[{key:"workspace:create",label:"Create workspaces"},{key:"workspace:update",label:"Update workspace settings"},{key:"workspace:delete",label:"Delete workspaces"}]},{group:"Projects",permissions:[{key:"project:create",label:"Create projects"},{key:"project:update",label:"Update project settings"},{key:"project:delete",label:"Delete projects"},{key:"project:archive",label:"Archive projects"},{key:"project:manage_access",label:"Manage project access"}]},{group:"Issues",permissions:[{key:"issue:create",label:"Create issues"},{key:"issue:update",label:"Update issues"},{key:"issue:delete",label:"Delete issues"},{key:"issue:assign",label:"Assign issues"},{key:"issue:update_status",label:"Update issue status"}]},{group:"Sprints",permissions:[{key:"sprint:create",label:"Create sprints"},{key:"sprint:start",label:"Start sprints"},{key:"sprint:complete",label:"Complete sprints"},{key:"sprint:delete",label:"Delete sprints"}]},{group:"Teams",permissions:[{key:"team:create",label:"Create teams"},{key:"team:update",label:"Update teams"},{key:"team:delete",label:"Delete teams"},{key:"team:manage_members",label:"Manage team members"}]},{group:"Roles",permissions:[{key:"role:create",label:"Create roles"},{key:"role:update",label:"Update roles"},{key:"role:delete",label:"Delete roles"},{key:"role:assign",label:"Assign roles to users"}]}];function er({open:e,onClose:s,onConfirm:n,title:r,description:a,confirmLabel:o="Confirm",variant:i="default",loading:l=!1}){return t.jsx(ei,{open:e,onOpenChange:c=>!c&&s(),children:t.jsxs(la,{children:[t.jsxs(ca,{children:[t.jsx(ua,{children:r}),t.jsx(ma,{children:a})]}),t.jsxs(da,{children:[t.jsx(ha,{onClick:s,disabled:l,children:"Cancel"}),t.jsx(fa,{onClick:n,disabled:l,className:A(i==="destructive"&&"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus:ring-destructive"),children:l?"Please wait…":o})]})]})})}const Yv=["workspace:update","workspace:delete","workspace:create"];function il(e,s){const n=s.find(r=>r.id===e);return n&&Yv.some(r=>n.permissions.includes(r))?"admin":"member"}function si({value:e,className:s}){const[n,r]=x.useState(!1),a=()=>{navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1500)};return t.jsx("button",{onClick:a,className:A("text-muted-foreground hover:text-foreground transition-colors",s),title:"Copy",children:n?t.jsx(Pt,{className:"h-3.5 w-3.5 text-emerald-500"}):t.jsx(Yf,{className:"h-3.5 w-3.5"})})}function ll({value:e,onChange:s,appRoles:n}){return!n||n.length===0?t.jsxs("div",{className:"flex items-start gap-2 px-3 py-2.5 border border-border rounded-lg bg-muted/40 text-xs text-muted-foreground",children:[t.jsx(Bf,{className:"h-3.5 w-3.5 shrink-0 mt-0.5"}),t.jsxs("span",{children:["No roles created yet."," ",t.jsx("a",{href:"?tab=roles",className:"underline hover:text-foreground transition-colors",children:"Create roles"})," ","before inviting members."]})]}):t.jsxs(_e,{value:e,onValueChange:s,children:[t.jsx(Se,{className:"h-9",children:t.jsx(Fe,{placeholder:"Select a role…"})}),t.jsx(Ce,{children:n.map(r=>t.jsx(be,{value:r.id,children:t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{children:r.name}),r.description&&t.jsx("span",{className:"text-xs text-muted-foreground",children:r.description})]})},r.id))})]})}function Hv({open:e,onClose:s,workspaceId:n}){const[r,a]=x.useState("existing"),[o,i]=x.useState(""),[l,c]=x.useState(""),[d,u]=x.useState(""),[m,f]=x.useState(""),[h,g]=x.useState(""),[v,D]=x.useState(null),{data:b=[]}=Nd(),{data:w=[]}=cr(n),j=_h(n),y=Mh(n),{data:C}=ti(),p=x.useMemo(()=>new Set(w.map(E=>E.user_id)),[w]),_=x.useMemo(()=>b.filter(E=>!p.has(E.id)),[b,p]),I=x.useMemo(()=>{const E=o.toLowerCase().trim();return E?_.filter(P=>P.email.toLowerCase().includes(E)||`${P.first_name} ${P.last_name}`.toLowerCase().includes(E)):_},[_,o]);x.useEffect(()=>{if(e){const E=C&&C.length>0?C[0].id:"";i(""),c(""),u(E),f(""),g(E),D(null),a("existing")}},[e,C]);const W=E=>{var P;return((P=C==null?void 0:C.find(O=>O.id===E))==null?void 0:P.name)??"Member"},T=()=>{if(!l||!d)return;const E=il(d,C??[]);j.mutate({user_id:l,role:E,app_role_id:d},{onSuccess:()=>{z.success("Member added"),s()},onError:P=>z.error(P.message||"Failed to add member")})},R=E=>{if(E.preventDefault(),!h)return;const P=il(h,C??[]);y.mutate({email:m.trim()||void 0,role:P,app_role_id:h},{onSuccess:O=>{D(O.invitation),z.success("Invitation created")},onError:O=>z.error(O.message||"Failed to create invitation")})};return t.jsx(Xr,{open:e,onOpenChange:E=>!E&&s(),children:t.jsxs(hr,{className:"sm:max-w-[520px]",children:[t.jsx(Zr,{children:t.jsx(Jr,{children:"Add member"})}),!v&&t.jsxs("div",{className:"flex rounded-lg border border-border p-0.5 bg-muted/40 gap-0.5",children:[t.jsx("button",{type:"button",onClick:()=>a("existing"),className:A("flex-1 text-sm py-1.5 rounded-md font-medium transition-colors",r==="existing"?"bg-white dark:bg-card shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:"Existing user"}),t.jsx("button",{type:"button",onClick:()=>a("invite"),className:A("flex-1 text-sm py-1.5 rounded-md font-medium transition-colors",r==="invite"?"bg-white dark:bg-card shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:"Send invite"})]}),r==="existing"&&!v&&t.jsxs("div",{className:"space-y-3 pt-1",children:[t.jsx(ve,{placeholder:"Search by name or email…",value:o,onChange:E=>i(E.target.value),className:"h-9",autoFocus:!0}),t.jsx("div",{className:"rounded-lg border border-border overflow-hidden",children:_.length===0?t.jsxs("div",{className:"py-8 text-center px-4",children:[t.jsx("p",{className:"text-sm text-muted-foreground",children:"All users are already members."}),t.jsx("button",{className:"mt-2 text-xs text-muted-foreground hover:text-foreground underline underline-offset-2 transition-colors",onClick:()=>a("invite"),children:"Send an invite instead"})]}):I.length===0?t.jsx("div",{className:"py-6 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:['No users match "',o,'"']})}):t.jsx("div",{className:"max-h-52 overflow-y-auto divide-y divide-border",children:I.map(E=>{const P=E.first_name??"",O=E.last_name??"",V=`${P} ${O}`.trim()||E.email,Y=(P[0]??O[0]??E.email[0]??"U").toUpperCase(),H=l===E.id;return t.jsxs("button",{type:"button",onClick:()=>c(H?"":E.id),className:A("w-full flex items-center gap-3 px-3 py-2.5 text-left transition-colors",H?"bg-indigo/5 dark:bg-indigo/10":"hover:bg-muted/40"),children:[t.jsx(Dt,{className:"h-7 w-7 shrink-0",children:t.jsx(_t,{className:"text-[11px] font-medium",children:Y})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:V}),t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:E.email})]}),H&&t.jsx(Pt,{className:"h-4 w-4 text-indigo shrink-0"})]},E.id)})})}),_.length>0&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Role"}),t.jsx(ll,{value:d,onChange:u,appRoles:C})]}),t.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[t.jsx(J,{type:"button",variant:"outline",size:"sm",onClick:s,children:"Cancel"}),t.jsx(J,{type:"button",size:"sm",disabled:!l||!d||j.isPending,onClick:T,children:j.isPending?"Adding…":"Add to workspace"})]})]})]}),r==="invite"&&!v&&t.jsxs("form",{onSubmit:R,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(ve,{type:"email",placeholder:"colleague@example.com",value:m,onChange:E=>f(E.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.jsx(ll,{value:h,onChange:g,appRoles:C})]}),t.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[t.jsx(J,{type:"button",variant:"outline",size:"sm",onClick:s,children:"Cancel"}),t.jsx(J,{type:"submit",size:"sm",disabled:!h||y.isPending,children:y.isPending?"Creating…":"Create invitation"})]})]}),v&&t.jsxs("div",{className:"space-y-4 pt-1",children:[t.jsxs("p",{className:"text-sm text-muted-foreground",children:["Share this link with"," ",v.email?t.jsx("span",{className:"font-medium text-foreground",children:v.email}):"anyone you want to invite",". They will join as"," ",t.jsx("span",{className:"font-medium text-foreground",children:W(h)}),"."]}),t.jsxs("div",{className:"flex items-start gap-2 p-3 bg-muted/50 rounded-lg border border-border",children:[t.jsx(wo,{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:`${window.location.origin}/invite/${v.token}`}),t.jsx(si,{value:`${window.location.origin}/invite/${v.token}`,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(J,{size:"sm",onClick:s,children:"Done"})]})]})]})})}function Vv({invitation:e,workspaceId:s}){const n=Dh(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(wo,{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:A("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(si,{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:ue(new Date(e.created_at),"MMM d")}),t.jsx("button",{onClick:()=>n.mutate(e.id,{onSuccess:()=>z.success("Invitation revoked"),onError:()=>z.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(Ve,{className:"h-3.5 w-3.5"})})]})]})}function Kv({workspaceId:e}){const{workspace:s,setWorkspace:n}=Te(),{data:r,isLoading:a}=Kr(),o=r==null?void 0:r.find(m=>m.id===(s==null?void 0:s.id)),i=Sh(e),[l,c]=x.useState("");x.useEffect(()=>{o&&c(o.name)},[o==null?void 0:o.name]);const d=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}),z.success("Workspace updated")},onError:()=>z.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(oe,{className:"h-8 w-64"}):t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(ve,{value:l,onChange:m=>c(m.target.value),className:"h-8 w-64 text-sm bg-transparent",placeholder:"Workspace name"}),d&&t.jsx(J,{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(oe,{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(si,{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(oe,{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(oe,{className:"h-4 w-28"}):t.jsx("span",{className:"text-sm text-muted-foreground",children:o!=null&&o.created_at?ue(new Date(o.created_at),"MMMM d, yyyy"):"—"})]})]})}function Gv({workspaceId:e,onInvite:s}){var D,b;const{data:n,isLoading:r}=cr(e),{data:a,isLoading:o}=Ch(e),i=Eh(e),l=Th(e),c=Uv(),{data:d}=ti(),{user:u}=Te(),[m,f]=x.useState(null),[h,g]=x.useState(null),v=(a==null?void 0:a.filter(w=>w.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(w=>t.jsxs("div",{className:"flex items-center gap-3 px-6 py-3.5",children:[t.jsx(oe,{className:"h-7 w-7 rounded-full shrink-0"}),t.jsxs("div",{className:"flex-1 space-y-1.5",children:[t.jsx(oe,{className:"h-3.5 w-32"}),t.jsx(oe,{className:"h-3 w-48"})]})]},w))}):n!=null&&n.length?t.jsx("div",{className:"divide-y divide-border",children:n.map(w=>{var W;const j=w.user,y=(j==null?void 0:j.first_name)??"",C=(j==null?void 0:j.last_name)??"",p=`${y} ${C}`.trim()||(j==null?void 0:j.email)||"Unknown",_=(y[0]??C[0]??((W=j==null?void 0:j.email)==null?void 0:W[0])??"U").toUpperCase(),I=(j==null?void 0:j.id)===(u==null?void 0:u.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(Dt,{className:"h-7 w-7 shrink-0",children:t.jsx(_t,{className:"text-[11px] font-medium",children:_})}),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:p}),I&&t.jsx("span",{className:"text-[11px] text-muted-foreground",children:"(you)"})]}),(j==null?void 0:j.email)&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:j.email})]}),t.jsx("span",{className:A("inline-flex items-center text-[11px] px-1.5 py-0.5 rounded font-medium shrink-0",w.role==="admin"?"bg-indigo/10 text-indigo":"bg-muted text-muted-foreground"),children:w.role==="admin"?"Admin":"Member"}),d&&d.length>0&&t.jsxs(_e,{value:w.app_role_id??"none",onValueChange:T=>c.mutate({userId:w.user_id,appRoleId:T==="none"?null:T},{onSuccess:()=>z.success("Custom role updated"),onError:()=>z.error("Failed to update custom role")}),children:[t.jsx(Se,{className:"h-7 text-[11px] w-32 shrink-0",children:t.jsx(Fe,{placeholder:"Custom role"})}),t.jsxs(Ce,{children:[t.jsx(be,{value:"none",children:t.jsx("span",{className:"text-muted-foreground",children:"No custom role"})}),d.map(T=>t.jsx(be,{value:T.id,children:T.name},T.id))]})]}),!I&&t.jsxs(en,{children:[t.jsx(tn,{asChild:!0,children:t.jsx("button",{className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-foreground",children:t.jsx(ar,{className:"h-4 w-4"})})}),t.jsxs(Es,{align:"end",className:"w-44",children:[t.jsx(ut,{onClick:()=>g({member:w,newRole:w.role==="admin"?"member":"admin"}),children:w.role==="admin"?"Make member":"Make admin"}),t.jsx(ut,{onClick:()=>{fetch(`/admin/users/${w.user_id}/sessions`,{method:"DELETE",headers:{Authorization:`Bearer ${localStorage.getItem("meridian_token")}`}}).then(()=>z.success("Sessions revoked — user will be signed out")).catch(()=>z.error("Failed to revoke sessions"))},children:"Revoke sessions"}),t.jsx(ur,{}),t.jsxs(ut,{className:"text-destructive focus:text-destructive",onClick:()=>f(w),children:[t.jsx(xs,{className:"h-3.5 w-3.5 mr-2"}),"Remove"]})]})]})]},w.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(jh,{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&&v.length>0&&t.jsxs("span",{className:"ml-2 font-normal normal-case tracking-normal",children:["· ",v.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(Be,{className:"h-3 w-3"}),"Invite"]})]}),o?t.jsx("div",{className:"divide-y divide-border",children:[1,2].map(w=>t.jsxs("div",{className:"flex items-center gap-3 px-6 py-3.5",children:[t.jsx(oe,{className:"h-7 w-7 rounded-full shrink-0"}),t.jsxs("div",{className:"flex-1 space-y-1.5",children:[t.jsx(oe,{className:"h-3.5 w-48"}),t.jsx(oe,{className:"h-3 w-64"})]})]},w))}):v.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:v.map(w=>t.jsx(Vv,{invitation:w,workspaceId:e},w.id))}),t.jsx(er,{open:!!m,onClose:()=>f(null),onConfirm:()=>{m&&l.mutate(m.user_id,{onSuccess:()=>{z.success("Member removed"),f(null)},onError:()=>{z.error("Failed to remove member"),f(null)}})},title:"Remove member",description:`Remove ${((D=m==null?void 0:m.user)==null?void 0:D.email)??"this member"} from the workspace? They will lose access to all projects.`,confirmLabel:"Remove",variant:"destructive",loading:l.isPending}),t.jsx(er,{open:!!h,onClose:()=>g(null),onConfirm:()=>{h&&i.mutate({userId:h.member.user_id,role:h.newRole},{onSuccess:()=>{z.success("Role updated"),g(null)},onError:()=>{z.error("Failed to update role"),g(null)}})},title:"Change role",description:`Make ${((b=h==null?void 0:h.member.user)==null?void 0:b.email)??"this member"} a workspace ${(h==null?void 0:h.newRole)==="admin"?"admin":"member"}?`,confirmLabel:"Change role",loading:i.isPending})]})}function Qv({workspaceId:e,teamId:s,allMembers:n}){var b,w;const{data:r,isLoading:a}=Ph(e,s),o=Rh(e,s),i=Ih(e,s),[l,c]=x.useState(""),[d,u]=x.useState(null),[m,f]=x.useState(null),h=new Set((r==null?void 0:r.map(j=>j.user_id))??[]),g=n.filter(j=>!h.has(j.user_id)),v=r==null?void 0:r.find(j=>j.user_id===d),D=n.find(j=>j.user_id===m);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(oe,{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(j=>{var W;const y=j.user,C=(y==null?void 0:y.first_name)??"",p=(y==null?void 0:y.last_name)??"",_=`${C} ${p}`.trim()||(y==null?void 0:y.email)||"Unknown",I=(C[0]??p[0]??((W=y==null?void 0:y.email)==null?void 0:W[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(Dt,{className:"h-6 w-6 shrink-0",children:t.jsx(_t,{className:"text-[10px] font-medium",children:I})}),t.jsx("span",{className:"flex-1 text-sm truncate",children:_}),t.jsx("button",{onClick:()=>u(j.user_id),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",title:"Remove from team",children:t.jsx(Ve,{className:"h-3.5 w-3.5"})})]},j.id)})}),g.length>0&&t.jsxs("div",{className:"px-8 py-2.5 flex items-center gap-2 border-t border-border/50",children:[t.jsx(lr,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),t.jsxs(_e,{value:l,onValueChange:c,children:[t.jsx(Se,{className:"h-7 text-xs flex-1 max-w-[200px]",children:t.jsx(Fe,{placeholder:"Add member…"})}),t.jsx(Ce,{children:g.map(j=>{const y=j.user,C=(y==null?void 0:y.first_name)??"",p=(y==null?void 0:y.last_name)??"",_=`${C} ${p}`.trim()||(y==null?void 0:y.email)||"Unknown";return t.jsx(be,{value:j.user_id,children:_},j.user_id)})})]}),l&&t.jsx(J,{size:"sm",className:"h-7 text-xs px-2",disabled:o.isPending,onClick:()=>f(l),children:"Add"})]}),t.jsx(er,{open:!!d,onClose:()=>u(null),onConfirm:()=>{d&&i.mutate(d,{onSuccess:()=>{z.success("Removed from team"),u(null)},onError:()=>{z.error("Failed to remove"),u(null)}})},title:"Remove from team",description:`Remove ${((b=v==null?void 0:v.user)==null?void 0:b.email)??"this member"} from the team?`,confirmLabel:"Remove",variant:"destructive",loading:i.isPending}),t.jsx(er,{open:!!m,onClose:()=>{f(null),c("")},onConfirm:()=>{m&&o.mutate(m,{onSuccess:()=>{z.success("Added to team"),f(null),c("")},onError:()=>{z.error("Failed to add"),f(null)}})},title:"Add to team",description:`Add ${((w=D==null?void 0:D.user)==null?void 0:w.email)??"this member"} to the team?`,confirmLabel:"Add",loading:o.isPending})]})}function Xv({workspaceId:e}){const{data:s,isLoading:n}=Co(e),{data:r}=cr(e),a=Oh(e),o=Ah(e),[i,l]=x.useState(new Set),[c,d]=x.useState(!1),[u,m]=x.useState(""),[f,h]=x.useState(null),g=s==null?void 0:s.find(b=>b.id===f),v=b=>{l(w=>{const j=new Set(w);return j.has(b)?j.delete(b):j.add(b),j})},D=b=>{b.preventDefault(),u.trim()&&a.mutate({name:u.trim()},{onSuccess:()=>{z.success("Team created"),m(""),d(!1)},onError:()=>z.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:()=>d(!0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(Be,{className:"h-3 w-3"}),"New team"]})]}),c&&t.jsx("div",{className:"px-6 py-3 border-b border-border bg-muted/5",children:t.jsxs("form",{onSubmit:D,className:"flex items-center gap-2",children:[t.jsx(ve,{autoFocus:!0,placeholder:"Team name",value:u,onChange:b=>m(b.target.value),className:"h-8 text-sm flex-1 max-w-[240px]"}),t.jsx(J,{type:"submit",size:"sm",className:"h-8",disabled:!u.trim()||a.isPending,children:a.isPending?"Creating…":"Create"}),t.jsx(J,{type:"button",variant:"ghost",size:"sm",className:"h-8",onClick:()=>{d(!1),m("")},children:"Cancel"})]})}),n?t.jsx("div",{className:"divide-y divide-border",children:[1,2].map(b=>t.jsxs("div",{className:"flex items-center gap-3 px-6 py-3.5",children:[t.jsx(oe,{className:"h-7 w-7 rounded-lg shrink-0"}),t.jsx(oe,{className:"h-3.5 w-32"})]},b))}):s!=null&&s.length?t.jsx("div",{className:"divide-y divide-border",children:s.map(b=>{const w=i.has(b.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:()=>v(b.id),className:"text-muted-foreground hover:text-foreground shrink-0 transition-colors",children:w?t.jsx(Nn,{className:"h-4 w-4"}):t.jsx(kn,{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(Hs,{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:b.name}),b.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:b.description})]}),t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[b.member_count," ",b.member_count===1?"member":"members"]}),t.jsxs(en,{children:[t.jsx(tn,{asChild:!0,children:t.jsx("button",{className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-foreground",children:t.jsx(ar,{className:"h-4 w-4"})})}),t.jsx(Es,{align:"end",className:"w-36",children:t.jsxs(ut,{className:"text-destructive focus:text-destructive",onClick:()=>h(b.id),children:[t.jsx(xs,{className:"h-3.5 w-3.5 mr-2"}),"Delete team"]})})]})]}),w&&t.jsx(Qv,{workspaceId:e,teamId:b.id,allMembers:r??[]})]},b.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(Hs,{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(J,{variant:"outline",size:"sm",onClick:()=>d(!0),children:"Create a team"})]}),t.jsx(er,{open:!!f,onClose:()=>h(null),onConfirm:()=>{f&&o.mutate(f,{onSuccess:()=>{z.success("Team deleted"),h(null)},onError:()=>{z.error("Failed to delete team"),h(null)}})},title:"Delete team",description:`Delete "${(g==null?void 0:g.name)??"this team"}"? All members will be removed from the team. Projects will not be affected.`,confirmLabel:"Delete team",variant:"destructive",loading:o.isPending})]})}const Zv=["general","members","teams"];function Jv(){const{workspace:e}=Te(),s=(e==null?void 0:e.id)??"",[n,r]=fl(),a=n.get("tab"),[o,i]=x.useState(Zv.includes(a)?a:"general"),l=u=>{i(u),r({tab:u},{replace:!0})},[c,d]=x.useState(!1);return t.jsxs("div",{className:"p-2",children:[t.jsx(Mt,{zone:"workspace.settings.before",props:{workspaceId:s}}),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(u=>t.jsx("button",{onClick:()=>l(u),className:A("h-12 px-4 text-sm font-medium border-b-2 transition-colors capitalize",o===u?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:u},u))}),o==="members"&&t.jsxs(J,{size:"sm",onClick:()=>d(!0),children:[t.jsx(Be,{className:"h-4 w-4"}),"Add member"]})]}),o==="general"&&t.jsx(Kv,{workspaceId:s}),o==="members"&&t.jsx(Gv,{workspaceId:s,onInvite:()=>d(!0)}),o==="teams"&&t.jsx(Xv,{workspaceId:s})]}),t.jsx(Mt,{zone:"workspace.settings.after",props:{workspaceId:s}}),t.jsx(Hv,{open:c,onClose:()=>d(!1),workspaceId:s})]})}function ej({open:e,onClose:s}){const[n,r]=x.useState(""),[a,o]=x.useState(""),[i,l]=x.useState(new Set),c=Lv();x.useEffect(()=>{e&&(r(""),o(""),l(new Set))},[e]);const d=Fr.flatMap(v=>v.permissions.map(D=>D.key)),u=d.every(v=>i.has(v)),m=!u&&d.some(v=>i.has(v)),f=()=>{l(u?new Set:new Set(d))},h=v=>{l(D=>{const b=new Set(D);return b.has(v)?b.delete(v):b.add(v),b})},g=v=>{v.preventDefault(),n.trim()&&c.mutate({name:n.trim(),description:a.trim()||void 0,permissions:Array.from(i)},{onSuccess:()=>{z.success("Role created"),s()},onError:D=>z.error(D.message||"Failed to create role")})};return t.jsx(Xr,{open:e,onOpenChange:v=>!v&&s(),children:t.jsxs(hr,{className:"sm:max-w-[580px] max-h-[85vh] overflow-y-auto",children:[t.jsxs(Zr,{children:[t.jsx(Jr,{children:"Create role"}),t.jsx(Hc,{children:"Define a new custom role with a specific permission set."})]}),t.jsxs("form",{onSubmit:g,className:"space-y-5 pt-2",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Name"}),t.jsx(ve,{value:n,onChange:v=>r(v.target.value),placeholder:"e.g. Developer, PM, Viewer",className:"h-9",autoFocus:!0,required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Description ",t.jsx("span",{className:"font-normal",children:"(optional)"})]}),t.jsx(ve,{value:a,onChange:v=>o(v.target.value),placeholder:"What is this role for?",className:"h-9"})]}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Permissions"}),t.jsx("button",{type:"button",onClick:f,className:"text-xs text-muted-foreground hover:text-foreground transition-colors underline underline-offset-2",children:u?"Deselect all":"Select all"})]}),Fr.map(v=>t.jsxs("div",{children:[t.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:v.group}),t.jsx("div",{className:"space-y-1.5",children:v.permissions.map(D=>t.jsxs("label",{className:"flex items-center gap-2.5 cursor-pointer group",children:[t.jsx("input",{type:"checkbox",checked:i.has(D.key),onChange:()=>h(D.key),className:"h-3.5 w-3.5 rounded border-border accent-foreground cursor-pointer"}),t.jsx("span",{className:"text-sm group-hover:text-foreground text-muted-foreground transition-colors",children:D.label})]},D.key))})]},v.group))]}),t.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[t.jsx(J,{type:"button",variant:"outline",size:"sm",onClick:s,children:"Cancel"}),t.jsx(J,{type:"submit",size:"sm",disabled:!n.trim()||c.isPending,children:c.isPending?"Creating…":"Create role"})]})]})]})})}function tj({role:e,onDeleted:s}){const[n,r]=x.useState(e.name),[a,o]=x.useState(e.description??""),[i,l]=x.useState(new Set(e.permissions)),[c,d]=x.useState(!1),u=qv(e.id),m=Bv();x.useEffect(()=>{r(e.name),o(e.description??""),l(new Set(e.permissions))},[e.id,e.name,e.description,e.permissions]);const f=n!==e.name||a!==(e.description??"")||i.size!==e.permissions.length||Array.from(i).some(y=>!e.permissions.includes(y)),h=Fr.flatMap(y=>y.permissions.map(C=>C.key)),g=h.every(y=>i.has(y)),v=!g&&h.some(y=>i.has(y)),D=()=>{l(g?new Set:new Set(h))},b=y=>{l(C=>{const p=new Set(C);return p.has(y)?p.delete(y):p.add(y),p})},w=()=>{u.mutate({name:n.trim(),description:a.trim()||void 0,permissions:Array.from(i)},{onSuccess:()=>z.success("Role saved"),onError:y=>z.error(y.message||"Failed to save role")})},j=()=>{m.mutate(e.id,{onSuccess:()=>{z.success("Role deleted"),s(),d(!1)},onError:y=>z.error(y.message||"Failed to delete role")})};return t.jsxs("div",{className:"flex flex-col h-full",children:[t.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("h2",{className:"text-sm font-semibold",children:e.name}),e.is_system&&t.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-muted-foreground bg-muted px-1.5 py-0.5 rounded",children:[t.jsx(Yr,{className:"h-3 w-3"}),"System"]})]}),!e.is_system&&t.jsx("button",{onClick:()=>d(!0),className:"text-muted-foreground hover:text-destructive transition-colors",title:"Delete role",children:t.jsx(xs,{className:"h-4 w-4"})})]}),t.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4 space-y-5",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Name"}),t.jsx(ve,{value:n,onChange:y=>r(y.target.value),className:"h-8 text-sm"})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Description"}),t.jsx(ve,{value:a,onChange:y=>o(y.target.value),placeholder:"What is this role for?",className:"h-8 text-sm"})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Permissions"}),t.jsx("button",{type:"button",onClick:D,className:"text-xs text-muted-foreground hover:text-foreground transition-colors underline underline-offset-2",children:g?"Deselect all":"Select all"})]}),Fr.map(y=>t.jsxs("div",{children:[t.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide mb-2",children:y.group}),t.jsx("div",{className:"space-y-2",children:y.permissions.map(C=>t.jsxs("label",{className:"flex items-center gap-2.5 cursor-pointer group",children:[t.jsx("input",{type:"checkbox",checked:i.has(C.key),onChange:()=>b(C.key),className:"h-3.5 w-3.5 rounded border-border accent-foreground cursor-pointer"}),t.jsx("span",{className:"text-sm text-muted-foreground group-hover:text-foreground transition-colors",children:C.label})]},C.key))})]},y.group))]}),t.jsx("div",{className:"shrink-0 px-6 py-4 border-t border-border flex justify-end",children:t.jsx(J,{size:"sm",onClick:w,disabled:!f||!n.trim()||u.isPending,children:u.isPending?"Saving…":"Save changes"})}),t.jsx(ei,{open:c,onOpenChange:d,children:t.jsxs(la,{children:[t.jsxs(ca,{children:[t.jsxs(ua,{children:['Delete "',e.name,'"?']}),t.jsx(ma,{children:"This role will be removed from all users assigned to it. This action cannot be undone."})]}),t.jsxs(da,{children:[t.jsx(ha,{children:"Cancel"}),t.jsx(fa,{onClick:j,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})}function sj(){const{data:e,isLoading:s}=ti(),[n,r]=x.useState(null),[a,o]=x.useState(!1),i=(e==null?void 0:e.filter(d=>d.is_system))??[],l=(e==null?void 0:e.filter(d=>!d.is_system))??[];x.useEffect(()=>{e&&e.length>0&&!n&&r(e[0].id)},[e]);const c=(e==null?void 0:e.find(d=>d.id===n))??null;return t.jsx("div",{className:"p-2 h-full",children:t.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden flex flex-col h-full",children:[t.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(Ga,{className:"h-5 w-5 text-muted-foreground"}),t.jsxs("div",{children:[t.jsx("h1",{className:"text-base font-semibold",children:"Roles & Permissions"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Define what users with each custom role can do across the application."})]})]}),t.jsxs(J,{size:"sm",onClick:()=>o(!0),children:[t.jsx(Be,{className:"h-4 w-4 mr-1.5"}),"Create role"]})]}),t.jsxs("div",{className:"flex flex-1 min-h-0",children:[t.jsx("div",{className:"w-56 shrink-0 border-r border-border flex flex-col overflow-y-auto",children:s?t.jsx("div",{className:"p-4 space-y-2",children:[1,2,3].map(d=>t.jsx(oe,{className:"h-8 w-full"},d))}):t.jsxs(t.Fragment,{children:[i.length>0&&t.jsxs("div",{children:[t.jsx("div",{className:"px-3 pt-3 pb-1",children:t.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide",children:"System Roles"})}),i.map(d=>t.jsxs("button",{onClick:()=>r(d.id),className:A("w-full flex items-center gap-2 px-3 py-2 text-left text-sm transition-colors",n===d.id?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[t.jsx(Yr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),t.jsx("span",{className:"truncate",children:d.name})]},d.id))]}),l.length>0&&t.jsxs("div",{children:[t.jsx("div",{className:"px-3 pt-3 pb-1",children:t.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Custom Roles"})}),l.map(d=>t.jsxs("button",{onClick:()=>r(d.id),className:A("w-full flex items-center gap-2 px-3 py-2 text-left text-sm transition-colors",n===d.id?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[t.jsx("div",{className:"h-3 w-3 shrink-0"}),t.jsx("span",{className:"truncate",children:d.name})]},d.id))]}),!s&&(!e||e.length===0)&&t.jsx("div",{className:"flex flex-col items-center justify-center py-10 px-3 text-center",children:t.jsx("p",{className:"text-xs text-muted-foreground",children:"No roles yet."})})]})}),t.jsx("div",{className:"flex-1 min-w-0",children:c?t.jsx(tj,{role:c,onDeleted:()=>{var u;const d=(e==null?void 0:e.filter(m=>m.id!==c.id))??[];r(((u=d[0])==null?void 0:u.id)??null)}},c.id):t.jsx("div",{className:"flex items-center justify-center h-full text-center p-8",children:t.jsxs("div",{children:[t.jsx(Ga,{className:"h-10 w-10 text-muted-foreground mx-auto mb-3"}),t.jsx("p",{className:"text-sm font-medium mb-1",children:"Select a role to edit"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Or"," ",t.jsx("button",{onClick:()=>o(!0),className:"underline underline-offset-2 hover:text-foreground transition-colors",children:"create a new role"})]})]})})})]}),t.jsx(ej,{open:a,onClose:()=>o(!1)})]})})}function nj(e){return Ee({queryKey:["invite",e],queryFn:()=>se.get(`/auth/invite/${e}`),retry:!1,enabled:!!e})}function rj(){const{token:e}=pt(),{isAuthenticated:s}=Te(),n=ot(),{data:r,isLoading:a,error:o}=nj(e??""),i=Fh(e??""),[l,c]=x.useState(""),[d,u]=x.useState(""),[m,f]=x.useState(""),[h,g]=x.useState(""),[v,D]=x.useState(!1);if(s&&r)return n(`/${r.workspace.slug}/projects`,{replace:!0}),null;const b=(r==null?void 0:r.invitation.email)??null,w=j=>{j.preventDefault();const y=b??m.trim();if(!y){z.error("Email is required");return}i.mutate({email:y,password:h,first_name:l,last_name:d},{onSuccess:()=>{n(`/${r.workspace.slug}/projects`,{replace:!0})},onError:C=>z.error(C.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(Kn,{to:"/login",children:t.jsx(J,{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(Lf,{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(dh,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}):t.jsx(vh,{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:w,className:"space-y-2",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[t.jsx(ve,{placeholder:"First name",value:l,onChange:j=>c(j.target.value),required:!0,className:"h-9 bg-transparent",autoFocus:!0}),t.jsx(ve,{placeholder:"Last name",value:d,onChange:j=>u(j.target.value),required:!0,className:"h-9 bg-transparent"})]}),b?t.jsxs("div",{className:"relative",children:[t.jsx(ve,{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(ve,{type:"email",placeholder:"Email",value:m,onChange:j=>f(j.target.value),required:!0,className:"h-9 bg-transparent",autoComplete:"email"}),t.jsxs("div",{className:"relative",children:[t.jsx(ve,{type:v?"text":"password",placeholder:"Password (min. 8 characters)",value:h,onChange:j=>g(j.target.value),required:!0,minLength:8,className:"h-9 bg-transparent pr-10",autoComplete:"new-password"}),t.jsx("button",{type:"button",onClick:()=>D(!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(vo,{className:"h-4 w-4"}):t.jsx(or,{className:"h-4 w-4"})})]}),t.jsx("div",{className:"pt-1",children:t.jsx(J,{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(Kn,{to:"/login",className:"text-indigo hover:opacity-80 transition-opacity",children:"Sign in"})]})]}):null]})})}const aj=x.lazy(()=>mm(()=>import("./ProjectTimelinePage-CBA3foKj.js"),__vite__mapDeps([0,1,2,3,4,5])).then(e=>({default:e.ProjectTimelinePage})));function Ha({children:e}){const{isAuthenticated:s}=Te();return s?t.jsx(t.Fragment,{children:e}):t.jsx(Ws,{to:"/login",replace:!0})}function oj({children:e}){var n;const{user:s}=Te();return(n=s==null?void 0:s.roles)!=null&&n.includes("super-admin")?t.jsx(t.Fragment,{children:e}):t.jsx(Ws,{to:"/",replace:!0})}function cl({children:e}){const{isAuthenticated:s}=Te(),{data:n}=Tc(),r=Wr();return s?t.jsx(Ws,{to:"/",replace:!0}):n!=null&&n.needsSetup&&r.pathname==="/login"?t.jsx(Ws,{to:"/register",replace:!0}):n&&!n.needsSetup&&r.pathname==="/register"?t.jsx(Ws,{to:"/login",replace:!0}):t.jsx(t.Fragment,{children:e})}function ij(){const{workspace:e,setWorkspace:s}=Te(),n=ot(),{data:r,isLoading:a}=Kr(!e);return x.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 lj(){const{workspace:e}=pt(),{workspace:s,setWorkspace:n}=Te();qh();const r=ot(),{data:a,isLoading:o,isFetching:i}=Kr();return x.useEffect(()=>{if(o||!a)return;const l=a.find(c=>c.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(Ex,{}),t.jsx(rp,{})]})}function cj(){return t.jsxs(Tu,{children:[t.jsx(Ye,{path:"/login",element:t.jsx(cl,{children:t.jsx(ap,{})})}),t.jsx(Ye,{path:"/register",element:t.jsx(cl,{children:t.jsx(op,{})})}),t.jsx(Ye,{path:"/invite/:token",element:t.jsx(rj,{})}),t.jsx(Ye,{path:"/setup",element:t.jsx(Ha,{children:t.jsx(ip,{})})}),t.jsx(Ye,{index:!0,element:t.jsx(Ha,{children:t.jsx(ij,{})})}),t.jsxs(Ye,{path:"/:workspace",element:t.jsx(Ha,{children:t.jsx(lj,{})}),children:[t.jsx(Ye,{index:!0,element:t.jsx(Ws,{to:"projects",replace:!0})}),t.jsx(Ye,{path:"projects",element:t.jsx(vb,{})}),t.jsxs(Ye,{path:"projects/:projectKey",element:t.jsx(Tx,{}),children:[t.jsx(Ye,{path:"board",element:t.jsx(nv,{})}),t.jsx(Ye,{path:"issues",element:t.jsx(rv,{})}),t.jsx(Ye,{path:"issues/new",element:t.jsx(Av,{})}),t.jsx(Ye,{path:"issues/:issueId",element:t.jsx(Dv,{})}),t.jsx(Ye,{path:"sprints",element:t.jsx(Wv,{})}),t.jsx(Ye,{path:"timeline",element:t.jsx(x.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Loading…"}),children:t.jsx(aj,{})})}),t.jsx(Ye,{path:"access",element:t.jsx(kv,{})})]}),t.jsx(Ye,{path:"notifications",element:t.jsx(Iv,{})}),t.jsx(Ye,{path:"settings",element:t.jsx(Jv,{})}),t.jsx(Ye,{path:"roles",element:t.jsx(oj,{children:t.jsx(sj,{})})})]}),t.jsx(Ye,{path:"*",element:t.jsx(Ws,{to:"/",replace:!0})})]})}window.__React=N;window.__ReactJsxRuntime=Cu;const dj=new Mu({defaultOptions:{queries:{staleTime:1e3*30,retry:1}}});(async()=>{let e=[];try{const n=await import("/admin-extensions.js");Array.isArray(n==null?void 0:n.default)&&(e=n.default)}catch{}Xl(document.getElementById("root")).render(t.jsx(x.StrictMode,{children:t.jsx(Af,{widgets:[...Nh,...e],children:t.jsx(Xm,{children:t.jsxs(Du,{client:dj,children:[t.jsx(Zm,{children:t.jsx(Jm,{children:t.jsx(Ou,{children:t.jsxs(fo,{delayDuration:300,children:[t.jsx(cj,{}),t.jsx(Wm,{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(fm,{initialIsOpen:!1})]})})})}))})();export{z as A,J as B,kn as C,Le as D,se as E,ru as I,Be as P,Mt as W,A as a,Pt as b,G as c,Io as d,ts as e,lb as f,eg as g,Ro as h,zo as i,ob as j,ue as k,Zn as l,pj as m,Ts as n,sg as o,rg as p,ig as q,gd as r,pb as s,je as t,hd as u,Js as v,nr as w,Tn as x,On as y,ra as z};
|