@lytjs/renderer 4.2.0 → 5.0.0

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.
Files changed (52) hide show
  1. package/dist/dom.cjs +1 -1
  2. package/dist/dom.mjs +1 -1
  3. package/dist/index.cjs +1 -1
  4. package/dist/index.mjs +1 -1
  5. package/dist/miniapp.cjs +21 -5
  6. package/dist/miniapp.mjs +21 -5
  7. package/dist/native.cjs +1 -1
  8. package/dist/native.mjs +1 -1
  9. package/dist/ssr.cjs +1 -1
  10. package/dist/ssr.mjs +1 -1
  11. package/dist/types/dom/dom-ops.d.ts.map +1 -1
  12. package/dist/types/dom/dom-renderer.d.ts +3 -3
  13. package/dist/types/dom/dom-renderer.d.ts.map +1 -1
  14. package/dist/types/dom/patch-props.d.ts +2 -32
  15. package/dist/types/dom/patch-props.d.ts.map +1 -1
  16. package/dist/types/miniapp/index.d.ts +8 -0
  17. package/dist/types/miniapp/index.d.ts.map +1 -1
  18. package/dist/types/miniapp/miniapp-compiler.d.ts +269 -0
  19. package/dist/types/miniapp/miniapp-compiler.d.ts.map +1 -0
  20. package/dist/types/miniapp/miniapp-event-bridge.d.ts +255 -0
  21. package/dist/types/miniapp/miniapp-event-bridge.d.ts.map +1 -0
  22. package/dist/types/miniapp/miniapp-lifecycle.d.ts +224 -0
  23. package/dist/types/miniapp/miniapp-lifecycle.d.ts.map +1 -0
  24. package/dist/types/miniapp/miniapp-renderer.d.ts.map +1 -1
  25. package/dist/types/miniapp/miniapp-utils.d.ts +168 -0
  26. package/dist/types/miniapp/miniapp-utils.d.ts.map +1 -0
  27. package/dist/types/miniapp/shared-constants.d.ts +28 -0
  28. package/dist/types/miniapp/shared-constants.d.ts.map +1 -0
  29. package/dist/types/native/native-renderer.d.ts.map +1 -1
  30. package/dist/types/renderer-interfaces.d.ts +19 -19
  31. package/dist/types/renderer-interfaces.d.ts.map +1 -1
  32. package/dist/types/shared/abstract-renderer.d.ts +74 -0
  33. package/dist/types/shared/abstract-renderer.d.ts.map +1 -0
  34. package/dist/types/ssr/hydration.d.ts +1 -16
  35. package/dist/types/ssr/hydration.d.ts.map +1 -1
  36. package/dist/types/ssr/ssr-renderer.d.ts +9 -24
  37. package/dist/types/ssr/ssr-renderer.d.ts.map +1 -1
  38. package/dist/types/vapor/index.d.ts +1 -1
  39. package/dist/types/vapor/index.d.ts.map +1 -1
  40. package/dist/types/vapor/vapor-compiler.d.ts +9 -0
  41. package/dist/types/vapor/vapor-compiler.d.ts.map +1 -1
  42. package/dist/types/vapor/vapor-component.d.ts +8 -1
  43. package/dist/types/vapor/vapor-component.d.ts.map +1 -1
  44. package/dist/types/vapor/vapor-reactive.d.ts +27 -4
  45. package/dist/types/vapor/vapor-reactive.d.ts.map +1 -1
  46. package/dist/types/vapor/vapor-renderer.d.ts +4 -2
  47. package/dist/types/vapor/vapor-renderer.d.ts.map +1 -1
  48. package/dist/types/vnode.d.ts +76 -7
  49. package/dist/types/vnode.d.ts.map +1 -1
  50. package/dist/vapor.cjs +1 -1
  51. package/dist/vapor.mjs +1 -1
  52. package/package.json +4 -3
