incajs 0.0.29 → 0.0.31

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.
@@ -0,0 +1,2 @@
1
+ function e(){return globalThis.__inca_native__}const t=/* @__PURE__ */ new WeakSet;function n(e,n){return t.add(e),Object.defineProperty(e,"__node_id",{value:n})}function r(e){return typeof e==`object`&&!!e&&t.has(e)}const i=/* @__PURE__ */ new Map,a=new FinalizationRegistry(e=>{i.get(e)?.deref()||i.delete(e)});function o(e){i.set(e.__node_id,new WeakRef(e)),a.register(e,e.__node_id)}function s(e){i.delete(e)}function c(e){return i.get(e)?.deref()}function l(e){let t=c(e);return t?.kind===`element`?t:void 0}const ee=/* @__PURE__ */ new WeakMap,te=/* @__PURE__ */ new WeakMap;function u(e){return e.kind===`element`?ee.get(e):void 0}function ne(e,t){ee.set(e,t),te.set(t,e)}const re=/* @__PURE__ */ new WeakSet;function d(e){return re.has(e)||p.has(e)}function f(e){if(re.add(e),e.kind===`text`)return;for(let t of e.__children)f(t);let t=u(e);t&&f(t)}const p=/* @__PURE__ */ new WeakSet;function m(e){return p.has(e)}function h(e){if(p.has(e)||(p.add(e),s(e.__node_id),e.kind===`text`))return;for(let t of e.__children)h(t);let t=u(e);t&&h(t);let n=e.kind===`fragment`?te.get(e):void 0;n&&h(n)}function ie(e){for(let t of e){let e=c(t);e&&h(e)}}const ae=new FinalizationRegistry(t=>e().releaseNode(t)),oe=/* @__PURE__ */ new WeakSet;function se(e){return oe.has(e)}function g(e){oe.add(e),ae.register(e,e.__node_id)}const _=/* @__PURE__ */ new Map,ce=/* @__PURE__ */ new Map;function le(e,t,n){let r=_.get(e);r||_.set(e,r=/* @__PURE__ */ new Map),r.set(t,n),ce.set(n,{group:e,listener:t})}function ue(e,t){return _.get(e)?.get(t)}function de(e){let t=ce.get(e);if(t===void 0)return;ce.delete(e);let n=_.get(t.group);n?.delete(t.listener),n?.size===0&&_.delete(t.group)}function fe(e){for(let t of e)de(t)}const pe=(e,t,n)=>`${e}:${t}:${n===!0}`;Object.defineProperty(globalThis,"__inca_released__",{value:(e,t)=>{fe(t),ie(e)},configurable:!0});let v=0;function me(){return v}function he(e){return(...t)=>{let n=t[0]?.eventId;return typeof n==`number`&&n>v&&(v=n),e(...t)}}function ge(t,n,r,i={}){if(r==null)return;let a=pe(t,n,i.capture);if(ue(a,r)!==void 0)return;let o=(...e)=>typeof r==`function`?r.apply(e[0]?.currentTarget,e):r.handleEvent.apply(r,e),s=i.once?(...e)=>(y(t,n,r,i),o(...e)):o;le(a,r,e().addEventListener(t,n,he(s),i.capture===!0,i.passive===!0))}function y(t,n,r,i={}){if(r==null)return;let a=ue(pe(t,n,i.capture),r);a!==void 0&&(e().removeEventListener(t,n,a),de(a))}function _e(t,n){return e().dispatchEvent(t,n)}function ve(t){e().click(t)}function ye(t,n){e().focusNode(t,n)}function be(t){e().blurNode(t)}function xe(t,n){e().setPointerCapture(t,n)}function Se(t,n){e().releasePointerCapture(t,n)}function Ce(t,n){return e().hasPointerCapture(t,n)}function b(e,t=[]){let n=typeof e==`function`?e:()=>e;return{addEventListener(e,r,i){let a=typeof i==`boolean`?{capture:i}:i??{};ge(n(),e,r,{...a,passive:a.passive??t.includes(e)})},removeEventListener(e,t,r){let i=typeof r==`boolean`?r:r?.capture;y(n(),e,t,{capture:i})},dispatchEvent:e=>_e(n(),e)}}function x(){return e().rootNodeId()}function we(){return e().documentNodeId()}function Te(t){return e().createElement(t)}function S(t){return e().createNode(t)}function Ee(t,n){return e().appendChild(t,n)}function C(t,n,r){return e().insertBefore(t,n,r)}function w(t,n){e().removeChild(t,n)}function De(t,n,r){return e().replaceChild(t,n,r)}function Oe(t,n){return e().cloneNode(t,n)}function ke(t){return e().innerHtml(t)}function Ae(t){return e().outerHtml(t)}function je(t,n){return e().setInnerHtml(t,n)}function Me(t,n){return e().setOuterHtml(t,n)}function Ne(t,n,r){return e().insertAdjacentHtml(t,n,r)}function Pe(t){return e().rootOf(t)}function Fe(t,n){return e().compareNodePosition(t,n)}function Ie(t,n){return e().isEqualNode(t,n)}function Le(t){fe(e().releaseListeners(t))}function T(t){e().holdNode(t)}function Re(t){e().releaseNode(t)}function E(t,n,r){e().setAttribute(t,n,r)}function D(t,n){return e().getAttribute(t,n)}function ze(t){return e().attributeNames(t)}function Be(t,n){return e().linkedNode(t,n)}function Ve(t){return e().childNodeIds(t)}function He(t){return e().isConnected(t)}function Ue(t){return e().textContent(t)}function We(t){return e().wholeText(t)}function Ge(t,n,r){return e().substringData(t,n,r)}function Ke(t,n,r,i){e().replaceData(t,n,r,i)}function qe(t,n){return e().splitText(t,n)}function Je(t,n){return e().matches(t,n)}function Ye(t,n){return e().closest(t,n)}function Xe(t,n){return e().querySelector(t,n)}function Ze(t,n){return e().querySelectorAll(t,n)}function O(t){e().checkSelector(t)}function Qe(t){return e().layoutOf(t)}function $e(t){return e().scrollOf(t)}function et(t,n,r){e().scrollNode(t,n,r)}function tt(t,n,r){e().scrollIntoViewNode(t,n,r)}function nt(t,n){e().removeAttribute(t,n)}function rt(t,n,r){e().setStyle(t,n,r)}function it(t,n){e().removeStyle(t,n)}function at(t){return e().inputValue(t)}function ot(t,n){e().setInputValue(t,n)}function st(){return e().focusedNode()}const ct=/^(?:0|[1-9]\d*)$/,lt=2**32-1;function k(e){return ct.test(e)&&Number(e)<lt}function ut(e,t){return t===``?null:e.find(e=>e.id===t)??e.find(e=>e.getAttribute(`name`)===t)??null}function dt(e){let t=/* @__PURE__ */ new Set;for(let n of e)t.add(n.id),t.add(n.getAttribute(`name`)??``);return t.delete(``),[...t]}function ft(e){let{source:t,named:n}=e,r=e=>{if(e!==l)throw TypeError(`the receiver is not a collection. call it on one`)},i={writable:!0,enumerable:!0,configurable:!0},a=Object.create(Object.prototype,{length:{get(){return r(this),t().length},enumerable:!0,configurable:!0},item:{...i,value:Object.defineProperty(function(...e){if(r(this),e.length<1)throw TypeError(`item() needs 1 argument`);return t()[e[0]>>>0]??null},"length",{value:1})},...e.method&&{[e.method]:{...i,value(...t){if(r(this),t.length<1)throw TypeError(`${e.method}() needs 1 argument`);return e.find(`${t[0]}`)}}},...e.arrayMembers&&{forEach:{...i,value:Array.prototype.forEach},entries:{...i,value:Array.prototype.entries},keys:{...i,value:Array.prototype.keys},values:{...i,value:Array.prototype.values}},[Symbol.iterator]:{...i,enumerable:!1,value:Array.prototype.values},[Symbol.toStringTag]:{value:e.tag,configurable:!0}}),o=Object.create(a),s=e=>Object.hasOwn(o,e),c=e=>k(e)||!s(e)&&!(e in a)&&n(e)!==null,l=new Proxy(o,{get(e,r,i){return typeof r==`symbol`?Reflect.get(o,r,i):k(r)?t()[Number(r)]:r in o?Reflect.get(o,r,i):n(r)??void 0},has(e,r){return typeof r==`symbol`||r in o?r in o:k(r)?Number(r)<t().length:n(r)!==null},set(e,t,n,r){return r===l&&typeof t==`string`&&c(t)?!1:Reflect.set(o,t,n,r)},deleteProperty(e,n){if(typeof n==`string`){if(k(n))return Number(n)>=t().length;if(c(n))return!1}return Reflect.deleteProperty(o,n)},preventExtensions:()=>!1,defineProperty(e,t,n){return typeof t==`string`&&c(t)?!1:Reflect.defineProperty(o,t,n)},ownKeys(){let n=t(),r=Array.from(n,(e,t)=>String(t)),i=e.names(n).filter(e=>!k(e)&&!(e in a)&&!s(e)),c=Reflect.ownKeys(o);return[...r,...c,...i]},getOwnPropertyDescriptor(e,r){if(typeof r==`symbol`||s(r))return Reflect.getOwnPropertyDescriptor(o,r);if(k(r)){let e=t()[Number(r)];return e?{value:e,writable:!1,enumerable:!0,configurable:!0}:void 0}let i=r in a?void 0:n(r);return i?{value:i,writable:!1,enumerable:!1,configurable:!0}:void 0}});return l}function pt(e){let t=t=>ut(e(),t);return ft({tag:`HTMLCollection`,method:`namedItem`,source:e,find:t,named:t,names:dt})}function mt(e,t,n){return ft({tag:`NamedNodeMap`,method:`getNamedItem`,source:e,find:t,named:n,names:e=>e.map(e=>e.name)})}function A(e){return ft({tag:`NodeList`,arrayMembers:!0,source:e,find:()=>null,named:()=>null,names:()=>[]})}const ht=/* @__PURE__ */ new Set([`\0`,` `,`
2
+ `,`\f`,`\r`,` `,`/`,`=`,`>`]);function gt(e){if(e.length===0)return!1;for(let t of e)if(ht.has(t))return!1;return!0}function j(e){if(typeof e==`symbol`)throw TypeError(`a symbol cannot become text`);return String(e)}function M(e,t,n){if(e.length<t)throw TypeError(`${n}() needs ${t} argument${t===1?``:`s`}`)}function _t(e){return e.replace(/[A-Z]/g,e=>e.toLowerCase())}var N=class e{#e;#t;#n;#r;#i;constructor(e,t,n,r,i){this.#e=e,this.#i=t,this.#t=n,this.#r=r,this.#n=i}static detach(e){e.#r=null,e.#n(e)}#a(){if(this.#r===null)return!1;let t=m(this.#r)?null:D(this.#t,this.#e);return t===null?(e.detach(this),!1):(this.#i=j(t),!0)}get name(){return this.#e}get localName(){return this.#e}get value(){return this.#a(),this.#i}set value(e){let t=j(e);this.#a()&&E(this.#t,this.#e,t),this.#i=t}get namespaceURI(){return null}get prefix(){return null}get specified(){return!0}get ownerElement(){return this.#a(),this.#r}get[Symbol.toStringTag](){return`Attr`}};function vt(e,t){let n=t=>{let n=D(e,t);return n===null?null:j(n)},r=()=>m(t)?[]:ze(e),i=/* @__PURE__ */ new Map,a=e=>{i.get(e.name)===e&&i.delete(e.name)},o=(n,r)=>{let o=i.get(n);return o||(o=new N(n,r,e,t,a),i.set(n,o)),o},s=e=>{let r=m(t)?null:n(e);if(r!==null)return o(e,r);let a=i.get(e);return a&&N.detach(a),null},c=()=>{let e=r(),t=new Set(e);for(let[e,n]of i)t.has(e)||N.detach(n);return e.map(e=>i.get(e)??o(e,n(e)))},l;return{getAttribute:(...e)=>(M(e,1,`getAttribute`),m(t)?null:n(j(e[0]))),setAttribute:(...n)=>{M(n,2,`setAttribute`);let r=j(n[0]),i=j(n[1]);if(!gt(r))throw new DOMException(`the attribute name is not valid. it is empty or holds whitespace, '/', '=' or '>'`,`InvalidCharacterError`);m(t)||E(e,r,i)},hasAttribute:(...e)=>(M(e,1,`hasAttribute`),!m(t)&&n(j(e[0]))!==null),removeAttribute:(...n)=>{M(n,1,`removeAttribute`);let r=j(n[0]);m(t)||nt(e,r)},getAttributeNames:()=>r(),get attributes(){return l??=mt(c,e=>s(_t(e)),e=>e===_t(e)?s(e):null),l}}}function yt(e){return e.kind===`element`}function P(e){return e.__children.filter(yt)}function bt(e,t){let n=e.parent?.__children??[];for(let r=n.indexOf(e)+t;r>=0&&r<n.length;r+=t){let e=n[r];if(yt(e))return e}return null}function xt(e){let t;return{get children(){return t??=pt(()=>P(e))},get parentElement(){return e.parent?.kind===`element`?e.parent:null},get firstElementChild(){return P(e)[0]??null},get lastElementChild(){return P(e).at(-1)??null},get childElementCount(){return P(e).length},get previousElementSibling(){return bt(e,-1)},get nextElementSibling(){return bt(e,1)}}}const St=((...e)=>e)(`auxclick`,`beforeinput`,`blur`,`change`,`click`,`contextmenu`,`dblclick`,`focus`,`gotpointercapture`,`input`,`keydown`,`keypress`,`keyup`,`lostpointercapture`,`mousedown`,`mouseenter`,`mouseleave`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointerenter`,`pointerleave`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`scroll`,`wheel`);function F(e,t){for(let n of St){let r=null,i=function(e){typeof r==`function`&&Reflect.apply(r,this,[e])===!1&&e.preventDefault()};Object.defineProperty(e,`on${n}`,{get:()=>r,set(a){t()||(r=typeof a==`function`||typeof a==`object`&&a?a:null,r===null?e.removeEventListener(n,i):e.addEventListener(n,i))}})}return e}function I(e){return d(e)?null:Qe(e.__node_id)}function Ct(e){let t=e.parent;return!I(e)||t?.kind!==`element`||!I(t)?null:t}function wt(e){let t=I(e);if(!t)return{left:0,top:0};let n=Ct(e),r=n?I(n):null;return{left:Math.round(t[0]-(r?r[0]+r[4]:0)+t[5])||0,top:Math.round(t[1]-(r?r[1]+r[4]:0)+t[6])||0}}function Tt(e){let[t,n,r,i]=e??[0,0,0,0,0],a={x:t,y:n,width:r,height:i,top:n,left:t,right:t+r,bottom:n+i};return{...a,toJSON:()=>({...a})}}function Et(e,t){let n=t===`button`||t===`input`?0:-1;if(typeof e!=`string`&&typeof e!=`number`)return n;let r=/^[\t\n\f\r ]*([+-]?\d+)/.exec(String(e));if(!r)return n;let i=Number(r[1])||0;return i>=-2147483648&&i<=2147483647?i:n}function L(e){m(e)||se(e)||(T(e.__node_id),g(e))}function R(e){let t=e.parent;if(!t)return;let n=t.__children.indexOf(e);n!==-1&&t.__children.splice(n,1),e.parent=null}function z(e,t,n){e.__children.splice(n,0,...t);for(let n of t)n.parent=e}function Dt(e){e.parent&&w(e.parent.__node_id,e.__node_id),R(e)}function Ot(e,t,n){if(n===e&&e.parent===t)return;Dt(e);let r=n?t.__children.indexOf(n):-1;C(t.__node_id,e.__node_id,n&&r!==-1?n.__node_id:null),r===-1?t.__children.push(e):t.__children.splice(r,0,e),e.parent=t}function kt(e){e.parent&&m(e.parent)?R(e):Dt(e),Le(e.__node_id),f(e),L(e)}function At(e){return e.parent?.kind===`element`?e.parent:null}function jt(e){let t=e.parent;if(!t)return null;let n=t.__children.indexOf(e);return t.__children[n+1]??null}function Mt(e){return e===null?``:j(e)}function Nt(e,t){let n=/* @__PURE__ */ new Map,r=[];for(let[i,a,o,s]of e[1]){let e=n.get(o);if(a===`#fragment`){n.set(i,u(e));continue}let c=a===`#text`?t.text(i,s??``):a===`#comment`?t.element(i,`comment`):t.element(i,`element`,a);n.set(i,c),e?z(e,[c],e.__children.length):r.push(c)}return r}function Pt(e,t){let n=e.__node_id,r=(e,n)=>z(n,Nt(e,t),e[0]);return{get innerHTML(){return m(e)?``:ke(n)},set innerHTML(t){let i=Mt(t);if(m(e))return;let a=u(e)??e,o=je(n,i);for(let e of a.__children.slice())R(e),L(e);r(o,a)},get outerHTML(){return m(e)?``:Ae(n)},set outerHTML(t){let i=Mt(t);if(m(e))return;let a=Me(n,i),o=e.parent;a!==null&&(R(e),L(e),r(a,o))},insertAdjacentHTML:(...t)=>{M(t,2,`insertAdjacentHTML`);let i=j(t[0]),a=j(t[1]);if(m(e))return;let o=Ne(n,i,a),s=/^(beforebegin|afterend)$/i.test(i);r(o,s?e.parent:e)}}}function B(e){return e.toLowerCase()===`template`}function Ft(t,n){ne(t,n(e().templateContent(t.__node_id))),e().holdNode(t.__node_id),g(t)}function V(){return new DOMException(`the node was freed. pass a child of the node you call it on`,`NotFoundError`)}function H(e,t){if(!r(e))throw TypeError(`parameter ${t} is not a node. pass an element, a text node, a comment or a fragment`);return e}function It(e){return e.kind===`fragment`?e.__children.slice():[e]}function Lt(e,t,n){let r=Oe(e.__node_id,t),i=0,a=e=>{let[o,s]=r[i++];if(e.kind===`text`)return n.text(o,e.text);let c=e.kind===`fragment`?n.fragment(o):n.element(o,e.kind,e.kind===`element`?s:void 0);if(e.kind===`element`&&B(e.tagName)){i++;let n=u(c);if(t)for(let t of u(e).__children)z(n,[a(t)],n.__children.length)}if(!t)return c;for(let t of e.__children)z(c,[a(t)],c.__children.length);return c},o=a(e);return L(o),o}function U(e,t){let n=e.__node_id,r=e,i=(e,t)=>{let n=It(e),i=t();for(let e of n)R(e);z(r,n,i)};return{appendChild:(...e)=>{M(e,1,`appendChild`);let t=H(e[0],1);return i(t,()=>Ee(n,t.__node_id)),t},insertBefore:(...e)=>{M(e,2,`insertBefore`);let t=H(e[0],1),r=e[1]===null||e[1]===void 0?null:H(e[1],2);if(r&&m(r))throw V();return i(t,()=>C(n,t.__node_id,r?.__node_id??null)),t},removeChild:(...e)=>{M(e,1,`removeChild`);let t=H(e[0],1);if(m(t))throw V();return w(n,t.__node_id),R(t),L(t),t},replaceChild:(...e)=>{M(e,2,`replaceChild`);let t=H(e[0],1),i=H(e[1],2);if(m(i))throw V();let a=It(t),o=De(n,t.__node_id,i.__node_id);for(let e of a)R(e);return R(i),i!==t&&L(i),z(r,a,o),i},cloneNode:n=>Lt(e,!!n,t)}}function W(e,t){let n=e.__node_id,r=e=>e==null?null:H(e,1);return{contains:t=>{let i=r(t);return i===null?!1:i===e?!0:m(e)||m(i)?!1:!!(Fe(n,i.__node_id)&16)},getRootNode:()=>m(e)?e:t.node(Pe(n)),compareDocumentPosition:(...t)=>{M(t,1,`compareDocumentPosition`);let r=H(t[0],1);return r===e?0:m(e)||m(r)?33|(r.__node_id<n?2:4):Fe(n,r.__node_id)},isSameNode:t=>r(t)===e,isEqualNode:t=>{let i=r(t);return i===null?!1:m(e)||m(i)?i===e:Ie(n,i.__node_id)}}}const Rt={element:1,text:3,comment:8,document:9,fragment:11};function G(e){return m(e)?e.kind===`text`?e.text:``:String(D(e.__node_id,`value`)??``)}function K(e,t){e.kind!==`element`&&e.kind!==`fragment`&&e.kind!==`document`&&(m(e)||(E(e.__node_id,`value`,t),e.kind===`text`&&(e.text=t)))}function q(e,t){let n=e.__node_id,r=r=>{if(m(e))return null;let i=Be(n,r);return i===null?null:t.node(i)??null},i,a=()=>m(e)?[]:Ve(n).flatMap(e=>t.node(e)??[]);return{get nodeType(){return Rt[e.kind]},get nodeName(){return e.kind===`element`?e.tagName:e.kind===`fragment`?`#document-fragment`:`#${e.kind}`},get nodeValue(){return e.kind===`element`||e.kind===`fragment`||e.kind===`document`?null:G(e)},set nodeValue(t){K(e,String(t??``))},get isConnected(){return!m(e)&&He(n)},get ownerDocument(){return e.kind===`document`?null:t.document()},get parentNode(){return r(`parent`)},get firstChild(){return r(`first`)},get lastChild(){return r(`last`)},get previousSibling(){return r(`previous`)},get nextSibling(){return r(`next`)},get childNodes(){return i??=A(a)},hasChildNodes:()=>a().length>0}}function J(e,t,n){if(d(e))return;let[r,i]=t,[a,o]=typeof r==`object`?[r?.left,r?.top]:[r,i],[s,c]=n?$e(e.__node_id)??[0,0]:[0,0],l=(e,t)=>{if(e===void 0)return null;let r=Number(e);return(n?t:0)+(Number.isFinite(r)?r:0)};et(e.__node_id,l(a,s),l(o,c))}function zt(e){let t=[`start`,`center`,`end`,`nearest`];return typeof e==`object`&&e?{block:t.includes(e.block??``)?e.block:`start`,inline:t.includes(e.inline??``)?e.inline:`nearest`}:{block:e===!1?`end`:`start`,inline:`nearest`}}function Bt(e){return e==null?``:j(e)}function Vt(e){let t=e.__node_id,n=(n,r,i)=>{m(e)||(Ke(t,n,r,i),e.kind===`text`&&(e.text=G(e)))};return{get data(){return G(e)},set data(t){K(e,t===null?``:j(t))},get length(){return G(e).length},get textContent(){return G(e)},set textContent(t){K(e,Bt(t))},substringData:(...n)=>{if(M(n,2,`substringData`),!m(e))return Ge(t,n[0],n[1]);let r=n[0]>>>0;return G(e).slice(r,r+(n[1]>>>0))},appendData:(...t)=>{M(t,1,`appendData`),n(G(e).length,0,j(t[0]))},insertData:(...e)=>{M(e,2,`insertData`),n(e[0],0,j(e[1]))},deleteData:(...e)=>{M(e,2,`deleteData`),n(e[0],e[1],``)},replaceData:(...e)=>{M(e,3,`replaceData`),n(e[0],e[1],j(e[2]))}}}function Ht(e,t){let n=e.__node_id;return{get wholeText(){return m(e)?e.text:We(n)},splitText:(...r)=>{if(M(r,1,`splitText`),m(e))throw TypeError(`the text node was freed. create a new one`);let i=qe(n,r[0]),a=Y(i,String(D(i,`value`)??``),t);e.text=G(e);let o=e.parent;return o===null?(T(a.__node_id),g(a)):(o.__children.splice(o.__children.indexOf(e)+1,0,a),a.parent=o),a}}}function Ut(e,t){E(e.__node_id,`value`,t),e.text=t}function Y(e,t,r){let i=n({kind:`text`,parent:null,text:t},e);for(let e of[q(i,r),U(i,r),W(i,r),Vt(i),Ht(i,r)])Object.defineProperties(i,Object.getOwnPropertyDescriptors(e));return o(i),i}function X(e,t){return M(e,1,t),j(e[0])}function Wt(e){return nn(e)}function Gt(e){let t=e.__node_id;return{querySelector:(...n)=>{let r=X(n,`querySelector`);if(m(e))return O(r),null;let i=Xe(t,r);return i===null?null:Wt(i)},querySelectorAll:(...n)=>{let r=X(n,`querySelectorAll`);if(m(e))return O(r),A(()=>[]);let i=Ze(t,r).map(Wt);return A(()=>i)}}}const Z={element:Q,text:(e,t)=>Y(e,t,Z),fragment:$t,document:tn,node:nn};function Q(e,t,r=`div`,i=[]){let a=b(()=>e,i),s=()=>d(l)?null:$e(e),c={get id(){return m(l)?``:String(D(e,`id`)??``)},set id(t){m(l)||E(e,`id`,String(t))},kind:t,tagName:r.replace(/[a-z]/g,e=>e.toUpperCase()),parent:null,__children:[],focus:t=>{d(l)||ye(e,!!t?.preventScroll)},blur:()=>be(e),click:()=>{d(l)||ve(e)},setPointerCapture:t=>xe(e,t),releasePointerCapture:t=>Se(e,t),hasPointerCapture:t=>Ce(e,t),addEventListener:(...e)=>{d(l)||a.addEventListener(...e)},removeEventListener:(...e)=>{d(l)||a.removeEventListener(...e)},dispatchEvent:e=>m(l)||a.dispatchEvent(e),get tabIndex(){return Et(m(l)?null:D(e,`tabindex`),r)},set tabIndex(t){m(l)||E(e,`tabindex`,t|0)},getBoundingClientRect:()=>Tt(I(l)),get offsetWidth(){return Math.round(I(l)?.[2]??0)},get offsetHeight(){return Math.round(I(l)?.[3]??0)},get offsetLeft(){return wt(l).left},get offsetTop(){return wt(l).top},get offsetParent(){return Ct(l)},get clientWidth(){let e=I(l);return e?Math.max(0,Math.round(e[2]-2*e[4])):0},get clientHeight(){let e=I(l);return e?Math.max(0,Math.round(e[3]-2*e[4])):0},get clientLeft(){return Math.round(I(l)?.[4]??0)},get clientTop(){return Math.round(I(l)?.[4]??0)},get scrollLeft(){return s()?.[0]??0},set scrollLeft(e){J(l,[e],!1)},get scrollTop(){return s()?.[1]??0},set scrollTop(e){J(l,[void 0,e],!1)},get scrollWidth(){return l.clientWidth+Math.round(s()?.[2]??0)},get scrollHeight(){return l.clientHeight+Math.round(s()?.[3]??0)},scrollTo:(...e)=>J(l,e,!1),scrollBy:(...e)=>J(l,e,!0),scrollIntoView:t=>{if(d(l))return;let{block:n,inline:r}=zt(t);tt(e,n,r)},matches:(...t)=>{let n=X(t,`matches`);return m(l)?(O(n),!1):Je(e,n)},closest:(...t)=>{let n=X(t,`closest`);if(m(l))return O(n),null;let r=Ye(e,n);return r===null?null:Wt(r)}};B(r)&&Object.defineProperty(c,"content",{get:()=>u(l),enumerable:!0,configurable:!0}),r===`input`&&Object.defineProperty(c,"value",{get:()=>m(l)?``:at(e),set:t=>{m(l)||ot(e,t===null?``:String(t))},enumerable:!0,configurable:!0});let l=F(n(c,e),()=>d(l));return Object.defineProperties(l,Object.getOwnPropertyDescriptors(vt(e,l))),Object.defineProperties(l,Object.getOwnPropertyDescriptors(xt(l))),Object.defineProperties(l,Object.getOwnPropertyDescriptors(q(l,Z))),Object.defineProperties(l,Object.getOwnPropertyDescriptors(U(l,Z))),Object.defineProperties(l,Object.getOwnPropertyDescriptors(W(l,Z))),Object.defineProperties(l,Object.getOwnPropertyDescriptors(Gt(l))),Object.defineProperties(l,Object.getOwnPropertyDescriptors(t===`comment`?Vt(l):Kt(l))),t!==`comment`&&Object.defineProperties(l,Object.getOwnPropertyDescriptors(Pt(l,Z))),o(l),B(r)&&Ft(l,$t),l}function Kt(e){return{get textContent(){return m(e)?``:Ue(e.__node_id)},set textContent(t){m(e)||Zt(e,Bt(t))}}}function qt(e){return Q(S(e),`element`,e)}function Jt(e=``){let t=S(`#comment`);return rt(t,`display`,`none`),E(t,`value`,e),Q(t,`comment`)}function Yt(e){let t=S(`#text`);return E(t,`value`,e),Y(t,e,Z)}function Xt(e,t){return Y(e,t,Z)}function Zt(e,t){for(let t of e.__children.slice())w(e.__node_id,t.__node_id),R(t),L(t);if(!t)return;let n=Yt(t);Ee(e.__node_id,n.__node_id),n.parent=e,e.__children.push(n)}function Qt(){let e=x();return l(e)??Q(e,`element`,void 0,[`wheel`])}function $t(e){let t=n({kind:`fragment`,parent:null,__children:[]},e),r={get textContent(){return m(t)?``:Ue(e)},set textContent(e){m(t)||Zt(t,Bt(e))}};for(let e of[q(t,Z),U(t,Z),W(t,Z),r])Object.defineProperties(t,Object.getOwnPropertyDescriptors(e));return o(t),t}let en;function tn(){return en??=rn(we())}function nn(e){return c(e)||(e===x()?Qt():e===we()?tn():void 0)}function $(e){return L(e),e}function rn(e){let t=F(n({...b(e,[`wheel`]),kind:`document`,parent:null,__children:[],get textContent(){return null},set textContent(e){},get activeElement(){let e=st();return e===null?null:l(e)??null},createDocumentFragment:()=>$($t(S(`#fragment`))),createElement:(...e)=>{M(e,1,`createElement`);let[t,n]=Te(j(e[0]));return $(Q(t,`element`,n))},createTextNode:(...e)=>(M(e,1,`createTextNode`),$(Yt(j(e[0])))),createComment:(...e)=>(M(e,1,`createComment`),$(Jt(j(e[0]))))},e),()=>!1),{cloneNode:r,...i}=U(t,Z);for(let e of[q(t,Z),i,W(t,Z),Gt(t)])Object.defineProperties(t,Object.getOwnPropertyDescriptors(e));return Object.setPrototypeOf(t,Document.prototype),o(t),t}const an=/* @__PURE__ */ Object.defineProperty(F(b(`$window`,[`wheel`]),()=>!1),Symbol.toStringTag,{value:`Window`});Object.defineProperty(globalThis,"__inca_targets__",{value:e=>e.map(e=>{if(e===`$window`)return an;let t=nn(e);return t?.kind===`element`||t?.kind===`document`?t:null}),configurable:!0});export{it as A,ve as B,C,Re as D,Ze as E,E as F,d as G,ye as H,rt as I,g as K,b as L,tt as M,et as N,nt as O,$e as P,ge as R,T as S,Be as T,me as U,_e as V,y as W,Ee as _,Q as a,st as b,Qt as c,Ot as d,z as f,R as g,kt as h,qt as i,x as j,w as k,Zt as l,At as m,Xt as n,Yt as o,jt as p,Jt as r,tn as s,an as t,Ut as u,Ve as v,Qe as w,D as x,S as y,be as z};
@@ -1,20 +1,35 @@
1
- import { A as EventHandler, B as NodeListOf, C as Overflow, D as TagName, E as StyleProps, F as IncaInputElement, H as TextContentMember, I as IncaNode, L as IncaParent, M as HTMLCollectionOf, N as IncaElement, O as Attr, P as IncaFragment, R as IncaText, S as NodeId, T as ScrollAlignment, U as TextMembers, V as NodeMembers, _ as IncaPointerEvent, a as EventListener, b as IncaWindow, c as IncaCompositionEvent, d as IncaEventMap, f as IncaEventTarget, g as IncaMouseEvent, h as IncaKeyboardEvent, i as EventLike, j as EventHandlers, k as CharacterDataMembers, l as IncaDocument, m as IncaInputEvent, n as AttributeValue, o as EventListenerObject, p as IncaFocusEvent, r as CallbackId, s as EventListenerOrObject, t as window, u as IncaEvent, v as IncaUIEvent, w as Px, x as ListenerOptions, y as IncaWheelEvent, z as NamedNodeMap } from "./window-DIrasL0K.js";
1
+ import { A as EventHandler, B as IncaText, C as Overflow, D as TagName, E as StyleProps, F as IncaFragment, G as TextMembers, H as NodeListOf, I as IncaInputElement, L as IncaNode, M as HTMLCollectionOf, N as HtmlMembers, O as Attr, P as IncaElement, R as IncaParent, S as NodeId, T as ScrollAlignment, U as NodeMembers, V as NamedNodeMap, W as TextContentMember, _ as IncaPointerEvent, a as EventListener, b as IncaWindow, c as IncaCompositionEvent, d as IncaEventMap, f as IncaEventTarget, g as IncaMouseEvent, h as IncaKeyboardEvent, i as EventLike, j as EventHandlers, k as CharacterDataMembers, l as IncaDocument, m as IncaInputEvent, n as AttributeValue, o as EventListenerObject, p as IncaFocusEvent, r as CallbackId, s as EventListenerOrObject, t as window, u as IncaEvent, v as IncaUIEvent, w as Px, x as ListenerOptions, y as IncaWheelEvent, z as IncaTemplateElement } from "./window-Bc0a_a9g.js";
2
2
  /** How {@link IncaNative.linkedNode} names the node to reach from a node. */
3
3
  type NodeLink = "parent" | "first" | "last" | "previous" | "next";
4
- /** What a listener or a dispatch names: a node id, or the tag of `document` or `window`. */
5
- type EventTargetId = NodeId | "$document" | "$window";
4
+ /** One node of a parsed fragment: id, tag, parent id and the text of a text node or a comment. */
5
+ type ParsedEntry = [id: NodeId, tag: string, parentId: NodeId, data: string | null];
6
+ /**
7
+ * What a parse writes into the tree: the position of the first inserted node among the children of
8
+ * its container, and the nodes in pre-order. An entry whose parent is no entry is a root.
9
+ */
10
+ type Parsed = [position: number, entries: ParsedEntry[]];
11
+ /** What a listener or a dispatch names: a node id, or the tag of `window`. */
12
+ type EventTargetId = NodeId | "$window";
6
13
  /**
7
14
  * The host-injected object every wrapper in this package forwards to. Not part of the public
8
15
  * surface.
9
16
  */
10
17
  interface IncaNative {
11
18
  rootNodeId(): NodeId;
19
+ documentNodeId(): NodeId;
12
20
  createNode(tag: string): NodeId;
21
+ createElement(localName: string): [NodeId, TagName];
13
22
  appendChild(parentId: NodeId, nodeId: NodeId): number;
14
23
  insertBefore(parentId: NodeId, nodeId: NodeId, refId: NodeId | null): number;
15
24
  removeChild(parentId: NodeId, childId: NodeId): void;
16
25
  replaceChild(parentId: NodeId, nodeId: NodeId, childId: NodeId): number;
17
26
  cloneNode(nodeId: NodeId, deep: boolean): [NodeId, string][];
27
+ templateContent(nodeId: NodeId): NodeId | null;
28
+ innerHtml(nodeId: NodeId): string;
29
+ outerHtml(nodeId: NodeId): string;
30
+ setInnerHtml(nodeId: NodeId, html: string): Parsed;
31
+ setOuterHtml(nodeId: NodeId, html: string): Parsed | null;
32
+ insertAdjacentHtml(nodeId: NodeId, position: string, html: string): Parsed;
18
33
  rootOf(nodeId: NodeId): NodeId;
19
34
  compareNodePosition(nodeId: NodeId, otherId: NodeId): number;
20
35
  isEqualNode(nodeId: NodeId, otherId: NodeId): boolean;
@@ -65,7 +80,7 @@ declare global {
65
80
  var __inca_targets__: (targets: EventTargetId[]) => unknown[];
66
81
  }
67
82
  /**
68
- * Builds the listener methods of an event target: a node, document or window.
83
+ * Builds the listener methods of an event target: a node or window.
69
84
  * @param target - the target id, or a function that resolves it each time a method runs
70
85
  * @param passiveByDefault - event names whose listeners are passive unless
71
86
  * their options say `passive: false`
@@ -80,14 +95,14 @@ declare function createEventTarget(target: EventTargetId | (() => EventTargetId)
80
95
  */
81
96
  declare function latestEventId(): number;
82
97
  /**
83
- * Registers `listener` for `event` on the target (node, document or window).
98
+ * Registers `listener` for `event` on the target (node or window).
84
99
  * Registering the same listener for the same target, event and `capture`
85
100
  * again changes nothing, and the first registration keeps its other options.
86
101
  * A `null` listener is ignored.
87
102
  *
88
103
  * Any event name is accepted, and it fires when the host dispatches that name.
89
104
  * `IncaEventMap` gives the event type of each name the host dispatches.
90
- * @param target - the event target (node id, "$document" or "$window")
105
+ * @param target - the event target (node id or "$window")
91
106
  * @param event - the event name (e.g. `"click"`)
92
107
  * @param listener - a function, called with the event's `currentTarget` as
93
108
  * `this`, or an object whose `handleEvent` method is called with the object
@@ -103,7 +118,7 @@ declare function addEventListener(target: EventTargetId, event: string, listener
103
118
  /**
104
119
  * Drops the registration {@link addEventListener} made for `listener` on
105
120
  * the target with the same `event` and `capture`. A no-op if there is none.
106
- * @param target - the event target (node, document or window)
121
+ * @param target - the event target (node or window)
107
122
  * @param event - the event name
108
123
  * @param listener - the listener that was registered
109
124
  * @param options - `capture` of the registration to drop
@@ -113,7 +128,7 @@ declare function removeEventListener(target: EventTargetId, event: string, liste
113
128
  * Dispatches `event` at a target along its path. Dispatching at an element
114
129
  * reaches its ancestors, `document` and `window`. Dispatching at `document`
115
130
  * reaches `window`, and dispatching at `window` reaches only `window`.
116
- * @param target - the target to dispatch at (node id, "$document" or "$window")
131
+ * @param target - the target to dispatch at (node id or "$window")
117
132
  * @param event - the event to dispatch
118
133
  * @returns `false` when a listener canceled a cancelable event, else `true`
119
134
  * @throws TypeError when `target` is malformed or is an unknown target tag
@@ -181,7 +196,8 @@ declare function appendChild(parentId: NodeId, nodeId: NodeId): number;
181
196
  * @param refId - the sibling to insert before, or `null` to append at the end
182
197
  * @returns the position of the first attached node among the children of `parentId`
183
198
  * @throws {DOMException} `HierarchyRequestError` when `parentId` is a text node or a comment,
184
- * `nodeId` is `parentId` or an ancestor of it, or `nodeId` is the root container;
199
+ * `nodeId` is `parentId` or an ancestor of it, `nodeId` is the document, or `parentId` is the
200
+ * document and the insertion gives it text or a second element;
185
201
  * `NotFoundError` when `refId` is not a child of `parentId`
186
202
  * @throws {TypeError} when an id names no node
187
203
  */
@@ -330,6 +346,19 @@ declare function createElementNode(tag: TagName): IncaElement;
330
346
  * @returns the new hidden element
331
347
  */
332
348
  declare function createCommentNode(text?: string): IncaElement;
349
+ /**
350
+ * Creates a text leaf.
351
+ * @param text - the initial text content
352
+ * @returns the new text leaf
353
+ */
354
+ declare function createTextNode(text: string): IncaText;
355
+ /**
356
+ * Replaces all of `el`'s children with at most a single text child holding
357
+ * `text`. The old children keep their listeners. An empty string leaves `el` childless.
358
+ * @param el - the element or fragment whose children are replaced
359
+ * @param text - the new text content
360
+ */
361
+ declare function setElementText(el: IncaParent, text: string): void;
333
362
  /**
334
363
  * Returns the handle of the host's mount container, which stands between the app's elements and
335
364
  * `document` in an event path. A live handle is reused, so a mount and an event see one object.
@@ -375,31 +404,18 @@ declare function parentNode(node: IncaNode): IncaElement | null;
375
404
  * @returns the sibling immediately after `node` in its parent's children, or `null` if there is none (or `node` isn't attached)
376
405
  */
377
406
  declare function nextSibling(node: IncaNode): IncaNode | null;
378
- /**
379
- * Creates a text leaf.
380
- * @param text - the initial text content
381
- * @returns the new text leaf
382
- */
383
- declare function createTextNode(text: string): IncaText;
384
407
  /**
385
408
  * Updates a text leaf's content in place.
386
409
  * @param node - the text leaf to update
387
410
  * @param text - the new text content
388
411
  */
389
412
  declare function setText(node: IncaText, text: string): void;
390
- /**
391
- * Replaces all of `el`'s children with at most a single text child holding
392
- * `text`. An empty string leaves `el` childless.
393
- * @param el - the element or fragment whose children are replaced
394
- * @param text - the new text content
395
- */
396
- declare function setElementText(el: IncaParent, text: string): void;
397
413
  declare namespace rendererCore_d_exports {
398
- export { Attr, AttributeValue, CallbackId, CharacterDataMembers, EventHandler, EventHandlers, EventLike, EventListener, EventListenerObject, EventListenerOrObject, HTMLCollectionOf, IncaCompositionEvent, IncaCore, IncaDocument, IncaElement, IncaEvent, IncaEventMap, IncaEventTarget, IncaFocusEvent, IncaFragment, IncaInputElement, IncaInputEvent, IncaKeyboardEvent, IncaMouseEvent, IncaNode, IncaParent, IncaPointerEvent, IncaText, IncaUIEvent, IncaWheelEvent, IncaWindow, ListenerOptions, NamedNodeMap, NodeId, NodeListOf, NodeMembers, Overflow, Px, ScrollAlignment, StyleProps, TagName, TextContentMember, TextMembers, addEventListener, appendChild, blur, click, createCommentNode, createElementNode, createEventTarget, createIncaElement, createNode, createTextNode, dispatchEvent, focus, focusedNode, getAttribute, holdNode, insert, insertBefore, isRemoved, latestEventId, layoutOf, nextSibling, parentNode, releaseNode, remove, removeAttribute, removeChild, removeEventListener, removeStyle, rootElement, rootNodeId, scrollIntoViewNode, scrollNode, scrollOf, setAttribute, setElementText, setStyle, setText, window };
414
+ export { Attr, AttributeValue, CallbackId, CharacterDataMembers, EventHandler, EventHandlers, EventLike, EventListener, EventListenerObject, EventListenerOrObject, HTMLCollectionOf, HtmlMembers, IncaCompositionEvent, IncaCore, IncaDocument, IncaElement, IncaEvent, IncaEventMap, IncaEventTarget, IncaFocusEvent, IncaFragment, IncaInputElement, IncaInputEvent, IncaKeyboardEvent, IncaMouseEvent, IncaNode, IncaParent, IncaPointerEvent, IncaTemplateElement, IncaText, IncaUIEvent, IncaWheelEvent, IncaWindow, ListenerOptions, NamedNodeMap, NodeId, NodeListOf, NodeMembers, Overflow, Px, ScrollAlignment, StyleProps, TagName, TextContentMember, TextMembers, addEventListener, appendChild, blur, click, createCommentNode, createElementNode, createEventTarget, createIncaElement, createNode, createTextNode, dispatchEvent, focus, focusedNode, getAttribute, holdNode, insert, insertBefore, isRemoved, latestEventId, layoutOf, nextSibling, parentNode, releaseNode, remove, removeAttribute, removeChild, removeEventListener, removeStyle, rootElement, rootNodeId, scrollIntoViewNode, scrollNode, scrollOf, setAttribute, setElementText, setStyle, setText, window };
399
415
  }
400
416
  /**
401
417
  * What a custom renderer (`incajs/vue`) drives the host through: the tree and
402
418
  * event calls, the element handles and the shadow tree.
403
419
  */
404
420
  type IncaCore = typeof rendererCore_d_exports;
405
- export { setStyle as A, removeChild as C, scrollNode as D, scrollIntoViewNode as E, focus as F, latestEventId as I, removeEventListener as L, blur as M, click as N, scrollOf as O, dispatchEvent as P, createEventTarget as R, removeAttribute as S, rootNodeId as T, getAttribute as _, insert as a, layoutOf as b, remove as c, createElementNode as d, createIncaElement as f, focusedNode as g, createNode as h, setText as i, addEventListener as j, setAttribute as k, isRemoved as l, appendChild as m, createTextNode as n, nextSibling as o, rootElement as p, setElementText as r, parentNode as s, IncaCore as t, createCommentNode as u, holdNode as v, removeStyle as w, releaseNode as x, insertBefore as y };
421
+ export { setStyle as A, removeChild as C, scrollNode as D, scrollIntoViewNode as E, focus as F, latestEventId as I, removeEventListener as L, blur as M, click as N, scrollOf as O, dispatchEvent as P, createEventTarget as R, removeAttribute as S, rootNodeId as T, getAttribute as _, parentNode as a, layoutOf as b, createCommentNode as c, createTextNode as d, rootElement as f, focusedNode as g, createNode as h, nextSibling as i, addEventListener as j, setAttribute as k, createElementNode as l, appendChild as m, setText as n, remove as o, setElementText as p, insert as r, isRemoved as s, IncaCore as t, createIncaElement as u, holdNode as v, removeStyle as w, releaseNode as x, insertBefore as y };
@@ -0,0 +1 @@
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{A as t,B as n,C as r,D as i,F as a,G as o,H as s,I as c,K as l,L as u,M as d,N as f,O as p,P as m,R as h,S as g,U as _,V as v,W as y,_ as b,a as x,b as S,c as C,d as w,h as T,i as E,j as D,k as O,l as k,m as A,o as j,p as M,r as N,t as P,u as F,w as I,x as L,y as R,z}from"./hooks-BFw_ohVI.js";var B=/* @__PURE__ */ e({addEventListener:()=>h,appendChild:()=>b,blur:()=>z,click:()=>n,createCommentNode:()=>N,createElementNode:()=>E,createEventTarget:()=>u,createIncaElement:()=>x,createNode:()=>R,createTextNode:()=>j,dispatchEvent:()=>v,focus:()=>s,focusedNode:()=>S,getAttribute:()=>L,holdNode:()=>g,insert:()=>w,insertBefore:()=>r,isRemoved:()=>o,latestEventId:()=>_,layoutOf:()=>I,nextSibling:()=>M,parentNode:()=>A,releaseNode:()=>i,releaseWhenCollected:()=>l,remove:()=>T,removeAttribute:()=>p,removeChild:()=>O,removeEventListener:()=>y,removeStyle:()=>t,rootElement:()=>C,rootNodeId:()=>D,scrollIntoViewNode:()=>d,scrollNode:()=>f,scrollOf:()=>m,setAttribute:()=>a,setElementText:()=>k,setStyle:()=>c,setText:()=>F,window:()=>P});export{B as t};
@@ -1,15 +1,3 @@
1
- declare global {
2
- function setTimeout<A extends unknown[]>(handler: (...args: A) => void, delay?: number, ...args: A): number;
3
- function setInterval<A extends unknown[]>(handler: (...args: A) => void, delay?: number, ...args: A): number;
4
- function clearTimeout(id?: number): void;
5
- function clearInterval(id?: number): void;
6
- function requestAnimationFrame(callback: (time: number) => void): number;
7
- function cancelAnimationFrame(id: number): void;
8
- interface Performance {
9
- now(): number;
10
- }
11
- var performance: Performance;
12
- }
13
1
  /** The events whose handler property every element has. */
14
2
  declare const HANDLER_EVENTS: readonly ["auxclick", "beforeinput", "blur", "change", "click", "contextmenu", "dblclick", "focus", "gotpointercapture", "input", "keydown", "keypress", "keyup", "lostpointercapture", "mousedown", "mouseenter", "mouseleave", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointerenter", "pointerleave", "pointermove", "pointerout", "pointerover", "pointerup", "scroll", "wheel"];
15
3
  /** The plain values of a {@link RectLike}, as `toJSON` returns them. */
@@ -127,7 +115,7 @@ interface Attr {
127
115
  /** The element that holds the attribute, or `null` once the attribute is removed. */
128
116
  readonly ownerElement: IncaElement | null;
129
117
  }
130
- /** A live, read-only list of the attributes of an element in alphabetical order of the name. */
118
+ /** A live, read-only list of the attributes of an element in the order they were set. */
131
119
  interface NamedNodeMap {
132
120
  readonly [index: number]: Attr;
133
121
  /** The number of attributes. */
@@ -151,28 +139,28 @@ interface NamedNodeMap {
151
139
  /** The members every node has: what it is, its data and its place in the tree. */
152
140
  interface NodeMembers {
153
141
  /**
154
- * `1` for an element, `3` for a text node, `8` for a comment stand-in and `11` for a
155
- * fragment.
142
+ * `1` for an element, `3` for a text node, `8` for a comment stand-in, `9` for the document and
143
+ * `11` for a fragment.
156
144
  */
157
- readonly nodeType: 1 | 3 | 8 | 11;
145
+ readonly nodeType: 1 | 3 | 8 | 9 | 11;
158
146
  /**
159
147
  * The {@link IncaElement.tagName} of an element, `"#text"` for a text node, `"#comment"` for a
160
- * comment stand-in and `"#document-fragment"` for a fragment.
148
+ * comment stand-in, `"#document"` for the document and `"#document-fragment"` for a fragment.
161
149
  */
162
150
  readonly nodeName: string;
163
151
  /**
164
- * The data of a text node or a comment stand-in, and `null` for an element or a
152
+ * The data of a text node or a comment stand-in, and `null` for an element, the document or a
165
153
  * fragment. Assigning `null` or `undefined` stores `""` and any other value stores its string.
166
- * Assigning to an element, a fragment or a freed node does nothing.
154
+ * Assigning to an element, the document, a fragment or a freed node does nothing.
167
155
  */
168
156
  nodeValue: string | null;
169
- /** Whether the node hangs under the mount container, which counts as connected. */
157
+ /** Whether the node hangs under `document`. */
170
158
  readonly isConnected: boolean;
171
- /** The `document` export. */
172
- readonly ownerDocument: IncaDocument;
159
+ /** `document`, and `null` for `document` itself. */
160
+ readonly ownerDocument: IncaDocument | null;
173
161
  /**
174
- * The parent, `document` for the mount container and `null` for a detached node. A node inside
175
- * a fragment reads the fragment. A freed node reads `null`.
162
+ * The parent, or `null` for a detached node. A node inside a fragment reads the fragment. A
163
+ * freed node reads `null`.
176
164
  */
177
165
  readonly parentNode: IncaElement | IncaFragment | IncaDocument | null;
178
166
  /** The first child, or `null`. */
@@ -233,10 +221,10 @@ interface NodeMembers {
233
221
  */
234
222
  contains(other: IncaNode | null): boolean;
235
223
  /**
236
- * The `document` export while the node hangs under the mount container, else the topmost node
237
- * of its subtree, the node itself without a parent.
224
+ * The topmost node above this one: `document` for a connected node, else the top of its
225
+ * subtree, the node itself without a parent.
238
226
  */
239
- getRootNode(): IncaNode | IncaDocument;
227
+ getRootNode(): IncaNode;
240
228
  /**
241
229
  * The position of `other` relative to this node as a bit mask: `1` disconnected, `2` preceding,
242
230
  * `4` following, `8` contains, `16` contained by and `32` implementation specific. Nodes of
@@ -321,6 +309,29 @@ interface TextMembers {
321
309
  */
322
310
  splitText(offset: number): IncaText;
323
311
  }
312
+ /** The members that read and write the markup of an element. */
313
+ interface HtmlMembers {
314
+ /**
315
+ * The markup of the children. Assigning replaces all children with the nodes the string parses
316
+ * to in the context of the element, and `null` assigns `""`. A template reads and replaces its
317
+ * content.
318
+ */
319
+ innerHTML: string;
320
+ /**
321
+ * The markup of the element and its children. Assigning replaces the element with the nodes the
322
+ * string parses to in the context of its parent, and `null` assigns `""`. An element without a
323
+ * parent keeps its place. An element whose parent is `document` throws a
324
+ * `NoModificationAllowedError`.
325
+ */
326
+ outerHTML: string;
327
+ /**
328
+ * Parses `text` and inserts the nodes at `position`: `beforebegin`, `afterbegin`, `beforeend` or
329
+ * `afterend`, in any ASCII case. Another position throws a `SyntaxError`. `beforebegin` and
330
+ * `afterend` on an element without a parent or whose parent is `document` throw a
331
+ * `NoModificationAllowedError`.
332
+ */
333
+ insertAdjacentHTML(position: string, text: string): void;
334
+ }
324
335
  /**
325
336
  * A container node: either a real element or the hidden stand-in that
326
337
  * `createCommentNode` makes. It is the only node type that can act as a
@@ -331,7 +342,7 @@ interface TextMembers {
331
342
  * call, an assignment to a handler property does nothing, and `dispatchEvent()` runs no listener
332
343
  * on it.
333
344
  */
334
- interface IncaElement extends IncaEventTarget, EventHandlers, NodeMembers, TextContentMember {
345
+ interface IncaElement extends IncaEventTarget, EventHandlers, NodeMembers, TextContentMember, HtmlMembers {
335
346
  /**
336
347
  * The `id` attribute, or an empty string when it is unset. Assigning sets
337
348
  * the attribute to the value as a string.
@@ -435,7 +446,7 @@ interface IncaElement extends IncaEventTarget, EventHandlers, NodeMembers, TextC
435
446
  * @param name - The attribute name.
436
447
  */
437
448
  removeAttribute(name: string): void;
438
- /** The names of the set attributes in alphabetical order. */
449
+ /** The names of the set attributes in the order they were set. */
439
450
  getAttributeNames(): string[];
440
451
  /**
441
452
  * The set attributes as a live map. Every read returns the same object, which follows later
@@ -536,6 +547,11 @@ interface IncaInputElement extends IncaElement {
536
547
  */
537
548
  value: string;
538
549
  }
550
+ /** The handle of a `<template>`. */
551
+ interface IncaTemplateElement extends IncaElement {
552
+ /** The fragment that holds the markup of the template. It is never drawn or connected. */
553
+ readonly content: IncaFragment;
554
+ }
539
555
  /** A text leaf node. */
540
556
  interface IncaText extends NodeMembers, CharacterDataMembers, TextMembers {
541
557
  /** Discriminates this node within the {@link IncaNode} union. */
@@ -558,9 +574,9 @@ interface IncaFragment extends NodeMembers, TextContentMember {
558
574
  parent: null;
559
575
  }
560
576
  /** A node that can have children. */
561
- type IncaParent = IncaElement | IncaFragment;
562
- /** Any node the shadow tree holds: an element, comment, text leaf or fragment. */
563
- type IncaNode = IncaElement | IncaText | IncaFragment;
577
+ type IncaParent = IncaElement | IncaFragment | IncaDocument;
578
+ /** Any node the shadow tree holds: an element, comment, text leaf, fragment or the document. */
579
+ type IncaNode = IncaElement | IncaText | IncaFragment | IncaDocument;
564
580
  /**
565
581
  * Stable handle to a node in the native retained tree, returned by `createNode`
566
582
  * and used in every later call that touches that node.
@@ -738,9 +754,16 @@ interface IncaEventTarget {
738
754
  dispatchEvent(event: EventLike): boolean;
739
755
  }
740
756
  /**
741
- * The event target between the elements and `window`.
757
+ * The top node of the tree, the parent of the mount container. It holds at most one element and
758
+ * any number of comments, and no text.
742
759
  */
743
- interface IncaDocument extends IncaEventTarget, EventHandlers<IncaDocument> {
760
+ interface IncaDocument extends IncaEventTarget, EventHandlers<IncaDocument>, Omit<NodeMembers, "cloneNode"> {
761
+ /** Discriminates this node within the {@link IncaNode} union. */
762
+ readonly kind: "document";
763
+ /** The document has no parent. */
764
+ parent: null;
765
+ /** Always `null`. An assignment does nothing. */
766
+ textContent: string | null;
744
767
  /**
745
768
  * The element that has focus, or `null` when no element has focus. A `focus()` or `blur()` call
746
769
  * takes effect for this property at once.
@@ -751,6 +774,44 @@ interface IncaDocument extends IncaEventTarget, EventHandlers<IncaDocument> {
751
774
  * @returns the new fragment
752
775
  */
753
776
  createDocumentFragment(): IncaFragment;
777
+ /**
778
+ * Creates an element. The name converts to a string, and its ASCII upper case becomes lower
779
+ * case. The second argument of the web API is ignored.
780
+ * @param localName - The element name, such as `"div"`.
781
+ * @returns The new element, which has no parent.
782
+ * @throws TypeError when called without an argument
783
+ * @throws DOMException named `InvalidCharacterError` when `localName` is not a valid element name
784
+ */
785
+ createElement(localName: string): IncaElement;
786
+ /**
787
+ * Creates a text node.
788
+ * @param data - The text. It converts to a string.
789
+ * @returns The new text node, which has no parent.
790
+ * @throws TypeError when called without an argument
791
+ */
792
+ createTextNode(data: string): IncaText;
793
+ /**
794
+ * Creates a comment.
795
+ * @param data - The text. It converts to a string.
796
+ * @returns The new comment, which has no parent.
797
+ * @throws TypeError when called without an argument
798
+ */
799
+ createComment(data: string): IncaElement;
800
+ /**
801
+ * The first element below the document that matches the selector list, or `null`.
802
+ * @throws DOMException named `SyntaxError` for an invalid selector
803
+ * @param selectors - A selector list.
804
+ * @returns The first matching element in document order, or `null`.
805
+ */
806
+ querySelector(selectors: string): IncaElement | null;
807
+ /**
808
+ * The elements below the document that match the selector list, in document order, as a list
809
+ * that later changes do not reach. Every call returns a new list.
810
+ * @throws DOMException named `SyntaxError` for an invalid selector
811
+ * @param selectors - A selector list.
812
+ * @returns The matching elements.
813
+ */
814
+ querySelectorAll(selectors: string): NodeListOf<IncaElement>;
754
815
  }
755
816
  /**
756
817
  * The event target at the top of every event path.
@@ -779,8 +840,9 @@ interface IncaEvent {
779
840
  * The element the event is about. It is the deepest element under the pointer for pointer
780
841
  * events (the capturing element while the pointer is captured), the nearest common ancestor of
781
842
  * the press and the release for `click`, `dblclick` and `auxclick`, and the focused element for
782
- * key events. With no such element it is the mount container's element. A script dispatch at
783
- * `document` or `window` gives that object.
843
+ * key events. With no such element it is the mount container's element, or `document` while
844
+ * the mount container is out of the document. A script dispatch at `document` or `window`
845
+ * gives that object.
784
846
  */
785
847
  readonly target: IncaEventTarget;
786
848
  /** The same object as {@link IncaEvent.target}. */
@@ -1075,4 +1137,4 @@ type EventListenerOrObject<E = IncaEvent, T = IncaEventTarget> = EventListener<E
1075
1137
  * `dispatchEvent`, and the event handler properties such as `onkeydown`.
1076
1138
  */
1077
1139
  declare const window: IncaWindow;
1078
- export { EventHandler as A, NodeListOf as B, Overflow as C, TagName as D, StyleProps as E, IncaInputElement as F, ScrollOptions as G, TextContentMember as H, IncaNode as I, RectLike as K, IncaParent as L, HTMLCollectionOf as M, IncaElement as N, Attr as O, IncaFragment as P, IncaText as R, NodeId as S, ScrollAlignment as T, TextMembers as U, NodeMembers as V, ScrollIntoViewOptions as W, IncaPointerEvent as _, EventListener as a, IncaWindow as b, IncaCompositionEvent as c, IncaEventMap as d, IncaEventTarget as f, IncaMouseEvent as g, IncaKeyboardEvent as h, EventLike as i, EventHandlers as j, CharacterDataMembers as k, IncaDocument as l, IncaInputEvent as m, AttributeValue as n, EventListenerObject as o, IncaFocusEvent as p, RectValues as q, CallbackId as r, EventListenerOrObject as s, window as t, IncaEvent as u, IncaUIEvent as v, Px as w, ListenerOptions as x, IncaWheelEvent as y, NamedNodeMap as z };
1140
+ export { EventHandler as A, IncaText as B, Overflow as C, TagName as D, StyleProps as E, IncaFragment as F, TextMembers as G, NodeListOf as H, IncaInputElement as I, RectLike as J, ScrollIntoViewOptions as K, IncaNode as L, HTMLCollectionOf as M, HtmlMembers as N, Attr as O, IncaElement as P, IncaParent as R, NodeId as S, ScrollAlignment as T, NodeMembers as U, NamedNodeMap as V, TextContentMember as W, RectValues as Y, IncaPointerEvent as _, EventListener as a, IncaWindow as b, IncaCompositionEvent as c, IncaEventMap as d, IncaEventTarget as f, IncaMouseEvent as g, IncaKeyboardEvent as h, EventLike as i, EventHandlers as j, CharacterDataMembers as k, IncaDocument as l, IncaInputEvent as m, AttributeValue as n, EventListenerObject as o, IncaFocusEvent as p, ScrollOptions as q, CallbackId as r, EventListenerOrObject as s, window as t, IncaEvent as u, IncaUIEvent as v, Px as w, ListenerOptions as x, IncaWheelEvent as y, IncaTemplateElement as z };
@@ -0,0 +1,256 @@
1
+ // Copyright (c) 2026 tom96da
2
+ // SPDX-License-Identifier: MIT OR Apache-2.0
3
+
4
+ // The host defines these globals before the app runs. This file carries their types.
5
+ declare global {
6
+ /** The document of the app. The build adds its import to every module that names it. */
7
+ var document: import("incajs").IncaDocument;
8
+
9
+ /** The interface object of `document`. */
10
+ var Document: { readonly prototype: object };
11
+
12
+ /** The interface object of shadow roots, which the host never creates. */
13
+ var ShadowRoot: { readonly prototype: object };
14
+
15
+ function setTimeout<A extends unknown[]>(
16
+ handler: (...args: A) => void,
17
+ delay?: number,
18
+ ...args: A
19
+ ): number;
20
+ function setInterval<A extends unknown[]>(
21
+ handler: (...args: A) => void,
22
+ delay?: number,
23
+ ...args: A
24
+ ): number;
25
+ function clearTimeout(id?: number): void;
26
+ function clearInterval(id?: number): void;
27
+
28
+ type FrameRequestCallback = (time: number) => void;
29
+ function requestAnimationFrame(callback: FrameRequestCallback): number;
30
+ function cancelAnimationFrame(handle: number): void;
31
+
32
+ interface PerformanceEntry {
33
+ readonly name: string;
34
+ readonly entryType: string;
35
+ readonly startTime: number;
36
+ readonly duration: number;
37
+ toJSON(): any;
38
+ }
39
+ var PerformanceEntry: { prototype: PerformanceEntry; new (): PerformanceEntry };
40
+ type PerformanceEntryList = PerformanceEntry[];
41
+
42
+ interface PerformanceMarkOptions {
43
+ detail?: any;
44
+ startTime?: number;
45
+ }
46
+ interface PerformanceMark extends PerformanceEntry {
47
+ readonly detail: any;
48
+ }
49
+ var PerformanceMark: {
50
+ prototype: PerformanceMark;
51
+ new (markName: string, markOptions?: PerformanceMarkOptions): PerformanceMark;
52
+ };
53
+
54
+ interface PerformanceMeasureOptions {
55
+ detail?: any;
56
+ start?: string | number;
57
+ duration?: number;
58
+ end?: string | number;
59
+ }
60
+ interface PerformanceMeasure extends PerformanceEntry {
61
+ readonly detail: any;
62
+ }
63
+ var PerformanceMeasure: { prototype: PerformanceMeasure; new (): PerformanceMeasure };
64
+
65
+ interface Performance {
66
+ readonly timeOrigin: number;
67
+ now(): number;
68
+ toJSON(): any;
69
+ mark(markName: string, markOptions?: PerformanceMarkOptions): PerformanceMark;
70
+ measure(
71
+ measureName: string,
72
+ startOrMeasureOptions?: string | PerformanceMeasureOptions,
73
+ endMark?: string,
74
+ ): PerformanceMeasure;
75
+ getEntries(): PerformanceEntryList;
76
+ getEntriesByName(name: string, type?: string): PerformanceEntryList;
77
+ getEntriesByType(type: string): PerformanceEntryList;
78
+ clearMarks(markName?: string): void;
79
+ clearMeasures(measureName?: string): void;
80
+ }
81
+ var Performance: { prototype: Performance; new (): Performance };
82
+ var performance: Performance;
83
+
84
+ interface Console {
85
+ assert(condition?: boolean, ...data: unknown[]): void;
86
+ clear(): void;
87
+ count(label?: string): void;
88
+ countReset(label?: string): void;
89
+ debug(...data: unknown[]): void;
90
+ dir(item?: unknown, options?: unknown): void;
91
+ dirxml(...data: unknown[]): void;
92
+ error(...data: unknown[]): void;
93
+ group(...data: unknown[]): void;
94
+ groupCollapsed(...data: unknown[]): void;
95
+ groupEnd(): void;
96
+ info(...data: unknown[]): void;
97
+ log(...data: unknown[]): void;
98
+ table(tabularData?: unknown, properties?: string[]): void;
99
+ time(label?: string): void;
100
+ timeEnd(label?: string): void;
101
+ timeLog(label?: string, ...data: unknown[]): void;
102
+ trace(...data: unknown[]): void;
103
+ warn(...data: unknown[]): void;
104
+ }
105
+ var console: Console;
106
+
107
+ interface TextEncoderEncodeIntoResult {
108
+ read: number;
109
+ written: number;
110
+ }
111
+ interface TextEncoder {
112
+ readonly encoding: string;
113
+ encode(input?: string): Uint8Array<ArrayBuffer>;
114
+ encodeInto(source: string, destination: Uint8Array): TextEncoderEncodeIntoResult;
115
+ }
116
+ var TextEncoder: {
117
+ new (): TextEncoder;
118
+ prototype: TextEncoder;
119
+ };
120
+
121
+ type AllowSharedBufferSource = ArrayBufferLike | ArrayBufferView;
122
+ interface TextDecoderOptions {
123
+ fatal?: boolean;
124
+ ignoreBOM?: boolean;
125
+ }
126
+ interface TextDecodeOptions {
127
+ stream?: boolean;
128
+ }
129
+ interface TextDecoder {
130
+ readonly encoding: string;
131
+ readonly fatal: boolean;
132
+ readonly ignoreBOM: boolean;
133
+ decode(input?: AllowSharedBufferSource, options?: TextDecodeOptions): string;
134
+ }
135
+ var TextDecoder: {
136
+ new (label?: string, options?: TextDecoderOptions): TextDecoder;
137
+ prototype: TextDecoder;
138
+ };
139
+
140
+ interface URL {
141
+ href: string;
142
+ protocol: string;
143
+ username: string;
144
+ password: string;
145
+ host: string;
146
+ hostname: string;
147
+ port: string;
148
+ pathname: string;
149
+ search: string;
150
+ hash: string;
151
+ readonly origin: string;
152
+ readonly searchParams: URLSearchParams;
153
+ toString(): string;
154
+ toJSON(): string;
155
+ }
156
+ var URL: {
157
+ new (url: string | URL, base?: string | URL): URL;
158
+ prototype: URL;
159
+ canParse(url: string | URL, base?: string | URL): boolean;
160
+ parse(url: string | URL, base?: string | URL): URL | null;
161
+ };
162
+
163
+ interface URLSearchParamsIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
164
+ [Symbol.iterator](): URLSearchParamsIterator<T>;
165
+ }
166
+ interface URLSearchParams {
167
+ readonly size: number;
168
+ append(name: string, value: string): void;
169
+ delete(name: string, value?: string): void;
170
+ get(name: string): string | null;
171
+ getAll(name: string): string[];
172
+ has(name: string, value?: string): boolean;
173
+ set(name: string, value: string): void;
174
+ sort(): void;
175
+ forEach(
176
+ callback: (value: string, key: string, parent: URLSearchParams) => void,
177
+ thisArg?: unknown,
178
+ ): void;
179
+ entries(): URLSearchParamsIterator<[string, string]>;
180
+ keys(): URLSearchParamsIterator<string>;
181
+ values(): URLSearchParamsIterator<string>;
182
+ [Symbol.iterator](): URLSearchParamsIterator<[string, string]>;
183
+ toString(): string;
184
+ }
185
+ var URLSearchParams: {
186
+ new (init?: string | string[][] | Record<string, string> | URLSearchParams): URLSearchParams;
187
+ prototype: URLSearchParams;
188
+ };
189
+ }
190
+
191
+ // The JavaScript engine provides these globals.
192
+ declare global {
193
+ interface DOMException {
194
+ readonly name: string;
195
+ readonly message: string;
196
+ readonly code: number;
197
+ stack?: string;
198
+ toString(): string;
199
+ readonly INDEX_SIZE_ERR: 1;
200
+ readonly DOMSTRING_SIZE_ERR: 2;
201
+ readonly HIERARCHY_REQUEST_ERR: 3;
202
+ readonly WRONG_DOCUMENT_ERR: 4;
203
+ readonly INVALID_CHARACTER_ERR: 5;
204
+ readonly NO_DATA_ALLOWED_ERR: 6;
205
+ readonly NO_MODIFICATION_ALLOWED_ERR: 7;
206
+ readonly NOT_FOUND_ERR: 8;
207
+ readonly NOT_SUPPORTED_ERR: 9;
208
+ readonly INUSE_ATTRIBUTE_ERR: 10;
209
+ readonly INVALID_STATE_ERR: 11;
210
+ readonly SYNTAX_ERR: 12;
211
+ readonly INVALID_MODIFICATION_ERR: 13;
212
+ readonly NAMESPACE_ERR: 14;
213
+ readonly INVALID_ACCESS_ERR: 15;
214
+ readonly VALIDATION_ERR: 16;
215
+ readonly TYPE_MISMATCH_ERR: 17;
216
+ readonly SECURITY_ERR: 18;
217
+ readonly NETWORK_ERR: 19;
218
+ readonly ABORT_ERR: 20;
219
+ readonly URL_MISMATCH_ERR: 21;
220
+ readonly QUOTA_EXCEEDED_ERR: 22;
221
+ readonly TIMEOUT_ERR: 23;
222
+ readonly INVALID_NODE_TYPE_ERR: 24;
223
+ readonly DATA_CLONE_ERR: 25;
224
+ }
225
+ var DOMException: {
226
+ prototype: DOMException;
227
+ new (message?: string, name?: string): DOMException;
228
+ readonly INDEX_SIZE_ERR: 1;
229
+ readonly DOMSTRING_SIZE_ERR: 2;
230
+ readonly HIERARCHY_REQUEST_ERR: 3;
231
+ readonly WRONG_DOCUMENT_ERR: 4;
232
+ readonly INVALID_CHARACTER_ERR: 5;
233
+ readonly NO_DATA_ALLOWED_ERR: 6;
234
+ readonly NO_MODIFICATION_ALLOWED_ERR: 7;
235
+ readonly NOT_FOUND_ERR: 8;
236
+ readonly NOT_SUPPORTED_ERR: 9;
237
+ readonly INUSE_ATTRIBUTE_ERR: 10;
238
+ readonly INVALID_STATE_ERR: 11;
239
+ readonly SYNTAX_ERR: 12;
240
+ readonly INVALID_MODIFICATION_ERR: 13;
241
+ readonly NAMESPACE_ERR: 14;
242
+ readonly INVALID_ACCESS_ERR: 15;
243
+ readonly VALIDATION_ERR: 16;
244
+ readonly TYPE_MISMATCH_ERR: 17;
245
+ readonly SECURITY_ERR: 18;
246
+ readonly NETWORK_ERR: 19;
247
+ readonly ABORT_ERR: 20;
248
+ readonly URL_MISMATCH_ERR: 21;
249
+ readonly QUOTA_EXCEEDED_ERR: 22;
250
+ readonly TIMEOUT_ERR: 23;
251
+ readonly INVALID_NODE_TYPE_ERR: 24;
252
+ readonly DATA_CLONE_ERR: 25;
253
+ };
254
+ }
255
+
256
+ export {};
package/dist/index.d.ts CHANGED
@@ -1,12 +1,13 @@
1
- import { B as NodeListOf, D as TagName, E as StyleProps, F as IncaInputElement, G as ScrollOptions, I as IncaNode, K as RectLike, L as IncaParent, M as HTMLCollectionOf, N as IncaElement, O as Attr, P as IncaFragment, S as NodeId, W as ScrollIntoViewOptions, _ as IncaPointerEvent, a as EventListener, b as IncaWindow, c as IncaCompositionEvent, d as IncaEventMap, f as IncaEventTarget, g as IncaMouseEvent, h as IncaKeyboardEvent, i as EventLike, l as IncaDocument, m as IncaInputEvent, n as AttributeValue, o as EventListenerObject, p as IncaFocusEvent, q as RectValues, r as CallbackId, s as EventListenerOrObject, t as window, u as IncaEvent, v as IncaUIEvent, w as Px, x as ListenerOptions, y as IncaWheelEvent, z as NamedNodeMap } from "./chunks/window-DIrasL0K.js";
1
+ import { D as TagName, E as StyleProps, F as IncaFragment, H as NodeListOf, I as IncaInputElement, J as RectLike, K as ScrollIntoViewOptions, L as IncaNode, M as HTMLCollectionOf, O as Attr, P as IncaElement, R as IncaParent, S as NodeId, V as NamedNodeMap, Y as RectValues, _ as IncaPointerEvent, a as EventListener, b as IncaWindow, c as IncaCompositionEvent, d as IncaEventMap, f as IncaEventTarget, g as IncaMouseEvent, h as IncaKeyboardEvent, i as EventLike, l as IncaDocument, m as IncaInputEvent, n as AttributeValue, o as EventListenerObject, p as IncaFocusEvent, q as ScrollOptions, r as CallbackId, s as EventListenerOrObject, t as window, u as IncaEvent, v as IncaUIEvent, w as Px, x as ListenerOptions, y as IncaWheelEvent, z as IncaTemplateElement } from "./chunks/window-Bc0a_a9g.js";
2
2
  /**
3
- * The event target between the elements and `window`. An event at an element
4
- * passes through it, and it is the next target after the mount container.
3
+ * The top node of the tree and the parent of the mount container. An event at an element passes
4
+ * through it, and it is the next target after the mount container.
5
5
  *
6
- * It has the listener methods `addEventListener`, `removeEventListener` and
7
- * `dispatchEvent`, the event handler properties such as `onkeydown`,
8
- * `activeElement` and `createDocumentFragment()`. A `wheel` listener is passive unless its
9
- * options say `passive: false`. It is an instance of the global `Document`.
6
+ * It has the node members, the listener methods `addEventListener`, `removeEventListener` and
7
+ * `dispatchEvent`, the event handler properties such as `onkeydown`, `activeElement`,
8
+ * `createElement()`, `createTextNode()`, `createComment()`, `createDocumentFragment()`, and the
9
+ * query methods `querySelector()` and `querySelectorAll()`. A `wheel` listener is passive unless
10
+ * its options say `passive: false`. It is an instance of the global `Document`.
10
11
  */
11
12
  export declare const document: IncaDocument;
12
- export { type Attr, type AttributeValue, type CallbackId, type EventLike, type EventListener, type EventListenerObject, type EventListenerOrObject, type HTMLCollectionOf, type IncaCompositionEvent, type IncaDocument, type IncaElement, type IncaEvent, type IncaEventMap, type IncaEventTarget, type IncaFocusEvent, type IncaFragment, type IncaInputElement, type IncaInputEvent, type IncaKeyboardEvent, type IncaMouseEvent, type IncaNode, type IncaParent, type IncaPointerEvent, type IncaUIEvent, type IncaWheelEvent, type IncaWindow, type ListenerOptions, type NamedNodeMap, type NodeId, type NodeListOf, type Px, type RectLike, type RectValues, type ScrollIntoViewOptions, type ScrollOptions, type StyleProps, type TagName, window };
13
+ export { type Attr, type AttributeValue, type CallbackId, type EventLike, type EventListener, type EventListenerObject, type EventListenerOrObject, type HTMLCollectionOf, type IncaCompositionEvent, type IncaDocument, type IncaElement, type IncaEvent, type IncaEventMap, type IncaEventTarget, type IncaFocusEvent, type IncaFragment, type IncaInputElement, type IncaInputEvent, type IncaKeyboardEvent, type IncaMouseEvent, type IncaNode, type IncaParent, type IncaPointerEvent, type IncaTemplateElement, type IncaUIEvent, type IncaWheelEvent, type IncaWindow, type ListenerOptions, type NamedNodeMap, type NodeId, type NodeListOf, type Px, type RectLike, type RectValues, type ScrollIntoViewOptions, type ScrollOptions, type StyleProps, type TagName, window };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export{g as document,t as window}from"./chunks/hooks-BSL3d56y.js";
1
+ import{s as e,t}from"./chunks/hooks-BFw_ohVI.js";const n=/* @__PURE__ */ e();export{n as document,t as window};
@@ -1,3 +1,3 @@
1
- import { A as EventHandler, B as NodeListOf, C as Overflow, D as TagName, E as StyleProps, F as IncaInputElement, H as TextContentMember, I as IncaNode, L as IncaParent, M as HTMLCollectionOf, N as IncaElement, O as Attr, P as IncaFragment, R as IncaText, S as NodeId, T as ScrollAlignment, U as TextMembers, V as NodeMembers, _ as IncaPointerEvent, a as EventListener, b as IncaWindow, c as IncaCompositionEvent, d as IncaEventMap, f as IncaEventTarget, g as IncaMouseEvent, h as IncaKeyboardEvent, i as EventLike, j as EventHandlers, k as CharacterDataMembers, l as IncaDocument, m as IncaInputEvent, n as AttributeValue, o as EventListenerObject, p as IncaFocusEvent, r as CallbackId, s as EventListenerOrObject, t as window, u as IncaEvent, v as IncaUIEvent, w as Px, x as ListenerOptions, y as IncaWheelEvent, z as NamedNodeMap } from "./chunks/window-DIrasL0K.js";
2
- import { A as setStyle, C as removeChild, D as scrollNode, E as scrollIntoViewNode, F as focus, I as latestEventId, L as removeEventListener, M as blur, N as click, O as scrollOf, P as dispatchEvent, R as createEventTarget, S as removeAttribute, T as rootNodeId, _ as getAttribute, a as insert, b as layoutOf, c as remove, d as createElementNode, f as createIncaElement, g as focusedNode, h as createNode, i as setText, j as addEventListener, k as setAttribute, l as isRemoved, m as appendChild, n as createTextNode, o as nextSibling, p as rootElement, r as setElementText, s as parentNode, t as IncaCore, u as createCommentNode, v as holdNode, w as removeStyle, x as releaseNode, y as insertBefore } from "./chunks/rendererCore-D7-q9n5H.js";
3
- export { type Attr, type AttributeValue, type CallbackId, type CharacterDataMembers, type EventHandler, type EventHandlers, type EventLike, type EventListener, type EventListenerObject, type EventListenerOrObject, type HTMLCollectionOf, type IncaCompositionEvent, IncaCore, type IncaDocument, type IncaElement, type IncaEvent, type IncaEventMap, type IncaEventTarget, type IncaFocusEvent, type IncaFragment, type IncaInputElement, type IncaInputEvent, type IncaKeyboardEvent, type IncaMouseEvent, type IncaNode, type IncaParent, type IncaPointerEvent, type IncaText, type IncaUIEvent, type IncaWheelEvent, type IncaWindow, type ListenerOptions, type NamedNodeMap, type NodeId, type NodeListOf, type NodeMembers, type Overflow, type Px, type ScrollAlignment, type StyleProps, type TagName, type TextContentMember, type TextMembers, addEventListener, appendChild, blur, click, createCommentNode, createElementNode, createEventTarget, createIncaElement, createNode, createTextNode, dispatchEvent, focus, focusedNode, getAttribute, holdNode, insert, insertBefore, isRemoved, latestEventId, layoutOf, nextSibling, parentNode, releaseNode, remove, removeAttribute, removeChild, removeEventListener, removeStyle, rootElement, rootNodeId, scrollIntoViewNode, scrollNode, scrollOf, setAttribute, setElementText, setStyle, setText, window };
1
+ import { A as EventHandler, B as IncaText, C as Overflow, D as TagName, E as StyleProps, F as IncaFragment, G as TextMembers, H as NodeListOf, I as IncaInputElement, L as IncaNode, M as HTMLCollectionOf, N as HtmlMembers, O as Attr, P as IncaElement, R as IncaParent, S as NodeId, T as ScrollAlignment, U as NodeMembers, V as NamedNodeMap, W as TextContentMember, _ as IncaPointerEvent, a as EventListener, b as IncaWindow, c as IncaCompositionEvent, d as IncaEventMap, f as IncaEventTarget, g as IncaMouseEvent, h as IncaKeyboardEvent, i as EventLike, j as EventHandlers, k as CharacterDataMembers, l as IncaDocument, m as IncaInputEvent, n as AttributeValue, o as EventListenerObject, p as IncaFocusEvent, r as CallbackId, s as EventListenerOrObject, t as window, u as IncaEvent, v as IncaUIEvent, w as Px, x as ListenerOptions, y as IncaWheelEvent, z as IncaTemplateElement } from "./chunks/window-Bc0a_a9g.js";
2
+ import { A as setStyle, C as removeChild, D as scrollNode, E as scrollIntoViewNode, F as focus, I as latestEventId, L as removeEventListener, M as blur, N as click, O as scrollOf, P as dispatchEvent, R as createEventTarget, S as removeAttribute, T as rootNodeId, _ as getAttribute, a as parentNode, b as layoutOf, c as createCommentNode, d as createTextNode, f as rootElement, g as focusedNode, h as createNode, i as nextSibling, j as addEventListener, k as setAttribute, l as createElementNode, m as appendChild, n as setText, o as remove, p as setElementText, r as insert, s as isRemoved, t as IncaCore, u as createIncaElement, v as holdNode, w as removeStyle, x as releaseNode, y as insertBefore } from "./chunks/rendererCore-BHeDyiqS.js";
3
+ export { type Attr, type AttributeValue, type CallbackId, type CharacterDataMembers, type EventHandler, type EventHandlers, type EventLike, type EventListener, type EventListenerObject, type EventListenerOrObject, type HTMLCollectionOf, type HtmlMembers, type IncaCompositionEvent, IncaCore, type IncaDocument, type IncaElement, type IncaEvent, type IncaEventMap, type IncaEventTarget, type IncaFocusEvent, type IncaFragment, type IncaInputElement, type IncaInputEvent, type IncaKeyboardEvent, type IncaMouseEvent, type IncaNode, type IncaParent, type IncaPointerEvent, type IncaTemplateElement, type IncaText, type IncaUIEvent, type IncaWheelEvent, type IncaWindow, type ListenerOptions, type NamedNodeMap, type NodeId, type NodeListOf, type NodeMembers, type Overflow, type Px, type ScrollAlignment, type StyleProps, type TagName, type TextContentMember, type TextMembers, addEventListener, appendChild, blur, click, createCommentNode, createElementNode, createEventTarget, createIncaElement, createNode, createTextNode, dispatchEvent, focus, focusedNode, getAttribute, holdNode, insert, insertBefore, isRemoved, latestEventId, layoutOf, nextSibling, parentNode, releaseNode, remove, removeAttribute, removeChild, removeEventListener, removeStyle, rootElement, rootNodeId, scrollIntoViewNode, scrollNode, scrollOf, setAttribute, setElementText, setStyle, setText, window };
@@ -1 +1 @@
1
- export{R as addEventListener,_ as appendChild,z as blur,B as click,n as createCommentNode,r as createElementNode,L as createEventTarget,i as createIncaElement,y as createNode,s as createTextNode,V as dispatchEvent,H as focus,b as focusedNode,x as getAttribute,S as holdNode,u as insert,C as insertBefore,G as isRemoved,U as latestEventId,w as layoutOf,f as nextSibling,p as parentNode,D as releaseNode,K as releaseWhenCollected,m as remove,O as removeAttribute,k as removeChild,W as removeEventListener,A as removeStyle,a as rootElement,j as rootNodeId,M as scrollIntoViewNode,N as scrollNode,P as scrollOf,F as setAttribute,c as setElementText,I as setStyle,l as setText,t as window}from"./chunks/hooks-BSL3d56y.js";import"./chunks/rendererCore-CWokQ5X0.js";
1
+ export{R as addEventListener,_ as appendChild,z as blur,B as click,r as createCommentNode,i as createElementNode,L as createEventTarget,a as createIncaElement,y as createNode,o as createTextNode,V as dispatchEvent,H as focus,b as focusedNode,x as getAttribute,S as holdNode,d as insert,C as insertBefore,G as isRemoved,U as latestEventId,w as layoutOf,p as nextSibling,m as parentNode,D as releaseNode,K as releaseWhenCollected,h as remove,O as removeAttribute,k as removeChild,W as removeEventListener,A as removeStyle,c as rootElement,j as rootNodeId,M as scrollIntoViewNode,N as scrollNode,P as scrollOf,F as setAttribute,l as setElementText,I as setStyle,u as setText,t as window}from"./chunks/hooks-BFw_ohVI.js";import"./chunks/rendererCore-C0G-5EWy.js";
package/dist/style.js CHANGED
@@ -1 +1 @@
1
- import{E as e,F as t,T as n,a as r,d as i,h as a,i as o,j as s,k as c,m as l,o as u,r as d,s as f,u as p,v as m,x as h}from"./chunks/hooks-BSL3d56y.js";const g=`data-inca-style`,_=/* @__PURE__ */ new Map;let v=!1;function y(e){let t=o(e,`element`,`style`);for(let n of m(e)){let e=u(n,String(h(n,`value`)??``));i(t,[e],t.__children.length)}let a=r();if(n(e,`parent`)===a.__node_id){let n=m(a.__node_id),r=a.__children.filter(t=>n.indexOf(t.__node_id)<n.indexOf(e));i(a,[t],r.length)}return t}function b(){if(!v){for(let t of e(s(),`style[${g}]`))_.set(String(h(t,g)),y(t));v=!0}}function x(e,t){let n=e.__children.slice();t&&p(f(t),e);for(let e of n)l(e)}function S(e,n){b();let i=_.get(e);if(i!==void 0){x(i,n);return}let a=d(`style`);t(a.__node_id,g,e),x(a,n),p(a,r()),_.set(e,a)}function C(e){b();let t=_.get(e);if(t===void 0)return;let r=n(t.__node_id,`parent`);r!==null&&c(r,t.__node_id),a(t),_.delete(e)}export{C as removeStyle,S as updateStyle};
1
+ import{E as e,F as t,T as n,a as r,c as i,d as a,f as o,g as s,h as c,i as l,j as u,k as d,n as f,o as p,v as m,x as h}from"./chunks/hooks-BFw_ohVI.js";const g=`data-inca-style`,_=/* @__PURE__ */ new Map;let v=!1;function y(e){let t=r(e,`element`,`style`);for(let n of m(e)){let e=f(n,String(h(n,`value`)??``));o(t,[e],t.__children.length)}let a=i();if(n(e,`parent`)===a.__node_id){let n=m(a.__node_id),r=a.__children.filter(t=>n.indexOf(t.__node_id)<n.indexOf(e));o(a,[t],r.length)}return t}function b(){if(!v){for(let t of e(u(),`style[${g}]`))_.set(String(h(t,g)),y(t));v=!0}}function x(e,t){let n=e.__children.slice();t&&a(p(t),e);for(let e of n)c(e)}function S(e,n){b();let r=_.get(e);if(r!==void 0){x(r,n);return}let o=l(`style`);t(o.__node_id,g,e),x(o,n),a(o,i()),_.set(e,o)}function C(e){b();let t=_.get(e);if(t===void 0)return;let r=n(t.__node_id,`parent`);r!==null&&d(r,t.__node_id),s(t),_.delete(e)}export{C as removeStyle,S as updateStyle};
package/dist/vue.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { N as IncaElement } from "./chunks/window-DIrasL0K.js";
2
- import "./chunks/rendererCore-D7-q9n5H.js";
1
+ import { P as IncaElement } from "./chunks/window-Bc0a_a9g.js";
2
+ import "./chunks/rendererCore-BHeDyiqS.js";
3
3
  import { App, Component, ComponentPublicInstance } from "@vue/runtime-core";
4
4
  /**
5
5
  * `@vue/runtime-core`'s `App`, with `mount` also callable with no argument
package/dist/vue.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunks/hooks-BSL3d56y.js";import{t}from"./chunks/rendererCore-CWokQ5X0.js";import{ErrorCodes as n,callWithAsyncErrorHandling as r,createRenderer as i,warn as a}from"@vue/runtime-core";function o(e){return Object.defineProperty(e,"__v_skip",{value:!0}),e}function s(e){return{createElement:t=>o(e.createElementNode(t)),createText:t=>o(e.createTextNode(t)),createComment:t=>o(e.createCommentNode(t)),setText:(t,n)=>e.setText(t,n),setElementText:(t,n)=>e.setElementText(t,n),insert:(t,n,r)=>e.insert(t,n,r),setScopeId:(t,n)=>e.setAttribute(t.__node_id,n,``),remove:t=>e.remove(t),parentNode:e.parentNode,nextSibling:e.nextSibling}}function c(e,t){let n=t=>(e.holdNode(t.__node_id),e.releaseWhenCollected(t),t),{createElement:r,createText:i}=t;return{createElement:e=>n(r(e)),createText:e=>n(i(e))}}const l=e=>/^on[^a-z]/.test(e),u=e=>/^on[a-z]/.test(e),d=/(?:Once|Passive|Capture)$/,f=/^on:?(?:Once|Passive|Capture)$/,p=e=>e.replace(/\B([A-Z])/g,`-$1`).toLowerCase();function m(e){let t=e,n={event:``,once:!1,capture:!1,passive:!1},r;for(;(r=t.match(d))&&!f.test(t);)t=t.slice(0,-r[0].length),r[0]===`Once`?n.once=!0:r[0]===`Capture`?n.capture=!0:n.passive=!0;return n.event=t[2]===`:`?t.slice(3):p(t.slice(2)),n}const h=e=>typeof e==`string`||typeof e==`number`,g=/* @__PURE__ */ new WeakMap;function _(e,t,n){let r=typeof n==`object`&&n?n:{},i=g.get(t);i||g.set(t,i=/* @__PURE__ */ new Map);let a=!1;for(let n of i.keys())h(r[n])||(e.removeStyle(t.__node_id,n),i.delete(n),a=!0);for(let[n,o]of Object.entries(r))h(o)&&(a||i.get(n)!==o)&&(e.setStyle(t.__node_id,n,o),i.set(n,o))}function v(e,t){return e?typeof e==`function`?[e]:Array.isArray(e)?e.slice():(a(`Wrong type passed as event handler to ${t} - did you forget @ or : in front of your prop?
1
+ import{c as e}from"./chunks/hooks-BFw_ohVI.js";import{t}from"./chunks/rendererCore-C0G-5EWy.js";import{ErrorCodes as n,callWithAsyncErrorHandling as r,createRenderer as i,warn as a}from"@vue/runtime-core";function o(e){return Object.defineProperty(e,"__v_skip",{value:!0}),e}function s(e){return{createElement:t=>o(e.createElementNode(t)),createText:t=>o(e.createTextNode(t)),createComment:t=>o(e.createCommentNode(t)),setText:(t,n)=>e.setText(t,n),setElementText:(t,n)=>e.setElementText(t,n),insert:(t,n,r)=>e.insert(t,n,r),setScopeId:(t,n)=>e.setAttribute(t.__node_id,n,``),remove:t=>e.remove(t),parentNode:e.parentNode,nextSibling:e.nextSibling}}function c(e,t){let n=t=>(e.holdNode(t.__node_id),e.releaseWhenCollected(t),t),{createElement:r,createText:i}=t;return{createElement:e=>n(r(e)),createText:e=>n(i(e))}}const l=e=>/^on[^a-z]/.test(e),u=e=>/^on[a-z]/.test(e),d=/(?:Once|Passive|Capture)$/,f=/^on:?(?:Once|Passive|Capture)$/,p=e=>e.replace(/\B([A-Z])/g,`-$1`).toLowerCase();function m(e){let t=e,n={event:``,once:!1,capture:!1,passive:!1},r;for(;(r=t.match(d))&&!f.test(t);)t=t.slice(0,-r[0].length),r[0]===`Once`?n.once=!0:r[0]===`Capture`?n.capture=!0:n.passive=!0;return n.event=t[2]===`:`?t.slice(3):p(t.slice(2)),n}const h=e=>typeof e==`string`||typeof e==`number`,g=/* @__PURE__ */ new WeakMap;function _(e,t,n){let r=typeof n==`object`&&n?n:{},i=g.get(t);i||g.set(t,i=/* @__PURE__ */ new Map);let a=!1;for(let n of i.keys())h(r[n])||(e.removeStyle(t.__node_id,n),i.delete(n),a=!0);for(let[n,o]of Object.entries(r))h(o)&&(a||i.get(n)!==o)&&(e.setStyle(t.__node_id,n,o),i.set(n,o))}function v(e,t){return e?typeof e==`function`?[e]:Array.isArray(e)?e.slice():(a(`Wrong type passed as event handler to ${t} - did you forget @ or : in front of your prop?
2
2
  Expected function or array of functions, received type ${typeof e}.`),[]):null}function y(e,t){let n=e[0];if(typeof n!=`object`||!n)return t(()=>!1);let r=n.stopImmediatePropagation;if(typeof r!=`function`)return t(()=>!1);let i=Object.hasOwn(n,`stopImmediatePropagation`),a=!1;try{n.stopImmediatePropagation=(...e)=>(a=!0,r.apply(n,e))}catch{return t(()=>!1)}try{t(()=>a)}finally{i?n.stopImmediatePropagation=r:delete n.stopImmediatePropagation}}const b=/* @__PURE__ */ new WeakMap,x=({event:e,capture:t,passive:n})=>`${e}:${t===!0}:${n===!0}`;function S(e,t,n,r){let i=Array.from(r.slots.values()).some(e=>!e.fired);i&&!r.registered&&!e.isRemoved(t)?(e.addEventListener(t.__node_id,r.event,r.dispatcher,r.options),r.registered=!0):!i&&r.registered&&(r.registered=!1,e.removeEventListener(t.__node_id,r.event,r.dispatcher,r.options)),r.slots.size===0&&b.get(t)?.delete(n)}function C(e,t,i,{event:a,capture:o,passive:s}){let c={event:a,options:{capture:o,passive:s},slots:/* @__PURE__ */ new Map,registered:!1,dispatcher:(...a)=>{let o=[],s=a[0]?.eventId;y(a,l=>{for(let u of Array.from(c.slots.keys())){if(l())break;let d=c.slots.get(u);if(d&&!d.fired&&!(typeof s==`number`&&d.attachedAt>=s)){d.once&&(d.fired=!0,S(e,t,i,c));for(let e of d.handlers){if(l())break;if(e)try{r(e,d.instance,n.NATIVE_EVENT_HANDLER,a)}catch(e){o.push(e)}}}}});for(let e of o.slice(1))Promise.reject(e);if(o.length>0)throw o[0]}};return c}function w(e,t,n,r){let i=x(n),a=b.get(t)?.get(i);a?.slots.delete(r)&&S(e,t,i,a)}function T(e,t,n,r,i){let a=m(n),o=v(r,n);if(!o){w(e,t,a,n);return}let s=x(a),c=b.get(t);c||b.set(t,c=/* @__PURE__ */ new Map);let l=c.get(s);l||c.set(s,l=C(e,t,s,a));let u=l.slots.get(n);if(u)u.handlers=o,u.instance=i;else{l.slots.set(n,{attachedAt:e.latestEventId(),handlers:o,instance:i,once:a.once,fired:!1});try{S(e,t,s,l)}catch(e){throw l.slots.delete(n),l.slots.size===0&&c.delete(s),e}}}const E=/* @__PURE__ */ new Set([`disabled`,`hidden`,`inert`,`allowfullscreen`,`formnovalidate`,`ismap`,`itemscope`,`nomodule`,`novalidate`,`readonly`]);function D(e){return(t,n,r,i,a,o)=>{n.startsWith(`onUpdate:`)||(n===`style`?_(e,t,i):l(n)?T(e,t,n,i,o??null):u(n)&&n in t?typeof i==`string`?(Reflect.set(t,n,null),e.setAttribute(t.__node_id,n,i)):Reflect.set(t,n,i):n===`value`&&`value`in t?Reflect.set(t,n,i??``):E.has(n)?n===`hidden`&&typeof i==`string`&&/^until-found$/i.test(i)?e.setAttribute(t.__node_id,n,i):i||i===``?e.setAttribute(t.__node_id,n,``):e.removeAttribute(t.__node_id,n):typeof i==`string`||typeof i==`number`||typeof i==`boolean`?e.setAttribute(t.__node_id,n,i):i==null?e.removeAttribute(t.__node_id,n):e.setAttribute(t.__node_id,n,String(i)))}}const O=/* @__PURE__ */ new Set;function k(n,r){let a={...s(t),patchProp:D(t)},l=i(a);Object.assign(a,c(t,a));let u=l.createApp(n,r),d=u.mount.bind(u),f=u.unmount.bind(u);return Object.assign(u,{mount:t=>{let n=d(t??o(e()));return O.add(u),n},unmount:()=>{f(),O.delete(u)}})}export{k as createIncaApp};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incajs",
3
- "version": "0.0.29",
3
+ "version": "0.0.31",
4
4
  "description": "A GPU-native, Webview-free desktop app framework built on GPUI and QuickJS.",
5
5
  "keywords": [
6
6
  "cross-platform",
@@ -35,8 +35,6 @@
35
35
  "sideEffects": [
36
36
  "src/callbacks.mts",
37
37
  "src/targets.mts",
38
- "src/element/fragment.mts",
39
- "src/interfaces.mts",
40
38
  "dist/chunks/hooks-*.js"
41
39
  ],
42
40
  "main": "./dist/index.js",
@@ -57,6 +55,9 @@
57
55
  "./style": {
58
56
  "types": "./dist/style.d.ts",
59
57
  "import": "./dist/style.js"
58
+ },
59
+ "./globals": {
60
+ "types": "./dist/globals.d.mts"
60
61
  }
61
62
  },
62
63
  "publishConfig": {
@@ -1,2 +0,0 @@
1
- const e=/* @__PURE__ */ `auxclick.beforeinput.blur.change.click.contextmenu.dblclick.focus.gotpointercapture.input.keydown.keypress.keyup.lostpointercapture.mousedown.mouseenter.mouseleave.mousemove.mouseout.mouseover.mouseup.pointerdown.pointerenter.pointerleave.pointermove.pointerout.pointerover.pointerup.scroll.wheel`.split(`.`);function t(t,n){for(let r of e){let e=null,i=function(t){typeof e==`function`&&Reflect.apply(e,this,[t])===!1&&t.preventDefault()};Object.defineProperty(t,`on${r}`,{get:()=>e,set(a){n()||(e=typeof a==`function`||typeof a==`object`&&a?a:null,e===null?t.removeEventListener(r,i):t.addEventListener(r,i))}})}return t}function n(){return globalThis.__inca_native__}const r=/* @__PURE__ */ new WeakSet;function i(e,t){return r.add(e),Object.defineProperty(e,"__node_id",{value:t})}function a(e){return typeof e==`object`&&!!e&&r.has(e)}const o=/* @__PURE__ */ new Map,s=new FinalizationRegistry(e=>{o.get(e)?.deref()||o.delete(e)});function c(e){o.set(e.__node_id,new WeakRef(e)),s.register(e,e.__node_id)}function l(e){o.delete(e)}function u(e){return o.get(e)?.deref()}function d(e){let t=u(e);return t?.kind===`element`?t:void 0}const ee=/* @__PURE__ */ new WeakSet;function f(e){return ee.has(e)||p.has(e)}function te(e){if(ee.add(e),e.kind!==`text`)for(let t of e.__children)te(t)}const p=/* @__PURE__ */ new WeakSet;function m(e){return p.has(e)}function ne(e){if(p.add(e),l(e.__node_id),e.kind!==`text`)for(let t of e.__children)ne(t)}function re(e){for(let t of e){let e=u(t);e&&ne(e)}}const ie=new FinalizationRegistry(e=>n().releaseNode(e)),ae=/* @__PURE__ */ new WeakSet;function oe(e){return ae.has(e)}function h(e){ae.add(e),ie.register(e,e.__node_id)}const g=/* @__PURE__ */ new Map,se=/* @__PURE__ */ new Map;function ce(e,t,n){let r=g.get(e);r||g.set(e,r=/* @__PURE__ */ new Map),r.set(t,n),se.set(n,{group:e,listener:t})}function le(e,t){return g.get(e)?.get(t)}function ue(e){let t=se.get(e);if(t===void 0)return;se.delete(e);let n=g.get(t.group);n?.delete(t.listener),n?.size===0&&g.delete(t.group)}function de(e){for(let t of e)ue(t)}const fe=(e,t,n)=>`${e}:${t}:${n===!0}`;Object.defineProperty(globalThis,"__inca_released__",{value:(e,t)=>{de(t),re(e)},configurable:!0});let pe=0;function me(){return pe}function he(e){return(...t)=>{let n=t[0]?.eventId;return typeof n==`number`&&n>pe&&(pe=n),e(...t)}}function ge(e,t,r,i={}){if(r==null)return;let a=fe(e,t,i.capture);if(le(a,r)!==void 0)return;let o=(...e)=>typeof r==`function`?r.apply(e[0]?.currentTarget,e):r.handleEvent.apply(r,e),s=i.once?(...n)=>(_(e,t,r,i),o(...n)):o;ce(a,r,n().addEventListener(e,t,he(s),i.capture===!0,i.passive===!0))}function _(e,t,r,i={}){if(r==null)return;let a=le(fe(e,t,i.capture),r);a!==void 0&&(n().removeEventListener(e,t,a),ue(a))}function _e(e,t){return n().dispatchEvent(e,t)}function ve(e){n().click(e)}function ye(e,t){n().focusNode(e,t)}function be(e){n().blurNode(e)}function xe(e,t){n().setPointerCapture(e,t)}function Se(e,t){n().releasePointerCapture(e,t)}function Ce(e,t){return n().hasPointerCapture(e,t)}function v(e,t=[]){let n=typeof e==`function`?e:()=>e;return{addEventListener(e,r,i){let a=typeof i==`boolean`?{capture:i}:i??{};ge(n(),e,r,{...a,passive:a.passive??t.includes(e)})},removeEventListener(e,t,r){let i=typeof r==`boolean`?r:r?.capture;_(n(),e,t,{capture:i})},dispatchEvent:e=>_e(n(),e)}}function we(){throw TypeError(`document cannot be constructed. use the document export of incajs`)}function Te(){throw TypeError(`a shadow root cannot be constructed. the host has no shadow roots`)}Object.defineProperty(globalThis,"Document",{value:we,writable:!0,configurable:!0,enumerable:!1}),Object.defineProperty(globalThis,"ShadowRoot",{value:Te,writable:!0,configurable:!0,enumerable:!1});function y(){return n().rootNodeId()}function b(e){return n().createNode(e)}function x(e,t){return n().appendChild(e,t)}function S(e,t,r){return n().insertBefore(e,t,r)}function C(e,t){n().removeChild(e,t)}function Ee(e,t,r){return n().replaceChild(e,t,r)}function De(e,t){return n().cloneNode(e,t)}function Oe(e){return n().rootOf(e)}function ke(e,t){return n().compareNodePosition(e,t)}function Ae(e,t){return n().isEqualNode(e,t)}function je(e){de(n().releaseListeners(e))}function w(e){n().holdNode(e)}function Me(e){n().releaseNode(e)}function T(e,t,r){n().setAttribute(e,t,r)}function E(e,t){return n().getAttribute(e,t)}function Ne(e){return n().attributeNames(e)}function Pe(e,t){return n().linkedNode(e,t)}function Fe(e){return n().childNodeIds(e)}function Ie(e){return n().isConnected(e)}function Le(e){return n().textContent(e)}function Re(e){return n().wholeText(e)}function ze(e,t,r){return n().substringData(e,t,r)}function Be(e,t,r,i){n().replaceData(e,t,r,i)}function Ve(e,t){return n().splitText(e,t)}function He(e,t){return n().matches(e,t)}function Ue(e,t){return n().closest(e,t)}function We(e,t){return n().querySelector(e,t)}function Ge(e,t){return n().querySelectorAll(e,t)}function D(e){n().checkSelector(e)}function Ke(e){return n().layoutOf(e)}function O(e){return n().scrollOf(e)}function qe(e,t,r){n().scrollNode(e,t,r)}function Je(e,t,r){n().scrollIntoViewNode(e,t,r)}function Ye(e,t){n().removeAttribute(e,t)}function Xe(e,t,r){n().setStyle(e,t,r)}function Ze(e,t){n().removeStyle(e,t)}function Qe(e){return n().inputValue(e)}function $e(e,t){n().setInputValue(e,t)}function et(){return n().focusedNode()}function tt(){let e=et();return e===null?null:d(e)??null}const k=/* @__PURE__ */ Object.defineProperties(Object.setPrototypeOf(t(v(`$document`,[`wheel`]),()=>!1),we.prototype),{[Symbol.toStringTag]:{value:`Document`},activeElement:{get:tt}}),nt=/^(?:0|[1-9]\d*)$/,rt=2**32-1;function A(e){return nt.test(e)&&Number(e)<rt}function it(e,t){return t===``?null:e.find(e=>e.id===t)??e.find(e=>e.getAttribute(`name`)===t)??null}function at(e){let t=/* @__PURE__ */ new Set;for(let n of e)t.add(n.id),t.add(n.getAttribute(`name`)??``);return t.delete(``),[...t]}function j(e){let{source:t,named:n}=e,r=e=>{if(e!==l)throw TypeError(`the receiver is not a collection. call it on one`)},i={writable:!0,enumerable:!0,configurable:!0},a=Object.create(Object.prototype,{length:{get(){return r(this),t().length},enumerable:!0,configurable:!0},item:{...i,value:Object.defineProperty(function(...e){if(r(this),e.length<1)throw TypeError(`item() needs 1 argument`);return t()[e[0]>>>0]??null},"length",{value:1})},...e.method&&{[e.method]:{...i,value(...t){if(r(this),t.length<1)throw TypeError(`${e.method}() needs 1 argument`);return e.find(`${t[0]}`)}}},...e.arrayMembers&&{forEach:{...i,value:Array.prototype.forEach},entries:{...i,value:Array.prototype.entries},keys:{...i,value:Array.prototype.keys},values:{...i,value:Array.prototype.values}},[Symbol.iterator]:{...i,enumerable:!1,value:Array.prototype.values},[Symbol.toStringTag]:{value:e.tag,configurable:!0}}),o=Object.create(a),s=e=>Object.hasOwn(o,e),c=e=>A(e)||!s(e)&&!(e in a)&&n(e)!==null,l=new Proxy(o,{get(e,r,i){return typeof r==`symbol`?Reflect.get(o,r,i):A(r)?t()[Number(r)]:r in o?Reflect.get(o,r,i):n(r)??void 0},has(e,r){return typeof r==`symbol`||r in o?r in o:A(r)?Number(r)<t().length:n(r)!==null},set(e,t,n,r){return r===l&&typeof t==`string`&&c(t)?!1:Reflect.set(o,t,n,r)},deleteProperty(e,n){if(typeof n==`string`){if(A(n))return Number(n)>=t().length;if(c(n))return!1}return Reflect.deleteProperty(o,n)},preventExtensions:()=>!1,defineProperty(e,t,n){return typeof t==`string`&&c(t)?!1:Reflect.defineProperty(o,t,n)},ownKeys(){let n=t(),r=Array.from(n,(e,t)=>String(t)),i=e.names(n).filter(e=>!A(e)&&!(e in a)&&!s(e)),c=Reflect.ownKeys(o);return[...r,...c,...i]},getOwnPropertyDescriptor(e,r){if(typeof r==`symbol`||s(r))return Reflect.getOwnPropertyDescriptor(o,r);if(A(r)){let e=t()[Number(r)];return e?{value:e,writable:!1,enumerable:!0,configurable:!0}:void 0}let i=r in a?void 0:n(r);return i?{value:i,writable:!1,enumerable:!1,configurable:!0}:void 0}});return l}function ot(e){let t=t=>it(e(),t);return j({tag:`HTMLCollection`,method:`namedItem`,source:e,find:t,named:t,names:at})}function st(e,t,n){return j({tag:`NamedNodeMap`,method:`getNamedItem`,source:e,find:t,named:n,names:e=>e.map(e=>e.name)})}function M(e){return j({tag:`NodeList`,arrayMembers:!0,source:e,find:()=>null,named:()=>null,names:()=>[]})}const ct=/* @__PURE__ */ new Set([`\0`,` `,`
2
- `,`\f`,`\r`,` `,`/`,`=`,`>`]);function lt(e){if(e.length===0)return!1;for(let t of e)if(ct.has(t))return!1;return!0}function N(e){if(typeof e==`symbol`)throw TypeError(`a symbol cannot become text`);return String(e)}function P(e,t,n){if(e.length<t)throw TypeError(`${n}() needs ${t} argument${t===1?``:`s`}`)}function ut(e){return e.replace(/[A-Z]/g,e=>e.toLowerCase())}var F=class e{#e;#t;#n;#r;#i;constructor(e,t,n,r,i){this.#e=e,this.#i=t,this.#t=n,this.#r=r,this.#n=i}static detach(e){e.#r=null,e.#n(e)}#a(){if(this.#r===null)return!1;let t=m(this.#r)?null:E(this.#t,this.#e);return t===null?(e.detach(this),!1):(this.#i=N(t),!0)}get name(){return this.#e}get localName(){return this.#e}get value(){return this.#a(),this.#i}set value(e){let t=N(e);this.#a()&&T(this.#t,this.#e,t),this.#i=t}get namespaceURI(){return null}get prefix(){return null}get specified(){return!0}get ownerElement(){return this.#a(),this.#r}get[Symbol.toStringTag](){return`Attr`}};function dt(e,t){let n=t=>{let n=E(e,t);return n===null?null:N(n)},r=()=>m(t)?[]:Ne(e),i=/* @__PURE__ */ new Map,a=e=>{i.get(e.name)===e&&i.delete(e.name)},o=(n,r)=>{let o=i.get(n);return o||(o=new F(n,r,e,t,a),i.set(n,o)),o},s=e=>{let r=m(t)?null:n(e);if(r!==null)return o(e,r);let a=i.get(e);return a&&F.detach(a),null},c=()=>{let e=r(),t=new Set(e);for(let[e,n]of i)t.has(e)||F.detach(n);return e.map(e=>i.get(e)??o(e,n(e)))},l;return{getAttribute:(...e)=>(P(e,1,`getAttribute`),m(t)?null:n(N(e[0]))),setAttribute:(...n)=>{P(n,2,`setAttribute`);let r=N(n[0]),i=N(n[1]);if(!lt(r))throw new DOMException(`the attribute name is not valid. it is empty or holds whitespace, '/', '=' or '>'`,`InvalidCharacterError`);m(t)||T(e,r,i)},hasAttribute:(...e)=>(P(e,1,`hasAttribute`),!m(t)&&n(N(e[0]))!==null),removeAttribute:(...n)=>{P(n,1,`removeAttribute`);let r=N(n[0]);m(t)||Ye(e,r)},getAttributeNames:()=>r(),get attributes(){return l??=st(c,e=>s(ut(e)),e=>e===ut(e)?s(e):null),l}}}function ft(e){return e.kind===`element`}function I(e){return e.__children.filter(ft)}function pt(e,t){let n=e.parent?.__children??[];for(let r=n.indexOf(e)+t;r>=0&&r<n.length;r+=t){let e=n[r];if(ft(e))return e}return null}function mt(e){let t;return{get children(){return t??=ot(()=>I(e))},get parentElement(){return e.parent?.kind===`element`?e.parent:null},get firstElementChild(){return I(e)[0]??null},get lastElementChild(){return I(e).at(-1)??null},get childElementCount(){return I(e).length},get previousElementSibling(){return pt(e,-1)},get nextElementSibling(){return pt(e,1)}}}function L(e){return f(e)?null:Ke(e.__node_id)}function ht(e){let t=e.parent;return!L(e)||t?.kind!==`element`||!L(t)?null:t}function gt(e){let t=L(e);if(!t)return{left:0,top:0};let n=ht(e),r=n?L(n):null;return{left:Math.round(t[0]-(r?r[0]+r[4]:0)+t[5])||0,top:Math.round(t[1]-(r?r[1]+r[4]:0)+t[6])||0}}function _t(e){let[t,n,r,i]=e??[0,0,0,0,0],a={x:t,y:n,width:r,height:i,top:n,left:t,right:t+r,bottom:n+i};return{...a,toJSON:()=>({...a})}}function vt(e,t){let n=t===`button`||t===`input`?0:-1;if(typeof e!=`string`&&typeof e!=`number`)return n;let r=/^[\t\n\f\r ]*([+-]?\d+)/.exec(String(e));if(!r)return n;let i=Number(r[1])||0;return i>=-2147483648&&i<=2147483647?i:n}function R(e){m(e)||oe(e)||(w(e.__node_id),h(e))}function z(e){let t=e.parent;if(!t)return;let n=t.__children.indexOf(e);n!==-1&&t.__children.splice(n,1),e.parent=null}function B(e,t,n){e.__children.splice(n,0,...t);for(let n of t)n.parent=e}function yt(e){e.parent&&C(e.parent.__node_id,e.__node_id),z(e)}function bt(e,t,n){if(n===e&&e.parent===t)return;yt(e);let r=n?t.__children.indexOf(n):-1;S(t.__node_id,e.__node_id,n&&r!==-1?n.__node_id:null),r===-1?t.__children.push(e):t.__children.splice(r,0,e),e.parent=t}function xt(e){e.parent&&m(e.parent)?z(e):yt(e),je(e.__node_id),te(e),R(e)}function St(e){return e.parent?.kind===`element`?e.parent:null}function Ct(e){let t=e.parent;if(!t)return null;let n=t.__children.indexOf(e);return t.__children[n+1]??null}function V(){return new DOMException(`the node was freed. pass a child of the node you call it on`,`NotFoundError`)}function H(e,t){if(!a(e))throw TypeError(`parameter ${t} is not a node. pass an element, a text node, a comment or a fragment`);return e}function wt(e){return e.kind===`fragment`?e.__children.slice():[e]}function Tt(e,t,n){let r=De(e.__node_id,t),i=0,a=e=>{let[o,s]=r[i++];if(e.kind===`text`)return n.text(o,e.text);let c=e.kind===`fragment`?n.fragment(o):n.element(o,e.kind,e.kind===`element`?s:void 0);if(!t)return c;for(let t of e.__children)B(c,[a(t)],c.__children.length);return c},o=a(e);return R(o),o}function U(e,t){let n=e.__node_id,r=e,i=(e,t)=>{let n=wt(e),i=t();for(let e of n)z(e);B(r,n,i)};return{appendChild:(...e)=>{P(e,1,`appendChild`);let t=H(e[0],1);return i(t,()=>x(n,t.__node_id)),t},insertBefore:(...e)=>{P(e,2,`insertBefore`);let t=H(e[0],1),r=e[1]===null||e[1]===void 0?null:H(e[1],2);if(r&&m(r))throw V();return i(t,()=>S(n,t.__node_id,r?.__node_id??null)),t},removeChild:(...e)=>{P(e,1,`removeChild`);let t=H(e[0],1);if(m(t))throw V();return C(n,t.__node_id),z(t),R(t),t},replaceChild:(...e)=>{P(e,2,`replaceChild`);let t=H(e[0],1),i=H(e[1],2);if(m(i))throw V();let a=wt(t),o=Ee(n,t.__node_id,i.__node_id);for(let e of a)z(e);return z(i),i!==t&&R(i),B(r,a,o),i},cloneNode:n=>Tt(e,!!n,t)}}function W(e){let t=e.__node_id,n=e=>e==null?null:H(e,1);return{contains:r=>{let i=n(r);return i===null?!1:i===e?!0:m(e)||m(i)?!1:!!(ke(t,i.__node_id)&16)},getRootNode:()=>{if(m(e))return e;let n=Oe(t);return n===y()?k:u(n)},compareDocumentPosition:(...n)=>{P(n,1,`compareDocumentPosition`);let r=H(n[0],1);return r===e?0:m(e)||m(r)?33|(r.__node_id<t?2:4):ke(t,r.__node_id)},isSameNode:t=>n(t)===e,isEqualNode:r=>{let i=n(r);return i===null?!1:m(e)||m(i)?i===e:Ae(t,i.__node_id)}}}const Et={element:1,text:3,comment:8,fragment:11};function G(e){return m(e)?e.kind===`text`?e.text:``:String(E(e.__node_id,`value`)??``)}function K(e,t){e.kind===`element`||e.kind===`fragment`||m(e)||(T(e.__node_id,`value`,t),e.kind===`text`&&(e.text=t))}function q(e){let t=e.__node_id,n=n=>{if(m(e))return null;let r=Pe(t,n);return r===null?null:u(r)??null},r,i=()=>m(e)?[]:Fe(t).flatMap(e=>u(e)??[]);return{get nodeType(){return Et[e.kind]},get nodeName(){return e.kind===`element`?e.tagName:e.kind===`fragment`?`#document-fragment`:`#${e.kind}`},get nodeValue(){return e.kind===`element`||e.kind===`fragment`?null:G(e)},set nodeValue(t){K(e,String(t??``))},get isConnected(){return!m(e)&&Ie(t)},get ownerDocument(){return k},get parentNode(){let e=n(`parent`);return e===null?t===y()?k:null:e},get firstChild(){return n(`first`)},get lastChild(){return n(`last`)},get previousSibling(){return n(`previous`)},get nextSibling(){return n(`next`)},get childNodes(){return r??=M(i)},hasChildNodes:()=>i().length>0}}function J(e,t,n){if(f(e))return;let[r,i]=t,[a,o]=typeof r==`object`?[r?.left,r?.top]:[r,i],[s,c]=n?O(e.__node_id)??[0,0]:[0,0],l=(e,t)=>{if(e===void 0)return null;let r=Number(e);return(n?t:0)+(Number.isFinite(r)?r:0)};qe(e.__node_id,l(a,s),l(o,c))}function Dt(e){let t=[`start`,`center`,`end`,`nearest`];return typeof e==`object`&&e?{block:t.includes(e.block??``)?e.block:`start`,inline:t.includes(e.inline??``)?e.inline:`nearest`}:{block:e===!1?`end`:`start`,inline:`nearest`}}function Y(e){return e==null?``:N(e)}function Ot(e){let t=e.__node_id,n=(n,r,i)=>{m(e)||(Be(t,n,r,i),e.kind===`text`&&(e.text=G(e)))};return{get data(){return G(e)},set data(t){K(e,t===null?``:N(t))},get length(){return G(e).length},get textContent(){return G(e)},set textContent(t){K(e,Y(t))},substringData:(...n)=>{if(P(n,2,`substringData`),!m(e))return ze(t,n[0],n[1]);let r=n[0]>>>0;return G(e).slice(r,r+(n[1]>>>0))},appendData:(...t)=>{P(t,1,`appendData`),n(G(e).length,0,N(t[0]))},insertData:(...e)=>{P(e,2,`insertData`),n(e[0],0,N(e[1]))},deleteData:(...e)=>{P(e,2,`deleteData`),n(e[0],e[1],``)},replaceData:(...e)=>{P(e,3,`replaceData`),n(e[0],e[1],N(e[2]))}}}function kt(e){let t=e.__node_id;return{get wholeText(){return m(e)?e.text:Re(t)},splitText:(...n)=>{if(P(n,1,`splitText`),m(e))throw TypeError(`the text node was freed. create a new one`);let r=Ve(t,n[0]),i=Z(r,String(E(r,`value`)??``));e.text=G(e);let a=e.parent;return a===null?(w(i.__node_id),h(i)):(a.__children.splice(a.__children.indexOf(e)+1,0,i),i.parent=a),i}}}function At(e){let t=b(`#text`);return T(t,`value`,e),Z(t,e)}function jt(e,t){T(e.__node_id,`value`,t),e.text=t}function X(e,t){for(let t of e.__children.slice())xt(t);if(!t)return;let n=At(t);x(e.__node_id,n.__node_id),n.parent=e,e.__children.push(n)}function Z(e,t){let n=i({kind:`text`,parent:null,text:t},e);for(let e of[q(n),U(n,{text:Z}),W(n),Ot(n),kt(n)])Object.defineProperties(n,Object.getOwnPropertyDescriptors(e));return c(n),n}function Q(e,t){return P(e,1,t),N(e[0])}const Mt={element:$,text:Z,fragment:Lt};function $(e,n,r=`div`,a=[]){let o=v(()=>e,a),s=()=>f(u)?null:O(e),l={get id(){return m(u)?``:String(E(e,`id`)??``)},set id(t){m(u)||T(e,`id`,String(t))},kind:n,tagName:r.replace(/[a-z]/g,e=>e.toUpperCase()),parent:null,__children:[],focus:t=>{f(u)||ye(e,!!t?.preventScroll)},blur:()=>be(e),click:()=>{f(u)||ve(e)},setPointerCapture:t=>xe(e,t),releasePointerCapture:t=>Se(e,t),hasPointerCapture:t=>Ce(e,t),addEventListener:(...e)=>{f(u)||o.addEventListener(...e)},removeEventListener:(...e)=>{f(u)||o.removeEventListener(...e)},dispatchEvent:e=>m(u)||o.dispatchEvent(e),get tabIndex(){return vt(m(u)?null:E(e,`tabindex`),r)},set tabIndex(t){m(u)||T(e,`tabindex`,t|0)},getBoundingClientRect:()=>_t(L(u)),get offsetWidth(){return Math.round(L(u)?.[2]??0)},get offsetHeight(){return Math.round(L(u)?.[3]??0)},get offsetLeft(){return gt(u).left},get offsetTop(){return gt(u).top},get offsetParent(){return ht(u)},get clientWidth(){let e=L(u);return e?Math.max(0,Math.round(e[2]-2*e[4])):0},get clientHeight(){let e=L(u);return e?Math.max(0,Math.round(e[3]-2*e[4])):0},get clientLeft(){return Math.round(L(u)?.[4]??0)},get clientTop(){return Math.round(L(u)?.[4]??0)},get scrollLeft(){return s()?.[0]??0},set scrollLeft(e){J(u,[e],!1)},get scrollTop(){return s()?.[1]??0},set scrollTop(e){J(u,[void 0,e],!1)},get scrollWidth(){return u.clientWidth+Math.round(s()?.[2]??0)},get scrollHeight(){return u.clientHeight+Math.round(s()?.[3]??0)},scrollTo:(...e)=>J(u,e,!1),scrollBy:(...e)=>J(u,e,!0),scrollIntoView:t=>{if(f(u))return;let{block:n,inline:r}=Dt(t);Je(e,n,r)},matches:(...t)=>{let n=Q(t,`matches`);return m(u)?(D(n),!1):He(e,n)},closest:(...t)=>{let n=Q(t,`closest`);if(m(u))return D(n),null;let r=Ue(e,n);return r===null?null:d(r)},querySelector:(...t)=>{let n=Q(t,`querySelector`);if(m(u))return D(n),null;let r=We(e,n);return r===null?null:d(r)},querySelectorAll:(...t)=>{let n=Q(t,`querySelectorAll`);if(m(u))return D(n),M(()=>[]);let r=Ge(e,n).map(e=>d(e));return M(()=>r)}};r===`input`&&Object.defineProperty(l,"value",{get:()=>m(u)?``:Qe(e),set:t=>{m(u)||$e(e,t===null?``:String(t))},enumerable:!0,configurable:!0});let u=t(i(l,e),()=>f(u));return Object.defineProperties(u,Object.getOwnPropertyDescriptors(dt(e,u))),Object.defineProperties(u,Object.getOwnPropertyDescriptors(mt(u))),Object.defineProperties(u,Object.getOwnPropertyDescriptors(q(u))),Object.defineProperties(u,Object.getOwnPropertyDescriptors(U(u,Mt))),Object.defineProperties(u,Object.getOwnPropertyDescriptors(W(u))),Object.defineProperties(u,Object.getOwnPropertyDescriptors(n===`comment`?Ot(u):Nt(u))),c(u),u}function Nt(e){return{get textContent(){return m(e)?``:Le(e.__node_id)},set textContent(t){m(e)||X(e,Y(t))}}}function Pt(e){return $(b(e),`element`,e)}function Ft(e=``){let t=b(`#comment`);return Xe(t,`display`,`none`),T(t,`value`,e),$(t,`comment`)}function It(){let e=y();return d(e)??$(e,`element`,void 0,[`wheel`])}function Lt(e){let t=i({kind:`fragment`,parent:null,__children:[]},e),n={get textContent(){return m(t)?``:Le(e)},set textContent(e){m(t)||X(t,Y(e))}};for(let e of[q(t),U(t,Mt),W(t),n])Object.defineProperties(t,Object.getOwnPropertyDescriptors(e));return c(t),t}function Rt(){let e=Lt(b(`#fragment`));return w(e.__node_id),h(e),e}Object.defineProperty(k,"createDocumentFragment",{value:Rt,configurable:!0,writable:!0});const zt=/* @__PURE__ */ Object.defineProperty(t(v(`$window`,[`wheel`]),()=>!1),Symbol.toStringTag,{value:`Window`});Object.defineProperty(globalThis,"__inca_targets__",{value:e=>e.map(e=>e===`$document`?k:e===`$window`?zt:d(e)??(e===y()?It():null)),configurable:!0});export{Ze as A,ve as B,S as C,Me as D,Ge as E,T as F,f as G,ye as H,Xe as I,h as K,v as L,Je as M,qe as N,Ye as O,O as P,ge as R,w as S,Pe as T,me as U,_e as V,_ as W,x as _,It as a,et as b,X as c,B as d,Ct as f,k as g,z as h,$ as i,y as j,C as k,jt as l,xt as m,Ft as n,Z as o,St as p,Pt as r,At as s,zt as t,bt as u,Fe as v,Ke as w,E as x,b as y,be as z};
@@ -1 +0,0 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{A as t,B as n,C as r,D as i,F as a,G as o,H as s,I as c,K as l,L as u,M as d,N as f,O as p,P as m,R as h,S as g,U as _,V as v,W as y,_ as b,a as x,b as S,c as C,f as w,i as T,j as E,k as D,l as O,m as k,n as A,p as j,r as M,s as N,t as P,u as F,w as I,x as L,y as R,z}from"./hooks-BSL3d56y.js";var B=/* @__PURE__ */ e({addEventListener:()=>h,appendChild:()=>b,blur:()=>z,click:()=>n,createCommentNode:()=>A,createElementNode:()=>M,createEventTarget:()=>u,createIncaElement:()=>T,createNode:()=>R,createTextNode:()=>N,dispatchEvent:()=>v,focus:()=>s,focusedNode:()=>S,getAttribute:()=>L,holdNode:()=>g,insert:()=>F,insertBefore:()=>r,isRemoved:()=>o,latestEventId:()=>_,layoutOf:()=>I,nextSibling:()=>w,parentNode:()=>j,releaseNode:()=>i,releaseWhenCollected:()=>l,remove:()=>k,removeAttribute:()=>p,removeChild:()=>D,removeEventListener:()=>y,removeStyle:()=>t,rootElement:()=>x,rootNodeId:()=>E,scrollIntoViewNode:()=>d,scrollNode:()=>f,scrollOf:()=>m,setAttribute:()=>a,setElementText:()=>C,setStyle:()=>c,setText:()=>O,window:()=>P});export{B as t};