@stacksjs/bun-router 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-03m2j6h7.js +2 -0
- package/dist/chunk-08cw7ejr.js +3 -0
- package/dist/chunk-0e4g0fyv.js +62 -0
- package/dist/chunk-0mmn02yw.js +2 -0
- package/dist/chunk-126c9qm3.js +2 -0
- package/dist/chunk-12p13817.js +2 -0
- package/dist/chunk-14v65c37.js +4 -0
- package/dist/{chunk-s3dn1kwx.js → chunk-1b6a7t3v.js} +2 -2
- package/dist/chunk-1wenkmk0.js +2 -0
- package/dist/chunk-2152npfd.js +2 -0
- package/dist/chunk-26w23krx.js +2 -0
- package/dist/chunk-2g8m379z.js +10 -0
- package/dist/{chunk-5mxby3fd.js → chunk-2rr178et.js} +2 -2
- package/dist/chunk-2w8f3swz.js +29 -0
- package/dist/chunk-3y4gaz7v.js +82 -0
- package/dist/chunk-4r1x4afz.js +12 -0
- package/dist/chunk-4wyw66zk.js +2 -0
- package/dist/chunk-4z5sf8ag.js +2 -0
- package/dist/{chunk-krkchy8v.js → chunk-58tfvayh.js} +3 -3
- package/dist/{chunk-ex5fkjah.js → chunk-5dp83qcx.js} +43 -43
- package/dist/chunk-5f0d9j9a.js +2 -0
- package/dist/{chunk-zhx0hxdd.js → chunk-5z52b0fc.js} +7 -7
- package/dist/{chunk-kc659vhx.js → chunk-5zrnk2kq.js} +3 -3
- package/dist/chunk-6dmqtdnq.js +2 -0
- package/dist/{chunk-5s1pr62n.js → chunk-6e91956t.js} +2 -2
- package/dist/{chunk-jrf5a2ap.js → chunk-6rv8w5jk.js} +1 -1
- package/dist/{chunk-5n0ckcmc.js → chunk-6x1feysm.js} +2 -2
- package/dist/chunk-7y72hm1x.js +2 -0
- package/dist/{chunk-zetqzgf3.js → chunk-8hbhfh6b.js} +6 -6
- package/dist/{chunk-5ncn73tp.js → chunk-8kfzygg5.js} +2 -2
- package/dist/chunk-8wydx2we.js +2 -0
- package/dist/chunk-8zjnjvv7.js +2 -0
- package/dist/chunk-988h4bzr.js +2 -0
- package/dist/chunk-9b6a58ac.js +2 -0
- package/dist/chunk-a8fcaywb.js +2 -0
- package/dist/chunk-bfjwn7yg.js +2 -0
- package/dist/chunk-bp2522mm.js +2 -0
- package/dist/chunk-bswe62q4.js +48 -0
- package/dist/chunk-c3v796c8.js +943 -0
- package/dist/chunk-ccqmwdry.js +2 -0
- package/dist/chunk-ck0crwnx.js +2 -0
- package/dist/chunk-cqgkxcb4.js +2 -0
- package/dist/chunk-dntnakjy.js +2 -0
- package/dist/{chunk-67wgad4f.js → chunk-ettdpnrw.js} +2 -2
- package/dist/{chunk-csfrpsp7.js → chunk-ezqwq17j.js} +10 -10
- package/dist/chunk-ezx3qsez.js +2 -0
- package/dist/{chunk-73k79n7q.js → chunk-f72nnjy4.js} +360 -360
- package/dist/chunk-fna5n0ey.js +246 -0
- package/dist/chunk-fqhckdt8.js +2 -0
- package/dist/chunk-fr6hbx25.js +2 -0
- package/dist/{chunk-vr10sbbh.js → chunk-g9cwng6w.js} +1 -1
- package/dist/chunk-gd3za5x0.js +2 -0
- package/dist/chunk-gf28608k.js +2 -0
- package/dist/chunk-h1dj6v8q.js +3 -0
- package/dist/chunk-hjxe7k2g.js +2 -0
- package/dist/chunk-hrkgznbn.js +2 -0
- package/dist/chunk-j6h5v0br.js +2 -0
- package/dist/{chunk-0gjq8ttx.js → chunk-mgb01qdv.js} +2 -2
- package/dist/chunk-n24c9whp.js +2 -0
- package/dist/{chunk-kxp888dn.js → chunk-n2j24b0h.js} +244 -244
- package/dist/{chunk-vv3gb1m5.js → chunk-nhmtg01n.js} +2 -2
- package/dist/chunk-p0qhpnqh.js +70 -0
- package/dist/chunk-p0w1x8y2.js +3 -0
- package/dist/{chunk-9ght4n4r.js → chunk-p3dk1w2w.js} +11 -11
- package/dist/{chunk-6sjvhy5f.js → chunk-q4e9pxs7.js} +2 -2
- package/dist/chunk-q5dv1kyy.js +2 -0
- package/dist/chunk-qnqgf9tq.js +2 -0
- package/dist/chunk-qvwy1808.js +898 -0
- package/dist/{chunk-5s0pnsd6.js → chunk-r18f77vc.js} +4 -4
- package/dist/chunk-r63za1mr.js +2 -0
- package/dist/{chunk-6s1kbajm.js → chunk-rft8gw92.js} +1 -1
- package/dist/chunk-ryvmyskt.js +4211 -0
- package/dist/chunk-sa6mx308.js +2 -0
- package/dist/chunk-va0pc7hx.js +2 -0
- package/dist/chunk-vcp8dnjq.js +412 -0
- package/dist/chunk-vg1erq1q.js +2 -0
- package/dist/{chunk-hmgedrmr.js → chunk-w0jv49ch.js} +3 -3
- package/dist/{chunk-0t5vz87j.js → chunk-wm805tte.js} +19 -19
- package/dist/chunk-xj9h6mc9.js +2 -0
- package/dist/chunk-ytvzwrq3.js +51 -0
- package/dist/{chunk-w4r464v5.js → chunk-zde7ebc4.js} +2 -2
- package/dist/chunk-zmqsv2xy.js +2 -0
- package/dist/cli.js +57 -66
- package/dist/container/index.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +29 -29
- package/dist/typed/client.d.ts +89 -0
- package/dist/typed/contract.d.ts +34 -0
- package/dist/typed/endpoint.d.ts +90 -0
- package/dist/typed/index.d.ts +14 -0
- package/dist/typed/router.d.ts +141 -0
- package/package.json +1 -1
- package/dist/chunk-30rkn2ym.js +0 -2
- package/dist/chunk-38cmrard.js +0 -2
- package/dist/chunk-3qna6dwd.js +0 -2
- package/dist/chunk-4d5fmta0.js +0 -2
- package/dist/chunk-4x3b4b4q.js +0 -2
- package/dist/chunk-6xed4va1.js +0 -2
- package/dist/chunk-748n6ydj.js +0 -2
- package/dist/chunk-7rsf8tes.js +0 -898
- package/dist/chunk-8aspmtf1.js +0 -2
- package/dist/chunk-8yfdg595.js +0 -2
- package/dist/chunk-90eze7av.js +0 -3
- package/dist/chunk-9dvwyej7.js +0 -2
- package/dist/chunk-a2w45krb.js +0 -2
- package/dist/chunk-a547f2ab.js +0 -48
- package/dist/chunk-bqdycvtc.js +0 -2
- package/dist/chunk-cd03rk3x.js +0 -2
- package/dist/chunk-ct0m17q5.js +0 -2
- package/dist/chunk-dhbvvr5h.js +0 -2
- package/dist/chunk-dhptcsya.js +0 -943
- package/dist/chunk-dq93zag9.js +0 -2
- package/dist/chunk-edrtesh7.js +0 -2
- package/dist/chunk-ejcws37w.js +0 -2
- package/dist/chunk-ex890p45.js +0 -51
- package/dist/chunk-f69cpnhw.js +0 -2
- package/dist/chunk-fjf53b44.js +0 -2
- package/dist/chunk-fjzye4qj.js +0 -2
- package/dist/chunk-gfd23b6t.js +0 -2
- package/dist/chunk-habv0vef.js +0 -12
- package/dist/chunk-hz6fc788.js +0 -2
- package/dist/chunk-jff6j9y3.js +0 -10
- package/dist/chunk-jmeb7n8k.js +0 -70
- package/dist/chunk-jy2jhcpy.js +0 -246
- package/dist/chunk-m249t3je.js +0 -3
- package/dist/chunk-m9yabnjx.js +0 -2
- package/dist/chunk-mekrq9wd.js +0 -2
- package/dist/chunk-mmxv535f.js +0 -82
- package/dist/chunk-mypn7jss.js +0 -2
- package/dist/chunk-n18x1k3c.js +0 -2
- package/dist/chunk-nkddjzsa.js +0 -2
- package/dist/chunk-pjmhqmr9.js +0 -2
- package/dist/chunk-qyrnsaq1.js +0 -2
- package/dist/chunk-r19ff2qm.js +0 -62
- package/dist/chunk-r338fssq.js +0 -2
- package/dist/chunk-s36z58x2.js +0 -29
- package/dist/chunk-s79dd325.js +0 -471
- package/dist/chunk-ta38j9em.js +0 -2
- package/dist/chunk-tpfgntwj.js +0 -4211
- package/dist/chunk-vw8rwv6e.js +0 -2
- package/dist/chunk-wcrqs5z9.js +0 -2
- package/dist/chunk-x6d1rmwa.js +0 -2
- package/dist/chunk-x7ft15zz.js +0 -2
- package/dist/chunk-x8trwn7j.js +0 -3
- package/dist/chunk-xhepdj1f.js +0 -2
- package/dist/chunk-xv2em0q4.js +0 -4
- package/dist/chunk-ypw6g0te.js +0 -2
- package/dist/chunk-z8szsm21.js +0 -2
- package/dist/chunk-zfbh14qe.js +0 -2
- /package/dist/{chunk-a3wahyg7.js → chunk-nf3kv7kv.js} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$m as b,_m as a,an as c,bn as d,cn as e,dn as f,en as g,fn as h,gn as i,hn as j,in as k}from"./chunk-2g8m379z.js";import"./chunk-p0qhpnqh.js";import"./chunk-nf3kv7kv.js";export{f as buildCrosswindCSS,i as extractClassNames,j as generateCrosswindCSS,h as getCachedCSS,a as getCrosswindServeAsset,k as injectCrosswindCSS,b as loadCrosswind,e as loadCrosswindConfig,g as rebuildCrosswindCSS,d as resetCrosswindCache,c as resetCssCache};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Zu as b}from"./chunk-
|
|
2
|
+
import{Zu as b}from"./chunk-nf3kv7kv.js";var n;async function f(){if(n!==void 0)return n;try{n=await import("bun-queue")}catch{n=null}return n}class u{channel;event;data;excludeSocketId;connection;queue;delay;tries;timeout;backoff;constructor(e,t,i,a){this.channel=e,this.event=t,this.data=i,this.excludeSocketId=a,this.tries=3,this.timeout=30000,this.backoff=[1000,5000]}async handle(e){try{e.broadcast(this.channel,this.event,this.data,this.excludeSocketId)}catch(t){throw console.error(`Failed to broadcast to ${this.channel}:`,t),t}}failed(e){console.error(`BroadcastJob failed for channel ${this.channel}:`,e.message)}}class c extends u{constructor(e,t,i,a,s){super(e,t,i,s);this.delay=a}}class d{channel;event;dataFn;cronExpression;connection;queue;delay;tries;timeout;constructor(e,t,i,a){this.channel=e,this.event=t,this.dataFn=i,this.cronExpression=a,this.tries=3,this.timeout=30000}async handle(e){try{let t=typeof this.dataFn==="function"?await this.dataFn():this.dataFn;e.broadcast(this.channel,this.event,t)}catch(t){throw console.error(`Failed to broadcast recurring event to ${this.channel}:`,t),t}}failed(e){console.error(`RecurringBroadcastJob failed for channel ${this.channel}:`,e.message)}}class g{queue=null;server;config;deadLetterQueue;constructor(e,t){if(this.server=e,this.config={enabled:t?.enabled??!1,connection:t?.connection||"default",defaultQueue:t?.defaultQueue||"broadcasts",retry:{attempts:t?.retry?.attempts??3,backoff:t?.retry?.backoff??{type:"exponential",delay:1000}},deadLetter:{enabled:t?.deadLetter?.enabled??!0,maxRetries:t?.deadLetter?.maxRetries??3}},this.config.enabled)this.initializeQueue()}async initializeQueue(){let e=await f();if(!e?.getQueueManager){console.warn("bun-queue is not installed. Queue features will be disabled."),this.config.enabled=!1;return}try{let t=e.getQueueManager();if(this.queue=t.connection(this.config.connection).queue(this.config.defaultQueue),this.config.deadLetter.enabled)this.deadLetterQueue=this.queue.getDeadLetterQueue();this.queue.processJobs(10),console.log(`\u2713 Broadcasting queue initialized: ${this.config.defaultQueue}`)}catch(t){console.error("Failed to initialize broadcasting queue:",t),this.config.enabled=!1}}async queueBroadcast(e,t,i,a){if(!this.isEnabled())throw Error("Queue system is not enabled");let s=Array.isArray(e)?e:[e],r=[];for(let o of s){let l=a?.delay?new c(o,t,i,a.delay,a?.excludeSocketId):new u(o,t,i,a?.excludeSocketId),h=await this.queue.dispatchJob(l,this.server);r.push(h)}return s.length===1?r[0]:r}async scheduleRecurringBroadcast(e,t,i,a){if(!this.isEnabled())throw Error("Queue system is not enabled");let s=new d(e,t,i,a);return await this.queue.scheduleCron({cron:a,data:{job:s,server:this.server},name:`recurring-broadcast-${e}-${t}`})}async cancelRecurringBroadcast(e){if(!this.isEnabled())return!1;return this.queue.unscheduleCron(e)}async getStats(){if(!this.isEnabled())return null;let e=await this.queue.getJobCounts(),t=this.deadLetterQueue?await this.deadLetterQueue.getJobs():[];return{waiting:e.waiting,active:e.active,completed:e.completed,failed:e.failed,delayed:e.delayed,deadLetter:t.length}}async getFailedJobs(e=0,t=-1){if(!this.isEnabled())return[];return this.queue.getJobs("failed",e,t)}async getDeadLetterJobs(e=0,t=-1){if(!this.isEnabled()||!this.deadLetterQueue)return[];return this.deadLetterQueue.getJobs(e,t)}async retryJob(e){if(!this.isEnabled())return null;return this.queue.retryJob(e)}async republishDeadLetterJob(e,t=!0){if(!this.isEnabled()||!this.deadLetterQueue)return null;return this.queue.republishDeadLetterJob(e,{resetRetries:t})}async clearFailedJobs(){if(!this.isEnabled())return;let e=(await this.queue.getJobs("failed")).map((t)=>t.id);if(e.length>0)await this.queue.bulkRemove(e)}async clearDeadLetterQueue(){if(!this.isEnabled()||!this.deadLetterQueue)return;await this.queue.clearDeadLetterQueue()}isEnabled(){return this.config.enabled&&this.queue!==null}async close(){if(this.queue)await this.queue.close(),this.queue=null}}
|
|
3
3
|
export{u as W,c as X,d as Y,g as Z};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{An as g,Bn as h,Cn as i,Dn as j,un as a,vn as b,wn as c,xn as d,yn as e,zn as f}from"./chunk-wm805tte.js";import"./chunk-58tfvayh.js";import"./chunk-5be9x5cq.js";import"./chunk-nf3kv7kv.js";export{a as STX_ENGINE_BINDING_NAMES,g as convertToCommonJS,i as extractScriptFromTemplate,e as extractVariables,j as hasVariables,f as isCompleteImport,d as isMissingBindingFailure,c as isModuleResolutionFailure,h as splitDeclaration,b as stripTypeScript};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$s as M,dt as b}from"./chunk-fna5n0ey.js";import{Zu as N}from"./chunk-nf3kv7kv.js";import y from"fs";import l from"path";import P from"os";import B from"crypto";var O=[320,640,768,1024,1280,1536,1920],_=["webp","jpeg"],H=80,V=[".jpg",".jpeg",".png",".webp",".avif",".gif",".svg"],q={webp:"image/webp",avif:"image/avif",jpeg:"image/jpeg",png:"image/png"},w=null,F=!1;async function d(){if(F)return w;F=!0;try{let t=await import("sharp");return w=t.default||t,w}catch{return null}}async function Z(){return await d()!==null}async function tt(){return!0}async function et(t,e={}){let{widths:a=O,formats:r=_,quality:i=H,fit:o="cover",placeholder:n="none",outputDir:f=".stx/images",baseUrl:T="/images"}=e,h,m;if(typeof t==="string"){if(m=t,!await Bun.file(t).exists())throw new I(`Image not found: ${t}`,"NOT_FOUND");h=await Bun.file(t).arrayBuffer().then((s)=>Buffer.from(s))}else m="buffer-input",h=t;let E=B.createHash("sha256").update(h).digest("hex").slice(0,12),z=await x(h),{width:c,height:S}=z,U=c/S;await y.promises.mkdir(f,{recursive:!0});let j=[],D=l.basename(m,l.extname(m)),g=a.filter((s)=>s<=c);if(!g.includes(c)&&c<=Math.max(...a))g.push(c);g.sort((s,u)=>s-u);for(let s of g){let u=Math.round(s/U);for(let p of r){let L=`${D}-${s}w-${E}.${p}`,k=l.join(f,L),R=`${T}/${L}`,v=await C(h,{width:s,height:u,format:p,quality:i,fit:o});await Bun.write(k,v),j.push({path:k,url:R,width:s,height:u,format:p,size:v.length})}}let A;if(n!=="none")A=await G(h,n);return{src:m,variants:j,placeholder:A,width:c,height:S,aspectRatio:U,hash:E}}async function x(t){let e=typeof t==="string"?Buffer.from(await Bun.file(t).arrayBuffer()):t,a=await d();if(a){let r=await a(e).metadata();return{width:r.width||0,height:r.height||0,format:r.format||"unknown",hasAlpha:r.hasAlpha}}return W(e)}function W(t){if(t[0]===137&&t[1]===80&&t[2]===78&&t[3]===71){let e=t.readUInt32BE(16),a=t.readUInt32BE(20);return{width:e,height:a,format:"png",hasAlpha:!0}}if(t[0]===255&&t[1]===216){let e=2;while(e<t.length){if(t[e]!==255)break;let a=t[e+1];if(a>=192&&a<=207&&a!==196&&a!==200&&a!==204){let i=t.readUInt16BE(e+5);return{width:t.readUInt16BE(e+7),height:i,format:"jpeg",hasAlpha:!1}}let r=t.readUInt16BE(e+2);e+=2+r}}if(t.toString("utf8",0,4)==="RIFF"&&t.toString("utf8",8,12)==="WEBP"){let e=t.toString("utf8",12,16);if(e==="VP8 "){let a=t.readUInt16LE(26)&16383,r=t.readUInt16LE(28)&16383;return{width:a,height:r,format:"webp",hasAlpha:!1}}if(e==="VP8L"){let a=t.readUInt32LE(21),r=(a&16383)+1,i=(a>>14&16383)+1;return{width:r,height:i,format:"webp",hasAlpha:!0}}}if(t.toString("utf8",0,3)==="GIF"){let e=t.readUInt16LE(6),a=t.readUInt16LE(8);return{width:e,height:a,format:"gif",hasAlpha:!0}}throw new I("Unable to parse image dimensions","PARSE_ERROR")}async function C(t,e){let a=await d();if(a){let i=a(t).resize(e.width,e.height,{fit:e.fit});switch(e.format){case"webp":i=i.webp({quality:e.quality});break;case"avif":i=i.avif({quality:e.quality});break;case"jpeg":i=i.jpeg({quality:e.quality});break;case"png":i=i.png({quality:e.quality});break}return i.toBuffer()}let r=l.join(P.tmpdir(),`stx-img-${B.randomBytes(8).toString("hex")}.${e.format}`);try{return await M({input:t,output:r,format:e.format,quality:e.quality,resize:{width:e.width,height:e.height,fit:e.fit}}),Buffer.from(await Bun.file(r).arrayBuffer())}finally{await y.promises.unlink(r).catch(()=>{})}}async function G(t,e){let a=await d();if(e==="blur"&&a){let o=(await a(t).resize(20).blur(10).toBuffer()).toString("base64"),n=await x(t);return`data:${q[n.format]||"image/jpeg"};base64,${o}`}if(e==="dominant-color"&&a){let{dominant:o}=await a(t).resize(1,1).toBuffer().then(async(n)=>{let f=await a(n).metadata();return{dominant:{r:128,g:128,b:128}}}).catch(()=>({dominant:{r:128,g:128,b:128}}));return`rgb(${o.r}, ${o.g}, ${o.b})`}let r=await x(t),i=l.join(P.tmpdir(),`stx-ph-${B.randomBytes(8).toString("hex")}.${r.format==="unknown"?"bin":r.format}`);try{await Bun.write(i,t);let o=e==="blur"?"blur":e==="thumbhash"?"thumbhash":"dominant-color",n=await b(i,{strategy:o,width:o==="thumbhash"?void 0:32});if(e==="dominant-color"&&n.dominantColor)return n.dominantColor;if(n.dataURL)return n.dataURL;return"rgb(128, 128, 128)"}catch{return"rgb(128, 128, 128)"}finally{await y.promises.unlink(i).catch(()=>{})}}function at(t,e){return(e?t.filter((a)=>a.format===e):t).sort((a,r)=>a.width-r.width).map((a)=>`${a.url} ${a.width}w`).join(", ")}function rt(t){if(!t||Object.keys(t).length===0)return"100vw";return Object.entries(t).sort((e,a)=>{let r=Number.parseInt(e[0].replace(/\D/g,""))||0;return(Number.parseInt(a[0].replace(/\D/g,""))||0)-r}).map(([e,a])=>`(max-width: ${e}) ${a}`).join(", ")+", 100vw"}function it(t){let e=t.filter((r)=>r.format==="jpeg");if(e.length===0)return t[Math.floor(t.length/2)];let a=e.sort((r,i)=>r.width-i.width);return a[Math.floor(a.length/2)]}function nt(t){let e=new Map;for(let a of t){let r=e.get(a.format)||[];r.push(a),e.set(a.format,r)}return e}function ot(t){let e=l.extname(t).toLowerCase();return V.includes(e)}function st(t){return q[t]||"application/octet-stream"}function ht(t){return t.reduce((e,a)=>e+a.size,0)}function ct(t){if(t<1024)return`${t} B`;if(t<1048576)return`${(t/1024).toFixed(1)} KB`;return`${(t/1048576).toFixed(2)} MB`}class I extends Error{code;constructor(t,e){super(t);this.name="ImageProcessingError",this.code=e}}
|
|
3
|
+
export{O as ds,_ as es,H as fs,Z as gs,tt as hs,et as is,x as js,C as ks,at as ls,rt as ms,it as ns,nt as os,ot as ps,st as qs,ht as rs,ct as ss,I as ts};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Bf as a,Cf as b}from"./chunk-w0jv49ch.js";import"./chunk-e3qej0jr.js";import"./chunk-ryvmyskt.js";import"./chunk-2g8m379z.js";import"./chunk-ezqwq17j.js";import"./chunk-wm805tte.js";import"./chunk-58tfvayh.js";import"./chunk-brpgjyqg.js";import"./chunk-2rr178et.js";import"./chunk-5be9x5cq.js";import"./chunk-5zrnk2kq.js";import"./chunk-p0qhpnqh.js";import"./chunk-nf3kv7kv.js";export{b as clearStoreCache,a as getStoreScript};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ne as a,oe as b,pe as c,qe as d,re as e,se as f,te as g,ue as h}from"./chunk-14v65c37.js";import"./chunk-p0w1x8y2.js";import"./chunk-nf3kv7kv.js";export{c as Validator,b as defineForm,e as processErrorDirective,f as processErrorsDirective,h as processFormValidationDirectives,g as processHasErrorsDirective,a as useForm,d as v};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Td as a,Ud as b,Vd as c,Wd as d,Xd as e,Yd as f,Zd as g}from"./chunk-p3dk1w2w.js";import"./chunk-nf3kv7kv.js";export{a as createVirtualList,g as default,c as generateVirtualListCSS,e as processInfiniteListDirectives,f as processVirtualGridDirectives,b as processVirtualListDirectives,d as useVirtualList};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-nf3kv7kv.js";var l=null,v=[],m=new WeakMap;function x(e){let o=e,t=new Set,n={get value(){if(l){let s=m.get(n);if(!s)s=new Set,m.set(n,s);s.add(l)}return o},set value(s){if(!Object.is(o,s)){o=s,t.forEach((i)=>i(s));let r=m.get(n);if(r)r.forEach((i)=>i())}},subscribe(s){return t.add(s),()=>t.delete(s)},peek(){return o}};return n}function h(e){return e!==null&&typeof e==="object"&&"value"in e&&"subscribe"in e&&"peek"in e}function k(e){return h(e)?e.value:e}function _(e){let o={};for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))o[t]=x(e[t]);return o}function E(e){return x(e)}function S(e){let o=typeof e==="function",t=o?e:e.get,n=o?void 0:e.set,s=o?Object.is:e.equals||Object.is,r,i=!0,c=new Set,f=new Set,d=()=>{if(i=!0,f.size>0){let u=a.value;f.forEach((w)=>w(u))}};function p(){c.clear();let u=l;l=d,v.push(d);try{return t()}finally{v.pop(),l=u}}let a={get value(){if(l){let u=m.get(a);if(!u)u=new Set,m.set(a,u);u.add(l)}if(i){let u=p();if(!s(r,u))r=u;i=!1}return r},set value(u){if(n)n(u);else console.warn("Computed property is readonly")},subscribe(u){return f.add(u),()=>f.delete(u)},peek(){if(i)r=t(),i=!1;return r},invalidate(){i=!0},get dirty(){return i},get deps(){return c}};return a}function R(e,o,t={}){let{immediate:n=!1,deep:s=!1,flush:r="pre",once:i=!1}=t,c,f=!0,d=!1,p=()=>{if(h(e))return s?b(e.value):e.value;return e()},a=()=>{if(!f||d)return;let y=p();if(c!==void 0&&Object.is(c,y)&&!s)return;let g=()=>{if(o(y,c),c=s?b(y):y,i)w()};if(r==="sync")g();else if(r==="post")queueMicrotask(g);else Promise.resolve().then(g)},u=null;if(h(e))u=e.subscribe(()=>a());else u=S(e).subscribe(()=>a());if(n)c=void 0,a();else c=p();let w=()=>{if(f=!1,u)u(),u=null};return w.pause=()=>{d=!0},w.resume=()=>{d=!1},w}function j(e,o,t={}){let{immediate:n=!1,once:s=!1}=t,r=e.map((a)=>h(a)?a.value:void 0),i=!0,c=!1,f=()=>{if(!i||c)return;let a=e.map((u)=>h(u)?u.value:void 0);if(o(a,r),r=[...a],s)p()},d=e.map((a)=>{if(h(a))return a.subscribe(()=>f());return()=>{}});if(n)f();let p=()=>{i=!1,d.forEach((a)=>a())};return p.pause=()=>{c=!0},p.resume=()=>{c=!1},p}function C(e,o={}){let{flush:t="pre"}=o,n,s=!0,r=!1,i=()=>{if(!s||r)return;if(n)n();let f=l;l=i,v.push(i);try{n=e()}finally{v.pop(),l=f}};if(t==="sync")i();else if(t==="post")queueMicrotask(i);else Promise.resolve().then(i);let c=()=>{if(s=!1,n)n()};return c.pause=()=>{r=!0},c.resume=()=>{r=!1},c}function D(e,o={},t){let n=/@computed\s*\(\s*(\w+)\s*,\s*(.+?)\s*\)/gi;return e.replace(n,(s,r,i)=>{try{let c=Function(...Object.keys(o),`return ${i}`)(...Object.values(o));return o[r]=c,`<!-- computed: ${r} = ${c} -->`}catch(c){return`<!-- computed error: ${r} - ${c} -->`}})}function P(e,o={},t){let n=/@watch\s*\(\s*(\w+)\s*\)\s*([\s\S]*?)@endwatch/gi;return e.replace(n,(s,r,i)=>`
|
|
3
3
|
<script data-watch="${`watch-${Math.random().toString(36).substring(2,9)}`}">
|
|
4
4
|
(function() {
|
|
5
5
|
// Watch implementation for ${r}
|
|
@@ -11,4 +11,4 @@ import"./chunk-a3wahyg7.js";var l=null,v=[],m=new WeakMap;function x(e){let o=e,
|
|
|
11
11
|
}
|
|
12
12
|
})();
|
|
13
13
|
</script>
|
|
14
|
-
`
|
|
14
|
+
`)}function b(e){if(e===null||typeof e!=="object")return e;if(Array.isArray(e))return e.map((t)=>b(t));if(e instanceof Date)return new Date(e.getTime());if(e instanceof Map){let t=new Map;return e.forEach((n,s)=>t.set(b(s),b(n))),t}if(e instanceof Set){let t=new Set;return e.forEach((n)=>t.add(b(n))),t}let o={};for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))o[t]=b(e[t]);return o}function M(e,o=100){let t=x(e()),n=null,s=()=>{if(n)clearTimeout(n);n=setTimeout(()=>{t.value=e()},o)};return S(e).subscribe(()=>s()),{get value(){return t.value},set value(r){console.warn("Debounced computed is readonly")},subscribe:t.subscribe,peek:t.peek,invalidate(){s()},get dirty(){return!1},get deps(){return new Set}}}function V(e,o=100){let t=x(e()),n=0,s=()=>{let r=Date.now();if(r-n>=o)n=r,t.value=e()};return S(e).subscribe(()=>s()),{get value(){return t.value},set value(r){console.warn("Throttled computed is readonly")},subscribe:t.subscribe,peek:t.peek,invalidate(){s()},get dirty(){return!1},get deps(){return new Set}}}var T={ref:x,computed:S,watch:R,watchMultiple:j,watchEffect:C,isRef:h,unref:k,toRefs:_,shallowRef:E,debouncedComputed:M,throttledComputed:V,processComputedDirectives:D,processWatchDirectives:P};export{S as computed,M as debouncedComputed,T as default,h as isRef,D as processComputedDirectives,P as processWatchDirectives,x as ref,E as shallowRef,S as stxComputed,M as stxDebouncedComputed,h as stxIsRef,x as stxRef,E as stxShallowRef,V as stxThrottledComputed,_ as stxToRefs,k as stxUnref,R as stxWatch,C as stxWatchEffect,j as stxWatchMultiple,V as throttledComputed,_ as toRefs,k as unref,R as watch,C as watchEffect,j as watchMultiple};
|