// @bun
var{defineProperty:K,getOwnPropertyNames:X,getOwnPropertyDescriptor:Y}=Object,Z=Object.prototype.hasOwnProperty;function _(b){return this[b]}var U=(b)=>{var j=(Q??=new WeakMap).get(b),q;if(j)return j;if(j=K({},"__esModule",{value:!0}),b&&typeof b==="object"||typeof b==="function"){for(var A of X(b))if(!Z.call(j,A))K(j,A,{get:_.bind(b,A),enumerable:!(q=Y(b,A))||q.enumerable})}return Q.set(b,j),j},Q;var $=(b)=>b;function G(b,j){this[b]=$.bind(null,j)}var h=(b,j)=>{for(var q in j)K(b,q,{get:j[q],enumerable:!0,configurable:!0,set:G.bind(j,q)})};var E=(b,j)=>()=>(b&&(j=b(b=0)),j);var W=import.meta.require;function L(b){if(b===String)return"string";if(b===Number)return"number";if(b===Boolean)return"boolean";if(b===Array)return"array";if(b===Object)return"object";if(b===Function)return"function";if(b===Date)return"date";if(b===Symbol)return"symbol";if(typeof b==="function"&&b.name)return b.name;return"unknown"}function S(b,j){if(b===null||b===void 0)return!0;if(j===String)return typeof b==="string";if(j===Number)return typeof b==="number"&&!Number.isNaN(b);if(j===Boolean)return typeof b==="boolean";if(j===Array)return Array.isArray(b);if(j===Object)return typeof b==="object"&&!Array.isArray(b);if(j===Function)return typeof b==="function";if(j===Date)return b instanceof Date;if(j===Symbol)return typeof b==="symbol";if(typeof j==="function")return b instanceof j;return!0}function R(b,j,q,A){let z=A?`[${A}]`:"";if(q.required&&(j===void 0||j===null))return{prop:b,message:`${z} Missing required prop: "${b}"`,value:j,expected:q.type?L(q.type):void 0};if(j===void 0||j===null)return null;if(q.type){let B=Array.isArray(q.type)?q.type:[q.type];if(!B.some((C)=>S(j,C))){let C=B.map((D)=>L(D)).join(" | ");return{prop:b,message:`${z} Invalid prop type for "${b}": expected ${C}, got ${typeof j}`,value:j,expected:C}}}if(q.validator){if(!q.validator(j))return{prop:b,message:`${z} Custom validation failed for prop "${b}"`,value:j}}return null}function O(b){let j=globalThis.__STX_CURRENT_PROPS__||{};if(!b)return j;let q={...j};for(let[A,z]of Object.entries(b)){let B=typeof z==="function"||Array.isArray(z)?{type:z}:z||{};if(q[A]===void 0&&B.default!==void 0)q[A]=typeof B.default==="function"?B.default():B.default}return q}function T(b,j={}){let{componentName:q,throwOnError:A=!1,logWarnings:z=!0}=j,B=globalThis.__STX_CURRENT_PROPS__||{},F={...B},C={valid:!0,errors:[],warnings:[]};for(let[D,H]of Object.entries(b)){let I=typeof H==="function"||Array.isArray(H)?{type:H}:H||{};if(F[D]===void 0&&I.default!==void 0)F[D]=typeof I.default==="function"?I.default():I.default;let J=R(D,F[D],I,q);if(J){if(C.valid=!1,C.errors.push(J),z)console.warn(J.message)}}for(let D of Object.keys(B))if(!(D in b)){let H=`${q?`[${q}]`:""} Unknown prop: "${D}"`;if(C.warnings.push(H),z)console.warn(H)}if(A&&!C.valid){let D=C.errors.map((H)=>H.message).join(`
`);throw Error(`Prop validation failed:
${D}`)}return{props:F,validation:C}}function x(b,j){let q={...b};for(let[A,z]of Object.entries(j))if(q[A]===void 0)q[A]=typeof z==="function"?z():z;return q}function P(b){return b}function g(b){return{type:b,required:!0}}function w(b,j){return{type:j,default:b}}function N(b,j={}){return{...j,validator:b}}function k(b,j={}){return{...j,validator:(q)=>b.includes(q)}}function c(b,j={}){return{...j,type:Array,validator:(q)=>{if(!Array.isArray(q))return!1;return!0}}}function f(b,j={}){return{...j,type:Object}}function m(b,j,q){if(!j)return b;let A={};for(let[z,B]of Object.entries(j)){let F=typeof B==="function"||Array.isArray(B)?{type:B}:B||{},C=b[z];if(C===void 0&&F.default!==void 0)C=typeof F.default==="function"?F.default():F.default;{let D=R(z,C,F,q);if(D)console.warn(D.message)}A[z]=C}for(let[z,B]of Object.entries(b))if(!(z in A))A[z]=B;return A}function d(){let b=globalThis.__STX_CURRENT_ELEMENT__;return(j,q)=>{if(b){let A=new CustomEvent(String(j),{detail:q,bubbles:!0,cancelable:!0});b.dispatchEvent(A)}else console.warn(`Cannot emit event "${String(j)}" - no element context`)}}function v(b){let j=globalThis.__STX_CURRENT_ELEMENT__;if(j)j.__stx_exposed__=b,j.setAttribute("data-stx-exposed",Object.keys(b).join(","))}function y(b,j){let q=[`interface ${b}Props {`];for(let[A,z]of Object.entries(j)){let B=typeof z==="function"||Array.isArray(z)?{type:z}:z||{},F=B.type?L(B.type):"unknown",C=B.required?"":"?",D=B.description?`  /** ${B.description} */
`:"";q.push(`${D}  ${A}${C}: ${F}`)}return q.push("}"),q.join(`
`)}export{x as withDefaults,N as validated,f as shape,g as required,P as prop,m as processComponentProps,w as optional,k as oneOf,y as generatePropsInterface,T as definePropsWithValidation,O as defineProps,v as defineExpose,d as defineEmits,c as arrayOf};
