@stacksjs/stx 0.2.503 → 0.2.506
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/browser-core-imports.d.ts +1 -1
- package/dist/browser-core-imports.js +1 -2
- package/dist/builtins/attrs.d.ts +2 -0
- package/dist/builtins/attrs.js +102 -0
- package/dist/{chunk-3mynjdqr.js → chunk-068ank60.js} +3 -3
- package/dist/{chunk-yvt8zszz.js → chunk-06v0c3fz.js} +1 -1
- package/dist/chunk-0eptxhzy.js +2 -0
- package/dist/{chunk-15w4adyd.js → chunk-0vnr7mz7.js} +8 -8
- package/dist/{chunk-bv7bsdfe.js → chunk-1149d93e.js} +2 -2
- package/dist/chunk-1b7dd8rn.js +2 -0
- package/dist/{chunk-0egg3666.js → chunk-1verz406.js} +5 -5
- package/dist/{chunk-7cbtcdqw.js → chunk-2etevws0.js} +2 -2
- package/dist/chunk-2h4bf7m4.js +2 -0
- package/dist/{chunk-z9fz5dby.js → chunk-2j04bc8c.js} +2 -2
- package/dist/{chunk-40jd0b4h.js → chunk-2wr0sk42.js} +1 -1
- package/dist/chunk-36rwfhnb.js +2 -0
- package/dist/{chunk-b5mcvm6y.js → chunk-38xtsdk9.js} +6 -6
- package/dist/chunk-3c9t71pc.js +2 -0
- package/dist/chunk-3pczp9c0.js +2 -0
- package/dist/{chunk-jwjggr91.js → chunk-3ynfz6h8.js} +2 -2
- package/dist/{chunk-1v86h5vn.js → chunk-46wre9ep.js} +3 -3
- package/dist/{chunk-rhrv2j36.js → chunk-4hz4g5ym.js} +2 -2
- package/dist/chunk-4w358hpx.js +2 -0
- package/dist/{chunk-33snwgdy.js → chunk-5dh041x0.js} +3 -3
- package/dist/{chunk-802qf0vz.js → chunk-5q9rmcp7.js} +1 -1
- package/dist/{chunk-qmcmjdy7.js → chunk-5tbqdz94.js} +7 -7
- package/dist/{chunk-zv0vgamy.js → chunk-5tkzfw4s.js} +3 -3
- package/dist/{chunk-25m2wqsd.js → chunk-5zm23zrb.js} +38 -12
- package/dist/{chunk-szry3s17.js → chunk-68tzytfz.js} +3 -3
- package/dist/chunk-76g4jw9g.js +2 -0
- package/dist/{chunk-93sr9q8g.js → chunk-7p6y0b47.js} +1 -1
- package/dist/chunk-7sjmpfwy.js +18 -0
- package/dist/chunk-7z28hk7r.js +2 -0
- package/dist/chunk-8nx5asjr.js +2 -0
- package/dist/chunk-8ptefdpy.js +2 -0
- package/dist/{chunk-cp7hph6f.js → chunk-8xpyzcq2.js} +1 -1
- package/dist/chunk-8zj1ebs5.js +2 -0
- package/dist/{chunk-c8psbk2e.js → chunk-91y360rc.js} +1 -1
- package/dist/chunk-96kr2xrt.js +2828 -0
- package/dist/{chunk-b77v56fz.js → chunk-9p3rtfbv.js} +9 -9
- package/dist/chunk-9xw416q3.js +2 -0
- package/dist/chunk-9z76qhdm.js +2 -0
- package/dist/{chunk-zqxqdns1.js → chunk-9z8mxp15.js} +1 -1
- package/dist/chunk-ag1j84s6.js +2 -0
- package/dist/{chunk-d4k4nyj0.js → chunk-ba88n1j7.js} +2 -2
- package/dist/chunk-c2vwq6gr.js +2 -0
- package/dist/{chunk-2kyfaa0p.js → chunk-c322rrge.js} +2 -2
- package/dist/chunk-cb1c9mvc.js +2 -0
- package/dist/chunk-ces3vdjp.js +2 -0
- package/dist/{chunk-stvqwzen.js → chunk-cprcfp0j.js} +2 -2
- package/dist/chunk-dn4tww9q.js +2 -0
- package/dist/chunk-dne8n6h3.js +3 -0
- package/dist/chunk-dv94gdv4.js +2 -0
- package/dist/chunk-e4zks32s.js +2 -0
- package/dist/{chunk-h0sd5cda.js → chunk-ea19gveh.js} +5 -5
- package/dist/{chunk-tvag2s5a.js → chunk-eacd5755.js} +1 -1
- package/dist/{chunk-8fb1mqw1.js → chunk-ej46bkaw.js} +1 -1
- package/dist/{chunk-1hpttjgq.js → chunk-fh5rp6wb.js} +1 -1
- package/dist/chunk-fkv8jmse.js +2 -0
- package/dist/{chunk-vtn0gmen.js → chunk-fwvqbx49.js} +8 -8
- package/dist/chunk-g1r4v0mc.js +3 -0
- package/dist/{chunk-2pph3dh0.js → chunk-g495xx4v.js} +5 -5
- package/dist/{chunk-vp827ah7.js → chunk-g7wgpys2.js} +4 -4
- package/dist/chunk-gw9ax7xx.js +2 -0
- package/dist/{chunk-4ssg2hn4.js → chunk-h37bbgg8.js} +1 -1
- package/dist/chunk-h3rrsq05.js +2 -0
- package/dist/{chunk-z6nm6rf1.js → chunk-h6z4s5p3.js} +1 -1
- package/dist/chunk-h87zhtw8.js +2 -0
- package/dist/chunk-h9reptxv.js +45 -0
- package/dist/{chunk-vs0ebfg5.js → chunk-hka18tmt.js} +1 -1
- package/dist/chunk-j08y5n2k.js +2 -0
- package/dist/chunk-j7nd8zfe.js +2 -0
- package/dist/{chunk-z9tvn738.js → chunk-jcmgj8kk.js} +1 -1
- package/dist/chunk-jtwx2xte.js +2 -0
- package/dist/{chunk-gvkfydq5.js → chunk-k2331dfx.js} +1 -1
- package/dist/chunk-k5syze27.js +2 -0
- package/dist/{chunk-258qj7pt.js → chunk-km9g9drp.js} +1 -1
- package/dist/{chunk-t61vdbje.js → chunk-ktvr45qg.js} +6 -6
- package/dist/chunk-kxvtyh05.js +2 -0
- package/dist/chunk-mq6expbd.js +2 -0
- package/dist/chunk-mvqhf6dn.js +2 -0
- package/dist/chunk-mz7snf2b.js +2 -0
- package/dist/chunk-n1hd2fx6.js +2 -0
- package/dist/{chunk-298s08st.js → chunk-n34kagea.js} +2 -2
- package/dist/chunk-nnrtwpvy.js +2 -0
- package/dist/chunk-pecwdp57.js +2 -0
- package/dist/{chunk-tdetcthb.js → chunk-ph1xz7k5.js} +2 -2
- package/dist/chunk-pj562qnx.js +2 -0
- package/dist/chunk-pzcw3trh.js +2 -0
- package/dist/{chunk-4mrgy3ve.js → chunk-qt31at4s.js} +4 -4
- package/dist/{chunk-4c1afy15.js → chunk-qv57r0fa.js} +1 -1
- package/dist/{chunk-qhnpc3ac.js → chunk-r14mvycg.js} +22 -22
- package/dist/chunk-r5fzxtbc.js +2 -0
- package/dist/{chunk-vg9dyc4y.js → chunk-rvwtyrj4.js} +1 -1
- package/dist/{chunk-dve4q9tg.js → chunk-s87qrma5.js} +3 -3
- package/dist/chunk-spg0fzyv.js +2 -0
- package/dist/{chunk-hqvdm4h9.js → chunk-t77pz252.js} +1 -1
- package/dist/chunk-t7djn7zd.js +2 -0
- package/dist/{chunk-tse7jzmz.js → chunk-tf239jvd.js} +1 -1
- package/dist/{chunk-gzt3ghgq.js → chunk-tkagcknf.js} +2 -2
- package/dist/{chunk-xevnx24r.js → chunk-tnxprz69.js} +2 -2
- package/dist/{chunk-81t6zr3m.js → chunk-v74acg2k.js} +2 -2
- package/dist/{chunk-f0prq6yw.js → chunk-vc1m5fr9.js} +1 -1
- package/dist/{chunk-jbvg29t0.js → chunk-vftdacyb.js} +1 -1
- package/dist/{chunk-hktvv0hd.js → chunk-vtxzaj1h.js} +2 -2
- package/dist/chunk-w925gtgg.js +2 -0
- package/dist/chunk-w9kj6t7s.js +2 -0
- package/dist/{chunk-b90y5phw.js → chunk-w9mxt96c.js} +78 -78
- package/dist/{chunk-d19vgjjt.js → chunk-x81vcxzs.js} +2 -2
- package/dist/{chunk-rmavqxd8.js → chunk-xd4zvm4x.js} +2 -2
- package/dist/{chunk-x8mp9yvn.js → chunk-xemsypk7.js} +4 -4
- package/dist/{chunk-71bbv43t.js → chunk-xx2pk2ay.js} +3 -3
- package/dist/{chunk-74j18qk0.js → chunk-y8h823cb.js} +28 -28
- package/dist/chunk-yn2d8x8m.js +3 -0
- package/dist/{chunk-hmyyq2hh.js → chunk-z2775k8r.js} +1 -1
- package/dist/{chunk-1erc0vrb.js → chunk-zz5b1g50.js} +2 -2
- package/dist/cli.js +44 -44
- package/dist/component-renderer.js +84 -36
- package/dist/composables/index.d.ts +4 -0
- package/dist/composables/index.js +5 -1
- package/dist/composables/use-timer.d.ts +8 -0
- package/dist/composables/use-timer.js +4 -0
- package/dist/config.js +24 -7
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/native/bridge/protocol.d.ts +3 -0
- package/dist/native/cli.d.ts +1 -0
- package/dist/native/cli.js +7 -2
- package/dist/native/compiler/bundle.d.ts +1 -0
- package/dist/native/compiler/bundle.js +27 -7
- package/dist/native/compiler/html-to-ir.d.ts +3 -1
- package/dist/native/compiler/html-to-ir.js +13 -0
- package/dist/native/runtime/craft-bridge.js +9 -1
- package/dist/native/runtime/craft.d.ts +2 -0
- package/dist/native/runtime/native-host.d.ts +1 -0
- package/dist/native/runtime/native-host.js +1 -0
- package/dist/native/runtime/shared-screen.d.ts +21 -0
- package/dist/native/runtime/shared-screen.js +43 -0
- package/dist/pwa.js +3 -3
- package/dist/runtime-globals.js +4 -0
- package/dist/signals.js +34 -8
- package/dist/ssg.js +2 -2
- package/dist/stx-module.d.ts +4 -0
- package/dist/stx.d.ts +8 -0
- package/dist/utils.d.ts +3 -1
- package/dist/utils.js +12 -2
- package/package.json +6 -6
- package/stx-module.d.ts +4 -0
- package/stx.d.ts +8 -0
- package/dist/chunk-0adrp7qd.js +0 -2
- package/dist/chunk-0vdxchfw.js +0 -2
- package/dist/chunk-1mrn5s5z.js +0 -2
- package/dist/chunk-2gr5zcm3.js +0 -2
- package/dist/chunk-2grygc4b.js +0 -2
- package/dist/chunk-379nn8yc.js +0 -2
- package/dist/chunk-3vqabd10.js +0 -2
- package/dist/chunk-490f2x2r.js +0 -2
- package/dist/chunk-4j2ej7er.js +0 -2
- package/dist/chunk-4rmdngzw.js +0 -2
- package/dist/chunk-52saa2nj.js +0 -2
- package/dist/chunk-69dc3tyz.js +0 -2
- package/dist/chunk-6v3p6cx1.js +0 -2
- package/dist/chunk-78vfptph.js +0 -2
- package/dist/chunk-7e6sxdp6.js +0 -2
- package/dist/chunk-7wxmsv41.js +0 -2
- package/dist/chunk-8qdvhbv7.js +0 -18
- package/dist/chunk-9mh1qq3g.js +0 -2
- package/dist/chunk-9z70zv10.js +0 -33
- package/dist/chunk-b0bgprzs.js +0 -2
- package/dist/chunk-c7cajwd2.js +0 -2
- package/dist/chunk-cg8hg6cs.js +0 -3
- package/dist/chunk-ckrpk6ak.js +0 -2
- package/dist/chunk-en0atzsp.js +0 -2
- package/dist/chunk-fxppbahx.js +0 -2
- package/dist/chunk-hhj1txvj.js +0 -2
- package/dist/chunk-j2q2pp0x.js +0 -2
- package/dist/chunk-jbj6xh7f.js +0 -3
- package/dist/chunk-jh385m2w.js +0 -2
- package/dist/chunk-kxg9q64a.js +0 -2
- package/dist/chunk-m9nr12a1.js +0 -2828
- package/dist/chunk-mdfrm5hv.js +0 -2
- package/dist/chunk-mq7vvaf4.js +0 -2
- package/dist/chunk-nfffn3s0.js +0 -2
- package/dist/chunk-nw7qvyek.js +0 -2
- package/dist/chunk-ny64ezsj.js +0 -2
- package/dist/chunk-qjba655t.js +0 -2
- package/dist/chunk-qjxxd4a0.js +0 -2
- package/dist/chunk-qsy7phd4.js +0 -2
- package/dist/chunk-rfq1jfhf.js +0 -2
- package/dist/chunk-rr41gk8b.js +0 -2
- package/dist/chunk-snyq0jj6.js +0 -2
- package/dist/chunk-sybzayv3.js +0 -2
- package/dist/chunk-v7vkqg8f.js +0 -3
- package/dist/chunk-v8m2khkq.js +0 -2
- package/dist/chunk-vbhykx9z.js +0 -2
- package/dist/chunk-xfxrh6vx.js +0 -2
- package/dist/chunk-xk2mwk61.js +0 -2
- package/dist/chunk-zbzmfqmk.js +0 -2
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import u from"fs";import l from"path";var m=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useModel)\s*(?:<[^<>()]*>)?\s*\(/,g=/(?:^|\n)\s*(?:import|export)\s+(?:[^'"]*?\sfrom\s+)?['"](\.[^'"]*)['"]/g,b=["",".ts",".tsx",".js",".jsx",".mts",".mjs","/index.ts","/index.js"],x=3;function h(e,t){let r=l.resolve(l.dirname(t),e);for(let o of b){let s=r+o;try{if(u.statSync(s).isFile())return s}catch{}}return null}function wn(e,t,r=0,o=new Set){if(!t||r>=x)return!1;for(let s of e.matchAll(g)){let n=h(s[1],t);if(!n||o.has(n))continue;o.add(n);let i;try{i=u.readFileSync(n,"utf8")}catch{continue}if(m.test(i))return!0;if(wn(i,n,r+1,o))return!0}return!1}var y=["batch","cachedQuery","clearServerData","computed","configureFetch","defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","defineStore","derived","effect","flushKeptState","forgetKeptState","goBack","goForward","inject","invalidateRoute","isDerived","isSignal","keptState","navigate","nextTick","onBeforeMount","onBeforeUnmount","onDestroy","onMount","onMounted","onUnmounted","peek","provide","reactive","ref","refDebounced","refresh","registerStoresClient","setKeptScope","setRouteParams","state","untrack","useAsync","useClickOutside","useColorMode","useCookie","useCounter","useDark","useDebounce","useDebounceFn","useDebouncedValue","useDocumentVisibility","useEventListener","useFetch","useFocus","useHead","useId","useInterval","useLocalStorage","useMediaQuery","useModel","useMutation","useOptimistic","usePreferredContrast","usePreferredDark","usePreferredLight","usePreferredReducedMotion","useQuery","useReactiveProp","useRef","useRoute","useRouteParam","useRouteParams","useScrollLock","useSearchParams","useSeoMeta","useSessionStorage","useSlots","useStore","useThrottle","useThrottleFn","useTimeout","useTimeoutFn","useToggle","useWebSocket","watch","watchEffect","watchMultiple","withDefaults"],Pi=["onMount","onDestroy"];function Pt(e="const",t=[],r){let o=t.length?y.filter((s)=>!t.includes(s)):y;if(r!==void 0)o=o.filter((s)=>{let n=s.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(^|[^\\w$])${n}(?![\\w$])`).test(r)});return`${e} { ${o.join(", ")} } = window.stx;`}var E=["defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","withDefaults"];var S=y.filter((e)=>!E.includes(e));function Ls(e){if(!e)return!1;return S.some((t)=>new RegExp(`\\b${t}\\s*(?:<[^>]*>)?\\s*\\(`).test(e))}var v=[/@if\s*=/,/@for\s*=/,/@show\s*=/,/@model\s*=/,/@bind:/,/@class\s*=/,/@style\s*=/,/\bx-data\s*=/,/\bstate\s*(?:<[^>]*>)?\s*\(/,/\bderived\s*(?:<[^>]*>)?\s*\(/,/\beffect\s*(?:<[^>]*>)?\s*\(/,/\bref\s*(?:<[^>]*>)?\s*\(/,/\bcomputed\s*(?:<[^>]*>)?\s*\(/,/\breactive\s*(?:<[^>]*>)?\s*\(/,/\bwatch\s*(?:<[^>]*>)?\s*\(/,/\bwatchEffect\s*(?:<[^>]*>)?\s*\(/,/\s:[a-z][\w-]*\s*=\s*["']/i,/\s:(?:if|else-if|else|for|show|text|html|model)\s*=/,/data-stx(?:-auto)?(?![-\w])/,/data-stx-scoped/],T=/\s@[a-z][\w.:-]*\s*=/i;function Ii(e,t){if(!e)return!1;let r=f(e);return d(r,t)}function d(e,t){if(v.some((r)=>r.test(e)))return!0;if(Ls(e))return!0;return R(e,t)}function R(e,t){if(!t)return!1;for(let r of e.matchAll(/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script\s*>/gi))if(wn(r[1],t))return!0;return!1}function Di(e,t){if(!e)return!1;let r=f(e);return T.test(r)||d(r,t)}var _=["if","else-if","elseif","else","for","show","key","text","html","model","ref"];function Oi(e){return _.includes(e.toLowerCase())}var cr=["x-text","x-html","x-model","x-show","x-if","x-for","x-cloak","x-ref","x-data","x-bind","x-class","x-style","x-tooltip","x-tooltip-position"],w=["x-init","x-transition","x-effect","x-on"],Mi=[...cr,...w];function Ni(){return`{${cr.map((e)=>`'${e}':1`).join(",")}}`}var js=["class","style","text","html","show","model","if","ref"];function Li(){return`{${js.map((e)=>e==="if"?"'if':1":`${e}:1`).join(",")}}`}var p=["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","keydown","keyup","keypress","input","change","submit","focus","blur","scroll","resize","touchstart","touchend","touchmove","contextmenu","wheel","pointerdown","pointerup","pointermove"];function ji(){return`/^(${p.join("|")})(?:\\.|$)/`}function Bi(e){return p.some((t)=>e===t||e.startsWith(`${t}.`))}var A=65536,N=4,c=new Map;function f(e){if(!e)return e;if(!e.includes("<!--")&&!/<(?:pre|code)\b/i.test(e))return e;let t=e.length>=A;if(t){let s=c.get(e);if(s!==void 0)return s}let r=(s)=>s.replace(/(<[^>]*>)|([^<]+)/g,(n,i,a)=>i??" ".repeat(a.length)),o=e.replace(/(<pre\b[^>]*>)([\s\S]*?)(<\/pre>)/gi,(s,n,i,a)=>n+r(i)+a).replace(/(<code\b[^>]*>)([\s\S]*?)(<\/code>)/gi,(s,n,i,a)=>n+r(i)+a).replace(/<!--[\s\S]*?-->/g,(s)=>" ".repeat(s.length));if(t){while(c.size>=N){let s=c.keys().next();if(s.done)break;c.delete(s.value)}c.set(e,o)}return o}
|
|
3
|
+
export{wn,y,Pi,Pt,Ls,Ii,Di,Oi,cr,Mi,Ni,js,Li,ji,Bi};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{O}from"./chunk-
|
|
2
|
+
import{O}from"./chunk-vtxzaj1h.js";var t={UNCLOSED_DIRECTIVE:1001,UNCLOSED_EXPRESSION:1002,INVALID_DIRECTIVE_SYNTAX:1003,MALFORMED_EXPRESSION:1004,UNEXPECTED_TOKEN:1005,UNDEFINED_VARIABLE:1101,TYPE_ERROR:1102,EVALUATION_ERROR:1103,INFINITE_LOOP:1104,CIRCULAR_REFERENCE:1105,UNSAFE_EXPRESSION:1201,PATH_TRAVERSAL:1202,XSS_ATTEMPT:1203,CODE_INJECTION:1204,DOM_API_VIOLATION:1205,FILE_NOT_FOUND:1301,FILE_READ_ERROR:1302,INVALID_FILE_PATH:1303,PERMISSION_DENIED:1304,INVALID_CONFIG:1401,MISSING_REQUIRED_CONFIG:1402,DEPRECATED_CONFIG:1403,COMPONENT_NOT_FOUND:1501,INVALID_PROPS:1502,COMPONENT_RENDER_ERROR:1503,FILTER_NOT_FOUND:1601,INVALID_FILTER_ARGS:1602,EXPRESSION_TIMEOUT:1603};function N(e){for(let[r,n]of Object.entries(t))if(n===e)return r;return}import ee from"path";var re={showRelativePaths:!1,enableAutoRecovery:O(),logRecoveryWarnings:!0},L={...re};function R(){return{...L}}function k(e){if(!L.showRelativePaths||!e)return e;let r=L.baseDir||process.cwd();try{let n=ee.relative(r,e);return n.startsWith("..")?e:n}catch{return e}}class v extends Error{code;filePath;line;column;context;numericCode;constructor(e,r,n,o,s,a,g){super(e);this.code=r;this.filePath=n;this.line=o;this.column=s;this.context=a;if(this.name="StxError",this.numericCode=g||t.EVALUATION_ERROR,this.filePath)this.filePath=k(this.filePath)}}class X extends v{constructor(e,r,n,o,s,a){super(e,"stx_RUNTIME_ERROR",r,n,o,s,a||t.EVALUATION_ERROR);this.name="StxRuntimeError"}}class yn extends v{constructor(e,r,n,o,s,a){super(e,"stx_FILE_ERROR",r,n,o,s,a||t.FILE_NOT_FOUND);this.name="StxFileError"}}class ir extends v{isFatal=!0;constructor(e,r,n,o,s,a){super(e,"stx_VALIDATION_ERROR",r,n,o,s,a||t.DOM_API_VIOLATION);this.name="StxValidationError"}}function U(e){let{type:r,message:n,code:o,filePath:s,line:a,column:g,template:u,offset:d,snippet:f,suggestion:m,format:h="text"}=e,E=a,x=g;if(!E&&u&&d!==void 0){let z=ce(u,d);E=z.line,x=z.column}let y=s?k(s):void 0,K=o?N(o):void 0,w={type:r,code:o,codeName:K,message:n,filePath:y,line:E,column:x,snippet:f,suggestion:m,timestamp:new Date().toISOString()},S;switch(h){case"html":S=oe(w);break;case"json":S=JSON.stringify(w,null,2);break;case"console":S=ie(w,u,d);break;case"text":default:S=ne(w,u,d);break}return{formatted:S,data:w}}function ne(e,r,n){let o=[],s=e.code?` [${e.codeName||e.code}]`:"";if(o.push(`[${e.type} Error${s}]`),e.filePath){let a=e.filePath;if(e.line){if(a+=`:${e.line}`,e.column)a+=`:${e.column}`}o.push(`at ${a}`)}if(o.push(`
|
|
3
3
|
${e.message}`),r&&e.line){let a=se(r,e.line,2);if(a)o.push(`
|
|
4
4
|
${a}`)}if(e.snippet)o.push(`
|
|
5
5
|
Snippet: ${e.snippet}`);if(e.suggestion)o.push(`
|
|
@@ -18,14 +18,14 @@ ${"\x1B[31m"}\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\
|
|
|
18
18
|
`),s=Math.max(0,r-n-1),a=Math.min(o.length-1,r+n-1),g="\x1B[90m",u="\x1B[31m",d="\x1B[0m",f=[];for(let m=s;m<=a;m++){let h=(m+1).toString().padStart(4),E=m===r-1,x=E?"\x1B[31m>\x1B[0m":" ",y=E?`\x1B[31m${o[m]}\x1B[0m`:`\x1B[90m${o[m]}\x1B[0m`;f.push(`${x}\x1B[90m${h}\x1B[0m | ${y}`)}return f.join(`
|
|
19
19
|
`)}function M(e){return e.replace(/--/g,"- -").replace(/>/g,">")}function ce(e,r){let o=e.substring(0,r).split(`
|
|
20
20
|
`);return{line:o.length,column:o[o.length-1].length}}function i(e,r,n){return U({type:e,message:r,code:n,format:"html"}).formatted}async function te(e,r,n){try{return await e()}catch(o){if(n&&o instanceof Error)n(o);return r}}var Os={isEnabled(){return R().enableAutoRecovery},fixCommonSyntaxErrors(e){let r=R();if(!r.enableAutoRecovery)return{fixed:e,fixes:[]};let n=e,o=[],s=(n.match(/\{\{/g)||[]).length,a=(n.match(/\}\}/g)||[]).length;if(s>a){let u=s-a;n+="}}".repeat(u),o.push(`Added ${u} missing closing braces '}}'`)}let g=["if","foreach","for","switch","section"];for(let u of g){let d=(n.match(new RegExp(`@${u}\\b`,"g"))||[]).length,f=(n.match(new RegExp(`@end${u}\\b`,"g"))||[]).length;if(d>f){let m=d-f;for(let h=0;h<m;h++)n+=`
|
|
21
|
-
@end${u}`;o.push(`Added ${m} missing @end${u}`)}}if(o.length>0&&r.logRecoveryWarnings)console.warn("[stx] Auto-recovery applied fixes:"),o.forEach((u)=>console.warn(` - ${u}`)),console.warn(" Consider fixing these issues in your template.");return{fixed:n,fixes:o}},createFallbackContent(e,r){if(O())return`<!-- ${e} failed: ${r.message} -->`;return"<!-- stx rendering error -->"}};class
|
|
21
|
+
@end${u}`;o.push(`Added ${m} missing @end${u}`)}}if(o.length>0&&r.logRecoveryWarnings)console.warn("[stx] Auto-recovery applied fixes:"),o.forEach((u)=>console.warn(` - ${u}`)),console.warn(" Consider fixing these issues in your template.");return{fixed:n,fixes:o}},createFallbackContent(e,r){if(O())return`<!-- ${e} failed: ${r.message} -->`;return"<!-- stx rendering error -->"}};class I{errors=[];maxErrors;enableFileLogging;logFilePath;logFormat;maxFileSize;maxLogFiles;minLevel;writeQueue=Promise.resolve();constructor(e={}){this.maxErrors=e.maxErrors??1000,this.enableFileLogging=e.enableFileLogging??!1,this.logFilePath=e.logFilePath??".stx/errors.log",this.logFormat=e.logFormat??"json",this.maxFileSize=e.maxFileSize??10485760,this.maxLogFiles=e.maxLogFiles??5,this.minLevel=e.minLevel??"all"}configure(e){if(e.maxErrors!==void 0)this.maxErrors=e.maxErrors;if(e.enableFileLogging!==void 0)this.enableFileLogging=e.enableFileLogging;if(e.logFilePath!==void 0)this.logFilePath=e.logFilePath;if(e.logFormat!==void 0)this.logFormat=e.logFormat;if(e.maxFileSize!==void 0)this.maxFileSize=e.maxFileSize;if(e.maxLogFiles!==void 0)this.maxLogFiles=e.maxLogFiles;if(e.minLevel!==void 0)this.minLevel=e.minLevel}log(e,r,n="error"){let o={timestamp:new Date,error:e,context:r,level:n};if(this.errors.push(o),this.errors.length>this.maxErrors)this.errors=this.errors.slice(-this.maxErrors);if(this.enableFileLogging&&this.shouldLog(n))this.writeToFile(o)}shouldLog(e){if(this.minLevel==="all")return!0;if(this.minLevel==="warning")return e==="error"||e==="warning";if(this.minLevel==="error")return e==="error";return!0}formatEntry(e){if(this.logFormat==="json")return JSON.stringify({timestamp:e.timestamp.toISOString(),level:e.level||"error",type:e.error.constructor.name,message:e.error.message,stack:e.error.stack,context:e.context});let r=[`[${e.timestamp.toISOString()}] [${(e.level||"error").toUpperCase()}] ${e.error.constructor.name}: ${e.error.message}`];if(e.error.stack)r.push(` Stack: ${e.error.stack.split(`
|
|
22
22
|
`).slice(1).join(`
|
|
23
23
|
`)}`);if(e.context)r.push(` Context: ${JSON.stringify(e.context)}`);return r.join(`
|
|
24
24
|
`)}writeToFile(e){this.writeQueue=this.writeQueue.then(async()=>{try{let r=await import("fs"),n=await import("path"),o=n.dirname(this.logFilePath);if(!r.existsSync(o))r.mkdirSync(o,{recursive:!0});await this.rotateIfNeeded(r);let s=`${this.formatEntry(e)}
|
|
25
25
|
`;r.appendFileSync(this.logFilePath,s,"utf-8")}catch(r){if(process.env.STX_DEBUG==="true")console.error("Failed to write to error log:",r)}})}async rotateIfNeeded(e){try{if(!e.existsSync(this.logFilePath))return;if(e.statSync(this.logFilePath).size<this.maxFileSize)return;for(let n=this.maxLogFiles-1;n>=1;n--){let o=`${this.logFilePath}.${n}`,s=`${this.logFilePath}.${n+1}`;if(e.existsSync(o))if(n>=this.maxLogFiles-1)e.unlinkSync(o);else e.renameSync(o,s)}if(this.maxLogFiles<=1)e.writeFileSync(this.logFilePath,"");else e.renameSync(this.logFilePath,`${this.logFilePath}.1`)}catch(r){if(process.env.STX_DEBUG==="true")console.error("Failed to rotate error logs:",r)}}getRecentErrors(e=10){return this.errors.slice(-e)}getErrorsByType(e){return this.errors.filter((r)=>r.error.constructor.name===e)}getErrorsByLevel(e){return this.errors.filter((r)=>r.level===e)}clear(){this.errors.length=0}async clearLogFile(){try{let e=await import("fs");if(e.existsSync(this.logFilePath))e.writeFileSync(this.logFilePath,"","utf-8")}catch(e){if(process.env.STX_DEBUG==="true")console.error("Failed to clear error log:",e)}}getStats(){let e={},r={error:0,warning:0,info:0};for(let n of this.errors){let o=n.error.constructor.name;e[o]=(e[o]||0)+1;let s=n.level||"error";r[s]=(r[s]||0)+1}return{total:this.errors.length,byType:e,byLevel:r}}async exportToFile(e,r="json"){let n=await import("fs"),o=await import("path"),s=o.dirname(e);if(!n.existsSync(s))n.mkdirSync(s,{recursive:!0});if(r==="json"){let a=this.errors.map((g)=>({timestamp:g.timestamp.toISOString(),level:g.level||"error",type:g.error.constructor.name,message:g.error.message,stack:g.error.stack,context:g.context}));n.writeFileSync(e,JSON.stringify(a,null,2),"utf-8")}else{let a=this.errors.map((g)=>this.formatEntry(g));n.writeFileSync(e,a.join(`
|
|
26
26
|
|
|
27
|
-
`),"utf-8")}}async flush(){await this.writeQueue}}var
|
|
28
|
-
`)}};var le={maxSanitizeDepth:10,allowBracketNotation:!1},G={...le};var C=/\bnew\s+/,F="__stx_safe_ctors",H=[/\b(eval|Function|setTimeout|setInterval|setImmediate)\b/,/\b(process|require|import|exports|module)\b/,/\b(window|document|global|globalThis)\b/,/\b(constructor|prototype|__proto__)\b/,/\b(Reflect|Proxy)\b/,/\bSymbol\b/,/\b(WeakMap|WeakSet|WeakRef|FinalizationRegistry)\b/,/\b(Generator|AsyncGenerator)\b/,/__\w+__/,/\.(bind|call|apply)\s*\(/,C,/\bdelete\s+/,/\bthis\b/],ue=new Set(["eval","Function","setTimeout","setInterval","setImmediate","process","require","import","exports","module","window","document","global","globalThis","constructor","prototype","Reflect","Proxy","Symbol","WeakMap","WeakSet","WeakRef","FinalizationRegistry","Generator","AsyncGenerator","delete","this",F]),q=new Set(["__proto__","constructor","prototype"]),ge=/[\w)\]]\s*\[\s*['"]/;function J(e){let r="",n=[],o=null,s=!1;for(let a=0;a<e.length;a++){let g=e[a];if(s){s=!1;continue}if(g==="\\"&&o){s=!0;continue}if(o){if(o==="`"&&g==="$"&&a+1<e.length&&e[a+1]==="{"){let u=1;a+=2;while(a<e.length&&u>0){if(e[a]==="{")u++;else if(e[a]==="}")u--;if(u>0)r+=e[a],n.push(a),a++}continue}if(g===o)o=null;continue}if(g==='"'||g==="'"||g==="`"){o=g;continue}r+=g,n.push(a)}return{text:r,map:n}}function fe(e){return J(e).text}var Y=["Collator","DateTimeFormat","DisplayNames","ListFormat","Locale","NumberFormat","PluralRules","RelativeTimeFormat","Segmenter"],Z=(()=>{let e={Date,URL,URLSearchParams},r=Intl;for(let n of Y)if(typeof r[n]==="function")e[`Intl_${n}`]=r[n];return Object.freeze(Object.assign(Object.create(null),e))})(),me=/^new(\s+)(Date|URLSearchParams|URL|Intl\s*\.\s*([A-Z_a-z]\w*))\s*\(/,j=/(?<![\w$])new(?![\w$])/g,B=`only new Date(), new URL(), new URLSearchParams() and new Intl.{${Y.join(",")}}() are allowed`;function pe(e){let{text:r,map:n}=J(e),o=[];j.lastIndex=0;let s;while((s=j.exec(r))!==null){let g=s.index;if(/(?<!\.)\.\s*$/.test(r.slice(0,g)))continue;let u=me.exec(r.slice(g)),d=u?.[3],f=!u?null:d?`Intl_${d}`:u[2];if(!u||!f||!(f in Z))throw new b(`matched /${C.source}/; ${B}`,e);let m=g+u[0].length,h=n[g],E=n[m-1]+1;if(e.slice(h,E)!==r.slice(g,m))throw new b(`matched /${C.source}/; ${B}`,e);let x=h+3+u[1].length;o.push({start:x,end:x+u[2].length,key:f})}let a=e;for(let g=o.length-1;g>=0;g--){let u=o[g];a=`${a.slice(0,u.start)}${F}.${u.key}${a.slice(u.end)}`}return{source:a,usesSafeConstructors:o.length>0}}class b extends Error{rule;expression;constructor(e,r,n){super(n??`Potentially unsafe expression (${e}): ${r}`);this.name="UnsafeExpressionError",this.rule=e,this.expression=r}}function bn(e){try{return T(e),null}catch(r){return r instanceof b?r.rule:r instanceof Error?r.message:String(r)}}function de(e,r){let n=/[$A-Z_a-z][$\w]*/g,o;while((o=n.exec(e))!==null){let s=o[0],a=e[o.index-1];if(ue.has(s))throw new b(`matched /\\b${s}\\b/; identifier ${s}`,r);if(a==="."&&q.has(s))throw new b(`matched /.${s}/; property ${s}`,r)}}function he(e){let r=/\[\s*(['"])(.*?)\1\s*\]/g,n;while((n=r.exec(e))!==null){let o=n[2];if(!q.has(o))continue;let s=e.slice(0,n.index).match(/\S(?=\s*$)/)?.[0],a=e.slice(n.index+n[0].length).match(/^\s*(\S)/)?.[1];if(!((s==="{"||s===",")&&a===":"))throw new b(`bracket key ${n[2]}`,e)}}function T(e){let r=e.trim(),n=fe(r);de(n,r),he(r);for(let o of H){if(o===C)continue;if(o.test(n))throw new b(`matched /${o.source}/`,r)}if(!G.allowBracketNotation&&ge.test(r))throw new b("bracket notation with a string key; enable with configureSafeEvaluator({ allowBracketNotation: true })",r,`Bracket notation with strings not allowed: ${r}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return pe(r)}function Ms(e){return T(e),e.trim()}function Ns(e){let r={};r.Math=Math,r.JSON=JSON,r.Date=Date,r.String=String,r.Number=Number,r.Boolean=Boolean,r.Array=Array,r.parseInt=Number.parseInt,r.parseFloat=Number.parseFloat,r.isNaN=Number.isNaN,r.isFinite=Number.isFinite,r.encodeURIComponent=encodeURIComponent,r.decodeURIComponent=decodeURIComponent;for(let[n,o]of Object.entries(e)){if(n.startsWith("__")||H.some((s)=>s.test(n)))continue;if(o&&typeof o==="object"&&!Array.isArray(o))r[n]=
|
|
27
|
+
`),"utf-8")}}async flush(){await this.writeQueue}}var P=new I,Rt={isDevelopment(){return O()},logDetailedError(e,r){if(!this.isDevelopment())return;if(console.error("=== stx Detailed Error ==="),console.error("Error:",e.message),console.error("Stack:",e.stack),r)console.error("Context:",r);console.error("========================")},createErrorReport(e,r){let n=["=== stx Error Report ===",`Time: ${new Date().toISOString()}`,`Error: ${e.message}`,`Type: ${e.constructor.name}`,`Stack: ${e.stack}`];if(r)n.push(`Context: ${JSON.stringify(r,null,2)}`);return n.push("========================"),n.join(`
|
|
28
|
+
`)}};var le={maxSanitizeDepth:10,allowBracketNotation:!1},G={...le};var C=/\bnew\s+/,F="__stx_safe_ctors",H=[/\b(eval|Function|setTimeout|setInterval|setImmediate)\b/,/\b(process|require|import|exports|module)\b/,/\b(window|document|global|globalThis)\b/,/\b(constructor|prototype|__proto__)\b/,/\b(Reflect|Proxy)\b/,/\bSymbol\b/,/\b(WeakMap|WeakSet|WeakRef|FinalizationRegistry)\b/,/\b(Generator|AsyncGenerator)\b/,/__\w+__/,/\.(bind|call|apply)\s*\(/,C,/\bdelete\s+/,/\bthis\b/],ue=new Set(["eval","Function","setTimeout","setInterval","setImmediate","process","require","import","exports","module","window","document","global","globalThis","constructor","prototype","Reflect","Proxy","Symbol","WeakMap","WeakSet","WeakRef","FinalizationRegistry","Generator","AsyncGenerator","delete","this",F]),q=new Set(["__proto__","constructor","prototype"]),ge=/[\w)\]]\s*\[\s*['"]/;function J(e){let r="",n=[],o=null,s=!1;for(let a=0;a<e.length;a++){let g=e[a];if(s){s=!1;continue}if(g==="\\"&&o){s=!0;continue}if(o){if(o==="`"&&g==="$"&&a+1<e.length&&e[a+1]==="{"){let u=1;a+=2;while(a<e.length&&u>0){if(e[a]==="{")u++;else if(e[a]==="}")u--;if(u>0)r+=e[a],n.push(a),a++}continue}if(g===o)o=null;continue}if(g==='"'||g==="'"||g==="`"){o=g;continue}r+=g,n.push(a)}return{text:r,map:n}}function fe(e){return J(e).text}var Y=["Collator","DateTimeFormat","DisplayNames","ListFormat","Locale","NumberFormat","PluralRules","RelativeTimeFormat","Segmenter"],Z=(()=>{let e={Date,URL,URLSearchParams},r=Intl;for(let n of Y)if(typeof r[n]==="function")e[`Intl_${n}`]=r[n];return Object.freeze(Object.assign(Object.create(null),e))})(),me=/^new(\s+)(Date|URLSearchParams|URL|Intl\s*\.\s*([A-Z_a-z]\w*))\s*\(/,j=/(?<![\w$])new(?![\w$])/g,B=`only new Date(), new URL(), new URLSearchParams() and new Intl.{${Y.join(",")}}() are allowed`;function pe(e){let{text:r,map:n}=J(e),o=[];j.lastIndex=0;let s;while((s=j.exec(r))!==null){let g=s.index;if(/(?<!\.)\.\s*$/.test(r.slice(0,g)))continue;let u=me.exec(r.slice(g)),d=u?.[3],f=!u?null:d?`Intl_${d}`:u[2];if(!u||!f||!(f in Z))throw new b(`matched /${C.source}/; ${B}`,e);let m=g+u[0].length,h=n[g],E=n[m-1]+1;if(e.slice(h,E)!==r.slice(g,m))throw new b(`matched /${C.source}/; ${B}`,e);let x=h+3+u[1].length;o.push({start:x,end:x+u[2].length,key:f})}let a=e;for(let g=o.length-1;g>=0;g--){let u=o[g];a=`${a.slice(0,u.start)}${F}.${u.key}${a.slice(u.end)}`}return{source:a,usesSafeConstructors:o.length>0}}class b extends Error{rule;expression;constructor(e,r,n){super(n??`Potentially unsafe expression (${e}): ${r}`);this.name="UnsafeExpressionError",this.rule=e,this.expression=r}}function bn(e){try{return T(e),null}catch(r){return r instanceof b?r.rule:r instanceof Error?r.message:String(r)}}function de(e,r){let n=/[$A-Z_a-z][$\w]*/g,o;while((o=n.exec(e))!==null){let s=o[0],a=e[o.index-1];if(ue.has(s))throw new b(`matched /\\b${s}\\b/; identifier ${s}`,r);if(a==="."&&q.has(s))throw new b(`matched /.${s}/; property ${s}`,r)}}function he(e){let r=/\[\s*(['"])(.*?)\1\s*\]/g,n;while((n=r.exec(e))!==null){let o=n[2];if(!q.has(o))continue;let s=e.slice(0,n.index).match(/\S(?=\s*$)/)?.[0],a=e.slice(n.index+n[0].length).match(/^\s*(\S)/)?.[1];if(!((s==="{"||s===",")&&a===":"))throw new b(`bracket key ${n[2]}`,e)}}function T(e){let r=e.trim(),n=fe(r);de(n,r),he(r);for(let o of H){if(o===C)continue;if(o.test(n))throw new b(`matched /${o.source}/`,r)}if(!G.allowBracketNotation&&ge.test(r))throw new b("bracket notation with a string key; enable with configureSafeEvaluator({ allowBracketNotation: true })",r,`Bracket notation with strings not allowed: ${r}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return pe(r)}function Ms(e){return T(e),e.trim()}function Ns(e){let r={};r.Math=Math,r.JSON=JSON,r.Date=Date,r.String=String,r.Number=Number,r.Boolean=Boolean,r.Array=Array,r.parseInt=Number.parseInt,r.parseFloat=Number.parseFloat,r.isNaN=Number.isNaN,r.isFinite=Number.isFinite,r.encodeURIComponent=encodeURIComponent,r.decodeURIComponent=decodeURIComponent;for(let[n,o]of Object.entries(e)){if(n.startsWith("__")||H.some((s)=>s.test(n)))continue;if(o&&typeof o==="object"&&!Array.isArray(o))r[n]=A(o);else r[n]=o}return r}function A(e,r=0){if(r>=G.maxSanitizeDepth)return"[Object too deep]";if(e===null||typeof e!=="object")return e;if(Array.isArray(e))return e.map((o)=>A(o,r+1));if(e instanceof Date||e instanceof RegExp||e instanceof Map||e instanceof Set||e instanceof Error)return e;let n={};for(let[o,s]of Object.entries(e)){if(o.startsWith("__")||o==="constructor"||o==="prototype")continue;if(s&&typeof s==="object")n[o]=A(s,r+1);else n[o]=s}return n}function c(e,r){try{let n=Ns(r),o=Object.keys(n),s=Object.values(n);return l(e,o)(...s)}catch{return}}function p(e){try{return Ms(e),!0}catch{return!1}}function D(e,r){try{let n=c(e,r);if(n&&typeof n==="object"&&!Array.isArray(n))return n;return{}}catch{return{}}}var Q=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","yield","let","static","implements","interface","package","private","protected","public","arguments","eval","await"]),Ee=2000,_=new Map;function V(e,r){let n=`${e.join(",")}\x00${r}`,o=_.get(n);if(o)return o;let s=Function(...e,r);if(_.size>=Ee)_.clear();return _.set(n,s),s}function Se(e){return e.replace(/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*`/g," ").replace(/\??\.\s*[a-zA-Z_$][\w$]*/g," ").replace(/([{,]\s*)[a-zA-Z_$][\w$]*(\s*:)/g,"$1$2").match(/\b[a-zA-Z_$][\w$]*\b/g)||[]}var xe=/^[A-Za-z_$][\w$]*$/;function Ze(e){return xe.test(e)&&!Q.has(e)}function l(e,r){let{source:n,usesSafeConstructors:o}=T(e),s=[];for(let f=0;f<r.length;f++){if(!Ze(r[f]))continue;if(r[f]===F)continue;s.push({key:r[f],index:f})}s.sort((f,m)=>f.key.localeCompare(m.key));let a=s.map((f)=>f.key),g=s.map((f)=>f.index),u=`
|
|
29
29
|
'use strict';
|
|
30
30
|
try {
|
|
31
31
|
return ${n};
|
|
@@ -37,4 +37,4 @@ catch (e) {
|
|
|
37
37
|
throw e;
|
|
38
38
|
}
|
|
39
39
|
`;return be(o?(f)=>{let m=V([F,...a,...f],u);return(...h)=>m(Z,...h)}:(f)=>V([...a,...f],u),a,r,s,g)}function be(e,r,n,o,s){let a=e([]),g=o.every((d,f)=>d.index===f);if(r.length===n.length&&g)return W(a,r,e);return W((...d)=>{let f=Array(s.length);for(let m=0;m<s.length;m++)f[m]=d[s[m]];return a(...f)},r,e,(d)=>{a=e(d)})}function W(e,r,n,o){let a=/^(\w+) is not defined$/,g=e,u=[],d=new Set(r);return(...f)=>{for(let m=0;m<=8;m++)try{return g(...f)}catch(h){let E=h instanceof Error?h.message:"",x=a.exec(E);if(!(h instanceof ReferenceError)||!x)return;let y=x[1];if(d.has(y)||Q.has(y))return;if(d.add(y),u.push(y),o)o(u);else g=n(u)}return}}function ar(e){let r=e.trim(),n=[/\beval\s*\(/i,/\bFunction\s*\(/i,/\bimport\s*\(/i,/\brequire\s*\(/i,/\bprocess\b/i,/\b__proto__\b/i,/\bconstructor\s*[.(]/i,/\bglobalThis\b/i,/\bwindow\b/i,/\bdocument\b/i,/\bfetch\s*\(/i,/\bBun\b/i,/\bDeno\b/i,/\bconsole\b/i,/\bthis\b/i,/\bReflect\b/i,/\bProxy\b/i,/\bprototype\b/i,/\.(bind|call|apply)\s*\(/i];for(let o of n)if(o.test(r))return!1;return!0}
|
|
40
|
-
export{t,X,yn,ir,i,te,Os,
|
|
40
|
+
export{t,X,yn,ir,i,te,Os,P,Rt,bn,Ms,Ns,c,p,D,Se,Ze,l,ar};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
function
|
|
2
|
+
function vo(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="id",dynamicHeight:d=!1,estimatedItemHeight:g=l,direction:x="vertical"}=c,e=[...v],t=0,n=new Map;function f(){if(d)return h();let i=Math.max(0,Math.floor(t/l)-s),r=Math.ceil(u/l),m=Math.min(e.length-1,i+r+s*2);return{startIndex:i,endIndex:m}}function h(){let i=0,r=0,m=e.length-1;for(let p=0;p<e.length;p++){let M=n.get(p)||g;if(i+M>t){r=Math.max(0,p-s);break}i+=M}i=0;for(let p=0;p<e.length;p++){let M=n.get(p)||g;if(i+=M,i>t+u){m=Math.min(e.length-1,p+s);break}}return{startIndex:r,endIndex:m}}function w(){if(d){let i=0;for(let r=0;r<e.length;r++)i+=n.get(r)||g;return i}return e.length*l}function y(i){if(d){let r=0;for(let m=0;m<i;m++)r+=n.get(m)||g;return r}return i*l}function S(){let{startIndex:i,endIndex:r}=f();return{startIndex:i,endIndex:r,scrollTop:t,totalHeight:w(),visibleItems:e.slice(i,r+1),itemHeights:new Map(n)}}function L(i,r="auto"){let m=y(i);a(m,r)}function a(i,r="auto"){t=Math.max(0,Math.min(i,w()-u))}function o(){f()}function H(i){e=[...i],n.clear(),o()}function I(){e=[],n.clear()}return{scrollToIndex:L,scrollToOffset:a,getState:S,refresh:o,setItems:H,destroy:I}}function wo(v,c={},l){let u=/@virtualList\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@endvirtualList/gi;return v.replace(u,(s,b,d,g)=>{let x=b.trim(),e=c[x];if(!e||!Array.isArray(e))return`<!-- virtualList: items "${x}" not found or not an array -->`;let t={itemHeight:50,containerHeight:400,overscan:3};if(d)try{let a=d.trim(),o=Function(`return ${a}`)();t={...t,...o}}catch{}let n=`vlist-${Math.random().toString(36).substring(2,9)}`,f=Math.ceil(t.containerHeight/t.itemHeight),h=t.overscan||3,w=0,y=Math.min(e.length-1,f+h),S="";for(let a=w;a<=y&&a<e.length;a++){let o=e[a],H=g.replace(/\{\{\s*item\s*\}\}/g,typeof o==="object"?JSON.stringify(o):String(o)).replace(/\{\{\s*item\.(\w+)\s*\}\}/g,(I,i)=>{if(typeof o==="object"&&o!==null)return String(o[i]??"");return""}).replace(/\{\{\s*index\s*\}\}/g,String(a));S+=`
|
|
3
3
|
<div class="virtual-item ${t.itemClass||""}"
|
|
4
4
|
style="position: absolute; top: ${a*t.itemHeight}px; height: ${t.itemHeight}px; width: 100%;"
|
|
5
5
|
data-index="${a}">
|
|
@@ -124,7 +124,7 @@ function wo(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="
|
|
|
124
124
|
0% { background-position: 200% 0; }
|
|
125
125
|
100% { background-position: -200% 0; }
|
|
126
126
|
}
|
|
127
|
-
`}function
|
|
127
|
+
`}function va(v,c){let l=null,u=()=>{if(!l)l=vo(v(),c);return l};return{visibleItems:()=>u().getState().visibleItems,totalHeight:()=>u().getState().totalHeight,containerProps:()=>({style:{height:`${c.containerHeight}px`,overflow:"auto",position:"relative"},onScroll:(s)=>{let b=s.target;if(l)l.scrollToOffset(b.scrollTop)}}),itemProps:(s)=>({style:{position:"absolute",top:`${s*c.itemHeight}px`,height:`${c.itemHeight}px`,width:"100%"},"data-index":s}),scrollToIndex:(s)=>{u().scrollToIndex(s)}}}function wa(v,c={},l){let u=/@infiniteList\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@loading\s*([\s\S]*?)@endinfiniteList/gi;return v.replace(u,(s,b,d,g,x)=>{let e=b.trim(),t=c[e];if(!t||!Array.isArray(t))return`<!-- infiniteList: items "${e}" not found or not an array -->`;let n={itemHeight:50,containerHeight:400,overscan:3,threshold:100,hasMore:!0};if(d)try{let w=Function(`return ${d.trim()}`)();n={...n,...w}}catch{}let f=`ilist-${Math.random().toString(36).substring(2,9)}`,h=wo(`@virtualList(${e}, ${JSON.stringify({itemHeight:n.itemHeight,containerHeight:n.containerHeight,overscan:n.overscan,containerClass:n.containerClass})})${g}@endvirtualList`,c);return h=h.replace("</script>",`
|
|
128
128
|
// Infinite scroll detection
|
|
129
129
|
container.addEventListener('scroll', function() {
|
|
130
130
|
const scrollBottom = container.scrollTop + container.clientHeight;
|
|
@@ -212,5 +212,5 @@ function wo(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="
|
|
|
212
212
|
});
|
|
213
213
|
})();
|
|
214
214
|
</script>
|
|
215
|
-
`})}var Pl={createVirtualList:
|
|
216
|
-
export{wo,
|
|
215
|
+
`})}var Pl={createVirtualList:vo,processVirtualListDirectives:wo,processInfiniteListDirectives:wa,processVirtualGridDirectives:xa,generateVirtualListCSS:ba,useVirtualList:va};
|
|
216
|
+
export{vo,wo,ba,va,wa,xa,Pl};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{De,Kt,sd}from"./chunk-5zm23zrb.js";import{V,Dn,Xt,jr,Br,On,od,id,ad,Gt,Jt,Fr,Mn,cd}from"./chunk-x81vcxzs.js";import"./chunk-g1r4v0mc.js";export{jr as batch,sd as default,Dn as derived,Xt as effect,De as generateSignalsRuntime,Kt as generateSignalsRuntimeDev,Jt as isDerived,Gt as isSignal,On as onDestroy,Br as onMount,Mn as peek,ad as pendingLifecycleCounts,id as runDestroyCallbacks,od as runMountCallbacks,V as state,Fr as untrack,cd as useOptimistic};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{p,l}from"./chunk-
|
|
2
|
+
import{p,l}from"./chunk-g495xx4v.js";import{b}from"./chunk-96kr2xrt.js";function y(t,o){let i=1,r=o,e="<template",n="</template";while(r<t.length&&i>0){let s=t.indexOf("<",r);if(s===-1)break;if(r=s,t.startsWith(e,r)&&(r+e.length>=t.length||/[\s>\/]/.test(t[r+e.length]))){i++,r+=e.length;continue}if(t.startsWith(n,r)){let a=t.indexOf(">",r+n.length);if(a!==-1){if(i--,i===0)return a+1;r=a+1;continue}}r++}return i===0?r:-1}var w=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function x(t,o){let i=null;for(let r=o;r<t.length;r++){let e=t[r];if(i){if(e==="\\"){r++;continue}if(e===i)i=null;continue}if(e==='"'||e==="'"){i=e;continue}if(e===">")return r+1}return-1}function N(t,o,i){let r=o.toLowerCase(),e=1,n=i;while(n<t.length){let s=t.indexOf("<",n);if(s===-1)return-1;if(t.startsWith("<!--",s)){let g=t.indexOf("-->",s+4);n=g===-1?t.length:g+3;continue}let a=x(t,s+1);if(a===-1)return-1;let f=t.slice(s,a),u=f.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(u&&u[2].toLowerCase()===r){if(u[1]==="/"){if(e--,e===0)return a}else if(!/\/\s*>$/.test(f))e++}n=a}return-1}function A(t){let o=[],i=[],r=/\bslot\s*=\s*(?:"([^"]+)"|'([^']+)')/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let c=t.indexOf("-->",n+4);e=c===-1?t.length:c+3;continue}let s=x(t,n+1);if(s===-1)break;let a=t.slice(n,s),f=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!f){e=s;continue}let u=f[2].toLowerCase();if(f[1]==="/"){let c=i.lastIndexOf(u);if(c!==-1)i.splice(c);e=s;continue}let g=/\/\s*>$/.test(a),d=i.length===0?a.match(r):null;if(d){let c=d[1]||d[2],m=a.replace(r,"").replace(/\s+(?=\/?>$)/,"").replace(/\s{2,}/g," "),h=g||w.has(u)?-1:N(t,u,s);if(h===-1)o.push({start:n,end:s,slotName:c,element:m}),e=s;else o.push({start:n,end:h,slotName:c,element:m+t.slice(s,h)}),e=h;continue}if(!g&&!w.has(u)){if(i.push(u),u==="script"||u==="style"){let c=t.toLowerCase().indexOf(`</${u}>`,s);if(c!==-1){e=c;continue}}}e=s}return o}function O(t){let o=[],i=[],r=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let c=t.indexOf("-->",n+4);e=c===-1?t.length:c+3;continue}let s=x(t,n+1);if(s===-1)break;let a=t.slice(n,s),f=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!f){e=s;continue}let u=f[1]==="/",g=f[2].toLowerCase();if(u){let c=i.lastIndexOf(g);if(c!==-1)i.splice(c);e=s;continue}if(g==="template"&&i.length===0){let c=a.match(r);if(c){let m=y(t,s);if(m!==-1){let h=c[1]||c[2]||c[3];o.push({start:n,end:m,slotName:h,content:t.slice(s,m-11).trim(),propsBinding:c[4]||void 0}),e=m;continue}}}if(!/\/\s*>$/.test(a)&&!w.has(g)){if(i.push(g),g==="script"||g==="style"){let c=t.toLowerCase().indexOf(`</${g}>`,s);if(c!==-1){e=c;continue}}}e=s}return o}function aa(t){let o={default:"",named:new Map},i=t,r=O(t);for(let n of r)o.named.set(n.slotName,{name:n.slotName,content:n.content,propsBinding:n.propsBinding});r.sort((n,s)=>s.start-n.start);for(let n of r)i=i.slice(0,n.start)+i.slice(n.end);let e=A(i);for(let n of e){let s=o.named.get(n.slotName);if(s)s.content+=n.element;else o.named.set(n.slotName,{name:n.slotName,content:n.element})}for(let n=e.length-1;n>=0;n--){let s=e[n];i=i.slice(0,s.start)+i.slice(s.end)}return o.default=i.trim(),o}function xl(t){let o=t.match(/name\s*=\s*["']([^"']+)["']/),i=o?o[1]:"",r={},e=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,n;while((n=e.exec(t))!==null)r[n[1]]=n[2];let s=t.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),a=s?s[1].trim():"";return{name:i,props:r,defaultContent:a}}async function ca(t,o,i,r){if(!t)return i;let e=t.content;if(t.propsBinding&&Object.keys(o).length>0){let n=t.propsBinding.trim(),s={...r};if(n.startsWith("{")&&n.endsWith("}")){let a=n.slice(1,-1).split(",").map((f)=>f.trim()).filter(Boolean);for(let f of a){let[u,g]=f.split(":").map((c)=>c.trim()),d=g||u;if(o[u]!==void 0)s[d]=o[u]}}else s[n]=o;e=C(e,s)}return e}function C(t,o){return t.replace(/\{\{\s*([^}]+)\s*\}\}/g,(i,r)=>{try{let e=r.trim(),n=k(e,o);return b(String(n??""))}catch{return`{{ ${r} }}`}})}function k(t,o){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(t)){let r=t.split("."),e=o;for(let n of r)if(e&&typeof e==="object"&&n in e)e=e[n];else return;return e}let i=t.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(i){let[,r,e,n]=i,s=o[r],a=parseInt(n,10);if(typeof s==="number")switch(e){case"+":return s+a;case"-":return s-a;case"*":return s*a;case"/":return s/a}}try{if(!p(t))return;return l(t,Object.keys(o))(...Object.values(o))}catch{return}}async function la(t,o,i){let r=t;r=await M(r,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(s,a,f,u)=>{let g=o.named.get(a),d=u?.trim()||"",c=f||"",m={},h=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,S;while((S=h.exec(c))!==null){let E=S[1],R=S[2];m[E]=k(R,i)}return await ca(g,m,d,i)});let n=/<slot\b((?:"[^"]*"|'[^']*'|[^>"'])*?)\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return r=r.replace(n,(s,a,f)=>{if(/\bname\s*=/.test(a||""))return s;let u=f?.trim()||"";return o.default||u}),r}async function M(t,o,i){let r=[],e=[];t.replace(o,(a,...f)=>{let u=f[f.length-2];return e.push({match:a,index:u}),r.push(i(a,...f.slice(0,-2))),a});let n=await Promise.all(r),s=t;for(let a=e.length-1;a>=0;a--){let{match:f,index:u}=e[a];s=s.slice(0,u)+n[a]+s.slice(u+f.length)}return s}function Sl(t){let o=aa(t);return{defaultSlot:o.default,namedSlots:o.named}}async function kl(t,o,i,r){return await la(t,{default:o,named:i},r)}
|
|
3
3
|
export{aa,xl,ca,la,Sl,kl};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{on,gc,as}from"./chunk-96kr2xrt.js";import"./chunk-68tzytfz.js";import"./chunk-c57j92td.js";import"./chunk-kp4mzspk.js";import"./chunk-v74acg2k.js";import"./chunk-zz5b1g50.js";import"./chunk-5tbqdz94.js";import"./chunk-9p3rtfbv.js";import{Se}from"./chunk-g495xx4v.js";import"./chunk-ba88n1j7.js";import"./chunk-g1r4v0mc.js";import"./chunk-xd4zvm4x.js";import"./chunk-e6y6s7q8.js";export{Se as freeIdentifiers,as as processComponents,gc as processESImports,on as rendersAsElement};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ln,Oe,Bo,Wa}from"./chunk-
|
|
2
|
+
import{Ln,Oe,Bo,Wa}from"./chunk-qv57r0fa.js";export{Ln as generateServiceWorker,Wa as generateServiceWorkerAuto,Oe as getServiceWorkerFileName,Bo as isWorkboxEnabled};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{u,ps,ci,li,Tc,_c,Rc,Ac,Pc,Ic,Ue,L,We,Dc,Xn,Oc,fi,Mc,qe,r,Gn,gi,g,ee,Jd}from"./chunk-96kr2xrt.js";import"./chunk-68tzytfz.js";import"./chunk-c57j92td.js";import"./chunk-kp4mzspk.js";import"./chunk-v74acg2k.js";import"./chunk-zz5b1g50.js";import"./chunk-5tbqdz94.js";import"./chunk-9p3rtfbv.js";import"./chunk-g495xx4v.js";import"./chunk-ba88n1j7.js";import"./chunk-g1r4v0mc.js";import"./chunk-xd4zvm4x.js";import"./chunk-e6y6s7q8.js";export{ee as clearComponentCache,Mc as componentClientSignalNames,ps as convertToCommonJS,g as createDetailedErrorMessage,Pc as extractDirectiveNames,ci as extractScriptFromTemplate,u as extractVariables,r as fileExists,Jd as getComponentCacheStats,_c as getPositionInfo,L as getSharedTranspiler,gi as getSourceLineInfo,Ac as hasDirectives,li as hasVariables,Oc as isHydrateTrigger,Ic as isJavaScriptScript,qe as renderComponentWithSlot,Gn as resolveTemplatePath,Dc as scopeOnRootElement,Ue as shouldTranspileTypeScript,fi as slotContentHasExpressions,We as transpileTypeScript,Xn as userComponentFileExists,Rc as validateDirective,Tc as validateTemplate};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import"./chunk-g495xx4v.js";import"./chunk-c57j92td.js";import"./chunk-xd4zvm4x.js";import{cr,js,Bi}from"./chunk-g1r4v0mc.js";import"./chunk-ba88n1j7.js";import{Hn,qn,n,o}from"./chunk-96kr2xrt.js";import"./chunk-9p3rtfbv.js";import"./chunk-5tbqdz94.js";import"./chunk-zz5b1g50.js";import"./chunk-v74acg2k.js";import"./chunk-e6y6s7q8.js";import"./chunk-kp4mzspk.js";import{De}from"./chunk-5zm23zrb.js";import"./chunk-68tzytfz.js";import{existsSync as Z,mkdirSync as tn,readFileSync as nn}from"fs";import C from"path";import{existsSync as Ke,mkdirSync as Qt}from"fs";import D from"path";import{existsSync as Kt}from"fs";import H from"path";var et="data-stx-b",xe=new Set(js),tt=new Set(cr);function nt(r){if(r==="ref"||r==="data-stx-ref")return"ref";if(r.startsWith("::"))return null;if(r.startsWith("@bind:")||r.startsWith("x-bind:"))return"attr";if(r.startsWith("@")||r.startsWith(":")){let e=r.slice(1).split(".")[0];if(xe.has(e))return e==="if"?"if":e;if(e==="for"||e==="else"||e==="else-if"||e==="elseif")return"for";if(Bi(e))return"event";if(r.startsWith("@"))return"event";return"attr"}if(r.startsWith("x-")){let e=r.split(".")[0];if(!tt.has(e))return"attr";let t=e.slice(2);if(t==="cloak"||t==="data"||t==="bind")return null;if(t==="tooltip"||t==="tooltip-position")return null;return xe.has(t)?t==="if"?"if":t:"attr"}return null}function rt(r){let e=[];for(let[t,i]of r){let s=nt(t);if(s)e.push({name:t,value:i,kind:s})}return e}var it=/<([a-z][\w-]*)((?:\s+[^\s"'=<>/]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)*)\s*\/?>/gi,ne=/([^\s"'=<>/]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g;function Ne(r){let e=[],t=0;return{html:r.replace(it,(s,a,c)=>{if(!c||!/[:@]|x-/.test(c))return s;let u=[];ne.lastIndex=0;for(let h=ne.exec(c);h;h=ne.exec(c))u.push([h[1],h[2]??h[3]??h[4]??""]);let l=rt(u);if(!l.length)return s;let p={id:t++,bindings:l};if(l.some((h)=>h.kind==="for"))p.template=!0;e.push(p);let g=s.endsWith("/>");return`${s.slice(0,g?-2:-1).trimEnd()} ${et}="${p.id}"${g?"/>":">"}`}),manifest:{entries:e}}}var ie={svg:"Svg",g:"G",path:"Path",line:"Line",rect:"Rect",circle:"Circle",ellipse:"Ellipse",polyline:"Polyline",polygon:"Polygon",text:"SvgText",tspan:"SvgText"},oe=new Set(Object.values(ie));var Ee=new Set(["defs","title","desc","metadata","style","symbol","use","clippath","mask","lineargradient","radialgradient","stop","pattern","marker","filter","foreignobject"]),Re=["viewBox","preserveAspectRatio","strokeWidth","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","fillOpacity","fillRule","vectorEffect","textAnchor","dominantBaseline","fontSize","fontWeight"];function k(r){let e=typeof r==="number"?r:Number.parseFloat(String(r??""));return Number.isFinite(e)?e:0}function V(r){return Math.round(r*1000)/1000}function se(r){if(Array.isArray(r)&&r.length===4&&r.every((t)=>Number.isFinite(Number(t))))return r.map(Number);let e=String(r??"").trim().split(/[\s,]+/).map(Number);if(e.length!==4||e.some((t)=>!Number.isFinite(t))||e[2]<=0||e[3]<=0)return null;return e}function ot(r){let e=String(r??"").trim().split(/[\s,]+/).filter(Boolean).map(Number).filter(Number.isFinite);return e.length%2?e.slice(0,-1):e}var Te=/[MLHVCSQTAZ]/i,re=/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi;function st(r){let e=[],t=r,i=Te.exec(t);while(i){let s=i.index;t=t.slice(s);let a=t[0];t=t.slice(1);let c=Te.exec(t),u=c?t.slice(0,c.index):t,l;if(a==="A"||a==="a"){l=[];let p=0,g=u.trim(),d=0;while(d<g.length){let h=p%7,b=g.slice(d).replace(/^[\s,]+/,"");if(d=g.length-b.length,!b)break;if(h===3||h===4)l.push(b[0]==="1"?1:0),d+=1;else{re.lastIndex=0;let v=re.exec(b);if(!v||v.index!==0)break;l.push(Number.parseFloat(v[0])),d+=v[0].length}p++}}else l=(u.match(re)||[]).map(Number.parseFloat);e.push({command:a,args:l}),i=c}return e}function at(r,e,t,i,s,a,c,u,l){if(r===u&&e===l)return[];let p=Math.abs(t),g=Math.abs(i);if(!p||!g)return[1,u,l];let d=s*Math.PI/180,h=Math.cos(d),b=Math.sin(d),v=(r-u)/2,S=(e-l)/2,f=h*v+b*S,y=-b*v+h*S,w=f*f/(p*p)+y*y/(g*g);if(w>1)p*=Math.sqrt(w),g*=Math.sqrt(w);let E=p*p*g*g-p*p*y*y-g*g*f*f,m=p*p*y*y+g*g*f*f,R=Math.sqrt(Math.max(0,E/m));if(a===c)R=-R;let T=R*(p*y)/g,x=R*-(g*f)/p,I=h*T-b*x+(r+u)/2,O=b*T+h*x+(e+l)/2,P=(A,_,B,X)=>{let ee=A*X-_*B<0?-1:1,te=(A*B+_*X)/(Math.hypot(A,_)*Math.hypot(B,X));return ee*Math.acos(Math.min(1,Math.max(-1,te)))},z=P(1,0,(f-T)/p,(y-x)/g),M=P((f-T)/p,(y-x)/g,(-f-T)/p,(-y-x)/g);if(!c&&M>0)M-=2*Math.PI;if(c&&M<0)M+=2*Math.PI;let q=Math.max(1,Math.ceil(Math.abs(M)/(Math.PI/2))),me=M/q,U=1.3333333333333333*Math.tan(me/4),be=[],ye=(A)=>{let _=p*Math.cos(A),B=g*Math.sin(A);return[h*_-b*B+I,b*_+h*B+O]},Se=(A)=>{let _=-p*Math.sin(A),B=g*Math.cos(A);return[h*_-b*B,b*_+h*B]},G=z;for(let A=0;A<q;A++){let _=G+me,[B,X]=ye(G),[ee,te]=Se(G),[ve,we]=ye(_),[Qe,Ze]=Se(_);be.push(2,B+U*ee,X+U*te,ve-U*Qe,we-U*Ze,A===q-1?u:ve,A===q-1?l:we),G=_}return be}function ct(r){let e=[],t=0,i=0,s=0,a=0,c=0,u=0,l=0,p=0,g="";for(let{command:d,args:h}of st(String(r??""))){let b=d===d.toLowerCase(),v=d.toUpperCase(),S=()=>b?t:0,f=()=>b?i:0,y=0,w=(m)=>{if(y+m>h.length)return null;let R=h.slice(y,y+m);return y+=m,R};if(v==="Z"){e.push(4),t=s,i=a,g="Z";continue}let E=!0;while(y<h.length||E&&v==="Z"){switch(v){case"M":{let m=w(2);if(!m)return e;if(t=m[0]+S(),i=m[1]+f(),E)e.push(0,t,i),s=t,a=i;else e.push(1,t,i);g=E?"M":"L";break}case"L":{let m=w(2);if(!m)return e;t=m[0]+S(),i=m[1]+f(),e.push(1,t,i),g="L";break}case"H":{let m=w(1);if(!m)return e;t=m[0]+S(),e.push(1,t,i),g="L";break}case"V":{let m=w(1);if(!m)return e;i=m[0]+f(),e.push(1,t,i),g="L";break}case"C":{let m=w(6);if(!m)return e;let R=m[0]+S(),T=m[1]+f();c=m[2]+S(),u=m[3]+f(),t=m[4]+S(),i=m[5]+f(),e.push(2,R,T,c,u,t,i),g="C";break}case"S":{let m=w(4);if(!m)return e;let R=g==="C"?2*t-c:t,T=g==="C"?2*i-u:i;c=m[0]+S(),u=m[1]+f(),t=m[2]+S(),i=m[3]+f(),e.push(2,R,T,c,u,t,i),g="C";break}case"Q":{let m=w(4);if(!m)return e;l=m[0]+S(),p=m[1]+f(),t=m[2]+S(),i=m[3]+f(),e.push(3,l,p,t,i),g="Q";break}case"T":{let m=w(2);if(!m)return e;l=g==="Q"?2*t-l:t,p=g==="Q"?2*i-p:i,t=m[0]+S(),i=m[1]+f(),e.push(3,l,p,t,i),g="Q";break}case"A":{let m=w(7);if(!m)return e;let R=m[5]+S(),T=m[6]+f();e.push(...at(t,i,m[0],m[1],m[2],m[3],m[4],R,T)),t=R,i=T,g="A";break}default:return e}E=!1}}return e.map((d)=>V(d))}function ke(r,e,t,i){if(t<=0||i<=0)return[];let s=0.5522847498;return[0,r+t,e,2,r+t,e+s*i,r+s*t,e+i,r,e+i,2,r-s*t,e+i,r-t,e+s*i,r-t,e,2,r-t,e-s*i,r-s*t,e-i,r,e-i,2,r+s*t,e-i,r+t,e-s*i,r+t,e,4].map(V)}function ae(r,e){switch(r){case"Path":return ct(String(e.d??""));case"Line":return[0,k(e.x1),k(e.y1),1,k(e.x2),k(e.y2)].map(V);case"Rect":{let t=k(e.x),i=k(e.y),s=k(e.width),a=k(e.height);if(s<=0||a<=0)return[];let c=e.rx===void 0?k(e.ry):k(e.rx),u=e.ry===void 0?c:k(e.ry);if(c=Math.min(Math.max(0,c),s/2),u=Math.min(Math.max(0,u),a/2),!c||!u)return[0,t,i,1,t+s,i,1,t+s,i+a,1,t,i+a,4].map(V);let l=0.5522847498;return[0,t+c,i,1,t+s-c,i,2,t+s-c+l*c,i,t+s,i+u-l*u,t+s,i+u,1,t+s,i+a-u,2,t+s,i+a-u+l*u,t+s-c+l*c,i+a,t+s-c,i+a,1,t+c,i+a,2,t+c-l*c,i+a,t,i+a-u+l*u,t,i+a-u,1,t,i+u,2,t,i+u-l*u,t+c-l*c,i,t+c,i,4].map(V)}case"Circle":return ke(k(e.cx),k(e.cy),k(e.r),k(e.r));case"Ellipse":return ke(k(e.cx),k(e.cy),k(e.rx),k(e.ry));case"Polyline":case"Polygon":{let t=ot(e.points);if(t.length<4)return[];let i=[0,t[0],t[1]];for(let s=2;s<t.length;s+=2)i.push(1,t[s],t[s+1]);if(r==="Polygon")i.push(4);return i.map(V)}default:return null}}var lt=[...Re,"accessibilityHint","accessibilityLabel","accessibilityRole","accessibilityState","accessibilityValue","activeOpacity","alwaysBounceHorizontal","alwaysBounceVertical","animationType","autoCapitalize","autoComplete","autoCorrect","autoFocus","blurRadius","contentContainerStyle","defaultSource","defaultValue","ellipsizeMode","fadeDuration","hidesWhenStopped","hitSlop","imageStyle","initialNumToRender","iosBackgroundColor","keyboardDismissMode","keyboardShouldPersistTaps","keyboardType","keyboardVerticalOffset","keyExtractor","maxLength","maximumDate","maximumTrackTintColor","maximumValue","maxToRenderPerBatch","minimumDate","minimumTrackTintColor","minimumValue","minuteInterval","numberOfLines","numColumns","onEndReachedThreshold","pagingEnabled","passwordRules","placeholderTextColor","pointerEvents","presentationStyle","pressRetentionOffset","progressBackgroundColor","progressViewOffset","refreshControl","resizeMode","returnKeyType","scrollEnabled","scrollTarget","secureTextEntry","selectedValue","selectionColor","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","statusBarTranslucent","stickyHeaderIndices","testID","textContentType","thumbColor","thumbTintColor","titleColor","trackColor","underlayColor","windowSize"],Ae=new Set(["animating","autoCorrect","autoFocus","autoplay","autoPlay","bounces","controls","disabled","editable","hidesWhenStopped","horizontal","loop","multiline","muted","pagingEnabled","paused","refreshing","scrollEnabled","secureTextEntry","selectTextOnFocus","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","transparent","visible"]),dt=new Map(lt.map((r)=>[_e(r),r]));function _e(r){return r.replace(/[-_]/g,"").toLowerCase()}function ce(r){return dt.get(_e(r))??r}var ut={view:"View",text:"Text",button:"Button",image:"Image",img:"Image",video:"Video",input:"TextInput",textarea:"TextInput",scroll:"ScrollView",scrollview:"ScrollView",list:"FlatList",flatlist:"FlatList",modal:"Modal",switch:"Switch",slider:"Slider",picker:"Picker",select:"Picker",loading:"ActivityIndicator",spinner:"ActivityIndicator",div:"View",span:"Text",p:"Text",h1:"Text",h2:"Text",h3:"Text",h4:"Text",h5:"Text",h6:"Text",a:"TouchableOpacity",section:"View",article:"View",header:"SafeAreaView",footer:"View",main:"View",nav:"View",aside:"View",form:"View",label:"Text",fieldset:"View",legend:"Text",option:"Text",dialog:"Modal",figure:"View",figcaption:"Text",picture:"View",hr:"View",ul:"View",ol:"View",li:"View",dl:"View",dt:"Text",dd:"Text",table:"View",thead:"View",tbody:"View",tfoot:"View",tr:"View",th:"Text",td:"Text",caption:"Text",strong:"Text",b:"Text",em:"Text",i:"Text",u:"Text",s:"Text",small:"Text",mark:"Text",abbr:"Text",time:"Text",code:"Text",kbd:"Text",samp:"Text",pre:"Text",blockquote:"Text",cite:"Text",q:"Text",sub:"Text",sup:"Text"};function Ie(r){return ut[r.toLowerCase()]||r}var ft={activity:"waveform.path.ecg","alarm-clock":"alarm","alert-circle":"exclamationmark.circle","alert-triangle":"exclamationmark.triangle",archive:"archivebox",armchair:"sofa","arrow-down":"arrow.down","arrow-left":"arrow.left","arrow-right":"arrow.right","arrow-up":"arrow.up","arrow-up-right":"arrow.up.right","at-sign":"at","audio-lines":"waveform",award:"rosette",backpack:"backpack","badge-check":"checkmark.seal","badge-x":"xmark.seal",ban:"nosign","bar-chart":"chart.bar","bar-chart-2":"chart.bar","bar-chart-3":"chart.bar",battery:"battery.100","battery-charging":"battery.100.bolt",bed:"bed.double",bell:"bell","bell-off":"bell.slash","bell-ring":"bell.and.waves.left.and.right",bike:"figure.outdoor.cycle",blocks:"square.grid.2x2",bluetooth:"antenna.radiowaves.left.and.right",book:"book","book-open":"book",bookmark:"bookmark",box:"shippingbox",brain:"brain",building:"building","building-2":"building.2",cable:"cable.connector",calendar:"calendar","calendar-check":"calendar.badge.checkmark","calendar-clock":"calendar.badge.clock","calendar-days":"calendar","calendar-minus":"calendar.badge.minus","calendar-minus-2":"calendar.badge.minus","calendar-off":"calendar.badge.exclamationmark","calendar-plus":"calendar.badge.plus","calendar-range":"calendar","calendar-sync":"arrow.triangle.2.circlepath","calendar-x":"calendar.badge.exclamationmark","calendar-x-2":"calendar.badge.exclamationmark",camera:"camera","chart-bar":"chart.bar","chart-column":"chart.bar","chart-line":"chart.xyaxis.line","chart-no-axes-gantt":"chart.bar.doc.horizontal",check:"checkmark","check-circle":"checkmark.circle","check-circle-2":"checkmark.circle","chevron-down":"chevron.down","chevron-left":"chevron.left","chevron-right":"chevron.right","chevron-up":"chevron.up",circle:"circle","circle-alert":"exclamationmark.circle","circle-arrow-down":"arrow.down.circle","circle-check":"checkmark.circle","circle-check-big":"checkmark.circle","circle-dot":"smallcircle.filled.circle","circle-help":"questionmark.circle","circle-play":"play.circle","circle-plus":"plus.circle","circle-user":"person.crop.circle","circle-x":"xmark.circle",clapperboard:"film",clipboard:"clipboard","clipboard-list":"list.clipboard",clock:"clock","clock-12":"clock","clock-2":"clock","clock-3":"clock","clock-4":"clock","clock-8":"clock",cloud:"cloud","cloud-off":"icloud.slash",coffee:"cup.and.saucer",copy:"doc.on.doc","credit-card":"creditcard",cylinder:"cylinder",disc:"opticaldisc",download:"arrow.down.circle",droplet:"drop",droplets:"drop",dumbbell:"dumbbell",edit:"pencil","external-link":"arrow.up.right.square",eye:"eye","eye-off":"eye.slash",file:"doc","file-text":"doc.text",filter:"line.3.horizontal.decrease",flag:"flag",flame:"flame","flower-2":"camera.macro",footprints:"figure.run",gauge:"gauge",gift:"gift",globe:"globe","graduation-cap":"graduationcap","grip-vertical":"line.3.horizontal","hand-fist":"hand.raised",heart:"heart","heart-off":"heart.slash","heart-pulse":"heart.text.square","help-circle":"questionmark.circle",history:"clock.arrow.circlepath",home:"house",hourglass:"hourglass",house:"house","id-card":"person.text.rectangle",image:"photo",inbox:"tray",info:"info.circle",layers:"square.3.layers.3d","layout-dashboard":"rectangle.3.group","layout-grid":"square.grid.2x2",leaf:"leaf",library:"books.vertical",link:"link",list:"list.bullet","list-checks":"checklist",loader:"arrow.triangle.2.circlepath","loader-2":"arrow.triangle.2.circlepath","loader-circle":"arrow.triangle.2.circlepath",lock:"lock","log-in":"arrow.right.to.line","log-out":"rectangle.portrait.and.arrow.right",mail:"envelope",map:"map","map-pin":"mappin.and.ellipse",medal:"medal",megaphone:"megaphone",menu:"line.3.horizontal","message-circle":"bubble.left","message-square":"text.bubble","message-square-quote":"quote.bubble",mic:"mic",minus:"minus",moon:"moon","more-horizontal":"ellipsis","more-vertical":"ellipsis",mountain:"mountain.2",music:"music.note","music-2":"music.note",package:"shippingbox",pause:"pause","pause-circle":"pause.circle",pencil:"pencil","person-standing":"figure.walk",phone:"phone",play:"play.fill",plug:"powerplug",plus:"plus","plus-circle":"plus.circle","rectangle-horizontal":"rectangle","refresh-cw":"arrow.clockwise",repeat:"repeat","rotate-ccw":"arrow.counterclockwise",route:"point.topleft.down.to.point.bottomright.curvepath",ruler:"ruler",sailboat:"sailboat",satellite:"antenna.radiowaves.left.and.right",save:"square.and.arrow.down",scale:"scalemass","scan-line":"barcode.viewfinder",search:"magnifyingglass",send:"paperplane",settings:"gearshape","settings-2":"slider.horizontal.3",share:"square.and.arrow.up","share-2":"square.and.arrow.up",shield:"shield","shield-check":"checkmark.shield","shopping-bag":"bag","shopping-cart":"cart",shuffle:"shuffle","skip-back":"backward.end","skip-forward":"forward.end",sliders:"slider.horizontal.3","sliders-horizontal":"slider.horizontal.3",smartphone:"iphone",snowflake:"snowflake",sparkles:"sparkles",sprout:"leaf",square:"square",star:"star",stopwatch:"stopwatch",store:"storefront","stretch-horizontal":"rectangle.split.1x2",sun:"sun.max",sunrise:"sunrise",sunset:"sunset",tag:"tag",target:"scope",thermometer:"thermometer.medium","thumbs-up":"hand.thumbsup",timer:"timer",trash:"trash","trash-2":"trash","trending-down":"chart.line.downtrend.xyaxis","trending-up":"chart.line.uptrend.xyaxis","triangle-alert":"exclamationmark.triangle",trophy:"trophy",unlink:"personalhotspot.slash",upload:"arrow.up.circle",user:"person","user-check":"person.crop.circle.badge.checkmark","user-minus":"person.badge.minus","user-plus":"person.badge.plus","user-round":"person","user-round-check":"person.crop.circle.badge.checkmark","user-round-minus":"person.crop.circle.badge.minus","user-round-plus":"person.crop.circle.badge.plus","user-round-x":"person.crop.circle.badge.xmark","user-x":"person.crop.circle.badge.xmark",users:"person.2","users-round":"person.2",video:"video","volume-2":"speaker.wave.2",warehouse:"building.2",watch:"applewatch",waves:"figure.pool.swim",weight:"scalemass",wifi:"wifi","wifi-off":"wifi.slash",wind:"wind",x:"xmark","x-circle":"xmark.circle",zap:"bolt"};function le(r,e=!1){let t=String(r??"").trim();if(!t)return{symbol:"circle",known:!1};if(e)return{symbol:t,known:!0};let i=/^i-([a-z0-9]+)-(.+)$/.exec(t)??/^([a-z0-9]+):(.+)$/.exec(t),s=i?i[1]:"lucide",a=i?i[2]:t;if(s==="lucide"){let c=ft[a];if(c)return{symbol:c,iconify:`i-lucide-${a}`,known:!0};if(!i&&t.includes("."))return{symbol:t,known:!0}}return{symbol:"circle",iconify:i?t:`i-lucide-${a}`,known:!1}}var pt={transparent:"transparent",current:"currentColor",black:"#000000",white:"#ffffff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"}},Be={px:1,0:0,0.5:2,1:4,1.5:6,2:8,2.5:10,3:12,3.5:14,4:16,5:20,6:24,7:28,8:32,9:36,10:40,11:44,12:48,14:56,16:64,20:80,24:96,28:112,32:128,36:144,40:160,44:176,48:192,52:208,56:224,60:240,64:256,72:288,80:320,96:384},Pe={xs:12,sm:14,base:16,lg:18,xl:20,"2xl":24,"3xl":30,"4xl":36,"5xl":48,"6xl":60,"7xl":72,"8xl":96,"9xl":128},L={none:0,sm:2,DEFAULT:4,md:6,lg:8,xl:12,"2xl":16,"3xl":24,full:9999};function F(r){let e=r.lastIndexOf("/");if(e>0&&!r.endsWith("]")){let i=F(r.slice(0,e)),s=r.slice(e+1),a=/^\[(.+)\]$/.test(s)?Number.parseFloat(s.slice(1,-1))*(s.includes("%")?1:100):Number.parseFloat(s);if(!i||!Number.isFinite(a))return;return gt(i,a/100)}if(r==="transparent")return"transparent";if(r==="current")return"currentColor";if(r==="black")return"#000000";if(r==="white")return"#ffffff";let t=r.split("-");if(t.length===2){let[i,s]=t,a=pt[i];if(a&&typeof a==="object")return a[s]}if(r.startsWith("[")&&r.endsWith("]")){let i=r.slice(1,-1);return/^(#|rgba?\(|hsla?\(|[a-z]+$)/i.test(i)?i:void 0}return}function gt(r,e){if(r==="transparent")return r;let t=r.startsWith("#")?r.slice(1):"";if(t.length===3)t=t.split("").map((s)=>s+s).join("");if(t.length===8)t=t.slice(0,6);if(t.length!==6)return;let i=Math.round(Math.min(1,Math.max(0,e))*255);return`#${t}${i.toString(16).padStart(2,"0")}`}function de(r,e=16){if(!r.startsWith("[")||!r.endsWith("]"))return;let t=r.slice(1,-1),i=Number.parseFloat(t);if(!Number.isFinite(i))return;if(t.endsWith("rem"))return i*16;if(t.endsWith("em"))return i*e;return i}function N(r){if(r.startsWith("[")&&r.endsWith("]")){let e=r.slice(1,-1),t=e.endsWith("rem")?Number.parseFloat(e)*16:Number.parseFloat(e);return Number.isFinite(t)?t:void 0}return Be[r]}var ht={flex:(r,e)=>(e.display="flex",!0),hidden:(r,e)=>(e.display="none",!0),grid:(r,e)=>(e.display="grid",!0),"flex-row":(r,e)=>(e.flexDirection="row",!0),"flex-col":(r,e)=>(e.flexDirection="column",!0),"flex-row-reverse":(r,e)=>(e.flexDirection="row-reverse",!0),"flex-col-reverse":(r,e)=>(e.flexDirection="column-reverse",!0),"flex-wrap":(r,e)=>(e.flexWrap="wrap",!0),"flex-nowrap":(r,e)=>(e.flexWrap="nowrap",!0),"flex-wrap-reverse":(r,e)=>(e.flexWrap="wrap-reverse",!0),"flex-1":(r,e)=>(e.flex=1,e.flexGrow=1,e.flexShrink=1,e.flexBasis=0,!0),"flex-auto":(r,e)=>(e.flexGrow=1,e.flexShrink=1,!0),"flex-initial":(r,e)=>(e.flexGrow=0,e.flexShrink=1,!0),"flex-none":(r,e)=>(e.flexGrow=0,e.flexShrink=0,!0),grow:(r,e)=>(e.flexGrow=1,!0),"grow-0":(r,e)=>(e.flexGrow=0,!0),shrink:(r,e)=>(e.flexShrink=1,!0),"shrink-0":(r,e)=>(e.flexShrink=0,!0),"justify-start":(r,e)=>(e.justifyContent="flex-start",!0),"justify-center":(r,e)=>(e.justifyContent="center",!0),"justify-end":(r,e)=>(e.justifyContent="flex-end",!0),"justify-between":(r,e)=>(e.justifyContent="space-between",!0),"justify-around":(r,e)=>(e.justifyContent="space-around",!0),"justify-evenly":(r,e)=>(e.justifyContent="space-evenly",!0),"items-start":(r,e)=>(e.alignItems="flex-start",!0),"items-center":(r,e)=>(e.alignItems="center",!0),"items-end":(r,e)=>(e.alignItems="flex-end",!0),"items-stretch":(r,e)=>(e.alignItems="stretch",!0),"items-baseline":(r,e)=>(e.alignItems="baseline",!0),"self-auto":(r,e)=>(e.alignSelf="auto",!0),"self-start":(r,e)=>(e.alignSelf="flex-start",!0),"self-center":(r,e)=>(e.alignSelf="center",!0),"self-end":(r,e)=>(e.alignSelf="flex-end",!0),"self-stretch":(r,e)=>(e.alignSelf="stretch",!0),"self-baseline":(r,e)=>(e.alignSelf="baseline",!0),"min-w-0":(r,e)=>(e.minWidth=0,!0),"aspect-square":(r,e)=>(e.aspectRatio=1,!0),"inset-0":(r,e)=>(e.top=0,e.right=0,e.bottom=0,e.left=0,!0),"tracking-tighter":(r,e)=>(e.letterSpacing=-0.8,!0),"tracking-tight":(r,e)=>(e.letterSpacing=-0.4,!0),"tracking-normal":(r,e)=>(e.letterSpacing=0,!0),"tracking-wide":(r,e)=>(e.letterSpacing=0.4,!0),"tracking-wider":(r,e)=>(e.letterSpacing=0.8,!0),"tracking-widest":(r,e)=>(e.letterSpacing=1.6,!0),"tabular-nums":()=>!0,block:()=>!0,"inline-flex":(r,e)=>(e.display="flex",!0),truncate:()=>!0,relative:(r,e)=>(e.position="relative",!0),absolute:(r,e)=>(e.position="absolute",!0),"overflow-visible":(r,e)=>(e.overflow="visible",!0),"overflow-hidden":(r,e)=>(e.overflow="hidden",!0),"overflow-scroll":(r,e)=>(e.overflow="scroll",!0),"font-thin":(r,e)=>(e.fontWeight="100",!0),"font-extralight":(r,e)=>(e.fontWeight="200",!0),"font-light":(r,e)=>(e.fontWeight="300",!0),"font-normal":(r,e)=>(e.fontWeight="400",!0),"font-medium":(r,e)=>(e.fontWeight="500",!0),"font-semibold":(r,e)=>(e.fontWeight="600",!0),"font-bold":(r,e)=>(e.fontWeight="bold",!0),"font-extrabold":(r,e)=>(e.fontWeight="800",!0),"font-black":(r,e)=>(e.fontWeight="900",!0),italic:(r,e)=>(e.fontStyle="italic",!0),"not-italic":(r,e)=>(e.fontStyle="normal",!0),"text-left":(r,e)=>(e.textAlign="left",!0),"text-center":(r,e)=>(e.textAlign="center",!0),"text-right":(r,e)=>(e.textAlign="right",!0),"text-justify":(r,e)=>(e.textAlign="justify",!0),uppercase:(r,e)=>(e.textTransform="uppercase",!0),lowercase:(r,e)=>(e.textTransform="lowercase",!0),capitalize:(r,e)=>(e.textTransform="capitalize",!0),"normal-case":(r,e)=>(e.textTransform="none",!0),underline:(r,e)=>(e.textDecorationLine="underline",!0),"line-through":(r,e)=>(e.textDecorationLine="line-through",!0),"no-underline":(r,e)=>(e.textDecorationLine="none",!0)};function mt(r,e){if(!r.startsWith("bg-"))return!1;let t=r.slice(3),i=F(t);if(i)return e.backgroundColor=i,!0;return!1}function bt(r,e){if(!r.startsWith("text-"))return!1;let t=r.slice(5);if(Pe[t])return e.fontSize=Pe[t],!0;if(t.startsWith("[")&&t.endsWith("]")){let s=t.slice(1,-1);if(/^-?[\d.]+(?:px|r?em)?$/.test(s)){let a=s.endsWith("rem")||s.endsWith("em")?Number.parseFloat(s)*16:Number.parseFloat(s);if(Number.isFinite(a))return e.fontSize=a,!0}}let i=F(t);if(i)return e.color=i,!0;return!1}var yt=new Set(["t","tr","r","br","b","bl","l","tl"]);function St(r,e){let t=/^bg-(?:gradient|linear)-to-([a-z]+)$/.exec(r);if(t&&yt.has(t[1]))return e.gradientDirection=`to-${t[1]}`,!0;let i=/^(from|via|to)-(.+)$/.exec(r);if(!i)return!1;let s=F(i[2]);if(!s)return!1;if(i[1]==="from")e.gradientFrom=s;else if(i[1]==="via")e.gradientVia=s;else e.gradientTo=s;return!0}function vt(r,e){for(let t of["fill","stroke"]){let i=`${t}-`;if(!r.startsWith(i))continue;let s=r.slice(i.length);if(s==="none")return e[t]="none",!0;if(t==="stroke"&&/^\d+(?:\.\d+)?$/.test(s))return e.strokeWidth=Number.parseFloat(s),!0;if(t==="stroke"&&/^\[\d+(?:\.\d+)?(?:px)?\]$/.test(s))return e.strokeWidth=Number.parseFloat(s.slice(1)),!0;let a=F(s);if(a)return e[t]=a,!0}return!1}function wt(r,e){if(r.startsWith("p-")){let t=N(r.slice(2));if(t!==void 0)return e.padding=t,!0}if(r.startsWith("px-")){let t=N(r.slice(3));if(t!==void 0)return e.paddingHorizontal=t,!0}if(r.startsWith("py-")){let t=N(r.slice(3));if(t!==void 0)return e.paddingVertical=t,!0}if(r.startsWith("pt-")){let t=N(r.slice(3));if(t!==void 0)return e.paddingTop=t,!0}if(r.startsWith("pr-")){let t=N(r.slice(3));if(t!==void 0)return e.paddingRight=t,!0}if(r.startsWith("pb-")){let t=N(r.slice(3));if(t!==void 0)return e.paddingBottom=t,!0}if(r.startsWith("pl-")){let t=N(r.slice(3));if(t!==void 0)return e.paddingLeft=t,!0}return!1}function xt(r,e){if(r.startsWith("m-")){let t=N(r.slice(2));if(t!==void 0)return e.margin=t,!0}if(r.startsWith("mx-")){let t=N(r.slice(3));if(t!==void 0)return e.marginHorizontal=t,!0}if(r.startsWith("my-")){let t=N(r.slice(3));if(t!==void 0)return e.marginVertical=t,!0}if(r.startsWith("mt-")){let t=N(r.slice(3));if(t!==void 0)return e.marginTop=t,!0}if(r.startsWith("mr-")){let t=N(r.slice(3));if(t!==void 0)return e.marginRight=t,!0}if(r.startsWith("mb-")){let t=N(r.slice(3));if(t!==void 0)return e.marginBottom=t,!0}if(r.startsWith("ml-")){let t=N(r.slice(3));if(t!==void 0)return e.marginLeft=t,!0}return!1}function Nt(r,e){if(!r.startsWith("w-"))return!1;let t=r.slice(2);if(t==="full")return e.width="100%",!0;if(t==="screen")return e.width="100%",!0;if(t==="auto")return e.width="auto",!0;if(t.includes("/")){let[s,a]=t.split("/"),c=Number.parseInt(s)/Number.parseInt(a)*100;return e.width=`${c}%`,!0}let i=N(t);if(i!==void 0)return e.width=i,!0;return!1}function Tt(r,e){if(!r.startsWith("h-"))return!1;let t=r.slice(2);if(t==="full")return e.height="100%",!0;if(t==="screen")return e.height="100%",!0;if(t==="auto")return e.height="auto",!0;let i=N(t);if(i!==void 0)return e.height=i,!0;return!1}function kt(r,e){if(!r.startsWith("rounded"))return!1;if(r==="rounded")return e.borderRadius=L.DEFAULT,!0;let t=r.slice(8);if(t==="")return!1;let i=/^(?:(t|b|l|r)-)?(\[[^\]]+\])$/.exec(t);if(i){let a=de(i[2]);if(a===void 0)return!1;let c={t:["borderTopLeftRadius","borderTopRightRadius"],b:["borderBottomLeftRadius","borderBottomRightRadius"],l:["borderTopLeftRadius","borderBottomLeftRadius"],r:["borderTopRightRadius","borderBottomRightRadius"]};for(let u of i[1]?c[i[1]]:["borderRadius"])e[u]=a;return!0}if(t.startsWith("t-")){let a=L[t.slice(2)]??L.DEFAULT;return e.borderTopLeftRadius=a,e.borderTopRightRadius=a,!0}if(t.startsWith("b-")){let a=L[t.slice(2)]??L.DEFAULT;return e.borderBottomLeftRadius=a,e.borderBottomRightRadius=a,!0}if(t.startsWith("l-")){let a=L[t.slice(2)]??L.DEFAULT;return e.borderTopLeftRadius=a,e.borderBottomLeftRadius=a,!0}if(t.startsWith("r-")){let a=L[t.slice(2)]??L.DEFAULT;return e.borderTopRightRadius=a,e.borderBottomRightRadius=a,!0}let s=L[t];if(s!==void 0)return e.borderRadius=s,!0;return!1}function Et(r,e){if(!r.startsWith("border"))return!1;if(r==="border")return e.borderWidth=1,!0;let t=r.match(/^border-(\d+)$/);if(t)return e.borderWidth=Number.parseInt(t[1]),!0;let i=r.match(/^border-(t|r|b|l)-?(\d*)$/);if(i){let[,s,a]=i,c=a?Number.parseInt(a):1;switch(s){case"t":e.borderTopWidth=c;break;case"r":e.borderRightWidth=c;break;case"b":e.borderBottomWidth=c;break;case"l":e.borderLeftWidth=c;break}return!0}return!1}function Rt(r,e){if(!r.startsWith("border-"))return!1;let t=r.slice(7),i=F(t);if(i)return e.borderColor=i,!0;return!1}function At(r,e){if(!r.startsWith("opacity-"))return!1;let t=Number.parseInt(r.slice(8));if(!Number.isNaN(t))return e.opacity=t/100,!0;return!1}function _t(r,e){if(r.startsWith("tracking-[")){let t=de(r.slice(9),typeof e.fontSize==="number"?e.fontSize:16);if(t===void 0)return!1;return e.letterSpacing=t,!0}if(r.startsWith("leading-")){let t=r.slice(8),i=typeof e.fontSize==="number"?e.fontSize:16,s={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2},a=t.startsWith("[")?/^\[[\d.]+\]$/.test(t)?Number.parseFloat(t.slice(1,-1))*i:de(t,i):s[t]!==void 0?s[t]*i:Be[t];if(a===void 0||!Number.isFinite(a))return!1;return e.lineHeight=a,!0}return!1}function It(r,e){let t=/^grid-cols-(\d+)$/.exec(r);if(!t)return!1;return e.gridColumns=Number(t[1]),!0}function Pt(r,e){if(!r.startsWith("size-"))return!1;let t=r.slice(5),i=t==="full"?"100%":N(t);if(i===void 0)return!1;return e.width=i,e.height=i,!0}var Ct={xs:320,sm:384,md:448,lg:512,xl:576,"2xl":672,"3xl":768,"4xl":896,"5xl":1024,"6xl":1152,"7xl":1280};function Bt(r,e){let t=/^(min|max)-(w|h)-(.+)$/.exec(r);if(!t)return!1;let[,i,s,a]=t,c=a==="full"||a==="screen"?"100%":a==="none"?void 0:s==="w"&&i==="max"&&Ct[a]||N(a);if(c===void 0&&a!=="none")return!1;let u=`${i}${s==="w"?"Width":"Height"}`;if(c===void 0)delete e[u];else e[u]=c;return!0}function Ot(r,e){let t=/^(-?)(top|right|bottom|left)-(.+)$/.exec(r);if(!t)return!1;let i=t[3]==="full"?"100%":N(t[3]);if(i===void 0)return!1;return e[t[2]]=typeof i==="number"&&t[1]?-i:i,!0}function Lt(r,e){let t=/^space-(x|y)-(.+)$/.exec(r);if(!t)return!1;let i=N(t[2]);if(i===void 0)return!1;return e.gap=i,!0}function Mt(r,e){if(r.startsWith("gap-")){let t=N(r.slice(4));if(t!==void 0)return e.gap=t,!0}if(r.startsWith("gap-x-")){let t=N(r.slice(6));if(t!==void 0)return e.columnGap=t,!0}if(r.startsWith("gap-y-")){let t=N(r.slice(6));if(t!==void 0)return e.rowGap=t,!0}return!1}function K(r){let e=[],t=[],i=[];function s(l,p){let g=/^(text|bg|border|ring)-([a-z-]+)(\/[^\s]+)?$/.exec(l),d=g&&Hn[g[2]];return d?`${g[1]}-${d[p]}${g[3]||""}`:l}for(let l of r.split(/\s+/).filter(Boolean))if(l.startsWith("dark:"))t.push(s(l.slice(5),"dark"));else if(!l.includes(":")||l.startsWith("[")){if(e.push(s(l,"light")),s(l,"dark")!==l)i.push(s(l,"dark"))}let a=[],u={style:Ce(e.join(" "),a),unknown:a};if(t.length||i.length)u.dark=Ce([...i,...t].join(" "),a);for(let l of e){if(l==="truncate")u.numberOfLines=1;let p=/^line-clamp-(\d+)$/.exec(l);if(p)u.numberOfLines=Number(p[1]);if(!u.icon&&/^i-[a-z0-9]+-[a-z0-9-]+$/.test(l))u.icon=l}return u.unknown=a.filter((l)=>!/^line-clamp-\d+$/.test(l)),u}function Ce(r,e){let t={},i=r.split(/\s+/).filter(Boolean);for(let s of i){if(/^i-[a-z0-9]+-/.test(s))continue;let a=ht[s];if(a){a("",t);continue}if(St(s,t))continue;if(mt(s,t))continue;if(vt(s,t))continue;if(bt(s,t))continue;if(wt(s,t))continue;if(xt(s,t))continue;if(Nt(s,t))continue;if(Tt(s,t))continue;if(kt(s,t))continue;if(Et(s,t))continue;if(Rt(s,t))continue;if(At(s,t))continue;if(Mt(s,t))continue;if(_t(s,t))continue;if(Pt(s,t))continue;if(Bt(s,t))continue;if(It(s,t))continue;if(Ot(s,t))continue;if(Lt(s,t))continue;if(e?.push(s),typeof process<"u"&&process.env?.NODE_ENV==="development")console.warn(`[STX Native] Unknown Headwind class: ${s}`)}return t}function W(r,e={},t={},i={},s=[]){return{type:r,props:e,style:t,events:i,children:s}}function Oe(r,e,t={}){return{version:"1.0.0",root:r,script:e,meta:{source:t.source||"unknown",compiledAt:t.compiledAt||Date.now(),headwindConfig:t.headwindConfig}}}var Le=new Set(["script","style","head","meta","link","title","base","noscript"]),Me=new Set(["template","body","html","main","fragment"]),Y=new Set,Dt={click:"onPress",press:"onPress","press-in":"onPressIn",pressin:"onPressIn","press-out":"onPressOut",pressout:"onPressOut",longpress:"onLongPress",contextmenu:"onLongPress",input:"onChangeText",change:"onValueChange","value-change":"onValueChange",valuechange:"onValueChange",focus:"onFocus",focusin:"onFocus",blur:"onBlur",focusout:"onBlur",submit:"onSubmitEditing","submit-editing":"onSubmitEditing",submitediting:"onSubmitEditing","end-editing":"onEndEditing",endediting:"onEndEditing",scroll:"onScroll","scroll-begin-drag":"onScrollBeginDrag",scrollbegindrag:"onScrollBeginDrag","scroll-end-drag":"onScrollEndDrag",scrollenddrag:"onScrollEndDrag","momentum-scroll-begin":"onMomentumScrollBegin",momentumscrollbegin:"onMomentumScrollBegin","momentum-scroll-end":"onMomentumScrollEnd",momentumscrollend:"onMomentumScrollEnd",refresh:"onRefresh",layout:"onLayout","end-reached":"onEndReached",endreached:"onEndReached",close:"onRequestClose","request-close":"onRequestClose",requestclose:"onRequestClose",show:"onShow",dismiss:"onDismiss","sliding-complete":"onSlidingComplete",slidingcomplete:"onSlidingComplete","load-start":"onLoadStart",loadstart:"onLoadStart",load:"onLoad","load-end":"onLoadEnd",loadend:"onLoadEnd",error:"onError",play:"onPlay",playing:"onPlay",pause:"onPause",ended:"onEnd",end:"onEnd",timeupdate:"onProgress",progress:"onProgress",loadedmetadata:"onLoad"},Vt=new Set(["onBlur","onChangeText","onDismiss","onEnd","onEndEditing","onEndReached","onError","onFocus","onLayout","onLoad","onLoadEnd","onLoadStart","onLongPress","onMomentumScrollBegin","onMomentumScrollEnd","onPause","onPlay","onPress","onPressIn","onPressOut","onProgress","onRequestClose","onRefresh","onScroll","onScrollBeginDrag","onScrollEndDrag","onShow","onSlidingComplete","onSubmitEditing","onValueChange"]),ue=new Set(["display","gridColumns","gridTemplateColumns","gridAutoRows","flex","flexGrow","flexShrink","flexBasis","flexDirection","flexWrap","justifyContent","alignItems","alignSelf","alignContent","position","top","right","bottom","left","zIndex","width","height","minWidth","maxWidth","minHeight","maxHeight","aspectRatio","margin","marginTop","marginRight","marginBottom","marginLeft","marginHorizontal","marginVertical","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingHorizontal","paddingVertical","gap","rowGap","columnGap","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","borderStyle","backgroundColor","backgroundImage","opacity","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","color","fontSize","fontWeight","fontStyle","fontFamily","lineHeight","letterSpacing","textAlign","textDecorationLine","textDecorationColor","textTransform","resizeMode","tintColor","transform","overflow","fill","stroke","strokeWidth","gradientDirection","gradientFrom","gradientVia","gradientTo"]),Ft=new Set(["gridColumns","gridAutoRows","flex","flexGrow","flexShrink","zIndex","aspectRatio","gap","rowGap","columnGap","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","opacity","shadowOpacity","shadowRadius","elevation","fontSize","lineHeight","letterSpacing","strokeWidth"]),Wt=new Set(["top","right","bottom","left","width","height","minWidth","maxWidth","minHeight","maxHeight","flexBasis","margin","marginTop","marginRight","marginBottom","marginLeft","marginHorizontal","marginVertical","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingHorizontal","paddingVertical"]),Ve=new Set(["View","ScrollView","SafeAreaView","KeyboardAvoidingView","Text","TextInput","Button","TouchableOpacity","TouchableHighlight","Pressable","Icon","Image","ImageBackground","Video","FlatList","SectionList","Switch","Slider","Picker","DatePicker","Modal","ActivityIndicator","StatusBar","RefreshControl",...oe]),$t=new Map([["data","data"],["sections","sections"],["renderitem","renderItem"],["rendersectionheader","renderSectionHeader"],["keyextractor","keyExtractor"],["listrole","listRole"]]),Fe=new Set(["View","SafeAreaView","ScrollView","KeyboardAvoidingView"]),zt={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ","#39":"'","#x27":"'"};function j(r){return r.replace(/&(#x?[0-9a-f]+|\w+);/gi,(e,t)=>{let i=zt[t.toLowerCase()];if(i!==void 0)return i;if(t[0]==="#"){let s=t[1]==="x"||t[1]==="X"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return Number.isFinite(s)?String.fromCodePoint(s):e}return e})}function We(r){return r.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function $e(r){let e=/^(-?[\d.]+)px$/.exec(r);if(e)return Number.parseFloat(e[1]);let t=/^(-?[\d.]+)r?em$/.exec(r);if(t)return Number.parseFloat(t[1])*16;if(/^-?[\d.]+$/.test(r))return Number.parseFloat(r);return r}function ze(r,e,t){let i={},s={},a={},c="",u={};for(let[p,g]of e){let d=p.toLowerCase();if(d==="class"||d==="classname"){c=c?`${c} ${g}`:g;continue}if(d==="style"){u={...u,...Xt(r,g,t)};continue}if(d.startsWith(":")||d.startsWith("x-")&&d!=="x-cloak"){a[d.startsWith(":")?d.slice(1):d.slice(2)]=j(g);continue}if(d==="x-cloak")continue;if(d.startsWith("@")||d.startsWith("v-on:")){let v=d.startsWith("@")?d.slice(1):d.slice(5),[S]=v.split("."),f=Dt[S]??(S.startsWith("on")?S:"");if(!f||!Vt.has(f)){t.push({kind:"unread-event",tag:r,name:p});continue}s[f]=j(g);continue}if(d==="key"){i.key=g;continue}let h=j(g),b=ce(p);if(h===""&&Ae.has(b)){i[b]=!0;continue}try{i[b]=JSON.parse(h)}catch{i[b]=h}}let l={...c?K(c).style:{},...u};return{props:i,style:l,events:s,bindings:a,classes:c,inline:u}}function Xe(r,e){if(Ft.has(r))return!1;if(Wt.has(r))return/^-?[\d.]+%$/.test(e);return!0}function Xt(r,e,t){let i={},s=j(e);try{let a=JSON.parse(s);if(a&&typeof a==="object"&&!Array.isArray(a)){for(let[c,u]of Object.entries(a)){let l=ue.has(c)?c:We(c.trim().toLowerCase());if(!ue.has(l)){t.push({kind:"unknown-style",tag:r,name:l});continue}if(u===null||u===void 0)continue;let p=typeof u==="string"?$e(u):u;if(typeof p!=="string"&&typeof p!=="number")continue;if(typeof p==="string"&&!Xe(l,p)){t.push({kind:"non-numeric-style",tag:r,name:l});continue}i[l]=p}return i}}catch{}for(let a of s.split(";")){let c=a.indexOf(":");if(c===-1)continue;let u=We(a.slice(0,c).trim().toLowerCase()),l=a.slice(c+1).trim();if(!u||!l)continue;if(!ue.has(u)){t.push({kind:"unknown-style",tag:r,name:u});continue}let p=$e(l);if(typeof p==="string"&&!Xe(u,p)){t.push({kind:"non-numeric-style",tag:r,name:u});continue}i[u]=p}return i}function fe(r){return r.children.map((e)=>typeof e==="string"?e:fe(e)).join("").replace(/\s+/g," ").trim()}function jt(r,e){let t=r.node,i=t.children.filter((a)=>typeof a!=="string"),s=t.children.filter((a)=>typeof a==="string").join("").trim();if(t.type==="Svg"||t.type==="G")return t.children=i,t;if(t.type==="SvgText"){let a=fe(t);return t.children=a?[a]:[],t}if(Fe.has(t.type)&&i.length===0&&s)return t.type="Text",t.children=[s],t;if(t.type==="Text"&&!s&&i.length===0&&typeof t.props.text==="string")return t.children=t.props.text?[t.props.text]:[],delete t.props.text,t;if(t.type==="Text"&&i.length>0){let a=fe(t);return e.push({kind:"flattened-text",tag:r.tag}),t.children=a?[a]:[],t}if(Fe.has(t.type)&&i.length>0)t.children=i;return t}async function Ht(r,e={}){let t=[],i=[],s=[],a=new Set;function c(d){let h=s[s.length-1];if(!h)i.push(d);else if(!h.dropped)h.node.children.push(d)}function u(d){if(d.node.bindings&&Object.keys(d.node.bindings).length>0){let b=d.node.children,v=b.filter((f)=>typeof f!=="string"),S=v.length===1&&v.length===b.length?v[0]:W("View",{},{},{},b);if(S.bindings={...d.node.bindings,...S.bindings},S.bindingId===void 0&&d.node.bindingId!==void 0)S.bindingId=d.node.bindingId;c(S);return}let h=s[s.length-1];for(let b of d.node.children){if(typeof b==="string"){if(h&&!h.dropped)h.node.children.push(b);continue}if(!h)i.push(b);else if(!h.dropped)h.node.children.push(b)}}function l(d,h){let b=s[s.length-1];if(d==="svg"||b?.svg)return p(d,h,b);let v=Le.has(d)&&!Y.has(d),S=s[s.length-1]?.dropped??!1,{props:f,style:y,events:w,bindings:E,classes:m,inline:R}=v||S?{props:{},style:{},events:{},bindings:{},classes:"",inline:{}}:ze(d,h,t),T=f["data-native"],x;if(typeof T==="string"&&Ve.has(T))x=T,delete f["data-native"];else x=Y.has(d)?"View":Ie(d);if(x===d&&!Ve.has(x)&&!Le.has(d)&&!Me.has(d)&&!a.has(d))a.add(d),t.push({kind:"unmapped-tag",tag:d});if((v||Y.has(d))&&!a.has(`drop:${d}`))a.add(`drop:${d}`),t.push({kind:"dropped-subtree",tag:d});if(x==="Video"&&f.source===void 0&&f.src!==void 0)f.source=f.src,delete f.src;if(x==="Icon"){let P=K(m).icon;f.symbol=le(String(f.symbol||f.name||P||""),Boolean(f.symbol)).symbol}if(x==="FlatList"||x==="SectionList"){let P=new Set([...Object.keys(f),...Object.keys(E)].map((z)=>z.toLowerCase()));for(let[z,M]of $t)if(P.has(z))t.push({kind:"unsupported-list-prop",tag:x,name:M})}let I=W(x,f,y,w);I._inlineStyle=R;let O=f["data-stx-b"];if(typeof O==="number"&&Number.isInteger(O))I.bindingId=O;if(delete f["data-stx-b"],m)I._classes=m;if(Object.keys(E).length>0)I.bindings=E;if(typeof f.key==="string")I.key=f.key,delete f.key;return{tag:d,node:I,dropped:v||S||Y.has(d),discard:v||S,unwrap:Me.has(d)}}function p(d,h,b){let v=b?.dropped??!1,S=ie[d];if(v||!S){if(!v&&!a.has(`drop:${d}`))a.add(`drop:${d}`),t.push({kind:Ee.has(d)?"dropped-subtree":"unmapped-tag",tag:d});return{tag:d,node:W("G",{},{},{}),svg:!0,dropped:!0,discard:!0,unwrap:!1}}let{props:f,style:y,events:w,bindings:E,classes:m,inline:R}=ze(d,h,t);if(S==="Svg"){let O=se(f.viewBox);if(O)f.viewBox=O;else delete f.viewBox;for(let P of["width","height"]){if(typeof f[P]==="number"&&y[P]===void 0)y[P]=f[P];delete f[P]}}if(typeof f.strokeDasharray==="string"||typeof f.strokeDasharray==="number"){let O=String(f.strokeDasharray).split(/[\s,]+/).map(Number).filter(Number.isFinite);f.strokeDasharray=O}let T=ae(S,f);if(T)f.geometry=T;let x=W(S,f,y,w);x._inlineStyle=R;let I=f["data-stx-b"];if(typeof I==="number"&&Number.isInteger(I))x.bindingId=I;if(delete f["data-stx-b"],m)x._classes=m;if(Object.keys(E).length>0)x.bindings=E;if(typeof f.key==="string")x.key=f.key,delete f.key;return{tag:d,node:x,svg:!0,dropped:!1,discard:!1,unwrap:!1}}if(await new HTMLRewriter().on("*",{element(d){let h=d.tagName.toLowerCase(),b=l(h,[...d.attributes]),v=!0;try{d.onEndTag(()=>{if(s.pop(),b.discard)return;if(b.unwrap)u(b);else c(jt(b,t))})}catch{v=!1}if(v)s.push(b);else if(!b.discard)c(b.node)},text(d){let h=s[s.length-1];if(!h||h.dropped)return;let b=j(d.text).replace(/\s+/g," ");if(!b.trim())return;h.node.children.push(b)}}).transform(new Response(r)).text(),i.length===0)throw Error(`No element to translate in the rendered output of ${e.source??"unknown"}`);return{root:i.length===1?i[0]:W("View",{},{},{},i),diagnostics:t}}async function je(r,e={}){let{root:t,diagnostics:i}=await Ht(r,e),s=e.script??{exports:{},functions:[],code:""};return{document:Oe(t,s,{source:e.source??"unknown"}),diagnostics:i}}var He=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,qt=/(?:^|\n)\s*(?:export\s+)?(?:async\s+)?function\s*\*?\s*([$\w]+)\s*\(/g,Ut=/(?:^|\n)\s*(?:export\s+)?(?:const|let|var)\s+([$\w]+)\s*=\s*(?:async\s*)?(?:\([^)]*\)|[$\w]+)\s*=>/g,qe=/(?:^|\n)\s*(?:export\s+)?const\s+([$\w]+)\s*=\s*(-?[\d.]+|true|false|'[^']*'|"[^"]*")\s*(?=;|\n|$)/g;function pe(r){let e=[];He.lastIndex=0;for(let a of r.matchAll(He)){let c=a[1]??"";if(/\bserver\b/.test(c))continue;e.push(a[2].trim())}let t=e.filter(Boolean).join(`
|
|
3
|
+
|
|
4
|
+
`),i=[];for(let a of[qt,Ut]){a.lastIndex=0;for(let c of t.matchAll(a))if(!i.includes(c[1]))i.push(c[1])}let s={};qe.lastIndex=0;for(let a of t.matchAll(qe)){let c=a[2];try{s[a[1]]=JSON.parse(c.replace(/^'(.*)'$/,'"$1"'))}catch{s[a[1]]=c}}return{exports:s,functions:i,code:t}}var Ue=/<script\b[^>]*\bdata-stx-scoped\b[^>]*>([\s\S]*?)<\/script>/gi,Gt=/function\s+(__stx_setup_[\w$]+)\s*\(/;function ge(r){Ue.lastIndex=0;for(let e of r.matchAll(Ue)){let t=e[1].trim(),i=Gt.exec(t)?.[1];if(i)return{name:i,code:t}}return null}function Yt(){let r=[H.join(import.meta.dir,"..","primitives"),H.join(import.meta.dir,"native","primitives")];for(let e of r)if(Kt(H.join(e,"View.stx")))return e;return r[0]}async function Jt(r,e,t={}){let i=t.root??H.dirname(e),s=await o(i),a={root:i,componentsDir:t.componentsDir??H.join(i,"components"),buildMode:"serve",cache:!1,_pluginComponentDirs:[Yt(),...s._pluginComponentDirs??[]]},c={...t.context??{},__stx_inject_css:!1},u=await n(r,c,e,a,new Set),{html:l,manifest:p}=Ne(u),{document:g,diagnostics:d}=await je(l,{source:e,script:pe(r)}),h=ge(l);if(pe(r).code.trim()){let b=await qn(r,e,t.context,{forceClientSetup:!0});h=ge(b.setupCode??"")??h}return{document:g,manifest:p,setup:h,diagnostics:d,html:l}}async function J(r,e={}){return Jt(await Bun.file(r).text(),r,e)}var Q="__app";function Ge(r){let t=[D.join(import.meta.dir,"..","runtime",`${r}.ts`),D.join(import.meta.dir,"..","runtime",`${r}.js`),D.join(import.meta.dir,"native","runtime",`${r}.js`)].find((i)=>Ke(i));if(!t)throw Error(`Native runtime module ${r} is missing`);return t}async function Zt(r,e,t){let i=await Bun.build({entrypoints:[r],target:"browser",format:"iife",minify:t,plugins:e,define:{"process.env.NODE_ENV":JSON.stringify(t?"production":"development")}});if(!i.success){let s=i.logs.map((a)=>String(a.message??a)).join(`
|
|
5
|
+
`);throw Error(`Could not bundle ${r}:
|
|
6
|
+
${s}`)}return(await i.outputs[0].text()).trim()}async function he(r){let e=Object.keys(r.screens);if(e.length===0)throw Error("screens must name at least one .stx file");let t=r.routed??!0,i=r.initialScreen??e[0];if(!r.screens[i])throw Error(`Initial screen ${i} is not in screens`);let s=D.resolve(r.root??process.cwd()),a=[];for(let y of e){let w=D.resolve(s,r.screens[y]);if(!w.endsWith(".stx"))throw Error(`Screen ${y} must name a .stx file`);a.push({name:y,file:w,compiled:await J(w,{root:s})})}let c=Ge("jsc-globals"),u=Ge("shared-screen"),l=r.app?D.resolve(s,r.app):null;if(l&&!Ke(l))throw Error(`The app script ${r.app} does not exist`);if(l&&!t)throw Error("An app script needs a routed bundle");if(l&&r.screens[Q])throw Error(`${Q} is the app script's route, not a screen name`);let p=t?`var routeName = g.__stxNativeRoute || ${JSON.stringify(i)};
|
|
7
|
+
var isApp = ${l?`routeName === ${JSON.stringify(Q)}`:"false"};
|
|
8
|
+
if (!isApp && routeNames.indexOf(routeName) === -1) throw new Error(['Unknown native screen:', routeName].join(' '));`:`var routeName = 'main';
|
|
9
|
+
var isApp = false;`,g=a.map(({name:y,compiled:w},E)=>`${E===0?"if":"else if"} (routeName === ${JSON.stringify(t?y:"main")}) {
|
|
10
|
+
nativeDocument = ${JSON.stringify(w.document)};
|
|
11
|
+
manifest = ${JSON.stringify(w.manifest)};
|
|
12
|
+
}`).join(`
|
|
13
|
+
`),d=a.map(({name:y,compiled:w},E)=>`${E===0?"if":"else if"} (routeName === ${JSON.stringify(t?y:"main")}) {
|
|
14
|
+
${w.setup?.code??"g.__stx_latestSetup = null;"}
|
|
15
|
+
}`).join(`
|
|
16
|
+
`),h=`
|
|
17
|
+
import { installJSCGlobals } from ${JSON.stringify(c)};
|
|
18
|
+
import { prepareNativeApp, prepareSharedNativeScreen } from ${JSON.stringify(u)};
|
|
19
|
+
${l?`import * as nativeAppModule from ${JSON.stringify(l)};`:"var nativeAppModule = null;"}
|
|
20
|
+
var g = globalThis;
|
|
21
|
+
installJSCGlobals(g);
|
|
22
|
+
var bridge = g.__stxNativeBridge;
|
|
23
|
+
if (!bridge) throw new Error('Missing __stxNativeBridge');
|
|
24
|
+
var routeNames = ${JSON.stringify(t?e:["main"])};
|
|
25
|
+
${p}
|
|
26
|
+
g.__stxNativeRoute = routeName;
|
|
27
|
+
var nativeDocument;
|
|
28
|
+
var manifest;
|
|
29
|
+
${g}
|
|
30
|
+
var screen = null;
|
|
31
|
+
var app = null;
|
|
32
|
+
if (isApp) {
|
|
33
|
+
app = prepareNativeApp(bridge, { routeName: routeName, routeNames: routeNames });
|
|
34
|
+
g.__stxNativeUnmount = function() { app.unmount(); };
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
screen = prepareSharedNativeScreen(nativeDocument, manifest, bridge, { routeName: routeName, routeNames: routeNames });
|
|
38
|
+
g.__stx_host = screen.host;
|
|
39
|
+
g.__stxNativeUnmount = function() { screen.unmount(); };
|
|
40
|
+
}
|
|
41
|
+
${De()}
|
|
42
|
+
${d}
|
|
43
|
+
if (isApp) app.start(nativeAppModule);
|
|
44
|
+
else screen.mount(g.stx, g.__stx_latestSetup || null);
|
|
45
|
+
`,v=await Zt("stx:native-shared-screens",[{name:"stx-native-shared-screens",setup(y){y.onResolve({filter:/^stx:native-shared-screens$/},()=>({path:"entry",namespace:"stx-native-shared-screens"})),y.onLoad({filter:/.*/,namespace:"stx-native-shared-screens"},()=>({contents:h,loader:"js"}))}}],r.minify??!1),S=a.flatMap(({compiled:y})=>y.diagnostics).map((y)=>({level:"warning",message:[y.kind,y.tag,y.name].filter(Boolean).join(": ")}));if(!r.outFile)return{code:v,diagnostics:S};let f=D.resolve(s,r.outFile);return Qt(D.dirname(f),{recursive:!0}),await Bun.write(f,v),{code:v,outFile:f,diagnostics:S}}async function en(r,e={}){return he({...e,screens:{main:r},routed:!1})}function Ye(r,e={}){return en(r,e)}var Je=["native.config.json","stx-native.config.json"];function rn(r=process.cwd(),e){let t=e?C.resolve(r,e):Je.map((l)=>C.join(r,l)).find((l)=>Z(l));if(!t)return null;if(!Z(t))throw Error(`Native config not found: ${t}`);let i=JSON.parse(nn(t,"utf8")),s=Object.entries(i.screens??{});if(s.length===0)throw Error(`${C.basename(t)} must name at least one screen in "screens"`);let a={};for(let[l,p]of s){if(!/^[A-Z][\w-]*$/i.test(l))throw Error(`Invalid native screen name: ${l}`);if(typeof p!=="string"||!p.endsWith(".stx"))throw Error(`Screen ${l} must name a .stx file`);if(a[l]=C.resolve(C.dirname(t),p),!Z(a[l]))throw Error(`Screen ${l} not found: ${a[l]}`)}let c=i.initialScreen||s[0][0];if(!a[c])throw Error(`Initial screen ${c} is not in screens`);if(i.app!==void 0&&typeof i.app!=="string")throw Error(`"app" must name the app script's file`);let u=i.app?C.resolve(C.dirname(t),i.app):void 0;if(u&&!Z(u))throw Error(`App script not found: ${u}`);return{initialScreen:c,screens:a,file:t,...u?{app:u}:{}}}async function xr(r,e={}){let t=C.resolve(e.cwd??process.cwd()),i=e.format??"ir";if(i!=="ir"&&i!=="bundle")throw Error(`Unknown compile format: ${i}. Expected ir or bundle.`);let s=r?null:rn(t,e.config);if(!r&&!s)throw Error(`Please specify an input file: stx native compile <file.stx>, or add ${Je[0]}`);let a,c=[];if(i==="bundle"){let l=s?await he({screens:s.screens,initialScreen:s.initialScreen,minify:e.minify,root:t,...s.app?{app:s.app}:{}}):await Ye(C.resolve(t,r),{minify:e.minify});a=l.code,c=l.diagnostics}else{let l=async(g)=>{let d=await J(g);return c.push(...d.diagnostics.map((h)=>({level:"warning",message:[h.kind,h.tag,h.name].filter(Boolean).join(": ")}))),d.document},p=s?{initialScreen:s.initialScreen,screens:Object.fromEntries(await Promise.all(Object.entries(s.screens).map(async([g,d])=>[g,await l(d)])))}:await l(C.resolve(t,r));a=JSON.stringify(p,null,2)}if(!e.output)return{output:a,diagnostics:c};let u=C.resolve(t,e.output);return tn(C.dirname(u),{recursive:!0}),await Bun.write(u,a),{output:a,written:u,diagnostics:c}}export{xr as runNativeCompile};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-g495xx4v.js";import"./chunk-c57j92td.js";import"./chunk-68tzytfz.js";import{a}from"./chunk-dne8n6h3.js";import f from"fs";import l from"path";async function d(e,t={}){let s=Date.now(),n={total:0,passed:0,failed:0,new:0,failures:[],duration:0},o=t.snapshotDir||a(e.root,"story","snapshots");await f.promises.mkdir(o,{recursive:!0});let r=e.storyFiles;if(t.filter&&t.filter.length>0)r=r.filter((i)=>t.filter.some((p)=>i.fileName.toLowerCase().includes(p.toLowerCase())));for(let i of r)await h(i,o,t,n);return n.duration=Date.now()-s,n}async function h(e,t,s,n){let o=e.story;if(!o)return;for(let r of o.variants){n.total++;let i=l.join(t,`${e.id}-${r.id}.snap`),p=g(r.source||""),c=await w(i);if(s.update||!c){let u={storyId:e.id,variantId:r.id,component:e.fileName,timestamp:Date.now(),hash:p};if(await f.promises.writeFile(i,JSON.stringify(u,null,2)),!c)n.new++;n.passed++}else try{let u=await f.promises.readFile(i,"utf-8"),m=JSON.parse(u);if(m.hash===p)n.passed++;else n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:"Snapshot mismatch",difference:y(m.hash,p)})}catch(u){n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:`Error reading snapshot: ${u}`})}}}async function x(e,t={}){return(await d(e,{...t,update:!0})).total}function g(e){let t=0;for(let s=0;s<e.length;s++){let n=e.charCodeAt(s);t=(t<<5)-t+n,t=t&t}return t.toString(16)}function y(e,t){if(e===t)return 0;let s=Math.abs(Number.parseInt(e,16)-Number.parseInt(t,16));return Math.min(s/1e6,1)}async function w(e){try{return await f.promises.access(e),!0}catch{return!1}}function F(e){let t=[];if(t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(" STX Story Visual Regression Tests"),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),e.failures.length>0){t.push(" \u274C Failures:"),t.push("");for(let s of e.failures){if(t.push(` \u2022 ${s.component} / ${s.variantId}`),t.push(` ${s.message}`),s.difference!==void 0)t.push(` Difference: ${(s.difference*100).toFixed(2)}%`);t.push("")}}if(t.push(" Summary:"),t.push(` Total: ${e.total}`),t.push(` Passed: ${e.passed} \u2713`),t.push(` Failed: ${e.failed} \u2717`),e.new>0)t.push(` New: ${e.new} \u26A1`);return t.push(` Time: ${e.duration}ms`),t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),t.join(`
|
|
3
3
|
`)}export{F as formatTestResults,d as runVisualTests,x as updateSnapshots};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ui,Wi}from"./chunk-w9mxt96c.js";import"./chunk-2wr0sk42.js";import"./chunk-7p6y0b47.js";import"./chunk-1verz406.js";import"./chunk-2j04bc8c.js";import"./chunk-9z8mxp15.js";import"./chunk-01rz8h7x.js";import"./chunk-ph1xz7k5.js";import{io}from"./chunk-fwvqbx49.js";import"./chunk-4hz4g5ym.js";import"./chunk-jcmgj8kk.js";import"./chunk-cprcfp0j.js";import"./chunk-ej46bkaw.js";import"./chunk-n34kagea.js";import"./chunk-h37bbgg8.js";import"./chunk-rvwtyrj4.js";import"./chunk-5tkzfw4s.js";import"./chunk-46wre9ep.js";import"./chunk-g7wgpys2.js";import"./chunk-068ank60.js";import"./chunk-8xpyzcq2.js";import"./chunk-67actssw.js";import"./chunk-0vnr7mz7.js";import"./chunk-h6q8jafh.js";import"./chunk-3s9s1mdt.js";import"./chunk-s9mq9x2k.js";import"./chunk-1c407nky.js";import"./chunk-xx2pk2ay.js";import"./chunk-5dh041x0.js";import"./chunk-5zm23zrb.js";import"./chunk-38xtsdk9.js";import"./chunk-7sjmpfwy.js";import"./chunk-er7y8hk9.js";import"./chunk-s87qrma5.js";import"./chunk-qt31at4s.js";import"./chunk-2hc5mbw8.js";import{he,nn,rn,K,u,n,Jn,R,o,le}from"./chunk-96kr2xrt.js";import"./chunk-68tzytfz.js";import"./chunk-c57j92td.js";import"./chunk-kp4mzspk.js";import"./chunk-v74acg2k.js";import"./chunk-zz5b1g50.js";import"./chunk-5tbqdz94.js";import"./chunk-9p3rtfbv.js";import"./chunk-g495xx4v.js";import"./chunk-ba88n1j7.js";import"./chunk-g1r4v0mc.js";import"./chunk-xd4zvm4x.js";import"./chunk-e6y6s7q8.js";export{Jn as buildWebComponents,rn as cacheTemplate,nn as checkCache,io as classifyAllScripts,Ui as createMiddleware,Wi as createRoute,R as defaultConfig,u as extractVariables,K as injectRouterScript,o as loadStxConfig,he as processClientScript,n as processDirectives,le as readMarkdownFile};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{z}from"./chunk-
|
|
2
|
+
import{z}from"./chunk-n34kagea.js";import R from"fs";import g from"path";import C from"crypto";var S=new Set(["webp","avif","jpeg","png"]),T=new Set(["cover","contain","fill","inside","outside"]),q=new Set([".jpg",".jpeg",".png",".webp",".avif",".gif"]),k=4096,D=80,U="cover";async function mo(e,t){let r=t.routePath??"/_stx/img",h=new URL(e.url);if(h.pathname!==r)return null;let a=A(h,t);if(!a.ok)return new Response(a.error,{status:a.status,headers:{"Content-Type":"text/plain"}});let{srcFsPath:n,srcUrl:d,width:l,height:i,format:s,quality:u,fit:c}=a,m;try{m=R.statSync(n)}catch{return new Response(`Source image not found: ${d}`,{status:404,headers:{"Content-Type":"text/plain"}})}if(!m.isFile())return new Response("Not a file",{status:404,headers:{"Content-Type":"text/plain"}});let w=t.cacheDir??".stx/cache/img";await R.promises.mkdir(w,{recursive:!0});let b=`${n}:${m.mtimeMs}:${m.size}`,I=`${l}x${i}:${s}:${u}:${c}`,f=C.createHash("sha256").update(`${b}|${I}`).digest("hex").slice(0,16),o=g.join(w,`${f}.${s}`),p={"Content-Type":z(s),"Cache-Control":"public, max-age=31536000, immutable",ETag:`"${f}"`,"X-Stx-Image-Cache":"HIT"};if(e.headers.get("if-none-match")===`"${f}"`)return new Response(null,{status:304,headers:p});let v=Bun.file(o);if(await v.exists())return new Response(v,{headers:p});try{let x=Buffer.from(await Bun.file(n).arrayBuffer()),{resizeAndConvert:P}=await L(),F=await P(x,{width:l,height:i,format:s,quality:u,fit:c});return await Bun.write(o,F),p["X-Stx-Image-Cache"]="MISS",new Response(new Uint8Array(F),{headers:p})}catch(x){let P=x.message;return new Response(`Image processing failed: ${P}`,{status:500,headers:{"Content-Type":"text/plain"}})}}function oa(e){return async(t)=>await mo(t,e)??new Response("Not Found",{status:404,headers:{"Content-Type":"text/plain"}})}function A(e,t){let r=e.searchParams.get("src");if(!r)return{ok:!1,error:"Missing required param: src",status:400};if(!r.startsWith("/"))return{ok:!1,error:"src must be an absolute URL path (start with /)",status:400};if(r.startsWith("//"))return{ok:!1,error:"src must be a local path",status:400};let h=g.extname(r).toLowerCase();if(!q.has(h))return{ok:!1,error:`Unsupported source extension: ${h}`,status:400};let a=g.resolve(t.publicDir),n=g.resolve(a,r.slice(1));if(!n.startsWith(`${a}${g.sep}`)&&n!==a)return{ok:!1,error:"src is outside publicDir",status:400};let d=t.maxWidth??k,l=t.maxHeight??k,i=e.searchParams.get("w"),s=e.searchParams.get("h"),u=i?Number.parseInt(i,10):0,c=s?Number.parseInt(s,10):0;if(i&&(!Number.isFinite(u)||u<=0))return{ok:!1,error:"Invalid w (must be positive integer)",status:400};if(s&&(!Number.isFinite(c)||c<=0))return{ok:!1,error:"Invalid h (must be positive integer)",status:400};if(!i&&!s)return{ok:!1,error:"At least one of w or h is required",status:400};let m=Math.min(u||d,d),w=Math.min(c||l,l),b=e.searchParams.get("f")||"webp";if(!S.has(b))return{ok:!1,error:`Invalid f (must be one of: ${[...S].join(", ")})`,status:400};let I=b,f=e.searchParams.get("q"),o=f?Number.parseInt(f,10):t.defaultQuality??D;if(!Number.isFinite(o)||o<1||o>100)return{ok:!1,error:"Invalid q (must be 1-100)",status:400};let y=e.searchParams.get("fit")||t.defaultFit||U;if(!T.has(y))return{ok:!1,error:`Invalid fit (must be one of: ${[...T].join(", ")})`,status:400};return{ok:!0,srcFsPath:n,srcUrl:r,width:m,height:w,format:I,quality:o,fit:y}}async function L(){return await import("./chunk-eacd5755.js")}
|
|
3
3
|
export{mo,oa};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-g1r4v0mc.js";import"./chunk-ba88n1j7.js";import{m,h,w,L}from"./chunk-96kr2xrt.js";import"./chunk-g495xx4v.js";import"./chunk-c57j92td.js";import"./chunk-xd4zvm4x.js";import"./chunk-9p3rtfbv.js";import"./chunk-5tbqdz94.js";import"./chunk-kp4mzspk.js";import"./chunk-zz5b1g50.js";import"./chunk-v74acg2k.js";import"./chunk-e6y6s7q8.js";import"./chunk-68tzytfz.js";import f from"path";var S=["applyOfflineUpdate","broadcast","cacheMedia","calculateDistance","canNotify","clearCookies","clearFetchCache","clearOfflineData","clearStorage","copyToClipboard","createShareableFile","defineForm","getBatteryLevel","getCookie","getCurrentPosition","getStorageKeys","getStorageSize","getVoices","hasBattery","hasCameraPermission","hasGeolocationPermission","hasMicrophonePermission","hasNotificationPermission","hasResizeObserver","hexToHsl","hexToRgb","isBroadcastChannelSupported","isCharging","isDeviceMotionSupported","isDeviceOrientationSupported","isEventSourceSupported","isEyeDropperSupported","isInFullscreen","isMutationObserverSupported","isPermissionGranted","isSpeechRecognitionSupported","isSpeechSynthesisSupported","isWakeLockSupported","isWebSocketSupported","notify","onOfflineUpdateReady","parseCookies","pickColor","prefetch","removeCookie","requestMediaPermissions","requestMotionPermission","requestNotificationPermission","requestOrientationPermission","setCookie","share","shareCurrentPage","shareFiles","shareText","shareURL","shareWithFallback","speak","stopSpeaking","toggleFullscreen","useAmbientSound","useAsyncData","useAttributeObserver","useAutoLogout","useAutoWakeLock","useBattery","useBreakpoint","useBreathPacer","useBroadcastChannel","useBroadcastStream","useChannel","useChildListObserver","useClipboard","useColorHistory","useConditionalWakeLock","useCookies","useCopySelection","useDeviceMotion","useDeviceOrientation","useElementSize","useElementTextSelection","useElementVisibility","useEventSource","useEyeDropper","useFavicon","useForm","useFullscreen","useGeolocation","useGeolocationWatch","useHotkey","useIdle","useIdleState","useInfiniteScroll","useIntersectionObserver","useIntersectionObserverMultiple","useIsDesktop","useIsMobile","useIsTablet","useKeyPressed","useKeySequence","useKeyboard","useLastActive","useLazyLoad","useMeta","useMouse","useMouseInElement","useMutationObserver","useNetwork","useNotification","useOnline","useOutbox","useParallax","usePermission","usePermissions","usePointer","usePost","useResizeObserver","useResizeObserverMultiple","useSSE","useScroll","useSelectionPopup","useShare","useSpeechRecognition","useSpeechSynthesis","useStorage","useTextObserver","useTextSelection","useTitle","useVisibility","useWakeLock","useWindowSize"],_=new Set(S);var l=new Map,x=m(64),y=new Set,O=0,R=new Set(S);function W(){l.clear(),x.clear()}function P(o){let n=new Map;for(let r of o){let a=f.basename(r);if(a.endsWith(".d.ts"))continue;let t=a.replace(/\.[jt]s$/,"");if(t==="index")continue;if(t===a)continue;let i=n.get(t);if(i&&!i.endsWith(".js"))continue;n.set(t,r)}return[...n.values()].sort()}function I(o,n){let r=n.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(?:^|[^\\w$.])(?:const|let|var|function|class)\\s+${r}\\b`).test(o)}function M(o){if(!o)return[];let n=h(o,O),r=x.get(n);if(r)return r.slice();let a=o.replace(/<script\b[^>]*\bdata-stx-runtime\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-framework-composables\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-stores\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-composables\b[^>]*>[\s\S]*?<\/script>/gi,""),t=[];for(let i of R){if(y.has(i))continue;let u=i.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");if(new RegExp(`(^|[^\\w$.])${u}\\s*\\(`).test(a))t.push(i)}return t.sort(),x.set(n,t),t.slice()}async function A(o,n){let r=M(o);if(r.length===0)return null;let a=n??f.join(import.meta.dir,"composables"),t=`${a}\x00${r.join(",")}`,i=l.get(t);if(i!==void 0)return i||null;let u=L({loader:"ts",target:"browser",define:w()}),C=new Set(r),d=[],g=new Set,p=[];try{let s=new Bun.Glob("*.{ts,js}");for await(let e of s.scan({cwd:a,absolute:!0}))p.push(e)}catch{return l.set(t,""),null}p=P(p);for(let s of p){let e;try{e=await Bun.file(s).text()}catch{continue}let b=[];try{b=u.scan(e).exports.filter((c)=>c!=="default")}catch{continue}if(!b.some((c)=>C.has(c)))continue;try{e=e.replace(/^import\s+.*from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^import\s+type\s+.*$/gm,""),e=e.replace(/^export\s+\*\s+(?:as\s+\w+\s+)?from\s*['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^export\s+(?:type\s+)?\{[\s\S]*?\}\s*(?:from\s*['"][^'"]+['"]\s*)?;?\s*$/gm,""),e=e.replace(/^export\s+default\s+/gm,""),e=e.replace(/^export\s+(?=(?:declare\s+)?(?:abstract\s+)?(?:async\s+)?(?:function|class|const|let|var|type|interface|enum)\b)/gm,""),d.push(`// ${f.basename(s).replace(/\.[jt]s$/,"")}
|
|
3
3
|
${u.transformSync(e).trim()}`);for(let c of b)g.add(c)}catch(c){console.warn(`[stx] framework composable ${f.basename(s)} could not be bundled:`,c)}}let v=r.filter((s)=>!g.has(s)&&!I(o,s));if(v.length>0)console.warn(`[stx] could not bundle ${v.join(", ")} from @stacksjs/stx/composables \u2014 `+"calls to them will throw ReferenceError in the browser. Import them explicitly so the bundler inlines them, or use a runtime equivalent from window.stx.");if(d.length===0)return l.set(t,""),null;let E=[...g].map((s)=>` try { if (!(${JSON.stringify(s)} in __s)) { __s[${JSON.stringify(s)}] = ${s}; if (!(${JSON.stringify(s)} in window)) window[${JSON.stringify(s)}] = ${s}; } } catch (e) {}`).join(`
|
|
4
4
|
`),k=`<script data-stx-framework-composables>
|
|
5
5
|
;(function(){
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ne,oc,Md,Nd,Ld,jd,ic,ac,Bd,Fd,Ko,zd,nn,rn,zn}from"./chunk-96kr2xrt.js";import"./chunk-68tzytfz.js";import"./chunk-c57j92td.js";import"./chunk-kp4mzspk.js";import"./chunk-v74acg2k.js";import"./chunk-zz5b1g50.js";import"./chunk-5tbqdz94.js";import"./chunk-9p3rtfbv.js";import"./chunk-g495xx4v.js";import"./chunk-ba88n1j7.js";import"./chunk-g1r4v0mc.js";import"./chunk-xd4zvm4x.js";import"./chunk-e6y6s7q8.js";export{jd as __setSignalsGeneratorsForTest,Ne as cacheEngineFingerprint,rn as cacheTemplate,nn as checkCache,zd as clearDevCaches,ac as getCachedRouterScript,ic as getCachedSignalsRuntime,Bd as getServeClientAsset,Ko as getServeModuleBundle,zn as hashFilePath,Nd as invalidateFileCache,Ld as invalidateFileCacheByDir,Md as readFileCached,Fd as registerServeModuleBundle,oc as templateCache};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Bs,Fs,Qe,G,xn,lr,Sn,ur,
|
|
2
|
+
import{Bs,Fs,Qe,G,xn,lr,Sn,dr,ur,Bc,Fc,zc,kn,Hc,Vc,Uc,Wc,Fi,zi,Hi,zs,Vi,qc,et,tt,nt,rt,st,ot,Ce,Kc}from"./chunk-xd4zvm4x.js";export{Sn as Router,Uc as abortNavigation,lr as bracketPathToRegex,et as clearMiddleware,zi as createClientCookieManager,st as createMiddlewareContext,rt as createRouteLocation,Fi as createServerCookieManager,Hi as createStorageManager,Wc as defineMiddleware,Fc as defineRoute,zc as defineRoutes,dr as findErrorPage,ur as formatRoutes,Fs as generateRouteManifest,Bs as generateRouteTypes,Vi as getMiddleware,tt as getMiddlewareNames,Ce as getRouterScript,Kc as getRouterScriptDev,qc as hasMiddleware,Qe as isFileRequestPath,nt as loadMiddlewareFromDirectory,xn as matchRoute,Vc as navigateTo,G as patternToRegex,zs as registerMiddleware,Hc as resetRoutes,kn as route,ot as runMiddleware,Bc as setAppUrl};
|