@shumai-one/shumai 0.6.1 → 0.6.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-01052ssf.js +32 -0
- package/bin/{chunk-w4ydfy9d.js → chunk-02fvcrej.js} +4 -4
- package/bin/chunk-0bj887zm.js +2 -0
- package/bin/chunk-167z646e.js +2 -0
- package/bin/chunk-1ktk6764.js +10 -0
- package/bin/{chunk-p1ed0pa6.js → chunk-1nvd90g2.js} +1 -1
- package/bin/{chunk-kywdke0y.js → chunk-1wfg56z3.js} +5 -5
- package/bin/{chunk-ahgq10a7.js → chunk-257dcd2f.js} +2 -2
- package/bin/chunk-26qn7fek.js +2 -0
- package/bin/chunk-2cdxm1cp.js +55 -0
- package/bin/chunk-2jj4j8cn.js +3 -0
- package/bin/chunk-2ne2b54t.js +2 -0
- package/bin/{chunk-qqj2m1b1.js → chunk-2nhgdqdg.js} +2 -2
- package/bin/chunk-2vbeqczj.js +1 -0
- package/bin/chunk-37p6bcx2.js +1 -0
- package/bin/chunk-3ckkwdjx.js +13 -0
- package/bin/chunk-3knfx6dm.js +1 -0
- package/bin/chunk-3z85zxkn.js +1 -0
- package/bin/chunk-4mws03es.js +5 -0
- package/bin/chunk-54tbfvya.js +2 -0
- package/bin/chunk-55h9ze53.js +2 -0
- package/bin/chunk-56kh5fxc.js +1 -0
- package/bin/chunk-576nj64j.js +2 -0
- package/bin/{chunk-dfecgpce.js → chunk-5wapd171.js} +13 -13
- package/bin/chunk-6cnqjngz.js +1 -0
- package/bin/chunk-73yncv54.js +2 -0
- package/bin/chunk-7g46e1wy.js +3 -0
- package/bin/{chunk-jq3pq545.js → chunk-7naa7tpn.js} +2 -2
- package/bin/{chunk-am6dg0a5.js → chunk-7sgrtxbt.js} +2 -2
- package/bin/{chunk-3me1v3z5.js → chunk-7v7mypc6.js} +2 -2
- package/bin/chunk-82tps5n1.js +2 -0
- package/bin/chunk-84x8p7v5.js +1 -0
- package/bin/{chunk-fxtzy5f5.js → chunk-88jg9dq5.js} +2 -2
- package/bin/chunk-8cjet7pp.js +12 -0
- package/bin/chunk-8fyg9dy4.js +2 -0
- package/bin/chunk-8gtfgkrn.js +2 -0
- package/bin/chunk-8mqbztj8.js +2 -0
- package/bin/chunk-8xb6yz11.js +2 -0
- package/bin/chunk-8yjsmr7g.js +2 -0
- package/bin/chunk-91rb0jpb.js +2 -0
- package/bin/chunk-96qpjght.js +2 -0
- package/bin/chunk-9f1xk1nt.js +1 -0
- package/bin/chunk-9mk9cvbk.js +1 -0
- package/bin/{chunk-r5g84kj4.js → chunk-9n1w5dw1.js} +3 -3
- package/bin/chunk-9nw5w8vh.js +1 -0
- package/bin/{chunk-3j82q2gj.js → chunk-9t3p4xp6.js} +1 -1
- package/bin/chunk-9xhjy897.js +11 -0
- package/bin/chunk-9zsv6d2f.js +1 -0
- package/bin/chunk-a411xhmm.js +7 -0
- package/bin/{chunk-s01p4w8d.js → chunk-a74g6h8a.js} +2 -2
- package/bin/chunk-ah8fjb6f.js +2 -0
- package/bin/chunk-atfz7g7e.js +2 -0
- package/bin/{chunk-swz6v48q.js → chunk-b5rhvzv9.js} +2 -2
- package/bin/{chunk-bg6waaf9.js → chunk-b7bnp021.js} +2 -2
- package/bin/chunk-cf5axr8c.js +1 -0
- package/bin/chunk-cgmebxx6.js +2 -0
- package/bin/chunk-cwat1jwx.js +3 -0
- package/bin/chunk-cz13a82m.js +3 -0
- package/bin/chunk-dk42gf7v.js +2 -0
- package/bin/chunk-e4f56spj.js +4 -0
- package/bin/chunk-e4yscwen.js +18 -0
- package/bin/chunk-eb7mzbfm.js +1 -0
- package/bin/chunk-er14d498.js +3 -0
- package/bin/{chunk-bs6saf4d.js → chunk-eyjfhdp9.js} +2 -2
- package/bin/chunk-f25fe9th.js +393 -0
- package/bin/chunk-f6avg5qe.js +129 -0
- package/bin/chunk-fatmqnp1.js +2 -0
- package/bin/chunk-fvx9k1dc.js +2 -0
- package/bin/{chunk-h6f2gyt5.js → chunk-g22wmpk1.js} +2 -2
- package/bin/chunk-g6sdezec.js +2 -0
- package/bin/chunk-gtf19jc1.js +2 -0
- package/bin/chunk-gxepkvt2.js +2 -0
- package/bin/chunk-h1n7jqnw.js +1 -0
- package/bin/chunk-hfm82066.js +2 -0
- package/bin/chunk-hnkcgvcj.js +3 -0
- package/bin/{chunk-agcnbjxk.js → chunk-hpbn0k9n.js} +2 -2
- package/bin/{chunk-d4hk62q2.js → chunk-hpwv4am3.js} +4 -4
- package/bin/{chunk-acmr8v0d.js → chunk-hw6czrya.js} +1 -1
- package/bin/{chunk-r9gp9yqw.js → chunk-hzkjgcre.js} +1 -1
- package/bin/chunk-j2s311yc.js +3 -0
- package/bin/{chunk-6hzktewz.js → chunk-jt02kpfc.js} +2 -2
- package/bin/{chunk-c60j1b4w.js → chunk-jt0ykktx.js} +1 -1
- package/bin/{chunk-sd6w0z6a.js → chunk-jzgbxqdg.js} +2 -2
- package/bin/chunk-kj6h5j5a.js +4 -0
- package/bin/chunk-km4gn6b6.js +1 -0
- package/bin/chunk-knj2s8mg.js +16 -0
- package/bin/{chunk-1eqw2dpx.js → chunk-kvhf12b4.js} +2 -2
- package/bin/chunk-m0q2cgfg.js +2 -0
- package/bin/chunk-m82tkhaa.js +11 -0
- package/bin/chunk-m9adtgzk.js +2 -0
- package/bin/{chunk-0tvnfy4k.js → chunk-mcj1xpcc.js} +2 -2
- package/bin/chunk-mcw198kg.js +13 -0
- package/bin/{chunk-9s0k533c.js → chunk-mwktrwtx.js} +1 -1
- package/bin/{chunk-wsprap60.js → chunk-mzsw9var.js} +2 -2
- package/bin/chunk-ns33grgx.js +2 -0
- package/bin/{chunk-xsfy8hz3.js → chunk-ny1kbmxt.js} +2 -2
- package/bin/{chunk-16n160h1.js → chunk-p3f5aevs.js} +1 -1
- package/bin/chunk-p3j6ydk1.js +1 -0
- package/bin/chunk-p4s95471.js +2 -0
- package/bin/chunk-pk406dgy.js +2 -0
- package/bin/chunk-q2bew2vc.js +2 -0
- package/bin/chunk-q5vkxee3.js +5 -0
- package/bin/{chunk-hzv1mhr5.js → chunk-q83h0hkx.js} +2 -2
- package/bin/{chunk-fre31bhw.js → chunk-q8w4mbw4.js} +2 -2
- package/bin/{chunk-b7qs7hxg.js → chunk-qwpkcp8d.js} +2 -2
- package/bin/chunk-r1xer8gn.js +5 -0
- package/bin/chunk-s1e4qy3q.js +14 -0
- package/bin/{chunk-b9d8xdhb.js → chunk-s9ksftq2.js} +1 -1
- package/bin/chunk-srxp5jav.js +42 -0
- package/bin/chunk-swtwaaqe.js +1 -0
- package/bin/chunk-tagdrg7p.js +1 -0
- package/bin/{chunk-d18v5vmp.js → chunk-tekwpkjf.js} +2 -2
- package/bin/chunk-twtxnzbv.js +2 -0
- package/bin/{chunk-c6f8x05m.js → chunk-v05rrxp5.js} +2 -2
- package/bin/{chunk-ht5rht98.js → chunk-v5cn90cf.js} +2 -2
- package/bin/chunk-v5mcjwxy.js +2 -0
- package/bin/{chunk-jb8vbeb0.js → chunk-vcrmjtcz.js} +2 -2
- package/bin/chunk-vkzasgxw.js +2 -0
- package/bin/chunk-vp3czaeh.js +7 -0
- package/bin/chunk-x03jwaga.js +8 -0
- package/bin/chunk-x342vzdx.js +2 -0
- package/bin/chunk-x8mjh387.js +5 -0
- package/bin/chunk-xc54vhfz.js +2 -0
- package/bin/chunk-xvkwbczx.js +3 -0
- package/bin/chunk-y241cxff.js +1 -0
- package/bin/chunk-yk12hydf.js +7 -0
- package/bin/chunk-ympbfzz4.js +2 -0
- package/bin/{chunk-n412a1hp.js → chunk-yq32evnn.js} +6 -6
- package/bin/chunk-z1p13dnc.js +2 -0
- package/bin/chunk-zarz3sqn.js +211 -0
- package/bin/chunk-zezje74z.js +4 -0
- package/bin/chunk-zrszykjf.js +3 -0
- package/bin/shumai-app.html +1 -1
- package/bin/shumai-app.js +942 -1015
- package/package.json +7 -7
- package/prisma/migrations/20261026024507_hash_api_tokens/migration.sql +28 -0
- package/prisma/migrations/20261026031904_add_audit_log_via/migration.sql +2 -0
- package/prisma/migrations/20261029024626_add_oauth_and_jwks/migration.sql +205 -0
- package/prisma/migrations/20261029030321_default_empty_arrays_oauth/migration.sql +25 -0
- package/prisma/schema.prisma +186 -1
- package/bin/chunk-0502p2k7.js +0 -3
- package/bin/chunk-0b0t6y8h.js +0 -11
- package/bin/chunk-1vt9ss7d.js +0 -2
- package/bin/chunk-23780yj6.js +0 -3
- package/bin/chunk-2cpsfc87.js +0 -1
- package/bin/chunk-2w0d9veg.js +0 -2
- package/bin/chunk-2xp9prpq.js +0 -1
- package/bin/chunk-3gqs15zq.js +0 -2
- package/bin/chunk-3pw7z25v.js +0 -3
- package/bin/chunk-3tx9v8kj.js +0 -2
- package/bin/chunk-3wdtp4ht.js +0 -1
- package/bin/chunk-57axjy7y.js +0 -1
- package/bin/chunk-5aqthcm6.js +0 -5
- package/bin/chunk-5gq4q1bb.js +0 -2
- package/bin/chunk-5r1br11d.js +0 -2
- package/bin/chunk-61hrdg0g.js +0 -1
- package/bin/chunk-6aa4xmnw.js +0 -2
- package/bin/chunk-6mrgtn78.js +0 -18
- package/bin/chunk-6s55r0z9.js +0 -1
- package/bin/chunk-6vkfzzvt.js +0 -5
- package/bin/chunk-7dprpnm6.js +0 -2
- package/bin/chunk-7rycq6wb.js +0 -129
- package/bin/chunk-895gzdtp.js +0 -7
- package/bin/chunk-8d1p8qpv.js +0 -1
- package/bin/chunk-8r3k84dh.js +0 -2
- package/bin/chunk-99sarrvt.js +0 -3
- package/bin/chunk-b21z62fj.js +0 -1
- package/bin/chunk-bv589v2m.js +0 -3
- package/bin/chunk-c8kjpmfe.js +0 -2
- package/bin/chunk-c9xyejnk.js +0 -2
- package/bin/chunk-cb9peqy5.js +0 -2
- package/bin/chunk-ckczqmrz.js +0 -5
- package/bin/chunk-cr33cs6j.js +0 -2
- package/bin/chunk-cxet91kt.js +0 -2
- package/bin/chunk-d7e351jd.js +0 -6
- package/bin/chunk-ebcfbn00.js +0 -2
- package/bin/chunk-f0b4a9y3.js +0 -2
- package/bin/chunk-fkn6f4qt.js +0 -4
- package/bin/chunk-g78vapcm.js +0 -2
- package/bin/chunk-gdpfwxea.js +0 -4
- package/bin/chunk-gwqqq0b1.js +0 -32
- package/bin/chunk-h3cwf9aw.js +0 -2
- package/bin/chunk-h4ty530v.js +0 -16
- package/bin/chunk-h58yfx7w.js +0 -2
- package/bin/chunk-h9ngpxyd.js +0 -1
- package/bin/chunk-hbr17jvr.js +0 -13
- package/bin/chunk-hc0xbmtt.js +0 -5
- package/bin/chunk-j9t7tvt5.js +0 -2
- package/bin/chunk-jvt8q0eg.js +0 -2
- package/bin/chunk-jzgtthsj.js +0 -3
- package/bin/chunk-jzjhg7ng.js +0 -1
- package/bin/chunk-k547syp2.js +0 -2
- package/bin/chunk-k7sjpke6.js +0 -2
- package/bin/chunk-k8ct1qgv.js +0 -3
- package/bin/chunk-k9q4nn8b.js +0 -11
- package/bin/chunk-keetdtxb.js +0 -2
- package/bin/chunk-kjjw8mbg.js +0 -1
- package/bin/chunk-mey80kv9.js +0 -54
- package/bin/chunk-nfncawpm.js +0 -12
- package/bin/chunk-nvwt8atc.js +0 -1
- package/bin/chunk-p1d500sf.js +0 -211
- package/bin/chunk-q0vs124k.js +0 -2
- package/bin/chunk-q5795f3s.js +0 -2
- package/bin/chunk-q5j3b0h5.js +0 -3
- package/bin/chunk-qd7pvaxb.js +0 -2
- package/bin/chunk-qhpt7170.js +0 -2
- package/bin/chunk-qt78vs3g.js +0 -2
- package/bin/chunk-ra6mdjr0.js +0 -1
- package/bin/chunk-ryfvaz6v.js +0 -3
- package/bin/chunk-s22eapcc.js +0 -2
- package/bin/chunk-sbg86tch.js +0 -2
- package/bin/chunk-sbqy6m8t.js +0 -1
- package/bin/chunk-sdp9w627.js +0 -14
- package/bin/chunk-sn0nypvd.js +0 -42
- package/bin/chunk-sv92vkyh.js +0 -2
- package/bin/chunk-t6cn018t.js +0 -3
- package/bin/chunk-ts4d1mxf.js +0 -2
- package/bin/chunk-wkdkc12e.js +0 -4
- package/bin/chunk-xgnvktq6.js +0 -10
- package/bin/chunk-xjw3mpvx.js +0 -1
- package/bin/chunk-xznq2axj.js +0 -1
- package/bin/chunk-y4v08wq7.js +0 -1
- package/bin/chunk-yncvy335.js +0 -3
- package/bin/chunk-ytzddcj2.js +0 -1
- package/bin/chunk-zxqasmvz.js +0 -2
package/bin/chunk-h58yfx7w.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ee,ms}from"./chunk-nfncawpm.js";function R(e,c){if(typeof e==="string"&&typeof c==="string")return e.toLowerCase()===c.toLowerCase();return e===c}function S(e,c){if(typeof e!=="string")return c.includes(e);return c.some((v)=>typeof v==="string"&&e.toLowerCase()===v.toLowerCase())}function W(e,c){return!S(e,c)}function T(e,c){if(typeof e!=="string"||typeof c!=="string")return!1;return e.toLowerCase().includes(c.toLowerCase())}function D(e,c){if(typeof e!=="string"||typeof c!=="string")return!1;return e.toLowerCase().startsWith(c.toLowerCase())}function k(e,c){if(typeof e!=="string"||typeof c!=="string")return!1;return e.toLowerCase().endsWith(c.toLowerCase())}var J=(e,c)=>{let v=null,E=ms({config:{adapterId:"memory",adapterName:"Memory Adapter",usePlural:!1,debugLogs:c?.debugLogs||!1,supportsArrays:!0,customTransformInput(h){if(h.options.advanced?.database?.generateId==="serial"&&h.field==="id"&&h.action==="create")return e[h.model].length+1;return h.data},transaction:async(h)=>{let L=structuredClone(e);try{return await h(E(v))}catch(M){throw Object.keys(e).forEach((C)=>{e[C]=L[C]}),M}}},adapter:({getFieldName:h,getDefaultFieldName:L,options:M,getModelName:C})=>{let I=(t,i,l)=>{if(!i)return t;return t.sort((o,f)=>{let y=h({model:l,field:i.field}),g=o[y],u=f[y],a=0;if(g==null&&u==null)a=0;else if(g==null)a=-1;else if(u==null)a=1;else if(typeof g==="string"&&typeof u==="string")a=g.localeCompare(u);else if(g instanceof Date&&u instanceof Date)a=g.getTime()-u.getTime();else if(typeof g==="number"&&typeof u==="number")a=g-u;else if(typeof g==="boolean"&&typeof u==="boolean")a=g===u?0:g?1:-1;else a=String(g).localeCompare(String(u));return i.direction==="asc"?a:-a})};function m(t,i,l,o){let f=(()=>{let u=e[i];if(!u)throw Ee.error(`[MemoryAdapter] Model ${i} not found in the DB`,Object.keys(e)),Error(`Model ${i} not found`);let a=(n,p)=>{let{field:s,value:r,operator:O,mode:A="sensitive"}=p,w=A==="insensitive"&&(typeof r==="string"||Array.isArray(r)&&r.every((j)=>typeof j==="string"));switch(O){case"in":if(!Array.isArray(r))throw Error("Value must be an array");if(w)return S(n[s],r);return r.includes(n[s]);case"not_in":if(!Array.isArray(r))throw Error("Value must be an array");if(w)return W(n[s],r);return!r.includes(n[s]);case"contains":if(w)return T(n[s],r);return n[s]?.includes(r);case"starts_with":if(w)return D(n[s],r);return n[s].startsWith(r);case"ends_with":if(w)return k(n[s],r);return n[s].endsWith(r);case"ne":return w?!R(n[s],r):n[s]!==r;case"gt":return r!=null&&Boolean(n[s]>r);case"gte":return r!=null&&Boolean(n[s]>=r);case"lt":return r!=null&&Boolean(n[s]<r);case"lte":return r!=null&&Boolean(n[s]<=r);default:if(w)return R(n[s],r);if(r===null)return n[s]==null;return n[s]===r}},d=u.filter((n)=>{if(!t.length||t.length===0)return!0;let p=a(n,t[0]);for(let s of t){let r=a(n,s);if(s.connector==="OR")p=p||r;else p=p&&r}return p});if(o?.length&&o.length>0)d=d.map((n)=>Object.fromEntries(Object.entries(n).filter(([p])=>o.includes(L({model:i,field:p})))));return d})();if(!l)return f;let y=new Map,g=new Map;for(let u of f){let a=String(u.id);if(!y.has(a)){let n={...u};for(let[p,s]of Object.entries(l)){let r=C(p);if(s.relation==="one-to-one")n[r]=null;else n[r]=[],g.set(`${a}-${p}`,new Set)}y.set(a,n)}let d=y.get(a);for(let[n,p]of Object.entries(l)){let s=C(n),r=e[s];if(!r)throw Ee.error(`[MemoryAdapter] JoinOption model ${s} not found in the DB`,Object.keys(e)),Error(`JoinOption model ${s} not found`);let O=r.filter((A)=>A[p.on.to]===u[p.on.from]);if(p.relation==="one-to-one")d[s]=O[0]||null;else{let A=g.get(`${a}-${n}`),w=p.limit??100,j=0;for(let b of O){if(j>=w)break;if(!A.has(b.id))d[s].push(b),A.add(b.id),j++}}}}return Array.from(y.values())}return{create:async({model:t,data:i})=>{if(M.advanced?.database?.generateId==="serial")i.id=e[C(t)].length+1;if(!e[t])e[t]=[];return e[t].push(i),i},findOne:async({model:t,where:i,select:l,join:o})=>{let f=m(i,t,o,l);if(o){let y=f;if(!y.length)return null;return y[0]}return f[0]||null},findMany:async({model:t,where:i,sortBy:l,limit:o,select:f,offset:y,join:g})=>{let u=m(i||[],t,g,f);if(g){let d=u;if(!d.length)return[];I(d,l,t);let n=d;if(y!==void 0)n=n.slice(y);if(o!==void 0)n=n.slice(0,o);return n}let a=I(u,l,t);if(y!==void 0)a=a.slice(y);if(o!==void 0)a=a.slice(0,o);return a||[]},count:async({model:t,where:i})=>{if(i)return m(i,t).length;return e[t].length},update:async({model:t,where:i,update:l})=>{let o=m(i,t);return o.forEach((f)=>{Object.assign(f,l)}),o[0]||null},delete:async({model:t,where:i})=>{let l=e[t],o=m(i,t);e[t]=l.filter((f)=>!o.includes(f))},deleteMany:async({model:t,where:i})=>{let l=e[t],o=m(i,t),f=0;return e[t]=l.filter((y)=>{if(o.includes(y))return f++,!1;return!o.includes(y)}),f},consumeOne:async({model:t,where:i})=>{let l=e[t],o=m(i,t)[0];if(!o)return null;return e[t]=l.filter((f)=>f!==o),o},updateMany({model:t,where:i,update:l}){let o=m(i,t);return o.forEach((f)=>{Object.assign(f,l)}),o[0]||null}}}});return(h)=>(v=h,E(h))};export{J as memoryAdapter};
|
package/bin/chunk-h9ngpxyd.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{m,E,t,Z,B,ze,g,ig,gt,xm,r0}from"./chunk-p1d500sf.js";import"./chunk-7rycq6wb.js";import"./chunk-sdp9w627.js";import"./chunk-c8kjpmfe.js";import"./chunk-qt78vs3g.js";import"./chunk-cxet91kt.js";import"./chunk-xgnvktq6.js";import"./chunk-keetdtxb.js";import"./chunk-j9t7tvt5.js";import"./chunk-sbg86tch.js";import"./chunk-k7sjpke6.js";import"./chunk-fkn6f4qt.js";import"./chunk-6vkfzzvt.js";import"./chunk-5aqthcm6.js";import{Yn}from"./chunk-h3cwf9aw.js";import{tr}from"./chunk-qd7pvaxb.js";import"./chunk-ahgq10a7.js";import"./chunk-1vt9ss7d.js";import"./chunk-agcnbjxk.js";import"./chunk-zxqasmvz.js";import"./chunk-ts4d1mxf.js";import"./chunk-xsfy8hz3.js";import"./chunk-1eqw2dpx.js";import"./chunk-b7qs7hxg.js";import"./chunk-ht5rht98.js";E();function I(){let{projectId:e,collectionId:c}=y.useParams(),{teamId:i,ensureTeamIdForProject:l}=gt();m(()=>{l(e)},[e,l]);let{data:a}=tr(xm(e)),{data:n,refetch:d}=Z({...r0(c)}),{mutate:p}=B({mutationFn:async(r)=>{let s=await g.api.collections[":collectionId"].$patch({param:{collectionId:c},json:r});if(!s.ok)throw Error("Failed to update collection");return await s.json()},onSuccess:()=>{d()}}),o=a?.rootFolder,{data:u}=Z({queryKey:["folders",o],queryFn:async()=>{let r=await g.api.folders[":folderId"].$get({param:{folderId:o}});if(!r.ok)throw Error("Failed to fetch folder");return await r.json()},enabled:!!o});if(!i||!o||!u||!n)return t("div",{children:ig()});let f=n.filter.sourceFolderId||o;return t(Yn,{teamId:i,projectId:e,projectName:a.name??"",assetId:f,rootFolderId:o,collection:n,onUpdateCollection:p})}var y=ze("/projects/$projectId/collections/$collectionId")({component:I});export{y as Route};
|
package/bin/chunk-hbr17jvr.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{w,V}from"./chunk-t6cn018t.js";var Y=w(function(wt,X){var E=1000,I=E*60,M=I*60,P=M*24,Oe=P*7,Se=P*365.25;X.exports=function(e,r){r=r||{};var t=typeof e;if(t==="string"&&e.length>0)return Pe(e);else if(t==="number"&&isFinite(e))return r.long?Ae(e):je(e);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Pe(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*Se;case"weeks":case"week":case"w":return t*Oe;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*I;case"seconds":case"second":case"secs":case"sec":case"s":return t*E;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}function je(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>=I)return Math.round(e/I)+"m";if(r>=E)return Math.round(e/E)+"s";return e+"ms"}function Ae(e){var r=Math.abs(e);if(r>=P)return L(e,r,P,"day");if(r>=M)return L(e,r,M,"hour");if(r>=I)return L(e,r,I,"minute");if(r>=E)return L(e,r,E,"second");return e+" ms"}function L(e,r,t,n){var s=r>=t*1.5;return Math.round(e/t)+" "+n+(s?"s":"")}});var z=w(function(Ft,ee){function Ee(e){t.debug=t,t.default=t,t.coerce=_,t.disable=l,t.enable=s,t.enabled=v,t.humanize=Y(),t.destroy=q,Object.keys(e).forEach((o)=>{t[o]=e[o]}),t.names=[],t.skips=[],t.formatters={};function r(o){let i=0;for(let c=0;c<o.length;c++)i=(i<<5)-i+o.charCodeAt(c),i|=0;return t.colors[Math.abs(i)%t.colors.length]}t.selectColor=r;function t(o){let i,c=null,a,y;function f(...d){if(!f.enabled)return;let m=f,g=Number(new Date),O=g-(i||g);if(m.diff=O,m.prev=i,m.curr=g,i=g,d[0]=t.coerce(d[0]),typeof d[0]!=="string")d.unshift("%O");let F=0;d[0]=d[0].replace(/%([a-zA-Z%])/g,(S,A)=>{if(S==="%%")return"%";F++;let Q=t.formatters[A];if(typeof Q==="function"){let xe=d[F];S=Q.call(m,xe),d.splice(F,1),F--}return S}),t.formatArgs.call(m,d),(m.log||t.log).apply(m,d)}if(f.namespace=o,f.useColors=t.useColors(),f.color=t.selectColor(o),f.extend=n,f.destroy=t.destroy,Object.defineProperty(f,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(c!==null)return c;if(a!==t.namespaces)a=t.namespaces,y=t.enabled(o);return y},set:(d)=>{c=d}}),typeof t.init==="function")t.init(f);return f}function n(o,i){let c=t(this.namespace+(typeof i>"u"?":":i)+o);return c.log=this.log,c}function s(o){t.save(o),t.namespaces=o,t.names=[],t.skips=[];let i=(typeof o==="string"?o:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let c of i)if(c[0]==="-")t.skips.push(c.slice(1));else t.names.push(c)}function u(o,i){let c=0,a=0,y=-1,f=0;while(c<o.length)if(a<i.length&&(i[a]===o[c]||i[a]==="*"))if(i[a]==="*")y=a,f=c,a++;else c++,a++;else if(y!==-1)a=y+1,f++,c=f;else return!1;while(a<i.length&&i[a]==="*")a++;return a===i.length}function l(){let o=[...t.names,...t.skips.map((i)=>"-"+i)].join(",");return t.enable(""),o}function v(o){for(let i of t.skips)if(u(o,i))return!1;for(let i of t.names)if(u(o,i))return!0;return!1}function _(o){if(o instanceof Error)return o.stack||o.message;return o}function q(){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}ee.exports=Ee});var te=w(function(G,T){G.formatArgs=Me;G.save=Ne;G.load=qe;G.useColors=Ie;G.storage=Be();G.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`.")}})();G.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 Ie(){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 Me(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+T.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,(s)=>{if(s==="%%")return;if(t++,s==="%c")n=t}),e.splice(n,0,r)}G.log=console.debug||console.log||(()=>{});function Ne(e){try{if(e)G.storage.setItem("debug",e);else G.storage.removeItem("debug")}catch(r){}}function qe(){let e;try{e=G.storage.getItem("debug")||G.storage.getItem("DEBUG")}catch(r){}if(!e&&typeof process<"u"&&"env"in process)e=process.env.DEBUG;return e}function Be(){try{return localStorage}catch(e){}}T.exports=z()(G);var{formatters:De}=T.exports;De.j=function(e){try{return JSON.stringify(e)}catch(r){return"[UnexpectedJSONParseError]: "+r.message}}});var oe=w(function(J,H){var re=V("tty"),x=V("util");J.init=Qe;J.log=We;J.formatArgs=Ge;J.save=Ze;J.load=Ke;J.useColors=ze;J.destroy=x.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");J.colors=[6,2,3,4,5,1];try{let e=(()=>{throw new Error("Cannot require module "+"supports-color");})();if(e&&(e.stderr||e).level>=2)J.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){}J.inspectOpts=Object.keys(process.env).filter((e)=>/^debug_/i.test(e)).reduce((e,r)=>{let t=r.substring(6).toLowerCase().replace(/_([a-z])/g,(s,u)=>u.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 ze(){return"colors"in J.inspectOpts?Boolean(J.inspectOpts.colors):re.isatty(process.stderr.fd)}function Ge(e){let{namespace:r,useColors:t}=this;if(t){let n=this.color,s="\x1B[3"+(n<8?n:"8;5;"+n),u=` ${s};1m${r} \x1B[0m`;e[0]=u+e[0].split(`
|
|
3
|
-
`).join(`
|
|
4
|
-
`+u),e.push(s+"m+"+H.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=Je()+r+" "+e[0]}function Je(){if(J.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function We(...e){return process.stderr.write(x.formatWithOptions(J.inspectOpts,...e)+`
|
|
5
|
-
`)}function Ze(e){if(e)process.env.DEBUG=e;else delete process.env.DEBUG}function Ke(){return process.env.DEBUG}function Qe(e){e.inspectOpts={};let r=Object.keys(J.inspectOpts);for(let t=0;t<r.length;t++)e.inspectOpts[r[t]]=J.inspectOpts[r[t]]}H.exports=z()(J);var{formatters:ne}=H.exports;ne.o=function(e){return this.inspectOpts.colors=this.useColors,x.inspect(e,this.inspectOpts).split(`
|
|
6
|
-
`).map((r)=>r.trim()).join(" ")};ne.O=function(e){return this.inspectOpts.colors=this.useColors,x.inspect(e,this.inspectOpts)}});var Z=w(function(St,W){if(typeof process>"u"||process.type==="renderer"||!1||process.__nwjs)W.exports=te();else W.exports=oe()});var ue=w(function(p){var st=p&&p.__createBinding||(Object.create?function(e,r,t,n){if(n===void 0)n=t;var s=Object.getOwnPropertyDescriptor(r,t);if(!s||("get"in s?!r.__esModule:s.writable||s.configurable))s={enumerable:!0,get:function(){return r[t]}};Object.defineProperty(e,n,s)}:function(e,r,t,n){if(n===void 0)n=t;e[n]=r[t]}),ot=p&&p.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),ie=p&&p.__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))st(r,e,t)}return ot(r,e),r};Object.defineProperty(p,"__esModule",{value:!0});p.req=p.json=p.toBuffer=void 0;var it=ie(V("http")),ct=ie(V("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)}p.toBuffer=ce;async function ut(e){let t=(await ce(e)).toString("utf8");try{return JSON.parse(t)}catch(n){let s=n;throw s.message+=` (input: ${t})`,s}}p.json=ut;function at(e,r={}){let n=((typeof e==="string"?e:e.href).startsWith("https:")?ct:it).request(e,r),s=new Promise((u,l)=>{n.once("response",u).once("error",l).end()});return n.then=s.then.bind(s),n}p.req=at});var he=w(function(h){var fe=h&&h.__createBinding||(Object.create?function(e,r,t,n){if(n===void 0)n=t;var s=Object.getOwnPropertyDescriptor(r,t);if(!s||("get"in s?!r.__esModule:s.writable||s.configurable))s={enumerable:!0,get:function(){return r[t]}};Object.defineProperty(e,n,s)}:function(e,r,t,n){if(n===void 0)n=t;e[n]=r[t]}),ft=h&&h.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),le=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))fe(r,e,t)}return ft(r,e),r},lt=h&&h.__exportStar||function(e,r){for(var t in e)if(t!=="default"&&!Object.prototype.hasOwnProperty.call(r,t))fe(r,e,t)};Object.defineProperty(h,"__esModule",{value:!0});h.Agent=void 0;var dt=le(V("net")),ae=le(V("http")),de=V("https");lt(ue(),h);var b=Symbol("AgentBaseInternalState");class pe extends ae.Agent{constructor(e){super(e);this[b]={}}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 dt.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 de.Agent.prototype.getName.call(this,e);return super.getName(e)}createSocket(e,r,t){let n={...r,secureEndpoint:this.isSecureEndpoint(r)},s=this.getName(n),u=this.incrementSockets(s);Promise.resolve().then(()=>this.connect(e,n)).then((l)=>{if(this.decrementSockets(s,u),l instanceof ae.Agent)try{return l.addRequest(e,n)}catch(v){return t(v)}this[b].currentSocket=l,super.createSocket(e,r,t)},(l)=>{this.decrementSockets(s,u),t(l)})}createConnection(){let e=this[b].currentSocket;if(this[b].currentSocket=void 0,!e)throw Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[b].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){if(this[b])this[b].defaultPort=e}get protocol(){return this[b].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){if(this[b])this[b].protocol=e}}h.Agent=pe});var Ce=w(function(N){var pt=N&&N.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(N,"__esModule",{value:!0});N.parseProxyResponse=void 0;var ht=pt(Z()),R=(0,ht.default)("https-proxy-agent:parse-proxy-response");function Ct(e){return new Promise((r,t)=>{let n=0,s=[];function u(){let o=e.read();if(o)q(o);else e.once("readable",u)}function l(){e.removeListener("end",v),e.removeListener("error",_),e.removeListener("readable",u)}function v(){l(),R("onend"),t(Error("Proxy connection ended before receiving CONNECT response"))}function _(o){l(),R("onerror %o",o),t(o)}function q(o){s.push(o),n+=o.length;let i=Buffer.concat(s,n),c=i.indexOf(`\r
|
|
8
|
-
\r
|
|
9
|
-
`);if(c===-1){R("have not received end of HTTP headers yet..."),u();return}let a=i.slice(0,c).toString("ascii").split(`\r
|
|
10
|
-
`),y=a.shift();if(!y)return e.destroy(),t(Error("No header received from proxy CONNECT response"));let f=y.split(" "),d=+f[1],m=f.slice(2).join(" "),g={};for(let O of a){if(!O)continue;let F=O.indexOf(":");if(F===-1)return e.destroy(),t(Error(`Invalid header from proxy CONNECT response: "${O}"`));let k=O.slice(0,F).toLowerCase(),S=O.slice(F+1).trimStart(),A=g[k];if(typeof A==="string")g[k]=[A,S];else if(Array.isArray(A))A.push(S);else g[k]=S}R("got proxy server response: %o %o",y,g),l(),r({connect:{statusCode:d,statusText:m,headers:g},buffered:i})}e.on("error",_),e.on("end",v),u()})}N.parseProxyResponse=Ct});var _t=w(function(C){var yt=C&&C.__createBinding||(Object.create?function(e,r,t,n){if(n===void 0)n=t;var s=Object.getOwnPropertyDescriptor(r,t);if(!s||("get"in s?!r.__esModule:s.writable||s.configurable))s={enumerable:!0,get:function(){return r[t]}};Object.defineProperty(e,n,s)}:function(e,r,t,n){if(n===void 0)n=t;e[n]=r[t]}),gt=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))yt(r,e,t)}return gt(r,e),r},ve=C&&C.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(C,"__esModule",{value:!0});C.HttpsProxyAgent=void 0;var U=me(V("net")),ye=me(V("tls")),bt=ve(V("assert")),mt=ve(Z()),_e=he(),we=V("url"),Fe=Ce(),D=(0,mt.default)("https-proxy-agent"),ge=(e)=>{if(e.servername===void 0&&e.host&&!U.isIP(e.host))return{...e,servername:e.host};return e};class K extends _e.Agent{constructor(e,r){super(r);this.options={path:void 0},this.proxy=typeof e==="string"?new we.URL(e):e,this.proxyHeaders=r?.headers??{},D("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?be(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:")D("Creating `tls.Socket`: %o",this.connectOpts),n=ye.connect(ge(this.connectOpts));else D("Creating `net.Socket`: %o",this.connectOpts),n=U.connect(this.connectOpts);let s=typeof this.proxyHeaders==="function"?this.proxyHeaders():{...this.proxyHeaders},u=U.isIPv6(r.host)?`[${r.host}]`:r.host,l=`CONNECT ${u}:${r.port} HTTP/1.1\r
|
|
11
|
-
`;if(t.username||t.password){let i=`${decodeURIComponent(t.username)}:${decodeURIComponent(t.password)}`;s["Proxy-Authorization"]=`Basic ${Buffer.from(i).toString("base64")}`}if(s.Host=`${u}:${r.port}`,!s["Proxy-Connection"])s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close";for(let i of Object.keys(s))l+=`${i}: ${s[i]}\r
|
|
12
|
-
`;let v=Fe.parseProxyResponse(n);n.write(`${l}\r
|
|
13
|
-
`);let{connect:_,buffered:q}=await v;if(e.emit("proxyConnect",_),this.emit("proxyConnect",_,e),_.statusCode===200){if(e.once("socket",vt),r.secureEndpoint)return D("Upgrading socket connection to TLS"),ye.connect({...be(ge(r),"host","path","port"),socket:n});return n}n.destroy();let o=new U.Socket({writable:!1});return o.readable=!0,e.once("socket",(i)=>{D("Replaying proxy buffer for failed request"),(0,bt.default)(i.listenerCount("data")>0),i.push(q),i.push(null)}),o}}K.protocols=["http","https"];C.HttpsProxyAgent=K;function vt(e){e.resume()}function be(e,...r){let t={},n;for(n in e)if(!r.includes(n))t[n]=e[n];return t}});export default _t();
|
package/bin/chunk-hc0xbmtt.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{er,Ht}from"./chunk-6mrgtn78.js";import{w,V}from"./chunk-t6cn018t.js";var Ko=w(function(he){var{hasOwn:K}=er(),{streamCollector:te}=er();he.streamCollector=te;var{buildQueryString:Q,HttpResponse:J}=Ht(),E=V("https"),{Readable:oe}=V("stream"),D=V("http2");function L(e){let t=e&&typeof e==="object"&&"reason"in e?e.reason:void 0;if(t){if(t instanceof Error){let s=Error("Request aborted");return s.name="AbortError",s.cause=t,s}let n=Error(String(t));return n.name="AbortError",n}let o=Error("Request aborted");return o.name="AbortError",o}var ne=["ECONNRESET","EPIPE","ETIMEDOUT"],G=(e)=>{let t={};for(let o in e){if(!K(e,o))continue;let n=e[o];t[o]=Array.isArray(n)?n.join(","):n}return t},h={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:(e)=>clearTimeout(e)},F=1000,se=(e,t,o=0)=>{if(!o)return-1;let n=(s)=>{let i=h.setTimeout(()=>{e.destroy(),t(Object.assign(Error(`@smithy/node-http-handler - the request socket did not establish a connection with the server within the configured timeout of ${o} ms.`),{name:"TimeoutError"}))},o-s),c=(a)=>{if(a?.connecting)a.on("connect",()=>{h.clearTimeout(i)});else h.clearTimeout(i)};if(e.socket)c(e.socket);else e.on("socket",c)};if(o<2000)return n(0),0;return h.setTimeout(n.bind(null,F),F)},re=(e,t,o=0,n,s)=>{if(o)return h.setTimeout(()=>{let i=`@smithy/node-http-handler - [${n?"ERROR":"WARN"}] a request has exceeded the configured ${o} ms requestTimeout.`;if(n){let c=Object.assign(Error(i),{name:"TimeoutError",code:"ETIMEDOUT"});e.destroy(c),t(c)}else i+=" Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.",s?.warn?.(i)},o);return-1},ie=3000,ce=(e,{keepAlive:t,keepAliveMsecs:o},n=ie)=>{if(t!==!0)return-1;let s=()=>{if(e.socket)e.socket.setKeepAlive(t,o||0);else e.on("socket",(i)=>{i.setKeepAlive(t,o||0)})};if(n===0)return s(),0;return h.setTimeout(s,n)},j=3000,ae=(e,t,o=0)=>{let n=(s)=>{let i=o-s,c=()=>{e.destroy(),t(Object.assign(Error(`@smithy/node-http-handler - the request socket timed out after ${o} ms of inactivity (configured by client requestHandler).`),{name:"TimeoutError"}))};if(e.socket)e.socket.setTimeout(i,c),e.on("close",()=>e.socket?.removeListener("timeout",c));else e.setTimeout(i,c)};if(0<o&&o<6000)return n(0),0;return h.setTimeout(n.bind(null,o===0?0:j),j)},B=6000;async function X(e,t,o=B,n=!1){let s=t.headers,i=s?s.Expect||s.expect:void 0,c=-1,a=!0;if(!n&&i==="100-continue")a=await Promise.race([new Promise((u)=>{c=Number(h.setTimeout(()=>u(!0),Math.max(B,o)))}),new Promise((u)=>{e.on("continue",()=>{h.clearTimeout(c),u(!0)}),e.on("response",()=>{h.clearTimeout(c),u(!1)}),e.on("error",()=>{h.clearTimeout(c),u(!1)})})]);if(a)ue(e,t.body)}function ue(e,t){if(t instanceof oe){t.pipe(e);return}if(t){let o=Buffer.isBuffer(t);if(o||typeof t==="string"){if(o&&t.byteLength===0)e.end();else e.end(t);return}let s=t;if(typeof s==="object"&&s.buffer&&typeof s.byteOffset==="number"&&typeof s.byteLength==="number"){e.end(Buffer.from(s.buffer,s.byteOffset,s.byteLength));return}e.end(Buffer.from(t));return}e.end()}var fe=0,I=void 0,W=void 0;class M{config;configProvider;socketWarningTimestamp=0;externalAgent=!1;metadata={handlerProtocol:"http/1.1"};static create(e){if(typeof e?.handle==="function")return e;return new M(e)}static checkSocketUsage(e,t,o=console){let{sockets:n,requests:s,maxSockets:i}=e;if(typeof i!=="number"||i===1/0)return t;let c=15000;if(Date.now()-c<t)return t;if(n&&s)for(let a in n){if(!K(n,a))continue;let u=n[a]?.length??0,l=s[a]?.length??0;if(u>=i&&l>=2*i)return o?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${u} and ${l} additional requests are enqueued.
|
|
3
|
-
See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
|
|
4
|
-
or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return t}constructor(e){this.configProvider=new Promise((t,o)=>{if(typeof e==="function")e().then((n)=>{t(this.resolveDefaultConfig(n))}).catch(o);else t(this.resolveDefaultConfig(e))})}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(e,{abortSignal:t,requestTimeout:o}={}){if(!this.config)this.config=await this.configProvider;let n=this.config,s=n.logger,i=e.protocol==="https:";if(!i&&!this.config.httpAgent)this.config.httpAgent=await this.config.httpAgentProvider();return new Promise((c,a)=>{let u=void 0,l=-1,m=-1,T=-1,x=-1,A=-1,S=()=>{h.clearTimeout(l),h.clearTimeout(m),h.clearTimeout(T),h.clearTimeout(x),h.clearTimeout(A)},N=async(r)=>{await u,S(),c(r)},p=async(r)=>{await u,S(),a(r)};if(t?.aborted){let r=L(t);p(r);return}let R=e.headers,O=R?(R.Expect??R.expect)==="100-continue":!1,v=i?n.httpsAgent:n.httpAgent;if(O&&!this.externalAgent)v=new(i?E.Agent:I)({keepAlive:!1,maxSockets:1/0});l=h.setTimeout(()=>{this.socketWarningTimestamp=M.checkSocketUsage(v,this.socketWarningTimestamp,s)},n.socketAcquisitionWarningTimeout??(n.requestTimeout??2000)+(n.connectionTimeout??1000));let H=e.query?Q(e.query):"",P=void 0;if(e.username!=null||e.password!=null){let r=e.username??"",f=e.password??"";P=`${r}:${f}`}let b=e.path;if(H)b+=`?${H}`;if(e.fragment)b+=`#${e.fragment}`;let y=e.hostname??"";if(y[0]==="["&&y.endsWith("]"))y=e.hostname.slice(1,-1);else y=e.hostname;let _={headers:e.headers,host:y,method:e.method,path:b,port:e.port,agent:v,auth:P},g=(i?E.request:W)(_,(r)=>{let f=new J({statusCode:r.statusCode||-1,reason:r.statusMessage,headers:G(r.headers),body:r});N({response:f})});if(g.on("error",(r)=>{if(ne.includes(r.code))p(Object.assign(r,{name:"TimeoutError"}));else p(r)}),t){let r=()=>{g.destroy();let f=L(t);p(f)};if(typeof t.addEventListener==="function"){let f=t;f.addEventListener("abort",r,{once:!0}),g.once("close",()=>f.removeEventListener("abort",r))}else t.onabort=r}let k=o??n.requestTimeout;m=se(g,p,n.connectionTimeout),T=re(g,p,k,n.throwOnRequestTimeout,s??console),x=ae(g,p,n.socketTimeout);let d=_.agent;if(typeof d==="object"&&"keepAlive"in d)A=ce(g,{keepAlive:d.keepAlive,keepAliveMsecs:d.keepAliveMsecs});u=X(g,e,k,this.externalAgent).catch((r)=>(S(),a(r)))})}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then((o)=>{if(e===Symbol.for("logger"))return{...o,logger:o.logger??t};return{...o,[e]:t}})}httpHandlerConfigs(){return this.config??{}}resolveDefaultConfig(e){let{requestTimeout:t,connectionTimeout:o,socketTimeout:n,socketAcquisitionWarningTimeout:s,httpAgent:i,httpsAgent:c,throwOnRequestTimeout:a,logger:u}=e||{},l=!0,m=50;return{connectionTimeout:o,requestTimeout:t,socketTimeout:n,socketAcquisitionWarningTimeout:s,throwOnRequestTimeout:a,httpAgentProvider:async()=>{let T=V("http"),{Agent:x,request:A}=T.default??T;if(W=A,I=x,i instanceof I||typeof i?.destroy==="function")return this.externalAgent=!0,i;return new I({keepAlive:!0,maxSockets:50,...i})},httpsAgent:(()=>{if(c instanceof E.Agent||typeof c?.destroy==="function")return this.externalAgent=!0,c;return new E.Agent({keepAlive:!0,maxSockets:50,...c})})(),logger:u}}}var de=new Uint16Array(1);class U{id=de[0]++;total=0;max=0;session;refs=0;constructor(e){e.unref(),this.session=e}retain(){if(this.session.destroyed)throw Error("@smithy/node-http-handler - cannot acquire reference to destroyed session.");this.refs+=1,this.total+=1,this.max=Math.max(this.refs,this.max),this.session.ref()}free(){if(this.session.destroyed)return;if(this.refs-=1,this.refs===0)this.session.unref();if(this.refs<0)throw Error("@smithy/node-http-handler - ClientHttp2Session refcount at zero, cannot decrement.")}deref(){return this.session}close(){if(!this.session.closed)this.session.close()}destroy(){if(this.refs=0,!this.session.destroyed)this.session.destroy()}useCount(){return this.refs}}class Y{sessions=[];maxConcurrency=0;constructor(e){this.sessions=(e??[]).map((t)=>new U(t))}poll(){let e=!1;for(let t of this.sessions){if(t.deref().destroyed){e=!0;continue}if(!this.maxConcurrency||t.useCount()<this.maxConcurrency)return t}if(e){for(let t of this.sessions)if(t.deref().destroyed)this.remove(t)}}offerLast(e){this.sessions.push(e)}remove(e){let t=this.sessions.indexOf(e);if(t>-1)this.sessions.splice(t,1)}[Symbol.iterator](){return this.sessions[Symbol.iterator]()}setMaxConcurrency(e){this.maxConcurrency=e}destroy(e){this.remove(e),e.destroy()}}class Z{config;connectOptions;connectionPools=new Map;constructor(e){if(this.config=e,this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw RangeError("maxConcurrency must be greater than zero.")}lease(e,t){let o=this.getUrlString(e),n=this.getPool(o);if(!this.config.disableConcurrency&&!t.isEventStream){let u=n.poll();if(u)return u.retain(),u}let s=new U(this.connect(o)),i=s.deref();if(this.config.maxConcurrency)i.settings({maxConcurrentStreams:this.config.maxConcurrency},(u)=>{if(u)throw Error("Fail to set maxConcurrentStreams to "+this.config.maxConcurrency+"when creating new session for "+e.destination.toString())});let c=()=>{this.removeFromPoolAndClose(o,s)},a=()=>{this.removeFromPoolAndCheckedDestroy(o,s)};if(i.on("goaway",c),i.on("error",a),i.on("frameError",a),i.on("close",a),t.requestTimeout)i.setTimeout(t.requestTimeout,a);return n.offerLast(s),s.retain(),s}release(e,t){t.free()}createIsolatedSession(e,t){let o=this.getUrlString(e),n=new U(this.connect(o)),s=n.deref();s.settings({maxConcurrentStreams:1});let i=()=>{n.destroy()};if(s.on("error",i),s.on("frameError",i),s.on("close",i),t.requestTimeout)s.setTimeout(t.requestTimeout,i);return n.retain(),n}destroy(){for(let[e,t]of this.connectionPools){for(let o of[...t])o.destroy();this.connectionPools.delete(e)}}setMaxConcurrentStreams(e){if(e&&e<=0)throw RangeError("maxConcurrentStreams must be greater than zero.");this.config.maxConcurrency=e;for(let t of this.connectionPools.values())t.setMaxConcurrency(e)}setDisableConcurrentStreams(e){this.config.disableConcurrency=e}setNodeHttp2ConnectOptions(e){this.connectOptions=e}debug(){let e={};for(let[t,o]of this.connectionPools){let n=[];for(let s of o)n.push({id:s.id,active:s.useCount(),maxConcurrent:s.max,totalRequests:s.total});e[t]={sessions:n}}return e}removeFromPoolAndClose(e,t){this.connectionPools.get(e)?.remove(t),t.close()}removeFromPoolAndCheckedDestroy(e,t){this.connectionPools.get(e)?.remove(t),t.destroy()}getPool(e){if(!this.connectionPools.has(e)){let t=new Y;if(this.config.maxConcurrency)t.setMaxConcurrency(this.config.maxConcurrency);this.connectionPools.set(e,t)}return this.connectionPools.get(e)}getUrlString(e){return e.destination.toString()}connect(e){return this.connectOptions===void 0?D.connect(e):D.connect(e,this.connectOptions)}}var{constants:z}=D;class q{config;configProvider;metadata={handlerProtocol:"h2"};connectionManager=new Z({});static create(e){if(typeof e?.handle==="function")return e;return new q(e)}constructor(e){this.configProvider=new Promise((t,o)=>{if(typeof e==="function")e().then((n)=>{t(n||{})}).catch(o);else t(e||{})})}destroy(){this.connectionManager.destroy()}async handle(e,{abortSignal:t,requestTimeout:o,isEventStream:n}={}){if(!this.config){this.config=await this.configProvider;let{disableConcurrentStreams:u,maxConcurrentStreams:l,nodeHttp2ConnectOptions:m}=this.config;if(this.connectionManager.setDisableConcurrentStreams(u??!1),l)this.connectionManager.setMaxConcurrentStreams(l);if(m)this.connectionManager.setNodeHttp2ConnectOptions(m)}let{requestTimeout:s,disableConcurrentStreams:i}=this.config,c=i||n,a=o??s;return new Promise((u,l)=>{let m=!1,T=void 0,x=async(r)=>{await T,u(r)},A=async(r)=>{await T,l(r)};if(t?.aborted){m=!0;let r=L(t);A(r);return}let{hostname:S,method:N,port:p,protocol:R,query:O}=e,v="";if(e.username!=null||e.password!=null){let r=e.username??"",f=e.password??"";v=`${r}:${f}@`}let H=`${R}//${v}${S}${p?`:${p}`:""}`,P={destination:new URL(H)},b={requestTimeout:this.config?.sessionTimeout,isEventStream:n},y=c?this.connectionManager.createIsolatedSession(P,b):this.connectionManager.lease(P,b),_=y.deref(),C=(r)=>{if(c)y.destroy();m=!0,A(r)},g=O?Q(O):"",k=e.path;if(g)k+=`?${g}`;if(e.fragment)k+=`#${e.fragment}`;let d=_.request({...e.headers,[z.HTTP2_HEADER_PATH]:k,[z.HTTP2_HEADER_METHOD]:N});if(a)d.setTimeout(a,()=>{d.close();let r=Error(`Stream timed out because of no activity for ${a} ms`);r.name="TimeoutError",C(r)});if(t){let r=()=>{d.close();let f=L(t);C(f)};if(typeof t.addEventListener==="function"){let f=t;f.addEventListener("abort",r,{once:!0}),d.once("close",()=>f.removeEventListener("abort",r))}else t.onabort=r}d.on("frameError",(r,f,ee)=>{C(Error(`Frame type id ${r} in stream id ${ee} has failed with code ${f}.`))}),d.on("error",C),d.on("aborted",()=>{C(Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${d.rstCode}.`))}),d.on("response",(r)=>{let f=new J({statusCode:r[":status"]??-1,headers:G(r),body:d});if(m=!0,x({response:f}),c)_.close()}),d.on("close",()=>{if(c)y.destroy();else this.connectionManager.release(P,y);if(!m)C(Error("Unexpected error: http2 request did not get a response"))}),T=X(d,e,a)})}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then((o)=>({...o,[e]:t}))}httpHandlerConfigs(){return this.config??{}}}he.DEFAULT_REQUEST_TIMEOUT=fe;he.NodeHttp2Handler=q;he.NodeHttpHandler=M});
|
|
5
|
-
export{Ko};
|
package/bin/chunk-j9t7tvt5.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{u,E,G,B,g,oa,Jd,M,dr}from"./chunk-p1d500sf.js";var z={x:0.5,y:0.5};class da extends Jd{apply({activatorEvent:m,shape:h,transform:I}){if(!h||!(m instanceof PointerEvent))return I;let F=this.options?.anchor??z,{boundingRectangle:p}=h.initial,A=p.left+p.width*F.x,l=p.top+p.height*F.y;return{x:I.x+m.clientX-A,y:I.y+m.clientY-l}}static configure=oa(da)}E();function Kl({teamId:m,projectId:h,assetId:I,folders:F,files:p,selectedIds:A,onClearSelection:l}){let D=G(),[d,S]=u(void 0),q=(n,r)=>{let s=["search",m,I,n?"folder":"file"],i=D.getQueriesData({queryKey:s}),o=(t)=>{if(typeof t!=="object"||t===null)return!1;let e=t;return"field"in e&&"order"in e&&typeof e.field==="string"&&(e.order==="asc"||e.order==="desc")};for(let[t,e]of i){if(!e||!Array.isArray(e.pages))continue;let f=t.find(o),a=e.pages.flatMap((c)=>c.data??[]),x=a.findIndex((c)=>c.id===r.id);if(x===-1)continue;if(a[x]={...a[x],...r},f?.field==="custom"){let c=f.order==="desc";a.sort((w,b)=>{let k=w.sortIndex??"",R=b.sortIndex??"";if(k===R)return 0;if(c)return k<R?1:-1;else return k<R?-1:1})}let T=0,U=e.pages.map((c)=>{let w=c.data?c.data.length:0,b=a.slice(T,T+w);return T+=w,{...c,data:b}});D.setQueryData(t,{...e,pages:U})}},j=g.api.projects[":projectId"].reparent.$post,{mutate:v}=B({mutationFn:async(n)=>{if(!(await j(n)).ok)throw Error("Failed to move assets");return null}}),P=g.api.folders[":folderId"].order.$patch,{mutate:C}=B({mutationFn:async(n)=>{let r=await P(n);if(!r.ok)throw Error("Failed to reorder folder");return await r.json()}}),K=g.api.files[":fileId"].order.$patch,{mutate:Q}=B({mutationFn:async(n)=>{let r=await K(n);if(!r.ok)throw Error("Failed to reorder file");return await r.json()}}),L=g.api.shares[":shareId"].assets.$post,{mutate:O}=B({mutationFn:async(n)=>{let r=await L(n);if(!r.ok)throw Error("Failed to add asset to share");return await r.json()}});return{dragState:d,handleDragStart:(n)=>{let r=n.operation.source;if(!r)return;let y=r.id.split(":").pop(),s=r.data;if(!s)return;let i,o;if(A.has(y))i=new Set(A),o=[...F,...p].filter((f)=>A.has(f.id));else i=new Set([y]),o=[s.item];let t=o.some((f)=>f.type==="folder"),e=i.size===1&&o.length===1&&o[0].type==="file";S({isActive:!0,draggedIds:i,hasFolders:t,isSingleFile:e,itemCount:i.size})},handleDragEnd:(n)=>{let{target:r}=n.operation;if(r&&d){let y=r.id.split(":").pop(),s=r.data;if(s?.type==="chatbot-sidebar"){let t=[...F,...p].filter((e)=>d.draggedIds.has(e.id)).map((e)=>({id:e.id,name:e.name||"Unnamed",type:e.type}));dr.getState().addAssets(t),l(),S(void 0);return}if(s?.type==="share-link"){let o=y,t=Array.from(d.draggedIds);O({param:{shareId:o},json:{assetIds:t}},{onSuccess:(e)=>{if(e.addedCount===0)M.info("Assets already exists in share");else M.success(`Added ${e.addedCount} item(s) to share link`);D.invalidateQueries({queryKey:["shares",h]}),l()},onError:(e)=>{M.error(`Failed to add to share: ${e.message}`)}}),S(void 0);return}let i=!1;if(s&&!d.draggedIds.has(y)){if(s.type==="folder"||s.type==="reorder")i=!0;else if(s.type==="file"||s.type==="version_stack"){if(d.isSingleFile)i=!0}}if(s?.type==="reorder"){let{position:o,item:t}=s,e=d.hasFolders,f=Array.from(d.draggedIds)[0];if(e)C({param:{folderId:f},json:o==="before"?{beforeIndex:t.sortIndex??void 0}:{afterIndex:t.sortIndex??void 0}},{onSuccess:(a)=>{M.success("Folder reordered"),q(!0,a),l()},onError:(a)=>{M.error(`Failed to reorder: ${a.message}`)}});else Q({param:{fileId:f},json:o==="before"?{beforeIndex:t.sortIndex??void 0}:{afterIndex:t.sortIndex??void 0}},{onSuccess:(a)=>{M.success("File reordered"),q(!1,a),l()},onError:(a)=>{M.error(`Failed to reorder: ${a.message}`)}})}else if(i)v({param:{projectId:h},json:{assetIds:Array.from(d.draggedIds),newParentId:y}},{onSuccess:()=>{M.success("Assets moved successfully"),D.invalidateQueries({queryKey:["search",m,I]}),D.invalidateQueries({queryKey:["folders"]}),l()},onError:()=>{M.error("Failed to move assets")}})}S(void 0)}}}
|
|
2
|
-
export{da,Kl};
|
package/bin/chunk-jvt8q0eg.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{I}from"./chunk-p1d500sf.js";var e=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],ga=I("bell",e);
|
|
2
|
-
export{ga};
|
package/bin/chunk-jzgtthsj.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{w,V}from"./chunk-t6cn018t.js";var il=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 bf=w(function(cr,C){var{defineProperty:y,getOwnPropertyDescriptor:ae,getOwnPropertyNames:ce}=Object,ue=Object.prototype.hasOwnProperty,pe=(e,r)=>{for(var t in r)y(e,t,{get:r[t],enumerable:!0})},le=(e,r,t,n)=>{if(r&&typeof r==="object"||typeof r==="function"){for(let o of ce(r))if(!ue.call(e,o)&&o!==t)y(e,o,{get:()=>r[o],enumerable:!(n=ae(r,o))||n.enumerable})}return e},fe=(e)=>le(y({},"__esModule",{value:!0}),e),x={};pe(x,{AccessTokenMissingError:()=>A,RefreshAccessTokenFailedError:()=>S});C.exports=fe(x);class A extends Error{constructor(){super("No authentication found. Please log in with the Vercel CLI (vercel login).");this.name="AccessTokenMissingError"}}class S extends Error{constructor(e){super("Failed to refresh authentication token.",{cause:e});this.name="RefreshAccessTokenFailedError"}}});var N=w(function(ur,I){var{create:_e,defineProperty:_,getOwnPropertyDescriptor:de,getOwnPropertyNames:he,getPrototypeOf:ve}=Object,ke=Object.prototype.hasOwnProperty,ye=(e,r)=>{for(var t in r)_(e,t,{get:r[t],enumerable:!0})},R=(e,r,t,n)=>{if(r&&typeof r==="object"||typeof r==="function"){for(let o of he(r))if(!ke.call(e,o)&&o!==t)_(e,o,{get:()=>r[o],enumerable:!(n=de(r,o))||n.enumerable})}return e},O=(e,r,t)=>(t=e!=null?_e(ve(e)):{},R(r||!e||!e.__esModule?_(t,"default",{value:e,enumerable:!0}):t,e)),we=(e)=>R(_({},"__esModule",{value:!0}),e),M={};ye(M,{findRootDir:()=>Pe,getUserDataDir:()=>be});I.exports=we(M);var p=O(V("path")),ge=O(V("fs")),g=O(V("os")),Oe=il();function Pe(){try{let e=process.cwd();while(e!==p.default.dirname(e)){let r=p.default.join(e,".vercel");if(ge.default.existsSync(r))return e;e=p.default.dirname(e)}}catch(e){throw new Oe.VercelOidcTokenError("Token refresh only supported in node server environments")}return null}function be(){if(process.env.XDG_DATA_HOME)return process.env.XDG_DATA_HOME;switch(g.default.platform()){case"darwin":return p.default.join(g.default.homedir(),"Library/Application Support");case"linux":return p.default.join(g.default.homedir(),".local/share");case"win32":if(process.env.LOCALAPPDATA)return process.env.LOCALAPPDATA;return null;default:return null}}});var H=w(function(pr,B){var{create:je,defineProperty:d,getOwnPropertyDescriptor:Te,getOwnPropertyNames:Ee,getPrototypeOf:me}=Object,De=Object.prototype.hasOwnProperty,xe=(e,r)=>{for(var t in r)d(e,t,{get:r[t],enumerable:!0})},q=(e,r,t,n)=>{if(r&&typeof r==="object"||typeof r==="function"){for(let o of Ee(r))if(!De.call(e,o)&&o!==t)d(e,o,{get:()=>r[o],enumerable:!(n=Te(r,o))||n.enumerable})}return e},F=(e,r,t)=>(t=e!=null?je(me(e)):{},q(r||!e||!e.__esModule?d(t,"default",{value:e,enumerable:!0}):t,e)),Ae=(e)=>q(d({},"__esModule",{value:!0}),e),U={};xe(U,{isValidAccessToken:()=>Re,readAuthConfig:()=>Ve,writeAuthConfig:()=>Ce});B.exports=Ae(U);var l=F(V("fs")),J=F(V("path")),Se=al();function L(){let e=(0,Se.getVercelDataDir)();if(!e)throw Error(`Unable to find Vercel CLI data directory. Your platform: ${process.platform}. Supported: darwin, linux, win32.`);return J.join(e,"auth.json")}function Ve(){try{let e=L();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 Ce(e){let r=L(),t=J.dirname(r);if(!l.existsSync(t))l.mkdirSync(t,{mode:504,recursive:!0});l.writeFileSync(r,JSON.stringify(e,null,2),{mode:384})}function Re(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 Y=w(function(lr,X){var{defineProperty:j,getOwnPropertyDescriptor:Me,getOwnPropertyNames:Ie}=Object,Ne=Object.prototype.hasOwnProperty,qe=(e,r)=>{for(var t in r)j(e,t,{get:r[t],enumerable:!0})},Fe=(e,r,t,n)=>{if(r&&typeof r==="object"||typeof r==="function"){for(let o of Ie(r))if(!Ne.call(e,o)&&o!==t)j(e,o,{get:()=>r[o],enumerable:!(n=Me(r,o))||n.enumerable})}return e},$e=(e)=>Fe(j({},"__esModule",{value:!0}),e),z={};qe(z,{processTokenResponse:()=>He,refreshTokenRequest:()=>Be});X.exports=$e(z);var P=V("os"),Ue="https://vercel.com",Je="cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp",G=`@vercel/oidc node-${process.version} ${(0,P.platform)()} (${(0,P.arch)()}) ${(0,P.hostname)()}`,b=null;async function Le(){if(b)return b;let e=`${Ue}/.well-known/openid-configuration`,r=await fetch(e,{headers:{"user-agent":G}});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 b=n,n}async function Be(e){let r=await Le();return await fetch(r,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","user-agent":G},body:new URLSearchParams({client_id:Je,grant_type:"refresh_token",...e})})}async function He(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 al=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})},Z=(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},K=(e,r,t)=>(t=e!=null?ze(Ye(e)):{},Z(r||!e||!e.__esModule?h(t,"default",{value:e,enumerable:!0}):t,e)),Ke=(e)=>Z(h({},"__esModule",{value:!0}),e),W={};Ze(W,{assertVercelOidcTokenResponse:()=>T,findProjectInfo:()=>tr,getTokenPayload:()=>sr,getVercelDataDir:()=>We,getVercelOidcToken:()=>rr,getVercelToken:()=>er,isExpired:()=>ir,loadToken:()=>nr,saveToken:()=>or});ee.exports=Ke(W);var f=K(V("path")),s=K(V("fs")),u=il(),v=N(),a=H(),Q=Y(),c=bf();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,Q.refreshTokenRequest)({refresh_token:r.refreshToken}),[n,o]=await(0,Q.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{il,bf,al};
|
package/bin/chunk-jzjhg7ng.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{m,E,t,Z,ze,g,gt,Tt,Sm}from"./chunk-p1d500sf.js";import"./chunk-cxet91kt.js";import"./chunk-xgnvktq6.js";import"./chunk-keetdtxb.js";import"./chunk-5aqthcm6.js";import{Va}from"./chunk-sn0nypvd.js";import"./chunk-swz6v48q.js";import"./chunk-am6dg0a5.js";import{tr}from"./chunk-qd7pvaxb.js";import"./chunk-ahgq10a7.js";import"./chunk-1vt9ss7d.js";import"./chunk-ebcfbn00.js";import"./chunk-agcnbjxk.js";import"./chunk-xsfy8hz3.js";E();function c(){let{projectId:e,folderId:a}=p.useParams(),{teamId:r,ensureTeamIdForProject:d}=gt();m(()=>{d(e)},[e,d]);let{data:n}=tr(Sm(e)),o=n?.rootFolder,{data:f}=Z({queryKey:["folders",o],queryFn:async()=>{let s=await g.api.folders[":folderId"].$get({param:{folderId:o}});if(!s.ok)throw Error("failed to fetch folder");return await s.json()},enabled:!!o});if(!r||!o||!f)return t(Tt,{});return t(Va,{teamId:r,projectId:e,projectName:n.name??"",assetId:a,rootFolderId:o,isRoot:!1})}var p=ze("/projects/$projectId/folders/$folderId_/agentsmd")({component:c});export{p as Route};
|
package/bin/chunk-k547syp2.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{qe}from"./chunk-t6cn018t.js";var yf={};qe(yf,{decode:()=>D,encode:()=>mr});var ye=new TextEncoder,q=new TextDecoder,re=new TextDecoder("utf-8",{fatal:!0});function A(...e){let t=e.reduce((o,{length:a})=>o+a,0),r=new Uint8Array(t),n=0;for(let o of e)r.set(o,n),n+=o.length;return r}function tt(e,t,r){if(t<0||t>=4294967296)throw RangeError(`value must be >= 0 and <= 4294967295. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,t&255],r)}function rt(e){let t=Math.floor(e/4294967296),r=e%4294967296,n=new Uint8Array(8);return tt(n,t,0),tt(n,r,4),n}function Te(e){let t=new Uint8Array(4);return tt(t,e),t}function b(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if(n>127)throw TypeError("non-ASCII string encountered in encode()");t[r]=n}return t}var Pe=(e,t="algorithm.name")=>TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);function nt(e,t){if(t&&!e.usages.includes(t))throw TypeError(`CryptoKey does not support this operation, its usages must include ${t}.`)}function Ie(e,t){let{modulusLength:r}=t.algorithm;if(typeof r!=="number"||r<2048)throw TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}function k(e,t,r){let n=e.algorithm;if(n.name!==t.name)throw Pe(t.name);if(t.hash&&n.hash?.name!==t.hash)throw Pe(t.hash,"algorithm.hash");if(t.namedCurve&&n.namedCurve!==t.namedCurve)throw Pe(t.namedCurve,"algorithm.namedCurve");if(t.length!==void 0&&n.length!==t.length)throw Pe(t.length,"algorithm.length");nt(e,r)}function Ot(e,t,...r){if(r.length>2){let n=r.pop();e+=`one of type ${r.join(", ")}, or ${n}.`}else if(r.length===2)e+=`one of type ${r[0]} or ${r[1]}.`;else e+=`of type ${r[0]}.`;if(t==null)e+=` Received ${t}`;else if(typeof t==="function"&&t.name)e+=` Received function ${t.name}`;else if(typeof t==="object"&&t!=null){if(t.constructor?.name)e+=` Received an instance of ${t.constructor.name}`}return e}var B=(e,...t)=>Ot("Key must be ",e,...t),he=(e,t,...r)=>Ot(`Key for the ${e} algorithm must be `,t,...r);class x extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(e,t){super(e,t);this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}class _ extends x{static code="ERR_JWT_CLAIM_VALIDATION_FAILED";code="ERR_JWT_CLAIM_VALIDATION_FAILED";claim;reason;payload;constructor(e,t,r="unspecified",n="unspecified"){super(e,{cause:{claim:r,reason:n,payload:t}});this.claim=r,this.reason=n,this.payload=t}}class sl extends x{static code="ERR_JWT_EXPIRED";code="ERR_JWT_EXPIRED";claim;reason;payload;constructor(e,t,r="unspecified",n="unspecified"){super(e,{cause:{claim:r,reason:n,payload:t}});this.claim=r,this.reason=n,this.payload=t}}class ne extends x{static code="ERR_JOSE_ALG_NOT_ALLOWED";code="ERR_JOSE_ALG_NOT_ALLOWED"}class m extends x{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"}class Oe extends x{static code="ERR_JWE_DECRYPTION_FAILED";code="ERR_JWE_DECRYPTION_FAILED";constructor(e="decryption operation failed",t){super(e,t)}}class f extends x{static code="ERR_JWE_INVALID";code="ERR_JWE_INVALID"}class w extends x{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"}class E extends x{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"}class _e extends x{static code="ERR_JWK_INVALID";code="ERR_JWK_INVALID"}class De extends x{static code="ERR_JWKS_INVALID";code="ERR_JWKS_INVALID"}class we extends x{static code="ERR_JWKS_NO_MATCHING_KEY";code="ERR_JWKS_NO_MATCHING_KEY";constructor(e="no applicable key found in the JSON Web Key Set",t){super(e,t)}}class ot extends x{[Symbol.asyncIterator]=async function*(){};static code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";constructor(e="multiple matching keys found in the JSON Web Key Set",t){super(e,t)}}class it extends x{static code="ERR_JWKS_TIMEOUT";code="ERR_JWKS_TIMEOUT";constructor(e="request timed out",t){super(e,t)}}class at extends x{static code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";constructor(e="signature verification failed",t){super(e,t)}}function Ue(e){if(!M(e))throw Error("CryptoKey instance expected")}var M=(e)=>{if(e?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},st=(e)=>e?.[Symbol.toStringTag]==="KeyObject",Re=(e)=>M(e)||st(e);var L=(e)=>crypto.getRandomValues(new Uint8Array(e.cekBits>>3));function _t(e,t){let r=e.byteLength<<3;if(r!==t)throw new f(`Invalid Content Encryption Key length. Expected ${t} bits, got ${r} bits`)}var Wr=(e)=>crypto.getRandomValues(new Uint8Array(e.ivBits>>3));function Dt(e,t){if(t.length<<3!==e.ivBits)throw new f("Invalid Initialization Vector length")}async function Ut(e,t,r){if(!(t instanceof Uint8Array))throw TypeError(B(t,"Uint8Array"));let n=e.cekBits>>1,o=await crypto.subtle.importKey("raw",t.subarray(n>>3),"AES-CBC",!1,[r]),a=await crypto.subtle.importKey("raw",t.subarray(0,n>>3),{hash:`SHA-${n<<1}`,name:"HMAC"},!1,["sign"]);return[o,a,n]}async function Rt(e,t,r){return new Uint8Array((await crypto.subtle.sign("HMAC",e,t)).slice(0,r>>3))}async function Cr(e,t,r,n,o){let[a,i,s]=await Ut(e,r,"encrypt"),c=new Uint8Array(await crypto.subtle.encrypt({iv:n,name:"AES-CBC"},a,t)),p=A(o,n,c,rt(o.length*8)),d=await Rt(i,p,s);return{ciphertext:c,tag:d,iv:n}}async function vr(e,t){let r={name:"HMAC",hash:"SHA-256"},n=await crypto.subtle.generateKey(r,!1,["sign","verify"]),o=await crypto.subtle.sign(r,n,e);return crypto.subtle.verify(r,n,o,t)}async function Tr(e,t,r,n,o,a){let[i,s,c]=await Ut(e,t,"decrypt"),p=A(a,n,r,rt(a.length*8)),d=await Rt(s,p,c);try{if(await vr(o,d))return new Uint8Array(await crypto.subtle.decrypt({iv:n,name:"AES-CBC"},i,r))}catch{}throw new Oe}async function Pr(e,t,r,n,o){let a=r instanceof Uint8Array?await crypto.subtle.importKey("raw",r,"AES-GCM",!1,["encrypt"]):(k(r,e.subtle,"encrypt"),r),i=new Uint8Array(await crypto.subtle.encrypt({additionalData:o,iv:n,name:"AES-GCM",tagLength:128},a,t)),s=i.slice(-16);return{ciphertext:i.slice(0,-16),tag:s,iv:n}}async function Ir(e,t,r,n,o,a){let i=t instanceof Uint8Array?await crypto.subtle.importKey("raw",t,"AES-GCM",!1,["decrypt"]):(k(t,e.subtle,"decrypt"),t);try{return new Uint8Array(await crypto.subtle.decrypt({additionalData:a,iv:n,name:"AES-GCM",tagLength:128},i,A(r,o)))}catch{throw new Oe}}async function Ne(e,t,r,n,o){if(!M(r)&&!(r instanceof Uint8Array))throw TypeError(B(r,"CryptoKey","KeyObject","Uint8Array","JSON Web Key"));if(n)Dt(e,n);else n=Wr(e);if(r instanceof Uint8Array)_t(r,e.cekBits);return e.cbc?Cr(e,t,r,n,o):Pr(e,t,r,n,o)}async function He(e,t,r,n,o,a){if(!M(t)&&!(t instanceof Uint8Array))throw TypeError(B(t,"CryptoKey","KeyObject","Uint8Array","JSON Web Key"));if(!n)throw new f("JWE Initialization Vector missing");if(!o)throw new f("JWE Authentication Tag missing");if(!e.cbc&&o.length!==16)throw new f("Invalid Authentication Tag length");if(Dt(e,n),t instanceof Uint8Array)_t(t,e.cekBits);return e.cbc?Tr(e,t,r,n,o,a):Ir(e,t,r,n,o,a)}function ct(e){if(Uint8Array.prototype.toBase64)return e.toBase64();let t=32768,r=[];for(let n=0;n<e.length;n+=t)r.push(String.fromCharCode.apply(null,e.subarray(n,n+t)));return btoa(r.join(""))}function ke(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}var pt="The input to be decoded is not correctly encoded.";function D(e){if(Uint8Array.fromBase64)try{return Uint8Array.fromBase64(typeof e==="string"?e:q.decode(e),{alphabet:"base64url"})}catch(r){throw TypeError(pt,{cause:r})}let t=e;if(t instanceof Uint8Array)t=q.decode(t);if(t.includes("+")||t.includes("/"))throw TypeError(pt);t=t.replace(/-/g,"+").replace(/_/g,"/");try{return ke(t)}catch{throw TypeError(pt)}}function mr(e){let t=e;if(typeof t==="string")t=ye.encode(t);if(Uint8Array.prototype.toBase64)return t.toBase64({alphabet:"base64url",omitPadding:!0});return ct(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Z(e,t){if(!(e instanceof Uint8Array))throw TypeError(`${t} must be an instance of Uint8Array`)}function S(e){if(typeof e!=="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function Be(e){return S(e)&&Array.isArray(e.keys)&&Array.from(e.keys).every(S)}function Nt(...e){let t=new Set;for(let r of e){if(!r)continue;for(let n of Object.keys(r)){if(t.has(n))return!1;t.add(n)}}return!0}var Ht=Symbol();function Q(e,t){if(e!==void 0)throw TypeError(`${t} can only be called once`)}function W(e,t,r){try{return D(e)}catch{throw new r(`Failed to base64url decode the ${t}`)}}function dt(e,t,r){try{return b(e)}catch{throw new r(`The ${t} is not a valid base64url string`)}}async function Me(e,t){let r=`SHA-${e.slice(-3)}`;return new Uint8Array(await crypto.subtle.digest(r,t))}function F(e,t,r){let n;try{n=JSON.parse(re.decode(D(e)))}catch{throw new t(r)}if(!S(n))throw new t(r);return n}async function j(e,t){if(t.kty==="RSA"&&"oth"in t&&t.oth!==void 0)throw new m('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');if(!e.kty.includes(t.kty))throw new m('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');let r=e.resolve?.({kty:t.kty,crv:t.crv})??e.subtle,n=!!(t.d||t.priv),o={...t};if(o.kty!=="AKP")delete o.alg;return delete o.use,crypto.subtle.importKey("jwk",o,r,t.ext??!n,t.key_ops??e.usages[n?1:0])}function oe(e){return{__proto__:null,...e}}function $e(e){let t=oe(e);if(t.ext!==void 0&&typeof t.ext!=="boolean")throw TypeError('"ext" (Extractable) Parameter must be a boolean');if(t.key_ops!==void 0){let r=t.key_ops,n=Array.isArray(r)?[...r]:void 0;if(!n||n.some((o)=>typeof o!=="string")||new Set(n).size!==n.length)throw TypeError('"key_ops" (Key Operations) Parameter must be an array of unique strings');t.key_ops=n}return t}var ft=(e)=>e[Symbol.toStringTag],Or=(e,t,r)=>{let{alg:n}=e;if(t.use!==void 0){let o=r==="sign"||r==="verify"?"sig":"enc";if(t.use!==o)throw TypeError(`Invalid key for this operation, its "use" must be "${o}" when present`)}if(t.alg!==void 0&&t.alg!==n)throw TypeError(`Invalid key for this operation, its "alg" must be "${n}" when present`);if(Array.isArray(t.key_ops)){let o=r==="encrypt"||r==="decrypt"?e.ops?.[r==="encrypt"?0:1]:r;if(o&&!t.key_ops.includes(o))throw TypeError(`Invalid key for this operation, its "key_ops" must include "${o}" when present`)}};function _r(e,t,r){let{alg:n,secret:o}=e,a=r==="decrypt"||r==="sign";if(o&&t instanceof Uint8Array)return[Bt,t];if(S(t)){let i=$e(t);if(typeof i.kty!=="string")throw TypeError(o?he(n,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"):he(n,t,"CryptoKey","KeyObject","JSON Web Key"));if(!(o?i.kty==="oct"&&typeof i.k==="string":i.kty!=="oct"&&(a?i.kty==="AKP"&&typeof i.priv==="string"||typeof i.d==="string":i.d===void 0&&i.priv===void 0)))throw TypeError(o?'JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present':`JSON Web Key for this operation must be a ${a?"private":"public"} JWK`);return Or(e,i,r),[Lt,t,i]}if(!Re(t))throw TypeError(o?he(n,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"):he(n,t,"CryptoKey","KeyObject","JSON Web Key"));if(o){if(t.type!=="secret")throw TypeError(`${ft(t)} instances for symmetric algorithms must be of type "secret"`)}else{if(t.type==="secret")throw TypeError(`${ft(t)} instances for asymmetric algorithms must not be of type "secret"`);let i=a?"private":"public";if((t.type==="public"||t.type==="private")&&t.type!==i){let s=r==="sign"?"signing":r==="verify"?"verifying":`${r.slice(0,-1)}tion`;throw TypeError(`${ft(t)} instances for asymmetric algorithm ${s} must be of type "${i}"`)}}return M(t)?[Mt,t]:[$t,t]}var Bt=0,Mt=1,$t=2,Lt=3,ut,Dr={__proto__:null,prime256v1:"P-256",secp384r1:"P-384",secp521r1:"P-521"};function Le(e,t,r){ut||=new WeakMap;let n=ut.get(e);if(r)if(n)n[t]=r;else ut.set(e,{[t]:r});return r??n?.[t]}var kt=async(e,t,r)=>Le(e,r.alg)??Le(e,r.alg,await j(r,{...t,alg:r.alg})),Ur=(e,t)=>{let r=Le(e,t.alg);if(r)return r;let n=e.type==="public",o=t.usages[n?0:1],{asymmetricKeyType:a}=e,i=Dr[e.asymmetricKeyDetails?.namedCurve],s=t.resolve?.({crv:i,asymmetricKeyType:a})??t.subtle;return Le(e,t.alg,e.toCryptoKey(s,n,o))};async function U(e,t,r){let n=_r(e,t,r);switch(n[0]){case Bt:case Mt:return n[1];case Lt:{let o=n[1],a=n[2];if(a.kty==="oct")return D(a.k);if(!Object.isFrozen(o)){let{key_ops:i}=o;if(Array.isArray(i))Object.freeze(i);Object.freeze(o)}return kt(o,a,e)}case $t:{let o=n[1];if(o.type==="secret")return o.export();if("toCryptoKey"in o&&typeof o.toCryptoKey==="function")return Ur(o,e);return kt(o,o.export({format:"jwk"}),e)}}}function ge(e){let t={__proto__:null};for(let r in e)t[r]={...e[r],alg:r};return t}var Rr=[["encrypt","wrapKey"],["decrypt","unwrapKey"]],Nr=[[],["deriveBits"]],Ve=[[],[]];function je(e){return{kty:["RSA"],subtle:{name:"RSA-OAEP",hash:`SHA-${e}`},usages:Rr,ops:["wrapKey","unwrapKey"]}}function ze(){return{kty:["EC","OKP"],subtle:{name:"ECDH"},resolve:({kty:e,crv:t,asymmetricKeyType:r})=>{if(t==="X25519"||r==="x25519")return{name:"X25519"};if(e==="OKP")throw new m('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');return{name:"ECDH",namedCurve:t}},usages:Nr,ops:[void 0,"deriveBits"]}}function ie(e,t=!1){return{kty:["oct"],secret:!0,subtle:{name:t?"AES-GCM":"AES-KW",length:e},usages:Ve,ops:t?["encrypt","decrypt"]:["wrapKey","unwrapKey"]}}function lt(){return{kty:["oct"],secret:!0,subtle:{name:"PBKDF2"},usages:Ve,ops:["deriveBits","deriveBits"]}}var mt=ge({dir:{kty:["oct"],secret:!0,subtle:{name:"AES-GCM"},usages:Ve,ops:["encrypt","decrypt"]},"RSA-OAEP":je(1),"RSA-OAEP-256":je(256),"RSA-OAEP-384":je(384),"RSA-OAEP-512":je(512),"ECDH-ES":ze(),"ECDH-ES+A128KW":ze(),"ECDH-ES+A192KW":ze(),"ECDH-ES+A256KW":ze(),A128KW:ie(128),A192KW:ie(192),A256KW:ie(256),A128GCMKW:ie(128,!0),A192GCMKW:ie(192,!0),A256GCMKW:ie(256,!0),"PBES2-HS256+A128KW":lt(),"PBES2-HS384+A192KW":lt(),"PBES2-HS512+A256KW":lt()}),Hr=["encrypt","decrypt"];function ae(e,t=!1){return{kty:["oct"],secret:!0,subtle:{name:t?"AES-CBC":"AES-GCM",length:e},usages:Ve,ops:Hr,cekBits:e,ivBits:t?128:96,cbc:t}}var kr=ge({A128GCM:ae(128),A192GCM:ae(192),A256GCM:ae(256),"A128CBC-HS256":ae(256,!0),"A192CBC-HS384":ae(384,!0),"A256CBC-HS512":ae(512,!0)});function jt(e,t){throw new m(`Invalid or unsupported "${e}" (JWE ${t}) header value`)}function R(e){return(typeof e==="string"?mt[e]:void 0)??jt("alg","Algorithm")}function ee(e){return(typeof e==="string"?kr[e]:void 0)??jt("enc","Encryption Algorithm")}function zt(e,t){if(e.algorithm.name!=="ECDH"&&e.algorithm.name!=="X25519")throw TypeError("CryptoKey does not support this operation, its algorithm.name must be ECDH or X25519");nt(e,t)}async function Gt(e,t,r){let n=R(t).subtle,o=e instanceof Uint8Array?await crypto.subtle.importKey("raw",e,"AES-KW",!0,[r]):e;return k(o,n,r),o}async function yt(e,t,r){let n=await Gt(t,e,"wrapKey"),o=await crypto.subtle.importKey("raw",r,{hash:"SHA-256",name:"HMAC"},!0,["sign"]);return new Uint8Array(await crypto.subtle.wrapKey("raw",o,n,"AES-KW"))}async function ht(e,t,r){let n=await Gt(t,e,"unwrapKey"),o=await crypto.subtle.unwrapKey("raw",r,n,"AES-KW",{hash:"SHA-256",name:"HMAC"},!0,["sign"]);return new Uint8Array(await crypto.subtle.exportKey("raw",o))}function Ft(e,t,r){k(t,R(e).subtle,r),Ie(e,t)}function Br(e,t){if(e instanceof Uint8Array)return crypto.subtle.importKey("raw",e,"PBKDF2",!1,["deriveBits"]);return k(e,R(t).subtle,"deriveBits"),e}async function Xt(e,t,r,n){if(!(e instanceof Uint8Array)||e.length<8)throw new f("PBES2 Salt Input must be 8 or more octets");if(!Number.isSafeInteger(r)||Math.sign(r)!==1)throw new f("PBES2 Count Input must be a positive integer");let o=A(b(t),Uint8Array.of(0),e),a=parseInt(t.slice(13,16),10),i={hash:`SHA-${t.slice(8,11)}`,iterations:r,name:"PBKDF2",salt:o},s=await Br(n,t);return new Uint8Array(await crypto.subtle.deriveBits(i,s,a))}function wt(e){return A(Te(e.length),e)}async function Mr(e,t,r){let n=t>>3,o=32,a=Math.ceil(n/32),i=new Uint8Array(a*32);for(let s=1;s<=a;s++){let c=await Me("sha256",A(Te(s),e,r));i.set(c,(s-1)*32)}return i.slice(0,n)}async function Yt(e,t,r,n,o=new Uint8Array,a=new Uint8Array){zt(e),zt(t,"deriveBits");let i=A(wt(b(r)),wt(o),wt(a),Te(n)),s=new Uint8Array(await crypto.subtle.deriveBits({name:e.algorithm.name,public:e},t,e.algorithm.name==="X25519"?256:Math.ceil(parseInt(e.algorithm.namedCurve.slice(-3),10)/8)<<3));return Mr(s,n,i)}function qt(e){Ue(e);let t=e.algorithm.namedCurve;if(t!=="P-256"&&t!=="P-384"&&t!=="P-521"&&e.algorithm.name!=="X25519")throw new m("ECDH with the provided key is not allowed or not supported by your javascript runtime")}function Ee(e){if(e===void 0)throw new f("JWE Encrypted Key missing")}function Vt(e){if(e!==void 0)throw new f("Encountered unexpected JWE Encrypted Key")}async function Zt(e,t,r,n,o,a){let i=R(e);if(e==="dir")return Vt(n),r;switch(i.subtle.name){case"ECDH":{if(e==="ECDH-ES")Vt(n);if(!S(o.epk))throw new f('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');qt(r);let s=await j(i,o.epk),c,p;if(o.apu!==void 0){if(typeof o.apu!=="string")throw new f('JOSE Header "apu" (Agreement PartyUInfo) invalid');c=W(o.apu,"apu",f)}if(o.apv!==void 0){if(typeof o.apv!=="string")throw new f('JOSE Header "apv" (Agreement PartyVInfo) invalid');p=W(o.apv,"apv",f)}let d=await Yt(s,r,e==="ECDH-ES"?t.alg:e,e==="ECDH-ES"?t.cekBits:parseInt(e.slice(-5,-2),10),c,p);if(e==="ECDH-ES")return d;return Ee(n),ht(e.slice(-6),d,n)}case"RSA-OAEP":return Ee(n),Ue(r),Ft(e,r,"decrypt"),new Uint8Array(await crypto.subtle.decrypt("RSA-OAEP",r,n));case"PBKDF2":{if(Ee(n),typeof o.p2c!=="number")throw new f('JOSE Header "p2c" (PBES2 Count) missing or invalid');let s=a||1e4;if(o.p2c>s)throw new f('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if(typeof o.p2s!=="string")throw new f('JOSE Header "p2s" (PBES2 Salt) missing or invalid');let c=W(o.p2s,"p2s",f),p=await Xt(c,e,o.p2c,r);return ht(e.slice(-6),p,n)}case"AES-KW":return Ee(n),ht(e,r,n);case"AES-GCM":{if(Ee(n),typeof o.iv!=="string")throw new f('JOSE Header "iv" (Initialization Vector) missing or invalid');if(typeof o.tag!=="string")throw new f('JOSE Header "tag" (Authentication Tag) missing or invalid');let s;s=W(o.iv,"iv",f);let c;return c=W(o.tag,"tag",f),He(ee(e.slice(0,-2)),r,n,s,c,new Uint8Array)}}}async function Qt(e,t,r,n,o={}){let a,i,s,c=R(e);if(e==="dir")return[r,void 0,void 0];switch(c.subtle.name){case"ECDH":{qt(r);let{apu:p,apv:d}=o;if(p!==void 0)Z(p,'"apu"');if(d!==void 0)Z(d,'"apv"');let u;if(o.epk!==void 0)u=await U(c,o.epk,"decrypt");else u=(await crypto.subtle.generateKey(r.algorithm,!0,["deriveBits"])).privateKey;let l=crypto.subtle,K=u;if(!K.extractable){if(typeof l.getPublicKey!=="function")throw TypeError('CryptoKey for "epk" must be extractable');K=await l.getPublicKey(u,[])}let{x:T,y:g,crv:h,kty:v}=await l.exportKey("jwk",K),y=await Yt(r,u,e==="ECDH-ES"?t.alg:e,e==="ECDH-ES"?t.cekBits:parseInt(e.slice(-5,-2),10),p,d);if(i={epk:{x:T,crv:h,kty:v}},v==="EC")i.epk.y=g;if(p)i.apu=mr(p);if(d)i.apv=mr(d);if(e==="ECDH-ES"){s=y;break}s=n||L(t);let J=e.slice(-6);a=await yt(J,y,s);break}case"RSA-OAEP":{s=n||L(t),Ue(r),Ft(e,r,"encrypt"),a=new Uint8Array(await crypto.subtle.encrypt("RSA-OAEP",r,s));break}case"PBKDF2":{s=n||L(t);let{p2c:p=2048,p2s:d=crypto.getRandomValues(new Uint8Array(16))}=o,u=await Xt(d,e,p,r);a=await yt(e.slice(-6),u,s),i={p2c:p,p2s:mr(d)};break}case"AES-KW":{s=n||L(t),a=await yt(e,r,s);break}case"AES-GCM":{s=n||L(t);let{iv:p}=o,d=await Ne(ee(e.slice(0,-2)),s,r,p,new Uint8Array);a=d.ciphertext,i={iv:mr(d.iv),tag:mr(d.tag)};break}}return[s,a,i]}var se={__proto__:null,b64:!0},Ge={__proto__:null};function be(e,t){if(t!==void 0&&(!Array.isArray(t)||t.some((r)=>typeof r!=="string")))throw TypeError(`"${e}" option must be an array of strings`);if(!t)return;return new Set(t)}function Fe(e,t){let{crit:r}=t??{};if(Array.isArray(r)&&new Set(r).size!==r.length)throw new e('"crit" (Critical) Header Parameter MUST NOT contain duplicate values')}function N(e,t,r,n,o){if(o.crit!==void 0&&n?.crit===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||n.crit===void 0)return[];if(!Array.isArray(n.crit)||n.crit.length===0||n.crit.some((i)=>typeof i!=="string"||i.length===0))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let a=r===void 0?t:{__proto__:null,...r,...t};for(let i of n.crit){if(!(i in a))throw new m(`Extension Header Parameter "${i}" is not recognized`);if(!Object.hasOwn(o,i)||o[i]===void 0)throw new e(`Extension Header Parameter "${i}" is missing`);if(a[i]&&(!Object.hasOwn(n,i)||n[i]===void 0))throw new e(`Extension Header Parameter "${i}" MUST be integrity protected`)}return n.crit}function ce(e,t){if(t.includes("b64")){let r=e.b64;if(typeof r!=="boolean")throw new w('The "b64" (base64url-encode payload) Header Parameter must be a boolean');return r}return!0}function pe(e,t){let r,n;try{r=JSON.stringify(t),n=JSON.parse(r)}catch(o){throw new e("JOSE Header is not valid JSON",{cause:o})}if(!S(n))throw new e("JOSE Header is not a JSON object");return[n,r]}function Xe(e,t){if(e.zip!==void 0&&e.zip!=="DEF")throw new m('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value.');if(e.zip!==void 0&&!t?.zip)throw new f('JWE "zip" (Compression Algorithm) Header Parameter MUST be in a protected header.')}function er(e){if(typeof globalThis[e]>"u")throw new m(`JWE "zip" (Compression Algorithm) Header Parameter requires the ${e} API.`)}async function tr(e){er("CompressionStream");let t=new CompressionStream("deflate-raw"),r=t.writable.getWriter();r.write(e).catch(()=>{}),r.close().catch(()=>{});let n=[],o=t.readable.getReader();for(;;){let{value:a,done:i}=await o.read();if(i)break;n.push(a)}return A(...n)}async function rr(e,t){er("DecompressionStream");let r=new DecompressionStream("deflate-raw"),n=r.writable.getWriter();n.write(e).catch(()=>{}),n.close().catch(()=>{});let o=[],a=0,i=r.readable.getReader();for(;;){let{value:s,done:c}=await i.read();if(c)break;if(o.push(s),a+=s.byteLength,t!==1/0&&a>t)throw new f("Decompressed plaintext exceeded the configured limit")}return A(...o)}function nr(e){return[e&&be("keyManagementAlgorithms",e.keyManagementAlgorithms),e&&be("contentEncryptionAlgorithms",e.contentEncryptionAlgorithms),e?.crit,e?.maxPBES2Count,e?.maxDecompressedLength]}async function $r(e,t,r,n,o){let[a,i,s,c,p]=r,[d,u,l,K,T]=t,{encrypted_key:g}=e;N(f,Ge,s,d,o),Xe(o,d);let{alg:h,enc:v}=o;if(typeof h!=="string"||!h)throw new f("missing JWE Algorithm (alg) in JWE Header");if(typeof v!=="string"||!v)throw new f("missing JWE Encryption Algorithm (enc) in JWE Header");if(a&&!a.has(h)||!a&&h.startsWith("PBES2"))throw new ne('"alg" (Algorithm) Header Parameter value not allowed');if(i&&!i.has(v))throw new ne('"enc" (Encryption Algorithm) Header Parameter value not allowed');let y=ee(v),J;if(g!==void 0)J=W(g,"encrypted_key",f);let P=!1;if(typeof n==="function")n=await n(d,e),P=!0;let H=R(h),O=await U(h==="dir"?y:H,n,"decrypt"),I;try{if(I=await Zt(h,y,O,J,o,c),g!==void 0&&I instanceof Uint8Array&&I.byteLength<<3!==y.cekBits)I=L(y)}catch(C){if(C instanceof TypeError||C instanceof f||C instanceof m)throw C;I=L(y)}let X=await He(y,I,u,l,K,T);if(o.zip==="DEF"){let C=p??250000;if(C===0)throw new m('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');if(C!==1/0&&(!Number.isSafeInteger(C)||C<1))throw TypeError("maxDecompressedLength must be 0, a positive safe integer, or Infinity");X=await rr(X,C).catch((Y)=>{if(Y instanceof f)throw Y;throw new f("Failed to decompress plaintext",{cause:Y})})}return[X,d,O,P]}async function or(e,t,r){if(e instanceof Uint8Array)e=q.decode(e);if(typeof e!=="string")throw new f("Compact JWE must be a string or Uint8Array");let{0:n,1:o,2:a,3:i,4:s,length:c}=e.split(".");if(c!==5)throw new f("Invalid Compact JWE");let p={ciphertext:i,iv:a||void 0,protected:n,tag:s||void 0,encrypted_key:o||void 0},d=F(n,f,"JWE Protected Header is invalid"),u=b(n),l=[d,W(i,"ciphertext",f),a?W(a,"iv",f):void 0,s?W(s,"tag",f):void 0,u];return $r(p,l,t,r,d)}function ir(e,t,r){if(!Nt(e,t,r))throw new f("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint")}function Lr(e){let[,t,r,n,o,a,i,s,c]=e;if(o!==void 0)Z(o,"JWE Additional Authenticated Data");if(a!==void 0)Z(a,"JWE Content Encryption Key");if(i!==void 0)Z(i,"JWE Initialization Vector");if(t!==void 0)t=pe(f,t)[0],e[1]=t;if(r!==void 0)r=pe(f,r)[0],e[2]=r;if(n!==void 0)n=pe(f,n)[0],e[3]=n;if(s!==void 0&&!S(s))throw TypeError("JWE Key Management Parameters must be an object");ir(t,r,n);let p={...t,...r,...n};Fe(f,t),N(f,Ge,c,t,p),Xe(p,t);let{alg:d,enc:u}=p;if(typeof d!=="string"||!d)throw new f('JWE "alg" (Algorithm) Header Parameter missing or invalid');if(typeof u!=="string"||!u)throw new f('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');return[p,d,u,ee(u)]}async function jr(e,t,r){let[n,o,,a]=t,[i,s,c,p,d,u,l,K,,T]=e,g=s,h=c;if(u&&(o==="dir"||o==="ECDH-ES"))throw TypeError(`setContentEncryptionKey cannot be called with JWE "alg" (Algorithm) Header ${o}`);let v=R(o),y=await U(o==="dir"?a:v,r,"encrypt"),[J,P,H]=await Qt(o,a,y,u,K);if(H){if(T)h=h?{...h,...H}:H;else g=g?{...g,...H}:H;ir(g,h,p)}let O,I;if(g)O=mr(JSON.stringify(g)),I=b(O);else O="",I=new Uint8Array;let X,C;if(d?.byteLength)C=mr(d),X=A(I,b("."),b(C));else X=I;let Y=i;if(n.zip==="DEF")Y=await tr(Y).catch((Jr)=>{throw new f("Failed to compress plaintext",{cause:Jr})});let{ciphertext:Kr,tag:Pt,iv:It}=await Ne(a,Y,J,l,X),G={ciphertext:mr(Kr)};if(It)G.iv=mr(It);if(Pt)G.tag=mr(Pt);if(P)G.encrypted_key=mr(P);if(C)G.aad=C;if(g)G.protected=O;if(p)G.unprotected=p;if(h)G.header=h;return G}async function ar(e,t,r){if(!e[1]&&!e[2]&&!e[3])throw new f("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(r!==void 0)e[8]=r?.crit,e[9]=r?Ht in r:!1;return jr(e,Lr(e),t)}async function sr(e,t,r){if(t instanceof Uint8Array)return crypto.subtle.importKey("raw",t,e.subtle,!1,[r]);if(k(t,e.subtle,r),e.minRsaBits)Ie(e.alg,t);return t}async function cr(e,t,r){let n=await sr(e,t,"sign"),o=await crypto.subtle.sign(e.signing,n,r);return new Uint8Array(o)}async function pr(e,t,r,n){let o=await sr(e,t,"verify");try{return await crypto.subtle.verify(e.signing,o,r,n)}catch{return!1}}var Se=[["verify"],["sign"]];function gt(e){let t={name:"HMAC",hash:`SHA-${e}`};return{kty:["oct"],secret:!0,subtle:t,signing:t,usages:Se}}function de(e,t){let n={name:t?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:`SHA-${e}`};return{kty:["RSA"],subtle:n,signing:t?{...n,saltLength:t}:n,usages:Se,minRsaBits:2048}}function Et(e,t){return{kty:["EC"],crv:e,subtle:{name:"ECDSA",namedCurve:e},signing:{name:"ECDSA",hash:`SHA-${t}`},usages:Se}}function dr(){let e={name:"Ed25519"};return{kty:["OKP"],crv:"Ed25519",subtle:e,signing:e,usages:Se}}function bt(e){let r={name:`ML-DSA-${e}`};return{kty:["AKP"],subtle:r,signing:r,usages:Se}}var Ae=ge({HS256:gt(256),HS384:gt(384),HS512:gt(512),RS256:de(256),RS384:de(384),RS512:de(512),PS256:de(256,32),PS384:de(384,48),PS512:de(512,64),ES256:Et("P-256",256),ES384:Et("P-384",384),ES512:Et("P-521",512),EdDSA:dr(),Ed25519:dr(),"ML-DSA-44":bt(44),"ML-DSA-65":bt(65),"ML-DSA-87":bt(87)});function Ye(e){let t=typeof e==="string"?Ae[e]:void 0;if(!t)throw new m(`alg ${e} is not supported either by JOSE or your javascript runtime`);return t}function fr(e){return[e&&be("algorithms",e.algorithms),e?.crit]}function zr(e,t=e===void 0?{}:F(e,w,"JWS Protected Header is invalid")){return t}function Vr(e,t,r){let n=ce(e,N(w,se,r[1],e,t)),o=t.alg;if(typeof o!=="string"||!o)throw new w('JWS "alg" (Algorithm) Header Parameter missing or invalid');if(r[0]&&!r[0].has(o))throw new ne('"alg" (Algorithm) Header Parameter value not allowed');return[n,o]}function Gr(e){try{return b(e)}catch{throw new w("JWS Compact Serialization payload must use only ASCII characters")}}async function Fr(e,t,r,n,o,a,i){let s=!1;if(typeof r==="function")r=await r(o,e),s=!0;let c=typeof i==="string",p=Ye(a),d=A(n!==void 0?b(n):new Uint8Array,b("."),c?t[2]??=dt(i,"payload",w):i),u=W(e.signature,"signature",w),l=await U(p,r,"verify");if(!await pr(p,l,u,d))throw new at;return[c?W(i,"payload",w):i,o,c,l,s]}async function ur(e,t,r){if(e instanceof Uint8Array)e=q.decode(e);if(typeof e!=="string")throw new w("Compact JWS must be a string or Uint8Array");let{0:n,1:o,2:a,length:i}=e.split(".");if(i!==3)throw new w("Invalid Compact JWS");let s={payload:o,protected:n,signature:a},c=zr(n),[p,d]=Vr(c,c,t),u=p?o:Gr(o);return Fr(s,t,r,n,c,d,u)}var xe=(e)=>Math.floor(e.getTime()/1000),Xr={s:1,m:60,h:3600,d:86400,w:604800,y:31557600},Yr=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,fe="check_failed";function St(){throw TypeError("Invalid time period format")}function Ze(e){if(typeof e!=="string")St();let t=Yr.exec(e);if(!t||t[4]&&t[1])St();let r=parseFloat(t[2]),n=Math.round(r*Xr[t[3][0].toLowerCase()]);if(!Number.isFinite(n))St();if(t[1]==="-"||t[4]==="ago")return-n;return n}function ue(e,t){if(!Number.isFinite(t))throw TypeError(`Invalid ${e} input`);return t}function At(e,t){if(typeof t!=="string")throw TypeError(`"${e}" claim must be a string`)}function qr(e){if(typeof e!=="string"&&(!Array.isArray(e)||Array.from(e).some((t)=>typeof t!=="string")))throw TypeError('"aud" claim must be a string or an array of strings')}function xt(e,t){if(typeof e==="number")return ue(t,e);if(e instanceof Date)return ue(t,xe(e));return xe(new Date)+Ze(e)}var lr=(e)=>{let t=e.toLowerCase();return e.includes("/")?t:`application/${t}`},Zr=(e,t)=>{if(typeof e==="string")return t.includes(e);if(Array.isArray(e))return t.some((r)=>e.includes(r));return!1};function Kt(e,t,r=!1){let n=e[t];if(n===void 0&&!r)return;if(typeof n!=="number")throw new _(`"${t}" claim must be a number`,e,t,"invalid");return n}function Jt(e,t){throw new _(`unexpected "${t}" claim value`,e,t,fe)}function le(e,t,r={}){let n;try{n=JSON.parse(re.decode(t))}catch{}if(!S(n))throw new E("JWT Claims Set must be a top-level JSON object");let{typ:o}=r;if(o!==void 0&&(typeof e.typ!=="string"||lr(e.typ)!==lr(o)))throw new _('unexpected "typ" JWT header value',n,"typ",fe);let{requiredClaims:a=[],issuer:i,subject:s,audience:c,maxTokenAge:p}=r,d=[...a];if(p!==void 0)d.push("iat");if(c!==void 0)d.push("aud");if(s!==void 0)d.push("sub");if(i!==void 0)d.push("iss");for(let y of new Set(d.reverse()))if(!Object.hasOwn(n,y))throw new _(`missing required "${y}" claim`,n,y,"missing");if(i!==void 0&&!(Array.isArray(i)?i:[i]).includes(n.iss))Jt(n,"iss");if(s!==void 0&&n.sub!==s)Jt(n,"sub");if(c!==void 0&&!Zr(n.aud,typeof c==="string"?[c]:c))Jt(n,"aud");let{clockTolerance:u}=r,l=0;if(typeof u==="string")l=Ze(u);else if(u!==void 0){if(typeof u!=="number")throw TypeError("Invalid clockTolerance option type");l=u}ue("clockTolerance option",l);let{currentDate:K}=r,T=ue("currentDate option",xe(K===void 0?new Date:K)),g=Kt(n,"iat",p!==void 0),h=Kt(n,"nbf");if(h!==void 0){if(h>T+l)throw new _('"nbf" claim timestamp check failed',n,"nbf",fe)}let v=Kt(n,"exp");if(v!==void 0){if(v<=T-l)throw new sl('"exp" claim timestamp check failed',n,"exp",fe)}if(p!==void 0){let y=T-g,J=ue("maxTokenAge option",typeof p==="number"?p:Ze(p));if(y-l>J)throw new sl('"iat" claim timestamp check failed (too far in the past)',n,"iat",fe);if(y<-l)throw new _('"iat" claim timestamp check failed (it should be in the past)',n,"iat",fe)}return n}var yr;function z(e){return yr.get(e)}function me(e){let t=z(e);for(let r of["iat","nbf","exp"]){let n=t[r];if(typeof n==="number"&&!Number.isFinite(n))throw TypeError(`"${r}" claim must be a finite number`)}return ye.encode(JSON.stringify(t))}function Qe(e,t){return z(e)[t]}class te{constructor(e={}){if(!S(e))throw TypeError("JWT Claims Set MUST be an object");(yr||=new WeakMap).set(this,structuredClone(e))}setIssuer(e){return At("iss",e),z(this).iss=e,this}setSubject(e){return At("sub",e),z(this).sub=e,this}setAudience(e){return qr(e),z(this).aud=e,this}setJti(e){return At("jti",e),z(this).jti=e,this}setNotBefore(e){return z(this).nbf=xt(e,"setNotBefore"),this}setExpirationTime(e){return z(this).exp=xt(e,"setExpirationTime"),this}setIssuedAt(e){let t=z(this);if(e===void 0)t.iat=xe(new Date);else if(typeof e==="string")t.iat=ue("setIssuedAt",xe(new Date)+Ze(e));else t.iat=xt(e,"setIssuedAt");return this}}async function Bn(e,t,r){let n=await ur(e,fr(r),t);if(!n[2])throw new E("JWTs MUST NOT use unencoded payload");let a={payload:le(n[1],n[0],r),protectedHeader:n[1]};if(typeof t==="function")return{...a,key:n[3]};return a}async function yc(e,t,r){let n=await or(e,nr(r),t),o=n[1],a=le(o,n[0],r);for(let s of["iss","sub","aud"])if(o[s]!==void 0&&(s==="aud"?JSON.stringify(o.aud)!==JSON.stringify(a.aud):o[s]!==a[s]))throw new _(`replicated "${s}" claim header parameter mismatch`,a,s,"mismatch");let i={payload:a,protectedHeader:o};if(typeof t==="function")return{...i,key:n[2]};return i}function en(e){if(e===void 0)return[void 0,""];let t=pe(w,e);return[t[0],mr(t[1])]}function tn(e,t,r){return Fe(w,e),ce(e,N(w,se,r,e,t))}function rn(e){let t=e.alg;if(typeof t!=="string"||!t)throw new w('JWS "alg" (Algorithm) Header Parameter missing or invalid');return Ye(t)}async function nn(e,t,r,n){let o=A(b(e),b("."),t),a=await U(r,n,"sign");return mr(await cr(r,a,o))}async function hr(e,t,r,n,o){let[a,i]=en(t);if(!a)throw new w("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!tn(a,a,r))o();let c=rn(a),p=mr(e),d=await nn(i,b(p),c,n);return`${i}.${p}.${d}`}var on=te;class bc extends on{#e;setProtectedHeader(e){return Q(this.#e,"setProtectedHeader"),this.#e=e,this}async sign(e,t){return hr(me(this),this.#e,t?.crit,e,()=>{throw new E("JWTs MUST NOT use unencoded payload")})}}var an=te;class vc extends an{#e;#r;#n;#t;#o;#i;#a;setProtectedHeader(e){return Q(this.#t,"setProtectedHeader"),this.#t=e,this}setKeyManagementParameters(e){return Q(this.#n,"setKeyManagementParameters"),this.#n=e,this}setContentEncryptionKey(e){return Q(this.#e,"setContentEncryptionKey"),this.#e=e,this}setInitializationVector(e){return Q(this.#r,"setInitializationVector"),this.#r=e,this}replicateIssuerAsHeader(){return this.#o=!0,this}replicateSubjectAsHeader(){return this.#i=!0,this}replicateAudienceAsHeader(){return this.#a=!0,this}async encrypt(e,t){let r=me(this);if(this.#t&&(this.#o||this.#i||this.#a))this.#t={...this.#t,iss:this.#o?Qe(this,"iss"):void 0,sub:this.#i?Qe(this,"sub"):void 0,aud:this.#a?Qe(this,"aud"):void 0};let n=await ar([r,this.#t,void 0,void 0,void 0,this.#e,this.#r,this.#n,void 0,!1],e,t);return[n.protected,n.encrypted_key,n.iv,n.ciphertext,n.tag].join(".")}}var Wt='"alg" (Algorithm)';function Ct(e='JWK "alg" (Algorithm) Parameter'){throw new m(`Invalid or unsupported ${e} value`)}function Ke(e,t){return(typeof e==="string"?Ae[e]??mt[e]:void 0)??Ct(t)}function et(e){if(e!==void 0&&typeof e!=="boolean")throw TypeError('"extractable" option must be a boolean');return e}var Je=(e,t)=>{if(e.byteLength!==t.length)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},sn=(e)=>({data:e,pos:0}),vt=(e)=>{let t=e.data[e.pos++];if(t===void 0)throw Error("Unexpected end of ASN.1 input");return t},We=(e)=>{let t=vt(e);if(t&128){let r=t&127,n=0;for(let o=0;o<r;o++)n=n<<8|vt(e);return n}return t};var Ce=(e,t,r)=>{if(vt(e)!==t)throw Error(r)},wr=(e,t)=>{if(t<0||e.pos+t>e.data.length)throw Error("Unexpected end of ASN.1 input");let r=e.data.subarray(e.pos,e.pos+t);return e.pos+=t,r},cn=(e)=>{Ce(e,6,"Expected algorithm OID");let t=We(e);return wr(e,t)};function pn(e,t){if(Ce(e,48,`Invalid ${t==="spki"?"SPKI":"PKCS#8"} structure`),We(e),t==="pkcs8"){Ce(e,2,"Expected version field");let r=We(e);e.pos+=r}Ce(e,48,"Expected algorithm identifier"),We(e)}var dn=(e)=>{let t=cn(e);if(Je(t,[43,101,110]))return"X25519";if(!Je(t,[42,134,72,206,61,2,1]))throw Error("Unsupported key algorithm");Ce(e,6,"Expected curve OID");let r=We(e),n=wr(e,r);if(Je(n,[42,134,72,206,61,3,1,7]))return"P-256";if(Je(n,[43,129,4,0,34]))return"P-384";if(Je(n,[43,129,4,0,35]))return"P-521";throw Error("Unsupported named curve")},fn=async(e,t,r,n)=>{let o=et(n?.extractable),a=Ke(r,Wt);if(a.secret)Ct(Wt);let i=e==="spki",s;if(a.resolve)try{let c=sn(t);pn(c,e),s=a.resolve({crv:dn(c)})}catch{throw new m("Invalid or unsupported key format")}else s=a.subtle;return crypto.subtle.importKey(e,t,s,o??i,a.usages[i?0:1])},un=(e,t)=>ke(e.replace(t,"")),gr=(e,t,r)=>{let n=un(e,/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g);return fn("pkcs8",n,t,r)};function ln(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}async function mn(e){if(st(e))if(e.type==="secret")e=e.export();else return e.export({format:"jwk"});if(e instanceof Uint8Array)return{kty:"oct",k:mr(e)};if(!M(e))throw TypeError(B(e,"CryptoKey","KeyObject","Uint8Array"));if(!e.extractable)throw TypeError("non-extractable CryptoKey cannot be exported as a JWK");let{ext:t,key_ops:r,alg:n,use:o,...a}=ln(await crypto.subtle.exportKey("jwk",e));if(a.kty==="AKP")a.alg=n;return a}function Er(e){return mn(e)}var V=(e,t)=>{if(typeof e!=="string"||!e)throw new _e(`${t} missing or invalid`)};async function wc(e,t){let r;if(S(e)){if(r=oe(e),typeof r.kty!=="string")throw TypeError(B(e,"CryptoKey","KeyObject","JSON Web Key"))}else if(Re(e))r=oe(await Er(e));else throw TypeError(B(e,"CryptoKey","KeyObject","JSON Web Key"));if(t??="sha256",t!=="sha256"&&t!=="sha384"&&t!=="sha512")throw TypeError('digestAlgorithm must one of "sha256", "sha384", or "sha512"');let n;switch(r.kty){case"AKP":V(r.alg,'"alg" (Algorithm) Parameter'),V(r.pub,'"pub" (Public key) Parameter'),n={alg:r.alg,kty:r.kty,pub:r.pub};break;case"EC":V(r.crv,'"crv" (Curve) Parameter'),V(r.x,'"x" (X Coordinate) Parameter'),V(r.y,'"y" (Y Coordinate) Parameter'),n={crv:r.crv,kty:r.kty,x:r.x,y:r.y};break;case"OKP":V(r.crv,'"crv" (Subtype of Key Pair) Parameter'),V(r.x,'"x" (Public Key) Parameter'),n={crv:r.crv,kty:r.kty,x:r.x};break;case"RSA":V(r.e,'"e" (Exponent) Parameter'),V(r.n,'"n" (Modulus) Parameter'),n={e:r.e,kty:r.kty,n:r.n};break;case"oct":if(typeof r.k!=="string")throw new _e('"k" (Key Value) Parameter missing or invalid');n={k:r.k,kty:r.kty};break;default:throw new m('"kty" (Key Type) Parameter missing or unsupported')}let o=b(JSON.stringify(n));return mr(await Me(t,o))}function yn(e,t,r,n){let{kty:o,key_ops:a,ext:i,kid:s,alg:c,use:p,crv:d}=oe(e),u=Array.isArray(a)?[...a]:a;return(i===void 0||typeof i==="boolean")&&(u===void 0||Array.isArray(u)&&u.every((l,K)=>typeof l==="string"&&u.indexOf(l)===K)&&u.includes("verify"))&&t.kty.includes(o)&&(n===void 0||typeof n==="string"&&n===s)&&(c===void 0?o!=="AKP":r===c)&&(p===void 0||p==="sig")&&(!t.crv||d===t.crv)}async function br(e,t,r){let n=e.get(t)||e.set(t,{}).get(t),{alg:o}=r;if(n[o]===void 0){let a=await j(r,{...t,alg:o,ext:!0});if(a.type!=="public")throw new De("JSON Web Key Set members must be public keys");n[o]=a}return n[o]}function Mu(e){let t;try{t=structuredClone(e)}catch{}if(!Be(t))throw new De("JSON Web Key Set malformed");let r=new WeakMap;return Object.defineProperty(async(o,a)=>{let{alg:i,kid:s}={...o,...a?.header},c=typeof i==="string"?Ae[i]:void 0;if(!c||c.secret)throw new m('Unsupported "alg" value for a JSON Web Key Set');let p=t.keys.filter((l)=>yn(l,c,i,s)),{0:d,length:u}=p;if(!u)throw new we;if(u!==1){let l=new ot;throw l[Symbol.asyncIterator]=async function*(){for(let K of p)try{yield await br(r,K,c)}catch{}},l}return br(r,d,c)},"jwks",{value:()=>structuredClone(t)})}function hn(){return typeof WebSocketPair<"u"||typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"||typeof EdgeRuntime<"u"&&EdgeRuntime==="vercel"}var Tt;if(typeof navigator>"u"||!navigator.userAgent?.startsWith?.("Mozilla/5.0 "))Tt="jose/v6.2.10";var Ar=Symbol();async function wn(e,t,r,n=fetch){let o=await n(e,{method:"GET",signal:r,redirect:"manual",headers:t}).catch((a)=>{if(a.name==="TimeoutError")throw new it;throw a});if(o.status!==200)throw new x("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await o.json()}catch{throw new x("Failed to parse the JSON Web Key Set HTTP response as JSON")}}var xr=Symbol();function ve(e,t){return Number.isFinite(e)&&Date.now()<e+t}function Sr(e,t,r){if(Number.isNaN(e))throw TypeError(`"${r}" option must not be NaN`);return typeof e==="number"?e:t}function ku(e,t){if(!(e instanceof URL))throw TypeError("url must be an instance of URL");let r=new URL(e.href).href,n=t??{},o=n.timeoutDuration;if(typeof o==="number"&&(!Number.isInteger(o)||o<0))throw TypeError('"timeoutDuration" option must be a non-negative integer');let a=typeof o==="number"?o:5000,i=Sr(n.cooldownDuration,30000,"cooldownDuration"),s=Sr(n.cacheMaxAge,600000,"cacheMaxAge"),c=new Headers(n.headers);if(Tt&&!c.has("User-Agent"))c.set("User-Agent",Tt);if(!c.has("accept"))c.set("accept","application/json, application/jwk-set+json");let p=n[Ar],d=n[xr],u,l,K=0,T=0,g;if(d&&typeof d==="object"){let{uat:y,jwks:J}=d;if(ve(y,s)&&Be(J))u=y,g=Mu(J)}let h=async()=>{if(l&&hn())l=void 0;if(!l){let y=++K,J=l=wn(r,c,AbortSignal.timeout(a),p).then((P)=>{let H=Mu(P);if(y<=T)return;g=H;let O=Date.now();if(d)d.uat=O,d.jwks=P;u=O,T=y}).finally(()=>{if(l===J)l=void 0})}await l};return Object.defineProperties(async(y,J)=>{if(!g||!ve(u,s))await h();try{return await g(y,J)}catch(P){if(P instanceof we&&!ve(u,i))return await h(),g(y,J);throw P}},{coolingDown:{get:()=>ve(u,i),enumerable:!0},fresh:{get:()=>ve(u,s),enumerable:!0},reload:{value:h,enumerable:!0},reloading:{get:()=>!!l,enumerable:!0},jwks:{value:()=>g?.jwks(),enumerable:!0}})}var gn=te;class km extends gn{encode(){let e=mr(JSON.stringify({alg:"none"})),t=mr(me(this));return`${e}.${t}.`}static decode(e,t){if(typeof e!=="string")throw new E("Unsecured JWT must be a string");let{0:r,1:n,2:o,length:a}=e.split(".");if(a!==3||o!=="")throw new E("Invalid Unsecured JWT");let i,s;try{i=F(r,w,"JWS Protected Header is invalid");let p=N(w,se,void 0,i,i);s=ce(i,p)}catch(p){if(!(p instanceof w))throw p;throw new E("Invalid Unsecured JWT",{cause:p})}if(i.alg!=="none")throw new E("Invalid Unsecured JWT");if(!s)throw new E("JWTs MUST NOT use unencoded payload");return{payload:le(i,W(n,"payload",E),t),header:i}}}async function n0(e,t,r){if(typeof e!=="string"||e.indexOf("-----BEGIN PRIVATE KEY-----")!==0)throw TypeError('"pkcs8" must be PKCS#8 formatted string');return gr(e,t,r)}async function Ns(e,t,r){if(!S(e))throw TypeError("JWK must be an object");let n=$e(e),o=et(r?.extractable),{alg:a}=n;t??=a;let i=o??n.ext;if(n.kty!=="oct"&&!t)throw TypeError('"alg" argument is required when "jwk.alg" is not present');switch(n.kty){case"oct":if(typeof n.k!=="string")throw TypeError('missing "k" (Key Value) Parameter value');return D(n.k);case"AKP":{if(typeof a!=="string"||!a)throw TypeError('missing "alg" (Algorithm) Parameter value');if(t!==a)throw TypeError("JWK alg and alg option value mismatch");return j(Ke(t),{...n,ext:i})}case"RSA":case"EC":case"OKP":return j(Ke(t),{...n,alg:t,ext:i});default:throw new m('Unsupported "kty" (Key Type) Parameter value')}}function Ho(e){let t;if(typeof e==="string"){let n=e.split(".");if(n.length===3||n.length===5)[t]=n}else if(typeof e==="object"&&e)if("protected"in e)t=e.protected;else throw TypeError("Token does not contain a Protected Header");let r="Invalid Token or Protected Header formatting";if(typeof t!=="string"||!t)throw TypeError(r);return F(t,TypeError,r)}function Qr(e){if(typeof e!=="string")throw new E("JWTs must use Compact JWS serialization, JWT must be a string");let{1:t,length:r}=e.split(".");if(r===5)throw new E("Only JWTs using Compact JWS serialization can be decoded");if(r!==3)throw new E("Invalid JWT");if(!t)throw new E("JWTs must contain a payload");let n;try{n=D(t)}catch{throw new E("Failed to base64url decode the payload")}let o;try{o=JSON.parse(re.decode(n))}catch{throw new E("Failed to parse the decoded payload as JSON")}if(!S(o))throw new E("Invalid JWT Claims Set");return o}export{sl,mr,yf,Bn,yc,bc,vc,wc,Mu,ku,km,n0,Ns,Ho,Qr};
|
package/bin/chunk-k7sjpke6.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{m,_,u,E,L,t,o,G,B,g,O,Dr,ve,It,wt,js,pe,S,ge,Ae,_e,K,Re,na,vh,ht,Kc,Wc,Ph,Hb,$b,Wh,Yh,Jh,gp,Ap,_p,yp,kl,Ig,wp,xp,Zg,Bg,Zp,lA,TA,tm,j1,sm,im,nt,ot,st,it,at,lt,ct,ut,de,ce,me,He,ue,Et,z,Ft,Nt,M,Lr,Cn,mm}from"./chunk-p1d500sf.js";import{hu,gu,Ka,Wa,Au}from"./chunk-sdp9w627.js";import{Uo}from"./chunk-7rycq6wb.js";import{po}from"./chunk-1eqw2dpx.js";E();var Ee=[];function Wl({teamId:r,projectId:y,assetId:p,folders:a,files:l,totalFolders:Se,totalFiles:Me,totalFoldersSize:ze,totalFilesSize:Ue,selectedItem:J,selectedIds:D,onItemSelect:X,onItemDoubleClick:Y,onSaveField:Be,onClearSelection:qe,fetchNextFoldersPage:Z,hasNextFoldersPage:ee,isFetchingNextFoldersPage:b,fetchNextFilesPage:te,hasNextFilesPage:oe,isFetchingNextFilesPage:x,isRecentlyDeleted:k=!1,isRecents:C=!1,isLoading:se=!1,isShareView:q=!1,isPublic:ie=!1,shareId:$e,allowDownload:re=!0}){let d=G(),{canEdit:N,canAdmin:Oe}=Ft(y),ne=_(null),ae=_(null),[W,We]=u(!0),[j,je]=u(!0),[Qe,F]=u(!1),[A,le]=u(""),[Ke,Q]=u(!1),fe=Se??a.length,he=Me??l.length,we=ze??(a.length>0?a.reduce((e,s)=>e+(s.sizeByte||0),0):-1),De=Ue??(l.length>0?l.reduce((e,s)=>e+(s.sizeByte||0),0):-1),Le=we>-1,Pe=De>-1,ye=(e,s)=>{if(s)return e===1?Ap({count:e}):gp({count:e});else return e===1?yp({count:e}):_p({count:e})},{editingItemId:be,setEditingItemId:xe,handleAction:ke,onRenameSubmit:Ce,isDeleteDialogOpen:Ve,setIsDeleteDialogOpen:Ge,confirmDelete:Je,isDownloadDialogOpen:Xe,setIsDownloadDialogOpen:H,isLoadingLinks:I,resolvedFiles:Ne,startDownload:Ye}=Au({teamId:r,projectId:y,assetId:p,folders:a,files:l,selectedIds:D,isPublic:ie,shareId:$e}),{ref:Ze,inView:Fe}=Nt();m(()=>{if(Fe){if(ee&&!b)Z();else if(oe&&!x)te()}},[Fe,ee,b,oe,x,Z,te]);let et=Cn((e)=>e.startTask),tt=g.api.teams[":teamId"].upload.tasks.$post,{mutate:rt}=B({mutationFn:async(e)=>{let s=await tt(e);if(!s.ok)throw Error("Failed to create upload task");return await s.json()},onMutate:()=>({files:[...Ee]}),onSuccess:async(e,s,n)=>{let f=n?.files||[],h=f.map((i)=>{let w=e.createdAssets?.find((c)=>c.tempId===i.id),R=e.presignedUrls?.find((c)=>c.id===i.id);return{fileId:w?.assetId||R?.fileId||i.id,name:i.file.name,size:i.file.size}}).filter((i)=>!!i.fileId),v=f.filter((i)=>!i.file.name.startsWith(".")),T=v.length===1?v[0].file.name:`${v.length} Items`;if(e.taskId)et(e.taskId,T,h);d.invalidateQueries({queryKey:["search",r,p]}),d.invalidateQueries({queryKey:["teams",r,"upload","tasks"]}),await gu({files:f,taskId:e.taskId,teamId:r,storageBackend:e.storageBackend||"local",createdAssets:e.createdAssets,presignedUrls:e.presignedUrls,onFileFinished:async()=>{await d.invalidateQueries({queryKey:["search",r,p]})}}),d.invalidateQueries({queryKey:["search",r,p]}),d.invalidateQueries({queryKey:["teams",r,"upload","tasks"]})}}),Ie=(e)=>{if(!e||e.length===0)return;let s=[],n=[],f=new Map;for(let h of e){let v=(h.webkitRelativePath||h.name).split("/");if(v.some((U)=>U.startsWith(".")))continue;let T=v.pop(),i=n,w="";for(let U of v)if(w=`${w}/${U}`,!f.has(w)){let V=[],vt={name:U,type:"folder",id:Uo(),children:V,size:0};i.push(vt),f.set(w,V),i=V}else i=f.get(w);let R={file:h,id:Uo()};s.push(R);let c=h.type;if(T.toLowerCase().endsWith(".wma")&&c?.startsWith("video/"))c=c.replace(/^video\//,"audio/");i.push({name:T,size:h.size,type:"file",id:R.id,children:[],mediaType:c})}Ee=s,rt({param:{teamId:r},json:{parentId:p,files:n}})},dt=g.api.folders.$post,{mutate:mt,isPending:Te}=B({mutationFn:async(e)=>{let s=await dt({json:{name:e,parentId:p}});if(!s.ok)throw Error("Failed to create folder");return await s.json()},onSuccess:()=>{M.success(kl()),F(!1),le(""),d.invalidateQueries({queryKey:["search",r,p]}),d.invalidateQueries({queryKey:["folders"]})},onError:(e)=>{M.error(`Error: ${e.message}`)}}),{mutate:pt,isPending:P}=B({mutationFn:async()=>{let e=await g.api.projects[":projectId"]["empty-trash"].$post({param:{projectId:y}});if(!e.ok)throw Error("Failed to empty trash");return await e.json()},onSuccess:()=>{M.success(j1()),d.invalidateQueries({queryKey:["projects",y,"recently-deleted"]}),qe(),Q(!1)},onError:(e)=>{M.error(`Error: ${e.message}`)}}),ft=(e)=>{if(e.preventDefault(),!A.trim())return;mt(A.trim())},gt=!se&&a.length===0&&l.length===0&&!b&&!x;return o("div",{className:"flex-1 flex flex-col min-h-0 bg-background overflow-hidden relative",children:[N&&o(L,{children:[t("input",{type:"file",ref:ne,multiple:!0,className:"hidden",onChange:(e)=>{if(e.target.files)Ie(e.target.files)}}),t("input",{type:"file",ref:ae,multiple:!0,webkitdirectory:"true",className:"hidden",onChange:(e)=>{if(e.target.files)Ie(e.target.files)}})]}),k&&o("div",{className:"flex items-center justify-between px-4 py-2.5 bg-muted/20 border-b border-border text-sm shrink-0",children:[o("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t(Dr,{className:"h-4 w-4 text-amber-500 shrink-0"}),t("span",{className:"text-xs",children:Zp()})]}),Oe&&t(S,{variant:"destructive",size:"sm",disabled:P||a.length===0&&l.length===0,onClick:()=>Q(!0),className:"h-7 px-2.5 text-xs font-medium bg-destructive/10 text-destructive border border-destructive/20 hover:bg-destructive hover:text-destructive-foreground",children:"Delete"})]}),o("div",{className:"flex-1 overflow-y-auto min-h-0 p-3 pb-24",children:[se&&a.length===0&&l.length===0?t(mm,{}):o("div",{className:"max-w-lg mx-auto w-full",children:[fe>0&&o("div",{className:"mb-4",children:[o("button",{onClick:()=>We(!W),className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground mb-3 font-medium select-none cursor-pointer",children:[W?t(ve,{className:"h-4 w-4"}):t(It,{className:"h-4 w-4"}),o("span",{children:[ye(fe,!1),Le?` • ${Lr(we)}`:""]})]}),W&&t("div",{className:"grid grid-cols-1 gap-4 w-full",children:a.map((e)=>t(Wa,{item:e,isSelected:J?.id===e.id,isChecked:D.has(e.id),isEditing:be===e.id,onSelect:X,onDoubleClick:Y,onContextMenu:()=>{},onDragStart:()=>{},onDrop:()=>{},onRename:(s)=>Ce(e,s),onFinishEditing:()=>xe(null),onAction:(s,n)=>ke(s,n),isRecentlyDeleted:k,isRecents:C,selectedCount:D.size,canEdit:N,isShareView:q,allowDownload:re},e.id))})]}),he>0&&o("div",{className:"mb-4",children:[o("button",{onClick:()=>je(!j),className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground mb-3 font-medium select-none cursor-pointer",children:[j?t(ve,{className:"h-4 w-4"}):t(It,{className:"h-4 w-4"}),o("span",{children:[ye(he,!0),Pe?` • ${Lr(De)}`:""]})]}),j&&t("div",{className:"grid grid-cols-1 gap-4 w-full",children:l.map((e)=>t(Ka,{teamId:r,item:e,isSelected:J?.id===e.id,isChecked:D.has(e.id),isEditing:be===e.id,onSelect:X,onDoubleClick:Y,onContextMenu:()=>{},onDragStart:()=>{},onDrop:()=>{},onRename:(s)=>Ce(e,s),onFinishEditing:()=>xe(null),onSaveField:(s,n)=>Be?.(e.id,s,n),fields:[],onAction:(s,n)=>ke(s,n),isRecentlyDeleted:k,isRecents:C,selectedCount:D.size,canEdit:N,isShareView:q,allowDownload:re},e.id))})]})]}),gt&&t("div",{className:"flex flex-col items-center justify-center h-64 text-sm text-muted-foreground p-6 text-center",children:C?o("div",{className:"flex flex-col items-center gap-2",children:[t(js,{className:"h-10 w-10 text-muted-foreground/40 mb-1"}),t("p",{className:"font-medium text-foreground",children:wp()}),t("p",{className:"text-xs text-muted-foreground",children:xp()})]}):t("span",{children:tm()})}),t("div",{ref:Ze,className:"py-4 flex justify-center items-center min-h-6",children:(b||x)&&t(O,{className:"h-5 w-5 animate-spin text-muted-foreground"})})]}),N&&!k&&!C&&!q&&!ie&&t("div",{className:"fixed bottom-6 right-6 z-30",children:o(ge,{modal:!1,children:[t(Ae,{asChild:!0,children:t(S,{size:"icon",className:"h-14 w-14 rounded-full bg-primary text-primary-foreground shadow-lg shadow-primary/25 hover:bg-primary/90 flex items-center justify-center","aria-label":"Actions",children:t(pe,{className:"h-6 w-6"})})}),o(_e,{align:"end",side:"top",className:"w-48 mb-2",children:[o(K,{onClick:()=>ne.current?.click(),className:"flex items-center gap-2.5 py-2 cursor-pointer",children:[t(po,{className:"h-4 w-4"}),t("span",{children:sm()})]}),o(K,{onClick:()=>ae.current?.click(),className:"flex items-center gap-2.5 py-2 cursor-pointer",children:[t(po,{className:"h-4 w-4"}),t("span",{children:im()})]}),o(K,{onClick:()=>F(!0),className:"flex items-center gap-2.5 py-2 cursor-pointer",children:[t(hu,{className:"h-4 w-4"}),t("span",{children:kl()})]})]})]})}),t(de,{open:Qe,onOpenChange:F,children:t(ce,{className:"sm:max-w-md",children:o("form",{onSubmit:ft,children:[o(me,{children:[t(ue,{children:kl()}),t(Et,{children:Yh()})]}),t("div",{className:"py-4",children:t(z,{autoFocus:!0,placeholder:Yh(),value:A,onChange:(e)=>le(e.target.value)})}),o(He,{children:[t(S,{type:"button",variant:"outline",onClick:()=>F(!1),children:Re()}),o(S,{type:"submit",disabled:!A.trim()||Te,children:[Te?t(O,{className:"h-4 w-4 animate-spin mr-2"}):null,na()]})]})]})})}),t(nt,{open:Ve,onOpenChange:Ge,children:o(ot,{children:[o(st,{children:[t(at,{children:Wc()}),t(lt,{children:Kc()})]}),o(it,{children:[t(ut,{children:Re()}),t(ct,{onClick:()=>Je(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:ht()})]})]})}),t(nt,{open:Ke,onOpenChange:Q,children:o(ot,{children:[o(st,{children:[t(at,{children:$b()}),t(lt,{children:Hb()})]}),o(it,{children:[t(ut,{children:Re()}),t(ct,{onClick:(e)=>{e.preventDefault(),pt()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",disabled:P,children:P?"Deleting...":ht()})]})]})}),t(de,{open:Xe,onOpenChange:H,children:o(ce,{className:"sm:max-w-md",children:[o(me,{children:[t(ue,{children:I?Zg():vh()}),t(Et,{children:I?lA():Wh()})]}),I?o("div",{className:"space-y-4 py-6 flex flex-col items-center justify-center",children:[t(O,{className:"h-8 w-8 animate-spin text-primary"}),t("span",{className:"text-sm font-medium text-muted-foreground mt-2",children:Bg()})]}):o("div",{className:"space-y-4 py-2",children:[t("div",{className:"text-sm text-muted-foreground",children:Ph({count:Ne.length})}),o("div",{className:"flex items-start gap-3 p-3 text-sm rounded-lg bg-amber-50 dark:bg-amber-950/30 text-amber-800 dark:text-amber-300 border border-amber-200 dark:border-amber-900/30",children:[t(Dr,{className:"h-5 w-5 shrink-0 mt-0.5"}),o("div",{children:[t("p",{className:"font-semibold",children:Ig()}),t("p",{className:"mt-0.5 text-xs text-amber-700/90 dark:text-amber-400/90",children:Jh()})]})]})]}),t(He,{children:!I?o(L,{children:[t(S,{variant:"outline",onClick:()=>H(!1),children:Re()}),o(S,{onClick:Ye,className:"gap-2",disabled:Ne.length===0,children:[t(wt,{className:"h-4 w-4"}),TA()]})]}):t(S,{variant:"outline",onClick:()=>H(!1),children:Re()})})]})})]})}
|
|
2
|
-
export{Wl};
|