// @bun
var{defineProperty:J,getOwnPropertyNames:L,getOwnPropertyDescriptor:M}=Object,N=Object.prototype.hasOwnProperty;function O(q){return this[q]}var _=(q)=>{var w=(K??=new WeakMap).get(q),z;if(w)return w;if(w=J({},"__esModule",{value:!0}),q&&typeof q==="object"||typeof q==="function"){for(var B of L(q))if(!N.call(w,B))J(w,B,{get:O.bind(q,B),enumerable:!(z=M(q,B))||z.enumerable})}return K.set(q,w),w},K;var Q=(q)=>q;function R(q,w){this[q]=Q.bind(null,w)}var $=(q,w)=>{for(var z in w)J(q,z,{get:w[z],enumerable:!0,configurable:!0,set:R.bind(w,z)})};var U=(q,w)=>()=>(q&&(w=q(q=0)),w);var j=import.meta.require;function X(){return`stx-${++W}`}function G(q=null){return{scopeId:X(),parent:q,provides:new Map(q?.provides),exposed:null,refs:{},props:{},attrs:{},slots:{},emit:()=>{},el:null,errorCapturedHooks:[],isMounted:!1}}function T(q){if(q)F.push(q);else if(F.length>0)F.pop();D=q||F[F.length-1]||null}function b(){return D}function V(){D=null,F.length=0}function m(q,w){if(D)D.provides.set(q,w);else H.set(q,w)}function h(q,w){let z=D;while(z){if(z.provides.has(q))return z.provides.get(q);z=z.parent}if(H.has(q))return H.get(q);return w}function P(q,w){H.set(q,w)}function S(q){let w=D,z=(B,...E)=>{if(typeof document>"u")return;if(w?.el)w.el.dispatchEvent(new CustomEvent(B,{detail:E.length===1?E[0]:E,bubbles:!0,cancelable:!0}))};if(w)w.emit=z;return z}function f(q){if(D)D.exposed=q}function g(q){let w=Promise.resolve();return q?w.then(q):w}function x(q){if(D)D.errorCapturedHooks.push(q)}function C(q,w,z){let B=w?.parent;while(B){for(let E of B.errorCapturedHooks)if(E(q,w,z)===!1)return;B=B.parent}}function I(){return D?.slots??{}}function d(){return D?.slots??{}}function v(){return D?.attrs??{}}function y(q){let w=q.__provides?new Map(Object.entries(q.__provides)):new Map;return{...q,__provides:w,__provide(z,B){w.set(z,B)},__inject(z,B){if(w.has(z))return w.get(z);if(q.__provides){let E=q.__provides instanceof Map?q.__provides:new Map(Object.entries(q.__provides));if(E.has(z))return E.get(z)}return B}}}function l(){return`
// STX Composition API Runtime
(function() {
  const _provides = new Map();
  const _scopes = window.__stx_scopes || (window.__stx_scopes = {});
  const _exposed = window.__stx_exposed || (window.__stx_exposed = {});

  // provide() stores values in the nearest scope's provide map
  window.__stx_provide = function(key, value) {
    _provides.set(key, value);
  };

  // inject() walks up DOM ancestors with data-stx-scope to find provided values
  window.__stx_inject = function(key, defaultValue, el) {
    // Walk up the DOM tree
    let current = el ? el.closest('[data-stx-scope]') : null;
    while (current) {
      const scopeId = current.getAttribute('data-stx-scope');
      const scope = _scopes[scopeId];
      if (scope && scope.__provided && scope.__provided.has(key)) {
        return scope.__provided.get(key);
      }
      current = current.parentElement ? current.parentElement.closest('[data-stx-scope]') : null;
    }
    // Check global provides
    if (_provides.has(key)) return _provides.get(key);
    return defaultValue;
  };

  // defineEmits() returns an emit function
  window.__stx_defineEmits = function(scopeId) {
    return function emit(event, ...args) {
      const el = document.querySelector('[data-stx-scope="' + scopeId + '"]');
      if (el) {
        el.dispatchEvent(new CustomEvent(event, {
          detail: args.length === 1 ? args[0] : args,
          bubbles: true,
          cancelable: true
        }));
      }
    };
  };

  // defineExpose() registers exposed properties
  window.__stx_defineExpose = function(scopeId, exposed) {
    _exposed[scopeId] = exposed;
  };

  // nextTick()
  window.__stx_nextTick = function(fn) {
    return Promise.resolve().then(fn);
  };

  // Template ref resolution
  window.__stx_resolveRefs = function(scopeId) {
    const scope = document.querySelector('[data-stx-scope="' + scopeId + '"]');
    if (!scope) return {};
    const refs = {};
    // eslint-disable-next-line pickier/no-unused-vars
    scope.querySelectorAll('[data-stx-ref]').forEach(function(el) {
      refs[el.getAttribute('data-stx-ref')] = el;
    });
    return refs;
  };
})();
`}var D=null,F,W=0,H;var Y=U(()=>{F=[];H=new Map});Y();export{I as useSlots,v as useAttrs,P as setGlobalProvide,T as setCurrentInstance,V as resetComponentState,m as provide,x as onErrorCaptured,g as nextTick,h as inject,C as handleError,b as getCurrentInstance,X as generateScopeId,l as generateCompositionRuntime,d as defineSlots,f as defineExpose,S as defineEmits,y as createProvideContext,G as createComponentInstance};
