kenzoboard 0.1.1 → 0.1.3
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/index.js +200 -303
- package/dist/mcp.js +16018 -0
- package/dist/web/assets/index-BwQljj46.js +5 -0
- package/dist/web/assets/index-D8L4OSbt.css +1 -0
- package/dist/web/favicon.svg +4 -0
- package/dist/web/index.html +14 -0
- package/package.json +19 -8
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var Nt,R,Pr,nt,Zn,Mr,Ir,Fr,Ln,hn,fn,Wr,Et={},Br=[],Zs=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,At=Array.isArray;function Ue(e,t){for(var n in t)e[n]=t[n];return e}function Nn(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function m(e,t,n){var s,o,i,l={};for(i in t)i=="key"?s=t[i]:i=="ref"?o=t[i]:l[i]=t[i];if(arguments.length>2&&(l.children=arguments.length>3?Nt.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)l[i]===void 0&&(l[i]=e.defaultProps[i]);return kt(e,l,s,o,null)}function kt(e,t,n,s,o){var i={type:e,props:t,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++Pr,__i:-1,__u:0};return o==null&&R.vnode!=null&&R.vnode(i),i}function Ys(){return{current:null}}function he(e){return e.children}function Pe(e,t){this.props=e,this.context=t}function dt(e,t){if(t==null)return e.__?dt(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?dt(e):null}function Hr(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return Hr(e)}}function pn(e){(!e.__d&&(e.__d=!0)&&nt.push(e)&&!Ht.__r++||Zn!=R.debounceRendering)&&((Zn=R.debounceRendering)||Mr)(Ht)}function Ht(){for(var e,t,n,s,o,i,l,a=1;nt.length;)nt.length>a&&nt.sort(Ir),e=nt.shift(),a=nt.length,e.__d&&(n=void 0,s=void 0,o=(s=(t=e).__v).__e,i=[],l=[],t.__P&&((n=Ue({},s)).__v=s.__v+1,R.vnode&&R.vnode(n),An(t.__P,n,s,t.__n,t.__P.namespaceURI,32&s.__u?[o]:null,i,o??dt(s),!!(32&s.__u),l),n.__v=s.__v,n.__.__k[n.__i]=n,Kr(i,n,l),s.__e=s.__=null,n.__e!=o&&Hr(n)));Ht.__r=0}function Ur(e,t,n,s,o,i,l,a,d,u,h){var c,v,f,g,w,C,S,y=s&&s.__k||Br,$=t.length;for(d=Gs(n,t,y,d,$),c=0;c<$;c++)(f=n.__k[c])!=null&&(v=f.__i==-1?Et:y[f.__i]||Et,f.__i=c,C=An(e,f,v,o,i,l,a,d,u,h),g=f.__e,f.ref&&v.ref!=f.ref&&(v.ref&&jn(v.ref,null,f),h.push(f.ref,f.__c||g,f)),w==null&&g!=null&&(w=g),(S=!!(4&f.__u))||v.__k===f.__k?d=zr(f,d,e,S):typeof f.type=="function"&&C!==void 0?d=C:g&&(d=g.nextSibling),f.__u&=-7);return n.__e=w,d}function Gs(e,t,n,s,o){var i,l,a,d,u,h=n.length,c=h,v=0;for(e.__k=new Array(o),i=0;i<o;i++)(l=t[i])!=null&&typeof l!="boolean"&&typeof l!="function"?(typeof l=="string"||typeof l=="number"||typeof l=="bigint"||l.constructor==String?l=e.__k[i]=kt(null,l,null,null,null):At(l)?l=e.__k[i]=kt(he,{children:l},null,null,null):l.constructor===void 0&&l.__b>0?l=e.__k[i]=kt(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):e.__k[i]=l,d=i+v,l.__=e,l.__b=e.__b+1,a=null,(u=l.__i=Xs(l,n,d,c))!=-1&&(c--,(a=n[u])&&(a.__u|=2)),a==null||a.__v==null?(u==-1&&(o>h?v--:o<h&&v++),typeof l.type!="function"&&(l.__u|=4)):u!=d&&(u==d-1?v--:u==d+1?v++:(u>d?v--:v++,l.__u|=4))):e.__k[i]=null;if(c)for(i=0;i<h;i++)(a=n[i])!=null&&!(2&a.__u)&&(a.__e==s&&(s=dt(a)),qr(a,a));return s}function zr(e,t,n,s){var o,i;if(typeof e.type=="function"){for(o=e.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=e,t=zr(o[i],t,n,s));return t}e.__e!=t&&(s&&(t&&e.type&&!t.parentNode&&(t=dt(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Me(e,t){return t=t||[],e==null||typeof e=="boolean"||(At(e)?e.some(function(n){Me(n,t)}):t.push(e)),t}function Xs(e,t,n,s){var o,i,l,a=e.key,d=e.type,u=t[n],h=u!=null&&(2&u.__u)==0;if(u===null&&a==null||h&&a==u.key&&d==u.type)return n;if(s>(h?1:0)){for(o=n-1,i=n+1;o>=0||i<t.length;)if((u=t[l=o>=0?o--:i++])!=null&&!(2&u.__u)&&a==u.key&&d==u.type)return l}return-1}function Yn(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Zs.test(t)?n:n+"px"}function Mt(e,t,n,s,o){var i,l;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof s=="string"&&(e.style.cssText=s=""),s)for(t in s)n&&t in n||Yn(e.style,t,"");if(n)for(t in n)s&&n[t]==s[t]||Yn(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(Fr,"$1")),l=t.toLowerCase(),t=l in e||t=="onFocusOut"||t=="onFocusIn"?l.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?s?n.u=s.u:(n.u=Ln,e.addEventListener(t,i?fn:hn,i)):e.removeEventListener(t,i?fn:hn,i);else{if(o=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function Gn(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=Ln++;else if(t.t<n.u)return;return n(R.event?R.event(t):t)}}}function An(e,t,n,s,o,i,l,a,d,u){var h,c,v,f,g,w,C,S,y,$,O,A,j,L,k,D,E,N=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(d=!!(32&n.__u),i=[a=t.__e=n.__e]),(h=R.__b)&&h(t);e:if(typeof N=="function")try{if(S=t.props,y="prototype"in N&&N.prototype.render,$=(h=N.contextType)&&s[h.__c],O=h?$?$.props.value:h.__:s,n.__c?C=(c=t.__c=n.__c).__=c.__E:(y?t.__c=c=new N(S,O):(t.__c=c=new Pe(S,O),c.constructor=N,c.render=Qs),$&&$.sub(c),c.state||(c.state={}),c.__n=s,v=c.__d=!0,c.__h=[],c._sb=[]),y&&c.__s==null&&(c.__s=c.state),y&&N.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=Ue({},c.__s)),Ue(c.__s,N.getDerivedStateFromProps(S,c.__s))),f=c.props,g=c.state,c.__v=t,v)y&&N.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),y&&c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(y&&N.getDerivedStateFromProps==null&&S!==f&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(S,O),t.__v==n.__v||!c.__e&&c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(S,c.__s,O)===!1){for(t.__v!=n.__v&&(c.props=S,c.state=c.__s,c.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(B){B&&(B.__=t)}),A=0;A<c._sb.length;A++)c.__h.push(c._sb[A]);c._sb=[],c.__h.length&&l.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(S,c.__s,O),y&&c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(f,g,w)})}if(c.context=O,c.props=S,c.__P=e,c.__e=!1,j=R.__r,L=0,y){for(c.state=c.__s,c.__d=!1,j&&j(t),h=c.render(c.props,c.state,c.context),k=0;k<c._sb.length;k++)c.__h.push(c._sb[k]);c._sb=[]}else do c.__d=!1,j&&j(t),h=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++L<25);c.state=c.__s,c.getChildContext!=null&&(s=Ue(Ue({},s),c.getChildContext())),y&&!v&&c.getSnapshotBeforeUpdate!=null&&(w=c.getSnapshotBeforeUpdate(f,g)),D=h,h!=null&&h.type===he&&h.key==null&&(D=Vr(h.props.children)),a=Ur(e,At(D)?D:[D],t,n,s,o,i,l,a,d,u),c.base=t.__e,t.__u&=-161,c.__h.length&&l.push(c),C&&(c.__E=c.__=null)}catch(B){if(t.__v=null,d||i!=null)if(B.then){for(t.__u|=d?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;i[i.indexOf(a)]=null,t.__e=a}else{for(E=i.length;E--;)Nn(i[E]);bn(t)}else t.__e=n.__e,t.__k=n.__k,B.then||bn(t);R.__e(B,t,n)}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):a=t.__e=Js(n.__e,t,n,s,o,i,l,d,u);return(h=R.diffed)&&h(t),128&t.__u?void 0:a}function bn(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(bn)}function Kr(e,t,n){for(var s=0;s<n.length;s++)jn(n[s],n[++s],n[++s]);R.__c&&R.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){R.__e(i,o.__v)}})}function Vr(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:At(e)?e.map(Vr):Ue({},e)}function Js(e,t,n,s,o,i,l,a,d){var u,h,c,v,f,g,w,C=n.props||Et,S=t.props,y=t.type;if(y=="svg"?o="http://www.w3.org/2000/svg":y=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),i!=null){for(u=0;u<i.length;u++)if((f=i[u])&&"setAttribute"in f==!!y&&(y?f.localName==y:f.nodeType==3)){e=f,i[u]=null;break}}if(e==null){if(y==null)return document.createTextNode(S);e=document.createElementNS(o,y,S.is&&S),a&&(R.__m&&R.__m(t,i),a=!1),i=null}if(y==null)C===S||a&&e.data==S||(e.data=S);else{if(i=i&&Nt.call(e.childNodes),!a&&i!=null)for(C={},u=0;u<e.attributes.length;u++)C[(f=e.attributes[u]).name]=f.value;for(u in C)if(f=C[u],u!="children"){if(u=="dangerouslySetInnerHTML")c=f;else if(!(u in S)){if(u=="value"&&"defaultValue"in S||u=="checked"&&"defaultChecked"in S)continue;Mt(e,u,null,f,o)}}for(u in S)f=S[u],u=="children"?v=f:u=="dangerouslySetInnerHTML"?h=f:u=="value"?g=f:u=="checked"?w=f:a&&typeof f!="function"||C[u]===f||Mt(e,u,f,C[u],o);if(h)a||c&&(h.__html==c.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(c&&(e.innerHTML=""),Ur(t.type=="template"?e.content:e,At(v)?v:[v],t,n,s,y=="foreignObject"?"http://www.w3.org/1999/xhtml":o,i,l,i?i[0]:n.__k&&dt(n,0),a,d),i!=null)for(u=i.length;u--;)Nn(i[u]);a||(u="value",y=="progress"&&g==null?e.removeAttribute("value"):g!=null&&(g!==e[u]||y=="progress"&&!g||y=="option"&&g!=C[u])&&Mt(e,u,g,C[u],o),u="checked",w!=null&&w!=e[u]&&Mt(e,u,w,C[u],o))}return e}function jn(e,t,n){try{if(typeof e=="function"){var s=typeof e.__u=="function";s&&e.__u(),s&&t==null||(e.__u=e(t))}else e.current=t}catch(o){R.__e(o,n)}}function qr(e,t,n){var s,o;if(R.unmount&&R.unmount(e),(s=e.ref)&&(s.current&&s.current!=e.__e||jn(s,null,t)),(s=e.__c)!=null){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(i){R.__e(i,t)}s.base=s.__P=null}if(s=e.__k)for(o=0;o<s.length;o++)s[o]&&qr(s[o],t,n||typeof e.type!="function");n||Nn(e.__e),e.__c=e.__=e.__e=void 0}function Qs(e,t,n){return this.constructor(e,n)}function ut(e,t,n){var s,o,i,l;t==document&&(t=document.documentElement),R.__&&R.__(e,t),o=(s=typeof n=="function")?null:n&&n.__k||t.__k,i=[],l=[],An(t,e=(!s&&n||t).__k=m(he,null,[e]),o||Et,Et,t.namespaceURI,!s&&n?[n]:o?null:t.firstChild?Nt.call(t.childNodes):null,i,!s&&n?n:o?o.__e:t.firstChild,s,l),Kr(i,e,l)}function Zr(e,t){ut(e,t,Zr)}function Yr(e,t,n){var s,o,i,l,a=Ue({},e.props);for(i in e.type&&e.type.defaultProps&&(l=e.type.defaultProps),t)i=="key"?s=t[i]:i=="ref"?o=t[i]:a[i]=t[i]===void 0&&l!=null?l[i]:t[i];return arguments.length>2&&(a.children=arguments.length>3?Nt.call(arguments,2):n),kt(e.type,a,s||e.key,o||e.ref,null)}function Qe(e){function t(n){var s,o;return this.getChildContext||(s=new Set,(o={})[t.__c]=this,this.getChildContext=function(){return o},this.componentWillUnmount=function(){s=null},this.shouldComponentUpdate=function(i){this.props.value!=i.value&&s.forEach(function(l){l.__e=!0,pn(l)})},this.sub=function(i){s.add(i);var l=i.componentWillUnmount;i.componentWillUnmount=function(){s&&s.delete(i),l&&l.call(i)}}),n.children}return t.__c="__cC"+Wr++,t.__=e,t.Provider=t.__l=(t.Consumer=function(n,s){return n.children(s)}).contextType=t,t}Nt=Br.slice,R={__e:function(e,t,n,s){for(var o,i,l;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),l=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,s||{}),l=o.__d),l)return o.__E=o}catch(a){e=a}throw e}},Pr=0,Pe.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Ue({},this.state),typeof e=="function"&&(e=e(Ue({},n),this.props)),e&&Ue(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),pn(this))},Pe.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),pn(this))},Pe.prototype.render=he,nt=[],Mr=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ir=function(e,t){return e.__v.__b-t.__v.__b},Ht.__r=0,Fr=/(PointerCapture)$|Capture$/i,Ln=0,hn=Gn(!1),fn=Gn(!0),Wr=0;var eo=0;function r(e,t,n,s,o,i){t||(t={});var l,a,d=t;if("ref"in d)for(a in d={},t)a=="ref"?l=t[a]:d[a]=t[a];var u={type:e,props:d,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--eo,__i:-1,__u:0,__source:o,__self:i};if(typeof e=="function"&&(l=e.defaultProps))for(a in l)d[a]===void 0&&(d[a]=l[a]);return R.vnode&&R.vnode(u),u}var Ge,X,rn,Xn,ht=0,Gr=[],ne=R,Jn=ne.__b,Qn=ne.__r,er=ne.diffed,tr=ne.__c,nr=ne.unmount,rr=ne.__;function pt(e,t){ne.__h&&ne.__h(X,e,ht||t),ht=0;var n=X.__H||(X.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function b(e){return ht=1,qt(es,e)}function qt(e,t,n){var s=pt(Ge++,2);if(s.t=e,!s.__c&&(s.__=[n?n(t):es(void 0,t),function(a){var d=s.__N?s.__N[0]:s.__[0],u=s.t(d,a);d!==u&&(s.__N=[u,s.__[1]],s.__c.setState({}))}],s.__c=X,!X.__f)){var o=function(a,d,u){if(!s.__c.__H)return!0;var h=s.__c.__H.__.filter(function(v){return!!v.__c});if(h.every(function(v){return!v.__N}))return!i||i.call(this,a,d,u);var c=s.__c.props!==a;return h.forEach(function(v){if(v.__N){var f=v.__[0];v.__=v.__N,v.__N=void 0,f!==v.__[0]&&(c=!0)}}),i&&i.call(this,a,d,u)||c};X.__f=!0;var i=X.shouldComponentUpdate,l=X.componentWillUpdate;X.componentWillUpdate=function(a,d,u){if(this.__e){var h=i;i=void 0,o(a,d,u),i=h}l&&l.call(this,a,d,u)},X.shouldComponentUpdate=o}return s.__N||s.__}function P(e,t){var n=pt(Ge++,3);!ne.__s&&On(n.__H,t)&&(n.__=e,n.u=t,X.__H.__h.push(n))}function bt(e,t){var n=pt(Ge++,4);!ne.__s&&On(n.__H,t)&&(n.__=e,n.u=t,X.__h.push(n))}function q(e){return ht=5,G(function(){return{current:e}},[])}function Xr(e,t,n){ht=6,bt(function(){if(typeof e=="function"){var s=e(t());return function(){e(null),s&&typeof s=="function"&&s()}}if(e)return e.current=t(),function(){return e.current=null}},n==null?n:n.concat(e))}function G(e,t){var n=pt(Ge++,7);return On(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function ie(e,t){return ht=8,G(function(){return e},t)}function Xe(e){var t=X.context[e.__c],n=pt(Ge++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(X)),t.props.value):e.__}function Jr(e,t){ne.useDebugValue&&ne.useDebugValue(t?t(e):e)}function Qr(){var e=pt(Ge++,11);if(!e.__){for(var t=X.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function to(){for(var e;e=Gr.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Ft),e.__H.__h.forEach(gn),e.__H.__h=[]}catch(t){e.__H.__h=[],ne.__e(t,e.__v)}}ne.__b=function(e){X=null,Jn&&Jn(e)},ne.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),rr&&rr(e,t)},ne.__r=function(e){Qn&&Qn(e),Ge=0;var t=(X=e.__c).__H;t&&(rn===X?(t.__h=[],X.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.forEach(Ft),t.__h.forEach(gn),t.__h=[],Ge=0)),rn=X},ne.diffed=function(e){er&&er(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Gr.push(t)!==1&&Xn===ne.requestAnimationFrame||((Xn=ne.requestAnimationFrame)||no)(to)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),rn=X=null},ne.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Ft),n.__h=n.__h.filter(function(s){return!s.__||gn(s)})}catch(s){t.some(function(o){o.__h&&(o.__h=[])}),t=[],ne.__e(s,n.__v)}}),tr&&tr(e,t)},ne.unmount=function(e){nr&&nr(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(s){try{Ft(s)}catch(o){t=o}}),n.__H=void 0,t&&ne.__e(t,n.__v))};var sr=typeof requestAnimationFrame=="function";function no(e){var t,n=function(){clearTimeout(s),sr&&cancelAnimationFrame(t),setTimeout(e)},s=setTimeout(n,35);sr&&(t=requestAnimationFrame(n))}function Ft(e){var t=X,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),X=t}function gn(e){var t=X;e.__c=e.__(),X=t}function On(e,t){return!e||e.length!==t.length||t.some(function(n,s){return n!==e[s]})}function es(e,t){return typeof t=="function"?t(e):t}var ro={};function It(e,t){for(var n in t)e[n]=t[n];return e}function so(e,t,n){var s,o=/(?:\?([^#]*))?(#.*)?$/,i=e.match(o),l={};if(i&&i[1])for(var a=i[1].split("&"),d=0;d<a.length;d++){var u=a[d].split("=");l[decodeURIComponent(u[0])]=decodeURIComponent(u.slice(1).join("="))}e=mn(e.replace(o,"")),t=mn(t||"");for(var h=Math.max(e.length,t.length),c=0;c<h;c++)if(t[c]&&t[c].charAt(0)===":"){var v=t[c].replace(/(^:|[+*?]+$)/g,""),f=(t[c].match(/[+*?]+$/)||ro)[0]||"",g=~f.indexOf("+"),w=~f.indexOf("*"),C=e[c]||"";if(!C&&!w&&(f.indexOf("?")<0||g)){s=!1;break}if(l[v]=decodeURIComponent(C),g||w){l[v]=e.slice(c).map(decodeURIComponent).join("/");break}}else if(t[c]!==e[c]){s=!1;break}return(n.default===!0||s!==!1)&&l}function oo(e,t){return e.rank<t.rank?1:e.rank>t.rank?-1:e.index-t.index}function io(e,t){return e.index=t,e.rank=function(n){return n.props.default?0:mn(n.props.path).map(lo).join("")}(e),e.props}function mn(e){return e.replace(/(^\/+|\/+$)/g,"").split("/")}function lo(e){return e.charAt(0)==":"?1+"*+?".indexOf(e.charAt(e.length-1))||4:5}var ao={},st=[],or=[],Le=null,ts={url:Rn()},co=Qe(ts);function Rn(){var e;return""+((e=Le&&Le.location?Le.location:Le&&Le.getCurrentLocation?Le.getCurrentLocation():typeof location<"u"?location:ao).pathname||"")+(e.search||"")}function ge(e,t){return t===void 0&&(t=!1),typeof e!="string"&&e.url&&(t=e.replace,e=e.url),function(n){for(var s=st.length;s--;)if(st[s].canRoute(n))return!0;return!1}(e)&&function(n,s){s===void 0&&(s="push"),Le&&Le[s]?Le[s](n):typeof history<"u"&&history[s+"State"]&&history[s+"State"](null,null,n)}(e,t?"replace":"push"),ns(e)}function ns(e){for(var t=!1,n=0;n<st.length;n++)st[n].routeTo(e)&&(t=!0);return t}function uo(e){if(e&&e.getAttribute){var t=e.getAttribute("href"),n=e.getAttribute("target");if(t&&t.match(/^\//g)&&(!n||n.match(/^_?self$/i)))return ge(t)}}function ho(e){return e.stopImmediatePropagation&&e.stopImmediatePropagation(),e.stopPropagation&&e.stopPropagation(),e.preventDefault(),!1}function fo(e){if(!(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey||e.button)){var t=e.target;do if(t.localName==="a"&&t.getAttribute("href")){if(t.hasAttribute("data-native")||t.hasAttribute("native"))return;if(uo(t))return ho(e)}while(t=t.parentNode)}}var ir=!1;function rs(e){e.history&&(Le=e.history),this.state={url:e.url||Rn()}}It(rs.prototype=new Pe,{shouldComponentUpdate:function(e){return e.static!==!0||e.url!==this.props.url||e.onChange!==this.props.onChange},canRoute:function(e){var t=Me(this.props.children);return this.g(t,e)!==void 0},routeTo:function(e){this.setState({url:e});var t=this.canRoute(e);return this.p||this.forceUpdate(),t},componentWillMount:function(){this.p=!0},componentDidMount:function(){var e=this;ir||(ir=!0,Le||addEventListener("popstate",function(){ns(Rn())}),addEventListener("click",fo)),st.push(this),Le&&(this.u=Le.listen(function(t){var n=t.location||t;e.routeTo(""+(n.pathname||"")+(n.search||""))})),this.p=!1},componentWillUnmount:function(){typeof this.u=="function"&&this.u(),st.splice(st.indexOf(this),1)},componentWillUpdate:function(){this.p=!0},componentDidUpdate:function(){this.p=!1},g:function(e,t){e=e.filter(io).sort(oo);for(var n=0;n<e.length;n++){var s=e[n],o=so(t,s.props.path,s.props);if(o)return[s,o]}},render:function(e,t){var n,s,o=e.onChange,i=t.url,l=this.c,a=this.g(Me(e.children),i);if(a&&(s=Yr(a[0],It(It({url:i,matches:n=a[1]},n),{key:void 0,ref:void 0}))),i!==(l&&l.url)){It(ts,l=this.c={url:i,previous:l&&l.url,current:s,path:s?s.props.path:null,matches:n}),l.router=this,l.active=s?[s]:[];for(var d=or.length;d--;)or[d]({});typeof o=="function"&&o(l)}return m(co.Provider,{value:l},s)}});function ss(e,t){for(var n in t)e[n]=t[n];return e}function vn(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var s in t)if(s!=="__source"&&e[s]!==t[s])return!0;return!1}function os(e,t){var n=t(),s=b({t:{__:n,u:t}}),o=s[0].t,i=s[1];return bt(function(){o.__=n,o.u=t,sn(o)&&i({t:o})},[e,n,t]),P(function(){return sn(o)&&i({t:o}),e(function(){sn(o)&&i({t:o})})},[e]),n}function sn(e){var t,n,s=e.u,o=e.__;try{var i=s();return!((t=o)===(n=i)&&(t!==0||1/t==1/n)||t!=t&&n!=n)}catch{return!0}}function is(e){e()}function ls(e){return e}function as(){return[!1,is]}var cs=bt;function _n(e,t){this.props=e,this.context=t}function ds(e,t){function n(o){var i=this.props.ref,l=i==o.ref;return!l&&i&&(i.call?i(null):i.current=null),t?!t(this.props,o)||!l:vn(this.props,o)}function s(o){return this.shouldComponentUpdate=n,m(e,o)}return s.displayName="Memo("+(e.displayName||e.name)+")",s.prototype.isReactComponent=!0,s.__f=!0,s.type=e,s}(_n.prototype=new Pe).isPureReactComponent=!0,_n.prototype.shouldComponentUpdate=function(e,t){return vn(this.props,e)||vn(this.state,t)};var lr=R.__b;R.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),lr&&lr(e)};var po=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function z(e){function t(n){var s=ss({},n);return delete s.ref,e(s,n.ref||null)}return t.$$typeof=po,t.render=e,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var ar=function(e,t){return e==null?null:Me(Me(e).map(t))},bo={map:ar,forEach:ar,count:function(e){return e?Me(e).length:0},only:function(e){var t=Me(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:Me},go=R.__e;R.__e=function(e,t,n,s){if(e.then){for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t)}go(e,t,n,s)};var cr=R.unmount;function us(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(s){typeof s.__c=="function"&&s.__c()}),e.__c.__H=null),(e=ss({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(s){return us(s,t,n)})),e}function hs(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(s){return hs(s,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Wt(){this.__u=0,this.o=null,this.__b=null}function fs(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function mo(e){var t,n,s,o=null;function i(l){if(t||(t=e()).then(function(a){a&&(o=a.default||a),s=!0},function(a){n=a,s=!0}),n)throw n;if(!s)throw t;return o?m(o,l):null}return i.displayName="Lazy",i.__f=!0,i}function wt(){this.i=null,this.l=null}R.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),cr&&cr(e)},(Wt.prototype=new Pe).__c=function(e,t){var n=t.__c,s=this;s.o==null&&(s.o=[]),s.o.push(n);var o=fs(s.__v),i=!1,l=function(){i||(i=!0,n.__R=null,o?o(a):a())};n.__R=l;var a=function(){if(!--s.__u){if(s.state.__a){var d=s.state.__a;s.__v.__k[0]=hs(d,d.__c.__P,d.__c.__O)}var u;for(s.setState({__a:s.__b=null});u=s.o.pop();)u.forceUpdate()}};s.__u++||32&t.__u||s.setState({__a:s.__b=s.__v.__k[0]}),e.then(l,l)},Wt.prototype.componentWillUnmount=function(){this.o=[]},Wt.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),s=this.__v.__k[0].__c;this.__v.__k[0]=us(this.__b,n,s.__O=s.__P)}this.__b=null}var o=t.__a&&m(he,null,e.fallback);return o&&(o.__u&=-33),[m(he,null,t.__a?null:e.children),o]};var dr=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};function vo(e){return this.getChildContext=function(){return e.context},e.children}function _o(e){var t=this,n=e.h;if(t.componentWillUnmount=function(){ut(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),!t.v){for(var s=t.__v;s!==null&&!s.__m&&s.__!==null;)s=s.__;t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],__k:{__m:s.__m},contains:function(){return!0},insertBefore:function(o,i){this.childNodes.push(o),t.h.insertBefore(o,i)},removeChild:function(o){this.childNodes.splice(this.childNodes.indexOf(o)>>>1,1),t.h.removeChild(o)}}}ut(m(vo,{context:t.context},e.__v),t.v)}function ps(e,t){var n=m(_o,{__v:e,h:t});return n.containerInfo=t,n}(wt.prototype=new Pe).__a=function(e){var t=this,n=fs(t.__v),s=t.l.get(e);return s[0]++,function(o){var i=function(){t.props.revealOrder?(s.push(o),dr(t,e,s)):o()};n?n(i):i()}},wt.prototype.render=function(e){this.i=null,this.l=new Map;var t=Me(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},wt.prototype.componentDidUpdate=wt.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){dr(e,n,t)})};var bs=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,xo=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,wo=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,yo=/[A-Z0-9]/g,ko=typeof document<"u",Co=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function So(e,t,n){return t.__k==null&&(t.textContent=""),ut(e,t),typeof n=="function"&&n(),e?e.__c:null}function Do(e,t,n){return Zr(e,t),typeof n=="function"&&n(),e?e.__c:null}Pe.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Pe.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var ur=R.event;function Eo(){}function To(){return this.cancelBubble}function $o(){return this.defaultPrevented}R.event=function(e){return ur&&(e=ur(e)),e.persist=Eo,e.isPropagationStopped=To,e.isDefaultPrevented=$o,e.nativeEvent=e};var Pn,Lo={enumerable:!1,configurable:!0,get:function(){return this.class}},hr=R.vnode;R.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,s=t.type,o={},i=s.indexOf("-")===-1;for(var l in n){var a=n[l];if(!(l==="value"&&"defaultValue"in n&&a==null||ko&&l==="children"&&s==="noscript"||l==="class"||l==="className")){var d=l.toLowerCase();l==="defaultValue"&&"value"in n&&n.value==null?l="value":l==="download"&&a===!0?a="":d==="translate"&&a==="no"?a=!1:d[0]==="o"&&d[1]==="n"?d==="ondoubleclick"?l="ondblclick":d!=="onchange"||s!=="input"&&s!=="textarea"||Co(n.type)?d==="onfocus"?l="onfocusin":d==="onblur"?l="onfocusout":wo.test(l)&&(l=d):d=l="oninput":i&&xo.test(l)?l=l.replace(yo,"-$&").toLowerCase():a===null&&(a=void 0),d==="oninput"&&o[l=d]&&(l="oninputCapture"),o[l]=a}}s=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=Me(n.children).forEach(function(u){u.props.selected=o.value.indexOf(u.props.value)!=-1})),s=="select"&&o.defaultValue!=null&&(o.value=Me(n.children).forEach(function(u){u.props.selected=o.multiple?o.defaultValue.indexOf(u.props.value)!=-1:o.defaultValue==u.props.value})),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,"className",Lo)):(n.className&&!n.class||n.class&&n.className)&&(o.class=o.className=n.className),t.props=o}(e),e.$$typeof=bs,hr&&hr(e)};var fr=R.__r;R.__r=function(e){fr&&fr(e),Pn=e.__c};var pr=R.diffed;R.diffed=function(e){pr&&pr(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),Pn=null};var No={ReactCurrentDispatcher:{current:{readContext:function(e){return Pn.__n[e.__c].props.value},useCallback:ie,useContext:Xe,useDebugValue:Jr,useDeferredValue:ls,useEffect:P,useId:Qr,useImperativeHandle:Xr,useInsertionEffect:cs,useLayoutEffect:bt,useMemo:G,useReducer:qt,useRef:q,useState:b,useSyncExternalStore:os,useTransition:as}}};function Ao(e){return m.bind(null,e)}function Zt(e){return!!e&&e.$$typeof===bs}function jo(e){return Zt(e)&&e.type===he}function Oo(e){return!!e&&!!e.displayName&&(typeof e.displayName=="string"||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function Ro(e){return Zt(e)?Yr.apply(null,arguments):e}function Po(e){return!!e.__k&&(ut(null,e),!0)}function Mo(e){return e&&(e.base||e.nodeType===1&&e)||null}var yt=function(e,t){return e(t)},Io=function(e,t){return e(t)},Fo=he,Wo=Zt,Oe={useState:b,useId:Qr,useReducer:qt,useEffect:P,useLayoutEffect:bt,useInsertionEffect:cs,useTransition:as,useDeferredValue:ls,useSyncExternalStore:os,startTransition:is,useRef:q,useImperativeHandle:Xr,useMemo:G,useCallback:ie,useContext:Xe,useDebugValue:Jr,version:"18.3.1",Children:bo,render:So,hydrate:Do,unmountComponentAtNode:Po,createPortal:ps,createElement:m,createContext:Qe,createFactory:Ao,cloneElement:Ro,createRef:Ys,Fragment:he,isValidElement:Zt,isElement:Wo,isFragment:jo,isMemo:Oo,findDOMNode:Mo,Component:Pe,PureComponent:_n,memo:ds,forwardRef:z,flushSync:Io,unstable_batchedUpdates:yt,StrictMode:Fo,Suspense:Wt,SuspenseList:wt,lazy:mo,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:No};function Bo({title:e,titleId:t,...n},s){return m("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},n),e?m("title",{id:t},e):null,m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 13.5 12 21m0 0-7.5-7.5M12 21V3"}))}const Ho=z(Bo);function Uo({title:e,titleId:t,...n},s){return m("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},n),e?m("title",{id:t},e):null,m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"}))}const gs=z(Uo);function zo({title:e,titleId:t,...n},s){return m("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},n),e?m("title",{id:t},e):null,m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3"}))}const Ko=z(zo);function Vo({title:e,titleId:t,...n},s){return m("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},n),e?m("title",{id:t},e):null,m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25H12"}))}const qo=z(Vo);function Zo({title:e,titleId:t,...n},s){return m("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},n),e?m("title",{id:t},e):null,m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m3.75 13.5 10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75Z"}))}const Yo=z(Zo);function Go({title:e,titleId:t,...n},s){return m("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},n),e?m("title",{id:t},e):null,m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const ms=z(Go);function Xo({title:e,titleId:t,...n},s){return m("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},n),e?m("title",{id:t},e):null,m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"}))}const Jo=z(Xo);function Qo({title:e,titleId:t,...n},s){return m("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},n),e?m("title",{id:t},e):null,m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"}))}const br=z(Qo);function ei({title:e,titleId:t,...n},s){return m("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},n),e?m("title",{id:t},e):null,m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z"}),m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const ti=z(ei);function ni({title:e,titleId:t,...n},s){return m("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},n),e?m("title",{id:t},e):null,m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m6.75 7.5 3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0 0 21 18V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v12a2.25 2.25 0 0 0 2.25 2.25Z"}))}const ri=z(ni);function si({title:e,titleId:t,...n},s){return m("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},n),e?m("title",{id:t},e):null,m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"}))}const oi=z(si);function ii({title:e,titleId:t,...n},s){return m("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},n),e?m("title",{id:t},e):null,m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88"}))}const on=z(ii);function li({title:e,titleId:t,...n},s){return m("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},n),e?m("title",{id:t},e):null,m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const ai=z(li);function ci({title:e,titleId:t,...n},s){return m("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},n),e?m("title",{id:t},e):null,m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"}))}const di=z(ci);function ui({title:e,titleId:t,...n},s){return m("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},n),e?m("title",{id:t},e):null,m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"}))}const hi=z(ui);function fi({title:e,titleId:t,...n},s){return m("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},n),e?m("title",{id:t},e):null,m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z"}))}const pi=z(fi);function bi({title:e,titleId:t,...n},s){return m("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},n),e?m("title",{id:t},e):null,m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 18.364A9 9 0 0 0 5.636 5.636m12.728 12.728A9 9 0 0 1 5.636 5.636m12.728 12.728L5.636 5.636"}))}const gi=z(bi);function mi({title:e,titleId:t,...n},s){return m("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},n),e?m("title",{id:t},e):null,m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13"}))}const xn=z(mi);function vi({title:e,titleId:t,...n},s){return m("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},n),e?m("title",{id:t},e):null,m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"}))}const vs=z(vi);function _i({title:e,titleId:t,...n},s){return m("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},n),e?m("title",{id:t},e):null,m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"}))}const gr=z(_i);function xi({title:e,titleId:t,...n},s){return m("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},n),e?m("title",{id:t},e):null,m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 6.878V6a2.25 2.25 0 0 1 2.25-2.25h7.5A2.25 2.25 0 0 1 18 6v.878m-12 0c.235-.083.487-.128.75-.128h10.5c.263 0 .515.045.75.128m-12 0A2.25 2.25 0 0 0 4.5 9v.878m13.5-3A2.25 2.25 0 0 1 19.5 9v.878m0 0a2.246 2.246 0 0 0-.75-.128H5.25c-.263 0-.515.045-.75.128m15 0A2.25 2.25 0 0 1 21 12v6a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 18v-6c0-.98.626-1.813 1.5-2.122"}))}const wi=z(xi);function yi({title:e,titleId:t,...n},s){return m("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},n),e?m("title",{id:t},e):null,m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z"}))}const ki=z(yi);function Ci({title:e,titleId:t,...n},s){return m("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},n),e?m("title",{id:t},e):null,m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z"}))}const Si=z(Ci);function Di({title:e,titleId:t,...n},s){return m("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},n),e?m("title",{id:t},e):null,m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25V6ZM3.75 15.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18v-2.25ZM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25V6ZM13.5 15.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25A2.25 2.25 0 0 1 13.5 18v-2.25Z"}))}const Ei=z(Di);function Ti({title:e,titleId:t,...n},s){return m("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},n),e?m("title",{id:t},e):null,m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"}))}const $i=z(Ti);function Li({title:e,titleId:t,...n},s){return m("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},n),e?m("title",{id:t},e):null,m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"}))}const Ni=z(Li);function Ai({title:e,titleId:t,...n},s){return m("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},n),e?m("title",{id:t},e):null,m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 4.5v15m6-15v15m-10.875 0h15.75c.621 0 1.125-.504 1.125-1.125V5.625c0-.621-.504-1.125-1.125-1.125H4.125C3.504 4.5 3 5.004 3 5.625v12.75c0 .621.504 1.125 1.125 1.125Z"}))}const ji=z(Ai);function Oi({title:e,titleId:t,...n},s){return m("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},n),e?m("title",{id:t},e):null,m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))}const _s=z(Oi),Tt="Kenzo",Ri="Flux CLI for Kenzo";function it({isOpen:e,onClose:t,title:n,children:s,boxClassName:o}){const i=q(null);return P(()=>{const a=i.current;a&&(e?a.showModal():a.close())},[e]),r("dialog",{ref:i,class:"modal",onClick:a=>{const d=i.current;a.target===d&&t()},onClose:t,children:r("div",{class:`modal-box flex max-h-[88vh] w-full max-w-xl flex-col overflow-hidden rounded-lg border border-base-300 bg-base-100 p-0 shadow-2xl ${o??""}`,children:[r("div",{class:"flex items-start justify-between gap-4 border-b border-base-200 bg-base-100 px-6 py-4",children:[r("div",{class:"min-w-0",children:r("h3",{class:"truncate text-lg font-semibold leading-6 text-base-content",children:n})}),r("button",{type:"button",class:"btn btn-ghost btn-sm btn-circle shrink-0",onClick:t,"aria-label":"Close modal",children:r(_s,{className:"h-5 w-5","aria-hidden":"true"})})]}),r("div",{class:"min-h-0 flex-1 overflow-y-auto px-6 py-5",children:s})]})})}function ft({isOpen:e,title:t,description:n,confirmLabel:s="Confirm",cancelLabel:o="Cancel",confirmClassName:i="btn-primary",confirmDisabled:l=!1,isLoading:a=!1,onConfirm:d,onClose:u}){return r(it,{isOpen:e,onClose:u,title:t,children:[n&&r("div",{class:"rounded-lg border border-base-200 bg-base-200/40 p-4",children:r("p",{class:"text-sm leading-6 text-base-content/70",children:n})}),r("div",{class:"modal-action border-t border-base-200 pt-4",children:[r("button",{type:"button",class:"btn btn-ghost",onClick:u,children:o}),r("button",{type:"button",class:`btn ${i}`,onClick:d,disabled:l||a,children:a?r("span",{class:"loading loading-spinner loading-sm"}):s})]})]})}const Mn="flux_auth_token";function Pi(){try{return localStorage.getItem(Mn)}catch{return null}}function Mi(e){try{localStorage.setItem(Mn,e)}catch{console.error("Failed to save auth token")}}function Ii(){try{localStorage.removeItem(Mn)}catch{}}const Fi="",H=`${Fi}/api`,wn=`${H}/events`;function Z(e,t={}){const n=Pi(),s=new Headers(t.headers);return n&&s.set("Authorization",`Bearer ${n}`),fetch(e,{...t,headers:s})}async function Yt(){return(await Z(`${H}/projects`)).json()}async function Wi(e){const t=await Z(`${H}/projects/${e}`);return t.ok?t.json():null}async function Bi(e,t){return(await Z(`${H}/projects`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,description:t})})).json()}async function Hi(e,t){const n=await Z(`${H}/projects/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return n.ok?n.json():null}async function Ui(e){await fetch(`${H}/projects/${e}`,{method:"DELETE"})}async function In(e){return(await Z(`${H}/projects/${e}/epics`)).json()}async function zi(e,t,n){return(await Z(`${H}/projects/${e}/epics`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:t,notes:n})})).json()}async function yn(e,t){const n=await Z(`${H}/epics/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return n.ok?n.json():null}async function Ki(e){return(await Z(`${H}/epics/${e}`,{method:"DELETE"})).ok}async function xs(e){return(await Z(`${H}/projects/${e}/tasks`)).json()}async function Vi(e,t,n){return(await Z(`${H}/projects/${e}/tasks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:t,epic_id:n})})).json()}async function kn(e,t){const n=await Z(`${H}/tasks/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return n.ok?n.json():null}async function qi(e){return(await Z(`${H}/tasks/${e}`,{method:"DELETE"})).ok}async function Zi(e,t,n){return(await Z(`${H}/tasks/${e}/comments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:t,author:n})})).json()}async function Yi(e,t){return(await Z(`${H}/tasks/${e}/comments/${t}`,{method:"DELETE"})).ok}async function Gi(e,t,n){return(await Z(`${H}/projects/${e}/cleanup`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({archiveTasks:t,archiveEpics:n})})).json()}async function Xi(){return(await Z(`${H}/reset`,{method:"POST"})).json()}async function Ji(){return(await Z(`${H}/webhooks`)).json()}async function Qi(e,t,n,s){return(await Z(`${H}/webhooks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,url:t,events:n,...s})})).json()}async function mr(e,t){const n=await Z(`${H}/webhooks/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return n.ok?n.json():null}async function el(e){return(await Z(`${H}/webhooks/${e}`,{method:"DELETE"})).ok}async function tl(e){return(await Z(`${H}/webhooks/${e}/test`,{method:"POST"})).json()}async function nl(e,t=50){return(await Z(`${H}/webhooks/${e}/deliveries?limit=${t}`)).json()}async function rl(){return(await Z(`${H}/auth/status`)).json()}async function sl(e,t,n){return(await Z(`${H}/auth/cli-complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e,name:t,project_ids:n})})).json()}async function ol(e,t){const n=new FormData;return n.append("file",e),t&&n.append("task_id",t),(await Z(`${H}/blobs`,{method:"POST",body:n})).json()}async function il(e){const t=e?`${H}/blobs?task_id=${e}`:`${H}/blobs`;return(await Z(t)).json()}async function ll(e){return(await Z(`${H}/blobs/${e}`,{method:"DELETE"})).ok}function vr(e){return`${H}/blobs/${e}/content`}const rt=["planning","todo","in_progress","done"],ot={planning:{label:"Planning",color:"#a855f7"},todo:{label:"To Do",color:"#6b7280"},in_progress:{label:"In Progress",color:"#3b82f6"},done:{label:"Done",color:"#22c55e"}},_r=["#3b82f6","#22c55e","#f59e0b","#8b5cf6","#ef4444","#06b6d4","#ec4899","#84cc16"],xr=["project.created","project.updated","project.deleted","epic.created","epic.updated","epic.deleted","task.created","task.updated","task.deleted","task.status_changed","task.archived"],ln={"project.created":"Project Created","project.updated":"Project Updated","project.deleted":"Project Deleted","epic.created":"Epic Created","epic.updated":"Epic Updated","epic.deleted":"Epic Deleted","task.created":"Task Created","task.updated":"Task Updated","task.deleted":"Task Deleted","task.status_changed":"Task Status Changed","task.archived":"Task Archived"};function al(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function cl({isOpen:e,onClose:t,onSave:n,task:s,projectId:o,defaultEpicId:i}){const[l,a]=b(""),[d,u]=b("todo"),[h,c]=b(""),[v,f]=b([]),[g,w]=b([]),[C,S]=b([]),[y,$]=b(!1),[O,A]=b(""),[j,L]=b([]),[k,D]=b(""),[E,N]=b(!1),[B,Y]=b(""),[le,re]=b(!1),[U,J]=b(null),[me,ce]=b([]),[we,Ne]=b(""),[ae,Q]=b([]),[_e,ye]=b(""),[T,se]=b(""),[_,ee]=b([]),[de,Re]=b(!1),oe=!!s;P(()=>{e?(re(!1),J(null),Ce()):(re(!1),J(null))},[e,s,o,i]);const Ce=async()=>{const[p,M]=await Promise.all([In(o),xs(o)]);if(f(p),S(s?M.filter(K=>K.id!==s.id):M),A(""),Ne(""),ye(""),se(""),s){a(s.title),u(s.status),c(s.epic_id||""),w([...s.depends_on]),L(s.comments?[...s.comments]:[]),Y(s.blocked_reason||""),ce(s.acceptance_criteria?[...s.acceptance_criteria]:[]),Q(s.guardrails?[...s.guardrails]:[]);const K=await il(s.id);ee(K)}else a(""),u("todo"),c(i||""),w([]),L([]),Y(""),ce([]),Q([]),ee([])},pe=async p=>{if(p.preventDefault(),!(!l.trim()||y)){$(!0);try{if(oe&&s)await kn(s.id,{title:l.trim(),status:d,epic_id:h||void 0,depends_on:g,blocked_reason:B.trim()||void 0,acceptance_criteria:me.length>0?me:void 0,guardrails:ae.length>0?ae:void 0});else{const M=await Vi(o,l.trim(),h||void 0),K={};g.length>0&&(K.depends_on=g),me.length>0&&(K.acceptance_criteria=me),ae.length>0&&(K.guardrails=ae),Object.keys(K).length>0&&await kn(M.id,K)}await n(),t()}finally{$(!1)}}},Fe=()=>{s&&!y&&re(!0)},Se=async()=>{if(!(!s||y)){$(!0);try{await qi(s.id),await n(),t()}finally{$(!1),re(!1)}}},lt=async()=>{if(!(!s||!k.trim()||E)){N(!0);try{const p=await Zi(s.id,k.trim(),"user");L(M=>[...M,p]),D(""),await n()}finally{N(!1)}}},x=async p=>{!s||E||J(p)},I=async()=>{if(!(!s||E||!U)){N(!0);try{await Yi(s.id,U)&&(L(M=>M.filter(K=>K.id!==U)),await n())}finally{N(!1),J(null)}}},F=p=>{w(M=>M.includes(p)?M.filter(K=>K!==p):[...M,p])},te=()=>{we.trim()&&(ce(p=>[...p,we.trim()]),Ne(""))},W=p=>{ce(M=>M.filter((K,tt)=>tt!==p))},ue=()=>{const p=Math.floor(parseInt(_e));isNaN(p)||p<=0||!T.trim()||(Q(M=>[...M,{id:crypto.randomUUID(),number:p,text:T.trim()}]),ye(""),se(""))},De=p=>{Q(M=>M.filter(K=>K.id!==p))},Ke=async p=>{var tt;const M=p.target,K=(tt=M.files)==null?void 0:tt[0];if(!(!K||!s||de)){Re(!0);try{const We=await ol(K,s.id);ee(Pt=>[...Pt,We]),await n()}finally{Re(!1),M.value=""}}},et=async p=>{await ll(p),ee(M=>M.filter(K=>K.id!==p)),await n()};return r(he,{children:[r(it,{isOpen:e,onClose:t,title:oe?"Edit Task":"New Task",boxClassName:"!w-[min(94vw,1120px)] !max-w-none",children:r("form",{onSubmit:pe,class:"space-y-5",children:[r("div",{class:"grid grid-cols-1 gap-5 lg:grid-cols-[minmax(0,0.92fr)_minmax(0,1.08fr)]",children:[r("section",{class:"space-y-4 rounded-lg border border-base-200 bg-base-200/30 p-4",children:[r("div",{children:[r("h4",{class:"text-sm font-semibold text-base-content",children:"Task details"}),r("p",{class:"mt-1 text-xs text-base-content/55",children:"Name the work, place it, and note anything holding it up."})]}),r("div",{class:"form-control mb-4",children:[r("label",{class:"label",children:r("span",{class:"label-text",children:"Title *"})}),r("input",{type:"text",placeholder:"Task title",class:"input input-bordered w-full",value:l,onInput:p=>a(p.target.value),required:!0})]}),oe&&r("div",{class:"form-control mb-4",children:[r("label",{class:"label",children:r("span",{class:"label-text",children:"Status"})}),r("select",{class:"select select-bordered w-full",value:d,onChange:p=>u(p.target.value),children:rt.map(p=>r("option",{value:p,children:ot[p].label},p))})]}),oe&&r("div",{class:"form-control mb-4",children:[r("label",{class:"label",children:[r("span",{class:"label-text",children:"Waiting on"}),B&&r("span",{class:"badge badge-warning badge-sm",children:"Waiting"})]}),r("input",{type:"text",placeholder:"e.g., Waiting for vendor quote",class:"input input-bordered w-full",value:B,onInput:p=>Y(p.target.value)}),r("p",{class:"mt-1 text-xs leading-5 text-base-content/55",children:"Add anything outside this task that is holding it up. Clear when ready."})]}),r("div",{class:"form-control mb-4",children:[r("label",{class:"label",children:r("span",{class:"label-text",children:"Workstream"})}),r("select",{class:"select select-bordered w-full",value:h,onChange:p=>c(p.target.value),children:[r("option",{value:"",children:"No workstream"}),v.map(p=>r("option",{value:p.id,children:p.title},p.id))]})]}),r("div",{class:"form-control mb-6",children:[r("label",{class:"label",children:[r("span",{class:"label-text",children:"Waiting on other tasks"}),g.length>0&&r("span",{class:"label-text-alt",children:[g.length," selected"]})]}),C.length===0?r("p",{class:"text-sm text-base-content/50",children:"No other tasks to wait on"}):r("div",{class:"border border-base-300 rounded-lg",children:[C.length>3&&r("div",{class:"px-3 py-2 border-b border-base-300",children:r("input",{type:"text",placeholder:"Find tasks...",class:"input input-bordered input-sm w-full",value:O,onInput:p=>A(p.target.value)})}),r("div",{class:"max-h-32 overflow-y-auto",children:C.filter(p=>!O||p.title.toLowerCase().includes(O.toLowerCase())).map(p=>{var M;return r("label",{class:"flex items-center gap-2 px-3 py-2 hover:bg-base-200 cursor-pointer",children:[r("input",{type:"checkbox",class:"checkbox checkbox-sm",checked:g.includes(p.id),onChange:()=>F(p.id)}),r("span",{class:"text-sm truncate flex-1",children:p.title}),r("span",{class:"badge badge-ghost badge-xs",children:((M=ot[p.status])==null?void 0:M.label)||p.status})]},p.id)})})]})]})]}),r("div",{class:"space-y-4",children:[r("section",{class:"space-y-4 rounded-lg border border-base-200 bg-base-200/30 p-4",children:[r("div",{children:[r("h4",{class:"text-sm font-semibold text-base-content",children:"Finish line"}),r("p",{class:"mt-1 text-xs text-base-content/55",children:"Capture what good looks like before the task is closed."})]}),r("div",{class:"form-control mb-4",children:[r("label",{class:"label",children:[r("span",{class:"label-text",children:"Done when"}),me.length>0&&r("span",{class:"label-text-alt",children:me.length})]}),r("p",{class:"text-xs text-base-content/50 mb-2",children:"Clear outcomes that prove this is finished"}),r("div",{class:"space-y-2",children:[me.map((p,M)=>r("div",{class:"flex items-start gap-2 border border-base-300 rounded-lg p-2",children:[r("span",{class:"text-sm flex-1",children:p}),r("button",{type:"button",class:"btn btn-ghost btn-xs",onClick:()=>W(M),children:"×"})]},M)),r("div",{class:"flex gap-2",children:[r("input",{type:"text",placeholder:"Add a done condition...",class:"input input-bordered input-sm flex-1",value:we,onInput:p=>Ne(p.target.value),onKeyDown:p=>p.key==="Enter"&&(p.preventDefault(),te())}),r("button",{type:"button",class:"btn btn-sm btn-outline",onClick:te,disabled:!we.trim(),children:"Add"})]})]})]}),r("div",{class:"form-control mb-4",children:[r("label",{class:"label",children:[r("span",{class:"label-text",children:"Rules"}),ae.length>0&&r("span",{class:"label-text-alt",children:ae.length})]}),r("p",{class:"text-xs text-base-content/50 mb-2",children:"Important constraints this work must follow"}),r("div",{class:"space-y-2",children:[[...ae].sort((p,M)=>M.number-p.number).map(p=>r("div",{class:"flex items-start gap-2 border border-base-300 rounded-lg p-2",children:[r("span",{class:"badge badge-outline badge-sm font-mono",children:p.number}),r("span",{class:"text-sm flex-1",children:p.text}),r("button",{type:"button",class:"btn btn-ghost btn-xs",onClick:()=>De(p.id),children:"×"})]},p.id)),r("div",{class:"flex gap-2",children:[r("input",{type:"number",placeholder:"999",class:"input input-bordered input-sm w-20",value:_e,onInput:p=>ye(p.target.value)}),r("input",{type:"text",placeholder:"Rule to follow...",class:"input input-bordered input-sm flex-1",value:T,onInput:p=>se(p.target.value),onKeyDown:p=>p.key==="Enter"&&(p.preventDefault(),ue())}),r("button",{type:"button",class:"btn btn-sm btn-outline",onClick:ue,disabled:!_e||parseInt(_e)<=0||!T.trim(),children:"Add"})]})]})]})]}),oe&&r("section",{class:"rounded-lg border border-base-200 bg-base-200/30 p-4",children:r("div",{class:"form-control",children:[r("label",{class:"label",children:[r("span",{class:"label-text",children:"Attachments"}),_.length>0&&r("span",{class:"label-text-alt",children:_.length})]}),r("div",{class:"space-y-2",children:[_.map(p=>r("div",{class:"flex items-center gap-2 border border-base-300 rounded-lg p-2",children:[p.mime_type.startsWith("image/")?r("img",{src:vr(p.id),alt:p.filename,class:"w-10 h-10 object-cover rounded"}):r(xn,{className:"h-5 w-5 text-base-content/50 flex-shrink-0"}),r("div",{class:"flex-1 min-w-0",children:[r("a",{href:vr(p.id),target:"_blank",class:"text-sm font-medium truncate block hover:underline",children:p.filename}),r("span",{class:"text-xs text-base-content/50",children:al(p.size)})]}),r("button",{type:"button",class:"btn btn-ghost btn-xs",onClick:()=>et(p.id),children:"×"})]},p.id)),r("label",{class:"btn btn-sm btn-outline gap-2 cursor-pointer",children:[de?r("span",{class:"loading loading-spinner loading-xs"}):r(he,{children:[r(xn,{className:"h-4 w-4"}),"Attach file"]}),r("input",{type:"file",class:"hidden",onChange:Ke,disabled:de})]})]})]})}),oe&&r("section",{class:"rounded-lg border border-base-200 bg-base-200/30 p-4",children:r("div",{class:"form-control",children:[r("label",{class:"label",children:[r("span",{class:"label-text",children:"Comments"}),j.length>0&&r("span",{class:"label-text-alt",children:j.length})]}),r("div",{class:"space-y-3",children:[j.length>0?r("div",{class:"space-y-2",children:j.map(p=>r("div",{class:"border border-base-300 rounded-lg p-3 text-sm",children:[r("div",{class:"flex items-center justify-between gap-2 mb-2",children:[r("div",{class:"flex items-center gap-2",children:[r("span",{class:`badge badge-sm ${p.author==="mcp"?"badge-secondary":"badge-ghost"}`,children:p.author==="mcp"?"Agent":"User"}),p.agent_name&&r("span",{class:"badge badge-primary badge-xs",children:p.agent_name}),p.created_at&&r("span",{class:"text-xs text-base-content/50",children:new Date(p.created_at).toLocaleString()})]}),r("button",{type:"button",class:"btn btn-ghost btn-xs",onClick:()=>x(p.id),disabled:E,children:"Delete"})]}),r("p",{class:"text-sm whitespace-pre-wrap",children:p.body})]},p.id))}):r("p",{class:"text-sm text-base-content/50",children:"No comments yet"}),r("div",{class:"flex flex-col gap-2",children:[r("textarea",{placeholder:"Add a comment...",class:"textarea textarea-bordered w-full",value:k,onInput:p=>D(p.target.value),rows:2}),r("div",{class:"flex justify-end",children:r("button",{type:"button",class:"btn btn-sm btn-outline",onClick:lt,disabled:!k.trim()||E,children:E?r("span",{class:"loading loading-spinner loading-xs"}):"Add Comment"})})]})]})]})})]})]}),r("div",{class:"modal-action border-t border-base-200 pt-4",children:[oe&&r("button",{type:"button",class:"btn btn-ghost text-error",onClick:Fe,disabled:y,children:"Delete"}),r("button",{type:"button",class:"btn btn-ghost",onClick:t,children:"Cancel"}),r("button",{type:"submit",class:"btn btn-primary",disabled:!l.trim()||y,children:y?r("span",{class:"loading loading-spinner loading-sm"}):oe?"Save":"Create"})]})]})}),r(ft,{isOpen:le,title:"Delete Task?",description:"This action cannot be undone.",confirmLabel:"Delete",confirmClassName:"btn-error",onConfirm:Se,onClose:()=>{y||re(!1)},isLoading:y}),r(ft,{isOpen:!!U,title:"Delete Comment?",description:"This action cannot be undone.",confirmLabel:"Delete",confirmClassName:"btn-error",onConfirm:I,onClose:()=>{E||J(null)},isLoading:E})]})}function dl({isOpen:e,onClose:t,onSave:n,epic:s,projectId:o}){const[i,l]=b(""),[a,d]=b(""),[u,h]=b("todo"),[c,v]=b([]),[f,g]=b([]),[w,C]=b(!1),[S,y]=b(!1),$=!!s;P(()=>{e?O():y(!1)},[e,s,o]);const O=async()=>{const D=await In(o);g(s?D.filter(E=>E.id!==s.id):D),s?(l(s.title),d(s.notes),h(s.status),v([...s.depends_on])):(l(""),d(""),h("todo"),v([]))},A=async D=>{if(D.preventDefault(),!(!i.trim()||w)){C(!0);try{if($&&s)await yn(s.id,{title:i.trim(),notes:a.trim(),status:u,depends_on:c});else{const E=await zi(o,i.trim(),a.trim());c.length>0&&await yn(E.id,{depends_on:c})}await n(),t()}finally{C(!1)}}},j=()=>{s&&!w&&y(!0)},L=async()=>{if(!(!s||w)){C(!0);try{await Ki(s.id),await n(),t()}finally{C(!1),y(!1)}}},k=D=>{v(E=>E.includes(D)?E.filter(N=>N!==D):[...E,D])};return r(he,{children:[r(it,{isOpen:e,onClose:t,title:$?"Edit Workstream":"New Workstream",children:r("form",{onSubmit:A,class:"space-y-5",children:[r("section",{class:"space-y-4 rounded-lg border border-base-200 bg-base-200/30 p-4",children:[r("div",{children:[r("div",{class:"relative flex items-center gap-2",children:[r("h4",{class:"text-sm font-semibold text-base-content",children:"Workstream details"}),r("div",{class:"group inline-flex",children:[r("button",{type:"button",class:"btn btn-ghost btn-xs btn-circle text-base-content/55 hover:text-base-content focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary","aria-label":"A workstream groups related tasks toward one outcome. Tasks are the individual cards inside it.","aria-describedby":"workstream-help-tooltip",children:r(di,{className:"h-4 w-4","aria-hidden":"true"})}),r("span",{id:"workstream-help-tooltip",role:"tooltip",class:"pointer-events-none absolute left-0 top-full z-20 mt-2 hidden w-72 max-w-[calc(100vw-4rem)] rounded-lg border border-base-300 bg-base-100 px-3 py-2 text-xs font-normal leading-5 text-base-content shadow-xl group-hover:block group-focus-within:block",children:"A workstream is a larger lane or phase that groups related tasks toward one outcome. Tasks are the individual cards you move and complete inside a workstream."})]})]}),r("p",{class:"mt-1 text-xs text-base-content/55",children:"Group related tasks into a larger outcome, phase, or parallel area of work."})]}),r("div",{class:"form-control",children:[r("label",{class:"label",children:r("span",{class:"label-text",children:"Title *"})}),r("input",{type:"text",placeholder:"Workstream title",class:"input input-bordered w-full",value:i,onInput:D=>l(D.target.value),required:!0})]}),r("div",{class:"form-control",children:[r("label",{class:"label",children:r("span",{class:"label-text",children:"Notes"})}),r("textarea",{placeholder:"Optional notes...",class:"textarea textarea-bordered w-full",value:a,onInput:D=>d(D.target.value),rows:3})]}),r("div",{class:"form-control",children:[r("label",{class:"label",children:r("span",{class:"label-text",children:"Status"})}),r("select",{class:"select select-bordered w-full",value:u,onChange:D=>h(D.target.value),children:rt.map(D=>r("option",{value:D,children:ot[D].label},D))})]})]}),r("section",{class:"rounded-lg border border-base-200 bg-base-200/30 p-4",children:r("div",{class:"form-control",children:[r("label",{class:"label",children:[r("span",{class:"label-text",children:"Waiting on other workstreams"}),c.length>0&&r("span",{class:"label-text-alt",children:[c.length," selected"]})]}),f.length===0?r("p",{class:"text-sm text-base-content/50",children:"No other workstreams to wait on"}):r("div",{class:"max-h-40 overflow-y-auto rounded-lg border border-base-300",children:f.map(D=>{var E;return r("label",{class:"flex items-center gap-2 px-3 py-2 hover:bg-base-200 cursor-pointer",children:[r("input",{type:"checkbox",class:"checkbox checkbox-sm",checked:c.includes(D.id),onChange:()=>k(D.id)}),r("span",{class:"text-sm truncate flex-1",children:D.title}),r("span",{class:"badge badge-ghost badge-xs",children:((E=ot[D.status])==null?void 0:E.label)||D.status})]},D.id)})})]})}),r("div",{class:"modal-action border-t border-base-200 pt-4",children:[$&&r("button",{type:"button",class:"btn btn-error btn-outline",onClick:j,disabled:w,children:"Delete"}),r("button",{type:"button",class:"btn btn-ghost",onClick:t,children:"Cancel"}),r("button",{type:"submit",class:"btn btn-primary",disabled:!i.trim()||w,children:w?r("span",{class:"loading loading-spinner loading-sm"}):$?"Save":"Create"})]})]})}),r(ft,{isOpen:S,title:"Delete Workstream?",description:"Tasks in this workstream will move to No workstream.",confirmLabel:"Delete",confirmClassName:"btn-error",onConfirm:L,onClose:()=>{w||y(!1)},isLoading:w})]})}const Gt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function gt(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Fn(e){return"nodeType"in e}function ke(e){var t,n;return e?gt(e)?e:Fn(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Wn(e){const{Document:t}=ke(e);return e instanceof t}function jt(e){return gt(e)?!1:e instanceof ke(e).HTMLElement}function ws(e){return e instanceof ke(e).SVGElement}function mt(e){return e?gt(e)?e.document:Fn(e)?Wn(e)?e:jt(e)||ws(e)?e.ownerDocument:document:document:document}const Je=Gt?bt:P;function Bn(e){const t=q(e);return Je(()=>{t.current=e}),ie(function(){for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return t.current==null?void 0:t.current(...s)},[])}function ul(){const e=q(null),t=ie((s,o)=>{e.current=setInterval(s,o)},[]),n=ie(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function $t(e,t){t===void 0&&(t=[e]);const n=q(e);return Je(()=>{n.current!==e&&(n.current=e)},t),n}function Ot(e,t){const n=q();return G(()=>{const s=e(n.current);return n.current=s,s},[...t])}function Ut(e){const t=Bn(e),n=q(null),s=ie(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,s]}function Cn(e){const t=q();return P(()=>{t.current=e},[e]),t.current}let an={};function Xt(e,t){return G(()=>{if(t)return t;const n=an[e]==null?0:an[e]+1;return an[e]=n,e+"-"+n},[e,t])}function ys(e){return function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];return s.reduce((i,l)=>{const a=Object.entries(l);for(const[d,u]of a){const h=i[d];h!=null&&(i[d]=h+e*u)}return i},{...t})}}const ct=ys(1),zt=ys(-1);function hl(e){return"clientX"in e&&"clientY"in e}function ks(e){if(!e)return!1;const{KeyboardEvent:t}=ke(e.target);return t&&e instanceof t}function fl(e){if(!e)return!1;const{TouchEvent:t}=ke(e.target);return t&&e instanceof t}function Sn(e){if(fl(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return hl(e)?{x:e.clientX,y:e.clientY}:null}const Dn=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Dn.Translate.toString(e),Dn.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:s}=e;return t+" "+n+"ms "+s}}}),wr="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function pl(e){return e.matches(wr)?e:e.querySelector(wr)}const bl={display:"none"};function gl(e){let{id:t,value:n}=e;return Oe.createElement("div",{id:t,style:bl},n)}function ml(e){let{id:t,announcement:n,ariaLiveType:s="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Oe.createElement("div",{id:t,style:o,role:"status","aria-live":s,"aria-atomic":!0},n)}function vl(){const[e,t]=b("");return{announce:ie(s=>{s!=null&&t(s)},[]),announcement:e}}const Cs=Qe(null);function _l(e){const t=Xe(Cs);P(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function xl(){const[e]=b(()=>new Set),t=ie(s=>(e.add(s),()=>e.delete(s)),[e]);return[ie(s=>{let{type:o,event:i}=s;e.forEach(l=>{var a;return(a=l[o])==null?void 0:a.call(l,i)})},[e]),t]}const wl={draggable:`
|
|
2
|
+
To pick up a draggable item, press the space bar.
|
|
3
|
+
While dragging, use the arrow keys to move the item.
|
|
4
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
5
|
+
`},yl={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function kl(e){let{announcements:t=yl,container:n,hiddenTextDescribedById:s,screenReaderInstructions:o=wl}=e;const{announce:i,announcement:l}=vl(),a=Xt("DndLiveRegion"),[d,u]=b(!1);if(P(()=>{u(!0)},[]),_l(G(()=>({onDragStart(c){let{active:v}=c;i(t.onDragStart({active:v}))},onDragMove(c){let{active:v,over:f}=c;t.onDragMove&&i(t.onDragMove({active:v,over:f}))},onDragOver(c){let{active:v,over:f}=c;i(t.onDragOver({active:v,over:f}))},onDragEnd(c){let{active:v,over:f}=c;i(t.onDragEnd({active:v,over:f}))},onDragCancel(c){let{active:v,over:f}=c;i(t.onDragCancel({active:v,over:f}))}}),[i,t])),!d)return null;const h=Oe.createElement(Oe.Fragment,null,Oe.createElement(gl,{id:s,value:o.draggable}),Oe.createElement(ml,{id:a,announcement:l}));return n?ps(h,n):h}var fe;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(fe||(fe={}));function Kt(){}function Cl(e,t){return G(()=>({sensor:e,options:t??{}}),[e,t])}function Sl(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return G(()=>[...t].filter(s=>s!=null),[...t])}const Ie=Object.freeze({x:0,y:0});function Dl(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function El(e,t){let{data:{value:n}}=e,{data:{value:s}}=t;return n-s}function Tl(e,t){let{data:{value:n}}=e,{data:{value:s}}=t;return s-n}function $l(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function yr(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const Ll=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:s}=e;const o=yr(t,t.left,t.top),i=[];for(const l of s){const{id:a}=l,d=n.get(a);if(d){const u=Dl(yr(d),o);i.push({id:a,data:{droppableContainer:l,value:u}})}}return i.sort(El)};function Nl(e,t){const n=Math.max(t.top,e.top),s=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),l=o-s,a=i-n;if(s<o&&n<i){const d=t.width*t.height,u=e.width*e.height,h=l*a,c=h/(d+u-h);return Number(c.toFixed(4))}return 0}const Al=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:s}=e;const o=[];for(const i of s){const{id:l}=i,a=n.get(l);if(a){const d=Nl(a,t);d>0&&o.push({id:l,data:{droppableContainer:i,value:d}})}}return o.sort(Tl)};function jl(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Ss(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Ie}function Ol(e){return function(n){for(var s=arguments.length,o=new Array(s>1?s-1:0),i=1;i<s;i++)o[i-1]=arguments[i];return o.reduce((l,a)=>({...l,top:l.top+e*a.y,bottom:l.bottom+e*a.y,left:l.left+e*a.x,right:l.right+e*a.x}),{...n})}}const Rl=Ol(1);function Pl(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Ml(e,t,n){const s=Pl(t);if(!s)return e;const{scaleX:o,scaleY:i,x:l,y:a}=s,d=e.left-l-(1-o)*parseFloat(n),u=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),h=o?e.width/o:e.width,c=i?e.height/i:e.height;return{width:h,height:c,top:u,right:d+h,bottom:u+c,left:d}}const Il={ignoreTransform:!1};function Rt(e,t){t===void 0&&(t=Il);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:h}=ke(e).getComputedStyle(e);u&&(n=Ml(n,u,h))}const{top:s,left:o,width:i,height:l,bottom:a,right:d}=n;return{top:s,left:o,width:i,height:l,bottom:a,right:d}}function kr(e){return Rt(e,{ignoreTransform:!0})}function Fl(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Wl(e,t){return t===void 0&&(t=ke(e).getComputedStyle(e)),t.position==="fixed"}function Bl(e,t){t===void 0&&(t=ke(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const i=t[o];return typeof i=="string"?n.test(i):!1})}function Hn(e,t){const n=[];function s(o){if(t!=null&&n.length>=t||!o)return n;if(Wn(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!jt(o)||ws(o)||n.includes(o))return n;const i=ke(e).getComputedStyle(o);return o!==e&&Bl(o,i)&&n.push(o),Wl(o,i)?n:s(o.parentNode)}return e?s(e):n}function Ds(e){const[t]=Hn(e,1);return t??null}function cn(e){return!Gt||!e?null:gt(e)?e:Fn(e)?Wn(e)||e===mt(e).scrollingElement?window:jt(e)?e:null:null}function Es(e){return gt(e)?e.scrollX:e.scrollLeft}function Ts(e){return gt(e)?e.scrollY:e.scrollTop}function En(e){return{x:Es(e),y:Ts(e)}}var be;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(be||(be={}));function $s(e){return!Gt||!e?!1:e===document.scrollingElement}function Ls(e){const t={x:0,y:0},n=$s(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},s={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,l=e.scrollTop>=s.y,a=e.scrollLeft>=s.x;return{isTop:o,isLeft:i,isBottom:l,isRight:a,maxScroll:s,minScroll:t}}const Hl={x:.2,y:.2};function Ul(e,t,n,s,o){let{top:i,left:l,right:a,bottom:d}=n;s===void 0&&(s=10),o===void 0&&(o=Hl);const{isTop:u,isBottom:h,isLeft:c,isRight:v}=Ls(e),f={x:0,y:0},g={x:0,y:0},w={height:t.height*o.y,width:t.width*o.x};return!u&&i<=t.top+w.height?(f.y=be.Backward,g.y=s*Math.abs((t.top+w.height-i)/w.height)):!h&&d>=t.bottom-w.height&&(f.y=be.Forward,g.y=s*Math.abs((t.bottom-w.height-d)/w.height)),!v&&a>=t.right-w.width?(f.x=be.Forward,g.x=s*Math.abs((t.right-w.width-a)/w.width)):!c&&l<=t.left+w.width&&(f.x=be.Backward,g.x=s*Math.abs((t.left+w.width-l)/w.width)),{direction:f,speed:g}}function zl(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:l}=window;return{top:0,left:0,right:i,bottom:l,width:i,height:l}}const{top:t,left:n,right:s,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:s,bottom:o,width:e.clientWidth,height:e.clientHeight}}function Ns(e){return e.reduce((t,n)=>ct(t,En(n)),Ie)}function Kl(e){return e.reduce((t,n)=>t+Es(n),0)}function Vl(e){return e.reduce((t,n)=>t+Ts(n),0)}function ql(e,t){if(t===void 0&&(t=Rt),!e)return;const{top:n,left:s,bottom:o,right:i}=t(e);Ds(e)&&(o<=0||i<=0||n>=window.innerHeight||s>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Zl=[["x",["left","right"],Kl],["y",["top","bottom"],Vl]];class Un{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const s=Hn(n),o=Ns(s);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,l,a]of Zl)for(const d of l)Object.defineProperty(this,d,{get:()=>{const u=a(s),h=o[i]-u;return this.rect[d]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ct{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var s;return(s=this.target)==null?void 0:s.removeEventListener(...n)})},this.target=t}add(t,n,s){var o;(o=this.target)==null||o.addEventListener(t,n,s),this.listeners.push([t,n,s])}}function Yl(e){const{EventTarget:t}=ke(e);return e instanceof t?e:mt(e)}function dn(e,t){const n=Math.abs(e.x),s=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+s**2)>t:"x"in t&&"y"in t?n>t.x&&s>t.y:"x"in t?n>t.x:"y"in t?s>t.y:!1}var je;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(je||(je={}));function Cr(e){e.preventDefault()}function Gl(e){e.stopPropagation()}var V;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(V||(V={}));const As={start:[V.Space,V.Enter],cancel:[V.Esc],end:[V.Space,V.Enter,V.Tab]},Xl=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case V.Right:return{...n,x:n.x+25};case V.Left:return{...n,x:n.x-25};case V.Down:return{...n,y:n.y+25};case V.Up:return{...n,y:n.y-25}}};class js{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Ct(mt(n)),this.windowListeners=new Ct(ke(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(je.Resize,this.handleCancel),this.windowListeners.add(je.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(je.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,s=t.node.current;s&&ql(s),n(Ie)}handleKeyDown(t){if(ks(t)){const{active:n,context:s,options:o}=this.props,{keyboardCodes:i=As,coordinateGetter:l=Xl,scrollBehavior:a="smooth"}=o,{code:d}=t;if(i.end.includes(d)){this.handleEnd(t);return}if(i.cancel.includes(d)){this.handleCancel(t);return}const{collisionRect:u}=s.current,h=u?{x:u.left,y:u.top}:Ie;this.referenceCoordinates||(this.referenceCoordinates=h);const c=l(t,{active:n,context:s.current,currentCoordinates:h});if(c){const v=zt(c,h),f={x:0,y:0},{scrollableAncestors:g}=s.current;for(const w of g){const C=t.code,{isTop:S,isRight:y,isLeft:$,isBottom:O,maxScroll:A,minScroll:j}=Ls(w),L=zl(w),k={x:Math.min(C===V.Right?L.right-L.width/2:L.right,Math.max(C===V.Right?L.left:L.left+L.width/2,c.x)),y:Math.min(C===V.Down?L.bottom-L.height/2:L.bottom,Math.max(C===V.Down?L.top:L.top+L.height/2,c.y))},D=C===V.Right&&!y||C===V.Left&&!$,E=C===V.Down&&!O||C===V.Up&&!S;if(D&&k.x!==c.x){const N=w.scrollLeft+v.x,B=C===V.Right&&N<=A.x||C===V.Left&&N>=j.x;if(B&&!v.y){w.scrollTo({left:N,behavior:a});return}B?f.x=w.scrollLeft-N:f.x=C===V.Right?w.scrollLeft-A.x:w.scrollLeft-j.x,f.x&&w.scrollBy({left:-f.x,behavior:a});break}else if(E&&k.y!==c.y){const N=w.scrollTop+v.y,B=C===V.Down&&N<=A.y||C===V.Up&&N>=j.y;if(B&&!v.x){w.scrollTo({top:N,behavior:a});return}B?f.y=w.scrollTop-N:f.y=C===V.Down?w.scrollTop-A.y:w.scrollTop-j.y,f.y&&w.scrollBy({top:-f.y,behavior:a});break}}this.handleMove(t,ct(zt(c,this.referenceCoordinates),f))}}}handleMove(t,n){const{onMove:s}=this.props;t.preventDefault(),s(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}js.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:s=As,onActivation:o}=t,{active:i}=n;const{code:l}=e.nativeEvent;if(s.start.includes(l)){const a=i.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function Sr(e){return!!(e&&"distance"in e)}function Dr(e){return!!(e&&"delay"in e)}class zn{constructor(t,n,s){var o;s===void 0&&(s=Yl(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:i}=t,{target:l}=i;this.props=t,this.events=n,this.document=mt(l),this.documentListeners=new Ct(this.document),this.listeners=new Ct(s),this.windowListeners=new Ct(ke(l)),this.initialCoordinates=(o=Sn(i))!=null?o:Ie,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:s}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(je.Resize,this.handleCancel),this.windowListeners.add(je.DragStart,Cr),this.windowListeners.add(je.VisibilityChange,this.handleCancel),this.windowListeners.add(je.ContextMenu,Cr),this.documentListeners.add(je.Keydown,this.handleKeydown),n){if(s!=null&&s({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Dr(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Sr(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:s,onPending:o}=this.props;o(s,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(je.Click,Gl,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(je.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:s,initialCoordinates:o,props:i}=this,{onMove:l,options:{activationConstraint:a}}=i;if(!o)return;const d=(n=Sn(t))!=null?n:Ie,u=zt(o,d);if(!s&&a){if(Sr(a)){if(a.tolerance!=null&&dn(u,a.tolerance))return this.handleCancel();if(dn(u,a.distance))return this.handleStart()}if(Dr(a)&&dn(u,a.tolerance))return this.handleCancel();this.handlePending(a,u);return}t.cancelable&&t.preventDefault(),l(d)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===V.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Jl={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Kn extends zn{constructor(t){const{event:n}=t,s=mt(n.target);super(t,Jl,s)}}Kn.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:s}=t;return!n.isPrimary||n.button!==0?!1:(s==null||s({event:n}),!0)}}];const Ql={move:{name:"mousemove"},end:{name:"mouseup"}};var Tn;(function(e){e[e.RightClick=2]="RightClick"})(Tn||(Tn={}));class ea extends zn{constructor(t){super(t,Ql,mt(t.event.target))}}ea.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:s}=t;return n.button===Tn.RightClick?!1:(s==null||s({event:n}),!0)}}];const un={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class ta extends zn{constructor(t){super(t,un)}static setup(){return window.addEventListener(un.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(un.move.name,t)};function t(){}}}ta.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:s}=t;const{touches:o}=n;return o.length>1?!1:(s==null||s({event:n}),!0)}}];var St;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(St||(St={}));var Vt;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Vt||(Vt={}));function na(e){let{acceleration:t,activator:n=St.Pointer,canScroll:s,draggingRect:o,enabled:i,interval:l=5,order:a=Vt.TreeOrder,pointerCoordinates:d,scrollableAncestors:u,scrollableAncestorRects:h,delta:c,threshold:v}=e;const f=sa({delta:c,disabled:!i}),[g,w]=ul(),C=q({x:0,y:0}),S=q({x:0,y:0}),y=G(()=>{switch(n){case St.Pointer:return d?{top:d.y,bottom:d.y,left:d.x,right:d.x}:null;case St.DraggableRect:return o}},[n,o,d]),$=q(null),O=ie(()=>{const j=$.current;if(!j)return;const L=C.current.x*S.current.x,k=C.current.y*S.current.y;j.scrollBy(L,k)},[]),A=G(()=>a===Vt.TreeOrder?[...u].reverse():u,[a,u]);P(()=>{if(!i||!u.length||!y){w();return}for(const j of A){if((s==null?void 0:s(j))===!1)continue;const L=u.indexOf(j),k=h[L];if(!k)continue;const{direction:D,speed:E}=Ul(j,k,y,t,v);for(const N of["x","y"])f[N][D[N]]||(E[N]=0,D[N]=0);if(E.x>0||E.y>0){w(),$.current=j,g(O,l),C.current=E,S.current=D;return}}C.current={x:0,y:0},S.current={x:0,y:0},w()},[t,O,s,w,i,l,JSON.stringify(y),JSON.stringify(f),g,u,A,h,JSON.stringify(v)])}const ra={x:{[be.Backward]:!1,[be.Forward]:!1},y:{[be.Backward]:!1,[be.Forward]:!1}};function sa(e){let{delta:t,disabled:n}=e;const s=Cn(t);return Ot(o=>{if(n||!s||!o)return ra;const i={x:Math.sign(t.x-s.x),y:Math.sign(t.y-s.y)};return{x:{[be.Backward]:o.x[be.Backward]||i.x===-1,[be.Forward]:o.x[be.Forward]||i.x===1},y:{[be.Backward]:o.y[be.Backward]||i.y===-1,[be.Forward]:o.y[be.Forward]||i.y===1}}},[n,t,s])}function oa(e,t){const n=t!=null?e.get(t):void 0,s=n?n.node.current:null;return Ot(o=>{var i;return t==null?null:(i=s??o)!=null?i:null},[s,t])}function ia(e,t){return G(()=>e.reduce((n,s)=>{const{sensor:o}=s,i=o.activators.map(l=>({eventName:l.eventName,handler:t(l.handler,s)}));return[...n,...i]},[]),[e,t])}var Lt;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Lt||(Lt={}));var $n;(function(e){e.Optimized="optimized"})($n||($n={}));const Er=new Map;function la(e,t){let{dragging:n,dependencies:s,config:o}=t;const[i,l]=b(null),{frequency:a,measure:d,strategy:u}=o,h=q(e),c=C(),v=$t(c),f=ie(function(S){S===void 0&&(S=[]),!v.current&&l(y=>y===null?S:y.concat(S.filter($=>!y.includes($))))},[v]),g=q(null),w=Ot(S=>{if(c&&!n)return Er;if(!S||S===Er||h.current!==e||i!=null){const y=new Map;for(let $ of e){if(!$)continue;if(i&&i.length>0&&!i.includes($.id)&&$.rect.current){y.set($.id,$.rect.current);continue}const O=$.node.current,A=O?new Un(d(O),O):null;$.rect.current=A,A&&y.set($.id,A)}return y}return S},[e,i,n,c,d]);return P(()=>{h.current=e},[e]),P(()=>{c||f()},[n,c]),P(()=>{i&&i.length>0&&l(null)},[JSON.stringify(i)]),P(()=>{c||typeof a!="number"||g.current!==null||(g.current=setTimeout(()=>{f(),g.current=null},a))},[a,c,f,...s]),{droppableRects:w,measureDroppableContainers:f,measuringScheduled:i!=null};function C(){switch(u){case Lt.Always:return!1;case Lt.BeforeDragging:return n;default:return!n}}}function Os(e,t){return Ot(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function aa(e,t){return Os(e,t)}function ca(e){let{callback:t,disabled:n}=e;const s=Bn(t),o=G(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(s)},[s,n]);return P(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Jt(e){let{callback:t,disabled:n}=e;const s=Bn(t),o=G(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(s)},[n]);return P(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function da(e){return new Un(Rt(e),e)}function Tr(e,t,n){t===void 0&&(t=da);const[s,o]=b(null);function i(){o(d=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=d??n)!=null?u:null}const h=t(e);return JSON.stringify(d)===JSON.stringify(h)?d:h})}const l=ca({callback(d){if(e)for(const u of d){const{type:h,target:c}=u;if(h==="childList"&&c instanceof HTMLElement&&c.contains(e)){i();break}}}}),a=Jt({callback:i});return Je(()=>{i(),e?(a==null||a.observe(e),l==null||l.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),l==null||l.disconnect())},[e]),s}function ua(e){const t=Os(e);return Ss(e,t)}const $r=[];function ha(e){const t=q(e),n=Ot(s=>e?s&&s!==$r&&e&&t.current&&e.parentNode===t.current.parentNode?s:Hn(e):$r,[e]);return P(()=>{t.current=e},[e]),n}function fa(e){const[t,n]=b(null),s=q(e),o=ie(i=>{const l=cn(i.target);l&&n(a=>a?(a.set(l,En(l)),new Map(a)):null)},[]);return P(()=>{const i=s.current;if(e!==i){l(i);const a=e.map(d=>{const u=cn(d);return u?(u.addEventListener("scroll",o,{passive:!0}),[u,En(u)]):null}).filter(d=>d!=null);n(a.length?new Map(a):null),s.current=e}return()=>{l(e),l(i)};function l(a){a.forEach(d=>{const u=cn(d);u==null||u.removeEventListener("scroll",o)})}},[o,e]),G(()=>e.length?t?Array.from(t.values()).reduce((i,l)=>ct(i,l),Ie):Ns(e):Ie,[e,t])}function Lr(e,t){t===void 0&&(t=[]);const n=q(null);return P(()=>{n.current=null},t),P(()=>{const s=e!==Ie;s&&!n.current&&(n.current=e),!s&&n.current&&(n.current=null)},[e]),n.current?zt(e,n.current):Ie}function pa(e){P(()=>{if(!Gt)return;const t=e.map(n=>{let{sensor:s}=n;return s.setup==null?void 0:s.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function ba(e,t){return G(()=>e.reduce((n,s)=>{let{eventName:o,handler:i}=s;return n[o]=l=>{i(l,t)},n},{}),[e,t])}function Rs(e){return G(()=>e?Fl(e):null,[e])}const Nr=[];function ga(e,t){t===void 0&&(t=Rt);const[n]=e,s=Rs(n?ke(n):null),[o,i]=b(Nr);function l(){i(()=>e.length?e.map(d=>$s(d)?s:new Un(t(d),d)):Nr)}const a=Jt({callback:l});return Je(()=>{a==null||a.disconnect(),l(),e.forEach(d=>a==null?void 0:a.observe(d))},[e]),o}function ma(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return jt(t)?t:e}function va(e){let{measure:t}=e;const[n,s]=b(null),o=ie(u=>{for(const{target:h}of u)if(jt(h)){s(c=>{const v=t(h);return c?{...c,width:v.width,height:v.height}:v});break}},[t]),i=Jt({callback:o}),l=ie(u=>{const h=ma(u);i==null||i.disconnect(),h&&(i==null||i.observe(h)),s(h?t(h):null)},[t,i]),[a,d]=Ut(l);return G(()=>({nodeRef:a,rect:n,setRef:d}),[n,a,d])}const _a=[{sensor:Kn,options:{}},{sensor:js,options:{}}],xa={current:{}},Bt={draggable:{measure:kr},droppable:{measure:kr,strategy:Lt.WhileDragging,frequency:$n.Optimized},dragOverlay:{measure:Rt}};class Dt extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,s;return(n=(s=this.get(t))==null?void 0:s.node.current)!=null?n:void 0}}const wa={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Dt,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Kt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Bt,measureDroppableContainers:Kt,windowRect:null,measuringScheduled:!1},ya={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Kt,draggableNodes:new Map,over:null,measureDroppableContainers:Kt},Qt=Qe(ya),ka=Qe(wa);function Ca(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Dt}}}function Sa(e,t){switch(t.type){case fe.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case fe.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case fe.DragEnd:case fe.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case fe.RegisterDroppable:{const{element:n}=t,{id:s}=n,o=new Dt(e.droppable.containers);return o.set(s,n),{...e,droppable:{...e.droppable,containers:o}}}case fe.SetDroppableDisabled:{const{id:n,key:s,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||s!==i.key)return e;const l=new Dt(e.droppable.containers);return l.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:l}}}case fe.UnregisterDroppable:{const{id:n,key:s}=t,o=e.droppable.containers.get(n);if(!o||s!==o.key)return e;const i=new Dt(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Da(e){let{disabled:t}=e;const{active:n,activatorEvent:s,draggableNodes:o}=Xe(Qt),i=Cn(s),l=Cn(n==null?void 0:n.id);return P(()=>{if(!t&&!s&&i&&l!=null){if(!ks(i)||document.activeElement===i.target)return;const a=o.get(l);if(!a)return;const{activatorNode:d,node:u}=a;if(!d.current&&!u.current)return;requestAnimationFrame(()=>{for(const h of[d.current,u.current]){if(!h)continue;const c=pl(h);if(c){c.focus();break}}})}},[s,t,o,l,i]),null}function Ea(e,t){let{transform:n,...s}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...s}),n):n}function Ta(e){return G(()=>({draggable:{...Bt.draggable,...e==null?void 0:e.draggable},droppable:{...Bt.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Bt.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function $a(e){let{activeNode:t,measure:n,initialRect:s,config:o=!0}=e;const i=q(!1),{x:l,y:a}=typeof o=="boolean"?{x:o,y:o}:o;Je(()=>{if(!l&&!a||!t){i.current=!1;return}if(i.current||!s)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const h=n(u),c=Ss(h,s);if(l||(c.x=0),a||(c.y=0),i.current=!0,Math.abs(c.x)>0||Math.abs(c.y)>0){const v=Ds(u);v&&v.scrollBy({top:c.y,left:c.x})}},[t,l,a,s,n])}const Ps=Qe({...Ie,scaleX:1,scaleY:1});var Ye;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Ye||(Ye={}));const La=ds(function(t){var n,s,o,i;let{id:l,accessibility:a,autoScroll:d=!0,children:u,sensors:h=_a,collisionDetection:c=Al,measuring:v,modifiers:f,...g}=t;const w=qt(Sa,void 0,Ca),[C,S]=w,[y,$]=xl(),[O,A]=b(Ye.Uninitialized),j=O===Ye.Initialized,{draggable:{active:L,nodes:k,translate:D},droppable:{containers:E}}=C,N=L!=null?k.get(L):null,B=q({initial:null,translated:null}),Y=G(()=>{var xe;return L!=null?{id:L,data:(xe=N==null?void 0:N.data)!=null?xe:xa,rect:B}:null},[L,N]),le=q(null),[re,U]=b(null),[J,me]=b(null),ce=$t(g,Object.values(g)),we=Xt("DndDescribedBy",l),Ne=G(()=>E.getEnabled(),[E]),ae=Ta(v),{droppableRects:Q,measureDroppableContainers:_e,measuringScheduled:ye}=la(Ne,{dragging:j,dependencies:[D.x,D.y],config:ae.droppable}),T=oa(k,L),se=G(()=>J?Sn(J):null,[J]),_=qs(),ee=aa(T,ae.draggable.measure);$a({activeNode:L!=null?k.get(L):null,config:_.layoutShiftCompensation,initialRect:ee,measure:ae.draggable.measure});const de=Tr(T,ae.draggable.measure,ee),Re=Tr(T?T.parentElement:null),oe=q({activatorEvent:null,active:null,activeNode:T,collisionRect:null,collisions:null,droppableRects:Q,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:E,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ce=E.getNodeFor((n=oe.current.over)==null?void 0:n.id),pe=va({measure:ae.dragOverlay.measure}),Fe=(s=pe.nodeRef.current)!=null?s:T,Se=j?(o=pe.rect)!=null?o:de:null,lt=!!(pe.nodeRef.current&&pe.rect),x=ua(lt?null:de),I=Rs(Fe?ke(Fe):null),F=ha(j?Ce??T:null),te=ga(F),W=Ea(f,{transform:{x:D.x-x.x,y:D.y-x.y,scaleX:1,scaleY:1},activatorEvent:J,active:Y,activeNodeRect:de,containerNodeRect:Re,draggingNodeRect:Se,over:oe.current.over,overlayNodeRect:pe.rect,scrollableAncestors:F,scrollableAncestorRects:te,windowRect:I}),ue=se?ct(se,D):null,De=fa(F),Ke=Lr(De),et=Lr(De,[de]),p=ct(W,Ke),M=Se?Rl(Se,W):null,K=Y&&M?c({active:Y,collisionRect:M,droppableRects:Q,droppableContainers:Ne,pointerCoordinates:ue}):null,tt=$l(K,"id"),[We,Pt]=b(null),Hs=lt?W:ct(W,et),Us=jl(Hs,(i=We==null?void 0:We.rect)!=null?i:null,de),tn=q(null),Vn=ie((xe,Ee)=>{let{sensor:Te,options:Ve}=Ee;if(le.current==null)return;const Ae=k.get(le.current);if(!Ae)return;const $e=xe.nativeEvent,Be=new Te({active:le.current,activeNode:Ae,event:$e,options:Ve,context:oe,onAbort(ve){if(!k.get(ve))return;const{onDragAbort:He}=ce.current,ze={id:ve};He==null||He(ze),y({type:"onDragAbort",event:ze})},onPending(ve,qe,He,ze){if(!k.get(ve))return;const{onDragPending:_t}=ce.current,Ze={id:ve,constraint:qe,initialCoordinates:He,offset:ze};_t==null||_t(Ze),y({type:"onDragPending",event:Ze})},onStart(ve){const qe=le.current;if(qe==null)return;const He=k.get(qe);if(!He)return;const{onDragStart:ze}=ce.current,vt={activatorEvent:$e,active:{id:qe,data:He.data,rect:B}};yt(()=>{ze==null||ze(vt),A(Ye.Initializing),S({type:fe.DragStart,initialCoordinates:ve,active:qe}),y({type:"onDragStart",event:vt}),U(tn.current),me($e)})},onMove(ve){S({type:fe.DragMove,coordinates:ve})},onEnd:at(fe.DragEnd),onCancel:at(fe.DragCancel)});tn.current=Be;function at(ve){return async function(){const{active:He,collisions:ze,over:vt,scrollAdjustedTranslate:_t}=oe.current;let Ze=null;if(He&&_t){const{cancelDrop:xt}=ce.current;Ze={activatorEvent:$e,active:He,collisions:ze,delta:_t,over:vt},ve===fe.DragEnd&&typeof xt=="function"&&await Promise.resolve(xt(Ze))&&(ve=fe.DragCancel)}le.current=null,yt(()=>{S({type:ve}),A(Ye.Uninitialized),Pt(null),U(null),me(null),tn.current=null;const xt=ve===fe.DragEnd?"onDragEnd":"onDragCancel";if(Ze){const nn=ce.current[xt];nn==null||nn(Ze),y({type:xt,event:Ze})}})}}},[k]),zs=ie((xe,Ee)=>(Te,Ve)=>{const Ae=Te.nativeEvent,$e=k.get(Ve);if(le.current!==null||!$e||Ae.dndKit||Ae.defaultPrevented)return;const Be={active:$e};xe(Te,Ee.options,Be)===!0&&(Ae.dndKit={capturedBy:Ee.sensor},le.current=Ve,Vn(Te,Ee))},[k,Vn]),qn=ia(h,zs);pa(h),Je(()=>{de&&O===Ye.Initializing&&A(Ye.Initialized)},[de,O]),P(()=>{const{onDragMove:xe}=ce.current,{active:Ee,activatorEvent:Te,collisions:Ve,over:Ae}=oe.current;if(!Ee||!Te)return;const $e={active:Ee,activatorEvent:Te,collisions:Ve,delta:{x:p.x,y:p.y},over:Ae};yt(()=>{xe==null||xe($e),y({type:"onDragMove",event:$e})})},[p.x,p.y]),P(()=>{const{active:xe,activatorEvent:Ee,collisions:Te,droppableContainers:Ve,scrollAdjustedTranslate:Ae}=oe.current;if(!xe||le.current==null||!Ee||!Ae)return;const{onDragOver:$e}=ce.current,Be=Ve.get(tt),at=Be&&Be.rect.current?{id:Be.id,rect:Be.rect.current,data:Be.data,disabled:Be.disabled}:null,ve={active:xe,activatorEvent:Ee,collisions:Te,delta:{x:Ae.x,y:Ae.y},over:at};yt(()=>{Pt(at),$e==null||$e(ve),y({type:"onDragOver",event:ve})})},[tt]),Je(()=>{oe.current={activatorEvent:J,active:Y,activeNode:T,collisionRect:M,collisions:K,droppableRects:Q,draggableNodes:k,draggingNode:Fe,draggingNodeRect:Se,droppableContainers:E,over:We,scrollableAncestors:F,scrollAdjustedTranslate:p},B.current={initial:Se,translated:M}},[Y,T,K,M,k,Fe,Se,Q,E,We,F,p]),na({..._,delta:D,draggingRect:M,pointerCoordinates:ue,scrollableAncestors:F,scrollableAncestorRects:te});const Ks=G(()=>({active:Y,activeNode:T,activeNodeRect:de,activatorEvent:J,collisions:K,containerNodeRect:Re,dragOverlay:pe,draggableNodes:k,droppableContainers:E,droppableRects:Q,over:We,measureDroppableContainers:_e,scrollableAncestors:F,scrollableAncestorRects:te,measuringConfiguration:ae,measuringScheduled:ye,windowRect:I}),[Y,T,de,J,K,Re,pe,k,E,Q,We,_e,F,te,ae,ye,I]),Vs=G(()=>({activatorEvent:J,activators:qn,active:Y,activeNodeRect:de,ariaDescribedById:{draggable:we},dispatch:S,draggableNodes:k,over:We,measureDroppableContainers:_e}),[J,qn,Y,de,S,we,k,We,_e]);return Oe.createElement(Cs.Provider,{value:$},Oe.createElement(Qt.Provider,{value:Vs},Oe.createElement(ka.Provider,{value:Ks},Oe.createElement(Ps.Provider,{value:Us},u)),Oe.createElement(Da,{disabled:(a==null?void 0:a.restoreFocus)===!1})),Oe.createElement(kl,{...a,hiddenTextDescribedById:we}));function qs(){const xe=(re==null?void 0:re.autoScrollEnabled)===!1,Ee=typeof d=="object"?d.enabled===!1:d===!1,Te=j&&!xe&&!Ee;return typeof d=="object"?{...d,enabled:Te}:{enabled:Te}}}),Na=Qe(null),Ar="button",Aa="Draggable";function ja(e){let{id:t,data:n,disabled:s=!1,attributes:o}=e;const i=Xt(Aa),{activators:l,activatorEvent:a,active:d,activeNodeRect:u,ariaDescribedById:h,draggableNodes:c,over:v}=Xe(Qt),{role:f=Ar,roleDescription:g="draggable",tabIndex:w=0}=o??{},C=(d==null?void 0:d.id)===t,S=Xe(C?Ps:Na),[y,$]=Ut(),[O,A]=Ut(),j=ba(l,t),L=$t(n);Je(()=>(c.set(t,{id:t,key:i,node:y,activatorNode:O,data:L}),()=>{const D=c.get(t);D&&D.key===i&&c.delete(t)}),[c,t]);const k=G(()=>({role:f,tabIndex:w,"aria-disabled":s,"aria-pressed":C&&f===Ar?!0:void 0,"aria-roledescription":g,"aria-describedby":h.draggable}),[s,f,w,C,g,h.draggable]);return{active:d,activatorEvent:a,activeNodeRect:u,attributes:k,isDragging:C,listeners:s?void 0:j,node:y,over:v,setNodeRef:$,setActivatorNodeRef:A,transform:S}}const Oa="Droppable",Ra={timeout:25};function Pa(e){let{data:t,disabled:n=!1,id:s,resizeObserverConfig:o}=e;const i=Xt(Oa),{active:l,dispatch:a,over:d,measureDroppableContainers:u}=Xe(Qt),h=q({disabled:n}),c=q(!1),v=q(null),f=q(null),{disabled:g,updateMeasurementsFor:w,timeout:C}={...Ra,...o},S=$t(w??s),y=ie(()=>{if(!c.current){c.current=!0;return}f.current!=null&&clearTimeout(f.current),f.current=setTimeout(()=>{u(Array.isArray(S.current)?S.current:[S.current]),f.current=null},C)},[C]),$=Jt({callback:y,disabled:g||!l}),O=ie((k,D)=>{$&&(D&&($.unobserve(D),c.current=!1),k&&$.observe(k))},[$]),[A,j]=Ut(O),L=$t(t);return P(()=>{!$||!A.current||($.disconnect(),c.current=!1,$.observe(A.current))},[A,$]),P(()=>(a({type:fe.RegisterDroppable,element:{id:s,key:i,disabled:n,node:A,rect:v,data:L}}),()=>a({type:fe.UnregisterDroppable,key:i,id:s})),[s]),P(()=>{n!==h.current.disabled&&(a({type:fe.SetDroppableDisabled,id:s,key:i,disabled:n}),h.current.disabled=n)},[s,i,n,a]),{active:l,rect:v,isOver:(d==null?void 0:d.id)===s,node:A,over:d,setNodeRef:j}}function jr({task:e,epicColor:t="#9ca3af",epicTitle:n="No workstream",taskNumber:s,onClick:o,condensed:i=!1}){const{attributes:l,listeners:a,setNodeRef:d,transform:u,isDragging:h}=ja({id:e.id,data:{task:e}}),c={transform:Dn.Translate.toString(u),opacity:h?.5:1},v=()=>{!h&&o&&o()},f=(g=!1)=>r(he,{children:[e.acceptance_criteria&&e.acceptance_criteria.length>0&&r("div",{class:`flex items-center ${g?"gap-0.5 flex-shrink-0":"gap-1"} text-xs text-success/70`,title:"Done when",children:[r(ms,{className:"h-3.5 w-3.5"}),r("span",{children:e.acceptance_criteria.length})]}),e.guardrails&&e.guardrails.length>0&&r("div",{class:`flex items-center ${g?"gap-0.5 flex-shrink-0":"gap-1"} text-xs text-info/70`,title:"Rules",children:[r(ki,{className:"h-3.5 w-3.5"}),r("span",{children:e.guardrails.length})]}),e.blob_ids&&e.blob_ids.length>0&&r("div",{class:`flex items-center ${g?"gap-0.5 flex-shrink-0":"gap-1"} text-xs text-base-content/50`,title:"Attachments",children:[r(xn,{className:"h-3.5 w-3.5"}),r("span",{children:e.blob_ids.length})]})]});return i?r("div",{ref:d,style:c,class:`bg-base-100 rounded-lg shadow-sm px-3 py-2 cursor-grab hover:shadow-md transition-shadow active:cursor-grabbing touch-none ${e.blocked?"ring-2 ring-warning/50":""}`,onClick:v,...a,role:l.role,tabIndex:l.tabIndex,"aria-pressed":l["aria-pressed"],"aria-roledescription":l["aria-roledescription"],"aria-describedby":l["aria-describedby"],children:r("div",{class:"flex items-center gap-2",children:[r("span",{class:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:t}}),r("span",{class:"font-medium text-sm truncate flex-1",children:e.title}),e.blocked&&r("span",{class:"text-xs bg-warning/20 text-warning px-1.5 py-0.5 rounded font-medium flex-shrink-0",children:"Waiting"}),f(!0),e.status==="planning"&&r("progress",{class:"progress progress-secondary w-8 flex-shrink-0",value:0,max:100}),e.status==="todo"&&r("progress",{class:"progress w-8 flex-shrink-0",value:0,max:100}),e.status==="in_progress"&&r(he,{children:[r("progress",{class:"progress progress-warning w-8 flex-shrink-0"}),e.workers&&e.workers.length>0&&e.workers.map(g=>r("span",{class:"badge badge-primary badge-xs flex-shrink-0",children:g},g))]}),e.status==="done"&&r("progress",{class:"progress progress-success w-8 flex-shrink-0",value:100,max:100})]})}):r("div",{ref:d,style:c,class:`bg-base-100 rounded-lg shadow-sm p-4 cursor-grab hover:shadow-md transition-shadow active:cursor-grabbing touch-none ${e.blocked?"ring-2 ring-warning/50":""}`,onClick:v,...a,role:l.role,tabIndex:l.tabIndex,"aria-pressed":l["aria-pressed"],"aria-roledescription":l["aria-roledescription"],"aria-describedby":l["aria-describedby"],children:[r("div",{class:"flex items-center gap-1.5 mb-2",children:[r("span",{class:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:t}}),r("span",{class:"text-xs text-base-content/50 font-medium",children:n}),e.blocked&&r("span",{class:"ml-auto text-xs bg-warning/20 text-warning px-1.5 py-0.5 rounded font-medium",children:"Waiting"})]}),r("h4",{class:"font-semibold text-sm mb-1",children:e.title}),e.comments&&e.comments.length>0&&r("p",{class:"text-xs text-base-content/50 mb-3 line-clamp-2",children:e.comments[e.comments.length-1].body}),r("div",{class:"flex items-center justify-between mt-auto pt-2",children:[r("div",{class:"flex items-center gap-2",children:[e.status==="planning"&&r(he,{children:[r("progress",{class:"progress progress-secondary w-10",value:0,max:100}),r("span",{class:"badge badge-ghost badge-secondary badge-xs",children:"Planning"})]}),e.status==="todo"&&r(he,{children:[r("progress",{class:"progress w-10",value:0,max:100}),r("span",{class:"badge badge-ghost badge-xs",children:"To do"})]}),e.status==="in_progress"&&r(he,{children:[r("progress",{class:"progress progress-warning w-10"}),r("span",{class:"badge badge-ghost badge-warning badge-xs",children:"Agent working"}),e.workers&&e.workers.map(g=>r("span",{class:"badge badge-primary badge-xs",children:g},g))]}),e.status==="done"&&r(he,{children:[r("progress",{class:"progress progress-success w-10",value:100,max:100}),r("span",{class:"badge badge-ghost badge-success badge-xs",children:"Done"})]}),e.depends_on.length>0&&r("div",{class:`flex items-center gap-1 text-xs ${e.blocked?"text-warning":"text-base-content/40"}`,children:[r(Ho,{className:"h-3.5 w-3.5"}),r("span",{children:e.depends_on.length})]}),f()]}),s&&r("span",{class:"text-xs text-base-content/40",children:["#",s]})]})]})}function Or({id:e,children:t,isEmpty:n=!1}){const{isOver:s,setNodeRef:o}=Pa({id:e});return r("div",{ref:o,class:`rounded-xl p-3 min-h-32 transition-all ${s?"bg-primary/10 ring-2 ring-primary/50":n?"bg-base-200/50 border-2 border-dashed border-base-300":"bg-base-200/50"}`,children:n?r("div",{class:"h-full min-h-24 flex items-center justify-center",children:r("span",{class:"text-base-content/40 text-sm",children:"No tasks"})}):r("div",{class:"space-y-3",children:t})})}const Ms=Qe(null),Is="kenzo-theme";function Ma(){if(typeof window>"u")return"light";const e=localStorage.getItem(Is);return e==="light"||e==="dark"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Ia({children:e}){const[t,n]=b(Ma);P(()=>{document.documentElement.setAttribute("data-theme",t),localStorage.setItem(Is,t)},[t]);const s=()=>{n(o=>o==="light"?"dark":"light")};return r(Ms.Provider,{value:{theme:t,toggleTheme:s},children:e})}function Fa(){const e=Xe(Ms);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e}function en(){const{theme:e,toggleTheme:t}=Fa();return r("label",{class:"swap swap-rotate btn btn-ghost btn-circle",children:[r("input",{type:"checkbox",checked:e==="dark",onChange:t,class:"theme-controller","aria-label":"Toggle dark mode"}),r($i,{className:"swap-off h-5 w-5"}),r(pi,{className:"swap-on h-5 w-5"})]})}function Fs({compact:e=!1}){return r("span",{class:"flex items-center gap-2",children:[r("svg",{class:"h-8 w-8 shrink-0 drop-shadow-sm",viewBox:"0 0 64 64",role:"img","aria-label":`${Tt} logo`,children:[r("defs",{children:[r("linearGradient",{id:"kenzo-logo-surface",x1:"12",y1:"8",x2:"52",y2:"56",gradientUnits:"userSpaceOnUse",children:[r("stop",{"stop-color":"#111827"}),r("stop",{offset:"0.55","stop-color":"#0f172a"}),r("stop",{offset:"1","stop-color":"#020617"})]}),r("linearGradient",{id:"kenzo-logo-highlight",x1:"18",y1:"14",x2:"42",y2:"50",gradientUnits:"userSpaceOnUse",children:[r("stop",{"stop-color":"#ffffff"}),r("stop",{offset:"1","stop-color":"#dbeafe"})]})]}),r("rect",{width:"64",height:"64",rx:"14",fill:"url(#kenzo-logo-surface)"}),r("path",{d:"M18 16h8v18l17-18h10L36 34l18 14H42L26 35v13h-8V16z",fill:"url(#kenzo-logo-highlight)"})]}),!e&&r("span",{class:"text-xl font-bold",children:Tt})]})}const Wa=[{label:"Planning",title:"Turn rough intent into a scoped lane",tone:"badge-info"},{label:"Todo",title:"Pick the next ready move",tone:"badge-primary"},{label:"In progress",title:"Keep the active work visible",tone:"badge-warning"},{label:"Done",title:"Close the loop with proof",tone:"badge-success"}],Ba=[{icon:wi,title:"Boards stay close to the work",body:"Projects, workstreams, waiting items, and status move in the same surface your team already uses."},{icon:ri,title:"Agents get a real operating layer",body:"The command line and agent interface keep task context explicit instead of scattered through chat history."},{icon:Yo,title:"The next action is never buried",body:"Priority, dependencies, and live updates make the board useful during execution, not just planning."}];function Ha(e){const[t,n]=b([]),[s,o]=b(!0),[i,l]=b(!0);P(()=>{Yt().then(h=>{n(h),l(!0)}).catch(()=>{n([]),l(!1)}).finally(()=>o(!1))},[]);const a=G(()=>t.find(h=>h.stats.done<h.stats.total)??t[0],[t]),d=()=>{if(a){ge(`/board/${a.id}`);return}ge("/new")},u=a?`Open ${a.name} board`:"Create your first board";return r("main",{class:"min-h-screen bg-base-200 text-base-content",children:[r("header",{class:"navbar bg-base-100/95 shadow-lg",children:[r("div",{class:"flex-1 px-2",children:r(Fs,{})}),r("div",{class:"flex-none flex items-center gap-2",children:[r("button",{type:"button",class:"btn btn-ghost btn-sm",onClick:()=>ge("/projects"),children:"Projects"}),r(en,{})]})]}),r("section",{class:"px-4 py-8 sm:px-6 lg:px-8 lg:py-12",children:r("div",{class:"mx-auto grid max-w-6xl items-center gap-8 lg:grid-cols-[0.95fr_1.05fr]",children:[r("div",{class:"space-y-6",children:[r("div",{class:"inline-flex items-center gap-2 rounded-full border border-base-300 bg-base-100 px-3 py-1 text-sm text-base-content/70 shadow-sm",children:[r(Si,{className:"h-4 w-4 text-primary"}),"Kenzo, powered by the Flux engine"]}),r("div",{class:"space-y-4",children:[r("h1",{class:"max-w-3xl text-4xl font-black leading-[0.98] tracking-normal text-base-content sm:text-5xl lg:text-6xl",children:"Run the next move from one visible board."}),r("p",{class:"max-w-2xl text-base leading-7 text-base-content/70 sm:text-lg",children:[Tt," gives human operators and AI agents the same source of truth for priorities, blockers, handoffs, and finished work."]})]}),r("div",{class:"flex flex-col gap-3 sm:flex-row",children:[r("button",{type:"button",class:"btn btn-primary",onClick:d,disabled:s,children:[s?r("span",{class:"loading loading-spinner loading-sm"}):u,!s&&r(Ko,{className:"h-4 w-4"})]}),r("button",{type:"button",class:"btn btn-ghost",onClick:()=>ge("/projects"),children:"View all projects"})]}),!i&&r("div",{class:"alert alert-warning max-w-xl",children:r("span",{children:"The API is offline. Start the server, then refresh to open a live board."})})]}),r("div",{class:"relative min-h-[420px] overflow-hidden rounded-lg border border-base-300 bg-base-100 p-4 shadow-xl",children:[r("div",{class:"flex items-center justify-between border-b border-base-200 pb-3",children:[r("div",{children:[r("div",{class:"text-sm font-semibold",children:(a==null?void 0:a.name)??"Kenzo board"}),r("div",{class:"text-xs text-base-content/50",children:"Live execution rail"})]}),r("div",{class:"badge badge-outline",children:[t.length||1," project",(t.length||1)===1?"":"s"]})]}),r("div",{class:"mt-5 grid gap-3",children:Wa.map((h,c)=>r("div",{class:`group grid grid-cols-[96px_1fr_auto] items-center gap-3 rounded-lg border border-base-200 bg-base-200/60 p-3 transition-transform hover:-translate-y-0.5 ${c===2?"translate-x-3 border-primary/40 bg-primary/10":""}`,children:[r("span",{class:`badge badge-soft badge-sm ${h.tone}`,children:h.label}),r("span",{class:"text-sm font-medium",children:h.title}),c===3?r(ms,{className:"h-5 w-5 text-success"}):r("span",{class:"h-2 w-2 rounded-full bg-base-content/30 group-hover:bg-primary"})]},h.label))}),r("div",{class:"mt-5 grid grid-cols-3 gap-3 text-center",children:[r("div",{class:"rounded-lg border border-base-200 bg-base-100 p-3",children:[r("div",{class:"text-2xl font-black",children:(a==null?void 0:a.stats.total)??4}),r("div",{class:"text-xs text-base-content/50",children:"tasks tracked"})]}),r("div",{class:"rounded-lg border border-base-200 bg-base-100 p-3",children:[r("div",{class:"text-2xl font-black",children:(a==null?void 0:a.stats.done)??1}),r("div",{class:"text-xs text-base-content/50",children:"closed loops"})]}),r("div",{class:"rounded-lg border border-base-200 bg-base-100 p-3",children:[r("div",{class:"text-2xl font-black",children:a?a.stats.total-a.stats.done:3}),r("div",{class:"text-xs text-base-content/50",children:"next moves"})]})]}),r("div",{class:"absolute bottom-4 right-4 hidden max-w-[220px] rotate-[-2deg] rounded-lg border border-neutral bg-neutral p-3 text-neutral-content shadow-2xl sm:block",children:[r("div",{class:"text-xs uppercase text-neutral-content/60",children:"Agent note"}),r("div",{class:"mt-1 text-sm font-semibold",children:"Start from ready work. Finish with evidence."})]})]})]})}),r("section",{class:"px-4 pb-20 sm:px-6 lg:px-8",children:r("div",{class:"mx-auto grid max-w-6xl gap-4 md:grid-cols-3",children:Ba.map(h=>{const c=h.icon;return r("article",{class:"rounded-lg border border-base-300 bg-base-100 p-5 shadow-sm",children:[r(c,{className:"h-6 w-6 text-primary"}),r("h2",{class:"mt-4 text-lg font-bold",children:h.title}),r("p",{class:"mt-2 text-sm leading-6 text-base-content/65",children:h.body})]},h.title)})})})]})}function Ua(e){const[t,n]=b(""),[s,o]=b(""),[i,l]=b(!1);return r("div",{class:"min-h-screen bg-base-200 flex items-center justify-center",children:r("div",{class:"card w-96 bg-base-100 shadow-xl",children:r("div",{class:"card-body",children:[r("h2",{class:"card-title text-2xl mb-4",children:"Create Project"}),r("form",{onSubmit:async d=>{if(d.preventDefault(),!t.trim()||i)return;l(!0);const u=await Bi(t.trim(),s.trim()||void 0);ge(`/board/${u.id}`)},children:[r("div",{class:"form-control mb-4",children:[r("label",{class:"label",children:r("span",{class:"label-text",children:"Project Name *"})}),r("input",{type:"text",placeholder:"My Kanban Project",class:"input input-bordered w-full",value:t,onInput:d=>n(d.target.value),required:!0})]}),r("div",{class:"form-control mb-6",children:[r("label",{class:"label",children:r("span",{class:"label-text",children:"Description"})}),r("textarea",{placeholder:"Optional description...",class:"textarea textarea-bordered w-full",value:s,onInput:d=>o(d.target.value)})]}),r("div",{class:"card-actions justify-end",children:[r("button",{type:"button",class:"btn btn-ghost",onClick:()=>ge("/projects"),children:"Cancel"}),r("button",{type:"submit",class:"btn btn-primary",disabled:!t.trim()||i,children:i?r("span",{class:"loading loading-spinner loading-sm"}):"Create Project"})]})]})]})})})}function Ws(){const[e,t]=b([]),[n,s]=b([]),[o,i]=b(!0),[l,a]=b(!1),[d,u]=b(null),[h,c]=b(null),[v,f]=b([]),[g,w]=b(null),[C,S]=b(null),[y,$]=b(null),[O,A]=b(""),[j,L]=b(""),[k,D]=b([]),[E,N]=b(""),[B,Y]=b(""),[le,re]=b(!0);P(()=>{U()},[]);async function U(){i(!0);const[_,ee]=await Promise.all([Ji(),Yt()]);t(_),s(ee),i(!1)}function J(){u(null),A(""),L(""),D([]),N(""),Y(""),re(!0),a(!0)}function me(_){u(_),A(_.name),L(_.url),D([..._.events]),N(_.secret||""),Y(_.project_id||""),re(_.enabled),a(!0)}async function ce(_){_.preventDefault(),!(!O||!j||k.length===0)&&(d?await mr(d.id,{name:O,url:j,events:k,secret:E||void 0,project_id:B||void 0,enabled:le}):await Qi(O,j,k,{secret:E||void 0,project_id:B||void 0,enabled:le}),a(!1),U())}function we(_){S(_)}async function Ne(){if(!(!C||y)){$(C.id);try{await el(C.id),U()}finally{$(null),S(null)}}}async function ae(_){await mr(_.id,{enabled:!_.enabled}),U()}async function Q(_){w({webhookId:_.id,result:{loading:!0}});const ee=await tl(_.id);w({webhookId:_.id,result:ee})}async function _e(_){c(_);const ee=await nl(_,20);f(ee)}function ye(_){k.includes(_)?D(k.filter(ee=>ee!==_)):D([...k,_])}function T(){D([...xr])}function se(){D([])}return o?r("div",{class:"flex items-center justify-center py-12",children:r("span",{class:"loading loading-spinner loading-lg"})}):r("div",{children:[r("div",{class:"flex items-center justify-between mb-4",children:[r("div",{children:[r("h4",{class:"text-lg font-semibold",children:"Webhooks"}),r("p",{class:"text-sm text-base-content/60",children:"Send events to external services when changes happen."})]}),r("button",{class:"btn btn-primary btn-sm",onClick:J,children:"+ Add Webhook"})]}),e.length===0?r("div",{class:"card bg-base-100 shadow-sm border border-base-200",children:r("div",{class:"card-body text-center py-10",children:[r("h2",{class:"text-lg font-semibold mb-2",children:"No webhooks configured"}),r("p",{class:"text-base-content/60 mb-4",children:["Webhooks let you send notifications to external services when events occur in ",Tt,"."]}),r("button",{class:"btn btn-primary",onClick:J,children:"Create your first webhook"})]})}):r("div",{class:"space-y-4",children:e.map(_=>{var ee,de,Re,oe;return r("div",{class:"card bg-base-100 shadow-sm border border-base-200",children:r("div",{class:"card-body",children:[r("div",{class:"flex items-start justify-between",children:[r("div",{class:"flex-1",children:[r("div",{class:"flex items-center gap-3 mb-2",children:[r("h2",{class:"card-title text-lg",children:_.name}),r("span",{class:`badge ${_.enabled?"badge-success":"badge-ghost"}`,children:_.enabled?"Enabled":"Disabled"}),_.project_id&&r("span",{class:"badge badge-outline badge-sm",children:["Project: ",((ee=n.find(Ce=>Ce.id===_.project_id))==null?void 0:ee.name)||_.project_id]})]}),r("p",{class:"text-sm text-base-content/60 font-mono break-all mb-2",children:_.url}),r("div",{class:"flex flex-wrap gap-1 mb-2",children:_.events.map(Ce=>r("span",{class:"badge badge-sm badge-outline",children:ln[Ce]},Ce))}),r("p",{class:"text-xs text-base-content/40",children:["Created: ",new Date(_.created_at).toLocaleDateString(),_.secret&&" | Secret configured"]})]}),r("div",{class:"flex flex-col gap-2",children:[r("div",{class:"flex gap-1",children:[r("button",{class:"btn btn-ghost btn-xs",onClick:()=>me(_),title:"Edit",children:r(vs,{className:"h-4 w-4"})}),r("button",{class:"btn btn-ghost btn-xs",onClick:()=>ae(_),title:_.enabled?"Disable":"Enable",children:_.enabled?r(gi,{className:"h-4 w-4"}):r(Jo,{className:"h-4 w-4"})}),r("button",{class:"btn btn-ghost btn-xs text-error",onClick:()=>we(_),title:"Delete",children:r(Ni,{className:"h-4 w-4"})})]}),r("button",{class:"btn btn-outline btn-xs",onClick:()=>Q(_),disabled:(g==null?void 0:g.webhookId)===_.id&&((de=g==null?void 0:g.result)==null?void 0:de.loading),children:(g==null?void 0:g.webhookId)===_.id&&((Re=g==null?void 0:g.result)!=null&&Re.loading)?r("span",{class:"loading loading-spinner loading-xs"}):"Test"}),r("button",{class:"btn btn-outline btn-xs",onClick:()=>_e(_.id),children:"Deliveries"})]})]}),(g==null?void 0:g.webhookId)===_.id&&!((oe=g==null?void 0:g.result)!=null&&oe.loading)&&r("div",{class:`mt-3 p-3 rounded-lg ${g.result.success?"bg-success/10":"bg-error/10"}`,children:[r("div",{class:"flex items-center gap-2 mb-1",children:[g.result.success?r("span",{class:"text-success font-medium",children:"Test Successful"}):r("span",{class:"text-error font-medium",children:"Test Failed"}),g.result.status_code&&r("span",{class:"badge badge-sm",children:["HTTP ",g.result.status_code]}),r("button",{class:"btn btn-ghost btn-xs ml-auto",onClick:()=>w(null),children:r(_s,{className:"h-4 w-4"})})]}),g.result.error&&r("p",{class:"text-sm text-error",children:g.result.error}),g.result.response&&r("pre",{class:"text-xs mt-1 overflow-auto max-h-24",children:g.result.response})]})]})},_.id)})}),r(it,{isOpen:l,title:d?"Edit Webhook":"Create Webhook",onClose:()=>a(!1),children:r("form",{onSubmit:ce,class:"space-y-4",children:[r("div",{class:"form-control",children:[r("label",{class:"label",children:r("span",{class:"label-text",children:"Name"})}),r("input",{type:"text",class:"input input-bordered w-full",value:O,onInput:_=>A(_.target.value),placeholder:"My Webhook",required:!0})]}),r("div",{class:"form-control",children:[r("label",{class:"label",children:r("span",{class:"label-text",children:"URL"})}),r("input",{type:"url",class:"input input-bordered w-full font-mono text-sm",value:j,onInput:_=>L(_.target.value),placeholder:"https://example.com/webhook",required:!0})]}),r("div",{class:"form-control",children:[r("label",{class:"label",children:[r("span",{class:"label-text",children:"Events"}),r("span",{class:"label-text-alt",children:[r("button",{type:"button",class:"link link-primary text-xs",onClick:T,children:"Select All"})," | ",r("button",{type:"button",class:"link link-primary text-xs",onClick:se,children:"Clear"})]})]}),r("div",{class:"grid grid-cols-2 gap-2 p-3 border rounded-lg border-base-300 max-h-48 overflow-y-auto",children:xr.map(_=>r("label",{class:"flex items-center gap-2 cursor-pointer",children:[r("input",{type:"checkbox",class:"checkbox checkbox-sm",checked:k.includes(_),onChange:()=>ye(_)}),r("span",{class:"text-sm",children:ln[_]})]},_))}),k.length===0&&r("span",{class:"text-xs text-error mt-1",children:"Select at least one event"})]}),r("div",{class:"form-control",children:[r("label",{class:"label",children:[r("span",{class:"label-text",children:"Secret (optional)"}),r("span",{class:"label-text-alt",children:"For HMAC signature verification"})]}),r("input",{type:"text",class:"input input-bordered w-full font-mono text-sm",value:E,onInput:_=>N(_.target.value),placeholder:"your-secret-key"})]}),r("div",{class:"form-control",children:[r("label",{class:"label",children:[r("span",{class:"label-text",children:"Project Filter (optional)"}),r("span",{class:"label-text-alt",children:"Only trigger for this project"})]}),r("select",{class:"select select-bordered w-full",value:B,onChange:_=>Y(_.target.value),children:[r("option",{value:"",children:"All Projects"}),n.map(_=>r("option",{value:_.id,children:_.name},_.id))]})]}),r("div",{class:"form-control",children:r("label",{class:"label cursor-pointer justify-start gap-3",children:[r("input",{type:"checkbox",class:"toggle toggle-primary",checked:le,onChange:_=>re(_.target.checked)}),r("span",{class:"label-text",children:"Enabled"})]})}),r("div",{class:"flex justify-end gap-2 pt-4",children:[r("button",{type:"button",class:"btn btn-ghost",onClick:()=>a(!1),children:"Cancel"}),r("button",{type:"submit",class:"btn btn-primary",disabled:k.length===0,children:d?"Save Changes":"Create Webhook"})]})]})}),r(it,{isOpen:!!h,title:"Recent Deliveries",onClose:()=>c(null),children:v.length===0?r("p",{class:"text-center py-8 text-base-content/60",children:"No deliveries yet"}):r("div",{class:"space-y-3 max-h-96 overflow-y-auto",children:v.map(_=>r("div",{class:`p-3 rounded-lg border ${_.status==="success"?"border-success/30 bg-success/5":_.status==="failed"?"border-error/30 bg-error/5":"border-warning/30 bg-warning/5"}`,children:[r("div",{class:"flex items-center justify-between mb-1",children:[r("span",{class:"badge badge-sm",children:ln[_.event]}),r("span",{class:`badge badge-sm ${_.status==="success"?"badge-success":_.status==="failed"?"badge-error":"badge-warning"}`,children:_.status})]}),r("div",{class:"text-xs text-base-content/60",children:[r("span",{children:new Date(_.created_at).toLocaleString()}),_.response_code&&r("span",{children:[" | HTTP ",_.response_code]}),_.attempts>1&&r("span",{children:[" | ",_.attempts," attempts"]})]}),_.error&&r("p",{class:"text-xs text-error mt-1",children:_.error})]},_.id))})}),r(ft,{isOpen:!!C,title:"Delete Webhook?",description:C?`Delete webhook "${C.name}"? This action cannot be undone.`:void 0,confirmLabel:"Delete",confirmClassName:"btn-error",onConfirm:Ne,onClose:()=>{y||S(null)},isLoading:!!y})]})}function za(e){const[t,n]=b([]),[s,o]=b(!0),[i,l]=b(null),[a,d]=b(""),[u,h]=b(""),[c,v]=b(!1),[f,g]=b(!1),[w,C]=b("configuration"),[S,y]=b("unknown"),[$,O]=b("unknown"),[A,j]=b(!1),[L,k]=b(!1),[D,E]=b(!1),[N,B]=b(!1);P(()=>{Y()},[]),P(()=>{if(!f){O("unknown"),k(!1);return}O("unknown");const T=new EventSource(wn);let se=!1;const _=window.setTimeout(()=>{se||O("offline")},3e3),ee=()=>{se=!0,O("online")};return T.addEventListener("connected",ee),T.onerror=()=>{se||O("offline")},()=>{T.removeEventListener("connected",ee),T.close(),window.clearTimeout(_)}},[f]);const Y=async()=>{o(!0),y("unknown");try{const T=await Yt();n(T),y("online")}catch{n([]),y("offline")}finally{o(!1)}},le=T=>{l(T),d(T.name),h(T.description||"")},re=(T=!1)=>{c&&!T||(l(null),d(""),h(""))},U=()=>{C("configuration"),g(!0)},J=async()=>{if(!A){j(!0);try{await Xi(),await Y()}finally{j(!1),k(!1)}}},me=async T=>{if(T.preventDefault(),!i||!a.trim()||c)return;v(!0);let se=!1;try{await Hi(i.id,{name:a.trim(),description:u.trim()||void 0}),await Y(),se=!0}finally{v(!1),se&&re(!0)}},ce=()=>{i&&!c&&!N&&E(!0)},we=async()=>{if(!(!i||N)){B(!0);try{await Ui(i.id),await Y(),E(!1),re(!0)}finally{B(!1)}}},Ne=H,ae=wn,Q=T=>T==="online"?"Online":T==="offline"?"Offline":"Checking",_e=T=>T==="online"?"bg-success":T==="offline"?"bg-error":"bg-base-content/30",ye=[{id:"configuration",title:"Configuration",subtitle:"API endpoints and realtime status"},{id:"webhooks",title:"Webhooks",subtitle:"Outbound events and delivery history"},{id:"reset",title:"Reset",subtitle:"Wipe data and start fresh"}];return s?r("div",{class:"min-h-screen bg-base-200 flex items-center justify-center",children:r("span",{class:"loading loading-spinner loading-lg"})}):r("div",{class:"min-h-screen bg-base-200",children:[r("div",{class:"navbar bg-base-100 shadow-lg",children:[r("div",{class:"flex-1",children:r("button",{type:"button",class:"btn btn-ghost px-4",onClick:()=>ge("/"),children:r(Fs,{})})}),r("div",{class:"flex-none flex items-center gap-2",children:[r("button",{class:"btn btn-ghost btn-sm btn-circle",onClick:U,title:"Settings",children:r(ti,{className:"h-5 w-5"})}),r(en,{})]})]}),r("div",{class:"p-6",children:r("div",{class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[r("button",{type:"button",class:"card bg-base-100 shadow-md hover:shadow-lg transition-shadow border-2 border-dashed border-base-300 text-left",onClick:()=>ge("/new"),children:r("div",{class:"card-body items-center justify-center text-center",children:[r("div",{class:"text-4xl font-semibold",children:"+"}),r("div",{class:"text-lg font-semibold",children:"New Project"})]})}),t.map(T=>r("div",{class:"card bg-base-100 shadow-md hover:shadow-lg transition-shadow cursor-pointer",onClick:()=>ge(`/board/${T.id}`),children:r("div",{class:"card-body",children:[r("div",{class:"flex items-start justify-between gap-3",children:[r("h3",{class:"card-title",children:T.name}),r("button",{type:"button",class:"btn btn-ghost btn-sm btn-circle","aria-label":"Edit project",onClick:se=>{se.stopPropagation(),le(T)},children:r(vs,{className:"h-4 w-4","aria-hidden":"true"})})]}),T.description&&r("p",{class:"text-base-content/60 text-sm line-clamp-2",children:T.description}),r("div",{class:"mt-2",children:T.stats.total===0?r("span",{class:"badge badge-soft badge-sm",children:"No tasks"}):r("span",{class:`badge badge-soft badge-sm ${T.stats.done===T.stats.total?"badge-success":""}`,children:[T.stats.done," of ",T.stats.total," complete"]})})]})},T.id))]})}),r(it,{isOpen:f,onClose:()=>g(!1),title:"Settings",boxClassName:"!w-[80vw] !h-[80vh] !max-w-none !max-h-none overflow-y-auto",children:r("div",{class:"grid gap-4 lg:grid-cols-[240px_1fr]",children:[r("div",{class:"bg-base-200 rounded-box p-0",children:r("ul",{class:"menu",children:ye.map(T=>{const se=w===T.id;return r("li",{children:r("button",{type:"button",class:`rounded-none flex flex-col items-start gap-0.5 ${se?"bg-base-300 border-l-4 border-primary":""}`,onClick:()=>C(T.id),children:[r("span",{class:"font-medium",children:T.title}),r("span",{class:"text-xs text-base-content/60",children:T.subtitle})]})},T.id)})})}),r("div",{class:"bg-base-100 rounded-box border border-base-200 p-4 min-h-[360px]",children:[w==="configuration"&&r("div",{class:"space-y-4",children:[r("div",{children:[r("h4",{class:"text-lg font-semibold",children:"Configuration"}),r("p",{class:"text-sm text-base-content/60",children:["Read-only diagnostics for your ",Tt," instance."]})]}),r("div",{class:"space-y-3",children:[r("div",{class:"rounded-lg border border-base-200 p-3",children:[r("div",{class:"text-xs uppercase tracking-wide text-base-content/60",children:"API Location"}),r("div",{class:"mt-1 font-mono text-xs",children:Ne})]}),r("div",{class:"rounded-lg border border-base-200 p-3",children:[r("div",{class:"text-xs uppercase tracking-wide text-base-content/60",children:"Events Stream"}),r("div",{class:"mt-1 font-mono text-xs",children:ae})]})]}),r("div",{class:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r("div",{class:"flex items-center gap-3 rounded-lg border border-base-200 p-3",children:[r("span",{class:`h-2.5 w-2.5 rounded-full ${_e(S)}`}),r("div",{children:[r("div",{class:"text-sm font-medium",children:"Connection"}),r("div",{class:"text-xs text-base-content/60",children:Q(S)})]})]}),r("div",{class:"flex items-center gap-3 rounded-lg border border-base-200 p-3",children:[r("span",{class:`h-2.5 w-2.5 rounded-full ${_e($)}`}),r("div",{children:[r("div",{class:"text-sm font-medium",children:"Live updates"}),r("div",{class:"text-xs text-base-content/60",children:Q($)})]})]})]})]}),w==="webhooks"&&r("div",{class:"space-y-4",children:r(Ws,{})}),w==="reset"&&r("div",{class:"space-y-4",children:[r("div",{children:[r("h4",{class:"text-lg font-semibold",children:"Reset Database"}),r("p",{class:"text-sm text-base-content/60",children:"This will wipe all projects, tasks, workstreams, and webhooks."})]}),r("div",{class:"alert alert-warning",children:[r(oi,{className:"h-5 w-5"}),r("span",{children:"This action is permanent. You cannot undo a reset."})]}),r("button",{type:"button",class:"btn btn-error",onClick:()=>k(!0),disabled:A,children:A?r("span",{class:"loading loading-spinner loading-sm"}):"Reset Database"})]})]})]})}),r(it,{isOpen:!!i,onClose:re,title:"Edit Project",children:r("form",{onSubmit:me,children:[r("div",{class:"form-control mb-4",children:[r("label",{class:"label",children:r("span",{class:"label-text",children:"Project Name *"})}),r("input",{type:"text",class:"input input-bordered w-full",value:a,onInput:T=>d(T.target.value),required:!0})]}),r("div",{class:"form-control mb-6",children:[r("label",{class:"label",children:r("span",{class:"label-text",children:"Description"})}),r("textarea",{class:"textarea textarea-bordered w-full",rows:3,value:u,onInput:T=>h(T.target.value)})]}),r("div",{class:"modal-action",children:[r("button",{type:"button",class:"btn btn-error btn-outline",onClick:ce,disabled:c||N,children:"Delete"}),r("div",{class:"flex-1"}),r("button",{type:"button",class:"btn btn-ghost",onClick:()=>re(),children:"Cancel"}),r("button",{type:"submit",class:"btn btn-primary",disabled:!a.trim()||c,children:c?r("span",{class:"loading loading-spinner loading-sm"}):"Save"})]})]})}),r(ft,{isOpen:L,title:"Reset Database?",description:"This will wipe all projects, tasks, workstreams, and webhooks. This action cannot be undone.",confirmLabel:"Reset",confirmClassName:"btn-error",onConfirm:J,onClose:()=>{A||k(!1)},isLoading:A}),r(ft,{isOpen:D,title:"Delete Project?",description:"This will permanently delete the project and all its workstreams and tasks. This action cannot be undone.",confirmLabel:"Delete",confirmClassName:"btn-error",onConfirm:we,onClose:()=>{N||E(!1)},isLoading:N})]})}const Ka="flux-board-preferences";function Bs(e){return`${Ka}-${e}`}function Rr(e){if(typeof window>"u")return{viewMode:"normal",planningCollapsed:!1,collapsedEpics:[]};try{const t=localStorage.getItem(Bs(e));if(t){const n=JSON.parse(t);return{viewMode:n.viewMode==="condensed"?"condensed":"normal",planningCollapsed:!!n.planningCollapsed,collapsedEpics:Array.isArray(n.collapsedEpics)?n.collapsedEpics:[]}}}catch{}return{viewMode:"normal",planningCollapsed:!1,collapsedEpics:[]}}function Va(e){const[t,n]=b(()=>Rr(e));P(()=>{n(Rr(e))},[e]),P(()=>{typeof window>"u"||localStorage.setItem(Bs(e),JSON.stringify(t))},[e,t]);const s=ie(a=>{n(d=>({...d,viewMode:a}))},[]),o=ie(a=>{n(d=>({...d,planningCollapsed:a}))},[]),i=ie(a=>{n(d=>{const u=d.collapsedEpics.includes(a)?d.collapsedEpics.filter(h=>h!==a):[...d.collapsedEpics,a];return{...d,collapsedEpics:u}})},[]),l=ie(a=>t.collapsedEpics.includes(a),[t.collapsedEpics]);return{viewMode:t.viewMode,planningCollapsed:t.planningCollapsed,collapsedEpics:new Set(t.collapsedEpics),setViewMode:s,setPlanningCollapsed:o,toggleEpicCollapse:i,isEpicCollapsed:l}}const qa=(e,t)=>{const n=t.findIndex(s=>s.id===e);return _r[n%_r.length]};function Za({projectId:e}){const[t,n]=b([]),[s,o]=b([]),[i,l]=b(""),[a,d]=b(!0),[u,h]=b(!1),[c,v]=b(!1),[f,g]=b(void 0),[w,C]=b(void 0),[S,y]=b(void 0),[$,O]=b(""),[A,j]=b("all"),[L,k]=b("all"),[D,E]=b(!1),[N,B]=b(!0),[Y,le]=b(!0),{viewMode:re,planningCollapsed:U,collapsedEpics:J,setViewMode:me,setPlanningCollapsed:ce,toggleEpicCollapse:we}=Va(e??""),Ne=Sl(Cl(Kn,{activationConstraint:{distance:8}}));P(()=>{if(!e){ge("/");return}ae()},[e]),P(()=>{if(!e)return;let x=null,I=null,F=null,te=!0;const W=()=>{I&&window.clearTimeout(I),I=window.setTimeout(()=>{Q()},100)},ue=()=>{te&&(x=new EventSource(wn),x.addEventListener("data-changed",W),x.addEventListener("connected",()=>{W()}),x.onerror=()=>{x==null||x.close(),te&&(F=window.setTimeout(ue,2e3))})};return ue(),()=>{te=!1,I&&window.clearTimeout(I),F&&window.clearTimeout(F),x==null||x.close()}},[e]);const ae=async()=>{if(!e)return;d(!0);const x=await Wi(e);if(!x){ge("/");return}l(x.name),await Q(),d(!1)},Q=async()=>{if(!e)return;const[x,I]=await Promise.all([xs(e),In(e)]);n(x),o(I)},_e=async x=>{const{active:I,over:F}=x;if(!F)return;const te=I.id,W=F.id,[ue,De]=W.split(":"),Ke=De==="unassigned"?void 0:De,et=t.find(p=>p.id===te);et&&(et.status!==ue||et.epic_id!==Ke)&&(await kn(te,{status:ue,epic_id:Ke}),await Q())},ye=x=>{g(void 0),y(x),h(!0)},T=async(x,I)=>{const F=await yn(x.id,{auto:I});F&&o(te=>te.map(W=>W.id===x.id?F:W))},se=x=>{g(x),h(!0)},_=()=>{h(!1),g(void 0),y(void 0)},ee=()=>{C(void 0),v(!0)},de=()=>{v(!1),C(void 0)},Re=async()=>{e&&(await Gi(e,N,Y),E(!1),B(!0),le(!0),await Q())},oe=t.filter(x=>x.status==="done").length,Ce=x=>{var I;if($){const F=$.toLowerCase(),te=x.title.toLowerCase().includes(F),ue=(((I=x.comments)==null?void 0:I.map(De=>De.body).join(" "))||"").toLowerCase().includes(F);if(!te&&!ue)return!1}return!(L!=="all"&&x.status!==L)},pe=(x,I)=>t.filter(F=>F.epic_id===I&&F.status===x).filter(Ce),Fe=x=>t.filter(I=>I.epic_id===x).filter(Ce).length,Se=(x,I)=>`${x}:${I??"unassigned"}`,lt=t.filter(Ce).length;return a?r("div",{class:"min-h-screen bg-base-200 flex items-center justify-center",children:r("span",{class:"loading loading-spinner loading-lg text-primary"})}):r(La,{sensors:Ne,collisionDetection:Ll,onDragEnd:_e,children:r("div",{class:"min-h-screen bg-base-200",children:[r("div",{class:"navbar bg-base-100 shadow-lg mb-4",children:[r("div",{class:"flex-1 flex items-center",children:[r("button",{class:"btn btn-ghost btn-circle",onClick:()=>ge("/projects"),children:r(gs,{className:"h-5 w-5"})}),r("div",{class:"flex items-center gap-2 px-2",children:[r(Ei,{className:"h-6 w-6 text-primary"}),r("h1",{class:"text-xl font-bold",children:i}),r("span",{class:"text-base-content/50 text-lg ml-1",children:[lt," tasks"]})]})]}),r("div",{class:"flex gap-2",children:[r(en,{}),r("button",{class:"btn btn-primary btn-sm",onClick:()=>ye(),children:"New Task"}),r("button",{class:"btn btn-neutral btn-sm",onClick:ee,children:"New Workstream"})]})]}),r("div",{class:"px-6 pb-0",children:r("div",{class:"bg-base-100 rounded-xl p-4 shadow-sm mb-6",children:r("div",{class:"flex flex-wrap items-center gap-3",children:[r("div",{class:"relative min-w-56 flex-1 max-w-sm",children:[r(hi,{className:"h-5 w-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-base-content/40"}),r("input",{type:"text",placeholder:"Search tasks...",class:"input input-bordered w-full pl-10 text-sm",value:$,onInput:x=>O(x.target.value)})]}),r("select",{class:"select select-bordered text-sm font-medium",value:A,onChange:x=>j(x.target.value),children:[r("option",{value:"all",children:"All Workstreams"}),s.map(x=>r("option",{value:x.id,children:x.title},x.id)),r("option",{value:"unassigned",children:"No workstream"})]}),r("select",{class:"select select-bordered text-sm font-medium",value:L,onChange:x=>k(x.target.value),children:[r("option",{value:"all",children:"All Statuses"}),rt.map(x=>r("option",{value:x,children:ot[x].label},x))]}),($||A!=="all"||L!=="all")&&r("button",{class:"btn btn-ghost btn-sm",onClick:()=>{O(""),j("all"),k("all")},children:"Clear"}),r("div",{class:"flex-1"}),r("button",{class:"btn btn-ghost btn-sm",onClick:()=>E(!0),title:"Archive completed work",children:"Archive"}),r("div",{class:"join",children:[r("button",{class:`btn btn-sm join-item ${re==="normal"?"btn-primary":"btn-ghost"}`,onClick:()=>me("normal"),title:"Normal view",children:r(ji,{className:"h-4 w-4"})}),r("button",{class:`btn btn-sm join-item ${re==="condensed"?"btn-primary":"btn-ghost"}`,onClick:()=>me("condensed"),title:"Condensed view",children:r(qo,{className:"h-4 w-4"})})]}),r("button",{class:"btn btn-sm btn-ghost",onClick:()=>ce(!U),title:U?"Show Planning column":"Hide Planning column",children:[U?r(on,{className:"h-4 w-4"}):r(ai,{className:"h-4 w-4"}),r("span",{class:"ml-1 text-xs",children:"Show Planning"})]})]})})}),r("div",{class:"px-6 pb-6 space-y-4",children:[s.filter(x=>A==="all"||A===x.id).map(x=>{const I=J.has(x.id),F=qa(x.id,s),te=Fe(x.id);return r("div",{class:"bg-base-100 rounded-xl shadow-sm overflow-hidden",children:[r("div",{class:"p-4 flex items-center gap-3 cursor-pointer hover:bg-base-200 transition-colors",onClick:()=>we(x.id),children:[r(br,{className:`h-5 w-5 text-base-content/40 transition-transform ${I?"":"rotate-90"}`}),r("span",{class:"w-3 h-3 rounded-full flex-shrink-0",style:{backgroundColor:F}}),r("span",{class:"font-semibold",children:x.title}),r("span",{class:"text-base-content/40 text-sm bg-base-200 px-2 py-0.5 rounded",children:[te," task",te!==1?"s":""]}),r("div",{class:"ml-auto flex items-center gap-3",children:r("div",{class:"flex items-center gap-2",onClick:W=>W.stopPropagation(),children:r("label",{class:"flex items-center gap-2 text-xs text-base-content/60",children:[x.auto&&r("span",{class:"loading loading-infinity loading-xs text-warning"}),r("span",{children:"Auto"}),r("input",{type:"checkbox",class:"toggle toggle-xs",checked:x.auto,onChange:W=>T(x,W.target.checked)})]})})})]}),!I&&r("div",{class:"px-4 pb-4",children:r("div",{class:"flex gap-4",children:[U&&r("div",{class:"w-8 min-h-[100px] bg-base-200 rounded-lg flex items-center justify-center cursor-pointer hover:bg-base-300 transition-colors relative",onClick:()=>ce(!1),title:"Show Planning column",children:[r("div",{class:"absolute inset-0 flex items-center justify-center",children:r("span",{class:"text-xs font-medium text-base-content/60 whitespace-nowrap",style:{transform:"rotate(-90deg)"},children:["Planning (",pe("planning",x.id).length,")"]})}),r(on,{className:"h-4 w-4 text-base-content/40 absolute top-2"})]}),r("div",{class:"flex-1",children:[r("div",{class:`grid ${U?"grid-cols-3":"grid-cols-4"} gap-4 mb-3`,children:rt.filter(W=>!U||W!=="planning").map(W=>{const ue=ot[W],De=pe(W,x.id).length;return r("div",{class:"flex items-center gap-2",children:[r("span",{class:"w-2 h-2 rounded-full",style:{backgroundColor:ue.color}}),r("span",{class:"font-medium text-sm",children:ue.label}),r("span",{class:"text-base-content/40 text-sm",children:De}),W==="planning"&&r("button",{class:"ml-auto w-5 h-5 rounded flex items-center justify-center text-base-content/40 hover:text-base-content/70 hover:bg-base-200 transition-colors",onClick:Ke=>{Ke.stopPropagation(),ye(x.id)},title:"Add task to this workstream",children:r(gr,{className:"h-4 w-4"})})]},W)})}),r("div",{class:`grid ${U?"grid-cols-3":"grid-cols-4"} gap-4`,children:rt.filter(W=>!U||W!=="planning").map(W=>r(Or,{id:Se(W,x.id),isEmpty:pe(W,x.id).length===0,children:pe(W,x.id).map((ue,De)=>r(jr,{task:ue,epicColor:F,epicTitle:x.title,taskNumber:De+1,onClick:()=>se(ue),condensed:re==="condensed"},ue.id))},Se(W,x.id)))})]})]})})]},x.id)}),(A==="all"||A==="unassigned")&&r("div",{class:"bg-base-100 rounded-xl shadow-sm overflow-hidden",children:[r("div",{class:"p-4 flex items-center gap-3 cursor-pointer hover:bg-base-200 transition-colors",onClick:()=>we("unassigned"),children:[r(br,{className:`h-5 w-5 text-base-content/40 transition-transform ${J.has("unassigned")?"":"rotate-90"}`}),r("span",{class:"w-3 h-3 rounded-full bg-base-content/40 flex-shrink-0"}),r("span",{class:"font-semibold",children:"No workstream"}),r("span",{class:"text-base-content/40 text-sm bg-base-200 px-2 py-0.5 rounded",children:[Fe(void 0)," task",Fe(void 0)!==1?"s":""]})]}),!J.has("unassigned")&&r("div",{class:"px-4 pb-4",children:r("div",{class:"flex gap-4",children:[U&&r("div",{class:"w-8 min-h-[100px] bg-base-200 rounded-lg flex items-center justify-center cursor-pointer hover:bg-base-300 transition-colors relative",onClick:()=>ce(!1),title:"Show Planning column",children:[r("div",{class:"absolute inset-0 flex items-center justify-center",children:r("span",{class:"text-xs font-medium text-base-content/60 whitespace-nowrap",style:{transform:"rotate(-90deg)"},children:["Planning (",pe("planning",void 0).length,")"]})}),r(on,{className:"h-4 w-4 text-base-content/40 absolute top-2"})]}),r("div",{class:"flex-1",children:[r("div",{class:`grid ${U?"grid-cols-3":"grid-cols-4"} gap-4 mb-3`,children:rt.filter(x=>!U||x!=="planning").map(x=>{const I=ot[x],F=pe(x,void 0).length;return r("div",{class:"flex items-center gap-2",children:[r("span",{class:"w-2 h-2 rounded-full",style:{backgroundColor:I.color}}),r("span",{class:"font-medium text-sm",children:I.label}),r("span",{class:"text-base-content/40 text-sm",children:F}),x==="planning"&&r("button",{class:"ml-auto w-5 h-5 rounded flex items-center justify-center text-base-content/40 hover:text-base-content/70 hover:bg-base-200 transition-colors",onClick:te=>{te.stopPropagation(),ye(void 0)},title:"Add task without a workstream",children:r(gr,{className:"h-4 w-4"})})]},x)})}),r("div",{class:`grid ${U?"grid-cols-3":"grid-cols-4"} gap-4`,children:rt.filter(x=>!U||x!=="planning").map(x=>r(Or,{id:Se(x,void 0),isEmpty:pe(x,void 0).length===0,children:pe(x,void 0).map((I,F)=>r(jr,{task:I,epicColor:"#9ca3af",epicTitle:"No workstream",taskNumber:F+1,onClick:()=>se(I),condensed:re==="condensed"},I.id))},Se(x,void 0)))})]})]})})]})]}),r(cl,{isOpen:u,onClose:_,onSave:Q,task:f,projectId:e,defaultEpicId:S}),r(dl,{isOpen:c,onClose:de,onSave:Q,epic:w,projectId:e}),D&&r("div",{class:"modal modal-open",children:[r("div",{class:"modal-box max-h-[88vh] overflow-hidden rounded-lg border border-base-300 bg-base-100 p-0 shadow-2xl",children:[r("div",{class:"border-b border-base-200 px-6 py-4",children:[r("h3",{class:"text-lg font-semibold",children:"Archive completed work"}),r("p",{class:"mt-1 text-sm text-base-content/60",children:"Keep the active board focused without deleting useful history."})]}),r("div",{class:"space-y-3 px-6 py-5",children:[r("label",{class:"flex cursor-pointer items-center gap-3 rounded-lg border border-base-200 bg-base-200/30 p-3",children:[r("input",{type:"checkbox",class:"checkbox",checked:N,onChange:x=>B(x.target.checked)}),r("span",{class:"flex-1 text-sm font-medium",children:"Archive completed tasks"}),oe>0&&r("span",{class:"text-sm text-base-content/50",children:oe})]}),r("label",{class:"flex cursor-pointer items-center gap-3 rounded-lg border border-base-200 bg-base-200/30 p-3",children:[r("input",{type:"checkbox",class:"checkbox",checked:Y,onChange:x=>le(x.target.checked)}),r("span",{class:"text-sm font-medium",children:"Archive empty workstreams"})]})]}),r("div",{class:"modal-action border-t border-base-200 px-6 py-4",children:[r("button",{class:"btn btn-ghost",onClick:()=>{E(!1),B(!0),le(!0)},children:"Cancel"}),r("button",{class:"btn btn-primary",onClick:Re,disabled:!N&&!Y,children:"Archive"})]})]}),r("div",{class:"modal-backdrop bg-black/50",onClick:()=>{E(!1),B(!0),le(!0)}})]})]})})}function Ya(e){return r("div",{class:"min-h-screen bg-base-200",children:[r("div",{class:"navbar bg-base-100 shadow-lg",children:[r("div",{class:"flex-1",children:[r("button",{class:"btn btn-ghost btn-sm",onClick:()=>ge("/"),children:r(gs,{className:"h-5 w-5"})}),r("span",{class:"text-xl font-bold px-4",children:"Webhooks"})]}),r("div",{class:"flex-none flex items-center gap-2",children:r(en,{})})]}),r("div",{class:"p-6",children:r("div",{class:"max-w-4xl mx-auto",children:r(Ws,{})})})]})}function Ga({token:e}){const t=q(e),[n,s]=b(""),[o,i]=b("server"),[l,a]=b([]),[d,u]=b([]),[h,c]=b(!1),[v,f]=b(null),[g,w]=b(!1),[C,S]=b(!1),[y,$]=b(!0);P(()=>{e&&window.history.replaceState&&window.history.replaceState({},"","/auth")},[e]),P(()=>{O(),A()},[]);const O=async()=>{try{const k=await rl();S(k.authenticated)}catch{S(!1)}finally{$(!1)}},A=async()=>{try{const k=await Yt();u(k)}catch{}},j=async k=>{if(k.preventDefault(),!n.trim()||h)return;const D=t.current;if(!D){f("No auth token provided");return}c(!0),f(null);try{const E=o==="project"?l:void 0;(await sl(D,n.trim(),E)).success?w(!0):f("Failed to complete authentication")}catch(E){f(E.message||"Authentication failed")}finally{c(!1)}},L=k=>{k.preventDefault();const E=k.target.elements.namedItem("apiKey");E!=null&&E.value&&(Mi(E.value),S(!0),t.current?window.location.reload():ge("/"))};return y?r("div",{class:"min-h-screen bg-base-200 flex items-center justify-center",children:r("span",{class:"loading loading-spinner loading-lg"})}):!C&&t.current?r("div",{class:"min-h-screen bg-base-200 flex items-center justify-center",children:r("div",{class:"card w-96 bg-base-100 shadow-xl",children:r("div",{class:"card-body",children:[r("h2",{class:"card-title text-2xl mb-4",children:"Login Required"}),r("p",{class:"text-sm opacity-70 mb-4",children:"Enter your API key to authorize this CLI session."}),r("form",{onSubmit:L,children:[r("div",{class:"form-control mb-4",children:[r("label",{class:"label",children:r("span",{class:"label-text",children:"API Key"})}),r("input",{type:"password",name:"apiKey",placeholder:"flx_...",class:"input input-bordered w-full",required:!0})]}),r("button",{type:"submit",class:"btn btn-primary w-full",children:"Login"})]})]})})}):g?r("div",{class:"min-h-screen bg-base-200 flex items-center justify-center",children:r("div",{class:"card w-96 bg-base-100 shadow-xl",children:r("div",{class:"card-body text-center",children:[r("div",{class:"text-6xl mb-4",children:"✓"}),r("h2",{class:"card-title text-2xl justify-center mb-4",children:"Authorized!"}),r("p",{class:"opacity-70",children:"The CLI has been authorized. You can close this window."}),r("div",{class:"card-actions justify-center mt-4",children:r("button",{class:"btn btn-ghost",onClick:()=>ge("/"),children:"Go to Dashboard"})})]})})}):t.current?r("div",{class:"min-h-screen bg-base-200 flex items-center justify-center",children:r("div",{class:"card w-96 bg-base-100 shadow-xl",children:r("div",{class:"card-body",children:[r("h2",{class:"card-title text-2xl mb-4",children:"Authorize CLI"}),r("p",{class:"text-sm opacity-70 mb-4",children:["Create an API key for the ",Ri,"."]}),v&&r("div",{class:"alert alert-error mb-4",children:r("span",{children:v})}),r("form",{onSubmit:j,children:[r("div",{class:"form-control mb-4",children:[r("label",{class:"label",children:r("span",{class:"label-text",children:"Key Name *"})}),r("input",{type:"text",placeholder:"My CLI Key",class:"input input-bordered w-full",value:n,onInput:k=>s(k.target.value),required:!0})]}),r("div",{class:"form-control mb-4",children:[r("label",{class:"label",children:r("span",{class:"label-text",children:"Access Scope"})}),r("select",{class:"select select-bordered w-full",value:o,onChange:k=>i(k.target.value),children:[r("option",{value:"server",children:"Full Access (Server Key)"}),r("option",{value:"project",children:"Limited to Specific Projects"})]})]}),o==="project"&&r("div",{class:"form-control mb-4",children:[r("label",{class:"label",children:r("span",{class:"label-text",children:"Select Projects"})}),r("div",{class:"max-h-40 overflow-y-auto border rounded-lg p-2",children:d.length===0?r("p",{class:"text-sm opacity-50 p-2",children:"No projects available"}):d.map(k=>r("label",{class:"flex items-center gap-2 p-1 cursor-pointer hover:bg-base-200 rounded",children:[r("input",{type:"checkbox",class:"checkbox checkbox-sm",checked:l.includes(k.id),onChange:D=>{const E=D.target.checked;a(E?[...l,k.id]:l.filter(N=>N!==k.id))}}),r("span",{class:"text-sm",children:k.name})]},k.id))})]}),r("div",{class:"card-actions justify-end",children:[r("button",{type:"button",class:"btn btn-ghost",onClick:()=>window.close(),children:"Cancel"}),r("button",{type:"submit",class:"btn btn-primary",disabled:!n.trim()||h||o==="project"&&l.length===0,children:h?r("span",{class:"loading loading-spinner loading-sm"}):"Authorize"})]})]})]})})}):r("div",{class:"min-h-screen bg-base-200 flex items-center justify-center",children:r("div",{class:"card w-96 bg-base-100 shadow-xl",children:r("div",{class:"card-body",children:[r("h2",{class:"card-title text-2xl mb-4",children:"Login"}),C?r(he,{children:[r("p",{class:"text-sm opacity-70 mb-4",children:"You are logged in."}),r("div",{class:"card-actions justify-between",children:[r("button",{class:"btn btn-ghost",onClick:()=>ge("/"),children:"Go to Dashboard"}),r("button",{class:"btn btn-outline btn-error",onClick:()=>{Ii(),window.location.reload()},children:"Logout"})]})]}):r(he,{children:[r("p",{class:"text-sm opacity-70 mb-4",children:"Enter your API key to access the dashboard."}),r("form",{onSubmit:L,children:[r("div",{class:"form-control mb-4",children:r("input",{type:"password",name:"apiKey",placeholder:"flx_...",class:"input input-bordered w-full",required:!0})}),r("button",{type:"submit",class:"btn btn-primary w-full",children:"Login"})]}),r("div",{class:"divider",children:"OR"}),r("p",{class:"text-sm opacity-50 text-center",children:["Run ",r("code",{class:"bg-base-200 px-1 rounded",children:"flux auth"})," from CLI"]}),r("div",{class:"card-actions justify-center mt-2",children:r("button",{class:"btn btn-ghost btn-sm",onClick:()=>ge("/"),children:"Continue without login"})})]})]})})})}function Xa(){return r(Ia,{children:r(rs,{children:[r(Ha,{path:"/"}),r(za,{path:"/projects"}),r(Ua,{path:"/new"}),r(Za,{path:"/board/:projectId"}),r(Ya,{path:"/webhooks"}),r(Ga,{path:"/auth"})]})})}ut(r(Xa,{}),document.getElementById("app"));
|