@shumai-one/shumai 0.4.2 → 0.4.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/bin/{chunk-adekdctx.css → chunk-0ccg9ddn.css} +1 -1
- package/bin/chunk-0e4wawpq.js +2 -0
- package/bin/chunk-185qefn1.js +2 -0
- package/bin/chunk-1kw2mbqb.js +1 -0
- package/bin/chunk-1wm6ptdx.js +1 -0
- package/bin/chunk-1yacmegc.js +2 -0
- package/bin/chunk-2291ehh5.js +3 -0
- package/bin/chunk-2520aq8j.js +2 -0
- package/bin/chunk-29zdp63z.js +3 -0
- package/bin/chunk-2yxj593j.js +2 -0
- package/bin/chunk-32pcmaqm.js +3 -0
- package/bin/chunk-3a13dcs1.js +1 -0
- package/bin/chunk-3cyrcgm5.js +13 -0
- package/bin/chunk-3swpwb9v.js +1 -0
- package/bin/chunk-3wmcx2bv.js +2 -0
- package/bin/chunk-4r81ghg8.js +2 -0
- package/bin/chunk-4v5n0ayb.js +2 -0
- package/bin/chunk-5a8nt4me.js +1 -0
- package/bin/chunk-66hsjnw6.js +2 -0
- package/bin/chunk-6bhn1p8v.js +211 -0
- package/bin/chunk-6gg1ymer.js +2 -0
- package/bin/chunk-70c3xrgd.js +2 -0
- package/bin/chunk-7esm0hqb.js +2 -0
- package/bin/chunk-7fst8kdw.js +12 -0
- package/bin/chunk-83e12sjg.js +3 -0
- package/bin/chunk-87zxtf66.js +3 -0
- package/bin/chunk-8fmy5jtp.js +2 -0
- package/bin/chunk-8zqgaxvv.js +1 -0
- package/bin/chunk-9t1ne8xr.js +2 -0
- package/bin/chunk-a32vreya.js +2 -0
- package/bin/chunk-a3dmtt2j.js +1 -0
- package/bin/chunk-abt0azmv.js +2 -0
- package/bin/chunk-ag6p3mbf.js +2 -0
- package/bin/chunk-aqbrzx9z.js +1 -0
- package/bin/chunk-av1a8fqp.js +3 -0
- package/bin/chunk-awfwk64v.js +2 -0
- package/bin/chunk-b235azv4.js +45 -0
- package/bin/chunk-b9yrw9et.js +10 -0
- package/bin/chunk-bay038pj.js +2 -0
- package/bin/chunk-c007p0t8.js +299 -0
- package/bin/chunk-cak32x57.js +2 -0
- package/bin/chunk-ce8m4zeg.js +3 -0
- package/bin/chunk-ck8azecb.js +12 -0
- package/bin/chunk-cnxwmycy.js +6 -0
- package/bin/chunk-cqb415s6.js +5 -0
- package/bin/chunk-e2mvmq2m.js +1 -0
- package/bin/chunk-e7mqtkzn.js +2 -0
- package/bin/chunk-e99dv20z.js +3 -0
- package/bin/chunk-ea79xnn3.js +2 -0
- package/bin/chunk-ehc9adfz.js +2 -0
- package/bin/chunk-ejbvfj4r.js +1 -0
- package/bin/chunk-ekfem7kf.js +1 -0
- package/bin/chunk-etwkk0xh.js +1 -0
- package/bin/chunk-evrdd32b.js +2 -0
- package/bin/chunk-f15qyp41.js +1 -0
- package/bin/chunk-f3ehv01n.js +54 -0
- package/bin/chunk-fm6p03ad.js +2 -0
- package/bin/chunk-fxswt9hc.js +3 -0
- package/bin/chunk-fyha3r13.js +2 -0
- package/bin/chunk-g0vs7k2x.js +1 -0
- package/bin/chunk-g84z2w7v.js +16 -0
- package/bin/chunk-gk3eqd50.js +2 -0
- package/bin/chunk-h3tbf521.js +2 -0
- package/bin/chunk-h837fyed.js +2 -0
- package/bin/chunk-hfh0c082.js +2 -0
- package/bin/chunk-j20e0qsw.js +7 -0
- package/bin/chunk-j8fxp8ej.js +2 -0
- package/bin/chunk-jje8nj8h.js +3 -0
- package/bin/chunk-jy006gcv.js +7 -0
- package/bin/chunk-k7hss0bd.js +4 -0
- package/bin/chunk-m7m9d4fb.js +2 -0
- package/bin/chunk-n1jwdb0a.js +1 -0
- package/bin/chunk-p5gf1zdm.js +4 -0
- package/bin/chunk-pb1zf0vb.js +2 -0
- package/bin/chunk-pfgxggaj.js +11 -0
- package/bin/chunk-q16490pv.js +2 -0
- package/bin/chunk-q2bvyv39.js +8 -0
- package/bin/chunk-qf24e71w.js +2 -0
- package/bin/chunk-qh81zhg1.js +1 -0
- package/bin/chunk-qwp3kwbz.js +2 -0
- package/bin/chunk-qwqvt9v6.js +2 -0
- package/bin/chunk-qydeqgyj.js +5 -0
- package/bin/chunk-r7dty1tg.js +2 -0
- package/bin/chunk-rbj4fad9.js +32 -0
- package/bin/chunk-rhdxwebf.js +2 -0
- package/bin/chunk-rhh716z0.js +42 -0
- package/bin/chunk-rpywcvg1.js +3 -0
- package/bin/chunk-rza4ae5z.js +3 -0
- package/bin/chunk-sfx2588q.js +3 -0
- package/bin/chunk-sk4e6rb1.js +1 -0
- package/bin/chunk-t2n1dbgx.js +4 -0
- package/bin/chunk-tf28796q.js +2 -0
- package/bin/chunk-twdxayky.js +3 -0
- package/bin/chunk-v9b3w8q5.js +3 -0
- package/bin/chunk-v9w25rp2.js +2 -0
- package/bin/chunk-vgn5zcpv.js +3 -0
- package/bin/chunk-wfzqnpc1.js +3 -0
- package/bin/chunk-wry2hvrq.js +24 -0
- package/bin/chunk-x8f4defx.js +3 -0
- package/bin/chunk-xp59apdb.js +2 -0
- package/bin/chunk-xtf3c29c.css +1 -0
- package/bin/chunk-z3gkt8w1.js +3 -0
- package/bin/chunk-zehyn6vd.js +2 -0
- package/bin/chunk-zh6fqq44.js +1 -0
- package/bin/chunk-zmv8cg4s.js +8 -0
- package/bin/chunk-zqv0zhfb.js +3 -0
- package/bin/{pdf.worker.min-szxdj13d.mjs → pdf.worker.min-vf48er29.mjs} +14423 -13889
- package/bin/shumai-app.html +1 -1
- package/bin/shumai-app.js +626 -460
- package/package.json +18 -18
- package/prisma/migrations/20260904022457_add_agent_id_to_assets_and_audit_logs/migration.sql +17 -0
- package/prisma/migrations/20260906081230_default_denied_tools_delete_asset/migration.sql +15 -0
- package/prisma/schema.prisma +9 -0
- package/bin/chunk-07h4b77v.js +0 -2
- package/bin/chunk-0t4n4d5w.js +0 -4
- package/bin/chunk-1611z9jg.js +0 -2
- package/bin/chunk-1phqxp6z.js +0 -3
- package/bin/chunk-23hckrrz.js +0 -2
- package/bin/chunk-30z44j1g.js +0 -2
- package/bin/chunk-3j463k1g.js +0 -1
- package/bin/chunk-4181tdds.js +0 -14
- package/bin/chunk-480jtqng.js +0 -4
- package/bin/chunk-4c3g146q.js +0 -2
- package/bin/chunk-4ca0zt5e.js +0 -1
- package/bin/chunk-4d9bgmf2.js +0 -2
- package/bin/chunk-4ev56fss.js +0 -9
- package/bin/chunk-4gk52tjq.js +0 -45
- package/bin/chunk-4mdqkj4d.js +0 -1
- package/bin/chunk-4r91fggc.js +0 -2
- package/bin/chunk-50fb1x3w.js +0 -1
- package/bin/chunk-59gj1njz.js +0 -1
- package/bin/chunk-5pr0t7fb.js +0 -2
- package/bin/chunk-5vewxmz7.js +0 -3
- package/bin/chunk-62zx96pe.js +0 -2
- package/bin/chunk-63y0eb07.js +0 -2
- package/bin/chunk-6d5xrgfx.js +0 -2
- package/bin/chunk-6gbtz5bf.js +0 -67
- package/bin/chunk-6gjg5egq.js +0 -3
- package/bin/chunk-6m4jz9s1.js +0 -44
- package/bin/chunk-6s4x525w.js +0 -2
- package/bin/chunk-6w2wmvqs.js +0 -3
- package/bin/chunk-77d23vcn.js +0 -2
- package/bin/chunk-77m5p188.js +0 -2
- package/bin/chunk-7bvx087f.js +0 -1
- package/bin/chunk-7pfjfrjg.js +0 -5
- package/bin/chunk-7q10s127.js +0 -4
- package/bin/chunk-7thx8ctx.js +0 -3
- package/bin/chunk-8t4s91gh.js +0 -2
- package/bin/chunk-98ey5p2e.js +0 -3
- package/bin/chunk-9amndcyh.js +0 -6
- package/bin/chunk-9bk23g9x.js +0 -1
- package/bin/chunk-9mkcfy43.js +0 -1
- package/bin/chunk-9t3nsq5n.js +0 -2
- package/bin/chunk-9tjq99ds.js +0 -2
- package/bin/chunk-9wm9rwh1.js +0 -2
- package/bin/chunk-ab16fyg4.js +0 -4
- package/bin/chunk-arv0g2av.js +0 -1
- package/bin/chunk-aytj4zxg.js +0 -3
- package/bin/chunk-b1ypjqgp.js +0 -2
- package/bin/chunk-bdjv0ykq.js +0 -2
- package/bin/chunk-c1k86mfa.js +0 -10
- package/bin/chunk-caa96dgd.js +0 -2
- package/bin/chunk-ce4v2yjy.js +0 -1
- package/bin/chunk-cqh60y54.js +0 -3
- package/bin/chunk-cvq7zgw7.js +0 -1
- package/bin/chunk-d9mjbtp2.js +0 -2
- package/bin/chunk-dn7sbjws.js +0 -3
- package/bin/chunk-dxyq9h8n.js +0 -3
- package/bin/chunk-e3cabksx.js +0 -3
- package/bin/chunk-egcrbj94.js +0 -2
- package/bin/chunk-ev17v1mv.js +0 -2
- package/bin/chunk-evtpwg71.js +0 -2
- package/bin/chunk-f3e0nsv2.js +0 -2
- package/bin/chunk-f40gjqpq.js +0 -2
- package/bin/chunk-fe7822ak.js +0 -299
- package/bin/chunk-g8tkhw9j.js +0 -2
- package/bin/chunk-g9r0p4t8.js +0 -2
- package/bin/chunk-gbjyh9ms.js +0 -1
- package/bin/chunk-gtbsb39v.js +0 -3
- package/bin/chunk-gytz1q13.js +0 -13
- package/bin/chunk-h0fxysxs.js +0 -7
- package/bin/chunk-h8bdvsqt.js +0 -2
- package/bin/chunk-hag024w8.js +0 -2
- package/bin/chunk-hc6w5nw4.js +0 -7
- package/bin/chunk-j69dqc48.js +0 -2
- package/bin/chunk-jbtw1zym.js +0 -8
- package/bin/chunk-jc1vb7rj.js +0 -5
- package/bin/chunk-jdv78w9r.js +0 -2
- package/bin/chunk-jjs70y9v.js +0 -3
- package/bin/chunk-jmdar2gz.js +0 -2
- package/bin/chunk-jvwz10n4.js +0 -2
- package/bin/chunk-k47md1g4.js +0 -2
- package/bin/chunk-k4v0brcb.js +0 -2
- package/bin/chunk-k6n7c07e.js +0 -1
- package/bin/chunk-kk2cstsg.js +0 -2
- package/bin/chunk-knz4h56q.js +0 -12
- package/bin/chunk-kqqtt6bd.js +0 -3
- package/bin/chunk-kvyp1t4j.js +0 -7
- package/bin/chunk-kxskpgsq.js +0 -5
- package/bin/chunk-m6srbjcs.js +0 -2
- package/bin/chunk-mcc1scxs.js +0 -12
- package/bin/chunk-mq83a0kk.js +0 -2
- package/bin/chunk-mxm8g4q0.js +0 -1
- package/bin/chunk-nhpgdqq5.js +0 -2
- package/bin/chunk-nne496aa.js +0 -2
- package/bin/chunk-nqpb0r9h.js +0 -11
- package/bin/chunk-ns0zww9g.js +0 -2
- package/bin/chunk-ps4xfp23.js +0 -2
- package/bin/chunk-pz2ec6xt.js +0 -2
- package/bin/chunk-q163k309.js +0 -2
- package/bin/chunk-q1da61ps.js +0 -1
- package/bin/chunk-qrf0ady6.js +0 -68
- package/bin/chunk-qy28f25e.js +0 -2
- package/bin/chunk-r7s4ypw1.js +0 -2
- package/bin/chunk-ran23vm9.js +0 -1
- package/bin/chunk-rfvdc4n0.js +0 -2
- package/bin/chunk-rgthkvgx.js +0 -3
- package/bin/chunk-s39n3yw3.js +0 -2
- package/bin/chunk-s7wdd0g7.js +0 -8
- package/bin/chunk-s88ha5kx.js +0 -3
- package/bin/chunk-sf91bt9m.js +0 -2
- package/bin/chunk-sjwbjf9j.js +0 -2
- package/bin/chunk-t62076pv.js +0 -1
- package/bin/chunk-tbbwss3v.js +0 -3
- package/bin/chunk-tjcc7a6y.js +0 -24
- package/bin/chunk-tp6ab26e.js +0 -2
- package/bin/chunk-v2wxk9p5.js +0 -4
- package/bin/chunk-vbk6y4hk.js +0 -2
- package/bin/chunk-vfgfg5fk.js +0 -2
- package/bin/chunk-vm6c3xx9.js +0 -2
- package/bin/chunk-vsx96mt6.js +0 -3
- package/bin/chunk-wbyw1shz.js +0 -6
- package/bin/chunk-whh2vh50.css +0 -1
- package/bin/chunk-wjkcq65s.js +0 -2
- package/bin/chunk-wkefwkfp.js +0 -41
- package/bin/chunk-x7bsnk1e.js +0 -2
- package/bin/chunk-xbhw6bpz.js +0 -3
- package/bin/chunk-xg5yrcj5.js +0 -2
- package/bin/chunk-xg9xscqz.js +0 -1
- package/bin/chunk-xw2gpcsh.js +0 -3
- package/bin/chunk-ycq8ank7.js +0 -2
- package/bin/chunk-yp9hvkc5.js +0 -73
- package/bin/chunk-ytypyfkc.js +0 -65
- package/bin/chunk-z1kjmf60.js +0 -2
- package/bin/chunk-z36bx86r.js +0 -2
- package/bin/chunk-z7hdnecp.js +0 -3
- package/bin/chunk-zeby1cq7.js +0 -2
- package/bin/chunk-zs5e8z1w.js +0 -1
- package/bin/chunk-zxnyefg5.js +0 -2
- /package/bin/{chunk-24ke0th1.css → chunk-kegybs91.css} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
.pdf-text-layer{position:absolute;overflow:clip;text-align:initial;letter-spacing:normal;word-spacing:normal;transform-origin:0 0;caret-color:CanvasText;user-select:none;-webkit-user-select:none;-moz-user-select:none;z-index:10;--total-scale-factor:1;--scale-round-x:1px;--scale-round-y:1px;--min-font-size:1;--text-scale-factor:calc(var(--total-scale-factor)*var(--min-font-size));--min-font-size-inv:calc(1/var(--min-font-size));line-height:1;inset:0}.pdf-text-layer :-webkit-any(span,br){color:#0000;position:absolute;white-space:pre;cursor:text;transform-origin:0% 0%;-webkit-user-select:text;-moz-user-select:text;user-select:text}.pdf-text-layer :-moz-any(span,br){color:#0000;position:absolute;white-space:pre;cursor:text;transform-origin:0% 0%;-webkit-user-select:text;-moz-user-select:text;user-select:text}.pdf-text-layer :is(span,br){color:#0000;position:absolute;white-space:pre;cursor:text;transform-origin:0% 0%;-webkit-user-select:text;-moz-user-select:text;user-select:text}.pdf-text-layer br
|
|
1
|
+
.pdf-text-layer{position:absolute;overflow:clip;text-align:initial;letter-spacing:normal;word-spacing:normal;transform-origin:0 0;caret-color:CanvasText;user-select:none;-webkit-user-select:none;-moz-user-select:none;z-index:10;--total-scale-factor:1;--scale-round-x:1px;--scale-round-y:1px;--min-font-size:1;--text-scale-factor:calc(var(--total-scale-factor)*var(--min-font-size));--min-font-size-inv:calc(1/var(--min-font-size));line-height:1;inset:0}.pdf-text-layer :-webkit-any(span,br){color:#0000;position:absolute;white-space:pre;cursor:text;transform-origin:0% 0%;-webkit-user-select:text;-moz-user-select:text;user-select:text}.pdf-text-layer :-moz-any(span,br){color:#0000;position:absolute;white-space:pre;cursor:text;transform-origin:0% 0%;-webkit-user-select:text;-moz-user-select:text;user-select:text}.pdf-text-layer :is(span,br){color:#0000;position:absolute;white-space:pre;cursor:text;transform-origin:0% 0%;-webkit-user-select:text;-moz-user-select:text;user-select:text}.pdf-text-layer br::selection{background:0 0}.pdf-text-layer>:not(.markedContent),.pdf-text-layer .markedContent span:not(.markedContent){z-index:1;--font-height:0;font-size:calc(var(--text-scale-factor)*var(--font-height));--scale-x:1;--rotate:0deg;transform:rotate(var(--rotate))scaleX(var(--scale-x))scale(var(--min-font-size-inv))}.pdf-text-layer .markedContent{display:contents}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Qe}from"./chunk-wry2hvrq.js";import{nr}from"./chunk-sfx2588q.js";import"./chunk-qydeqgyj.js";import{vs}from"./chunk-vgn5zcpv.js";import{ws,xs}from"./chunk-twdxayky.js";import{Ua,za,Fa}from"./chunk-ck8azecb.js";import{Go}from"./chunk-z3gkt8w1.js";import{$o}from"./chunk-jje8nj8h.js";import{cn,un}from"./chunk-87zxtf66.js";import{zn,xr}from"./chunk-zqv0zhfb.js";import{Xr}from"./chunk-29zdp63z.js";import{Ur}from"./chunk-2291ehh5.js";import{Vt}from"./chunk-x8f4defx.js";var O=new Set(["openai","openai-codex","opencode"]),E=16;function h(e,o){if(!e)return!1;let r=o.toLowerCase();for(let[t,s]of Object.entries(e))if(t.toLowerCase()===r&&s!==null&&s.trim().length>0)return!0;return!1}function g(e,o,r){if(o)return o;if(h(r,"authorization")||h(r,"cf-aig-authorization"))return"unused";throw Error(`No API key for provider: ${e}`)}function I(e){return e.provider==="openrouter"||e.baseUrl.includes("openrouter.ai")?"openrouter":"openai"}function R(e,o){if(e)return e;if(nr("PI_CACHE_RETENTION",o)==="long")return"long";return"short"}function m(e){return{supportsDeveloperRole:e.compat?.supportsDeveloperRole??!0,sessionAffinityFormat:e.compat?.sessionAffinityFormat??I(e),supportsLongCacheRetention:e.compat?.supportsLongCacheRetention??!0,supportsStrictMode:e.compat?.supportsStrictMode??!1,supportsOpenAIGrammarTools:e.compat?.supportsOpenAIGrammarTools??!1,supportsToolSearch:e.compat?.supportsToolSearch??!1,supportsExplicitPromptCacheMode:e.compat?.supportsExplicitPromptCacheMode??!1}}function P(e,o){return o==="long"&&e.supportsLongCacheRetention?"24h":void 0}function S(e){return un(cn(e),"OpenAI API error")}var C=(e,o,r)=>{let t=new Vt;return(async()=>{let s={role:"assistant",content:[],api:e.api,provider:e.provider,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{let i=g(e.provider,r?.apiKey,r?.headers),c=R(r?.cacheRetention,r?.env)==="none"?void 0:r?.sessionId,p=m(e),a=zn(o.tools,p.supportsOpenAIGrammarTools),u=w(e,o,i,r?.headers,c),f=M(e,o,r,p,a),l=await r?.onPayload?.(f,e);if(l!==void 0)f=l;let v={...r?.signal?{signal:r.signal}:{},...r?.timeoutMs!==void 0?{timeout:r.timeoutMs}:{},maxRetries:0},{data:y,response:d}=await $o(()=>u.responses.create(f,v).withResponse(),{maxRetries:r?.maxRetries,maxRetryDelayMs:r?.maxRetryDelayMs,signal:r?.signal});if(await r?.onResponse?.({status:d.status,headers:Xr(d.headers)},e),t.push({type:"start",partial:s}),await Fa(y,s,t,e,{serviceTier:r?.serviceTier,grammarToolInputProperties:a,applyServiceTierPricing:(T,A)=>b(T,A,e)}),r?.signal?.aborted)throw Error("Request was aborted");if(s.stopReason==="aborted"||s.stopReason==="error")throw Error("An unknown error occurred");t.push({type:"done",reason:s.stopReason,message:s}),t.end()}catch(i){for(let n of s.content)delete n.index,delete n.partialJson,delete n.customInput;s.stopReason=r?.signal?.aborted?"aborted":"error",s.errorMessage=S(i),t.push({type:"error",reason:s.stopReason,error:s}),t.end()}})(),t},z=(e,o,r)=>{g(e.provider,r?.apiKey,r?.headers);let t=xr(e,o,r,r?.apiKey),s=r?.reasoning?Ur(e,r.reasoning):void 0;return C(e,o,{...t,reasoningEffort:s==="off"?void 0:s})};function w(e,o,r,t,s){let i=m(e),n={...e.headers};if(e.provider==="github-copilot"){let c=ws(o.messages),p=xs({messages:o.messages,hasImages:c});Object.assign(n,p)}if(s)if(i.sessionAffinityFormat==="openrouter")n["x-session-id"]=s;else{if(i.sessionAffinityFormat==="openai")n.session_id=s;n["x-client-request-id"]=s}if(t)Object.assign(n,t);return new Qe({apiKey:r,baseURL:e.baseUrl,dangerouslyAllowBrowser:!0,defaultHeaders:n})}function M(e,o,r,t=m(e),s=zn(o.tools,t.supportsOpenAIGrammarTools)){let i=vs(o,t.supportsToolSearch),n=Ua(e,o,O,{grammarToolInputProperties:s,deferredTools:i.deferred,toolOptions:{supportsStrictMode:t.supportsStrictMode,supportsOpenAIGrammarTools:t.supportsOpenAIGrammarTools}}),c=R(r?.cacheRetention,r?.env),p=c==="none"&&t.supportsExplicitPromptCacheMode,a={model:e.id,input:n,stream:!0,prompt_cache_key:c==="none"?void 0:Go(r?.sessionId),prompt_cache_retention:P(t,c),prompt_cache_options:p?{mode:"explicit"}:void 0,store:!1};if(r?.maxTokens)a.max_output_tokens=Math.max(r.maxTokens,E);if(r?.temperature!==void 0)a.temperature=r?.temperature;if(r?.serviceTier!==void 0)a.service_tier=r.serviceTier;if(i.immediate.length>0)a.tools=za(i.immediate,{supportsStrictMode:t.supportsStrictMode,supportsOpenAIGrammarTools:t.supportsOpenAIGrammarTools});if(r?.toolChoice!==void 0)a.tool_choice=r.toolChoice;if(e.reasoning){if(r?.reasoningEffort||r?.reasoningSummary){let u=r?.reasoningEffort?e.thinkingLevelMap?.[r.reasoningEffort]??r.reasoningEffort:"medium";a.reasoning={effort:u,summary:r?.reasoningSummary||"auto"},a.include=["reasoning.encrypted_content"]}else if(e.provider!=="github-copilot"&&e.thinkingLevelMap?.off!==null)a.reasoning={effort:e.thinkingLevelMap?.off??"none"};if(e.provider==="xai")a.include=["reasoning.encrypted_content"]}return a}function _(e,o){switch(o){case"flex":return 0.5;case"priority":return e.id==="gpt-5.5"?2.5:2;default:return 1}}function b(e,o,r){let t=_(r,o);if(t===1)return;e.cost.input*=t,e.cost.output*=t,e.cost.cacheRead*=t,e.cost.cacheWrite*=t,e.cost.total=e.cost.input+e.cost.output+e.cost.cacheRead+e.cost.cacheWrite}export{C as stream,z as streamSimple};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{h,O,v,u,C,B,t,o,Q,L,U,ct,Me,A,E,qh,Hh,wC,Rt,Yo,Ir,nn,Dn,Sc,fr,Kr,Dr,Ht,pr,Co,Eo}from"./chunk-6bhn1p8v.js";import{Rr}from"./chunk-3wmcx2bv.js";import{os}from"./chunk-j20e0qsw.js";import{ns}from"./chunk-6gg1ymer.js";import{Qs,xl}from"./chunk-bay038pj.js";import{Sl}from"./chunk-q16490pv.js";import{is}from"./chunk-c007p0t8.js";import{br}from"./chunk-cqb415s6.js";C();function Ce(i,s,F,r,c,f){let T=i.type==="folder",g=s.type==="folder";if(T!==g)return null;let x=g?r:c,w=x.findIndex((a)=>a.id===F),S=x.findIndex((a)=>a.id===s.id);if(w===-1||S===-1)return null;let q=Math.min(w,S),K=Math.max(w,S),b=x.slice(q,K+1),l=new Set(f);return b.forEach((a)=>{if(a.id)l.add(a.id)}),l}function Zn({teamId:i,projectId:s,projectName:F,assetId:r,rootFolderId:c,collection:f,onUpdateCollection:T}){let g=Me(),x=Q(),{canEdit:w}=Rt(s),{setFields:S}=Rr(),q=A.api.files[":fileId"].metadata.$patch,{mutate:K}=U({mutationFn:async(e)=>{if(!(await q(e)).ok)throw Error("Failed to patch metadata");return null}}),{data:b}=L({queryKey:["fields",s],queryFn:async()=>{let e=await A.api.projects[":projectId"].fields.$get({param:{projectId:s}});if(!e.ok)throw Error("Failed to fetch fields");return await e.json()},enabled:!!s});h(()=>{if(b)S(b,s)},[b,s,S]);let l=r==="recently-deleted",a=r==="recents",[te,W]=u(null),[p,R]=u(new Set),[_,se]=u(null),[Pe,ke]=u(240),[Ne,Ae]=u(360),{isChatbotOpen:H}=pr(),{members:ze,fetchMembers:oe}=Dr(),{metadata:Le,fetchMetadata:ne,setMetadata:Re}=Eo();h(()=>{if(i)oe(i),ne(i)},[i,oe,ne]);let V=O(()=>f?.filter?.searchFilter?.conditions||[],[f]),[I,X]=u(V);h(()=>{X(V)},[V]);let ae=`project:${s}:sort`,P=Le[ae]||{field:"custom",order:"asc"},je=(e)=>{if(e)Re(i,ae,e)},m=!!f,j=I.length>0||m,{fileListLeftSidebarCollapsed:re,setFileListLeftSidebarCollapsed:De,fileListRightSidebarCollapsed:ie,setFileListRightSidebarCollapsed:$e,viewModes:Te}=Ht(),le=Te[s]??"card",qe=v(null),{data:k}=l||a?{data:void 0}:L({queryKey:["folders",r],queryFn:async()=>{let e=await A.api.folders[":folderId"].$get({param:{folderId:r}});if(!e.ok)throw Error("failed to fetch folder");return await e.json()}}),{setProjectState:de,clearProjectState:ce}=Kr();h(()=>(de({teamId:i,projectId:s,projectName:F,rootFolderId:c,ancestorFolders:k?.ancestorFolders??[],currentAsset:l?{name:qh(),type:"folder"}:a?{name:Hh(),type:"folder"}:m?{id:f.id,name:f.name,type:"folder"}:{id:k?.id||r,name:k?.name,type:"folder"},isRootFolder:!l&&!a&&!m&&r===c,onFolderClick:(e)=>{g({to:"/projects/$projectId/folders/$folderId",params:{projectId:s,folderId:e}})}}),()=>ce()),[i,s,F,k,l,a,r,c,de,ce,g]);let{data:G,fetchNextPage:fe,hasNextPage:pe,isFetchingNextPage:ue,isLoading:Ee}=ct({queryKey:l?["projects",s,"recently-deleted","folder"]:a?["projects",s,"recents","folder"]:["search",i,r,"folder",I,P,m],queryFn:async({pageParam:e})=>{if(l||m||a){if(l){let d=await A.api.projects[":projectId"]["recently-deleted"].$get({param:{projectId:s},query:{assetType:"folder",after:e}});if(!d.ok)throw Error("failed to fetch recently deleted folders");return await d.json()}return{data:[],pageInfo:{total:0}}}if(j)return{data:[],pageInfo:{total:0}};let n=await A.api.folders[":folderId"].search.$post({param:{folderId:r},json:{assetType:"folder",after:e,recursively:!1,sort:P,conditions:[]}});if(!n.ok)throw Error("failed to search folders");return await n.json()},enabled:!j&&!a,initialPageParam:"",getNextPageParam:(e)=>e.pageInfo?.cursor||void 0}),{data:J,fetchNextPage:ge,hasNextPage:me,isFetchingNextPage:he,isLoading:Ke}=ct({queryKey:l?["projects",s,"recently-deleted","file"]:a?["projects",s,"recents","file"]:["search",i,r,"file",I,P,m],queryFn:async({pageParam:e})=>{if(l){let d=await A.api.projects[":projectId"]["recently-deleted"].$get({param:{projectId:s},query:{assetType:"file",after:e}});if(!d.ok)throw Error("failed to fetch recently deleted files");return await d.json()}if(a){let d=await A.api.projects[":projectId"].recents.$get({param:{projectId:s},query:{after:e,first:"20"}});if(!d.ok)throw Error("failed to fetch recent files");return await d.json()}let n=await A.api.folders[":folderId"].search.$post({param:{folderId:r},json:{assetType:"file",after:e,recursively:j||m,conditions:I,sort:P}});if(!n.ok)throw Error("failed to search files");return await n.json()},initialPageParam:"",getNextPageParam:(e)=>e.pageInfo?.cursor||void 0}),N=G?.pages.flatMap((e)=>e.data??[])??[],y=J?.pages.flatMap((e)=>e.data??[])??[],ye=(!j&&!a?Ee:!1)||Ke,xe=G?.pages[0]?.pageInfo?.total,Se=J?.pages[0]?.pageInfo?.total,Fe=G?.pages[0]?.pageInfo?.totalSize,we=J?.pages[0]?.pageInfo?.totalSize,Y=()=>{R(new Set),W(null),se(null)},{dragState:M,handleDragStart:Qe,handleDragEnd:Oe}=xl({teamId:i,projectId:s,assetId:r,folders:N,files:y,selectedIds:p,onClearSelection:Y}),Z=O(()=>{if(p.size!==1)return null;let e=Array.from(p)[0];return y.find((d)=>d.id===e)||null},[p,y]),be=(e)=>{if(l)return;if(e.type==="folder")X([]),g({to:"/projects/$projectId/folders/$folderId",params:{projectId:s,folderId:e.id}});else g({to:"/projects/$projectId/files/$fileId",params:{projectId:s,fileId:e.versionStack?e.versionStack.id:e.id},search:{version:void 0}})},ve=(e,n)=>{let d=n.metaKey||n.ctrlKey;if(n.shiftKey&&_){let Ie=[...N,...y].find((D)=>D.id===_);if(Ie){let D=Ce(Ie,e,_,N,y,p);if(D){R(D),W(e);return}}}if(d){let z=new Set(p);if(z.has(e.id))z.delete(e.id);else z.add(e.id);R(z)}else R(new Set([e.id]));se(e.id),W(e)},ee=(e,n,d)=>{K({param:{fileId:e},json:[{key:n,value:d}]},{onSuccess:()=>{x.invalidateQueries({queryKey:["folders",r,"children",{assetType:"file"}]}),x.invalidateQueries({queryKey:["search",i,r]})}})};if(Co())return t(Sl,{teamId:i,projectId:s,assetId:r,folders:N,files:y,totalFolders:xe,totalFiles:Se,totalFoldersSize:Fe,totalFilesSize:we,selectedItem:te,selectedIds:p,onItemSelect:ve,onItemDoubleClick:be,onSaveField:ee,onClearSelection:Y,fetchNextFoldersPage:fe,hasNextFoldersPage:pe||!1,isFetchingNextFoldersPage:ue,fetchNextFilesPage:ge,hasNextFilesPage:me||!1,isFetchingNextFilesPage:he,isRecentlyDeleted:l,isRecents:a,isLoading:ye,rootFolderId:c});return o(Dn,{modifiers:[Qs.configure({anchor:{x:0,y:0}})],plugins:(e)=>e.map((n)=>{if(n===Yo)return Yo.configure({dropAnimation:null});if(typeof n==="object"&&n!==null&&"plugin"in n&&n.plugin===Yo)return Yo.configure({dropAnimation:null});return n}),sensors:l||a||!w?[]:[nn.configure({activationConstraints:[new Ir.Distance({value:10})]})],onDragStart:Qe,onDragEnd:Oe,children:[t("div",{className:"flex flex-1 flex-col bg-background min-h-0",children:o("div",{ref:qe,className:"flex flex-1 overflow-hidden relative",children:[!re&&t("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>De(!0)}),(!ie||H)&&t("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>{$e(!0),pr.getState().setIsChatbotOpen(!1)}}),!re&&o(B,{children:[t("div",{className:"bg-background",style:{width:Pe},children:t(fr,{teamId:i,projectId:s,projectName:F,rootFolderId:c,dragState:M,ancestorFolders:k?.ancestorFolders??[]})}),t(br,{onResize:(e)=>{ke((n)=>Math.max(180,Math.min(400,n+e)))},className:"hidden md:block"})]}),t(os,{teamId:i,projectId:s,assetId:r,folders:N,files:y,totalFolders:xe,totalFiles:Se,totalFoldersSize:Fe,totalFilesSize:we,selectedItem:te,selectedIds:p,onItemSelect:ve,onItemDoubleClick:be,onSaveField:ee,displayStyle:le,onClearSelection:Y,fetchNextFoldersPage:fe,hasNextFoldersPage:pe||!1,isFetchingNextFoldersPage:ue,fetchNextFilesPage:ge,hasNextFilesPage:me||!1,isFetchingNextFilesPage:he,isRecentlyDeleted:l,isRecents:a,isLoading:ye,filterConditions:I,onFilterChange:X,sort:P,onSortChange:je,dragState:M,collection:f,onUpdateCollection:T,rootFolderId:c}),(!ie||H)&&o(B,{children:[t(br,{onResize:(e)=>{Ae((n)=>Math.max(240,Math.min(600,n-e)))},className:"hidden md:block"}),t("div",{style:{width:Ne},className:"bg-background flex flex-col flex-shrink-0",children:H?t(ns,{projectId:s,contextAssetId:r}):Z?t(is,{teamId:i,projectId:s,file:Z,onSaveField:(e,n)=>ee(Z.id,e,n),members:ze,hideAnnotationControl:!0}):t("div",{className:"flex h-full items-center justify-center p-4 text-center text-sm text-muted-foreground",children:wC()})})]})]})}),t(Sc,{children:M?.isActive?t("div",{className:E("flex items-center gap-2 rounded-md bg-popover px-3 py-2 text-sm font-medium text-popover-foreground shadow-md ring-1 ring-border cursor-grabbing",le==="list"&&"w-30 h-[40px] px-0 flex-none overflow-hidden justify-center"),style:{transform:"translate(0px, 0px)"},children:o("span",{children:["Moving ",M.itemCount," item",M.itemCount!==1?"s":""]})}):null})]})}
|
|
2
|
+
export{Zn};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t,Ue}from"./chunk-6bhn1p8v.js";import"./chunk-j20e0qsw.js";import"./chunk-3wmcx2bv.js";import"./chunk-ehc9adfz.js";import"./chunk-7esm0hqb.js";import"./chunk-q16490pv.js";import"./chunk-c007p0t8.js";import"./chunk-b9yrw9et.js";import"./chunk-k7hss0bd.js";import"./chunk-e7mqtkzn.js";import"./chunk-cqb415s6.js";import{ts}from"./chunk-awfwk64v.js";import"./chunk-4r81ghg8.js";import"./chunk-gk3eqd50.js";import"./chunk-ag6p3mbf.js";import"./chunk-9t1ne8xr.js";import"./chunk-m7m9d4fb.js";import"./chunk-r7dty1tg.js";import"./chunk-2yxj593j.js";import"./chunk-ea79xnn3.js";function p(){let{shareId:a,fileId:s}=e.useParams(),{start:n,version:o,compare:r,cmpLeft:i,cmpRight:l,cmpActive:c}=e.useSearch();return t(ts,{shareId:a,initialFileId:s,startTime:n,versionId:o,compare:r,compareLeftId:i,compareRightId:l,compareActiveSide:c})}var e=Ue("/share/$shareId/files/$fileId")({component:p});export{e as Route};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h,C,t,L,Ue,A,st,yt,Ep}from"./chunk-6bhn1p8v.js";import"./chunk-b9yrw9et.js";import"./chunk-6gg1ymer.js";import"./chunk-cqb415s6.js";import{_i}from"./chunk-rhh716z0.js";import"./chunk-zehyn6vd.js";import"./chunk-70c3xrgd.js";import"./chunk-pb1zf0vb.js";import{Wt}from"./chunk-rhdxwebf.js";import"./chunk-4r81ghg8.js";import"./chunk-gk3eqd50.js";import"./chunk-1yacmegc.js";import"./chunk-ea79xnn3.js";C();function p(){let{projectId:e,folderId:d}=s.useParams(),{teamId:r,ensureTeamIdForProject:i}=st();h(()=>{i(e)},[e,i]);let{data:a}=Wt(Ep(e)),o=a?.rootFolder,{data:l}=L({queryKey:["folders",o],queryFn:async()=>{let n=await A.api.folders[":folderId"].$get({param:{folderId:o}});if(!n.ok)throw Error("failed to fetch folder");return await n.json()},enabled:!!o});if(!r||!o||!l)return t(yt,{});return t(_i,{teamId:r,projectId:e,projectName:a.name??"",assetId:d,rootFolderId:o,isRoot:!1})}var s=Ue("/projects/$projectId/folders/$folderId_/agentsmd")({component:p});export{s as Route};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{T}from"./chunk-6bhn1p8v.js";var c=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],mo=T("wrench",c);
|
|
2
|
+
export{mo};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Vt,Cs}from"./chunk-x8f4defx.js";function C(e,t){return{role:"assistant",content:[],api:e.api,provider:e.provider,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"error",errorMessage:t instanceof Error?t.message:String(t),timestamp:Date.now()}}function P(e){return typeof e.result==="function"}async function S(e,t){for await(let r of t)e.push(r);e.end(P(t)?await t.result():void 0)}function y(e,t){let r=new Vt;return t().then((n)=>S(r,n)).catch((n)=>{let a=C(e,n);r.push({type:"error",reason:"error",error:a}),r.end(a)}),r}function Br(e){return{stream:(t,r,n)=>y(t,async()=>(await e()).stream(t,r,n)),streamSimple:(t,r,n)=>y(t,async()=>(await e()).streamSimple(t,r,n))}}var K=function(e,t){if(typeof e==="string"&&/^\.\.?\//.test(e))return e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,a,s,i){return n?t?".jsx":".js":a&&(!s||!i)?r:a+s+"."+i.toLowerCase()+"js"});return e},x=(e)=>import(K(e));function b(){return globalThis.process?.env}function A(){return{async env(e){let t=b()?.[e];return typeof t==="string"&&t.trim().length>0?t:void 0},async fileExists(e){try{let t=await x("node:fs/promises"),r=e;if(r.startsWith("~"))r=(await x("node:os")).homedir()+r.slice(1);return await t.access(r),!0}catch{return!1}}}}class ec{credentials=new Map;chains=new Map;enqueue(e,t){let r=this.chains.get(e)??Promise.resolve(),n=(async()=>(await r.catch(()=>{}),t()))();return this.chains.set(e,n.catch(()=>{})),n}async read(e){return this.credentials.get(e)}async list(){return[...this.credentials].map(([e,t])=>({providerId:e,type:t.type}))}modify(e,t){return this.enqueue(e,async()=>{let r=this.credentials.get(e),n=await t(r);if(n!==void 0)this.credentials.set(e,n);return n??r})}delete(e){return this.enqueue(e,async()=>{this.credentials.delete(e)})}}class u extends Error{code;constructor(e,t,r){super(q(t,r?.cause),r);this.name="ModelsError",this.code=e}}function q(e,t){if(t===void 0||t===null)return e;let r=Cs(t).trim();if(!r||e.includes(r))return e;return`${e}: ${r}`}async function v(e,t,r,n){let a=n?.env?E(r,n.env):r;if(n?.apiKey!==void 0&&e.auth.apiKey)return m(a,e.auth.apiKey,e.id,{type:"api_key",key:n.apiKey,env:n.env});let s=await _(t,e.id);if(s){if(s.type==="oauth"&&e.auth.oauth)return R(t,e.id,e.auth.oauth,s);if(s.type==="api_key"&&e.auth.apiKey){let i=n?.env?{...s,env:{...s.env,...n.env}}:s;return m(a,e.auth.apiKey,e.id,i)}return}return e.auth.apiKey?m(a,e.auth.apiKey,e.id,void 0):void 0}function E(e,t){return{env:async(r)=>t[r]||await e.env(r),fileExists:(r)=>e.fileExists(r)}}async function R(e,t,r,n){let a=n;if(Date.now()>=a.expires){let s;try{s=await e.modify(t,async(i)=>{if(i?.type!=="oauth")return;if(Date.now()<i.expires)return;try{return await r.refresh(i)}catch(c){throw new u("oauth",`OAuth refresh failed for ${t}`,{cause:c})}})}catch(i){if(i instanceof u)throw i;throw new u("auth",`Credential store modify failed for ${t}`,{cause:i})}if(s?.type!=="oauth")return;a=s}try{return{auth:await r.toAuth(a),source:"OAuth"}}catch(s){throw new u("oauth",`OAuth auth derivation failed for ${t}`,{cause:s})}}async function m(e,t,r,n){try{return await t.resolve({ctx:e,credential:n})}catch(a){throw new u("auth",`API key auth failed for provider ${r}`,{cause:a})}}async function _(e,t){try{return await e.read(t)}catch(r){throw new u("auth",`Credential store read failed for ${t}`,{cause:r})}}class g{entries=new Map;async read(e){let t=this.entries.get(e);return t?structuredClone(t):void 0}async write(e,t){this.entries.set(e,structuredClone(t))}async delete(e){this.entries.delete(e)}}function k(e,t){if(!e&&!t)return;let r={...e};for(let[n,a]of Object.entries(t??{})){let s=n.toLowerCase();for(let i of Object.keys(r))if(i.toLowerCase()===s)delete r[i];r[n]=a}return r}class M{providers=new Map;credentials;modelsStore;authContext;constructor(e){this.credentials=e?.credentials??new ec,this.modelsStore=e?.modelsStore??new g,this.authContext=e?.authContext??A()}setProvider(e){this.providers.set(e.id,e)}deleteProvider(e){this.providers.delete(e)}clearProviders(){this.providers.clear()}getProviders(){return Array.from(this.providers.values())}getProvider(e){return this.providers.get(e)}getModels(e){if(e!==void 0){let r=this.providers.get(e);if(!r)return[];try{return r.getModels()}catch{return[]}}let t=[];for(let r of this.providers.values())try{t.push(...r.getModels())}catch{}return t}getModel(e,t){return this.getModels(e).find((r)=>r.id===t)}async refresh(e={}){let t=e.allowNetwork??!0,r=new Map,n=Array.from(this.providers.values()).filter((a)=>a.refreshModels!==void 0);return await Promise.all(n.map(async(a)=>{if(e.signal?.aborted)return;let s={read:()=>this.modelsStore.read(a.id),write:(c)=>this.modelsStore.write(a.id,c),delete:()=>this.modelsStore.delete(a.id)},i;try{i=await this.readCredential(a.id);let c=await this.resolveRefreshCredential(a,i,t,e.signal);if(!c)return;await a.refreshModels({credential:c,store:s,allowNetwork:t,force:e.force,signal:e.signal})}catch(c){if(!e.signal?.aborted)r.set(a.id,c instanceof Error?c:new u("model_source",`Model refresh failed for ${a.id}`,{cause:c}));try{await a.refreshModels({credential:i,store:s,allowNetwork:!1,signal:e.signal})}catch{}}})),{aborted:e.signal?.aborted??!1,errors:r}}async resolveRefreshCredential(e,t,r,n){if(t?.type==="oauth"){let c=e.auth.oauth;if(!c)return;if(!r||Date.now()<t.expires)return t;if(n?.aborted)return;let p=await this.credentials.modify(e.id,async(l)=>{if(l?.type!=="oauth"||Date.now()<l.expires)return;return c.refresh(l,n)});return p?.type==="oauth"?p:void 0}let a=e.auth.apiKey;if(!a)return;let s=t?.type==="api_key"?t:void 0,i=await a.resolve({ctx:this.authContext,credential:s});if(!i)return;return{type:"api_key",key:i.auth.apiKey,env:i.env}}async readCredential(e){try{return await this.credentials.read(e)}catch(t){throw new u("auth",`Credential store read failed for ${e}`,{cause:t})}}async checkProviderAuth(e,t){if(t?.type==="oauth")return e.auth.oauth?{source:"OAuth",type:"oauth"}:void 0;let r=e.auth.apiKey;if(!r)return;if(r.check)try{return await r.check({ctx:this.authContext,credential:t?.type==="api_key"?t:void 0})}catch(a){throw new u("auth",`API key auth check failed for provider ${e.id}`,{cause:a})}let n=await v(e,this.credentials,this.authContext);return n?{source:n.source,type:"api_key"}:void 0}async checkAuth(e){let t=this.providers.get(e);if(!t)return;return this.checkProviderAuth(t,await this.readCredential(e))}async getAvailable(e){let t=e?[this.providers.get(e)].filter((n)=>n!==void 0):this.getProviders();return(await Promise.all(t.map(async(n)=>{let a=await this.readCredential(n.id);return{provider:n,credential:a,auth:await this.checkProviderAuth(n,a)}}))).flatMap(({provider:n,credential:a,auth:s})=>{if(!s)return[];let i=n.getModels();return n.filterModels?.(i,a)??i})}async getAuth(e,t){let r=typeof e==="string"?e:e.provider,n=this.providers.get(r);if(!n)return;let a=await v(n,this.credentials,this.authContext,t);if(!a||typeof e==="string"||!e.headers)return a;return{...a,auth:{...a.auth,headers:k(a.auth.headers,e.headers)}}}async login(e,t,r){let n=this.providers.get(e);if(!n)throw new u("provider",`Unknown provider: ${e}`);let a=t==="oauth"?n.auth.oauth:n.auth.apiKey;if(!a?.login)throw new u("auth",`${n.name} does not support ${t} login`);let s=await a.login(r);try{await this.credentials.modify(e,async()=>s)}catch(i){throw new u("auth",`Credential store modify failed for ${e}`,{cause:i})}return s}async logout(e){try{await this.credentials.delete(e)}catch(t){throw new u("auth",`Credential store delete failed for ${e}`,{cause:t})}}requireProvider(e){let t=this.providers.get(e.provider);if(!t)throw new u("provider",`Unknown provider: ${e.provider}`);return t}async applyAuth(e,t){this.requireProvider(e);let r=await this.getAuth(e,{apiKey:t?.apiKey,env:t?.env});if(!r)throw new u("auth",`Provider is not configured: ${e.provider}`);let n=r.auth,a=t?.apiKey??n.apiKey,s=k(n.headers,t?.headers);if(t?.transformHeaders)s=await t.transformHeaders(s??{});let i=r.env||t?.env?{...r.env??{},...t?.env??{}}:void 0,c=n.baseUrl?{...e,baseUrl:n.baseUrl}:e,{transformHeaders:p,...l}=t??{},o={...l,apiKey:a,headers:s,env:i};return{requestModel:c,requestOptions:o}}stream(e,t,r){return y(e,async()=>{let n=this.requireProvider(e),{requestModel:a,requestOptions:s}=await this.applyAuth(e,r);return n.stream(a,t,s)})}async complete(e,t,r){return this.stream(e,t,r).result()}streamSimple(e,t,r){return y(e,async()=>{let n=this.requireProvider(e),{requestModel:a,requestOptions:s}=await this.applyAuth(e,r);return n.streamSimple(a,t,s)})}async completeSimple(e,t,r){return this.streamSimple(e,t,r).result()}}function Up(e){return new M(e)}function ye(e){let t=e.models,r=[],n,a=e.fetchModels,s=()=>{let o=[...t];for(let h of r){let d=o.findIndex((f)=>f.id===h.id);if(d>=0)o[d]=h;else o.push(h)}return o},i=typeof e.api.stream==="function"?e.api:void 0,c=i?void 0:e.api,p=(o)=>i??c?.[o.api],l=(o,h)=>{let d=p(o);if(!d)return y(o,async()=>{throw new u("stream",`Provider ${e.id} has no API implementation for "${o.api}"`)});return h(d)};return{id:e.id,name:e.name??e.id,baseUrl:e.baseUrl,headers:e.headers,auth:e.auth,getModels:s,refreshModels:a?(o)=>(n??=(async()=>{try{let h=await o.store.read();if(h)r=h.models.filter((f)=>f.provider===e.id).map((f)=>f);if(!o.allowNetwork||o.signal?.aborted)return;let d=await a(o);if(o.signal?.aborted)return;r=d,await o.store.write({models:d,checkedAt:Date.now()})}finally{n=void 0}})(),n):void 0,filterModels:e.filterModels,stream:(o,h,d)=>l(o,(f)=>f.stream(o,h,d)),streamSimple:(o,h,d)=>l(o,(f)=>f.streamSimple(o,h,d))}}function en(e,t){let r=t.input+t.cacheRead+t.cacheWrite,n=e.cost,a=-1;for(let c of e.cost.tiers??[])if(r>c.inputTokensAbove&&c.inputTokensAbove>a)n=c,a=c.inputTokensAbove;let s=t.cacheWrite1h??0,i=t.cacheWrite-s;return t.cost.input=n.input/1e6*t.input,t.cost.output=n.output/1e6*t.output,t.cost.cacheRead=n.cacheRead/1e6*t.cacheRead,t.cost.cacheWrite=(n.cacheWrite*i+n.input*2*s)/1e6,t.cost.total=t.cost.input+t.cost.output+t.cost.cacheRead+t.cost.cacheWrite,t.cost}var w=["off","minimal","low","medium","high","xhigh","max"];function T(e){if(!e.reasoning)return["off"];return w.filter((t)=>{let r=e.thinkingLevelMap?.[t];if(r===null)return!1;if(t==="xhigh"||t==="max")return r!==void 0;return!0})}function Ur(e,t){let r=T(e);if(r.includes(t))return t;let n=w.indexOf(t);if(n===-1)return r[0]??"off";for(let a=n;a<w.length;a++){let s=w[a];if(r.includes(s))return s}for(let a=n-1;a>=0;a--){let s=w[a];if(r.includes(s))return s}return r[0]??"off"}
|
|
3
|
+
export{Br,ec,Up,ye,en,Ur};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{T}from"./chunk-6bhn1p8v.js";var e=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Ln=T("user",e);var c=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Xn=T("users",c);
|
|
2
|
+
export{Ln,Xn};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{w,W}from"./chunk-rza4ae5z.js";var Li=w(function(ar,D){var{defineProperty:k,getOwnPropertyDescriptor:re,getOwnPropertyNames:te}=Object,oe=Object.prototype.hasOwnProperty,ne=(e,r)=>{for(var t in r)k(e,t,{get:r[t],enumerable:!0})},se=(e,r,t,n)=>{if(r&&typeof r==="object"||typeof r==="function"){for(let o of te(r))if(!oe.call(e,o)&&o!==t)k(e,o,{get:()=>r[o],enumerable:!(n=re(r,o))||n.enumerable})}return e},ie=(e)=>se(k({},"__esModule",{value:!0}),e),E={};ne(E,{VercelOidcTokenError:()=>m});D.exports=ie(E);class m extends Error{constructor(e,r){super(e);this.name="VercelOidcTokenError",this.cause=r}toString(){if(this.cause)return`${this.name}: ${this.message}: ${this.cause}`;return`${this.name}: ${this.message}`}}});var V=w(function(cr,S){var{create:ae,defineProperty:_,getOwnPropertyDescriptor:ce,getOwnPropertyNames:ue,getPrototypeOf:pe}=Object,le=Object.prototype.hasOwnProperty,fe=(e,r)=>{for(var t in r)_(e,t,{get:r[t],enumerable:!0})},x=(e,r,t,n)=>{if(r&&typeof r==="object"||typeof r==="function"){for(let o of ue(r))if(!le.call(e,o)&&o!==t)_(e,o,{get:()=>r[o],enumerable:!(n=ce(r,o))||n.enumerable})}return e},g=(e,r,t)=>(t=e!=null?ae(pe(e)):{},x(r||!e||!e.__esModule?_(t,"default",{value:e,enumerable:!0}):t,e)),_e=(e)=>x(_({},"__esModule",{value:!0}),e),A={};fe(A,{findRootDir:()=>ve,getUserDataDir:()=>ke});S.exports=_e(A);var p=g(W("path")),de=g(W("fs")),y=g(W("os")),he=Li();function ve(){try{let e=process.cwd();while(e!==p.default.dirname(e)){let r=p.default.join(e,".vercel");if(de.default.existsSync(r))return e;e=p.default.dirname(e)}}catch(e){throw new he.VercelOidcTokenError("Token refresh only supported in node server environments")}return null}function ke(){if(process.env.XDG_DATA_HOME)return process.env.XDG_DATA_HOME;switch(y.default.platform()){case"darwin":return p.default.join(y.default.homedir(),"Library/Application Support");case"linux":return p.default.join(y.default.homedir(),".local/share");case"win32":if(process.env.LOCALAPPDATA)return process.env.LOCALAPPDATA;return null;default:return null}}});var F=w(function(ur,q){var{create:ye,defineProperty:d,getOwnPropertyDescriptor:we,getOwnPropertyNames:ge,getPrototypeOf:Oe}=Object,Pe=Object.prototype.hasOwnProperty,be=(e,r)=>{for(var t in r)d(e,t,{get:r[t],enumerable:!0})},C=(e,r,t,n)=>{if(r&&typeof r==="object"||typeof r==="function"){for(let o of ge(r))if(!Pe.call(e,o)&&o!==t)d(e,o,{get:()=>r[o],enumerable:!(n=we(r,o))||n.enumerable})}return e},R=(e,r,t)=>(t=e!=null?ye(Oe(e)):{},C(r||!e||!e.__esModule?d(t,"default",{value:e,enumerable:!0}):t,e)),je=(e)=>C(d({},"__esModule",{value:!0}),e),M={};be(M,{isValidAccessToken:()=>De,readAuthConfig:()=>Ee,writeAuthConfig:()=>me});q.exports=je(M);var l=R(W("fs")),I=R(W("path")),Te=Bi();function N(){let e=(0,Te.getVercelDataDir)();if(!e)throw Error(`Unable to find Vercel CLI data directory. Your platform: ${process.platform}. Supported: darwin, linux, win32.`);return I.join(e,"auth.json")}function Ee(){try{let e=N();if(!l.existsSync(e))return null;let r=l.readFileSync(e,"utf8");if(!r)return null;return JSON.parse(r)}catch(e){return null}}function me(e){let r=N(),t=I.dirname(r);if(!l.existsSync(t))l.mkdirSync(t,{mode:504,recursive:!0});l.writeFileSync(r,JSON.stringify(e,null,2),{mode:384})}function De(e,r=0){if(!e.token)return!1;if(typeof e.expiresAt!=="number")return!0;let t=Math.floor(Date.now()/1000),n=r/1000;return e.expiresAt>=t+n}});var B=w(function(pr,L){var{defineProperty:b,getOwnPropertyDescriptor:xe,getOwnPropertyNames:Ae}=Object,Se=Object.prototype.hasOwnProperty,Ve=(e,r)=>{for(var t in r)b(e,t,{get:r[t],enumerable:!0})},Ce=(e,r,t,n)=>{if(r&&typeof r==="object"||typeof r==="function"){for(let o of Ae(r))if(!Se.call(e,o)&&o!==t)b(e,o,{get:()=>r[o],enumerable:!(n=xe(r,o))||n.enumerable})}return e},Re=(e)=>Ce(b({},"__esModule",{value:!0}),e),U={};Ve(U,{processTokenResponse:()=>Fe,refreshTokenRequest:()=>qe});L.exports=Re(U);var O=W("os"),Me="https://vercel.com",Ie="cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp",J=`@vercel/oidc node-${process.version} ${(0,O.platform)()} (${(0,O.arch)()}) ${(0,O.hostname)()}`,P=null;async function Ne(){if(P)return P;let e=`${Me}/.well-known/openid-configuration`,r=await fetch(e,{headers:{"user-agent":J}});if(!r.ok)throw Error("Failed to discover OAuth endpoints");let t=await r.json();if(!t||typeof t.token_endpoint!=="string")throw Error("Invalid OAuth discovery response");let n=t.token_endpoint;return P=n,n}async function qe(e){let r=await Ne();return await fetch(r,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","user-agent":J},body:new URLSearchParams({client_id:Ie,grant_type:"refresh_token",...e})})}async function Fe(e){let r=await e.json();if(!e.ok){let t=typeof r==="object"&&r&&"error"in r?String(r.error):"Token refresh failed";return[Error(t)]}if(typeof r!=="object"||r===null)return[Error("Invalid token response")];if(typeof r.access_token!=="string")return[Error("Missing access_token in response")];if(r.token_type!=="Bearer")return[Error("Invalid token_type in response")];if(typeof r.expires_in!=="number")return[Error("Missing expires_in in response")];return[null,r]}});var Ud=w(function(lr,X){var{defineProperty:j,getOwnPropertyDescriptor:$e,getOwnPropertyNames:Ue}=Object,Je=Object.prototype.hasOwnProperty,Le=(e,r)=>{for(var t in r)j(e,t,{get:r[t],enumerable:!0})},Be=(e,r,t,n)=>{if(r&&typeof r==="object"||typeof r==="function"){for(let o of Ue(r))if(!Je.call(e,o)&&o!==t)j(e,o,{get:()=>r[o],enumerable:!(n=$e(r,o))||n.enumerable})}return e},He=(e)=>Be(j({},"__esModule",{value:!0}),e),H={};Le(H,{AccessTokenMissingError:()=>z,RefreshAccessTokenFailedError:()=>G});X.exports=He(H);class z extends Error{constructor(){super("No authentication found. Please log in with the Vercel CLI (vercel login).");this.name="AccessTokenMissingError"}}class G extends Error{constructor(e){super("Failed to refresh authentication token.",{cause:e});this.name="RefreshAccessTokenFailedError"}}});var Bi=w(function(fr,ee){var{create:ze,defineProperty:h,getOwnPropertyDescriptor:Ge,getOwnPropertyNames:Xe,getPrototypeOf:Ye}=Object,Qe=Object.prototype.hasOwnProperty,Ze=(e,r)=>{for(var t in r)h(e,t,{get:r[t],enumerable:!0})},Q=(e,r,t,n)=>{if(r&&typeof r==="object"||typeof r==="function"){for(let o of Xe(r))if(!Qe.call(e,o)&&o!==t)h(e,o,{get:()=>r[o],enumerable:!(n=Ge(r,o))||n.enumerable})}return e},Z=(e,r,t)=>(t=e!=null?ze(Ye(e)):{},Q(r||!e||!e.__esModule?h(t,"default",{value:e,enumerable:!0}):t,e)),Ke=(e)=>Q(h({},"__esModule",{value:!0}),e),K={};Ze(K,{assertVercelOidcTokenResponse:()=>T,findProjectInfo:()=>tr,getTokenPayload:()=>sr,getVercelDataDir:()=>We,getVercelOidcToken:()=>rr,getVercelToken:()=>er,isExpired:()=>ir,loadToken:()=>nr,saveToken:()=>or});ee.exports=Ke(K);var f=Z(W("path")),s=Z(W("fs")),u=Li(),v=V(),a=F(),Y=B(),c=Ud();function We(){let r=(0,v.getUserDataDir)();if(!r)return null;return f.join(r,"com.vercel.cli")}async function er(e){let r=(0,a.readAuthConfig)();if(!r?.token)throw new c.AccessTokenMissingError;if((0,a.isValidAccessToken)(r,e?.expirationBufferMs))return r.token;if(!r.refreshToken)throw(0,a.writeAuthConfig)({}),new c.RefreshAccessTokenFailedError("No refresh token available");try{let t=await(0,Y.refreshTokenRequest)({refresh_token:r.refreshToken}),[n,o]=await(0,Y.processTokenResponse)(t);if(n||!o)throw(0,a.writeAuthConfig)({}),new c.RefreshAccessTokenFailedError(n);let i={token:o.access_token,expiresAt:Math.floor(Date.now()/1000)+o.expires_in};if(o.refresh_token)i.refreshToken=o.refresh_token;return(0,a.writeAuthConfig)(i),i.token}catch(t){if((0,a.writeAuthConfig)({}),t instanceof c.AccessTokenMissingError||t instanceof c.RefreshAccessTokenFailedError)throw t;throw new c.RefreshAccessTokenFailedError(t)}}async function rr(e,r,t){let n=`https://api.vercel.com/v1/projects/${r}/token?source=vercel-oidc-refresh${t?`&teamId=${t}`:""}`,o=await fetch(n,{method:"POST",headers:{Authorization:`Bearer ${e}`}});if(!o.ok)throw new u.VercelOidcTokenError(`Failed to refresh OIDC token: ${o.statusText}`);let i=await o.json();return T(i),i}function T(e){if(!e||typeof e!=="object")throw TypeError("Vercel OIDC token is malformed. Expected an object. Please run `vc env pull` and try again");if(!("token"in e)||typeof e.token!=="string")throw TypeError("Vercel OIDC token is malformed. Expected a string-valued token property. Please run `vc env pull` and try again")}function tr(){let e=(0,v.findRootDir)();if(!e)throw new u.VercelOidcTokenError("Unable to find project root directory. Have you linked your project with `vc link?`");let r=f.join(e,".vercel","project.json");if(!s.existsSync(r))throw new u.VercelOidcTokenError("project.json not found, have you linked your project with `vc link?`");let t=JSON.parse(s.readFileSync(r,"utf8"));if(typeof t.projectId!=="string"&&typeof t.orgId!=="string")throw TypeError("Expected a string-valued projectId property. Try running `vc link` to re-link your project.");return{projectId:t.projectId,teamId:t.orgId}}function or(e,r){let t=(0,v.getUserDataDir)();if(!t)throw new u.VercelOidcTokenError("Unable to find user data directory. Please reach out to Vercel support.");let n=f.join(t,"com.vercel.token",`${r}.json`),o=JSON.stringify(e);s.mkdirSync(f.dirname(n),{mode:504,recursive:!0}),s.writeFileSync(n,o),s.chmodSync(n,432);return}function nr(e){let r=(0,v.getUserDataDir)();if(!r)throw new u.VercelOidcTokenError("Unable to find user data directory. Please reach out to Vercel support.");let t=f.join(r,"com.vercel.token",`${e}.json`);if(!s.existsSync(t))return null;let n=JSON.parse(s.readFileSync(t,"utf8"));return T(n),n}function sr(e){let r=e.split(".");if(r.length!==3)throw new u.VercelOidcTokenError("Invalid token. Please run `vc env pull` and try again");let t=r[1].replace(/-/g,"+").replace(/_/g,"/"),n=t.padEnd(t.length+(4-t.length%4)%4,"=");return JSON.parse(Buffer.from(n,"base64").toString("utf8"))}function ir(e,r=0){return e.exp*1000<Date.now()+r}});
|
|
3
|
+
export{Li,Ud,Bi};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h,u,C,B,t,o,Me,Rn,Ue,T,gr,Z,qn,Vr,S,Hp,t0,r0,df,pf,Yb,Tw,Mw,Pf,Ox,Dx,Zx,$h,nC,oC,q,p,P,G,fl,pl,ml}from"./chunk-6bhn1p8v.js";import{an}from"./chunk-ea79xnn3.js";var v=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],f=T("key-round",v);C();var x=P({password:p().min(3,Pf()),confirmPassword:p().min(3,Pf())}).refine((s)=>s.password===s.confirmPassword,{message:Zx(),path:["confirmPassword"]}),b=Ue("/reset-password")({component:N});function N(){let s=Me(),r=b.useSearch().token||"",[n,a]=u(null),[l,m]=u(!1),[i,w]=u(!1),e=pl({resolver:ml(x),defaultValues:{password:"",confirmPassword:""}});h(()=>{if(i){let d=setTimeout(()=>{s({to:"/login"})},3000);return()=>clearTimeout(d)}},[i,s]);let g=async(d)=>{if(!r){a(pf());return}m(!0),a(null);let{error:c}=await Hp({newPassword:d.password,token:r});if(m(!1),c){a(c.message||pf());return}w(!0)};return o(fl,{children:[o("div",{className:"mb-8",children:[t("h1",{className:"text-2xl font-bold tracking-tight text-foreground",children:$h()}),t("p",{className:"text-muted-foreground text-sm mt-1",children:nC()})]}),!r?o("div",{className:"space-y-6",children:[o("div",{className:"p-4 bg-destructive/10 border border-destructive/20 text-destructive rounded-xl text-sm flex items-start gap-3",children:[t(an,{className:"w-5 h-5 shrink-0 mt-0.5"}),o("div",{className:"space-y-1",children:[t("p",{className:"font-semibold",children:pf()}),t("p",{className:"text-xs text-muted-foreground",children:Yb()})]})]}),t(Rn,{to:"/login",className:"block w-full",children:o(S,{variant:"outline",className:"w-full h-11 rounded-xl flex items-center justify-center gap-2",children:[df(),t(qn,{className:"w-4 h-4"})]})})]}):i?o("div",{className:"space-y-6",children:[o("div",{className:"p-4 bg-emerald-500/10 border border-emerald-500/20 text-emerald-600 dark:text-emerald-400 rounded-xl text-sm flex items-start gap-3",children:[t(gr,{className:"w-5 h-5 shrink-0 mt-0.5"}),o("div",{className:"space-y-1",children:[t("p",{className:"font-semibold",children:Ox()}),t("p",{className:"text-xs text-muted-foreground",children:Dx()})]})]}),t(Rn,{to:"/login",className:"block w-full",children:o(S,{className:"w-full h-11 bg-gradient-to-r from-rose-500 to-orange-500 hover:from-rose-600 hover:to-orange-600 text-white font-semibold rounded-xl shadow-md shadow-rose-500/10 hover:shadow-rose-500/20 active:scale-[0.98] transition-all flex items-center justify-center gap-2 border-0",children:[df(),t(qn,{className:"w-4 h-4"})]})})]}):o("form",{onSubmit:e.handleSubmit(g),className:"space-y-5",children:[n&&t("div",{className:"p-3 bg-destructive/10 border border-destructive/20 text-destructive rounded-xl text-sm text-center font-medium",children:n}),o("div",{className:"space-y-2",children:[t(G,{htmlFor:"password",className:"text-xs font-semibold text-muted-foreground tracking-wide uppercase",children:Tw()}),o("div",{className:"relative group",children:[t(Vr,{className:"absolute left-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground transition-colors group-focus-within:text-rose-500"}),t(q,{id:"password",type:"password",...e.register("password"),placeholder:Mw(),className:"pl-10.5 h-11 border-border focus-visible:ring-rose-500/50 focus-visible:border-rose-500 rounded-xl transition-all shadow-sm"})]}),e.formState.errors.password&&t("p",{className:"text-destructive text-xs font-medium",children:e.formState.errors.password.message})]}),o("div",{className:"space-y-2",children:[t(G,{htmlFor:"confirmPassword",className:"text-xs font-semibold text-muted-foreground tracking-wide uppercase",children:t0()}),o("div",{className:"relative group",children:[t(Vr,{className:"absolute left-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground transition-colors group-focus-within:text-rose-500"}),t(q,{id:"confirmPassword",type:"password",...e.register("confirmPassword"),placeholder:r0(),className:"pl-10.5 h-11 border-border focus-visible:ring-rose-500/50 focus-visible:border-rose-500 rounded-xl transition-all shadow-sm"})]}),e.formState.errors.confirmPassword&&t("p",{className:"text-destructive text-xs font-medium",children:e.formState.errors.confirmPassword.message})]}),t(S,{type:"submit",className:"w-full h-11 bg-gradient-to-r from-rose-500 to-orange-500 hover:from-rose-600 hover:to-orange-600 text-white font-semibold rounded-xl shadow-md shadow-rose-500/10 hover:shadow-rose-500/20 active:scale-[0.98] transition-all flex items-center justify-center gap-2 border-0",disabled:l,children:l?o(B,{children:[t(Z,{className:"h-4 w-4 animate-spin"}),oC()]}):o(B,{children:[t(f,{className:"w-4 h-4"}),$h()]})}),t("div",{className:"pt-2 text-center text-sm",children:t(Rn,{to:"/login",className:"font-semibold text-rose-500 hover:text-rose-600 dark:text-rose-400 dark:hover:text-rose-300 transition-colors hover:underline inline-flex items-center gap-1",children:df()})})]})]})}export{b as Route};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{w,W}from"./chunk-rza4ae5z.js";var ne=w(function(Nt,re){var A=1000,T=A*60,M=T*60,P=M*24,Ie=P*7,Re=P*365.25;re.exports=function(e,r){r=r||{};var t=typeof e;if(t==="string"&&e.length>0)return Ae(e);else if(t==="number"&&isFinite(e))return r.long?Me(e):Te(e);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Ae(e){if(e=String(e),e.length>100)return;var r=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!r)return;var t=parseFloat(r[1]),n=(r[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return t*Re;case"weeks":case"week":case"w":return t*Ie;case"days":case"day":case"d":return t*P;case"hours":case"hour":case"hrs":case"hr":case"h":return t*M;case"minutes":case"minute":case"mins":case"min":case"m":return t*T;case"seconds":case"second":case"secs":case"sec":case"s":return t*A;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}function Te(e){var r=Math.abs(e);if(r>=P)return Math.round(e/P)+"d";if(r>=M)return Math.round(e/M)+"h";if(r>=T)return Math.round(e/T)+"m";if(r>=A)return Math.round(e/A)+"s";return e+"ms"}function Me(e){var r=Math.abs(e);if(r>=P)return D(e,r,P,"day");if(r>=M)return D(e,r,M,"hour");if(r>=T)return D(e,r,T,"minute");if(r>=A)return D(e,r,A,"second");return e+" ms"}function D(e,r,t,n){var o=r>=t*1.5;return Math.round(e/t)+" "+n+(o?"s":"")}});var V=w(function(Lt,oe){function je(e){t.debug=t,t.default=t,t.coerce=F,t.disable=u,t.enable=o,t.enabled=v,t.humanize=ne(),t.destroy=N,Object.keys(e).forEach((s)=>{t[s]=e[s]}),t.names=[],t.skips=[],t.formatters={};function r(s){let i=0;for(let a=0;a<s.length;a++)i=(i<<5)-i+s.charCodeAt(a),i|=0;return t.colors[Math.abs(i)%t.colors.length]}t.selectColor=r;function t(s){let i,a=null,f,b;function p(...d){if(!p.enabled)return;let O=p,m=Number(new Date),E=m-(i||m);if(O.diff=E,O.prev=i,O.curr=m,i=m,d[0]=t.coerce(d[0]),typeof d[0]!=="string")d.unshift("%O");let x=0;d[0]=d[0].replace(/%([a-zA-Z%])/g,(S,R)=>{if(S==="%%")return"%";x++;let te=t.formatters[R];if(typeof te==="function"){let Pe=d[x];S=te.call(O,Pe),d.splice(x,1),x--}return S}),t.formatArgs.call(O,d),(O.log||t.log).apply(O,d)}if(p.namespace=s,p.useColors=t.useColors(),p.color=t.selectColor(s),p.extend=n,p.destroy=t.destroy,Object.defineProperty(p,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(a!==null)return a;if(f!==t.namespaces)f=t.namespaces,b=t.enabled(s);return b},set:(d)=>{a=d}}),typeof t.init==="function")t.init(p);return p}function n(s,i){let a=t(this.namespace+(typeof i>"u"?":":i)+s);return a.log=this.log,a}function o(s){t.save(s),t.namespaces=s,t.names=[],t.skips=[];let i=(typeof s==="string"?s:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let a of i)if(a[0]==="-")t.skips.push(a.slice(1));else t.names.push(a)}function c(s,i){let a=0,f=0,b=-1,p=0;while(a<s.length)if(f<i.length&&(i[f]===s[a]||i[f]==="*"))if(i[f]==="*")b=f,p=a,f++;else a++,f++;else if(b!==-1)f=b+1,p++,a=p;else return!1;while(f<i.length&&i[f]==="*")f++;return f===i.length}function u(){let s=[...t.names,...t.skips.map((i)=>"-"+i)].join(",");return t.enable(""),s}function v(s){for(let i of t.skips)if(c(s,i))return!1;for(let i of t.names)if(c(s,i))return!0;return!1}function F(s){if(s instanceof Error)return s.stack||s.message;return s}function N(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}oe.exports=je});var se=w(function(J,k){J.formatArgs=Le;J.save=Be;J.load=qe;J.useColors=Ne;J.storage=De();J.destroy=(()=>{let e=!1;return()=>{if(!e)e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();J.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Ne(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Le(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+k.exports.humanize(this.diff),!this.useColors)return;let r="color: "+this.color;e.splice(1,0,r,"color: inherit");let t=0,n=0;e[0].replace(/%[a-zA-Z%]/g,(o)=>{if(o==="%%")return;if(t++,o==="%c")n=t}),e.splice(n,0,r)}J.log=console.debug||console.log||(()=>{});function Be(e){try{if(e)J.storage.setItem("debug",e);else J.storage.removeItem("debug")}catch(r){}}function qe(){let e;try{e=J.storage.getItem("debug")||J.storage.getItem("DEBUG")}catch(r){}if(!e&&typeof process<"u"&&"env"in process)e=process.env.DEBUG;return e}function De(){try{return localStorage}catch(e){}}k.exports=V()(J);var{formatters:ke}=k.exports;ke.j=function(e){try{return JSON.stringify(e)}catch(r){return"[UnexpectedJSONParseError]: "+r.message}}});var ce=w(function(qt,ie){ie.exports=(e,r=process.argv)=>{let t=e.startsWith("-")?"":e.length===1?"-":"--",n=r.indexOf(t+e),o=r.indexOf("--");return n!==-1&&(o===-1||n<o)}});var fe=w(function(Dt,ae){var Je=W("os"),ue=W("tty"),y=ce(),{env:l}=process,U;if(y("no-color")||y("no-colors")||y("color=false")||y("color=never"))U=0;else if(y("color")||y("colors")||y("color=true")||y("color=always"))U=1;function We(){if("FORCE_COLOR"in l){if(l.FORCE_COLOR==="true")return 1;if(l.FORCE_COLOR==="false")return 0;return l.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(l.FORCE_COLOR,10),3)}}function Ke(e){if(e===0)return!1;return{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Ze(e,{streamIsTTY:r,sniffFlags:t=!0}={}){let n=We();if(n!==void 0)U=n;let o=t?U:n;if(o===0)return 0;if(t){if(y("color=16m")||y("color=full")||y("color=truecolor"))return 3;if(y("color=256"))return 2}if(e&&!r&&o===void 0)return 0;let c=o||0;if(l.TERM==="dumb")return c;if(process.platform==="win32"){let u=Je.release().split(".");if(Number(u[0])>=10&&Number(u[2])>=10586)return Number(u[2])>=14931?3:2;return 1}if("CI"in l){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some((u)=>(u in l))||l.CI_NAME==="codeship")return 1;return c}if("TEAMCITY_VERSION"in l)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(l.TEAMCITY_VERSION)?1:0;if(l.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in l){let u=Number.parseInt((l.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(l.TERM_PROGRAM){case"iTerm.app":return u>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(l.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(l.TERM))return 1;if("COLORTERM"in l)return 1;return c}function K(e,r={}){let t=Ze(e,{streamIsTTY:e&&e.isTTY,...r});return Ke(t)}ae.exports={supportsColor:K,stdout:K({isTTY:ue.isatty(1)}),stderr:K({isTTY:ue.isatty(2)})}});var de=w(function(Z,G){var Qe=W("tty"),H=W("util");Z.init=st;Z.log=rt;Z.formatArgs=et;Z.save=nt;Z.load=ot;Z.useColors=Xe;Z.destroy=H.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Z.colors=[6,2,3,4,5,1];try{let e=fe();if(e&&(e.stderr||e).level>=2)Z.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(e){}Z.inspectOpts=Object.keys(process.env).filter((e)=>/^debug_/i.test(e)).reduce((e,r)=>{let t=r.substring(6).toLowerCase().replace(/_([a-z])/g,(o,c)=>c.toUpperCase()),n=process.env[r];if(/^(yes|on|true|enabled)$/i.test(n))n=!0;else if(/^(no|off|false|disabled)$/i.test(n))n=!1;else if(n==="null")n=null;else n=Number(n);return e[t]=n,e},{});function Xe(){return"colors"in Z.inspectOpts?Boolean(Z.inspectOpts.colors):Qe.isatty(process.stderr.fd)}function et(e){let{namespace:r,useColors:t}=this;if(t){let n=this.color,o="\x1B[3"+(n<8?n:"8;5;"+n),c=` ${o};1m${r} \x1B[0m`;e[0]=c+e[0].split(`
|
|
3
|
+
`).join(`
|
|
4
|
+
`+c),e.push(o+"m+"+G.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=tt()+r+" "+e[0]}function tt(){if(Z.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function rt(...e){return process.stderr.write(H.formatWithOptions(Z.inspectOpts,...e)+`
|
|
5
|
+
`)}function nt(e){if(e)process.env.DEBUG=e;else delete process.env.DEBUG}function ot(){return process.env.DEBUG}function st(e){e.inspectOpts={};let r=Object.keys(Z.inspectOpts);for(let t=0;t<r.length;t++)e.inspectOpts[r[t]]=Z.inspectOpts[r[t]]}G.exports=V()(Z);var{formatters:le}=G.exports;le.o=function(e){return this.inspectOpts.colors=this.useColors,H.inspect(e,this.inspectOpts).split(`
|
|
6
|
+
`).map((r)=>r.trim()).join(" ")};le.O=function(e){return this.inspectOpts.colors=this.useColors,H.inspect(e,this.inspectOpts)}});var X=w(function($t,Q){if(typeof process>"u"||process.type==="renderer"||!1||process.__nwjs)Q.exports=se();else Q.exports=de()});var ye=w(function(h){var dt=h&&h.__createBinding||(Object.create?function(e,r,t,n){if(n===void 0)n=t;var o=Object.getOwnPropertyDescriptor(r,t);if(!o||("get"in o?!r.__esModule:o.writable||o.configurable))o={enumerable:!0,get:function(){return r[t]}};Object.defineProperty(e,n,o)}:function(e,r,t,n){if(n===void 0)n=t;e[n]=r[t]}),ht=h&&h.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),he=h&&h.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null){for(var t in e)if(t!=="default"&&Object.prototype.hasOwnProperty.call(e,t))dt(r,e,t)}return ht(r,e),r};Object.defineProperty(h,"__esModule",{value:!0});h.req=h.json=h.toBuffer=void 0;var Ct=he(W("http")),yt=he(W("https"));async function Ce(e){let r=0,t=[];for await(let n of e)r+=n.length,t.push(n);return Buffer.concat(t,r)}h.toBuffer=Ce;async function gt(e){let t=(await Ce(e)).toString("utf8");try{return JSON.parse(t)}catch(n){let o=n;throw o.message+=` (input: ${t})`,o}}h.json=gt;function bt(e,r={}){let n=((typeof e==="string"?e:e.href).startsWith("https:")?yt:Ct).request(e,r),o=new Promise((c,u)=>{n.once("response",c).once("error",u).end()});return n.then=o.then.bind(o),n}h.req=bt});var Oe=w(function(C){var be=C&&C.__createBinding||(Object.create?function(e,r,t,n){if(n===void 0)n=t;var o=Object.getOwnPropertyDescriptor(r,t);if(!o||("get"in o?!r.__esModule:o.writable||o.configurable))o={enumerable:!0,get:function(){return r[t]}};Object.defineProperty(e,n,o)}:function(e,r,t,n){if(n===void 0)n=t;e[n]=r[t]}),mt=C&&C.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),me=C&&C.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null){for(var t in e)if(t!=="default"&&Object.prototype.hasOwnProperty.call(e,t))be(r,e,t)}return mt(r,e),r},_t=C&&C.__exportStar||function(e,r){for(var t in e)if(t!=="default"&&!Object.prototype.hasOwnProperty.call(r,t))be(r,e,t)};Object.defineProperty(C,"__esModule",{value:!0});C.Agent=void 0;var Ot=me(W("net")),ge=me(W("http")),vt=W("https");_t(ye(),C);var _=Symbol("AgentBaseInternalState");class _e extends ge.Agent{constructor(e){super(e);this[_]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint==="boolean")return e.secureEndpoint;if(typeof e.protocol==="string")return e.protocol==="https:"}let{stack:r}=Error();if(typeof r!=="string")return!1;return r.split(`
|
|
7
|
+
`).some((t)=>t.indexOf("(https.js:")!==-1||t.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;if(!this.sockets[e])this.sockets[e]=[];let r=new Ot.Socket({writable:!1});return this.sockets[e].push(r),this.totalSocketCount++,r}decrementSockets(e,r){if(!this.sockets[e]||r===null)return;let t=this.sockets[e],n=t.indexOf(r);if(n!==-1){if(t.splice(n,1),this.totalSocketCount--,t.length===0)delete this.sockets[e]}}getName(e){if(this.isSecureEndpoint(e))return vt.Agent.prototype.getName.call(this,e);return super.getName(e)}createSocket(e,r,t){let n={...r,secureEndpoint:this.isSecureEndpoint(r)},o=this.getName(n),c=this.incrementSockets(o);Promise.resolve().then(()=>this.connect(e,n)).then((u)=>{if(this.decrementSockets(o,c),u instanceof ge.Agent)try{return u.addRequest(e,n)}catch(v){return t(v)}this[_].currentSocket=u,super.createSocket(e,r,t)},(u)=>{this.decrementSockets(o,c),t(u)})}createConnection(){let e=this[_].currentSocket;if(this[_].currentSocket=void 0,!e)throw Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[_].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){if(this[_])this[_].defaultPort=e}get protocol(){return this[_].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){if(this[_])this[_].protocol=e}}C.Agent=_e});var ve=w(function(j){var wt=j&&j.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(j,"__esModule",{value:!0});j.parseProxyResponse=void 0;var Ft=wt(X()),z=(0,Ft.default)("https-proxy-agent:parse-proxy-response");function xt(e){return new Promise((r,t)=>{let n=0,o=[];function c(){let s=e.read();if(s)N(s);else e.once("readable",c)}function u(){e.removeListener("end",v),e.removeListener("error",F),e.removeListener("readable",c)}function v(){u(),z("onend"),t(Error("Proxy connection ended before receiving CONNECT response"))}function F(s){u(),z("onerror %o",s),t(s)}function N(s){o.push(s),n+=s.length;let i=Buffer.concat(o,n),a=i.indexOf(`\r
|
|
8
|
+
\r
|
|
9
|
+
`);if(a===-1){z("have not received end of HTTP headers yet..."),c();return}let f=i.slice(0,a).toString("ascii").split(`\r
|
|
10
|
+
`),b=f.shift();if(!b)return e.destroy(),t(Error("No header received from proxy CONNECT response"));let p=b.split(" "),d=+p[1],O=p.slice(2).join(" "),m={};for(let E of f){if(!E)continue;let x=E.indexOf(":");if(x===-1)return e.destroy(),t(Error(`Invalid header from proxy CONNECT response: "${E}"`));let q=E.slice(0,x).toLowerCase(),S=E.slice(x+1).trimStart(),R=m[q];if(typeof R==="string")m[q]=[R,S];else if(Array.isArray(R))R.push(S);else m[q]=S}z("got proxy server response: %o %o",b,m),u(),r({connect:{statusCode:d,statusText:O,headers:m},buffered:i})}e.on("error",F),e.on("end",v),c()})}j.parseProxyResponse=xt});var jt=w(function(g){var Et=g&&g.__createBinding||(Object.create?function(e,r,t,n){if(n===void 0)n=t;var o=Object.getOwnPropertyDescriptor(r,t);if(!o||("get"in o?!r.__esModule:o.writable||o.configurable))o={enumerable:!0,get:function(){return r[t]}};Object.defineProperty(e,n,o)}:function(e,r,t,n){if(n===void 0)n=t;e[n]=r[t]}),St=g&&g.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),Ee=g&&g.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null){for(var t in e)if(t!=="default"&&Object.prototype.hasOwnProperty.call(e,t))Et(r,e,t)}return St(r,e),r},Se=g&&g.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(g,"__esModule",{value:!0});g.HttpsProxyAgent=void 0;var Y=Ee(W("net")),we=Ee(W("tls")),Pt=Se(W("assert")),It=Se(X()),Rt=Oe(),At=W("url"),Tt=ve(),B=(0,It.default)("https-proxy-agent"),Fe=(e)=>{if(e.servername===void 0&&e.host&&!Y.isIP(e.host))return{...e,servername:e.host};return e};class ee extends Rt.Agent{constructor(e,r){super(r);this.options={path:void 0},this.proxy=typeof e==="string"?new At.URL(e):e,this.proxyHeaders=r?.headers??{},B("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let t=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),n=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...r?xe(r,"headers"):null,host:t,port:n}}async connect(e,r){let{proxy:t}=this;if(!r.host)throw TypeError('No "host" provided');let n;if(t.protocol==="https:")B("Creating `tls.Socket`: %o",this.connectOpts),n=we.connect(Fe(this.connectOpts));else B("Creating `net.Socket`: %o",this.connectOpts),n=Y.connect(this.connectOpts);let o=typeof this.proxyHeaders==="function"?this.proxyHeaders():{...this.proxyHeaders},c=Y.isIPv6(r.host)?`[${r.host}]`:r.host,u=`CONNECT ${c}:${r.port} HTTP/1.1\r
|
|
11
|
+
`;if(t.username||t.password){let i=`${decodeURIComponent(t.username)}:${decodeURIComponent(t.password)}`;o["Proxy-Authorization"]=`Basic ${Buffer.from(i).toString("base64")}`}if(o.Host=`${c}:${r.port}`,!o["Proxy-Connection"])o["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close";for(let i of Object.keys(o))u+=`${i}: ${o[i]}\r
|
|
12
|
+
`;let v=Tt.parseProxyResponse(n);n.write(`${u}\r
|
|
13
|
+
`);let{connect:F,buffered:N}=await v;if(e.emit("proxyConnect",F),this.emit("proxyConnect",F,e),F.statusCode===200){if(e.once("socket",Mt),r.secureEndpoint)return B("Upgrading socket connection to TLS"),we.connect({...xe(Fe(r),"host","path","port"),socket:n});return n}n.destroy();let s=new Y.Socket({writable:!1});return s.readable=!0,e.once("socket",(i)=>{B("Replaying proxy buffer for failed request"),(0,Pt.default)(i.listenerCount("data")>0),i.push(N),i.push(null)}),s}}ee.protocols=["http","https"];g.HttpsProxyAgent=ee;function Mt(e){e.resume()}function xe(e,...r){let t={},n;for(n in e)if(!r.includes(n))t[n]=e[n];return t}});export default jt();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h,C,t,L,Ue,A,st,yt,Sp}from"./chunk-6bhn1p8v.js";import"./chunk-3wmcx2bv.js";import"./chunk-j20e0qsw.js";import"./chunk-ehc9adfz.js";import"./chunk-b9yrw9et.js";import"./chunk-6gg1ymer.js";import"./chunk-bay038pj.js";import"./chunk-7esm0hqb.js";import"./chunk-q16490pv.js";import"./chunk-k7hss0bd.js";import"./chunk-c007p0t8.js";import"./chunk-cqb415s6.js";import{Zn}from"./chunk-185qefn1.js";import{Wt}from"./chunk-rhdxwebf.js";import"./chunk-4r81ghg8.js";import"./chunk-gk3eqd50.js";import"./chunk-ag6p3mbf.js";import"./chunk-9t1ne8xr.js";import"./chunk-m7m9d4fb.js";import"./chunk-1yacmegc.js";import"./chunk-r7dty1tg.js";import"./chunk-2yxj593j.js";import"./chunk-ea79xnn3.js";C();function l(){let{projectId:o,folderId:n}=c.useParams(),{teamId:r,ensureTeamIdForProject:a}=st();h(()=>{a(o)},[o,a]);let{data:s}=Wt(Sp(o)),e=s?.rootFolder,{data:i}=L({queryKey:["folders",e],queryFn:()=>(async()=>await(await A.api.folders[":folderId"].$get({param:{folderId:e}})).json())(),enabled:!!e});if(!r||!e||!i)return t(yt,{});return t(Zn,{teamId:r,projectId:o,projectName:s.name??"",assetId:n,rootFolderId:e})}var c=Ue("/projects/$projectId/folders/$folderId")({component:l});export{c as Route};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{D,h,He,O,v,u,C,B,t,o,Q,U,Sr,A,T,bt,Pn,Te,_e,jr,ft,ur,ga,wo,de,Lt,Oe,E,ut,me,K,Ot,oe,Ha,Ga,On,Qa,sc,S,Ce,Ee,Ie,he,ge,Ae,V,Vo,Pu,$p,Zu,lc,Ay,yy,cc,_y,by,vy,Qd,uc,wy,xy,Re,Wi,Bu,of,Ji,af,lf,cf,fi,hf,Cw,Ew,Ku,yh,Mf,Ju,So,AC,eg,EC,wI,fe,Cg,ce,pe,ue,It,q,Lo,Ir,nn,Dn,R,it,we,gi,Bs,hd,ul,ir,Cc,Ec,$n,Ai,ht,gt,At,Cr,_r,G,je,Dr}from"./chunk-6bhn1p8v.js";import{go,lr}from"./chunk-ehc9adfz.js";import{Yr}from"./chunk-m7m9d4fb.js";import{Ln,Xn}from"./chunk-2yxj593j.js";function Dt(e){let n=e.lastIndexOf(".");if(n>0)return[0,n];return[0,e.length]}function ea(e){e.focus();let[n,r]=Dt(e.value);if(typeof e.setSelectionRange==="function")e.setSelectionRange(n,r);else e.select()}var Pt=[["path",{d:"M2 10v3",key:"1fnikh"}],["path",{d:"M6 6v11",key:"11sgs0"}],["path",{d:"M10 3v18",key:"yhl04a"}],["path",{d:"M14 8v7",key:"3a1oy3"}],["path",{d:"M18 5v13",key:"123xd1"}],["path",{d:"M22 10v3",key:"154ddg"}]],To=T("audio-lines",Pt);var Rr=Sr((e)=>({fields:[],loadedProjectId:null,setFields:(n,r)=>e({fields:n,loadedProjectId:r}),updateFields:(n)=>e({fields:n})}));function We(e,n){let{start:r,end:a}=ul(n?.in,e),i=+r>+a,s=i?+r:+a,c=i?a:r;c.setHours(0,0,0,0);let l=n?.step??1;if(!l)return[];if(l<0)l=-l,i=!i;let m=[];while(+c<=s)m.push(it(r,c)),c.setDate(c.getDate()+l),c.setHours(0,0,0,0);return i?m.reverse():m}function ye(e,n){return we(e,n?.in).getDate()}function Ze(e,n){return we(e,n?.in).getDay()}function Me(e,n){return we(e,n?.in).getHours()}function ke(e,n){return we(e,n?.in).getMinutes()}var Vt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],De=T("circle-question-mark",Vt);var Bt=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],Xe=T("text-align-start",Bt);var Ht=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]],Qe=T("ban",Ht);var $t=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],Ye=T("hash",$t);var Ut=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Ca=T("settings",Ut);var zt=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],Ne=T("star",zt);var Gt=[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",key:"16rjxf"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",key:"178nd4"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor",key:"12ikhr"}]],qe=T("tags",Gt);var jt=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],Je=T("toggle-left",jt);var Kt=[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]],Si=T("type",Kt);C();var Wt=({value:e,config:n,onSave:r,readOnly:a})=>{let i=n?.date,[s,c]=u(!1),l=v(null),m=e?new Date(e):new Date,f=Bs(m)?m:new Date,[x,b]=u(f);h(()=>{if(s&&e){let N=new Date(e);if(Bs(N))b(N)}},[s,e]),h(()=>{let N=(g)=>{if(l.current&&!l.current.contains(g.target)){if(s)c(!1)}};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[s]);let p=()=>{if(!a)c(!0)},F=(N)=>{if(!N)return"";let g=new Date(N);if(!Bs(g))return"Invalid Date";let k="PPP";if(i?.displayFormat==="usa")k="MM/dd/yyyy";else if(i?.displayFormat==="euro")k="dd/MM/yyyy";else if(i?.displayFormat==="iso")k="yyyy-MM-dd";if(i?.includeTime)if(i?.timeFormat==="twenty_four_hour")k+=" HH:mm";else k+=" p";let j=ir(g,k);if(i?.displayTimezone)j+=` (${Intl.DateTimeFormat().resolvedOptions().timeZone})`;return j},d=new Date(x.getFullYear(),x.getMonth(),1),M=hd(x),H=We({start:d,end:M}),P=Ze(d),y=(N)=>{let g=new Date(N);if(i?.includeTime)g.setHours(Me(f)),g.setMinutes(ke(f));let k=g.toISOString();if(r(k),!i?.includeTime)c(!1)},z=(N,g)=>{let k=e?new Date(e):new Date;if(!Bs(k))k.setTime(new Date().getTime());if(N==="hour")k.setHours(g);if(N==="minute")k.setMinutes(g);let j=k.toISOString();r(j)},w=Array.from({length:24},(N,g)=>g),Z=Array.from({length:12},(N,g)=>g*5);if(s)return o("div",{className:"relative w-full",ref:l,children:[t("div",{className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm shadow-sm min-h-[28px] flex items-center",children:e?F(e):t("span",{className:"text-muted-foreground",children:"Select date..."})}),o("div",{className:"absolute z-50 top-full left-0 mt-1 bg-popover border border-border rounded-lg shadow-xl flex flex-col md:flex-row overflow-hidden min-w-[280px]",children:[o("div",{className:"p-4 w-64",children:[o("div",{className:"flex justify-between items-center mb-4",children:[t("button",{onClick:()=>b(gi(x,-1)),className:"p-1 hover:bg-accent rounded",children:t(jr,{className:"w-4 h-4"})}),t("span",{className:"font-semibold text-sm",children:ir(x,"MMMM yyyy")}),t("button",{onClick:()=>b(gi(x,1)),className:"p-1 hover:bg-accent rounded",children:t(ft,{className:"w-4 h-4"})})]}),t("div",{className:"grid grid-cols-7 gap-1 text-center text-xs mb-2 text-muted-foreground",children:["Su","Mo","Tu","We","Th","Fr","Sa"].map((N)=>t("div",{children:N},N))}),o("div",{className:"grid grid-cols-7 gap-1 text-center text-sm",children:[Array.from({length:P}).map((N,g)=>t("div",{},`empty-${g}`)),H.map((N)=>{let g=e?new Date(e):null,k=g&&Bs(g)&&ye(g)===ye(N)&&Cc(g)===Cc(N)&&Ec(g)===Ec(N);return t("button",{onClick:()=>y(N),className:`w-8 h-8 rounded-full flex items-center justify-center hover:bg-accent transition-colors ${k?"bg-primary text-primary-foreground hover:bg-primary/90":"text-foreground"}`,children:ye(N)},N.toString())})]})]}),i?.includeTime&&o("div",{className:"border-l border-border bg-muted w-32 flex flex-col",children:[o("div",{className:"p-2 border-b border-border text-xs font-semibold text-muted-foreground flex items-center justify-center gap-1",children:[t(ur,{className:"w-3 h-3"})," Time"]}),o("div",{className:"flex flex-1 h-64",children:[t("div",{className:"flex-1 overflow-y-auto scrollbar-hide border-r border-border",children:w.map((N)=>t("div",{onClick:()=>z("hour",N),className:`px-2 py-1 text-center text-sm cursor-pointer hover:bg-accent ${Me(f)===N?"bg-primary/10 font-medium text-primary":""}`,children:N.toString().padStart(2,"0")},N))}),t("div",{className:"flex-1 overflow-y-auto scrollbar-hide",children:Z.map((N)=>t("div",{onClick:()=>z("minute",N),className:`px-2 py-1 text-center text-sm cursor-pointer hover:bg-accent ${ke(f)===N?"bg-primary/10 font-medium text-primary":""}`,children:N.toString().padStart(2,"0")},N))})]})]})]})]});return t("div",{onClick:p,className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded border border-transparent transition-colors ${!a?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:e?F(e):t("span",{className:"text-muted-foreground italic",children:"Empty"})})},et=Wt;C();var Zt=({value:e,onSave:n,readOnly:r})=>{let[a,i]=u(!1),[s,c]=u(e||""),l=v(null),m=v(null),[f,x]=u(!1);h(()=>{c(e||"")},[e]),h(()=>{if(a&&l.current)l.current.focus(),x(!1)},[a]),h(()=>{let d=(M)=>{if(f&&m.current&&!m.current.contains(M.target))x(!1)};if(f)document.addEventListener("mousedown",d);return()=>{document.removeEventListener("mousedown",d)}},[f]);let b=()=>{i(!1),n(s)},p=(d)=>{d.stopPropagation(),x(!0)},F=(d)=>{if(d.stopPropagation(),!r)i(!0)};if(a)return t("textarea",{ref:l,value:s,onChange:(d)=>c(d.target.value),onBlur:b,className:"w-full min-h-[80px] p-2 border border-ring rounded bg-background text-sm outline-none shadow-sm resize-none"});return o("div",{ref:m,className:"relative w-full text-sm",children:[t("div",{onClick:p,className:`w-full text-foreground rounded border border-transparent transition-all px-2 py-1 h-[48px] line-clamp-2 whitespace-pre-wrap overflow-hidden ${!r?"cursor-pointer hover:bg-accent hover:border-border":"cursor-pointer"}`,title:"Click to expand",children:e?e:t("span",{className:"text-muted-foreground italic",children:"Empty"})}),f&&t("div",{onClick:F,className:`absolute top-0 left-0 w-full min-h-full h-auto z-50 bg-background border border-ring rounded shadow-lg px-2 py-1 whitespace-pre-wrap ${!r?"cursor-text":""}`,children:e?e:t("span",{className:"text-muted-foreground italic",children:"Empty"})})]})},tt=Zt;C();var Xt=({value:e,config:n,onSave:r,readOnly:a})=>{let i=n?.number,[s,c]=u(!1),[l,m]=u(""),f=v(null);h(()=>{m(e!==void 0&&e!==null?e.toString():"")},[e]),h(()=>{if(s&&f.current)f.current.focus()},[s]);let x=()=>{if(!a)c(!0)},b=()=>{if(c(!1),l==="")r(void 0);else{let d=parseFloat(l);r(isNaN(d)?void 0:d)}},p=(d)=>{if(d.key==="Enter")d.stopPropagation(),f.current?.blur()},F=(d)=>{if(d===void 0||d===null||isNaN(d))return"";return d.toFixed(i?.scale)};if(s)return t("input",{ref:f,type:"number",step:1/Math.pow(10,i?.scale||0),value:l,onChange:(d)=>m(d.target.value),onBlur:b,onKeyDown:p,onDoubleClick:(d)=>d.stopPropagation(),className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm outline-none shadow-sm text-left font-mono"});return t("div",{onClick:x,onDoubleClick:(d)=>d.stopPropagation(),className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded border border-transparent transition-colors text-left font-mono ${!a?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:e!==void 0&&e!==null?F(e):t("span",{className:"text-muted-foreground italic font-sans text-left block",children:"Empty"})})},ot=Xt;C();var Qt=({value:e,config:n,onSave:r,readOnly:a})=>{let i=n?.rating,s=Math.max(2,Math.min(6,i?.maxValue||5)),[c,l]=u(null),m=(x,b)=>{if(x.stopPropagation(),a)return;let p;if(e===b)p=0;else p=b;r(p)},f=Array.from({length:s},(x,b)=>b+1);return t("div",{className:"flex items-center gap-1 h-[28px]",onMouseLeave:()=>!a&&l(null),onDoubleClick:(x)=>x.stopPropagation(),children:f.map((x)=>{let b=c!==null?x<=c:x<=(e||0);return t("button",{onClick:(p)=>m(p,x),onMouseEnter:()=>!a&&l(x),className:`focus:outline-none transition-transform ${!a?"cursor-pointer hover:scale-110":"cursor-default"}`,type:"button",disabled:a,children:t(Ne,{className:`w-5 h-5 transition-colors ${b?"fill-yellow-400 text-yellow-400":"fill-muted text-muted-foreground/30"}`})},x)})})},Fc=Qt;C();C();var qt=Object.defineProperty,I=(e,n)=>qt(e,"name",{value:n,configurable:!0}),rt=["PageUp","PageDown"],at=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],st={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},xe="Slider",[Le,Jt,eo]=Ga(xe),[Ve,nr]=ut(xe,[eo]),[to,be]=Ve(xe),oo=D(I(function(n,r){let{name:a,min:i=0,max:s=100,step:c=1,orientation:l="horizontal",disabled:m=!1,minStepsBetweenThumbs:f=0,defaultValue:x=[i],value:b,onValueChange:p=I(()=>{},"onValueChange"),onValueCommit:F=I(()=>{},"onValueCommit"),inverted:d=!1,form:M,...H}=n,P=v(new Set),y=v(0),z=v(!1),Z=l==="horizontal"?no:ro,[N,g]=u(null),k=me(r,g),[j=[],ee]=Ot({prop:b,defaultProp:x,onChange:I((W)=>{[...P.current][y.current]?.focus({preventScroll:!0,focusVisible:z.current}),z.current=!1,p(W)},"onChange")}),Y=v(j),ne=v(j);h(()=>{let W=M?N?.ownerDocument.getElementById(M):N?.closest("form");if(W instanceof HTMLFormElement){let te=I(()=>ee(ne.current),"reset");return W.addEventListener("reset",te),()=>W.removeEventListener("reset",te)}},[N,M,ee]);function _(W){let te=yt(j,W);L(W,te)}I(_,"handleSlideStart");function X(W){L(W,y.current)}I(X,"handleSlideMove");function J(){if(String(j)!==String(Y.current))F(j)}I(J,"handleSlideEnd");function L(W,te,{commit:ze}={commit:!1}){let Ge=$e(c),Fe=ve(Math.round((W-i)/c)*c+i,Ge),le=Qa(Fe,[i,s]);ee((ie=[])=>{let re=vt(ie,le,te);if(St(re,f*c)){y.current=re.indexOf(le);let Ke=String(re)!==String(ie);if(Ke&&ze)F(re);return Ke?re:ie}else return ie})}return I(L,"updateValues"),t(to,{scope:n.__scopeSlider,name:a,disabled:m,min:i,max:s,valueIndexToChangeRef:y,thumbs:P.current,values:j,orientation:l,form:M,children:t(Le.Provider,{scope:n.__scopeSlider,children:t(Le.Slot,{scope:n.__scopeSlider,children:t(Z,{"aria-disabled":m,"data-disabled":m?"":void 0,...H,ref:k,onPointerDown:K(H.onPointerDown,()=>{if(!m)Y.current=j,z.current=!1}),min:i,max:s,inverted:d,onSlideStart:m?void 0:_,onSlideMove:m?void 0:X,onSlideEnd:m?void 0:J,onHomeKeyDown:()=>{if(!m)z.current=!0,L(i,0,{commit:!0})},onEndKeyDown:()=>{if(!m)z.current=!0,L(s,j.length-1,{commit:!0})},onStepKeyDown:({event:W,direction:te})=>{if(!m){z.current=!0;let Fe=rt.includes(W.key)||W.shiftKey&&at.includes(W.key)?10:1,le=y.current,ie=j[le],re=Ct(ie,{min:i,step:c,direction:te,multiplier:Fe});L(re,le,{commit:!0})}}})})})})},"Slider")),[lt,ct]=Ve(xe,{startEdge:"left",endEdge:"right",size:"width",direction:1}),no=D(I(function(n,r){let{min:a,max:i,dir:s,inverted:c,onSlideStart:l,onSlideMove:m,onSlideEnd:f,onStepKeyDown:x,...b}=n,[p,F]=u(null),d=me(r,F),M=v(void 0),H=On(s),P=H==="ltr",y=P&&!c||!P&&c;function z(w){let Z=M.current||p.getBoundingClientRect(),N=[0,Z.width],k=Se(N,y?[a,i]:[i,a]);return M.current=Z,k(w-Z.left)}return I(z,"getValueFromPointer"),t(lt,{scope:n.__scopeSlider,startEdge:y?"left":"right",endEdge:y?"right":"left",direction:y?1:-1,size:"width",children:t(dt,{dir:H,"data-orientation":"horizontal",...b,ref:d,style:{...b.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:(w)=>{let Z=z(w.clientX);l?.(Z)},onSlideMove:(w)=>{let Z=z(w.clientX);m?.(Z)},onSlideEnd:()=>{M.current=void 0,f?.()},onStepKeyDown:(w)=>{let N=st[y?"from-left":"from-right"].includes(w.key);x?.({event:w,direction:N?-1:1})}})})},"SliderHorizontal")),ro=D(I(function(n,r){let{min:a,max:i,inverted:s,onSlideStart:c,onSlideMove:l,onSlideEnd:m,onStepKeyDown:f,...x}=n,b=v(null),p=me(r,b),F=v(void 0),d=!s;function M(H){let P=F.current||b.current.getBoundingClientRect(),y=[0,P.height],w=Se(y,d?[i,a]:[a,i]);return F.current=P,w(H-P.top)}return I(M,"getValueFromPointer"),t(lt,{scope:n.__scopeSlider,startEdge:d?"bottom":"top",endEdge:d?"top":"bottom",size:"height",direction:d?1:-1,children:t(dt,{"data-orientation":"vertical",...x,ref:p,style:{...x.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:(H)=>{let P=M(H.clientY);c?.(P)},onSlideMove:(H)=>{let P=M(H.clientY);l?.(P)},onSlideEnd:()=>{F.current=void 0,m?.()},onStepKeyDown:(H)=>{let y=st[d?"from-bottom":"from-top"].includes(H.key);f?.({event:H,direction:y?-1:1})}})})},"SliderVertical")),dt=D(I(function(n,r){let{__scopeSlider:a,onSlideStart:i,onSlideMove:s,onSlideEnd:c,onHomeKeyDown:l,onEndKeyDown:m,onStepKeyDown:f,...x}=n,b=be(xe,a);return t(oe.span,{...x,ref:r,onKeyDown:K(n.onKeyDown,(p)=>{if(p.key==="Home")l(p),p.preventDefault();else if(p.key==="End")m(p),p.preventDefault();else if(rt.concat(at).includes(p.key))f(p),p.preventDefault()}),onPointerDown:K(n.onPointerDown,(p)=>{let F=p.target;if(F.setPointerCapture(p.pointerId),p.preventDefault(),b.thumbs.has(F))F.focus({preventScroll:!0,focusVisible:!1});else i(p)}),onPointerMove:K(n.onPointerMove,(p)=>{if(p.target.hasPointerCapture(p.pointerId))s(p)}),onPointerUp:K(n.onPointerUp,(p)=>{let F=p.target;if(F.hasPointerCapture(p.pointerId))F.releasePointerCapture(p.pointerId),c(p)})})},"SliderImpl")),ao="SliderTrack",io=D(I(function(n,r){let{__scopeSlider:a,...i}=n,s=be(ao,a);return t(oe.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...i,ref:r})},"SliderTrack")),nt="SliderRange",so=D(I(function(n,r){let{__scopeSlider:a,...i}=n,s=be(nt,a),c=ct(nt,a),l=v(null),m=me(r,l),f=s.values.length,x=s.values.map((F)=>Be(F,s.min,s.max)),b=f>1?Math.min(...x):0,p=100-Math.max(...x);return t(oe.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...i,ref:m,style:{...n.style,[c.startEdge]:b+"%",[c.endEdge]:p+"%"}})},"SliderRange")),lo="SliderThumb",[co,mt]=Ve(lo),uo="SliderThumbProvider";function pt(e){let{__scopeSlider:n,name:r,children:a,internal_do_not_use_render:i}=e,s=be(uo,n),c=Jt(n),[l,m]=u(null),f=O(()=>l?c().findIndex((H)=>H.ref.current===l):-1,[c,l]),x=Ha(l),b=l?!!s.form||!!l.closest("form"):!0,p=s.values[f],F=r??(s.name?s.name+(s.values.length>1?"[]":""):void 0),d=p===void 0?0:Be(p,s.min,s.max);h(()=>{if(l)return s.thumbs.add(l),()=>{s.thumbs.delete(l)}},[l,s.thumbs]);let M={value:p,name:F,form:s.form,isFormControl:b,index:f,thumb:l,onThumbChange:m,percent:d,size:x};return t(co,{scope:n,...M,children:Et(i)?i(M):a})}I(pt,"SliderThumbProvider");var Pe="SliderThumbTrigger",mo=D(I(function(n,r){let{__scopeSlider:a,...i}=n,s=be(Pe,a),c=ct(Pe,a),{index:l,value:m,percent:f,size:x,onThumbChange:b}=mt(Pe,a),p=me(r,b),F=xt(l,s.values.length),d=x?.[c.size],M=d?wt(d,f,c.direction):0;return t("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${f}% + ${M}px)`},children:t(Le.ItemSlot,{scope:a,children:t(oe.span,{role:"slider","aria-label":n["aria-label"]||F,"aria-valuemin":s.min,"aria-valuenow":m,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,tabIndex:s.disabled?void 0:0,...i,ref:p,style:m===void 0?{display:"none"}:n.style,onFocus:K(n.onFocus,()=>{s.valueIndexToChangeRef.current=l})})})})},"SliderThumbTrigger")),fo=D(I(function(n,r){let{__scopeSlider:a,name:i,...s}=n;return t(pt,{__scopeSlider:a,name:i,internal_do_not_use_render:({index:c,isFormControl:l})=>o(B,{children:[t(mo,{...s,ref:r,__scopeSlider:a}),l?t(ho,{__scopeSlider:a},c):null]})})},"SliderThumb")),po="SliderBubbleInput",ho=D(I(function({__scopeSlider:n,...r},a){let{value:i,name:s,form:c}=mt(po,n),l=v(null),m=me(l,a),f=sc(i);return h(()=>{let x=l.current;if(!x)return;let b=window.HTMLInputElement.prototype,F=Object.getOwnPropertyDescriptor(b,"value").set;if(f!==i&&F){let d=new Event("input",{bubbles:!0});F.call(x,i),x.dispatchEvent(d)}},[f,i]),t(oe.input,{style:{display:"none"},name:s,form:c,...r,ref:m,defaultValue:i})},"SliderBubbleInput"));function vt(e=[],n,r){let a=[...e];return a[r]=n,a.sort((i,s)=>i-s)}I(vt,"getNextSortedValues");function Be(e,n,r){let s=100/(r-n)*(e-n);return Qa(s,[0,100])}I(Be,"convertValueToPercentage");function xt(e,n){if(n>2)return`Value ${e+1} of ${n}`;else if(n===2)return["Minimum","Maximum"][e];else return}I(xt,"getLabel");function yt(e,n){if(e.length===1)return 0;let r=e.map((i)=>Math.abs(i-n)),a=Math.min(...r);return r.indexOf(a)}I(yt,"getClosestValueIndex");function wt(e,n,r){let a=e/2,i=50,s=Se([0,50],[0,a]);return(a-s(n)*r)*r}I(wt,"getThumbInBoundsOffset");function Nt(e){return e.slice(0,-1).map((n,r)=>e[r+1]-n)}I(Nt,"getStepsBetweenValues");function St(e,n){if(n>0){let r=Nt(e);return Math.min(...r)>=n}return!0}I(St,"hasMinStepsBetweenValues");function Se(e,n){return(r)=>{if(e[0]===e[1]||n[0]===n[1])return n[0];let a=(n[1]-n[0])/(e[1]-e[0]);return n[0]+a*(r-e[0])}}I(Se,"linearScale");function $e(e){if(!Number.isFinite(e))return 0;let n=e.toString();if(n.includes("e")){let[a,i]=n.split("e"),s=a.split(".")[1]||"",c=Number(i);return Math.max(0,s.length-c)}let r=n.split(".")[1];return r?r.length:0}I($e,"getDecimalCount");function ve(e,n){let r=Math.pow(10,n);return Math.round(e*r)/r}I(ve,"roundValue");function Ct(e,{min:n,step:r,direction:a,multiplier:i}){let s=$e(r),c=(e-n)/r,l=Math.round(c),m=ve(l*r+n,s)===ve(e,s),f;if(m)f=l+i*a;else if(a>0)f=Math.ceil(c);else f=Math.floor(c);return ve(f*r+n,s)}I(Ct,"getNextStepValue");function Et(e){return typeof e==="function"}I(Et,"isFunction");var ae;(function(e){e.Base32IncorrectEncoding="B32_ENC_INVALID",e.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",e.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",e.EncodeTimeNegative="ENC_TIME_NEG",e.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",e.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",e.PRNGDetectFailure="PRNG_DETECT",e.ULIDInvalid="ULID_INVALID",e.Unexpected="UNEXPECTED",e.UUIDInvalid="UUID_INVALID"})(ae||(ae={}));class se extends Error{constructor(e,n){super(`${n} (${e})`);this.name="ULIDError",this.code=e}}function xo(e){let n=Math.floor(e()*32)%32;return"0123456789ABCDEFGHJKMNPQRSTVWXYZ".charAt(n)}function bo(e){let n=yo(),r=n&&(n.crypto||n.msCrypto)||null;if(typeof r?.getRandomValues==="function")return()=>{let a=new Uint8Array(1);return r.getRandomValues(a),a[0]/256};else if(typeof r?.randomBytes==="function")return()=>r.randomBytes(1).readUInt8()/256;throw new se(ae.PRNGDetectFailure,"Failed to find a reliable PRNG")}function yo(){if(Eo())return self;if(typeof window<"u")return window;if(typeof global<"u")return global;if(typeof globalThis<"u")return globalThis;return null}function No(e,n){let r="";for(;e>0;e--)r=xo(n)+r;return r}function Co(e,n=10){if(isNaN(e))throw new se(ae.EncodeTimeValueMalformed,`Time must be a number: ${e}`);else if(e>281474976710655)throw new se(ae.EncodeTimeSizeExceeded,`Cannot encode a time larger than 281474976710655: ${e}`);else if(e<0)throw new se(ae.EncodeTimeNegative,`Time must be positive: ${e}`);else if(Number.isInteger(e)===!1)throw new se(ae.EncodeTimeValueMalformed,`Time must be an integer: ${e}`);let r,a="";for(let i=n;i>0;i--)r=e%32,a="0123456789ABCDEFGHJKMNPQRSTVWXYZ".charAt(r)+a,e=(e-r)/32;return a}function Eo(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function Mo(e,n){let r=n||bo(),a=!e||isNaN(e)?Date.now():e;return Co(a,10)+No(16,r)}function _o(e,n,r){let a=e.slice();return a.splice(r,0,a.splice(n,1)[0]),a}function zc(e,n,r,a){if(r===a)return e;let i=_o(n,r,a),s=new Set(n.map((l)=>l.id)),c=0;return e.map((l)=>s.has(l.id)?i[c++]:l)}async function Ci(e){let n=[],r=[],a=e.items;if(a)for(let c=0;c<a.length;c++){let l=a[c];if(l.kind==="file"){let m=l.webkitGetAsEntry?.();if(m)r.push({entry:m,path:""})}}else return Array.from(e.files);let i=(c)=>new Promise((l)=>{c.readEntries((m)=>l(m),()=>l([]))}),s=(c)=>new Promise((l,m)=>{c.file((f)=>l(f),(f)=>m(f))});while(r.length>0){let c=r.shift();if(!c)continue;let{entry:l,path:m}=c;if(l.isFile)try{let f=await s(l),x=m?`${m}/${f.name}`:f.name;Object.defineProperty(f,"webkitRelativePath",{value:x,writable:!1,configurable:!0}),n.push(f)}catch(f){console.error("Error reading file entry:",f)}else if(l.isDirectory){let f=l.createReader(),x=[],b=await i(f);while(b.length>0)x=x.concat(b),b=await i(f);let p=m?`${m}/${l.name}`:l.name;for(let F of x)r.push({entry:F,path:p})}}return n}C();C();function El(){let[e,n]=u(!1);return o(fe,{open:e,onOpenChange:n,children:[t(Cg,{asChild:!0,children:o(S,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-transparent text-muted-foreground hover:text-foreground inline-flex items-center justify-center shrink-0 ml-1",title:Qd(),children:[t(De,{className:"h-3.5 w-3.5"}),t("span",{className:"sr-only",children:Qd()})]})}),o(ce,{className:"sm:max-w-[500px]",children:[o(pe,{children:[o(ue,{className:"flex items-center gap-2",children:[t(De,{className:"h-5 w-5 text-muted-foreground"}),Qd()]}),t(It,{children:vy()})]}),o("div",{className:"space-y-4 py-2",children:[o("div",{className:"rounded-lg border p-3.5 space-y-1.5 bg-muted/30",children:[o("div",{className:"flex items-center gap-2 font-medium text-sm",children:[t(Qe,{className:"h-4 w-4 text-muted-foreground shrink-0"}),t("span",{children:uc()})]}),t("p",{className:"text-xs text-muted-foreground leading-relaxed",children:wy()}),t("p",{className:"text-xs italic text-muted-foreground/80",children:xy()})]}),o("div",{className:"rounded-lg border p-3.5 space-y-1.5 bg-muted/30",children:[o("div",{className:"flex items-center gap-2 font-medium text-sm",children:[t(Yr,{className:"h-4 w-4 text-amber-500 shrink-0"}),t("span",{children:lc()})]}),t("p",{className:"text-xs text-muted-foreground leading-relaxed",children:Ay()}),t("p",{className:"text-xs italic text-muted-foreground/80",children:yy()})]}),o("div",{className:"rounded-lg border p-3.5 space-y-1.5 bg-muted/30",children:[o("div",{className:"flex items-center gap-2 font-medium text-sm",children:[t(bt,{className:"h-4 w-4 text-blue-500 shrink-0"}),t("span",{children:cc()})]}),t("p",{className:"text-xs text-muted-foreground leading-relaxed",children:_y()}),t("p",{className:"text-xs italic text-muted-foreground/80",children:by()})]})]})]})]})}var Vs=["red","orange","yellow","green","blue","purple","gray"],cs={red:{bg:"rgba(239, 68, 68, 0.15)",text:"#ef4444",hex:"#ef4444"},orange:{bg:"rgba(249, 115, 22, 0.15)",text:"#f97316",hex:"#f97316"},yellow:{bg:"rgba(234, 179, 8, 0.15)",text:"#ca8a04",hex:"#eab308"},green:{bg:"rgba(34, 197, 94, 0.15)",text:"#16a34a",hex:"#22c55e"},blue:{bg:"rgba(59, 130, 246, 0.15)",text:"#2563eb",hex:"#3b82f6"},purple:{bg:"rgba(168, 85, 247, 0.15)",text:"#9333ea",hex:"#a855f7"},gray:{bg:"rgba(128, 128, 128, 0.15)",text:"#4b5563",hex:"#808080"},system:{bg:"rgba(128, 128, 128, 0.1)",text:"#6b7280",hex:"#808080"}};function ta(e){if(!e)return{backgroundColor:"rgba(128, 128, 128, 0.1)",color:"#6b7280"};let n=e.toLowerCase(),r=cs[n];if(r)return{backgroundColor:r.bg,color:r.text};if(e.startsWith("#"))return{backgroundColor:`${e}33`,color:e};return{backgroundColor:"rgba(128, 128, 128, 0.1)",color:e}}function us(e=[]){let n=new Set(e.map((a)=>a.color?.toLowerCase()).filter(Boolean)),r=Vs.filter((a)=>!n.has(a.toLowerCase()));if(r.length>0)return r[Math.floor(Math.random()*r.length)];return Vs[Math.floor(Math.random()*Vs.length)]}var Ks={[Cr.text]:Si,[Cr.longText]:Xe,[Cr.select]:wo,[Cr.selectMulti]:qe,[Cr.rating]:Ne,[Cr.number]:Ye,[Cr.toggle]:Je,[Cr.date]:Pn,[Cr.user]:Ln,[Cr.userMulti]:Xn};function Fo({field:e,index:n,onVisibilityChange:r}){let{ref:a,handleRef:i}=Ai({id:e.id,index:n}),s=e.config?.type?Ks[e.config.type]:null;return o("div",{ref:a,className:"flex items-center justify-between p-2 rounded-md hover:bg-muted",children:[o("div",{className:"flex items-center gap-2",children:[t("div",{ref:i,className:"cursor-grab",children:t(ga,{className:"h-4 w-4 text-muted-foreground"})}),s&&t(s,{className:"h-4 w-4 text-muted-foreground shrink-0"}),e.config?.autofillSource===_r.CONTENT&&t(Yr,{className:"h-4 w-4 text-muted-foreground shrink-0"}),e.config?.autofillSource===_r.CREATION_CONTEXT&&t(bt,{className:"h-4 w-4 text-muted-foreground shrink-0"}),t("span",{className:"text-sm truncate",children:e.config?.name})]}),t(je,{checked:e.visible,onCheckedChange:(c)=>r(e.id,c)})]})}function Ip({projectId:e,onManageFields:n,onSave:r}){let{fields:a,updateFields:i}=Rr(),[s,c]=u(""),[l,m]=u("list"),[f,x]=u(""),[b,p]=u(""),[F,d]=u(_r.NONE),[M,H]=u(""),[P,y]=u([]),z=Q();h(()=>{z.invalidateQueries({queryKey:["fields",e]})},[e,z]);let w=A.api.projects[":projectId"].fields.order.$patch,{mutate:Z}=U({mutationFn:async(_)=>{if(!(await w(_)).ok)throw Error(af());return null}}),N=A.api.projects[":projectId"].fields.$post,{mutate:g}=U({mutationFn:async(_)=>{let X=await N(_);if(!X.ok)throw Error(of());return await X.json()},onSuccess:(_)=>{let X={..._,visible:!0},J=[...a,X];i(J),x(""),y([]),Z({param:{projectId:e},json:J.map((L)=>({fieldId:L.id,visible:L.visible||!1}))}),r?.()}}),k=O(()=>a.filter((_)=>_.config?.name?.toLowerCase().includes(s.toLowerCase())),[a,s]),j=(_)=>{if(_.canceled)return;let{source:X}=_.operation;if(!$n(X))return;let{initialIndex:J,index:L}=X;if(J===L)return;let W=zc(a,k,J,L);i(W),Z({param:{projectId:e},json:W.map((te)=>({fieldId:te.id,visible:te.visible||!1}))})},ee=(_,X)=>{let J=a.map((L)=>L.id===_?{...L,visible:X}:L);i(J),Z({param:{projectId:e},json:J.map((L)=>({fieldId:L.id,visible:L.visible||!1}))})},Y=()=>{if(!f||!b)return;let _=b===Cr.select?{select:{options:P}}:b===Cr.selectMulti?{selectMulti:{options:P}}:{};g({param:{projectId:e},json:{config:{name:f,type:b,autofillSource:F,..._},label:f,description:M}})},ne=a.filter((_)=>_.visible).length;if(l==="create")return t("div",{className:"w-80 p-4",children:o("div",{className:"space-y-4",children:[o("div",{className:"space-y-2",children:[t(G,{htmlFor:"field-name",children:lf()}),t(q,{id:"field-name",placeholder:Ew(),value:f,onChange:(_)=>x(_.target.value),autoFocus:!0})]}),o("div",{className:"space-y-2",children:[t(G,{children:cf()}),o(he,{children:[t(ge,{asChild:!0,children:o(S,{variant:"outline",className:"w-full justify-between font-normal",children:[b?t("span",{className:"capitalize",children:b.replace(/_/g," ")}):t("span",{className:"text-muted-foreground border-dashed",children:EC()}),t(_e,{className:"ml-2 h-4 w-4 opacity-50"})]})}),t(Ae,{className:"w-[--radix-dropdown-menu-trigger-width]",children:Object.values(Cr).map((_)=>t(V,{onClick:()=>{p(_),y([])},className:"capitalize",children:_.replace(/_/g," ")},_))})]})]}),o("div",{className:"space-y-2",children:[t(G,{htmlFor:"field-desc",children:Wi()}),t(q,{id:"field-desc",placeholder:Bu(),value:M,onChange:(_)=>H(_.target.value)})]}),o("div",{className:"space-y-2",children:[o("div",{className:"flex items-center gap-1",children:[t(G,{children:Zu()}),t(El,{})]}),o(go,{type:"single",value:F,onValueChange:(_)=>{if(_)d(_)},className:"w-full grid grid-cols-3 border rounded-md p-1 gap-1",children:[t(lr,{value:_r.NONE,className:"text-[11px] leading-tight py-1 px-1 h-auto min-h-[32px] w-full text-center justify-center whitespace-normal font-medium",children:uc()}),t(lr,{value:_r.CONTENT,className:"text-[11px] leading-tight py-1 px-1 h-auto min-h-[32px] w-full text-center justify-center whitespace-normal font-medium",children:lc()}),t(lr,{value:_r.CREATION_CONTEXT,className:"text-[11px] leading-tight py-1 px-1 h-auto min-h-[32px] w-full text-center justify-center whitespace-normal font-medium",children:cc()})]})]}),(b===Cr.select||b===Cr.selectMulti)&&o("div",{className:"space-y-2",children:[o("div",{className:"flex items-center justify-between",children:[t(G,{className:"text-sm font-medium",children:Ju()}),o(S,{variant:"ghost",size:"sm",className:"h-8 px-2",onClick:()=>{let _={id:Mo(),displayName:Ku(),color:us(P)};y([...P,_])},children:[t(de,{className:"h-4 w-4 mr-1"})," ",Pu()]})]}),t("div",{className:"space-y-2 max-h-40 overflow-y-auto pr-1",children:P.map((_,X)=>o("div",{className:"flex items-center gap-2",children:[t(q,{value:_.displayName,onChange:(J)=>{let L=[...P];L[X]={..._,displayName:J.target.value},y(L)},placeholder:Mf(),className:"h-8 flex-1"}),o(ht,{children:[t(gt,{asChild:!0,children:t("button",{type:"button",className:"w-6 h-6 rounded-full border shrink-0 cursor-pointer focus:outline-none hover:scale-105 transition-transform",style:{backgroundColor:cs[_.color||""]?.hex||_.color||"#808080"}})}),t(At,{className:"p-2 w-auto",align:"end",children:t("div",{className:"flex gap-1",children:Vs.map((J)=>t("button",{type:"button",className:"w-5 h-5 rounded-full border cursor-pointer hover:scale-110 transition-transform",style:{backgroundColor:cs[J]?.hex||J},onClick:()=>{let L=[...P];L[X]={..._,color:J},y(L)}},J))})})]}),t(S,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>{y(P.filter((J,L)=>L!==X))},children:t(Oe,{className:"h-4 w-4"})})]},_.id))})]}),o("div",{className:"flex gap-2 pt-2",children:[t(S,{variant:"secondary",className:"flex-1",onClick:()=>{m("list"),x(""),p(""),d(_r.NONE),H(""),y([])},children:Re()}),t(S,{className:"flex-1",onClick:Y,disabled:!f||!b,children:So()})]})]})});return o("div",{className:"w-80 p-4",children:[t("div",{className:"flex items-center justify-between mb-4",children:o("h3",{className:"font-semibold",children:[fi()," ",t("span",{className:"text-muted-foreground text-sm font-normal",children:wI({count:ne})})]})}),o("div",{className:"relative mb-4",children:[t(Lt,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),t(q,{placeholder:AC(),value:s,onChange:(_)=>c(_.target.value),className:"pl-8"})]}),t("div",{className:"max-h-60 overflow-y-auto pr-2",children:t(Dn,{sensors:[nn.configure({activationConstraints:[new Ir.Distance({value:8})]}),Lo],onDragEnd:j,children:k.map((_,X)=>t(Fo,{field:_,index:X,onVisibilityChange:ee},_.id))})}),n&&o("div",{className:"mt-4 space-y-2",children:[o(S,{variant:"secondary",className:"w-full",onClick:n,children:[t(Ca,{className:"h-4 w-4 mr-2"}),hf()]}),o(S,{className:"w-full",onClick:()=>m("create"),children:[t(de,{className:"h-4 w-4 mr-2"}),Cw()]})]})]})}var Ro=({value:e,config:n,onSave:r,readOnly:a,fieldId:i})=>{let s=n?.select,c=s?.options||[],[l,m]=u(!1),[f,x]=u(""),b=c.find((w)=>w.id===e),p=f.trim(),F=c.filter((w)=>w.displayName.toLowerCase().includes(p.toLowerCase())),d=c.some((w)=>w.displayName.trim().toLowerCase()===p.toLowerCase()||w.id.toLowerCase()===p.toLowerCase()),M=()=>{if(!a)m(!0)},H=(w)=>{r(w),m(!1),x("")},P=(w)=>{if(a)return;if(m(w),!w)x("")},y=async()=>{if(!p)return;let w={id:p.toLowerCase().replace(/\s+/g,"-"),displayName:p,color:us(c)},Z=[...c,w],N={...n,select:{...s,options:Z}};if(i)try{let g=await A.api.fields[":fieldId"].$put({param:{fieldId:i},json:{config:N}});if(!g.ok){R.error(Ji());return}let k=await g.json(),ee=Rr.getState().fields.map((Y)=>Y.id===k.id?{...Y,...k,visible:Y.visible}:Y);Rr.getState().updateFields(ee)}catch{R.error(Ji());return}r(w.id),x(""),m(!1)};return t("div",{className:"relative w-full",onClick:(w)=>w.stopPropagation(),children:o(ht,{open:!a&&l,onOpenChange:P,children:[t(gt,{asChild:!0,children:o("div",{onClick:M,className:`flex items-center justify-between w-full h-[28px] px-2 rounded border border-transparent transition-colors ${!a?"cursor-pointer hover:bg-accent hover:border-border group":""}`,children:[((w)=>{if(!w)return t("span",{className:"text-muted-foreground italic text-sm",children:"Select an option"});return t("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium h-[22px]",style:ta(w.color),children:w.displayName})})(b),!a&&t(_e,{className:"w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100"})]})}),o(At,{side:"bottom",align:"start",sideOffset:4,className:"p-1.5 w-64 max-h-72 flex flex-col bg-popover border border-border rounded-lg shadow-lg",children:[o("div",{className:"relative pb-1.5 border-b border-border mb-1",onClick:(w)=>w.stopPropagation(),children:[t(Lt,{className:"w-3.5 h-3.5 absolute left-2 top-2 text-muted-foreground"}),t("input",{type:"text",className:"w-full pl-7 pr-2 py-1 text-xs bg-muted/50 border border-input rounded-md focus:outline-none focus:ring-1 focus:ring-ring text-foreground",placeholder:eg(),value:f,onChange:(w)=>x(w.target.value),autoFocus:!0})]}),o("div",{className:"overflow-y-auto max-h-48 min-h-[120px] space-y-0.5",children:[f===""&&o("div",{onClick:()=>H(""),className:"px-2.5 py-1.5 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded cursor-pointer flex items-center gap-2",children:[t(Oe,{className:"w-3.5 h-3.5"})," Clear"]}),F.map((w)=>t("div",{onClick:()=>H(w.id),className:`px-2.5 py-1.5 text-xs hover:bg-accent rounded cursor-pointer flex items-center justify-between ${e===w.id?"bg-accent/50 font-medium":""}`,children:t("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",style:ta(w.color),children:w.displayName})},w.id)),F.length===0&&!p&&t("div",{className:"px-2.5 py-2 text-xs text-muted-foreground italic text-center",children:yh()}),p!==""&&!d&&o("div",{onClick:y,className:"px-2.5 py-1.5 text-xs text-primary hover:bg-accent rounded cursor-pointer flex items-center gap-1.5 font-medium border-t border-border mt-1 pt-1.5",children:[t(de,{className:"w-3.5 h-3.5 shrink-0"}),t("span",{className:"truncate",children:$p({name:p})})]})]})]})]})})},_t=Ro;C();var ko=({value:e=[],config:n,onSave:r,readOnly:a,fieldId:i})=>{let s=n?.selectMulti,c=s?.options||[],l=v(null),[m,f]=u(!1),[x,b]=u(e.length),[p,F]=u(""),d=c.filter((g)=>(e||[]).includes(g.id))||[],M=p.trim(),H=c.filter((g)=>g.displayName.toLowerCase().includes(M.toLowerCase())),P=c.some((g)=>g.displayName.trim().toLowerCase()===M.toLowerCase()||g.id.toLowerCase()===M.toLowerCase());He(()=>{if(m){b(d.length);return}if(l.current){let g=l.current.clientWidth-8,j=document.createElement("canvas").getContext("2d");if(j&&g>0){j.font="500 12px ui-sans-serif, system-ui, sans-serif";let ee=4,Y=d.map((W)=>Math.ceil(j.measureText(W.displayName).width)+18);if(Y.reduce((W,te)=>W+te,0)+Math.max(0,Y.length-1)*ee<=g){b(d.length);return}let X=g-32-ee,J=0,L=0;for(let W=0;W<Y.length;W++){let te=L>0?J+ee+Y[W]:Y[W];if(te>X)break;J=te,L++}b(L)}}},[d,m,e]);let y=(g)=>{let k=e||[],j;if(k.includes(g))j=k.filter((ee)=>ee!==g);else j=[...k,g];r(j)},z=async()=>{if(!M)return;let g={id:M.toLowerCase().replace(/\s+/g,"-"),displayName:M,color:us(c)},k=[...c,g],j={...n,selectMulti:{...s,options:k}};if(i)try{let ee=await A.api.fields[":fieldId"].$put({param:{fieldId:i},json:{config:j}});if(!ee.ok){R.error(Ji());return}let Y=await ee.json(),_=Rr.getState().fields.map((X)=>X.id===Y.id?{...X,...Y,visible:X.visible}:X);Rr.getState().updateFields(_)}catch{R.error(Ji());return}r([...e||[],g.id]),F("")},w=(g)=>{if(g.stopPropagation(),!a)f(!0)},Z=d.length-x;return t("div",{className:"relative w-full",onClick:(g)=>g.stopPropagation(),children:o(ht,{open:!a&&m,onOpenChange:(g)=>{if(a)return;if(f(g),!g)F("")},children:[t(gt,{asChild:!0,children:o("div",{ref:l,onClick:w,className:`w-full px-1 py-1 flex flex-wrap gap-1 rounded border border-transparent transition-all box-border h-[32px] overflow-hidden ${!a||Z>0?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:[d.length===0&&t("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),d.slice(0,x).map((g)=>t("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium border border-transparent whitespace-nowrap h-[22px]",style:ta(g.color),children:g.displayName},g.id)),Z>0&&o("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-muted text-muted-foreground h-[22px]",children:["+",Z]})]})}),o(At,{side:"bottom",align:"start",sideOffset:4,className:"p-1.5 w-64 max-h-72 flex flex-col bg-popover border border-border rounded-lg shadow-lg",children:[o("div",{className:"relative pb-1.5 border-b border-border mb-1",onClick:(g)=>g.stopPropagation(),children:[t(Lt,{className:"w-3.5 h-3.5 absolute left-2 top-2 text-muted-foreground"}),t("input",{type:"text",className:"w-full pl-7 pr-2 py-1 text-xs bg-muted/50 border border-input rounded-md focus:outline-none focus:ring-1 focus:ring-ring text-foreground",placeholder:eg(),value:p,onChange:(g)=>F(g.target.value),autoFocus:!0})]}),o("div",{className:"overflow-y-auto max-h-48 min-h-[120px] space-y-0.5",children:[H.map((g)=>{let k=(e||[]).includes(g.id);return o("div",{onClick:()=>y(g.id),className:`px-2.5 py-1.5 hover:bg-accent rounded cursor-pointer flex items-center justify-between text-xs ${k?"bg-accent/30 font-medium":""}`,children:[t("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",style:ta(g.color),children:g.displayName}),k&&t(Te,{className:"w-3.5 h-3.5 text-primary"})]},g.id)}),H.length===0&&!M&&t("div",{className:"px-2.5 py-2 text-xs text-muted-foreground italic text-center",children:yh()}),M!==""&&!P&&o("div",{onClick:z,className:"px-2.5 py-1.5 text-xs text-primary hover:bg-accent rounded cursor-pointer flex items-center gap-1.5 font-medium border-t border-border mt-1 pt-1.5",children:[t(de,{className:"w-3.5 h-3.5 shrink-0"}),t("span",{className:"truncate",children:$p({name:M})})]})]})]})]})})},Ft=ko;C();var Io=({value:e,onSave:n,readOnly:r})=>{let[a,i]=u(!1),[s,c]=u(e||""),l=v(null);h(()=>{c(e||"")},[e]),h(()=>{if(a&&l.current)l.current.focus()},[a]);let m=()=>{if(!r)i(!0)},f=()=>{i(!1),n(s)},x=(b)=>{if(b.key==="Enter")l.current?.blur()};if(a)return t("input",{ref:l,type:"text",value:s,onChange:(b)=>c(b.target.value),onBlur:f,onKeyDown:x,className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm outline-none shadow-sm"});return t("div",{onClick:m,className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded truncate border border-transparent transition-colors ${!r?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:e||t("span",{className:"text-muted-foreground italic",children:"Empty"})})},Mt=Io;var Do=({value:e,onSave:n,readOnly:r})=>t("div",{className:"flex items-center h-[28px] w-full",onClick:(i)=>i.stopPropagation(),children:t(je,{checked:e,onCheckedChange:(i)=>{if(!r)n(i)},disabled:r,className:"cursor-pointer"})}),Rt=Do;C();var Po=({value:e,onSave:n,readOnly:r})=>{let a=Vo(),{members:i,fetchMembers:s}=Dr(),[c,l]=u(!1);h(()=>{if(a)s(a)},[a,s]);let m=i.find((d)=>d.id===e),f=()=>{if(!r)l(!0)},x=(d)=>{n(d),l(!1)},b=(d)=>{if(r)return;l(d)},p=(d)=>d.split(" ").map((M)=>M[0]).slice(0,2).join("").toUpperCase();return t("div",{className:"relative w-full",onClick:(d)=>d.stopPropagation(),children:o(ht,{open:!r&&c,onOpenChange:b,children:[t(gt,{asChild:!0,children:o("div",{onClick:f,className:`flex items-center justify-between w-full h-[28px] px-2 rounded border border-transparent transition-colors ${!r?"cursor-pointer hover:bg-accent hover:border-border group":""}`,children:[((d)=>{if(!d)return t("span",{className:"text-muted-foreground italic text-sm",children:"Select user"});return o("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium bg-muted text-foreground border h-[22px]",children:[o(Ce,{className:"w-4 h-4",children:[t(Ee,{src:d.image,alt:d.name,className:"object-cover"}),t(Ie,{className:"text-[8px] bg-rose-400 text-black font-semibold",children:p(d.name)})]}),t("span",{className:"truncate max-w-[120px]",children:d.name})]})})(m),!r&&t(_e,{className:"w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100"})]})}),o(At,{className:"p-1 w-[--radix-popover-trigger-width] min-w-[200px] max-h-60 overflow-auto bg-popover border border-border rounded-lg shadow-lg",align:"start",children:[o("div",{onClick:()=>x(""),className:"px-3 py-2 text-sm text-muted-foreground hover:bg-accent cursor-pointer flex items-center gap-2 rounded-sm",children:[t(Oe,{className:"w-3 h-3"})," Clear"]}),i.map((d)=>o("div",{onClick:()=>x(d.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center gap-2 rounded-sm",children:[o(Ce,{className:"w-5 h-5",children:[t(Ee,{src:d.image,alt:d.name,className:"object-cover"}),t(Ie,{className:"text-[10px] bg-rose-400 text-black font-semibold",children:p(d.name)})]}),t("span",{className:"text-sm font-medium text-foreground",children:d.name})]},d.id))]})]})})},kt=Po;C();var Ao=({value:e=[],onSave:n,readOnly:r})=>{let a=Vo(),{members:i,fetchMembers:s}=Dr(),c=v(null),[l,m]=u(!1),[f,x]=u(e.length);h(()=>{if(a)s(a)},[a,s]);let b=i.filter((y)=>(e||[]).includes(y.id)),p=(y)=>y.split(" ").map((z)=>z[0]).slice(0,2).join("").toUpperCase();He(()=>{if(l){x(b.length);return}if(c.current){let y=c.current.clientWidth-8,w=document.createElement("canvas").getContext("2d");if(w&&y>0){w.font="500 12px ui-sans-serif, system-ui, sans-serif";let Z=4,N=b.map((ne)=>Math.min(100,Math.ceil(w.measureText(ne.name).width))+40);if(N.reduce((ne,_)=>ne+_,0)+Math.max(0,N.length-1)*Z<=y){x(b.length);return}let j=y-32-Z,ee=0,Y=0;for(let ne=0;ne<N.length;ne++){let _=Y>0?ee+Z+N[ne]:N[ne];if(_>j)break;ee=_,Y++}x(Y)}}},[b,l,e]);let F=(y)=>{let z=e||[],w;if(z.includes(y))w=z.filter((Z)=>Z!==y);else w=[...z,y];n(w)},d=(y)=>{if(y.stopPropagation(),!r)m(!0)},M=b.length-f,H=(y)=>{if(r)return;m(y)},P=(y)=>o("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium bg-muted text-foreground border whitespace-nowrap h-[22px]",children:[o(Ce,{className:"w-4 h-4",children:[t(Ee,{src:y.image,alt:y.name,className:"object-cover"}),t(Ie,{className:"text-[8px] bg-rose-400 text-black font-semibold",children:p(y.name)})]}),t("span",{className:"truncate max-w-[100px]",children:y.name})]},y.id);return t("div",{className:"relative w-full",onClick:(y)=>y.stopPropagation(),children:o(ht,{open:!r&&l,onOpenChange:H,children:[t(gt,{asChild:!0,children:o("div",{ref:c,onClick:d,className:`w-full px-1 py-1 flex flex-wrap gap-1 rounded border border-transparent transition-all box-border h-[32px] overflow-hidden ${!r||M>0?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:[b.length===0&&t("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),b.slice(0,f).map(P),M>0&&o("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-muted text-muted-foreground h-[22px]",children:["+",M]})]})}),t(At,{className:"p-1 w-[--radix-popover-trigger-width] min-w-[200px] max-h-60 overflow-auto bg-popover border border-border rounded-lg shadow-lg",align:"start",children:i.map((y)=>{let z=(e||[]).includes(y.id);return o("div",{onClick:()=>F(y.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center justify-between rounded-sm",children:[o("div",{className:"flex items-center gap-2",children:[o(Ce,{className:"w-5 h-5",children:[t(Ee,{src:y.image,alt:y.name,className:"object-cover"}),t(Ie,{className:"text-[10px] bg-rose-400 text-black font-semibold",children:p(y.name)})]}),t("span",{className:"text-sm font-medium text-foreground",children:y.name})]}),z&&t(Te,{className:"w-4 h-4 text-primary"})]},y.id)})})]})})},Tt=Ao;var Oo=(e)=>{if(!e.config)return t("div",{children:"Unknown Field Type"});switch(e.config.type){case"text":return t(Mt,{...e,value:e.value,onSave:e.onSave});case"longText":return t(tt,{...e,value:e.value,onSave:e.onSave});case"select":return t(_t,{...e,value:e.value,onSave:e.onSave});case"selectMulti":return t(Ft,{...e,value:e.value,onSave:e.onSave});case"rating":return t(Fc,{...e,value:e.value,onSave:e.onSave});case"number":return t(ot,{...e,value:e.value,onSave:e.onSave});case"toggle":return t(Rt,{...e,value:e.value,onSave:e.onSave});case"date":return t(et,{...e,value:e.value,onSave:e.onSave});case"user":return t(kt,{...e,value:e.value,onSave:e.onSave});case"userMulti":return t(Tt,{...e,value:e.value,onSave:e.onSave});default:return t("div",{children:"Unknown Field Type"})}},ra=Oo;C();function Ea({className:e,defaultValue:n,value:r,min:a=0,max:i=100,...s}){let c=O(()=>Array.isArray(r)?r:Array.isArray(n)?n:[a,i],[r,n,a,i]);return o(oo,{"data-slot":"slider",defaultValue:n,value:r,min:a,max:i,className:E("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e),...s,children:[t(io,{"data-slot":"slider-track",className:E("relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:t(so,{"data-slot":"slider-range",className:E("absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:c.length},(l,m)=>t(fo,{"data-slot":"slider-thumb",className:"block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},m))]})}
|
|
2
|
+
export{To,Ca,Si,zc,Ci,Rr,Mo,ea,Fc,El,Vs,cs,ta,us,Ks,Ip,ra,Ea};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Pe,sr}from"./chunk-83e12sjg.js";import{Tn,$r,ln}from"./chunk-v9b3w8q5.js";var n=class{get supportsCreateIfNotExists(){return!0}get supportsTransactionalDdl(){return!1}get supportsReturning(){return!0}async acquireMigrationLock(){}async releaseMigrationLock(){}get supportsOutput(){return!0}},s=class{#e;#t=new o;#r;#a;constructor(e){this.#e={...e}}async init(){if(this.#r=this.#e.database,this.#a=new i(this.#r),this.#e.onCreateConnection)await this.#e.onCreateConnection(this.#a)}async acquireConnection(){return await this.#t.lock(),this.#a}async beginTransaction(e){await e.executeQuery(sr.raw("begin"))}async commitTransaction(e){await e.executeQuery(sr.raw("commit"))}async rollbackTransaction(e){await e.executeQuery(sr.raw("rollback"))}async releaseConnection(){this.#t.unlock()}async destroy(){this.#r?.close()}},i=class{#e;constructor(e){this.#e=e}executeQuery(e){let{sql:r,parameters:a}=e,t=this.#e.prepare(r).all(...a);return Promise.resolve({rows:t})}async*streamQuery(){throw Error("Streaming query is not supported by SQLite driver.")}},o=class{#e;#t;async lock(){while(this.#e!==void 0)await this.#e;this.#e=new Promise((e)=>{this.#t=e})}unlock(){let e=this.#t;this.#e=void 0,this.#t=void 0,e?.()}},c=class{#e;constructor(e){this.#e=e}async getSchemas(){return[]}async getTables(e={withInternalKyselyTables:!1}){let r=this.#e.selectFrom("sqlite_schema").where("type","=","table").where("name","not like","sqlite_%").select("name").$castTo();if(!e.withInternalKyselyTables)r=r.where("name","!=",$r).where("name","!=",ln);let a=await r.execute();return Promise.all(a.map(({name:t})=>this.#t(t)))}async getMetadata(e){return{tables:await this.getTables(e)}}async#t(e){let r=this.#e,a=(await r.selectFrom("sqlite_master").where("name","=",e).select("sql").$castTo().execute())[0]?.sql?.split(/[\(\),]/)?.find((t)=>t.toLowerCase().includes("autoincrement"))?.split(/\s+/)?.[0]?.replace(/["`]/g,"");return{name:e,columns:(await r.selectFrom(Pe`pragma_table_info(${e})`.as("table_info")).select(["name","type","notnull","dflt_value"]).execute()).map((t)=>({name:t.name,dataType:t.type,isNullable:!t.notnull,isAutoIncrementing:t.name===a,hasDefaultValue:t.dflt_value!=null})),isView:!0}}},l=class extends Tn{getCurrentParameterPlaceholder(){return"?"}getLeftIdentifierWrapper(){return'"'}getRightIdentifierWrapper(){return'"'}getAutoIncrement(){return"autoincrement"}},m=class{#e;constructor(e){this.#e={...e}}createDriver(){return new s(this.#e)}createQueryCompiler(){return new l}createAdapter(){return new n}createIntrospector(e){return new c(e)}};export{m as NodeSqliteDialect};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h,O,u,C,B,t,o,Q,L,U,ct,Ue,A,T,or,Z,Fr,bt,Pn,jr,ft,ii,Xt,Aa,lo,de,co,ve,Oe,E,S,Ce,Ee,Ie,he,ge,Ae,V,fm,gm,Re,Dy,Fy,fc,g0,A0,Yd,at,H0,G0,t_,r_,Uu,f_,Pm,An,kb,Pb,Nb,Ob,Db,Zb,Lb,Gu,cv,mw,dh,Uw,Yw,Sh,Gh,va,ld,Kf,cd,fg,np,TE,ME,pg,mg,hg,gg,Ag,dd,yg,OE,Wo,We,Ye,Je,Xe,et,tt,rt,nt,fe,ce,pe,qe,ue,It,q,se,Lo,Ir,nn,Dn,Jo,Tr,md,Tt,R,we,ir,Ge,Or,Ja,Rg,Vn,gp,zs,Fs,Xa,G,je,De,Ze,Le,Be,re,es,yd,_d,bd,wd}from"./chunk-6bhn1p8v.js";import{bi}from"./chunk-pb1zf0vb.js";import{Yr}from"./chunk-m7m9d4fb.js";import{Ln,Xn}from"./chunk-2yxj593j.js";C();var it=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],Ne=T("pen",it);function Te({scope:e,onScopeChange:r,selectedGoal:x,onClearGoal:p,onCreateTask:w,canCreateTask:v=!0}){return o("header",{className:"h-14 border-b border-border bg-card/60 backdrop-blur-sm px-4 flex items-center justify-between gap-3 shrink-0 select-none",children:[o("div",{className:"flex items-center gap-3 min-w-0",children:[o("div",{className:"flex items-center bg-muted/60 p-0.5 rounded-lg border border-border/50",children:[o(S,{variant:e==="team"?"secondary":"ghost",size:"sm",onClick:()=>r("team"),className:`h-7 px-2.5 text-xs font-medium gap-1.5 transition-all ${e==="team"?"bg-background text-foreground shadow-xs":"text-muted-foreground hover:text-foreground"}`,children:[t(Xn,{className:"w-3.5 h-3.5"}),t("span",{children:OE()})]}),o(S,{variant:e==="my"?"secondary":"ghost",size:"sm",onClick:()=>r("my"),className:`h-7 px-2.5 text-xs font-medium gap-1.5 transition-all ${e==="my"?"bg-background text-foreground shadow-xs":"text-muted-foreground hover:text-foreground"}`,children:[t(Ln,{className:"w-3.5 h-3.5"}),t("span",{children:mw()})]})]}),x&&o("div",{className:"hidden sm:flex items-center gap-1.5 px-2 py-1 rounded-md bg-sidebar-accent border border-sidebar-border text-xs text-sidebar-accent-foreground min-w-0 max-w-[200px] md:max-w-[280px]",children:[t(co,{className:"w-3.5 h-3.5 text-sidebar-primary shrink-0"}),t("span",{className:"truncate font-medium",children:x.id===Ja?Wo():x.title}),t(S,{variant:"ghost",size:"icon-xs",onClick:p,className:"h-4 w-4 p-0 ml-0.5 text-muted-foreground hover:text-foreground",title:Fy(),children:t(Oe,{className:"w-3 h-3"})})]})]}),v&&t("div",{className:"flex items-center gap-2 shrink-0",children:o(S,{size:"sm",onClick:w,className:"h-8 px-3 text-xs gap-1.5 shadow-xs",children:[t(de,{className:"w-3.5 h-3.5"}),t("span",{children:Yd()})]})})]})}C();C();function me({teamId:e,isOpen:r,onClose:x,goalToEdit:p}){let w=Q(),[v,I]=u(""),[g,K]=u("");h(()=>{if(p)I(p.title),K(p.description||"");else I(""),K("")},[p,r]);let{mutate:P,isPending:M}=U({mutationFn:async()=>{let n=await A.api.teams[":teamId"].kanban.goals.$post({param:{teamId:e},json:{title:v.trim(),description:g.trim()||void 0}});if(!n.ok){let b=await n.json().catch(()=>({message:An()}));throw Error(b.message||An())}return await n.json()},onSuccess:()=>{w.invalidateQueries({queryKey:["teams",e,"kanban","goals"]}),R.success(kb()),x()},onError:(n)=>{R.error(n.message)}}),{mutate:j,isPending:_}=U({mutationFn:async()=>{if(!p)return;let n=await A.api.teams[":teamId"].kanban.goals[":goalId"].$patch({param:{teamId:e,goalId:p.id},json:{title:v.trim(),description:g.trim()||null}});if(!n.ok){let b=await n.json().catch(()=>({message:An()}));throw Error(b.message||An())}return await n.json()},onSuccess:()=>{w.invalidateQueries({queryKey:["teams",e,"kanban","goals"]}),R.success(Lb()),x()},onError:(n)=>{R.error(n.message)}}),H=(n)=>{if(n.preventDefault(),!v.trim())return;if(p)j();else P()},d=M||_;return t(fe,{open:r,onOpenChange:(n)=>!n&&x(),children:t(ce,{className:"sm:max-w-xl",children:o("form",{onSubmit:H,className:"space-y-4",children:[o(pe,{children:[t(ue,{children:p?Pm():A0()}),t(It,{children:p?Pm():g0()})]}),o("div",{className:"space-y-3 py-2",children:[o("div",{className:"space-y-1.5",children:[t(G,{htmlFor:"goal-title",children:Db()}),t(q,{id:"goal-title",value:v,onChange:(n)=>I(n.target.value),placeholder:Zb(),required:!0,autoFocus:!0})]}),o("div",{className:"space-y-1.5",children:[t(G,{htmlFor:"goal-description",children:Nb()}),t(Xa,{id:"goal-description",value:g,onChange:(n)=>K(n.target.value),placeholder:Ob(),rows:3})]})]}),o(qe,{children:[t(S,{type:"button",variant:"outline",onClick:x,disabled:d,children:Re()}),o(S,{type:"submit",disabled:!v.trim()||d,children:[d&&t(Z,{className:"w-4 h-4 mr-1.5 animate-spin"}),p?va():fc()]})]})]})})})}function Se({teamId:e,selectedGoalId:r,onSelectGoal:x,isOwnerOrEditor:p=!0}){let w=Q(),[v,I]=u(!1),[g,K]=u(null),[P,M]=u(null),[j,_]=u(!1),{data:H,isLoading:d}=L({queryKey:["teams",e,"kanban","goals"],queryFn:async()=>{let i=await A.api.teams[":teamId"].kanban.goals.$get({param:{teamId:e},query:{}});if(!i.ok)throw Error("Failed to fetch goals");return await i.json()},enabled:!!e}),n=H?.data||[],b=n.reduce((i,s)=>i+(s.taskCount||0),0),{mutate:N,isPending:l}=U({mutationFn:async(i)=>{let s=await A.api.teams[":teamId"].kanban.goals[":goalId"].$delete({param:{teamId:e,goalId:i}});if(!s.ok){let m=await s.json().catch(()=>({message:An()}));throw Error(m.message||An())}return await s.json()},onSuccess:(i,s)=>{if(w.invalidateQueries({queryKey:["teams",e,"kanban","goals"]}),w.invalidateQueries({queryKey:["teams",e,"kanban","tasks"]}),R.success(Pb()),r===s)x(null);M(null)},onError:(i)=>{R.error(i.message)}});if(j)return o("div",{className:"border-r border-sidebar-border bg-sidebar flex flex-col items-center w-12 shrink-0 transition-all duration-300",children:[t("div",{className:"h-14 flex items-center justify-center border-b border-sidebar-border w-full shrink-0",children:t(S,{variant:"ghost",size:"icon-sm",onClick:()=>_(!1),title:Gu(),className:"text-sidebar-foreground/70 hover:text-sidebar-foreground",children:t(ft,{className:"w-4 h-4"})})}),o("div",{className:"mt-3 flex flex-col items-center gap-2",children:[t(S,{variant:r===null?"secondary":"ghost",size:"icon-sm",onClick:()=>x(null),title:fm(),className:E("w-8 h-8 rounded-md",r===null&&"bg-sidebar-accent text-sidebar-accent-foreground"),children:t(bi,{className:"w-4 h-4"})}),t(S,{variant:"ghost",size:"icon-sm",onClick:()=>I(!0),title:dh(),className:"w-8 h-8 rounded-md text-sidebar-foreground/70 hover:text-sidebar-foreground",children:t(de,{className:"w-4 h-4"})})]}),v&&t(me,{teamId:e,isOpen:v,onClose:()=>I(!1)})]});return o("aside",{className:"w-64 border-r border-sidebar-border bg-sidebar flex flex-col shrink-0 transition-all duration-300 select-none",children:[o("div",{className:"h-14 px-3 flex items-center justify-between border-b border-sidebar-border shrink-0",children:[o("div",{className:"flex items-center gap-2 font-semibold text-xs tracking-wider uppercase text-sidebar-foreground/70",children:[t(co,{className:"w-4 h-4 text-sidebar-primary"}),t("span",{children:Gu()})]}),o("div",{className:"flex items-center gap-1",children:[p&&t(S,{variant:"ghost",size:"icon-sm",onClick:()=>I(!0),className:"h-7 w-7 text-sidebar-foreground/70 hover:text-sidebar-foreground",title:dh(),children:t(de,{className:"w-4 h-4"})}),t(S,{variant:"ghost",size:"icon-sm",onClick:()=>_(!0),className:"h-7 w-7 text-sidebar-foreground/70 hover:text-sidebar-foreground",title:"Collapse",children:t(jr,{className:"w-4 h-4"})})]})]}),t(se,{className:"flex-1 p-2",children:o("div",{className:"space-y-1",children:[o("div",{onClick:()=>x(null),className:E("flex items-center justify-between px-2.5 py-1 rounded-md text-xs font-medium cursor-pointer transition-colors group h-8 min-h-[32px]",r===null?"bg-sidebar-accent text-sidebar-accent-foreground font-semibold shadow-xs":"text-sidebar-foreground/70 hover:bg-sidebar-accent/50 hover:text-sidebar-foreground"),children:[o("div",{className:"flex items-center gap-2 truncate min-w-0",children:[t(bi,{className:"w-3.5 h-3.5 shrink-0 text-sidebar-primary"}),t("span",{className:"truncate",children:fm()})]}),b>0&&t("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-sidebar-border text-sidebar-foreground/60 shrink-0",children:b})]}),d?t("div",{className:"flex items-center justify-center p-4",children:t(Z,{className:"w-4 h-4 animate-spin text-muted-foreground"})}):n.length===0?t("div",{className:"px-2.5 py-4 text-center text-xs text-muted-foreground",children:Uw()}):n.map((i)=>{let s=r===i.id,m=i.id===Ja,k=m?Wo():i.title,f=p&&!m;return o("div",{onClick:()=>x(i.id),className:E("flex items-center justify-between px-2.5 py-1 rounded-md text-xs font-medium cursor-pointer transition-colors group relative min-h-[32px]",s?"bg-sidebar-accent text-sidebar-accent-foreground font-semibold shadow-xs":"text-sidebar-foreground/70 hover:bg-sidebar-accent/50 hover:text-sidebar-foreground"),children:[o("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[t(co,{className:E("w-3.5 h-3.5 shrink-0",s?"text-sidebar-primary":"text-muted-foreground")}),t("span",{className:"line-clamp-2 break-words leading-tight",title:k,children:k})]}),t("div",{className:"flex items-center shrink-0 ml-1",children:f?o(B,{children:[(i.taskCount??0)>0&&t("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-sidebar-border text-sidebar-foreground/60 group-hover:hidden group-focus-within:hidden [&:has(~_div_[data-state=open])]:hidden",children:i.taskCount}),t("div",{className:"hidden group-hover:flex group-focus-within:flex [&:has([data-state=open])]:flex items-center",onClick:(c)=>c.stopPropagation(),children:o(he,{modal:!1,children:[t(ge,{asChild:!0,children:t(S,{variant:"ghost",size:"icon-xs",className:"h-6 w-6 p-0 text-muted-foreground hover:text-foreground",children:t(or,{className:"w-3.5 h-3.5"})})}),o(Ae,{align:"end",className:"w-36",children:[o(V,{onClick:()=>{K(i)},children:[t(Ne,{className:"w-3.5 h-3.5 mr-2"}),f_()]}),o(V,{className:"text-destructive focus:text-destructive focus:bg-destructive/10",onClick:()=>{M(i)},children:[t(ve,{className:"w-3.5 h-3.5 mr-2"}),at()]})]})]})})]}):(i.taskCount??0)>0&&t("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-sidebar-border text-sidebar-foreground/60",children:i.taskCount})})]},i.id)})]})}),(v||g)&&t(me,{teamId:e,isOpen:v||!!g,goalToEdit:g,onClose:()=>{I(!1),K(null)}}),P&&t(We,{open:!!P,onOpenChange:(i)=>!i&&M(null),children:o(Ye,{children:[o(Je,{children:[t(et,{children:H0()}),t(tt,{children:G0({title:P.title})})]}),o(Xe,{children:[t(nt,{disabled:l,children:Re()}),o(rt,{onClick:()=>N(P.id),disabled:l,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[l&&t(Z,{className:"w-4 h-4 mr-1.5 animate-spin"}),at()]})]})]})})]})}C();C();function Ke(e){return+we(e)<Date.now()}function _e({task:e,onClick:r,onDelete:x,disabled:p,isFirst:w,isLast:v,showBottomIndicator:I,currentUserId:g,currentUserRole:K}){let{source:P}=md(),M=!!P,j=K?.toLowerCase()==="owner",_=K?.toLowerCase()==="editor",H=!!g&&e.creator?.id===g,d=e.reporter?.id===g||H,n=e.assignee?.id===g,b=j||_||d||n,N=H||j||d,l=p||!b,{ref:i,isDragging:s}=Jo({id:e.id,data:{type:"kanban_task",task:e},disabled:l}),{ref:m,isDropTarget:k}=Tr({id:`reorder-before-${e.id}`,data:{type:"reorder",task:e,position:"before"},disabled:s||p}),{ref:f,isDropTarget:c}=Tr({id:`reorder-after-${e.id}`,data:{type:"reorder",task:e,position:"after"},disabled:s||p}),D=e.isAgentTask,F=e.status===Ge.BLOCKED,y=e.dueDate?Ke(new Date(e.dueDate))&&e.status!==Ge.DONE:!1;return o("div",{className:"relative",children:[t("div",{ref:m,className:E("absolute left-0 right-0 z-20",w?"-top-6 h-[calc(50%+24px)]":"-top-1 h-[calc(50%+4px)]",M&&!s?"pointer-events-auto":"pointer-events-none")}),t("div",{ref:f,className:E("absolute bottom-0 left-0 right-0 z-20",v?"-bottom-6 h-[calc(50%+24px)]":"h-1/2",M&&!s?"pointer-events-auto":"pointer-events-none")}),k&&!s&&t("div",{className:"absolute -top-1.5 left-0 right-0 h-[3px] rounded-full bg-primary shadow-[0_0_8px_rgba(var(--primary),0.6)] z-30 pointer-events-none"}),(c||I)&&!s&&t("div",{className:"absolute -bottom-1.5 left-0 right-0 h-[3px] rounded-full bg-primary shadow-[0_0_8px_rgba(var(--primary),0.6)] z-30 pointer-events-none"}),o("div",{ref:i,onClick:()=>r(e),className:E("group relative flex flex-col gap-2 p-3 rounded-lg border text-card-foreground transition-all duration-200 cursor-pointer select-none",s&&"opacity-40 scale-95 shadow-lg ring-2 ring-primary",!s&&"hover:shadow-md","border-border/80 bg-card hover:border-primary/50 shadow-2xs",F&&"border-red-500/60 bg-red-500/[0.03] ring-1 ring-red-500/20"),children:[o("div",{className:"flex items-center justify-between gap-1.5 min-w-0",children:[o("div",{className:"flex items-center gap-1.5 min-w-0 flex-1",children:[t("span",{className:E("px-1.5 py-0.5 rounded text-[10px] font-medium border uppercase tracking-wider shrink-0",Fs(e.priority)),children:zs(e.priority)}),D&&o("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-semibold bg-orange-500/15 text-orange-600 dark:text-orange-400 border border-orange-500/30 shrink-0",children:[t(bt,{className:"w-3 h-3"}),t("span",{children:dd()})]}),e.goal&&o("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-muted text-muted-foreground border border-border/70 truncate max-w-[130px]",children:[t(co,{className:"w-2.5 h-2.5 shrink-0"}),t("span",{className:"truncate",children:e.goal.title})]})]}),t("div",{className:"flex items-center gap-1 shrink-0",children:N&&t("div",{className:"opacity-0 group-hover:opacity-100 [&:has([data-state=open])]:opacity-100 focus-within:opacity-100 transition-opacity flex items-center",onClick:(X)=>X.stopPropagation(),children:o(he,{modal:!1,children:[t(ge,{asChild:!0,children:t(S,{variant:"ghost",size:"icon-xs",className:"h-5 w-5 p-0 text-muted-foreground hover:text-foreground",children:t(or,{className:"w-3.5 h-3.5"})})}),t(Ae,{align:"end",className:"w-32",children:o(V,{className:"text-destructive focus:text-destructive focus:bg-destructive/10",onClick:()=>x?.(e),children:[t(ve,{className:"w-3.5 h-3.5 mr-2"}),at()]})})]})})})]}),t("h4",{className:"text-xs font-semibold leading-snug line-clamp-2 text-foreground break-words",children:e.title}),F&&o("div",{className:"flex items-start gap-1.5 p-1.5 rounded bg-red-500/10 border border-red-500/20 text-[11px] text-red-600 dark:text-red-400",children:[t(Fr,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),t("span",{className:"line-clamp-2 break-words",children:e.latestStatusEvent?.blockReason||e.latestStatusEvent?.reason||e.latestStatusEvent?.summary||fg()})]}),e.status===Ge.IN_REVIEW&&e.latestStatusEvent?.summary&&o("div",{className:"flex items-start gap-1.5 p-1.5 rounded bg-purple-500/10 border border-purple-500/20 text-[11px] text-purple-600 dark:text-purple-400",children:[t(Yr,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),t("span",{className:"line-clamp-2 break-words",children:e.latestStatusEvent.summary})]}),o("div",{className:"flex items-center justify-between gap-2 pt-1 mt-auto border-t border-border/40 text-[11px] text-muted-foreground",children:[t("div",{className:"flex items-center gap-1.5 min-w-0",children:e.assignee?o(B,{children:[D?t("div",{className:"w-5 h-5 rounded-full bg-orange-500/15 border border-orange-500/30 flex items-center justify-center shrink-0",children:t(bt,{className:"w-3 h-3 text-orange-600 dark:text-orange-400"})}):o(Ce,{size:"sm",className:"w-5 h-5 border border-border",children:[t(Ee,{src:e.assignee.image}),t(Ie,{className:"text-[9px]",children:e.assignee.name.slice(0,2).toUpperCase()})]}),t("span",{className:"truncate text-xs font-medium text-foreground/80 max-w-[90px]",children:e.assignee.name})]}):t("span",{className:"text-[11px] italic text-muted-foreground/60",children:Wo()})}),o("div",{className:"flex items-center gap-2 shrink-0",children:[e.dueDate&&o("div",{className:E("flex items-center gap-1 text-[10px] font-mono",y?"text-red-500 font-semibold":"text-muted-foreground"),title:ir(new Date(e.dueDate),"yyyy/MM/dd HH:mm"),children:[t(Pn,{className:"w-3 h-3"}),t("span",{children:ir(new Date(e.dueDate),"MM/dd")})]}),e.assetCount>0&&o("div",{className:"flex items-center gap-0.5 text-[10px] text-muted-foreground hover:text-foreground",title:cv({count:e.assetCount}),children:[t(ii,{className:"w-3 h-3"}),t("span",{children:e.assetCount})]}),e.dependencyCount>0&&o("div",{className:"flex items-center gap-0.5 text-[10px] text-muted-foreground hover:text-foreground",title:`${e.dependencyCount} dependencies`,children:[t(Aa,{className:"w-3 h-3"}),t("span",{children:e.dependencyCount})]}),e.commentCount>0&&o("div",{className:"flex items-center gap-0.5 text-[10px] text-muted-foreground hover:text-foreground",title:`${e.commentCount} comments`,children:[t(lo,{className:"w-3 h-3"}),t("span",{children:e.commentCount})]})]})]})]})]})}function Pe({teamId:e,status:r,selectedGoalId:x,scope:p,currentUserId:w,currentUserRole:v,onTaskClick:I,onDeleteTask:g,onCreateTaskInColumn:K}){let P=v?.toLowerCase()==="owner"||v?.toLowerCase()==="editor",M=p==="my"?w:void 0,{data:j,fetchNextPage:_,hasNextPage:H,isFetchingNextPage:d,isLoading:n}=ct({queryKey:["teams",e,"kanban","tasks",{status:r,goalId:x,assigneeId:M}],queryFn:async({pageParam:z=""})=>{let W=await A.api.teams[":teamId"].kanban.tasks.$get({param:{teamId:e},query:{status:r,goalId:x||void 0,assigneeId:M||void 0,first:"20",after:z||void 0}});if(!W.ok)throw Error("Failed to fetch column tasks");return await W.json()},initialPageParam:"",getNextPageParam:(z)=>z.pageInfo?.cursor||void 0,refetchInterval:5000,enabled:!!e}),{ref:b,inView:N}=Tt({threshold:0.1});h(()=>{if(N&&H&&!d)_()},[N,H,d,_]);let l=O(()=>j?.pages?.flatMap((z)=>Array.isArray(z?.data)?z.data:[])||[],[j]),{source:i,target:s}=md(),m=l.filter((z)=>z.id!==i?.id).at(-1),{ref:k,isDropTarget:f}=Tr({id:r,data:{type:"kanban_column",status:r,lastTask:m}}),c=i?.data?.type==="kanban_task",D=c&&(f||s?.data?.type==="kanban_column"&&s.data.status===r||s?.data?.type==="reorder"&&s.data.task?.status===r),F=c&&s?.data?.type==="kanban_column"&&s.data.status===r,y=j?.pages?.[0]?.pageInfo?.total??l.length,X=gp(r);return o("div",{ref:k,className:E("flex flex-col h-full max-h-full w-80 md:w-84 shrink-0 rounded-xl bg-card/60 border border-border/70 shadow-xs transition-colors duration-200 overflow-hidden select-none",D&&"ring-2 ring-primary/60 bg-primary/[0.03] border-primary/40"),children:[o("div",{className:"h-11 px-3.5 flex items-center justify-between border-b border-border/60 bg-card/80 shrink-0",children:[o("div",{className:"flex items-center gap-2 min-w-0",children:[t("div",{className:E("w-2.5 h-2.5 rounded-full shrink-0",X.dot)}),t("h3",{className:"text-xs font-bold tracking-wide uppercase text-foreground/90 truncate",children:Vn(r)})]}),t("div",{className:"flex items-center gap-1 shrink-0",children:t("span",{className:"text-[11px] font-mono px-2 py-0.5 rounded-full bg-muted font-medium text-muted-foreground",children:y})})]}),t(se,{className:"flex-1 min-h-0 [&>div>div]:block!",children:o("div",{className:"p-2.5 space-y-2.5 min-h-full flex flex-col",children:[n?t("div",{className:"flex items-center justify-center py-10",children:t(Z,{className:"w-5 h-5 animate-spin text-muted-foreground"})}):l.length===0?t("div",{className:"flex flex-col items-center justify-center py-10 px-4 text-center",children:t("p",{className:"text-xs text-muted-foreground/70",children:Yw()})}):l.map((z,W)=>t(_e,{task:z,onClick:I,onDelete:g,isFirst:W===0,isLast:W===l.length-1,showBottomIndicator:F&&z.id===m?.id,currentUserId:w,currentUserRole:v},z.id)),t("div",{ref:b,className:"h-2"}),d&&t("div",{className:"flex justify-center py-2",children:t(Z,{className:"w-4 h-4 animate-spin text-muted-foreground"})})]})}),P&&t("div",{className:"p-2 border-t border-border/50 bg-card/90 shrink-0",children:o(S,{variant:"ghost",size:"sm",onClick:()=>K(r),className:"w-full justify-center h-8 text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-muted/80 border border-dashed border-border/80",children:[t(de,{className:"w-3.5 h-3.5 mr-1.5"}),t("span",{children:Yd()})]})})]})}function Fe({teamId:e,selectedGoalId:r,scope:x,currentUserId:p,currentUserRole:w,onTaskClick:v,onCreateTaskInColumn:I}){let g=Q(),[K,P]=u(null),{mutate:M,isPending:j}=U({mutationFn:async(d)=>{let n=await A.api.teams[":teamId"].kanban.tasks[":taskId"].$delete({param:{teamId:e,taskId:d}});if(!n.ok){let b=await n.json().catch(()=>({message:An()}));throw Error(b.message||An())}return await n.json()},onSuccess:()=>{g.invalidateQueries({queryKey:["teams",e,"kanban","tasks"]}),g.invalidateQueries({queryKey:["teams",e,"kanban","goals"]}),R.success(ME()),P(null)},onError:(d)=>{R.error(d.message)}}),{mutate:_}=U({mutationFn:async({taskId:d,fromStatus:n,status:b,reason:N,beforeIndex:l,afterIndex:i})=>{let s=await A.api.teams[":teamId"].kanban.tasks[":taskId"].$patch({param:{teamId:e,taskId:d},json:{fromStatus:n,status:b,reason:N,beforeIndex:l,afterIndex:i}});if(!s.ok){let m=await s.json().catch(()=>({message:An()}));throw Error(m.message||An())}return await s.json()},onMutate:async({taskId:d,status:n,targetTaskId:b,position:N})=>{await g.cancelQueries({queryKey:["teams",e,"kanban","tasks"]});let l=g.getQueriesData({queryKey:["teams",e,"kanban","tasks"]}),i=null,s=(m)=>m[0]==="teams"&&m[1]===e&&m[2]==="kanban"&&m[3]==="tasks"&&typeof m[4]==="object"&&m[4]!==null&&("status"in m[4]);if(g.setQueriesData({predicate:(m)=>s(m.queryKey)},(m)=>{if(!m||!Array.isArray(m.pages))return m;let k=!1,f=m.pages.map((c)=>{if(!c||!Array.isArray(c.data))return c;let D=c.data.find((F)=>F.id===d);if(D)return i={...D,status:n},k=!0,{...c,data:c.data.filter((F)=>F.id!==d),pageInfo:{...c.pageInfo,total:Math.max(0,(c.pageInfo?.total??c.data.length)-1)}};return c});return k?{...m,pages:f}:m}),i){let m=i;g.setQueriesData({predicate:(k)=>{if(!s(k.queryKey))return!1;return k.queryKey[4]?.status===n}},(k)=>{if(!k||!Array.isArray(k.pages))return k;let f=k.pages.flatMap((y)=>y?.data??[]).filter((y)=>y.id!==d),c=f.length;if(b){let y=f.findIndex((X)=>X.id===b);if(y!==-1)c=N==="before"?y:y+1}f.splice(c,0,m);let D=0,F=k.pages.map((y,X)=>{let z=y?.data?y.data.length:0,W=X===0&&z===0?1:X===k.pages.length-1?f.length-D:z,te=f.slice(D,D+W);return D+=W,{...y,data:te,pageInfo:{...y?.pageInfo,total:(y?.pageInfo?.total??0)+1}}});if(D<f.length&&F.length>0){let y=F.length-1;F[y]={...F[y],data:[...F[y]?.data??[],...f.slice(D)]}}return{...k,pages:F}})}return{previousQueries:l}},onError:(d,n,b)=>{if(b?.previousQueries)for(let[N,l]of b.previousQueries)g.setQueryData(N,l);R.error(d.message)},onSettled:()=>{g.invalidateQueries({queryKey:["teams",e,"kanban","tasks"]})}}),H=(d)=>{if(d.canceled)return;let{source:n,target:b}=d.operation;if(!n||!b)return;let N=n.data;if(N?.type!=="kanban_task"||!N.task)return;let l=N.task,i=w?.toLowerCase()==="owner",s=w?.toLowerCase()==="editor",m=l.reporter?.id===p||l.creator?.id===p,k=l.assignee?.id===p;if(!i&&!s&&!m&&!k){R.error(Dy());return}let f=b.data;if(!f)return;if(f.type==="reorder"&&f.task&&f.position){let c=f.task,D=c.status;if(l.id===c.id)return;let F=f.position==="before"?c.sortIndex??void 0:void 0,y=f.position==="after"?c.sortIndex??void 0:void 0;_({taskId:l.id,fromStatus:l.status,status:D,beforeIndex:F,afterIndex:y,targetTaskId:c.id,position:f.position});return}if(f.type==="kanban_column"&&f.status){let{status:c,lastTask:D}=f;if(D){if(l.id===D.id){if(l.status===c)return;_({taskId:l.id,fromStatus:l.status,status:c});return}_({taskId:l.id,fromStatus:l.status,status:c,afterIndex:D.sortIndex??void 0,targetTaskId:D.id,position:"after"});return}if(l.status===c)return;_({taskId:l.id,fromStatus:l.status,status:c})}};return o(Dn,{sensors:[nn.configure({activationConstraints:[new Ir.Distance({value:8})]}),Lo],onDragEnd:H,children:[t("div",{className:"flex-1 min-h-0 overflow-x-auto overflow-y-hidden p-4 bg-background/50",children:t("div",{className:"flex gap-4 h-full min-w-max pb-2",children:Rg.map((d)=>t(Pe,{teamId:e,status:d,selectedGoalId:r,scope:x,currentUserId:p,currentUserRole:w,onTaskClick:v,onDeleteTask:(n)=>P(n),onCreateTaskInColumn:I},d))})}),K&&t(We,{open:!!K,onOpenChange:(d)=>!d&&P(null),children:o(Ye,{children:[o(Je,{children:[t(et,{children:t_()}),t(tt,{children:r_({title:K.title})})]}),o(Xe,{children:[t(nt,{disabled:j,children:Re()}),o(rt,{onClick:()=>M(K.id),disabled:j,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[j&&t(Z,{className:"w-4 h-4 mr-1.5 animate-spin"}),at()]})]})]})})]})}C();function Me({teamId:e,isOpen:r,onClose:x,initialGoalId:p}){let w=Q(),v=p===Ja||!p?"none":p,[I,g]=u(""),[K,P]=u(""),[M,j]=u(!1),[_,H]=u(Or.MEDIUM),[d,n]=u(v),[b,N]=u("none"),[l,i]=u("none"),[s,m]=u(void 0),[k,f]=u(void 0),[c,D]=u(null),[F,y]=u(null),[X,z]=u(null),[W,te]=u([]),[ne,oe]=u([]),[be,xe]=u(!1),{data:ke}=L({queryKey:["teams",e,"me"],queryFn:async()=>{let a=await A.api.teams[":teamId"].me.$get({param:{teamId:e}});if(!a.ok)return null;return await a.json()},enabled:!!e&&r});h(()=>{if(r)g(""),P(""),j(!1),H(Or.MEDIUM),n(v),N("none"),i(ke?.id||"none"),m(void 0),f(void 0),D(null),y(null),z(null),te([]),oe([])},[r,v,ke?.id]);let{data:ye=[]}=L({queryKey:["teams",e,"members","human"],queryFn:async()=>{let a=await A.api.teams[":teamId"].members.$get({param:{teamId:e},query:{includeAgents:"false"}});if(!a.ok)return[];let J=await a.json();return Array.isArray(J)?J:[]},enabled:!!e&&r}),{data:$e=[]}=L({queryKey:["teams",e,"agents"],queryFn:async()=>{let a=await A.api.teams[":teamId"].agents.$get({param:{teamId:e}});if(!a.ok)return[];return await a.json()||[]},enabled:!!e&&r}),{data:He}=L({queryKey:["teams",e,"kanban","goals"],queryFn:async()=>{let a=await A.api.teams[":teamId"].kanban.goals.$get({param:{teamId:e},query:{}});if(!a.ok)return{data:[]};return await a.json()},enabled:!!e&&r}),Ve=He?.data||[],{mutate:st,isPending:ae}=U({mutationFn:async()=>{let a=await A.api.teams[":teamId"].kanban.tasks.$post({param:{teamId:e},json:{title:I.trim(),description:K.trim()||void 0,isAgentTask:M,priority:_,goalId:d!=="none"?d:void 0,assigneeId:b!=="none"?b:void 0,reporterId:l!=="none"?l:void 0,startDate:s?s.toISOString():void 0,dueDate:k?k.toISOString():void 0,projectId:c||void 0,targetFolderId:F||void 0,parentIds:W.length>0?W:void 0,assetIds:ne.length>0?ne.map((J)=>J.id):void 0}});if(!a.ok){let J=await a.text().catch(()=>""),Y=An();if(J)try{let le=JSON.parse(J);if(le&&typeof le.message==="string")Y=le.message}catch{Y=J}throw Error(Y)}return await a.json()},onSuccess:()=>{w.invalidateQueries({queryKey:["teams",e,"kanban","tasks"]}),w.invalidateQueries({queryKey:["teams",e,"kanban","goals"]}),R.success(TE()),x()},onError:(a)=>{R.error(a.message)}}),ot=(a)=>{if(a.preventDefault(),!I.trim()||ae)return;st()},ie=M;return t(fe,{open:r,onOpenChange:(a)=>!a&&x(),children:o(ce,{className:"sm:max-w-3xl max-h-[90vh] overflow-y-auto",children:[o("form",{onSubmit:ot,className:"space-y-4",children:[t(pe,{children:t(ue,{children:Yd()})}),o("div",{className:"space-y-3.5 py-1",children:[o("div",{className:"space-y-1.5",children:[t(G,{htmlFor:"create-task-title",children:gg()}),t(q,{id:"create-task-title",value:I,onChange:(a)=>g(a.target.value),placeholder:Ag(),required:!0,autoFocus:!0})]}),o("div",{className:"space-y-1.5",children:[t(G,{htmlFor:"create-task-desc",children:pg()}),t(Xa,{id:"create-task-desc",value:K,onChange:(a)=>P(a.target.value),placeholder:mg(),rows:3})]}),o("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[o("div",{className:"sm:col-span-2 flex items-center justify-between space-x-2 rounded-lg border border-border/80 bg-muted/30 p-2.5 h-14",children:[o("div",{className:"space-y-0.5 min-w-0 pr-2",children:[o(G,{htmlFor:"create-is-agent-task",className:"text-xs font-medium cursor-pointer flex items-center gap-1.5",children:[t(bt,{className:"w-3.5 h-3.5 text-orange-500"}),t("span",{children:dd()})]}),t("p",{className:"text-[11px] text-muted-foreground line-clamp-1",children:yg()})]}),t(je,{id:"create-is-agent-task",checked:M,onCheckedChange:(a)=>{j(a),N("none")}})]}),o("div",{className:"space-y-1.5",children:[t(G,{className:"text-xs font-medium text-muted-foreground",children:hg()}),o(De,{value:_,onValueChange:(a)=>H(a),children:[t(Le,{className:"w-full h-9 text-xs",children:t(Ze,{})}),t(Be,{children:Object.values(Or).map((a)=>t(re,{value:a,children:t("span",{className:E("px-1.5 py-0.5 rounded text-[10px] uppercase font-medium",Fs(a)),children:zs(a)})},a))})]})]}),o("div",{className:"space-y-1.5",children:[t(G,{className:"text-xs font-medium text-muted-foreground",children:Gu()}),o(De,{value:d,onValueChange:n,children:[t(Le,{className:"w-full h-9 text-xs",children:t(Ze,{placeholder:"None"})}),o(Be,{children:[t(re,{value:"none",children:t("span",{className:"text-muted-foreground italic",children:"None"})}),Ve.filter((a)=>a.id!==Ja).map((a)=>t(re,{value:a.id,children:o("div",{className:"flex items-center gap-2",children:[t(co,{className:"w-3.5 h-3.5 text-primary"}),t("span",{children:a.title})]})},a.id))]})]})]}),o("div",{className:"space-y-1.5",children:[t(G,{className:"text-xs font-medium text-muted-foreground",children:ie?ld():gm()}),o(De,{value:b,onValueChange:N,children:[t(Le,{className:"w-full h-9 text-xs",children:t(Ze,{placeholder:Wo()})}),o(Be,{children:[t(re,{value:"none",children:t("span",{className:"text-muted-foreground italic",children:Wo()})}),ie?$e.map((a)=>t(re,{value:a.id,children:o("div",{className:"flex items-center gap-2",children:[t(bt,{className:"w-3.5 h-3.5 text-purple-500"}),t("span",{children:a.name})]})},a.id)):ye.map((a)=>t(re,{value:a.id,children:o("div",{className:"flex items-center gap-2",children:[o(Ce,{size:"sm",className:"w-4 h-4",children:[t(Ee,{src:a.image}),t(Ie,{className:"text-[8px]",children:a.name.slice(0,2).toUpperCase()})]}),t("span",{children:a.name})]})},a.id))]})]})]}),o("div",{className:"space-y-1.5",children:[t(G,{className:"text-xs font-medium text-muted-foreground",children:Gh()}),o(De,{value:l,onValueChange:i,children:[t(Le,{className:"w-full h-9 text-xs",children:t(Ze,{placeholder:Wo()})}),o(Be,{children:[t(re,{value:"none",children:t("span",{className:"text-muted-foreground italic",children:Wo()})}),ye.map((a)=>t(re,{value:a.id,children:o("div",{className:"flex items-center gap-2",children:[o(Ce,{size:"sm",className:"w-4 h-4",children:[t(Ee,{src:a.image}),t(Ie,{className:"text-[8px]",children:a.name.slice(0,2).toUpperCase()})]}),t("span",{children:a.name})]})},a.id))]})]})]}),ie&&o("div",{className:"sm:col-span-2 space-y-1.5",children:[t(G,{className:"text-xs font-medium text-muted-foreground",children:np()}),o(S,{type:"button",variant:"outline",size:"sm",onClick:()=>xe(!0),className:"w-full justify-start h-9 text-xs truncate font-normal",children:[t(Xt,{className:"w-3.5 h-3.5 mr-2 text-primary shrink-0"}),t("span",{className:"truncate",children:X||Kf()})]})]}),o("div",{className:"space-y-1.5",children:[t(G,{className:"text-xs font-medium text-muted-foreground",children:cd()}),t(es,{value:s,onChange:m,placeholder:cd(),className:"h-9 text-xs"})]}),o("div",{className:"space-y-1.5",children:[t(G,{className:"text-xs font-medium text-muted-foreground",children:Uu()}),t(es,{value:k,onChange:f,placeholder:Uu(),className:"h-9 text-xs"})]}),o("div",{className:"sm:col-span-2 space-y-1.5",children:[t(G,{className:"text-xs font-medium text-muted-foreground",children:Sh()}),t(yd,{teamId:e,value:W,onChange:te})]}),t("div",{className:"sm:col-span-2 pt-1",children:t(_d,{teamId:e,projectId:c,assets:ne,onAddAssets:(a)=>oe((J)=>[...J,...a]),onRemoveAsset:(a)=>oe((J)=>J.filter((Y)=>Y.id!==a))})})]})]}),o(qe,{children:[t(S,{type:"button",variant:"outline",onClick:x,disabled:ae,children:Re()}),o(S,{type:"submit",disabled:!I.trim()||ae,children:[ae&&t(Z,{className:"w-4 h-4 mr-1.5 animate-spin"}),fc()]})]})]}),be&&t(bd,{teamId:e,currentProjectId:c,currentTargetFolderId:F,isOpen:be,onClose:()=>xe(!1),onSelect:(a,J,Y)=>{D(a),y(J),z(Y||"Selected Folder")}})]})})}function ze({teamId:e,initialTaskId:r}){let[x,p]=u("team"),[w,v]=u(null),[I,g]=u(r??null),[K,P]=u(!1);h(()=>{if(r)g(r)},[r]);let[M,j]=u(Ge.TODO),{data:_,isLoading:H}=L({queryKey:["teams",e,"me"],queryFn:async()=>{let s=await A.api.teams[":teamId"].me.$get({param:{teamId:e}});if(!s.ok)throw Error("Failed to fetch me");return await s.json()},enabled:!!e}),{data:d}=L({queryKey:["teams",e,"kanban","goals"],queryFn:async()=>{let s=await A.api.teams[":teamId"].kanban.goals.$get({param:{teamId:e},query:{}});if(!s.ok)return{data:[]};return await s.json()},enabled:!!e}),n=d?.data||[],b=w?n.find((s)=>s.id===w)||null:null,N=_?.role?.toLowerCase()==="owner"||_?.role?.toLowerCase()==="editor",l=(s=Ge.TODO)=>{j(s),P(!0)},i=(s)=>{g(s.id)};if(H)return t("div",{className:"flex h-full items-center justify-center",children:t(Z,{className:"w-8 h-8 animate-spin text-muted-foreground"})});return o("div",{className:"flex flex-row h-full bg-background overflow-hidden font-sans",children:[t(Se,{teamId:e,selectedGoalId:w,onSelectGoal:v,isOwnerOrEditor:N}),o("div",{className:"flex-1 flex flex-col min-w-0 h-full overflow-hidden",children:[t(Te,{scope:x,onScopeChange:p,selectedGoal:b,onClearGoal:()=>v(null),onCreateTask:()=>l(Ge.TODO),canCreateTask:N}),t(Fe,{teamId:e,selectedGoalId:w,scope:x,currentUserId:_?.id,currentUserRole:_?.role,onTaskClick:i,onCreateTaskInColumn:(s)=>l(s)})]}),I&&t(wd,{teamId:e,taskId:I,isOpen:!!I,onClose:()=>g(null),canEdit:N}),K&&t(Me,{teamId:e,isOpen:K,initialStatus:M,initialGoalId:w,onClose:()=>P(!1)})]})}function lt(){let{teamId:e}=Qe.useParams(),{taskId:r}=Qe.useSearch();return t(ze,{teamId:e,initialTaskId:r})}var Qe=Ue("/teams/$teamId/kanban")({component:lt});export{Qe as Route};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{t,E}from"./chunk-6bhn1p8v.js";function bn({className:e,...a}){return t("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:t("table",{"data-slot":"table",className:E("w-full caption-bottom text-sm",e),...a})})}function vn({className:e,...a}){return t("thead",{"data-slot":"table-header",className:E("[&_tr]:border-b",e),...a})}function wn({className:e,...a}){return t("tbody",{"data-slot":"table-body",className:E("[&_tr:last-child]:border-0",e),...a})}function hr({className:e,...a}){return t("tr",{"data-slot":"table-row",className:E("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",e),...a})}function _t({className:e,...a}){return t("th",{"data-slot":"table-head",className:E("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...a})}function pt({className:e,...a}){return t("td",{"data-slot":"table-cell",className:E("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...a})}
|
|
2
|
+
export{bn,vn,wn,hr,_t,pt};
|