@shumai-one/shumai 0.4.0 → 0.4.2
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-2xgvs3as.js → chunk-07h4b77v.js} +2 -2
- package/bin/{chunk-gazp5662.js → chunk-0t4n4d5w.js} +2 -2
- package/bin/{chunk-x9akgj7w.js → chunk-1611z9jg.js} +2 -2
- package/bin/{chunk-kvnfgr29.js → chunk-1phqxp6z.js} +1 -1
- package/bin/chunk-23hckrrz.js +2 -0
- package/bin/{chunk-ymr5ybxk.js → chunk-30z44j1g.js} +2 -2
- package/bin/{chunk-fcsfssar.js → chunk-3j463k1g.js} +1 -1
- package/bin/{chunk-zye42cfp.js → chunk-4181tdds.js} +1 -1
- package/bin/chunk-480jtqng.js +4 -0
- package/bin/{chunk-m8z8jvdq.js → chunk-4c3g146q.js} +2 -2
- package/bin/chunk-4ca0zt5e.js +1 -0
- package/bin/chunk-4d9bgmf2.js +2 -0
- package/bin/{chunk-fvbd5dk7.js → chunk-4ev56fss.js} +5 -5
- package/bin/{chunk-zmyawgth.js → chunk-4gk52tjq.js} +1 -1
- package/bin/chunk-4mdqkj4d.js +1 -0
- package/bin/{chunk-mhps85dd.js → chunk-4r91fggc.js} +1 -1
- package/bin/chunk-50fb1x3w.js +1 -0
- package/bin/chunk-59gj1njz.js +1 -0
- package/bin/{chunk-j04sztp3.js → chunk-5pr0t7fb.js} +1 -1
- package/bin/chunk-5vewxmz7.js +3 -0
- package/bin/chunk-62zx96pe.js +2 -0
- package/bin/chunk-63y0eb07.js +2 -0
- package/bin/chunk-6d5xrgfx.js +2 -0
- package/bin/{chunk-etprs58p.js → chunk-6gbtz5bf.js} +2 -2
- package/bin/{chunk-wrgwjg2g.js → chunk-6gjg5egq.js} +1 -1
- package/bin/{chunk-4q782s34.js → chunk-6m4jz9s1.js} +3 -3
- package/bin/{chunk-wehhpcm1.js → chunk-6s4x525w.js} +1 -1
- package/bin/{chunk-xzag8w1v.js → chunk-6w2wmvqs.js} +1 -1
- package/bin/{chunk-r2shjtte.js → chunk-77d23vcn.js} +2 -2
- package/bin/{chunk-vhcqazqf.js → chunk-77m5p188.js} +2 -2
- package/bin/chunk-7bvx087f.js +1 -0
- package/bin/chunk-7pfjfrjg.js +5 -0
- package/bin/{chunk-1qr0ajc8.js → chunk-7q10s127.js} +1 -1
- package/bin/{chunk-c3msq02x.js → chunk-7thx8ctx.js} +2 -2
- package/bin/{chunk-vvhs586e.js → chunk-8t4s91gh.js} +1 -1
- package/bin/{chunk-k3r97v7j.js → chunk-98ey5p2e.js} +1 -1
- package/bin/{chunk-44edgqvy.js → chunk-9amndcyh.js} +3 -3
- package/bin/chunk-9bk23g9x.js +1 -0
- package/bin/chunk-9mkcfy43.js +1 -0
- package/bin/{chunk-0h8rjeyj.js → chunk-9t3nsq5n.js} +2 -2
- package/bin/{chunk-j536e9nx.js → chunk-9tjq99ds.js} +2 -2
- package/bin/chunk-9wm9rwh1.js +2 -0
- package/bin/{chunk-nz2v1jmd.js → chunk-ab16fyg4.js} +2 -2
- package/bin/chunk-arv0g2av.js +1 -0
- package/bin/{chunk-hx2mvd20.js → chunk-aytj4zxg.js} +2 -2
- package/bin/{chunk-02afmyqy.js → chunk-b1ypjqgp.js} +2 -2
- package/bin/{chunk-93ecxcy4.js → chunk-bdjv0ykq.js} +1 -1
- package/bin/chunk-c1k86mfa.js +10 -0
- package/bin/{chunk-wy2f6mby.js → chunk-caa96dgd.js} +1 -1
- package/bin/chunk-ce4v2yjy.js +1 -0
- package/bin/{chunk-m2tbft2c.js → chunk-cqh60y54.js} +2 -2
- package/bin/chunk-cvq7zgw7.js +1 -0
- package/bin/{chunk-tcm57j8r.js → chunk-d9mjbtp2.js} +2 -2
- package/bin/{chunk-xkhwj8mw.js → chunk-dn7sbjws.js} +2 -2
- package/bin/{chunk-p49h5fxs.js → chunk-dxyq9h8n.js} +1 -1
- package/bin/{chunk-3twtxs5m.js → chunk-e3cabksx.js} +1 -1
- package/bin/{chunk-52dr035y.js → chunk-egcrbj94.js} +2 -2
- package/bin/chunk-ev17v1mv.js +2 -0
- package/bin/chunk-evtpwg71.js +2 -0
- package/bin/{chunk-2rbexbv0.js → chunk-f3e0nsv2.js} +1 -1
- package/bin/chunk-f40gjqpq.js +2 -0
- package/bin/chunk-fe7822ak.js +299 -0
- package/bin/{chunk-4b7jcpgv.js → chunk-g8tkhw9j.js} +2 -2
- package/bin/{chunk-mgnxa0vy.js → chunk-g9r0p4t8.js} +1 -1
- package/bin/chunk-gbjyh9ms.js +1 -0
- package/bin/{chunk-thbfw1ed.js → chunk-gtbsb39v.js} +1 -1
- package/bin/{chunk-zh752hw8.js → chunk-gytz1q13.js} +1 -1
- package/bin/chunk-h0fxysxs.js +7 -0
- package/bin/{chunk-aw5zkdma.js → chunk-h8bdvsqt.js} +2 -2
- package/bin/{chunk-76433x4d.js → chunk-hag024w8.js} +2 -2
- package/bin/chunk-hc6w5nw4.js +7 -0
- package/bin/chunk-j69dqc48.js +2 -0
- package/bin/{chunk-yfqz6f72.js → chunk-jbtw1zym.js} +1 -1
- package/bin/{chunk-9k76s3y6.js → chunk-jc1vb7rj.js} +2 -2
- package/bin/{chunk-41d9gkx7.js → chunk-jdv78w9r.js} +1 -1
- package/bin/{chunk-dag45evp.js → chunk-jjs70y9v.js} +1 -1
- package/bin/{chunk-ysvhtgve.js → chunk-jmdar2gz.js} +2 -2
- package/bin/chunk-jvwz10n4.js +2 -0
- package/bin/{chunk-ck6msfch.js → chunk-k47md1g4.js} +2 -2
- package/bin/{chunk-yyjx8nbq.js → chunk-k4v0brcb.js} +1 -1
- package/bin/chunk-k6n7c07e.js +1 -0
- package/bin/{chunk-kjjhvrk1.js → chunk-kk2cstsg.js} +1 -1
- package/bin/{chunk-3r33kewe.js → chunk-knz4h56q.js} +3 -3
- package/bin/{chunk-j5rx3x1q.js → chunk-kqqtt6bd.js} +1 -1
- package/bin/{chunk-ez6veng7.js → chunk-kvyp1t4j.js} +1 -1
- package/bin/{chunk-djx2r4nj.js → chunk-kxskpgsq.js} +2 -2
- package/bin/{chunk-3gjn4pyp.js → chunk-m6srbjcs.js} +2 -2
- package/bin/{chunk-8956rryj.js → chunk-mcc1scxs.js} +2 -2
- package/bin/{chunk-0bfqrx5q.js → chunk-mq83a0kk.js} +2 -2
- package/bin/chunk-mxm8g4q0.js +1 -0
- package/bin/{chunk-6m1k317a.js → chunk-nhpgdqq5.js} +2 -2
- package/bin/{chunk-pdjar480.js → chunk-nne496aa.js} +2 -2
- package/bin/{chunk-s73c0brj.js → chunk-nqpb0r9h.js} +1 -1
- package/bin/chunk-ns0zww9g.js +2 -0
- package/bin/{chunk-9cmvymm5.js → chunk-ps4xfp23.js} +1 -1
- package/bin/chunk-pz2ec6xt.js +2 -0
- package/bin/{chunk-vkgxrn1h.js → chunk-q163k309.js} +2 -2
- package/bin/chunk-q1da61ps.js +1 -0
- package/bin/{chunk-7x1vkftb.js → chunk-qrf0ady6.js} +2 -2
- package/bin/{chunk-d7en47eh.js → chunk-qy28f25e.js} +1 -1
- package/bin/{chunk-xjnghr99.js → chunk-r7s4ypw1.js} +1 -1
- package/bin/chunk-ran23vm9.js +1 -0
- package/bin/chunk-rfvdc4n0.js +2 -0
- package/bin/{chunk-8rcfhfq5.js → chunk-rgthkvgx.js} +1 -1
- package/bin/chunk-s39n3yw3.js +2 -0
- package/bin/{chunk-xv5h4dv1.js → chunk-s7wdd0g7.js} +1 -1
- package/bin/{chunk-n8gsjwht.js → chunk-s88ha5kx.js} +2 -2
- package/bin/chunk-sf91bt9m.js +2 -0
- package/bin/{chunk-2x46963w.js → chunk-sjwbjf9j.js} +1 -1
- package/bin/chunk-t62076pv.js +1 -0
- package/bin/{chunk-he1ywtxx.js → chunk-tbbwss3v.js} +1 -1
- package/bin/{chunk-06spnkta.js → chunk-tjcc7a6y.js} +1 -1
- package/bin/{chunk-qac5hr5h.js → chunk-tp6ab26e.js} +1 -1
- package/bin/{chunk-md12a1sf.js → chunk-v2wxk9p5.js} +2 -2
- package/bin/chunk-vbk6y4hk.js +2 -0
- package/bin/{chunk-vcf2qk9h.js → chunk-vfgfg5fk.js} +2 -2
- package/bin/{chunk-gjnrd32m.js → chunk-vm6c3xx9.js} +2 -2
- package/bin/{chunk-agabtxrc.js → chunk-vsx96mt6.js} +1 -1
- package/bin/{chunk-et0cewj7.js → chunk-wbyw1shz.js} +2 -2
- package/bin/chunk-whh2vh50.css +1 -0
- package/bin/{chunk-792t2653.js → chunk-wjkcq65s.js} +2 -2
- package/bin/{chunk-5yhn31rd.js → chunk-wkefwkfp.js} +1 -1
- package/bin/{chunk-gcc6pte2.js → chunk-x7bsnk1e.js} +2 -2
- package/bin/{chunk-tn67sjb2.js → chunk-xbhw6bpz.js} +2 -2
- package/bin/{chunk-34kaja59.js → chunk-xg5yrcj5.js} +2 -2
- package/bin/{chunk-wzmpvadf.js → chunk-xw2gpcsh.js} +1 -1
- package/bin/{chunk-sx6y697s.js → chunk-ycq8ank7.js} +1 -1
- package/bin/chunk-yp9hvkc5.js +73 -0
- package/bin/{chunk-dkjkn8t3.js → chunk-ytypyfkc.js} +2 -2
- package/bin/{chunk-62ebss6h.js → chunk-z1kjmf60.js} +2 -2
- package/bin/chunk-z36bx86r.js +2 -0
- package/bin/chunk-z7hdnecp.js +3 -0
- package/bin/chunk-zeby1cq7.js +2 -0
- package/bin/chunk-zs5e8z1w.js +1 -0
- package/bin/chunk-zxnyefg5.js +2 -0
- package/bin/shumai-app.html +1 -1
- package/bin/shumai-app.js +312 -342
- package/package.json +7 -7
- package/prisma/schema.prisma +1 -1
- package/bin/chunk-045f1bw7.js +0 -2
- package/bin/chunk-0n1wfwcm.js +0 -2
- package/bin/chunk-1fwzepfn.js +0 -2
- package/bin/chunk-2xevs82j.js +0 -2
- package/bin/chunk-31y5j4hr.js +0 -1
- package/bin/chunk-34adtqqh.js +0 -1
- package/bin/chunk-4j8fbckp.js +0 -1
- package/bin/chunk-57s7yj35.js +0 -1
- package/bin/chunk-6tse78c7.js +0 -2
- package/bin/chunk-8nyve0cr.js +0 -7
- package/bin/chunk-ajndx51c.js +0 -2
- package/bin/chunk-bbyc2jfq.js +0 -1
- package/bin/chunk-br7d2qwc.js +0 -1
- package/bin/chunk-by6g0vye.js +0 -2
- package/bin/chunk-c24fvhm6.js +0 -1
- package/bin/chunk-c6aszz6p.js +0 -1
- package/bin/chunk-csqvmx1m.js +0 -2
- package/bin/chunk-dg8c91j5.js +0 -1
- package/bin/chunk-dk8vk17v.js +0 -2
- package/bin/chunk-ex2ym5pz.js +0 -2
- package/bin/chunk-f2zbsrc9.js +0 -2
- package/bin/chunk-gcpr2a24.js +0 -7
- package/bin/chunk-gpjkegdp.js +0 -1
- package/bin/chunk-jt6d0zb1.js +0 -2
- package/bin/chunk-jwgfkpek.js +0 -3
- package/bin/chunk-k2065y29.js +0 -2
- package/bin/chunk-k514bttd.js +0 -1
- package/bin/chunk-k7chm9a9.js +0 -2
- package/bin/chunk-kjgejwjp.css +0 -1
- package/bin/chunk-kqpzx5az.js +0 -73
- package/bin/chunk-kxr8fjsq.js +0 -2
- package/bin/chunk-mha3rsh7.js +0 -2
- package/bin/chunk-nn0px81k.js +0 -307
- package/bin/chunk-ns804tmv.js +0 -2
- package/bin/chunk-p1temt1j.js +0 -1
- package/bin/chunk-rkz6x3r0.js +0 -2
- package/bin/chunk-svz0ds0g.js +0 -1
- package/bin/chunk-t31basc5.js +0 -1
- package/bin/chunk-t6qdrw24.js +0 -1
- package/bin/chunk-wvwqgff4.js +0 -1
- package/bin/chunk-ww1cy08p.js +0 -1
- package/bin/chunk-xfp27ya9.js +0 -2
- package/bin/chunk-y0f4bc9f.js +0 -2
- package/bin/chunk-y2s0tjaa.js +0 -3
- package/bin/chunk-y3dy4pdt.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{wm as _1}from"./chunk-6gjg5egq.js";import{xm as P1,ym as f1}from"./chunk-jjs70y9v.js";import{Gm as D1}from"./chunk-e3cabksx.js";import{Hm as B1}from"./chunk-xbhw6bpz.js";import{Im as j1,Jm as S0}from"./chunk-jc1vb7rj.js";import{_m as T1,bn as I1,cn as R1,dn as k1,en as y1}from"./chunk-vsx96mt6.js";import{fn as c}from"./chunk-tbbwss3v.js";import{gn as S1}from"./chunk-6w2wmvqs.js";import{mn as j0}from"./chunk-dn7sbjws.js";import{on as A1}from"./chunk-1phqxp6z.js";import"./chunk-dxyq9h8n.js";function U(X,Z,$,W,Y){if(W==="m")throw TypeError("Private method is not writable");if(W==="a"&&!Y)throw TypeError("Private accessor was defined without a setter");if(typeof Z==="function"?X!==Z||!Y:!Z.has(X))throw TypeError("Cannot write private member to an object whose class did not declare it");return W==="a"?Y.call(X,$):Y?Y.value=$:Z.set(X,$),$}function z(X,Z,$,W){if($==="a"&&!W)throw TypeError("Private accessor was defined without a getter");if(typeof Z==="function"?X!==Z||!W:!Z.has(X))throw TypeError("Cannot read private member from an object whose class did not declare it");return $==="m"?W:$==="a"?W.call(X):W?W.value:Z.get(X)}var pZ=function(){let{crypto:X}=globalThis;if(X?.randomUUID)return pZ=X.randomUUID.bind(X),X.randomUUID();let Z=new Uint8Array(1),$=X?()=>X.getRandomValues(Z)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(W)=>(+W^$()&15>>+W/4).toString(16))};function d(X){return typeof X==="object"&&X!==null&&(("name"in X)&&X.name==="AbortError"||("message"in X)&&String(X.message).includes("FetchRequestCanceledException"))}var xX=(X)=>{if(X instanceof Error)return X;if(typeof X==="object"&&X!==null){try{if(Object.prototype.toString.call(X)==="[object Error]"){let Z=Error(X.message,X.cause?{cause:X.cause}:{});if(X.stack)Z.stack=X.stack;if(X.cause&&!Z.cause)Z.cause=X.cause;if(X.name)Z.name=X.name;return Z}}catch{}try{return Error(JSON.stringify(X))}catch{}}return Error(X)};class C extends Error{}class A extends C{constructor(X,Z,$,W,Y){super(`${A.makeMessage(X,Z,$)}`);this.status=X,this.headers=W,this.requestID=W?.get("request-id"),this.error=Z,this.type=Y??null}static makeMessage(X,Z,$){let W=Z?.message?typeof Z.message==="string"?Z.message:JSON.stringify(Z.message):Z?JSON.stringify(Z):$;if(X&&W)return`${X} ${W}`;if(X)return`${X} status code (no body)`;if(W)return W;return"(no status code or body)"}static generate(X,Z,$,W){if(!X||!W)return new s({message:$,cause:xX(Z)});let Y=Z,J=Y?.error?.type;if(X===400)return new FX(X,Y,$,W,J);if(X===401)return new LX(X,Y,$,W,J);if(X===403)return new AX(X,Y,$,W,J);if(X===404)return new jX(X,Y,$,W,J);if(X===409)return new SX(X,Y,$,W,J);if(X===422)return new BX(X,Y,$,W,J);if(X===429)return new DX(X,Y,$,W,J);if(X>=500)return new TX(X,Y,$,W,J);return new A(X,Y,$,W,J)}}class D extends A{constructor({message:X}={}){super(void 0,void 0,X||"Request was aborted.",void 0)}}class s extends A{constructor({message:X,cause:Z}){super(void 0,void 0,X||"Connection error.",void 0);if(Z)this.cause=Z}}class HX extends s{constructor({message:X}={}){super({message:X??"Request timed out."})}}class FX extends A{}class LX extends A{}class AX extends A{}class jX extends A{}class SX extends A{}class BX extends A{}class DX extends A{}class TX extends A{}var c1=/^[a-z][a-z0-9+.-]*:/i,P0=(X)=>{return c1.test(X)},lZ=(X)=>(lZ=Array.isArray,lZ(X)),iZ=lZ;function qZ(X){if(typeof X!=="object")return{};return X??{}}function nZ(X){if(!X)return!0;for(let Z in X)return!1;return!0}function f0(X,Z){return Object.prototype.hasOwnProperty.call(X,Z)}var I0=(X,Z)=>{if(typeof Z!=="number"||!Number.isInteger(Z))throw new C(`${X} must be an integer`);if(Z<0)throw new C(`${X} must be a positive integer`);return Z};var CZ=(X)=>{try{return JSON.parse(X)}catch(Z){return}};var R0=(X)=>new Promise((Z)=>setTimeout(Z,X));var i="0.91.1";var h0=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"};function d1(){if(typeof Deno<"u"&&Deno.build!=null)return"deno";if(typeof EdgeRuntime<"u")return"edge";if(Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]")return"node";return"unknown"}var m1=()=>{let X=d1();if(X==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":i,"X-Stainless-OS":y0(Deno.build.os),"X-Stainless-Arch":k0(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version==="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":i,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(X==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":i,"X-Stainless-OS":y0(globalThis.process.platform??"unknown"),"X-Stainless-Arch":k0(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let Z=u1();if(Z)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":i,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${Z.browser}`,"X-Stainless-Runtime-Version":Z.version};return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":i,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function u1(){if(typeof navigator>"u"||!navigator)return null;let X=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:Z,pattern:$}of X){let W=$.exec(navigator.userAgent);if(W){let Y=W[1]||0,J=W[2]||0,Q=W[3]||0;return{browser:Z,version:`${Y}.${J}.${Q}`}}}return null}var k0=(X)=>{if(X==="x32")return"x32";if(X==="x86_64"||X==="x64")return"x64";if(X==="arm")return"arm";if(X==="aarch64"||X==="arm64")return"arm64";if(X)return`other:${X}`;return"unknown"},y0=(X)=>{if(X=X.toLowerCase(),X.includes("ios"))return"iOS";if(X==="android")return"Android";if(X==="darwin")return"MacOS";if(X==="win32")return"Windows";if(X==="freebsd")return"FreeBSD";if(X==="openbsd")return"OpenBSD";if(X==="linux")return"Linux";if(X)return`Other:${X}`;return"Unknown"},_0,g0=()=>{return _0??(_0=m1())};function b0(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function rZ(...X){let Z=globalThis.ReadableStream;if(typeof Z>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new Z(...X)}function OZ(X){let Z=Symbol.asyncIterator in X?X[Symbol.asyncIterator]():X[Symbol.iterator]();return rZ({start(){},async pull($){let{done:W,value:Y}=await Z.next();if(W)$.close();else $.enqueue(Y)},async cancel(){await Z.return?.()}})}function PX(X){if(X[Symbol.asyncIterator])return X;let Z=X.getReader();return{async next(){try{let $=await Z.read();if($?.done)Z.releaseLock();return $}catch($){throw Z.releaseLock(),$}},async return(){let $=Z.cancel();return Z.releaseLock(),await $,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function v0(X){if(X===null||typeof X!=="object")return;if(X[Symbol.asyncIterator]){await X[Symbol.asyncIterator]().return?.();return}let Z=X.getReader(),$=Z.cancel();Z.releaseLock(),await $}var c0=({headers:X,body:Z})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(Z)}};function d0(X){return Object.entries(X).filter(([Z,$])=>typeof $<"u").map(([Z,$])=>{if(typeof $==="string"||typeof $==="number"||typeof $==="boolean")return`${encodeURIComponent(Z)}=${encodeURIComponent($)}`;if($===null)return`${encodeURIComponent(Z)}=`;throw new C(`Cannot stringify type ${typeof $}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}function p0(X){let Z=0;for(let Y of X)Z+=Y.length;let $=new Uint8Array(Z),W=0;for(let Y of X)$.set(Y,W),W+=Y.length;return $}var m0;function fX(X){let Z;return(m0??(Z=new globalThis.TextEncoder,m0=Z.encode.bind(Z)))(X)}var u0;function aZ(X){let Z;return(u0??(Z=new globalThis.TextDecoder,u0=Z.decode.bind(Z)))(X)}var f,I;class n{constructor(){f.set(this,void 0),I.set(this,void 0),U(this,f,new Uint8Array,"f"),U(this,I,null,"f")}decode(X){if(X==null)return[];let Z=X instanceof ArrayBuffer?new Uint8Array(X):typeof X==="string"?fX(X):X;U(this,f,p0([z(this,f,"f"),Z]),"f");let $=[],W;while((W=i1(z(this,f,"f"),z(this,I,"f")))!=null){if(W.carriage&&z(this,I,"f")==null){U(this,I,W.index,"f");continue}if(z(this,I,"f")!=null&&(W.index!==z(this,I,"f")+1||W.carriage)){$.push(aZ(z(this,f,"f").subarray(0,z(this,I,"f")-1))),U(this,f,z(this,f,"f").subarray(z(this,I,"f")),"f"),U(this,I,null,"f");continue}let Y=z(this,I,"f")!==null?W.preceding-1:W.preceding,J=aZ(z(this,f,"f").subarray(0,Y));$.push(J),U(this,f,z(this,f,"f").subarray(W.index),"f"),U(this,I,null,"f")}return $}flush(){if(!z(this,f,"f").length)return[];return this.decode(`
|
|
3
3
|
`)}}f=new WeakMap,I=new WeakMap;n.NEWLINE_CHARS=new Set([`
|
|
4
4
|
`,"\r"]);n.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function i1(X,Z){for(let Y=Z??0;Y<X.length;Y++){if(X[Y]===10)return{preceding:Y,index:Y+1,carriage:!1};if(X[Y]===13)return{preceding:Y,index:Y+1,carriage:!0}}return null}function l0(X){for(let W=0;W<X.length-1;W++){if(X[W]===10&&X[W+1]===10)return W+2;if(X[W]===13&&X[W+1]===13)return W+2;if(X[W]===13&&X[W+1]===10&&W+3<X.length&&X[W+2]===13&&X[W+3]===10)return W+4}return-1}var MZ={off:0,error:200,warn:300,info:400,debug:500},oZ=(X,Z,$)=>{if(!X)return;if(f0(MZ,X))return X;S($).warn(`${Z} was set to ${JSON.stringify(X)}, expected one of ${JSON.stringify(Object.keys(MZ))}`);return};function IX(){}function EZ(X,Z,$){if(!Z||MZ[X]>MZ[$])return IX;else return Z[X].bind(Z)}var n1={error:IX,warn:IX,info:IX,debug:IX},i0=new WeakMap;function S(X){let Z=X.logger,$=X.logLevel??"off";if(!Z)return n1;let W=i0.get(Z);if(W&&W[0]===$)return W[1];let Y={error:EZ("error",Z,$),warn:EZ("warn",Z,$),info:EZ("info",Z,$),debug:EZ("debug",Z,$)};return i0.set(Z,[$,Y]),Y}var m=(X)=>{if(X.options)X.options={...X.options},delete X.options.headers;if(X.headers)X.headers=Object.fromEntries((X.headers instanceof Headers?[...X.headers]:Object.entries(X.headers)).map(([Z,$])=>[Z,Z.toLowerCase()==="x-api-key"||Z.toLowerCase()==="authorization"||Z.toLowerCase()==="cookie"||Z.toLowerCase()==="set-cookie"?"***":$]));if("retryOfRequestLogID"in X){if(X.retryOfRequestLogID)X.retryOf=X.retryOfRequestLogID;delete X.retryOfRequestLogID}return X};var RX;class R{constructor(X,Z,$){this.iterator=X,RX.set(this,void 0),this.controller=Z,U(this,RX,$,"f")}static fromSSEResponse(X,Z,$){let W=!1,Y=$?S($):console;async function*J(){if(W)throw new C("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");W=!0;let Q=!1;try{for await(let w of r1(X,Z)){if(w.event==="completion")try{yield JSON.parse(w.data)}catch(G){throw Y.error("Could not parse message into JSON:",w.data),Y.error("From chunk:",w.raw),G}if(w.event==="message_start"||w.event==="message_delta"||w.event==="message_stop"||w.event==="content_block_start"||w.event==="content_block_delta"||w.event==="content_block_stop"||w.event==="message"||w.event==="user.message"||w.event==="user.interrupt"||w.event==="user.tool_confirmation"||w.event==="user.custom_tool_result"||w.event==="agent.message"||w.event==="agent.thinking"||w.event==="agent.tool_use"||w.event==="agent.tool_result"||w.event==="agent.mcp_tool_use"||w.event==="agent.mcp_tool_result"||w.event==="agent.custom_tool_use"||w.event==="agent.thread_context_compacted"||w.event==="session.status_running"||w.event==="session.status_idle"||w.event==="session.status_rescheduled"||w.event==="session.status_terminated"||w.event==="session.error"||w.event==="session.deleted"||w.event==="span.model_request_start"||w.event==="span.model_request_end")try{yield JSON.parse(w.data)}catch(G){throw Y.error("Could not parse message into JSON:",w.data),Y.error("From chunk:",w.raw),G}if(w.event==="ping")continue;if(w.event==="error"){let G=CZ(w.data)??w.data,M=G?.error?.type;throw new A(void 0,G,void 0,X.headers,M)}}Q=!0}catch(w){if(d(w))return;throw w}finally{if(!Q)Z.abort()}}return new R(J,Z,$)}static fromReadableStream(X,Z,$){let W=!1;async function*Y(){let Q=new n,w=PX(X);for await(let G of w)for(let M of Q.decode(G))yield M;for(let G of Q.flush())yield G}async function*J(){if(W)throw new C("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");W=!0;let Q=!1;try{for await(let w of Y()){if(Q)continue;if(w)yield JSON.parse(w)}Q=!0}catch(w){if(d(w))return;throw w}finally{if(!Q)Z.abort()}}return new R(J,Z,$)}[(RX=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let X=[],Z=[],$=this.iterator(),W=(Y)=>{return{next:()=>{if(Y.length===0){let J=$.next();X.push(J),Z.push(J)}return Y.shift()}}};return[new R(()=>W(X),this.controller,z(this,RX,"f")),new R(()=>W(Z),this.controller,z(this,RX,"f"))]}toReadableStream(){let X=this,Z;return rZ({async start(){Z=X[Symbol.asyncIterator]()},async pull($){try{let{value:W,done:Y}=await Z.next();if(Y)return $.close();let J=fX(JSON.stringify(W)+`
|
|
5
5
|
`);$.enqueue(J)}catch(W){$.error(W)}},async cancel(){await Z.return?.()}})}}async function*r1(X,Z){if(!X.body){if(Z.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new C("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new C("Attempted to iterate over a response with no body")}let $=new n0,W=new n,Y=PX(X.body);for await(let J of a1(Y))for(let Q of W.decode(J)){let w=$.decode(Q);if(w)yield w}for(let J of W.flush()){let Q=$.decode(J);if(Q)yield Q}}async function*a1(X){let Z=new Uint8Array;for await(let $ of X){if($==null)continue;let W=$ instanceof ArrayBuffer?new Uint8Array($):typeof $==="string"?fX($):$,Y=new Uint8Array(Z.length+W.length);Y.set(Z),Y.set(W,Z.length),Z=Y;let J;while((J=l0(Z))!==-1)yield Z.slice(0,J),Z=Z.slice(J)}if(Z.length>0)yield Z}class n0{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(X){if(X.endsWith("\r"))X=X.substring(0,X.length-1);if(!X){if(!this.event&&!this.data.length)return null;let Y={event:this.event,data:this.data.join(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as x}from"./chunk-wkefwkfp.js";import"./chunk-s39n3yw3.js";import"./chunk-c1k86mfa.js";import"./chunk-6d5xrgfx.js";import"./chunk-kxskpgsq.js";import{se as f}from"./chunk-wjkcq65s.js";import"./chunk-5vewxmz7.js";import"./chunk-ev17v1mv.js";import"./chunk-pz2ec6xt.js";import"./chunk-k4v0brcb.js";import"./chunk-4181tdds.js";import"./chunk-62zx96pe.js";import{pg as c}from"./chunk-63y0eb07.js";import"./chunk-qrf0ady6.js";import"./chunk-k47md1g4.js";import"./chunk-77m5p188.js";import"./chunk-d9mjbtp2.js";import"./chunk-mq83a0kk.js";import"./chunk-hag024w8.js";import"./chunk-07h4b77v.js";import"./chunk-ps4xfp23.js";import{qi as s}from"./chunk-b1ypjqgp.js";import{Gi as b,xi as d,yi as l}from"./chunk-h0fxysxs.js";import{aj as v,cj as e,nj as p}from"./chunk-yp9hvkc5.js";import{sn as m}from"./chunk-dxyq9h8n.js";var g=m(v(),1);function k(){let{projectId:i,folderId:h}=y.useParams(),{teamId:r,ensureTeamIdForProject:t}=s();g.useEffect(()=>{t(i)},[i,t]);let{data:a}=l(f(i)),o=a?.rootFolder,{data:u}=d({queryKey:["folders",o],queryFn:async()=>{let n=await b.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||!u)return e(c,{});return e(x,{teamId:r,projectId:i,projectName:a.name??"",assetId:h,rootFolderId:o,isRoot:!1})}var y=p("/projects/$projectId/folders/$folderId_/agentsmd")({component:k});export{y as Route};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Ag as P1,Bg as x1,Cg as v1,Dg as g1,Eg as q1,Fg as B1,Gg as W1,Hg as _1,Ig as b1,Jg as d1,Kg as c1,Og as p1,Pg as m1,Qg as Q1,Rg as $Q,Sg as HQ,Tg as JQ,Ug as C,Vg as $1,Xg as XQ,mg as V,ng as J1,og as h1,pg as l,qg as X1,rg as f1,sg as Y1,ug as U1,wg as Z1,xg as y1,yg as S1,zg as I1}from"./chunk-7x1vkftb.js";import{Ci as w1,ti as D1}from"./chunk-8nyve0cr.js";import{Vi as R1,kj as T1}from"./chunk-kqpzx5az.js";import{kn as N1}from"./chunk-p49h5fxs.js";var s=N1(R1(),1);function YQ(Q){let $=Q.match(/teams\/([^/]+)/);if($)return{teamId:$[1]};let H=Q.match(/projects\/([^/]+)/);if(H)return{projectId:H[1]};return{}}function gQ(){let[Q,$]=s.useState(),H=T1({select:(J)=>J.location.pathname}),{teamId:X,projectId:Y}=YQ(H),{data:U}=D1({queryKey:["projects",Y,"team"],queryFn:async()=>{let J=await w1.api.projects[":projectId"].team.$get({param:{projectId:Y}});if(!J.ok)throw Error("failed to fetch project team");return await J.json()},enabled:!!Y});return s.useEffect(()=>{if(X)$(X);else if(U?.teamId)$(U.teamId)},[X,U]),Q}var{create:ZQ,defineProperty:u1,defineProperties:qQ,getOwnPropertyDescriptor:BQ,getOwnPropertyDescriptors:WQ,getOwnPropertySymbols:e}=Object,l1=Object.prototype.hasOwnProperty,i1=Object.prototype.propertyIsEnumerable,KQ=(Q,$)=>($=Symbol[Q])?$:Symbol.for("Symbol."+Q),m=(Q)=>{throw TypeError(Q)},K1=(Q,$,H)=>($ in Q)?u1(Q,$,{enumerable:!0,configurable:!0,writable:!0,value:H}):Q[$]=H,G1=(Q,$)=>{for(var H in $||($={}))if(l1.call($,H))K1(Q,H,$[H]);if(e){for(var H of e($))if(i1.call($,H))K1(Q,H,$[H])}return Q},j1=(Q,$)=>qQ(Q,WQ($)),UQ=(Q,$)=>{var H={};for(var X in Q)if(l1.call(Q,X)&&$.indexOf(X)<0)H[X]=Q[X];if(Q!=null&&e){for(var X of e(Q))if($.indexOf(X)<0&&i1.call(Q,X))H[X]=Q[X]}return H},FQ=(Q)=>{var $;return[,,,ZQ(($=void 0)!=null?$:null)]},o1=["class","method","getter","setter","accessor","field","value","get","set"],b=(Q)=>Q!==void 0&&typeof Q!=="function"?m("Function expected"):Q,MQ=(Q,$,H,X,Y)=>({kind:o1[Q],name:$,metadata:X,addInitializer:(U)=>H._?m("Already initialized"):Y.push(b(U||null))}),zQ=(Q,$)=>K1($,KQ("metadata"),Q[3]),n=(Q,$,H,X)=>{for(var Y=0,U=Q[$>>1],J=U&&U.length;Y<J;Y++)$&1?U[Y].call(H):X=U[Y].call(H,X);return X},s1=(Q,$,H,X,Y,U)=>{var J,Z,w,R,N,z=$&7,q=!1,F=!1,A=Q.length+1,D=o1[z+5],T=Q[A-1]=[],K=Q[A]||(Q[A]=[]),G=(Y=Y.prototype,BQ({get[H](){return d(this,U)},set[H](W){return y(this,U,W)}},H));for(var L=X.length-1;L>=0;L--)if(R=MQ(z,H,w={},Q[3],K),R.static=q,R.private=F,N=R.access={has:(W)=>(H in W)},N.get=(W)=>W[H],N.set=(W,B)=>W[H]=B,Z=(0,X[L])({get:G.get,set:G.set},R),w._=1,Z===void 0)b(Z)&&(G[D]=Z);else if(typeof Z!=="object"||Z===null)m("Object expected");else b(J=Z.get)&&(G.get=J),b(J=Z.set)&&(G.set=J),b(J=Z.init)&&T.unshift(J);return G&&u1(Y,H,G),Y},n1=(Q,$,H)=>$.has(Q)||m("Cannot "+H),d=(Q,$,H)=>(n1(Q,$,"read from private field"),$.get(Q)),_=(Q,$,H)=>$.has(Q)?m("Cannot add the same private member more than once"):$ instanceof WeakSet?$.add(Q):$.set(Q,H),y=(Q,$,H,X)=>(n1(Q,$,"write to private field"),$.set(Q,H),H);function h(Q){return Q instanceof L1||Q instanceof t1}var r=10,LQ=class extends U1{constructor(Q){super(Q);let $=h1(()=>{let{dragOperation:X}=Q;if(!W1(X.activatorEvent))return;if(!h(X.source))return;if(X.status.initialized){let Y=Q.registry.plugins.get(c1);if(Y)return Y.disable(),()=>Y.enable()}}),H=Q.monitor.addEventListener("dragmove",(X,Y)=>{queueMicrotask(()=>{if(this.disabled||X.defaultPrevented||!X.nativeEvent)return;let{dragOperation:U}=Y;if(!W1(X.nativeEvent))return;if(!h(U.source))return;if(!U.shape)return;let{actions:J,collisionObserver:Z,registry:w}=Y,{by:R}=X;if(!R)return;let N=AQ(R),{source:z,target:q}=U,{center:F}=U.shape.current,A=[],D=[];V(()=>{for(let B of w.droppables){let{id:M}=B;if(!B.accepts(z)||M===(q==null?void 0:q.id)&&h(B)||!B.element)continue;let j=B.shape,E=new B1(B.element,{getBoundingClientRect:(x)=>S1(x,void 0,0.2)});if(!E.height||!E.width)continue;if(N=="down"&&F.y+r<E.center.y||N=="up"&&F.y-r>E.center.y||N=="left"&&F.x-r>E.center.x||N=="right"&&F.x+r<E.center.x)A.push(B),B.shape=E,D.push(()=>B.shape=j)}}),X.preventDefault(),Z.disable();let T=Z.computeCollisions(A,b1);V(()=>D.forEach((B)=>B()));let[K]=T;if(!K)return;let{id:G}=K,{index:L,group:W}=z.sortable;J.setDropTarget(G).then(()=>{let{source:B,target:M,shape:j}=U;if(!B||!h(B)||!j)return;let{index:E,group:x,target:O}=B.sortable,k=L!==E||W!==x,v=k?O:M==null?void 0:M.element;if(!v)return;v1(v);let o=new B1(v);if(!o)return;let g=Y1.delta(o,Y1.from(j.current.boundingRectangle),B.alignment);if(J.move({by:g}),k)J.setDropTarget(B.id).then(()=>Z.enable());else Z.enable()})})});this.destroy=()=>{H(),$()}}};function AQ(Q){let{x:$,y:H}=Q;if($>0)return"right";else if($<0)return"left";else if(H>0)return"down";else if(H<0)return"up"}var{defineProperty:NQ,defineProperties:RQ,getOwnPropertyDescriptors:DQ,getOwnPropertySymbols:V1}=Object,TQ=Object.prototype.hasOwnProperty,wQ=Object.prototype.propertyIsEnumerable,C1=(Q,$,H)=>($ in Q)?NQ(Q,$,{enumerable:!0,configurable:!0,writable:!0,value:H}):Q[$]=H,S=(Q,$)=>{for(var H in $||($={}))if(TQ.call($,H))C1(Q,H,$[H]);if(V1){for(var H of V1($))if(wQ.call($,H))C1(Q,H,$[H])}return Q},I=(Q,$)=>RQ(Q,DQ($));function GQ(Q,$,H){if($===H)return Q;let X=Q.slice();return X.splice(H,0,X.splice($,1)[0]),X}function H1(Q){return"initialIndex"in Q&&typeof Q.initialIndex==="number"&&"index"in Q&&typeof Q.index==="number"}function jQ(Q,$,H){var X,Y,U;let{source:J,target:Z,canceled:w}=$.operation;if(!J||!Z||w){if("preventDefault"in $)$.preventDefault();return Q}let R=(W,B)=>W===B||typeof W==="object"&&("id"in W)&&W.id===B;if(Array.isArray(Q)){let W=Q.findIndex((M)=>R(M,J.id)),B=Q.findIndex((M)=>R(M,Z.id));if(W===-1||B===-1){if(H1(J)){let{initialIndex:M,index:j}=J;if(M===j||M<0||M>=Q.length){if("preventDefault"in $)$.preventDefault();return Q}return H(Q,M,j)}return Q}if(!w&&"index"in J&&typeof J.index==="number"){let M=J.index;if(M!==W)return H(Q,W,M)}return H(Q,W,B)}let N=Object.entries(Q),z=-1,q,F=-1,A;for(let[W,B]of N){if(z===-1){if(z=B.findIndex((M)=>R(M,J.id)),z!==-1)q=W}if(F===-1){if(F=B.findIndex((M)=>R(M,Z.id)),F!==-1)A=W}if(z!==-1&&F!==-1)break}if(z===-1&&H1(J)){let{initialGroup:W,initialIndex:B,group:M,index:j}=J;if(W==null||M==null||!(W in Q)||!(M in Q)){if("preventDefault"in $)$.preventDefault();return Q}if(W===M&&B===j){if("preventDefault"in $)$.preventDefault();return Q}if(W===M)return I(S({},Q),{[W]:H(Q[W],B,j)});let E=Q[W][B];return I(S({},Q),{[W]:[...Q[W].slice(0,B),...Q[W].slice(B+1)],[M]:[...Q[M].slice(0,j),E,...Q[M].slice(j)]})}if(!J.manager)return Q;let{dragOperation:D}=J.manager,T=(Y=(X=D.shape)==null?void 0:X.current.center)!=null?Y:D.position.current;if(A==null){if(Z.id in Q){let W=Z.shape&&T.y>Z.shape.center.y?Q[Z.id].length:0;A=Z.id,F=W}}if(q==null||A==null||q===A&&z===F){if(q!=null&&q===A&&z===F&&H1(J)){let W=J.group!=null&&J.group!==q,B=J.index!==z;if(W||B){let M=(U=J.group)!=null?U:q;if(M in Q){if(q===M)return I(S({},Q),{[q]:H(Q[q],z,J.index)});let j=Q[q][z];return I(S({},Q),{[q]:[...Q[q].slice(0,z),...Q[q].slice(z+1)],[M]:[...Q[M].slice(0,J.index),j,...Q[M].slice(J.index)]})}}}if("preventDefault"in $)$.preventDefault();return Q}if(q===A)return I(S({},Q),{[q]:H(Q[q],z,F)});let G=Z.shape&&Math.round(T.y)>Math.round(Z.shape.center.y)?1:0,L=Q[q][z];return I(S({},Q),{[q]:[...Q[q].slice(0,z),...Q[q].slice(z+1)],[A]:[...Q[A].slice(0,F+G),L,...Q[A].slice(F+G)]})}function VQ(Q,$){return jQ(Q,$,GQ)}var E1="__default__",CQ=class extends U1{constructor(Q){super(Q);let $=()=>{let X=new Map;for(let Y of Q.registry.droppables)if(Y instanceof L1){let{sortable:U}=Y,{group:J}=U,Z=X.get(J);if(!Z)Z=new Set,X.set(J,Z);Z.add(U)}for(let[Y,U]of X)X.set(Y,new Set(a(U)));return X},H=[Q.monitor.addEventListener("dragover",(X,Y)=>{if(this.disabled)return;let{dragOperation:U}=Y,{source:J,target:Z}=U;if(!h(J)||!h(Z))return;if(J.sortable===Z.sortable)return;let w=$(),R=J.sortable.group===Z.sortable.group,N=w.get(J.sortable.group),z=R?N:w.get(Z.sortable.group);if(!N||!z)return;queueMicrotask(()=>{if(X.defaultPrevented)return;Y.renderer.rendering.then(()=>{var q,F,A;let D=$();for(let[O,k]of w.entries()){let v=Array.from(k).entries();for(let[o,g]of v)if(g.index!==o||g.group!==O||!((q=D.get(O))==null?void 0:q.has(g)))return}let T=J.sortable.element,K=Z.sortable.element;if(!K||!T)return;if(!R&&Z.id===J.sortable.group)return;let G=a(N),L=R?G:a(z),W=(F=J.sortable.group)!=null?F:E1,B=(A=Z.sortable.group)!=null?A:E1,M={[W]:G,[B]:L},j=VQ(M,X);if(M===j)return;let E=j[B].indexOf(J.sortable),x=j[B].indexOf(Z.sortable);Y.collisionObserver.disable(),k1(T,E,K,x),V(()=>{for(let[O,k]of j[W].entries())k.index=O;if(!R)for(let[O,k]of j[B].entries())k.group=Z.sortable.group,k.index=O}),Y.actions.setDropTarget(J.id).then(()=>Y.collisionObserver.enable())})})}),Q.monitor.addEventListener("dragend",(X,Y)=>{if(!X.canceled)return;let{dragOperation:U}=Y,{source:J}=U;if(!h(J))return;if(J.sortable.initialIndex===J.sortable.index&&J.sortable.initialGroup===J.sortable.group)return;queueMicrotask(()=>{let Z=$(),w=Z.get(J.sortable.initialGroup);if(!w)return;Y.renderer.rendering.then(()=>{for(let[F,A]of Z.entries()){let D=Array.from(A).entries();for(let[T,K]of D)if(K.index!==T||K.group!==F)return}let R=a(w),N=J.sortable.element,z=R[J.sortable.initialIndex],q=z==null?void 0:z.element;if(!z||!q||!N)return;k1(N,z.index,q,J.index),V(()=>{for(let[F,A]of Z.entries()){let D=Array.from(A).values();for(let T of D)T.index=T.initialIndex,T.group=T.initialGroup}})})})})];this.destroy=()=>{for(let X of H)X()}}};function k1(Q,$,H,X){let Y=X<$?"afterend":"beforebegin";H.insertAdjacentElement(Y,Q)}function EQ(Q,$){return Q.index-$.index}function a(Q){return Array.from(Q).sort(EQ)}var O1=[LQ,CQ],F1={duration:250,easing:"cubic-bezier(0.25, 1, 0.5, 1)",idle:!1},t=new f1,r1,a1,f,M1,c,p,z1,P;a1=[X1],r1=[X1];var u=class{constructor(Q,$){_(this,M1,n(f,8,this)),n(f,11,this),_(this,c),_(this,p),_(this,z1,n(f,12,this)),n(f,15,this),_(this,P),this.register=()=>{return V(()=>{var q,F;(q=this.manager)==null||q.registry.register(this.droppable),(F=this.manager)==null||F.registry.register(this.draggable)}),()=>this.unregister()},this.unregister=()=>{V(()=>{var q,F;(q=this.manager)==null||q.registry.unregister(this.droppable),(F=this.manager)==null||F.registry.unregister(this.draggable)})},this.destroy=()=>{V(()=>{this.droppable.destroy(),this.draggable.destroy()})};var H=Q,{effects:X=()=>[],group:Y,index:U,sensors:J,type:Z,transition:w=F1,plugins:R}=H,N=UQ(H,["effects","group","index","sensors","type","transition","plugins"]);let z=Z1(R,O1);this.droppable=new L1(N,$,this),this.draggable=new t1(j1(G1({},N),{plugins:z,effects:()=>[()=>{var q,F,A;let D=(q=this.manager)==null?void 0:q.dragOperation.status;if((D==null?void 0:D.initializing)&&this.id===((A=(F=this.manager)==null?void 0:F.dragOperation.source)==null?void 0:A.id))t.clear(this.manager);if(D==null?void 0:D.dragging)t.set(this.manager,this.id,J1(()=>({initialIndex:this.index,initialGroup:this.group})))},()=>{let{index:q,group:F,manager:A}=this,D=d(this,p),T=d(this,c);if(q!==D||F!==T)y(this,p,q),y(this,c,F),this.animate()},()=>{var q,F;let{target:A}=this,{isDragSource:D}=this.draggable;if(((F=(q=this.draggable.pluginConfig(d1))==null?void 0:q.feedback)!=null?F:"default")==="move"&&D)this.droppable.disabled=!A},...X()],type:Z,sensors:J}),$,this),y(this,P,N.element),this.manager=$,this.index=U,y(this,p,U),this.group=Y,y(this,c,Y),this.type=Z,this.transition=w}get initialIndex(){var Q,$;return($=(Q=t.get(this.manager,this.id))==null?void 0:Q.initialIndex)!=null?$:this.index}get initialGroup(){var Q,$;return($=(Q=t.get(this.manager,this.id))==null?void 0:Q.initialGroup)!=null?$:this.group}animate(){J1(()=>{let{manager:Q,transition:$}=this,{shape:H}=this.droppable;if(!Q)return;let{idle:X}=Q.dragOperation.status;if(!H||!$||X&&!$.idle)return;Q.renderer.rendering.then(()=>{let{element:Y}=this;if(!Y)return;for(let N of Y.getAnimations())if("transitionProperty"in N&&(N.transitionProperty==="transform"||N.transitionProperty==="translate"||N.transitionProperty==="scale"))N.cancel();let U=this.refreshShape();if(!U)return;let J={x:H.boundingRectangle.left-U.boundingRectangle.left,y:H.boundingRectangle.top-U.boundingRectangle.top},{translate:Z}=x1(Y),w=q1(Y,Z,!1),R=q1(Y,Z);if(J.x||J.y){let N=I1(y1(Y))?j1(G1({},$),{duration:0}):$;g1({element:Y,keyframes:{translate:[`${w.x+J.x}px ${w.y+J.y}px ${w.z}`,`${R.x}px ${R.y}px ${R.z}`]},options:N}).then(()=>{if(!Q.dragOperation.status.dragging)this.droppable.shape=void 0})}})})}get manager(){return this.draggable.manager}set manager(Q){V(()=>{this.draggable.manager=Q,this.droppable.manager=Q})}set element(Q){V(()=>{let $=d(this,P),H=this.droppable.element,X=this.draggable.element;if(!H||H===$)this.droppable.element=Q;if(!X||X===$)this.draggable.element=Q;y(this,P,Q)})}get element(){var Q,$;let H=d(this,P);if(!H)return;return($=(Q=P1.get(H))!=null?Q:H)!=null?$:this.droppable.element}set target(Q){this.droppable.element=Q}get target(){return this.droppable.element}set source(Q){this.draggable.element=Q}get source(){return this.draggable.element}get disabled(){return this.draggable.disabled&&this.droppable.disabled}set plugins(Q){this.draggable.plugins=Z1(Q,O1)}set disabled(Q){V(()=>{this.droppable.disabled=Q,this.draggable.disabled=Q})}set data(Q){V(()=>{this.droppable.data=Q,this.draggable.data=Q})}set handle(Q){this.draggable.handle=Q}set id(Q){this.droppable.id=Q,this.draggable.id=Q}get id(){return this.droppable.id}set sensors(Q){this.draggable.sensors=Q}set modifiers(Q){this.draggable.modifiers=Q}set collisionPriority(Q){this.droppable.collisionPriority=Q}set collisionDetector(Q){this.droppable.collisionDetector=Q!=null?Q:_1}set alignment(Q){this.draggable.alignment=Q}get alignment(){return this.draggable.alignment}set type(Q){V(()=>{this.droppable.type=Q,this.draggable.type=Q})}get type(){return this.draggable.type}set accept(Q){this.droppable.accept=Q}get accept(){return this.droppable.accept}get isDropTarget(){return this.droppable.isDropTarget}get isDragSource(){return this.draggable.isDragSource}get isDragging(){return this.draggable.isDragging}get isDropping(){return this.draggable.isDropping}get status(){return this.draggable.status}refreshShape(){return this.droppable.refreshShape()}accepts(Q){return this.droppable.accepts(Q)}};f=FQ();M1=new WeakMap;c=new WeakMap;p=new WeakMap;z1=new WeakMap;P=new WeakMap;s1(f,4,"index",a1,u,M1);s1(f,4,"group",r1,u,z1);zQ(f,u);var t1=class extends p1{constructor(Q,$,H){super(Q,$);this.sortable=H}get index(){return this.sortable.index}get initialIndex(){return this.sortable.initialIndex}get group(){return this.sortable.group}get initialGroup(){return this.sortable.initialGroup}},L1=class extends m1{constructor(Q,$,H){super(Q,$);this.sortable=H}get index(){return this.sortable.index}get group(){return this.sortable.group}};var i=N1(R1(),1);var{defineProperty:kQ,defineProperties:OQ,getOwnPropertyDescriptors:hQ,getOwnPropertySymbols:e1}=Object,fQ=Object.prototype.hasOwnProperty,yQ=Object.prototype.propertyIsEnumerable,QQ=(Q,$,H)=>($ in Q)?kQ(Q,$,{enumerable:!0,configurable:!0,writable:!0,value:H}):Q[$]=H,A1=(Q,$)=>{for(var H in $||($={}))if(fQ.call($,H))QQ(Q,H,$[H]);if(e1){for(var H of e1($))if(yQ.call($,H))QQ(Q,H,$[H])}return Q},SQ=(Q,$)=>OQ(Q,hQ($));function J$(Q){let{accept:$,collisionDetector:H,collisionPriority:X,id:Y,data:U,element:J,handle:Z,index:w,group:R,disabled:N,modifiers:z,sensors:q,target:F,type:A,plugins:D}=Q,T=A1(A1({},F1),Q.transition),K=XQ((L)=>{return new u(SQ(A1({},Q),{transition:T,register:!1,handle:Q1(Z),element:Q1(J),target:Q1(F)}),L)}),G=HQ(K,IQ);return C(Y,()=>K.id=Y),$Q(()=>{V(()=>{K.group=R,K.index=w})},[K,R,w]),C(A,()=>K.type=A),C($,()=>K.accept=$,void 0,l),C(U,()=>U&&(K.data=U)),C(w,()=>{var L;if(((L=K.manager)==null?void 0:L.dragOperation.status.idle)&&(T==null?void 0:T.idle))K.refreshShape()},JQ),$1(Z,(L)=>K.handle=L),$1(J,(L)=>K.element=L),$1(F,(L)=>K.target=L),C(N,()=>K.disabled=N===!0),C(q,()=>K.sensors=q),C(H,()=>K.collisionDetector=H),C(X,()=>K.collisionPriority=X),C(D,()=>K.plugins=D,void 0,l),C(T,()=>K.transition=T,void 0,l),C(z,()=>K.modifiers=z,void 0,l),C(Q.alignment,()=>K.alignment=Q.alignment),{sortable:G,get isDragging(){return G.isDragging},get isDropping(){return G.isDropping},get isDragSource(){return G.isDragSource},get isDropTarget(){return G.isDropTarget},handleRef:i.useCallback((L)=>{K.handle=L!=null?L:void 0},[K]),ref:i.useCallback((L)=>{var W,B;if(!L&&((W=K.element)==null?void 0:W.isConnected)&&!((B=K.manager)==null?void 0:B.dragOperation.status.idle))return;K.element=L!=null?L:void 0},[K]),sourceRef:i.useCallback((L)=>{var W,B;if(!L&&((W=K.source)==null?void 0:W.isConnected)&&!((B=K.manager)==null?void 0:B.dragOperation.status.idle))return;K.source=L!=null?L:void 0},[K]),targetRef:i.useCallback((L)=>{var W,B;if(!L&&((W=K.target)==null?void 0:W.isConnected)&&!((B=K.manager)==null?void 0:B.dragOperation.status.idle))return;K.target=L!=null?L:void 0},[K])}}function IQ(Q,$,H){if(Q==="isDragSource"&&!H&&$)return!0;return!1}
|
|
1
|
+
import{$g as C,Bg as U1,Dg as Z1,Eg as y1,Fg as S1,Gg as I1,Hg as P1,Ig as x1,Jg as v1,Kg as g1,Lg as q1,Mg as B1,Ng as W1,Og as _1,Pg as b1,Qg as d1,Rg as c1,Vg as p1,Wg as m1,Xg as Q1,Yg as $Q,Zg as HQ,_g as JQ,ah as $1,ch as XQ,tg as V,ug as J1,vg as h1,wg as l,xg as X1,yg as f1,zg as Y1}from"./chunk-qrf0ady6.js";import{Gi as w1,xi as D1}from"./chunk-h0fxysxs.js";import{aj as R1,rj as T1}from"./chunk-yp9hvkc5.js";import{sn as N1}from"./chunk-dxyq9h8n.js";var s=N1(R1(),1);function YQ(Q){let $=Q.match(/teams\/([^/]+)/);if($)return{teamId:$[1]};let H=Q.match(/projects\/([^/]+)/);if(H)return{projectId:H[1]};return{}}function gQ(){let[Q,$]=s.useState(),H=T1({select:(J)=>J.location.pathname}),{teamId:X,projectId:Y}=YQ(H),{data:U}=D1({queryKey:["projects",Y,"team"],queryFn:async()=>{let J=await w1.api.projects[":projectId"].team.$get({param:{projectId:Y}});if(!J.ok)throw Error("failed to fetch project team");return await J.json()},enabled:!!Y});return s.useEffect(()=>{if(X)$(X);else if(U?.teamId)$(U.teamId)},[X,U]),Q}var{create:ZQ,defineProperty:u1,defineProperties:qQ,getOwnPropertyDescriptor:BQ,getOwnPropertyDescriptors:WQ,getOwnPropertySymbols:e}=Object,l1=Object.prototype.hasOwnProperty,i1=Object.prototype.propertyIsEnumerable,KQ=(Q,$)=>($=Symbol[Q])?$:Symbol.for("Symbol."+Q),m=(Q)=>{throw TypeError(Q)},K1=(Q,$,H)=>($ in Q)?u1(Q,$,{enumerable:!0,configurable:!0,writable:!0,value:H}):Q[$]=H,G1=(Q,$)=>{for(var H in $||($={}))if(l1.call($,H))K1(Q,H,$[H]);if(e){for(var H of e($))if(i1.call($,H))K1(Q,H,$[H])}return Q},j1=(Q,$)=>qQ(Q,WQ($)),UQ=(Q,$)=>{var H={};for(var X in Q)if(l1.call(Q,X)&&$.indexOf(X)<0)H[X]=Q[X];if(Q!=null&&e){for(var X of e(Q))if($.indexOf(X)<0&&i1.call(Q,X))H[X]=Q[X]}return H},FQ=(Q)=>{var $;return[,,,ZQ(($=void 0)!=null?$:null)]},o1=["class","method","getter","setter","accessor","field","value","get","set"],b=(Q)=>Q!==void 0&&typeof Q!=="function"?m("Function expected"):Q,MQ=(Q,$,H,X,Y)=>({kind:o1[Q],name:$,metadata:X,addInitializer:(U)=>H._?m("Already initialized"):Y.push(b(U||null))}),zQ=(Q,$)=>K1($,KQ("metadata"),Q[3]),n=(Q,$,H,X)=>{for(var Y=0,U=Q[$>>1],J=U&&U.length;Y<J;Y++)$&1?U[Y].call(H):X=U[Y].call(H,X);return X},s1=(Q,$,H,X,Y,U)=>{var J,Z,w,R,N,z=$&7,q=!1,F=!1,A=Q.length+1,D=o1[z+5],T=Q[A-1]=[],K=Q[A]||(Q[A]=[]),G=(Y=Y.prototype,BQ({get[H](){return d(this,U)},set[H](W){return y(this,U,W)}},H));for(var L=X.length-1;L>=0;L--)if(R=MQ(z,H,w={},Q[3],K),R.static=q,R.private=F,N=R.access={has:(W)=>(H in W)},N.get=(W)=>W[H],N.set=(W,B)=>W[H]=B,Z=(0,X[L])({get:G.get,set:G.set},R),w._=1,Z===void 0)b(Z)&&(G[D]=Z);else if(typeof Z!=="object"||Z===null)m("Object expected");else b(J=Z.get)&&(G.get=J),b(J=Z.set)&&(G.set=J),b(J=Z.init)&&T.unshift(J);return G&&u1(Y,H,G),Y},n1=(Q,$,H)=>$.has(Q)||m("Cannot "+H),d=(Q,$,H)=>(n1(Q,$,"read from private field"),$.get(Q)),_=(Q,$,H)=>$.has(Q)?m("Cannot add the same private member more than once"):$ instanceof WeakSet?$.add(Q):$.set(Q,H),y=(Q,$,H,X)=>(n1(Q,$,"write to private field"),$.set(Q,H),H);function h(Q){return Q instanceof L1||Q instanceof t1}var r=10,LQ=class extends U1{constructor(Q){super(Q);let $=h1(()=>{let{dragOperation:X}=Q;if(!W1(X.activatorEvent))return;if(!h(X.source))return;if(X.status.initialized){let Y=Q.registry.plugins.get(c1);if(Y)return Y.disable(),()=>Y.enable()}}),H=Q.monitor.addEventListener("dragmove",(X,Y)=>{queueMicrotask(()=>{if(this.disabled||X.defaultPrevented||!X.nativeEvent)return;let{dragOperation:U}=Y;if(!W1(X.nativeEvent))return;if(!h(U.source))return;if(!U.shape)return;let{actions:J,collisionObserver:Z,registry:w}=Y,{by:R}=X;if(!R)return;let N=AQ(R),{source:z,target:q}=U,{center:F}=U.shape.current,A=[],D=[];V(()=>{for(let B of w.droppables){let{id:M}=B;if(!B.accepts(z)||M===(q==null?void 0:q.id)&&h(B)||!B.element)continue;let j=B.shape,E=new B1(B.element,{getBoundingClientRect:(x)=>S1(x,void 0,0.2)});if(!E.height||!E.width)continue;if(N=="down"&&F.y+r<E.center.y||N=="up"&&F.y-r>E.center.y||N=="left"&&F.x-r>E.center.x||N=="right"&&F.x+r<E.center.x)A.push(B),B.shape=E,D.push(()=>B.shape=j)}}),X.preventDefault(),Z.disable();let T=Z.computeCollisions(A,b1);V(()=>D.forEach((B)=>B()));let[K]=T;if(!K)return;let{id:G}=K,{index:L,group:W}=z.sortable;J.setDropTarget(G).then(()=>{let{source:B,target:M,shape:j}=U;if(!B||!h(B)||!j)return;let{index:E,group:x,target:O}=B.sortable,k=L!==E||W!==x,v=k?O:M==null?void 0:M.element;if(!v)return;v1(v);let o=new B1(v);if(!o)return;let g=Y1.delta(o,Y1.from(j.current.boundingRectangle),B.alignment);if(J.move({by:g}),k)J.setDropTarget(B.id).then(()=>Z.enable());else Z.enable()})})});this.destroy=()=>{H(),$()}}};function AQ(Q){let{x:$,y:H}=Q;if($>0)return"right";else if($<0)return"left";else if(H>0)return"down";else if(H<0)return"up"}var{defineProperty:NQ,defineProperties:RQ,getOwnPropertyDescriptors:DQ,getOwnPropertySymbols:V1}=Object,TQ=Object.prototype.hasOwnProperty,wQ=Object.prototype.propertyIsEnumerable,C1=(Q,$,H)=>($ in Q)?NQ(Q,$,{enumerable:!0,configurable:!0,writable:!0,value:H}):Q[$]=H,S=(Q,$)=>{for(var H in $||($={}))if(TQ.call($,H))C1(Q,H,$[H]);if(V1){for(var H of V1($))if(wQ.call($,H))C1(Q,H,$[H])}return Q},I=(Q,$)=>RQ(Q,DQ($));function GQ(Q,$,H){if($===H)return Q;let X=Q.slice();return X.splice(H,0,X.splice($,1)[0]),X}function H1(Q){return"initialIndex"in Q&&typeof Q.initialIndex==="number"&&"index"in Q&&typeof Q.index==="number"}function jQ(Q,$,H){var X,Y,U;let{source:J,target:Z,canceled:w}=$.operation;if(!J||!Z||w){if("preventDefault"in $)$.preventDefault();return Q}let R=(W,B)=>W===B||typeof W==="object"&&("id"in W)&&W.id===B;if(Array.isArray(Q)){let W=Q.findIndex((M)=>R(M,J.id)),B=Q.findIndex((M)=>R(M,Z.id));if(W===-1||B===-1){if(H1(J)){let{initialIndex:M,index:j}=J;if(M===j||M<0||M>=Q.length){if("preventDefault"in $)$.preventDefault();return Q}return H(Q,M,j)}return Q}if(!w&&"index"in J&&typeof J.index==="number"){let M=J.index;if(M!==W)return H(Q,W,M)}return H(Q,W,B)}let N=Object.entries(Q),z=-1,q,F=-1,A;for(let[W,B]of N){if(z===-1){if(z=B.findIndex((M)=>R(M,J.id)),z!==-1)q=W}if(F===-1){if(F=B.findIndex((M)=>R(M,Z.id)),F!==-1)A=W}if(z!==-1&&F!==-1)break}if(z===-1&&H1(J)){let{initialGroup:W,initialIndex:B,group:M,index:j}=J;if(W==null||M==null||!(W in Q)||!(M in Q)){if("preventDefault"in $)$.preventDefault();return Q}if(W===M&&B===j){if("preventDefault"in $)$.preventDefault();return Q}if(W===M)return I(S({},Q),{[W]:H(Q[W],B,j)});let E=Q[W][B];return I(S({},Q),{[W]:[...Q[W].slice(0,B),...Q[W].slice(B+1)],[M]:[...Q[M].slice(0,j),E,...Q[M].slice(j)]})}if(!J.manager)return Q;let{dragOperation:D}=J.manager,T=(Y=(X=D.shape)==null?void 0:X.current.center)!=null?Y:D.position.current;if(A==null){if(Z.id in Q){let W=Z.shape&&T.y>Z.shape.center.y?Q[Z.id].length:0;A=Z.id,F=W}}if(q==null||A==null||q===A&&z===F){if(q!=null&&q===A&&z===F&&H1(J)){let W=J.group!=null&&J.group!==q,B=J.index!==z;if(W||B){let M=(U=J.group)!=null?U:q;if(M in Q){if(q===M)return I(S({},Q),{[q]:H(Q[q],z,J.index)});let j=Q[q][z];return I(S({},Q),{[q]:[...Q[q].slice(0,z),...Q[q].slice(z+1)],[M]:[...Q[M].slice(0,J.index),j,...Q[M].slice(J.index)]})}}}if("preventDefault"in $)$.preventDefault();return Q}if(q===A)return I(S({},Q),{[q]:H(Q[q],z,F)});let G=Z.shape&&Math.round(T.y)>Math.round(Z.shape.center.y)?1:0,L=Q[q][z];return I(S({},Q),{[q]:[...Q[q].slice(0,z),...Q[q].slice(z+1)],[A]:[...Q[A].slice(0,F+G),L,...Q[A].slice(F+G)]})}function VQ(Q,$){return jQ(Q,$,GQ)}var E1="__default__",CQ=class extends U1{constructor(Q){super(Q);let $=()=>{let X=new Map;for(let Y of Q.registry.droppables)if(Y instanceof L1){let{sortable:U}=Y,{group:J}=U,Z=X.get(J);if(!Z)Z=new Set,X.set(J,Z);Z.add(U)}for(let[Y,U]of X)X.set(Y,new Set(a(U)));return X},H=[Q.monitor.addEventListener("dragover",(X,Y)=>{if(this.disabled)return;let{dragOperation:U}=Y,{source:J,target:Z}=U;if(!h(J)||!h(Z))return;if(J.sortable===Z.sortable)return;let w=$(),R=J.sortable.group===Z.sortable.group,N=w.get(J.sortable.group),z=R?N:w.get(Z.sortable.group);if(!N||!z)return;queueMicrotask(()=>{if(X.defaultPrevented)return;Y.renderer.rendering.then(()=>{var q,F,A;let D=$();for(let[O,k]of w.entries()){let v=Array.from(k).entries();for(let[o,g]of v)if(g.index!==o||g.group!==O||!((q=D.get(O))==null?void 0:q.has(g)))return}let T=J.sortable.element,K=Z.sortable.element;if(!K||!T)return;if(!R&&Z.id===J.sortable.group)return;let G=a(N),L=R?G:a(z),W=(F=J.sortable.group)!=null?F:E1,B=(A=Z.sortable.group)!=null?A:E1,M={[W]:G,[B]:L},j=VQ(M,X);if(M===j)return;let E=j[B].indexOf(J.sortable),x=j[B].indexOf(Z.sortable);Y.collisionObserver.disable(),k1(T,E,K,x),V(()=>{for(let[O,k]of j[W].entries())k.index=O;if(!R)for(let[O,k]of j[B].entries())k.group=Z.sortable.group,k.index=O}),Y.actions.setDropTarget(J.id).then(()=>Y.collisionObserver.enable())})})}),Q.monitor.addEventListener("dragend",(X,Y)=>{if(!X.canceled)return;let{dragOperation:U}=Y,{source:J}=U;if(!h(J))return;if(J.sortable.initialIndex===J.sortable.index&&J.sortable.initialGroup===J.sortable.group)return;queueMicrotask(()=>{let Z=$(),w=Z.get(J.sortable.initialGroup);if(!w)return;Y.renderer.rendering.then(()=>{for(let[F,A]of Z.entries()){let D=Array.from(A).entries();for(let[T,K]of D)if(K.index!==T||K.group!==F)return}let R=a(w),N=J.sortable.element,z=R[J.sortable.initialIndex],q=z==null?void 0:z.element;if(!z||!q||!N)return;k1(N,z.index,q,J.index),V(()=>{for(let[F,A]of Z.entries()){let D=Array.from(A).values();for(let T of D)T.index=T.initialIndex,T.group=T.initialGroup}})})})})];this.destroy=()=>{for(let X of H)X()}}};function k1(Q,$,H,X){let Y=X<$?"afterend":"beforebegin";H.insertAdjacentElement(Y,Q)}function EQ(Q,$){return Q.index-$.index}function a(Q){return Array.from(Q).sort(EQ)}var O1=[LQ,CQ],F1={duration:250,easing:"cubic-bezier(0.25, 1, 0.5, 1)",idle:!1},t=new f1,r1,a1,f,M1,c,p,z1,P;a1=[X1],r1=[X1];var u=class{constructor(Q,$){_(this,M1,n(f,8,this)),n(f,11,this),_(this,c),_(this,p),_(this,z1,n(f,12,this)),n(f,15,this),_(this,P),this.register=()=>{return V(()=>{var q,F;(q=this.manager)==null||q.registry.register(this.droppable),(F=this.manager)==null||F.registry.register(this.draggable)}),()=>this.unregister()},this.unregister=()=>{V(()=>{var q,F;(q=this.manager)==null||q.registry.unregister(this.droppable),(F=this.manager)==null||F.registry.unregister(this.draggable)})},this.destroy=()=>{V(()=>{this.droppable.destroy(),this.draggable.destroy()})};var H=Q,{effects:X=()=>[],group:Y,index:U,sensors:J,type:Z,transition:w=F1,plugins:R}=H,N=UQ(H,["effects","group","index","sensors","type","transition","plugins"]);let z=Z1(R,O1);this.droppable=new L1(N,$,this),this.draggable=new t1(j1(G1({},N),{plugins:z,effects:()=>[()=>{var q,F,A;let D=(q=this.manager)==null?void 0:q.dragOperation.status;if((D==null?void 0:D.initializing)&&this.id===((A=(F=this.manager)==null?void 0:F.dragOperation.source)==null?void 0:A.id))t.clear(this.manager);if(D==null?void 0:D.dragging)t.set(this.manager,this.id,J1(()=>({initialIndex:this.index,initialGroup:this.group})))},()=>{let{index:q,group:F,manager:A}=this,D=d(this,p),T=d(this,c);if(q!==D||F!==T)y(this,p,q),y(this,c,F),this.animate()},()=>{var q,F;let{target:A}=this,{isDragSource:D}=this.draggable;if(((F=(q=this.draggable.pluginConfig(d1))==null?void 0:q.feedback)!=null?F:"default")==="move"&&D)this.droppable.disabled=!A},...X()],type:Z,sensors:J}),$,this),y(this,P,N.element),this.manager=$,this.index=U,y(this,p,U),this.group=Y,y(this,c,Y),this.type=Z,this.transition=w}get initialIndex(){var Q,$;return($=(Q=t.get(this.manager,this.id))==null?void 0:Q.initialIndex)!=null?$:this.index}get initialGroup(){var Q,$;return($=(Q=t.get(this.manager,this.id))==null?void 0:Q.initialGroup)!=null?$:this.group}animate(){J1(()=>{let{manager:Q,transition:$}=this,{shape:H}=this.droppable;if(!Q)return;let{idle:X}=Q.dragOperation.status;if(!H||!$||X&&!$.idle)return;Q.renderer.rendering.then(()=>{let{element:Y}=this;if(!Y)return;for(let N of Y.getAnimations())if("transitionProperty"in N&&(N.transitionProperty==="transform"||N.transitionProperty==="translate"||N.transitionProperty==="scale"))N.cancel();let U=this.refreshShape();if(!U)return;let J={x:H.boundingRectangle.left-U.boundingRectangle.left,y:H.boundingRectangle.top-U.boundingRectangle.top},{translate:Z}=x1(Y),w=q1(Y,Z,!1),R=q1(Y,Z);if(J.x||J.y){let N=I1(y1(Y))?j1(G1({},$),{duration:0}):$;g1({element:Y,keyframes:{translate:[`${w.x+J.x}px ${w.y+J.y}px ${w.z}`,`${R.x}px ${R.y}px ${R.z}`]},options:N}).then(()=>{if(!Q.dragOperation.status.dragging)this.droppable.shape=void 0})}})})}get manager(){return this.draggable.manager}set manager(Q){V(()=>{this.draggable.manager=Q,this.droppable.manager=Q})}set element(Q){V(()=>{let $=d(this,P),H=this.droppable.element,X=this.draggable.element;if(!H||H===$)this.droppable.element=Q;if(!X||X===$)this.draggable.element=Q;y(this,P,Q)})}get element(){var Q,$;let H=d(this,P);if(!H)return;return($=(Q=P1.get(H))!=null?Q:H)!=null?$:this.droppable.element}set target(Q){this.droppable.element=Q}get target(){return this.droppable.element}set source(Q){this.draggable.element=Q}get source(){return this.draggable.element}get disabled(){return this.draggable.disabled&&this.droppable.disabled}set plugins(Q){this.draggable.plugins=Z1(Q,O1)}set disabled(Q){V(()=>{this.droppable.disabled=Q,this.draggable.disabled=Q})}set data(Q){V(()=>{this.droppable.data=Q,this.draggable.data=Q})}set handle(Q){this.draggable.handle=Q}set id(Q){this.droppable.id=Q,this.draggable.id=Q}get id(){return this.droppable.id}set sensors(Q){this.draggable.sensors=Q}set modifiers(Q){this.draggable.modifiers=Q}set collisionPriority(Q){this.droppable.collisionPriority=Q}set collisionDetector(Q){this.droppable.collisionDetector=Q!=null?Q:_1}set alignment(Q){this.draggable.alignment=Q}get alignment(){return this.draggable.alignment}set type(Q){V(()=>{this.droppable.type=Q,this.draggable.type=Q})}get type(){return this.draggable.type}set accept(Q){this.droppable.accept=Q}get accept(){return this.droppable.accept}get isDropTarget(){return this.droppable.isDropTarget}get isDragSource(){return this.draggable.isDragSource}get isDragging(){return this.draggable.isDragging}get isDropping(){return this.draggable.isDropping}get status(){return this.draggable.status}refreshShape(){return this.droppable.refreshShape()}accepts(Q){return this.droppable.accepts(Q)}};f=FQ();M1=new WeakMap;c=new WeakMap;p=new WeakMap;z1=new WeakMap;P=new WeakMap;s1(f,4,"index",a1,u,M1);s1(f,4,"group",r1,u,z1);zQ(f,u);var t1=class extends p1{constructor(Q,$,H){super(Q,$);this.sortable=H}get index(){return this.sortable.index}get initialIndex(){return this.sortable.initialIndex}get group(){return this.sortable.group}get initialGroup(){return this.sortable.initialGroup}},L1=class extends m1{constructor(Q,$,H){super(Q,$);this.sortable=H}get index(){return this.sortable.index}get group(){return this.sortable.group}};var i=N1(R1(),1);var{defineProperty:kQ,defineProperties:OQ,getOwnPropertyDescriptors:hQ,getOwnPropertySymbols:e1}=Object,fQ=Object.prototype.hasOwnProperty,yQ=Object.prototype.propertyIsEnumerable,QQ=(Q,$,H)=>($ in Q)?kQ(Q,$,{enumerable:!0,configurable:!0,writable:!0,value:H}):Q[$]=H,A1=(Q,$)=>{for(var H in $||($={}))if(fQ.call($,H))QQ(Q,H,$[H]);if(e1){for(var H of e1($))if(yQ.call($,H))QQ(Q,H,$[H])}return Q},SQ=(Q,$)=>OQ(Q,hQ($));function J$(Q){let{accept:$,collisionDetector:H,collisionPriority:X,id:Y,data:U,element:J,handle:Z,index:w,group:R,disabled:N,modifiers:z,sensors:q,target:F,type:A,plugins:D}=Q,T=A1(A1({},F1),Q.transition),K=XQ((L)=>{return new u(SQ(A1({},Q),{transition:T,register:!1,handle:Q1(Z),element:Q1(J),target:Q1(F)}),L)}),G=HQ(K,IQ);return C(Y,()=>K.id=Y),$Q(()=>{V(()=>{K.group=R,K.index=w})},[K,R,w]),C(A,()=>K.type=A),C($,()=>K.accept=$,void 0,l),C(U,()=>U&&(K.data=U)),C(w,()=>{var L;if(((L=K.manager)==null?void 0:L.dragOperation.status.idle)&&(T==null?void 0:T.idle))K.refreshShape()},JQ),$1(Z,(L)=>K.handle=L),$1(J,(L)=>K.element=L),$1(F,(L)=>K.target=L),C(N,()=>K.disabled=N===!0),C(q,()=>K.sensors=q),C(H,()=>K.collisionDetector=H),C(X,()=>K.collisionPriority=X),C(D,()=>K.plugins=D,void 0,l),C(T,()=>K.transition=T,void 0,l),C(z,()=>K.modifiers=z,void 0,l),C(Q.alignment,()=>K.alignment=Q.alignment),{sortable:G,get isDragging(){return G.isDragging},get isDropping(){return G.isDropping},get isDragSource(){return G.isDragSource},get isDropTarget(){return G.isDropTarget},handleRef:i.useCallback((L)=>{K.handle=L!=null?L:void 0},[K]),ref:i.useCallback((L)=>{var W,B;if(!L&&((W=K.element)==null?void 0:W.isConnected)&&!((B=K.manager)==null?void 0:B.dragOperation.status.idle))return;K.element=L!=null?L:void 0},[K]),sourceRef:i.useCallback((L)=>{var W,B;if(!L&&((W=K.source)==null?void 0:W.isConnected)&&!((B=K.manager)==null?void 0:B.dragOperation.status.idle))return;K.source=L!=null?L:void 0},[K]),targetRef:i.useCallback((L)=>{var W,B;if(!L&&((W=K.target)==null?void 0:W.isConnected)&&!((B=K.manager)==null?void 0:B.dragOperation.status.idle))return;K.target=L!=null?L:void 0},[K])}}function IQ(Q,$,H){if(Q==="isDragSource"&&!H&&$)return!0;return!1}
|
|
2
2
|
export{gQ as xf,h as yf,J$ as zf};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as s}from"./chunk-f40gjqpq.js";import"./chunk-9wm9rwh1.js";import"./chunk-zeby1cq7.js";import"./chunk-hc6w5nw4.js";import"./chunk-fe7822ak.js";import"./chunk-z36bx86r.js";import"./chunk-480jtqng.js";import"./chunk-g8tkhw9j.js";import"./chunk-c1k86mfa.js";import"./chunk-6d5xrgfx.js";import"./chunk-kxskpgsq.js";import"./chunk-rfvdc4n0.js";import"./chunk-g9r0p4t8.js";import"./chunk-vbk6y4hk.js";import"./chunk-jmdar2gz.js";import"./chunk-ns0zww9g.js";import"./chunk-zxnyefg5.js";import"./chunk-xg5yrcj5.js";import"./chunk-1611z9jg.js";import"./chunk-23hckrrz.js";import"./chunk-bdjv0ykq.js";import"./chunk-4r91fggc.js";import"./chunk-sf91bt9m.js";import"./chunk-77d23vcn.js";import"./chunk-30z44j1g.js";import"./chunk-7pfjfrjg.js";import"./chunk-5vewxmz7.js";import"./chunk-ev17v1mv.js";import"./chunk-pz2ec6xt.js";import"./chunk-k4v0brcb.js";import"./chunk-4181tdds.js";import"./chunk-62zx96pe.js";import"./chunk-63y0eb07.js";import"./chunk-qrf0ady6.js";import"./chunk-k47md1g4.js";import"./chunk-77m5p188.js";import"./chunk-d9mjbtp2.js";import"./chunk-ytypyfkc.js";import"./chunk-mq83a0kk.js";import"./chunk-hag024w8.js";import"./chunk-07h4b77v.js";import"./chunk-ps4xfp23.js";import"./chunk-nhpgdqq5.js";import"./chunk-b1ypjqgp.js";import"./chunk-h0fxysxs.js";import"./chunk-z1kjmf60.js";import{cj as t,nj as a}from"./chunk-yp9hvkc5.js";import"./chunk-dxyq9h8n.js";function h(){let{shareId:n,fileId:o}=e.useParams(),{start:r,version:i,compare:l,cmpLeft:c,cmpRight:p,cmpActive:d}=e.useSearch();return t(s,{shareId:n,initialFileId:o,startTime:r,versionId:i,compare:l,compareLeftId:c,compareRightId:p,compareActiveSide:d})}var e=a("/share/$shareId/files/$fileId")({component:h});export{e as Route};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as a,j as s,k as e,l as E,m as $,n as q}from"./chunk-ycq8ank7.js";import{ca as r}from"./chunk-kxskpgsq.js";import{ea as t}from"./chunk-g9r0p4t8.js";import{De as j}from"./chunk-vm6c3xx9.js";import{og as l,pg as x}from"./chunk-63y0eb07.js";import{hh as i}from"./chunk-qrf0ady6.js";import"./chunk-k47md1g4.js";import"./chunk-77m5p188.js";import{lh as d}from"./chunk-d9mjbtp2.js";import{di as o}from"./chunk-nhpgdqq5.js";import{qi as h}from"./chunk-b1ypjqgp.js";import{Ai as S,Gi as A,Hi as p,Ii as c,Ji as n,Zi as B,ui as L,yi as y,zi as F}from"./chunk-h0fxysxs.js";import{$j as T,Ej as f,Ok as I,aj as OG,bj as k,cj as G,dj as K,ij as P,mk as g,nj as C,qk as b,rm as m,um as X,vl as u}from"./chunk-yp9hvkc5.js";import{sn as qG}from"./chunk-dxyq9h8n.js";var _=qG(OG(),1);var zG=(Y)=>{if(!Y)return"??";return Y.split(" ").map((z)=>z[0]).slice(0,2).join("").toUpperCase()};function BG(){let{projectId:Y}=MG.useParams(),{teamId:z,ensureTeamIdForProject:U}=h(),GG=L(),JG=P();_.useEffect(()=>{U(Y)},[Y,U]);let{data:M}=y(j(Y)),D=M?.rootFolder,[KG,XG]=_.useState(240),{shareConfigLeftSidebarCollapsed:Q,setShareConfigLeftSidebarCollapsed:YG}=l(),{data:V,isLoading:ZG,fetchNextPage:R,hasNextPage:v,isFetchingNextPage:W}=S({queryKey:["shares",Y],queryFn:async({pageParam:J})=>{let Z=await A.api.projects[":projectId"].shares.$get({param:{projectId:Y},query:{first:"20",after:J}});if(!Z.ok)throw Error("Failed to fetch share links");return await Z.json()},initialPageParam:"",getNextPageParam:(J)=>J.pageInfo?.cursor||void 0,enabled:!!Y}),{ref:_G,inView:w}=d();_.useEffect(()=>{if(w&&v&&!W)R()},[w,v,W,R]);let H=_.useMemo(()=>V?.pages.flatMap((J)=>J.data)||[],[V]),{mutate:$G}=F({mutationFn:async({id:J,isDisabled:Z})=>{let O=await A.api.shares[":shareId"].$put({param:{shareId:J},json:{isDisabled:Z}});if(!O.ok)throw Error("Failed to update share link");return await O.json()},onSuccess:()=>{GG.invalidateQueries({queryKey:["shares",Y]}),B.success(X.share_link_status_updated())},onError:(J)=>{B.error(X.error_message({message:J.message}))}});if(!z||!D||!M)return G(x,{});let N=async(J)=>{let Z=`${window.location.origin}/share/${J}`;if(await t(Z))B.success(X.link_copied())};return G("div",{className:"flex flex-1 flex-col bg-background min-h-0",children:K("div",{className:"flex flex-1 overflow-hidden relative",children:[!Q&&G("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>YG(!0)}),!Q&&K(k,{children:[G("div",{className:"bg-background",style:{width:KG},children:G(i,{teamId:z,projectId:Y,projectName:M.name??"",rootFolderId:D})}),G(r,{onResize:(J)=>{XG((Z)=>Math.max(180,Math.min(400,Z+J)))},className:"hidden md:block"})]}),K("div",{className:"flex-1 flex flex-col min-h-0 bg-card overflow-hidden",children:[G("header",{className:"h-14 border-b flex items-center justify-between px-6 shrink-0 bg-background/50 backdrop-blur-sm sticky top-0 z-10",children:K("div",{className:"flex items-center gap-2",children:[G(u,{className:"h-5 w-5 text-primary"}),G("h1",{className:"font-bold text-lg text-foreground",children:X.all_share_links()})]})}),G("div",{className:"flex-1 overflow-y-auto p-6",children:ZG?G("div",{className:"flex justify-center items-center h-64",children:G("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):H.length===0?K("div",{className:"flex flex-col items-center justify-center h-64 text-muted-foreground gap-3",children:[G(I,{className:"h-10 w-10 text-muted-foreground/50"}),G("p",{children:X.no_share_links_yet()})]}):K("div",{className:"border border-border rounded-xl bg-background overflow-hidden shadow-xs",children:[K(a,{children:[G(s,{children:K(E,{className:"hover:bg-transparent bg-muted/20",children:[G($,{className:"font-semibold px-4 py-3",children:X.name()}),G($,{className:"font-semibold px-4 py-3",children:X.public_link()}),G($,{className:"font-semibold px-4 py-3",children:X.creator()}),G($,{className:"font-semibold px-4 py-3 w-[150px]",children:X.created_date()}),G($,{className:"font-semibold px-4 py-3 text-right w-[120px]",children:X.active()})]})}),G(e,{children:H.map((J)=>{let Z=`${window.location.origin}/share/${J.id}`;return K(E,{className:"hover:bg-muted/10 transition-colors",children:[G(q,{className:"font-medium px-4 py-3.5",children:G("span",{className:"cursor-pointer hover:underline text-foreground",onClick:()=>JG({to:"/projects/$projectId/shares/$shareId",params:{projectId:Y,shareId:J.id}}),children:J.name})}),G(q,{className:"px-4 py-3.5 max-w-[300px]",children:K("div",{className:"flex items-center gap-2 group",children:[G("span",{className:"truncate text-xs font-mono bg-muted/50 text-muted-foreground px-2 py-1 rounded-md border border-border cursor-pointer hover:bg-muted transition-colors flex-1",onClick:()=>N(J.id),title:X.click_to_copy_link(),children:Z}),G(m,{variant:"ghost",size:"icon-sm",className:"h-7 w-7 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>N(J.id),children:G(g,{className:"h-3.5 w-3.5"})}),G("a",{href:Z,target:"_blank",rel:"noreferrer",className:"text-muted-foreground hover:text-foreground inline-flex items-center",children:G(b,{className:"h-3.5 w-3.5"})})]})}),G(q,{className:"px-4 py-3.5",children:K("div",{className:"flex items-center gap-2",children:[K(p,{className:"h-6 w-6",children:[J.creator?.image&&G(c,{src:J.creator.image,alt:J.creator.name,className:"object-cover"}),G(n,{className:"text-[10px]",children:zG(J.creator?.name)})]}),G("span",{className:"text-sm font-medium text-foreground truncate max-w-[150px]",children:J.creator?.name||X.unknown()})]})}),G(q,{className:"px-4 py-3.5 text-muted-foreground text-sm",children:K("div",{className:"flex items-center gap-2",children:[G(T,{className:"h-3.5 w-3.5 text-muted-foreground/70"}),G("span",{children:new Date(J.createdAt).toLocaleDateString()})]})}),G(q,{className:"px-4 py-3.5 text-right",children:G("div",{className:"flex justify-end",children:G(o,{checked:!J.isDisabled,onCheckedChange:(O)=>$G({id:J.id,isDisabled:!O})})})})]},J.id)})})]}),G("div",{ref:_G,className:"h-10 w-full flex items-center justify-center",children:W&&G(f,{className:"h-6 w-6 animate-spin text-primary"})})]})})]})]})})}var MG=C("/projects/$projectId/shares/")({component:BG});export{MG as Route};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Am as z,Bm as E,zm as h}from"./chunk-mcc1scxs.js";import{Cm as S}from"./chunk-98ey5p2e.js";import"./chunk-xw2gpcsh.js";import{Fm as f}from"./chunk-tjcc7a6y.js";import{Gm as R}from"./chunk-e3cabksx.js";import{Hm as $}from"./chunk-xbhw6bpz.js";import"./chunk-jc1vb7rj.js";import{Wm as M,Xm as V}from"./chunk-gtbsb39v.js";import{an as C,cn as _}from"./chunk-vsx96mt6.js";import"./chunk-tbbwss3v.js";import{gn as k}from"./chunk-6w2wmvqs.js";import{nn as L}from"./chunk-dn7sbjws.js";import{on as D}from"./chunk-1phqxp6z.js";import"./chunk-dxyq9h8n.js";var O="v1",g=new Set(["openai","openai-codex","opencode","azure-openai-responses"]),A=16;function T(w){let G=new Map;if(!w)return G;for(let j of w.split(",")){let Q=j.trim();if(!Q)continue;let[W,J]=Q.split("=",2);if(!W||!J)continue;G.set(W.trim(),J.trim())}return G}function I(w,G){if(G?.azureDeploymentName)return G.azureDeploymentName;return T($("AZURE_OPENAI_DEPLOYMENT_NAME_MAP",G?.env)).get(w.id)||w.id}function b(w){return V(M(w),"Azure OpenAI API error")}var y=(w,G,j)=>{let Q=new D;return(async()=>{let W=I(w,j),J={role:"assistant",content:[],api:"azure-openai-responses",provider:w.provider,model:w.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 X=j?.apiKey;if(!X)throw Error(`No API key for provider: ${w.provider}`);let Y=U(w,X,j),F=C(G.tools,w.compat?.supportsOpenAIGrammarTools??!1),q=x(w,G,j,W,F),H=await j?.onPayload?.(q,w);if(H!==void 0)q=H;let K={...j?.signal?{signal:j.signal}:{},...j?.timeoutMs!==void 0?{timeout:j.timeoutMs}:{},maxRetries:0},{data:B,response:Z}=await R(()=>Y.responses.create(q,K).withResponse(),{maxRetries:j?.maxRetries,maxRetryDelayMs:j?.maxRetryDelayMs,signal:j?.signal});if(await j?.onResponse?.({status:Z.status,headers:k(Z.headers)},w),Q.push({type:"start",partial:J}),await E(B,J,Q,w,{grammarToolInputProperties:F}),j?.signal?.aborted)throw Error("Request was aborted");if(J.stopReason==="aborted"||J.stopReason==="error")throw Error("An unknown error occurred");Q.push({type:"done",reason:J.stopReason,message:J}),Q.end()}catch(X){for(let Y of J.content)delete Y.index,delete Y.partialJson,delete Y.customInput;J.stopReason=j?.signal?.aborted?"aborted":"error",J.errorMessage=b(X),Q.push({type:"error",reason:J.stopReason,error:J}),Q.end()}})(),Q},t=(w,G,j)=>{let Q=j?.apiKey;if(!Q)throw Error(`No API key for provider: ${w.provider}`);let W=_(w,G,j,Q),J=j?.reasoning?L(w,j.reasoning):void 0;return y(w,G,{...W,reasoningEffort:J==="off"?void 0:J})};function v(w){let G=w.trim().replace(/\/+$/,""),j;try{j=new URL(G)}catch{throw Error(`Invalid Azure OpenAI base URL: ${w}`)}let Q=j.hostname.endsWith(".openai.azure.com")||j.hostname.endsWith(".cognitiveservices.azure.com")||j.hostname.endsWith(".ai.azure.com"),W=j.pathname.replace(/\/+$/,"");if(Q&&(W===""||W==="/"||W==="/openai"||W==="/openai/v1/responses"))j.pathname="/openai/v1",j.search="";return j.toString().replace(/\/+$/,"")}function N(w){return`https://${w}.openai.azure.com/openai/v1`}function P(w,G){let j=G?.azureApiVersion||$("AZURE_OPENAI_API_VERSION",G?.env)||O,Q=G?.azureBaseUrl?.trim()||$("AZURE_OPENAI_BASE_URL",G?.env)?.trim()||void 0,W=G?.azureResourceName||$("AZURE_OPENAI_RESOURCE_NAME",G?.env),J=Q;if(!J&&W)J=N(W);if(!J&&w.baseUrl)J=w.baseUrl;if(!J)throw Error("Azure OpenAI base URL is required. Set AZURE_OPENAI_BASE_URL or AZURE_OPENAI_RESOURCE_NAME, or pass azureBaseUrl, azureResourceName, or model.baseUrl.");return{baseUrl:v(J),apiVersion:j}}function U(w,G,j){let Q={...w.headers};if(j?.headers)Object.assign(Q,j.headers);let{baseUrl:W,apiVersion:J}=P(w,j);return new f({apiKey:G,apiVersion:J,dangerouslyAllowBrowser:!0,defaultHeaders:Q,baseURL:W})}function x(w,G,j,Q,W=C(G.tools,w.compat?.supportsOpenAIGrammarTools??!1)){let J=h(w,G,g,{grammarToolInputProperties:W}),X={model:Q,input:J,stream:!0,prompt_cache_key:S(j?.sessionId),store:!1};if(j?.maxTokens)X.max_output_tokens=Math.max(j.maxTokens,A);if(j?.temperature!==void 0)X.temperature=j?.temperature;if(G.tools&&G.tools.length>0)X.tools=z(G.tools,{supportsStrictMode:w.compat?.supportsStrictMode??!0,supportsOpenAIGrammarTools:w.compat?.supportsOpenAIGrammarTools??!1});if(w.reasoning){if(j?.reasoningEffort||j?.reasoningSummary){let Y=j?.reasoningEffort?w.thinkingLevelMap?.[j.reasoningEffort]??j.reasoningEffort:"medium";X.reasoning={effort:Y,summary:j?.reasoningSummary||"auto"},X.include=["reasoning.encrypted_content"]}else if(w.thinkingLevelMap?.off!==null)X.reasoning={effort:w.thinkingLevelMap?.off??"none"}}return X}export{t as streamSimple,y as stream};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{Bi as j,Gi as B,Zi as k}from"./chunk-h0fxysxs.js";var w=null,r=j((J)=>({projectState:null,setProjectState:(D)=>{if(w)clearTimeout(w),w=null;J({projectState:D})},clearProjectState:()=>{if(w)clearTimeout(w);w=setTimeout(()=>{J({projectState:null}),w=null},10)}}));var _="shumai_selected_agent_id",h=()=>{if(typeof window<"u"&&window.localStorage)return localStorage.getItem(_);return null},K=j((J)=>({isChatbotOpen:!1,setIsChatbotOpen:(D)=>J({isChatbotOpen:D}),isHistoryMode:!1,setIsHistoryMode:(D)=>J({isHistoryMode:D}),currentSessionId:null,setCurrentSessionId:(D)=>J({currentSessionId:D}),chatAssets:[],addAssets:(D)=>J((H)=>{let Q=new Set(H.chatAssets.map((W)=>W.id)),L=D.filter((W)=>!Q.has(W.id));return{chatAssets:[...H.chatAssets,...L]}}),removeAsset:(D)=>J((H)=>({chatAssets:H.chatAssets.filter((Q)=>Q.id!==D)})),clearAssets:()=>J({chatAssets:[]}),messages:[],setMessages:(D)=>J({messages:D}),historySessions:[],setHistorySessions:(D)=>J({historySessions:D}),isStreaming:!1,setIsStreaming:(D)=>J({isStreaming:D}),selectedAgentId:h(),setSelectedAgentId:(D)=>{if(typeof window<"u"&&window.localStorage)if(D)localStorage.setItem(_,D);else localStorage.removeItem(_);J({selectedAgentId:D})},inputText:"",setInputText:(D)=>J({inputText:D}),scrollTop:0,isAtBottom:!0,setScrollState:(D,H)=>J({scrollTop:D,isAtBottom:H}),fetchHistorySessions:async(D)=>{try{let H=await B.api.teams[":teamId"].chat.sessions.$get({param:{teamId:D},query:{first:"50"}});if(H.ok){let Q=await H.json();J({historySessions:Q.data||[]})}}catch(H){console.error("Failed to fetch history sessions:",H)}},loadSession:async(D,H)=>{try{let Q=await B.api.teams[":teamId"].chat.sessions[":sessionId"].messages.$get({param:{teamId:D,sessionId:H}});if(Q.ok){let L=await Q.json(),z=K.getState().historySessions.find((q)=>q.id===H)?.agentId||null;J({currentSessionId:H,messages:L,isHistoryMode:!1,scrollTop:0,isAtBottom:!0,...z?{selectedAgentId:z}:{}})}else throw Error("Failed to load session messages")}catch(Q){let L=Q instanceof Error?Q.message:"Failed to load session";k.error(L)}},deleteSession:async(D,H)=>{try{if((await B.api.teams[":teamId"].chat.sessions[":sessionId"].$delete({param:{teamId:D,sessionId:H}})).ok)k.success("Session deleted successfully"),J((L)=>({historySessions:L.historySessions.filter((W)=>W.id!==H),currentSessionId:L.currentSessionId===H?null:L.currentSessionId,messages:L.currentSessionId===H?[]:L.messages}));else throw Error("Failed to delete session")}catch(Q){let L=Q instanceof Error?Q.message:"Failed to delete session";k.error(L)}},startNewSession:()=>{let D=h();J({currentSessionId:null,messages:[],chatAssets:[],inputText:"",scrollTop:0,isAtBottom:!0,...D?{selectedAgentId:D}:{}})},sendMessage:async(D,H,Q,L,W,z,q,P,y)=>{let U=K.getState();if(U.isStreaming)return;let R=`temp-${Date.now()}`,x={id:R,role:"custom",customType:"shumai_message",content:H,display:!0,details:{currentAsset:L?{id:L,name:"",type:"file"}:void 0,position:P!==void 0&&P!==null?{type:"time",seconds:P}:void 0,annotation:!!(q&&q.length>0),annotations:q||void 0,attachedFiles:y||void 0,referencedAssets:U.chatAssets.length>0?U.chatAssets.map((V)=>({id:V.id,name:V.name,type:V.type})):void 0},timestamp:Date.now()},A=[...U.messages,x];J({messages:A,isStreaming:!0,chatAssets:[],isAtBottom:!0});let G=U.chatAssets.map((V)=>V.id),f=U.selectedAgentId;if(!f){k.error("No agent selected");return}try{let V=await B.api.teams[":teamId"].chat.$post({param:{teamId:D},json:{agentId:f,textPrompt:H||void 0,attachedFiles:z&&z.length>0?z:void 0,assetIds:G&&G.length>0?G:void 0,sessionId:U.currentSessionId||void 0,contextAssetId:L,projectId:Q,second:P??void 0,annotations:q&&q.length>0?q:void 0}});if(!V.ok)throw Error("Failed to start chat");let Y=V.headers.get("x-session-id");if(Y&&!U.currentSessionId)J({currentSessionId:Y});let v=V.body?.getReader();if(!v)throw Error("No stream body");let N=new TextDecoder,O="";while(!0){let{done:E,value:l}=await v.read();if(E)break;O+=N.decode(l,{stream:!0});let M=O.split(`
|
|
2
|
+
`);O=M.pop()||"";for(let u of M){let C=u.trim();if(!C)continue;if(C.startsWith("data: ")){let g=C.slice(6);try{let Z=JSON.parse(g);if(Z.type==="session"){if(!K.getState().currentSessionId)J({currentSessionId:Z.sessionId})}else if(Z.type==="entry"){let X=Z.entry,F=X;if(F.role==="toolResult"&&typeof F.toolName==="string"&&["create_file","create_folder","create_version"].includes(F.toolName)&&!F.isError)W?.();J((b)=>{let p=b.messages.some(($)=>$.id===X.id),c=(X.role==="user"||X.role==="custom"&&X.customType==="shumai_message")&&!p,T=b.messages.filter(($)=>{if(c)return!$.id.startsWith("temp-");if(X.role==="custom"&&X.customType==="context_display_info"&&!p)return!$.id.startsWith("temp-context-");return!0}),S=T.findIndex(($)=>$.id===X.id);if(S!==-1){let $=[...T];return $[S]=X,{messages:$}}else return{messages:[...T,X]}})}else if(Z.type==="done"){if(Z.status==="failed")k.error(Z.error||"Workflow failed")}}catch(Z){console.error("Error parsing SSE line:",Z)}}}}K.getState().fetchHistorySessions(D)}catch(V){let Y=V instanceof Error?V.message:"Failed to send message";k.error(Y),J((v)=>({messages:v.messages.filter((N)=>N.id!==R)}))}finally{J({isStreaming:!1})}},abortActiveSession:async(D)=>{let{currentSessionId:H,isStreaming:Q}=K.getState();if(!H||!Q)return;try{if((await B.api.teams[":teamId"].chat.sessions[":sessionId"].abort.$post({param:{teamId:D,sessionId:H}})).ok)k.success("Agent execution stopped");else throw Error("Failed to abort agent execution")}catch(L){let W=L instanceof Error?L.message:"Failed to abort execution";k.error(W)}}}));
|
|
3
|
+
export{r as $f,K as ag};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Xl as r,cj as t,gm as e,km as p}from"./chunk-yp9hvkc5.js";function s({...o}){return t(e.Root,{"data-slot":"popover",...o})}function l({...o}){return t(e.Trigger,{"data-slot":"popover-trigger",...o})}function c({className:o,align:a="center",sideOffset:i=4,...n}){return t(e.Portal,{children:t(e.Content,{"data-slot":"popover-content",align:a,sideOffset:i,className:r("z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",o),...n})})}function g({className:o,orientation:a="horizontal",decorative:i=!0,...n}){return t(p.Root,{"data-slot":"separator",decorative:i,orientation:a,className:r("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",o),...n})}
|
|
2
|
+
export{s as kg,l as lg,c as mg,g as ng};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{kh as a}from"./chunk-77m5p188.js";import{Bi as o,Di as f,Ei as p}from"./chunk-h0fxysxs.js";import{cj as i,dj as d}from"./chunk-yp9hvkc5.js";var L=o()(p((r)=>({fileViewLeftSidebarCollapsed:!0,setFileViewLeftSidebarCollapsed:(e)=>r({fileViewLeftSidebarCollapsed:e}),fileViewRightSidebarCollapsed:!1,setFileViewRightSidebarCollapsed:(e)=>r({fileViewRightSidebarCollapsed:e}),fileListLeftSidebarCollapsed:!1,setFileListLeftSidebarCollapsed:(e)=>r({fileListLeftSidebarCollapsed:e}),fileListRightSidebarCollapsed:!0,setFileListRightSidebarCollapsed:(e)=>r({fileListRightSidebarCollapsed:e}),shareConfigLeftSidebarCollapsed:!1,setShareConfigLeftSidebarCollapsed:(e)=>r({shareConfigLeftSidebarCollapsed:e}),shareConfigRightSidebarCollapsed:!1,setShareConfigRightSidebarCollapsed:(e)=>r({shareConfigRightSidebarCollapsed:e}),viewModes:{},setViewMode:(e,l)=>r((b)=>({viewModes:{...b.viewModes,[e]:l}})),videoTimeDisplayMode:"standard",setVideoTimeDisplayMode:(e)=>r({videoTimeDisplayMode:e})}),{name:"ui-storage",storage:f(()=>localStorage)}));function v(){return d("div",{className:"flex h-screen flex-col bg-background min-h-0",children:[d("div",{className:"flex h-14 items-center justify-between border-b px-6 shrink-0",children:[d("div",{className:"flex items-center gap-2",children:[i(a,{className:"h-4 w-24"}),i("span",{className:"text-muted-foreground",children:"/"}),i(a,{className:"h-4 w-32"})]}),d("div",{className:"flex items-center gap-2",children:[i(a,{className:"h-8 w-8 rounded-md"}),i(a,{className:"h-8 w-20 rounded-md"})]})]}),d("div",{className:"flex flex-1 overflow-hidden",children:[d("div",{className:"w-[240px] border-r p-4 space-y-4 hidden md:block shrink-0",children:[d("div",{className:"flex items-center gap-2",children:[i(a,{className:"h-4 w-4 rounded"}),i(a,{className:"h-4 w-24"})]}),d("div",{className:"pl-4 space-y-3",children:[d("div",{className:"flex items-center gap-2",children:[i(a,{className:"h-3 w-3 rounded"}),i(a,{className:"h-3 w-28"})]}),d("div",{className:"flex items-center gap-2",children:[i(a,{className:"h-3 w-3 rounded"}),i(a,{className:"h-3 w-20"})]}),d("div",{className:"flex items-center gap-2",children:[i(a,{className:"h-3 w-3 rounded"}),i(a,{className:"h-3 w-24"})]})]})]}),d("div",{className:"flex-1 p-6 space-y-6 overflow-y-auto",children:[d("div",{className:"flex items-center justify-between border-b pb-4",children:[d("div",{className:"flex items-center gap-4",children:[i(a,{className:"h-5 w-40"}),i(a,{className:"h-4 w-20"})]}),d("div",{className:"flex items-center gap-2",children:[i(a,{className:"h-8 w-8 rounded"}),i(a,{className:"h-8 w-8 rounded"}),i(a,{className:"h-8 w-32 rounded"})]})]}),d("div",{className:"space-y-4",children:[i("div",{className:"flex items-center gap-2",children:i(a,{className:"h-4 w-24"})}),i("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5",children:Array.from({length:10}).map((r,e)=>d("div",{className:"flex flex-col rounded-lg border bg-card p-3 space-y-3",children:[i(a,{className:"aspect-square w-full rounded-md"}),d("div",{className:"space-y-2",children:[i(a,{className:"h-4 w-3/4"}),d("div",{className:"flex justify-between items-center",children:[i(a,{className:"h-3 w-1/4"}),i(a,{className:"h-3 w-1/3"})]})]})]},e))})]})]})]})]})}function R(){return d("div",{className:"h-screen flex flex-col bg-background",children:[d("div",{className:"flex h-14 items-center justify-between border-b px-6 shrink-0",children:[d("div",{className:"flex items-center gap-2",children:[i(a,{className:"h-4 w-16"}),i("span",{className:"text-muted-foreground",children:"/"}),i(a,{className:"h-4 w-28"}),i("span",{className:"text-muted-foreground",children:"/"}),i(a,{className:"h-4 w-32"})]}),i("div",{className:"flex items-center gap-2",children:i(a,{className:"h-8 w-20 rounded"})})]}),d("div",{className:"flex flex-1 overflow-hidden",children:[d("div",{className:"w-[280px] border-r p-4 flex flex-col gap-4 shrink-0 hidden md:flex",children:[i(a,{className:"h-5 w-24"}),i("div",{className:"space-y-3 flex-1 overflow-y-auto",children:Array.from({length:4}).map((r,e)=>d("div",{className:"flex gap-3 p-2 rounded border",children:[i(a,{className:"h-12 w-12 rounded bg-muted shrink-0"}),d("div",{className:"space-y-2 flex-1",children:[i(a,{className:"h-3 w-2/3"}),i(a,{className:"h-2 w-1/2"})]})]},e))})]}),d("div",{className:"flex-1 bg-muted/20 p-6 flex flex-col justify-between relative min-w-0",children:[i("div",{className:"flex-1 flex items-center justify-center",children:i(a,{className:"w-full max-w-4xl aspect-video rounded-lg shadow-lg"})}),d("div",{className:"mt-4 flex items-center justify-between shrink-0",children:[d("div",{className:"flex items-center gap-4",children:[i(a,{className:"h-8 w-8 rounded-full"}),i(a,{className:"h-4 w-32"})]}),i(a,{className:"h-4 w-24"})]})]}),d("div",{className:"w-[360px] border-l p-4 flex flex-col gap-6 shrink-0 hidden lg:flex bg-card",children:[d("div",{className:"space-y-4",children:[i(a,{className:"h-5 w-32"}),i("div",{className:"space-y-3",children:Array.from({length:3}).map((r,e)=>d("div",{className:"flex justify-between items-center py-1 border-b",children:[i(a,{className:"h-3 w-20"}),i(a,{className:"h-3 w-32"})]},e))})]}),d("div",{className:"flex-1 flex flex-col gap-4",children:[i(a,{className:"h-5 w-24"}),i("div",{className:"space-y-3 flex-1 overflow-y-auto",children:Array.from({length:3}).map((r,e)=>d("div",{className:"flex gap-3 p-3 rounded-lg border bg-muted/10",children:[i(a,{className:"h-8 w-8 rounded-full shrink-0"}),d("div",{className:"space-y-2 flex-1",children:[d("div",{className:"flex justify-between",children:[i(a,{className:"h-3 w-24"}),i(a,{className:"h-2 w-12"})]}),i(a,{className:"h-3 w-full"}),i(a,{className:"h-3 w-5/6"})]})]},e))})]})]})]})]})}function V({displayStyle:r="card"}){if(r==="list")return i("div",{className:"p-4 space-y-2","data-testid":"file-browser-loading-skeleton",children:Array.from({length:8}).map((e,l)=>d("div",{className:"flex items-center gap-4 py-2 border-b border-border/40",children:[i(a,{className:"h-4 w-4 rounded"}),i(a,{className:"h-4 w-4 rounded"}),i(a,{className:"h-4 w-48"}),d("div",{className:"ml-auto flex items-center gap-8",children:[i(a,{className:"h-3 w-16"}),i(a,{className:"h-3 w-24"})]})]},l))});return i("div",{className:"p-4 space-y-4","data-testid":"file-browser-loading-skeleton",children:i("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5",children:Array.from({length:10}).map((e,l)=>d("div",{className:"flex flex-col rounded-lg border bg-card p-3 space-y-3",children:[i(a,{className:"aspect-square w-full rounded-md"}),d("div",{className:"space-y-2",children:[i(a,{className:"h-4 w-3/4"}),d("div",{className:"flex justify-between items-center",children:[i(a,{className:"h-3 w-1/4"}),i(a,{className:"h-3 w-1/3"})]})]})]},l))})})}function c(){return i("div",{className:"p-3 space-y-3 max-w-lg mx-auto w-full","data-testid":"mobile-file-browser-loading-skeleton",children:Array.from({length:6}).map((r,e)=>d("div",{className:"flex items-center gap-3 p-3 rounded-lg border bg-card",children:[i(a,{className:"h-10 w-10 rounded-md shrink-0"}),d("div",{className:"space-y-2 flex-1",children:[i(a,{className:"h-4 w-3/4"}),i(a,{className:"h-3 w-1/3"})]})]},e))})}
|
|
2
|
+
export{L as og,v as pg,R as qg,V as rg,c as sg};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Xl as O,cj as J,dj as M}from"./chunk-yp9hvkc5.js";var A=(P)=>{if(isNaN(P))return"00:00";let N=new Date(P*1000),q=N.getUTCHours(),$=N.getUTCMinutes().toString().padStart(2,"0"),k=N.getUTCSeconds().toString().padStart(2,"0");if(q)return`${q}:${$}:${k}`;return`${$}:${k}`},y=(P,N,q,$)=>{if(q==="frames")return`${P} fr`;if(q==="standard")return A(P/N);let k=Math.round(N),K=N!==k,z=!1;if(K&&(k===30||k===60))z=!0;let G=0;if($){let C=$.match(/^([012]\d):(\d\d):(\d\d)(:|;|\.)(\d+)$/);if(C){let H=parseInt(C[1],10),E=parseInt(C[2],10),Y=parseInt(C[3],10),Z=parseInt(C[5],10);if(z=C[4]!==":",G=(H*3600+E*60+Y)*k+Z,z){let L=H*60+E,g=N<30?2:4;G-=g*(L-Math.floor(L/10))}}}let B=P+G;if(z){let C=N<30?2:4,H=Math.floor(B/(17982*C/2)),E=B%(17982*C/2);if(E<C)E=E+C;B+=9*C*H+C*Math.floor((E-C)/(1798*C/2))}let Q=B%k,U=Math.floor(B/k)%60,V=Math.floor(B/(k*60))%60,W=Math.floor(B/(k*3600))%24,X=z?";":":";return`${W.toString().padStart(2,"0")}:${V.toString().padStart(2,"0")}:${U.toString().padStart(2,"0")}${X}${Q.toString().padStart(2,"0")}`};var S=(P,N)=>{if(!N)return 0;let q=1/N;return P*q+q/2},_=(P)=>Math.max(100,3000/(P||30)),w=({dbTotalFrames:P,containerDuration:N,frameRate:q})=>{let $=q||30,k=Math.round(N*$);if(P<=0)return k;let K=P/$,z=N-K,G=_($)/1000;return z>G?k:P};var D=({progress:P,className:N})=>{let $=2*Math.PI*20,k=$-Math.min(100,Math.max(0,P))/100*$;return M("svg",{viewBox:"0 0 50 50",className:O("w-12 h-12",N),children:[J("circle",{cx:"25",cy:"25",r:20,className:"stroke-muted",strokeWidth:"4",fill:"transparent"}),J("circle",{cx:"25",cy:"25",r:20,className:"stroke-primary transition-all duration-300 ease-out",strokeWidth:"4",fill:"transparent",strokeDasharray:$,strokeDashoffset:k,transform:"rotate(-90 25 25)"}),J("text",{x:"50%",y:"50%",textAnchor:"middle",dy:".3em",className:"fill-foreground text-[10px] font-bold",children:`${Math.round(P)}%`})]})};
|
|
2
|
+
export{D as Y,A as Z,y as _,S as $,_ as aa,w as ba};
|