@lytjs/renderer 4.0.1 → 4.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/native.cjs CHANGED
@@ -1 +1 @@
1
- var C=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var z=Object.prototype.hasOwnProperty;var F=(o,e)=>{for(var t in e)C(o,t,{get:e[t],enumerable:!0})},K=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Y(e))!z.call(o,i)&&i!==t&&C(o,i,{get:()=>e[i],enumerable:!(n=B(e,i))||n.enumerable});return o};var X=o=>K(C({},"__esModule",{value:!0}),o);var se={};F(se,{Comment:()=>L,Fragment:()=>E,NativeRenderer:()=>u,PatchFlags:()=>N,ShapeFlags:()=>y,Text:()=>R,createRenderer:()=>U,nativeRenderer:()=>j});module.exports=X(se);var W=require("@lytjs/vdom");var y=(s=>(s[s.ELEMENT=1]="ELEMENT",s[s.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",s[s.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",s[s.TEXT_CHILDREN=8]="TEXT_CHILDREN",s[s.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",s[s.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",s))(y||{}),N=(d=>(d[d.TEXT=1]="TEXT",d[d.CLASS=2]="CLASS",d[d.STYLE=4]="STYLE",d[d.PROPS=8]="PROPS",d[d.FULL_PROPS=16]="FULL_PROPS",d[d.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",d[d.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",d[d.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",d[d.NEED_PATCH=256]="NEED_PATCH",d[d.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",d[d.HOISTED=-1]="HOISTED",d[d.BAIL=-2]="BAIL",d))(N||{}),E=Symbol("Fragment"),R=Symbol("Text"),L=Symbol("Comment");function m(o){return o.type===E}function h(o){return o.type===R}function g(o){return o.type===L}function D(o,e){return o.type===e.type&&o.key===e.key}function A(o){return Array.isArray(o.dynamicChildren)}function H(o,e,t,n){if(t==="class")o.setClass(e,n);else if(t==="style")o.setStyle(e,n);else if(t.startsWith("on")||t.startsWith("@")){let i=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();o.addEventListener(e,i,n)}else t==="key"||t==="ref"||o.setAttribute(e,t,n)}function b(o,e,t,n,i){if(t==="class")o.setClass(e,n);else if(t==="style")o.setStyle(e,n||{});else if(t.startsWith("on")||t.startsWith("@")){let r=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();i&&o.removeEventListener(e,r,i),n&&o.addEventListener(e,r,n)}else o.setAttribute(e,t,n)}function S(o,e,t,n){for(let i in n){if(i==="key"||i==="ref")continue;let r=t[i],s=n[i];s!==r&&b(o,e,i,s,r)}for(let i in t)if(!(i==="key"||i==="ref")&&!(i in n))if(i==="class")o.setClass(e,"");else if(i==="style")o.setStyle(e,{});else if(i.startsWith("on")||i.startsWith("@")){let r=i.startsWith("@")?i.slice(1).toLowerCase():i.slice(2).toLowerCase();o.removeEventListener(e,r,t[i])}else o.removeAttribute(e,i)}function _(o,e,t,n,i,r){let{shapeFlag:s}=t;if(m(t)){$(o,e,t,n,i,r);return}if(h(t)){let a=o.createText(t.children);t.el=a,o.insert(n,a,i);return}if(g(t)){let a=o.createComment(t.children);t.el=a,o.insert(n,a,i);return}if(s&1){G(o,e,t,n,i,r);return}if(s&6){q(e,t,n,i,r);return}}function G(o,e,t,n,i,r){let s=t.type,a=o.createElement(s);if(t.el=a,t.props)for(let c in t.props){let f=t.props[c];H(o,a,c,f)}let{shapeFlag:l,children:p}=t;l&8?a.textContent=p:l&16&&v(e,p,a,null,r),o.insert(n,a,i)}function v(o,e,t,n,i){for(let r=0;r<e.length;r++)o(null,e[r],t,n,i)}function $(o,e,t,n,i,r){let{children:s}=t,a=o.createComment("");o.insert(n,a,i),Array.isArray(s)&&s.length>0&&v(e,s,n,a,r),t.el=a,t.anchor=a}function q(o,e,t,n,i){let r=e.component;r&&r.update&&r.update(),r&&r.subTree&&(o(null,r.subTree,t,n,r),e.el=r.subTree.el)}function M(o,e,t,n){let{shapeFlag:i,children:r}=t;if(m(t)){if(Array.isArray(r))for(let s=0;s<r.length;s++)e(r[s],n);t.anchor&&t.anchor.parentNode&&o.remove(t.anchor);return}if(i&6){t.component&&t.component.subTree&&e(t.component.subTree,n);return}t.el&&o.remove(t.el)}function T(o,e){for(let t=0;t<e.length;t++)o(e[t])}var x=require("@lytjs/vdom");function V(o,e,t,n,i,r=null,s=null){if(n==null){t&&e(t,i);return}if(t===null){_(o,O(o,e),n,i,r,s);return}if(A(n)&&A(t)){k(o,e,t,n,i,s);return}if(!D(t,n)){e(t,i),_(o,O(o,e),n,i,r,s);return}n.el=t.el,n.anchor=t.anchor;let{shapeFlag:a}=n;if(m(n)){Z(o,e,t,n,i,r,s);return}if(h(n)){n.children!==t.children&&(n.el.nodeValue=n.children);return}if(g(n)){n.children!==t.children&&(n.el.nodeValue=n.children);return}if(a&1){J(o,e,t,n,s);return}if(a&6){ee(t,n,s);return}}function O(o,e){return(t,n,i,r,s)=>{V(o,e,t,n,i,r,s)}}function J(o,e,t,n,i=null){let r=n.el=t.el,s=t.props||{},a=n.props||{},{patchFlag:l,dynamicProps:p}=n;if(l&&l>0){if(l&1&&t.children!==n.children&&(r.textContent=n.children),l&2&&s.class!==a.class&&o.setClass(r,a.class),l&4&&s.style!==a.style&&o.setStyle(r,a.style||{}),l&8&&p)for(let c=0;c<p.length;c++){let f=p[c],d=s[f],w=a[f];w!==d&&b(o,r,f,w,d)}l&16&&S(o,r,s,a)}else S(o,r,s,a);(!l||!(l&1))&&P(o,e,t,n,r,null,i)}function P(o,e,t,n,i,r,s){let a=t.shapeFlag,l=n.shapeFlag,p=t.children,c=n.children;if(l&8){a&16&&T(e,p),p!==c&&(i.textContent=c);return}if(l&16){a&16?Q(o,e,p,c,i,r,s):(a&8&&(i.textContent=""),v(O(o,e),c,i,r,s));return}c==null&&(a&8?i.textContent="":a&16&&T(e,p))}function Q(o,e,t,n,i,r,s){n.every(l=>l.key!=null)&&t.every(l=>l.key!=null)?(0,x.patchKeyedChildren)(t,n,i,r,s,null,!1):(0,x.patchUnkeyedChildren)(t,n,i,r,s,null,!1)}function Z(o,e,t,n,i,r,s){let a=t.children,l=n.children;Array.isArray(l)&&l.length>0?(P(o,e,t,n,i,r,s),n.el=l[0].el,n.anchor=l[l.length-1].el?o.nextSibling(l[l.length-1].el):r):Array.isArray(a)&&a.length>0&&l===null?(T(e,a),n.el=t.el,n.anchor=t.anchor):(n.el=t.el,n.anchor=t.anchor)}function k(o,e,t,n,i,r){let s=t.dynamicChildren,a=n.dynamicChildren;for(let l=0;l<a.length;l++)V(o,e,s[l],a[l],i,null,r)}function ee(o,e,t){e.component=o.component,e.el=o.el,e.component&&e.component.update&&e.component.update()}function U(o){function e(i,r){M(o,e,i,r)}(0,W.registerDOMOperations)({insert(i,r,s){o.insert(r,i,s)},createElement(i){return o.createElement(i)},createText(i){return o.createText(i)},setText(i,r){i.nodeValue=r},setElementText(i,r){i.textContent=r},remove(i){o.remove(i)},createComment(i){return o.createComment(i)},mount(i,r,s,a,l,p,c){n(null,i,r,s,a)},patch(i,r,s,a,l,p,c,f){n(i,r,s,a,l)},unmount(i,r,s,a){e(i)},move(i,r,s){o.insert(r,i.el,s)}});function n(i,r,s,a,l){V(o,e,i,r,s,a,l)}return{mount(i,r){r.nodeType===1&&(r.textContent=""),n(null,i,r,null,null)},patch(i,r,s){var a;n(i,r,s||((a=i.el)==null?void 0:a.parentNode),null,null)},unmount(i,r){e(i,r)}}}var te={div:"View",span:"Text",p:"Text",h1:"Text",h2:"Text",h3:"Text",h4:"Text",h5:"Text",h6:"Text",img:"Image",input:"TextInput",textarea:"TextInput",button:"TouchableOpacity",scroll:"ScrollView",list:"FlatList",a:"TouchableOpacity",ul:"View",ol:"View",li:"View",form:"View",header:"View",footer:"View",nav:"View",main:"View",section:"View",article:"View",aside:"View"},ne={flexDirection:"flexDirection",justifyContent:"justifyContent",alignItems:"alignItems",alignSelf:"alignSelf",flexWrap:"flexWrap",flex:"flex",flexGrow:"flexGrow",flexShrink:"flexShrink",flexBasis:"flexBasis",backgroundColor:"backgroundColor",color:"color",fontSize:"fontSize",fontWeight:"fontWeight",fontStyle:"fontStyle",textAlign:"textAlign",lineHeight:"lineHeight",letterSpacing:"letterSpacing",padding:"padding",paddingTop:"paddingTop",paddingBottom:"paddingBottom",paddingLeft:"paddingLeft",paddingRight:"paddingRight",paddingHorizontal:"paddingHorizontal",paddingVertical:"paddingVertical",margin:"margin",marginTop:"marginTop",marginBottom:"marginBottom",marginLeft:"marginLeft",marginRight:"marginRight",marginHorizontal:"marginHorizontal",marginVertical:"marginVertical",width:"width",height:"height",minWidth:"minWidth",maxWidth:"maxWidth",minHeight:"minHeight",maxHeight:"maxHeight",borderRadius:"borderRadius",borderWidth:"borderWidth",borderColor:"borderColor",overflow:"overflow",opacity:"opacity",position:"position",top:"top",left:"left",right:"right",bottom:"bottom",zIndex:"zIndex",shadowColor:"shadowColor",shadowOffset:"shadowOffset",shadowOpacity:"shadowOpacity",shadowRadius:"shadowRadius"},ie={click:"onPress",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",change:"onChange",input:"onChangeText",focus:"onFocus",blur:"onBlur",submit:"onSubmitEditing",scroll:"onScroll",longpress:"onLongPress"},oe=0;function I(){return`native_${++oe}`}var u=class{createElement(e){return{type:this.getComponentType(e),props:{},children:[],nativeId:I()}}createText(e){return{type:"RawText",props:{text:e},children:[],nativeId:I()}}createComment(e){return{type:"__Comment",props:{text:e},children:[],nativeId:I()}}setAttribute(e,t,n){if(e){if(t==="style"&&typeof n=="object"&&n!==null){e.props.style={...e.props.style,...this.mapStyle(n)};return}if(t==="className"||t==="class"){e.props.className=n;return}if(t.startsWith("on")&&typeof n=="function"){let i=t.slice(2).toLowerCase(),r=this.mapEvent(i);e.props[r]=n;return}if(t==="src"&&e.type==="Image"){e.props.source={uri:n};return}if(t==="href"){e.props.href=n;return}if(t==="placeholder"){e.props.placeholder=n;return}e.props[t]=n}}removeAttribute(e,t){if(e)if(t==="style")delete e.props.style;else if(t.startsWith("on")){let n=t.slice(2).toLowerCase(),i=this.mapEvent(n);delete e.props[i]}else delete e.props[t]}setStyle(e,t){if(!e)return;let n=this.mapStyle(t);e.props.style={...e.props.style,...n}}setClass(e,t){if(e){if(typeof t=="string")e.props.className=t;else if(typeof t=="object"&&t!==null){let n=[];for(let[i,r]of Object.entries(t))r&&n.push(i);e.props.className=n.join(" ")}}}insert(e,t,n){if(!(!e||!t)){if(t._parent){let i=t._parent,r=i.children.indexOf(t);r!==-1&&i.children.splice(r,1)}if(t._parent=e,n){let i=e.children.indexOf(n);i!==-1?e.children.splice(i,0,t):e.children.push(t)}else e.children.push(t)}}remove(e){if(!e||!e._parent)return;let t=e._parent,n=t.children.indexOf(e);n!==-1&&t.children.splice(n,1),e._parent=void 0}replace(e,t,n){if(!e||!t||!n)return;let i=e.children.indexOf(t);i!==-1&&(t._parent=void 0,n._parent=e,e.children[i]=n)}addEventListener(e,t,n,i){if(!e)return;let r=this.mapEvent(t);e.props[r]=n}removeEventListener(e,t,n){if(!e)return;let i=this.mapEvent(t);e.props[i]===n&&delete e.props[i]}nextTick(e){Promise.resolve().then(()=>e())}parentNode(e){var t;return(t=e==null?void 0:e._parent)!=null?t:null}nextSibling(e){if(!e||!e._parent)return null;let t=e._parent.children,n=t.indexOf(e);return n!==-1&&n+1<t.length?t[n+1]:null}setText(e,t){e&&e.type==="RawText"&&(e.props.text=t)}patchProp(e,t,n,i){if(e){if(i==null){this.removeAttribute(e,t);return}if(t==="style")this.setStyle(e,i);else if(t==="class"||t==="className")this.setClass(e,i);else if(t.startsWith("on")&&typeof i=="function"){let r=t.slice(2).toLowerCase(),s=this.mapEvent(r);e.props[s]=i}else this.setAttribute(e,t,i)}}querySelector(e){let t=e.replace(/[.#\[\]]/g,"").trim();return null}renderToNativeTree(e){if(!e)return this.createComment("empty vnode");if(typeof e=="string")return this.createText(e);if(e.type===Symbol.for("lyt.comment")||e.type==="comment")return this.createComment(e.children||"");if(e.type===Symbol.for("lyt.text")||e.type==="text")return this.createText(e.children||"");if(e.type===Symbol.for("lyt.fragment")||e.type==="fragment"){let t=this.createElement("__Fragment");if(Array.isArray(e.children))for(let n of e.children){let i=this.renderToNativeTree(n);this.insert(t,i)}return t}if(typeof e.type=="string"){let t=this.createElement(e.type);if(e.props)for(let[n,i]of Object.entries(e.props))n==="key"||n==="ref"||this.setAttribute(t,n,i);if(e.children){if(typeof e.children=="string")this.insert(t,this.createText(e.children));else if(Array.isArray(e.children))for(let n of e.children)this.insert(t,this.renderToNativeTree(n))}return t}if(typeof e.type=="object"||typeof e.type=="function"){let t=this.createElement("div");if(Array.isArray(e.children))for(let n of e.children)this.insert(t,this.renderToNativeTree(n));return t}return this.createComment("unknown vnode type")}serializeToJSON(e){let t=n=>{let i={type:n.type,props:{...n.props},children:n.children.map(t)};return n.nativeId&&(i.nativeId=n.nativeId),i};return JSON.stringify(t(e),null,2)}getComponentType(e){return te[e]||re(e)}mapStyle(e){let t={};for(let[n,i]of Object.entries(e)){let r=ne[n]||n;typeof i=="string"&&/^\d+px$/.test(i)?t[r]=parseInt(i,10):t[r]=i}return t}mapEvent(e){return ie[e]||`on${e.charAt(0).toUpperCase()}${e.slice(1)}`}};function re(o){return o.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("")}var j=new u;
1
+ var C=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var z=Object.prototype.hasOwnProperty;var F=(o,e)=>{for(var t in e)C(o,t,{get:e[t],enumerable:!0})},K=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Y(e))!z.call(o,i)&&i!==t&&C(o,i,{get:()=>e[i],enumerable:!(n=B(e,i))||n.enumerable});return o};var X=o=>K(C({},"__esModule",{value:!0}),o);var se={};F(se,{Comment:()=>L,Fragment:()=>E,NativeRenderer:()=>u,PatchFlags:()=>N,ShapeFlags:()=>y,Text:()=>R,createRenderer:()=>U,nativeRenderer:()=>j});module.exports=X(se);var W=require("@lytjs/vdom");var y=(s=>(s[s.ELEMENT=1]="ELEMENT",s[s.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",s[s.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",s[s.TEXT_CHILDREN=8]="TEXT_CHILDREN",s[s.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",s[s.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",s))(y||{}),N=(l=>(l[l.TEXT=1]="TEXT",l[l.CLASS=2]="CLASS",l[l.STYLE=4]="STYLE",l[l.PROPS=8]="PROPS",l[l.FULL_PROPS=16]="FULL_PROPS",l[l.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",l[l.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",l[l.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",l[l.NEED_PATCH=256]="NEED_PATCH",l[l.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",l[l.HOISTED=-1]="HOISTED",l[l.BAIL=-2]="BAIL",l))(N||{}),E=Symbol("Fragment"),R=Symbol("Text"),L=Symbol("Comment");function m(o){return o.type===E}function h(o){return o.type===R}function g(o){return o.type===L}function D(o,e){return o.type===e.type&&o.key===e.key}function A(o){return Array.isArray(o.dynamicChildren)}function H(o,e,t,n){if(t==="class")o.setClass(e,n);else if(t==="style")o.setStyle(e,n);else if(t.startsWith("on")||t.startsWith("@")){let i=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();o.addEventListener(e,i,n)}else t==="key"||t==="ref"||o.setAttribute(e,t,n)}function b(o,e,t,n,i){if(t==="class")o.setClass(e,n);else if(t==="style")o.setStyle(e,n||{});else if(t.startsWith("on")||t.startsWith("@")){let r=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();i&&o.removeEventListener(e,r,i),n&&o.addEventListener(e,r,n)}else o.setAttribute(e,t,n)}function S(o,e,t,n){for(let i in n){if(i==="key"||i==="ref")continue;let r=t[i],s=n[i];s!==r&&b(o,e,i,s,r)}for(let i in t)if(!(i==="key"||i==="ref")&&!(i in n))if(i==="class")o.setClass(e,"");else if(i==="style")o.setStyle(e,{});else if(i.startsWith("on")||i.startsWith("@")){let r=i.startsWith("@")?i.slice(1).toLowerCase():i.slice(2).toLowerCase();o.removeEventListener(e,r,t[i])}else o.removeAttribute(e,i)}function _(o,e,t,n,i,r){let{shapeFlag:s}=t;if(m(t)){$(o,e,t,n,i,r);return}if(h(t)){let a=o.createText(t.children);t.el=a,o.insert(n,a,i);return}if(g(t)){let a=o.createComment(t.children);t.el=a,o.insert(n,a,i);return}if(s&1){G(o,e,t,n,i,r);return}if(s&6){q(e,t,n,i,r);return}}function G(o,e,t,n,i,r){let s=t.type,a=o.createElement(s);if(t.el=a,t.props)for(let c in t.props){let f=t.props[c];H(o,a,c,f)}let{shapeFlag:d,children:p}=t;d&8?a.textContent=p:d&16&&v(e,p,a,null,r),o.insert(n,a,i)}function v(o,e,t,n,i){for(let r=0;r<e.length;r++)o(null,e[r],t,n,i)}function $(o,e,t,n,i,r){let{children:s}=t,a=o.createComment("");o.insert(n,a,i),Array.isArray(s)&&s.length>0&&v(e,s,n,a,r),t.el=a,t.anchor=a}function q(o,e,t,n,i){let r=e.component;r&&r.update&&r.update(),r&&r.subTree&&(o(null,r.subTree,t,n,r),e.el=r.subTree.el)}function M(o,e,t,n){let{shapeFlag:i,children:r}=t;if(m(t)){if(Array.isArray(r))for(let s=0;s<r.length;s++)e(r[s],n);t.anchor&&t.anchor.parentNode&&o.remove(t.anchor);return}if(i&6){t.component&&t.component.subTree&&e(t.component.subTree,n);return}t.el&&o.remove(t.el)}function T(o,e){for(let t=0;t<e.length;t++)o(e[t])}var x=require("@lytjs/vdom");function V(o,e,t,n,i,r=null,s=null){if(n==null){t&&e(t,i);return}if(t===null){_(o,O(o,e),n,i,r,s);return}if(A(n)&&A(t)){k(o,e,t,n,i,s);return}if(!D(t,n)){e(t,i),_(o,O(o,e),n,i,r,s);return}n.el=t.el,n.anchor=t.anchor;let{shapeFlag:a}=n;if(m(n)){Z(o,e,t,n,i,r,s);return}if(h(n)){n.children!==t.children&&(n.el.nodeValue=n.children);return}if(g(n)){n.children!==t.children&&(n.el.nodeValue=n.children);return}if(a&1){J(o,e,t,n,s);return}if(a&6){ee(t,n,s);return}}function O(o,e){return(t,n,i,r,s)=>{V(o,e,t,n,i,r,s)}}function J(o,e,t,n,i=null){let r=n.el=t.el,s=t.props||{},a=n.props||{},{patchFlag:d,dynamicProps:p}=n;if(d&&d>0){if(d&1&&t.children!==n.children&&(r.textContent=n.children),d&2&&s.class!==a.class&&o.setClass(r,a.class),d&4&&s.style!==a.style&&o.setStyle(r,a.style||{}),d&8&&p)for(let c=0;c<p.length;c++){let f=p[c],l=s[f],w=a[f];w!==l&&b(o,r,f,w,l)}d&16&&S(o,r,s,a)}else S(o,r,s,a);(!d||!(d&1))&&P(o,e,t,n,r,null,i)}function P(o,e,t,n,i,r,s){let a=t.shapeFlag,d=n.shapeFlag,p=t.children,c=n.children;if(d&8){a&16&&T(e,p),p!==c&&(i.textContent=c);return}if(d&16){a&16?Q(o,e,p,c,i,r,s):(a&8&&(i.textContent=""),v(O(o,e),c,i,r,s));return}c==null&&(a&8?i.textContent="":a&16&&T(e,p))}function Q(o,e,t,n,i,r,s){n.every(d=>d.key!==null&&d.key!==void 0)&&t.every(d=>d.key!==null&&d.key!==void 0)?(0,x.patchKeyedChildren)(t,n,i,r,s,null,!1):(0,x.patchUnkeyedChildren)(t,n,i,r,s,null,!1)}function Z(o,e,t,n,i,r,s){let a=t.children,d=n.children;Array.isArray(d)&&d.length>0?(P(o,e,t,n,i,r,s),n.el=d[0].el,n.anchor=d[d.length-1].el?o.nextSibling(d[d.length-1].el):r):Array.isArray(a)&&a.length>0&&d===null?(T(e,a),n.el=t.el,n.anchor=t.anchor):(n.el=t.el,n.anchor=t.anchor)}function k(o,e,t,n,i,r){let s=t.dynamicChildren,a=n.dynamicChildren;for(let d=0;d<a.length;d++)V(o,e,s[d],a[d],i,null,r)}function ee(o,e,t){e.component=o.component,e.el=o.el,e.component&&e.component.update&&e.component.update()}function U(o){function e(i,r){M(o,e,i,r)}(0,W.registerDOMOperations)({insert(i,r,s){o.insert(r,i,s)},createElement(i){return o.createElement(i)},createText(i){return o.createText(i)},setText(i,r){i.nodeValue=r},setElementText(i,r){i.textContent=r},remove(i){o.remove(i)},createComment(i){return o.createComment(i)},mount(i,r,s,a,d,p,c){n(null,i,r,s,a)},patch(i,r,s,a,d,p,c,f){n(i,r,s,a,d)},unmount(i,r,s,a){e(i)},move(i,r,s){o.insert(r,i.el,s)}});function n(i,r,s,a,d){V(o,e,i,r,s,a,d)}return{mount(i,r){r.nodeType===1&&(r.textContent=""),n(null,i,r,null,null)},patch(i,r,s){var a;n(i,r,s||((a=i.el)==null?void 0:a.parentNode),null,null)},unmount(i,r){e(i,r)}}}var te={div:"View",span:"Text",p:"Text",h1:"Text",h2:"Text",h3:"Text",h4:"Text",h5:"Text",h6:"Text",img:"Image",input:"TextInput",textarea:"TextInput",button:"TouchableOpacity",scroll:"ScrollView",list:"FlatList",a:"TouchableOpacity",ul:"View",ol:"View",li:"View",form:"View",header:"View",footer:"View",nav:"View",main:"View",section:"View",article:"View",aside:"View"},ne={flexDirection:"flexDirection",justifyContent:"justifyContent",alignItems:"alignItems",alignSelf:"alignSelf",flexWrap:"flexWrap",flex:"flex",flexGrow:"flexGrow",flexShrink:"flexShrink",flexBasis:"flexBasis",backgroundColor:"backgroundColor",color:"color",fontSize:"fontSize",fontWeight:"fontWeight",fontStyle:"fontStyle",textAlign:"textAlign",lineHeight:"lineHeight",letterSpacing:"letterSpacing",padding:"padding",paddingTop:"paddingTop",paddingBottom:"paddingBottom",paddingLeft:"paddingLeft",paddingRight:"paddingRight",paddingHorizontal:"paddingHorizontal",paddingVertical:"paddingVertical",margin:"margin",marginTop:"marginTop",marginBottom:"marginBottom",marginLeft:"marginLeft",marginRight:"marginRight",marginHorizontal:"marginHorizontal",marginVertical:"marginVertical",width:"width",height:"height",minWidth:"minWidth",maxWidth:"maxWidth",minHeight:"minHeight",maxHeight:"maxHeight",borderRadius:"borderRadius",borderWidth:"borderWidth",borderColor:"borderColor",overflow:"overflow",opacity:"opacity",position:"position",top:"top",left:"left",right:"right",bottom:"bottom",zIndex:"zIndex",shadowColor:"shadowColor",shadowOffset:"shadowOffset",shadowOpacity:"shadowOpacity",shadowRadius:"shadowRadius"},ie={click:"onPress",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",change:"onChange",input:"onChangeText",focus:"onFocus",blur:"onBlur",submit:"onSubmitEditing",scroll:"onScroll",longpress:"onLongPress"},oe=0;function I(){return`native_${++oe}`}var u=class{createElement(e){return{type:this.getComponentType(e),props:{},children:[],nativeId:I()}}createText(e){return{type:"RawText",props:{text:e},children:[],nativeId:I()}}createComment(e){return{type:"__Comment",props:{text:e},children:[],nativeId:I()}}setAttribute(e,t,n){if(e){if(t==="style"&&typeof n=="object"&&n!==null){e.props.style={...e.props.style,...this.mapStyle(n)};return}if(t==="className"||t==="class"){e.props.className=n;return}if(t.startsWith("on")&&typeof n=="function"){let i=t.slice(2).toLowerCase(),r=this.mapEvent(i);e.props[r]=n;return}if(t==="src"&&e.type==="Image"){e.props.source={uri:n};return}if(t==="href"){e.props.href=n;return}if(t==="placeholder"){e.props.placeholder=n;return}e.props[t]=n}}removeAttribute(e,t){if(e)if(t==="style")delete e.props.style;else if(t.startsWith("on")){let n=t.slice(2).toLowerCase(),i=this.mapEvent(n);delete e.props[i]}else delete e.props[t]}setStyle(e,t){if(!e)return;let n=this.mapStyle(t);e.props.style={...e.props.style,...n}}setClass(e,t){if(e){if(typeof t=="string")e.props.className=t;else if(typeof t=="object"&&t!==null){let n=[];for(let[i,r]of Object.entries(t))r&&n.push(i);e.props.className=n.join(" ")}}}insert(e,t,n){if(!(!e||!t)){if(t._parent){let i=t._parent,r=i.children.indexOf(t);r!==-1&&i.children.splice(r,1)}if(t._parent=e,n){let i=e.children.indexOf(n);i!==-1?e.children.splice(i,0,t):e.children.push(t)}else e.children.push(t)}}remove(e){if(!e||!e._parent)return;let t=e._parent,n=t.children.indexOf(e);n!==-1&&t.children.splice(n,1),e._parent=void 0}replace(e,t,n){if(!e||!t||!n)return;let i=e.children.indexOf(t);i!==-1&&(t._parent=void 0,n._parent=e,e.children[i]=n)}addEventListener(e,t,n,i){if(!e)return;let r=this.mapEvent(t);e.props[r]=n}removeEventListener(e,t,n){if(!e)return;let i=this.mapEvent(t);e.props[i]===n&&delete e.props[i]}nextTick(e){Promise.resolve().then(()=>e())}parentNode(e){var t;return(t=e==null?void 0:e._parent)!=null?t:null}nextSibling(e){if(!e||!e._parent)return null;let t=e._parent.children,n=t.indexOf(e);return n!==-1&&n+1<t.length?t[n+1]:null}setText(e,t){e&&e.type==="RawText"&&(e.props.text=t)}patchProp(e,t,n,i){if(e){if(i==null){this.removeAttribute(e,t);return}if(t==="style")this.setStyle(e,i);else if(t==="class"||t==="className")this.setClass(e,i);else if(t.startsWith("on")&&typeof i=="function"){let r=t.slice(2).toLowerCase(),s=this.mapEvent(r);e.props[s]=i}else this.setAttribute(e,t,i)}}querySelector(e){let t=e.replace(/[.#\[\]]/g,"").trim();return null}renderToNativeTree(e){if(!e)return this.createComment("empty vnode");if(typeof e=="string")return this.createText(e);if(e.type===Symbol.for("lyt.comment")||e.type==="comment")return this.createComment(e.children||"");if(e.type===Symbol.for("lyt.text")||e.type==="text")return this.createText(e.children||"");if(e.type===Symbol.for("lyt.fragment")||e.type==="fragment"){let t=this.createElement("__Fragment");if(Array.isArray(e.children))for(let n of e.children){let i=this.renderToNativeTree(n);this.insert(t,i)}return t}if(typeof e.type=="string"){let t=this.createElement(e.type);if(e.props)for(let[n,i]of Object.entries(e.props))n==="key"||n==="ref"||this.setAttribute(t,n,i);if(e.children){if(typeof e.children=="string")this.insert(t,this.createText(e.children));else if(Array.isArray(e.children))for(let n of e.children)this.insert(t,this.renderToNativeTree(n))}return t}if(typeof e.type=="object"||typeof e.type=="function"){let t=this.createElement("div");if(Array.isArray(e.children))for(let n of e.children)this.insert(t,this.renderToNativeTree(n));return t}return this.createComment("unknown vnode type")}serializeToJSON(e){let t=n=>{let i={type:n.type,props:{...n.props},children:n.children.map(t)};return n.nativeId&&(i.nativeId=n.nativeId),i};return JSON.stringify(t(e),null,2)}getComponentType(e){return te[e]||re(e)}mapStyle(e){let t={};for(let[n,i]of Object.entries(e)){let r=ne[n]||n;typeof i=="string"&&/^\d+px$/.test(i)?t[r]=parseInt(i,10):t[r]=i}return t}mapEvent(e){return ie[e]||`on${e.charAt(0).toUpperCase()}${e.slice(1)}`}};function re(o){return o.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("")}var j=new u;
package/dist/native.mjs CHANGED
@@ -1 +1 @@
1
- import{registerDOMOperations as X}from"@lytjs/vdom";var m=(s=>(s[s.ELEMENT=1]="ELEMENT",s[s.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",s[s.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",s[s.TEXT_CHILDREN=8]="TEXT_CHILDREN",s[s.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",s[s.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",s))(m||{}),x=(d=>(d[d.TEXT=1]="TEXT",d[d.CLASS=2]="CLASS",d[d.STYLE=4]="STYLE",d[d.PROPS=8]="PROPS",d[d.FULL_PROPS=16]="FULL_PROPS",d[d.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",d[d.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",d[d.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",d[d.NEED_PATCH=256]="NEED_PATCH",d[d.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",d[d.HOISTED=-1]="HOISTED",d[d.BAIL=-2]="BAIL",d))(x||{}),S=Symbol("Fragment"),_=Symbol("Text"),O=Symbol("Comment");function y(r){return r.type===S}function u(r){return r.type===_}function N(r){return r.type===O}function I(r,e){return r.type===e.type&&r.key===e.key}function V(r){return Array.isArray(r.dynamicChildren)}function w(r,e,t,n){if(t==="class")r.setClass(e,n);else if(t==="style")r.setStyle(e,n);else if(t.startsWith("on")||t.startsWith("@")){let i=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();r.addEventListener(e,i,n)}else t==="key"||t==="ref"||r.setAttribute(e,t,n)}function C(r,e,t,n,i){if(t==="class")r.setClass(e,n);else if(t==="style")r.setStyle(e,n||{});else if(t.startsWith("on")||t.startsWith("@")){let o=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();i&&r.removeEventListener(e,o,i),n&&r.addEventListener(e,o,n)}else r.setAttribute(e,t,n)}function E(r,e,t,n){for(let i in n){if(i==="key"||i==="ref")continue;let o=t[i],s=n[i];s!==o&&C(r,e,i,s,o)}for(let i in t)if(!(i==="key"||i==="ref")&&!(i in n))if(i==="class")r.setClass(e,"");else if(i==="style")r.setStyle(e,{});else if(i.startsWith("on")||i.startsWith("@")){let o=i.startsWith("@")?i.slice(1).toLowerCase():i.slice(2).toLowerCase();r.removeEventListener(e,o,t[i])}else r.removeAttribute(e,i)}function R(r,e,t,n,i,o){let{shapeFlag:s}=t;if(y(t)){P(r,e,t,n,i,o);return}if(u(t)){let a=r.createText(t.children);t.el=a,r.insert(n,a,i);return}if(N(t)){let a=r.createComment(t.children);t.el=a,r.insert(n,a,i);return}if(s&1){M(r,e,t,n,i,o);return}if(s&6){W(e,t,n,i,o);return}}function M(r,e,t,n,i,o){let s=t.type,a=r.createElement(s);if(t.el=a,t.props)for(let c in t.props){let f=t.props[c];w(r,a,c,f)}let{shapeFlag:l,children:p}=t;l&8?a.textContent=p:l&16&&h(e,p,a,null,o),r.insert(n,a,i)}function h(r,e,t,n,i){for(let o=0;o<e.length;o++)r(null,e[o],t,n,i)}function P(r,e,t,n,i,o){let{children:s}=t,a=r.createComment("");r.insert(n,a,i),Array.isArray(s)&&s.length>0&&h(e,s,n,a,o),t.el=a,t.anchor=a}function W(r,e,t,n,i){let o=e.component;o&&o.update&&o.update(),o&&o.subTree&&(r(null,o.subTree,t,n,o),e.el=o.subTree.el)}function D(r,e,t,n){let{shapeFlag:i,children:o}=t;if(y(t)){if(Array.isArray(o))for(let s=0;s<o.length;s++)e(o[s],n);t.anchor&&t.anchor.parentNode&&r.remove(t.anchor);return}if(i&6){t.component&&t.component.subTree&&e(t.component.subTree,n);return}t.el&&r.remove(t.el)}function g(r,e){for(let t=0;t<e.length;t++)r(e[t])}import{patchKeyedChildren as U,patchUnkeyedChildren as j}from"@lytjs/vdom";function v(r,e,t,n,i,o=null,s=null){if(n==null){t&&e(t,i);return}if(t===null){R(r,L(r,e),n,i,o,s);return}if(V(n)&&V(t)){F(r,e,t,n,i,s);return}if(!I(t,n)){e(t,i),R(r,L(r,e),n,i,o,s);return}n.el=t.el,n.anchor=t.anchor;let{shapeFlag:a}=n;if(y(n)){z(r,e,t,n,i,o,s);return}if(u(n)){n.children!==t.children&&(n.el.nodeValue=n.children);return}if(N(n)){n.children!==t.children&&(n.el.nodeValue=n.children);return}if(a&1){B(r,e,t,n,s);return}if(a&6){K(t,n,s);return}}function L(r,e){return(t,n,i,o,s)=>{v(r,e,t,n,i,o,s)}}function B(r,e,t,n,i=null){let o=n.el=t.el,s=t.props||{},a=n.props||{},{patchFlag:l,dynamicProps:p}=n;if(l&&l>0){if(l&1&&t.children!==n.children&&(o.textContent=n.children),l&2&&s.class!==a.class&&r.setClass(o,a.class),l&4&&s.style!==a.style&&r.setStyle(o,a.style||{}),l&8&&p)for(let c=0;c<p.length;c++){let f=p[c],d=s[f],b=a[f];b!==d&&C(r,o,f,b,d)}l&16&&E(r,o,s,a)}else E(r,o,s,a);(!l||!(l&1))&&H(r,e,t,n,o,null,i)}function H(r,e,t,n,i,o,s){let a=t.shapeFlag,l=n.shapeFlag,p=t.children,c=n.children;if(l&8){a&16&&g(e,p),p!==c&&(i.textContent=c);return}if(l&16){a&16?Y(r,e,p,c,i,o,s):(a&8&&(i.textContent=""),h(L(r,e),c,i,o,s));return}c==null&&(a&8?i.textContent="":a&16&&g(e,p))}function Y(r,e,t,n,i,o,s){n.every(l=>l.key!=null)&&t.every(l=>l.key!=null)?U(t,n,i,o,s,null,!1):j(t,n,i,o,s,null,!1)}function z(r,e,t,n,i,o,s){let a=t.children,l=n.children;Array.isArray(l)&&l.length>0?(H(r,e,t,n,i,o,s),n.el=l[0].el,n.anchor=l[l.length-1].el?r.nextSibling(l[l.length-1].el):o):Array.isArray(a)&&a.length>0&&l===null?(g(e,a),n.el=t.el,n.anchor=t.anchor):(n.el=t.el,n.anchor=t.anchor)}function F(r,e,t,n,i,o){let s=t.dynamicChildren,a=n.dynamicChildren;for(let l=0;l<a.length;l++)v(r,e,s[l],a[l],i,null,o)}function K(r,e,t){e.component=r.component,e.el=r.el,e.component&&e.component.update&&e.component.update()}function G(r){function e(i,o){D(r,e,i,o)}X({insert(i,o,s){r.insert(o,i,s)},createElement(i){return r.createElement(i)},createText(i){return r.createText(i)},setText(i,o){i.nodeValue=o},setElementText(i,o){i.textContent=o},remove(i){r.remove(i)},createComment(i){return r.createComment(i)},mount(i,o,s,a,l,p,c){n(null,i,o,s,a)},patch(i,o,s,a,l,p,c,f){n(i,o,s,a,l)},unmount(i,o,s,a){e(i)},move(i,o,s){r.insert(o,i.el,s)}});function n(i,o,s,a,l){v(r,e,i,o,s,a,l)}return{mount(i,o){o.nodeType===1&&(o.textContent=""),n(null,i,o,null,null)},patch(i,o,s){var a;n(i,o,s||((a=i.el)==null?void 0:a.parentNode),null,null)},unmount(i,o){e(i,o)}}}var $={div:"View",span:"Text",p:"Text",h1:"Text",h2:"Text",h3:"Text",h4:"Text",h5:"Text",h6:"Text",img:"Image",input:"TextInput",textarea:"TextInput",button:"TouchableOpacity",scroll:"ScrollView",list:"FlatList",a:"TouchableOpacity",ul:"View",ol:"View",li:"View",form:"View",header:"View",footer:"View",nav:"View",main:"View",section:"View",article:"View",aside:"View"},q={flexDirection:"flexDirection",justifyContent:"justifyContent",alignItems:"alignItems",alignSelf:"alignSelf",flexWrap:"flexWrap",flex:"flex",flexGrow:"flexGrow",flexShrink:"flexShrink",flexBasis:"flexBasis",backgroundColor:"backgroundColor",color:"color",fontSize:"fontSize",fontWeight:"fontWeight",fontStyle:"fontStyle",textAlign:"textAlign",lineHeight:"lineHeight",letterSpacing:"letterSpacing",padding:"padding",paddingTop:"paddingTop",paddingBottom:"paddingBottom",paddingLeft:"paddingLeft",paddingRight:"paddingRight",paddingHorizontal:"paddingHorizontal",paddingVertical:"paddingVertical",margin:"margin",marginTop:"marginTop",marginBottom:"marginBottom",marginLeft:"marginLeft",marginRight:"marginRight",marginHorizontal:"marginHorizontal",marginVertical:"marginVertical",width:"width",height:"height",minWidth:"minWidth",maxWidth:"maxWidth",minHeight:"minHeight",maxHeight:"maxHeight",borderRadius:"borderRadius",borderWidth:"borderWidth",borderColor:"borderColor",overflow:"overflow",opacity:"opacity",position:"position",top:"top",left:"left",right:"right",bottom:"bottom",zIndex:"zIndex",shadowColor:"shadowColor",shadowOffset:"shadowOffset",shadowOpacity:"shadowOpacity",shadowRadius:"shadowRadius"},J={click:"onPress",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",change:"onChange",input:"onChangeText",focus:"onFocus",blur:"onBlur",submit:"onSubmitEditing",scroll:"onScroll",longpress:"onLongPress"},Q=0;function A(){return`native_${++Q}`}var T=class{createElement(e){return{type:this.getComponentType(e),props:{},children:[],nativeId:A()}}createText(e){return{type:"RawText",props:{text:e},children:[],nativeId:A()}}createComment(e){return{type:"__Comment",props:{text:e},children:[],nativeId:A()}}setAttribute(e,t,n){if(e){if(t==="style"&&typeof n=="object"&&n!==null){e.props.style={...e.props.style,...this.mapStyle(n)};return}if(t==="className"||t==="class"){e.props.className=n;return}if(t.startsWith("on")&&typeof n=="function"){let i=t.slice(2).toLowerCase(),o=this.mapEvent(i);e.props[o]=n;return}if(t==="src"&&e.type==="Image"){e.props.source={uri:n};return}if(t==="href"){e.props.href=n;return}if(t==="placeholder"){e.props.placeholder=n;return}e.props[t]=n}}removeAttribute(e,t){if(e)if(t==="style")delete e.props.style;else if(t.startsWith("on")){let n=t.slice(2).toLowerCase(),i=this.mapEvent(n);delete e.props[i]}else delete e.props[t]}setStyle(e,t){if(!e)return;let n=this.mapStyle(t);e.props.style={...e.props.style,...n}}setClass(e,t){if(e){if(typeof t=="string")e.props.className=t;else if(typeof t=="object"&&t!==null){let n=[];for(let[i,o]of Object.entries(t))o&&n.push(i);e.props.className=n.join(" ")}}}insert(e,t,n){if(!(!e||!t)){if(t._parent){let i=t._parent,o=i.children.indexOf(t);o!==-1&&i.children.splice(o,1)}if(t._parent=e,n){let i=e.children.indexOf(n);i!==-1?e.children.splice(i,0,t):e.children.push(t)}else e.children.push(t)}}remove(e){if(!e||!e._parent)return;let t=e._parent,n=t.children.indexOf(e);n!==-1&&t.children.splice(n,1),e._parent=void 0}replace(e,t,n){if(!e||!t||!n)return;let i=e.children.indexOf(t);i!==-1&&(t._parent=void 0,n._parent=e,e.children[i]=n)}addEventListener(e,t,n,i){if(!e)return;let o=this.mapEvent(t);e.props[o]=n}removeEventListener(e,t,n){if(!e)return;let i=this.mapEvent(t);e.props[i]===n&&delete e.props[i]}nextTick(e){Promise.resolve().then(()=>e())}parentNode(e){var t;return(t=e==null?void 0:e._parent)!=null?t:null}nextSibling(e){if(!e||!e._parent)return null;let t=e._parent.children,n=t.indexOf(e);return n!==-1&&n+1<t.length?t[n+1]:null}setText(e,t){e&&e.type==="RawText"&&(e.props.text=t)}patchProp(e,t,n,i){if(e){if(i==null){this.removeAttribute(e,t);return}if(t==="style")this.setStyle(e,i);else if(t==="class"||t==="className")this.setClass(e,i);else if(t.startsWith("on")&&typeof i=="function"){let o=t.slice(2).toLowerCase(),s=this.mapEvent(o);e.props[s]=i}else this.setAttribute(e,t,i)}}querySelector(e){let t=e.replace(/[.#\[\]]/g,"").trim();return null}renderToNativeTree(e){if(!e)return this.createComment("empty vnode");if(typeof e=="string")return this.createText(e);if(e.type===Symbol.for("lyt.comment")||e.type==="comment")return this.createComment(e.children||"");if(e.type===Symbol.for("lyt.text")||e.type==="text")return this.createText(e.children||"");if(e.type===Symbol.for("lyt.fragment")||e.type==="fragment"){let t=this.createElement("__Fragment");if(Array.isArray(e.children))for(let n of e.children){let i=this.renderToNativeTree(n);this.insert(t,i)}return t}if(typeof e.type=="string"){let t=this.createElement(e.type);if(e.props)for(let[n,i]of Object.entries(e.props))n==="key"||n==="ref"||this.setAttribute(t,n,i);if(e.children){if(typeof e.children=="string")this.insert(t,this.createText(e.children));else if(Array.isArray(e.children))for(let n of e.children)this.insert(t,this.renderToNativeTree(n))}return t}if(typeof e.type=="object"||typeof e.type=="function"){let t=this.createElement("div");if(Array.isArray(e.children))for(let n of e.children)this.insert(t,this.renderToNativeTree(n));return t}return this.createComment("unknown vnode type")}serializeToJSON(e){let t=n=>{let i={type:n.type,props:{...n.props},children:n.children.map(t)};return n.nativeId&&(i.nativeId=n.nativeId),i};return JSON.stringify(t(e),null,2)}getComponentType(e){return $[e]||Z(e)}mapStyle(e){let t={};for(let[n,i]of Object.entries(e)){let o=q[n]||n;typeof i=="string"&&/^\d+px$/.test(i)?t[o]=parseInt(i,10):t[o]=i}return t}mapEvent(e){return J[e]||`on${e.charAt(0).toUpperCase()}${e.slice(1)}`}};function Z(r){return r.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("")}var k=new T;export{O as Comment,S as Fragment,T as NativeRenderer,x as PatchFlags,m as ShapeFlags,_ as Text,G as createRenderer,k as nativeRenderer};
1
+ import{registerDOMOperations as X}from"@lytjs/vdom";var m=(s=>(s[s.ELEMENT=1]="ELEMENT",s[s.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",s[s.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",s[s.TEXT_CHILDREN=8]="TEXT_CHILDREN",s[s.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",s[s.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",s))(m||{}),x=(l=>(l[l.TEXT=1]="TEXT",l[l.CLASS=2]="CLASS",l[l.STYLE=4]="STYLE",l[l.PROPS=8]="PROPS",l[l.FULL_PROPS=16]="FULL_PROPS",l[l.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",l[l.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",l[l.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",l[l.NEED_PATCH=256]="NEED_PATCH",l[l.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",l[l.HOISTED=-1]="HOISTED",l[l.BAIL=-2]="BAIL",l))(x||{}),S=Symbol("Fragment"),_=Symbol("Text"),O=Symbol("Comment");function y(r){return r.type===S}function u(r){return r.type===_}function N(r){return r.type===O}function I(r,e){return r.type===e.type&&r.key===e.key}function V(r){return Array.isArray(r.dynamicChildren)}function w(r,e,t,n){if(t==="class")r.setClass(e,n);else if(t==="style")r.setStyle(e,n);else if(t.startsWith("on")||t.startsWith("@")){let i=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();r.addEventListener(e,i,n)}else t==="key"||t==="ref"||r.setAttribute(e,t,n)}function C(r,e,t,n,i){if(t==="class")r.setClass(e,n);else if(t==="style")r.setStyle(e,n||{});else if(t.startsWith("on")||t.startsWith("@")){let o=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();i&&r.removeEventListener(e,o,i),n&&r.addEventListener(e,o,n)}else r.setAttribute(e,t,n)}function E(r,e,t,n){for(let i in n){if(i==="key"||i==="ref")continue;let o=t[i],s=n[i];s!==o&&C(r,e,i,s,o)}for(let i in t)if(!(i==="key"||i==="ref")&&!(i in n))if(i==="class")r.setClass(e,"");else if(i==="style")r.setStyle(e,{});else if(i.startsWith("on")||i.startsWith("@")){let o=i.startsWith("@")?i.slice(1).toLowerCase():i.slice(2).toLowerCase();r.removeEventListener(e,o,t[i])}else r.removeAttribute(e,i)}function R(r,e,t,n,i,o){let{shapeFlag:s}=t;if(y(t)){P(r,e,t,n,i,o);return}if(u(t)){let a=r.createText(t.children);t.el=a,r.insert(n,a,i);return}if(N(t)){let a=r.createComment(t.children);t.el=a,r.insert(n,a,i);return}if(s&1){M(r,e,t,n,i,o);return}if(s&6){W(e,t,n,i,o);return}}function M(r,e,t,n,i,o){let s=t.type,a=r.createElement(s);if(t.el=a,t.props)for(let c in t.props){let f=t.props[c];w(r,a,c,f)}let{shapeFlag:d,children:p}=t;d&8?a.textContent=p:d&16&&h(e,p,a,null,o),r.insert(n,a,i)}function h(r,e,t,n,i){for(let o=0;o<e.length;o++)r(null,e[o],t,n,i)}function P(r,e,t,n,i,o){let{children:s}=t,a=r.createComment("");r.insert(n,a,i),Array.isArray(s)&&s.length>0&&h(e,s,n,a,o),t.el=a,t.anchor=a}function W(r,e,t,n,i){let o=e.component;o&&o.update&&o.update(),o&&o.subTree&&(r(null,o.subTree,t,n,o),e.el=o.subTree.el)}function D(r,e,t,n){let{shapeFlag:i,children:o}=t;if(y(t)){if(Array.isArray(o))for(let s=0;s<o.length;s++)e(o[s],n);t.anchor&&t.anchor.parentNode&&r.remove(t.anchor);return}if(i&6){t.component&&t.component.subTree&&e(t.component.subTree,n);return}t.el&&r.remove(t.el)}function g(r,e){for(let t=0;t<e.length;t++)r(e[t])}import{patchKeyedChildren as U,patchUnkeyedChildren as j}from"@lytjs/vdom";function v(r,e,t,n,i,o=null,s=null){if(n==null){t&&e(t,i);return}if(t===null){R(r,L(r,e),n,i,o,s);return}if(V(n)&&V(t)){F(r,e,t,n,i,s);return}if(!I(t,n)){e(t,i),R(r,L(r,e),n,i,o,s);return}n.el=t.el,n.anchor=t.anchor;let{shapeFlag:a}=n;if(y(n)){z(r,e,t,n,i,o,s);return}if(u(n)){n.children!==t.children&&(n.el.nodeValue=n.children);return}if(N(n)){n.children!==t.children&&(n.el.nodeValue=n.children);return}if(a&1){B(r,e,t,n,s);return}if(a&6){K(t,n,s);return}}function L(r,e){return(t,n,i,o,s)=>{v(r,e,t,n,i,o,s)}}function B(r,e,t,n,i=null){let o=n.el=t.el,s=t.props||{},a=n.props||{},{patchFlag:d,dynamicProps:p}=n;if(d&&d>0){if(d&1&&t.children!==n.children&&(o.textContent=n.children),d&2&&s.class!==a.class&&r.setClass(o,a.class),d&4&&s.style!==a.style&&r.setStyle(o,a.style||{}),d&8&&p)for(let c=0;c<p.length;c++){let f=p[c],l=s[f],b=a[f];b!==l&&C(r,o,f,b,l)}d&16&&E(r,o,s,a)}else E(r,o,s,a);(!d||!(d&1))&&H(r,e,t,n,o,null,i)}function H(r,e,t,n,i,o,s){let a=t.shapeFlag,d=n.shapeFlag,p=t.children,c=n.children;if(d&8){a&16&&g(e,p),p!==c&&(i.textContent=c);return}if(d&16){a&16?Y(r,e,p,c,i,o,s):(a&8&&(i.textContent=""),h(L(r,e),c,i,o,s));return}c==null&&(a&8?i.textContent="":a&16&&g(e,p))}function Y(r,e,t,n,i,o,s){n.every(d=>d.key!==null&&d.key!==void 0)&&t.every(d=>d.key!==null&&d.key!==void 0)?U(t,n,i,o,s,null,!1):j(t,n,i,o,s,null,!1)}function z(r,e,t,n,i,o,s){let a=t.children,d=n.children;Array.isArray(d)&&d.length>0?(H(r,e,t,n,i,o,s),n.el=d[0].el,n.anchor=d[d.length-1].el?r.nextSibling(d[d.length-1].el):o):Array.isArray(a)&&a.length>0&&d===null?(g(e,a),n.el=t.el,n.anchor=t.anchor):(n.el=t.el,n.anchor=t.anchor)}function F(r,e,t,n,i,o){let s=t.dynamicChildren,a=n.dynamicChildren;for(let d=0;d<a.length;d++)v(r,e,s[d],a[d],i,null,o)}function K(r,e,t){e.component=r.component,e.el=r.el,e.component&&e.component.update&&e.component.update()}function G(r){function e(i,o){D(r,e,i,o)}X({insert(i,o,s){r.insert(o,i,s)},createElement(i){return r.createElement(i)},createText(i){return r.createText(i)},setText(i,o){i.nodeValue=o},setElementText(i,o){i.textContent=o},remove(i){r.remove(i)},createComment(i){return r.createComment(i)},mount(i,o,s,a,d,p,c){n(null,i,o,s,a)},patch(i,o,s,a,d,p,c,f){n(i,o,s,a,d)},unmount(i,o,s,a){e(i)},move(i,o,s){r.insert(o,i.el,s)}});function n(i,o,s,a,d){v(r,e,i,o,s,a,d)}return{mount(i,o){o.nodeType===1&&(o.textContent=""),n(null,i,o,null,null)},patch(i,o,s){var a;n(i,o,s||((a=i.el)==null?void 0:a.parentNode),null,null)},unmount(i,o){e(i,o)}}}var $={div:"View",span:"Text",p:"Text",h1:"Text",h2:"Text",h3:"Text",h4:"Text",h5:"Text",h6:"Text",img:"Image",input:"TextInput",textarea:"TextInput",button:"TouchableOpacity",scroll:"ScrollView",list:"FlatList",a:"TouchableOpacity",ul:"View",ol:"View",li:"View",form:"View",header:"View",footer:"View",nav:"View",main:"View",section:"View",article:"View",aside:"View"},q={flexDirection:"flexDirection",justifyContent:"justifyContent",alignItems:"alignItems",alignSelf:"alignSelf",flexWrap:"flexWrap",flex:"flex",flexGrow:"flexGrow",flexShrink:"flexShrink",flexBasis:"flexBasis",backgroundColor:"backgroundColor",color:"color",fontSize:"fontSize",fontWeight:"fontWeight",fontStyle:"fontStyle",textAlign:"textAlign",lineHeight:"lineHeight",letterSpacing:"letterSpacing",padding:"padding",paddingTop:"paddingTop",paddingBottom:"paddingBottom",paddingLeft:"paddingLeft",paddingRight:"paddingRight",paddingHorizontal:"paddingHorizontal",paddingVertical:"paddingVertical",margin:"margin",marginTop:"marginTop",marginBottom:"marginBottom",marginLeft:"marginLeft",marginRight:"marginRight",marginHorizontal:"marginHorizontal",marginVertical:"marginVertical",width:"width",height:"height",minWidth:"minWidth",maxWidth:"maxWidth",minHeight:"minHeight",maxHeight:"maxHeight",borderRadius:"borderRadius",borderWidth:"borderWidth",borderColor:"borderColor",overflow:"overflow",opacity:"opacity",position:"position",top:"top",left:"left",right:"right",bottom:"bottom",zIndex:"zIndex",shadowColor:"shadowColor",shadowOffset:"shadowOffset",shadowOpacity:"shadowOpacity",shadowRadius:"shadowRadius"},J={click:"onPress",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",change:"onChange",input:"onChangeText",focus:"onFocus",blur:"onBlur",submit:"onSubmitEditing",scroll:"onScroll",longpress:"onLongPress"},Q=0;function A(){return`native_${++Q}`}var T=class{createElement(e){return{type:this.getComponentType(e),props:{},children:[],nativeId:A()}}createText(e){return{type:"RawText",props:{text:e},children:[],nativeId:A()}}createComment(e){return{type:"__Comment",props:{text:e},children:[],nativeId:A()}}setAttribute(e,t,n){if(e){if(t==="style"&&typeof n=="object"&&n!==null){e.props.style={...e.props.style,...this.mapStyle(n)};return}if(t==="className"||t==="class"){e.props.className=n;return}if(t.startsWith("on")&&typeof n=="function"){let i=t.slice(2).toLowerCase(),o=this.mapEvent(i);e.props[o]=n;return}if(t==="src"&&e.type==="Image"){e.props.source={uri:n};return}if(t==="href"){e.props.href=n;return}if(t==="placeholder"){e.props.placeholder=n;return}e.props[t]=n}}removeAttribute(e,t){if(e)if(t==="style")delete e.props.style;else if(t.startsWith("on")){let n=t.slice(2).toLowerCase(),i=this.mapEvent(n);delete e.props[i]}else delete e.props[t]}setStyle(e,t){if(!e)return;let n=this.mapStyle(t);e.props.style={...e.props.style,...n}}setClass(e,t){if(e){if(typeof t=="string")e.props.className=t;else if(typeof t=="object"&&t!==null){let n=[];for(let[i,o]of Object.entries(t))o&&n.push(i);e.props.className=n.join(" ")}}}insert(e,t,n){if(!(!e||!t)){if(t._parent){let i=t._parent,o=i.children.indexOf(t);o!==-1&&i.children.splice(o,1)}if(t._parent=e,n){let i=e.children.indexOf(n);i!==-1?e.children.splice(i,0,t):e.children.push(t)}else e.children.push(t)}}remove(e){if(!e||!e._parent)return;let t=e._parent,n=t.children.indexOf(e);n!==-1&&t.children.splice(n,1),e._parent=void 0}replace(e,t,n){if(!e||!t||!n)return;let i=e.children.indexOf(t);i!==-1&&(t._parent=void 0,n._parent=e,e.children[i]=n)}addEventListener(e,t,n,i){if(!e)return;let o=this.mapEvent(t);e.props[o]=n}removeEventListener(e,t,n){if(!e)return;let i=this.mapEvent(t);e.props[i]===n&&delete e.props[i]}nextTick(e){Promise.resolve().then(()=>e())}parentNode(e){var t;return(t=e==null?void 0:e._parent)!=null?t:null}nextSibling(e){if(!e||!e._parent)return null;let t=e._parent.children,n=t.indexOf(e);return n!==-1&&n+1<t.length?t[n+1]:null}setText(e,t){e&&e.type==="RawText"&&(e.props.text=t)}patchProp(e,t,n,i){if(e){if(i==null){this.removeAttribute(e,t);return}if(t==="style")this.setStyle(e,i);else if(t==="class"||t==="className")this.setClass(e,i);else if(t.startsWith("on")&&typeof i=="function"){let o=t.slice(2).toLowerCase(),s=this.mapEvent(o);e.props[s]=i}else this.setAttribute(e,t,i)}}querySelector(e){let t=e.replace(/[.#\[\]]/g,"").trim();return null}renderToNativeTree(e){if(!e)return this.createComment("empty vnode");if(typeof e=="string")return this.createText(e);if(e.type===Symbol.for("lyt.comment")||e.type==="comment")return this.createComment(e.children||"");if(e.type===Symbol.for("lyt.text")||e.type==="text")return this.createText(e.children||"");if(e.type===Symbol.for("lyt.fragment")||e.type==="fragment"){let t=this.createElement("__Fragment");if(Array.isArray(e.children))for(let n of e.children){let i=this.renderToNativeTree(n);this.insert(t,i)}return t}if(typeof e.type=="string"){let t=this.createElement(e.type);if(e.props)for(let[n,i]of Object.entries(e.props))n==="key"||n==="ref"||this.setAttribute(t,n,i);if(e.children){if(typeof e.children=="string")this.insert(t,this.createText(e.children));else if(Array.isArray(e.children))for(let n of e.children)this.insert(t,this.renderToNativeTree(n))}return t}if(typeof e.type=="object"||typeof e.type=="function"){let t=this.createElement("div");if(Array.isArray(e.children))for(let n of e.children)this.insert(t,this.renderToNativeTree(n));return t}return this.createComment("unknown vnode type")}serializeToJSON(e){let t=n=>{let i={type:n.type,props:{...n.props},children:n.children.map(t)};return n.nativeId&&(i.nativeId=n.nativeId),i};return JSON.stringify(t(e),null,2)}getComponentType(e){return $[e]||Z(e)}mapStyle(e){let t={};for(let[n,i]of Object.entries(e)){let o=q[n]||n;typeof i=="string"&&/^\d+px$/.test(i)?t[o]=parseInt(i,10):t[o]=i}return t}mapEvent(e){return J[e]||`on${e.charAt(0).toUpperCase()}${e.slice(1)}`}};function Z(r){return r.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("")}var k=new T;export{O as Comment,S as Fragment,T as NativeRenderer,x as PatchFlags,m as ShapeFlags,_ as Text,G as createRenderer,k as nativeRenderer};
package/dist/ssr.cjs CHANGED
@@ -1 +1 @@
1
- var W=Object.defineProperty;var Oe=Object.getOwnPropertyDescriptor;var Ie=Object.getOwnPropertyNames;var $e=Object.prototype.hasOwnProperty;var ve=(t,e)=>{for(var n in e)W(t,n,{get:e[n],enumerable:!0})},we=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Ie(e))!$e.call(t,s)&&s!==n&&W(t,s,{get:()=>e[s],enumerable:!(r=Oe(e,s))||r.enumerable});return t};var De=t=>we(W({},"__esModule",{value:!0}),t);var Vt={};ve(Vt,{Comment:()=>Y,Fragment:()=>G,PatchFlags:()=>M,ShapeFlags:()=>C,StringRenderer:()=>_,Text:()=>U,clearIslandRegistry:()=>Ae,clearMismatchWarnings:()=>Me,createHydrationIsland:()=>xe,createRenderer:()=>ye,getHydrateStats:()=>Se,getIslandRegistry:()=>He,getMismatchWarnings:()=>_e,hydrate:()=>Ve,hydrateAllIslands:()=>be,hydrateIsland:()=>se,isHydrating:()=>Ne,onHydrated:()=>Le,registerIslandComponent:()=>Ce,renderToStream:()=>me,renderToStreamGenerator:()=>pe,renderToString:()=>fe,resetHydrateStats:()=>ne,setHydrating:()=>Te,ssrRenderer:()=>ge,unmountIsland:()=>Re});module.exports=De(Vt);var de=require("@lytjs/vdom");var C=(i=>(i[i.ELEMENT=1]="ELEMENT",i[i.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",i[i.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",i[i.TEXT_CHILDREN=8]="TEXT_CHILDREN",i[i.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",i[i.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",i))(C||{}),M=(d=>(d[d.TEXT=1]="TEXT",d[d.CLASS=2]="CLASS",d[d.STYLE=4]="STYLE",d[d.PROPS=8]="PROPS",d[d.FULL_PROPS=16]="FULL_PROPS",d[d.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",d[d.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",d[d.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",d[d.NEED_PATCH=256]="NEED_PATCH",d[d.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",d[d.HOISTED=-1]="HOISTED",d[d.BAIL=-2]="BAIL",d))(M||{}),G=Symbol("Fragment"),U=Symbol("Text"),Y=Symbol("Comment");function R(t){return t.type===G}function O(t){return t.type===U}function I(t){return t.type===Y}function ie(t,e){return t.type===e.type&&t.key===e.key}function X(t){return Array.isArray(t.dynamicChildren)}function ae(t,e,n,r){if(n==="class")t.setClass(e,r);else if(n==="style")t.setStyle(e,r);else if(n.startsWith("on")||n.startsWith("@")){let s=n.startsWith("@")?n.slice(1).toLowerCase():n.slice(2).toLowerCase();t.addEventListener(e,s,r)}else n==="key"||n==="ref"||t.setAttribute(e,n,r)}function z(t,e,n,r,s){if(n==="class")t.setClass(e,r);else if(n==="style")t.setStyle(e,r||{});else if(n.startsWith("on")||n.startsWith("@")){let o=n.startsWith("@")?n.slice(1).toLowerCase():n.slice(2).toLowerCase();s&&t.removeEventListener(e,o,s),r&&t.addEventListener(e,o,r)}else t.setAttribute(e,n,r)}function q(t,e,n,r){for(let s in r){if(s==="key"||s==="ref")continue;let o=n[s],i=r[s];i!==o&&z(t,e,s,i,o)}for(let s in n)if(!(s==="key"||s==="ref")&&!(s in r))if(s==="class")t.setClass(e,"");else if(s==="style")t.setStyle(e,{});else if(s.startsWith("on")||s.startsWith("@")){let o=s.startsWith("@")?s.slice(1).toLowerCase():s.slice(2).toLowerCase();t.removeEventListener(e,o,n[s])}else t.removeAttribute(e,s)}function B(t,e,n,r,s,o){let{shapeFlag:i}=n;if(R(n)){je(t,e,n,r,s,o);return}if(O(n)){let a=t.createText(n.children);n.el=a,t.insert(r,a,s);return}if(I(n)){let a=t.createComment(n.children);n.el=a,t.insert(r,a,s);return}if(i&1){Pe(t,e,n,r,s,o);return}if(i&6){Fe(e,n,r,s,o);return}}function Pe(t,e,n,r,s,o){let i=n.type,a=t.createElement(i);if(n.el=a,n.props)for(let y in n.props){let u=n.props[y];ae(t,a,y,u)}let{shapeFlag:l,children:c}=n;l&8?a.textContent=c:l&16&&$(e,c,a,null,o),t.insert(r,a,s)}function $(t,e,n,r,s){for(let o=0;o<e.length;o++)t(null,e[o],n,r,s)}function je(t,e,n,r,s,o){let{children:i}=n,a=t.createComment("");t.insert(r,a,s),Array.isArray(i)&&i.length>0&&$(e,i,r,a,o),n.el=a,n.anchor=a}function Fe(t,e,n,r,s){let o=e.component;o&&o.update&&o.update(),o&&o.subTree&&(t(null,o.subTree,n,r,o),e.el=o.subTree.el)}function le(t,e,n,r){let{shapeFlag:s,children:o}=n;if(R(n)){if(Array.isArray(o))for(let i=0;i<o.length;i++)e(o[i],r);n.anchor&&n.anchor.parentNode&&t.remove(n.anchor);return}if(s&6){n.component&&n.component.subTree&&e(n.component.subTree,r);return}n.el&&t.remove(n.el)}function v(t,e){for(let n=0;n<e.length;n++)t(e[n])}var w=require("@lytjs/vdom");function D(t,e,n,r,s,o=null,i=null){if(r==null){n&&e(n,s);return}if(n===null){B(t,K(t,e),r,s,o,i);return}if(X(r)&&X(n)){Ue(t,e,n,r,s,i);return}if(!ie(n,r)){e(n,s),B(t,K(t,e),r,s,o,i);return}r.el=n.el,r.anchor=n.anchor;let{shapeFlag:a}=r;if(R(r)){Ge(t,e,n,r,s,o,i);return}if(O(r)){r.children!==n.children&&(r.el.nodeValue=r.children);return}if(I(r)){r.children!==n.children&&(r.el.nodeValue=r.children);return}if(a&1){ke(t,e,n,r,i);return}if(a&6){Ye(n,r,i);return}}function K(t,e){return(n,r,s,o,i)=>{D(t,e,n,r,s,o,i)}}function ke(t,e,n,r,s=null){let o=r.el=n.el,i=n.props||{},a=r.props||{},{patchFlag:l,dynamicProps:c}=r;if(l&&l>0){if(l&1&&n.children!==r.children&&(o.textContent=r.children),l&2&&i.class!==a.class&&t.setClass(o,a.class),l&4&&i.style!==a.style&&t.setStyle(o,a.style||{}),l&8&&c)for(let y=0;y<c.length;y++){let u=c[y],d=i[u],N=a[u];N!==d&&z(t,o,u,N,d)}l&16&&q(t,o,i,a)}else q(t,o,i,a);(!l||!(l&1))&&ce(t,e,n,r,o,null,s)}function ce(t,e,n,r,s,o,i){let a=n.shapeFlag,l=r.shapeFlag,c=n.children,y=r.children;if(l&8){a&16&&v(e,c),c!==y&&(s.textContent=y);return}if(l&16){a&16?We(t,e,c,y,s,o,i):(a&8&&(s.textContent=""),$(K(t,e),y,s,o,i));return}y==null&&(a&8?s.textContent="":a&16&&v(e,c))}function We(t,e,n,r,s,o,i){r.every(l=>l.key!=null)&&n.every(l=>l.key!=null)?(0,w.patchKeyedChildren)(n,r,s,o,i,null,!1):(0,w.patchUnkeyedChildren)(n,r,s,o,i,null,!1)}function Ge(t,e,n,r,s,o,i){let a=n.children,l=r.children;Array.isArray(l)&&l.length>0?(ce(t,e,n,r,s,o,i),r.el=l[0].el,r.anchor=l[l.length-1].el?t.nextSibling(l[l.length-1].el):o):Array.isArray(a)&&a.length>0&&l===null?(v(e,a),r.el=n.el,r.anchor=n.anchor):(r.el=n.el,r.anchor=n.anchor)}function Ue(t,e,n,r,s,o){let i=n.dynamicChildren,a=r.dynamicChildren;for(let l=0;l<a.length;l++)D(t,e,i[l],a[l],s,null,o)}function Ye(t,e,n){e.component=t.component,e.el=t.el,e.component&&e.component.update&&e.component.update()}function ye(t){function e(s,o){le(t,e,s,o)}(0,de.registerDOMOperations)({insert(s,o,i){t.insert(o,s,i)},createElement(s){return t.createElement(s)},createText(s){return t.createText(s)},setText(s,o){s.nodeValue=o},setElementText(s,o){s.textContent=o},remove(s){t.remove(s)},createComment(s){return t.createComment(s)},mount(s,o,i,a,l,c,y){r(null,s,o,i,a)},patch(s,o,i,a,l,c,y,u){r(s,o,i,a,l)},unmount(s,o,i,a){e(s)},move(s,o,i){t.insert(o,s.el,i)}});function r(s,o,i,a,l){D(t,e,s,o,i,a,l)}return{mount(s,o){o.nodeType===1&&(o.textContent=""),r(null,s,o,null,null)},patch(s,o,i){var a;r(s,o,i||((a=s.el)==null?void 0:a.parentNode),null,null)},unmount(s,o){e(s,o)}}}var J=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Xe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ze=/[&<>"']/g,T={ELEMENT:1,FUNCTIONAL_COMPONENT:2,STATEFUL_COMPONENT:4,TEXT_CHILDREN:8,ARRAY_CHILDREN:16,SLOTS_CHILDREN:32},qe=0;function f(t){return t.replace(ze,e=>Xe[e])}function Be(t,e){return t.startsWith("on")||t.startsWith("@")||t==="key"||t==="ref"||t==="__vccOpts"||t.startsWith("__")?"":e===!0?t:e===!1||e===null||e===void 0?"":t==="class"?`class="${f(ue(e))}"`:t==="style"?`style="${f(Ke(e))}"`:t==="dangerouslySetInnerHTML"||t==="innerHTML"?"":`${t}="${f(String(e))}"`}function ue(t){if(!t)return"";if(typeof t=="string")return t;if(Array.isArray(t))return t.map(ue).filter(Boolean).join(" ");if(typeof t=="object"){let e=[];for(let n in t)t[n]&&e.push(n);return e.join(" ")}return String(t)}function Ke(t){if(!t)return"";if(typeof t=="string")return t;if(typeof t=="object"){let e=[];for(let n in t)if(t[n]){let r=n.replace(/([A-Z])/g,"-$1").toLowerCase();e.push(`${r}: ${t[n]}`)}return e.join("; ")}return String(t)}function Z(t){if(!t)return"";let e=[];for(let n in t){let r=t[n],s=Be(n,r);s&&e.push(s)}return e.length>0?" "+e.join(" "):""}var _=class{createElement(e){return{tag:e,props:{},children:[]}}createText(e){return{type:"text",value:e}}createComment(e){return{type:"comment",value:e}}insert(e,n,r){e.children.push(n)}renderToString(e){return m(e)}async*renderToStream(e){yield*P(e)}};function m(t){if(t==null)return"";let{type:e,props:n,children:r}=t;return typeof e=="symbol"&&String(e)==="Symbol(Fragment)"?Array.isArray(r)?r.map(s=>m(s)).join(""):"":typeof e=="symbol"&&String(e).includes("Text")?f(String(r||"")):typeof e=="symbol"&&String(e).includes("Comment")?`<!--${String(r||"")}-->`:typeof e=="string"?Je(e,n,r,t):typeof e=="object"&&e!==null||typeof e=="function"?H(t):""}function Je(t,e,n,r){let s=Z(e);if(J.has(t))return`<${t}${s} />`;if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let a=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;return`<${t}${s}>${a}</${t}>`}let o="",i=r.shapeFlag||0;return i&T.TEXT_CHILDREN?o=f(String(n||"")):i&T.ARRAY_CHILDREN&&Array.isArray(n)?o=n.map(a=>m(a)).join(""):i&T.SLOTS_CHILDREN&&typeof n=="object"&&n!==null?o=Q(n):typeof n=="string"?o=f(n):Array.isArray(n)?o=n.map(a=>m(a)).join(""):typeof n=="number"&&(o=f(String(n))),`<${t}${s}>${o}</${t}>`}function Q(t){let e=[];for(let n in t){let r=t[n];if(typeof r=="function"){let s=r();Array.isArray(s)?e.push(s.map(o=>m(o)).join("")):s!=null&&e.push(m(s))}else Array.isArray(r)?e.push(r.map(s=>m(s)).join("")):r!=null&&e.push(m(r))}return e.join("")}function H(t){let e=t.type;if(e&&e.__island)return Ze(t,e);if(typeof e=="function"){let n=e(t.props||{},{slots:t.children||{}});return m(n)}if(typeof e=="object"&&e!==null){if(typeof e.render=="function"){let n=e.render(t.props||{},{slots:t.children||{},emit:()=>{}});return m(n)}if(typeof e.setup=="function"){let n=e.setup(t.props||{},{emit:()=>{},slots:t.children||{}});if(typeof n=="function"){let r=n();return m(r)}if(typeof e.render=="function"){let r=e.render(n||{},{slots:t.children||{},emit:()=>{}});return m(r)}}}return t.component&&t.component.subTree?m(t.component.subTree):"<!---->"}function Ze(t,e){var N;let n=e.name||((N=t.props)==null?void 0:N["data-island-id"])||"anonymous",r=t.props||{},s=r["data-hydrate-when"]||e.__hydrateWhen||"",o=e.__islandTag||"div",i={};for(let g in r)g==="data-hydrate-when"||g==="data-island-id"||(i[g]=r[g]);let a=JSON.stringify(i),l=f(a),c="";if(typeof e.render=="function"){let g=e.render(r,{slots:t.children||{},emit:()=>{}});c=m(g)}else if(typeof e=="function"){let g=e(r,{slots:t.children||{}});c=m(g)}let y=s?` data-hydrate-when="${f(s)}"`:"",u=`<${o} data-hydrate="${f(n)}" data-props="${l}"${y}>${c}</${o}>`,d=`<script type="application/json" data-hydrate-props="${f(n)}">${a}<\/script>`;return u+d}async function*P(t){if(t==null)return;let{type:e,props:n,children:r}=t;if(typeof e=="symbol"&&String(e)==="Symbol(Fragment)"){if(Array.isArray(r))for(let s of r)yield*P(s);return}if(typeof e=="symbol"&&String(e).includes("Text")){yield f(String(r||""));return}if(typeof e=="symbol"&&String(e).includes("Comment")){yield`<!--${String(r||"")}-->`;return}if(typeof e=="string"){yield*Qe(e,n,r,t);return}if(typeof e=="object"||typeof e=="function"){yield H(t);return}}async function*Qe(t,e,n,r){let s=Z(e);if(J.has(t)){yield`<${t}${s} />`;return}if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let i=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;yield`<${t}${s}>${i}</${t}>`;return}yield`<${t}${s}>`;let o=r.shapeFlag||0;if(o&T.TEXT_CHILDREN)yield f(String(n||""));else if(o&T.ARRAY_CHILDREN&&Array.isArray(n))for(let i of n)yield*P(i);else if(o&T.SLOTS_CHILDREN&&typeof n=="object"&&n!==null)yield Q(n);else if(typeof n=="string")yield f(n);else if(Array.isArray(n))for(let i of n)yield*P(i);else typeof n=="number"&&(yield f(String(n)));yield`</${t}>`}function fe(t){return m(t)}function me(t,e){let n=(e==null?void 0:e.suspenseIdPrefix)||"suspense",r=S(t,n);return new ReadableStream({async pull(s){let{value:o,done:i}=await r.next();i?s.close():s.enqueue(o)},async cancel(){await r.return(void 0)}})}async function*pe(t,e){let n=(e==null?void 0:e.suspenseIdPrefix)||"suspense";yield*S(t,n)}async function*S(t,e){if(t==null)return;let{type:n,props:r,children:s}=t;if(typeof n=="symbol"&&String(n)==="Symbol(Fragment)"){if(Array.isArray(s))for(let o of s)yield*S(o,e);return}if(typeof n=="symbol"&&String(n).includes("Text")){yield f(String(s||""));return}if(typeof n=="symbol"&&String(n).includes("Comment")){yield`<!--${String(s||"")}-->`;return}if(typeof n=="string"){yield*et(n,r,s,t,e);return}if(typeof n=="object"&&n!==null){let o=n;if(o.name==="Suspense"||o._isSuspense){yield*tt(t,e);return}if(o._isAsyncComponent||o.__asyncSetup){yield*nt(t,e);return}yield H(t);return}if(typeof n=="function"){yield H(t);return}}async function*et(t,e,n,r,s){let o=Z(e);if(J.has(t)){yield`<${t}${o} />`;return}if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let a=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;yield`<${t}${o}>${a}</${t}>`;return}yield`<${t}${o}>`;let i=r.shapeFlag||0;if(i&T.TEXT_CHILDREN)yield f(String(n||""));else if(i&T.ARRAY_CHILDREN&&Array.isArray(n))for(let a of n)yield*S(a,s);else if(i&T.SLOTS_CHILDREN&&typeof n=="object"&&n!==null)yield Q(n);else if(typeof n=="string")yield f(n);else if(Array.isArray(n))for(let a of n)yield*S(a,s);else typeof n=="number"&&(yield f(String(n)));yield`</${t}>`}async function*tt(t,e){let n=`${e}-${qe++}`,r=t.type,o=(t.props||{}).fallback,i="";o&&(typeof o=="object"&&o!==null?i=m(o):typeof o=="string"&&(i=o));let a=t.children,l=[];if(typeof a=="object"&&a!==null){if(Array.isArray(a))l=a;else if(typeof a.default=="function"){let u=a.default();Array.isArray(u)?l=u:u!=null&&(l=[u])}}let c=[];function y(u){for(let d of u){if(d==null)continue;let N=d.type;if(N&&(N._isAsyncComponent||N.__asyncSetup||d.__asyncSetup)){let g=d.__asyncPromise||N.__asyncPromise;g&&c.push(g.then(()=>{}))}}}if(y(l),c.length===0){for(let u of l)yield*S(u,e);return}yield`<!--${n}-fallback-->`,yield i,await Promise.all(c),yield`<!--${n}-resolved-->`;for(let u of l)yield*S(u,e);yield`<!--/${n}-->`}async function*nt(t,e){let n=t.type,r=t.__asyncPromise||n.__asyncPromise;if(r)try{await r}catch(s){yield"<!--async-component-error-->";return}yield H(t)}var ge=new _;var F={ELEMENT:1,FUNCTIONAL_COMPONENT:2,STATEFUL_COMPONENT:4,TEXT_CHILDREN:8,ARRAY_CHILDREN:16,SLOTS_CHILDREN:32},h=!1,te=[],p={success:!0,mismatches:0,hydratedNodes:0};function Ne(){return h}function Te(t){h=t}function Se(){return{...p}}function ne(){p={success:!0,mismatches:0,hydratedNodes:0}}function Le(t){h?te.push(t):t()}function Ve(t,e,n={}){ne(),n.onHydrated&&te.push(n.onHydrated),h=!0;try{let r=e.firstElementChild;return r?(t._vnode||t.mount(e),t._vnode&&V(r,t._vnode,n),h=!1,ee(),p):(h=!1,t.mount(e),p.success=!1,ee(),p)}catch(r){return h=!1,p.success=!1,e.innerHTML="",t.mount(e),ee(),p}}function ee(){let t=te.splice(0);for(let e of t)try{e()}catch(n){}}function V(t,e,n){if(dt(e)){it(t,e,n);return}if(yt(e)){st(t,e,n);return}if(ut(e)){ot(t,e,n);return}if(ft(e)){at(t,e,n);return}if(typeof e.type=="string"){rt(t,e,n);return}}function rt(t,e,n){let r=t.tagName.toLowerCase(),s=e.type.toLowerCase();if(r!==s){k(t,e,`\u6807\u7B7E\u4E0D\u5339\u914D: DOM "${r}" vs VNode "${s}"`,n);return}e.el=t,e.props&&re(t,e.props),e.ref&&ct(t,e.ref),lt(t,e,n),p.hydratedNodes++}function st(t,e,n){if(t.nodeType!==3){k(t,e,"\u671F\u671B\u6587\u672C\u8282\u70B9",n);return}e.el=t;let r=t.nodeValue||"",s=String(e.children||"");r!==s&&(t.nodeValue=s,n.strict),p.hydratedNodes++}function ot(t,e,n){if(t.nodeType!==8){k(t,e,"\u671F\u671B\u6CE8\u91CA\u8282\u70B9",n);return}e.el=t;let r=t.nodeValue||"",s=String(e.children||"");r!==s&&(t.nodeValue=s),p.hydratedNodes++}function it(t,e,n){if(!Array.isArray(e.children))return;let r=Array.from(t.childNodes);for(let s=0;s<e.children.length;s++){let o=e.children[s],i=r[s];if(!i){p.mismatches++;break}V(i,o,n)}}function at(t,e,n){if(e.component&&e.component.subTree){V(t,e.component.subTree,n),e.el=e.component.subTree.el;return}let r=e.type;if(typeof r=="function")try{let s=r(e.props||{},{slots:e.children||{}});if(s){V(t,s,n),e.el=s.el;return}}catch(s){}if(typeof r=="object"&&r!==null&&typeof r.render=="function")try{let s=r.render(e.props||{},{slots:e.children||{},emit:()=>{}});if(s){V(t,s,n),e.el=s.el;return}}catch(s){}k(t,e,"\u7EC4\u4EF6\u65E0\u6CD5\u83B7\u53D6 subTree",n)}function lt(t,e,n){if(!e.children)return;let r=e.shapeFlag||0;if(typeof e.children=="string"||r&F.TEXT_CHILDREN){let s=t.textContent||"",o=String(e.children||"");s!==o&&(t.textContent=o,n.strict);return}if(Array.isArray(e.children)){let s=Array.from(t.childNodes),o=0;for(let i=0;i<s.length&&o<e.children.length;i++){let a=e.children[o];if(a==null){o++;continue}V(s[i],a,n),o++}o<e.children.length&&p.mismatches++}r&F.SLOTS_CHILDREN&&typeof e.children=="object"&&e.children}function re(t,e){for(let n in e){let r=e[n];if(n.startsWith("on")&&typeof r=="function"){let s=n.slice(2).toLowerCase();t.addEventListener(s,r)}}}function ct(t,e){typeof e=="function"?e(t):e&&typeof e=="object"&&(e.current=t)}function dt(t){return typeof t.type=="symbol"&&String(t.type)==="Symbol(Fragment)"}function yt(t){return typeof t.type=="symbol"&&String(t.type).includes("Text")}function ut(t){return typeof t.type=="symbol"&&String(t.type).includes("Comment")}function ft(t){return!!((t.shapeFlag||0)&(F.STATEFUL_COMPONENT|F.FUNCTIONAL_COMPONENT)||typeof t.type=="object"&&t.type!==null||typeof t.type=="function")}function k(t,e,n,r){let s=`[lyt] \u6CE8\u6C34\u4E0D\u5339\u914D: ${n}`;if(p.mismatches++,r.strict)throw new Error(s)}var b=new Map,x=new Map,mt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},pt=/[&<>"']/g;function E(t){return t.replace(pt,e=>mt[e])}function se(t,e,n={}){let r=typeof document!="undefined"?document:null;if(!r)return{success:!1,mismatches:0,hydratedNodes:0};let s=r.querySelector(t);if(!s)return{success:!1,mismatches:0,hydratedNodes:0};let o=s.getAttribute("data-hydrate");if(!o)return{success:!1,mismatches:0,hydratedNodes:0};if(s.hasAttribute("data-hydrated"))return{success:!0,mismatches:0,hydratedNodes:0};let i=gt(o,r);if(i===null)return{success:!1,mismatches:0,hydratedNodes:0};let a=s.getAttribute("data-hydrate-when");return a||n.lazy?ht(s,o,e,i,a||"visible",n):L(s,o,e,i,n)}function gt(t,e){let n=e.querySelector(`script[type="application/json"][data-hydrate-props="${t}"]`);if(!n){let r=e.querySelector(`[data-hydrate="${t}"]`);if(r){let s=r.getAttribute("data-props");if(s)try{return JSON.parse(s)}catch(o){return null}}return{}}try{return JSON.parse(n.textContent||"{}")}catch(r){return null}}function L(t,e,n,r,s){let o={success:!0,mismatches:0,hydratedNodes:0};try{h=!0;let i=null;if(typeof n.render=="function")i=n.render(r,{slots:n.slots||{},emit:()=>{}});else if(typeof n.setup=="function"){let l=n.setup(r,{emit:()=>{},slots:n.slots||{}});typeof l=="function"&&(i=l())}if(!i)return h=!1,o.success=!1,o;if(s.dev!==!1){let l=Tt(t,i,e);o.mismatches=l}V(t,i,s),o.hydratedNodes=p.hydratedNodes,i.props&&re(t,i.props),j(t,i),t.setAttribute("data-hydrated","");let a={id:e,hydrated:!0,instance:n,eventListeners:[],timeoutId:null,observer:null,interactionHandler:null};return b.set(e,a),x.set(e,n),h=!1,s.onHydrated&&s.onHydrated(),o}catch(i){return h=!1,o.success=!1,o}}function j(t,e){if(!(!e.children||typeof e.children=="string")&&Array.isArray(e.children)){let n=Array.from(t.children),r=0;for(let s=0;s<n.length&&r<e.children.length;s++){let o=e.children[r];if(o==null){r++;continue}if(typeof o.type=="string"&&o.props)re(n[s],o.props),j(n[s],o);else if(typeof o.type=="object"||typeof o.type=="function"){let i=o.type;if(typeof i=="function")try{let a=i(o.props||{},{slots:o.children||{}});a&&n[s]&&j(n[s],a)}catch(a){}else if(i&&typeof i.render=="function")try{let a=i.render(o.props||{},{slots:o.children||{},emit:()=>{}});a&&n[s]&&j(n[s],a)}catch(a){}}r++}}}function ht(t,e,n,r,s,o){let i={success:!0,mismatches:0,hydratedNodes:0},a=null;o.timeout&&o.timeout>0&&(a=setTimeout(()=>{Ee(t,e),L(t,e,n,r,o)},o.timeout));let l={id:e,hydrated:!1,instance:n,eventListeners:[],timeoutId:a,observer:null,interactionHandler:null};switch(b.set(e,l),x.set(e,n),s){case"visible":{if(typeof IntersectionObserver!="undefined"){let c=new IntersectionObserver(y=>{for(let u of y)u.isIntersecting&&(c.unobserve(u.target),l.observer=null,a&&clearTimeout(a),l.timeoutId=null,L(t,e,n,r,o))},{rootMargin:"200px"});c.observe(t),l.observer=c}else a&&clearTimeout(a),L(t,e,n,r,o);break}case"idle":{(y=>{typeof requestIdleCallback!="undefined"?requestIdleCallback(y,{timeout:o.timeout||2e3}):setTimeout(y,1)})(()=>{a&&clearTimeout(a),l.timeoutId=null,t.hasAttribute("data-hydrated")||L(t,e,n,r,o)});break}case"interaction":{let c=()=>{a&&clearTimeout(a),l.timeoutId=null,l.interactionHandler=null,document.removeEventListener("click",c),document.removeEventListener("keydown",c),document.removeEventListener("scroll",c),document.removeEventListener("touchstart",c),t.hasAttribute("data-hydrated")||L(t,e,n,r,o)};document.addEventListener("click",c,{once:!1,passive:!0}),document.addEventListener("keydown",c,{once:!1,passive:!0}),document.addEventListener("scroll",c,{once:!1,passive:!0}),document.addEventListener("touchstart",c,{once:!1,passive:!0}),l.interactionHandler=c;break}default:a&&clearTimeout(a),L(t,e,n,r,o)}return i}function Ee(t,e){let n=b.get(e);n&&(n.observer&&(n.observer.disconnect(),n.observer=null),n.timeoutId!==null&&(clearTimeout(n.timeoutId),n.timeoutId=null),n.interactionHandler&&(document.removeEventListener("click",n.interactionHandler),document.removeEventListener("keydown",n.interactionHandler),document.removeEventListener("scroll",n.interactionHandler),document.removeEventListener("touchstart",n.interactionHandler),n.interactionHandler=null))}function be(t={}){let e=typeof document!="undefined"?document:null;if(!e)return{success:!1,mismatches:0,hydratedNodes:0};let n=e.querySelectorAll("[data-hydrate]:not([data-hydrated])"),r={success:!0,mismatches:0,hydratedNodes:0};return n.forEach(s=>{let o=s.getAttribute("data-hydrate"),i=x.get(o);if(!i){r.success=!1;return}let a=se(`[data-hydrate="${o}"]`,i,t);r.mismatches+=a.mismatches,r.hydratedNodes+=a.hydratedNodes,a.success||(r.success=!1)}),r}function Ce(t,e){x.set(t,e)}function Re(t){if(!b.get(t))return;let n=typeof document!="undefined"?document.querySelector(`[data-hydrate="${t}"]`):null;n&&(Ee(n,t),n.removeAttribute("data-hydrated")),b.delete(t),x.delete(t)}function He(){return b}function Ae(){b.clear(),x.clear()}function xe(t,e={},n="div",r){let s=t.name||"anonymous",o=JSON.stringify(e),i=E(o),a="";if(typeof t.render=="function"){let u=t.render(e,{slots:t.slots||{},emit:()=>{}});a=A(u)}let l=r?` data-hydrate-when="${r}"`:"",c=`<${n} data-hydrate="${s}" data-props="${i}"${l}>${a}</${n}>`,y=`<script type="application/json" data-hydrate-props="${s}">${o}<\/script>`;return c+y}function A(t){if(t==null)return"";let{type:e,props:n,children:r}=t;if(typeof e=="symbol"&&String(e)==="Symbol(Fragment)")return Array.isArray(r)?r.map(s=>A(s)).join(""):"";if(typeof e=="symbol"&&String(e).includes("Text"))return E(String(r||""));if(typeof e=="symbol"&&String(e).includes("Comment"))return`<!--${String(r||"")}-->`;if(typeof e=="string"){let s=Nt(n);if(new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]).has(e))return`<${e}${s} />`;let i="";return typeof r=="string"?i=E(r):Array.isArray(r)?i=r.map(a=>A(a)).join(""):typeof r=="number"&&(i=E(String(r))),`<${e}${s}>${i}</${e}>`}if(typeof e=="function"){let s=e(n||{},{slots:r||{}});return A(s)}if(typeof e=="object"&&e!==null){let s=e;if(typeof s.render=="function"){let o=s.render(n||{},{slots:r||{},emit:()=>{}});return A(o)}}return""}function Nt(t){if(!t)return"";let e=[];for(let n in t){let r=t[n];if(!(n.startsWith("on")||n.startsWith("@")||n==="key"||n==="ref")&&!(n==="__vccOpts"||n.startsWith("__"))&&!(n==="dangerouslySetInnerHTML"||n==="innerHTML"))if(r===!0)e.push(n);else{if(r===!1||r===null||r===void 0)continue;n==="class"&&typeof r=="string"?e.push(`class="${E(r)}"`):n==="style"&&typeof r=="string"?e.push(`style="${E(r)}"`):e.push(`${n}="${E(String(r))}"`)}}return e.length>0?" "+e.join(" "):""}var oe=[];function Tt(t,e,n){let r=0,s=St(t),o=A(e);if(s!==o){r++;let i={islandId:n,expected:o,actual:s,suggestion:Lt(s,o,n)};oe.push(i)}return r}function St(t){let e=t.cloneNode(!0);return e.removeAttribute("data-hydrate"),e.removeAttribute("data-props"),e.removeAttribute("data-hydrate-when"),e.removeAttribute("data-hydrated"),e.innerHTML}function Lt(t,e,n){if(t.trim()==="")return`\u670D\u52A1\u7AEF\u6E32\u67D3\u4E3A\u7A7A\uFF0C\u8BF7\u68C0\u67E5\u7EC4\u4EF6 "${n}" \u7684\u670D\u52A1\u7AEF\u6E32\u67D3\u903B\u8F91`;if(e.trim()==="")return`\u5BA2\u6237\u7AEF\u6E32\u67D3\u4E3A\u7A7A\uFF0C\u8BF7\u68C0\u67E5\u7EC4\u4EF6 "${n}" \u7684 render \u51FD\u6570`;let r=/\d{10,13}/;return r.test(t)||r.test(e)?"\u68C0\u6D4B\u5230\u65F6\u95F4\u6233\u5DEE\u5F02\uFF0C\u8003\u8651\u4F7F\u7528\u7EDF\u4E00\u7684\u65F6\u95F4\u6E90\u6216\u5EF6\u8FDF\u6CE8\u6C34":he(t)===he(e)?"HTML \u5185\u5BB9\u76F8\u540C\u4F46\u5C5E\u6027\u987A\u5E8F\u4E0D\u540C\uFF0C\u8FD9\u4E0D\u5F71\u54CD\u529F\u80FD\u4F46\u53EF\u80FD\u5BFC\u81F4 mismatch \u8B66\u544A":`\u8BF7\u786E\u4FDD\u7EC4\u4EF6 "${n}" \u5728\u670D\u52A1\u7AEF\u548C\u5BA2\u6237\u7AEF\u6E32\u67D3\u76F8\u540C\u7684\u8F93\u51FA`}function he(t){return t.replace(/\s+/g," ").replace(/>\s+</g,"><").trim()}function _e(){return[...oe]}function Me(){oe.length=0}
1
+ var W=Object.defineProperty;var Oe=Object.getOwnPropertyDescriptor;var Ie=Object.getOwnPropertyNames;var $e=Object.prototype.hasOwnProperty;var ve=(t,e)=>{for(var n in e)W(t,n,{get:e[n],enumerable:!0})},we=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Ie(e))!$e.call(t,s)&&s!==n&&W(t,s,{get:()=>e[s],enumerable:!(r=Oe(e,s))||r.enumerable});return t};var De=t=>we(W({},"__esModule",{value:!0}),t);var Vt={};ve(Vt,{Comment:()=>Y,Fragment:()=>G,PatchFlags:()=>M,ShapeFlags:()=>C,StringRenderer:()=>_,Text:()=>U,clearIslandRegistry:()=>Ae,clearMismatchWarnings:()=>Me,createHydrationIsland:()=>xe,createRenderer:()=>ye,getHydrateStats:()=>Se,getIslandRegistry:()=>He,getMismatchWarnings:()=>_e,hydrate:()=>Ve,hydrateAllIslands:()=>be,hydrateIsland:()=>se,isHydrating:()=>Ne,onHydrated:()=>Le,registerIslandComponent:()=>Ce,renderToStream:()=>me,renderToStreamGenerator:()=>pe,renderToString:()=>fe,resetHydrateStats:()=>ne,setHydrating:()=>Te,ssrRenderer:()=>ge,unmountIsland:()=>Re});module.exports=De(Vt);var de=require("@lytjs/vdom");var C=(i=>(i[i.ELEMENT=1]="ELEMENT",i[i.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",i[i.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",i[i.TEXT_CHILDREN=8]="TEXT_CHILDREN",i[i.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",i[i.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",i))(C||{}),M=(d=>(d[d.TEXT=1]="TEXT",d[d.CLASS=2]="CLASS",d[d.STYLE=4]="STYLE",d[d.PROPS=8]="PROPS",d[d.FULL_PROPS=16]="FULL_PROPS",d[d.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",d[d.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",d[d.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",d[d.NEED_PATCH=256]="NEED_PATCH",d[d.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",d[d.HOISTED=-1]="HOISTED",d[d.BAIL=-2]="BAIL",d))(M||{}),G=Symbol("Fragment"),U=Symbol("Text"),Y=Symbol("Comment");function R(t){return t.type===G}function O(t){return t.type===U}function I(t){return t.type===Y}function ie(t,e){return t.type===e.type&&t.key===e.key}function X(t){return Array.isArray(t.dynamicChildren)}function ae(t,e,n,r){if(n==="class")t.setClass(e,r);else if(n==="style")t.setStyle(e,r);else if(n.startsWith("on")||n.startsWith("@")){let s=n.startsWith("@")?n.slice(1).toLowerCase():n.slice(2).toLowerCase();t.addEventListener(e,s,r)}else n==="key"||n==="ref"||t.setAttribute(e,n,r)}function z(t,e,n,r,s){if(n==="class")t.setClass(e,r);else if(n==="style")t.setStyle(e,r||{});else if(n.startsWith("on")||n.startsWith("@")){let o=n.startsWith("@")?n.slice(1).toLowerCase():n.slice(2).toLowerCase();s&&t.removeEventListener(e,o,s),r&&t.addEventListener(e,o,r)}else t.setAttribute(e,n,r)}function q(t,e,n,r){for(let s in r){if(s==="key"||s==="ref")continue;let o=n[s],i=r[s];i!==o&&z(t,e,s,i,o)}for(let s in n)if(!(s==="key"||s==="ref")&&!(s in r))if(s==="class")t.setClass(e,"");else if(s==="style")t.setStyle(e,{});else if(s.startsWith("on")||s.startsWith("@")){let o=s.startsWith("@")?s.slice(1).toLowerCase():s.slice(2).toLowerCase();t.removeEventListener(e,o,n[s])}else t.removeAttribute(e,s)}function B(t,e,n,r,s,o){let{shapeFlag:i}=n;if(R(n)){je(t,e,n,r,s,o);return}if(O(n)){let a=t.createText(n.children);n.el=a,t.insert(r,a,s);return}if(I(n)){let a=t.createComment(n.children);n.el=a,t.insert(r,a,s);return}if(i&1){Pe(t,e,n,r,s,o);return}if(i&6){Fe(e,n,r,s,o);return}}function Pe(t,e,n,r,s,o){let i=n.type,a=t.createElement(i);if(n.el=a,n.props)for(let y in n.props){let u=n.props[y];ae(t,a,y,u)}let{shapeFlag:l,children:c}=n;l&8?a.textContent=c:l&16&&$(e,c,a,null,o),t.insert(r,a,s)}function $(t,e,n,r,s){for(let o=0;o<e.length;o++)t(null,e[o],n,r,s)}function je(t,e,n,r,s,o){let{children:i}=n,a=t.createComment("");t.insert(r,a,s),Array.isArray(i)&&i.length>0&&$(e,i,r,a,o),n.el=a,n.anchor=a}function Fe(t,e,n,r,s){let o=e.component;o&&o.update&&o.update(),o&&o.subTree&&(t(null,o.subTree,n,r,o),e.el=o.subTree.el)}function le(t,e,n,r){let{shapeFlag:s,children:o}=n;if(R(n)){if(Array.isArray(o))for(let i=0;i<o.length;i++)e(o[i],r);n.anchor&&n.anchor.parentNode&&t.remove(n.anchor);return}if(s&6){n.component&&n.component.subTree&&e(n.component.subTree,r);return}n.el&&t.remove(n.el)}function v(t,e){for(let n=0;n<e.length;n++)t(e[n])}var w=require("@lytjs/vdom");function D(t,e,n,r,s,o=null,i=null){if(r==null){n&&e(n,s);return}if(n===null){B(t,K(t,e),r,s,o,i);return}if(X(r)&&X(n)){Ue(t,e,n,r,s,i);return}if(!ie(n,r)){e(n,s),B(t,K(t,e),r,s,o,i);return}r.el=n.el,r.anchor=n.anchor;let{shapeFlag:a}=r;if(R(r)){Ge(t,e,n,r,s,o,i);return}if(O(r)){r.children!==n.children&&(r.el.nodeValue=r.children);return}if(I(r)){r.children!==n.children&&(r.el.nodeValue=r.children);return}if(a&1){ke(t,e,n,r,i);return}if(a&6){Ye(n,r,i);return}}function K(t,e){return(n,r,s,o,i)=>{D(t,e,n,r,s,o,i)}}function ke(t,e,n,r,s=null){let o=r.el=n.el,i=n.props||{},a=r.props||{},{patchFlag:l,dynamicProps:c}=r;if(l&&l>0){if(l&1&&n.children!==r.children&&(o.textContent=r.children),l&2&&i.class!==a.class&&t.setClass(o,a.class),l&4&&i.style!==a.style&&t.setStyle(o,a.style||{}),l&8&&c)for(let y=0;y<c.length;y++){let u=c[y],d=i[u],N=a[u];N!==d&&z(t,o,u,N,d)}l&16&&q(t,o,i,a)}else q(t,o,i,a);(!l||!(l&1))&&ce(t,e,n,r,o,null,s)}function ce(t,e,n,r,s,o,i){let a=n.shapeFlag,l=r.shapeFlag,c=n.children,y=r.children;if(l&8){a&16&&v(e,c),c!==y&&(s.textContent=y);return}if(l&16){a&16?We(t,e,c,y,s,o,i):(a&8&&(s.textContent=""),$(K(t,e),y,s,o,i));return}y==null&&(a&8?s.textContent="":a&16&&v(e,c))}function We(t,e,n,r,s,o,i){r.every(l=>l.key!==null&&l.key!==void 0)&&n.every(l=>l.key!==null&&l.key!==void 0)?(0,w.patchKeyedChildren)(n,r,s,o,i,null,!1):(0,w.patchUnkeyedChildren)(n,r,s,o,i,null,!1)}function Ge(t,e,n,r,s,o,i){let a=n.children,l=r.children;Array.isArray(l)&&l.length>0?(ce(t,e,n,r,s,o,i),r.el=l[0].el,r.anchor=l[l.length-1].el?t.nextSibling(l[l.length-1].el):o):Array.isArray(a)&&a.length>0&&l===null?(v(e,a),r.el=n.el,r.anchor=n.anchor):(r.el=n.el,r.anchor=n.anchor)}function Ue(t,e,n,r,s,o){let i=n.dynamicChildren,a=r.dynamicChildren;for(let l=0;l<a.length;l++)D(t,e,i[l],a[l],s,null,o)}function Ye(t,e,n){e.component=t.component,e.el=t.el,e.component&&e.component.update&&e.component.update()}function ye(t){function e(s,o){le(t,e,s,o)}(0,de.registerDOMOperations)({insert(s,o,i){t.insert(o,s,i)},createElement(s){return t.createElement(s)},createText(s){return t.createText(s)},setText(s,o){s.nodeValue=o},setElementText(s,o){s.textContent=o},remove(s){t.remove(s)},createComment(s){return t.createComment(s)},mount(s,o,i,a,l,c,y){r(null,s,o,i,a)},patch(s,o,i,a,l,c,y,u){r(s,o,i,a,l)},unmount(s,o,i,a){e(s)},move(s,o,i){t.insert(o,s.el,i)}});function r(s,o,i,a,l){D(t,e,s,o,i,a,l)}return{mount(s,o){o.nodeType===1&&(o.textContent=""),r(null,s,o,null,null)},patch(s,o,i){var a;r(s,o,i||((a=s.el)==null?void 0:a.parentNode),null,null)},unmount(s,o){e(s,o)}}}var J=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Xe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ze=/[&<>"']/g,T={ELEMENT:1,FUNCTIONAL_COMPONENT:2,STATEFUL_COMPONENT:4,TEXT_CHILDREN:8,ARRAY_CHILDREN:16,SLOTS_CHILDREN:32},qe=0;function f(t){return t.replace(ze,e=>Xe[e])}function Be(t,e){return t.startsWith("on")||t.startsWith("@")||t==="key"||t==="ref"||t==="__vccOpts"||t.startsWith("__")?"":e===!0?t:e===!1||e===null||e===void 0?"":t==="class"?`class="${f(ue(e))}"`:t==="style"?`style="${f(Ke(e))}"`:t==="dangerouslySetInnerHTML"||t==="innerHTML"?"":`${t}="${f(String(e))}"`}function ue(t){if(!t)return"";if(typeof t=="string")return t;if(Array.isArray(t))return t.map(ue).filter(Boolean).join(" ");if(typeof t=="object"){let e=[];for(let n in t)t[n]&&e.push(n);return e.join(" ")}return String(t)}function Ke(t){if(!t)return"";if(typeof t=="string")return t;if(typeof t=="object"){let e=[];for(let n in t)if(t[n]){let r=n.replace(/([A-Z])/g,"-$1").toLowerCase();e.push(`${r}: ${t[n]}`)}return e.join("; ")}return String(t)}function Z(t){if(!t)return"";let e=[];for(let n in t){let r=t[n],s=Be(n,r);s&&e.push(s)}return e.length>0?" "+e.join(" "):""}var _=class{createElement(e){return{tag:e,props:{},children:[]}}createText(e){return{type:"text",value:e}}createComment(e){return{type:"comment",value:e}}insert(e,n,r){e.children.push(n)}renderToString(e){return m(e)}async*renderToStream(e){yield*P(e)}};function m(t){if(t==null)return"";let{type:e,props:n,children:r}=t;return typeof e=="symbol"&&String(e)==="Symbol(Fragment)"?Array.isArray(r)?r.map(s=>m(s)).join(""):"":typeof e=="symbol"&&String(e).includes("Text")?f(String(r||"")):typeof e=="symbol"&&String(e).includes("Comment")?`<!--${String(r||"")}-->`:typeof e=="string"?Je(e,n,r,t):typeof e=="object"&&e!==null||typeof e=="function"?H(t):""}function Je(t,e,n,r){let s=Z(e);if(J.has(t))return`<${t}${s} />`;if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let a=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;return`<${t}${s}>${a}</${t}>`}let o="",i=r.shapeFlag||0;return i&T.TEXT_CHILDREN?o=f(String(n||"")):i&T.ARRAY_CHILDREN&&Array.isArray(n)?o=n.map(a=>m(a)).join(""):i&T.SLOTS_CHILDREN&&typeof n=="object"&&n!==null?o=Q(n):typeof n=="string"?o=f(n):Array.isArray(n)?o=n.map(a=>m(a)).join(""):typeof n=="number"&&(o=f(String(n))),`<${t}${s}>${o}</${t}>`}function Q(t){let e=[];for(let n in t){let r=t[n];if(typeof r=="function"){let s=r();Array.isArray(s)?e.push(s.map(o=>m(o)).join("")):s!=null&&e.push(m(s))}else Array.isArray(r)?e.push(r.map(s=>m(s)).join("")):r!=null&&e.push(m(r))}return e.join("")}function H(t){let e=t.type;if(e&&e.__island)return Ze(t,e);if(typeof e=="function"){let n=e(t.props||{},{slots:t.children||{}});return m(n)}if(typeof e=="object"&&e!==null){if(typeof e.render=="function"){let n=e.render(t.props||{},{slots:t.children||{},emit:()=>{}});return m(n)}if(typeof e.setup=="function"){let n=e.setup(t.props||{},{emit:()=>{},slots:t.children||{}});if(typeof n=="function"){let r=n();return m(r)}if(typeof e.render=="function"){let r=e.render(n||{},{slots:t.children||{},emit:()=>{}});return m(r)}}}return t.component&&t.component.subTree?m(t.component.subTree):"<!---->"}function Ze(t,e){var N;let n=e.name||((N=t.props)==null?void 0:N["data-island-id"])||"anonymous",r=t.props||{},s=r["data-hydrate-when"]||e.__hydrateWhen||"",o=e.__islandTag||"div",i={};for(let g in r)g==="data-hydrate-when"||g==="data-island-id"||(i[g]=r[g]);let a=JSON.stringify(i),l=f(a),c="";if(typeof e.render=="function"){let g=e.render(r,{slots:t.children||{},emit:()=>{}});c=m(g)}else if(typeof e=="function"){let g=e(r,{slots:t.children||{}});c=m(g)}let y=s?` data-hydrate-when="${f(s)}"`:"",u=`<${o} data-hydrate="${f(n)}" data-props="${l}"${y}>${c}</${o}>`,d=`<script type="application/json" data-hydrate-props="${f(n)}">${a}<\/script>`;return u+d}async function*P(t){if(t==null)return;let{type:e,props:n,children:r}=t;if(typeof e=="symbol"&&String(e)==="Symbol(Fragment)"){if(Array.isArray(r))for(let s of r)yield*P(s);return}if(typeof e=="symbol"&&String(e).includes("Text")){yield f(String(r||""));return}if(typeof e=="symbol"&&String(e).includes("Comment")){yield`<!--${String(r||"")}-->`;return}if(typeof e=="string"){yield*Qe(e,n,r,t);return}if(typeof e=="object"||typeof e=="function"){yield H(t);return}}async function*Qe(t,e,n,r){let s=Z(e);if(J.has(t)){yield`<${t}${s} />`;return}if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let i=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;yield`<${t}${s}>${i}</${t}>`;return}yield`<${t}${s}>`;let o=r.shapeFlag||0;if(o&T.TEXT_CHILDREN)yield f(String(n||""));else if(o&T.ARRAY_CHILDREN&&Array.isArray(n))for(let i of n)yield*P(i);else if(o&T.SLOTS_CHILDREN&&typeof n=="object"&&n!==null)yield Q(n);else if(typeof n=="string")yield f(n);else if(Array.isArray(n))for(let i of n)yield*P(i);else typeof n=="number"&&(yield f(String(n)));yield`</${t}>`}function fe(t){return m(t)}function me(t,e){let n=(e==null?void 0:e.suspenseIdPrefix)||"suspense",r=S(t,n);return new ReadableStream({async pull(s){let{value:o,done:i}=await r.next();i?s.close():s.enqueue(o)},async cancel(){await r.return(void 0)}})}async function*pe(t,e){let n=(e==null?void 0:e.suspenseIdPrefix)||"suspense";yield*S(t,n)}async function*S(t,e){if(t==null)return;let{type:n,props:r,children:s}=t;if(typeof n=="symbol"&&String(n)==="Symbol(Fragment)"){if(Array.isArray(s))for(let o of s)yield*S(o,e);return}if(typeof n=="symbol"&&String(n).includes("Text")){yield f(String(s||""));return}if(typeof n=="symbol"&&String(n).includes("Comment")){yield`<!--${String(s||"")}-->`;return}if(typeof n=="string"){yield*et(n,r,s,t,e);return}if(typeof n=="object"&&n!==null){let o=n;if(o.name==="Suspense"||o._isSuspense){yield*tt(t,e);return}if(o._isAsyncComponent||o.__asyncSetup){yield*nt(t,e);return}yield H(t);return}if(typeof n=="function"){yield H(t);return}}async function*et(t,e,n,r,s){let o=Z(e);if(J.has(t)){yield`<${t}${o} />`;return}if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let a=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;yield`<${t}${o}>${a}</${t}>`;return}yield`<${t}${o}>`;let i=r.shapeFlag||0;if(i&T.TEXT_CHILDREN)yield f(String(n||""));else if(i&T.ARRAY_CHILDREN&&Array.isArray(n))for(let a of n)yield*S(a,s);else if(i&T.SLOTS_CHILDREN&&typeof n=="object"&&n!==null)yield Q(n);else if(typeof n=="string")yield f(n);else if(Array.isArray(n))for(let a of n)yield*S(a,s);else typeof n=="number"&&(yield f(String(n)));yield`</${t}>`}async function*tt(t,e){let n=`${e}-${qe++}`,r=t.type,o=(t.props||{}).fallback,i="";o&&(typeof o=="object"&&o!==null?i=m(o):typeof o=="string"&&(i=o));let a=t.children,l=[];if(typeof a=="object"&&a!==null){if(Array.isArray(a))l=a;else if(typeof a.default=="function"){let u=a.default();Array.isArray(u)?l=u:u!=null&&(l=[u])}}let c=[];function y(u){for(let d of u){if(d==null)continue;let N=d.type;if(N&&(N._isAsyncComponent||N.__asyncSetup||d.__asyncSetup)){let g=d.__asyncPromise||N.__asyncPromise;g&&c.push(g.then(()=>{}))}}}if(y(l),c.length===0){for(let u of l)yield*S(u,e);return}yield`<!--${n}-fallback-->`,yield i,await Promise.all(c),yield`<!--${n}-resolved-->`;for(let u of l)yield*S(u,e);yield`<!--/${n}-->`}async function*nt(t,e){let n=t.type,r=t.__asyncPromise||n.__asyncPromise;if(r)try{await r}catch(s){yield"<!--async-component-error-->";return}yield H(t)}var ge=new _;var F={ELEMENT:1,FUNCTIONAL_COMPONENT:2,STATEFUL_COMPONENT:4,TEXT_CHILDREN:8,ARRAY_CHILDREN:16,SLOTS_CHILDREN:32},h=!1,te=[],p={success:!0,mismatches:0,hydratedNodes:0};function Ne(){return h}function Te(t){h=t}function Se(){return{...p}}function ne(){p={success:!0,mismatches:0,hydratedNodes:0}}function Le(t){h?te.push(t):t()}function Ve(t,e,n={}){ne(),n.onHydrated&&te.push(n.onHydrated),h=!0;try{let r=e.firstElementChild;return r?(t._vnode||t.mount(e),t._vnode&&V(r,t._vnode,n),h=!1,ee(),p):(h=!1,t.mount(e),p.success=!1,ee(),p)}catch(r){return h=!1,p.success=!1,e.innerHTML="",t.mount(e),ee(),p}}function ee(){let t=te.splice(0);for(let e of t)try{e()}catch(n){}}function V(t,e,n){if(dt(e)){it(t,e,n);return}if(yt(e)){st(t,e,n);return}if(ut(e)){ot(t,e,n);return}if(ft(e)){at(t,e,n);return}if(typeof e.type=="string"){rt(t,e,n);return}}function rt(t,e,n){let r=t.tagName.toLowerCase(),s=e.type.toLowerCase();if(r!==s){k(t,e,`\u6807\u7B7E\u4E0D\u5339\u914D: DOM "${r}" vs VNode "${s}"`,n);return}e.el=t,e.props&&re(t,e.props),e.ref&&ct(t,e.ref),lt(t,e,n),p.hydratedNodes++}function st(t,e,n){if(t.nodeType!==3){k(t,e,"\u671F\u671B\u6587\u672C\u8282\u70B9",n);return}e.el=t;let r=t.nodeValue||"",s=String(e.children||"");r!==s&&(t.nodeValue=s,n.strict),p.hydratedNodes++}function ot(t,e,n){if(t.nodeType!==8){k(t,e,"\u671F\u671B\u6CE8\u91CA\u8282\u70B9",n);return}e.el=t;let r=t.nodeValue||"",s=String(e.children||"");r!==s&&(t.nodeValue=s),p.hydratedNodes++}function it(t,e,n){if(!Array.isArray(e.children))return;let r=Array.from(t.childNodes);for(let s=0;s<e.children.length;s++){let o=e.children[s],i=r[s];if(!i){p.mismatches++;break}V(i,o,n)}}function at(t,e,n){if(e.component&&e.component.subTree){V(t,e.component.subTree,n),e.el=e.component.subTree.el;return}let r=e.type;if(typeof r=="function")try{let s=r(e.props||{},{slots:e.children||{}});if(s){V(t,s,n),e.el=s.el;return}}catch(s){}if(typeof r=="object"&&r!==null&&typeof r.render=="function")try{let s=r.render(e.props||{},{slots:e.children||{},emit:()=>{}});if(s){V(t,s,n),e.el=s.el;return}}catch(s){}k(t,e,"\u7EC4\u4EF6\u65E0\u6CD5\u83B7\u53D6 subTree",n)}function lt(t,e,n){if(!e.children)return;let r=e.shapeFlag||0;if(typeof e.children=="string"||r&F.TEXT_CHILDREN){let s=t.textContent||"",o=String(e.children||"");s!==o&&(t.textContent=o,n.strict);return}if(Array.isArray(e.children)){let s=Array.from(t.childNodes),o=0;for(let i=0;i<s.length&&o<e.children.length;i++){let a=e.children[o];if(a==null){o++;continue}V(s[i],a,n),o++}o<e.children.length&&p.mismatches++}r&F.SLOTS_CHILDREN&&typeof e.children=="object"&&e.children}function re(t,e){for(let n in e){let r=e[n];if(n.startsWith("on")&&typeof r=="function"){let s=n.slice(2).toLowerCase();t.addEventListener(s,r)}}}function ct(t,e){typeof e=="function"?e(t):e&&typeof e=="object"&&(e.current=t)}function dt(t){return typeof t.type=="symbol"&&String(t.type)==="Symbol(Fragment)"}function yt(t){return typeof t.type=="symbol"&&String(t.type).includes("Text")}function ut(t){return typeof t.type=="symbol"&&String(t.type).includes("Comment")}function ft(t){return!!((t.shapeFlag||0)&(F.STATEFUL_COMPONENT|F.FUNCTIONAL_COMPONENT)||typeof t.type=="object"&&t.type!==null||typeof t.type=="function")}function k(t,e,n,r){let s=`[lyt] \u6CE8\u6C34\u4E0D\u5339\u914D: ${n}`;if(p.mismatches++,r.strict)throw new Error(s)}var b=new Map,x=new Map,mt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},pt=/[&<>"']/g;function E(t){return t.replace(pt,e=>mt[e])}function se(t,e,n={}){let r=typeof document!="undefined"?document:null;if(!r)return{success:!1,mismatches:0,hydratedNodes:0};let s=r.querySelector(t);if(!s)return{success:!1,mismatches:0,hydratedNodes:0};let o=s.getAttribute("data-hydrate");if(!o)return{success:!1,mismatches:0,hydratedNodes:0};if(s.hasAttribute("data-hydrated"))return{success:!0,mismatches:0,hydratedNodes:0};let i=gt(o,r);if(i===null)return{success:!1,mismatches:0,hydratedNodes:0};let a=s.getAttribute("data-hydrate-when");return a||n.lazy?ht(s,o,e,i,a||"visible",n):L(s,o,e,i,n)}function gt(t,e){let n=e.querySelector(`script[type="application/json"][data-hydrate-props="${t}"]`);if(!n){let r=e.querySelector(`[data-hydrate="${t}"]`);if(r){let s=r.getAttribute("data-props");if(s)try{return JSON.parse(s)}catch(o){return null}}return{}}try{return JSON.parse(n.textContent||"{}")}catch(r){return null}}function L(t,e,n,r,s){let o={success:!0,mismatches:0,hydratedNodes:0};try{h=!0;let i=null;if(typeof n.render=="function")i=n.render(r,{slots:n.slots||{},emit:()=>{}});else if(typeof n.setup=="function"){let l=n.setup(r,{emit:()=>{},slots:n.slots||{}});typeof l=="function"&&(i=l())}if(!i)return h=!1,o.success=!1,o;if(s.dev!==!1){let l=Tt(t,i,e);o.mismatches=l}V(t,i,s),o.hydratedNodes=p.hydratedNodes,i.props&&re(t,i.props),j(t,i),t.setAttribute("data-hydrated","");let a={id:e,hydrated:!0,instance:n,eventListeners:[],timeoutId:null,observer:null,interactionHandler:null};return b.set(e,a),x.set(e,n),h=!1,s.onHydrated&&s.onHydrated(),o}catch(i){return h=!1,o.success=!1,o}}function j(t,e){if(!(!e.children||typeof e.children=="string")&&Array.isArray(e.children)){let n=Array.from(t.children),r=0;for(let s=0;s<n.length&&r<e.children.length;s++){let o=e.children[r];if(o==null){r++;continue}if(typeof o.type=="string"&&o.props)re(n[s],o.props),j(n[s],o);else if(typeof o.type=="object"||typeof o.type=="function"){let i=o.type;if(typeof i=="function")try{let a=i(o.props||{},{slots:o.children||{}});a&&n[s]&&j(n[s],a)}catch(a){}else if(i&&typeof i.render=="function")try{let a=i.render(o.props||{},{slots:o.children||{},emit:()=>{}});a&&n[s]&&j(n[s],a)}catch(a){}}r++}}}function ht(t,e,n,r,s,o){let i={success:!0,mismatches:0,hydratedNodes:0},a=null;o.timeout&&o.timeout>0&&(a=setTimeout(()=>{Ee(t,e),L(t,e,n,r,o)},o.timeout));let l={id:e,hydrated:!1,instance:n,eventListeners:[],timeoutId:a,observer:null,interactionHandler:null};switch(b.set(e,l),x.set(e,n),s){case"visible":{if(typeof IntersectionObserver!="undefined"){let c=new IntersectionObserver(y=>{for(let u of y)u.isIntersecting&&(c.unobserve(u.target),l.observer=null,a&&clearTimeout(a),l.timeoutId=null,L(t,e,n,r,o))},{rootMargin:"200px"});c.observe(t),l.observer=c}else a&&clearTimeout(a),L(t,e,n,r,o);break}case"idle":{(y=>{typeof requestIdleCallback!="undefined"?requestIdleCallback(y,{timeout:o.timeout||2e3}):setTimeout(y,1)})(()=>{a&&clearTimeout(a),l.timeoutId=null,t.hasAttribute("data-hydrated")||L(t,e,n,r,o)});break}case"interaction":{let c=()=>{a&&clearTimeout(a),l.timeoutId=null,l.interactionHandler=null,document.removeEventListener("click",c),document.removeEventListener("keydown",c),document.removeEventListener("scroll",c),document.removeEventListener("touchstart",c),t.hasAttribute("data-hydrated")||L(t,e,n,r,o)};document.addEventListener("click",c,{once:!1,passive:!0}),document.addEventListener("keydown",c,{once:!1,passive:!0}),document.addEventListener("scroll",c,{once:!1,passive:!0}),document.addEventListener("touchstart",c,{once:!1,passive:!0}),l.interactionHandler=c;break}default:a&&clearTimeout(a),L(t,e,n,r,o)}return i}function Ee(t,e){let n=b.get(e);n&&(n.observer&&(n.observer.disconnect(),n.observer=null),n.timeoutId!==null&&(clearTimeout(n.timeoutId),n.timeoutId=null),n.interactionHandler&&(document.removeEventListener("click",n.interactionHandler),document.removeEventListener("keydown",n.interactionHandler),document.removeEventListener("scroll",n.interactionHandler),document.removeEventListener("touchstart",n.interactionHandler),n.interactionHandler=null))}function be(t={}){let e=typeof document!="undefined"?document:null;if(!e)return{success:!1,mismatches:0,hydratedNodes:0};let n=e.querySelectorAll("[data-hydrate]:not([data-hydrated])"),r={success:!0,mismatches:0,hydratedNodes:0};return n.forEach(s=>{let o=s.getAttribute("data-hydrate"),i=x.get(o);if(!i){r.success=!1;return}let a=se(`[data-hydrate="${o}"]`,i,t);r.mismatches+=a.mismatches,r.hydratedNodes+=a.hydratedNodes,a.success||(r.success=!1)}),r}function Ce(t,e){x.set(t,e)}function Re(t){if(!b.get(t))return;let n=typeof document!="undefined"?document.querySelector(`[data-hydrate="${t}"]`):null;n&&(Ee(n,t),n.removeAttribute("data-hydrated")),b.delete(t),x.delete(t)}function He(){return b}function Ae(){b.clear(),x.clear()}function xe(t,e={},n="div",r){let s=t.name||"anonymous",o=JSON.stringify(e),i=E(o),a="";if(typeof t.render=="function"){let u=t.render(e,{slots:t.slots||{},emit:()=>{}});a=A(u)}let l=r?` data-hydrate-when="${r}"`:"",c=`<${n} data-hydrate="${s}" data-props="${i}"${l}>${a}</${n}>`,y=`<script type="application/json" data-hydrate-props="${s}">${o}<\/script>`;return c+y}function A(t){if(t==null)return"";let{type:e,props:n,children:r}=t;if(typeof e=="symbol"&&String(e)==="Symbol(Fragment)")return Array.isArray(r)?r.map(s=>A(s)).join(""):"";if(typeof e=="symbol"&&String(e).includes("Text"))return E(String(r||""));if(typeof e=="symbol"&&String(e).includes("Comment"))return`<!--${String(r||"")}-->`;if(typeof e=="string"){let s=Nt(n);if(new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]).has(e))return`<${e}${s} />`;let i="";return typeof r=="string"?i=E(r):Array.isArray(r)?i=r.map(a=>A(a)).join(""):typeof r=="number"&&(i=E(String(r))),`<${e}${s}>${i}</${e}>`}if(typeof e=="function"){let s=e(n||{},{slots:r||{}});return A(s)}if(typeof e=="object"&&e!==null){let s=e;if(typeof s.render=="function"){let o=s.render(n||{},{slots:r||{},emit:()=>{}});return A(o)}}return""}function Nt(t){if(!t)return"";let e=[];for(let n in t){let r=t[n];if(!(n.startsWith("on")||n.startsWith("@")||n==="key"||n==="ref")&&!(n==="__vccOpts"||n.startsWith("__"))&&!(n==="dangerouslySetInnerHTML"||n==="innerHTML"))if(r===!0)e.push(n);else{if(r===!1||r===null||r===void 0)continue;n==="class"&&typeof r=="string"?e.push(`class="${E(r)}"`):n==="style"&&typeof r=="string"?e.push(`style="${E(r)}"`):e.push(`${n}="${E(String(r))}"`)}}return e.length>0?" "+e.join(" "):""}var oe=[];function Tt(t,e,n){let r=0,s=St(t),o=A(e);if(s!==o){r++;let i={islandId:n,expected:o,actual:s,suggestion:Lt(s,o,n)};oe.push(i)}return r}function St(t){let e=t.cloneNode(!0);return e.removeAttribute("data-hydrate"),e.removeAttribute("data-props"),e.removeAttribute("data-hydrate-when"),e.removeAttribute("data-hydrated"),e.innerHTML}function Lt(t,e,n){if(t.trim()==="")return`\u670D\u52A1\u7AEF\u6E32\u67D3\u4E3A\u7A7A\uFF0C\u8BF7\u68C0\u67E5\u7EC4\u4EF6 "${n}" \u7684\u670D\u52A1\u7AEF\u6E32\u67D3\u903B\u8F91`;if(e.trim()==="")return`\u5BA2\u6237\u7AEF\u6E32\u67D3\u4E3A\u7A7A\uFF0C\u8BF7\u68C0\u67E5\u7EC4\u4EF6 "${n}" \u7684 render \u51FD\u6570`;let r=/\d{10,13}/;return r.test(t)||r.test(e)?"\u68C0\u6D4B\u5230\u65F6\u95F4\u6233\u5DEE\u5F02\uFF0C\u8003\u8651\u4F7F\u7528\u7EDF\u4E00\u7684\u65F6\u95F4\u6E90\u6216\u5EF6\u8FDF\u6CE8\u6C34":he(t)===he(e)?"HTML \u5185\u5BB9\u76F8\u540C\u4F46\u5C5E\u6027\u987A\u5E8F\u4E0D\u540C\uFF0C\u8FD9\u4E0D\u5F71\u54CD\u529F\u80FD\u4F46\u53EF\u80FD\u5BFC\u81F4 mismatch \u8B66\u544A":`\u8BF7\u786E\u4FDD\u7EC4\u4EF6 "${n}" \u5728\u670D\u52A1\u7AEF\u548C\u5BA2\u6237\u7AEF\u6E32\u67D3\u76F8\u540C\u7684\u8F93\u51FA`}function he(t){return t.replace(/\s+/g," ").replace(/>\s+</g,"><").trim()}function _e(){return[...oe]}function Me(){oe.length=0}
package/dist/ssr.mjs CHANGED
@@ -1 +1 @@
1
- import{registerDOMOperations as Le}from"@lytjs/vdom";var x=(i=>(i[i.ELEMENT=1]="ELEMENT",i[i.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",i[i.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",i[i.TEXT_CHILDREN=8]="TEXT_CHILDREN",i[i.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",i[i.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",i))(x||{}),F=(d=>(d[d.TEXT=1]="TEXT",d[d.CLASS=2]="CLASS",d[d.STYLE=4]="STYLE",d[d.PROPS=8]="PROPS",d[d.FULL_PROPS=16]="FULL_PROPS",d[d.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",d[d.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",d[d.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",d[d.NEED_PATCH=256]="NEED_PATCH",d[d.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",d[d.HOISTED=-1]="HOISTED",d[d.BAIL=-2]="BAIL",d))(F||{}),Q=Symbol("Fragment"),ee=Symbol("Text"),te=Symbol("Comment");function C(t){return t.type===Q}function _(t){return t.type===ee}function M(t){return t.type===te}function ne(t,e){return t.type===e.type&&t.key===e.key}function k(t){return Array.isArray(t.dynamicChildren)}function re(t,e,n,r){if(n==="class")t.setClass(e,r);else if(n==="style")t.setStyle(e,r);else if(n.startsWith("on")||n.startsWith("@")){let s=n.startsWith("@")?n.slice(1).toLowerCase():n.slice(2).toLowerCase();t.addEventListener(e,s,r)}else n==="key"||n==="ref"||t.setAttribute(e,n,r)}function W(t,e,n,r,s){if(n==="class")t.setClass(e,r);else if(n==="style")t.setStyle(e,r||{});else if(n.startsWith("on")||n.startsWith("@")){let o=n.startsWith("@")?n.slice(1).toLowerCase():n.slice(2).toLowerCase();s&&t.removeEventListener(e,o,s),r&&t.addEventListener(e,o,r)}else t.setAttribute(e,n,r)}function G(t,e,n,r){for(let s in r){if(s==="key"||s==="ref")continue;let o=n[s],i=r[s];i!==o&&W(t,e,s,i,o)}for(let s in n)if(!(s==="key"||s==="ref")&&!(s in r))if(s==="class")t.setClass(e,"");else if(s==="style")t.setStyle(e,{});else if(s.startsWith("on")||s.startsWith("@")){let o=s.startsWith("@")?s.slice(1).toLowerCase():s.slice(2).toLowerCase();t.removeEventListener(e,o,n[s])}else t.removeAttribute(e,s)}function U(t,e,n,r,s,o){let{shapeFlag:i}=n;if(C(n)){ue(t,e,n,r,s,o);return}if(_(n)){let a=t.createText(n.children);n.el=a,t.insert(r,a,s);return}if(M(n)){let a=t.createComment(n.children);n.el=a,t.insert(r,a,s);return}if(i&1){ye(t,e,n,r,s,o);return}if(i&6){fe(e,n,r,s,o);return}}function ye(t,e,n,r,s,o){let i=n.type,a=t.createElement(i);if(n.el=a,n.props)for(let y in n.props){let u=n.props[y];re(t,a,y,u)}let{shapeFlag:l,children:c}=n;l&8?a.textContent=c:l&16&&O(e,c,a,null,o),t.insert(r,a,s)}function O(t,e,n,r,s){for(let o=0;o<e.length;o++)t(null,e[o],n,r,s)}function ue(t,e,n,r,s,o){let{children:i}=n,a=t.createComment("");t.insert(r,a,s),Array.isArray(i)&&i.length>0&&O(e,i,r,a,o),n.el=a,n.anchor=a}function fe(t,e,n,r,s){let o=e.component;o&&o.update&&o.update(),o&&o.subTree&&(t(null,o.subTree,n,r,o),e.el=o.subTree.el)}function se(t,e,n,r){let{shapeFlag:s,children:o}=n;if(C(n)){if(Array.isArray(o))for(let i=0;i<o.length;i++)e(o[i],r);n.anchor&&n.anchor.parentNode&&t.remove(n.anchor);return}if(s&6){n.component&&n.component.subTree&&e(n.component.subTree,r);return}n.el&&t.remove(n.el)}function I(t,e){for(let n=0;n<e.length;n++)t(e[n])}import{patchKeyedChildren as me,patchUnkeyedChildren as pe}from"@lytjs/vdom";function $(t,e,n,r,s,o=null,i=null){if(r==null){n&&e(n,s);return}if(n===null){U(t,Y(t,e),r,s,o,i);return}if(k(r)&&k(n)){Te(t,e,n,r,s,i);return}if(!ne(n,r)){e(n,s),U(t,Y(t,e),r,s,o,i);return}r.el=n.el,r.anchor=n.anchor;let{shapeFlag:a}=r;if(C(r)){Ne(t,e,n,r,s,o,i);return}if(_(r)){r.children!==n.children&&(r.el.nodeValue=r.children);return}if(M(r)){r.children!==n.children&&(r.el.nodeValue=r.children);return}if(a&1){ge(t,e,n,r,i);return}if(a&6){Se(n,r,i);return}}function Y(t,e){return(n,r,s,o,i)=>{$(t,e,n,r,s,o,i)}}function ge(t,e,n,r,s=null){let o=r.el=n.el,i=n.props||{},a=r.props||{},{patchFlag:l,dynamicProps:c}=r;if(l&&l>0){if(l&1&&n.children!==r.children&&(o.textContent=r.children),l&2&&i.class!==a.class&&t.setClass(o,a.class),l&4&&i.style!==a.style&&t.setStyle(o,a.style||{}),l&8&&c)for(let y=0;y<c.length;y++){let u=c[y],d=i[u],N=a[u];N!==d&&W(t,o,u,N,d)}l&16&&G(t,o,i,a)}else G(t,o,i,a);(!l||!(l&1))&&oe(t,e,n,r,o,null,s)}function oe(t,e,n,r,s,o,i){let a=n.shapeFlag,l=r.shapeFlag,c=n.children,y=r.children;if(l&8){a&16&&I(e,c),c!==y&&(s.textContent=y);return}if(l&16){a&16?he(t,e,c,y,s,o,i):(a&8&&(s.textContent=""),O(Y(t,e),y,s,o,i));return}y==null&&(a&8?s.textContent="":a&16&&I(e,c))}function he(t,e,n,r,s,o,i){r.every(l=>l.key!=null)&&n.every(l=>l.key!=null)?me(n,r,s,o,i,null,!1):pe(n,r,s,o,i,null,!1)}function Ne(t,e,n,r,s,o,i){let a=n.children,l=r.children;Array.isArray(l)&&l.length>0?(oe(t,e,n,r,s,o,i),r.el=l[0].el,r.anchor=l[l.length-1].el?t.nextSibling(l[l.length-1].el):o):Array.isArray(a)&&a.length>0&&l===null?(I(e,a),r.el=n.el,r.anchor=n.anchor):(r.el=n.el,r.anchor=n.anchor)}function Te(t,e,n,r,s,o){let i=n.dynamicChildren,a=r.dynamicChildren;for(let l=0;l<a.length;l++)$(t,e,i[l],a[l],s,null,o)}function Se(t,e,n){e.component=t.component,e.el=t.el,e.component&&e.component.update&&e.component.update()}function Ve(t){function e(s,o){se(t,e,s,o)}Le({insert(s,o,i){t.insert(o,s,i)},createElement(s){return t.createElement(s)},createText(s){return t.createText(s)},setText(s,o){s.nodeValue=o},setElementText(s,o){s.textContent=o},remove(s){t.remove(s)},createComment(s){return t.createComment(s)},mount(s,o,i,a,l,c,y){r(null,s,o,i,a)},patch(s,o,i,a,l,c,y,u){r(s,o,i,a,l)},unmount(s,o,i,a){e(s)},move(s,o,i){t.insert(o,s.el,i)}});function r(s,o,i,a,l){$(t,e,s,o,i,a,l)}return{mount(s,o){o.nodeType===1&&(o.textContent=""),r(null,s,o,null,null)},patch(s,o,i){var a;r(s,o,i||((a=s.el)==null?void 0:a.parentNode),null,null)},unmount(s,o){e(s,o)}}}var X=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ee={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},be=/[&<>"']/g,T={ELEMENT:1,FUNCTIONAL_COMPONENT:2,STATEFUL_COMPONENT:4,TEXT_CHILDREN:8,ARRAY_CHILDREN:16,SLOTS_CHILDREN:32},Ce=0;function f(t){return t.replace(be,e=>Ee[e])}function Re(t,e){return t.startsWith("on")||t.startsWith("@")||t==="key"||t==="ref"||t==="__vccOpts"||t.startsWith("__")?"":e===!0?t:e===!1||e===null||e===void 0?"":t==="class"?`class="${f(ie(e))}"`:t==="style"?`style="${f(He(e))}"`:t==="dangerouslySetInnerHTML"||t==="innerHTML"?"":`${t}="${f(String(e))}"`}function ie(t){if(!t)return"";if(typeof t=="string")return t;if(Array.isArray(t))return t.map(ie).filter(Boolean).join(" ");if(typeof t=="object"){let e=[];for(let n in t)t[n]&&e.push(n);return e.join(" ")}return String(t)}function He(t){if(!t)return"";if(typeof t=="string")return t;if(typeof t=="object"){let e=[];for(let n in t)if(t[n]){let r=n.replace(/([A-Z])/g,"-$1").toLowerCase();e.push(`${r}: ${t[n]}`)}return e.join("; ")}return String(t)}function z(t){if(!t)return"";let e=[];for(let n in t){let r=t[n],s=Re(n,r);s&&e.push(s)}return e.length>0?" "+e.join(" "):""}var v=class{createElement(e){return{tag:e,props:{},children:[]}}createText(e){return{type:"text",value:e}}createComment(e){return{type:"comment",value:e}}insert(e,n,r){e.children.push(n)}renderToString(e){return m(e)}async*renderToStream(e){yield*w(e)}};function m(t){if(t==null)return"";let{type:e,props:n,children:r}=t;return typeof e=="symbol"&&String(e)==="Symbol(Fragment)"?Array.isArray(r)?r.map(s=>m(s)).join(""):"":typeof e=="symbol"&&String(e).includes("Text")?f(String(r||"")):typeof e=="symbol"&&String(e).includes("Comment")?`<!--${String(r||"")}-->`:typeof e=="string"?Ae(e,n,r,t):typeof e=="object"&&e!==null||typeof e=="function"?R(t):""}function Ae(t,e,n,r){let s=z(e);if(X.has(t))return`<${t}${s} />`;if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let a=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;return`<${t}${s}>${a}</${t}>`}let o="",i=r.shapeFlag||0;return i&T.TEXT_CHILDREN?o=f(String(n||"")):i&T.ARRAY_CHILDREN&&Array.isArray(n)?o=n.map(a=>m(a)).join(""):i&T.SLOTS_CHILDREN&&typeof n=="object"&&n!==null?o=q(n):typeof n=="string"?o=f(n):Array.isArray(n)?o=n.map(a=>m(a)).join(""):typeof n=="number"&&(o=f(String(n))),`<${t}${s}>${o}</${t}>`}function q(t){let e=[];for(let n in t){let r=t[n];if(typeof r=="function"){let s=r();Array.isArray(s)?e.push(s.map(o=>m(o)).join("")):s!=null&&e.push(m(s))}else Array.isArray(r)?e.push(r.map(s=>m(s)).join("")):r!=null&&e.push(m(r))}return e.join("")}function R(t){let e=t.type;if(e&&e.__island)return xe(t,e);if(typeof e=="function"){let n=e(t.props||{},{slots:t.children||{}});return m(n)}if(typeof e=="object"&&e!==null){if(typeof e.render=="function"){let n=e.render(t.props||{},{slots:t.children||{},emit:()=>{}});return m(n)}if(typeof e.setup=="function"){let n=e.setup(t.props||{},{emit:()=>{},slots:t.children||{}});if(typeof n=="function"){let r=n();return m(r)}if(typeof e.render=="function"){let r=e.render(n||{},{slots:t.children||{},emit:()=>{}});return m(r)}}}return t.component&&t.component.subTree?m(t.component.subTree):"<!---->"}function xe(t,e){var N;let n=e.name||((N=t.props)==null?void 0:N["data-island-id"])||"anonymous",r=t.props||{},s=r["data-hydrate-when"]||e.__hydrateWhen||"",o=e.__islandTag||"div",i={};for(let g in r)g==="data-hydrate-when"||g==="data-island-id"||(i[g]=r[g]);let a=JSON.stringify(i),l=f(a),c="";if(typeof e.render=="function"){let g=e.render(r,{slots:t.children||{},emit:()=>{}});c=m(g)}else if(typeof e=="function"){let g=e(r,{slots:t.children||{}});c=m(g)}let y=s?` data-hydrate-when="${f(s)}"`:"",u=`<${o} data-hydrate="${f(n)}" data-props="${l}"${y}>${c}</${o}>`,d=`<script type="application/json" data-hydrate-props="${f(n)}">${a}<\/script>`;return u+d}async function*w(t){if(t==null)return;let{type:e,props:n,children:r}=t;if(typeof e=="symbol"&&String(e)==="Symbol(Fragment)"){if(Array.isArray(r))for(let s of r)yield*w(s);return}if(typeof e=="symbol"&&String(e).includes("Text")){yield f(String(r||""));return}if(typeof e=="symbol"&&String(e).includes("Comment")){yield`<!--${String(r||"")}-->`;return}if(typeof e=="string"){yield*_e(e,n,r,t);return}if(typeof e=="object"||typeof e=="function"){yield R(t);return}}async function*_e(t,e,n,r){let s=z(e);if(X.has(t)){yield`<${t}${s} />`;return}if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let i=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;yield`<${t}${s}>${i}</${t}>`;return}yield`<${t}${s}>`;let o=r.shapeFlag||0;if(o&T.TEXT_CHILDREN)yield f(String(n||""));else if(o&T.ARRAY_CHILDREN&&Array.isArray(n))for(let i of n)yield*w(i);else if(o&T.SLOTS_CHILDREN&&typeof n=="object"&&n!==null)yield q(n);else if(typeof n=="string")yield f(n);else if(Array.isArray(n))for(let i of n)yield*w(i);else typeof n=="number"&&(yield f(String(n)));yield`</${t}>`}function Me(t){return m(t)}function Oe(t,e){let n=(e==null?void 0:e.suspenseIdPrefix)||"suspense",r=S(t,n);return new ReadableStream({async pull(s){let{value:o,done:i}=await r.next();i?s.close():s.enqueue(o)},async cancel(){await r.return(void 0)}})}async function*Ie(t,e){let n=(e==null?void 0:e.suspenseIdPrefix)||"suspense";yield*S(t,n)}async function*S(t,e){if(t==null)return;let{type:n,props:r,children:s}=t;if(typeof n=="symbol"&&String(n)==="Symbol(Fragment)"){if(Array.isArray(s))for(let o of s)yield*S(o,e);return}if(typeof n=="symbol"&&String(n).includes("Text")){yield f(String(s||""));return}if(typeof n=="symbol"&&String(n).includes("Comment")){yield`<!--${String(s||"")}-->`;return}if(typeof n=="string"){yield*$e(n,r,s,t,e);return}if(typeof n=="object"&&n!==null){let o=n;if(o.name==="Suspense"||o._isSuspense){yield*ve(t,e);return}if(o._isAsyncComponent||o.__asyncSetup){yield*we(t,e);return}yield R(t);return}if(typeof n=="function"){yield R(t);return}}async function*$e(t,e,n,r,s){let o=z(e);if(X.has(t)){yield`<${t}${o} />`;return}if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let a=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;yield`<${t}${o}>${a}</${t}>`;return}yield`<${t}${o}>`;let i=r.shapeFlag||0;if(i&T.TEXT_CHILDREN)yield f(String(n||""));else if(i&T.ARRAY_CHILDREN&&Array.isArray(n))for(let a of n)yield*S(a,s);else if(i&T.SLOTS_CHILDREN&&typeof n=="object"&&n!==null)yield q(n);else if(typeof n=="string")yield f(n);else if(Array.isArray(n))for(let a of n)yield*S(a,s);else typeof n=="number"&&(yield f(String(n)));yield`</${t}>`}async function*ve(t,e){let n=`${e}-${Ce++}`,r=t.type,o=(t.props||{}).fallback,i="";o&&(typeof o=="object"&&o!==null?i=m(o):typeof o=="string"&&(i=o));let a=t.children,l=[];if(typeof a=="object"&&a!==null){if(Array.isArray(a))l=a;else if(typeof a.default=="function"){let u=a.default();Array.isArray(u)?l=u:u!=null&&(l=[u])}}let c=[];function y(u){for(let d of u){if(d==null)continue;let N=d.type;if(N&&(N._isAsyncComponent||N.__asyncSetup||d.__asyncSetup)){let g=d.__asyncPromise||N.__asyncPromise;g&&c.push(g.then(()=>{}))}}}if(y(l),c.length===0){for(let u of l)yield*S(u,e);return}yield`<!--${n}-fallback-->`,yield i,await Promise.all(c),yield`<!--${n}-resolved-->`;for(let u of l)yield*S(u,e);yield`<!--/${n}-->`}async function*we(t,e){let n=t.type,r=t.__asyncPromise||n.__asyncPromise;if(r)try{await r}catch(s){yield"<!--async-component-error-->";return}yield R(t)}var De=new v;var P={ELEMENT:1,FUNCTIONAL_COMPONENT:2,STATEFUL_COMPONENT:4,TEXT_CHILDREN:8,ARRAY_CHILDREN:16,SLOTS_CHILDREN:32},h=!1,K=[],p={success:!0,mismatches:0,hydratedNodes:0};function Pe(){return h}function je(t){h=t}function Fe(){return{...p}}function le(){p={success:!0,mismatches:0,hydratedNodes:0}}function ke(t){h?K.push(t):t()}function We(t,e,n={}){le(),n.onHydrated&&K.push(n.onHydrated),h=!0;try{let r=e.firstElementChild;return r?(t._vnode||t.mount(e),t._vnode&&V(r,t._vnode,n),h=!1,B(),p):(h=!1,t.mount(e),p.success=!1,B(),p)}catch(r){return h=!1,p.success=!1,e.innerHTML="",t.mount(e),B(),p}}function B(){let t=K.splice(0);for(let e of t)try{e()}catch(n){}}function V(t,e,n){if(Ke(e)){Xe(t,e,n);return}if(Je(e)){Ue(t,e,n);return}if(Ze(e)){Ye(t,e,n);return}if(Qe(e)){ze(t,e,n);return}if(typeof e.type=="string"){Ge(t,e,n);return}}function Ge(t,e,n){let r=t.tagName.toLowerCase(),s=e.type.toLowerCase();if(r!==s){j(t,e,`\u6807\u7B7E\u4E0D\u5339\u914D: DOM "${r}" vs VNode "${s}"`,n);return}e.el=t,e.props&&J(t,e.props),e.ref&&Be(t,e.ref),qe(t,e,n),p.hydratedNodes++}function Ue(t,e,n){if(t.nodeType!==3){j(t,e,"\u671F\u671B\u6587\u672C\u8282\u70B9",n);return}e.el=t;let r=t.nodeValue||"",s=String(e.children||"");r!==s&&(t.nodeValue=s,n.strict),p.hydratedNodes++}function Ye(t,e,n){if(t.nodeType!==8){j(t,e,"\u671F\u671B\u6CE8\u91CA\u8282\u70B9",n);return}e.el=t;let r=t.nodeValue||"",s=String(e.children||"");r!==s&&(t.nodeValue=s),p.hydratedNodes++}function Xe(t,e,n){if(!Array.isArray(e.children))return;let r=Array.from(t.childNodes);for(let s=0;s<e.children.length;s++){let o=e.children[s],i=r[s];if(!i){p.mismatches++;break}V(i,o,n)}}function ze(t,e,n){if(e.component&&e.component.subTree){V(t,e.component.subTree,n),e.el=e.component.subTree.el;return}let r=e.type;if(typeof r=="function")try{let s=r(e.props||{},{slots:e.children||{}});if(s){V(t,s,n),e.el=s.el;return}}catch(s){}if(typeof r=="object"&&r!==null&&typeof r.render=="function")try{let s=r.render(e.props||{},{slots:e.children||{},emit:()=>{}});if(s){V(t,s,n),e.el=s.el;return}}catch(s){}j(t,e,"\u7EC4\u4EF6\u65E0\u6CD5\u83B7\u53D6 subTree",n)}function qe(t,e,n){if(!e.children)return;let r=e.shapeFlag||0;if(typeof e.children=="string"||r&P.TEXT_CHILDREN){let s=t.textContent||"",o=String(e.children||"");s!==o&&(t.textContent=o,n.strict);return}if(Array.isArray(e.children)){let s=Array.from(t.childNodes),o=0;for(let i=0;i<s.length&&o<e.children.length;i++){let a=e.children[o];if(a==null){o++;continue}V(s[i],a,n),o++}o<e.children.length&&p.mismatches++}r&P.SLOTS_CHILDREN&&typeof e.children=="object"&&e.children}function J(t,e){for(let n in e){let r=e[n];if(n.startsWith("on")&&typeof r=="function"){let s=n.slice(2).toLowerCase();t.addEventListener(s,r)}}}function Be(t,e){typeof e=="function"?e(t):e&&typeof e=="object"&&(e.current=t)}function Ke(t){return typeof t.type=="symbol"&&String(t.type)==="Symbol(Fragment)"}function Je(t){return typeof t.type=="symbol"&&String(t.type).includes("Text")}function Ze(t){return typeof t.type=="symbol"&&String(t.type).includes("Comment")}function Qe(t){return!!((t.shapeFlag||0)&(P.STATEFUL_COMPONENT|P.FUNCTIONAL_COMPONENT)||typeof t.type=="object"&&t.type!==null||typeof t.type=="function")}function j(t,e,n,r){let s=`[lyt] \u6CE8\u6C34\u4E0D\u5339\u914D: ${n}`;if(p.mismatches++,r.strict)throw new Error(s)}var b=new Map,A=new Map,et={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},tt=/[&<>"']/g;function E(t){return t.replace(tt,e=>et[e])}function ce(t,e,n={}){let r=typeof document!="undefined"?document:null;if(!r)return{success:!1,mismatches:0,hydratedNodes:0};let s=r.querySelector(t);if(!s)return{success:!1,mismatches:0,hydratedNodes:0};let o=s.getAttribute("data-hydrate");if(!o)return{success:!1,mismatches:0,hydratedNodes:0};if(s.hasAttribute("data-hydrated"))return{success:!0,mismatches:0,hydratedNodes:0};let i=nt(o,r);if(i===null)return{success:!1,mismatches:0,hydratedNodes:0};let a=s.getAttribute("data-hydrate-when");return a||n.lazy?rt(s,o,e,i,a||"visible",n):L(s,o,e,i,n)}function nt(t,e){let n=e.querySelector(`script[type="application/json"][data-hydrate-props="${t}"]`);if(!n){let r=e.querySelector(`[data-hydrate="${t}"]`);if(r){let s=r.getAttribute("data-props");if(s)try{return JSON.parse(s)}catch(o){return null}}return{}}try{return JSON.parse(n.textContent||"{}")}catch(r){return null}}function L(t,e,n,r,s){let o={success:!0,mismatches:0,hydratedNodes:0};try{h=!0;let i=null;if(typeof n.render=="function")i=n.render(r,{slots:n.slots||{},emit:()=>{}});else if(typeof n.setup=="function"){let l=n.setup(r,{emit:()=>{},slots:n.slots||{}});typeof l=="function"&&(i=l())}if(!i)return h=!1,o.success=!1,o;if(s.dev!==!1){let l=yt(t,i,e);o.mismatches=l}V(t,i,s),o.hydratedNodes=p.hydratedNodes,i.props&&J(t,i.props),D(t,i),t.setAttribute("data-hydrated","");let a={id:e,hydrated:!0,instance:n,eventListeners:[],timeoutId:null,observer:null,interactionHandler:null};return b.set(e,a),A.set(e,n),h=!1,s.onHydrated&&s.onHydrated(),o}catch(i){return h=!1,o.success=!1,o}}function D(t,e){if(!(!e.children||typeof e.children=="string")&&Array.isArray(e.children)){let n=Array.from(t.children),r=0;for(let s=0;s<n.length&&r<e.children.length;s++){let o=e.children[r];if(o==null){r++;continue}if(typeof o.type=="string"&&o.props)J(n[s],o.props),D(n[s],o);else if(typeof o.type=="object"||typeof o.type=="function"){let i=o.type;if(typeof i=="function")try{let a=i(o.props||{},{slots:o.children||{}});a&&n[s]&&D(n[s],a)}catch(a){}else if(i&&typeof i.render=="function")try{let a=i.render(o.props||{},{slots:o.children||{},emit:()=>{}});a&&n[s]&&D(n[s],a)}catch(a){}}r++}}}function rt(t,e,n,r,s,o){let i={success:!0,mismatches:0,hydratedNodes:0},a=null;o.timeout&&o.timeout>0&&(a=setTimeout(()=>{de(t,e),L(t,e,n,r,o)},o.timeout));let l={id:e,hydrated:!1,instance:n,eventListeners:[],timeoutId:a,observer:null,interactionHandler:null};switch(b.set(e,l),A.set(e,n),s){case"visible":{if(typeof IntersectionObserver!="undefined"){let c=new IntersectionObserver(y=>{for(let u of y)u.isIntersecting&&(c.unobserve(u.target),l.observer=null,a&&clearTimeout(a),l.timeoutId=null,L(t,e,n,r,o))},{rootMargin:"200px"});c.observe(t),l.observer=c}else a&&clearTimeout(a),L(t,e,n,r,o);break}case"idle":{(y=>{typeof requestIdleCallback!="undefined"?requestIdleCallback(y,{timeout:o.timeout||2e3}):setTimeout(y,1)})(()=>{a&&clearTimeout(a),l.timeoutId=null,t.hasAttribute("data-hydrated")||L(t,e,n,r,o)});break}case"interaction":{let c=()=>{a&&clearTimeout(a),l.timeoutId=null,l.interactionHandler=null,document.removeEventListener("click",c),document.removeEventListener("keydown",c),document.removeEventListener("scroll",c),document.removeEventListener("touchstart",c),t.hasAttribute("data-hydrated")||L(t,e,n,r,o)};document.addEventListener("click",c,{once:!1,passive:!0}),document.addEventListener("keydown",c,{once:!1,passive:!0}),document.addEventListener("scroll",c,{once:!1,passive:!0}),document.addEventListener("touchstart",c,{once:!1,passive:!0}),l.interactionHandler=c;break}default:a&&clearTimeout(a),L(t,e,n,r,o)}return i}function de(t,e){let n=b.get(e);n&&(n.observer&&(n.observer.disconnect(),n.observer=null),n.timeoutId!==null&&(clearTimeout(n.timeoutId),n.timeoutId=null),n.interactionHandler&&(document.removeEventListener("click",n.interactionHandler),document.removeEventListener("keydown",n.interactionHandler),document.removeEventListener("scroll",n.interactionHandler),document.removeEventListener("touchstart",n.interactionHandler),n.interactionHandler=null))}function st(t={}){let e=typeof document!="undefined"?document:null;if(!e)return{success:!1,mismatches:0,hydratedNodes:0};let n=e.querySelectorAll("[data-hydrate]:not([data-hydrated])"),r={success:!0,mismatches:0,hydratedNodes:0};return n.forEach(s=>{let o=s.getAttribute("data-hydrate"),i=A.get(o);if(!i){r.success=!1;return}let a=ce(`[data-hydrate="${o}"]`,i,t);r.mismatches+=a.mismatches,r.hydratedNodes+=a.hydratedNodes,a.success||(r.success=!1)}),r}function ot(t,e){A.set(t,e)}function it(t){if(!b.get(t))return;let n=typeof document!="undefined"?document.querySelector(`[data-hydrate="${t}"]`):null;n&&(de(n,t),n.removeAttribute("data-hydrated")),b.delete(t),A.delete(t)}function at(){return b}function lt(){b.clear(),A.clear()}function ct(t,e={},n="div",r){let s=t.name||"anonymous",o=JSON.stringify(e),i=E(o),a="";if(typeof t.render=="function"){let u=t.render(e,{slots:t.slots||{},emit:()=>{}});a=H(u)}let l=r?` data-hydrate-when="${r}"`:"",c=`<${n} data-hydrate="${s}" data-props="${i}"${l}>${a}</${n}>`,y=`<script type="application/json" data-hydrate-props="${s}">${o}<\/script>`;return c+y}function H(t){if(t==null)return"";let{type:e,props:n,children:r}=t;if(typeof e=="symbol"&&String(e)==="Symbol(Fragment)")return Array.isArray(r)?r.map(s=>H(s)).join(""):"";if(typeof e=="symbol"&&String(e).includes("Text"))return E(String(r||""));if(typeof e=="symbol"&&String(e).includes("Comment"))return`<!--${String(r||"")}-->`;if(typeof e=="string"){let s=dt(n);if(new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]).has(e))return`<${e}${s} />`;let i="";return typeof r=="string"?i=E(r):Array.isArray(r)?i=r.map(a=>H(a)).join(""):typeof r=="number"&&(i=E(String(r))),`<${e}${s}>${i}</${e}>`}if(typeof e=="function"){let s=e(n||{},{slots:r||{}});return H(s)}if(typeof e=="object"&&e!==null){let s=e;if(typeof s.render=="function"){let o=s.render(n||{},{slots:r||{},emit:()=>{}});return H(o)}}return""}function dt(t){if(!t)return"";let e=[];for(let n in t){let r=t[n];if(!(n.startsWith("on")||n.startsWith("@")||n==="key"||n==="ref")&&!(n==="__vccOpts"||n.startsWith("__"))&&!(n==="dangerouslySetInnerHTML"||n==="innerHTML"))if(r===!0)e.push(n);else{if(r===!1||r===null||r===void 0)continue;n==="class"&&typeof r=="string"?e.push(`class="${E(r)}"`):n==="style"&&typeof r=="string"?e.push(`style="${E(r)}"`):e.push(`${n}="${E(String(r))}"`)}}return e.length>0?" "+e.join(" "):""}var Z=[];function yt(t,e,n){let r=0,s=ut(t),o=H(e);if(s!==o){r++;let i={islandId:n,expected:o,actual:s,suggestion:ft(s,o,n)};Z.push(i)}return r}function ut(t){let e=t.cloneNode(!0);return e.removeAttribute("data-hydrate"),e.removeAttribute("data-props"),e.removeAttribute("data-hydrate-when"),e.removeAttribute("data-hydrated"),e.innerHTML}function ft(t,e,n){if(t.trim()==="")return`\u670D\u52A1\u7AEF\u6E32\u67D3\u4E3A\u7A7A\uFF0C\u8BF7\u68C0\u67E5\u7EC4\u4EF6 "${n}" \u7684\u670D\u52A1\u7AEF\u6E32\u67D3\u903B\u8F91`;if(e.trim()==="")return`\u5BA2\u6237\u7AEF\u6E32\u67D3\u4E3A\u7A7A\uFF0C\u8BF7\u68C0\u67E5\u7EC4\u4EF6 "${n}" \u7684 render \u51FD\u6570`;let r=/\d{10,13}/;return r.test(t)||r.test(e)?"\u68C0\u6D4B\u5230\u65F6\u95F4\u6233\u5DEE\u5F02\uFF0C\u8003\u8651\u4F7F\u7528\u7EDF\u4E00\u7684\u65F6\u95F4\u6E90\u6216\u5EF6\u8FDF\u6CE8\u6C34":ae(t)===ae(e)?"HTML \u5185\u5BB9\u76F8\u540C\u4F46\u5C5E\u6027\u987A\u5E8F\u4E0D\u540C\uFF0C\u8FD9\u4E0D\u5F71\u54CD\u529F\u80FD\u4F46\u53EF\u80FD\u5BFC\u81F4 mismatch \u8B66\u544A":`\u8BF7\u786E\u4FDD\u7EC4\u4EF6 "${n}" \u5728\u670D\u52A1\u7AEF\u548C\u5BA2\u6237\u7AEF\u6E32\u67D3\u76F8\u540C\u7684\u8F93\u51FA`}function ae(t){return t.replace(/\s+/g," ").replace(/>\s+</g,"><").trim()}function mt(){return[...Z]}function pt(){Z.length=0}export{te as Comment,Q as Fragment,F as PatchFlags,x as ShapeFlags,v as StringRenderer,ee as Text,lt as clearIslandRegistry,pt as clearMismatchWarnings,ct as createHydrationIsland,Ve as createRenderer,Fe as getHydrateStats,at as getIslandRegistry,mt as getMismatchWarnings,We as hydrate,st as hydrateAllIslands,ce as hydrateIsland,Pe as isHydrating,ke as onHydrated,ot as registerIslandComponent,Oe as renderToStream,Ie as renderToStreamGenerator,Me as renderToString,le as resetHydrateStats,je as setHydrating,De as ssrRenderer,it as unmountIsland};
1
+ import{registerDOMOperations as Le}from"@lytjs/vdom";var x=(i=>(i[i.ELEMENT=1]="ELEMENT",i[i.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",i[i.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",i[i.TEXT_CHILDREN=8]="TEXT_CHILDREN",i[i.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",i[i.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",i))(x||{}),F=(d=>(d[d.TEXT=1]="TEXT",d[d.CLASS=2]="CLASS",d[d.STYLE=4]="STYLE",d[d.PROPS=8]="PROPS",d[d.FULL_PROPS=16]="FULL_PROPS",d[d.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",d[d.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",d[d.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",d[d.NEED_PATCH=256]="NEED_PATCH",d[d.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",d[d.HOISTED=-1]="HOISTED",d[d.BAIL=-2]="BAIL",d))(F||{}),Q=Symbol("Fragment"),ee=Symbol("Text"),te=Symbol("Comment");function C(t){return t.type===Q}function _(t){return t.type===ee}function M(t){return t.type===te}function ne(t,e){return t.type===e.type&&t.key===e.key}function k(t){return Array.isArray(t.dynamicChildren)}function re(t,e,n,r){if(n==="class")t.setClass(e,r);else if(n==="style")t.setStyle(e,r);else if(n.startsWith("on")||n.startsWith("@")){let s=n.startsWith("@")?n.slice(1).toLowerCase():n.slice(2).toLowerCase();t.addEventListener(e,s,r)}else n==="key"||n==="ref"||t.setAttribute(e,n,r)}function W(t,e,n,r,s){if(n==="class")t.setClass(e,r);else if(n==="style")t.setStyle(e,r||{});else if(n.startsWith("on")||n.startsWith("@")){let o=n.startsWith("@")?n.slice(1).toLowerCase():n.slice(2).toLowerCase();s&&t.removeEventListener(e,o,s),r&&t.addEventListener(e,o,r)}else t.setAttribute(e,n,r)}function G(t,e,n,r){for(let s in r){if(s==="key"||s==="ref")continue;let o=n[s],i=r[s];i!==o&&W(t,e,s,i,o)}for(let s in n)if(!(s==="key"||s==="ref")&&!(s in r))if(s==="class")t.setClass(e,"");else if(s==="style")t.setStyle(e,{});else if(s.startsWith("on")||s.startsWith("@")){let o=s.startsWith("@")?s.slice(1).toLowerCase():s.slice(2).toLowerCase();t.removeEventListener(e,o,n[s])}else t.removeAttribute(e,s)}function U(t,e,n,r,s,o){let{shapeFlag:i}=n;if(C(n)){ue(t,e,n,r,s,o);return}if(_(n)){let a=t.createText(n.children);n.el=a,t.insert(r,a,s);return}if(M(n)){let a=t.createComment(n.children);n.el=a,t.insert(r,a,s);return}if(i&1){ye(t,e,n,r,s,o);return}if(i&6){fe(e,n,r,s,o);return}}function ye(t,e,n,r,s,o){let i=n.type,a=t.createElement(i);if(n.el=a,n.props)for(let y in n.props){let u=n.props[y];re(t,a,y,u)}let{shapeFlag:l,children:c}=n;l&8?a.textContent=c:l&16&&O(e,c,a,null,o),t.insert(r,a,s)}function O(t,e,n,r,s){for(let o=0;o<e.length;o++)t(null,e[o],n,r,s)}function ue(t,e,n,r,s,o){let{children:i}=n,a=t.createComment("");t.insert(r,a,s),Array.isArray(i)&&i.length>0&&O(e,i,r,a,o),n.el=a,n.anchor=a}function fe(t,e,n,r,s){let o=e.component;o&&o.update&&o.update(),o&&o.subTree&&(t(null,o.subTree,n,r,o),e.el=o.subTree.el)}function se(t,e,n,r){let{shapeFlag:s,children:o}=n;if(C(n)){if(Array.isArray(o))for(let i=0;i<o.length;i++)e(o[i],r);n.anchor&&n.anchor.parentNode&&t.remove(n.anchor);return}if(s&6){n.component&&n.component.subTree&&e(n.component.subTree,r);return}n.el&&t.remove(n.el)}function I(t,e){for(let n=0;n<e.length;n++)t(e[n])}import{patchKeyedChildren as me,patchUnkeyedChildren as pe}from"@lytjs/vdom";function $(t,e,n,r,s,o=null,i=null){if(r==null){n&&e(n,s);return}if(n===null){U(t,Y(t,e),r,s,o,i);return}if(k(r)&&k(n)){Te(t,e,n,r,s,i);return}if(!ne(n,r)){e(n,s),U(t,Y(t,e),r,s,o,i);return}r.el=n.el,r.anchor=n.anchor;let{shapeFlag:a}=r;if(C(r)){Ne(t,e,n,r,s,o,i);return}if(_(r)){r.children!==n.children&&(r.el.nodeValue=r.children);return}if(M(r)){r.children!==n.children&&(r.el.nodeValue=r.children);return}if(a&1){ge(t,e,n,r,i);return}if(a&6){Se(n,r,i);return}}function Y(t,e){return(n,r,s,o,i)=>{$(t,e,n,r,s,o,i)}}function ge(t,e,n,r,s=null){let o=r.el=n.el,i=n.props||{},a=r.props||{},{patchFlag:l,dynamicProps:c}=r;if(l&&l>0){if(l&1&&n.children!==r.children&&(o.textContent=r.children),l&2&&i.class!==a.class&&t.setClass(o,a.class),l&4&&i.style!==a.style&&t.setStyle(o,a.style||{}),l&8&&c)for(let y=0;y<c.length;y++){let u=c[y],d=i[u],N=a[u];N!==d&&W(t,o,u,N,d)}l&16&&G(t,o,i,a)}else G(t,o,i,a);(!l||!(l&1))&&oe(t,e,n,r,o,null,s)}function oe(t,e,n,r,s,o,i){let a=n.shapeFlag,l=r.shapeFlag,c=n.children,y=r.children;if(l&8){a&16&&I(e,c),c!==y&&(s.textContent=y);return}if(l&16){a&16?he(t,e,c,y,s,o,i):(a&8&&(s.textContent=""),O(Y(t,e),y,s,o,i));return}y==null&&(a&8?s.textContent="":a&16&&I(e,c))}function he(t,e,n,r,s,o,i){r.every(l=>l.key!==null&&l.key!==void 0)&&n.every(l=>l.key!==null&&l.key!==void 0)?me(n,r,s,o,i,null,!1):pe(n,r,s,o,i,null,!1)}function Ne(t,e,n,r,s,o,i){let a=n.children,l=r.children;Array.isArray(l)&&l.length>0?(oe(t,e,n,r,s,o,i),r.el=l[0].el,r.anchor=l[l.length-1].el?t.nextSibling(l[l.length-1].el):o):Array.isArray(a)&&a.length>0&&l===null?(I(e,a),r.el=n.el,r.anchor=n.anchor):(r.el=n.el,r.anchor=n.anchor)}function Te(t,e,n,r,s,o){let i=n.dynamicChildren,a=r.dynamicChildren;for(let l=0;l<a.length;l++)$(t,e,i[l],a[l],s,null,o)}function Se(t,e,n){e.component=t.component,e.el=t.el,e.component&&e.component.update&&e.component.update()}function Ve(t){function e(s,o){se(t,e,s,o)}Le({insert(s,o,i){t.insert(o,s,i)},createElement(s){return t.createElement(s)},createText(s){return t.createText(s)},setText(s,o){s.nodeValue=o},setElementText(s,o){s.textContent=o},remove(s){t.remove(s)},createComment(s){return t.createComment(s)},mount(s,o,i,a,l,c,y){r(null,s,o,i,a)},patch(s,o,i,a,l,c,y,u){r(s,o,i,a,l)},unmount(s,o,i,a){e(s)},move(s,o,i){t.insert(o,s.el,i)}});function r(s,o,i,a,l){$(t,e,s,o,i,a,l)}return{mount(s,o){o.nodeType===1&&(o.textContent=""),r(null,s,o,null,null)},patch(s,o,i){var a;r(s,o,i||((a=s.el)==null?void 0:a.parentNode),null,null)},unmount(s,o){e(s,o)}}}var X=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ee={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},be=/[&<>"']/g,T={ELEMENT:1,FUNCTIONAL_COMPONENT:2,STATEFUL_COMPONENT:4,TEXT_CHILDREN:8,ARRAY_CHILDREN:16,SLOTS_CHILDREN:32},Ce=0;function f(t){return t.replace(be,e=>Ee[e])}function Re(t,e){return t.startsWith("on")||t.startsWith("@")||t==="key"||t==="ref"||t==="__vccOpts"||t.startsWith("__")?"":e===!0?t:e===!1||e===null||e===void 0?"":t==="class"?`class="${f(ie(e))}"`:t==="style"?`style="${f(He(e))}"`:t==="dangerouslySetInnerHTML"||t==="innerHTML"?"":`${t}="${f(String(e))}"`}function ie(t){if(!t)return"";if(typeof t=="string")return t;if(Array.isArray(t))return t.map(ie).filter(Boolean).join(" ");if(typeof t=="object"){let e=[];for(let n in t)t[n]&&e.push(n);return e.join(" ")}return String(t)}function He(t){if(!t)return"";if(typeof t=="string")return t;if(typeof t=="object"){let e=[];for(let n in t)if(t[n]){let r=n.replace(/([A-Z])/g,"-$1").toLowerCase();e.push(`${r}: ${t[n]}`)}return e.join("; ")}return String(t)}function z(t){if(!t)return"";let e=[];for(let n in t){let r=t[n],s=Re(n,r);s&&e.push(s)}return e.length>0?" "+e.join(" "):""}var v=class{createElement(e){return{tag:e,props:{},children:[]}}createText(e){return{type:"text",value:e}}createComment(e){return{type:"comment",value:e}}insert(e,n,r){e.children.push(n)}renderToString(e){return m(e)}async*renderToStream(e){yield*w(e)}};function m(t){if(t==null)return"";let{type:e,props:n,children:r}=t;return typeof e=="symbol"&&String(e)==="Symbol(Fragment)"?Array.isArray(r)?r.map(s=>m(s)).join(""):"":typeof e=="symbol"&&String(e).includes("Text")?f(String(r||"")):typeof e=="symbol"&&String(e).includes("Comment")?`<!--${String(r||"")}-->`:typeof e=="string"?Ae(e,n,r,t):typeof e=="object"&&e!==null||typeof e=="function"?R(t):""}function Ae(t,e,n,r){let s=z(e);if(X.has(t))return`<${t}${s} />`;if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let a=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;return`<${t}${s}>${a}</${t}>`}let o="",i=r.shapeFlag||0;return i&T.TEXT_CHILDREN?o=f(String(n||"")):i&T.ARRAY_CHILDREN&&Array.isArray(n)?o=n.map(a=>m(a)).join(""):i&T.SLOTS_CHILDREN&&typeof n=="object"&&n!==null?o=q(n):typeof n=="string"?o=f(n):Array.isArray(n)?o=n.map(a=>m(a)).join(""):typeof n=="number"&&(o=f(String(n))),`<${t}${s}>${o}</${t}>`}function q(t){let e=[];for(let n in t){let r=t[n];if(typeof r=="function"){let s=r();Array.isArray(s)?e.push(s.map(o=>m(o)).join("")):s!=null&&e.push(m(s))}else Array.isArray(r)?e.push(r.map(s=>m(s)).join("")):r!=null&&e.push(m(r))}return e.join("")}function R(t){let e=t.type;if(e&&e.__island)return xe(t,e);if(typeof e=="function"){let n=e(t.props||{},{slots:t.children||{}});return m(n)}if(typeof e=="object"&&e!==null){if(typeof e.render=="function"){let n=e.render(t.props||{},{slots:t.children||{},emit:()=>{}});return m(n)}if(typeof e.setup=="function"){let n=e.setup(t.props||{},{emit:()=>{},slots:t.children||{}});if(typeof n=="function"){let r=n();return m(r)}if(typeof e.render=="function"){let r=e.render(n||{},{slots:t.children||{},emit:()=>{}});return m(r)}}}return t.component&&t.component.subTree?m(t.component.subTree):"<!---->"}function xe(t,e){var N;let n=e.name||((N=t.props)==null?void 0:N["data-island-id"])||"anonymous",r=t.props||{},s=r["data-hydrate-when"]||e.__hydrateWhen||"",o=e.__islandTag||"div",i={};for(let g in r)g==="data-hydrate-when"||g==="data-island-id"||(i[g]=r[g]);let a=JSON.stringify(i),l=f(a),c="";if(typeof e.render=="function"){let g=e.render(r,{slots:t.children||{},emit:()=>{}});c=m(g)}else if(typeof e=="function"){let g=e(r,{slots:t.children||{}});c=m(g)}let y=s?` data-hydrate-when="${f(s)}"`:"",u=`<${o} data-hydrate="${f(n)}" data-props="${l}"${y}>${c}</${o}>`,d=`<script type="application/json" data-hydrate-props="${f(n)}">${a}<\/script>`;return u+d}async function*w(t){if(t==null)return;let{type:e,props:n,children:r}=t;if(typeof e=="symbol"&&String(e)==="Symbol(Fragment)"){if(Array.isArray(r))for(let s of r)yield*w(s);return}if(typeof e=="symbol"&&String(e).includes("Text")){yield f(String(r||""));return}if(typeof e=="symbol"&&String(e).includes("Comment")){yield`<!--${String(r||"")}-->`;return}if(typeof e=="string"){yield*_e(e,n,r,t);return}if(typeof e=="object"||typeof e=="function"){yield R(t);return}}async function*_e(t,e,n,r){let s=z(e);if(X.has(t)){yield`<${t}${s} />`;return}if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let i=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;yield`<${t}${s}>${i}</${t}>`;return}yield`<${t}${s}>`;let o=r.shapeFlag||0;if(o&T.TEXT_CHILDREN)yield f(String(n||""));else if(o&T.ARRAY_CHILDREN&&Array.isArray(n))for(let i of n)yield*w(i);else if(o&T.SLOTS_CHILDREN&&typeof n=="object"&&n!==null)yield q(n);else if(typeof n=="string")yield f(n);else if(Array.isArray(n))for(let i of n)yield*w(i);else typeof n=="number"&&(yield f(String(n)));yield`</${t}>`}function Me(t){return m(t)}function Oe(t,e){let n=(e==null?void 0:e.suspenseIdPrefix)||"suspense",r=S(t,n);return new ReadableStream({async pull(s){let{value:o,done:i}=await r.next();i?s.close():s.enqueue(o)},async cancel(){await r.return(void 0)}})}async function*Ie(t,e){let n=(e==null?void 0:e.suspenseIdPrefix)||"suspense";yield*S(t,n)}async function*S(t,e){if(t==null)return;let{type:n,props:r,children:s}=t;if(typeof n=="symbol"&&String(n)==="Symbol(Fragment)"){if(Array.isArray(s))for(let o of s)yield*S(o,e);return}if(typeof n=="symbol"&&String(n).includes("Text")){yield f(String(s||""));return}if(typeof n=="symbol"&&String(n).includes("Comment")){yield`<!--${String(s||"")}-->`;return}if(typeof n=="string"){yield*$e(n,r,s,t,e);return}if(typeof n=="object"&&n!==null){let o=n;if(o.name==="Suspense"||o._isSuspense){yield*ve(t,e);return}if(o._isAsyncComponent||o.__asyncSetup){yield*we(t,e);return}yield R(t);return}if(typeof n=="function"){yield R(t);return}}async function*$e(t,e,n,r,s){let o=z(e);if(X.has(t)){yield`<${t}${o} />`;return}if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let a=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;yield`<${t}${o}>${a}</${t}>`;return}yield`<${t}${o}>`;let i=r.shapeFlag||0;if(i&T.TEXT_CHILDREN)yield f(String(n||""));else if(i&T.ARRAY_CHILDREN&&Array.isArray(n))for(let a of n)yield*S(a,s);else if(i&T.SLOTS_CHILDREN&&typeof n=="object"&&n!==null)yield q(n);else if(typeof n=="string")yield f(n);else if(Array.isArray(n))for(let a of n)yield*S(a,s);else typeof n=="number"&&(yield f(String(n)));yield`</${t}>`}async function*ve(t,e){let n=`${e}-${Ce++}`,r=t.type,o=(t.props||{}).fallback,i="";o&&(typeof o=="object"&&o!==null?i=m(o):typeof o=="string"&&(i=o));let a=t.children,l=[];if(typeof a=="object"&&a!==null){if(Array.isArray(a))l=a;else if(typeof a.default=="function"){let u=a.default();Array.isArray(u)?l=u:u!=null&&(l=[u])}}let c=[];function y(u){for(let d of u){if(d==null)continue;let N=d.type;if(N&&(N._isAsyncComponent||N.__asyncSetup||d.__asyncSetup)){let g=d.__asyncPromise||N.__asyncPromise;g&&c.push(g.then(()=>{}))}}}if(y(l),c.length===0){for(let u of l)yield*S(u,e);return}yield`<!--${n}-fallback-->`,yield i,await Promise.all(c),yield`<!--${n}-resolved-->`;for(let u of l)yield*S(u,e);yield`<!--/${n}-->`}async function*we(t,e){let n=t.type,r=t.__asyncPromise||n.__asyncPromise;if(r)try{await r}catch(s){yield"<!--async-component-error-->";return}yield R(t)}var De=new v;var P={ELEMENT:1,FUNCTIONAL_COMPONENT:2,STATEFUL_COMPONENT:4,TEXT_CHILDREN:8,ARRAY_CHILDREN:16,SLOTS_CHILDREN:32},h=!1,K=[],p={success:!0,mismatches:0,hydratedNodes:0};function Pe(){return h}function je(t){h=t}function Fe(){return{...p}}function le(){p={success:!0,mismatches:0,hydratedNodes:0}}function ke(t){h?K.push(t):t()}function We(t,e,n={}){le(),n.onHydrated&&K.push(n.onHydrated),h=!0;try{let r=e.firstElementChild;return r?(t._vnode||t.mount(e),t._vnode&&V(r,t._vnode,n),h=!1,B(),p):(h=!1,t.mount(e),p.success=!1,B(),p)}catch(r){return h=!1,p.success=!1,e.innerHTML="",t.mount(e),B(),p}}function B(){let t=K.splice(0);for(let e of t)try{e()}catch(n){}}function V(t,e,n){if(Ke(e)){Xe(t,e,n);return}if(Je(e)){Ue(t,e,n);return}if(Ze(e)){Ye(t,e,n);return}if(Qe(e)){ze(t,e,n);return}if(typeof e.type=="string"){Ge(t,e,n);return}}function Ge(t,e,n){let r=t.tagName.toLowerCase(),s=e.type.toLowerCase();if(r!==s){j(t,e,`\u6807\u7B7E\u4E0D\u5339\u914D: DOM "${r}" vs VNode "${s}"`,n);return}e.el=t,e.props&&J(t,e.props),e.ref&&Be(t,e.ref),qe(t,e,n),p.hydratedNodes++}function Ue(t,e,n){if(t.nodeType!==3){j(t,e,"\u671F\u671B\u6587\u672C\u8282\u70B9",n);return}e.el=t;let r=t.nodeValue||"",s=String(e.children||"");r!==s&&(t.nodeValue=s,n.strict),p.hydratedNodes++}function Ye(t,e,n){if(t.nodeType!==8){j(t,e,"\u671F\u671B\u6CE8\u91CA\u8282\u70B9",n);return}e.el=t;let r=t.nodeValue||"",s=String(e.children||"");r!==s&&(t.nodeValue=s),p.hydratedNodes++}function Xe(t,e,n){if(!Array.isArray(e.children))return;let r=Array.from(t.childNodes);for(let s=0;s<e.children.length;s++){let o=e.children[s],i=r[s];if(!i){p.mismatches++;break}V(i,o,n)}}function ze(t,e,n){if(e.component&&e.component.subTree){V(t,e.component.subTree,n),e.el=e.component.subTree.el;return}let r=e.type;if(typeof r=="function")try{let s=r(e.props||{},{slots:e.children||{}});if(s){V(t,s,n),e.el=s.el;return}}catch(s){}if(typeof r=="object"&&r!==null&&typeof r.render=="function")try{let s=r.render(e.props||{},{slots:e.children||{},emit:()=>{}});if(s){V(t,s,n),e.el=s.el;return}}catch(s){}j(t,e,"\u7EC4\u4EF6\u65E0\u6CD5\u83B7\u53D6 subTree",n)}function qe(t,e,n){if(!e.children)return;let r=e.shapeFlag||0;if(typeof e.children=="string"||r&P.TEXT_CHILDREN){let s=t.textContent||"",o=String(e.children||"");s!==o&&(t.textContent=o,n.strict);return}if(Array.isArray(e.children)){let s=Array.from(t.childNodes),o=0;for(let i=0;i<s.length&&o<e.children.length;i++){let a=e.children[o];if(a==null){o++;continue}V(s[i],a,n),o++}o<e.children.length&&p.mismatches++}r&P.SLOTS_CHILDREN&&typeof e.children=="object"&&e.children}function J(t,e){for(let n in e){let r=e[n];if(n.startsWith("on")&&typeof r=="function"){let s=n.slice(2).toLowerCase();t.addEventListener(s,r)}}}function Be(t,e){typeof e=="function"?e(t):e&&typeof e=="object"&&(e.current=t)}function Ke(t){return typeof t.type=="symbol"&&String(t.type)==="Symbol(Fragment)"}function Je(t){return typeof t.type=="symbol"&&String(t.type).includes("Text")}function Ze(t){return typeof t.type=="symbol"&&String(t.type).includes("Comment")}function Qe(t){return!!((t.shapeFlag||0)&(P.STATEFUL_COMPONENT|P.FUNCTIONAL_COMPONENT)||typeof t.type=="object"&&t.type!==null||typeof t.type=="function")}function j(t,e,n,r){let s=`[lyt] \u6CE8\u6C34\u4E0D\u5339\u914D: ${n}`;if(p.mismatches++,r.strict)throw new Error(s)}var b=new Map,A=new Map,et={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},tt=/[&<>"']/g;function E(t){return t.replace(tt,e=>et[e])}function ce(t,e,n={}){let r=typeof document!="undefined"?document:null;if(!r)return{success:!1,mismatches:0,hydratedNodes:0};let s=r.querySelector(t);if(!s)return{success:!1,mismatches:0,hydratedNodes:0};let o=s.getAttribute("data-hydrate");if(!o)return{success:!1,mismatches:0,hydratedNodes:0};if(s.hasAttribute("data-hydrated"))return{success:!0,mismatches:0,hydratedNodes:0};let i=nt(o,r);if(i===null)return{success:!1,mismatches:0,hydratedNodes:0};let a=s.getAttribute("data-hydrate-when");return a||n.lazy?rt(s,o,e,i,a||"visible",n):L(s,o,e,i,n)}function nt(t,e){let n=e.querySelector(`script[type="application/json"][data-hydrate-props="${t}"]`);if(!n){let r=e.querySelector(`[data-hydrate="${t}"]`);if(r){let s=r.getAttribute("data-props");if(s)try{return JSON.parse(s)}catch(o){return null}}return{}}try{return JSON.parse(n.textContent||"{}")}catch(r){return null}}function L(t,e,n,r,s){let o={success:!0,mismatches:0,hydratedNodes:0};try{h=!0;let i=null;if(typeof n.render=="function")i=n.render(r,{slots:n.slots||{},emit:()=>{}});else if(typeof n.setup=="function"){let l=n.setup(r,{emit:()=>{},slots:n.slots||{}});typeof l=="function"&&(i=l())}if(!i)return h=!1,o.success=!1,o;if(s.dev!==!1){let l=yt(t,i,e);o.mismatches=l}V(t,i,s),o.hydratedNodes=p.hydratedNodes,i.props&&J(t,i.props),D(t,i),t.setAttribute("data-hydrated","");let a={id:e,hydrated:!0,instance:n,eventListeners:[],timeoutId:null,observer:null,interactionHandler:null};return b.set(e,a),A.set(e,n),h=!1,s.onHydrated&&s.onHydrated(),o}catch(i){return h=!1,o.success=!1,o}}function D(t,e){if(!(!e.children||typeof e.children=="string")&&Array.isArray(e.children)){let n=Array.from(t.children),r=0;for(let s=0;s<n.length&&r<e.children.length;s++){let o=e.children[r];if(o==null){r++;continue}if(typeof o.type=="string"&&o.props)J(n[s],o.props),D(n[s],o);else if(typeof o.type=="object"||typeof o.type=="function"){let i=o.type;if(typeof i=="function")try{let a=i(o.props||{},{slots:o.children||{}});a&&n[s]&&D(n[s],a)}catch(a){}else if(i&&typeof i.render=="function")try{let a=i.render(o.props||{},{slots:o.children||{},emit:()=>{}});a&&n[s]&&D(n[s],a)}catch(a){}}r++}}}function rt(t,e,n,r,s,o){let i={success:!0,mismatches:0,hydratedNodes:0},a=null;o.timeout&&o.timeout>0&&(a=setTimeout(()=>{de(t,e),L(t,e,n,r,o)},o.timeout));let l={id:e,hydrated:!1,instance:n,eventListeners:[],timeoutId:a,observer:null,interactionHandler:null};switch(b.set(e,l),A.set(e,n),s){case"visible":{if(typeof IntersectionObserver!="undefined"){let c=new IntersectionObserver(y=>{for(let u of y)u.isIntersecting&&(c.unobserve(u.target),l.observer=null,a&&clearTimeout(a),l.timeoutId=null,L(t,e,n,r,o))},{rootMargin:"200px"});c.observe(t),l.observer=c}else a&&clearTimeout(a),L(t,e,n,r,o);break}case"idle":{(y=>{typeof requestIdleCallback!="undefined"?requestIdleCallback(y,{timeout:o.timeout||2e3}):setTimeout(y,1)})(()=>{a&&clearTimeout(a),l.timeoutId=null,t.hasAttribute("data-hydrated")||L(t,e,n,r,o)});break}case"interaction":{let c=()=>{a&&clearTimeout(a),l.timeoutId=null,l.interactionHandler=null,document.removeEventListener("click",c),document.removeEventListener("keydown",c),document.removeEventListener("scroll",c),document.removeEventListener("touchstart",c),t.hasAttribute("data-hydrated")||L(t,e,n,r,o)};document.addEventListener("click",c,{once:!1,passive:!0}),document.addEventListener("keydown",c,{once:!1,passive:!0}),document.addEventListener("scroll",c,{once:!1,passive:!0}),document.addEventListener("touchstart",c,{once:!1,passive:!0}),l.interactionHandler=c;break}default:a&&clearTimeout(a),L(t,e,n,r,o)}return i}function de(t,e){let n=b.get(e);n&&(n.observer&&(n.observer.disconnect(),n.observer=null),n.timeoutId!==null&&(clearTimeout(n.timeoutId),n.timeoutId=null),n.interactionHandler&&(document.removeEventListener("click",n.interactionHandler),document.removeEventListener("keydown",n.interactionHandler),document.removeEventListener("scroll",n.interactionHandler),document.removeEventListener("touchstart",n.interactionHandler),n.interactionHandler=null))}function st(t={}){let e=typeof document!="undefined"?document:null;if(!e)return{success:!1,mismatches:0,hydratedNodes:0};let n=e.querySelectorAll("[data-hydrate]:not([data-hydrated])"),r={success:!0,mismatches:0,hydratedNodes:0};return n.forEach(s=>{let o=s.getAttribute("data-hydrate"),i=A.get(o);if(!i){r.success=!1;return}let a=ce(`[data-hydrate="${o}"]`,i,t);r.mismatches+=a.mismatches,r.hydratedNodes+=a.hydratedNodes,a.success||(r.success=!1)}),r}function ot(t,e){A.set(t,e)}function it(t){if(!b.get(t))return;let n=typeof document!="undefined"?document.querySelector(`[data-hydrate="${t}"]`):null;n&&(de(n,t),n.removeAttribute("data-hydrated")),b.delete(t),A.delete(t)}function at(){return b}function lt(){b.clear(),A.clear()}function ct(t,e={},n="div",r){let s=t.name||"anonymous",o=JSON.stringify(e),i=E(o),a="";if(typeof t.render=="function"){let u=t.render(e,{slots:t.slots||{},emit:()=>{}});a=H(u)}let l=r?` data-hydrate-when="${r}"`:"",c=`<${n} data-hydrate="${s}" data-props="${i}"${l}>${a}</${n}>`,y=`<script type="application/json" data-hydrate-props="${s}">${o}<\/script>`;return c+y}function H(t){if(t==null)return"";let{type:e,props:n,children:r}=t;if(typeof e=="symbol"&&String(e)==="Symbol(Fragment)")return Array.isArray(r)?r.map(s=>H(s)).join(""):"";if(typeof e=="symbol"&&String(e).includes("Text"))return E(String(r||""));if(typeof e=="symbol"&&String(e).includes("Comment"))return`<!--${String(r||"")}-->`;if(typeof e=="string"){let s=dt(n);if(new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]).has(e))return`<${e}${s} />`;let i="";return typeof r=="string"?i=E(r):Array.isArray(r)?i=r.map(a=>H(a)).join(""):typeof r=="number"&&(i=E(String(r))),`<${e}${s}>${i}</${e}>`}if(typeof e=="function"){let s=e(n||{},{slots:r||{}});return H(s)}if(typeof e=="object"&&e!==null){let s=e;if(typeof s.render=="function"){let o=s.render(n||{},{slots:r||{},emit:()=>{}});return H(o)}}return""}function dt(t){if(!t)return"";let e=[];for(let n in t){let r=t[n];if(!(n.startsWith("on")||n.startsWith("@")||n==="key"||n==="ref")&&!(n==="__vccOpts"||n.startsWith("__"))&&!(n==="dangerouslySetInnerHTML"||n==="innerHTML"))if(r===!0)e.push(n);else{if(r===!1||r===null||r===void 0)continue;n==="class"&&typeof r=="string"?e.push(`class="${E(r)}"`):n==="style"&&typeof r=="string"?e.push(`style="${E(r)}"`):e.push(`${n}="${E(String(r))}"`)}}return e.length>0?" "+e.join(" "):""}var Z=[];function yt(t,e,n){let r=0,s=ut(t),o=H(e);if(s!==o){r++;let i={islandId:n,expected:o,actual:s,suggestion:ft(s,o,n)};Z.push(i)}return r}function ut(t){let e=t.cloneNode(!0);return e.removeAttribute("data-hydrate"),e.removeAttribute("data-props"),e.removeAttribute("data-hydrate-when"),e.removeAttribute("data-hydrated"),e.innerHTML}function ft(t,e,n){if(t.trim()==="")return`\u670D\u52A1\u7AEF\u6E32\u67D3\u4E3A\u7A7A\uFF0C\u8BF7\u68C0\u67E5\u7EC4\u4EF6 "${n}" \u7684\u670D\u52A1\u7AEF\u6E32\u67D3\u903B\u8F91`;if(e.trim()==="")return`\u5BA2\u6237\u7AEF\u6E32\u67D3\u4E3A\u7A7A\uFF0C\u8BF7\u68C0\u67E5\u7EC4\u4EF6 "${n}" \u7684 render \u51FD\u6570`;let r=/\d{10,13}/;return r.test(t)||r.test(e)?"\u68C0\u6D4B\u5230\u65F6\u95F4\u6233\u5DEE\u5F02\uFF0C\u8003\u8651\u4F7F\u7528\u7EDF\u4E00\u7684\u65F6\u95F4\u6E90\u6216\u5EF6\u8FDF\u6CE8\u6C34":ae(t)===ae(e)?"HTML \u5185\u5BB9\u76F8\u540C\u4F46\u5C5E\u6027\u987A\u5E8F\u4E0D\u540C\uFF0C\u8FD9\u4E0D\u5F71\u54CD\u529F\u80FD\u4F46\u53EF\u80FD\u5BFC\u81F4 mismatch \u8B66\u544A":`\u8BF7\u786E\u4FDD\u7EC4\u4EF6 "${n}" \u5728\u670D\u52A1\u7AEF\u548C\u5BA2\u6237\u7AEF\u6E32\u67D3\u76F8\u540C\u7684\u8F93\u51FA`}function ae(t){return t.replace(/\s+/g," ").replace(/>\s+</g,"><").trim()}function mt(){return[...Z]}function pt(){Z.length=0}export{te as Comment,Q as Fragment,F as PatchFlags,x as ShapeFlags,v as StringRenderer,ee as Text,lt as clearIslandRegistry,pt as clearMismatchWarnings,ct as createHydrationIsland,Ve as createRenderer,Fe as getHydrateStats,at as getIslandRegistry,mt as getMismatchWarnings,We as hydrate,st as hydrateAllIslands,ce as hydrateIsland,Pe as isHydrating,ke as onHydrated,ot as registerIslandComponent,Oe as renderToStream,Ie as renderToStreamGenerator,Me as renderToString,le as resetHydrateStats,je as setHydrating,De as ssrRenderer,it as unmountIsland};
package/dist/vapor.cjs CHANGED
@@ -1 +1 @@
1
- var j=Object.defineProperty;var le=Object.getOwnPropertyDescriptor;var pe=Object.getOwnPropertyNames;var ce=Object.prototype.hasOwnProperty;var de=(e,i)=>{for(var t in i)j(e,t,{get:i[t],enumerable:!0})},fe=(e,i,t,n)=>{if(i&&typeof i=="object"||typeof i=="function")for(let o of pe(i))!ce.call(e,o)&&o!==t&&j(e,o,{get:()=>i[o],enumerable:!(n=le(i,o))||n.enumerable});return e};var ye=e=>fe(j({},"__esModule",{value:!0}),e);var Re={};de(Re,{Comment:()=>k,Fragment:()=>P,PatchFlags:()=>E,ShapeFlags:()=>h,Text:()=>U,bindAttr:()=>M,bindClass:()=>_,bindEach:()=>X,bindEvent:()=>D,bindIf:()=>z,bindProp:()=>v,bindText:()=>O,compileToVapor:()=>w,createRenderer:()=>ne,createVaporApp:()=>se,createVaporElement:()=>Z,defineVaporComponent:()=>ie,getVaporDOMFactory:()=>N,parseTemplate:()=>F,renderVaporComponent:()=>ae,renderVaporNode:()=>u,setVaporDOMFactory:()=>re,vaporMount:()=>B,vaporPatch:()=>G});module.exports=ye(Re);var te=require("@lytjs/vdom");var h=(s=>(s[s.ELEMENT=1]="ELEMENT",s[s.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",s[s.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",s[s.TEXT_CHILDREN=8]="TEXT_CHILDREN",s[s.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",s[s.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",s))(h||{}),E=(p=>(p[p.TEXT=1]="TEXT",p[p.CLASS=2]="CLASS",p[p.STYLE=4]="STYLE",p[p.PROPS=8]="PROPS",p[p.FULL_PROPS=16]="FULL_PROPS",p[p.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",p[p.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",p[p.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",p[p.NEED_PATCH=256]="NEED_PATCH",p[p.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",p[p.HOISTED=-1]="HOISTED",p[p.BAIL=-2]="BAIL",p))(E||{}),P=Symbol("Fragment"),U=Symbol("Text"),k=Symbol("Comment");function V(e){return e.type===P}function b(e){return e.type===U}function T(e){return e.type===k}function q(e,i){return e.type===i.type&&e.key===i.key}function H(e){return Array.isArray(e.dynamicChildren)}function J(e,i,t,n){if(t==="class")e.setClass(i,n);else if(t==="style")e.setStyle(i,n);else if(t.startsWith("on")||t.startsWith("@")){let o=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();e.addEventListener(i,o,n)}else t==="key"||t==="ref"||e.setAttribute(i,t,n)}function W(e,i,t,n,o){if(t==="class")e.setClass(i,n);else if(t==="style")e.setStyle(i,n||{});else if(t.startsWith("on")||t.startsWith("@")){let r=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();o&&e.removeEventListener(i,r,o),n&&e.addEventListener(i,r,n)}else e.setAttribute(i,t,n)}function K(e,i,t,n){for(let o in n){if(o==="key"||o==="ref")continue;let r=t[o],s=n[o];s!==r&&W(e,i,o,s,r)}for(let o in t)if(!(o==="key"||o==="ref")&&!(o in n))if(o==="class")e.setClass(i,"");else if(o==="style")e.setStyle(i,{});else if(o.startsWith("on")||o.startsWith("@")){let r=o.startsWith("@")?o.slice(1).toLowerCase():o.slice(2).toLowerCase();e.removeEventListener(i,r,t[o])}else e.removeAttribute(i,o)}function Y(e,i,t,n,o,r){let{shapeFlag:s}=t;if(V(t)){me(e,i,t,n,o,r);return}if(b(t)){let a=e.createText(t.children);t.el=a,e.insert(n,a,o);return}if(T(t)){let a=e.createComment(t.children);t.el=a,e.insert(n,a,o);return}if(s&1){ue(e,i,t,n,o,r);return}if(s&6){ge(i,t,n,o,r);return}}function ue(e,i,t,n,o,r){let s=t.type,a=e.createElement(s);if(t.el=a,t.props)for(let c in t.props){let d=t.props[c];J(e,a,c,d)}let{shapeFlag:l,children:f}=t;l&8?a.textContent=f:l&16&&A(i,f,a,null,r),e.insert(n,a,o)}function A(e,i,t,n,o){for(let r=0;r<i.length;r++)e(null,i[r],t,n,o)}function me(e,i,t,n,o,r){let{children:s}=t,a=e.createComment("");e.insert(n,a,o),Array.isArray(s)&&s.length>0&&A(i,s,n,a,r),t.el=a,t.anchor=a}function ge(e,i,t,n,o){let r=i.component;r&&r.update&&r.update(),r&&r.subTree&&(e(null,r.subTree,t,n,r),i.el=r.subTree.el)}function Q(e,i,t,n){let{shapeFlag:o,children:r}=t;if(V(t)){if(Array.isArray(r))for(let s=0;s<r.length;s++)i(r[s],n);t.anchor&&t.anchor.parentNode&&e.remove(t.anchor);return}if(o&6){t.component&&t.component.subTree&&i(t.component.subTree,n);return}t.el&&e.remove(t.el)}function R(e,i){for(let t=0;t<i.length;t++)e(i[t])}var L=require("@lytjs/vdom");function S(e,i,t,n,o,r=null,s=null){if(n==null){t&&i(t,o);return}if(t===null){Y(e,$(e,i),n,o,r,s);return}if(H(n)&&H(t)){ve(e,i,t,n,o,s);return}if(!q(t,n)){i(t,o),Y(e,$(e,i),n,o,r,s);return}n.el=t.el,n.anchor=t.anchor;let{shapeFlag:a}=n;if(V(n)){Ne(e,i,t,n,o,r,s);return}if(b(n)){n.children!==t.children&&(n.el.nodeValue=n.children);return}if(T(n)){n.children!==t.children&&(n.el.nodeValue=n.children);return}if(a&1){he(e,i,t,n,s);return}if(a&6){xe(t,n,s);return}}function $(e,i){return(t,n,o,r,s)=>{S(e,i,t,n,o,r,s)}}function he(e,i,t,n,o=null){let r=n.el=t.el,s=t.props||{},a=n.props||{},{patchFlag:l,dynamicProps:f}=n;if(l&&l>0){if(l&1&&t.children!==n.children&&(r.textContent=n.children),l&2&&s.class!==a.class&&e.setClass(r,a.class),l&4&&s.style!==a.style&&e.setStyle(r,a.style||{}),l&8&&f)for(let c=0;c<f.length;c++){let d=f[c],p=s[d],y=a[d];y!==p&&W(e,r,d,y,p)}l&16&&K(e,r,s,a)}else K(e,r,s,a);(!l||!(l&1))&&ee(e,i,t,n,r,null,o)}function ee(e,i,t,n,o,r,s){let a=t.shapeFlag,l=n.shapeFlag,f=t.children,c=n.children;if(l&8){a&16&&R(i,f),f!==c&&(o.textContent=c);return}if(l&16){a&16?Ve(e,i,f,c,o,r,s):(a&8&&(o.textContent=""),A($(e,i),c,o,r,s));return}c==null&&(a&8?o.textContent="":a&16&&R(i,f))}function Ve(e,i,t,n,o,r,s){n.every(l=>l.key!=null)&&t.every(l=>l.key!=null)?(0,L.patchKeyedChildren)(t,n,o,r,s,null,!1):(0,L.patchUnkeyedChildren)(t,n,o,r,s,null,!1)}function Ne(e,i,t,n,o,r,s){let a=t.children,l=n.children;Array.isArray(l)&&l.length>0?(ee(e,i,t,n,o,r,s),n.el=l[0].el,n.anchor=l[l.length-1].el?e.nextSibling(l[l.length-1].el):r):Array.isArray(a)&&a.length>0&&l===null?(R(i,a),n.el=t.el,n.anchor=t.anchor):(n.el=t.el,n.anchor=t.anchor)}function ve(e,i,t,n,o,r){let s=t.dynamicChildren,a=n.dynamicChildren;for(let l=0;l<a.length;l++)S(e,i,s[l],a[l],o,null,r)}function xe(e,i,t){i.component=e.component,i.el=e.el,i.component&&i.component.update&&i.component.update()}function ne(e){function i(o,r){Q(e,i,o,r)}(0,te.registerDOMOperations)({insert(o,r,s){e.insert(r,o,s)},createElement(o){return e.createElement(o)},createText(o){return e.createText(o)},setText(o,r){o.nodeValue=r},setElementText(o,r){o.textContent=r},remove(o){e.remove(o)},createComment(o){return e.createComment(o)},mount(o,r,s,a,l,f,c){n(null,o,r,s,a)},patch(o,r,s,a,l,f,c,d){n(o,r,s,a,l)},unmount(o,r,s,a){i(o)},move(o,r,s){e.insert(r,o.el,s)}});function n(o,r,s,a,l){S(e,i,o,r,s,a,l)}return{mount(o,r){r.nodeType===1&&(r.textContent=""),n(null,o,r,null,null)},patch(o,r,s){var a;n(o,r,s||((a=o.el)==null?void 0:a.parentNode),null,null)},unmount(o,r){i(o,r)}}}var m=require("@lytjs/reactivity/signal");function O(e,i){return(0,m.effect)(()=>{let n=i();e.textContent=n==null?"":String(n)})}function v(e,i,t){return(0,m.effect)(()=>{let o=t();e[i]=o})}function M(e,i,t){return(0,m.effect)(()=>{let o=t();o==null||o===!1?e.removeAttribute(i):e.setAttribute(i,o===!0?"":String(o))})}function _(e,i){return(0,m.effect)(()=>{let n=i();if(typeof n=="string")e.className=n;else if(Array.isArray(n))e.className=n.filter(Boolean).join(" ");else if(typeof n=="object"&&n!==null){let o=[];for(let r of Object.keys(n))n[r]&&o.push(r);e.className=o.join(" ")}else e.className=""})}function D(e,i,t){return e.addEventListener(i,t),()=>{e.removeEventListener(i,t)}}function z(e,i){return(0,m.effect)(()=>{i()?(e.style=e.style||{},e.style.display==="none"&&(e.style.display=""),e.hidden=!1):(e.style=e.style||{},e.style.display="none",e.hidden=!0)})}function X(e,i,t,n){let o=[],r=[],s=new Map,a=(0,m.effect)(()=>{let l=i();if(!Array.isArray(l))return;let f=l.map((c,d)=>n?n(c,d):d);if(f.length===r.length){let c=!0;for(let d=0;d<f.length;d++)if(f[d]!==r[d]){c=!1;break}if(c){for(let d=0;d<l.length;d++){let p=t(l[d],d),y=o[d];y&&y.parentNode===e&&e.replaceChild(p,y),o[d]=p}return}}for(let c of o)c.parentNode===e&&e.removeChild(c);s.clear(),o=[],r=[];for(let c=0;c<l.length;c++){let d=t(l[c],c);e.appendChild(d),o.push(d),r.push(f[c]),s.set(f[c],d)}});return()=>{a();for(let l of o)l.parentNode===e&&e.removeChild(l);o=[],r=[],s.clear()}}var I=e=>{if(typeof document!="undefined")return document.createElement(e);throw new Error("[lyt:vapor] \u672A\u8BBE\u7F6E DOM \u5DE5\u5382\u51FD\u6570\u3002\u5728\u975E\u6D4F\u89C8\u5668\u73AF\u5883\u4E2D\u8BF7\u8C03\u7528 setVaporDOMFactory()")};function re(e){I=e}function N(){return I}function Z(e,i,...t){let n={tag:e,children:[],props:{},events:{},bindings:[]};if(i)for(let[o,r]of Object.entries(i))if(o.startsWith("on")&&typeof r=="function"&&!oe(r)){let s=o.slice(2).toLowerCase();n.events[s]=r}else oe(r)?o==="textContent"||o==="text"?n.bindings.push({type:"text",target:"textContent",signal:r}):o==="className"||o==="class"?n.bindings.push({type:"class",target:"className",signal:r}):o==="style"?n.bindings.push({type:"style",target:"style",signal:r}):n.bindings.push({type:"prop",target:o,signal:r}):n.props[o]=r;for(let o of t)typeof o=="string"?n.children.push({tag:"#text",children:[],props:{},events:{},bindings:[],text:o}):n.children.push(o);return n}function oe(e){return typeof e!="function"?!1:!!(e._subscribe||e.set)&&!e.toString().startsWith("class")}function u(e){if(e.tag==="#text"){let t=I("#text");return t.textContent=e.text||"",t.nodeType=3,t}let i=I(e.tag);e.el=i;for(let[t,n]of Object.entries(e.props))if(t==="style"&&typeof n=="object")for(let[o,r]of Object.entries(n))i.style[o]=r;else t==="className"||t==="class"?i.className=String(n):i[t]=n;for(let t of e.bindings)t.type==="text"?O(i,t.signal):t.type==="prop"?v(i,t.target,t.signal):t.type==="attr"?M(i,t.target,t.signal):t.type==="class"?_(i,t.signal):t.type==="style"&&v(i,"style",t.signal);for(let[t,n]of Object.entries(e.events))D(i,t,n);for(let t of e.children){let n=u(t);i.appendChild(n)}return i}function G(e,i,t){if(e.tag!==i.tag){let r=u(i);e.el&&e.el.parentNode===t&&t.removeChild(e.el),t.appendChild(r);return}let n=e.el||u(e);i.el=n;for(let[r,s]of Object.entries(i.props))if(r==="style"&&typeof s=="object")for(let[a,l]of Object.entries(s))n.style[a]=l;else r==="className"||r==="class"?n.className=String(s):n[r]=s;i.text!==void 0&&(n.textContent=i.text);for(let[r,s]of Object.entries(e.events))i.events[r]||n.removeEventListener(r,s);for(let[r,s]of Object.entries(i.events))e.events[r]!==s&&(e.events[r]&&n.removeEventListener(r,e.events[r]),n.addEventListener(r,s));let o=Math.max(e.children.length,i.children.length);for(let r=0;r<o;r++){let s=e.children[r],a=i.children[r];if(!s&&a){let l=u(a);n.appendChild(l)}else s&&!a?s.el&&s.el.parentNode===n&&n.removeChild(s.el):s&&a&&G(s,a,n)}}function B(e,i){let t=i.setup?i.setup():{};i.beforeMount&&i.beforeMount();let n;if(i.render){let r=i.render(t,Z);n=Array.isArray(r)?r:[r]}else n=[];let o=[];for(let r of n){let s=u(r);e.appendChild(s),o.push(s)}return i.mounted&&i.mounted(),()=>{i.beforeUnmount&&i.beforeUnmount();for(let r of o)e.removeChild(r);i.unmounted&&i.unmounted()}}function F(e){let i={type:"fragment",children:[]},t=e.trim();for(;t.length>0;){let n=t.match(/^<([a-zA-Z][a-zA-Z0-9-]*)([\s\S]*?)(\/?)>/);if(n){let o=n[1],r=n[2],s=n[3]==="/",{props:a,events:l,directives:f}=Ee(r),c={type:"element",tag:o,props:a,events:l,directives:f,children:[]};if(t=t.slice(n[0].length),s){i.children.push(c);continue}let d=`</${o}>`,p=Ce(t,o);if(p===-1)throw new Error(`[lyt:vapor:compiler] \u672A\u627E\u5230\u95ED\u5408\u6807\u7B7E: </${o}>`);let y=t.slice(0,p);t=t.slice(p+d.length);let g=F(y);c.children=g.children||[],i.children.push(c)}else{let o=t.indexOf("<"),r;if(o===-1?(r=t,t=""):(r=t.slice(0,o),t=t.slice(o)),r.trim())if(r.includes("{{")){let s=be(r);for(let a of s)a.type==="text"?i.children.push({type:"text",text:a.value}):i.children.push({type:"interpolation",expression:a.value})}else i.children.push({type:"text",text:r})}}return i}function Ce(e,i){let t=1,n=0,o=`<${i}`,r=`</${i}>`;for(;n<e.length&&t>0;){let s=e.indexOf(o,n),a=e.indexOf(r,n);if(a===-1)return-1;if(s!==-1&&s<a){let l=e[s+o.length];l===">"||l===" "||l==="/"?(t++,n=s+o.length):(n=a+r.length,t--)}else n=a+r.length,t--}return t===0?n-r.length:-1}function Ee(e){let i={},t={},n={},o=/([a-zA-Z@:][a-zA-Z0-9@:.-]*)\s*=\s*(?:"([^"]*)"|'([^']*)')/g,r;for(;(r=o.exec(e))!==null;){let s=r[1],a=r[2]||r[3];if(s.startsWith("on:")){let l=s.slice(3);t[l]=a}else if(s.startsWith(":")){let l=s.slice(1);i[l]=a}else if(s==="v-if")n.if=a;else if(s==="v-each"){let l=a.match(/^\s*(\w+)\s+in\s+(.+)\s*$/);l&&(n.each={item:l[1],expression:l[2]})}else i[s]=a}return{props:i,events:t,directives:n}}function be(e){let i=[],t=/\{\{([\s\S]*?)\}\}/g,n=0,o;for(;(o=t.exec(e))!==null;)o.index>n&&i.push({type:"text",value:e.slice(n,o.index)}),i.push({type:"interpolation",value:o[1].trim()}),n=o.index+o[0].length;return n<e.length&&i.push({type:"text",value:e.slice(n)}),i}function w(e){let i=F(e);return{render:Te(i),ast:i}}function Te(e){return function(t){let n=N();return C(e,t,n)}}function C(e,i,t){var n,o;if(e.type==="fragment"){if(e.children&&e.children.length===1)return C(e.children[0],i,t);let r=t("div");if(r.nodeType=11,e.children)for(let s of e.children){let a=C(s,i,t);r.appendChild(a)}return r}if(e.type==="text"){let r=t("#text");return r.textContent=e.text||"",r.nodeType=3,r}if(e.type==="interpolation"){let r=t("span"),s=e.expression||"",a=x(i,s);return r.textContent=a!=null?String(a):"",r}if(e.type==="element"){if((n=e.directives)!=null&&n.each){let{item:s,expression:a}=e.directives.each,l=x(i,a),f=t("#fragment");if(f.childNodes=[],f.nodeType=11,Array.isArray(l))for(let c=0;c<l.length;c++){let d={...i,[s]:l[c],index:c},p=t(e.tag);if(e.props)for(let[y,g]of Object.entries(e.props))y==="class"||y==="className"?p.className=g:p[y]=g;if(e.children)for(let y of e.children){let g=C(y,d,t);p.appendChild(g)}f.appendChild(p)}return f}let r=t(e.tag);if((o=e.directives)!=null&&o.if&&(x(i,e.directives.if)||(r.style=r.style||{},r.style.display="none",r.hidden=!0)),e.props)for(let[s,a]of Object.entries(e.props))if(s.startsWith(":")){let l=s.slice(1),f=x(i,a);r[l]=f}else s==="class"||s==="className"?r.className=a:r[s]=a;if(e.events)for(let[s,a]of Object.entries(e.events)){let l=x(i,a);typeof l=="function"&&r.addEventListener(s,l)}if(e.children)for(let s of e.children){let a=C(s,i,t);if(a.nodeType===11&&a.childNodes)for(let l of a.childNodes)r.appendChild(l);else r.appendChild(a)}return r}return t("div")}function x(e,i){let t=i.trim();if(/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(t)){let r=e[t];return typeof r=="function"&&!r.prototype?r():r}let n=t.split("."),o=e;for(let r of n){if(o==null)return;o=o[r],typeof o=="function"&&!o.prototype&&n.indexOf(r)<n.length-1&&(o=o())}return o}function ie(e){return e}function se(e){let i=!1,t=null,n=null;return{mount(o){if(!i){if(typeof o=="string")if(typeof document!="undefined"){let r=document.querySelector(o);if(!r)throw new Error(`[lyt:vapor] \u672A\u627E\u5230\u6302\u8F7D\u76EE\u6807: ${o}`);n=r}else throw new Error("[lyt:vapor] \u5728\u975E\u6D4F\u89C8\u5668\u73AF\u5883\u4E2D\uFF0C\u8BF7\u76F4\u63A5\u4F20\u5165\u5BB9\u5668\u5143\u7D20");else n=o;t=B(n,e),i=!0}},unmount(){i&&(t&&(t(),t=null),i=!1,n=null)}}}function ae(e){let i=e.setup?e.setup():{};e.beforeMount&&e.beforeMount();let t;if(e.template){let{render:n}=w(e.template);t=n(i)}else if(e.render){let n=e.render(i,Ae),o=Array.isArray(n)?n:[n];if(o.length===1)t=u(o[0]);else{t=N()("div");for(let s of o)t.appendChild(u(s))}}else throw new Error("[lyt:vapor] \u7EC4\u4EF6\u5FC5\u987B\u63D0\u4F9B template \u6216 render \u51FD\u6570");return e.mounted&&e.mounted(),t}function Ae(e,i,...t){let n={tag:e,children:[],props:i||{},events:{},bindings:[]};for(let o of t)typeof o=="string"?n.children.push({tag:"#text",children:[],props:{},events:{},bindings:[],text:o}):n.children.push(o);return n}
1
+ var j=Object.defineProperty;var le=Object.getOwnPropertyDescriptor;var pe=Object.getOwnPropertyNames;var ce=Object.prototype.hasOwnProperty;var de=(e,i)=>{for(var t in i)j(e,t,{get:i[t],enumerable:!0})},fe=(e,i,t,n)=>{if(i&&typeof i=="object"||typeof i=="function")for(let o of pe(i))!ce.call(e,o)&&o!==t&&j(e,o,{get:()=>i[o],enumerable:!(n=le(i,o))||n.enumerable});return e};var ye=e=>fe(j({},"__esModule",{value:!0}),e);var Re={};de(Re,{Comment:()=>U,Fragment:()=>P,PatchFlags:()=>E,ShapeFlags:()=>h,Text:()=>k,bindAttr:()=>M,bindClass:()=>_,bindEach:()=>X,bindEvent:()=>D,bindIf:()=>z,bindProp:()=>v,bindText:()=>O,compileToVapor:()=>w,createRenderer:()=>ne,createVaporApp:()=>se,createVaporElement:()=>Z,defineVaporComponent:()=>ie,getVaporDOMFactory:()=>N,parseTemplate:()=>F,renderVaporComponent:()=>ae,renderVaporNode:()=>u,setVaporDOMFactory:()=>re,vaporMount:()=>B,vaporPatch:()=>G});module.exports=ye(Re);var te=require("@lytjs/vdom");var h=(s=>(s[s.ELEMENT=1]="ELEMENT",s[s.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",s[s.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",s[s.TEXT_CHILDREN=8]="TEXT_CHILDREN",s[s.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",s[s.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",s))(h||{}),E=(c=>(c[c.TEXT=1]="TEXT",c[c.CLASS=2]="CLASS",c[c.STYLE=4]="STYLE",c[c.PROPS=8]="PROPS",c[c.FULL_PROPS=16]="FULL_PROPS",c[c.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",c[c.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",c[c.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",c[c.NEED_PATCH=256]="NEED_PATCH",c[c.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",c[c.HOISTED=-1]="HOISTED",c[c.BAIL=-2]="BAIL",c))(E||{}),P=Symbol("Fragment"),k=Symbol("Text"),U=Symbol("Comment");function V(e){return e.type===P}function b(e){return e.type===k}function T(e){return e.type===U}function q(e,i){return e.type===i.type&&e.key===i.key}function H(e){return Array.isArray(e.dynamicChildren)}function J(e,i,t,n){if(t==="class")e.setClass(i,n);else if(t==="style")e.setStyle(i,n);else if(t.startsWith("on")||t.startsWith("@")){let o=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();e.addEventListener(i,o,n)}else t==="key"||t==="ref"||e.setAttribute(i,t,n)}function W(e,i,t,n,o){if(t==="class")e.setClass(i,n);else if(t==="style")e.setStyle(i,n||{});else if(t.startsWith("on")||t.startsWith("@")){let r=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();o&&e.removeEventListener(i,r,o),n&&e.addEventListener(i,r,n)}else e.setAttribute(i,t,n)}function K(e,i,t,n){for(let o in n){if(o==="key"||o==="ref")continue;let r=t[o],s=n[o];s!==r&&W(e,i,o,s,r)}for(let o in t)if(!(o==="key"||o==="ref")&&!(o in n))if(o==="class")e.setClass(i,"");else if(o==="style")e.setStyle(i,{});else if(o.startsWith("on")||o.startsWith("@")){let r=o.startsWith("@")?o.slice(1).toLowerCase():o.slice(2).toLowerCase();e.removeEventListener(i,r,t[o])}else e.removeAttribute(i,o)}function Y(e,i,t,n,o,r){let{shapeFlag:s}=t;if(V(t)){me(e,i,t,n,o,r);return}if(b(t)){let a=e.createText(t.children);t.el=a,e.insert(n,a,o);return}if(T(t)){let a=e.createComment(t.children);t.el=a,e.insert(n,a,o);return}if(s&1){ue(e,i,t,n,o,r);return}if(s&6){ge(i,t,n,o,r);return}}function ue(e,i,t,n,o,r){let s=t.type,a=e.createElement(s);if(t.el=a,t.props)for(let p in t.props){let d=t.props[p];J(e,a,p,d)}let{shapeFlag:l,children:f}=t;l&8?a.textContent=f:l&16&&A(i,f,a,null,r),e.insert(n,a,o)}function A(e,i,t,n,o){for(let r=0;r<i.length;r++)e(null,i[r],t,n,o)}function me(e,i,t,n,o,r){let{children:s}=t,a=e.createComment("");e.insert(n,a,o),Array.isArray(s)&&s.length>0&&A(i,s,n,a,r),t.el=a,t.anchor=a}function ge(e,i,t,n,o){let r=i.component;r&&r.update&&r.update(),r&&r.subTree&&(e(null,r.subTree,t,n,r),i.el=r.subTree.el)}function Q(e,i,t,n){let{shapeFlag:o,children:r}=t;if(V(t)){if(Array.isArray(r))for(let s=0;s<r.length;s++)i(r[s],n);t.anchor&&t.anchor.parentNode&&e.remove(t.anchor);return}if(o&6){t.component&&t.component.subTree&&i(t.component.subTree,n);return}t.el&&e.remove(t.el)}function R(e,i){for(let t=0;t<i.length;t++)e(i[t])}var L=require("@lytjs/vdom");function S(e,i,t,n,o,r=null,s=null){if(n==null){t&&i(t,o);return}if(t===null){Y(e,$(e,i),n,o,r,s);return}if(H(n)&&H(t)){ve(e,i,t,n,o,s);return}if(!q(t,n)){i(t,o),Y(e,$(e,i),n,o,r,s);return}n.el=t.el,n.anchor=t.anchor;let{shapeFlag:a}=n;if(V(n)){Ne(e,i,t,n,o,r,s);return}if(b(n)){n.children!==t.children&&(n.el.nodeValue=n.children);return}if(T(n)){n.children!==t.children&&(n.el.nodeValue=n.children);return}if(a&1){he(e,i,t,n,s);return}if(a&6){xe(t,n,s);return}}function $(e,i){return(t,n,o,r,s)=>{S(e,i,t,n,o,r,s)}}function he(e,i,t,n,o=null){let r=n.el=t.el,s=t.props||{},a=n.props||{},{patchFlag:l,dynamicProps:f}=n;if(l&&l>0){if(l&1&&t.children!==n.children&&(r.textContent=n.children),l&2&&s.class!==a.class&&e.setClass(r,a.class),l&4&&s.style!==a.style&&e.setStyle(r,a.style||{}),l&8&&f)for(let p=0;p<f.length;p++){let d=f[p],c=s[d],y=a[d];y!==c&&W(e,r,d,y,c)}l&16&&K(e,r,s,a)}else K(e,r,s,a);(!l||!(l&1))&&ee(e,i,t,n,r,null,o)}function ee(e,i,t,n,o,r,s){let a=t.shapeFlag,l=n.shapeFlag,f=t.children,p=n.children;if(l&8){a&16&&R(i,f),f!==p&&(o.textContent=p);return}if(l&16){a&16?Ve(e,i,f,p,o,r,s):(a&8&&(o.textContent=""),A($(e,i),p,o,r,s));return}p==null&&(a&8?o.textContent="":a&16&&R(i,f))}function Ve(e,i,t,n,o,r,s){n.every(l=>l.key!==null&&l.key!==void 0)&&t.every(l=>l.key!==null&&l.key!==void 0)?(0,L.patchKeyedChildren)(t,n,o,r,s,null,!1):(0,L.patchUnkeyedChildren)(t,n,o,r,s,null,!1)}function Ne(e,i,t,n,o,r,s){let a=t.children,l=n.children;Array.isArray(l)&&l.length>0?(ee(e,i,t,n,o,r,s),n.el=l[0].el,n.anchor=l[l.length-1].el?e.nextSibling(l[l.length-1].el):r):Array.isArray(a)&&a.length>0&&l===null?(R(i,a),n.el=t.el,n.anchor=t.anchor):(n.el=t.el,n.anchor=t.anchor)}function ve(e,i,t,n,o,r){let s=t.dynamicChildren,a=n.dynamicChildren;for(let l=0;l<a.length;l++)S(e,i,s[l],a[l],o,null,r)}function xe(e,i,t){i.component=e.component,i.el=e.el,i.component&&i.component.update&&i.component.update()}function ne(e){function i(o,r){Q(e,i,o,r)}(0,te.registerDOMOperations)({insert(o,r,s){e.insert(r,o,s)},createElement(o){return e.createElement(o)},createText(o){return e.createText(o)},setText(o,r){o.nodeValue=r},setElementText(o,r){o.textContent=r},remove(o){e.remove(o)},createComment(o){return e.createComment(o)},mount(o,r,s,a,l,f,p){n(null,o,r,s,a)},patch(o,r,s,a,l,f,p,d){n(o,r,s,a,l)},unmount(o,r,s,a){i(o)},move(o,r,s){e.insert(r,o.el,s)}});function n(o,r,s,a,l){S(e,i,o,r,s,a,l)}return{mount(o,r){r.nodeType===1&&(r.textContent=""),n(null,o,r,null,null)},patch(o,r,s){var a;n(o,r,s||((a=o.el)==null?void 0:a.parentNode),null,null)},unmount(o,r){i(o,r)}}}var m=require("@lytjs/reactivity/signal");function O(e,i){return(0,m.effect)(()=>{let n=i();e.textContent=n==null?"":String(n)})}function v(e,i,t){return(0,m.effect)(()=>{let o=t();e[i]=o})}function M(e,i,t){return(0,m.effect)(()=>{let o=t();o==null||o===!1?e.removeAttribute(i):e.setAttribute(i,o===!0?"":String(o))})}function _(e,i){return(0,m.effect)(()=>{let n=i();if(typeof n=="string")e.className=n;else if(Array.isArray(n))e.className=n.filter(Boolean).join(" ");else if(typeof n=="object"&&n!==null){let o=[];for(let r of Object.keys(n))n[r]&&o.push(r);e.className=o.join(" ")}else e.className=""})}function D(e,i,t){return e.addEventListener(i,t),()=>{e.removeEventListener(i,t)}}function z(e,i){return(0,m.effect)(()=>{i()?(e.style=e.style||{},e.style.display==="none"&&(e.style.display=""),e.hidden=!1):(e.style=e.style||{},e.style.display="none",e.hidden=!0)})}function X(e,i,t,n){let o=[],r=[],s=new Map,a=(0,m.effect)(()=>{let l=i();if(!Array.isArray(l))return;let f=l.map((p,d)=>n?n(p,d):d);if(f.length===r.length){let p=!0;for(let d=0;d<f.length;d++)if(f[d]!==r[d]){p=!1;break}if(p){for(let d=0;d<l.length;d++){let c=t(l[d],d),y=o[d];y&&y.parentNode===e&&e.replaceChild(c,y),o[d]=c}return}}for(let p of o)p.parentNode===e&&e.removeChild(p);s.clear(),o=[],r=[];for(let p=0;p<l.length;p++){let d=t(l[p],p);e.appendChild(d),o.push(d),r.push(f[p]),s.set(f[p],d)}});return()=>{a();for(let l of o)l.parentNode===e&&e.removeChild(l);o=[],r=[],s.clear()}}var I=e=>{if(typeof document!="undefined")return document.createElement(e);throw new Error("[lyt:vapor] \u672A\u8BBE\u7F6E DOM \u5DE5\u5382\u51FD\u6570\u3002\u5728\u975E\u6D4F\u89C8\u5668\u73AF\u5883\u4E2D\u8BF7\u8C03\u7528 setVaporDOMFactory()")};function re(e){I=e}function N(){return I}function Z(e,i,...t){let n={tag:e,children:[],props:{},events:{},bindings:[]};if(i)for(let[o,r]of Object.entries(i))if(o.startsWith("on")&&typeof r=="function"&&!oe(r)){let s=o.slice(2).toLowerCase();n.events[s]=r}else oe(r)?o==="textContent"||o==="text"?n.bindings.push({type:"text",target:"textContent",signal:r}):o==="className"||o==="class"?n.bindings.push({type:"class",target:"className",signal:r}):o==="style"?n.bindings.push({type:"style",target:"style",signal:r}):n.bindings.push({type:"prop",target:o,signal:r}):n.props[o]=r;for(let o of t)typeof o=="string"?n.children.push({tag:"#text",children:[],props:{},events:{},bindings:[],text:o}):n.children.push(o);return n}function oe(e){return typeof e!="function"?!1:!!(e._subscribe||e.set)&&!e.toString().startsWith("class")}function u(e){if(e.tag==="#text"){let t=I("#text");return t.textContent=e.text||"",t.nodeType=3,t}let i=I(e.tag);e.el=i;for(let[t,n]of Object.entries(e.props))if(t==="style"&&typeof n=="object")for(let[o,r]of Object.entries(n))i.style[o]=r;else t==="className"||t==="class"?i.className=String(n):i[t]=n;for(let t of e.bindings)t.type==="text"?O(i,t.signal):t.type==="prop"?v(i,t.target,t.signal):t.type==="attr"?M(i,t.target,t.signal):t.type==="class"?_(i,t.signal):t.type==="style"&&v(i,"style",t.signal);for(let[t,n]of Object.entries(e.events))D(i,t,n);for(let t of e.children){let n=u(t);i.appendChild(n)}return i}function G(e,i,t){if(e.tag!==i.tag){let r=u(i);e.el&&e.el.parentNode===t&&t.removeChild(e.el),t.appendChild(r);return}let n=e.el||u(e);i.el=n;for(let[r,s]of Object.entries(i.props))if(r==="style"&&typeof s=="object")for(let[a,l]of Object.entries(s))n.style[a]=l;else r==="className"||r==="class"?n.className=String(s):n[r]=s;i.text!==void 0&&(n.textContent=i.text);for(let[r,s]of Object.entries(e.events))i.events[r]||n.removeEventListener(r,s);for(let[r,s]of Object.entries(i.events))e.events[r]!==s&&(e.events[r]&&n.removeEventListener(r,e.events[r]),n.addEventListener(r,s));let o=Math.max(e.children.length,i.children.length);for(let r=0;r<o;r++){let s=e.children[r],a=i.children[r];if(!s&&a){let l=u(a);n.appendChild(l)}else s&&!a?s.el&&s.el.parentNode===n&&n.removeChild(s.el):s&&a&&G(s,a,n)}}function B(e,i){let t=i.setup?i.setup():{};i.beforeMount&&i.beforeMount();let n;if(i.render){let r=i.render(t,Z);n=Array.isArray(r)?r:[r]}else n=[];let o=[];for(let r of n){let s=u(r);e.appendChild(s),o.push(s)}return i.mounted&&i.mounted(),()=>{i.beforeUnmount&&i.beforeUnmount();for(let r of o)e.removeChild(r);i.unmounted&&i.unmounted()}}function F(e){let i={type:"fragment",children:[]},t=e.trim();for(;t.length>0;){let n=t.match(/^<([a-zA-Z][a-zA-Z0-9-]*)([\s\S]*?)(\/?)>/);if(n){let o=n[1],r=n[2],s=n[3]==="/",{props:a,events:l,directives:f}=Ee(r),p={type:"element",tag:o,props:a,events:l,directives:f,children:[]};if(t=t.slice(n[0].length),s){i.children.push(p);continue}let d=`</${o}>`,c=Ce(t,o);if(c===-1)throw new Error(`[lyt:vapor:compiler] \u672A\u627E\u5230\u95ED\u5408\u6807\u7B7E: </${o}>`);let y=t.slice(0,c);t=t.slice(c+d.length);let g=F(y);p.children=g.children||[],i.children.push(p)}else{let o=t.indexOf("<"),r;if(o===-1?(r=t,t=""):(r=t.slice(0,o),t=t.slice(o)),r.trim())if(r.includes("{{")){let s=be(r);for(let a of s)a.type==="text"?i.children.push({type:"text",text:a.value}):i.children.push({type:"interpolation",expression:a.value})}else i.children.push({type:"text",text:r})}}return i}function Ce(e,i){let t=1,n=0,o=`<${i}`,r=`</${i}>`;for(;n<e.length&&t>0;){let s=e.indexOf(o,n),a=e.indexOf(r,n);if(a===-1)return-1;if(s!==-1&&s<a){let l=e[s+o.length];l===">"||l===" "||l==="/"?(t++,n=s+o.length):(n=a+r.length,t--)}else n=a+r.length,t--}return t===0?n-r.length:-1}function Ee(e){let i={},t={},n={},o=/([a-zA-Z@:][a-zA-Z0-9@:.-]*)\s*=\s*(?:"([^"]*)"|'([^']*)')/g,r;for(;(r=o.exec(e))!==null;){let s=r[1],a=r[2]||r[3];if(s.startsWith("on:")){let l=s.slice(3);t[l]=a}else if(s.startsWith(":")){let l=s.slice(1);i[l]=a}else if(s==="v-if")n.if=a;else if(s==="v-each"){let l=a.match(/^\s*(\w+)\s+in\s+(.+)\s*$/);l&&(n.each={item:l[1],expression:l[2]})}else i[s]=a}return{props:i,events:t,directives:n}}function be(e){let i=[],t=/\{\{([\s\S]*?)\}\}/g,n=0,o;for(;(o=t.exec(e))!==null;)o.index>n&&i.push({type:"text",value:e.slice(n,o.index)}),i.push({type:"interpolation",value:o[1].trim()}),n=o.index+o[0].length;return n<e.length&&i.push({type:"text",value:e.slice(n)}),i}function w(e){let i=F(e);return{render:Te(i),ast:i}}function Te(e){return function(t){let n=N();return C(e,t,n)}}function C(e,i,t){var n,o;if(e.type==="fragment"){if(e.children&&e.children.length===1)return C(e.children[0],i,t);let r=t("div");if(r.nodeType=11,e.children)for(let s of e.children){let a=C(s,i,t);r.appendChild(a)}return r}if(e.type==="text"){let r=t("#text");return r.textContent=e.text||"",r.nodeType=3,r}if(e.type==="interpolation"){let r=t("span"),s=e.expression||"",a=x(i,s);return r.textContent=a!=null?String(a):"",r}if(e.type==="element"){if((n=e.directives)!=null&&n.each){let{item:s,expression:a}=e.directives.each,l=x(i,a),f=t("#fragment");if(f.childNodes=[],f.nodeType=11,Array.isArray(l))for(let p=0;p<l.length;p++){let d={...i,[s]:l[p],index:p},c=t(e.tag);if(e.props)for(let[y,g]of Object.entries(e.props))y==="class"||y==="className"?c.className=g:c[y]=g;if(e.children)for(let y of e.children){let g=C(y,d,t);c.appendChild(g)}f.appendChild(c)}return f}let r=t(e.tag);if((o=e.directives)!=null&&o.if&&(x(i,e.directives.if)||(r.style=r.style||{},r.style.display="none",r.hidden=!0)),e.props)for(let[s,a]of Object.entries(e.props))if(s.startsWith(":")){let l=s.slice(1),f=x(i,a);r[l]=f}else s==="class"||s==="className"?r.className=a:r[s]=a;if(e.events)for(let[s,a]of Object.entries(e.events)){let l=x(i,a);typeof l=="function"&&r.addEventListener(s,l)}if(e.children)for(let s of e.children){let a=C(s,i,t);if(a.nodeType===11&&a.childNodes)for(let l of a.childNodes)r.appendChild(l);else r.appendChild(a)}return r}return t("div")}function x(e,i){let t=i.trim();if(/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(t)){let r=e[t];return typeof r=="function"&&!r.prototype?r():r}let n=t.split("."),o=e;for(let r of n){if(o==null)return;o=o[r],typeof o=="function"&&!o.prototype&&n.indexOf(r)<n.length-1&&(o=o())}return o}function ie(e){return e}function se(e){let i=!1,t=null,n=null;return{mount(o){if(!i){if(typeof o=="string")if(typeof document!="undefined"){let r=document.querySelector(o);if(!r)throw new Error(`[lyt:vapor] \u672A\u627E\u5230\u6302\u8F7D\u76EE\u6807: ${o}`);n=r}else throw new Error("[lyt:vapor] \u5728\u975E\u6D4F\u89C8\u5668\u73AF\u5883\u4E2D\uFF0C\u8BF7\u76F4\u63A5\u4F20\u5165\u5BB9\u5668\u5143\u7D20");else n=o;t=B(n,e),i=!0}},unmount(){i&&(t&&(t(),t=null),i=!1,n=null)}}}function ae(e){let i=e.setup?e.setup():{};e.beforeMount&&e.beforeMount();let t;if(e.template){let{render:n}=w(e.template);t=n(i)}else if(e.render){let n=e.render(i,Ae),o=Array.isArray(n)?n:[n];if(o.length===1)t=u(o[0]);else{t=N()("div");for(let s of o)t.appendChild(u(s))}}else throw new Error("[lyt:vapor] \u7EC4\u4EF6\u5FC5\u987B\u63D0\u4F9B template \u6216 render \u51FD\u6570");return e.mounted&&e.mounted(),t}function Ae(e,i,...t){let n={tag:e,children:[],props:i||{},events:{},bindings:[]};for(let o of t)typeof o=="string"?n.children.push({tag:"#text",children:[],props:{},events:{},bindings:[],text:o}):n.children.push(o);return n}