package/dist/miniapp.mjs CHANGED
@@ -1,5 +1,21 @@
1
- import{registerDOMOperations as Y}from"@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||{}),_=(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))(_||{}),w=Symbol("Fragment"),M=Symbol("Text"),S=Symbol("Comment");function m(o){return o.type===w}function N(o){return o.type===M}function g(o){return o.type===S}function O(o,e){return o.type===e.type&&o.key===e.key}function b(o){return Array.isArray(o.dynamicChildren)}function $(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 C(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 R(o,e,t,n){for(let i in n){if(i==="key"||i==="ref")continue;let r=t[i],s=n[i];s!==r&&C(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 v(o,e,t,n,i,r){let{shapeFlag:s}=t;if(m(t)){F(o,e,t,n,i,r);return}if(N(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){D(o,e,t,n,i,r);return}if(s&6){K(e,t,n,i,r);return}}function D(o,e,t,n,i,r){let s=t.type,a=o.createElement(s);if(t.el=a,t.props)for(let f in t.props){let d=t.props[f];$(o,a,f,d)}let{shapeFlag:c,children:l}=t;c&8?a.textContent=l:c&16&&x(e,l,a,null,r),o.insert(n,a,i)}function x(o,e,t,n,i){for(let r=0;r<e.length;r++)o(null,e[r],t,n,i)}function F(o,e,t,n,i,r){let{children:s}=t,a=o.createComment("");o.insert(n,a,i),Array.isArray(s)&&s.length>0&&x(e,s,n,a,r),t.el=a,t.anchor=a}function K(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 I(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])}import{patchKeyedChildren as j,patchUnkeyedChildren as U}from"@lytjs/vdom";function A(o,e,t,n,i,r=null,s=null){if(n==null){t&&e(t,i);return}if(t===null){v(o,V(o,e),n,i,r,s);return}if(b(n)&&b(t)){B(o,e,t,n,i,s);return}if(!O(t,n)){e(t,i),v(o,V(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(N(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){H(o,e,t,n,s);return}if(a&6){X(t,n,s);return}}function V(o,e){return(t,n,i,r,s)=>{A(o,e,t,n,i,r,s)}}function H(o,e,t,n,i=null){let r=n.el=t.el,s=t.props||{},a=n.props||{},{patchFlag:c,dynamicProps:l}=n;if(c&&c>0){if(c&1&&t.children!==n.children&&(r.textContent=n.children),c&2&&s.class!==a.class&&o.setClass(r,a.class),c&4&&s.style!==a.style&&o.setStyle(r,a.style||{}),c&8&&l)for(let f=0;f<l.length;f++){let d=l[f],p=s[d],L=a[d];L!==p&&C(o,r,d,L,p)}c&16&&R(o,r,s,a)}else R(o,r,s,a);(!c||!(c&1))&&P(o,e,t,n,r,null,i)}function P(o,e,t,n,i,r,s){let a=t.shapeFlag,c=n.shapeFlag,l=t.children,f=n.children;if(c&8){a&16&&T(e,l),l!==f&&(i.textContent=f);return}if(c&16){a&16?W(o,e,l,f,i,r,s):(a&8&&(i.textContent=""),x(V(o,e),f,i,r,s));return}f==null&&(a&8?i.textContent="":a&16&&T(e,l))}function W(o,e,t,n,i,r,s){n.every(c=>c.key!==null&&c.key!==void 0)&&t.every(c=>c.key!==null&&c.key!==void 0)?j(t,n,i,r,s,null,!1):U(t,n,i,r,s,null,!1)}function z(o,e,t,n,i,r,s){let a=t.children,c=n.children;Array.isArray(c)&&c.length>0?(P(o,e,t,n,i,r,s),n.el=c[0].el,n.anchor=c[c.length-1].el?o.nextSibling(c[c.length-1].el):r):Array.isArray(a)&&a.length>0&&c===null?(T(e,a),n.el=t.el,n.anchor=t.anchor):(n.el=t.el,n.anchor=t.anchor)}function B(o,e,t,n,i,r){let s=t.dynamicChildren,a=n.dynamicChildren;for(let c=0;c<a.length;c++)A(o,e,s[c],a[c],i,null,r)}function X(o,e,t){e.component=o.component,e.el=o.el,e.component&&e.component.update&&e.component.update()}function G(o){function e(i,r){I(o,e,i,r)}Y({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,c,l,f){n(null,i,r,s,a)},patch(i,r,s,a,c,l,f,d){n(i,r,s,a,c)},unmount(i,r,s,a){e(i)},move(i,r,s){o.insert(r,i.el,s)}});function n(i,r,s,a,c){A(o,e,i,r,s,a,c)}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 q={if:{attr:"if"},else:{attr:"else"},each:{attr:"for",prefix:""},bind:{attr:"model:"},on:{attr:"bind",prefix:""},ref:{attr:""},slot:{attr:"slot"},class:{attr:"class"},style:{attr:"style"},show:{attr:"hidden"}},u={click:"tap",input:"input",change:"change",submit:"submit",focus:"focus",blur:"blur",touchstart:"touchstart",touchend:"touchend",touchmove:"touchmove",scroll:"scroll",longpress:"longpress"},Z={div:"view",span:"text",p:"text",h1:"text",h2:"text",h3:"text",h4:"text",h5:"text",h6:"text",img:"image",input:"input",textarea:"textarea",button:"button",scroll:"scroll-view",list:"view",a:"navigator",ul:"view",ol:"view",li:"view",form:"form",header:"view",footer:"view",nav:"view",main:"view",section:"view",article:"view",aside:"view"},y={wechat:{if:"wx:if",else:"wx:else",for:"wx:for",forKey:"wx:key",bind:"bind",catch:"catch"},alipay:{if:"a:if",else:"a:else",for:"a:for",forKey:"a:key",bind:"on",catch:"catchEvent"},bytedance:{if:"tt:if",else:"tt:else",for:"tt:for",forKey:"tt:key",bind:"bind",catch:"catch"}},E=class{createElement(e){return{tag:Z[e]||e,attrs:{},children:[],bindEvents:{},modelBindings:{}}}createText(e){return{tag:"__text__",attrs:{},children:[],text:e,bindEvents:{},modelBindings:{}}}createComment(e){return{tag:"__comment__",attrs:{},children:[],text:e,bindEvents:{},modelBindings:{}}}setAttribute(e,t,n){if(e){if(t.startsWith("lyt:")){let i=t.slice(4);this._applyDirective(e,i,n);return}if(t==="v-if"||t==="if"){e.wxIf=String(n);return}if(t==="v-else"||t==="else"){e.attrs["wx:else"]="";return}if(t==="v-for"||t==="each"){let i=String(n),r=i.match(/(?:\((\w+),\s*(\w+)\)|(\w+))\s+in\s+(.+)/);r?(e.wxFor=r[4]||r[3],e.wxForKey=r[1]||r[3]):e.wxFor=i;return}if(t.startsWith("on")&&typeof n=="function"){let i=t.slice(2).toLowerCase(),r=u[i]||i;e.bindEvents[r]=n.name||"handleEvent";return}if(t==="v-model"||t==="model"){e.modelBindings.value=String(n);return}if(t==="class"||t==="className"){e.attrs.class=String(n);return}if(t==="style"){typeof n=="object"&&n!==null?e.attrs.style=this._styleObjectToString(n):e.attrs.style=String(n);return}if(t==="href"&&e.tag==="navigator"){e.attrs.url=String(n);return}e.attrs[t]=String(n)}}removeAttribute(e,t){if(e)if(t==="v-if"||t==="if")delete e.wxIf;else if(t==="v-for"||t==="each")delete e.wxFor,delete e.wxForKey;else if(t.startsWith("on")){let n=t.slice(2).toLowerCase(),i=u[n]||n;delete e.bindEvents[i]}else delete e.attrs[t]}setStyle(e,t){if(!e)return;let n=this._styleObjectToString(t);e.attrs.style=n}setClass(e,t){if(e){if(typeof t=="string")e.attrs.class=t;else if(typeof t=="object"&&t!==null){let n=[];for(let[i,r]of Object.entries(t))r&&n.push(i);e.attrs.class=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=u[t]||t;e.bindEvents[r]=n.name||"handleEvent"}removeEventListener(e,t,n){if(!e)return;let i=u[t]||t;delete e.bindEvents[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.tag==="__text__"&&(e.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=u[r]||r;e.bindEvents[s]=i.name||"handleEvent"}else this.setAttribute(e,t,i)}}querySelector(e){return null}renderToMiniAppTree(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)this.insert(t,this.renderToMiniAppTree(n));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.renderToMiniAppTree(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.renderToMiniAppTree(n));return t}return this.createComment("unknown vnode type")}serializeToWXML(e,t=0){return this._serializeToTemplate(e,t,"wechat")}serializeToAXML(e,t=0){return this._serializeToTemplate(e,t,"alipay")}serializeToTTML(e,t=0){return this._serializeToTemplate(e,t,"bytedance")}getPlatformTemplate(e,t){return this._serializeToTemplate(e,0,t)}mapDirective(e,t,n="wechat"){let i=y[n]||y.wechat,r=q[e];if(!r)return"";switch(e){case"if":return`${i.if}="{{${t}}}"`;case"else":return`${i.else}`;case"each":{let s=t.match(/(?:\((\w+),\s*(\w+)\)|(\w+))\s+in\s+(.+)/);if(s){let a=s[1]||s[3],c=s[4]||s[3];return`${i.for}="{{${c}}}" ${i.forKey}="{{${a}}}"`}return`${i.for}="{{${t}}}"`}case"show":return`hidden="{{!${t}}}"`;default:return`${r.attr}="${t}"`}}mapEvent(e,t="wechat"){let n=y[t]||y.wechat,i=u[e]||e;return n.bind==="on"?`on${i.charAt(0).toUpperCase()}${i.slice(1)}`:`${n.bind}${i}`}_applyDirective(e,t,n){switch(t){case"if":e.wxIf=String(n);break;case"else":e.attrs["wx:else"]="";break;case"each":{let i=String(n),r=i.match(/(?:\((\w+),\s*(\w+)\)|(\w+))\s+in\s+(.+)/);r?(e.wxFor=r[4]||r[3],e.wxForKey=r[1]||r[3]):e.wxFor=i;break}case"show":e.attrs.hidden=String(n);break;default:e.attrs[t]=String(n)}}_styleObjectToString(e){return Object.entries(e).map(([t,n])=>`${t.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${n}`).join("; ")}_serializeToTemplate(e,t,n){let i=" ".repeat(t),r=y[n]||y.wechat;if(e.tag==="__text__")return`${i}${e.text||""}`;if(e.tag==="__comment__")return`${i}<!-- ${e.text||""} -->`;if(e.tag==="__fragment__")return e.children.map(f=>this._serializeToTemplate(f,t,n)).join(`
2
- `);let s=[];for(let[f,d]of Object.entries(e.attrs)){if(f==="wx:else"){s.push(r.else);continue}s.push(`${f}="${d}"`)}e.wxIf&&s.unshift(`${r.if}="{{${e.wxIf}}}"`),e.wxFor&&(s.unshift(`${r.for}="{{${e.wxFor}}}"`),e.wxForKey&&s.unshift(`${r.forKey}="{{${e.wxForKey}}}"`));for(let[f,d]of Object.entries(e.bindEvents)){let p=r.bind==="on"?`on${f.charAt(0).toUpperCase()}${f.slice(1)}`:`${r.bind}${f}`;s.push(`${p}="${d}"`)}for(let[f,d]of Object.entries(e.modelBindings))s.push(`model:${f}="{{${d}}}"`);let a=s.length>0?" "+s.join(" "):"",c=new Set(["image","input"]);if(e.children.length===0&&c.has(e.tag))return`${i}<${e.tag}${a} />`;if(e.children.length===0)return`${i}<${e.tag}${a}></${e.tag}>`;let l=e.children.map(f=>this._serializeToTemplate(f,t+1,n)).join(`
3
- `);return`${i}<${e.tag}${a}>
4
- ${l}
5
- ${i}</${e.tag}>`}};var J=new E;export{S as Comment,w as Fragment,E as MiniAppRenderer,_ as PatchFlags,h as ShapeFlags,M as Text,G as createRenderer,J as miniAppRenderer};
1
+ import{registerDOMOperations as le}from"@lytjs/vdom";var h=(o=>(o[o.ELEMENT=1]="ELEMENT",o[o.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",o[o.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",o[o.TEXT_CHILDREN=8]="TEXT_CHILDREN",o[o.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",o[o.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",o))(h||{}),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||{}),j=Symbol("Fragment"),D=Symbol("Text"),I=Symbol("Comment");function m(s){return s.type===j}function b(s){return s.type===D}function v(s){return s.type===I}function B(s,e){return s.type===e.type&&s.key===e.key}function E(s){return Array.isArray(s.dynamicChildren)}function F(s,e,t,r){if(t==="class")s.setClass(e,r);else if(t==="style")s.setStyle(e,r);else if(t.startsWith("on")||t.startsWith("@")){let n=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();s.addEventListener(e,n,r)}else t==="key"||t==="ref"||s.setAttribute(e,t,r)}function R(s,e,t,r,n){if(t==="class")s.setClass(e,r);else if(t==="style")s.setStyle(e,r||{});else if(t.startsWith("on")||t.startsWith("@")){let i=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();n&&s.removeEventListener(e,i,n),r&&s.addEventListener(e,i,r)}else s.setAttribute(e,t,r)}function C(s,e,t,r){for(let n in r){if(n==="key"||n==="ref")continue;let i=t[n],o=r[n];o!==i&&R(s,e,n,o,i)}for(let n in t)if(!(n==="key"||n==="ref")&&!(n in r))if(n==="class")s.setClass(e,"");else if(n==="style")s.setStyle(e,{});else if(n.startsWith("on")||n.startsWith("@")){let i=n.startsWith("@")?n.slice(1).toLowerCase():n.slice(2).toLowerCase();s.removeEventListener(e,i,t[n])}else s.removeAttribute(e,n)}function T(s,e,t,r,n,i){let{shapeFlag:o}=t;if(m(t)){te(s,e,t,r,n,i);return}if(b(t)){let a=s.createText(t.children);t.el=a,s.insert(r,a,n);return}if(v(t)){let a=s.createComment(t.children);t.el=a,s.insert(r,a,n);return}if(o&1){ee(s,e,t,r,n,i);return}if(o&6){ne(e,t,r,n,i);return}}function ee(s,e,t,r,n,i){let o=t.type,a=s.createElement(o);if(t.el=a,t.props)for(let l in t.props){let f=t.props[l];F(s,a,l,f)}let{shapeFlag:c,children:p}=t;c&8?a.textContent=p:c&16&&N(e,p,a,null,i),s.insert(r,a,n)}function N(s,e,t,r,n){for(let i=0;i<e.length;i++)s(null,e[i],t,r,n)}function te(s,e,t,r,n,i){let{children:o}=t,a=s.createComment("");s.insert(r,a,n),Array.isArray(o)&&o.length>0&&N(e,o,r,a,i),t.el=a,t.anchor=a}function ne(s,e,t,r,n){let i=e.component;i&&i.update&&i.update(),i&&i.subTree&&(s(null,i.subTree,t,r,i),e.el=i.subTree.el)}function U(s,e,t,r){let{shapeFlag:n,children:i}=t;if(m(t)){if(Array.isArray(i))for(let o=0;o<i.length;o++)e(i[o],r);t.anchor&&t.anchor.parentNode&&s.remove(t.anchor);return}if(n&6){t.component&&t.component.subTree&&e(t.component.subTree,r);return}t.el&&s.remove(t.el)}function _(s,e){for(let t=0;t<e.length;t++)s(e[t])}import{patchKeyedChildren as re,patchUnkeyedChildren as ie}from"@lytjs/vdom";function x(s,e,t,r,n,i=null,o=null){if(r==null){t&&e(t,n);return}if(t===null){T(s,L(s,e),r,n,i,o);return}if(E(r)&&E(t)){ce(s,e,t,r,n,o);return}if(!B(t,r)){e(t,n),T(s,L(s,e),r,n,i,o);return}r.el=t.el,r.anchor=t.anchor;let{shapeFlag:a}=r;if(m(r)){ae(s,e,t,r,n,i,o);return}if(b(r)){r.children!==t.children&&(r.el.nodeValue=r.children);return}if(v(r)){r.children!==t.children&&(r.el.nodeValue=r.children);return}if(a&1){oe(s,e,t,r,o);return}if(a&6){pe(t,r,o);return}}function L(s,e){return(t,r,n,i,o)=>{x(s,e,t,r,n,i,o)}}function oe(s,e,t,r,n=null){let i=r.el=t.el,o=t.props||{},a=r.props||{},{patchFlag:c,dynamicProps:p}=r;if(c&&c>0){if(c&1&&t.children!==r.children&&(i.textContent=r.children),c&2&&o.class!==a.class&&s.setClass(i,a.class),c&4&&o.style!==a.style&&s.setStyle(i,a.style||{}),c&8&&p)for(let l=0;l<p.length;l++){let f=p[l],d=o[f],y=a[f];y!==d&&R(s,i,f,y,d)}c&16&&C(s,i,o,a)}else C(s,i,o,a);(!c||!(c&1))&&z(s,e,t,r,i,null,n)}function z(s,e,t,r,n,i,o){let a=t.shapeFlag,c=r.shapeFlag,p=t.children,l=r.children;if(c&8){a&16&&_(e,p),p!==l&&(n.textContent=l);return}if(c&16){a&16?se(s,e,p,l,n,i,o):(a&8&&(n.textContent=""),N(L(s,e),l,n,i,o));return}l==null&&(a&8?n.textContent="":a&16&&_(e,p))}function se(s,e,t,r,n,i,o){r.every(c=>c.key!==null&&c.key!==void 0)&&t.every(c=>c.key!==null&&c.key!==void 0)?re(t,r,n,i,o,null,!1):ie(t,r,n,i,o,null,!1)}function ae(s,e,t,r,n,i,o){let a=t.children,c=r.children;Array.isArray(c)&&c.length>0?(z(s,e,t,r,n,i,o),r.el=c[0].el,r.anchor=c[c.length-1].el?s.nextSibling(c[c.length-1].el):i):Array.isArray(a)&&a.length>0&&c===null?(_(e,a),r.el=t.el,r.anchor=t.anchor):(r.el=t.el,r.anchor=t.anchor)}function ce(s,e,t,r,n,i){let o=t.dynamicChildren,a=r.dynamicChildren;for(let c=0;c<a.length;c++)x(s,e,o[c],a[c],n,null,i)}function pe(s,e,t){e.component=s.component,e.el=s.el,e.component&&e.component.update&&e.component.update()}function de(s){function e(n,i){U(s,e,n,i)}le({insert(n,i,o){s.insert(i,n,o)},createElement(n){return s.createElement(n)},createText(n){return s.createText(n)},setText(n,i){n.nodeValue=i},setElementText(n,i){n.textContent=i},remove(n){s.remove(n)},createComment(n){return s.createComment(n)},mount(n,i,o,a,c,p,l){r(null,n,i,o,a)},patch(n,i,o,a,c,p,l,f){r(n,i,o,a,c)},unmount(n,i,o,a){e(n)},move(n,i,o){s.insert(i,n.el,o)}});function r(n,i,o,a,c){x(s,e,n,i,o,a,c)}return{mount(n,i){i.nodeType===1&&(i.textContent=""),r(null,n,i,null,null)},patch(n,i,o){var a;r(n,i,o||((a=n.el)==null?void 0:a.parentNode),null,null)},unmount(n,i){e(n,i)}}}var w={div:"view",span:"text",p:"text",h1:"text",h2:"text",h3:"text",h4:"text",h5:"text",h6:"text",img:"image",input:"input",textarea:"textarea",button:"button",scroll:"scroll-view",list:"view",a:"navigator",ul:"view",ol:"view",li:"view",form:"form",header:"view",footer:"view",nav:"view",main:"view",section:"view",article:"view",aside:"view"},u={click:"tap",input:"input",change:"change",submit:"submit",focus:"focus",blur:"blur",touchstart:"touchstart",touchend:"touchend",touchmove:"touchmove",scroll:"scroll",longpress:"longpress"};function K(s,e,t){if(!(!s||!e)){if(e._parent){let r=e._parent,n=r.children.indexOf(e);n!==-1&&r.children.splice(n,1)}if(e._parent=s,t){let r=s.children.indexOf(t);r!==-1?s.children.splice(r,0,e):s.children.push(e)}else s.children.push(e)}}function J(s){if(!s||!s._parent)return;let e=s._parent,t=e.children.indexOf(s);t!==-1&&e.children.splice(t,1),s._parent=void 0}function W(s,e,t){if(!s||!e||!t)return;let r=s.children.indexOf(e);r!==-1&&(e._parent=void 0,t._parent=s,s.children[r]=t)}function X(s){var e;return(e=s==null?void 0:s._parent)!=null?e:null}function Y(s){if(!s||!s._parent)return null;let e=s._parent.children,t=e.indexOf(s);return t!==-1&&t+1<e.length?e[t+1]:null}function G(s){Promise.resolve().then(()=>s())}var fe={if:{attr:"if"},else:{attr:"else"},each:{attr:"for",prefix:""},bind:{attr:"model:"},on:{attr:"bind",prefix:""},ref:{attr:""},slot:{attr:"slot"},class:{attr:"class"},style:{attr:"style"},show:{attr:"hidden"}},g={wechat:{if:"wx:if",else:"wx:else",for:"wx:for",forKey:"wx:key",bind:"bind",catch:"catch"},alipay:{if:"a:if",else:"a:else",for:"a:for",forKey:"a:key",bind:"on",catch:"catchEvent"},bytedance:{if:"tt:if",else:"tt:else",for:"tt:for",forKey:"tt:key",bind:"bind",catch:"catch"}},A=class{createElement(e){return{tag:w[e]||e,attrs:{},children:[],bindEvents:{},modelBindings:{}}}createText(e){return{tag:"__text__",attrs:{},children:[],text:e,bindEvents:{},modelBindings:{}}}createComment(e){return{tag:"__comment__",attrs:{},children:[],text:e,bindEvents:{},modelBindings:{}}}setAttribute(e,t,r){if(e){if(t.startsWith("lyt:")){let n=t.slice(4);this._applyDirective(e,n,r);return}if(t==="v-if"||t==="if"){e.wxIf=String(r);return}if(t==="v-else"||t==="else"){e.attrs["wx:else"]="";return}if(t==="v-for"||t==="each"){let n=String(r),i=n.match(/(?:\((\w+),\s*(\w+)\)|(\w+))\s+in\s+(.+)/);i?(e.wxFor=i[4]||i[3],e.wxForKey=i[1]||i[3]):e.wxFor=n;return}if(t.startsWith("on")&&typeof r=="function"){let n=t.slice(2).toLowerCase(),i=u[n]||n;e.bindEvents[i]=r.name||"handleEvent";return}if(t==="v-model"||t==="model"){e.modelBindings.value=String(r);return}if(t==="class"||t==="className"){e.attrs.class=String(r);return}if(t==="style"){typeof r=="object"&&r!==null?e.attrs.style=this._styleObjectToString(r):e.attrs.style=String(r);return}if(t==="href"&&e.tag==="navigator"){e.attrs.url=String(r);return}e.attrs[t]=String(r)}}removeAttribute(e,t){if(e)if(t==="v-if"||t==="if")delete e.wxIf;else if(t==="v-for"||t==="each")delete e.wxFor,delete e.wxForKey;else if(t.startsWith("on")){let r=t.slice(2).toLowerCase(),n=u[r]||r;delete e.bindEvents[n]}else delete e.attrs[t]}setStyle(e,t){if(!e)return;let r=this._styleObjectToString(t);e.attrs.style=r}setClass(e,t){if(e){if(typeof t=="string")e.attrs.class=t;else if(typeof t=="object"&&t!==null){let r=[];for(let[n,i]of Object.entries(t))i&&r.push(n);e.attrs.class=r.join(" ")}}}insert(e,t,r){K(e,t,r)}remove(e){J(e)}replace(e,t,r){W(e,t,r)}addEventListener(e,t,r,n){if(!e)return;let i=u[t]||t;e.bindEvents[i]=r.name||"handleEvent"}removeEventListener(e,t,r){if(!e)return;let n=u[t]||t;delete e.bindEvents[n]}nextTick(e){G(e)}parentNode(e){return X(e)}nextSibling(e){return Y(e)}setText(e,t){e&&e.tag==="__text__"&&(e.text=t)}patchProp(e,t,r,n){if(e){if(n==null){this.removeAttribute(e,t);return}if(t==="style")this.setStyle(e,n);else if(t==="class"||t==="className")this.setClass(e,n);else if(t.startsWith("on")&&typeof n=="function"){let i=t.slice(2).toLowerCase(),o=u[i]||i;e.bindEvents[o]=n.name||"handleEvent"}else this.setAttribute(e,t,n)}}querySelector(e){return null}renderToMiniAppTree(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 r of e.children)this.insert(t,this.renderToMiniAppTree(r));return t}if(typeof e.type=="string"){let t=this.createElement(e.type);if(e.props)for(let[r,n]of Object.entries(e.props))r==="key"||r==="ref"||this.setAttribute(t,r,n);if(e.children){if(typeof e.children=="string")this.insert(t,this.createText(e.children));else if(Array.isArray(e.children))for(let r of e.children)this.insert(t,this.renderToMiniAppTree(r))}return t}if(typeof e.type=="object"||typeof e.type=="function"){let t=this.createElement("div");if(Array.isArray(e.children))for(let r of e.children)this.insert(t,this.renderToMiniAppTree(r));return t}return this.createComment("unknown vnode type")}serializeToWXML(e,t=0){return this._serializeToTemplate(e,t,"wechat")}serializeToAXML(e,t=0){return this._serializeToTemplate(e,t,"alipay")}serializeToTTML(e,t=0){return this._serializeToTemplate(e,t,"bytedance")}getPlatformTemplate(e,t){return this._serializeToTemplate(e,0,t)}mapDirective(e,t,r="wechat"){let n=g[r]||g.wechat,i=fe[e];if(!i)return"";switch(e){case"if":return`${n.if}="{{${t}}}"`;case"else":return`${n.else}`;case"each":{let o=t.match(/(?:\((\w+),\s*(\w+)\)|(\w+))\s+in\s+(.+)/);if(o){let a=o[1]||o[3],c=o[4]||o[3];return`${n.for}="{{${c}}}" ${n.forKey}="{{${a}}}"`}return`${n.for}="{{${t}}}"`}case"show":return`hidden="{{!${t}}}"`;default:return`${i.attr}="${t}"`}}mapEvent(e,t="wechat"){let r=g[t]||g.wechat,n=u[e]||e;return r.bind==="on"?`on${n.charAt(0).toUpperCase()}${n.slice(1)}`:`${r.bind}${n}`}_applyDirective(e,t,r){switch(t){case"if":e.wxIf=String(r);break;case"else":e.attrs["wx:else"]="";break;case"each":{let n=String(r),i=n.match(/(?:\((\w+),\s*(\w+)\)|(\w+))\s+in\s+(.+)/);i?(e.wxFor=i[4]||i[3],e.wxForKey=i[1]||i[3]):e.wxFor=n;break}case"show":e.attrs.hidden=String(r);break;default:e.attrs[t]=String(r)}}_styleObjectToString(e){return Object.entries(e).map(([t,r])=>`${t.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${r}`).join("; ")}_serializeToTemplate(e,t,r){let n=" ".repeat(t),i=g[r]||g.wechat;if(e.tag==="__text__")return`${n}${e.text||""}`;if(e.tag==="__comment__")return`${n}<!-- ${e.text||""} -->`;if(e.tag==="__fragment__")return e.children.map(l=>this._serializeToTemplate(l,t,r)).join(`
2
+ `);let o=[];for(let[l,f]of Object.entries(e.attrs)){if(l==="wx:else"){o.push(i.else);continue}o.push(`${l}="${f}"`)}e.wxIf&&o.unshift(`${i.if}="{{${e.wxIf}}}"`),e.wxFor&&(o.unshift(`${i.for}="{{${e.wxFor}}}"`),e.wxForKey&&o.unshift(`${i.forKey}="{{${e.wxForKey}}}"`));for(let[l,f]of Object.entries(e.bindEvents)){let d=i.bind==="on"?`on${l.charAt(0).toUpperCase()}${l.slice(1)}`:`${i.bind}${l}`;o.push(`${d}="${f}"`)}for(let[l,f]of Object.entries(e.modelBindings))o.push(`model:${l}="{{${f}}}"`);let a=o.length>0?" "+o.join(" "):"",c=new Set(["image","input"]);if(e.children.length===0&&c.has(e.tag))return`${n}<${e.tag}${a} />`;if(e.children.length===0)return`${n}<${e.tag}${a}></${e.tag}>`;let p=e.children.map(l=>this._serializeToTemplate(l,t+1,r)).join(`
3
+ `);return`${n}<${e.tag}${a}>
4
+ ${p}
5
+ ${n}</${e.tag}>`}};var ue=new A;import{camelToKebab as Z,kebabToCamel as me}from"@lytjs/common";function ge(s){return Object.entries(s).map(([e,t])=>`${Z(e)}: ${t}`).join("; ")}function he(s){return typeof s=="string"?s:typeof s=="object"&&s!==null?Object.entries(s).filter(([,e])=>!!e).map(([e])=>e).join(" "):""}function $(s){let e={};return s.navigationBarTitleText!==void 0&&(e.navigationBarTitleText=s.navigationBarTitleText),s.enablePullDownRefresh!==void 0&&(e.enablePullDownRefresh=s.enablePullDownRefresh),s.backgroundColor!==void 0&&(e.backgroundColor=s.backgroundColor),s.backgroundTextStyle!==void 0&&(e.backgroundTextStyle=s.backgroundTextStyle),s.navigationBarBackgroundColor!==void 0&&(e.navigationBarBackgroundColor=s.navigationBarBackgroundColor),s.navigationBarTextStyle!==void 0&&(e.navigationBarTextStyle=s.navigationBarTextStyle),s.usingComponents&&Object.keys(s.usingComponents).length>0&&(e.usingComponents=s.usingComponents),JSON.stringify(e,null,2)}function P(s){let e={component:s.component!==!1};return s.usingComponents&&Object.keys(s.usingComponents).length>0&&(e.usingComponents=s.usingComponents),JSON.stringify(e,null,2)}function S(s){let e={},t=[];for(let[r,n]of Object.entries(s))if(typeof n=="function")e[r]={type:n.name};else if(typeof n=="object"&&n!==null){let i={};if(n.type!==void 0&&(i.type=n.type),n.default!==void 0&&(i.value=n.default),n.value!==void 0&&(i.value=n.value),n.optional!==void 0&&(i.optionalTypes=n.optional),e[r]=i,n.observer){let o=typeof n.observer=="string"?n.observer:`_${r}Observer`;t.push(`${r}: function(${r}) { this.${o}(${r}); }`)}}else e[r]={type:String,value:n};return{properties:e,observers:t}}function ye(s){let e=[],t=/function\s+(\w+)\s*\(/g,r;for(;(r=t.exec(s))!==null;)e.push(r[1]);let n=[],i=/(?:const|let|var)\s+(\w+)\s*=/g;for(;(r=i.exec(s))!==null;)n.push(r[1]);let o=[];for(let c of e)o.push(` ${c}: ${c}`);for(let c of n)o.push(` ${c}: ${c}`);return`${o.length>0?`module.exports = {
6
+ ${o.join(`,
7
+ `)}
8
+ };`:"module.exports = {};"}
9
+
10
+ // Original code:
11
+ ${s}`}var be={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ve=/[&<>"']/g;function Ne(s){return s.replace(ve,e=>be[e]||e)}var _e=new Set(["view","scroll-view","swiper","swiper-item","movable-view","movable-area","cover-view","cover-image","text","rich-text","progress","button","form","input","textarea","checkbox","checkbox-group","radio","radio-group","switch","slider","picker","picker-view","picker-view-column","navigator","audio","image","video","camera","live-player","live-pusher","map","canvas","ad","official-account","open-data","web-view","page-container","aria-component"]);function xe(s){return _e.has(s.toLowerCase())}var we={wechat:{if:"wx:if",elif:"wx:elif",else:"wx:else",for:"wx:for",forItem:"wx:for-item",forKey:"wx:key",bind:"bind",catch:"catch",model:"model",slot:"slot"},alipay:{if:"a:if",elif:"a:elif",else:"a:else",for:"a:for",forItem:"a:for-item",forKey:"a:key",bind:"on",catch:"catchEvent",model:"model",slot:"slot"},bytedance:{if:"tt:if",elif:"tt:elif",else:"tt:else",for:"tt:for",forItem:"tt:for-item",forKey:"tt:key",bind:"bind",catch:"catch",model:"model",slot:"slot"}},Ae={click:"tap",dblclick:"tap",input:"input",change:"change",submit:"submit",focus:"focus",blur:"blur",touchstart:"touchstart",touchend:"touchend",touchmove:"touchmove",scroll:"scroll",longpress:"longpress",keydown:"confirm",keyup:"confirm",keypress:"confirm"},k=class{compile(e,t){let{template:r,style:n,script:i}=this._extractTags(e),o=this._extractData(i);return{template:this._transformTemplate(r,t),style:n,script:i,data:o}}compilePage(e,t){let r=this.compile(e.template,t),n={...r.data,...e.data||{}},i={...e.methods||{}},o=this._generatePageJs(n,i,e,t),a=$({});return{wxml:r.template,wxss:r.style,js:o,json:a}}compileComponent(e,t){let r=this.compile(e.template,t),n={...r.data,...e.data||{}},i={...e.methods||{}},o={},a=[];if(e.props)if(Array.isArray(e.props))for(let l of e.props)o[l]={type:null};else{let l=S(e.props);o=l.properties,a=l.observers}let c=this._generateComponentJs(o,n,i,a,t),p=P({component:!0});return{wxml:r.template,wxss:r.style,js:c,json:p}}_transformTemplate(e,t){let r=we[t],n=e;return n=this._transformTags(n),n=this._transformConditional(n,r),n=this._transformIteration(n,r),n=this._transformEvents(n,t,r),n=this._transformModelBindings(n,r),n=this._transformSlots(n,r),n=this._transformRefs(n),n=this._transformShow(n),n=this._transformAttributeBindings(n),n=this._cleanupLytDirectives(n),n}_transformTags(e){let t=/<\/?([a-zA-Z][a-zA-Z0-9-]*)/g;return e.replace(t,(r,n)=>{let i=n.toLowerCase(),o=w[i];return o?r.replace(n,o):r})}_transformConditional(e,t){let r=e.replace(/lyt:if="([^"]*)"/g,(n,i)=>`${t.if}="{{${i}}}"`);return r=r.replace(/v-if="([^"]*)"/g,(n,i)=>`${t.if}="{{${i}}}"`),r=r.replace(/lyt:elif="([^"]*)"/g,(n,i)=>`${t.elif}="{{${i}}}"`),r=r.replace(/v-else-if="([^"]*)"/g,(n,i)=>`${t.elif}="{{${i}}}"`),r=r.replace(/\blyt:else\b/g,t.else),r=r.replace(/\bv-else\b/g,t.else),r}_transformIteration(e,t){let r=i=>{let o=i.match(/(?:\((\w+),\s*(\w+)\)|(\w+))\s+in\s+(.+)/);if(o){let a=o[1]||o[3],c=o[2],p=o[4].trim(),l=`${t.for}="{{${p}}}" ${t.forItem}="${a}" ${t.forKey}="${a}"`;return c&&(l+=` ${t.forIndex}="${c}"`),l}return`${t.for}="{{${i.trim()}}}"`},n=e.replace(/lyt:each="([^"]*)"/g,(i,o)=>r(o));return n=n.replace(/v-for="([^"]*)"/g,(i,o)=>r(o)),n}_transformEvents(e,t,r){let n=/@(\w+)(?:\.(\w+))*="([^"]*)"/g;return e.replace(n,(i,o,a,c)=>{let p=Ae[o.toLowerCase()]||o.toLowerCase();return a==="stop"||a==="prevent"?t==="alipay"?`catchEvent${this._capitalize(p)}="${c}"`:`${r.catch}${p}="${c}"`:a==="capture"?`capture-bind:${p}="${c}"`:t==="alipay"?`on${this._capitalize(p)}="${c}"`:`${r.bind}${p}="${c}"`})}_transformModelBindings(e,t){let r=e.replace(/:value="([^"]*)"/g,(n,i)=>`${t.model}:value="{{${i}}}"`);return r=r.replace(/v-model="([^"]*)"/g,(n,i)=>`${t.model}:value="{{${i}}}"`),r=r.replace(/:checked="([^"]*)"/g,(n,i)=>`${t.model}:checked="{{${i}}}"`),r}_transformSlots(e,t){return e}_transformRefs(e){return e.replace(/\bref="([^"]*)"/g,'id="$1"')}_transformShow(e){let t=e.replace(/lyt:show="([^"]*)"/g,(r,n)=>`hidden="{{!${n}}}"`);return t=t.replace(/v-show="([^"]*)"/g,(r,n)=>`hidden="{{!${n}}}"`),t}_transformAttributeBindings(e){let t=/:([a-zA-Z][a-zA-Z0-9-]*)="([^"]*)"/g;return e.replace(t,(r,n,i)=>n==="value"||n==="checked"?r:`${n}="{{${i}}}"`)}_cleanupLytDirectives(e){return e.replace(/\s*lyt:[a-zA-Z-]+(?:="[^"]*")?/g,"")}_extractTags(e){let t=e,r="",n="",i=e.match(/<style[^>]*>([\s\S]*?)<\/style>/i);i&&(r=i[1].trim(),t=t.replace(i[0],""));let o=e.match(/<script[^>]*>([\s\S]*?)<\/script>/i);return o&&(n=o[1].trim(),t=t.replace(o[0],"")),t=t.trim(),{template:t,style:r,script:n}}_extractData(e){let t={};if(!e)return t;let r=e.match(/data\s*:\s*(\{[\s\S]*?\})(?:\s*[,}])/);if(r)try{let i=r[1];this._parseSimpleObject(i,t)}catch(i){}let n=e.match(/data\s*\(\s*\)\s*\{[\s\S]*?return\s*(\{[\s\S]*?\})\s*;?\s*\}/);if(n)try{let i=n[1];this._parseSimpleObject(i,t)}catch(i){}return t}_parseSimpleObject(e,t){let r=e.replace(/^\s*\{/,"").replace(/\}\s*$/,"").trim();if(!r)return;let n=r.split(/\n|,/);for(let i of n){let o=i.trim();if(!o)continue;let a=o.match(/^(\w+)\s*:\s*(.+)$/);if(a){let c=a[1],p=a[2].trim().replace(/[,;]\s*$/,"");p==="true"?t[c]=!0:p==="false"?t[c]=!1:p==="null"?t[c]=null:p==="undefined"?t[c]=void 0:/^'[^']*'$/.test(p)||/^"[^"]*"$/.test(p)?t[c]=p.slice(1,-1):/^-?\d+$/.test(p)?t[c]=parseInt(p,10):/^-?\d+\.\d+$/.test(p)?t[c]=parseFloat(p):(/^\[/.test(p)||/^\{/.test(p),t[c]=p)}}}_generatePageJs(e,t,r,n){let i=[];i.push("// Auto-generated by MiniAppCompiler"),i.push(`// Platform: ${n}`),i.push(""),i.push("Page({"),i.push(" data: "+JSON.stringify(e,null,4).split(`
12
+ `).map((a,c)=>c===0?a:" "+a).join(`
13
+ `)+","),r.onLoad&&(i.push(""),i.push(" onLoad(options) {"),i.push(" // Lyt.js onBeforeMount -> onLoad"),i.push(" },")),r.onShow&&(i.push(""),i.push(" onShow() {"),i.push(" // Lyt.js onShow"),i.push(" },")),r.onReady&&(i.push(""),i.push(" onReady() {"),i.push(" // Lyt.js onMounted -> onReady"),i.push(" },"));let o=Object.entries(t);if(o.length>0){i.push("");for(let[a,c]of o){let p=c.toString(),l=p.match(/(?:function\s*\w*\s*\(|=>\s*\{?\s*)([\s\S]*)/),f=l?l[1].trim().replace(/^\{|\}$/g,"").trim():"";if(i.push(` ${a}(${this._extractParamNames(p).join(", ")}) {`),f)for(let d of f.split(`
14
+ `))i.push(` ${d}`);i.push(" },")}}return i.push("});"),i.join(`
15
+ `)}_generateComponentJs(e,t,r,n,i){let o=[];if(o.push("// Auto-generated by MiniAppCompiler"),o.push(`// Platform: ${i}`),o.push(""),o.push("Component({"),Object.keys(e).length>0&&o.push(" properties: "+JSON.stringify(e,null,4).split(`
16
+ `).map((c,p)=>p===0?c:" "+c).join(`
17
+ `)+","),o.push(" data: "+JSON.stringify(t,null,4).split(`
18
+ `).map((c,p)=>p===0?c:" "+c).join(`
19
+ `)+","),n.length>0){o.push(""),o.push(" observers: {");for(let c of n)o.push(` ${c},`);o.push(" },")}o.push(""),o.push(" lifetimes: {"),o.push(" attached() {"),o.push(" // Lyt.js setup -> attached"),o.push(" },"),o.push(" ready() {"),o.push(" // Lyt.js onMounted -> ready"),o.push(" },"),o.push(" detached() {"),o.push(" // Lyt.js onUnmounted -> detached"),o.push(" },"),o.push(" },");let a=Object.entries(r);if(a.length>0){o.push(""),o.push(" methods: {");for(let[c,p]of a){let l=p.toString(),f=l.match(/(?:function\s*\w*\s*\(|=>\s*\{?\s*)([\s\S]*)/),d=f?f[1].trim().replace(/^\{|\}$/g,"").trim():"";if(o.push(` ${c}(${this._extractParamNames(l).join(", ")}) {`),d)for(let y of d.split(`
20
+ `))o.push(` ${y}`);o.push(" },")}o.push(" },")}return o.push("});"),o.join(`
21
+ `)}_capitalize(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}_extractParamNames(e){let t=e.match(/(?:function\s*\w*\s*|\w+\s*=>\s*(?:\([^)]*\)|([^)]*)))\s*\(?([^)]*)\)?/);if(t&&t[2])return t[2].split(",").map(i=>i.trim()).filter(Boolean);let r=e.match(/\(([^)]*)\)\s*=>/);if(r)return r[1].split(",").map(i=>i.trim()).filter(Boolean);let n=e.match(/(\w+)\s*=>/);return n?[n[1].trim()]:[]}};var q={click:{wechat:"tap",alipay:"tap",bytedance:"tap"},dblclick:{wechat:"tap",alipay:"tap",bytedance:"tap"},input:{wechat:"input",alipay:"input",bytedance:"input"},change:{wechat:"change",alipay:"change",bytedance:"change"},submit:{wechat:"submit",alipay:"submit",bytedance:"submit"},focus:{wechat:"focus",alipay:"focus",bytedance:"focus"},blur:{wechat:"blur",alipay:"blur",bytedance:"blur"},touchstart:{wechat:"touchstart",alipay:"touchStart",bytedance:"touchstart"},touchend:{wechat:"touchend",alipay:"touchEnd",bytedance:"touchend"},touchmove:{wechat:"touchmove",alipay:"touchMove",bytedance:"touchmove"},touchcancel:{wechat:"touchcancel",alipay:"touchCancel",bytedance:"touchcancel"},scroll:{wechat:"scroll",alipay:"scroll",bytedance:"scroll"},longpress:{wechat:"longpress",alipay:"longTap",bytedance:"longpress"},keydown:{wechat:"confirm",alipay:"confirm",bytedance:"confirm"},keyup:{wechat:"confirm",alipay:"confirm",bytedance:"confirm"},keypress:{wechat:"confirm",alipay:"confirm",bytedance:"confirm"}},Me={wechat:{bind:"bind",catch:"catch",captureBind:"capture-bind:",captureCatch:"capture-catch:"},alipay:{bind:"on",catch:"catchEvent",captureBind:"capture-bind:",captureCatch:"capture-catch:"},bytedance:{bind:"bind",catch:"catch",captureBind:"capture-bind:",captureCatch:"capture-catch:"}},O=class{constructor(e,t){this._customEventListeners={};this._platform=e,this._componentInstance=t,this._bubblingEnabled=!0,this._capturingEnabled=!0}normalizeEvent(e,t){let r=t||this._platform,n=e.toLowerCase(),i=q[n];return i?i[r]:r==="alipay"?e.charAt(0).toLowerCase()+e.slice(1):n}getBindName(e,t){let r=this.normalizeEvent(e),n=Me[this._platform];return t!=null&&t.capture?`${n.captureBind}${r}`:t!=null&&t.stop?this._platform==="alipay"?`${n.catch}${this._capitalize(r)}`:`${n.catch}${r}`:this._platform==="alipay"?`${n.bind}${this._capitalize(r)}`:`${n.bind}${r}`}parseEventArgs(e,t){let r=t||this._platform,n=e[0]||{},i={type:n.type||"",timeStamp:n.timeStamp||Date.now(),target:this._normalizeTarget(n.target||{}),currentTarget:this._normalizeTarget(n.currentTarget||{}),detail:n.detail||{},bubbles:n.bubbles!==!1,cancelable:n.cancelable!==!1,defaultPrevented:!1,propagationStopped:!1},o=n.detail||{};return r==="wechat"||r==="alipay"&&!o.value&&n.value!==void 0&&(i.detail.value=n.value),{nativeEvent:i,detail:o}}_normalizeTarget(e){return{id:e.id||"",dataset:e.dataset||{}}}createDataBinder(e){let t=this;return{get(){if(!t._componentInstance)return;let r=t._componentInstance.data||{};return t._getNestedValue(r,e)},set(r){t._componentInstance&&(typeof t._componentInstance.setData=="function"?t._componentInstance.setData({[e]:r}):t._setNestedValue(t._componentInstance.data||{},e,r))}}}_getNestedValue(e,t){let r=t.split("."),n=e;for(let i of r){if(n==null)return;n=n[i]}return n}_setNestedValue(e,t,r){let n=t.split("."),i=e;for(let o=0;o<n.length-1;o++){let a=n[o];i[a]==null&&(i[a]={}),i=i[a]}i[n[n.length-1]]=r}createBridgeHandler(e){let t={},r=this;for(let[n]of Object.entries(q)){let i=this.getBindName(n),o=this.normalizeEvent(n);t[i]=function(a,...c){let p=r.parseEventArgs([a,...c]);return r._bubblingEnabled&&r._emitCustomEvent(e,n,p.detail,p.nativeEvent),p},t[o]=t[i]}return t.handleEvent=function(n){return r.parseEventArgs([n])},t}on(e,t){this._customEventListeners[e]||(this._customEventListeners[e]=[]),this._customEventListeners[e].push(t)}off(e,t){if(this._customEventListeners[e])if(t){let r=this._customEventListeners[e].indexOf(t);r!==-1&&this._customEventListeners[e].splice(r,1)}else delete this._customEventListeners[e]}_emitCustomEvent(e,t,r,n){let i=this._customEventListeners[t];if(!(!i||i.length===0)){for(let o of i)try{o(r,n)}catch(a){}this._componentInstance&&typeof this._componentInstance.triggerEvent=="function"&&this._componentInstance.triggerEvent(t,r,{bubbles:(n==null?void 0:n.bubbles)!==!1,composed:!0,capturePhase:!1})}}$emit(e,t){this._emitCustomEvent("__self__",e,t||{})}enableBubbling(){this._bubblingEnabled=!0}disableBubbling(){this._bubblingEnabled=!1}enableCapturing(){this._capturingEnabled=!0}disableCapturing(){this._capturingEnabled=!1}isBubblingEnabled(){return this._bubblingEnabled}isCapturingEnabled(){return this._capturingEnabled}setComponentInstance(e){this._componentInstance=e}getComponentInstance(){return this._componentInstance}getPlatform(){return this._platform}_capitalize(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}};var V={setup:{lytHook:"setup",platformHook:"data + attached",description:"setup() \u8FD4\u56DE\u503C\u4F5C\u4E3A data\uFF0C\u903B\u8F91\u5728 attached() \u4E2D\u6267\u884C",hasDirectMapping:!1},onBeforeMount:{lytHook:"onBeforeMount",platformHook:"created / onLoad",description:"\u9875\u9762\u4F7F\u7528 onLoad\uFF0C\u7EC4\u4EF6\u4F7F\u7528 created",hasDirectMapping:!0},onMounted:{lytHook:"onMounted",platformHook:"ready",description:"\u9875\u9762\u548C\u7EC4\u4EF6\u5747\u4F7F\u7528 ready",hasDirectMapping:!0},onUpdated:{lytHook:"onUpdated",platformHook:"(\u65E0\u76F4\u63A5\u5BF9\u5E94)",description:"\u53EF\u901A\u8FC7 observers \u6216 setData \u56DE\u8C03\u6A21\u62DF",hasDirectMapping:!1},onBeforeUnmount:{lytHook:"onBeforeUnmount",platformHook:"(\u65E0\u76F4\u63A5\u5BF9\u5E94)",description:"\u53EF\u5728 detached \u4E2D\u624B\u52A8\u5904\u7406",hasDirectMapping:!1},onUnmounted:{lytHook:"onUnmounted",platformHook:"detached / onUnload",description:"\u7EC4\u4EF6\u4F7F\u7528 detached\uFF0C\u9875\u9762\u4F7F\u7528 onUnload",hasDirectMapping:!0},onErrorCaptured:{lytHook:"onErrorCaptured",platformHook:"(\u65E0\u76F4\u63A5\u5BF9\u5E94)",description:"\u5C0F\u7A0B\u5E8F\u65E0\u76F4\u63A5\u5BF9\u5E94\uFF0C\u53EF\u5728\u65B9\u6CD5\u4E2D try-catch",hasDirectMapping:!1},onLoad:{lytHook:"onLoad",platformHook:"onLoad",description:"\u9875\u9762\u52A0\u8F7D\u65F6\u89E6\u53D1\uFF08\u4EC5\u9875\u9762\uFF09",hasDirectMapping:!0},onShow:{lytHook:"onShow",platformHook:"onShow",description:"\u9875\u9762\u663E\u793A\u65F6\u89E6\u53D1\uFF08\u4EC5\u9875\u9762\uFF09",hasDirectMapping:!0},onReady:{lytHook:"onReady",platformHook:"onReady",description:"\u9875\u9762\u521D\u6B21\u6E32\u67D3\u5B8C\u6210\uFF08\u4EC5\u9875\u9762\uFF09",hasDirectMapping:!0},onHide:{lytHook:"onHide",platformHook:"onHide",description:"\u9875\u9762\u9690\u85CF\u65F6\u89E6\u53D1\uFF08\u4EC5\u9875\u9762\uFF09",hasDirectMapping:!0},onUnload:{lytHook:"onUnload",platformHook:"onUnload",description:"\u9875\u9762\u5378\u8F7D\u65F6\u89E6\u53D1\uFF08\u4EC5\u9875\u9762\uFF09",hasDirectMapping:!0},created:{lytHook:"created",platformHook:"created",description:"\u7EC4\u4EF6\u5B9E\u4F8B\u521B\u5EFA\u65F6\u89E6\u53D1\uFF08\u4EC5\u7EC4\u4EF6\uFF09",hasDirectMapping:!0},attached:{lytHook:"attached",platformHook:"attached",description:"\u7EC4\u4EF6\u8FDB\u5165\u9875\u9762\u8282\u70B9\u6811\u65F6\u89E6\u53D1\uFF08\u4EC5\u7EC4\u4EF6\uFF09",hasDirectMapping:!0},ready:{lytHook:"ready",platformHook:"ready",description:"\u7EC4\u4EF6\u5E03\u5C40\u5B8C\u6210\u540E\u89E6\u53D1\uFF08\u4EC5\u7EC4\u4EF6\uFF09",hasDirectMapping:!0},moved:{lytHook:"moved",platformHook:"moved",description:"\u7EC4\u4EF6\u5B9E\u4F8B\u88AB\u79FB\u52A8\u5230\u8282\u70B9\u6811\u53E6\u4E00\u4E2A\u4F4D\u7F6E\u65F6\u89E6\u53D1\uFF08\u4EC5\u7EC4\u4EF6\uFF09",hasDirectMapping:!0},detached:{lytHook:"detached",platformHook:"detached",description:"\u7EC4\u4EF6\u79BB\u5F00\u9875\u9762\u8282\u70B9\u6811\u65F6\u89E6\u53D1\uFF08\u4EC5\u7EC4\u4EF6\uFF09",hasDirectMapping:!0}},Ee={onBeforeMount:"onLoad",onMounted:"onReady",onUnmounted:"onUnload",onShow:"onShow",onHide:"onHide",onReady:"onReady",onLoad:"onLoad",onUnload:"onUnload"},Q={onBeforeMount:"created",onMounted:"ready",onUnmounted:"detached",onReady:"ready",created:"created",attached:"attached",moved:"moved",detached:"detached"},H=class{constructor(e){this._platform=e}mapLifecycle(e,t){let r=V[e];return r?r.platformHook:e}getLifecycleMapping(e){return V[e]||null}getAllMappings(){return Object.values(V)}createPageLifecycle(e){let t={};for(let[r,n]of Object.entries(e)){if(typeof n!="function")continue;let i=Ee[r];if(i)if(t[i]){let o=t[i];t[i]=function(...a){o.apply(this,a),n.apply(this,a)}}else t[i]=n;else t[r]=n}return t}createComponentLifecycle(e){let t={},r={},n=null;for(let[i,o]of Object.entries(e)){if(typeof o!="function")continue;if(i==="setup"){let c=o.call({});c&&typeof c=="object"&&(n=c);continue}let a=Q[i];if(a)if(r[a]){let c=r[a];r[a]=function(...p){c.apply(this,p),o.apply(this,p)}}else r[a]=o;else t.methods||(t.methods={}),t.methods[i]=o}return Object.keys(r).length>0&&(t.lifetimes=r),n&&(t.data=n),t}wrapComponent(e,t){let r=t||this._platform,n={};if(e.setup&&typeof e.setup=="function"){let a=e.setup.call({});a&&typeof a=="object"?n.data={...a||{},...e.data||{}}:n.data=e.data||{}}else n.data=e.data||{};if(e.props){if(Array.isArray(e.props)){let a={};for(let c of e.props)a[c]={type:null};n.properties=a}else if(typeof e.props=="object"){let a={};for(let[c,p]of Object.entries(e.props))if(typeof p=="function")a[c]={type:p.name};else if(typeof p=="object"&&p!==null){let l={};p.type&&(l.type=p.type),p.default!==void 0&&(l.value=p.default),p.value!==void 0&&(l.value=p.value),a[c]=l}else a[c]={type:null,value:p};n.properties=a}}let i={},o=["onBeforeMount","onMounted","onUpdated","onUnmounted","onBeforeUnmount","onErrorCaptured","created","attached","ready","moved","detached"];for(let a of o)if(e[a]&&typeof e[a]=="function"){let c=Q[a];c&&(i[c]=e[a])}if(Object.keys(i).length>0&&(n.lifetimes=i),e.methods&&typeof e.methods=="object"?n.methods={...e.methods}:n.methods={},e.computed&&typeof e.computed=="object"){let a={};for(let[c,p]of Object.entries(e.computed))if(typeof p=="function")try{let l=p.call(n.data);n.data[c]=l}catch(l){}}if(e.watch&&typeof e.watch=="object"){n.observers||(n.observers={});for(let[a,c]of Object.entries(e.watch))if(typeof c=="function")n.observers[a]=c;else if(Array.isArray(c)){let p=c.filter(l=>typeof l=="function");p.length>0&&(n.observers[a]=function(...l){for(let f of p)f.apply(this,l)})}}return e.observers&&typeof e.observers=="object"&&(n.observers||(n.observers={}),Object.assign(n.observers,e.observers)),(e.onLoad||e.onShow||e.onHide||e.onPullDownRefresh||e.onReachBottom||e.onShareAppMessage)&&(e.onLoad&&(n.onLoad=e.onLoad),e.onShow&&(n.onShow=e.onShow),e.onHide&&(n.onHide=e.onHide),e.onPullDownRefresh&&(n.onPullDownRefresh=e.onPullDownRefresh),e.onReachBottom&&(n.onReachBottom=e.onReachBottom),e.onShareAppMessage&&(n.onShareAppMessage=e.onShareAppMessage)),n}getPlatform(){return this._platform}setPlatform(e){this._platform=e}getPlatformLifecycleDifferences(e){let t=e||this._platform;return t==="alipay"?{created:"created\uFF08\u652F\u4ED8\u5B9D\u7EC4\u4EF6\u652F\u6301\uFF09",attached:"attached\uFF08\u652F\u4ED8\u5B9D\u7EC4\u4EF6\u652F\u6301\uFF09",ready:"didMount\uFF08\u652F\u4ED8\u5B9D\u7EC4\u4EF6\u4F7F\u7528 didMount \u66FF\u4EE3 ready\uFF09",detached:"didUnmount\uFF08\u652F\u4ED8\u5B9D\u7EC4\u4EF6\u4F7F\u7528 didUnmount \u66FF\u4EE3 detached\uFF09",onLoad:"onLoad\uFF08\u652F\u4ED8\u5B9D\u9875\u9762\u652F\u6301\uFF09",onReady:"onReady\uFF08\u652F\u4ED8\u5B9D\u9875\u9762\u652F\u6301\uFF09",onUnload:"onUnload\uFF08\u652F\u4ED8\u5B9D\u9875\u9762\u652F\u6301\uFF09"}:t==="bytedance"?{created:"created\uFF08\u5B57\u8282\u8DF3\u52A8\u7EC4\u4EF6\u652F\u6301\uFF09",attached:"attached\uFF08\u5B57\u8282\u8DF3\u52A8\u7EC4\u4EF6\u652F\u6301\uFF09",ready:"ready\uFF08\u5B57\u8282\u8DF3\u52A8\u7EC4\u4EF6\u652F\u6301\uFF09",detached:"detached\uFF08\u5B57\u8282\u8DF3\u52A8\u7EC4\u4EF6\u652F\u6301\uFF09",onLoad:"onLoad\uFF08\u5B57\u8282\u8DF3\u52A8\u9875\u9762\u652F\u6301\uFF09",onReady:"onReady\uFF08\u5B57\u8282\u8DF3\u52A8\u9875\u9762\u652F\u6301\uFF09",onUnload:"onUnload\uFF08\u5B57\u8282\u8DF3\u52A8\u9875\u9762\u652F\u6301\uFF09"}:{created:"created",attached:"attached",ready:"ready",moved:"moved",detached:"detached",onLoad:"onLoad",onShow:"onShow",onReady:"onReady",onHide:"onHide",onUnload:"onUnload"}}};export{I as Comment,j as Fragment,k as MiniAppCompiler,O as MiniAppEventBridge,H as MiniAppLifecycleAdapter,A as MiniAppRenderer,M as PatchFlags,h as ShapeFlags,D as Text,Z as camelToKebab,de as createRenderer,ye as createWxsModule,Ne as escapeHtml,P as generateComponentJson,$ as generatePageJson,xe as isNativeTag,me as kebabToCamel,ue as miniAppRenderer,S as normalizeProps,he as parseClassObject,ge as parseStyleObject};
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=(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){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
+ "use strict";var V=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var $=Object.prototype.hasOwnProperty;var q=(i,e)=>{for(var t in e)V(i,t,{get:e[t],enumerable:!0})},J=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of G(e))!$.call(i,o)&&o!==t&&V(i,o,{get:()=>e[o],enumerable:!(n=X(e,o))||n.enumerable});return i};var Q=i=>J(V({},"__esModule",{value:!0}),i);var fe={};q(fe,{Comment:()=>L,Fragment:()=>E,NativeRenderer:()=>N,PatchFlags:()=>y,ShapeFlags:()=>u,Text:()=>R,createRenderer:()=>W,nativeRenderer:()=>K});module.exports=Q(fe);var M=require("@lytjs/vdom");var u=(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))(u||{}),y=(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))(y||{}),E=Symbol("Fragment"),R=Symbol("Text"),L=Symbol("Comment");function m(i){return i.type===E}function h(i){return i.type===R}function g(i){return i.type===L}function k(i,e){return i.type===e.type&&i.key===e.key}function w(i){return Array.isArray(i.dynamicChildren)}function P(i,e,t,n){if(t==="class")i.setClass(e,n);else if(t==="style")i.setStyle(e,n);else if(t.startsWith("on")||t.startsWith("@")){let o=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();i.addEventListener(e,o,n)}else t==="key"||t==="ref"||i.setAttribute(e,t,n)}function b(i,e,t,n,o){if(t==="class")i.setClass(e,n);else if(t==="style")i.setStyle(e,n||{});else if(t.startsWith("on")||t.startsWith("@")){let r=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();o&&i.removeEventListener(e,r,o),n&&i.addEventListener(e,r,n)}else i.setAttribute(e,t,n)}function A(i,e,t,n){for(let o in n){if(o==="key"||o==="ref")continue;let r=t[o],s=n[o];s!==r&&b(i,e,o,s,r)}for(let o in t)if(!(o==="key"||o==="ref")&&!(o in n))if(o==="class")i.setClass(e,"");else if(o==="style")i.setStyle(e,{});else if(o.startsWith("on")||o.startsWith("@")){let r=o.startsWith("@")?o.slice(1).toLowerCase():o.slice(2).toLowerCase();i.removeEventListener(e,r,t[o])}else i.removeAttribute(e,o)}function S(i,e,t,n,o,r){let{shapeFlag:s}=t;if(m(t)){ee(i,e,t,n,o,r);return}if(h(t)){let a=i.createText(t.children);t.el=a,i.insert(n,a,o);return}if(g(t)){let a=i.createComment(t.children);t.el=a,i.insert(n,a,o);return}if(s&1){Z(i,e,t,n,o,r);return}if(s&6){te(e,t,n,o,r);return}}function Z(i,e,t,n,o,r){let s=t.type,a=i.createElement(s);if(t.el=a,t.props)for(let c in t.props){let f=t.props[c];P(i,a,c,f)}let{shapeFlag:d,children:p}=t;d&8?a.textContent=p:d&16&&T(e,p,a,null,r),i.insert(n,a,o)}function T(i,e,t,n,o){for(let r=0;r<e.length;r++)i(null,e[r],t,n,o)}function ee(i,e,t,n,o,r){let{children:s}=t,a=i.createComment("");i.insert(n,a,o),Array.isArray(s)&&s.length>0&&T(e,s,n,a,r),t.el=a,t.anchor=a}function te(i,e,t,n,o){let r=e.component;r&&r.update&&r.update(),r&&r.subTree&&(i(null,r.subTree,t,n,r),e.el=r.subTree.el)}function D(i,e,t,n){let{shapeFlag:o,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&&i.remove(t.anchor);return}if(o&6){t.component&&t.component.subTree&&e(t.component.subTree,n);return}t.el&&i.remove(t.el)}function v(i,e){for(let t=0;t<e.length;t++)i(e[t])}var x=require("@lytjs/vdom");function C(i,e,t,n,o,r=null,s=null){if(n==null){t&&e(t,o);return}if(t===null){S(i,_(i,e),n,o,r,s);return}if(w(n)&&w(t)){re(i,e,t,n,o,s);return}if(!k(t,n)){e(t,o),S(i,_(i,e),n,o,r,s);return}n.el=t.el,n.anchor=t.anchor;let{shapeFlag:a}=n;if(m(n)){ie(i,e,t,n,o,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){ne(i,e,t,n,s);return}if(a&6){se(t,n,s);return}}function _(i,e){return(t,n,o,r,s)=>{C(i,e,t,n,o,r,s)}}function ne(i,e,t,n,o=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&&i.setClass(r,a.class),d&4&&s.style!==a.style&&i.setStyle(r,a.style||{}),d&8&&p)for(let c=0;c<p.length;c++){let f=p[c],l=s[f],I=a[f];I!==l&&b(i,r,f,I,l)}d&16&&A(i,r,s,a)}else A(i,r,s,a);(!d||!(d&1))&&H(i,e,t,n,r,null,o)}function H(i,e,t,n,o,r,s){let a=t.shapeFlag,d=n.shapeFlag,p=t.children,c=n.children;if(d&8){a&16&&v(e,p),p!==c&&(o.textContent=c);return}if(d&16){a&16?oe(i,e,p,c,o,r,s):(a&8&&(o.textContent=""),T(_(i,e),c,o,r,s));return}c==null&&(a&8?o.textContent="":a&16&&v(e,p))}function oe(i,e,t,n,o,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,o,r,s,null,!1):(0,x.patchUnkeyedChildren)(t,n,o,r,s,null,!1)}function ie(i,e,t,n,o,r,s){let a=t.children,d=n.children;Array.isArray(d)&&d.length>0?(H(i,e,t,n,o,r,s),n.el=d[0].el,n.anchor=d[d.length-1].el?i.nextSibling(d[d.length-1].el):r):Array.isArray(a)&&a.length>0&&d===null?(v(e,a),n.el=t.el,n.anchor=t.anchor):(n.el=t.el,n.anchor=t.anchor)}function re(i,e,t,n,o,r){let s=t.dynamicChildren,a=n.dynamicChildren;for(let d=0;d<a.length;d++)C(i,e,s[d],a[d],o,null,r)}function se(i,e,t){e.component=i.component,e.el=i.el,e.component&&e.component.update&&e.component.update()}function W(i){function e(o,r){D(i,e,o,r)}(0,M.registerDOMOperations)({insert(o,r,s){i.insert(r,o,s)},createElement(o){return i.createElement(o)},createText(o){return i.createText(o)},setText(o,r){o.nodeValue=r},setElementText(o,r){o.textContent=r},remove(o){i.remove(o)},createComment(o){return i.createComment(o)},mount(o,r,s,a,d,p,c){n(null,o,r,s,a)},patch(o,r,s,a,d,p,c,f){n(o,r,s,a,d)},unmount(o,r,s,a){e(o)},move(o,r,s){i.insert(r,o.el,s)}});function n(o,r,s,a,d){C(i,e,o,r,s,a,d)}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){e(o,r)}}}function U(i,e,t){if(!(!i||!e)){if(e._parent){let n=e._parent,o=n.children.indexOf(e);o!==-1&&n.children.splice(o,1)}if(e._parent=i,t){let n=i.children.indexOf(t);n!==-1?i.children.splice(n,0,e):i.children.push(e)}else i.children.push(e)}}function j(i){if(!i||!i._parent)return;let e=i._parent,t=e.children.indexOf(i);t!==-1&&e.children.splice(t,1),i._parent=void 0}function B(i,e,t){if(!i||!e||!t)return;let n=i.children.indexOf(e);n!==-1&&(e._parent=void 0,t._parent=i,i.children[n]=t)}function Y(i){var e;return(e=i==null?void 0:i._parent)!=null?e:null}function z(i){if(!i||!i._parent)return null;let e=i._parent.children,t=e.indexOf(i);return t!==-1&&t+1<e.length?e[t+1]:null}function F(i){Promise.resolve().then(()=>i())}var ae={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"},de={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"},le={click:"onPress",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",change:"onChange",input:"onChangeText",focus:"onFocus",blur:"onBlur",submit:"onSubmitEditing",scroll:"onScroll",longpress:"onLongPress"},ce=0;function O(){return`native_${++ce}`}var N=class{createElement(e){return{type:this.getComponentType(e),props:{},children:[],nativeId:O()}}createText(e){return{type:"RawText",props:{text:e},children:[],nativeId:O()}}createComment(e){return{type:"__Comment",props:{text:e},children:[],nativeId:O()}}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 o=t.slice(2).toLowerCase(),r=this.mapEvent(o);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(),o=this.mapEvent(n);delete e.props[o]}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[o,r]of Object.entries(t))r&&n.push(o);e.props.className=n.join(" ")}}}insert(e,t,n){U(e,t,n)}remove(e){j(e)}replace(e,t,n){B(e,t,n)}addEventListener(e,t,n,o){if(!e)return;let r=this.mapEvent(t);e.props[r]=n}removeEventListener(e,t,n){if(!e)return;let o=this.mapEvent(t);e.props[o]===n&&delete e.props[o]}nextTick(e){F(e)}parentNode(e){return Y(e)}nextSibling(e){return z(e)}setText(e,t){e&&e.type==="RawText"&&(e.props.text=t)}patchProp(e,t,n,o){if(e){if(o==null){this.removeAttribute(e,t);return}if(t==="style")this.setStyle(e,o);else if(t==="class"||t==="className")this.setClass(e,o);else if(t.startsWith("on")&&typeof o=="function"){let r=t.slice(2).toLowerCase(),s=this.mapEvent(r);e.props[s]=o}else this.setAttribute(e,t,o)}}querySelector(e){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 o=this.renderToNativeTree(n);this.insert(t,o)}return t}if(typeof e.type=="string"){let t=this.createElement(e.type);if(e.props)for(let[n,o]of Object.entries(e.props))n==="key"||n==="ref"||this.setAttribute(t,n,o);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 o={type:n.type,props:{...n.props},children:n.children.map(t)};return n.nativeId&&(o.nativeId=n.nativeId),o};return JSON.stringify(t(e),null,2)}getComponentType(e){return ae[e]||pe(e)}mapStyle(e){let t={};for(let[n,o]of Object.entries(e)){let r=de[n]||n;typeof o=="string"&&/^\d+px$/.test(o)?t[r]=parseInt(o,10):t[r]=o}return t}mapEvent(e){return le[e]||`on${e.charAt(0).toUpperCase()}${e.slice(1)}`}};function pe(i){return i.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("")}var K=new N;
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=(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){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 Q}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||{}),A=Symbol("Fragment"),S=Symbol("Text"),_=Symbol("Comment");function u(i){return i.type===A}function N(i){return i.type===S}function y(i){return i.type===_}function O(i,e){return i.type===e.type&&i.key===e.key}function C(i){return Array.isArray(i.dynamicChildren)}function I(i,e,t,n){if(t==="class")i.setClass(e,n);else if(t==="style")i.setStyle(e,n);else if(t.startsWith("on")||t.startsWith("@")){let o=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();i.addEventListener(e,o,n)}else t==="key"||t==="ref"||i.setAttribute(e,t,n)}function V(i,e,t,n,o){if(t==="class")i.setClass(e,n);else if(t==="style")i.setStyle(e,n||{});else if(t.startsWith("on")||t.startsWith("@")){let r=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();o&&i.removeEventListener(e,r,o),n&&i.addEventListener(e,r,n)}else i.setAttribute(e,t,n)}function E(i,e,t,n){for(let o in n){if(o==="key"||o==="ref")continue;let r=t[o],s=n[o];s!==r&&V(i,e,o,s,r)}for(let o in t)if(!(o==="key"||o==="ref")&&!(o in n))if(o==="class")i.setClass(e,"");else if(o==="style")i.setStyle(e,{});else if(o.startsWith("on")||o.startsWith("@")){let r=o.startsWith("@")?o.slice(1).toLowerCase():o.slice(2).toLowerCase();i.removeEventListener(e,r,t[o])}else i.removeAttribute(e,o)}function R(i,e,t,n,o,r){let{shapeFlag:s}=t;if(u(t)){Y(i,e,t,n,o,r);return}if(N(t)){let a=i.createText(t.children);t.el=a,i.insert(n,a,o);return}if(y(t)){let a=i.createComment(t.children);t.el=a,i.insert(n,a,o);return}if(s&1){B(i,e,t,n,o,r);return}if(s&6){z(e,t,n,o,r);return}}function B(i,e,t,n,o,r){let s=t.type,a=i.createElement(s);if(t.el=a,t.props)for(let c in t.props){let f=t.props[c];I(i,a,c,f)}let{shapeFlag:d,children:p}=t;d&8?a.textContent=p:d&16&&h(e,p,a,null,r),i.insert(n,a,o)}function h(i,e,t,n,o){for(let r=0;r<e.length;r++)i(null,e[r],t,n,o)}function Y(i,e,t,n,o,r){let{children:s}=t,a=i.createComment("");i.insert(n,a,o),Array.isArray(s)&&s.length>0&&h(e,s,n,a,r),t.el=a,t.anchor=a}function z(i,e,t,n,o){let r=e.component;r&&r.update&&r.update(),r&&r.subTree&&(i(null,r.subTree,t,n,r),e.el=r.subTree.el)}function k(i,e,t,n){let{shapeFlag:o,children:r}=t;if(u(t)){if(Array.isArray(r))for(let s=0;s<r.length;s++)e(r[s],n);t.anchor&&t.anchor.parentNode&&i.remove(t.anchor);return}if(o&6){t.component&&t.component.subTree&&e(t.component.subTree,n);return}t.el&&i.remove(t.el)}function g(i,e){for(let t=0;t<e.length;t++)i(e[t])}import{patchKeyedChildren as F,patchUnkeyedChildren as K}from"@lytjs/vdom";function T(i,e,t,n,o,r=null,s=null){if(n==null){t&&e(t,o);return}if(t===null){R(i,L(i,e),n,o,r,s);return}if(C(n)&&C(t)){q(i,e,t,n,o,s);return}if(!O(t,n)){e(t,o),R(i,L(i,e),n,o,r,s);return}n.el=t.el,n.anchor=t.anchor;let{shapeFlag:a}=n;if(u(n)){$(i,e,t,n,o,r,s);return}if(N(n)){n.children!==t.children&&(n.el.nodeValue=n.children);return}if(y(n)){n.children!==t.children&&(n.el.nodeValue=n.children);return}if(a&1){X(i,e,t,n,s);return}if(a&6){J(t,n,s);return}}function L(i,e){return(t,n,o,r,s)=>{T(i,e,t,n,o,r,s)}}function X(i,e,t,n,o=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&&i.setClass(r,a.class),d&4&&s.style!==a.style&&i.setStyle(r,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&&V(i,r,f,b,l)}d&16&&E(i,r,s,a)}else E(i,r,s,a);(!d||!(d&1))&&P(i,e,t,n,r,null,o)}function P(i,e,t,n,o,r,s){let a=t.shapeFlag,d=n.shapeFlag,p=t.children,c=n.children;if(d&8){a&16&&g(e,p),p!==c&&(o.textContent=c);return}if(d&16){a&16?G(i,e,p,c,o,r,s):(a&8&&(o.textContent=""),h(L(i,e),c,o,r,s));return}c==null&&(a&8?o.textContent="":a&16&&g(e,p))}function G(i,e,t,n,o,r,s){n.every(d=>d.key!==null&&d.key!==void 0)&&t.every(d=>d.key!==null&&d.key!==void 0)?F(t,n,o,r,s,null,!1):K(t,n,o,r,s,null,!1)}function $(i,e,t,n,o,r,s){let a=t.children,d=n.children;Array.isArray(d)&&d.length>0?(P(i,e,t,n,o,r,s),n.el=d[0].el,n.anchor=d[d.length-1].el?i.nextSibling(d[d.length-1].el):r):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 q(i,e,t,n,o,r){let s=t.dynamicChildren,a=n.dynamicChildren;for(let d=0;d<a.length;d++)T(i,e,s[d],a[d],o,null,r)}function J(i,e,t){e.component=i.component,e.el=i.el,e.component&&e.component.update&&e.component.update()}function Z(i){function e(o,r){k(i,e,o,r)}Q({insert(o,r,s){i.insert(r,o,s)},createElement(o){return i.createElement(o)},createText(o){return i.createText(o)},setText(o,r){o.nodeValue=r},setElementText(o,r){o.textContent=r},remove(o){i.remove(o)},createComment(o){return i.createComment(o)},mount(o,r,s,a,d,p,c){n(null,o,r,s,a)},patch(o,r,s,a,d,p,c,f){n(o,r,s,a,d)},unmount(o,r,s,a){e(o)},move(o,r,s){i.insert(r,o.el,s)}});function n(o,r,s,a,d){T(i,e,o,r,s,a,d)}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){e(o,r)}}}function D(i,e,t){if(!(!i||!e)){if(e._parent){let n=e._parent,o=n.children.indexOf(e);o!==-1&&n.children.splice(o,1)}if(e._parent=i,t){let n=i.children.indexOf(t);n!==-1?i.children.splice(n,0,e):i.children.push(e)}else i.children.push(e)}}function H(i){if(!i||!i._parent)return;let e=i._parent,t=e.children.indexOf(i);t!==-1&&e.children.splice(t,1),i._parent=void 0}function M(i,e,t){if(!i||!e||!t)return;let n=i.children.indexOf(e);n!==-1&&(e._parent=void 0,t._parent=i,i.children[n]=t)}function W(i){var e;return(e=i==null?void 0:i._parent)!=null?e:null}function U(i){if(!i||!i._parent)return null;let e=i._parent.children,t=e.indexOf(i);return t!==-1&&t+1<e.length?e[t+1]:null}function j(i){Promise.resolve().then(()=>i())}var ee={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"},te={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"},ne={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 w(){return`native_${++oe}`}var v=class{createElement(e){return{type:this.getComponentType(e),props:{},children:[],nativeId:w()}}createText(e){return{type:"RawText",props:{text:e},children:[],nativeId:w()}}createComment(e){return{type:"__Comment",props:{text:e},children:[],nativeId:w()}}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 o=t.slice(2).toLowerCase(),r=this.mapEvent(o);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(),o=this.mapEvent(n);delete e.props[o]}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[o,r]of Object.entries(t))r&&n.push(o);e.props.className=n.join(" ")}}}insert(e,t,n){D(e,t,n)}remove(e){H(e)}replace(e,t,n){M(e,t,n)}addEventListener(e,t,n,o){if(!e)return;let r=this.mapEvent(t);e.props[r]=n}removeEventListener(e,t,n){if(!e)return;let o=this.mapEvent(t);e.props[o]===n&&delete e.props[o]}nextTick(e){j(e)}parentNode(e){return W(e)}nextSibling(e){return U(e)}setText(e,t){e&&e.type==="RawText"&&(e.props.text=t)}patchProp(e,t,n,o){if(e){if(o==null){this.removeAttribute(e,t);return}if(t==="style")this.setStyle(e,o);else if(t==="class"||t==="className")this.setClass(e,o);else if(t.startsWith("on")&&typeof o=="function"){let r=t.slice(2).toLowerCase(),s=this.mapEvent(r);e.props[s]=o}else this.setAttribute(e,t,o)}}querySelector(e){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 o=this.renderToNativeTree(n);this.insert(t,o)}return t}if(typeof e.type=="string"){let t=this.createElement(e.type);if(e.props)for(let[n,o]of Object.entries(e.props))n==="key"||n==="ref"||this.setAttribute(t,n,o);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 o={type:n.type,props:{...n.props},children:n.children.map(t)};return n.nativeId&&(o.nativeId=n.nativeId),o};return JSON.stringify(t(e),null,2)}getComponentType(e){return ee[e]||ie(e)}mapStyle(e){let t={};for(let[n,o]of Object.entries(e)){let r=te[n]||n;typeof o=="string"&&/^\d+px$/.test(o)?t[r]=parseInt(o,10):t[r]=o}return t}mapEvent(e){return ne[e]||`on${e.charAt(0).toUpperCase()}${e.slice(1)}`}};function ie(i){return i.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("")}var re=new v;export{_ as Comment,A as Fragment,v as NativeRenderer,x as PatchFlags,m as ShapeFlags,S as Text,Z as createRenderer,re 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:()=>He,clearMismatchWarnings:()=>Me,createHydrationIsland:()=>xe,createRenderer:()=>ye,getHydrateStats:()=>Se,getIslandRegistry:()=>Ae,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=(y=>(y[y.TEXT=1]="TEXT",y[y.CLASS=2]="CLASS",y[y.STYLE=4]="STYLE",y[y.PROPS=8]="PROPS",y[y.FULL_PROPS=16]="FULL_PROPS",y[y.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",y[y.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",y[y.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",y[y.NEED_PATCH=256]="NEED_PATCH",y[y.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",y[y.HOISTED=-1]="HOISTED",y[y.BAIL=-2]="BAIL",y))(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 d in n.props){let u=n.props[d];ae(t,a,d,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 d=0;d<c.length;d++){let u=c[d],y=i[u],N=a[u];N!==y&&z(t,o,u,N,y)}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,d=r.children;if(l&8){a&16&&v(e,c),c!==d&&(s.textContent=d);return}if(l&16){a&16?We(t,e,c,d,s,o,i):(a&8&&(s.textContent=""),$(K(t,e),d,s,o,i));return}d==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,d){r(null,s,o,i,a)},patch(s,o,i,a,l,c,d,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,h={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"?A(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&h.TEXT_CHILDREN?o=f(String(n||"")):i&h.ARRAY_CHILDREN&&Array.isArray(n)?o=n.map(a=>m(a)).join(""):i&h.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 A(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 T in r)T==="data-hydrate-when"||T==="data-island-id"||(i[T]=r[T]);let a=JSON.stringify(i),l=f(a),c="";if(typeof e.render=="function"){let T=e.render(r,{slots:t.children||{},emit:()=>{}});c=m(T)}else if(typeof e=="function"){let T=e(r,{slots:t.children||{}});c=m(T)}let d=s?` data-hydrate-when="${f(s)}"`:"",u=`<${o} data-hydrate="${f(n)}" data-props="${l}"${d}>${c}</${o}>`,y=`<script type="application/json" data-hydrate-props="${f(n)}">${a}<\/script>`;return u+y}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 A(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&h.TEXT_CHILDREN)yield f(String(n||""));else if(o&h.ARRAY_CHILDREN&&Array.isArray(n))for(let i of n)yield*P(i);else if(o&h.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 A(t);return}if(typeof n=="function"){yield A(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&h.TEXT_CHILDREN)yield f(String(n||""));else if(i&h.ARRAY_CHILDREN&&Array.isArray(n))for(let a of n)yield*S(a,s);else if(i&h.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++}`,s=(t.props||{}).fallback,o="";s&&(typeof s=="object"&&s!==null?o=m(s):typeof s=="string"&&(o=s));let i=t.children,a=[];if(typeof i=="object"&&i!==null){if(Array.isArray(i))a=i;else if(typeof i.default=="function"){let d=i.default();Array.isArray(d)?a=d:d!=null&&(a=[d])}}let l=[];function c(d){for(let u of d){if(u==null)continue;let y=u.type;if(y&&(y._isAsyncComponent||y.__asyncSetup||u.__asyncSetup)){let N=u.__asyncPromise||y.__asyncPromise;N&&l.push(N.then(()=>{}))}}}if(c(a),l.length===0){for(let d of a)yield*S(d,e);return}yield`<!--${n}-fallback-->`,yield o,await Promise.all(l),yield`<!--${n}-resolved-->`;for(let d of a)yield*S(d,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 A(t)}var ge=new _;var F={ELEMENT:1,FUNCTIONAL_COMPONENT:2,STATEFUL_COMPONENT:4,TEXT_CHILDREN:8,ARRAY_CHILDREN:16,SLOTS_CHILDREN:32},g=!1,te=[],p={success:!0,mismatches:0,hydratedNodes:0};function Ne(){return g}function Te(t){g=t}function Se(){return{...p}}function ne(){p={success:!0,mismatches:0,hydratedNodes:0}}function Le(t){g?te.push(t):t()}function Ve(t,e,n={}){ne(),n.onHydrated&&te.push(n.onHydrated),g=!0;try{let r=e.firstElementChild;return r?(t._vnode||t.mount(e),t._vnode&&V(r,t._vnode,n),g=!1,ee(),p):(g=!1,t.mount(e),p.success=!1,ee(),p)}catch(r){return g=!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{g=!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 g=!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),g=!1,s.onHydrated&&s.onHydrated(),o}catch(i){return g=!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(d=>{for(let u of d)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":{(d=>{typeof requestIdleCallback!="undefined"?requestIdleCallback(d,{timeout:o.timeout||2e3}):setTimeout(d,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");if(!o){r.success=!1;return}let 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 Ae(){return b}function He(){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=H(u)}let l=r?` data-hydrate-when="${r}"`:"",c=`<${n} data-hydrate="${s}" data-props="${i}"${l}>${a}</${n}>`,d=`<script type="application/json" data-hydrate-props="${s}">${o}<\/script>`;return c+d}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=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=>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 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=H(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
+ "use strict";var U=Object.defineProperty;var ve=Object.getOwnPropertyDescriptor;var ke=Object.getOwnPropertyNames;var De=Object.prototype.hasOwnProperty;var Pe=(t,e)=>{for(var n in e)U(t,n,{get:e[n],enumerable:!0})},Fe=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of ke(e))!De.call(t,o)&&o!==n&&U(t,o,{get:()=>e[o],enumerable:!(r=ve(e,o))||r.enumerable});return t};var je=t=>Fe(U({},"__esModule",{value:!0}),t);var bt={};Pe(bt,{Comment:()=>X,Fragment:()=>Y,PatchFlags:()=>M,ShapeFlags:()=>C,StringRenderer:()=>_,Text:()=>z,clearIslandRegistry:()=>Ie,clearMismatchWarnings:()=>we,createHydrationIsland:()=>Oe,createRenderer:()=>pe,getHydrateStats:()=>Ee,getIslandRegistry:()=>Me,getMismatchWarnings:()=>$e,hydrate:()=>Ce,hydrateAllIslands:()=>Ae,hydrateIsland:()=>le,isHydrating:()=>Le,onHydrated:()=>be,registerIslandComponent:()=>xe,renderToStream:()=>he,renderToStreamGenerator:()=>Ne,renderToString:()=>ge,resetHydrateStats:()=>ie,setHydrating:()=>Ve,ssrRenderer:()=>Te,unmountIsland:()=>_e});module.exports=je(bt);var me=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=(u=>(u[u.TEXT=1]="TEXT",u[u.CLASS=2]="CLASS",u[u.STYLE=4]="STYLE",u[u.PROPS=8]="PROPS",u[u.FULL_PROPS=16]="FULL_PROPS",u[u.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",u[u.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",u[u.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",u[u.NEED_PATCH=256]="NEED_PATCH",u[u.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",u[u.HOISTED=-1]="HOISTED",u[u.BAIL=-2]="BAIL",u))(M||{}),Y=Symbol("Fragment"),z=Symbol("Text"),X=Symbol("Comment");function R(t){return t.type===Y}function I(t){return t.type===z}function O(t){return t.type===X}function de(t,e){return t.type===e.type&&t.key===e.key}function q(t){return Array.isArray(t.dynamicChildren)}function ue(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 o=n.startsWith("@")?n.slice(1).toLowerCase():n.slice(2).toLowerCase();t.addEventListener(e,o,r)}else n==="key"||n==="ref"||t.setAttribute(e,n,r)}function B(t,e,n,r,o){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();o&&t.removeEventListener(e,s,o),r&&t.addEventListener(e,s,r)}else t.setAttribute(e,n,r)}function J(t,e,n,r){for(let o in r){if(o==="key"||o==="ref")continue;let s=n[o],i=r[o];i!==s&&B(t,e,o,i,s)}for(let o in n)if(!(o==="key"||o==="ref")&&!(o in r))if(o==="class")t.setClass(e,"");else if(o==="style")t.setStyle(e,{});else if(o.startsWith("on")||o.startsWith("@")){let s=o.startsWith("@")?o.slice(1).toLowerCase():o.slice(2).toLowerCase();t.removeEventListener(e,s,n[o])}else t.removeAttribute(e,o)}function K(t,e,n,r,o,s){let{shapeFlag:i}=n;if(R(n)){Ge(t,e,n,r,o,s);return}if(I(n)){let a=t.createText(n.children);n.el=a,t.insert(r,a,o);return}if(O(n)){let a=t.createComment(n.children);n.el=a,t.insert(r,a,o);return}if(i&1){We(t,e,n,r,o,s);return}if(i&6){Ue(e,n,r,o,s);return}}function We(t,e,n,r,o,s){let i=n.type,a=t.createElement(i);if(n.el=a,n.props)for(let d in n.props){let f=n.props[d];ue(t,a,d,f)}let{shapeFlag:l,children:c}=n;l&8?a.textContent=c:l&16&&$(e,c,a,null,s),t.insert(r,a,o)}function $(t,e,n,r,o){for(let s=0;s<e.length;s++)t(null,e[s],n,r,o)}function Ge(t,e,n,r,o,s){let{children:i}=n,a=t.createComment("");t.insert(r,a,o),Array.isArray(i)&&i.length>0&&$(e,i,r,a,s),n.el=a,n.anchor=a}function Ue(t,e,n,r,o){let s=e.component;s&&s.update&&s.update(),s&&s.subTree&&(t(null,s.subTree,n,r,s),e.el=s.subTree.el)}function ye(t,e,n,r){let{shapeFlag:o,children:s}=n;if(R(n)){if(Array.isArray(s))for(let i=0;i<s.length;i++)e(s[i],r);n.anchor&&n.anchor.parentNode&&t.remove(n.anchor);return}if(o&6){n.component&&n.component.subTree&&e(n.component.subTree,r);return}n.el&&t.remove(n.el)}function w(t,e){for(let n=0;n<e.length;n++)t(e[n])}var v=require("@lytjs/vdom");function k(t,e,n,r,o,s=null,i=null){if(r==null){n&&e(n,o);return}if(n===null){K(t,Q(t,e),r,o,s,i);return}if(q(r)&&q(n)){qe(t,e,n,r,o,i);return}if(!de(n,r)){e(n,o),K(t,Q(t,e),r,o,s,i);return}r.el=n.el,r.anchor=n.anchor;let{shapeFlag:a}=r;if(R(r)){Xe(t,e,n,r,o,s,i);return}if(I(r)){r.children!==n.children&&(r.el.nodeValue=r.children);return}if(O(r)){r.children!==n.children&&(r.el.nodeValue=r.children);return}if(a&1){Ye(t,e,n,r,i);return}if(a&6){Be(n,r,i);return}}function Q(t,e){return(n,r,o,s,i)=>{k(t,e,n,r,o,s,i)}}function Ye(t,e,n,r,o=null){let s=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&&(s.textContent=r.children),l&2&&i.class!==a.class&&t.setClass(s,a.class),l&4&&i.style!==a.style&&t.setStyle(s,a.style||{}),l&8&&c)for(let d=0;d<c.length;d++){let f=c[d],u=i[f],N=a[f];N!==u&&B(t,s,f,N,u)}l&16&&J(t,s,i,a)}else J(t,s,i,a);(!l||!(l&1))&&fe(t,e,n,r,s,null,o)}function fe(t,e,n,r,o,s,i){let a=n.shapeFlag,l=r.shapeFlag,c=n.children,d=r.children;if(l&8){a&16&&w(e,c),c!==d&&(o.textContent=d);return}if(l&16){a&16?ze(t,e,c,d,o,s,i):(a&8&&(o.textContent=""),$(Q(t,e),d,o,s,i));return}d==null&&(a&8?o.textContent="":a&16&&w(e,c))}function ze(t,e,n,r,o,s,i){r.every(l=>l.key!==null&&l.key!==void 0)&&n.every(l=>l.key!==null&&l.key!==void 0)?(0,v.patchKeyedChildren)(n,r,o,s,i,null,!1):(0,v.patchUnkeyedChildren)(n,r,o,s,i,null,!1)}function Xe(t,e,n,r,o,s,i){let a=n.children,l=r.children;Array.isArray(l)&&l.length>0?(fe(t,e,n,r,o,s,i),r.el=l[0].el,r.anchor=l[l.length-1].el?t.nextSibling(l[l.length-1].el):s):Array.isArray(a)&&a.length>0&&l===null?(w(e,a),r.el=n.el,r.anchor=n.anchor):(r.el=n.el,r.anchor=n.anchor)}function qe(t,e,n,r,o,s){let i=n.dynamicChildren,a=r.dynamicChildren;for(let l=0;l<a.length;l++)k(t,e,i[l],a[l],o,null,s)}function Be(t,e,n){e.component=t.component,e.el=t.el,e.component&&e.component.update&&e.component.update()}function pe(t){function e(o,s){ye(t,e,o,s)}(0,me.registerDOMOperations)({insert(o,s,i){t.insert(s,o,i)},createElement(o){return t.createElement(o)},createText(o){return t.createText(o)},setText(o,s){o.nodeValue=s},setElementText(o,s){o.textContent=s},remove(o){t.remove(o)},createComment(o){return t.createComment(o)},mount(o,s,i,a,l,c,d){r(null,o,s,i,a)},patch(o,s,i,a,l,c,d,f){r(o,s,i,a,l)},unmount(o,s,i,a){e(o)},move(o,s,i){t.insert(s,o.el,i)}});function r(o,s,i,a,l){k(t,e,o,s,i,a,l)}return{mount(o,s){s.nodeType===1&&(s.textContent=""),r(null,o,s,null,null)},patch(o,s,i){var a;r(o,s,i||((a=o.el)==null?void 0:a.parentNode),null,null)},unmount(o,s){e(o,s)}}}var h=require("@lytjs/vdom"),P=require("@lytjs/common"),Z=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Je={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ke=/[&<>"']/g;var Qe=0;function y(t){return t.replace(Ke,e=>Je[e])}function Ze(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="${y((0,P.normalizeClass)(e))}"`:t==="style"?`style="${y((0,P.normalizeStyle)(e))}"`:t==="dangerouslySetInnerHTML"||t==="innerHTML"?"":`${t}="${y(String(e))}"`}function ee(t){if(!t)return"";let e=[];for(let n in t){let r=t[n],o=Ze(n,r);o&&e.push(o)}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*D(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(o=>m(o)).join(""):"":typeof e=="symbol"&&String(e).includes("Text")?y(String(r||"")):typeof e=="symbol"&&String(e).includes("Comment")?`<!--${String(r||"")}-->`:typeof e=="string"?et(e,n,r,t):typeof e=="object"&&e!==null||typeof e=="function"?H(t):""}function et(t,e,n,r){let o=ee(e);if(Z.has(t))return`<${t}${o} />`;if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let a=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;return`<${t}${o}>${y(String(a))}</${t}>`}let s="",i=r.shapeFlag||0;return i&h.ShapeFlags.TEXT_CHILDREN?s=y(String(n||"")):i&h.ShapeFlags.ARRAY_CHILDREN&&Array.isArray(n)?s=n.map(a=>m(a)).join(""):i&h.ShapeFlags.SLOTS_CHILDREN&&typeof n=="object"&&n!==null?s=te(n):typeof n=="string"?s=y(n):Array.isArray(n)?s=n.map(a=>m(a)).join(""):typeof n=="number"&&(s=y(String(n))),`<${t}${o}>${s}</${t}>`}function te(t){let e=[];for(let n in t){let r=t[n];if(typeof r=="function"){let o=r();Array.isArray(o)?e.push(o.map(s=>m(s)).join("")):o!=null&&e.push(m(o))}else Array.isArray(r)?e.push(r.map(o=>m(o)).join("")):r!=null&&e.push(m(r))}return e.join("")}function H(t){let e=t.type;if(e&&e.__island)return tt(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 tt(t,e){var N;let n=e.name||((N=t.props)==null?void 0:N["data-island-id"])||"anonymous",r=t.props||{},o=r["data-hydrate-when"]||e.__hydrateWhen||"",s=e.__islandTag||"div",i={};for(let T in r)T==="data-hydrate-when"||T==="data-island-id"||(i[T]=r[T]);let a=JSON.stringify(i),l=y(a),c="";if(typeof e.render=="function"){let T=e.render(r,{slots:t.children||{},emit:()=>{}});c=m(T)}else if(typeof e=="function"){let T=e(r,{slots:t.children||{}});c=m(T)}let d=o?` data-hydrate-when="${y(o)}"`:"",f=`<${s} data-hydrate="${y(n)}" data-props="${l}"${d}>${c}</${s}>`,u=`<script type="application/json" data-hydrate-props="${y(n)}">${a}<\/script>`;return f+u}async function*D(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 o of r)yield*D(o);return}if(typeof e=="symbol"&&String(e).includes("Text")){yield y(String(r||""));return}if(typeof e=="symbol"&&String(e).includes("Comment")){yield`<!--${String(r||"")}-->`;return}if(typeof e=="string"){yield*nt(e,n,r,t);return}if(typeof e=="object"||typeof e=="function"){yield H(t);return}}async function*nt(t,e,n,r){let o=ee(e);if(Z.has(t)){yield`<${t}${o} />`;return}if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let i=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;yield`<${t}${o}>${y(String(i))}</${t}>`;return}yield`<${t}${o}>`;let s=r.shapeFlag||0;if(s&h.ShapeFlags.TEXT_CHILDREN)yield y(String(n||""));else if(s&h.ShapeFlags.ARRAY_CHILDREN&&Array.isArray(n))for(let i of n)yield*D(i);else if(s&h.ShapeFlags.SLOTS_CHILDREN&&typeof n=="object"&&n!==null)yield te(n);else if(typeof n=="string")yield y(n);else if(Array.isArray(n))for(let i of n)yield*D(i);else typeof n=="number"&&(yield y(String(n)));yield`</${t}>`}function ge(t){return m(t)}function he(t,e){let n=(e==null?void 0:e.suspenseIdPrefix)||"suspense",r=S(t,n);return new ReadableStream({async pull(o){let{value:s,done:i}=await r.next();i?o.close():o.enqueue(s)},async cancel(){await r.return(void 0)}})}async function*Ne(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:o}=t;if(typeof n=="symbol"&&String(n)==="Symbol(Fragment)"){if(Array.isArray(o))for(let s of o)yield*S(s,e);return}if(typeof n=="symbol"&&String(n).includes("Text")){yield y(String(o||""));return}if(typeof n=="symbol"&&String(n).includes("Comment")){yield`<!--${String(o||"")}-->`;return}if(typeof n=="string"){yield*rt(n,r,o,t,e);return}if(typeof n=="object"&&n!==null){let s=n;if(s.name==="Suspense"||s._isSuspense){yield*ot(t,e);return}if(s._isAsyncComponent||s.__asyncSetup){yield*st(t,e);return}yield H(t);return}if(typeof n=="function"){yield H(t);return}}async function*rt(t,e,n,r,o){let s=ee(e);if(Z.has(t)){yield`<${t}${s} />`;return}if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let a=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;yield`<${t}${s}>${y(String(a))}</${t}>`;return}yield`<${t}${s}>`;let i=r.shapeFlag||0;if(i&h.ShapeFlags.TEXT_CHILDREN)yield y(String(n||""));else if(i&h.ShapeFlags.ARRAY_CHILDREN&&Array.isArray(n))for(let a of n)yield*S(a,o);else if(i&h.ShapeFlags.SLOTS_CHILDREN&&typeof n=="object"&&n!==null)yield te(n);else if(typeof n=="string")yield y(n);else if(Array.isArray(n))for(let a of n)yield*S(a,o);else typeof n=="number"&&(yield y(String(n)));yield`</${t}>`}async function*ot(t,e){let n=`${e}-${Qe++}`,o=(t.props||{}).fallback,s="";o&&(typeof o=="object"&&o!==null?s=m(o):typeof o=="string"&&(s=o));let i=t.children,a=[];if(typeof i=="object"&&i!==null){if(Array.isArray(i))a=i;else if(typeof i.default=="function"){let d=i.default();Array.isArray(d)?a=d:d!=null&&(a=[d])}}let l=[];function c(d){for(let f of d){if(f==null)continue;let u=f.type;if(u&&(u._isAsyncComponent||u.__asyncSetup||f.__asyncSetup)){let N=f.__asyncPromise||u.__asyncPromise;N&&l.push(N.then(()=>{}))}}}if(c(a),l.length===0){for(let d of a)yield*S(d,e);return}yield`<!--${n}-fallback-->`,yield s,await Promise.all(l),yield`<!--${n}-resolved-->`;for(let d of a)yield*S(d,e);yield`<!--/${n}-->`}async function*st(t,e){let n=t.type,r=t.__asyncPromise||n.__asyncPromise;if(r)try{await r}catch(o){yield"<!--async-component-error-->";return}yield H(t)}var Te=new _;var W=require("@lytjs/common"),j={ELEMENT:1,FUNCTIONAL_COMPONENT:2,STATEFUL_COMPONENT:4,TEXT_CHILDREN:8,ARRAY_CHILDREN:16,SLOTS_CHILDREN:32},g=!1,se=[],ne=!1,p={success:!0,mismatches:0,hydratedNodes:0};function Le(){return g}function Ve(t){g=t}function Ee(){return{...p}}function ie(){p={success:!0,mismatches:0,hydratedNodes:0}}function be(t){g?se.push(t):t()}function Ce(t,e,n={}){ie(),n.onHydrated&&se.push(n.onHydrated),g=!0;try{let r=e.firstElementChild;return r?(t._vnode||t.mount(e),t._vnode&&V(r,t._vnode,n),g=!1,re(),p):(g=!1,t.mount(e),p.success=!1,re(),p)}catch(r){return g=!1,p.success=!1,e.innerHTML="",t.mount(e),re(),p}}function re(){if(ne)return;ne=!0;let t=se.splice(0);for(let e of t)try{e()}catch(n){}ne=!1}function V(t,e,n){if(ft(e)){ct(t,e,n);return}if(mt(e)){at(t,e,n);return}if(pt(e)){lt(t,e,n);return}if(gt(e)){dt(t,e,n);return}if(typeof e.type=="string"){it(t,e,n);return}}function it(t,e,n){let r=t.tagName.toLowerCase(),o=e.type.toLowerCase();if(r!==o){G(t,e,`\u6807\u7B7E\u4E0D\u5339\u914D: DOM "${r}" vs VNode "${o}"`,n);return}e.el=t,e.props&&ae(t,e.props),e.ref&&yt(t,e.ref),ut(t,e,n),p.hydratedNodes++}function at(t,e,n){if(t.nodeType!==3){G(t,e,"\u671F\u671B\u6587\u672C\u8282\u70B9",n);return}e.el=t;let r=t.nodeValue||"",o=String(e.children||"");r!==o&&(t.nodeValue=o,n.strict),p.hydratedNodes++}function lt(t,e,n){if(t.nodeType!==8){G(t,e,"\u671F\u671B\u6CE8\u91CA\u8282\u70B9",n);return}e.el=t;let r=t.nodeValue||"",o=String(e.children||"");r!==o&&(t.nodeValue=o),p.hydratedNodes++}function ct(t,e,n){if(!Array.isArray(e.children))return;let r=Array.from(t.childNodes);for(let o=0;o<e.children.length;o++){let s=e.children[o],i=r[o];if(!i){p.mismatches++;break}V(i,s,n)}}function dt(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 o=r(e.props||{},{slots:e.children||{}});if(o){V(t,o,n),e.el=o.el;return}}catch(o){}if(typeof r=="object"&&r!==null&&typeof r.render=="function")try{let o=r.render(e.props||{},{slots:e.children||{},emit:()=>{}});if(o){V(t,o,n),e.el=o.el;return}}catch(o){}G(t,e,"\u7EC4\u4EF6\u65E0\u6CD5\u83B7\u53D6 subTree",n)}function ut(t,e,n){if(!e.children)return;let r=e.shapeFlag||0;if(typeof e.children=="string"||r&j.TEXT_CHILDREN){let o=t.textContent||"",s=String(e.children||"");o!==s&&(t.textContent=s,n.strict);return}if(Array.isArray(e.children)){let o=Array.from(t.childNodes),s=0;for(let i=0;i<o.length&&s<e.children.length;i++){let a=e.children[s];if(a==null){s++;continue}V(o[i],a,n),s++}s<e.children.length&&p.mismatches++}r&j.SLOTS_CHILDREN&&typeof e.children=="object"&&e.children}function ae(t,e){for(let n in e){let r=e[n];if(n.startsWith("on")&&typeof r=="function"){let o=n.slice(2).toLowerCase();t.addEventListener(o,r)}}}function yt(t,e){typeof e=="function"?e(t):e&&typeof e=="object"&&(e.current=t)}function ft(t){return typeof t.type=="symbol"&&String(t.type)==="Symbol(Fragment)"}function mt(t){return typeof t.type=="symbol"&&String(t.type).includes("Text")}function pt(t){return typeof t.type=="symbol"&&String(t.type).includes("Comment")}function gt(t){return!!((t.shapeFlag||0)&(j.STATEFUL_COMPONENT|j.FUNCTIONAL_COMPONENT)||typeof t.type=="object"&&t.type!==null||typeof t.type=="function")}function G(t,e,n,r){let o=`[lyt] \u6CE8\u6C34\u4E0D\u5339\u914D: ${n}`;if(p.mismatches++,r.strict)throw new W.LytError(W.LytErrorCodes.LYT_SSR_HYDRATION_ERROR,o)}var b=new Map,x=new Map,Re={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ht=/[&<>"']/g;function E(t){return t.replace(ht,e=>Re[e])}function oe(t){return t.replace(/[&<>"']/g,e=>Re[e])}function le(t,e,n={}){let r=typeof document!="undefined"?document:null;if(!r)return{success:!1,mismatches:0,hydratedNodes:0};let o=r.querySelector(t);if(!o)return{success:!1,mismatches:0,hydratedNodes:0};let s=o.getAttribute("data-hydrate");if(!s)return{success:!1,mismatches:0,hydratedNodes:0};if(o.hasAttribute("data-hydrated"))return{success:!0,mismatches:0,hydratedNodes:0};let i=Nt(s,r);if(i===null)return{success:!1,mismatches:0,hydratedNodes:0};let a=o.getAttribute("data-hydrate-when");return a||n.lazy?Tt(o,s,e,i,a||"visible",n):L(o,s,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 o=r.getAttribute("data-props");if(o)try{return JSON.parse(o)}catch(s){return null}}return{}}try{return JSON.parse(n.textContent||"{}")}catch(r){return null}}function L(t,e,n,r,o){let s={success:!0,mismatches:0,hydratedNodes:0};try{g=!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 g=!1,s.success=!1,s;if(o.dev!==!1){let l=Lt(t,i,e);s.mismatches=l}V(t,i,o),s.hydratedNodes=p.hydratedNodes,i.props&&ae(t,i.props),F(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),g=!1,o.onHydrated&&o.onHydrated(),s}catch(i){return g=!1,s.success=!1,s}}function F(t,e){if(!(!e.children||typeof e.children=="string")&&Array.isArray(e.children)){let n=Array.from(t.children),r=0;for(let o=0;o<n.length&&r<e.children.length;o++){let s=e.children[r];if(s==null){r++;continue}if(typeof s.type=="string"&&s.props)ae(n[o],s.props),F(n[o],s);else if(typeof s.type=="object"||typeof s.type=="function"){let i=s.type;if(typeof i=="function")try{let a=i(s.props||{},{slots:s.children||{}});a&&n[o]&&F(n[o],a)}catch(a){}else if(i&&typeof i.render=="function")try{let a=i.render(s.props||{},{slots:s.children||{},emit:()=>{}});a&&n[o]&&F(n[o],a)}catch(a){}}r++}}}function Tt(t,e,n,r,o,s){let i={success:!0,mismatches:0,hydratedNodes:0},a=null;s.timeout&&s.timeout>0&&(a=setTimeout(()=>{He(t,e),L(t,e,n,r,s)},s.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),o){case"visible":{if(typeof IntersectionObserver!="undefined"){let c=new IntersectionObserver(d=>{for(let f of d)f.isIntersecting&&(c.unobserve(f.target),l.observer=null,a&&clearTimeout(a),l.timeoutId=null,L(t,e,n,r,s))},{rootMargin:"200px"});c.observe(t),l.observer=c}else a&&clearTimeout(a),L(t,e,n,r,s);break}case"idle":{(d=>{typeof requestIdleCallback!="undefined"?requestIdleCallback(d,{timeout:s.timeout||2e3}):setTimeout(d,1)})(()=>{a&&clearTimeout(a),l.timeoutId=null,t.hasAttribute("data-hydrated")||L(t,e,n,r,s)});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,s)};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,s)}return i}function He(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 Ae(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(o=>{let s=o.getAttribute("data-hydrate");if(!s){r.success=!1;return}let i=x.get(s);if(!i){r.success=!1;return}let a=le(`[data-hydrate="${s}"]`,i,t);r.mismatches+=a.mismatches,r.hydratedNodes+=a.hydratedNodes,a.success||(r.success=!1)}),r}function xe(t,e){x.set(t,e)}function _e(t){if(!b.get(t))return;let n=typeof document!="undefined"?document.querySelector(`[data-hydrate="${t}"]`):null;n&&(He(n,t),n.removeAttribute("data-hydrated")),b.delete(t),x.delete(t)}function Me(){return b}function Ie(){b.clear(),x.clear()}function Oe(t,e={},n="div",r){let o=t.name||"anonymous",s=JSON.stringify(e),i=E(s),a="";if(typeof t.render=="function"){let u=t.render(e,{slots:t.slots||{},emit:()=>{}});a=A(u)}let l=r?` data-hydrate-when="${oe(r)}"`:"",c=oe(o),d=`<${n} data-hydrate="${c}" data-props="${i}"${l}>${a}</${n}>`,f=`<script type="application/json" data-hydrate-props="${c}">${s}<\/script>`;return d+f}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(o=>A(o)).join(""):"";if(typeof e=="symbol"&&String(e).includes("Text"))return E(String(r||""));if(typeof e=="symbol"&&String(e).includes("Comment"))return`<!--${oe(String(r||""))}-->`;if(typeof e=="string"){let o=St(n);if(new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]).has(e))return`<${e}${o} />`;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}${o}>${i}</${e}>`}if(typeof e=="function"){let o=e(n||{},{slots:r||{}});return A(o)}if(typeof e=="object"&&e!==null){let o=e;if(typeof o.render=="function"){let s=o.render(n||{},{slots:r||{},emit:()=>{}});return A(s)}}return""}function St(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 ce=[];function Lt(t,e,n){let r=0,o=Vt(t),s=A(e);if(o!==s){r++;let i={islandId:n,expected:s,actual:o,suggestion:Et(o,s,n)};ce.push(i)}return r}function Vt(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 Et(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":Se(t)===Se(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 Se(t){return t.replace(/\s+/g," ").replace(/>\s+</g,"><").trim()}function $e(){return[...ce]}function we(){ce.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=(y=>(y[y.TEXT=1]="TEXT",y[y.CLASS=2]="CLASS",y[y.STYLE=4]="STYLE",y[y.PROPS=8]="PROPS",y[y.FULL_PROPS=16]="FULL_PROPS",y[y.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",y[y.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",y[y.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",y[y.NEED_PATCH=256]="NEED_PATCH",y[y.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",y[y.HOISTED=-1]="HOISTED",y[y.BAIL=-2]="BAIL",y))(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 d in n.props){let u=n.props[d];re(t,a,d,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 d=0;d<c.length;d++){let u=c[d],y=i[u],N=a[u];N!==y&&W(t,o,u,N,y)}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,d=r.children;if(l&8){a&16&&I(e,c),c!==d&&(s.textContent=d);return}if(l&16){a&16?he(t,e,c,d,s,o,i):(a&8&&(s.textContent=""),O(Y(t,e),d,s,o,i));return}d==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,d){r(null,s,o,i,a)},patch(s,o,i,a,l,c,d,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,h={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(Ae(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 Ae(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"?He(e,n,r,t):typeof e=="object"&&e!==null||typeof e=="function"?R(t):""}function He(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&h.TEXT_CHILDREN?o=f(String(n||"")):i&h.ARRAY_CHILDREN&&Array.isArray(n)?o=n.map(a=>m(a)).join(""):i&h.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 T in r)T==="data-hydrate-when"||T==="data-island-id"||(i[T]=r[T]);let a=JSON.stringify(i),l=f(a),c="";if(typeof e.render=="function"){let T=e.render(r,{slots:t.children||{},emit:()=>{}});c=m(T)}else if(typeof e=="function"){let T=e(r,{slots:t.children||{}});c=m(T)}let d=s?` data-hydrate-when="${f(s)}"`:"",u=`<${o} data-hydrate="${f(n)}" data-props="${l}"${d}>${c}</${o}>`,y=`<script type="application/json" data-hydrate-props="${f(n)}">${a}<\/script>`;return u+y}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&h.TEXT_CHILDREN)yield f(String(n||""));else if(o&h.ARRAY_CHILDREN&&Array.isArray(n))for(let i of n)yield*w(i);else if(o&h.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&h.TEXT_CHILDREN)yield f(String(n||""));else if(i&h.ARRAY_CHILDREN&&Array.isArray(n))for(let a of n)yield*S(a,s);else if(i&h.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++}`,s=(t.props||{}).fallback,o="";s&&(typeof s=="object"&&s!==null?o=m(s):typeof s=="string"&&(o=s));let i=t.children,a=[];if(typeof i=="object"&&i!==null){if(Array.isArray(i))a=i;else if(typeof i.default=="function"){let d=i.default();Array.isArray(d)?a=d:d!=null&&(a=[d])}}let l=[];function c(d){for(let u of d){if(u==null)continue;let y=u.type;if(y&&(y._isAsyncComponent||y.__asyncSetup||u.__asyncSetup)){let N=u.__asyncPromise||y.__asyncPromise;N&&l.push(N.then(()=>{}))}}}if(c(a),l.length===0){for(let d of a)yield*S(d,e);return}yield`<!--${n}-fallback-->`,yield o,await Promise.all(l),yield`<!--${n}-resolved-->`;for(let d of a)yield*S(d,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},g=!1,K=[],p={success:!0,mismatches:0,hydratedNodes:0};function Pe(){return g}function je(t){g=t}function Fe(){return{...p}}function le(){p={success:!0,mismatches:0,hydratedNodes:0}}function ke(t){g?K.push(t):t()}function We(t,e,n={}){le(),n.onHydrated&&K.push(n.onHydrated),g=!0;try{let r=e.firstElementChild;return r?(t._vnode||t.mount(e),t._vnode&&V(r,t._vnode,n),g=!1,B(),p):(g=!1,t.mount(e),p.success=!1,B(),p)}catch(r){return g=!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,H=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{g=!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 g=!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),H.set(e,n),g=!1,s.onHydrated&&s.onHydrated(),o}catch(i){return g=!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),H.set(e,n),s){case"visible":{if(typeof IntersectionObserver!="undefined"){let c=new IntersectionObserver(d=>{for(let u of d)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":{(d=>{typeof requestIdleCallback!="undefined"?requestIdleCallback(d,{timeout:o.timeout||2e3}):setTimeout(d,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");if(!o){r.success=!1;return}let i=H.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){H.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),H.delete(t)}function at(){return b}function lt(){b.clear(),H.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=A(u)}let l=r?` data-hydrate-when="${r}"`:"",c=`<${n} data-hydrate="${s}" data-props="${i}"${l}>${a}</${n}>`,d=`<script type="application/json" data-hydrate-props="${s}">${o}<\/script>`;return c+d}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=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=>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 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=A(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 Ee}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=(u=>(u[u.TEXT=1]="TEXT",u[u.CLASS=2]="CLASS",u[u.STYLE=4]="STYLE",u[u.PROPS=8]="PROPS",u[u.FULL_PROPS=16]="FULL_PROPS",u[u.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",u[u.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",u[u.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",u[u.NEED_PATCH=256]="NEED_PATCH",u[u.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",u[u.HOISTED=-1]="HOISTED",u[u.BAIL=-2]="BAIL",u))(F||{}),te=Symbol("Fragment"),ne=Symbol("Text"),re=Symbol("Comment");function C(t){return t.type===te}function _(t){return t.type===ne}function M(t){return t.type===re}function oe(t,e){return t.type===e.type&&t.key===e.key}function j(t){return Array.isArray(t.dynamicChildren)}function se(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 o=n.startsWith("@")?n.slice(1).toLowerCase():n.slice(2).toLowerCase();t.addEventListener(e,o,r)}else n==="key"||n==="ref"||t.setAttribute(e,n,r)}function W(t,e,n,r,o){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();o&&t.removeEventListener(e,s,o),r&&t.addEventListener(e,s,r)}else t.setAttribute(e,n,r)}function G(t,e,n,r){for(let o in r){if(o==="key"||o==="ref")continue;let s=n[o],i=r[o];i!==s&&W(t,e,o,i,s)}for(let o in n)if(!(o==="key"||o==="ref")&&!(o in r))if(o==="class")t.setClass(e,"");else if(o==="style")t.setStyle(e,{});else if(o.startsWith("on")||o.startsWith("@")){let s=o.startsWith("@")?o.slice(1).toLowerCase():o.slice(2).toLowerCase();t.removeEventListener(e,s,n[o])}else t.removeAttribute(e,o)}function U(t,e,n,r,o,s){let{shapeFlag:i}=n;if(C(n)){me(t,e,n,r,o,s);return}if(_(n)){let a=t.createText(n.children);n.el=a,t.insert(r,a,o);return}if(M(n)){let a=t.createComment(n.children);n.el=a,t.insert(r,a,o);return}if(i&1){fe(t,e,n,r,o,s);return}if(i&6){pe(e,n,r,o,s);return}}function fe(t,e,n,r,o,s){let i=n.type,a=t.createElement(i);if(n.el=a,n.props)for(let d in n.props){let f=n.props[d];se(t,a,d,f)}let{shapeFlag:l,children:c}=n;l&8?a.textContent=c:l&16&&I(e,c,a,null,s),t.insert(r,a,o)}function I(t,e,n,r,o){for(let s=0;s<e.length;s++)t(null,e[s],n,r,o)}function me(t,e,n,r,o,s){let{children:i}=n,a=t.createComment("");t.insert(r,a,o),Array.isArray(i)&&i.length>0&&I(e,i,r,a,s),n.el=a,n.anchor=a}function pe(t,e,n,r,o){let s=e.component;s&&s.update&&s.update(),s&&s.subTree&&(t(null,s.subTree,n,r,s),e.el=s.subTree.el)}function ie(t,e,n,r){let{shapeFlag:o,children:s}=n;if(C(n)){if(Array.isArray(s))for(let i=0;i<s.length;i++)e(s[i],r);n.anchor&&n.anchor.parentNode&&t.remove(n.anchor);return}if(o&6){n.component&&n.component.subTree&&e(n.component.subTree,r);return}n.el&&t.remove(n.el)}function O(t,e){for(let n=0;n<e.length;n++)t(e[n])}import{patchKeyedChildren as ge,patchUnkeyedChildren as he}from"@lytjs/vdom";function $(t,e,n,r,o,s=null,i=null){if(r==null){n&&e(n,o);return}if(n===null){U(t,Y(t,e),r,o,s,i);return}if(j(r)&&j(n)){Le(t,e,n,r,o,i);return}if(!oe(n,r)){e(n,o),U(t,Y(t,e),r,o,s,i);return}r.el=n.el,r.anchor=n.anchor;let{shapeFlag:a}=r;if(C(r)){Se(t,e,n,r,o,s,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){Ne(t,e,n,r,i);return}if(a&6){Ve(n,r,i);return}}function Y(t,e){return(n,r,o,s,i)=>{$(t,e,n,r,o,s,i)}}function Ne(t,e,n,r,o=null){let s=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&&(s.textContent=r.children),l&2&&i.class!==a.class&&t.setClass(s,a.class),l&4&&i.style!==a.style&&t.setStyle(s,a.style||{}),l&8&&c)for(let d=0;d<c.length;d++){let f=c[d],u=i[f],N=a[f];N!==u&&W(t,s,f,N,u)}l&16&&G(t,s,i,a)}else G(t,s,i,a);(!l||!(l&1))&&ae(t,e,n,r,s,null,o)}function ae(t,e,n,r,o,s,i){let a=n.shapeFlag,l=r.shapeFlag,c=n.children,d=r.children;if(l&8){a&16&&O(e,c),c!==d&&(o.textContent=d);return}if(l&16){a&16?Te(t,e,c,d,o,s,i):(a&8&&(o.textContent=""),I(Y(t,e),d,o,s,i));return}d==null&&(a&8?o.textContent="":a&16&&O(e,c))}function Te(t,e,n,r,o,s,i){r.every(l=>l.key!==null&&l.key!==void 0)&&n.every(l=>l.key!==null&&l.key!==void 0)?ge(n,r,o,s,i,null,!1):he(n,r,o,s,i,null,!1)}function Se(t,e,n,r,o,s,i){let a=n.children,l=r.children;Array.isArray(l)&&l.length>0?(ae(t,e,n,r,o,s,i),r.el=l[0].el,r.anchor=l[l.length-1].el?t.nextSibling(l[l.length-1].el):s):Array.isArray(a)&&a.length>0&&l===null?(O(e,a),r.el=n.el,r.anchor=n.anchor):(r.el=n.el,r.anchor=n.anchor)}function Le(t,e,n,r,o,s){let i=n.dynamicChildren,a=r.dynamicChildren;for(let l=0;l<a.length;l++)$(t,e,i[l],a[l],o,null,s)}function Ve(t,e,n){e.component=t.component,e.el=t.el,e.component&&e.component.update&&e.component.update()}function be(t){function e(o,s){ie(t,e,o,s)}Ee({insert(o,s,i){t.insert(s,o,i)},createElement(o){return t.createElement(o)},createText(o){return t.createText(o)},setText(o,s){o.nodeValue=s},setElementText(o,s){o.textContent=s},remove(o){t.remove(o)},createComment(o){return t.createComment(o)},mount(o,s,i,a,l,c,d){r(null,o,s,i,a)},patch(o,s,i,a,l,c,d,f){r(o,s,i,a,l)},unmount(o,s,i,a){e(o)},move(o,s,i){t.insert(s,o.el,i)}});function r(o,s,i,a,l){$(t,e,o,s,i,a,l)}return{mount(o,s){s.nodeType===1&&(s.textContent=""),r(null,o,s,null,null)},patch(o,s,i){var a;r(o,s,i||((a=o.el)==null?void 0:a.parentNode),null,null)},unmount(o,s){e(o,s)}}}import{ShapeFlags as h}from"@lytjs/vdom";import{normalizeClass as He,normalizeStyle as Ae}from"@lytjs/common";var z=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ce={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Re=/[&<>"']/g;var xe=0;function y(t){return t.replace(Re,e=>Ce[e])}function _e(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="${y(He(e))}"`:t==="style"?`style="${y(Ae(e))}"`:t==="dangerouslySetInnerHTML"||t==="innerHTML"?"":`${t}="${y(String(e))}"`}function X(t){if(!t)return"";let e=[];for(let n in t){let r=t[n],o=_e(n,r);o&&e.push(o)}return e.length>0?" "+e.join(" "):""}var w=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*v(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(o=>m(o)).join(""):"":typeof e=="symbol"&&String(e).includes("Text")?y(String(r||"")):typeof e=="symbol"&&String(e).includes("Comment")?`<!--${String(r||"")}-->`:typeof e=="string"?Me(e,n,r,t):typeof e=="object"&&e!==null||typeof e=="function"?R(t):""}function Me(t,e,n,r){let o=X(e);if(z.has(t))return`<${t}${o} />`;if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let a=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;return`<${t}${o}>${y(String(a))}</${t}>`}let s="",i=r.shapeFlag||0;return i&h.TEXT_CHILDREN?s=y(String(n||"")):i&h.ARRAY_CHILDREN&&Array.isArray(n)?s=n.map(a=>m(a)).join(""):i&h.SLOTS_CHILDREN&&typeof n=="object"&&n!==null?s=q(n):typeof n=="string"?s=y(n):Array.isArray(n)?s=n.map(a=>m(a)).join(""):typeof n=="number"&&(s=y(String(n))),`<${t}${o}>${s}</${t}>`}function q(t){let e=[];for(let n in t){let r=t[n];if(typeof r=="function"){let o=r();Array.isArray(o)?e.push(o.map(s=>m(s)).join("")):o!=null&&e.push(m(o))}else Array.isArray(r)?e.push(r.map(o=>m(o)).join("")):r!=null&&e.push(m(r))}return e.join("")}function R(t){let e=t.type;if(e&&e.__island)return Ie(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 Ie(t,e){var N;let n=e.name||((N=t.props)==null?void 0:N["data-island-id"])||"anonymous",r=t.props||{},o=r["data-hydrate-when"]||e.__hydrateWhen||"",s=e.__islandTag||"div",i={};for(let T in r)T==="data-hydrate-when"||T==="data-island-id"||(i[T]=r[T]);let a=JSON.stringify(i),l=y(a),c="";if(typeof e.render=="function"){let T=e.render(r,{slots:t.children||{},emit:()=>{}});c=m(T)}else if(typeof e=="function"){let T=e(r,{slots:t.children||{}});c=m(T)}let d=o?` data-hydrate-when="${y(o)}"`:"",f=`<${s} data-hydrate="${y(n)}" data-props="${l}"${d}>${c}</${s}>`,u=`<script type="application/json" data-hydrate-props="${y(n)}">${a}<\/script>`;return f+u}async function*v(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 o of r)yield*v(o);return}if(typeof e=="symbol"&&String(e).includes("Text")){yield y(String(r||""));return}if(typeof e=="symbol"&&String(e).includes("Comment")){yield`<!--${String(r||"")}-->`;return}if(typeof e=="string"){yield*Oe(e,n,r,t);return}if(typeof e=="object"||typeof e=="function"){yield R(t);return}}async function*Oe(t,e,n,r){let o=X(e);if(z.has(t)){yield`<${t}${o} />`;return}if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let i=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;yield`<${t}${o}>${y(String(i))}</${t}>`;return}yield`<${t}${o}>`;let s=r.shapeFlag||0;if(s&h.TEXT_CHILDREN)yield y(String(n||""));else if(s&h.ARRAY_CHILDREN&&Array.isArray(n))for(let i of n)yield*v(i);else if(s&h.SLOTS_CHILDREN&&typeof n=="object"&&n!==null)yield q(n);else if(typeof n=="string")yield y(n);else if(Array.isArray(n))for(let i of n)yield*v(i);else typeof n=="number"&&(yield y(String(n)));yield`</${t}>`}function $e(t){return m(t)}function we(t,e){let n=(e==null?void 0:e.suspenseIdPrefix)||"suspense",r=S(t,n);return new ReadableStream({async pull(o){let{value:s,done:i}=await r.next();i?o.close():o.enqueue(s)},async cancel(){await r.return(void 0)}})}async function*ve(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:o}=t;if(typeof n=="symbol"&&String(n)==="Symbol(Fragment)"){if(Array.isArray(o))for(let s of o)yield*S(s,e);return}if(typeof n=="symbol"&&String(n).includes("Text")){yield y(String(o||""));return}if(typeof n=="symbol"&&String(n).includes("Comment")){yield`<!--${String(o||"")}-->`;return}if(typeof n=="string"){yield*ke(n,r,o,t,e);return}if(typeof n=="object"&&n!==null){let s=n;if(s.name==="Suspense"||s._isSuspense){yield*De(t,e);return}if(s._isAsyncComponent||s.__asyncSetup){yield*Pe(t,e);return}yield R(t);return}if(typeof n=="function"){yield R(t);return}}async function*ke(t,e,n,r,o){let s=X(e);if(z.has(t)){yield`<${t}${s} />`;return}if(e&&(e.dangerouslySetInnerHTML||e.innerHTML)){let a=e.dangerouslySetInnerHTML?e.dangerouslySetInnerHTML.__html||e.dangerouslySetInnerHTML:e.innerHTML;yield`<${t}${s}>${y(String(a))}</${t}>`;return}yield`<${t}${s}>`;let i=r.shapeFlag||0;if(i&h.TEXT_CHILDREN)yield y(String(n||""));else if(i&h.ARRAY_CHILDREN&&Array.isArray(n))for(let a of n)yield*S(a,o);else if(i&h.SLOTS_CHILDREN&&typeof n=="object"&&n!==null)yield q(n);else if(typeof n=="string")yield y(n);else if(Array.isArray(n))for(let a of n)yield*S(a,o);else typeof n=="number"&&(yield y(String(n)));yield`</${t}>`}async function*De(t,e){let n=`${e}-${xe++}`,o=(t.props||{}).fallback,s="";o&&(typeof o=="object"&&o!==null?s=m(o):typeof o=="string"&&(s=o));let i=t.children,a=[];if(typeof i=="object"&&i!==null){if(Array.isArray(i))a=i;else if(typeof i.default=="function"){let d=i.default();Array.isArray(d)?a=d:d!=null&&(a=[d])}}let l=[];function c(d){for(let f of d){if(f==null)continue;let u=f.type;if(u&&(u._isAsyncComponent||u.__asyncSetup||f.__asyncSetup)){let N=f.__asyncPromise||u.__asyncPromise;N&&l.push(N.then(()=>{}))}}}if(c(a),l.length===0){for(let d of a)yield*S(d,e);return}yield`<!--${n}-fallback-->`,yield s,await Promise.all(l),yield`<!--${n}-resolved-->`;for(let d of a)yield*S(d,e);yield`<!--/${n}-->`}async function*Pe(t,e){let n=t.type,r=t.__asyncPromise||n.__asyncPromise;if(r)try{await r}catch(o){yield"<!--async-component-error-->";return}yield R(t)}var Fe=new w;import{LytError as je,LytErrorCodes as We}from"@lytjs/common";var D={ELEMENT:1,FUNCTIONAL_COMPONENT:2,STATEFUL_COMPONENT:4,TEXT_CHILDREN:8,ARRAY_CHILDREN:16,SLOTS_CHILDREN:32},g=!1,Q=[],B=!1,p={success:!0,mismatches:0,hydratedNodes:0};function Ge(){return g}function Ue(t){g=t}function Ye(){return{...p}}function ce(){p={success:!0,mismatches:0,hydratedNodes:0}}function ze(t){g?Q.push(t):t()}function Xe(t,e,n={}){ce(),n.onHydrated&&Q.push(n.onHydrated),g=!0;try{let r=e.firstElementChild;return r?(t._vnode||t.mount(e),t._vnode&&V(r,t._vnode,n),g=!1,J(),p):(g=!1,t.mount(e),p.success=!1,J(),p)}catch(r){return g=!1,p.success=!1,e.innerHTML="",t.mount(e),J(),p}}function J(){if(B)return;B=!0;let t=Q.splice(0);for(let e of t)try{e()}catch(n){}B=!1}function V(t,e,n){if(tt(e)){Ke(t,e,n);return}if(nt(e)){Be(t,e,n);return}if(rt(e)){Je(t,e,n);return}if(ot(e)){Qe(t,e,n);return}if(typeof e.type=="string"){qe(t,e,n);return}}function qe(t,e,n){let r=t.tagName.toLowerCase(),o=e.type.toLowerCase();if(r!==o){P(t,e,`\u6807\u7B7E\u4E0D\u5339\u914D: DOM "${r}" vs VNode "${o}"`,n);return}e.el=t,e.props&&Z(t,e.props),e.ref&&et(t,e.ref),Ze(t,e,n),p.hydratedNodes++}function Be(t,e,n){if(t.nodeType!==3){P(t,e,"\u671F\u671B\u6587\u672C\u8282\u70B9",n);return}e.el=t;let r=t.nodeValue||"",o=String(e.children||"");r!==o&&(t.nodeValue=o,n.strict),p.hydratedNodes++}function Je(t,e,n){if(t.nodeType!==8){P(t,e,"\u671F\u671B\u6CE8\u91CA\u8282\u70B9",n);return}e.el=t;let r=t.nodeValue||"",o=String(e.children||"");r!==o&&(t.nodeValue=o),p.hydratedNodes++}function Ke(t,e,n){if(!Array.isArray(e.children))return;let r=Array.from(t.childNodes);for(let o=0;o<e.children.length;o++){let s=e.children[o],i=r[o];if(!i){p.mismatches++;break}V(i,s,n)}}function Qe(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 o=r(e.props||{},{slots:e.children||{}});if(o){V(t,o,n),e.el=o.el;return}}catch(o){}if(typeof r=="object"&&r!==null&&typeof r.render=="function")try{let o=r.render(e.props||{},{slots:e.children||{},emit:()=>{}});if(o){V(t,o,n),e.el=o.el;return}}catch(o){}P(t,e,"\u7EC4\u4EF6\u65E0\u6CD5\u83B7\u53D6 subTree",n)}function Ze(t,e,n){if(!e.children)return;let r=e.shapeFlag||0;if(typeof e.children=="string"||r&D.TEXT_CHILDREN){let o=t.textContent||"",s=String(e.children||"");o!==s&&(t.textContent=s,n.strict);return}if(Array.isArray(e.children)){let o=Array.from(t.childNodes),s=0;for(let i=0;i<o.length&&s<e.children.length;i++){let a=e.children[s];if(a==null){s++;continue}V(o[i],a,n),s++}s<e.children.length&&p.mismatches++}r&D.SLOTS_CHILDREN&&typeof e.children=="object"&&e.children}function Z(t,e){for(let n in e){let r=e[n];if(n.startsWith("on")&&typeof r=="function"){let o=n.slice(2).toLowerCase();t.addEventListener(o,r)}}}function et(t,e){typeof e=="function"?e(t):e&&typeof e=="object"&&(e.current=t)}function tt(t){return typeof t.type=="symbol"&&String(t.type)==="Symbol(Fragment)"}function nt(t){return typeof t.type=="symbol"&&String(t.type).includes("Text")}function rt(t){return typeof t.type=="symbol"&&String(t.type).includes("Comment")}function ot(t){return!!((t.shapeFlag||0)&(D.STATEFUL_COMPONENT|D.FUNCTIONAL_COMPONENT)||typeof t.type=="object"&&t.type!==null||typeof t.type=="function")}function P(t,e,n,r){let o=`[lyt] \u6CE8\u6C34\u4E0D\u5339\u914D: ${n}`;if(p.mismatches++,r.strict)throw new je(We.LYT_SSR_HYDRATION_ERROR,o)}var b=new Map,A=new Map,de={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},st=/[&<>"']/g;function E(t){return t.replace(st,e=>de[e])}function K(t){return t.replace(/[&<>"']/g,e=>de[e])}function ue(t,e,n={}){let r=typeof document!="undefined"?document:null;if(!r)return{success:!1,mismatches:0,hydratedNodes:0};let o=r.querySelector(t);if(!o)return{success:!1,mismatches:0,hydratedNodes:0};let s=o.getAttribute("data-hydrate");if(!s)return{success:!1,mismatches:0,hydratedNodes:0};if(o.hasAttribute("data-hydrated"))return{success:!0,mismatches:0,hydratedNodes:0};let i=it(s,r);if(i===null)return{success:!1,mismatches:0,hydratedNodes:0};let a=o.getAttribute("data-hydrate-when");return a||n.lazy?at(o,s,e,i,a||"visible",n):L(o,s,e,i,n)}function it(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 o=r.getAttribute("data-props");if(o)try{return JSON.parse(o)}catch(s){return null}}return{}}try{return JSON.parse(n.textContent||"{}")}catch(r){return null}}function L(t,e,n,r,o){let s={success:!0,mismatches:0,hydratedNodes:0};try{g=!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 g=!1,s.success=!1,s;if(o.dev!==!1){let l=pt(t,i,e);s.mismatches=l}V(t,i,o),s.hydratedNodes=p.hydratedNodes,i.props&&Z(t,i.props),k(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),g=!1,o.onHydrated&&o.onHydrated(),s}catch(i){return g=!1,s.success=!1,s}}function k(t,e){if(!(!e.children||typeof e.children=="string")&&Array.isArray(e.children)){let n=Array.from(t.children),r=0;for(let o=0;o<n.length&&r<e.children.length;o++){let s=e.children[r];if(s==null){r++;continue}if(typeof s.type=="string"&&s.props)Z(n[o],s.props),k(n[o],s);else if(typeof s.type=="object"||typeof s.type=="function"){let i=s.type;if(typeof i=="function")try{let a=i(s.props||{},{slots:s.children||{}});a&&n[o]&&k(n[o],a)}catch(a){}else if(i&&typeof i.render=="function")try{let a=i.render(s.props||{},{slots:s.children||{},emit:()=>{}});a&&n[o]&&k(n[o],a)}catch(a){}}r++}}}function at(t,e,n,r,o,s){let i={success:!0,mismatches:0,hydratedNodes:0},a=null;s.timeout&&s.timeout>0&&(a=setTimeout(()=>{ye(t,e),L(t,e,n,r,s)},s.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),o){case"visible":{if(typeof IntersectionObserver!="undefined"){let c=new IntersectionObserver(d=>{for(let f of d)f.isIntersecting&&(c.unobserve(f.target),l.observer=null,a&&clearTimeout(a),l.timeoutId=null,L(t,e,n,r,s))},{rootMargin:"200px"});c.observe(t),l.observer=c}else a&&clearTimeout(a),L(t,e,n,r,s);break}case"idle":{(d=>{typeof requestIdleCallback!="undefined"?requestIdleCallback(d,{timeout:s.timeout||2e3}):setTimeout(d,1)})(()=>{a&&clearTimeout(a),l.timeoutId=null,t.hasAttribute("data-hydrated")||L(t,e,n,r,s)});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,s)};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,s)}return i}function ye(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 lt(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(o=>{let s=o.getAttribute("data-hydrate");if(!s){r.success=!1;return}let i=A.get(s);if(!i){r.success=!1;return}let a=ue(`[data-hydrate="${s}"]`,i,t);r.mismatches+=a.mismatches,r.hydratedNodes+=a.hydratedNodes,a.success||(r.success=!1)}),r}function ct(t,e){A.set(t,e)}function dt(t){if(!b.get(t))return;let n=typeof document!="undefined"?document.querySelector(`[data-hydrate="${t}"]`):null;n&&(ye(n,t),n.removeAttribute("data-hydrated")),b.delete(t),A.delete(t)}function ut(){return b}function yt(){b.clear(),A.clear()}function ft(t,e={},n="div",r){let o=t.name||"anonymous",s=JSON.stringify(e),i=E(s),a="";if(typeof t.render=="function"){let u=t.render(e,{slots:t.slots||{},emit:()=>{}});a=H(u)}let l=r?` data-hydrate-when="${K(r)}"`:"",c=K(o),d=`<${n} data-hydrate="${c}" data-props="${i}"${l}>${a}</${n}>`,f=`<script type="application/json" data-hydrate-props="${c}">${s}<\/script>`;return d+f}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(o=>H(o)).join(""):"";if(typeof e=="symbol"&&String(e).includes("Text"))return E(String(r||""));if(typeof e=="symbol"&&String(e).includes("Comment"))return`<!--${K(String(r||""))}-->`;if(typeof e=="string"){let o=mt(n);if(new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]).has(e))return`<${e}${o} />`;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}${o}>${i}</${e}>`}if(typeof e=="function"){let o=e(n||{},{slots:r||{}});return H(o)}if(typeof e=="object"&&e!==null){let o=e;if(typeof o.render=="function"){let s=o.render(n||{},{slots:r||{},emit:()=>{}});return H(s)}}return""}function mt(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 ee=[];function pt(t,e,n){let r=0,o=gt(t),s=H(e);if(o!==s){r++;let i={islandId:n,expected:s,actual:o,suggestion:ht(o,s,n)};ee.push(i)}return r}function gt(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 ht(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":le(t)===le(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 le(t){return t.replace(/\s+/g," ").replace(/>\s+</g,"><").trim()}function Nt(){return[...ee]}function Tt(){ee.length=0}export{re as Comment,te as Fragment,F as PatchFlags,x as ShapeFlags,w as StringRenderer,ne as Text,yt as clearIslandRegistry,Tt as clearMismatchWarnings,ft as createHydrationIsland,be as createRenderer,Ye as getHydrateStats,ut as getIslandRegistry,Nt as getMismatchWarnings,Xe as hydrate,lt as hydrateAllIslands,ue as hydrateIsland,Ge as isHydrating,ze as onHydrated,ct as registerIslandComponent,we as renderToStream,ve as renderToStreamGenerator,$e as renderToString,ce as resetHydrateStats,Ue as setHydrating,Fe as ssrRenderer,dt as unmountIsland};