@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.
- package/dist/dom.cjs +1 -1
- package/dist/dom.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/miniapp.cjs +21 -5
- package/dist/miniapp.mjs +21 -5
- package/dist/native.cjs +1 -1
- package/dist/native.mjs +1 -1
- package/dist/ssr.cjs +1 -1
- package/dist/ssr.mjs +1 -1
- package/dist/types/dom/dom-ops.d.ts.map +1 -1
- package/dist/types/dom/dom-renderer.d.ts +3 -3
- package/dist/types/dom/dom-renderer.d.ts.map +1 -1
- package/dist/types/dom/patch-props.d.ts +2 -32
- package/dist/types/dom/patch-props.d.ts.map +1 -1
- package/dist/types/miniapp/index.d.ts +8 -0
- package/dist/types/miniapp/index.d.ts.map +1 -1
- package/dist/types/miniapp/miniapp-compiler.d.ts +269 -0
- package/dist/types/miniapp/miniapp-compiler.d.ts.map +1 -0
- package/dist/types/miniapp/miniapp-event-bridge.d.ts +255 -0
- package/dist/types/miniapp/miniapp-event-bridge.d.ts.map +1 -0
- package/dist/types/miniapp/miniapp-lifecycle.d.ts +224 -0
- package/dist/types/miniapp/miniapp-lifecycle.d.ts.map +1 -0
- package/dist/types/miniapp/miniapp-renderer.d.ts.map +1 -1
- package/dist/types/miniapp/miniapp-utils.d.ts +168 -0
- package/dist/types/miniapp/miniapp-utils.d.ts.map +1 -0
- package/dist/types/miniapp/shared-constants.d.ts +28 -0
- package/dist/types/miniapp/shared-constants.d.ts.map +1 -0
- package/dist/types/native/native-renderer.d.ts.map +1 -1
- package/dist/types/renderer-interfaces.d.ts +19 -19
- package/dist/types/renderer-interfaces.d.ts.map +1 -1
- package/dist/types/shared/abstract-renderer.d.ts +74 -0
- package/dist/types/shared/abstract-renderer.d.ts.map +1 -0
- package/dist/types/ssr/hydration.d.ts +1 -16
- package/dist/types/ssr/hydration.d.ts.map +1 -1
- package/dist/types/ssr/ssr-renderer.d.ts +9 -24
- package/dist/types/ssr/ssr-renderer.d.ts.map +1 -1
- package/dist/types/vapor/index.d.ts +1 -1
- package/dist/types/vapor/index.d.ts.map +1 -1
- package/dist/types/vapor/vapor-compiler.d.ts +9 -0
- package/dist/types/vapor/vapor-compiler.d.ts.map +1 -1
- package/dist/types/vapor/vapor-component.d.ts +8 -1
- package/dist/types/vapor/vapor-component.d.ts.map +1 -1
- package/dist/types/vapor/vapor-reactive.d.ts +27 -4
- package/dist/types/vapor/vapor-reactive.d.ts.map +1 -1
- package/dist/types/vapor/vapor-renderer.d.ts +4 -2
- package/dist/types/vapor/vapor-renderer.d.ts.map +1 -1
- package/dist/types/vnode.d.ts +76 -7
- package/dist/types/vnode.d.ts.map +1 -1
- package/dist/vapor.cjs +1 -1
- package/dist/vapor.mjs +1 -1
- package/package.json +4 -3
package/dist/dom.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var M=Object.defineProperty;var de=Object.getOwnPropertyDescriptor;var ye=Object.getOwnPropertyNames;var ue=Object.prototype.hasOwnProperty;var me=(n,e)=>{for(var t in e)M(n,t,{get:e[t],enumerable:!0})},ve=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ye(e))!ue.call(n,r)&&r!==t&&M(n,r,{get:()=>e[r],enumerable:!(o=de(e,r))||o.enumerable});return n};var Ne=n=>ve(M({},"__esModule",{value:!0}),n);var Ie={};me(Ie,{Comment:()=>K,DOMRenderer:()=>C,Fragment:()=>P,PatchFlags:()=>x,PatchPropFlags:()=>z,ShapeFlags:()=>u,Text:()=>k,createInvoker:()=>X,createRenderer:()=>ee,domRenderer:()=>pe,getEventInvokers:()=>se,getEventKey:()=>G,getSVGPropName:()=>ie,isSVGElement:()=>_,normalizeEventName:()=>I,parseEventModifier:()=>B,patchAllProps:()=>T,patchClass:()=>v,patchDOMProp:()=>w,patchDOMProps:()=>re,patchElementProps:()=>fe,patchEvent:()=>L,patchEventOnElement:()=>le,patchProp:()=>y,patchStyle:()=>N,removeAllEventListeners:()=>D,removeDOMProp:()=>h,setDOMProp:()=>E});module.exports=Ne(Ie);var $=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||{}),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||{}),P=Symbol("Fragment"),k=Symbol("Text"),K=Symbol("Comment");function m(n){return n.type===P}function R(n){return n.type===k}function V(n){return n.type===K}function F(n,e){return n.type===e.type&&n.key===e.key}function W(n){return Array.isArray(n.dynamicChildren)}function J(n,e,t,o){if(t==="class")n.setClass(e,o);else if(t==="style")n.setStyle(e,o);else if(t.startsWith("on")||t.startsWith("@")){let r=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();n.addEventListener(e,r,o)}else t==="key"||t==="ref"||n.setAttribute(e,t,o)}function H(n,e,t,o,r){if(t==="class")n.setClass(e,o);else if(t==="style")n.setStyle(e,o||{});else if(t.startsWith("on")||t.startsWith("@")){let i=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();r&&n.removeEventListener(e,i,r),o&&n.addEventListener(e,i,o)}else n.setAttribute(e,t,o)}function j(n,e,t,o){for(let r in o){if(r==="key"||r==="ref")continue;let i=t[r],s=o[r];s!==i&&H(n,e,r,s,i)}for(let r in t)if(!(r==="key"||r==="ref")&&!(r in o))if(r==="class")n.setClass(e,"");else if(r==="style")n.setStyle(e,{});else if(r.startsWith("on")||r.startsWith("@")){let i=r.startsWith("@")?r.slice(1).toLowerCase():r.slice(2).toLowerCase();n.removeEventListener(e,i,t[r])}else n.removeAttribute(e,r)}function U(n,e,t,o,r,i){let{shapeFlag:s}=t;if(m(t)){he(n,e,t,o,r,i);return}if(R(t)){let a=n.createText(t.children);t.el=a,n.insert(o,a,r);return}if(V(t)){let a=n.createComment(t.children);t.el=a,n.insert(o,a,r);return}if(s&1){Ee(n,e,t,o,r,i);return}if(s&6){ge(e,t,o,r,i);return}}function Ee(n,e,t,o,r,i){let s=t.type,a=n.createElement(s);if(t.el=a,t.props)for(let p in t.props){let d=t.props[p];J(n,a,p,d)}let{shapeFlag:c,children:f}=t;c&8?a.textContent=f:c&16&&A(e,f,a,null,i),n.insert(o,a,r)}function A(n,e,t,o,r){for(let i=0;i<e.length;i++)n(null,e[i],t,o,r)}function he(n,e,t,o,r,i){let{children:s}=t,a=n.createComment("");n.insert(o,a,r),Array.isArray(s)&&s.length>0&&A(e,s,o,a,i),t.el=a,t.anchor=a}function ge(n,e,t,o,r){let i=e.component;i&&i.update&&i.update(),i&&i.subTree&&(n(null,i.subTree,t,o,i),e.el=i.subTree.el)}function Q(n,e,t,o){let{shapeFlag:r,children:i}=t;if(m(t)){if(Array.isArray(i))for(let s=0;s<i.length;s++)e(i[s],o);t.anchor&&t.anchor.parentNode&&n.remove(t.anchor);return}if(r&6){t.component&&t.component.subTree&&e(t.component.subTree,o);return}t.el&&n.remove(t.el)}function b(n,e){for(let t=0;t<e.length;t++)n(e[t])}var S=require("@lytjs/vdom");function O(n,e,t,o,r,i=null,s=null){if(o==null){t&&e(t,r);return}if(t===null){U(n,Y(n,e),o,r,i,s);return}if(W(o)&&W(t)){xe(n,e,t,o,r,s);return}if(!F(t,o)){e(t,r),U(n,Y(n,e),o,r,i,s);return}o.el=t.el,o.anchor=t.anchor;let{shapeFlag:a}=o;if(m(o)){Ce(n,e,t,o,r,i,s);return}if(R(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(V(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(a&1){Le(n,e,t,o,s);return}if(a&6){Re(t,o,s);return}}function Y(n,e){return(t,o,r,i,s)=>{O(n,e,t,o,r,i,s)}}function Le(n,e,t,o,r=null){let i=o.el=t.el,s=t.props||{},a=o.props||{},{patchFlag:c,dynamicProps:f}=o;if(c&&c>0){if(c&1&&t.children!==o.children&&(i.textContent=o.children),c&2&&s.class!==a.class&&n.setClass(i,a.class),c&4&&s.style!==a.style&&n.setStyle(i,a.style||{}),c&8&&f)for(let p=0;p<f.length;p++){let d=f[p],l=s[d],q=a[d];q!==l&&H(n,i,d,q,l)}c&16&&j(n,i,s,a)}else j(n,i,s,a);(!c||!(c&1))&&Z(n,e,t,o,i,null,r)}function Z(n,e,t,o,r,i,s){let a=t.shapeFlag,c=o.shapeFlag,f=t.children,p=o.children;if(c&8){a&16&&b(e,f),f!==p&&(r.textContent=p);return}if(c&16){a&16?Te(n,e,f,p,r,i,s):(a&8&&(r.textContent=""),A(Y(n,e),p,r,i,s));return}p==null&&(a&8?r.textContent="":a&16&&b(e,f))}function Te(n,e,t,o,r,i,s){o.every(c=>c.key!==null&&c.key!==void 0)&&t.every(c=>c.key!==null&&c.key!==void 0)?(0,S.patchKeyedChildren)(t,o,r,i,s,null,!1):(0,S.patchUnkeyedChildren)(t,o,r,i,s,null,!1)}function Ce(n,e,t,o,r,i,s){let a=t.children,c=o.children;Array.isArray(c)&&c.length>0?(Z(n,e,t,o,r,i,s),o.el=c[0].el,o.anchor=c[c.length-1].el?n.nextSibling(c[c.length-1].el):i):Array.isArray(a)&&a.length>0&&c===null?(b(e,a),o.el=t.el,o.anchor=t.anchor):(o.el=t.el,o.anchor=t.anchor)}function xe(n,e,t,o,r,i){let s=t.dynamicChildren,a=o.dynamicChildren;for(let c=0;c<a.length;c++)O(n,e,s[c],a[c],r,null,i)}function Re(n,e,t){e.component=n.component,e.el=n.el,e.component&&e.component.update&&e.component.update()}function ee(n){function e(r,i){Q(n,e,r,i)}(0,$.registerDOMOperations)({insert(r,i,s){n.insert(i,r,s)},createElement(r){return n.createElement(r)},createText(r){return n.createText(r)},setText(r,i){r.nodeValue=i},setElementText(r,i){r.textContent=i},remove(r){n.remove(r)},createComment(r){return n.createComment(r)},mount(r,i,s,a,c,f,p){o(null,r,i,s,a)},patch(r,i,s,a,c,f,p,d){o(r,i,s,a,c)},unmount(r,i,s,a){e(r)},move(r,i,s){n.insert(i,r.el,s)}});function o(r,i,s,a,c){O(n,e,r,i,s,a,c)}return{mount(r,i){i.nodeType===1&&(i.textContent=""),o(null,r,i,null,null)},patch(r,i,s){var a;o(r,i,s||((a=r.el)==null?void 0:a.parentNode),null,null)},unmount(r,i){e(r,i)}}}var ne={acceptCharset:"acceptCharset",accessKey:"accessKey",className:"className",htmlFor:"htmlFor",httpEquiv:"httpEquiv",tabIndex:"tabIndex"},oe={allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,inert:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0},Ve={"accent-height":"accentHeight","alignment-baseline":"alignmentBaseline","baseline-shift":"baselineShift","clip-path":"clipPath","clip-rule":"clipRule","color-interpolation":"colorInterpolation","color-interpolation-filters":"colorInterpolationFilters","dominant-baseline":"dominantBaseline","enable-background":"enableBackground","fill-opacity":"fillOpacity","fill-rule":"fillRule","flood-color":"floodColor","flood-opacity":"floodOpacity","glyph-orientation-horizontal":"glyphOrientationHorizontal","glyph-orientation-vertical":"glyphOrientationVertical","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-variant":"fontVariant","font-weight":"fontWeight","image-rendering":"imageRendering","letter-spacing":"letterSpacing","lighting-color":"lightingColor","marker-end":"markerEnd","marker-mid":"markerMid","marker-start":"markerStart","paint-order":"paintOrder","pointer-events":"pointerEvents","shape-rendering":"shapeRendering","stop-color":"stopColor","stop-opacity":"stopOpacity","stroke-dasharray":"strokeDasharray","stroke-dashoffset":"strokeDashoffset","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","stroke-miterlimit":"strokeMiterlimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","text-anchor":"textAnchor","text-decoration":"textDecoration","text-rendering":"textRendering","transform-origin":"transformOrigin","word-spacing":"wordSpacing","writing-mode":"writingMode","xlink:href":"xlinkHref","xlink:title":"xlinkTitle","xml:lang":"xmlLang","xml:space":"xmlSpace"};function E(n,e,t){if(e==="class"){n.className=t==null?"":String(t);return}if(e==="style"){if(typeof t=="string")n.style.cssText=t;else if(t!=null&&typeof t=="object")for(let r in t)n.style[r]=t[r];else n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let r=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase();typeof t=="function"&&n.addEventListener(r,t);return}if(e in oe){t?(n.setAttribute(e,""),e in n&&(n[e]=!0)):(n.removeAttribute(e),e in n&&(n[e]=!1));return}let o=ne[e]||e;if(o in n){try{n[o]=t==null?"":t}catch(r){n.setAttribute(e,t==null?"":String(t))}return}t==null||t===!1?n.removeAttribute(e):n.setAttribute(e,String(t))}function h(n,e){if(e==="class"){n.className="";return}if(e==="style"){n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let o=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase(),r=n._vei;if(r){let i="on"+o.charAt(0).toUpperCase()+o.slice(1),s=r[i];s&&(n.removeEventListener(o,s),r[i]=void 0)}return}if(e in oe){n.removeAttribute(e),e in n&&(n[e]=!1);return}let t=ne[e]||e;if(t in n){try{n[t]=""}catch(o){n.removeAttribute(e)}return}n.removeAttribute(e)}function te(n){return n.startsWith("on")||n.startsWith("@")}function re(n,e,t){let o=e?Object.keys(e):[],r=t?Object.keys(t):[];for(let i=0;i<r.length;i++){let s=r[i],a=t[s],c=e?e[s]:void 0;s==="key"||s==="ref"||a!==c&&(s==="class"?n.className=a==null?"":String(a):s==="style"?Ae(n,a,c):te(s)||E(n,s,a))}for(let i=0;i<o.length;i++){let s=o[i];s==="key"||s==="ref"||(!t||!(s in t))&&(s==="class"?n.className="":s==="style"?n.style.cssText="":te(s)||h(n,s))}}function Ae(n,e,t){if(!e||typeof e=="string"&&!e.trim()){n.style.cssText="";return}if(typeof e=="string"){n.style.cssText=e;return}if(typeof t=="object"&&t!==null)for(let o in t)o in e||(n.style[o]="");for(let o in e)n.style[o]=e[o]}function _(n){return n==="svg"||n==="path"||n==="circle"||n==="rect"||n==="line"||n==="polyline"||n==="polygon"||n==="ellipse"||n==="g"||n==="defs"||n==="use"||n==="text"||n==="tspan"||n==="clipPath"||n==="mask"||n==="filter"||n==="linearGradient"||n==="radialGradient"||n==="stop"||n==="pattern"||n==="symbol"||n==="image"||n==="foreignObject"||n==="animate"||n==="animateTransform"||n==="animateMotion"}function ie(n){return Ve[n]||n}var be=/^(?:@|on)/;function I(n){return n.replace(be,"").toLowerCase()}function G(n){let e=I(n);return"on"+e.charAt(0).toUpperCase()+e.slice(1)}var Se={stop:"stop",prevent:"prevent",capture:"capture",once:"once",self:"self",passive:"passive"};function B(n){let e=n.split("."),o={name:e[0],stop:!1,prevent:!1,capture:!1,once:!1,self:!1,passive:!1};for(let r=1;r<e.length;r++){let i=e[r],s=Se[i];s&&(o[s]=!0)}return o}function X(n){let e=(t=>{e.value&&e.value(t)});return e.value=n,e}var g="_vei";function se(n){return n[g]||null}function L(n,e,t,o,r){let i=G(e),s=B(I(e)),a=s.name,c=n[g];c||(c=n[g]={});let f=c[i];if(t&&f)f.value=t;else if(t&&!f){let p=X(t);c[i]=p;let d={};s.capture&&(d.capture=!0),s.once&&(d.once=!0),s.passive&&(d.passive=!0),n.addEventListener(a,p,d)}else!t&&f&&(n.removeEventListener(a,f),c[i]=void 0)}function D(n){let e=n[g];if(e){for(let t in e){let o=e[t];if(o){let r=t.charAt(2).toLowerCase()+t.slice(3);n.removeEventListener(r,o)}}n[g]={}}}var z=(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))(z||{});function v(n,e,t){let o=ce(e);o!==t&&(n.className=o)}function ce(n){if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="object"){if(Array.isArray(n)){let t="";for(let o=0;o<n.length;o++){let r=ce(n[o]);r&&(t+=(t?" ":"")+r)}return t}let e="";for(let t in n)n[t]&&(e+=(e?" ":"")+t);return e}return String(n)}function N(n,e,t){if(!e){n.style.cssText="";return}if(!t){typeof e=="string"?n.style.cssText=e:typeof e=="object"&&ae(n,e);return}if(typeof e!=typeof t){n.style.cssText="",typeof e=="string"?n.style.cssText=e:typeof e=="object"&&ae(n,e);return}if(typeof e=="string"){e!==t&&(n.style.cssText=e);return}if(typeof e=="object"&&typeof t=="object"){for(let o in t)o in e||(n.style[o]="");for(let o in e){let r=e[o],i=t[o];r!==i&&(n.style[o]=r==null?"":r)}}}function ae(n,e){for(let t in e)n.style[t]=e[t]===null||e[t]===void 0?"":e[t]}function le(n,e,t,o){L(n,"",e,t,o)}var Oe=new Set(["class","style","key","ref"]);function _e(n){return n.length>2&&(n[0]==="o"||n[0]==="O"||n[0]==="@")&&(n[1]==="n"||n[1]==="N")}function w(n,e,t,o,r){if(!Oe.has(e)){if(e==="class"){v(n,t,o);return}if(e==="style"){N(n,t,o);return}if(_e(e)){L(n,e,t,o,r);return}if(t===!1||t===null||t===void 0){n.removeAttribute(e);return}if(e in n)try{n[e]=t}catch(i){n.setAttribute(e,String(t))}else n.setAttribute(e,String(t))}}function y(n,e,t,o,r){w(n,e,t,o,r)}function T(n,e,t,o){if(t)for(let r in t){if(r==="key"||r==="ref")continue;let i=t[r],s=e?e[r]:void 0;i!==s&&y(n,r,i,s,o)}if(e)for(let r in e)r==="key"||r==="ref"||(!t||!(r in t))&&y(n,r,null,e[r],o)}function fe(n,e,t,o){let r=e.props||{},i=t.props||{},{patchFlag:s,dynamicProps:a}=t;if(!s||s===-1){T(n,r,i,o);return}if(s===-2){T(n,r,i,o);return}if(s&1&&e.children!==t.children&&(n.textContent=t.children),s&2&&r.class!==i.class&&v(n,i.class,r.class),s&4&&r.style!==i.style&&N(n,i.style,r.style),s&8&&a)for(let c=0;c<a.length;c++){let f=a[c],p=r[f],d=i[f];d!==p&&y(n,f,d,p,o)}s&16&&T(n,r,i,o)}var C=class{createElement(e){return _(e)?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}createText(e){return document.createTextNode(e)}createComment(e){return document.createComment(e)}setAttribute(e,t,o){E(e,t,o)}removeAttribute(e,t){h(e,t)}setStyle(e,t){if(typeof t=="string")e.style.cssText=t;else if(t&&typeof t=="object")for(let o in t)e.style[o]=t[o]}setClass(e,t){if(typeof t=="string")e.className=t;else if(t&&typeof t=="object"){let o="";for(let r in t)t[r]&&(o+=(o?" ":"")+r);e.className=o}else e.className=""}insert(e,t,o){o!=null?e.insertBefore(t,o):e.appendChild(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}replace(e,t,o){e.replaceChild(o,t)}addEventListener(e,t,o,r){e.addEventListener(t,o,r)}removeEventListener(e,t,o){e.removeEventListener(t,o)}nextTick(e){Promise.resolve().then(e)}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}querySelector(e){return document.querySelector(e)}setClassWithOld(e,t,o){v(e,t,o)}setStyleWithOld(e,t,o){N(e,t,o)}setAttributeWithOld(e,t,o,r){y(e,t,o,r)}setElementText(e,t){e.textContent=t}setText(e,t){e.nodeValue=t}insertBefore(e,t,o){o!=null?e.insertBefore(t,o):e.appendChild(t)}removeChild(e,t){e.removeChild(t)}setAnchor(e,t){e.anchor=t}getNextSibling(e){return e.nextSibling}cleanupEvents(e){D(e)}},pe=new C;
|
|
1
|
+
"use strict";var P=Object.defineProperty;var pe=Object.getOwnPropertyDescriptor;var ue=Object.getOwnPropertyNames;var ye=Object.prototype.hasOwnProperty;var me=(n,e)=>{for(var t in e)P(n,t,{get:e[t],enumerable:!0})},ve=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ue(e))!ye.call(n,r)&&r!==t&&P(n,r,{get:()=>e[r],enumerable:!(o=pe(e,r))||o.enumerable});return n};var he=n=>ve(P({},"__esModule",{value:!0}),n);var we={};me(we,{Comment:()=>W,DOMRenderer:()=>T,Fragment:()=>D,PatchFlags:()=>R,PatchPropFlags:()=>u.PatchFlags,ShapeFlags:()=>m,Text:()=>M,createInvoker:()=>Y,createRenderer:()=>ee,domRenderer:()=>de,getEventInvokers:()=>se,getEventKey:()=>B,getSVGPropName:()=>ie,isSVGElement:()=>w,normalizeEventName:()=>_,parseEventModifier:()=>G,patchAllProps:()=>C,patchClass:()=>L,patchDOMProp:()=>z,patchDOMProps:()=>re,patchElementProps:()=>fe,patchEvent:()=>g,patchEventOnElement:()=>le,patchProp:()=>y,patchStyle:()=>x,removeAllEventListeners:()=>I,removeDOMProp:()=>N,setDOMProp:()=>h});module.exports=he(we);var Z=require("@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||{}),R=(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))(R||{}),D=Symbol("Fragment"),M=Symbol("Text"),W=Symbol("Comment");function v(n){return n.type===D}function V(n){return n.type===M}function b(n){return n.type===W}function q(n,e){return n.type===e.type&&n.key===e.key}function K(n){return Array.isArray(n.dynamicChildren)}function $(n,e,t,o){if(t==="class")n.setClass(e,o);else if(t==="style")n.setStyle(e,o);else if(t.startsWith("on")||t.startsWith("@")){let r=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();n.addEventListener(e,r,o)}else t==="key"||t==="ref"||n.setAttribute(e,t,o)}function j(n,e,t,o,r){if(t==="class")n.setClass(e,o);else if(t==="style")n.setStyle(e,o||{});else if(t.startsWith("on")||t.startsWith("@")){let i=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();r&&n.removeEventListener(e,i,r),o&&n.addEventListener(e,i,o)}else n.setAttribute(e,t,o)}function H(n,e,t,o){for(let r in o){if(r==="key"||r==="ref")continue;let i=t[r],s=o[r];s!==i&&j(n,e,r,s,i)}for(let r in t)if(!(r==="key"||r==="ref")&&!(r in o))if(r==="class")n.setClass(e,"");else if(r==="style")n.setStyle(e,{});else if(r.startsWith("on")||r.startsWith("@")){let i=r.startsWith("@")?r.slice(1).toLowerCase():r.slice(2).toLowerCase();n.removeEventListener(e,i,t[r])}else n.removeAttribute(e,r)}function F(n,e,t,o,r,i){let{shapeFlag:s}=t;if(v(t)){Ee(n,e,t,o,r,i);return}if(V(t)){let a=n.createText(t.children);t.el=a,n.insert(o,a,r);return}if(b(t)){let a=n.createComment(t.children);t.el=a,n.insert(o,a,r);return}if(s&1){Ne(n,e,t,o,r,i);return}if(s&6){ge(e,t,o,r,i);return}}function Ne(n,e,t,o,r,i){let s=t.type,a=n.createElement(s);if(t.el=a,t.props)for(let d in t.props){let p=t.props[d];$(n,a,d,p)}let{shapeFlag:c,children:f}=t;c&8?a.textContent=f:c&16&&A(e,f,a,null,i),n.insert(o,a,r)}function A(n,e,t,o,r){for(let i=0;i<e.length;i++)n(null,e[i],t,o,r)}function Ee(n,e,t,o,r,i){let{children:s}=t,a=n.createComment("");n.insert(o,a,r),Array.isArray(s)&&s.length>0&&A(e,s,o,a,i),t.el=a,t.anchor=a}function ge(n,e,t,o,r){let i=e.component;i&&i.update&&i.update(),i&&i.subTree&&(n(null,i.subTree,t,o,i),e.el=i.subTree.el)}function J(n,e,t,o){let{shapeFlag:r,children:i}=t;if(v(t)){if(Array.isArray(i))for(let s=0;s<i.length;s++)e(i[s],o);t.anchor&&t.anchor.parentNode&&n.remove(t.anchor);return}if(r&6){t.component&&t.component.subTree&&e(t.component.subTree,o);return}t.el&&n.remove(t.el)}function O(n,e){for(let t=0;t<e.length;t++)n(e[t])}var k=require("@lytjs/vdom");function S(n,e,t,o,r,i=null,s=null){if(o==null){t&&e(t,r);return}if(t===null){F(n,U(n,e),o,r,i,s);return}if(K(o)&&K(t)){Te(n,e,t,o,r,s);return}if(!q(t,o)){e(t,r),F(n,U(n,e),o,r,i,s);return}o.el=t.el,o.anchor=t.anchor;let{shapeFlag:a}=o;if(v(o)){xe(n,e,t,o,r,i,s);return}if(V(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(b(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(a&1){Ce(n,e,t,o,s);return}if(a&6){Re(t,o,s);return}}function U(n,e){return(t,o,r,i,s)=>{S(n,e,t,o,r,i,s)}}function Ce(n,e,t,o,r=null){let i=o.el=t.el,s=t.props||{},a=o.props||{},{patchFlag:c,dynamicProps:f}=o;if(c&&c>0){if(c&1&&t.children!==o.children&&(i.textContent=o.children),c&2&&s.class!==a.class&&n.setClass(i,a.class),c&4&&s.style!==a.style&&n.setStyle(i,a.style||{}),c&8&&f)for(let d=0;d<f.length;d++){let p=f[d],l=s[p],X=a[p];X!==l&&j(n,i,p,X,l)}c&16&&H(n,i,s,a)}else H(n,i,s,a);(!c||!(c&1))&&Q(n,e,t,o,i,null,r)}function Q(n,e,t,o,r,i,s){let a=t.shapeFlag,c=o.shapeFlag,f=t.children,d=o.children;if(c&8){a&16&&O(e,f),f!==d&&(r.textContent=d);return}if(c&16){a&16?Le(n,e,f,d,r,i,s):(a&8&&(r.textContent=""),A(U(n,e),d,r,i,s));return}d==null&&(a&8?r.textContent="":a&16&&O(e,f))}function Le(n,e,t,o,r,i,s){o.every(c=>c.key!==null&&c.key!==void 0)&&t.every(c=>c.key!==null&&c.key!==void 0)?(0,k.patchKeyedChildren)(t,o,r,i,s,null,!1):(0,k.patchUnkeyedChildren)(t,o,r,i,s,null,!1)}function xe(n,e,t,o,r,i,s){let a=t.children,c=o.children;Array.isArray(c)&&c.length>0?(Q(n,e,t,o,r,i,s),o.el=c[0].el,o.anchor=c[c.length-1].el?n.nextSibling(c[c.length-1].el):i):Array.isArray(a)&&a.length>0&&c===null?(O(e,a),o.el=t.el,o.anchor=t.anchor):(o.el=t.el,o.anchor=t.anchor)}function Te(n,e,t,o,r,i){let s=t.dynamicChildren,a=o.dynamicChildren;for(let c=0;c<a.length;c++)S(n,e,s[c],a[c],r,null,i)}function Re(n,e,t){e.component=n.component,e.el=n.el,e.component&&e.component.update&&e.component.update()}function ee(n){function e(r,i){J(n,e,r,i)}(0,Z.registerDOMOperations)({insert(r,i,s){n.insert(i,r,s)},createElement(r){return n.createElement(r)},createText(r){return n.createText(r)},setText(r,i){r.nodeValue=i},setElementText(r,i){r.textContent=i},remove(r){n.remove(r)},createComment(r){return n.createComment(r)},mount(r,i,s,a,c,f,d){o(null,r,i,s,a)},patch(r,i,s,a,c,f,d,p){o(r,i,s,a,c)},unmount(r,i,s,a){e(r)},move(r,i,s){n.insert(i,r.el,s)}});function o(r,i,s,a,c){S(n,e,r,i,s,a,c)}return{mount(r,i){i.nodeType===1&&(i.textContent=""),o(null,r,i,null,null)},patch(r,i,s){var a;o(r,i,s||((a=r.el)==null?void 0:a.parentNode),null,null)},unmount(r,i){e(r,i)}}}var ne={acceptCharset:"acceptCharset",accessKey:"accessKey",className:"className",htmlFor:"htmlFor",httpEquiv:"httpEquiv",tabIndex:"tabIndex"},oe={allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,inert:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0},Ve={"accent-height":"accentHeight","alignment-baseline":"alignmentBaseline","baseline-shift":"baselineShift","clip-path":"clipPath","clip-rule":"clipRule","color-interpolation":"colorInterpolation","color-interpolation-filters":"colorInterpolationFilters","dominant-baseline":"dominantBaseline","enable-background":"enableBackground","fill-opacity":"fillOpacity","fill-rule":"fillRule","flood-color":"floodColor","flood-opacity":"floodOpacity","glyph-orientation-horizontal":"glyphOrientationHorizontal","glyph-orientation-vertical":"glyphOrientationVertical","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-variant":"fontVariant","font-weight":"fontWeight","image-rendering":"imageRendering","letter-spacing":"letterSpacing","lighting-color":"lightingColor","marker-end":"markerEnd","marker-mid":"markerMid","marker-start":"markerStart","paint-order":"paintOrder","pointer-events":"pointerEvents","shape-rendering":"shapeRendering","stop-color":"stopColor","stop-opacity":"stopOpacity","stroke-dasharray":"strokeDasharray","stroke-dashoffset":"strokeDashoffset","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","stroke-miterlimit":"strokeMiterlimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","text-anchor":"textAnchor","text-decoration":"textDecoration","text-rendering":"textRendering","transform-origin":"transformOrigin","word-spacing":"wordSpacing","writing-mode":"writingMode","xlink:href":"xlinkHref","xlink:title":"xlinkTitle","xml:lang":"xmlLang","xml:space":"xmlSpace"};function h(n,e,t){if(e==="class"){n.className=t==null?"":String(t);return}if(e==="style"){if(typeof t=="string")n.style.cssText=t;else if(t!=null&&typeof t=="object")for(let r in t)n.style[r]=t[r];else n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let r=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase();typeof t=="function"&&n.addEventListener(r,t);return}if(e in oe){t?(n.setAttribute(e,""),e in n&&(n[e]=!0)):(n.removeAttribute(e),e in n&&(n[e]=!1));return}let o=ne[e]||e;if(o in n){try{n[o]=t==null?"":t}catch(r){n.setAttribute(e,t==null?"":String(t))}return}t==null||t===!1?n.removeAttribute(e):n.setAttribute(e,String(t))}function N(n,e){if(e==="class"){n.className="";return}if(e==="style"){n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let o=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase(),r=n._vei;if(r){let i="on"+o.charAt(0).toUpperCase()+o.slice(1),s=r[i];s&&(n.removeEventListener(o,s),r[i]=void 0)}return}if(e in oe){n.removeAttribute(e),e in n&&(n[e]=!1);return}let t=ne[e]||e;if(t in n){try{n[t]=""}catch(o){n.removeAttribute(e)}return}n.removeAttribute(e)}function te(n){return n.startsWith("on")||n.startsWith("@")}function re(n,e,t){let o=e?Object.keys(e):[],r=t?Object.keys(t):[];for(let i=0;i<r.length;i++){let s=r[i],a=t[s],c=e?e[s]:void 0;s==="key"||s==="ref"||a!==c&&(s==="class"?n.className=a==null?"":String(a):s==="style"?be(n,a,c):te(s)||h(n,s,a))}for(let i=0;i<o.length;i++){let s=o[i];s==="key"||s==="ref"||(!t||!(s in t))&&(s==="class"?n.className="":s==="style"?n.style.cssText="":te(s)||N(n,s))}}function be(n,e,t){if(!e||typeof e=="string"&&!e.trim()){n.style.cssText="";return}if(typeof e=="string"){n.style.cssText=e;return}if(typeof t=="object"&&t!==null)for(let o in t)o in e||(n.style[o]="");for(let o in e)n.style[o]=e[o]}function w(n){return n==="svg"||n==="path"||n==="circle"||n==="rect"||n==="line"||n==="polyline"||n==="polygon"||n==="ellipse"||n==="g"||n==="defs"||n==="use"||n==="text"||n==="tspan"||n==="clipPath"||n==="mask"||n==="filter"||n==="linearGradient"||n==="radialGradient"||n==="stop"||n==="pattern"||n==="symbol"||n==="image"||n==="foreignObject"||n==="animate"||n==="animateTransform"||n==="animateMotion"}function ie(n){return Ve[n]||n}var Ae=/^(?:@|on)/;function _(n){return n.replace(Ae,"").toLowerCase()}function B(n){let e=_(n);return"on"+e.charAt(0).toUpperCase()+e.slice(1)}var Oe={stop:"stop",prevent:"prevent",capture:"capture",once:"once",self:"self",passive:"passive"};function G(n){let e=n.split("."),o={name:e[0],stop:!1,prevent:!1,capture:!1,once:!1,self:!1,passive:!1};for(let r=1;r<e.length;r++){let i=e[r],s=Oe[i];s&&(o[s]=!0)}return o}function Y(n){let e=(t=>{e.value&&e.value(t)});return e.value=n,e}var E="_vei";function se(n){return n[E]||null}function g(n,e,t,o,r){let i=B(e),s=G(_(e)),a=s.name,c=n[E];c||(c=n[E]={});let f=c[i];if(t&&f)f.value=t;else if(t&&!f){let d=Y(t);c[i]=d;let p={};s.capture&&(p.capture=!0),s.once&&(p.once=!0),s.passive&&(p.passive=!0),n.addEventListener(a,d,p)}else!t&&f&&(n.removeEventListener(a,f),c[i]=void 0)}function I(n){let e=n[E];if(e){for(let t in e){let o=e[t];if(o){let r=t.charAt(2).toLowerCase()+t.slice(3);n.removeEventListener(r,o)}}n[E]={}}}var u=require("@lytjs/vdom");function L(n,e,t){let o=ce(e);o!==t&&(n.className=o)}function ce(n){if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="object"){if(Array.isArray(n)){let t="";for(let o=0;o<n.length;o++){let r=ce(n[o]);r&&(t+=(t?" ":"")+r)}return t}let e="";for(let t in n)n[t]&&(e+=(e?" ":"")+t);return e}return String(n)}function x(n,e,t){if(!e){n.style.cssText="";return}if(!t){typeof e=="string"?n.style.cssText=e:typeof e=="object"&&ae(n,e);return}if(typeof e!=typeof t){n.style.cssText="",typeof e=="string"?n.style.cssText=e:typeof e=="object"&&ae(n,e);return}if(typeof e=="string"){e!==t&&(n.style.cssText=e);return}if(typeof e=="object"&&typeof t=="object"){for(let o in t)o in e||(n.style[o]="");for(let o in e){let r=e[o],i=t[o];r!==i&&(n.style[o]=r==null?"":r)}}}function ae(n,e){for(let t in e)n.style[t]=e[t]===null||e[t]===void 0?"":e[t]}function le(n,e,t,o){g(n,"",e,t,o)}var ke=new Set(["class","style","key","ref"]);function Se(n){return n.length>2&&(n[0]==="o"||n[0]==="O"||n[0]==="@")&&(n[1]==="n"||n[1]==="N")}function z(n,e,t,o,r){if(!ke.has(e)){if(Se(e)){g(n,e,t,o,r);return}if(t===!1||t===null||t===void 0){n.removeAttribute(e);return}if(e in n)try{n[e]=t}catch(i){n.setAttribute(e,String(t))}else n.setAttribute(e,String(t))}}function y(n,e,t,o,r){z(n,e,t,o,r)}function C(n,e,t,o){if(t)for(let r in t){if(r==="key"||r==="ref")continue;let i=t[r],s=e?e[r]:void 0;i!==s&&y(n,r,i,s,o)}if(e)for(let r in e)r==="key"||r==="ref"||(!t||!(r in t))&&y(n,r,null,e[r],o)}function fe(n,e,t,o){let r=e.props||{},i=t.props||{},{patchFlag:s,dynamicProps:a}=t;if(!s||s===u.PatchFlags.HOISTED){C(n,r,i,o);return}if(s===u.PatchFlags.BAIL){C(n,r,i,o);return}if(s&u.PatchFlags.TEXT&&e.children!==t.children&&(n.textContent=t.children),s&u.PatchFlags.CLASS&&r.class!==i.class&&L(n,i.class,r.class),s&u.PatchFlags.STYLE&&r.style!==i.style&&x(n,i.style,r.style),s&u.PatchFlags.PROPS&&a)for(let c=0;c<a.length;c++){let f=a[c],d=r[f],p=i[f];p!==d&&y(n,f,p,d,o)}s&u.PatchFlags.FULL_PROPS&&C(n,r,i,o)}var T=class{createElement(e){return w(e)?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}createText(e){return document.createTextNode(e)}createComment(e){return document.createComment(e)}setAttribute(e,t,o){h(e,t,o)}removeAttribute(e,t){N(e,t)}setStyle(e,t){if(typeof t=="string")e.style.cssText=t;else if(t&&typeof t=="object")for(let o in t)e.style[o]=t[o]}setClass(e,t){if(typeof t=="string")e.className=t;else if(t&&typeof t=="object"){let o="";for(let r in t)t[r]&&(o+=(o?" ":"")+r);e.className=o}else e.className=""}insert(e,t,o){o!=null?e.insertBefore(t,o):e.appendChild(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}replace(e,t,o){e.replaceChild(o,t)}addEventListener(e,t,o,r){e.addEventListener(t,o,r)}removeEventListener(e,t,o){e.removeEventListener(t,o)}nextTick(e){Promise.resolve().then(e)}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}querySelector(e){return document.querySelector(e)}setClassWithOld(e,t,o){L(e,t,o)}setStyleWithOld(e,t,o){x(e,t,o)}setAttributeWithOld(e,t,o,r){y(e,t,o,r)}setElementText(e,t){e.textContent=t}setText(e,t){e.nodeValue=t}insertBefore(e,t,o){o!=null?e.insertBefore(t,o):e.appendChild(t)}removeChild(e,t){e.removeChild(t)}setAnchor(e,t){e.anchor=t}getNextSibling(e){return e.nextSibling}cleanupEvents(e){I(e)}},de=new T;
|
package/dist/dom.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{registerDOMOperations as de}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||{}),S=(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))(S||{}),H=Symbol("Fragment"),j=Symbol("Text"),U=Symbol("Comment");function y(n){return n.type===H}function h(n){return n.type===j}function g(n){return n.type===U}function Y(n,e){return n.type===e.type&&n.key===e.key}function O(n){return Array.isArray(n.dynamicChildren)}function G(n,e,t,o){if(t==="class")n.setClass(e,o);else if(t==="style")n.setStyle(e,o);else if(t.startsWith("on")||t.startsWith("@")){let r=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();n.addEventListener(e,r,o)}else t==="key"||t==="ref"||n.setAttribute(e,t,o)}function _(n,e,t,o,r){if(t==="class")n.setClass(e,o);else if(t==="style")n.setStyle(e,o||{});else if(t.startsWith("on")||t.startsWith("@")){let i=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();r&&n.removeEventListener(e,i,r),o&&n.addEventListener(e,i,o)}else n.setAttribute(e,t,o)}function I(n,e,t,o){for(let r in o){if(r==="key"||r==="ref")continue;let i=t[r],s=o[r];s!==i&&_(n,e,r,s,i)}for(let r in t)if(!(r==="key"||r==="ref")&&!(r in o))if(r==="class")n.setClass(e,"");else if(r==="style")n.setStyle(e,{});else if(r.startsWith("on")||r.startsWith("@")){let i=r.startsWith("@")?r.slice(1).toLowerCase():r.slice(2).toLowerCase();n.removeEventListener(e,i,t[r])}else n.removeAttribute(e,r)}function D(n,e,t,o,r,i){let{shapeFlag:s}=t;if(y(t)){oe(n,e,t,o,r,i);return}if(h(t)){let a=n.createText(t.children);t.el=a,n.insert(o,a,r);return}if(g(t)){let a=n.createComment(t.children);t.el=a,n.insert(o,a,r);return}if(s&1){ne(n,e,t,o,r,i);return}if(s&6){re(e,t,o,r,i);return}}function ne(n,e,t,o,r,i){let s=t.type,a=n.createElement(s);if(t.el=a,t.props)for(let p in t.props){let d=t.props[p];G(n,a,p,d)}let{shapeFlag:c,children:f}=t;c&8?a.textContent=f:c&16&&L(e,f,a,null,i),n.insert(o,a,r)}function L(n,e,t,o,r){for(let i=0;i<e.length;i++)n(null,e[i],t,o,r)}function oe(n,e,t,o,r,i){let{children:s}=t,a=n.createComment("");n.insert(o,a,r),Array.isArray(s)&&s.length>0&&L(e,s,o,a,i),t.el=a,t.anchor=a}function re(n,e,t,o,r){let i=e.component;i&&i.update&&i.update(),i&&i.subTree&&(n(null,i.subTree,t,o,i),e.el=i.subTree.el)}function B(n,e,t,o){let{shapeFlag:r,children:i}=t;if(y(t)){if(Array.isArray(i))for(let s=0;s<i.length;s++)e(i[s],o);t.anchor&&t.anchor.parentNode&&n.remove(t.anchor);return}if(r&6){t.component&&t.component.subTree&&e(t.component.subTree,o);return}t.el&&n.remove(t.el)}function T(n,e){for(let t=0;t<e.length;t++)n(e[t])}import{patchKeyedChildren as ie,patchUnkeyedChildren as se}from"@lytjs/vdom";function C(n,e,t,o,r,i=null,s=null){if(o==null){t&&e(t,r);return}if(t===null){D(n,M(n,e),o,r,i,s);return}if(O(o)&&O(t)){fe(n,e,t,o,r,s);return}if(!Y(t,o)){e(t,r),D(n,M(n,e),o,r,i,s);return}o.el=t.el,o.anchor=t.anchor;let{shapeFlag:a}=o;if(y(o)){le(n,e,t,o,r,i,s);return}if(h(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(g(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(a&1){ae(n,e,t,o,s);return}if(a&6){pe(t,o,s);return}}function M(n,e){return(t,o,r,i,s)=>{C(n,e,t,o,r,i,s)}}function ae(n,e,t,o,r=null){let i=o.el=t.el,s=t.props||{},a=o.props||{},{patchFlag:c,dynamicProps:f}=o;if(c&&c>0){if(c&1&&t.children!==o.children&&(i.textContent=o.children),c&2&&s.class!==a.class&&n.setClass(i,a.class),c&4&&s.style!==a.style&&n.setStyle(i,a.style||{}),c&8&&f)for(let p=0;p<f.length;p++){let d=f[p],l=s[d],W=a[d];W!==l&&_(n,i,d,W,l)}c&16&&I(n,i,s,a)}else I(n,i,s,a);(!c||!(c&1))&&X(n,e,t,o,i,null,r)}function X(n,e,t,o,r,i,s){let a=t.shapeFlag,c=o.shapeFlag,f=t.children,p=o.children;if(c&8){a&16&&T(e,f),f!==p&&(r.textContent=p);return}if(c&16){a&16?ce(n,e,f,p,r,i,s):(a&8&&(r.textContent=""),L(M(n,e),p,r,i,s));return}p==null&&(a&8?r.textContent="":a&16&&T(e,f))}function ce(n,e,t,o,r,i,s){o.every(c=>c.key!==null&&c.key!==void 0)&&t.every(c=>c.key!==null&&c.key!==void 0)?ie(t,o,r,i,s,null,!1):se(t,o,r,i,s,null,!1)}function le(n,e,t,o,r,i,s){let a=t.children,c=o.children;Array.isArray(c)&&c.length>0?(X(n,e,t,o,r,i,s),o.el=c[0].el,o.anchor=c[c.length-1].el?n.nextSibling(c[c.length-1].el):i):Array.isArray(a)&&a.length>0&&c===null?(T(e,a),o.el=t.el,o.anchor=t.anchor):(o.el=t.el,o.anchor=t.anchor)}function fe(n,e,t,o,r,i){let s=t.dynamicChildren,a=o.dynamicChildren;for(let c=0;c<a.length;c++)C(n,e,s[c],a[c],r,null,i)}function pe(n,e,t){e.component=n.component,e.el=n.el,e.component&&e.component.update&&e.component.update()}function ye(n){function e(r,i){B(n,e,r,i)}de({insert(r,i,s){n.insert(i,r,s)},createElement(r){return n.createElement(r)},createText(r){return n.createText(r)},setText(r,i){r.nodeValue=i},setElementText(r,i){r.textContent=i},remove(r){n.remove(r)},createComment(r){return n.createComment(r)},mount(r,i,s,a,c,f,p){o(null,r,i,s,a)},patch(r,i,s,a,c,f,p,d){o(r,i,s,a,c)},unmount(r,i,s,a){e(r)},move(r,i,s){n.insert(i,r.el,s)}});function o(r,i,s,a,c){C(n,e,r,i,s,a,c)}return{mount(r,i){i.nodeType===1&&(i.textContent=""),o(null,r,i,null,null)},patch(r,i,s){var a;o(r,i,s||((a=r.el)==null?void 0:a.parentNode),null,null)},unmount(r,i){e(r,i)}}}var w={acceptCharset:"acceptCharset",accessKey:"accessKey",className:"className",htmlFor:"htmlFor",httpEquiv:"httpEquiv",tabIndex:"tabIndex"},q={allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,inert:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0},ue={"accent-height":"accentHeight","alignment-baseline":"alignmentBaseline","baseline-shift":"baselineShift","clip-path":"clipPath","clip-rule":"clipRule","color-interpolation":"colorInterpolation","color-interpolation-filters":"colorInterpolationFilters","dominant-baseline":"dominantBaseline","enable-background":"enableBackground","fill-opacity":"fillOpacity","fill-rule":"fillRule","flood-color":"floodColor","flood-opacity":"floodOpacity","glyph-orientation-horizontal":"glyphOrientationHorizontal","glyph-orientation-vertical":"glyphOrientationVertical","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-variant":"fontVariant","font-weight":"fontWeight","image-rendering":"imageRendering","letter-spacing":"letterSpacing","lighting-color":"lightingColor","marker-end":"markerEnd","marker-mid":"markerMid","marker-start":"markerStart","paint-order":"paintOrder","pointer-events":"pointerEvents","shape-rendering":"shapeRendering","stop-color":"stopColor","stop-opacity":"stopOpacity","stroke-dasharray":"strokeDasharray","stroke-dashoffset":"strokeDashoffset","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","stroke-miterlimit":"strokeMiterlimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","text-anchor":"textAnchor","text-decoration":"textDecoration","text-rendering":"textRendering","transform-origin":"transformOrigin","word-spacing":"wordSpacing","writing-mode":"writingMode","xlink:href":"xlinkHref","xlink:title":"xlinkTitle","xml:lang":"xmlLang","xml:space":"xmlSpace"};function x(n,e,t){if(e==="class"){n.className=t==null?"":String(t);return}if(e==="style"){if(typeof t=="string")n.style.cssText=t;else if(t!=null&&typeof t=="object")for(let r in t)n.style[r]=t[r];else n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let r=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase();typeof t=="function"&&n.addEventListener(r,t);return}if(e in q){t?(n.setAttribute(e,""),e in n&&(n[e]=!0)):(n.removeAttribute(e),e in n&&(n[e]=!1));return}let o=w[e]||e;if(o in n){try{n[o]=t==null?"":t}catch(r){n.setAttribute(e,t==null?"":String(t))}return}t==null||t===!1?n.removeAttribute(e):n.setAttribute(e,String(t))}function R(n,e){if(e==="class"){n.className="";return}if(e==="style"){n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let o=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase(),r=n._vei;if(r){let i="on"+o.charAt(0).toUpperCase()+o.slice(1),s=r[i];s&&(n.removeEventListener(o,s),r[i]=void 0)}return}if(e in q){n.removeAttribute(e),e in n&&(n[e]=!1);return}let t=w[e]||e;if(t in n){try{n[t]=""}catch(o){n.removeAttribute(e)}return}n.removeAttribute(e)}function z(n){return n.startsWith("on")||n.startsWith("@")}function me(n,e,t){let o=e?Object.keys(e):[],r=t?Object.keys(t):[];for(let i=0;i<r.length;i++){let s=r[i],a=t[s],c=e?e[s]:void 0;s==="key"||s==="ref"||a!==c&&(s==="class"?n.className=a==null?"":String(a):s==="style"?ve(n,a,c):z(s)||x(n,s,a))}for(let i=0;i<o.length;i++){let s=o[i];s==="key"||s==="ref"||(!t||!(s in t))&&(s==="class"?n.className="":s==="style"?n.style.cssText="":z(s)||R(n,s))}}function ve(n,e,t){if(!e||typeof e=="string"&&!e.trim()){n.style.cssText="";return}if(typeof e=="string"){n.style.cssText=e;return}if(typeof t=="object"&&t!==null)for(let o in t)o in e||(n.style[o]="");for(let o in e)n.style[o]=e[o]}function P(n){return n==="svg"||n==="path"||n==="circle"||n==="rect"||n==="line"||n==="polyline"||n==="polygon"||n==="ellipse"||n==="g"||n==="defs"||n==="use"||n==="text"||n==="tspan"||n==="clipPath"||n==="mask"||n==="filter"||n==="linearGradient"||n==="radialGradient"||n==="stop"||n==="pattern"||n==="symbol"||n==="image"||n==="foreignObject"||n==="animate"||n==="animateTransform"||n==="animateMotion"}function Ne(n){return ue[n]||n}var Ee=/^(?:@|on)/;function k(n){return n.replace(Ee,"").toLowerCase()}function F(n){let e=k(n);return"on"+e.charAt(0).toUpperCase()+e.slice(1)}var he={stop:"stop",prevent:"prevent",capture:"capture",once:"once",self:"self",passive:"passive"};function J(n){let e=n.split("."),o={name:e[0],stop:!1,prevent:!1,capture:!1,once:!1,self:!1,passive:!1};for(let r=1;r<e.length;r++){let i=e[r],s=he[i];s&&(o[s]=!0)}return o}function Q(n){let e=(t=>{e.value&&e.value(t)});return e.value=n,e}var v="_vei";function ge(n){return n[v]||null}function V(n,e,t,o,r){let i=F(e),s=J(k(e)),a=s.name,c=n[v];c||(c=n[v]={});let f=c[i];if(t&&f)f.value=t;else if(t&&!f){let p=Q(t);c[i]=p;let d={};s.capture&&(d.capture=!0),s.once&&(d.once=!0),s.passive&&(d.passive=!0),n.addEventListener(a,p,d)}else!t&&f&&(n.removeEventListener(a,f),c[i]=void 0)}function K(n){let e=n[v];if(e){for(let t in e){let o=e[t];if(o){let r=t.charAt(2).toLowerCase()+t.slice(3);n.removeEventListener(r,o)}}n[v]={}}}var $=(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))($||{});function N(n,e,t){let o=ee(e);o!==t&&(n.className=o)}function ee(n){if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="object"){if(Array.isArray(n)){let t="";for(let o=0;o<n.length;o++){let r=ee(n[o]);r&&(t+=(t?" ":"")+r)}return t}let e="";for(let t in n)n[t]&&(e+=(e?" ":"")+t);return e}return String(n)}function E(n,e,t){if(!e){n.style.cssText="";return}if(!t){typeof e=="string"?n.style.cssText=e:typeof e=="object"&&Z(n,e);return}if(typeof e!=typeof t){n.style.cssText="",typeof e=="string"?n.style.cssText=e:typeof e=="object"&&Z(n,e);return}if(typeof e=="string"){e!==t&&(n.style.cssText=e);return}if(typeof e=="object"&&typeof t=="object"){for(let o in t)o in e||(n.style[o]="");for(let o in e){let r=e[o],i=t[o];r!==i&&(n.style[o]=r==null?"":r)}}}function Z(n,e){for(let t in e)n.style[t]=e[t]===null||e[t]===void 0?"":e[t]}function Le(n,e,t,o){V(n,"",e,t,o)}var Te=new Set(["class","style","key","ref"]);function Ce(n){return n.length>2&&(n[0]==="o"||n[0]==="O"||n[0]==="@")&&(n[1]==="n"||n[1]==="N")}function te(n,e,t,o,r){if(!Te.has(e)){if(e==="class"){N(n,t,o);return}if(e==="style"){E(n,t,o);return}if(Ce(e)){V(n,e,t,o,r);return}if(t===!1||t===null||t===void 0){n.removeAttribute(e);return}if(e in n)try{n[e]=t}catch(i){n.setAttribute(e,String(t))}else n.setAttribute(e,String(t))}}function u(n,e,t,o,r){te(n,e,t,o,r)}function A(n,e,t,o){if(t)for(let r in t){if(r==="key"||r==="ref")continue;let i=t[r],s=e?e[r]:void 0;i!==s&&u(n,r,i,s,o)}if(e)for(let r in e)r==="key"||r==="ref"||(!t||!(r in t))&&u(n,r,null,e[r],o)}function xe(n,e,t,o){let r=e.props||{},i=t.props||{},{patchFlag:s,dynamicProps:a}=t;if(!s||s===-1){A(n,r,i,o);return}if(s===-2){A(n,r,i,o);return}if(s&1&&e.children!==t.children&&(n.textContent=t.children),s&2&&r.class!==i.class&&N(n,i.class,r.class),s&4&&r.style!==i.style&&E(n,i.style,r.style),s&8&&a)for(let c=0;c<a.length;c++){let f=a[c],p=r[f],d=i[f];d!==p&&u(n,f,d,p,o)}s&16&&A(n,r,i,o)}var b=class{createElement(e){return P(e)?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}createText(e){return document.createTextNode(e)}createComment(e){return document.createComment(e)}setAttribute(e,t,o){x(e,t,o)}removeAttribute(e,t){R(e,t)}setStyle(e,t){if(typeof t=="string")e.style.cssText=t;else if(t&&typeof t=="object")for(let o in t)e.style[o]=t[o]}setClass(e,t){if(typeof t=="string")e.className=t;else if(t&&typeof t=="object"){let o="";for(let r in t)t[r]&&(o+=(o?" ":"")+r);e.className=o}else e.className=""}insert(e,t,o){o!=null?e.insertBefore(t,o):e.appendChild(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}replace(e,t,o){e.replaceChild(o,t)}addEventListener(e,t,o,r){e.addEventListener(t,o,r)}removeEventListener(e,t,o){e.removeEventListener(t,o)}nextTick(e){Promise.resolve().then(e)}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}querySelector(e){return document.querySelector(e)}setClassWithOld(e,t,o){N(e,t,o)}setStyleWithOld(e,t,o){E(e,t,o)}setAttributeWithOld(e,t,o,r){u(e,t,o,r)}setElementText(e,t){e.textContent=t}setText(e,t){e.nodeValue=t}insertBefore(e,t,o){o!=null?e.insertBefore(t,o):e.appendChild(t)}removeChild(e,t){e.removeChild(t)}setAnchor(e,t){e.anchor=t}getNextSibling(e){return e.nextSibling}cleanupEvents(e){K(e)}},Re=new b;export{U as Comment,b as DOMRenderer,H as Fragment,S as PatchFlags,$ as PatchPropFlags,m as ShapeFlags,j as Text,Q as createInvoker,ye as createRenderer,Re as domRenderer,ge as getEventInvokers,F as getEventKey,Ne as getSVGPropName,P as isSVGElement,k as normalizeEventName,J as parseEventModifier,A as patchAllProps,N as patchClass,te as patchDOMProp,me as patchDOMProps,xe as patchElementProps,V as patchEvent,Le as patchEventOnElement,u as patchProp,E as patchStyle,K as removeAllEventListeners,R as removeDOMProp,x as setDOMProp};
|
|
1
|
+
import{registerDOMOperations as pe}from"@lytjs/vdom";var v=(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))(v||{}),k=(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))(k||{}),j=Symbol("Fragment"),H=Symbol("Text"),F=Symbol("Comment");function y(n){return n.type===j}function N(n){return n.type===H}function E(n){return n.type===F}function U(n,e){return n.type===e.type&&n.key===e.key}function S(n){return Array.isArray(n.dynamicChildren)}function B(n,e,t,o){if(t==="class")n.setClass(e,o);else if(t==="style")n.setStyle(e,o);else if(t.startsWith("on")||t.startsWith("@")){let r=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();n.addEventListener(e,r,o)}else t==="key"||t==="ref"||n.setAttribute(e,t,o)}function w(n,e,t,o,r){if(t==="class")n.setClass(e,o);else if(t==="style")n.setStyle(e,o||{});else if(t.startsWith("on")||t.startsWith("@")){let i=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();r&&n.removeEventListener(e,i,r),o&&n.addEventListener(e,i,o)}else n.setAttribute(e,t,o)}function _(n,e,t,o){for(let r in o){if(r==="key"||r==="ref")continue;let i=t[r],s=o[r];s!==i&&w(n,e,r,s,i)}for(let r in t)if(!(r==="key"||r==="ref")&&!(r in o))if(r==="class")n.setClass(e,"");else if(r==="style")n.setStyle(e,{});else if(r.startsWith("on")||r.startsWith("@")){let i=r.startsWith("@")?r.slice(1).toLowerCase():r.slice(2).toLowerCase();n.removeEventListener(e,i,t[r])}else n.removeAttribute(e,r)}function I(n,e,t,o,r,i){let{shapeFlag:s}=t;if(y(t)){oe(n,e,t,o,r,i);return}if(N(t)){let a=n.createText(t.children);t.el=a,n.insert(o,a,r);return}if(E(t)){let a=n.createComment(t.children);t.el=a,n.insert(o,a,r);return}if(s&1){ne(n,e,t,o,r,i);return}if(s&6){re(e,t,o,r,i);return}}function ne(n,e,t,o,r,i){let s=t.type,a=n.createElement(s);if(t.el=a,t.props)for(let d in t.props){let p=t.props[d];B(n,a,d,p)}let{shapeFlag:c,children:f}=t;c&8?a.textContent=f:c&16&&g(e,f,a,null,i),n.insert(o,a,r)}function g(n,e,t,o,r){for(let i=0;i<e.length;i++)n(null,e[i],t,o,r)}function oe(n,e,t,o,r,i){let{children:s}=t,a=n.createComment("");n.insert(o,a,r),Array.isArray(s)&&s.length>0&&g(e,s,o,a,i),t.el=a,t.anchor=a}function re(n,e,t,o,r){let i=e.component;i&&i.update&&i.update(),i&&i.subTree&&(n(null,i.subTree,t,o,i),e.el=i.subTree.el)}function G(n,e,t,o){let{shapeFlag:r,children:i}=t;if(y(t)){if(Array.isArray(i))for(let s=0;s<i.length;s++)e(i[s],o);t.anchor&&t.anchor.parentNode&&n.remove(t.anchor);return}if(r&6){t.component&&t.component.subTree&&e(t.component.subTree,o);return}t.el&&n.remove(t.el)}function C(n,e){for(let t=0;t<e.length;t++)n(e[t])}import{patchKeyedChildren as ie,patchUnkeyedChildren as se}from"@lytjs/vdom";function L(n,e,t,o,r,i=null,s=null){if(o==null){t&&e(t,r);return}if(t===null){I(n,P(n,e),o,r,i,s);return}if(S(o)&&S(t)){fe(n,e,t,o,r,s);return}if(!U(t,o)){e(t,r),I(n,P(n,e),o,r,i,s);return}o.el=t.el,o.anchor=t.anchor;let{shapeFlag:a}=o;if(y(o)){le(n,e,t,o,r,i,s);return}if(N(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(E(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(a&1){ae(n,e,t,o,s);return}if(a&6){de(t,o,s);return}}function P(n,e){return(t,o,r,i,s)=>{L(n,e,t,o,r,i,s)}}function ae(n,e,t,o,r=null){let i=o.el=t.el,s=t.props||{},a=o.props||{},{patchFlag:c,dynamicProps:f}=o;if(c&&c>0){if(c&1&&t.children!==o.children&&(i.textContent=o.children),c&2&&s.class!==a.class&&n.setClass(i,a.class),c&4&&s.style!==a.style&&n.setStyle(i,a.style||{}),c&8&&f)for(let d=0;d<f.length;d++){let p=f[d],l=s[p],K=a[p];K!==l&&w(n,i,p,K,l)}c&16&&_(n,i,s,a)}else _(n,i,s,a);(!c||!(c&1))&&Y(n,e,t,o,i,null,r)}function Y(n,e,t,o,r,i,s){let a=t.shapeFlag,c=o.shapeFlag,f=t.children,d=o.children;if(c&8){a&16&&C(e,f),f!==d&&(r.textContent=d);return}if(c&16){a&16?ce(n,e,f,d,r,i,s):(a&8&&(r.textContent=""),g(P(n,e),d,r,i,s));return}d==null&&(a&8?r.textContent="":a&16&&C(e,f))}function ce(n,e,t,o,r,i,s){o.every(c=>c.key!==null&&c.key!==void 0)&&t.every(c=>c.key!==null&&c.key!==void 0)?ie(t,o,r,i,s,null,!1):se(t,o,r,i,s,null,!1)}function le(n,e,t,o,r,i,s){let a=t.children,c=o.children;Array.isArray(c)&&c.length>0?(Y(n,e,t,o,r,i,s),o.el=c[0].el,o.anchor=c[c.length-1].el?n.nextSibling(c[c.length-1].el):i):Array.isArray(a)&&a.length>0&&c===null?(C(e,a),o.el=t.el,o.anchor=t.anchor):(o.el=t.el,o.anchor=t.anchor)}function fe(n,e,t,o,r,i){let s=t.dynamicChildren,a=o.dynamicChildren;for(let c=0;c<a.length;c++)L(n,e,s[c],a[c],r,null,i)}function de(n,e,t){e.component=n.component,e.el=n.el,e.component&&e.component.update&&e.component.update()}function ue(n){function e(r,i){G(n,e,r,i)}pe({insert(r,i,s){n.insert(i,r,s)},createElement(r){return n.createElement(r)},createText(r){return n.createText(r)},setText(r,i){r.nodeValue=i},setElementText(r,i){r.textContent=i},remove(r){n.remove(r)},createComment(r){return n.createComment(r)},mount(r,i,s,a,c,f,d){o(null,r,i,s,a)},patch(r,i,s,a,c,f,d,p){o(r,i,s,a,c)},unmount(r,i,s,a){e(r)},move(r,i,s){n.insert(i,r.el,s)}});function o(r,i,s,a,c){L(n,e,r,i,s,a,c)}return{mount(r,i){i.nodeType===1&&(i.textContent=""),o(null,r,i,null,null)},patch(r,i,s){var a;o(r,i,s||((a=r.el)==null?void 0:a.parentNode),null,null)},unmount(r,i){e(r,i)}}}var X={acceptCharset:"acceptCharset",accessKey:"accessKey",className:"className",htmlFor:"htmlFor",httpEquiv:"httpEquiv",tabIndex:"tabIndex"},q={allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,inert:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0},ye={"accent-height":"accentHeight","alignment-baseline":"alignmentBaseline","baseline-shift":"baselineShift","clip-path":"clipPath","clip-rule":"clipRule","color-interpolation":"colorInterpolation","color-interpolation-filters":"colorInterpolationFilters","dominant-baseline":"dominantBaseline","enable-background":"enableBackground","fill-opacity":"fillOpacity","fill-rule":"fillRule","flood-color":"floodColor","flood-opacity":"floodOpacity","glyph-orientation-horizontal":"glyphOrientationHorizontal","glyph-orientation-vertical":"glyphOrientationVertical","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-variant":"fontVariant","font-weight":"fontWeight","image-rendering":"imageRendering","letter-spacing":"letterSpacing","lighting-color":"lightingColor","marker-end":"markerEnd","marker-mid":"markerMid","marker-start":"markerStart","paint-order":"paintOrder","pointer-events":"pointerEvents","shape-rendering":"shapeRendering","stop-color":"stopColor","stop-opacity":"stopOpacity","stroke-dasharray":"strokeDasharray","stroke-dashoffset":"strokeDashoffset","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","stroke-miterlimit":"strokeMiterlimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","text-anchor":"textAnchor","text-decoration":"textDecoration","text-rendering":"textRendering","transform-origin":"transformOrigin","word-spacing":"wordSpacing","writing-mode":"writingMode","xlink:href":"xlinkHref","xlink:title":"xlinkTitle","xml:lang":"xmlLang","xml:space":"xmlSpace"};function x(n,e,t){if(e==="class"){n.className=t==null?"":String(t);return}if(e==="style"){if(typeof t=="string")n.style.cssText=t;else if(t!=null&&typeof t=="object")for(let r in t)n.style[r]=t[r];else n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let r=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase();typeof t=="function"&&n.addEventListener(r,t);return}if(e in q){t?(n.setAttribute(e,""),e in n&&(n[e]=!0)):(n.removeAttribute(e),e in n&&(n[e]=!1));return}let o=X[e]||e;if(o in n){try{n[o]=t==null?"":t}catch(r){n.setAttribute(e,t==null?"":String(t))}return}t==null||t===!1?n.removeAttribute(e):n.setAttribute(e,String(t))}function T(n,e){if(e==="class"){n.className="";return}if(e==="style"){n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let o=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase(),r=n._vei;if(r){let i="on"+o.charAt(0).toUpperCase()+o.slice(1),s=r[i];s&&(n.removeEventListener(o,s),r[i]=void 0)}return}if(e in q){n.removeAttribute(e),e in n&&(n[e]=!1);return}let t=X[e]||e;if(t in n){try{n[t]=""}catch(o){n.removeAttribute(e)}return}n.removeAttribute(e)}function z(n){return n.startsWith("on")||n.startsWith("@")}function me(n,e,t){let o=e?Object.keys(e):[],r=t?Object.keys(t):[];for(let i=0;i<r.length;i++){let s=r[i],a=t[s],c=e?e[s]:void 0;s==="key"||s==="ref"||a!==c&&(s==="class"?n.className=a==null?"":String(a):s==="style"?ve(n,a,c):z(s)||x(n,s,a))}for(let i=0;i<o.length;i++){let s=o[i];s==="key"||s==="ref"||(!t||!(s in t))&&(s==="class"?n.className="":s==="style"?n.style.cssText="":z(s)||T(n,s))}}function ve(n,e,t){if(!e||typeof e=="string"&&!e.trim()){n.style.cssText="";return}if(typeof e=="string"){n.style.cssText=e;return}if(typeof t=="object"&&t!==null)for(let o in t)o in e||(n.style[o]="");for(let o in e)n.style[o]=e[o]}function D(n){return n==="svg"||n==="path"||n==="circle"||n==="rect"||n==="line"||n==="polyline"||n==="polygon"||n==="ellipse"||n==="g"||n==="defs"||n==="use"||n==="text"||n==="tspan"||n==="clipPath"||n==="mask"||n==="filter"||n==="linearGradient"||n==="radialGradient"||n==="stop"||n==="pattern"||n==="symbol"||n==="image"||n==="foreignObject"||n==="animate"||n==="animateTransform"||n==="animateMotion"}function he(n){return ye[n]||n}var Ne=/^(?:@|on)/;function M(n){return n.replace(Ne,"").toLowerCase()}function $(n){let e=M(n);return"on"+e.charAt(0).toUpperCase()+e.slice(1)}var Ee={stop:"stop",prevent:"prevent",capture:"capture",once:"once",self:"self",passive:"passive"};function J(n){let e=n.split("."),o={name:e[0],stop:!1,prevent:!1,capture:!1,once:!1,self:!1,passive:!1};for(let r=1;r<e.length;r++){let i=e[r],s=Ee[i];s&&(o[s]=!0)}return o}function Q(n){let e=(t=>{e.value&&e.value(t)});return e.value=n,e}var h="_vei";function ge(n){return n[h]||null}function R(n,e,t,o,r){let i=$(e),s=J(M(e)),a=s.name,c=n[h];c||(c=n[h]={});let f=c[i];if(t&&f)f.value=t;else if(t&&!f){let d=Q(t);c[i]=d;let p={};s.capture&&(p.capture=!0),s.once&&(p.once=!0),s.passive&&(p.passive=!0),n.addEventListener(a,d,p)}else!t&&f&&(n.removeEventListener(a,f),c[i]=void 0)}function W(n){let e=n[h];if(e){for(let t in e){let o=e[t];if(o){let r=t.charAt(2).toLowerCase()+t.slice(3);n.removeEventListener(r,o)}}n[h]={}}}import{PatchFlags as u}from"@lytjs/vdom";function b(n,e,t){let o=ee(e);o!==t&&(n.className=o)}function ee(n){if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="object"){if(Array.isArray(n)){let t="";for(let o=0;o<n.length;o++){let r=ee(n[o]);r&&(t+=(t?" ":"")+r)}return t}let e="";for(let t in n)n[t]&&(e+=(e?" ":"")+t);return e}return String(n)}function A(n,e,t){if(!e){n.style.cssText="";return}if(!t){typeof e=="string"?n.style.cssText=e:typeof e=="object"&&Z(n,e);return}if(typeof e!=typeof t){n.style.cssText="",typeof e=="string"?n.style.cssText=e:typeof e=="object"&&Z(n,e);return}if(typeof e=="string"){e!==t&&(n.style.cssText=e);return}if(typeof e=="object"&&typeof t=="object"){for(let o in t)o in e||(n.style[o]="");for(let o in e){let r=e[o],i=t[o];r!==i&&(n.style[o]=r==null?"":r)}}}function Z(n,e){for(let t in e)n.style[t]=e[t]===null||e[t]===void 0?"":e[t]}function Ce(n,e,t,o){R(n,"",e,t,o)}var Le=new Set(["class","style","key","ref"]);function xe(n){return n.length>2&&(n[0]==="o"||n[0]==="O"||n[0]==="@")&&(n[1]==="n"||n[1]==="N")}function te(n,e,t,o,r){if(!Le.has(e)){if(xe(e)){R(n,e,t,o,r);return}if(t===!1||t===null||t===void 0){n.removeAttribute(e);return}if(e in n)try{n[e]=t}catch(i){n.setAttribute(e,String(t))}else n.setAttribute(e,String(t))}}function m(n,e,t,o,r){te(n,e,t,o,r)}function V(n,e,t,o){if(t)for(let r in t){if(r==="key"||r==="ref")continue;let i=t[r],s=e?e[r]:void 0;i!==s&&m(n,r,i,s,o)}if(e)for(let r in e)r==="key"||r==="ref"||(!t||!(r in t))&&m(n,r,null,e[r],o)}function Te(n,e,t,o){let r=e.props||{},i=t.props||{},{patchFlag:s,dynamicProps:a}=t;if(!s||s===u.HOISTED){V(n,r,i,o);return}if(s===u.BAIL){V(n,r,i,o);return}if(s&u.TEXT&&e.children!==t.children&&(n.textContent=t.children),s&u.CLASS&&r.class!==i.class&&b(n,i.class,r.class),s&u.STYLE&&r.style!==i.style&&A(n,i.style,r.style),s&u.PROPS&&a)for(let c=0;c<a.length;c++){let f=a[c],d=r[f],p=i[f];p!==d&&m(n,f,p,d,o)}s&u.FULL_PROPS&&V(n,r,i,o)}var O=class{createElement(e){return D(e)?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}createText(e){return document.createTextNode(e)}createComment(e){return document.createComment(e)}setAttribute(e,t,o){x(e,t,o)}removeAttribute(e,t){T(e,t)}setStyle(e,t){if(typeof t=="string")e.style.cssText=t;else if(t&&typeof t=="object")for(let o in t)e.style[o]=t[o]}setClass(e,t){if(typeof t=="string")e.className=t;else if(t&&typeof t=="object"){let o="";for(let r in t)t[r]&&(o+=(o?" ":"")+r);e.className=o}else e.className=""}insert(e,t,o){o!=null?e.insertBefore(t,o):e.appendChild(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}replace(e,t,o){e.replaceChild(o,t)}addEventListener(e,t,o,r){e.addEventListener(t,o,r)}removeEventListener(e,t,o){e.removeEventListener(t,o)}nextTick(e){Promise.resolve().then(e)}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}querySelector(e){return document.querySelector(e)}setClassWithOld(e,t,o){b(e,t,o)}setStyleWithOld(e,t,o){A(e,t,o)}setAttributeWithOld(e,t,o,r){m(e,t,o,r)}setElementText(e,t){e.textContent=t}setText(e,t){e.nodeValue=t}insertBefore(e,t,o){o!=null?e.insertBefore(t,o):e.appendChild(t)}removeChild(e,t){e.removeChild(t)}setAnchor(e,t){e.anchor=t}getNextSibling(e){return e.nextSibling}cleanupEvents(e){W(e)}},Re=new O;export{F as Comment,O as DOMRenderer,j as Fragment,k as PatchFlags,u as PatchPropFlags,v as ShapeFlags,H as Text,Q as createInvoker,ue as createRenderer,Re as domRenderer,ge as getEventInvokers,$ as getEventKey,he as getSVGPropName,D as isSVGElement,M as normalizeEventName,J as parseEventModifier,V as patchAllProps,b as patchClass,te as patchDOMProp,me as patchDOMProps,Te as patchElementProps,R as patchEvent,Ce as patchEventOnElement,m as patchProp,A as patchStyle,W as removeAllEventListeners,T as removeDOMProp,x as setDOMProp};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var M=Object.defineProperty;var de=Object.getOwnPropertyDescriptor;var ye=Object.getOwnPropertyNames;var ue=Object.prototype.hasOwnProperty;var me=(n,e)=>{for(var t in e)M(n,t,{get:e[t],enumerable:!0})},ve=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ye(e))!ue.call(n,r)&&r!==t&&M(n,r,{get:()=>e[r],enumerable:!(o=de(e,r))||o.enumerable});return n};var Ne=n=>ve(M({},"__esModule",{value:!0}),n);var Ie={};me(Ie,{Comment:()=>K,DOMRenderer:()=>C,Fragment:()=>P,PatchFlags:()=>x,PatchPropFlags:()=>z,ShapeFlags:()=>u,Text:()=>k,createInvoker:()=>X,createRenderer:()=>ee,domRenderer:()=>pe,getEventInvokers:()=>se,getEventKey:()=>G,getSVGPropName:()=>ie,isSVGElement:()=>_,normalizeEventName:()=>I,parseEventModifier:()=>B,patchAllProps:()=>T,patchClass:()=>v,patchDOMProp:()=>w,patchDOMProps:()=>re,patchElementProps:()=>fe,patchEvent:()=>L,patchEventOnElement:()=>le,patchProp:()=>y,patchStyle:()=>N,removeAllEventListeners:()=>D,removeDOMProp:()=>h,setDOMProp:()=>E});module.exports=Ne(Ie);var $=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||{}),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||{}),P=Symbol("Fragment"),k=Symbol("Text"),K=Symbol("Comment");function m(n){return n.type===P}function R(n){return n.type===k}function V(n){return n.type===K}function F(n,e){return n.type===e.type&&n.key===e.key}function W(n){return Array.isArray(n.dynamicChildren)}function J(n,e,t,o){if(t==="class")n.setClass(e,o);else if(t==="style")n.setStyle(e,o);else if(t.startsWith("on")||t.startsWith("@")){let r=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();n.addEventListener(e,r,o)}else t==="key"||t==="ref"||n.setAttribute(e,t,o)}function H(n,e,t,o,r){if(t==="class")n.setClass(e,o);else if(t==="style")n.setStyle(e,o||{});else if(t.startsWith("on")||t.startsWith("@")){let i=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();r&&n.removeEventListener(e,i,r),o&&n.addEventListener(e,i,o)}else n.setAttribute(e,t,o)}function j(n,e,t,o){for(let r in o){if(r==="key"||r==="ref")continue;let i=t[r],s=o[r];s!==i&&H(n,e,r,s,i)}for(let r in t)if(!(r==="key"||r==="ref")&&!(r in o))if(r==="class")n.setClass(e,"");else if(r==="style")n.setStyle(e,{});else if(r.startsWith("on")||r.startsWith("@")){let i=r.startsWith("@")?r.slice(1).toLowerCase():r.slice(2).toLowerCase();n.removeEventListener(e,i,t[r])}else n.removeAttribute(e,r)}function U(n,e,t,o,r,i){let{shapeFlag:s}=t;if(m(t)){he(n,e,t,o,r,i);return}if(R(t)){let a=n.createText(t.children);t.el=a,n.insert(o,a,r);return}if(V(t)){let a=n.createComment(t.children);t.el=a,n.insert(o,a,r);return}if(s&1){Ee(n,e,t,o,r,i);return}if(s&6){ge(e,t,o,r,i);return}}function Ee(n,e,t,o,r,i){let s=t.type,a=n.createElement(s);if(t.el=a,t.props)for(let p in t.props){let d=t.props[p];J(n,a,p,d)}let{shapeFlag:c,children:f}=t;c&8?a.textContent=f:c&16&&A(e,f,a,null,i),n.insert(o,a,r)}function A(n,e,t,o,r){for(let i=0;i<e.length;i++)n(null,e[i],t,o,r)}function he(n,e,t,o,r,i){let{children:s}=t,a=n.createComment("");n.insert(o,a,r),Array.isArray(s)&&s.length>0&&A(e,s,o,a,i),t.el=a,t.anchor=a}function ge(n,e,t,o,r){let i=e.component;i&&i.update&&i.update(),i&&i.subTree&&(n(null,i.subTree,t,o,i),e.el=i.subTree.el)}function Q(n,e,t,o){let{shapeFlag:r,children:i}=t;if(m(t)){if(Array.isArray(i))for(let s=0;s<i.length;s++)e(i[s],o);t.anchor&&t.anchor.parentNode&&n.remove(t.anchor);return}if(r&6){t.component&&t.component.subTree&&e(t.component.subTree,o);return}t.el&&n.remove(t.el)}function b(n,e){for(let t=0;t<e.length;t++)n(e[t])}var S=require("@lytjs/vdom");function O(n,e,t,o,r,i=null,s=null){if(o==null){t&&e(t,r);return}if(t===null){U(n,Y(n,e),o,r,i,s);return}if(W(o)&&W(t)){xe(n,e,t,o,r,s);return}if(!F(t,o)){e(t,r),U(n,Y(n,e),o,r,i,s);return}o.el=t.el,o.anchor=t.anchor;let{shapeFlag:a}=o;if(m(o)){Ce(n,e,t,o,r,i,s);return}if(R(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(V(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(a&1){Le(n,e,t,o,s);return}if(a&6){Re(t,o,s);return}}function Y(n,e){return(t,o,r,i,s)=>{O(n,e,t,o,r,i,s)}}function Le(n,e,t,o,r=null){let i=o.el=t.el,s=t.props||{},a=o.props||{},{patchFlag:c,dynamicProps:f}=o;if(c&&c>0){if(c&1&&t.children!==o.children&&(i.textContent=o.children),c&2&&s.class!==a.class&&n.setClass(i,a.class),c&4&&s.style!==a.style&&n.setStyle(i,a.style||{}),c&8&&f)for(let p=0;p<f.length;p++){let d=f[p],l=s[d],q=a[d];q!==l&&H(n,i,d,q,l)}c&16&&j(n,i,s,a)}else j(n,i,s,a);(!c||!(c&1))&&Z(n,e,t,o,i,null,r)}function Z(n,e,t,o,r,i,s){let a=t.shapeFlag,c=o.shapeFlag,f=t.children,p=o.children;if(c&8){a&16&&b(e,f),f!==p&&(r.textContent=p);return}if(c&16){a&16?Te(n,e,f,p,r,i,s):(a&8&&(r.textContent=""),A(Y(n,e),p,r,i,s));return}p==null&&(a&8?r.textContent="":a&16&&b(e,f))}function Te(n,e,t,o,r,i,s){o.every(c=>c.key!==null&&c.key!==void 0)&&t.every(c=>c.key!==null&&c.key!==void 0)?(0,S.patchKeyedChildren)(t,o,r,i,s,null,!1):(0,S.patchUnkeyedChildren)(t,o,r,i,s,null,!1)}function Ce(n,e,t,o,r,i,s){let a=t.children,c=o.children;Array.isArray(c)&&c.length>0?(Z(n,e,t,o,r,i,s),o.el=c[0].el,o.anchor=c[c.length-1].el?n.nextSibling(c[c.length-1].el):i):Array.isArray(a)&&a.length>0&&c===null?(b(e,a),o.el=t.el,o.anchor=t.anchor):(o.el=t.el,o.anchor=t.anchor)}function xe(n,e,t,o,r,i){let s=t.dynamicChildren,a=o.dynamicChildren;for(let c=0;c<a.length;c++)O(n,e,s[c],a[c],r,null,i)}function Re(n,e,t){e.component=n.component,e.el=n.el,e.component&&e.component.update&&e.component.update()}function ee(n){function e(r,i){Q(n,e,r,i)}(0,$.registerDOMOperations)({insert(r,i,s){n.insert(i,r,s)},createElement(r){return n.createElement(r)},createText(r){return n.createText(r)},setText(r,i){r.nodeValue=i},setElementText(r,i){r.textContent=i},remove(r){n.remove(r)},createComment(r){return n.createComment(r)},mount(r,i,s,a,c,f,p){o(null,r,i,s,a)},patch(r,i,s,a,c,f,p,d){o(r,i,s,a,c)},unmount(r,i,s,a){e(r)},move(r,i,s){n.insert(i,r.el,s)}});function o(r,i,s,a,c){O(n,e,r,i,s,a,c)}return{mount(r,i){i.nodeType===1&&(i.textContent=""),o(null,r,i,null,null)},patch(r,i,s){var a;o(r,i,s||((a=r.el)==null?void 0:a.parentNode),null,null)},unmount(r,i){e(r,i)}}}var ne={acceptCharset:"acceptCharset",accessKey:"accessKey",className:"className",htmlFor:"htmlFor",httpEquiv:"httpEquiv",tabIndex:"tabIndex"},oe={allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,inert:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0},Ve={"accent-height":"accentHeight","alignment-baseline":"alignmentBaseline","baseline-shift":"baselineShift","clip-path":"clipPath","clip-rule":"clipRule","color-interpolation":"colorInterpolation","color-interpolation-filters":"colorInterpolationFilters","dominant-baseline":"dominantBaseline","enable-background":"enableBackground","fill-opacity":"fillOpacity","fill-rule":"fillRule","flood-color":"floodColor","flood-opacity":"floodOpacity","glyph-orientation-horizontal":"glyphOrientationHorizontal","glyph-orientation-vertical":"glyphOrientationVertical","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-variant":"fontVariant","font-weight":"fontWeight","image-rendering":"imageRendering","letter-spacing":"letterSpacing","lighting-color":"lightingColor","marker-end":"markerEnd","marker-mid":"markerMid","marker-start":"markerStart","paint-order":"paintOrder","pointer-events":"pointerEvents","shape-rendering":"shapeRendering","stop-color":"stopColor","stop-opacity":"stopOpacity","stroke-dasharray":"strokeDasharray","stroke-dashoffset":"strokeDashoffset","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","stroke-miterlimit":"strokeMiterlimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","text-anchor":"textAnchor","text-decoration":"textDecoration","text-rendering":"textRendering","transform-origin":"transformOrigin","word-spacing":"wordSpacing","writing-mode":"writingMode","xlink:href":"xlinkHref","xlink:title":"xlinkTitle","xml:lang":"xmlLang","xml:space":"xmlSpace"};function E(n,e,t){if(e==="class"){n.className=t==null?"":String(t);return}if(e==="style"){if(typeof t=="string")n.style.cssText=t;else if(t!=null&&typeof t=="object")for(let r in t)n.style[r]=t[r];else n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let r=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase();typeof t=="function"&&n.addEventListener(r,t);return}if(e in oe){t?(n.setAttribute(e,""),e in n&&(n[e]=!0)):(n.removeAttribute(e),e in n&&(n[e]=!1));return}let o=ne[e]||e;if(o in n){try{n[o]=t==null?"":t}catch(r){n.setAttribute(e,t==null?"":String(t))}return}t==null||t===!1?n.removeAttribute(e):n.setAttribute(e,String(t))}function h(n,e){if(e==="class"){n.className="";return}if(e==="style"){n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let o=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase(),r=n._vei;if(r){let i="on"+o.charAt(0).toUpperCase()+o.slice(1),s=r[i];s&&(n.removeEventListener(o,s),r[i]=void 0)}return}if(e in oe){n.removeAttribute(e),e in n&&(n[e]=!1);return}let t=ne[e]||e;if(t in n){try{n[t]=""}catch(o){n.removeAttribute(e)}return}n.removeAttribute(e)}function te(n){return n.startsWith("on")||n.startsWith("@")}function re(n,e,t){let o=e?Object.keys(e):[],r=t?Object.keys(t):[];for(let i=0;i<r.length;i++){let s=r[i],a=t[s],c=e?e[s]:void 0;s==="key"||s==="ref"||a!==c&&(s==="class"?n.className=a==null?"":String(a):s==="style"?Ae(n,a,c):te(s)||E(n,s,a))}for(let i=0;i<o.length;i++){let s=o[i];s==="key"||s==="ref"||(!t||!(s in t))&&(s==="class"?n.className="":s==="style"?n.style.cssText="":te(s)||h(n,s))}}function Ae(n,e,t){if(!e||typeof e=="string"&&!e.trim()){n.style.cssText="";return}if(typeof e=="string"){n.style.cssText=e;return}if(typeof t=="object"&&t!==null)for(let o in t)o in e||(n.style[o]="");for(let o in e)n.style[o]=e[o]}function _(n){return n==="svg"||n==="path"||n==="circle"||n==="rect"||n==="line"||n==="polyline"||n==="polygon"||n==="ellipse"||n==="g"||n==="defs"||n==="use"||n==="text"||n==="tspan"||n==="clipPath"||n==="mask"||n==="filter"||n==="linearGradient"||n==="radialGradient"||n==="stop"||n==="pattern"||n==="symbol"||n==="image"||n==="foreignObject"||n==="animate"||n==="animateTransform"||n==="animateMotion"}function ie(n){return Ve[n]||n}var be=/^(?:@|on)/;function I(n){return n.replace(be,"").toLowerCase()}function G(n){let e=I(n);return"on"+e.charAt(0).toUpperCase()+e.slice(1)}var Se={stop:"stop",prevent:"prevent",capture:"capture",once:"once",self:"self",passive:"passive"};function B(n){let e=n.split("."),o={name:e[0],stop:!1,prevent:!1,capture:!1,once:!1,self:!1,passive:!1};for(let r=1;r<e.length;r++){let i=e[r],s=Se[i];s&&(o[s]=!0)}return o}function X(n){let e=(t=>{e.value&&e.value(t)});return e.value=n,e}var g="_vei";function se(n){return n[g]||null}function L(n,e,t,o,r){let i=G(e),s=B(I(e)),a=s.name,c=n[g];c||(c=n[g]={});let f=c[i];if(t&&f)f.value=t;else if(t&&!f){let p=X(t);c[i]=p;let d={};s.capture&&(d.capture=!0),s.once&&(d.once=!0),s.passive&&(d.passive=!0),n.addEventListener(a,p,d)}else!t&&f&&(n.removeEventListener(a,f),c[i]=void 0)}function D(n){let e=n[g];if(e){for(let t in e){let o=e[t];if(o){let r=t.charAt(2).toLowerCase()+t.slice(3);n.removeEventListener(r,o)}}n[g]={}}}var z=(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))(z||{});function v(n,e,t){let o=ce(e);o!==t&&(n.className=o)}function ce(n){if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="object"){if(Array.isArray(n)){let t="";for(let o=0;o<n.length;o++){let r=ce(n[o]);r&&(t+=(t?" ":"")+r)}return t}let e="";for(let t in n)n[t]&&(e+=(e?" ":"")+t);return e}return String(n)}function N(n,e,t){if(!e){n.style.cssText="";return}if(!t){typeof e=="string"?n.style.cssText=e:typeof e=="object"&&ae(n,e);return}if(typeof e!=typeof t){n.style.cssText="",typeof e=="string"?n.style.cssText=e:typeof e=="object"&&ae(n,e);return}if(typeof e=="string"){e!==t&&(n.style.cssText=e);return}if(typeof e=="object"&&typeof t=="object"){for(let o in t)o in e||(n.style[o]="");for(let o in e){let r=e[o],i=t[o];r!==i&&(n.style[o]=r==null?"":r)}}}function ae(n,e){for(let t in e)n.style[t]=e[t]===null||e[t]===void 0?"":e[t]}function le(n,e,t,o){L(n,"",e,t,o)}var Oe=new Set(["class","style","key","ref"]);function _e(n){return n.length>2&&(n[0]==="o"||n[0]==="O"||n[0]==="@")&&(n[1]==="n"||n[1]==="N")}function w(n,e,t,o,r){if(!Oe.has(e)){if(e==="class"){v(n,t,o);return}if(e==="style"){N(n,t,o);return}if(_e(e)){L(n,e,t,o,r);return}if(t===!1||t===null||t===void 0){n.removeAttribute(e);return}if(e in n)try{n[e]=t}catch(i){n.setAttribute(e,String(t))}else n.setAttribute(e,String(t))}}function y(n,e,t,o,r){w(n,e,t,o,r)}function T(n,e,t,o){if(t)for(let r in t){if(r==="key"||r==="ref")continue;let i=t[r],s=e?e[r]:void 0;i!==s&&y(n,r,i,s,o)}if(e)for(let r in e)r==="key"||r==="ref"||(!t||!(r in t))&&y(n,r,null,e[r],o)}function fe(n,e,t,o){let r=e.props||{},i=t.props||{},{patchFlag:s,dynamicProps:a}=t;if(!s||s===-1){T(n,r,i,o);return}if(s===-2){T(n,r,i,o);return}if(s&1&&e.children!==t.children&&(n.textContent=t.children),s&2&&r.class!==i.class&&v(n,i.class,r.class),s&4&&r.style!==i.style&&N(n,i.style,r.style),s&8&&a)for(let c=0;c<a.length;c++){let f=a[c],p=r[f],d=i[f];d!==p&&y(n,f,d,p,o)}s&16&&T(n,r,i,o)}var C=class{createElement(e){return _(e)?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}createText(e){return document.createTextNode(e)}createComment(e){return document.createComment(e)}setAttribute(e,t,o){E(e,t,o)}removeAttribute(e,t){h(e,t)}setStyle(e,t){if(typeof t=="string")e.style.cssText=t;else if(t&&typeof t=="object")for(let o in t)e.style[o]=t[o]}setClass(e,t){if(typeof t=="string")e.className=t;else if(t&&typeof t=="object"){let o="";for(let r in t)t[r]&&(o+=(o?" ":"")+r);e.className=o}else e.className=""}insert(e,t,o){o!=null?e.insertBefore(t,o):e.appendChild(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}replace(e,t,o){e.replaceChild(o,t)}addEventListener(e,t,o,r){e.addEventListener(t,o,r)}removeEventListener(e,t,o){e.removeEventListener(t,o)}nextTick(e){Promise.resolve().then(e)}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}querySelector(e){return document.querySelector(e)}setClassWithOld(e,t,o){v(e,t,o)}setStyleWithOld(e,t,o){N(e,t,o)}setAttributeWithOld(e,t,o,r){y(e,t,o,r)}setElementText(e,t){e.textContent=t}setText(e,t){e.nodeValue=t}insertBefore(e,t,o){o!=null?e.insertBefore(t,o):e.appendChild(t)}removeChild(e,t){e.removeChild(t)}setAnchor(e,t){e.anchor=t}getNextSibling(e){return e.nextSibling}cleanupEvents(e){D(e)}},pe=new C;
|
|
1
|
+
"use strict";var P=Object.defineProperty;var pe=Object.getOwnPropertyDescriptor;var ue=Object.getOwnPropertyNames;var ye=Object.prototype.hasOwnProperty;var me=(n,e)=>{for(var t in e)P(n,t,{get:e[t],enumerable:!0})},ve=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ue(e))!ye.call(n,r)&&r!==t&&P(n,r,{get:()=>e[r],enumerable:!(o=pe(e,r))||o.enumerable});return n};var he=n=>ve(P({},"__esModule",{value:!0}),n);var we={};me(we,{Comment:()=>W,DOMRenderer:()=>T,Fragment:()=>D,PatchFlags:()=>R,PatchPropFlags:()=>u.PatchFlags,ShapeFlags:()=>m,Text:()=>M,createInvoker:()=>Y,createRenderer:()=>ee,domRenderer:()=>de,getEventInvokers:()=>se,getEventKey:()=>B,getSVGPropName:()=>ie,isSVGElement:()=>w,normalizeEventName:()=>_,parseEventModifier:()=>G,patchAllProps:()=>C,patchClass:()=>L,patchDOMProp:()=>z,patchDOMProps:()=>re,patchElementProps:()=>fe,patchEvent:()=>g,patchEventOnElement:()=>le,patchProp:()=>y,patchStyle:()=>x,removeAllEventListeners:()=>I,removeDOMProp:()=>N,setDOMProp:()=>h});module.exports=he(we);var Z=require("@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||{}),R=(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))(R||{}),D=Symbol("Fragment"),M=Symbol("Text"),W=Symbol("Comment");function v(n){return n.type===D}function V(n){return n.type===M}function b(n){return n.type===W}function q(n,e){return n.type===e.type&&n.key===e.key}function K(n){return Array.isArray(n.dynamicChildren)}function $(n,e,t,o){if(t==="class")n.setClass(e,o);else if(t==="style")n.setStyle(e,o);else if(t.startsWith("on")||t.startsWith("@")){let r=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();n.addEventListener(e,r,o)}else t==="key"||t==="ref"||n.setAttribute(e,t,o)}function j(n,e,t,o,r){if(t==="class")n.setClass(e,o);else if(t==="style")n.setStyle(e,o||{});else if(t.startsWith("on")||t.startsWith("@")){let i=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();r&&n.removeEventListener(e,i,r),o&&n.addEventListener(e,i,o)}else n.setAttribute(e,t,o)}function H(n,e,t,o){for(let r in o){if(r==="key"||r==="ref")continue;let i=t[r],s=o[r];s!==i&&j(n,e,r,s,i)}for(let r in t)if(!(r==="key"||r==="ref")&&!(r in o))if(r==="class")n.setClass(e,"");else if(r==="style")n.setStyle(e,{});else if(r.startsWith("on")||r.startsWith("@")){let i=r.startsWith("@")?r.slice(1).toLowerCase():r.slice(2).toLowerCase();n.removeEventListener(e,i,t[r])}else n.removeAttribute(e,r)}function F(n,e,t,o,r,i){let{shapeFlag:s}=t;if(v(t)){Ee(n,e,t,o,r,i);return}if(V(t)){let a=n.createText(t.children);t.el=a,n.insert(o,a,r);return}if(b(t)){let a=n.createComment(t.children);t.el=a,n.insert(o,a,r);return}if(s&1){Ne(n,e,t,o,r,i);return}if(s&6){ge(e,t,o,r,i);return}}function Ne(n,e,t,o,r,i){let s=t.type,a=n.createElement(s);if(t.el=a,t.props)for(let d in t.props){let p=t.props[d];$(n,a,d,p)}let{shapeFlag:c,children:f}=t;c&8?a.textContent=f:c&16&&A(e,f,a,null,i),n.insert(o,a,r)}function A(n,e,t,o,r){for(let i=0;i<e.length;i++)n(null,e[i],t,o,r)}function Ee(n,e,t,o,r,i){let{children:s}=t,a=n.createComment("");n.insert(o,a,r),Array.isArray(s)&&s.length>0&&A(e,s,o,a,i),t.el=a,t.anchor=a}function ge(n,e,t,o,r){let i=e.component;i&&i.update&&i.update(),i&&i.subTree&&(n(null,i.subTree,t,o,i),e.el=i.subTree.el)}function J(n,e,t,o){let{shapeFlag:r,children:i}=t;if(v(t)){if(Array.isArray(i))for(let s=0;s<i.length;s++)e(i[s],o);t.anchor&&t.anchor.parentNode&&n.remove(t.anchor);return}if(r&6){t.component&&t.component.subTree&&e(t.component.subTree,o);return}t.el&&n.remove(t.el)}function O(n,e){for(let t=0;t<e.length;t++)n(e[t])}var k=require("@lytjs/vdom");function S(n,e,t,o,r,i=null,s=null){if(o==null){t&&e(t,r);return}if(t===null){F(n,U(n,e),o,r,i,s);return}if(K(o)&&K(t)){Te(n,e,t,o,r,s);return}if(!q(t,o)){e(t,r),F(n,U(n,e),o,r,i,s);return}o.el=t.el,o.anchor=t.anchor;let{shapeFlag:a}=o;if(v(o)){xe(n,e,t,o,r,i,s);return}if(V(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(b(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(a&1){Ce(n,e,t,o,s);return}if(a&6){Re(t,o,s);return}}function U(n,e){return(t,o,r,i,s)=>{S(n,e,t,o,r,i,s)}}function Ce(n,e,t,o,r=null){let i=o.el=t.el,s=t.props||{},a=o.props||{},{patchFlag:c,dynamicProps:f}=o;if(c&&c>0){if(c&1&&t.children!==o.children&&(i.textContent=o.children),c&2&&s.class!==a.class&&n.setClass(i,a.class),c&4&&s.style!==a.style&&n.setStyle(i,a.style||{}),c&8&&f)for(let d=0;d<f.length;d++){let p=f[d],l=s[p],X=a[p];X!==l&&j(n,i,p,X,l)}c&16&&H(n,i,s,a)}else H(n,i,s,a);(!c||!(c&1))&&Q(n,e,t,o,i,null,r)}function Q(n,e,t,o,r,i,s){let a=t.shapeFlag,c=o.shapeFlag,f=t.children,d=o.children;if(c&8){a&16&&O(e,f),f!==d&&(r.textContent=d);return}if(c&16){a&16?Le(n,e,f,d,r,i,s):(a&8&&(r.textContent=""),A(U(n,e),d,r,i,s));return}d==null&&(a&8?r.textContent="":a&16&&O(e,f))}function Le(n,e,t,o,r,i,s){o.every(c=>c.key!==null&&c.key!==void 0)&&t.every(c=>c.key!==null&&c.key!==void 0)?(0,k.patchKeyedChildren)(t,o,r,i,s,null,!1):(0,k.patchUnkeyedChildren)(t,o,r,i,s,null,!1)}function xe(n,e,t,o,r,i,s){let a=t.children,c=o.children;Array.isArray(c)&&c.length>0?(Q(n,e,t,o,r,i,s),o.el=c[0].el,o.anchor=c[c.length-1].el?n.nextSibling(c[c.length-1].el):i):Array.isArray(a)&&a.length>0&&c===null?(O(e,a),o.el=t.el,o.anchor=t.anchor):(o.el=t.el,o.anchor=t.anchor)}function Te(n,e,t,o,r,i){let s=t.dynamicChildren,a=o.dynamicChildren;for(let c=0;c<a.length;c++)S(n,e,s[c],a[c],r,null,i)}function Re(n,e,t){e.component=n.component,e.el=n.el,e.component&&e.component.update&&e.component.update()}function ee(n){function e(r,i){J(n,e,r,i)}(0,Z.registerDOMOperations)({insert(r,i,s){n.insert(i,r,s)},createElement(r){return n.createElement(r)},createText(r){return n.createText(r)},setText(r,i){r.nodeValue=i},setElementText(r,i){r.textContent=i},remove(r){n.remove(r)},createComment(r){return n.createComment(r)},mount(r,i,s,a,c,f,d){o(null,r,i,s,a)},patch(r,i,s,a,c,f,d,p){o(r,i,s,a,c)},unmount(r,i,s,a){e(r)},move(r,i,s){n.insert(i,r.el,s)}});function o(r,i,s,a,c){S(n,e,r,i,s,a,c)}return{mount(r,i){i.nodeType===1&&(i.textContent=""),o(null,r,i,null,null)},patch(r,i,s){var a;o(r,i,s||((a=r.el)==null?void 0:a.parentNode),null,null)},unmount(r,i){e(r,i)}}}var ne={acceptCharset:"acceptCharset",accessKey:"accessKey",className:"className",htmlFor:"htmlFor",httpEquiv:"httpEquiv",tabIndex:"tabIndex"},oe={allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,inert:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0},Ve={"accent-height":"accentHeight","alignment-baseline":"alignmentBaseline","baseline-shift":"baselineShift","clip-path":"clipPath","clip-rule":"clipRule","color-interpolation":"colorInterpolation","color-interpolation-filters":"colorInterpolationFilters","dominant-baseline":"dominantBaseline","enable-background":"enableBackground","fill-opacity":"fillOpacity","fill-rule":"fillRule","flood-color":"floodColor","flood-opacity":"floodOpacity","glyph-orientation-horizontal":"glyphOrientationHorizontal","glyph-orientation-vertical":"glyphOrientationVertical","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-variant":"fontVariant","font-weight":"fontWeight","image-rendering":"imageRendering","letter-spacing":"letterSpacing","lighting-color":"lightingColor","marker-end":"markerEnd","marker-mid":"markerMid","marker-start":"markerStart","paint-order":"paintOrder","pointer-events":"pointerEvents","shape-rendering":"shapeRendering","stop-color":"stopColor","stop-opacity":"stopOpacity","stroke-dasharray":"strokeDasharray","stroke-dashoffset":"strokeDashoffset","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","stroke-miterlimit":"strokeMiterlimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","text-anchor":"textAnchor","text-decoration":"textDecoration","text-rendering":"textRendering","transform-origin":"transformOrigin","word-spacing":"wordSpacing","writing-mode":"writingMode","xlink:href":"xlinkHref","xlink:title":"xlinkTitle","xml:lang":"xmlLang","xml:space":"xmlSpace"};function h(n,e,t){if(e==="class"){n.className=t==null?"":String(t);return}if(e==="style"){if(typeof t=="string")n.style.cssText=t;else if(t!=null&&typeof t=="object")for(let r in t)n.style[r]=t[r];else n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let r=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase();typeof t=="function"&&n.addEventListener(r,t);return}if(e in oe){t?(n.setAttribute(e,""),e in n&&(n[e]=!0)):(n.removeAttribute(e),e in n&&(n[e]=!1));return}let o=ne[e]||e;if(o in n){try{n[o]=t==null?"":t}catch(r){n.setAttribute(e,t==null?"":String(t))}return}t==null||t===!1?n.removeAttribute(e):n.setAttribute(e,String(t))}function N(n,e){if(e==="class"){n.className="";return}if(e==="style"){n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let o=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase(),r=n._vei;if(r){let i="on"+o.charAt(0).toUpperCase()+o.slice(1),s=r[i];s&&(n.removeEventListener(o,s),r[i]=void 0)}return}if(e in oe){n.removeAttribute(e),e in n&&(n[e]=!1);return}let t=ne[e]||e;if(t in n){try{n[t]=""}catch(o){n.removeAttribute(e)}return}n.removeAttribute(e)}function te(n){return n.startsWith("on")||n.startsWith("@")}function re(n,e,t){let o=e?Object.keys(e):[],r=t?Object.keys(t):[];for(let i=0;i<r.length;i++){let s=r[i],a=t[s],c=e?e[s]:void 0;s==="key"||s==="ref"||a!==c&&(s==="class"?n.className=a==null?"":String(a):s==="style"?be(n,a,c):te(s)||h(n,s,a))}for(let i=0;i<o.length;i++){let s=o[i];s==="key"||s==="ref"||(!t||!(s in t))&&(s==="class"?n.className="":s==="style"?n.style.cssText="":te(s)||N(n,s))}}function be(n,e,t){if(!e||typeof e=="string"&&!e.trim()){n.style.cssText="";return}if(typeof e=="string"){n.style.cssText=e;return}if(typeof t=="object"&&t!==null)for(let o in t)o in e||(n.style[o]="");for(let o in e)n.style[o]=e[o]}function w(n){return n==="svg"||n==="path"||n==="circle"||n==="rect"||n==="line"||n==="polyline"||n==="polygon"||n==="ellipse"||n==="g"||n==="defs"||n==="use"||n==="text"||n==="tspan"||n==="clipPath"||n==="mask"||n==="filter"||n==="linearGradient"||n==="radialGradient"||n==="stop"||n==="pattern"||n==="symbol"||n==="image"||n==="foreignObject"||n==="animate"||n==="animateTransform"||n==="animateMotion"}function ie(n){return Ve[n]||n}var Ae=/^(?:@|on)/;function _(n){return n.replace(Ae,"").toLowerCase()}function B(n){let e=_(n);return"on"+e.charAt(0).toUpperCase()+e.slice(1)}var Oe={stop:"stop",prevent:"prevent",capture:"capture",once:"once",self:"self",passive:"passive"};function G(n){let e=n.split("."),o={name:e[0],stop:!1,prevent:!1,capture:!1,once:!1,self:!1,passive:!1};for(let r=1;r<e.length;r++){let i=e[r],s=Oe[i];s&&(o[s]=!0)}return o}function Y(n){let e=(t=>{e.value&&e.value(t)});return e.value=n,e}var E="_vei";function se(n){return n[E]||null}function g(n,e,t,o,r){let i=B(e),s=G(_(e)),a=s.name,c=n[E];c||(c=n[E]={});let f=c[i];if(t&&f)f.value=t;else if(t&&!f){let d=Y(t);c[i]=d;let p={};s.capture&&(p.capture=!0),s.once&&(p.once=!0),s.passive&&(p.passive=!0),n.addEventListener(a,d,p)}else!t&&f&&(n.removeEventListener(a,f),c[i]=void 0)}function I(n){let e=n[E];if(e){for(let t in e){let o=e[t];if(o){let r=t.charAt(2).toLowerCase()+t.slice(3);n.removeEventListener(r,o)}}n[E]={}}}var u=require("@lytjs/vdom");function L(n,e,t){let o=ce(e);o!==t&&(n.className=o)}function ce(n){if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="object"){if(Array.isArray(n)){let t="";for(let o=0;o<n.length;o++){let r=ce(n[o]);r&&(t+=(t?" ":"")+r)}return t}let e="";for(let t in n)n[t]&&(e+=(e?" ":"")+t);return e}return String(n)}function x(n,e,t){if(!e){n.style.cssText="";return}if(!t){typeof e=="string"?n.style.cssText=e:typeof e=="object"&&ae(n,e);return}if(typeof e!=typeof t){n.style.cssText="",typeof e=="string"?n.style.cssText=e:typeof e=="object"&&ae(n,e);return}if(typeof e=="string"){e!==t&&(n.style.cssText=e);return}if(typeof e=="object"&&typeof t=="object"){for(let o in t)o in e||(n.style[o]="");for(let o in e){let r=e[o],i=t[o];r!==i&&(n.style[o]=r==null?"":r)}}}function ae(n,e){for(let t in e)n.style[t]=e[t]===null||e[t]===void 0?"":e[t]}function le(n,e,t,o){g(n,"",e,t,o)}var ke=new Set(["class","style","key","ref"]);function Se(n){return n.length>2&&(n[0]==="o"||n[0]==="O"||n[0]==="@")&&(n[1]==="n"||n[1]==="N")}function z(n,e,t,o,r){if(!ke.has(e)){if(Se(e)){g(n,e,t,o,r);return}if(t===!1||t===null||t===void 0){n.removeAttribute(e);return}if(e in n)try{n[e]=t}catch(i){n.setAttribute(e,String(t))}else n.setAttribute(e,String(t))}}function y(n,e,t,o,r){z(n,e,t,o,r)}function C(n,e,t,o){if(t)for(let r in t){if(r==="key"||r==="ref")continue;let i=t[r],s=e?e[r]:void 0;i!==s&&y(n,r,i,s,o)}if(e)for(let r in e)r==="key"||r==="ref"||(!t||!(r in t))&&y(n,r,null,e[r],o)}function fe(n,e,t,o){let r=e.props||{},i=t.props||{},{patchFlag:s,dynamicProps:a}=t;if(!s||s===u.PatchFlags.HOISTED){C(n,r,i,o);return}if(s===u.PatchFlags.BAIL){C(n,r,i,o);return}if(s&u.PatchFlags.TEXT&&e.children!==t.children&&(n.textContent=t.children),s&u.PatchFlags.CLASS&&r.class!==i.class&&L(n,i.class,r.class),s&u.PatchFlags.STYLE&&r.style!==i.style&&x(n,i.style,r.style),s&u.PatchFlags.PROPS&&a)for(let c=0;c<a.length;c++){let f=a[c],d=r[f],p=i[f];p!==d&&y(n,f,p,d,o)}s&u.PatchFlags.FULL_PROPS&&C(n,r,i,o)}var T=class{createElement(e){return w(e)?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}createText(e){return document.createTextNode(e)}createComment(e){return document.createComment(e)}setAttribute(e,t,o){h(e,t,o)}removeAttribute(e,t){N(e,t)}setStyle(e,t){if(typeof t=="string")e.style.cssText=t;else if(t&&typeof t=="object")for(let o in t)e.style[o]=t[o]}setClass(e,t){if(typeof t=="string")e.className=t;else if(t&&typeof t=="object"){let o="";for(let r in t)t[r]&&(o+=(o?" ":"")+r);e.className=o}else e.className=""}insert(e,t,o){o!=null?e.insertBefore(t,o):e.appendChild(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}replace(e,t,o){e.replaceChild(o,t)}addEventListener(e,t,o,r){e.addEventListener(t,o,r)}removeEventListener(e,t,o){e.removeEventListener(t,o)}nextTick(e){Promise.resolve().then(e)}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}querySelector(e){return document.querySelector(e)}setClassWithOld(e,t,o){L(e,t,o)}setStyleWithOld(e,t,o){x(e,t,o)}setAttributeWithOld(e,t,o,r){y(e,t,o,r)}setElementText(e,t){e.textContent=t}setText(e,t){e.nodeValue=t}insertBefore(e,t,o){o!=null?e.insertBefore(t,o):e.appendChild(t)}removeChild(e,t){e.removeChild(t)}setAnchor(e,t){e.anchor=t}getNextSibling(e){return e.nextSibling}cleanupEvents(e){I(e)}},de=new T;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{registerDOMOperations as de}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||{}),S=(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))(S||{}),H=Symbol("Fragment"),j=Symbol("Text"),U=Symbol("Comment");function y(n){return n.type===H}function h(n){return n.type===j}function g(n){return n.type===U}function Y(n,e){return n.type===e.type&&n.key===e.key}function O(n){return Array.isArray(n.dynamicChildren)}function G(n,e,t,o){if(t==="class")n.setClass(e,o);else if(t==="style")n.setStyle(e,o);else if(t.startsWith("on")||t.startsWith("@")){let r=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();n.addEventListener(e,r,o)}else t==="key"||t==="ref"||n.setAttribute(e,t,o)}function _(n,e,t,o,r){if(t==="class")n.setClass(e,o);else if(t==="style")n.setStyle(e,o||{});else if(t.startsWith("on")||t.startsWith("@")){let i=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();r&&n.removeEventListener(e,i,r),o&&n.addEventListener(e,i,o)}else n.setAttribute(e,t,o)}function I(n,e,t,o){for(let r in o){if(r==="key"||r==="ref")continue;let i=t[r],s=o[r];s!==i&&_(n,e,r,s,i)}for(let r in t)if(!(r==="key"||r==="ref")&&!(r in o))if(r==="class")n.setClass(e,"");else if(r==="style")n.setStyle(e,{});else if(r.startsWith("on")||r.startsWith("@")){let i=r.startsWith("@")?r.slice(1).toLowerCase():r.slice(2).toLowerCase();n.removeEventListener(e,i,t[r])}else n.removeAttribute(e,r)}function D(n,e,t,o,r,i){let{shapeFlag:s}=t;if(y(t)){oe(n,e,t,o,r,i);return}if(h(t)){let a=n.createText(t.children);t.el=a,n.insert(o,a,r);return}if(g(t)){let a=n.createComment(t.children);t.el=a,n.insert(o,a,r);return}if(s&1){ne(n,e,t,o,r,i);return}if(s&6){re(e,t,o,r,i);return}}function ne(n,e,t,o,r,i){let s=t.type,a=n.createElement(s);if(t.el=a,t.props)for(let p in t.props){let d=t.props[p];G(n,a,p,d)}let{shapeFlag:c,children:f}=t;c&8?a.textContent=f:c&16&&L(e,f,a,null,i),n.insert(o,a,r)}function L(n,e,t,o,r){for(let i=0;i<e.length;i++)n(null,e[i],t,o,r)}function oe(n,e,t,o,r,i){let{children:s}=t,a=n.createComment("");n.insert(o,a,r),Array.isArray(s)&&s.length>0&&L(e,s,o,a,i),t.el=a,t.anchor=a}function re(n,e,t,o,r){let i=e.component;i&&i.update&&i.update(),i&&i.subTree&&(n(null,i.subTree,t,o,i),e.el=i.subTree.el)}function B(n,e,t,o){let{shapeFlag:r,children:i}=t;if(y(t)){if(Array.isArray(i))for(let s=0;s<i.length;s++)e(i[s],o);t.anchor&&t.anchor.parentNode&&n.remove(t.anchor);return}if(r&6){t.component&&t.component.subTree&&e(t.component.subTree,o);return}t.el&&n.remove(t.el)}function T(n,e){for(let t=0;t<e.length;t++)n(e[t])}import{patchKeyedChildren as ie,patchUnkeyedChildren as se}from"@lytjs/vdom";function C(n,e,t,o,r,i=null,s=null){if(o==null){t&&e(t,r);return}if(t===null){D(n,M(n,e),o,r,i,s);return}if(O(o)&&O(t)){fe(n,e,t,o,r,s);return}if(!Y(t,o)){e(t,r),D(n,M(n,e),o,r,i,s);return}o.el=t.el,o.anchor=t.anchor;let{shapeFlag:a}=o;if(y(o)){le(n,e,t,o,r,i,s);return}if(h(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(g(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(a&1){ae(n,e,t,o,s);return}if(a&6){pe(t,o,s);return}}function M(n,e){return(t,o,r,i,s)=>{C(n,e,t,o,r,i,s)}}function ae(n,e,t,o,r=null){let i=o.el=t.el,s=t.props||{},a=o.props||{},{patchFlag:c,dynamicProps:f}=o;if(c&&c>0){if(c&1&&t.children!==o.children&&(i.textContent=o.children),c&2&&s.class!==a.class&&n.setClass(i,a.class),c&4&&s.style!==a.style&&n.setStyle(i,a.style||{}),c&8&&f)for(let p=0;p<f.length;p++){let d=f[p],l=s[d],W=a[d];W!==l&&_(n,i,d,W,l)}c&16&&I(n,i,s,a)}else I(n,i,s,a);(!c||!(c&1))&&X(n,e,t,o,i,null,r)}function X(n,e,t,o,r,i,s){let a=t.shapeFlag,c=o.shapeFlag,f=t.children,p=o.children;if(c&8){a&16&&T(e,f),f!==p&&(r.textContent=p);return}if(c&16){a&16?ce(n,e,f,p,r,i,s):(a&8&&(r.textContent=""),L(M(n,e),p,r,i,s));return}p==null&&(a&8?r.textContent="":a&16&&T(e,f))}function ce(n,e,t,o,r,i,s){o.every(c=>c.key!==null&&c.key!==void 0)&&t.every(c=>c.key!==null&&c.key!==void 0)?ie(t,o,r,i,s,null,!1):se(t,o,r,i,s,null,!1)}function le(n,e,t,o,r,i,s){let a=t.children,c=o.children;Array.isArray(c)&&c.length>0?(X(n,e,t,o,r,i,s),o.el=c[0].el,o.anchor=c[c.length-1].el?n.nextSibling(c[c.length-1].el):i):Array.isArray(a)&&a.length>0&&c===null?(T(e,a),o.el=t.el,o.anchor=t.anchor):(o.el=t.el,o.anchor=t.anchor)}function fe(n,e,t,o,r,i){let s=t.dynamicChildren,a=o.dynamicChildren;for(let c=0;c<a.length;c++)C(n,e,s[c],a[c],r,null,i)}function pe(n,e,t){e.component=n.component,e.el=n.el,e.component&&e.component.update&&e.component.update()}function ye(n){function e(r,i){B(n,e,r,i)}de({insert(r,i,s){n.insert(i,r,s)},createElement(r){return n.createElement(r)},createText(r){return n.createText(r)},setText(r,i){r.nodeValue=i},setElementText(r,i){r.textContent=i},remove(r){n.remove(r)},createComment(r){return n.createComment(r)},mount(r,i,s,a,c,f,p){o(null,r,i,s,a)},patch(r,i,s,a,c,f,p,d){o(r,i,s,a,c)},unmount(r,i,s,a){e(r)},move(r,i,s){n.insert(i,r.el,s)}});function o(r,i,s,a,c){C(n,e,r,i,s,a,c)}return{mount(r,i){i.nodeType===1&&(i.textContent=""),o(null,r,i,null,null)},patch(r,i,s){var a;o(r,i,s||((a=r.el)==null?void 0:a.parentNode),null,null)},unmount(r,i){e(r,i)}}}var w={acceptCharset:"acceptCharset",accessKey:"accessKey",className:"className",htmlFor:"htmlFor",httpEquiv:"httpEquiv",tabIndex:"tabIndex"},q={allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,inert:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0},ue={"accent-height":"accentHeight","alignment-baseline":"alignmentBaseline","baseline-shift":"baselineShift","clip-path":"clipPath","clip-rule":"clipRule","color-interpolation":"colorInterpolation","color-interpolation-filters":"colorInterpolationFilters","dominant-baseline":"dominantBaseline","enable-background":"enableBackground","fill-opacity":"fillOpacity","fill-rule":"fillRule","flood-color":"floodColor","flood-opacity":"floodOpacity","glyph-orientation-horizontal":"glyphOrientationHorizontal","glyph-orientation-vertical":"glyphOrientationVertical","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-variant":"fontVariant","font-weight":"fontWeight","image-rendering":"imageRendering","letter-spacing":"letterSpacing","lighting-color":"lightingColor","marker-end":"markerEnd","marker-mid":"markerMid","marker-start":"markerStart","paint-order":"paintOrder","pointer-events":"pointerEvents","shape-rendering":"shapeRendering","stop-color":"stopColor","stop-opacity":"stopOpacity","stroke-dasharray":"strokeDasharray","stroke-dashoffset":"strokeDashoffset","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","stroke-miterlimit":"strokeMiterlimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","text-anchor":"textAnchor","text-decoration":"textDecoration","text-rendering":"textRendering","transform-origin":"transformOrigin","word-spacing":"wordSpacing","writing-mode":"writingMode","xlink:href":"xlinkHref","xlink:title":"xlinkTitle","xml:lang":"xmlLang","xml:space":"xmlSpace"};function x(n,e,t){if(e==="class"){n.className=t==null?"":String(t);return}if(e==="style"){if(typeof t=="string")n.style.cssText=t;else if(t!=null&&typeof t=="object")for(let r in t)n.style[r]=t[r];else n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let r=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase();typeof t=="function"&&n.addEventListener(r,t);return}if(e in q){t?(n.setAttribute(e,""),e in n&&(n[e]=!0)):(n.removeAttribute(e),e in n&&(n[e]=!1));return}let o=w[e]||e;if(o in n){try{n[o]=t==null?"":t}catch(r){n.setAttribute(e,t==null?"":String(t))}return}t==null||t===!1?n.removeAttribute(e):n.setAttribute(e,String(t))}function R(n,e){if(e==="class"){n.className="";return}if(e==="style"){n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let o=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase(),r=n._vei;if(r){let i="on"+o.charAt(0).toUpperCase()+o.slice(1),s=r[i];s&&(n.removeEventListener(o,s),r[i]=void 0)}return}if(e in q){n.removeAttribute(e),e in n&&(n[e]=!1);return}let t=w[e]||e;if(t in n){try{n[t]=""}catch(o){n.removeAttribute(e)}return}n.removeAttribute(e)}function z(n){return n.startsWith("on")||n.startsWith("@")}function me(n,e,t){let o=e?Object.keys(e):[],r=t?Object.keys(t):[];for(let i=0;i<r.length;i++){let s=r[i],a=t[s],c=e?e[s]:void 0;s==="key"||s==="ref"||a!==c&&(s==="class"?n.className=a==null?"":String(a):s==="style"?ve(n,a,c):z(s)||x(n,s,a))}for(let i=0;i<o.length;i++){let s=o[i];s==="key"||s==="ref"||(!t||!(s in t))&&(s==="class"?n.className="":s==="style"?n.style.cssText="":z(s)||R(n,s))}}function ve(n,e,t){if(!e||typeof e=="string"&&!e.trim()){n.style.cssText="";return}if(typeof e=="string"){n.style.cssText=e;return}if(typeof t=="object"&&t!==null)for(let o in t)o in e||(n.style[o]="");for(let o in e)n.style[o]=e[o]}function P(n){return n==="svg"||n==="path"||n==="circle"||n==="rect"||n==="line"||n==="polyline"||n==="polygon"||n==="ellipse"||n==="g"||n==="defs"||n==="use"||n==="text"||n==="tspan"||n==="clipPath"||n==="mask"||n==="filter"||n==="linearGradient"||n==="radialGradient"||n==="stop"||n==="pattern"||n==="symbol"||n==="image"||n==="foreignObject"||n==="animate"||n==="animateTransform"||n==="animateMotion"}function Ne(n){return ue[n]||n}var Ee=/^(?:@|on)/;function k(n){return n.replace(Ee,"").toLowerCase()}function F(n){let e=k(n);return"on"+e.charAt(0).toUpperCase()+e.slice(1)}var he={stop:"stop",prevent:"prevent",capture:"capture",once:"once",self:"self",passive:"passive"};function J(n){let e=n.split("."),o={name:e[0],stop:!1,prevent:!1,capture:!1,once:!1,self:!1,passive:!1};for(let r=1;r<e.length;r++){let i=e[r],s=he[i];s&&(o[s]=!0)}return o}function Q(n){let e=(t=>{e.value&&e.value(t)});return e.value=n,e}var v="_vei";function ge(n){return n[v]||null}function V(n,e,t,o,r){let i=F(e),s=J(k(e)),a=s.name,c=n[v];c||(c=n[v]={});let f=c[i];if(t&&f)f.value=t;else if(t&&!f){let p=Q(t);c[i]=p;let d={};s.capture&&(d.capture=!0),s.once&&(d.once=!0),s.passive&&(d.passive=!0),n.addEventListener(a,p,d)}else!t&&f&&(n.removeEventListener(a,f),c[i]=void 0)}function K(n){let e=n[v];if(e){for(let t in e){let o=e[t];if(o){let r=t.charAt(2).toLowerCase()+t.slice(3);n.removeEventListener(r,o)}}n[v]={}}}var $=(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))($||{});function N(n,e,t){let o=ee(e);o!==t&&(n.className=o)}function ee(n){if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="object"){if(Array.isArray(n)){let t="";for(let o=0;o<n.length;o++){let r=ee(n[o]);r&&(t+=(t?" ":"")+r)}return t}let e="";for(let t in n)n[t]&&(e+=(e?" ":"")+t);return e}return String(n)}function E(n,e,t){if(!e){n.style.cssText="";return}if(!t){typeof e=="string"?n.style.cssText=e:typeof e=="object"&&Z(n,e);return}if(typeof e!=typeof t){n.style.cssText="",typeof e=="string"?n.style.cssText=e:typeof e=="object"&&Z(n,e);return}if(typeof e=="string"){e!==t&&(n.style.cssText=e);return}if(typeof e=="object"&&typeof t=="object"){for(let o in t)o in e||(n.style[o]="");for(let o in e){let r=e[o],i=t[o];r!==i&&(n.style[o]=r==null?"":r)}}}function Z(n,e){for(let t in e)n.style[t]=e[t]===null||e[t]===void 0?"":e[t]}function Le(n,e,t,o){V(n,"",e,t,o)}var Te=new Set(["class","style","key","ref"]);function Ce(n){return n.length>2&&(n[0]==="o"||n[0]==="O"||n[0]==="@")&&(n[1]==="n"||n[1]==="N")}function te(n,e,t,o,r){if(!Te.has(e)){if(e==="class"){N(n,t,o);return}if(e==="style"){E(n,t,o);return}if(Ce(e)){V(n,e,t,o,r);return}if(t===!1||t===null||t===void 0){n.removeAttribute(e);return}if(e in n)try{n[e]=t}catch(i){n.setAttribute(e,String(t))}else n.setAttribute(e,String(t))}}function u(n,e,t,o,r){te(n,e,t,o,r)}function A(n,e,t,o){if(t)for(let r in t){if(r==="key"||r==="ref")continue;let i=t[r],s=e?e[r]:void 0;i!==s&&u(n,r,i,s,o)}if(e)for(let r in e)r==="key"||r==="ref"||(!t||!(r in t))&&u(n,r,null,e[r],o)}function xe(n,e,t,o){let r=e.props||{},i=t.props||{},{patchFlag:s,dynamicProps:a}=t;if(!s||s===-1){A(n,r,i,o);return}if(s===-2){A(n,r,i,o);return}if(s&1&&e.children!==t.children&&(n.textContent=t.children),s&2&&r.class!==i.class&&N(n,i.class,r.class),s&4&&r.style!==i.style&&E(n,i.style,r.style),s&8&&a)for(let c=0;c<a.length;c++){let f=a[c],p=r[f],d=i[f];d!==p&&u(n,f,d,p,o)}s&16&&A(n,r,i,o)}var b=class{createElement(e){return P(e)?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}createText(e){return document.createTextNode(e)}createComment(e){return document.createComment(e)}setAttribute(e,t,o){x(e,t,o)}removeAttribute(e,t){R(e,t)}setStyle(e,t){if(typeof t=="string")e.style.cssText=t;else if(t&&typeof t=="object")for(let o in t)e.style[o]=t[o]}setClass(e,t){if(typeof t=="string")e.className=t;else if(t&&typeof t=="object"){let o="";for(let r in t)t[r]&&(o+=(o?" ":"")+r);e.className=o}else e.className=""}insert(e,t,o){o!=null?e.insertBefore(t,o):e.appendChild(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}replace(e,t,o){e.replaceChild(o,t)}addEventListener(e,t,o,r){e.addEventListener(t,o,r)}removeEventListener(e,t,o){e.removeEventListener(t,o)}nextTick(e){Promise.resolve().then(e)}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}querySelector(e){return document.querySelector(e)}setClassWithOld(e,t,o){N(e,t,o)}setStyleWithOld(e,t,o){E(e,t,o)}setAttributeWithOld(e,t,o,r){u(e,t,o,r)}setElementText(e,t){e.textContent=t}setText(e,t){e.nodeValue=t}insertBefore(e,t,o){o!=null?e.insertBefore(t,o):e.appendChild(t)}removeChild(e,t){e.removeChild(t)}setAnchor(e,t){e.anchor=t}getNextSibling(e){return e.nextSibling}cleanupEvents(e){K(e)}},Re=new b;export{U as Comment,b as DOMRenderer,H as Fragment,S as PatchFlags,$ as PatchPropFlags,m as ShapeFlags,j as Text,Q as createInvoker,ye as createRenderer,Re as domRenderer,ge as getEventInvokers,F as getEventKey,Ne as getSVGPropName,P as isSVGElement,k as normalizeEventName,J as parseEventModifier,A as patchAllProps,N as patchClass,te as patchDOMProp,me as patchDOMProps,xe as patchElementProps,V as patchEvent,Le as patchEventOnElement,u as patchProp,E as patchStyle,K as removeAllEventListeners,R as removeDOMProp,x as setDOMProp};
|
|
1
|
+
import{registerDOMOperations as pe}from"@lytjs/vdom";var v=(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))(v||{}),k=(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))(k||{}),j=Symbol("Fragment"),H=Symbol("Text"),F=Symbol("Comment");function y(n){return n.type===j}function N(n){return n.type===H}function E(n){return n.type===F}function U(n,e){return n.type===e.type&&n.key===e.key}function S(n){return Array.isArray(n.dynamicChildren)}function B(n,e,t,o){if(t==="class")n.setClass(e,o);else if(t==="style")n.setStyle(e,o);else if(t.startsWith("on")||t.startsWith("@")){let r=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();n.addEventListener(e,r,o)}else t==="key"||t==="ref"||n.setAttribute(e,t,o)}function w(n,e,t,o,r){if(t==="class")n.setClass(e,o);else if(t==="style")n.setStyle(e,o||{});else if(t.startsWith("on")||t.startsWith("@")){let i=t.startsWith("@")?t.slice(1).toLowerCase():t.slice(2).toLowerCase();r&&n.removeEventListener(e,i,r),o&&n.addEventListener(e,i,o)}else n.setAttribute(e,t,o)}function _(n,e,t,o){for(let r in o){if(r==="key"||r==="ref")continue;let i=t[r],s=o[r];s!==i&&w(n,e,r,s,i)}for(let r in t)if(!(r==="key"||r==="ref")&&!(r in o))if(r==="class")n.setClass(e,"");else if(r==="style")n.setStyle(e,{});else if(r.startsWith("on")||r.startsWith("@")){let i=r.startsWith("@")?r.slice(1).toLowerCase():r.slice(2).toLowerCase();n.removeEventListener(e,i,t[r])}else n.removeAttribute(e,r)}function I(n,e,t,o,r,i){let{shapeFlag:s}=t;if(y(t)){oe(n,e,t,o,r,i);return}if(N(t)){let a=n.createText(t.children);t.el=a,n.insert(o,a,r);return}if(E(t)){let a=n.createComment(t.children);t.el=a,n.insert(o,a,r);return}if(s&1){ne(n,e,t,o,r,i);return}if(s&6){re(e,t,o,r,i);return}}function ne(n,e,t,o,r,i){let s=t.type,a=n.createElement(s);if(t.el=a,t.props)for(let d in t.props){let p=t.props[d];B(n,a,d,p)}let{shapeFlag:c,children:f}=t;c&8?a.textContent=f:c&16&&g(e,f,a,null,i),n.insert(o,a,r)}function g(n,e,t,o,r){for(let i=0;i<e.length;i++)n(null,e[i],t,o,r)}function oe(n,e,t,o,r,i){let{children:s}=t,a=n.createComment("");n.insert(o,a,r),Array.isArray(s)&&s.length>0&&g(e,s,o,a,i),t.el=a,t.anchor=a}function re(n,e,t,o,r){let i=e.component;i&&i.update&&i.update(),i&&i.subTree&&(n(null,i.subTree,t,o,i),e.el=i.subTree.el)}function G(n,e,t,o){let{shapeFlag:r,children:i}=t;if(y(t)){if(Array.isArray(i))for(let s=0;s<i.length;s++)e(i[s],o);t.anchor&&t.anchor.parentNode&&n.remove(t.anchor);return}if(r&6){t.component&&t.component.subTree&&e(t.component.subTree,o);return}t.el&&n.remove(t.el)}function C(n,e){for(let t=0;t<e.length;t++)n(e[t])}import{patchKeyedChildren as ie,patchUnkeyedChildren as se}from"@lytjs/vdom";function L(n,e,t,o,r,i=null,s=null){if(o==null){t&&e(t,r);return}if(t===null){I(n,P(n,e),o,r,i,s);return}if(S(o)&&S(t)){fe(n,e,t,o,r,s);return}if(!U(t,o)){e(t,r),I(n,P(n,e),o,r,i,s);return}o.el=t.el,o.anchor=t.anchor;let{shapeFlag:a}=o;if(y(o)){le(n,e,t,o,r,i,s);return}if(N(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(E(o)){o.children!==t.children&&(o.el.nodeValue=o.children);return}if(a&1){ae(n,e,t,o,s);return}if(a&6){de(t,o,s);return}}function P(n,e){return(t,o,r,i,s)=>{L(n,e,t,o,r,i,s)}}function ae(n,e,t,o,r=null){let i=o.el=t.el,s=t.props||{},a=o.props||{},{patchFlag:c,dynamicProps:f}=o;if(c&&c>0){if(c&1&&t.children!==o.children&&(i.textContent=o.children),c&2&&s.class!==a.class&&n.setClass(i,a.class),c&4&&s.style!==a.style&&n.setStyle(i,a.style||{}),c&8&&f)for(let d=0;d<f.length;d++){let p=f[d],l=s[p],K=a[p];K!==l&&w(n,i,p,K,l)}c&16&&_(n,i,s,a)}else _(n,i,s,a);(!c||!(c&1))&&Y(n,e,t,o,i,null,r)}function Y(n,e,t,o,r,i,s){let a=t.shapeFlag,c=o.shapeFlag,f=t.children,d=o.children;if(c&8){a&16&&C(e,f),f!==d&&(r.textContent=d);return}if(c&16){a&16?ce(n,e,f,d,r,i,s):(a&8&&(r.textContent=""),g(P(n,e),d,r,i,s));return}d==null&&(a&8?r.textContent="":a&16&&C(e,f))}function ce(n,e,t,o,r,i,s){o.every(c=>c.key!==null&&c.key!==void 0)&&t.every(c=>c.key!==null&&c.key!==void 0)?ie(t,o,r,i,s,null,!1):se(t,o,r,i,s,null,!1)}function le(n,e,t,o,r,i,s){let a=t.children,c=o.children;Array.isArray(c)&&c.length>0?(Y(n,e,t,o,r,i,s),o.el=c[0].el,o.anchor=c[c.length-1].el?n.nextSibling(c[c.length-1].el):i):Array.isArray(a)&&a.length>0&&c===null?(C(e,a),o.el=t.el,o.anchor=t.anchor):(o.el=t.el,o.anchor=t.anchor)}function fe(n,e,t,o,r,i){let s=t.dynamicChildren,a=o.dynamicChildren;for(let c=0;c<a.length;c++)L(n,e,s[c],a[c],r,null,i)}function de(n,e,t){e.component=n.component,e.el=n.el,e.component&&e.component.update&&e.component.update()}function ue(n){function e(r,i){G(n,e,r,i)}pe({insert(r,i,s){n.insert(i,r,s)},createElement(r){return n.createElement(r)},createText(r){return n.createText(r)},setText(r,i){r.nodeValue=i},setElementText(r,i){r.textContent=i},remove(r){n.remove(r)},createComment(r){return n.createComment(r)},mount(r,i,s,a,c,f,d){o(null,r,i,s,a)},patch(r,i,s,a,c,f,d,p){o(r,i,s,a,c)},unmount(r,i,s,a){e(r)},move(r,i,s){n.insert(i,r.el,s)}});function o(r,i,s,a,c){L(n,e,r,i,s,a,c)}return{mount(r,i){i.nodeType===1&&(i.textContent=""),o(null,r,i,null,null)},patch(r,i,s){var a;o(r,i,s||((a=r.el)==null?void 0:a.parentNode),null,null)},unmount(r,i){e(r,i)}}}var X={acceptCharset:"acceptCharset",accessKey:"accessKey",className:"className",htmlFor:"htmlFor",httpEquiv:"httpEquiv",tabIndex:"tabIndex"},q={allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,inert:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0},ye={"accent-height":"accentHeight","alignment-baseline":"alignmentBaseline","baseline-shift":"baselineShift","clip-path":"clipPath","clip-rule":"clipRule","color-interpolation":"colorInterpolation","color-interpolation-filters":"colorInterpolationFilters","dominant-baseline":"dominantBaseline","enable-background":"enableBackground","fill-opacity":"fillOpacity","fill-rule":"fillRule","flood-color":"floodColor","flood-opacity":"floodOpacity","glyph-orientation-horizontal":"glyphOrientationHorizontal","glyph-orientation-vertical":"glyphOrientationVertical","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-variant":"fontVariant","font-weight":"fontWeight","image-rendering":"imageRendering","letter-spacing":"letterSpacing","lighting-color":"lightingColor","marker-end":"markerEnd","marker-mid":"markerMid","marker-start":"markerStart","paint-order":"paintOrder","pointer-events":"pointerEvents","shape-rendering":"shapeRendering","stop-color":"stopColor","stop-opacity":"stopOpacity","stroke-dasharray":"strokeDasharray","stroke-dashoffset":"strokeDashoffset","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","stroke-miterlimit":"strokeMiterlimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","text-anchor":"textAnchor","text-decoration":"textDecoration","text-rendering":"textRendering","transform-origin":"transformOrigin","word-spacing":"wordSpacing","writing-mode":"writingMode","xlink:href":"xlinkHref","xlink:title":"xlinkTitle","xml:lang":"xmlLang","xml:space":"xmlSpace"};function x(n,e,t){if(e==="class"){n.className=t==null?"":String(t);return}if(e==="style"){if(typeof t=="string")n.style.cssText=t;else if(t!=null&&typeof t=="object")for(let r in t)n.style[r]=t[r];else n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let r=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase();typeof t=="function"&&n.addEventListener(r,t);return}if(e in q){t?(n.setAttribute(e,""),e in n&&(n[e]=!0)):(n.removeAttribute(e),e in n&&(n[e]=!1));return}let o=X[e]||e;if(o in n){try{n[o]=t==null?"":t}catch(r){n.setAttribute(e,t==null?"":String(t))}return}t==null||t===!1?n.removeAttribute(e):n.setAttribute(e,String(t))}function T(n,e){if(e==="class"){n.className="";return}if(e==="style"){n.style.cssText="";return}if(e.startsWith("on")||e.startsWith("@")){let o=e.startsWith("@")?e.slice(1).toLowerCase():e.slice(2).toLowerCase(),r=n._vei;if(r){let i="on"+o.charAt(0).toUpperCase()+o.slice(1),s=r[i];s&&(n.removeEventListener(o,s),r[i]=void 0)}return}if(e in q){n.removeAttribute(e),e in n&&(n[e]=!1);return}let t=X[e]||e;if(t in n){try{n[t]=""}catch(o){n.removeAttribute(e)}return}n.removeAttribute(e)}function z(n){return n.startsWith("on")||n.startsWith("@")}function me(n,e,t){let o=e?Object.keys(e):[],r=t?Object.keys(t):[];for(let i=0;i<r.length;i++){let s=r[i],a=t[s],c=e?e[s]:void 0;s==="key"||s==="ref"||a!==c&&(s==="class"?n.className=a==null?"":String(a):s==="style"?ve(n,a,c):z(s)||x(n,s,a))}for(let i=0;i<o.length;i++){let s=o[i];s==="key"||s==="ref"||(!t||!(s in t))&&(s==="class"?n.className="":s==="style"?n.style.cssText="":z(s)||T(n,s))}}function ve(n,e,t){if(!e||typeof e=="string"&&!e.trim()){n.style.cssText="";return}if(typeof e=="string"){n.style.cssText=e;return}if(typeof t=="object"&&t!==null)for(let o in t)o in e||(n.style[o]="");for(let o in e)n.style[o]=e[o]}function D(n){return n==="svg"||n==="path"||n==="circle"||n==="rect"||n==="line"||n==="polyline"||n==="polygon"||n==="ellipse"||n==="g"||n==="defs"||n==="use"||n==="text"||n==="tspan"||n==="clipPath"||n==="mask"||n==="filter"||n==="linearGradient"||n==="radialGradient"||n==="stop"||n==="pattern"||n==="symbol"||n==="image"||n==="foreignObject"||n==="animate"||n==="animateTransform"||n==="animateMotion"}function he(n){return ye[n]||n}var Ne=/^(?:@|on)/;function M(n){return n.replace(Ne,"").toLowerCase()}function $(n){let e=M(n);return"on"+e.charAt(0).toUpperCase()+e.slice(1)}var Ee={stop:"stop",prevent:"prevent",capture:"capture",once:"once",self:"self",passive:"passive"};function J(n){let e=n.split("."),o={name:e[0],stop:!1,prevent:!1,capture:!1,once:!1,self:!1,passive:!1};for(let r=1;r<e.length;r++){let i=e[r],s=Ee[i];s&&(o[s]=!0)}return o}function Q(n){let e=(t=>{e.value&&e.value(t)});return e.value=n,e}var h="_vei";function ge(n){return n[h]||null}function R(n,e,t,o,r){let i=$(e),s=J(M(e)),a=s.name,c=n[h];c||(c=n[h]={});let f=c[i];if(t&&f)f.value=t;else if(t&&!f){let d=Q(t);c[i]=d;let p={};s.capture&&(p.capture=!0),s.once&&(p.once=!0),s.passive&&(p.passive=!0),n.addEventListener(a,d,p)}else!t&&f&&(n.removeEventListener(a,f),c[i]=void 0)}function W(n){let e=n[h];if(e){for(let t in e){let o=e[t];if(o){let r=t.charAt(2).toLowerCase()+t.slice(3);n.removeEventListener(r,o)}}n[h]={}}}import{PatchFlags as u}from"@lytjs/vdom";function b(n,e,t){let o=ee(e);o!==t&&(n.className=o)}function ee(n){if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="object"){if(Array.isArray(n)){let t="";for(let o=0;o<n.length;o++){let r=ee(n[o]);r&&(t+=(t?" ":"")+r)}return t}let e="";for(let t in n)n[t]&&(e+=(e?" ":"")+t);return e}return String(n)}function A(n,e,t){if(!e){n.style.cssText="";return}if(!t){typeof e=="string"?n.style.cssText=e:typeof e=="object"&&Z(n,e);return}if(typeof e!=typeof t){n.style.cssText="",typeof e=="string"?n.style.cssText=e:typeof e=="object"&&Z(n,e);return}if(typeof e=="string"){e!==t&&(n.style.cssText=e);return}if(typeof e=="object"&&typeof t=="object"){for(let o in t)o in e||(n.style[o]="");for(let o in e){let r=e[o],i=t[o];r!==i&&(n.style[o]=r==null?"":r)}}}function Z(n,e){for(let t in e)n.style[t]=e[t]===null||e[t]===void 0?"":e[t]}function Ce(n,e,t,o){R(n,"",e,t,o)}var Le=new Set(["class","style","key","ref"]);function xe(n){return n.length>2&&(n[0]==="o"||n[0]==="O"||n[0]==="@")&&(n[1]==="n"||n[1]==="N")}function te(n,e,t,o,r){if(!Le.has(e)){if(xe(e)){R(n,e,t,o,r);return}if(t===!1||t===null||t===void 0){n.removeAttribute(e);return}if(e in n)try{n[e]=t}catch(i){n.setAttribute(e,String(t))}else n.setAttribute(e,String(t))}}function m(n,e,t,o,r){te(n,e,t,o,r)}function V(n,e,t,o){if(t)for(let r in t){if(r==="key"||r==="ref")continue;let i=t[r],s=e?e[r]:void 0;i!==s&&m(n,r,i,s,o)}if(e)for(let r in e)r==="key"||r==="ref"||(!t||!(r in t))&&m(n,r,null,e[r],o)}function Te(n,e,t,o){let r=e.props||{},i=t.props||{},{patchFlag:s,dynamicProps:a}=t;if(!s||s===u.HOISTED){V(n,r,i,o);return}if(s===u.BAIL){V(n,r,i,o);return}if(s&u.TEXT&&e.children!==t.children&&(n.textContent=t.children),s&u.CLASS&&r.class!==i.class&&b(n,i.class,r.class),s&u.STYLE&&r.style!==i.style&&A(n,i.style,r.style),s&u.PROPS&&a)for(let c=0;c<a.length;c++){let f=a[c],d=r[f],p=i[f];p!==d&&m(n,f,p,d,o)}s&u.FULL_PROPS&&V(n,r,i,o)}var O=class{createElement(e){return D(e)?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}createText(e){return document.createTextNode(e)}createComment(e){return document.createComment(e)}setAttribute(e,t,o){x(e,t,o)}removeAttribute(e,t){T(e,t)}setStyle(e,t){if(typeof t=="string")e.style.cssText=t;else if(t&&typeof t=="object")for(let o in t)e.style[o]=t[o]}setClass(e,t){if(typeof t=="string")e.className=t;else if(t&&typeof t=="object"){let o="";for(let r in t)t[r]&&(o+=(o?" ":"")+r);e.className=o}else e.className=""}insert(e,t,o){o!=null?e.insertBefore(t,o):e.appendChild(t)}remove(e){e.parentNode&&e.parentNode.removeChild(e)}replace(e,t,o){e.replaceChild(o,t)}addEventListener(e,t,o,r){e.addEventListener(t,o,r)}removeEventListener(e,t,o){e.removeEventListener(t,o)}nextTick(e){Promise.resolve().then(e)}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}querySelector(e){return document.querySelector(e)}setClassWithOld(e,t,o){b(e,t,o)}setStyleWithOld(e,t,o){A(e,t,o)}setAttributeWithOld(e,t,o,r){m(e,t,o,r)}setElementText(e,t){e.textContent=t}setText(e,t){e.nodeValue=t}insertBefore(e,t,o){o!=null?e.insertBefore(t,o):e.appendChild(t)}removeChild(e,t){e.removeChild(t)}setAnchor(e,t){e.anchor=t}getNextSibling(e){return e.nextSibling}cleanupEvents(e){W(e)}},Re=new O;export{F as Comment,O as DOMRenderer,j as Fragment,k as PatchFlags,u as PatchPropFlags,v as ShapeFlags,H as Text,Q as createInvoker,ue as createRenderer,Re as domRenderer,ge as getEventInvokers,$ as getEventKey,he as getSVGPropName,D as isSVGElement,M as normalizeEventName,J as parseEventModifier,V as patchAllProps,b as patchClass,te as patchDOMProp,me as patchDOMProps,Te as patchElementProps,R as patchEvent,Ce as patchEventOnElement,m as patchProp,A as patchStyle,W as removeAllEventListeners,T as removeDOMProp,x as setDOMProp};
|
package/dist/miniapp.cjs
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
|
-
var C=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var z=Object.prototype.hasOwnProperty;var B=(o,e)=>{for(var t in e)C(o,t,{get:e[t],enumerable:!0})},X=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of W(e))!z.call(o,i)&&i!==t&&C(o,i,{get:()=>e[i],enumerable:!(n=H(e,i))||n.enumerable});return o};var Y=o=>X(C({},"__esModule",{value:!0}),o);var re={};B(re,{Comment:()=>V,Fragment:()=>R,MiniAppRenderer:()=>N,PatchFlags:()=>g,ShapeFlags:()=>m,Text:()=>v,createRenderer:()=>j,miniAppRenderer:()=>U});module.exports=Y(re);var K=require("@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||{}),g=(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))(g||{}),R=Symbol("Fragment"),v=Symbol("Text"),V=Symbol("Comment");function u(o){return o.type===R}function x(o){return o.type===v}function T(o){return o.type===V}function I(o,e){return o.type===e.type&&o.key===e.key}function L(o){return Array.isArray(o.dynamicChildren)}function P(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 w(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 M(o,e,t,n){for(let i in n){if(i==="key"||i==="ref")continue;let r=t[i],s=n[i];s!==r&&w(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 S(o,e,t,n,i,r){let{shapeFlag:s}=t;if(u(t)){q(o,e,t,n,i,r);return}if(x(t)){let a=o.createText(t.children);t.el=a,o.insert(n,a,i);return}if(T(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){Z(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 f in t.props){let d=t.props[f];P(o,a,f,d)}let{shapeFlag:c,children:l}=t;c&8?a.textContent=l:c&16&&A(e,l,a,null,r),o.insert(n,a,i)}function A(o,e,t,n,i){for(let r=0;r<e.length;r++)o(null,e[r],t,n,i)}function q(o,e,t,n,i,r){let{children:s}=t,a=o.createComment("");o.insert(n,a,i),Array.isArray(s)&&s.length>0&&A(e,s,n,a,r),t.el=a,t.anchor=a}function Z(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 D(o,e,t,n){let{shapeFlag:i,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&&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 E(o,e){for(let t=0;t<e.length;t++)o(e[t])}var _=require("@lytjs/vdom");function b(o,e,t,n,i,r=null,s=null){if(n==null){t&&e(t,i);return}if(t===null){S(o,O(o,e),n,i,r,s);return}if(L(n)&&L(t)){ee(o,e,t,n,i,s);return}if(!I(t,n)){e(t,i),S(o,O(o,e),n,i,r,s);return}n.el=t.el,n.anchor=t.anchor;let{shapeFlag:a}=n;if(u(n)){k(o,e,t,n,i,r,s);return}if(x(n)){n.children!==t.children&&(n.el.nodeValue=n.children);return}if(T(n)){n.children!==t.children&&(n.el.nodeValue=n.children);return}if(a&1){J(o,e,t,n,s);return}if(a&6){te(t,n,s);return}}function O(o,e){return(t,n,i,r,s)=>{b(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: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],$=a[d];$!==p&&w(o,r,d,$,p)}c&16&&M(o,r,s,a)}else M(o,r,s,a);(!c||!(c&1))&&F(o,e,t,n,r,null,i)}function F(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&&E(e,l),l!==f&&(i.textContent=f);return}if(c&16){a&16?Q(o,e,l,f,i,r,s):(a&8&&(i.textContent=""),A(O(o,e),f,i,r,s));return}f==null&&(a&8?i.textContent="":a&16&&E(e,l))}function Q(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)?(0,_.patchKeyedChildren)(t,n,i,r,s,null,!1):(0,_.patchUnkeyedChildren)(t,n,i,r,s,null,!1)}function k(o,e,t,n,i,r,s){let a=t.children,c=n.children;Array.isArray(c)&&c.length>0?(F(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?(E(e,a),n.el=t.el,n.anchor=t.anchor):(n.el=t.el,n.anchor=t.anchor)}function ee(o,e,t,n,i,r){let s=t.dynamicChildren,a=n.dynamicChildren;for(let c=0;c<a.length;c++)b(o,e,s[c],a[c],i,null,r)}function te(o,e,t){e.component=o.component,e.el=o.el,e.component&&e.component.update&&e.component.update()}function j(o){function e(i,r){D(o,e,i,r)}(0,K.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,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){b(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 ne={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"}},y={click:"tap",input:"input",change:"change",submit:"submit",focus:"focus",blur:"blur",touchstart:"touchstart",touchend:"touchend",touchmove:"touchmove",scroll:"scroll",longpress:"longpress"},ie={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"},h={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"}},N=class{createElement(e){return{tag:ie[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=y[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=y[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=y[t]||t;e.bindEvents[r]=n.name||"handleEvent"}removeEventListener(e,t,n){if(!e)return;let i=y[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=y[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=h[n]||h.wechat,r=ne[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=h[t]||h.wechat,i=y[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=h[n]||h.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
|
|
3
|
-
`);return`${
|
|
4
|
-
${
|
|
5
|
-
${
|
|
1
|
+
"use strict";var k=Object.defineProperty;var le=Object.getOwnPropertyDescriptor;var de=Object.getOwnPropertyNames;var fe=Object.prototype.hasOwnProperty;var ue=(s,e)=>{for(var t in e)k(s,t,{get:e[t],enumerable:!0})},me=(s,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of de(e))!fe.call(s,n)&&n!==t&&k(s,n,{get:()=>e[n],enumerable:!(r=le(e,n))||r.enumerable});return s};var ge=s=>me(k({},"__esModule",{value:!0}),s);var Pe={};ue(Pe,{Comment:()=>H,Fragment:()=>O,MiniAppCompiler:()=>$,MiniAppEventBridge:()=>P,MiniAppLifecycleAdapter:()=>S,MiniAppRenderer:()=>b,PatchFlags:()=>N,ShapeFlags:()=>g,Text:()=>V,camelToKebab:()=>m.camelToKebab,createRenderer:()=>Y,createWxsModule:()=>oe,escapeHtml:()=>se,generateComponentJson:()=>T,generatePageJson:()=>C,isNativeTag:()=>ae,kebabToCamel:()=>m.kebabToCamel,miniAppRenderer:()=>ne,normalizeProps:()=>L,parseClassObject:()=>ie,parseStyleObject:()=>re});module.exports=ge(Pe);var X=require("@lytjs/vdom");var g=(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))(g||{}),N=(d=>(d[d.TEXT=1]="TEXT",d[d.CLASS=2]="CLASS",d[d.STYLE=4]="STYLE",d[d.PROPS=8]="PROPS",d[d.FULL_PROPS=16]="FULL_PROPS",d[d.STABLE_FRAGMENT=32]="STABLE_FRAGMENT",d[d.KEYED_FRAGMENT=64]="KEYED_FRAGMENT",d[d.UNKEYED_FRAGMENT=128]="UNKEYED_FRAGMENT",d[d.NEED_PATCH=256]="NEED_PATCH",d[d.DYNAMIC_SLOTS=512]="DYNAMIC_SLOTS",d[d.HOISTED=-1]="HOISTED",d[d.BAIL=-2]="BAIL",d))(N||{}),O=Symbol("Fragment"),V=Symbol("Text"),H=Symbol("Comment");function h(s){return s.type===O}function _(s){return s.type===V}function x(s){return s.type===H}function z(s,e){return s.type===e.type&&s.key===e.key}function j(s){return Array.isArray(s.dynamicChildren)}function K(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 D(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 I(s,e,t,r){for(let n in r){if(n==="key"||n==="ref")continue;let i=t[n],o=r[n];o!==i&&D(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 B(s,e,t,r,n,i){let{shapeFlag:o}=t;if(h(t)){ye(s,e,t,r,n,i);return}if(_(t)){let a=s.createText(t.children);t.el=a,s.insert(r,a,n);return}if(x(t)){let a=s.createComment(t.children);t.el=a,s.insert(r,a,n);return}if(o&1){he(s,e,t,r,n,i);return}if(o&6){be(e,t,r,n,i);return}}function he(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];K(s,a,l,f)}let{shapeFlag:c,children:p}=t;c&8?a.textContent=p:c&16&&w(e,p,a,null,i),s.insert(r,a,n)}function w(s,e,t,r,n){for(let i=0;i<e.length;i++)s(null,e[i],t,r,n)}function ye(s,e,t,r,n,i){let{children:o}=t,a=s.createComment("");s.insert(r,a,n),Array.isArray(o)&&o.length>0&&w(e,o,r,a,i),t.el=a,t.anchor=a}function be(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 J(s,e,t,r){let{shapeFlag:n,children:i}=t;if(h(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 A(s,e){for(let t=0;t<e.length;t++)s(e[t])}var M=require("@lytjs/vdom");function E(s,e,t,r,n,i=null,o=null){if(r==null){t&&e(t,n);return}if(t===null){B(s,F(s,e),r,n,i,o);return}if(j(r)&&j(t)){xe(s,e,t,r,n,o);return}if(!z(t,r)){e(t,n),B(s,F(s,e),r,n,i,o);return}r.el=t.el,r.anchor=t.anchor;let{shapeFlag:a}=r;if(h(r)){_e(s,e,t,r,n,i,o);return}if(_(r)){r.children!==t.children&&(r.el.nodeValue=r.children);return}if(x(r)){r.children!==t.children&&(r.el.nodeValue=r.children);return}if(a&1){ve(s,e,t,r,o);return}if(a&6){we(t,r,o);return}}function F(s,e){return(t,r,n,i,o)=>{E(s,e,t,r,n,i,o)}}function ve(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],v=a[f];v!==d&&D(s,i,f,v,d)}c&16&&I(s,i,o,a)}else I(s,i,o,a);(!c||!(c&1))&&W(s,e,t,r,i,null,n)}function W(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&&A(e,p),p!==l&&(n.textContent=l);return}if(c&16){a&16?Ne(s,e,p,l,n,i,o):(a&8&&(n.textContent=""),w(F(s,e),l,n,i,o));return}l==null&&(a&8?n.textContent="":a&16&&A(e,p))}function Ne(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)?(0,M.patchKeyedChildren)(t,r,n,i,o,null,!1):(0,M.patchUnkeyedChildren)(t,r,n,i,o,null,!1)}function _e(s,e,t,r,n,i,o){let a=t.children,c=r.children;Array.isArray(c)&&c.length>0?(W(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?(A(e,a),r.el=t.el,r.anchor=t.anchor):(r.el=t.el,r.anchor=t.anchor)}function xe(s,e,t,r,n,i){let o=t.dynamicChildren,a=r.dynamicChildren;for(let c=0;c<a.length;c++)E(s,e,o[c],a[c],n,null,i)}function we(s,e,t){e.component=s.component,e.el=s.el,e.component&&e.component.update&&e.component.update()}function Y(s){function e(n,i){J(s,e,n,i)}(0,X.registerDOMOperations)({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){E(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 R={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 G(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 Z(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 q(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 Q(s){var e;return(e=s==null?void 0:s._parent)!=null?e:null}function ee(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 te(s){Promise.resolve().then(()=>s())}var Ae={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"}},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"}},b=class{createElement(e){return{tag:R[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){G(e,t,r)}remove(e){Z(e)}replace(e,t,r){q(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){te(e)}parentNode(e){return Q(e)}nextSibling(e){return ee(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=y[r]||y.wechat,i=Ae[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=y[t]||y.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=y[r]||y.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 ne=new b;var m=require("@lytjs/common");function re(s){return Object.entries(s).map(([e,t])=>`${(0,m.camelToKebab)(e)}: ${t}`).join("; ")}function ie(s){return typeof s=="string"?s:typeof s=="object"&&s!==null?Object.entries(s).filter(([,e])=>!!e).map(([e])=>e).join(" "):""}function C(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 T(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 L(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 oe(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 Me={"&":"&","<":"<",">":">",'"':""","'":"'"},Ee=/[&<>"']/g;function se(s){return s.replace(Ee,e=>Me[e]||e)}var Re=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 ae(s){return Re.has(s.toLowerCase())}var Ce={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"}},Te={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"},$=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=C({});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=L(e.props);o=l.properties,a=l.observers}let c=this._generateComponentJs(o,n,i,a,t),p=T({component:!0});return{wxml:r.template,wxss:r.style,js:c,json:p}}_transformTemplate(e,t){let r=Ce[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=R[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=Te[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 v of d.split(`
|
|
20
|
+
`))o.push(` ${v}`);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 ce={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"}},Le={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:"}},P=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=ce[n];return i?i[r]:r==="alipay"?e.charAt(0).toLowerCase()+e.slice(1):n}getBindName(e,t){let r=this.normalizeEvent(e),n=Le[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(ce)){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 U={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}},$e={onBeforeMount:"onLoad",onMounted:"onReady",onUnmounted:"onUnload",onShow:"onShow",onHide:"onHide",onReady:"onReady",onLoad:"onLoad",onUnload:"onUnload"},pe={onBeforeMount:"created",onMounted:"ready",onUnmounted:"detached",onReady:"ready",created:"created",attached:"attached",moved:"moved",detached:"detached"},S=class{constructor(e){this._platform=e}mapLifecycle(e,t){let r=U[e];return r?r.platformHook:e}getLifecycleMapping(e){return U[e]||null}getAllMappings(){return Object.values(U)}createPageLifecycle(e){let t={};for(let[r,n]of Object.entries(e)){if(typeof n!="function")continue;let i=$e[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=pe[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=pe[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"}}};
|