@chamn/render 0.8.3 → 0.8.5
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/index.cjs +15 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +487 -483
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +13 -10
- package/dist/index.umd.js.map +1 -1
- package/package.json +5 -5
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(C,N){typeof exports=="object"&&typeof module<"u"?N(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],N):(C=typeof globalThis<"u"?globalThis:C||self,N(C.CRender={},C.React))})(this,function(C,N){"use strict";var Cm=Object.defineProperty;var Em=(C,N,Mt)=>N in C?Cm(C,N,{enumerable:!0,configurable:!0,writable:!0,value:Mt}):C[N]=Mt;var w=(C,N,Mt)=>Em(C,typeof N!="symbol"?N+"":N,Mt);const Mt=t=>()=>{console.warn(`${t} need to be implement getComponent`)},Ja=["customPageRootRender"],en=["pageRender","render","convertModelToComponent","getComponent","getContext","getUtils","transformProps","errorCatch","requestAPI","clear"],rn=t=>[...en,...Ja].reduce((r,n)=>{var o;return t!=null&&t[n]?r[n]=(o=t[n])==null?void 0:o.bind(t):en.includes(n)&&(r[n]=Mt),r},{});var nn=typeof global=="object"&&global&&global.Object===Object&&global,Wa=typeof self=="object"&&self&&self.Object===Object&&self,X=nn||Wa||Function("return this")(),lt=X.Symbol,on=Object.prototype,Ka=on.hasOwnProperty,Qa=on.toString,qt=lt?lt.toStringTag:void 0;function Ya(t){var e=Ka.call(t,qt),r=t[qt];try{t[qt]=void 0;var n=!0}catch{}var o=Qa.call(t);return n&&(e?t[qt]=r:delete t[qt]),o}var Xa=Object.prototype,Za=Xa.toString;function ts(t){return Za.call(t)}var es="[object Null]",rs="[object Undefined]",an=lt?lt.toStringTag:void 0;function gt(t){return t==null?t===void 0?rs:es:an&&an in Object(t)?Ya(t):ts(t)}function ft(t){return t!=null&&typeof t=="object"}var ns="[object Symbol]";function os(t){return typeof t=="symbol"||ft(t)&>(t)==ns}function as(t,e){for(var r=-1,n=t==null?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}var nt=Array.isArray,sn=lt?lt.prototype:void 0,un=sn?sn.toString:void 0;function cn(t){if(typeof t=="string")return t;if(nt(t))return as(t,cn)+"";if(os(t))return un?un.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function mt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function ln(t){return t}var ss="[object AsyncFunction]",is="[object Function]",us="[object GeneratorFunction]",cs="[object Proxy]";function Ie(t){if(!mt(t))return!1;var e=gt(t);return e==is||e==us||e==ss||e==cs}var De=X["__core-js_shared__"],fn=function(){var t=/[^.]+$/.exec(De&&De.keys&&De.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function ls(t){return!!fn&&fn in t}var fs=Function.prototype,ds=fs.toString;function vt(t){if(t!=null){try{return ds.call(t)}catch{}try{return t+""}catch{}}return""}var ps=/[\\^$.*+?()[\]{}|]/g,hs=/^\[object .+?Constructor\]$/,gs=Function.prototype,ms=Object.prototype,vs=gs.toString,ys=ms.hasOwnProperty,bs=RegExp("^"+vs.call(ys).replace(ps,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function _s(t){if(!mt(t)||ls(t))return!1;var e=Ie(t)?bs:hs;return e.test(vt(t))}function Ss(t,e){return t==null?void 0:t[e]}function yt(t,e){var r=Ss(t,e);return _s(r)?r:void 0}var Le=yt(X,"WeakMap"),dn=Object.create,Os=function(){function t(){}return function(e){if(!mt(e))return{};if(dn)return dn(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function Cs(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Es(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var ws=800,Ns=16,$s=Date.now;function js(t){var e=0,r=0;return function(){var n=$s(),o=Ns-(n-r);if(r=n,o>0){if(++e>=ws)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function As(t){return function(){return t}}var pe=function(){try{var t=yt(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Ts=pe?function(t,e){return pe(t,"toString",{configurable:!0,enumerable:!1,value:As(e),writable:!0})}:ln,Ms=js(Ts),Ps=9007199254740991,xs=/^(?:0|[1-9]\d*)$/;function pn(t,e){var r=typeof t;return e=e??Ps,!!e&&(r=="number"||r!="symbol"&&xs.test(t))&&t>-1&&t%1==0&&t<e}function Fe(t,e,r){e=="__proto__"&&pe?pe(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Jt(t,e){return t===e||t!==t&&e!==e}var Rs=Object.prototype,Is=Rs.hasOwnProperty;function Ds(t,e,r){var n=t[e];(!(Is.call(t,e)&&Jt(n,r))||r===void 0&&!(e in t))&&Fe(t,e,r)}function Ls(t,e,r,n){var o=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var i=e[a],u=void 0;u===void 0&&(u=t[i]),o?Fe(r,i,u):Ds(r,i,u)}return r}var hn=Math.max;function Fs(t,e,r){return e=hn(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=hn(n.length-e,0),s=Array(a);++o<a;)s[o]=n[e+o];o=-1;for(var i=Array(e+1);++o<e;)i[o]=n[o];return i[e]=r(s),Cs(t,this,i)}}function Vs(t,e){return Ms(Fs(t,e,ln),t+"")}var Us=9007199254740991;function gn(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Us}function he(t){return t!=null&&gn(t.length)&&!Ie(t)}function Bs(t,e,r){if(!mt(r))return!1;var n=typeof e;return(n=="number"?he(r)&&pn(e,r.length):n=="string"&&e in r)?Jt(r[e],t):!1}function Gs(t){return Vs(function(e,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,s=o>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(o--,a):void 0,s&&Bs(r[0],r[1],s)&&(a=o<3?void 0:a,o=1),e=Object(e);++n<o;){var i=r[n];i&&t(e,i,n,a)}return e})}var ks=Object.prototype;function Ve(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||ks;return t===r}function Hs(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var zs="[object Arguments]";function mn(t){return ft(t)&>(t)==zs}var vn=Object.prototype,qs=vn.hasOwnProperty,Js=vn.propertyIsEnumerable,Ue=mn(function(){return arguments}())?mn:function(t){return ft(t)&&qs.call(t,"callee")&&!Js.call(t,"callee")};function Ws(){return!1}var yn=typeof C=="object"&&C&&!C.nodeType&&C,bn=yn&&typeof module=="object"&&module&&!module.nodeType&&module,Ks=bn&&bn.exports===yn,_n=Ks?X.Buffer:void 0,Qs=_n?_n.isBuffer:void 0,ge=Qs||Ws,Ys="[object Arguments]",Xs="[object Array]",Zs="[object Boolean]",ti="[object Date]",ei="[object Error]",ri="[object Function]",ni="[object Map]",oi="[object Number]",ai="[object Object]",si="[object RegExp]",ii="[object Set]",ui="[object String]",ci="[object WeakMap]",li="[object ArrayBuffer]",fi="[object DataView]",di="[object Float32Array]",pi="[object Float64Array]",hi="[object Int8Array]",gi="[object Int16Array]",mi="[object Int32Array]",vi="[object Uint8Array]",yi="[object Uint8ClampedArray]",bi="[object Uint16Array]",_i="[object Uint32Array]",R={};R[di]=R[pi]=R[hi]=R[gi]=R[mi]=R[vi]=R[yi]=R[bi]=R[_i]=!0,R[Ys]=R[Xs]=R[li]=R[Zs]=R[fi]=R[ti]=R[ei]=R[ri]=R[ni]=R[oi]=R[ai]=R[si]=R[ii]=R[ui]=R[ci]=!1;function Si(t){return ft(t)&&gn(t.length)&&!!R[gt(t)]}function Oi(t){return function(e){return t(e)}}var Sn=typeof C=="object"&&C&&!C.nodeType&&C,Wt=Sn&&typeof module=="object"&&module&&!module.nodeType&&module,Ci=Wt&&Wt.exports===Sn,Be=Ci&&nn.process,On=function(){try{var t=Wt&&Wt.require&&Wt.require("util").types;return t||Be&&Be.binding&&Be.binding("util")}catch{}}(),Cn=On&&On.isTypedArray,Ge=Cn?Oi(Cn):Si,Ei=Object.prototype,wi=Ei.hasOwnProperty;function En(t,e){var r=nt(t),n=!r&&Ue(t),o=!r&&!n&&ge(t),a=!r&&!n&&!o&&Ge(t),s=r||n||o||a,i=s?Hs(t.length,String):[],u=i.length;for(var c in t)(e||wi.call(t,c))&&!(s&&(c=="length"||o&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||pn(c,u)))&&i.push(c);return i}function wn(t,e){return function(r){return t(e(r))}}var Ni=wn(Object.keys,Object),$i=Object.prototype,ji=$i.hasOwnProperty;function Ai(t){if(!Ve(t))return Ni(t);var e=[];for(var r in Object(t))ji.call(t,r)&&r!="constructor"&&e.push(r);return e}function Ti(t){return he(t)?En(t):Ai(t)}function Mi(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Pi=Object.prototype,xi=Pi.hasOwnProperty;function Ri(t){if(!mt(t))return Mi(t);var e=Ve(t),r=[];for(var n in t)n=="constructor"&&(e||!xi.call(t,n))||r.push(n);return r}function Nn(t){return he(t)?En(t,!0):Ri(t)}var Kt=yt(Object,"create");function Ii(){this.__data__=Kt?Kt(null):{},this.size=0}function Di(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Li="__lodash_hash_undefined__",Fi=Object.prototype,Vi=Fi.hasOwnProperty;function Ui(t){var e=this.__data__;if(Kt){var r=e[t];return r===Li?void 0:r}return Vi.call(e,t)?e[t]:void 0}var Bi=Object.prototype,Gi=Bi.hasOwnProperty;function ki(t){var e=this.__data__;return Kt?e[t]!==void 0:Gi.call(e,t)}var Hi="__lodash_hash_undefined__";function zi(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Kt&&e===void 0?Hi:e,this}function bt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}bt.prototype.clear=Ii,bt.prototype.delete=Di,bt.prototype.get=Ui,bt.prototype.has=ki,bt.prototype.set=zi;function qi(){this.__data__=[],this.size=0}function me(t,e){for(var r=t.length;r--;)if(Jt(t[r][0],e))return r;return-1}var Ji=Array.prototype,Wi=Ji.splice;function Ki(t){var e=this.__data__,r=me(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Wi.call(e,r,1),--this.size,!0}function Qi(t){var e=this.__data__,r=me(e,t);return r<0?void 0:e[r][1]}function Yi(t){return me(this.__data__,t)>-1}function Xi(t,e){var r=this.__data__,n=me(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function ot(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ot.prototype.clear=qi,ot.prototype.delete=Ki,ot.prototype.get=Qi,ot.prototype.has=Yi,ot.prototype.set=Xi;var Qt=yt(X,"Map");function Zi(){this.size=0,this.__data__={hash:new bt,map:new(Qt||ot),string:new bt}}function tu(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function ve(t,e){var r=t.__data__;return tu(e)?r[typeof e=="string"?"string":"hash"]:r.map}function eu(t){var e=ve(this,t).delete(t);return this.size-=e?1:0,e}function ru(t){return ve(this,t).get(t)}function nu(t){return ve(this,t).has(t)}function ou(t,e){var r=ve(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function _t(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}_t.prototype.clear=Zi,_t.prototype.delete=eu,_t.prototype.get=ru,_t.prototype.has=nu,_t.prototype.set=ou;function $n(t){return t==null?"":cn(t)}function au(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}var jn=wn(Object.getPrototypeOf,Object),su="[object Object]",iu=Function.prototype,uu=Object.prototype,An=iu.toString,cu=uu.hasOwnProperty,lu=An.call(Object);function Pt(t){if(!ft(t)||gt(t)!=su)return!1;var e=jn(t);if(e===null)return!0;var r=cu.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&An.call(r)==lu}function fu(t,e,r){var n=-1,o=t.length;e<0&&(e=-e>o?0:o+e),r=r>o?o:r,r<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(o);++n<o;)a[n]=t[n+e];return a}function du(t,e,r){var n=t.length;return r=r===void 0?n:r,fu(t,e,r)}var pu="\\ud800-\\udfff",hu="\\u0300-\\u036f",gu="\\ufe20-\\ufe2f",mu="\\u20d0-\\u20ff",vu=hu+gu+mu,yu="\\ufe0e\\ufe0f",bu="\\u200d",_u=RegExp("["+bu+pu+vu+yu+"]");function Tn(t){return _u.test(t)}function Su(t){return t.split("")}var Mn="\\ud800-\\udfff",Ou="\\u0300-\\u036f",Cu="\\ufe20-\\ufe2f",Eu="\\u20d0-\\u20ff",wu=Ou+Cu+Eu,Nu="\\ufe0e\\ufe0f",$u="["+Mn+"]",ke="["+wu+"]",He="\\ud83c[\\udffb-\\udfff]",ju="(?:"+ke+"|"+He+")",Pn="[^"+Mn+"]",xn="(?:\\ud83c[\\udde6-\\uddff]){2}",Rn="[\\ud800-\\udbff][\\udc00-\\udfff]",Au="\\u200d",In=ju+"?",Dn="["+Nu+"]?",Tu="(?:"+Au+"(?:"+[Pn,xn,Rn].join("|")+")"+Dn+In+")*",Mu=Dn+In+Tu,Pu="(?:"+[Pn+ke+"?",ke,xn,Rn,$u].join("|")+")",xu=RegExp(He+"(?="+He+")|"+Pu+Mu,"g");function Ru(t){return t.match(xu)||[]}function Iu(t){return Tn(t)?Ru(t):Su(t)}function Du(t){return function(e){e=$n(e);var r=Tn(e)?Iu(e):void 0,n=r?r[0]:e.charAt(0),o=r?du(r,1).join(""):e.slice(1);return n[t]()+o}}var Lu=Du("toUpperCase");function Fu(t){return Lu($n(t).toLowerCase())}function Vu(){this.__data__=new ot,this.size=0}function Uu(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function Bu(t){return this.__data__.get(t)}function Gu(t){return this.__data__.has(t)}var ku=200;function Hu(t,e){var r=this.__data__;if(r instanceof ot){var n=r.__data__;if(!Qt||n.length<ku-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new _t(n)}return r.set(t,e),this.size=r.size,this}function at(t){var e=this.__data__=new ot(t);this.size=e.size}at.prototype.clear=Vu,at.prototype.delete=Uu,at.prototype.get=Bu,at.prototype.has=Gu,at.prototype.set=Hu;var Ln=typeof C=="object"&&C&&!C.nodeType&&C,Fn=Ln&&typeof module=="object"&&module&&!module.nodeType&&module,zu=Fn&&Fn.exports===Ln,Vn=zu?X.Buffer:void 0;Vn&&Vn.allocUnsafe;function qu(t,e){return t.slice()}function Ju(t,e){for(var r=-1,n=t==null?0:t.length,o=0,a=[];++r<n;){var s=t[r];e(s,r,t)&&(a[o++]=s)}return a}function Wu(){return[]}var Ku=Object.prototype,Qu=Ku.propertyIsEnumerable,Un=Object.getOwnPropertySymbols,Yu=Un?function(t){return t==null?[]:(t=Object(t),Ju(Un(t),function(e){return Qu.call(t,e)}))}:Wu;function Xu(t,e,r){var n=e(t);return nt(t)?n:au(n,r(t))}function Bn(t){return Xu(t,Ti,Yu)}var ze=yt(X,"DataView"),qe=yt(X,"Promise"),Je=yt(X,"Set"),Gn="[object Map]",Zu="[object Object]",kn="[object Promise]",Hn="[object Set]",zn="[object WeakMap]",qn="[object DataView]",tc=vt(ze),ec=vt(Qt),rc=vt(qe),nc=vt(Je),oc=vt(Le),dt=gt;(ze&&dt(new ze(new ArrayBuffer(1)))!=qn||Qt&&dt(new Qt)!=Gn||qe&&dt(qe.resolve())!=kn||Je&&dt(new Je)!=Hn||Le&&dt(new Le)!=zn)&&(dt=function(t){var e=gt(t),r=e==Zu?t.constructor:void 0,n=r?vt(r):"";if(n)switch(n){case tc:return qn;case ec:return Gn;case rc:return kn;case nc:return Hn;case oc:return zn}return e});var ye=X.Uint8Array;function ac(t){var e=new t.constructor(t.byteLength);return new ye(e).set(new ye(t)),e}function sc(t,e){var r=ac(t.buffer);return new t.constructor(r,t.byteOffset,t.length)}function ic(t){return typeof t.constructor=="function"&&!Ve(t)?Os(jn(t)):{}}var uc="__lodash_hash_undefined__";function cc(t){return this.__data__.set(t,uc),this}function lc(t){return this.__data__.has(t)}function be(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new _t;++e<r;)this.add(t[e])}be.prototype.add=be.prototype.push=cc,be.prototype.has=lc;function fc(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function dc(t,e){return t.has(e)}var pc=1,hc=2;function Jn(t,e,r,n,o,a){var s=r&pc,i=t.length,u=e.length;if(i!=u&&!(s&&u>i))return!1;var c=a.get(t),d=a.get(e);if(c&&d)return c==e&&d==t;var l=-1,f=!0,h=r&hc?new be:void 0;for(a.set(t,e),a.set(e,t);++l<i;){var g=t[l],b=e[l];if(n)var p=s?n(b,g,l,e,t,a):n(g,b,l,t,e,a);if(p!==void 0){if(p)continue;f=!1;break}if(h){if(!fc(e,function(m,v){if(!dc(h,v)&&(g===m||o(g,m,r,n,a)))return h.push(v)})){f=!1;break}}else if(!(g===b||o(g,b,r,n,a))){f=!1;break}}return a.delete(t),a.delete(e),f}function gc(t){var e=-1,r=Array(t.size);return t.forEach(function(n,o){r[++e]=[o,n]}),r}function mc(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var vc=1,yc=2,bc="[object Boolean]",_c="[object Date]",Sc="[object Error]",Oc="[object Map]",Cc="[object Number]",Ec="[object RegExp]",wc="[object Set]",Nc="[object String]",$c="[object Symbol]",jc="[object ArrayBuffer]",Ac="[object DataView]",Wn=lt?lt.prototype:void 0,We=Wn?Wn.valueOf:void 0;function Tc(t,e,r,n,o,a,s){switch(r){case Ac:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case jc:return!(t.byteLength!=e.byteLength||!a(new ye(t),new ye(e)));case bc:case _c:case Cc:return Jt(+t,+e);case Sc:return t.name==e.name&&t.message==e.message;case Ec:case Nc:return t==e+"";case Oc:var i=gc;case wc:var u=n&vc;if(i||(i=mc),t.size!=e.size&&!u)return!1;var c=s.get(t);if(c)return c==e;n|=yc,s.set(t,e);var d=Jn(i(t),i(e),n,o,a,s);return s.delete(t),d;case $c:if(We)return We.call(t)==We.call(e)}return!1}var Mc=1,Pc=Object.prototype,xc=Pc.hasOwnProperty;function Rc(t,e,r,n,o,a){var s=r&Mc,i=Bn(t),u=i.length,c=Bn(e),d=c.length;if(u!=d&&!s)return!1;for(var l=u;l--;){var f=i[l];if(!(s?f in e:xc.call(e,f)))return!1}var h=a.get(t),g=a.get(e);if(h&&g)return h==e&&g==t;var b=!0;a.set(t,e),a.set(e,t);for(var p=s;++l<u;){f=i[l];var m=t[f],v=e[f];if(n)var y=s?n(v,m,f,e,t,a):n(m,v,f,t,e,a);if(!(y===void 0?m===v||o(m,v,r,n,a):y)){b=!1;break}p||(p=f=="constructor")}if(b&&!p){var _=t.constructor,O=e.constructor;_!=O&&"constructor"in t&&"constructor"in e&&!(typeof _=="function"&&_ instanceof _&&typeof O=="function"&&O instanceof O)&&(b=!1)}return a.delete(t),a.delete(e),b}var Ic=1,Kn="[object Arguments]",Qn="[object Array]",_e="[object Object]",Dc=Object.prototype,Yn=Dc.hasOwnProperty;function Lc(t,e,r,n,o,a){var s=nt(t),i=nt(e),u=s?Qn:dt(t),c=i?Qn:dt(e);u=u==Kn?_e:u,c=c==Kn?_e:c;var d=u==_e,l=c==_e,f=u==c;if(f&&ge(t)){if(!ge(e))return!1;s=!0,d=!1}if(f&&!d)return a||(a=new at),s||Ge(t)?Jn(t,e,r,n,o,a):Tc(t,e,u,r,n,o,a);if(!(r&Ic)){var h=d&&Yn.call(t,"__wrapped__"),g=l&&Yn.call(e,"__wrapped__");if(h||g){var b=h?t.value():t,p=g?e.value():e;return a||(a=new at),o(b,p,r,n,a)}}return f?(a||(a=new at),Rc(t,e,r,n,o,a)):!1}function Xn(t,e,r,n,o){return t===e?!0:t==null||e==null||!ft(t)&&!ft(e)?t!==t&&e!==e:Lc(t,e,r,n,Xn,o)}function Fc(t){return function(e,r,n){for(var o=-1,a=Object(e),s=n(e),i=s.length;i--;){var u=s[++o];if(r(a[u],u,a)===!1)break}return e}}var Vc=Fc();function Ke(t,e,r){(r!==void 0&&!Jt(t[e],r)||r===void 0&&!(e in t))&&Fe(t,e,r)}function Uc(t){return ft(t)&&he(t)}function Qe(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Bc(t){return Ls(t,Nn(t))}function Gc(t,e,r,n,o,a,s){var i=Qe(t,r),u=Qe(e,r),c=s.get(u);if(c){Ke(t,r,c);return}var d=a?a(i,u,r+"",t,e,s):void 0,l=d===void 0;if(l){var f=nt(u),h=!f&&ge(u),g=!f&&!h&&Ge(u);d=u,f||h||g?nt(i)?d=i:Uc(i)?d=Es(i):h?(l=!1,d=qu(u)):g?(l=!1,d=sc(u)):d=[]:Pt(u)||Ue(u)?(d=i,Ue(i)?d=Bc(i):(!mt(i)||Ie(i))&&(d=ic(u))):l=!1}l&&(s.set(u,d),o(d,u,n,a,s),s.delete(u)),Ke(t,r,d)}function Zn(t,e,r,n,o){t!==e&&Vc(e,function(a,s){if(o||(o=new at),mt(a))Gc(t,e,s,r,Zn,n,o);else{var i=n?n(Qe(t,s),a,s+"",t,e,o):void 0;i===void 0&&(i=a),Ke(t,s,i)}},Nn)}function kc(t,e){return Xn(t,e)}var Hc=Gs(function(t,e,r){Zn(t,e,r)});const to=(t,e={keyListVar:"ALL_NODE_IDS",getReadValCode:""})=>{let r=t;return r[0]===String(Number(r[0]))&&(r=`_${r}`),`
|
|
1
|
+
(function(E,$){typeof exports=="object"&&typeof module<"u"?$(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],$):(E=typeof globalThis<"u"?globalThis:E||self,$(E.CRender={},E.React))})(this,function(E,$){"use strict";var Om=Object.defineProperty;var Em=(E,$,Mt)=>$ in E?Om(E,$,{enumerable:!0,configurable:!0,writable:!0,value:Mt}):E[$]=Mt;var w=(E,$,Mt)=>Em(E,typeof $!="symbol"?$+"":$,Mt);const Mt=t=>()=>{console.warn(`${t} need to be implement getComponent`)},Ja=["customPageRootRender"],en=["pageRender","render","convertModelToComponent","getComponent","getContext","getUtils","transformProps","errorCatch","requestAPI","clear"],rn=t=>[...en,...Ja].reduce((r,n)=>{var o;return t!=null&&t[n]?r[n]=(o=t[n])==null?void 0:o.bind(t):en.includes(n)&&(r[n]=Mt),r},{});var nn=typeof global=="object"&&global&&global.Object===Object&&global,Wa=typeof self=="object"&&self&&self.Object===Object&&self,X=nn||Wa||Function("return this")(),lt=X.Symbol,on=Object.prototype,Ka=on.hasOwnProperty,Qa=on.toString,qt=lt?lt.toStringTag:void 0;function Ya(t){var e=Ka.call(t,qt),r=t[qt];try{t[qt]=void 0;var n=!0}catch{}var o=Qa.call(t);return n&&(e?t[qt]=r:delete t[qt]),o}var Xa=Object.prototype,Za=Xa.toString;function ts(t){return Za.call(t)}var es="[object Null]",rs="[object Undefined]",an=lt?lt.toStringTag:void 0;function gt(t){return t==null?t===void 0?rs:es:an&&an in Object(t)?Ya(t):ts(t)}function ft(t){return t!=null&&typeof t=="object"}var ns="[object Symbol]";function os(t){return typeof t=="symbol"||ft(t)&>(t)==ns}function as(t,e){for(var r=-1,n=t==null?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}var nt=Array.isArray,sn=lt?lt.prototype:void 0,un=sn?sn.toString:void 0;function cn(t){if(typeof t=="string")return t;if(nt(t))return as(t,cn)+"";if(os(t))return un?un.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function mt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function ln(t){return t}var ss="[object AsyncFunction]",is="[object Function]",us="[object GeneratorFunction]",cs="[object Proxy]";function De(t){if(!mt(t))return!1;var e=gt(t);return e==is||e==us||e==ss||e==cs}var Le=X["__core-js_shared__"],fn=function(){var t=/[^.]+$/.exec(Le&&Le.keys&&Le.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function ls(t){return!!fn&&fn in t}var fs=Function.prototype,ds=fs.toString;function vt(t){if(t!=null){try{return ds.call(t)}catch{}try{return t+""}catch{}}return""}var ps=/[\\^$.*+?()[\]{}|]/g,hs=/^\[object .+?Constructor\]$/,gs=Function.prototype,ms=Object.prototype,vs=gs.toString,ys=ms.hasOwnProperty,bs=RegExp("^"+vs.call(ys).replace(ps,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function _s(t){if(!mt(t)||ls(t))return!1;var e=De(t)?bs:hs;return e.test(vt(t))}function Ss(t,e){return t==null?void 0:t[e]}function yt(t,e){var r=Ss(t,e);return _s(r)?r:void 0}var Fe=yt(X,"WeakMap"),dn=Object.create,Os=function(){function t(){}return function(e){if(!mt(e))return{};if(dn)return dn(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function Es(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Cs(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var ws=800,$s=16,Ns=Date.now;function js(t){var e=0,r=0;return function(){var n=Ns(),o=$s-(n-r);if(r=n,o>0){if(++e>=ws)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function As(t){return function(){return t}}var he=function(){try{var t=yt(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Ts=he?function(t,e){return he(t,"toString",{configurable:!0,enumerable:!1,value:As(e),writable:!0})}:ln,Ps=js(Ts),Ms=9007199254740991,xs=/^(?:0|[1-9]\d*)$/;function pn(t,e){var r=typeof t;return e=e??Ms,!!e&&(r=="number"||r!="symbol"&&xs.test(t))&&t>-1&&t%1==0&&t<e}function Ve(t,e,r){e=="__proto__"&&he?he(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Jt(t,e){return t===e||t!==t&&e!==e}var Rs=Object.prototype,Is=Rs.hasOwnProperty;function Ds(t,e,r){var n=t[e];(!(Is.call(t,e)&&Jt(n,r))||r===void 0&&!(e in t))&&Ve(t,e,r)}function Ls(t,e,r,n){var o=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var i=e[a],u=void 0;u===void 0&&(u=t[i]),o?Ve(r,i,u):Ds(r,i,u)}return r}var hn=Math.max;function Fs(t,e,r){return e=hn(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=hn(n.length-e,0),s=Array(a);++o<a;)s[o]=n[e+o];o=-1;for(var i=Array(e+1);++o<e;)i[o]=n[o];return i[e]=r(s),Es(t,this,i)}}function Vs(t,e){return Ps(Fs(t,e,ln),t+"")}var Us=9007199254740991;function gn(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Us}function ge(t){return t!=null&&gn(t.length)&&!De(t)}function Bs(t,e,r){if(!mt(r))return!1;var n=typeof e;return(n=="number"?ge(r)&&pn(e,r.length):n=="string"&&e in r)?Jt(r[e],t):!1}function ks(t){return Vs(function(e,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,s=o>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(o--,a):void 0,s&&Bs(r[0],r[1],s)&&(a=o<3?void 0:a,o=1),e=Object(e);++n<o;){var i=r[n];i&&t(e,i,n,a)}return e})}var Gs=Object.prototype;function Ue(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Gs;return t===r}function Hs(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var zs="[object Arguments]";function mn(t){return ft(t)&>(t)==zs}var vn=Object.prototype,qs=vn.hasOwnProperty,Js=vn.propertyIsEnumerable,Be=mn(function(){return arguments}())?mn:function(t){return ft(t)&&qs.call(t,"callee")&&!Js.call(t,"callee")};function Ws(){return!1}var yn=typeof E=="object"&&E&&!E.nodeType&&E,bn=yn&&typeof module=="object"&&module&&!module.nodeType&&module,Ks=bn&&bn.exports===yn,_n=Ks?X.Buffer:void 0,Qs=_n?_n.isBuffer:void 0,me=Qs||Ws,Ys="[object Arguments]",Xs="[object Array]",Zs="[object Boolean]",ti="[object Date]",ei="[object Error]",ri="[object Function]",ni="[object Map]",oi="[object Number]",ai="[object Object]",si="[object RegExp]",ii="[object Set]",ui="[object String]",ci="[object WeakMap]",li="[object ArrayBuffer]",fi="[object DataView]",di="[object Float32Array]",pi="[object Float64Array]",hi="[object Int8Array]",gi="[object Int16Array]",mi="[object Int32Array]",vi="[object Uint8Array]",yi="[object Uint8ClampedArray]",bi="[object Uint16Array]",_i="[object Uint32Array]",R={};R[di]=R[pi]=R[hi]=R[gi]=R[mi]=R[vi]=R[yi]=R[bi]=R[_i]=!0,R[Ys]=R[Xs]=R[li]=R[Zs]=R[fi]=R[ti]=R[ei]=R[ri]=R[ni]=R[oi]=R[ai]=R[si]=R[ii]=R[ui]=R[ci]=!1;function Si(t){return ft(t)&&gn(t.length)&&!!R[gt(t)]}function Oi(t){return function(e){return t(e)}}var Sn=typeof E=="object"&&E&&!E.nodeType&&E,Wt=Sn&&typeof module=="object"&&module&&!module.nodeType&&module,Ei=Wt&&Wt.exports===Sn,ke=Ei&&nn.process,On=function(){try{var t=Wt&&Wt.require&&Wt.require("util").types;return t||ke&&ke.binding&&ke.binding("util")}catch{}}(),En=On&&On.isTypedArray,Ge=En?Oi(En):Si,Ci=Object.prototype,wi=Ci.hasOwnProperty;function Cn(t,e){var r=nt(t),n=!r&&Be(t),o=!r&&!n&&me(t),a=!r&&!n&&!o&&Ge(t),s=r||n||o||a,i=s?Hs(t.length,String):[],u=i.length;for(var c in t)(e||wi.call(t,c))&&!(s&&(c=="length"||o&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||pn(c,u)))&&i.push(c);return i}function wn(t,e){return function(r){return t(e(r))}}var $i=wn(Object.keys,Object),Ni=Object.prototype,ji=Ni.hasOwnProperty;function Ai(t){if(!Ue(t))return $i(t);var e=[];for(var r in Object(t))ji.call(t,r)&&r!="constructor"&&e.push(r);return e}function Ti(t){return ge(t)?Cn(t):Ai(t)}function Pi(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Mi=Object.prototype,xi=Mi.hasOwnProperty;function Ri(t){if(!mt(t))return Pi(t);var e=Ue(t),r=[];for(var n in t)n=="constructor"&&(e||!xi.call(t,n))||r.push(n);return r}function $n(t){return ge(t)?Cn(t,!0):Ri(t)}var Kt=yt(Object,"create");function Ii(){this.__data__=Kt?Kt(null):{},this.size=0}function Di(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Li="__lodash_hash_undefined__",Fi=Object.prototype,Vi=Fi.hasOwnProperty;function Ui(t){var e=this.__data__;if(Kt){var r=e[t];return r===Li?void 0:r}return Vi.call(e,t)?e[t]:void 0}var Bi=Object.prototype,ki=Bi.hasOwnProperty;function Gi(t){var e=this.__data__;return Kt?e[t]!==void 0:ki.call(e,t)}var Hi="__lodash_hash_undefined__";function zi(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Kt&&e===void 0?Hi:e,this}function bt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}bt.prototype.clear=Ii,bt.prototype.delete=Di,bt.prototype.get=Ui,bt.prototype.has=Gi,bt.prototype.set=zi;function qi(){this.__data__=[],this.size=0}function ve(t,e){for(var r=t.length;r--;)if(Jt(t[r][0],e))return r;return-1}var Ji=Array.prototype,Wi=Ji.splice;function Ki(t){var e=this.__data__,r=ve(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Wi.call(e,r,1),--this.size,!0}function Qi(t){var e=this.__data__,r=ve(e,t);return r<0?void 0:e[r][1]}function Yi(t){return ve(this.__data__,t)>-1}function Xi(t,e){var r=this.__data__,n=ve(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function ot(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ot.prototype.clear=qi,ot.prototype.delete=Ki,ot.prototype.get=Qi,ot.prototype.has=Yi,ot.prototype.set=Xi;var Qt=yt(X,"Map");function Zi(){this.size=0,this.__data__={hash:new bt,map:new(Qt||ot),string:new bt}}function tu(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function ye(t,e){var r=t.__data__;return tu(e)?r[typeof e=="string"?"string":"hash"]:r.map}function eu(t){var e=ye(this,t).delete(t);return this.size-=e?1:0,e}function ru(t){return ye(this,t).get(t)}function nu(t){return ye(this,t).has(t)}function ou(t,e){var r=ye(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function _t(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}_t.prototype.clear=Zi,_t.prototype.delete=eu,_t.prototype.get=ru,_t.prototype.has=nu,_t.prototype.set=ou;function Nn(t){return t==null?"":cn(t)}function au(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}var jn=wn(Object.getPrototypeOf,Object),su="[object Object]",iu=Function.prototype,uu=Object.prototype,An=iu.toString,cu=uu.hasOwnProperty,lu=An.call(Object);function xt(t){if(!ft(t)||gt(t)!=su)return!1;var e=jn(t);if(e===null)return!0;var r=cu.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&An.call(r)==lu}function fu(t,e,r){var n=-1,o=t.length;e<0&&(e=-e>o?0:o+e),r=r>o?o:r,r<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(o);++n<o;)a[n]=t[n+e];return a}function du(t,e,r){var n=t.length;return r=r===void 0?n:r,fu(t,e,r)}var pu="\\ud800-\\udfff",hu="\\u0300-\\u036f",gu="\\ufe20-\\ufe2f",mu="\\u20d0-\\u20ff",vu=hu+gu+mu,yu="\\ufe0e\\ufe0f",bu="\\u200d",_u=RegExp("["+bu+pu+vu+yu+"]");function Tn(t){return _u.test(t)}function Su(t){return t.split("")}var Pn="\\ud800-\\udfff",Ou="\\u0300-\\u036f",Eu="\\ufe20-\\ufe2f",Cu="\\u20d0-\\u20ff",wu=Ou+Eu+Cu,$u="\\ufe0e\\ufe0f",Nu="["+Pn+"]",He="["+wu+"]",ze="\\ud83c[\\udffb-\\udfff]",ju="(?:"+He+"|"+ze+")",Mn="[^"+Pn+"]",xn="(?:\\ud83c[\\udde6-\\uddff]){2}",Rn="[\\ud800-\\udbff][\\udc00-\\udfff]",Au="\\u200d",In=ju+"?",Dn="["+$u+"]?",Tu="(?:"+Au+"(?:"+[Mn,xn,Rn].join("|")+")"+Dn+In+")*",Pu=Dn+In+Tu,Mu="(?:"+[Mn+He+"?",He,xn,Rn,Nu].join("|")+")",xu=RegExp(ze+"(?="+ze+")|"+Mu+Pu,"g");function Ru(t){return t.match(xu)||[]}function Iu(t){return Tn(t)?Ru(t):Su(t)}function Du(t){return function(e){e=Nn(e);var r=Tn(e)?Iu(e):void 0,n=r?r[0]:e.charAt(0),o=r?du(r,1).join(""):e.slice(1);return n[t]()+o}}var Lu=Du("toUpperCase");function Fu(t){return Lu(Nn(t).toLowerCase())}function Vu(){this.__data__=new ot,this.size=0}function Uu(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function Bu(t){return this.__data__.get(t)}function ku(t){return this.__data__.has(t)}var Gu=200;function Hu(t,e){var r=this.__data__;if(r instanceof ot){var n=r.__data__;if(!Qt||n.length<Gu-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new _t(n)}return r.set(t,e),this.size=r.size,this}function at(t){var e=this.__data__=new ot(t);this.size=e.size}at.prototype.clear=Vu,at.prototype.delete=Uu,at.prototype.get=Bu,at.prototype.has=ku,at.prototype.set=Hu;var Ln=typeof E=="object"&&E&&!E.nodeType&&E,Fn=Ln&&typeof module=="object"&&module&&!module.nodeType&&module,zu=Fn&&Fn.exports===Ln,Vn=zu?X.Buffer:void 0;Vn&&Vn.allocUnsafe;function qu(t,e){return t.slice()}function Ju(t,e){for(var r=-1,n=t==null?0:t.length,o=0,a=[];++r<n;){var s=t[r];e(s,r,t)&&(a[o++]=s)}return a}function Wu(){return[]}var Ku=Object.prototype,Qu=Ku.propertyIsEnumerable,Un=Object.getOwnPropertySymbols,Yu=Un?function(t){return t==null?[]:(t=Object(t),Ju(Un(t),function(e){return Qu.call(t,e)}))}:Wu;function Xu(t,e,r){var n=e(t);return nt(t)?n:au(n,r(t))}function Bn(t){return Xu(t,Ti,Yu)}var qe=yt(X,"DataView"),Je=yt(X,"Promise"),We=yt(X,"Set"),kn="[object Map]",Zu="[object Object]",Gn="[object Promise]",Hn="[object Set]",zn="[object WeakMap]",qn="[object DataView]",tc=vt(qe),ec=vt(Qt),rc=vt(Je),nc=vt(We),oc=vt(Fe),dt=gt;(qe&&dt(new qe(new ArrayBuffer(1)))!=qn||Qt&&dt(new Qt)!=kn||Je&&dt(Je.resolve())!=Gn||We&&dt(new We)!=Hn||Fe&&dt(new Fe)!=zn)&&(dt=function(t){var e=gt(t),r=e==Zu?t.constructor:void 0,n=r?vt(r):"";if(n)switch(n){case tc:return qn;case ec:return kn;case rc:return Gn;case nc:return Hn;case oc:return zn}return e});var be=X.Uint8Array;function ac(t){var e=new t.constructor(t.byteLength);return new be(e).set(new be(t)),e}function sc(t,e){var r=ac(t.buffer);return new t.constructor(r,t.byteOffset,t.length)}function ic(t){return typeof t.constructor=="function"&&!Ue(t)?Os(jn(t)):{}}var uc="__lodash_hash_undefined__";function cc(t){return this.__data__.set(t,uc),this}function lc(t){return this.__data__.has(t)}function _e(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new _t;++e<r;)this.add(t[e])}_e.prototype.add=_e.prototype.push=cc,_e.prototype.has=lc;function fc(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function dc(t,e){return t.has(e)}var pc=1,hc=2;function Jn(t,e,r,n,o,a){var s=r&pc,i=t.length,u=e.length;if(i!=u&&!(s&&u>i))return!1;var c=a.get(t),d=a.get(e);if(c&&d)return c==e&&d==t;var l=-1,f=!0,h=r&hc?new _e:void 0;for(a.set(t,e),a.set(e,t);++l<i;){var g=t[l],b=e[l];if(n)var p=s?n(b,g,l,e,t,a):n(g,b,l,t,e,a);if(p!==void 0){if(p)continue;f=!1;break}if(h){if(!fc(e,function(m,v){if(!dc(h,v)&&(g===m||o(g,m,r,n,a)))return h.push(v)})){f=!1;break}}else if(!(g===b||o(g,b,r,n,a))){f=!1;break}}return a.delete(t),a.delete(e),f}function gc(t){var e=-1,r=Array(t.size);return t.forEach(function(n,o){r[++e]=[o,n]}),r}function mc(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var vc=1,yc=2,bc="[object Boolean]",_c="[object Date]",Sc="[object Error]",Oc="[object Map]",Ec="[object Number]",Cc="[object RegExp]",wc="[object Set]",$c="[object String]",Nc="[object Symbol]",jc="[object ArrayBuffer]",Ac="[object DataView]",Wn=lt?lt.prototype:void 0,Ke=Wn?Wn.valueOf:void 0;function Tc(t,e,r,n,o,a,s){switch(r){case Ac:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case jc:return!(t.byteLength!=e.byteLength||!a(new be(t),new be(e)));case bc:case _c:case Ec:return Jt(+t,+e);case Sc:return t.name==e.name&&t.message==e.message;case Cc:case $c:return t==e+"";case Oc:var i=gc;case wc:var u=n&vc;if(i||(i=mc),t.size!=e.size&&!u)return!1;var c=s.get(t);if(c)return c==e;n|=yc,s.set(t,e);var d=Jn(i(t),i(e),n,o,a,s);return s.delete(t),d;case Nc:if(Ke)return Ke.call(t)==Ke.call(e)}return!1}var Pc=1,Mc=Object.prototype,xc=Mc.hasOwnProperty;function Rc(t,e,r,n,o,a){var s=r&Pc,i=Bn(t),u=i.length,c=Bn(e),d=c.length;if(u!=d&&!s)return!1;for(var l=u;l--;){var f=i[l];if(!(s?f in e:xc.call(e,f)))return!1}var h=a.get(t),g=a.get(e);if(h&&g)return h==e&&g==t;var b=!0;a.set(t,e),a.set(e,t);for(var p=s;++l<u;){f=i[l];var m=t[f],v=e[f];if(n)var y=s?n(v,m,f,e,t,a):n(m,v,f,t,e,a);if(!(y===void 0?m===v||o(m,v,r,n,a):y)){b=!1;break}p||(p=f=="constructor")}if(b&&!p){var _=t.constructor,O=e.constructor;_!=O&&"constructor"in t&&"constructor"in e&&!(typeof _=="function"&&_ instanceof _&&typeof O=="function"&&O instanceof O)&&(b=!1)}return a.delete(t),a.delete(e),b}var Ic=1,Kn="[object Arguments]",Qn="[object Array]",Se="[object Object]",Dc=Object.prototype,Yn=Dc.hasOwnProperty;function Lc(t,e,r,n,o,a){var s=nt(t),i=nt(e),u=s?Qn:dt(t),c=i?Qn:dt(e);u=u==Kn?Se:u,c=c==Kn?Se:c;var d=u==Se,l=c==Se,f=u==c;if(f&&me(t)){if(!me(e))return!1;s=!0,d=!1}if(f&&!d)return a||(a=new at),s||Ge(t)?Jn(t,e,r,n,o,a):Tc(t,e,u,r,n,o,a);if(!(r&Ic)){var h=d&&Yn.call(t,"__wrapped__"),g=l&&Yn.call(e,"__wrapped__");if(h||g){var b=h?t.value():t,p=g?e.value():e;return a||(a=new at),o(b,p,r,n,a)}}return f?(a||(a=new at),Rc(t,e,r,n,o,a)):!1}function Xn(t,e,r,n,o){return t===e?!0:t==null||e==null||!ft(t)&&!ft(e)?t!==t&&e!==e:Lc(t,e,r,n,Xn,o)}function Fc(t){return function(e,r,n){for(var o=-1,a=Object(e),s=n(e),i=s.length;i--;){var u=s[++o];if(r(a[u],u,a)===!1)break}return e}}var Vc=Fc();function Qe(t,e,r){(r!==void 0&&!Jt(t[e],r)||r===void 0&&!(e in t))&&Ve(t,e,r)}function Uc(t){return ft(t)&&ge(t)}function Ye(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Bc(t){return Ls(t,$n(t))}function kc(t,e,r,n,o,a,s){var i=Ye(t,r),u=Ye(e,r),c=s.get(u);if(c){Qe(t,r,c);return}var d=a?a(i,u,r+"",t,e,s):void 0,l=d===void 0;if(l){var f=nt(u),h=!f&&me(u),g=!f&&!h&&Ge(u);d=u,f||h||g?nt(i)?d=i:Uc(i)?d=Cs(i):h?(l=!1,d=qu(u)):g?(l=!1,d=sc(u)):d=[]:xt(u)||Be(u)?(d=i,Be(i)?d=Bc(i):(!mt(i)||De(i))&&(d=ic(u))):l=!1}l&&(s.set(u,d),o(d,u,n,a,s),s.delete(u)),Qe(t,r,d)}function Zn(t,e,r,n,o){t!==e&&Vc(e,function(a,s){if(o||(o=new at),mt(a))kc(t,e,s,r,Zn,n,o);else{var i=n?n(Ye(t,s),a,s+"",t,e,o):void 0;i===void 0&&(i=a),Qe(t,s,i)}},$n)}function Gc(t,e){return Xn(t,e)}var Hc=ks(function(t,e,r){Zn(t,e,r)});const to=(t,e={keyListVar:"ALL_NODE_IDS",getReadValCode:""})=>{let r=t;return r[0]===String(Number(r[0]))&&(r=`_${r}`),`
|
|
2
2
|
var ${t} = {};
|
|
3
3
|
|
|
4
4
|
${e.keyListVar}.forEach(function (key) {
|
|
@@ -11,7 +11,7 @@ ${e.keyListVar}.forEach(function (key) {
|
|
|
11
11
|
enumerable: true
|
|
12
12
|
});
|
|
13
13
|
});
|
|
14
|
-
`},zc=function(t){return!(!t||typeof t!="function"||!t.prototype)};function eo(t){const e=t==null?void 0:t.prototype;return!!(e&&e.isReactComponent)}function ro(t){var n,o;const r=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.forward_ref"):60112;return(t==null?void 0:t.$$typeof)===r||((n=t==null?void 0:t.prototype)==null?void 0:n.isReactComponent)||((o=t==null?void 0:t.prototype)==null?void 0:o.setState)||t._forwardRef}function no(t){class e extends
|
|
14
|
+
`},zc=function(t){return!(!t||typeof t!="function"||!t.prototype)};function eo(t){const e=t==null?void 0:t.prototype;return!!(e&&e.isReactComponent)}function ro(t){var n,o;const r=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.forward_ref"):60112;return(t==null?void 0:t.$$typeof)===r||((n=t==null?void 0:t.prototype)==null?void 0:n.isReactComponent)||((o=t==null?void 0:t.prototype)==null?void 0:o.setState)||t._forwardRef}function no(t){class e extends $.Component{render(){return $.createElement(t,this.props)}}return e.displayName=t.displayName,e}const St=(t,e)=>{const r=n=>{let o=`function run () { return ${n}; }`;return String(n).includes("return ")&&(o=`function runExp () { ${n} }`),Rt({funcBody:o,funcName:"run",nodeContext:e.nodeContext,storeManager:e.storeManager,nodeModel:e.nodeModel})()};try{return r(t)}catch(n){console.warn(n);const o=`[${t}] expression run failed`;return console.warn(o),null}},Rt=t=>{const{funcBody:e,funcName:r,nodeContext:n,storeManager:o,$$response:a,nodeModel:s,actionVariableSpace:i}=t,u=r||"anonymous";return{[u]:function(...d){let l;const h=Object.keys(i||{}).map(g=>`var ${g} = $ACTION_VAR_SPACE[${JSON.stringify(g)}];`);try{return l=`
|
|
15
15
|
var $$$__args__$$$ = Array.from(arguments);
|
|
16
16
|
function $$_run_$$() {
|
|
17
17
|
var __extraParams = $$$__args__$$$.pop();
|
|
@@ -20,7 +20,9 @@ ${e.keyListVar}.forEach(function (key) {
|
|
|
20
20
|
var $RESPONSE = __extraParams.$$context;
|
|
21
21
|
var $CTX = __extraParams.$$context;
|
|
22
22
|
var $$context = $CTX;
|
|
23
|
-
var
|
|
23
|
+
var $PARAMS = $$context.params || {};
|
|
24
|
+
var $Event = $$$__args__$$$[0];
|
|
25
|
+
var $ARGS = $$$__args__$$$;
|
|
24
26
|
|
|
25
27
|
var $ACTION_VAR_SPACE = __extraParams.actionVariableSpace;
|
|
26
28
|
// 新增的变量
|
|
@@ -35,6 +37,7 @@ ${e.keyListVar}.forEach(function (key) {
|
|
|
35
37
|
var $STATE = __$$storeManager__.getState($N_ID);
|
|
36
38
|
var $LOOP_DATA = $CTX.loopData;
|
|
37
39
|
|
|
40
|
+
|
|
38
41
|
${to("$ALL_STATE",{keyListVar:"$ALL_NODE_IDS ",getReadValCode:"return __$$storeManager__.getState(key);"})}
|
|
39
42
|
|
|
40
43
|
${to("$U_STATE",{keyListVar:"$ALL_NODE_IDS ",getReadValCode:"return function (newVal) { __$$storeManager__.setState(key, newVal); }"})}
|
|
@@ -49,14 +52,14 @@ ${to("$U_STATE",{keyListVar:"$ALL_NODE_IDS ",getReadValCode:"return function (ne
|
|
|
49
52
|
return $$_f_$$.apply($$_f_$$, $$$__args__$$$);
|
|
50
53
|
}
|
|
51
54
|
return $$_run_$$();
|
|
52
|
-
`,new Function(l)(...d,{$$context:n,storeManager:o,$$response:a,actionVariableSpace:i,nodeModel:s})}catch(g){console.warn(g)}}}[u]},Ye=(t,e)=>{const r={};return e.forEach((n,o)=>{r[n]=t[o]}),r},oo=(t=[])=>{const e={};return t.forEach(({property:r,value:n})=>{let o=r.replace("-webkit","Webkit");o=o.replace("-ms","ms"),o=o.replace("-moz","Moz"),o=o.replace("-o","O");let a=o.split("-");a.length>=2&&(a=a.map((s,i)=>i!==0?Fu(s):s)),e[a.join("")]=n}),e},qc=t=>{let e="";return Object.keys(t||{}).forEach(r=>{e+=`${r}:${t[r]};`}),e},Jc=(t,e)=>{const r={};return t.forEach(n=>{if(n.globalName){const o=e[n.globalName];o&&(r[n.globalName]=o,o.__esModule&&o.default&&(r[n.globalName]=o.default))}}),r},Wc=(t,e=1)=>{let r=0,n=t,o={},a={};for(;r<e;)Object.keys(n).forEach(s=>{o={...o,...n[s]}}),a=o,n=o,o={},r+=1;return a},ao=(t,e)=>{const r=[];return e.forEach(n=>{const a=n.exec(t);a!=null&&a.length&&r.push(a[1])}),r},so=(t,e)=>{const r={};return e.forEach(n=>{t[n.name]&&(r[n.name]=t[n.name])}),r},Kc=(t,e)=>so(t,e),Qc=(t,e)=>so(t,e),Xe=t=>{var r;return((r=t.value.css)==null?void 0:r.class)||`c_${t.id}`},io=(t,e)=>{const r=t.split(".");let n,o=e;return r.forEach(a=>{n=o==null?void 0:o[a],o=n}),n||(()=>`Component [${t}] not found`)},Ze=(t,e)=>{const r={...t};return r.__proto__=e,r},Yc={},uo=t=>{let e;const r=new Set,n=(d,l)=>{const f=typeof d=="function"?d(e):d;if(!Object.is(f,e)){const h=e;e=l??(typeof f!="object"||f===null)?f:Object.assign({},e,f),r.forEach(g=>g(e,h))}},o=()=>e,u={setState:n,getState:o,getInitialState:()=>c,subscribe:d=>(r.add(d),()=>r.delete(d)),destroy:()=>{(Yc?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},c=e=t(n,o,u);return u},Xc=t=>t?uo(t):uo;class Zc{constructor(){w(this,"storeMap",new Map)}addStore(e,r){const n=Xc(r);return this.storeMap.set(e,n),n.name=e,n}setStore(e,r){this.storeMap.set(e,r)}removeStore(e){this.storeMap.delete(e)}getStore(e){return this.storeMap.get(e)}getState(e){var r;return(r=this.storeMap.get(e))==null?void 0:r.getState()}getStateObj(e){return{state:this.getState(e),updateState:r=>{this.setState(e,r)}}}setState(e,r){var n;return(n=this.storeMap.get(e))==null?void 0:n.setState(r)}connect(e,r){const n=this.storeMap.get(e);return n?n.subscribe(r):(console.warn("store not exits"),()=>{})}getStateSnapshot(){const e={};return this.storeMap.forEach((r,n)=>{e[n]=this.getStateObj(n)}),e}destroy(){this.storeMap=new Map}}class tl{constructor(){w(this,"varSpace",new Map)}get(e){return this.varSpace.get(e)}add(e,r){this.varSpace.set(e,r)}remove(e){this.varSpace.delete(e)}destroy(){this.varSpace.clear()}getStateSnapshot(){const e={};return this.varSpace.forEach((r,n)=>{e[n]=r}),e}}class tr{constructor(){w(this,"refMap",new Map)}get(e){return this.refMap.get(e)}add(e,r){this.refMap.set(e,r)}remove(e){this.refMap.delete(e)}destroy(){this.refMap.clear()}}var el=Object.defineProperty,rl=(t,e,r)=>e in t?el(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,j=(t,e,r)=>rl(t,typeof e!="symbol"?e+"":e,r),co=typeof global=="object"&&global&&global.Object===Object&&global,nl=typeof self=="object"&&self&&self.Object===Object&&self,Z=co||nl||Function("return this")(),z=Z.Symbol,lo=Object.prototype,ol=lo.hasOwnProperty,al=lo.toString,Yt=z?z.toStringTag:void 0;function sl(t){var e=ol.call(t,Yt),r=t[Yt];try{t[Yt]=void 0;var n=!0}catch{}var o=al.call(t);return n&&(e?t[Yt]=r:delete t[Yt]),o}var il=Object.prototype,ul=il.toString;function cl(t){return ul.call(t)}var ll="[object Null]",fl="[object Undefined]",fo=z?z.toStringTag:void 0;function Ot(t){return t==null?t===void 0?fl:ll:fo&&fo in Object(t)?sl(t):cl(t)}function tt(t){return t!=null&&typeof t=="object"}var dl="[object Symbol]";function er(t){return typeof t=="symbol"||tt(t)&&Ot(t)==dl}function rr(t,e){for(var r=-1,n=t==null?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}var F=Array.isArray,po=z?z.prototype:void 0,ho=po?po.toString:void 0;function go(t){if(typeof t=="string")return t;if(F(t))return rr(t,go)+"";if(er(t))return ho?ho.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function J(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function nr(t){return t}var pl="[object AsyncFunction]",hl="[object Function]",gl="[object GeneratorFunction]",ml="[object Proxy]";function or(t){if(!J(t))return!1;var e=Ot(t);return e==hl||e==gl||e==pl||e==ml}var ar=Z["__core-js_shared__"],mo=function(){var t=/[^.]+$/.exec(ar&&ar.keys&&ar.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function vl(t){return!!mo&&mo in t}var yl=Function.prototype,bl=yl.toString;function Ct(t){if(t!=null){try{return bl.call(t)}catch{}try{return t+""}catch{}}return""}var _l=/[\\^$.*+?()[\]{}|]/g,Sl=/^\[object .+?Constructor\]$/,Ol=Function.prototype,Cl=Object.prototype,El=Ol.toString,wl=Cl.hasOwnProperty,Nl=RegExp("^"+El.call(wl).replace(_l,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function $l(t){if(!J(t)||vl(t))return!1;var e=or(t)?Nl:Sl;return e.test(Ct(t))}function jl(t,e){return t==null?void 0:t[e]}function Et(t,e){var r=jl(t,e);return $l(r)?r:void 0}var sr=Et(Z,"WeakMap"),vo=Object.create,Al=function(){function t(){}return function(e){if(!J(e))return{};if(vo)return vo(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function Tl(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Ml(){}function yo(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var Pl=800,xl=16,Rl=Date.now;function Il(t){var e=0,r=0;return function(){var n=Rl(),o=xl-(n-r);if(r=n,o>0){if(++e>=Pl)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Dl(t){return function(){return t}}var Se=function(){try{var t=Et(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Ll=Se?function(t,e){return Se(t,"toString",{configurable:!0,enumerable:!1,value:Dl(e),writable:!0})}:nr,bo=Il(Ll);function Fl(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}function Vl(t,e,r,n){for(var o=t.length,a=r+-1;++a<o;)if(e(t[a],a,t))return a;return-1}function Ul(t){return t!==t}function Bl(t,e,r){for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}function Gl(t,e,r){return e===e?Bl(t,e,r):Vl(t,Ul,r)}function kl(t,e){var r=t==null?0:t.length;return!!r&&Gl(t,e,0)>-1}var Hl=9007199254740991,zl=/^(?:0|[1-9]\d*)$/;function Oe(t,e){var r=typeof t;return e=e??Hl,!!e&&(r=="number"||r!="symbol"&&zl.test(t))&&t>-1&&t%1==0&&t<e}function ir(t,e,r){e=="__proto__"&&Se?Se(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Xt(t,e){return t===e||t!==t&&e!==e}var ql=Object.prototype,Jl=ql.hasOwnProperty;function ur(t,e,r){var n=t[e];(!(Jl.call(t,e)&&Xt(n,r))||r===void 0&&!(e in t))&&ir(t,e,r)}function Rt(t,e,r,n){var o=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var i=e[a],u=void 0;u===void 0&&(u=t[i]),o?ir(r,i,u):ur(r,i,u)}return r}var _o=Math.max;function So(t,e,r){return e=_o(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=_o(n.length-e,0),s=Array(a);++o<a;)s[o]=n[e+o];o=-1;for(var i=Array(e+1);++o<e;)i[o]=n[o];return i[e]=r(s),Tl(t,this,i)}}function Oo(t,e){return bo(So(t,e,nr),t+"")}var Wl=9007199254740991;function cr(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Wl}function Ce(t){return t!=null&&cr(t.length)&&!or(t)}function Kl(t,e,r){if(!J(r))return!1;var n=typeof e;return(n=="number"?Ce(r)&&Oe(e,r.length):n=="string"&&e in r)?Xt(r[e],t):!1}function Ql(t){return Oo(function(e,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,s=o>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(o--,a):void 0,s&&Kl(r[0],r[1],s)&&(a=o<3?void 0:a,o=1),e=Object(e);++n<o;){var i=r[n];i&&t(e,i,n,a)}return e})}var Yl=Object.prototype;function lr(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Yl;return t===r}function Xl(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Zl="[object Arguments]";function Co(t){return tt(t)&&Ot(t)==Zl}var Eo=Object.prototype,tf=Eo.hasOwnProperty,ef=Eo.propertyIsEnumerable,Zt=Co(function(){return arguments}())?Co:function(t){return tt(t)&&tf.call(t,"callee")&&!ef.call(t,"callee")};function rf(){return!1}var wo=typeof C=="object"&&C&&!C.nodeType&&C,No=wo&&typeof module=="object"&&module&&!module.nodeType&&module,nf=No&&No.exports===wo,$o=nf?Z.Buffer:void 0,of=$o?$o.isBuffer:void 0,te=of||rf,af="[object Arguments]",sf="[object Array]",uf="[object Boolean]",cf="[object Date]",lf="[object Error]",ff="[object Function]",df="[object Map]",pf="[object Number]",hf="[object Object]",gf="[object RegExp]",mf="[object Set]",vf="[object String]",yf="[object WeakMap]",bf="[object ArrayBuffer]",_f="[object DataView]",Sf="[object Float32Array]",Of="[object Float64Array]",Cf="[object Int8Array]",Ef="[object Int16Array]",wf="[object Int32Array]",Nf="[object Uint8Array]",$f="[object Uint8ClampedArray]",jf="[object Uint16Array]",Af="[object Uint32Array]",I={};I[Sf]=I[Of]=I[Cf]=I[Ef]=I[wf]=I[Nf]=I[$f]=I[jf]=I[Af]=!0,I[af]=I[sf]=I[bf]=I[uf]=I[_f]=I[cf]=I[lf]=I[ff]=I[df]=I[pf]=I[hf]=I[gf]=I[mf]=I[vf]=I[yf]=!1;function Tf(t){return tt(t)&&cr(t.length)&&!!I[Ot(t)]}function fr(t){return function(e){return t(e)}}var jo=typeof C=="object"&&C&&!C.nodeType&&C,ee=jo&&typeof module=="object"&&module&&!module.nodeType&&module,Mf=ee&&ee.exports===jo,dr=Mf&&co.process,It=function(){try{var t=ee&&ee.require&&ee.require("util").types;return t||dr&&dr.binding&&dr.binding("util")}catch{}}(),Ao=It&&It.isTypedArray,pr=Ao?fr(Ao):Tf,Pf=Object.prototype,xf=Pf.hasOwnProperty;function To(t,e){var r=F(t),n=!r&&Zt(t),o=!r&&!n&&te(t),a=!r&&!n&&!o&&pr(t),s=r||n||o||a,i=s?Xl(t.length,String):[],u=i.length;for(var c in t)(e||xf.call(t,c))&&!(s&&(c=="length"||o&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Oe(c,u)))&&i.push(c);return i}function Mo(t,e){return function(r){return t(e(r))}}var Rf=Mo(Object.keys,Object),If=Object.prototype,Df=If.hasOwnProperty;function Lf(t){if(!lr(t))return Rf(t);var e=[];for(var r in Object(t))Df.call(t,r)&&r!="constructor"&&e.push(r);return e}function Ee(t){return Ce(t)?To(t):Lf(t)}function Ff(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Vf=Object.prototype,Uf=Vf.hasOwnProperty;function Bf(t){if(!J(t))return Ff(t);var e=lr(t),r=[];for(var n in t)n=="constructor"&&(e||!Uf.call(t,n))||r.push(n);return r}function re(t){return Ce(t)?To(t,!0):Bf(t)}var Gf=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,kf=/^\w*$/;function hr(t,e){if(F(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||er(t)?!0:kf.test(t)||!Gf.test(t)||e!=null&&t in Object(e)}var ne=Et(Object,"create");function Hf(){this.__data__=ne?ne(null):{},this.size=0}function zf(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var qf="__lodash_hash_undefined__",Jf=Object.prototype,Wf=Jf.hasOwnProperty;function Kf(t){var e=this.__data__;if(ne){var r=e[t];return r===qf?void 0:r}return Wf.call(e,t)?e[t]:void 0}var Qf=Object.prototype,Yf=Qf.hasOwnProperty;function Xf(t){var e=this.__data__;return ne?e[t]!==void 0:Yf.call(e,t)}var Zf="__lodash_hash_undefined__";function td(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=ne&&e===void 0?Zf:e,this}function wt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}wt.prototype.clear=Hf,wt.prototype.delete=zf,wt.prototype.get=Kf,wt.prototype.has=Xf,wt.prototype.set=td;function ed(){this.__data__=[],this.size=0}function we(t,e){for(var r=t.length;r--;)if(Xt(t[r][0],e))return r;return-1}var rd=Array.prototype,nd=rd.splice;function od(t){var e=this.__data__,r=we(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():nd.call(e,r,1),--this.size,!0}function ad(t){var e=this.__data__,r=we(e,t);return r<0?void 0:e[r][1]}function sd(t){return we(this.__data__,t)>-1}function id(t,e){var r=this.__data__,n=we(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function st(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}st.prototype.clear=ed,st.prototype.delete=od,st.prototype.get=ad,st.prototype.has=sd,st.prototype.set=id;var oe=Et(Z,"Map");function ud(){this.size=0,this.__data__={hash:new wt,map:new(oe||st),string:new wt}}function cd(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Ne(t,e){var r=t.__data__;return cd(e)?r[typeof e=="string"?"string":"hash"]:r.map}function ld(t){var e=Ne(this,t).delete(t);return this.size-=e?1:0,e}function fd(t){return Ne(this,t).get(t)}function dd(t){return Ne(this,t).has(t)}function pd(t,e){var r=Ne(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function it(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}it.prototype.clear=ud,it.prototype.delete=ld,it.prototype.get=fd,it.prototype.has=dd,it.prototype.set=pd;var hd="Expected a function";function gr(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(hd);var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var s=t.apply(this,n);return r.cache=a.set(o,s)||a,s};return r.cache=new(gr.Cache||it),r}gr.Cache=it;var gd=500;function md(t){var e=gr(t,function(n){return r.size===gd&&r.clear(),n}),r=e.cache;return e}var vd=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,yd=/\\(\\)?/g,bd=md(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(vd,function(r,n,o,a){e.push(o?a.replace(yd,"$1"):n||r)}),e});function _d(t){return t==null?"":go(t)}function Dt(t,e){return F(t)?t:hr(t,e)?[t]:bd(_d(t))}function Lt(t){if(typeof t=="string"||er(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function $e(t,e){e=Dt(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Lt(e[r++])];return r&&r==n?t:void 0}function Po(t,e,r){var n=t==null?void 0:$e(t,e);return n===void 0?r:n}function mr(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}var xo=z?z.isConcatSpreadable:void 0;function Sd(t){return F(t)||Zt(t)||!!(xo&&t&&t[xo])}function Ro(t,e,r,n,o){var a=-1,s=t.length;for(r||(r=Sd),o||(o=[]);++a<s;){var i=t[a];r(i)?mr(o,i):n||(o[o.length]=i)}return o}function Od(t){var e=t==null?0:t.length;return e?Ro(t):[]}function Cd(t){return bo(So(t,void 0,Od),t+"")}var vr=Mo(Object.getPrototypeOf,Object),Ed="[object Object]",wd=Function.prototype,Nd=Object.prototype,Io=wd.toString,$d=Nd.hasOwnProperty,jd=Io.call(Object);function V(t){if(!tt(t)||Ot(t)!=Ed)return!1;var e=vr(t);if(e===null)return!0;var r=$d.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Io.call(r)==jd}function Ad(t,e,r){var n=-1,o=t.length;e<0&&(e=-e>o?0:o+e),r=r>o?o:r,r<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(o);++n<o;)a[n]=t[n+e];return a}function Td(){this.__data__=new st,this.size=0}function Md(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function Pd(t){return this.__data__.get(t)}function xd(t){return this.__data__.has(t)}var Rd=200;function Id(t,e){var r=this.__data__;if(r instanceof st){var n=r.__data__;if(!oe||n.length<Rd-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new it(n)}return r.set(t,e),this.size=r.size,this}function W(t){var e=this.__data__=new st(t);this.size=e.size}W.prototype.clear=Td,W.prototype.delete=Md,W.prototype.get=Pd,W.prototype.has=xd,W.prototype.set=Id;function Dd(t,e){return t&&Rt(e,Ee(e),t)}function Ld(t,e){return t&&Rt(e,re(e),t)}var Do=typeof C=="object"&&C&&!C.nodeType&&C,Lo=Do&&typeof module=="object"&&module&&!module.nodeType&&module,Fd=Lo&&Lo.exports===Do,Fo=Fd?Z.Buffer:void 0,Vo=Fo?Fo.allocUnsafe:void 0;function Uo(t,e){if(e)return t.slice();var r=t.length,n=Vo?Vo(r):new t.constructor(r);return t.copy(n),n}function Vd(t,e){for(var r=-1,n=t==null?0:t.length,o=0,a=[];++r<n;){var s=t[r];e(s,r,t)&&(a[o++]=s)}return a}function Bo(){return[]}var Ud=Object.prototype,Bd=Ud.propertyIsEnumerable,Go=Object.getOwnPropertySymbols,yr=Go?function(t){return t==null?[]:(t=Object(t),Vd(Go(t),function(e){return Bd.call(t,e)}))}:Bo;function Gd(t,e){return Rt(t,yr(t),e)}var kd=Object.getOwnPropertySymbols,ko=kd?function(t){for(var e=[];t;)mr(e,yr(t)),t=vr(t);return e}:Bo;function Hd(t,e){return Rt(t,ko(t),e)}function Ho(t,e,r){var n=e(t);return F(t)?n:mr(n,r(t))}function br(t){return Ho(t,Ee,yr)}function _r(t){return Ho(t,re,ko)}var Sr=Et(Z,"DataView"),Or=Et(Z,"Promise"),Ft=Et(Z,"Set"),zo="[object Map]",zd="[object Object]",qo="[object Promise]",Jo="[object Set]",Wo="[object WeakMap]",Ko="[object DataView]",qd=Ct(Sr),Jd=Ct(oe),Wd=Ct(Or),Kd=Ct(Ft),Qd=Ct(sr),K=Ot;(Sr&&K(new Sr(new ArrayBuffer(1)))!=Ko||oe&&K(new oe)!=zo||Or&&K(Or.resolve())!=qo||Ft&&K(new Ft)!=Jo||sr&&K(new sr)!=Wo)&&(K=function(t){var e=Ot(t),r=e==zd?t.constructor:void 0,n=r?Ct(r):"";if(n)switch(n){case qd:return Ko;case Jd:return zo;case Wd:return qo;case Kd:return Jo;case Qd:return Wo}return e});var Yd=Object.prototype,Xd=Yd.hasOwnProperty;function Zd(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&Xd.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var je=Z.Uint8Array;function Cr(t){var e=new t.constructor(t.byteLength);return new je(e).set(new je(t)),e}function tp(t,e){var r=e?Cr(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var ep=/\w*$/;function rp(t){var e=new t.constructor(t.source,ep.exec(t));return e.lastIndex=t.lastIndex,e}var Qo=z?z.prototype:void 0,Yo=Qo?Qo.valueOf:void 0;function np(t){return Yo?Object(Yo.call(t)):{}}function Xo(t,e){var r=e?Cr(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var op="[object Boolean]",ap="[object Date]",sp="[object Map]",ip="[object Number]",up="[object RegExp]",cp="[object Set]",lp="[object String]",fp="[object Symbol]",dp="[object ArrayBuffer]",pp="[object DataView]",hp="[object Float32Array]",gp="[object Float64Array]",mp="[object Int8Array]",vp="[object Int16Array]",yp="[object Int32Array]",bp="[object Uint8Array]",_p="[object Uint8ClampedArray]",Sp="[object Uint16Array]",Op="[object Uint32Array]";function Cp(t,e,r){var n=t.constructor;switch(e){case dp:return Cr(t);case op:case ap:return new n(+t);case pp:return tp(t,r);case hp:case gp:case mp:case vp:case yp:case bp:case _p:case Sp:case Op:return Xo(t,r);case sp:return new n;case ip:case lp:return new n(t);case up:return rp(t);case cp:return new n;case fp:return np(t)}}function Zo(t){return typeof t.constructor=="function"&&!lr(t)?Al(vr(t)):{}}var Ep="[object Map]";function wp(t){return tt(t)&&K(t)==Ep}var ta=It&&It.isMap,Np=ta?fr(ta):wp,$p="[object Set]";function jp(t){return tt(t)&&K(t)==$p}var ea=It&&It.isSet,Ap=ea?fr(ea):jp,Tp=1,Mp=2,Pp=4,ra="[object Arguments]",xp="[object Array]",Rp="[object Boolean]",Ip="[object Date]",Dp="[object Error]",na="[object Function]",Lp="[object GeneratorFunction]",Fp="[object Map]",Vp="[object Number]",oa="[object Object]",Up="[object RegExp]",Bp="[object Set]",Gp="[object String]",kp="[object Symbol]",Hp="[object WeakMap]",zp="[object ArrayBuffer]",qp="[object DataView]",Jp="[object Float32Array]",Wp="[object Float64Array]",Kp="[object Int8Array]",Qp="[object Int16Array]",Yp="[object Int32Array]",Xp="[object Uint8Array]",Zp="[object Uint8ClampedArray]",th="[object Uint16Array]",eh="[object Uint32Array]",x={};x[ra]=x[xp]=x[zp]=x[qp]=x[Rp]=x[Ip]=x[Jp]=x[Wp]=x[Kp]=x[Qp]=x[Yp]=x[Fp]=x[Vp]=x[oa]=x[Up]=x[Bp]=x[Gp]=x[kp]=x[Xp]=x[Zp]=x[th]=x[eh]=!0,x[Dp]=x[na]=x[Hp]=!1;function ae(t,e,r,n,o,a){var s,i=e&Tp,u=e&Mp,c=e&Pp;if(r&&(s=o?r(t,n,o,a):r(t)),s!==void 0)return s;if(!J(t))return t;var d=F(t);if(d){if(s=Zd(t),!i)return yo(t,s)}else{var l=K(t),f=l==na||l==Lp;if(te(t))return Uo(t,i);if(l==oa||l==ra||f&&!o){if(s=u||f?{}:Zo(t),!i)return u?Hd(t,Ld(s,t)):Gd(t,Dd(s,t))}else{if(!x[l])return o?t:{};s=Cp(t,l,i)}}a||(a=new W);var h=a.get(t);if(h)return h;a.set(t,s),Ap(t)?t.forEach(function(p){s.add(ae(p,e,r,p,t,a))}):Np(t)&&t.forEach(function(p,m){s.set(m,ae(p,e,r,m,t,a))});var g=c?u?_r:br:u?re:Ee,b=d?void 0:g(t);return Fl(b||t,function(p,m){b&&(m=p,p=t[m]),ur(s,m,ae(p,e,r,m,t,a))}),s}var rh=1,nh=4;function aa(t){return ae(t,rh|nh)}var oh="__lodash_hash_undefined__";function ah(t){return this.__data__.set(t,oh),this}function sh(t){return this.__data__.has(t)}function se(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new it;++e<r;)this.add(t[e])}se.prototype.add=se.prototype.push=ah,se.prototype.has=sh;function ih(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function sa(t,e){return t.has(e)}var uh=1,ch=2;function ia(t,e,r,n,o,a){var s=r&uh,i=t.length,u=e.length;if(i!=u&&!(s&&u>i))return!1;var c=a.get(t),d=a.get(e);if(c&&d)return c==e&&d==t;var l=-1,f=!0,h=r&ch?new se:void 0;for(a.set(t,e),a.set(e,t);++l<i;){var g=t[l],b=e[l];if(n)var p=s?n(b,g,l,e,t,a):n(g,b,l,t,e,a);if(p!==void 0){if(p)continue;f=!1;break}if(h){if(!ih(e,function(m,v){if(!sa(h,v)&&(g===m||o(g,m,r,n,a)))return h.push(v)})){f=!1;break}}else if(!(g===b||o(g,b,r,n,a))){f=!1;break}}return a.delete(t),a.delete(e),f}function lh(t){var e=-1,r=Array(t.size);return t.forEach(function(n,o){r[++e]=[o,n]}),r}function Er(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var fh=1,dh=2,ph="[object Boolean]",hh="[object Date]",gh="[object Error]",mh="[object Map]",vh="[object Number]",yh="[object RegExp]",bh="[object Set]",_h="[object String]",Sh="[object Symbol]",Oh="[object ArrayBuffer]",Ch="[object DataView]",ua=z?z.prototype:void 0,wr=ua?ua.valueOf:void 0;function Eh(t,e,r,n,o,a,s){switch(r){case Ch:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Oh:return!(t.byteLength!=e.byteLength||!a(new je(t),new je(e)));case ph:case hh:case vh:return Xt(+t,+e);case gh:return t.name==e.name&&t.message==e.message;case yh:case _h:return t==e+"";case mh:var i=lh;case bh:var u=n&fh;if(i||(i=Er),t.size!=e.size&&!u)return!1;var c=s.get(t);if(c)return c==e;n|=dh,s.set(t,e);var d=ia(i(t),i(e),n,o,a,s);return s.delete(t),d;case Sh:if(wr)return wr.call(t)==wr.call(e)}return!1}var wh=1,Nh=Object.prototype,$h=Nh.hasOwnProperty;function jh(t,e,r,n,o,a){var s=r&wh,i=br(t),u=i.length,c=br(e),d=c.length;if(u!=d&&!s)return!1;for(var l=u;l--;){var f=i[l];if(!(s?f in e:$h.call(e,f)))return!1}var h=a.get(t),g=a.get(e);if(h&&g)return h==e&&g==t;var b=!0;a.set(t,e),a.set(e,t);for(var p=s;++l<u;){f=i[l];var m=t[f],v=e[f];if(n)var y=s?n(v,m,f,e,t,a):n(m,v,f,t,e,a);if(!(y===void 0?m===v||o(m,v,r,n,a):y)){b=!1;break}p||(p=f=="constructor")}if(b&&!p){var _=t.constructor,O=e.constructor;_!=O&&"constructor"in t&&"constructor"in e&&!(typeof _=="function"&&_ instanceof _&&typeof O=="function"&&O instanceof O)&&(b=!1)}return a.delete(t),a.delete(e),b}var Ah=1,ca="[object Arguments]",la="[object Array]",Ae="[object Object]",Th=Object.prototype,fa=Th.hasOwnProperty;function Mh(t,e,r,n,o,a){var s=F(t),i=F(e),u=s?la:K(t),c=i?la:K(e);u=u==ca?Ae:u,c=c==ca?Ae:c;var d=u==Ae,l=c==Ae,f=u==c;if(f&&te(t)){if(!te(e))return!1;s=!0,d=!1}if(f&&!d)return a||(a=new W),s||pr(t)?ia(t,e,r,n,o,a):Eh(t,e,u,r,n,o,a);if(!(r&Ah)){var h=d&&fa.call(t,"__wrapped__"),g=l&&fa.call(e,"__wrapped__");if(h||g){var b=h?t.value():t,p=g?e.value():e;return a||(a=new W),o(b,p,r,n,a)}}return f?(a||(a=new W),jh(t,e,r,n,o,a)):!1}function Nr(t,e,r,n,o){return t===e?!0:t==null||e==null||!tt(t)&&!tt(e)?t!==t&&e!==e:Mh(t,e,r,n,Nr,o)}var Ph=1,xh=2;function Rh(t,e,r,n){var o=r.length,a=o;if(t==null)return!a;for(t=Object(t);o--;){var s=r[o];if(s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++o<a;){s=r[o];var i=s[0],u=t[i],c=s[1];if(s[2]){if(u===void 0&&!(i in t))return!1}else{var d=new W,l;if(!(l===void 0?Nr(c,u,Ph|xh,n,d):l))return!1}}return!0}function da(t){return t===t&&!J(t)}function Ih(t){for(var e=Ee(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,da(o)]}return e}function pa(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function Dh(t){var e=Ih(t);return e.length==1&&e[0][2]?pa(e[0][0],e[0][1]):function(r){return r===t||Rh(r,t,e)}}function Lh(t,e){return t!=null&&e in Object(t)}function Fh(t,e,r){e=Dt(e,t);for(var n=-1,o=e.length,a=!1;++n<o;){var s=Lt(e[n]);if(!(a=t!=null&&r(t,s)))break;t=t[s]}return a||++n!=o?a:(o=t==null?0:t.length,!!o&&cr(o)&&Oe(s,o)&&(F(t)||Zt(t)))}function Vh(t,e){return t!=null&&Fh(t,e,Lh)}var Uh=1,Bh=2;function Gh(t,e){return hr(t)&&da(e)?pa(Lt(t),e):function(r){var n=Po(r,t);return n===void 0&&n===e?Vh(r,t):Nr(e,n,Uh|Bh)}}function kh(t){return function(e){return e==null?void 0:e[t]}}function Hh(t){return function(e){return $e(e,t)}}function zh(t){return hr(t)?kh(Lt(t)):Hh(t)}function $r(t){return typeof t=="function"?t:t==null?nr:typeof t=="object"?F(t)?Gh(t[0],t[1]):Dh(t):zh(t)}function qh(t){return function(e,r,n){for(var o=-1,a=Object(e),s=n(e),i=s.length;i--;){var u=s[++o];if(r(a[u],u,a)===!1)break}return e}}var Jh=qh();function jr(t,e,r){(r!==void 0&&!Xt(t[e],r)||r===void 0&&!(e in t))&&ir(t,e,r)}function Ar(t){return tt(t)&&Ce(t)}function Tr(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Wh(t){return Rt(t,re(t))}function Kh(t,e,r,n,o,a,s){var i=Tr(t,r),u=Tr(e,r),c=s.get(u);if(c){jr(t,r,c);return}var d=a?a(i,u,r+"",t,e,s):void 0,l=d===void 0;if(l){var f=F(u),h=!f&&te(u),g=!f&&!h&&pr(u);d=u,f||h||g?F(i)?d=i:Ar(i)?d=yo(i):h?(l=!1,d=Uo(u,!0)):g?(l=!1,d=Xo(u,!0)):d=[]:V(u)||Zt(u)?(d=i,Zt(i)?d=Wh(i):(!J(i)||or(i))&&(d=Zo(u))):l=!1}l&&(s.set(u,d),o(d,u,n,a,s),s.delete(u)),jr(t,r,d)}function ha(t,e,r,n,o){t!==e&&Jh(e,function(a,s){if(o||(o=new W),J(a))Kh(t,e,s,r,ha,n,o);else{var i=n?n(Tr(t,s),a,s+"",t,e,o):void 0;i===void 0&&(i=a),jr(t,s,i)}},re)}function ga(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function Qh(t,e){return e.length<2?t:$e(t,Ad(e,0,-1))}var ma=Ql(function(t,e,r){ha(t,e,r)}),Yh="Expected a function";function Xh(t){if(typeof t!="function")throw new TypeError(Yh);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function Zh(t,e){return e=Dt(e,t),t=Qh(t,e),t==null||delete t[Lt(ga(e))]}function tg(t){return V(t)?void 0:t}var eg=1,rg=2,ng=4,va=Cd(function(t,e){var r={};if(t==null)return r;var n=!1;e=rr(e,function(a){return a=Dt(a,t),n||(n=a.length>1),a}),Rt(t,_r(t),r),n&&(r=ae(r,eg|rg|ng,tg));for(var o=e.length;o--;)Zh(r,e[o]);return r});function og(t,e,r,n){if(!J(t))return t;e=Dt(e,t);for(var o=-1,a=e.length,s=a-1,i=t;i!=null&&++o<a;){var u=Lt(e[o]),c=r;if(u==="__proto__"||u==="constructor"||u==="prototype")return t;if(o!=s){var d=i[u];c=void 0,c===void 0&&(c=J(d)?d:Oe(e[o+1])?[]:{})}ur(i,u,c),i=i[u]}return t}function ag(t,e,r){for(var n=-1,o=e.length,a={};++n<o;){var s=e[n],i=$e(t,s);r(i,s)&&og(a,Dt(s,t),i)}return a}function sg(t,e){if(t==null)return{};var r=rr(_r(t),function(n){return[n]});return e=$r(e),ag(t,r,function(n,o){return e(n,o[0])})}function ig(t,e){return sg(t,Xh($r(e)))}var ug=1/0,cg=Ft&&1/Er(new Ft([,-0]))[1]==ug?function(t){return new Ft(t)}:Ml,lg=200;function fg(t,e,r){var n=-1,o=kl,a=t.length,s=!0,i=[],u=i;if(a>=lg){var c=e?null:cg(t);if(c)return Er(c);s=!1,o=sa,u=new se}else u=e?[]:i;t:for(;++n<a;){var d=t[n],l=e?e(d):d;if(d=d!==0?d:0,s&&l===l){for(var f=u.length;f--;)if(u[f]===l)continue t;e&&u.push(l),i.push(d)}else o(u,l,r)||(u!==i&&u.push(l),i.push(d))}return i}var dg=Oo(function(t){var e=ga(t);return Ar(e)&&(e=void 0),fg(Ro(t,1,Ar,!0),$r(e))});class ya extends TypeError{constructor(e,r){let n;const{message:o,...a}=e,{path:s}=e,i=s.length===0?o:`At path: ${s.join(".")} -- ${o}`;super(i),this.value=void 0,this.key=void 0,this.type=void 0,this.refinement=void 0,this.path=void 0,this.branch=void 0,this.failures=void 0,Object.assign(this,a),this.name=this.constructor.name,this.failures=()=>n??(n=[e,...r()])}}function pg(t){return Q(t)&&typeof t[Symbol.iterator]=="function"}function Q(t){return typeof t=="object"&&t!=null}function G(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function hg(t){const{done:e,value:r}=t.next();return e?void 0:r}function gg(t,e,r,n){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:o,branch:a}=e,{type:s}=r,{refinement:i,message:u=`Expected a value of type \`${s}\`${i?` with refinement \`${i}\``:""}, but received: \`${G(n)}\``}=t;return{value:n,type:s,refinement:i,key:o[o.length-1],path:o,branch:a,...t,message:u}}function*ba(t,e,r,n){pg(t)||(t=[t]);for(const o of t){const a=gg(o,e,r,n);a&&(yield a)}}function*Mr(t,e,r){r===void 0&&(r={});const{path:n=[],branch:o=[t],coerce:a=!1,mask:s=!1}=r,i={path:n,branch:o};if(a&&(t=e.coercer(t,i),s&&e.type!=="type"&&Q(e.schema)&&Q(t)&&!Array.isArray(t)))for(const c in t)e.schema[c]===void 0&&delete t[c];let u="valid";for(const c of e.validator(t,i))u="not_valid",yield[c,void 0];for(let[c,d,l]of e.entries(t,i)){const f=Mr(d,l,{path:c===void 0?n:[...n,c],branch:c===void 0?o:[...o,d],coerce:a,mask:s});for(const h of f)h[0]?(u=h[0].refinement!=null?"not_refined":"not_valid",yield[h[0],void 0]):a&&(d=h[1],c===void 0?t=d:t instanceof Map?t.set(c,d):t instanceof Set?t.add(d):Q(t)&&(d!==void 0||c in t)&&(t[c]=d))}if(u!=="not_valid")for(const c of e.refiner(t,i))u="not_refined",yield[c,void 0];u==="valid"&&(yield[void 0,t])}class et{constructor(e){this.TYPE=void 0,this.type=void 0,this.schema=void 0,this.coercer=void 0,this.validator=void 0,this.refiner=void 0,this.entries=void 0;const{type:r,schema:n,validator:o,refiner:a,coercer:s=u=>u,entries:i=function*(){}}=e;this.type=r,this.schema=n,this.entries=i,this.coercer=s,o?this.validator=(u,c)=>{const d=o(u,c);return ba(d,c,this,u)}:this.validator=()=>[],a?this.refiner=(u,c)=>{const d=a(u,c);return ba(d,c,this,u)}:this.refiner=()=>[]}assert(e){return _a(e,this)}create(e){return mg(e,this)}is(e){return yg(e,this)}mask(e){return vg(e,this)}validate(e,r){return r===void 0&&(r={}),Vt(e,this,r)}}function _a(t,e){const r=Vt(t,e);if(r[0])throw r[0]}function mg(t,e){const r=Vt(t,e,{coerce:!0});if(r[0])throw r[0];return r[1]}function vg(t,e){const r=Vt(t,e,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}function yg(t,e){return!Vt(t,e)[0]}function Vt(t,e,r){r===void 0&&(r={});const n=Mr(t,e,r),o=hg(n);return o[0]?[new ya(o[0],function*(){for(const a of n)a[0]&&(yield a[0])}),void 0]:[void 0,o[1]]}function Pr(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];const n=e[0].type==="type",o=e.map(s=>s.schema),a=Object.assign({},...o);return n?Ea(a):M(a)}function pt(t,e){return new et({type:t,schema:null,validator:e})}function Ut(t){return new et({type:"dynamic",schema:null,*entries(e,r){yield*t(e,r).entries(e,r)},validator(e,r){return t(e,r).validator(e,r)},coercer(e,r){return t(e,r).coercer(e,r)},refiner(e,r){return t(e,r).refiner(e,r)}})}function Sa(t,e){const{schema:r}=t,n={...r};for(const o of e)delete n[o];switch(t.type){case"type":return Ea(n);default:return M(n)}}function P(){return pt("any",()=>!0)}function D(t){return new et({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${G(e)}`}})}function Nt(){return pt("boolean",t=>typeof t=="boolean")}function xr(t){const e={},r=t.map(n=>G(n)).join();for(const n of t)e[n]=n;return new et({type:"enums",schema:e,validator(n){return t.includes(n)||`Expected one of \`${r}\`, but received: ${G(n)}`}})}function Oa(){return pt("func",t=>typeof t=="function"||`Expected a function, but received: ${G(t)}`)}function k(t){const e=G(t),r=typeof t;return new et({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||`Expected the literal \`${e}\`, but received: ${G(n)}`}})}function bg(){return pt("never",()=>!1)}function Ca(){return pt("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${G(t)}`)}function M(t){const e=t?Object.keys(t):[],r=bg();return new et({type:"object",schema:t||null,*entries(n){if(t&&Q(n)){const o=new Set(Object.keys(n));for(const a of e)o.delete(a),yield[a,n[a],t[a]];for(const a of o)yield[a,n[a],r]}},validator(n){return Q(n)||`Expected an object, but received: ${G(n)}`},coercer(n){return Q(n)?{...n}:n}})}function S(t){return new et({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function ie(t,e){return new et({type:"record",schema:null,*entries(r){if(Q(r))for(const n in r){const o=r[n];yield[n,n,t],yield[n,o,e]}},validator(r){return Q(r)||`Expected an object, but received: ${G(r)}`}})}function E(){return pt("string",t=>typeof t=="string"||`Expected a string, but received: ${G(t)}`)}function Ea(t){const e=Object.keys(t);return new et({type:"type",schema:t,*entries(r){if(Q(r))for(const n of e)yield[n,r[n],t[n]]},validator(r){return Q(r)||`Expected an object, but received: ${G(r)}`}})}function H(t){const e=t.map(r=>r.type).join(" | ");return new et({type:"union",schema:null,coercer(r,n){return(t.find(o=>{const[a]=o.validate(r,{coerce:!0});return!a})||_g()).coercer(r,n)},validator(r,n){const o=[];for(const a of t){const[...s]=Mr(r,a,n),[i]=s;if(i[0])for(const[u]of s)u&&o.push(u);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${G(r)}`,...o]}})}function _g(){return pt("unknown",()=>!0)}const Rr=M({package:E(),version:E(),name:E(),exportName:S(E()),destructuring:S(Nt()),subName:S(E()),main:S(E()),cssPaths:S(D(E()))}),Sg=D(Rr),Og=["CBlock","CContainer","CImage","CCanvas","CVideo","CAudio","CText","CNativeTag"];var U=(t=>(t.SLOT="SLOT",t.FUNCTION="FUNCTION",t.EXPRESSION="EXPRESSION",t.ACTION="ACTION",t.EVENT="EVENT",t))(U||{}),Ir=(t=>(t.DESIGN="design",t.SAVE="save",t))(Ir||{}),Dr=(t=>(t.FUNC="FUNC",t.COMP="COMP",t))(Dr||{});const Cg=()=>pt("normalObj",t=>!V(t)||[U.SLOT,U.EXPRESSION,U.FUNCTION].includes(t==null?void 0:t.type)?!1:(Vt(t,ie(E(),Lr)),!0)),Lr=H([E(),Ca(),Nt(),M({type:k(U.SLOT),renderType:xr([Dr.FUNC,Dr.COMP]),params:S(D(E())),value:Ut(()=>H([Bt,D(Bt)]))}),M({type:k(U.EXPRESSION),value:E()}),M({type:k(U.FUNCTION),value:E()}),M({type:k(U.ACTION),handler:P()}),Cg(),D(Ut(()=>Lr))]);var wa=(t=>(t.COMPONENTS="COMPONENTS",t))(wa||{});const Na=M({type:k(U.EXPRESSION),value:E()}),Bt=M({id:S(E()),title:S(E()),componentName:E(),props:S(ie(E(),Lr)),nodeName:S(E()),state:S(ie(E(),P())),children:Ut(()=>S(D(H([E(),Bt])))),eventListener:S(D(P())),configure:S(P()),css:S(P()),style:S(P()),classNames:S(D(P())),refId:S(E()),extra:S(ie(P(),P())),condition:S(H([Nt(),Na])),loop:S(M({open:Nt(),data:H([D(P()),Na]),args:S(D(E())),forName:S(E()),forIndex:S(E()),key:S(P()),name:S(E())})),injectEnvList:S(D(P())),methods:S(D(P()))}),Te=H([E(),M({label:E(),tip:S(E())})]),Eg=M({type:k("shape"),value:D(M({name:E(),title:Te,valueType:Ut(()=>Me)}))}),wg=M({type:k("enums"),value:D(E())});M({type:k("array"),value:Ut(()=>Me)});const Ng=M({type:k("array"),value:Ut(()=>D(Me))}),Me=H([xr(["array","boolean","number","object","string"]),xr(["component","expression","function"]),Eg,wg,Ng]),$g=H([E(),M({componentName:E(),props:S(P()),initialValue:S(P()),component:S(P()),hiddenLabel:S(Nt())})]),Fr=M({name:E(),title:Te,valueType:Me,description:S(E()),defaultValue:P(),setters:S(D($g)),condition:S(Oa())});H([E(),Oa()]);var Vr=(t=>(t.SINGLE="single",t.GROUP="group",t))(Vr||{});H([E(),M({event:E(),name:S(E()),describe:S(E()),params:S(D(M({name:E(),description:E(),example:E()}))),template:S(E())})]);const jg=M({id:S(E()),title:E(),snapshot:H([E(),P()]),snapshotText:S(E()),description:S(E()),tags:S(D(E())),groupName:S(E()),category:S(E()),schema:Pr(Sa(Bt,["id"]),M({componentName:S(E())}))}),Ag=M({componentName:E(),title:E(),screenshot:S(E()),icon:S(E()),tags:S(D(E())),groupName:S(E()),category:S(E()),priority:S(Ca()),npm:S(Rr),snippets:D(jg),props:D(H([Fr,M({title:S(Te),type:k("single"),content:Fr}),M({title:S(Te),type:k("group"),content:D(Fr)})])),events:S(P()),methods:S(P()),fixedProps:S(P()),isContainer:S(H([Nt(),M({placeholder:E(),width:E(),height:E()})])),disableEditorDragDom:S(P()),isLayout:S(Nt()),rootSelector:S(E()),advanceCustom:S(P()),extra:S(ie(P(),P()))}),Tg=t=>({data:e,message:r,throwError:n})=>{const o=t({data:e,message:r,throwError:n});if(o.isValidate)return o;if(n)throw o.message||r?new Error(`${o.message||r}
|
|
55
|
+
`,new Function(l)(...d,{$$context:n,storeManager:o,$$response:a,actionVariableSpace:i,nodeModel:s})}catch(g){console.warn(g)}}}[u]},Xe=(t,e)=>{const r={};return e.forEach((n,o)=>{r[n]=t[o]}),r},oo=(t=[])=>{const e={};return t.forEach(({property:r,value:n})=>{let o=r.replace("-webkit","Webkit");o=o.replace("-ms","ms"),o=o.replace("-moz","Moz"),o=o.replace("-o","O");let a=o.split("-");a.length>=2&&(a=a.map((s,i)=>i!==0?Fu(s):s)),e[a.join("")]=n}),e},qc=t=>{let e="";return Object.keys(t||{}).forEach(r=>{e+=`${r}:${t[r]};`}),e},Jc=(t,e)=>{const r={};return t.forEach(n=>{if(n.globalName){const o=e[n.globalName];o&&(r[n.globalName]=o,o.__esModule&&o.default&&(r[n.globalName]=o.default))}}),r},Wc=(t,e=1)=>{let r=0,n=t,o={},a={};for(;r<e;)Object.keys(n).forEach(s=>{o={...o,...n[s]}}),a=o,n=o,o={},r+=1;return a},ao=(t,e)=>{const r=[];return e.forEach(n=>{const a=n.exec(t);a!=null&&a.length&&r.push(a[1])}),r},so=(t,e)=>{const r={};return e.forEach(n=>{t[n.name]&&(r[n.name]=t[n.name])}),r},Kc=(t,e)=>so(t,e),Qc=(t,e)=>so(t,e),Ze=t=>{var r;return((r=t.value.css)==null?void 0:r.class)||`c_${t.id}`},io=(t,e)=>{const r=t.split(".");let n,o=e;return r.forEach(a=>{n=o==null?void 0:o[a],o=n}),n||(()=>`Component [${t}] not found`)},tr=(t,e)=>{const r={...t};return r.__proto__=e,r},Yc={},uo=t=>{let e;const r=new Set,n=(d,l)=>{const f=typeof d=="function"?d(e):d;if(!Object.is(f,e)){const h=e;e=l??(typeof f!="object"||f===null)?f:Object.assign({},e,f),r.forEach(g=>g(e,h))}},o=()=>e,u={setState:n,getState:o,getInitialState:()=>c,subscribe:d=>(r.add(d),()=>r.delete(d)),destroy:()=>{(Yc?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},c=e=t(n,o,u);return u},Xc=t=>t?uo(t):uo;class Zc{constructor(){w(this,"storeMap",new Map)}addStore(e,r){const n=Xc(r);return this.storeMap.set(e,n),n.name=e,n}setStore(e,r){this.storeMap.set(e,r)}removeStore(e){this.storeMap.delete(e)}getStore(e){return this.storeMap.get(e)}getState(e){var r;return(r=this.storeMap.get(e))==null?void 0:r.getState()}getStateObj(e){return{state:this.getState(e),updateState:r=>{this.setState(e,r)}}}setState(e,r){var n;return(n=this.storeMap.get(e))==null?void 0:n.setState(r)}connect(e,r){const n=this.storeMap.get(e);return n?n.subscribe(r):(console.warn("store not exits"),()=>{})}getStateSnapshot(){const e={};return this.storeMap.forEach((r,n)=>{e[n]=this.getStateObj(n)}),e}destroy(){this.storeMap=new Map}}class tl{constructor(){w(this,"varSpace",new Map)}get(e){return this.varSpace.get(e)}add(e,r){this.varSpace.set(e,r)}remove(e){this.varSpace.delete(e)}destroy(){this.varSpace.clear()}getStateSnapshot(){const e={};return this.varSpace.forEach((r,n)=>{e[n]=r}),e}}class er{constructor(){w(this,"refMap",new Map)}get(e){return this.refMap.get(e)}add(e,r){this.refMap.set(e,r)}remove(e){this.refMap.delete(e)}destroy(){this.refMap.clear()}}var el=Object.defineProperty,rl=(t,e,r)=>e in t?el(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,j=(t,e,r)=>rl(t,typeof e!="symbol"?e+"":e,r),co=typeof global=="object"&&global&&global.Object===Object&&global,nl=typeof self=="object"&&self&&self.Object===Object&&self,Z=co||nl||Function("return this")(),q=Z.Symbol,lo=Object.prototype,ol=lo.hasOwnProperty,al=lo.toString,Yt=q?q.toStringTag:void 0;function sl(t){var e=ol.call(t,Yt),r=t[Yt];try{t[Yt]=void 0;var n=!0}catch{}var o=al.call(t);return n&&(e?t[Yt]=r:delete t[Yt]),o}var il=Object.prototype,ul=il.toString;function cl(t){return ul.call(t)}var ll="[object Null]",fl="[object Undefined]",fo=q?q.toStringTag:void 0;function Ot(t){return t==null?t===void 0?fl:ll:fo&&fo in Object(t)?sl(t):cl(t)}function tt(t){return t!=null&&typeof t=="object"}var dl="[object Symbol]";function rr(t){return typeof t=="symbol"||tt(t)&&Ot(t)==dl}function nr(t,e){for(var r=-1,n=t==null?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}var F=Array.isArray,po=q?q.prototype:void 0,ho=po?po.toString:void 0;function go(t){if(typeof t=="string")return t;if(F(t))return nr(t,go)+"";if(rr(t))return ho?ho.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function W(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function or(t){return t}var pl="[object AsyncFunction]",hl="[object Function]",gl="[object GeneratorFunction]",ml="[object Proxy]";function ar(t){if(!W(t))return!1;var e=Ot(t);return e==hl||e==gl||e==pl||e==ml}var sr=Z["__core-js_shared__"],mo=function(){var t=/[^.]+$/.exec(sr&&sr.keys&&sr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function vl(t){return!!mo&&mo in t}var yl=Function.prototype,bl=yl.toString;function Et(t){if(t!=null){try{return bl.call(t)}catch{}try{return t+""}catch{}}return""}var _l=/[\\^$.*+?()[\]{}|]/g,Sl=/^\[object .+?Constructor\]$/,Ol=Function.prototype,El=Object.prototype,Cl=Ol.toString,wl=El.hasOwnProperty,$l=RegExp("^"+Cl.call(wl).replace(_l,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Nl(t){if(!W(t)||vl(t))return!1;var e=ar(t)?$l:Sl;return e.test(Et(t))}function jl(t,e){return t==null?void 0:t[e]}function Ct(t,e){var r=jl(t,e);return Nl(r)?r:void 0}var ir=Ct(Z,"WeakMap"),vo=Object.create,Al=function(){function t(){}return function(e){if(!W(e))return{};if(vo)return vo(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function Tl(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Pl(){}function yo(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var Ml=800,xl=16,Rl=Date.now;function Il(t){var e=0,r=0;return function(){var n=Rl(),o=xl-(n-r);if(r=n,o>0){if(++e>=Ml)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Dl(t){return function(){return t}}var Oe=function(){try{var t=Ct(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Ll=Oe?function(t,e){return Oe(t,"toString",{configurable:!0,enumerable:!1,value:Dl(e),writable:!0})}:or,bo=Il(Ll);function Fl(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}function Vl(t,e,r,n){for(var o=t.length,a=r+-1;++a<o;)if(e(t[a],a,t))return a;return-1}function Ul(t){return t!==t}function Bl(t,e,r){for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}function kl(t,e,r){return e===e?Bl(t,e,r):Vl(t,Ul,r)}function Gl(t,e){var r=t==null?0:t.length;return!!r&&kl(t,e,0)>-1}var Hl=9007199254740991,zl=/^(?:0|[1-9]\d*)$/;function Ee(t,e){var r=typeof t;return e=e??Hl,!!e&&(r=="number"||r!="symbol"&&zl.test(t))&&t>-1&&t%1==0&&t<e}function ur(t,e,r){e=="__proto__"&&Oe?Oe(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Xt(t,e){return t===e||t!==t&&e!==e}var ql=Object.prototype,Jl=ql.hasOwnProperty;function cr(t,e,r){var n=t[e];(!(Jl.call(t,e)&&Xt(n,r))||r===void 0&&!(e in t))&&ur(t,e,r)}function It(t,e,r,n){var o=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var i=e[a],u=void 0;u===void 0&&(u=t[i]),o?ur(r,i,u):cr(r,i,u)}return r}var _o=Math.max;function So(t,e,r){return e=_o(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=_o(n.length-e,0),s=Array(a);++o<a;)s[o]=n[e+o];o=-1;for(var i=Array(e+1);++o<e;)i[o]=n[o];return i[e]=r(s),Tl(t,this,i)}}function Oo(t,e){return bo(So(t,e,or),t+"")}var Wl=9007199254740991;function lr(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Wl}function Ce(t){return t!=null&&lr(t.length)&&!ar(t)}function Kl(t,e,r){if(!W(r))return!1;var n=typeof e;return(n=="number"?Ce(r)&&Ee(e,r.length):n=="string"&&e in r)?Xt(r[e],t):!1}function Ql(t){return Oo(function(e,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,s=o>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(o--,a):void 0,s&&Kl(r[0],r[1],s)&&(a=o<3?void 0:a,o=1),e=Object(e);++n<o;){var i=r[n];i&&t(e,i,n,a)}return e})}var Yl=Object.prototype;function fr(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Yl;return t===r}function Xl(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Zl="[object Arguments]";function Eo(t){return tt(t)&&Ot(t)==Zl}var Co=Object.prototype,tf=Co.hasOwnProperty,ef=Co.propertyIsEnumerable,Zt=Eo(function(){return arguments}())?Eo:function(t){return tt(t)&&tf.call(t,"callee")&&!ef.call(t,"callee")};function rf(){return!1}var wo=typeof E=="object"&&E&&!E.nodeType&&E,$o=wo&&typeof module=="object"&&module&&!module.nodeType&&module,nf=$o&&$o.exports===wo,No=nf?Z.Buffer:void 0,of=No?No.isBuffer:void 0,te=of||rf,af="[object Arguments]",sf="[object Array]",uf="[object Boolean]",cf="[object Date]",lf="[object Error]",ff="[object Function]",df="[object Map]",pf="[object Number]",hf="[object Object]",gf="[object RegExp]",mf="[object Set]",vf="[object String]",yf="[object WeakMap]",bf="[object ArrayBuffer]",_f="[object DataView]",Sf="[object Float32Array]",Of="[object Float64Array]",Ef="[object Int8Array]",Cf="[object Int16Array]",wf="[object Int32Array]",$f="[object Uint8Array]",Nf="[object Uint8ClampedArray]",jf="[object Uint16Array]",Af="[object Uint32Array]",I={};I[Sf]=I[Of]=I[Ef]=I[Cf]=I[wf]=I[$f]=I[Nf]=I[jf]=I[Af]=!0,I[af]=I[sf]=I[bf]=I[uf]=I[_f]=I[cf]=I[lf]=I[ff]=I[df]=I[pf]=I[hf]=I[gf]=I[mf]=I[vf]=I[yf]=!1;function Tf(t){return tt(t)&&lr(t.length)&&!!I[Ot(t)]}function dr(t){return function(e){return t(e)}}var jo=typeof E=="object"&&E&&!E.nodeType&&E,ee=jo&&typeof module=="object"&&module&&!module.nodeType&&module,Pf=ee&&ee.exports===jo,pr=Pf&&co.process,Dt=function(){try{var t=ee&&ee.require&&ee.require("util").types;return t||pr&&pr.binding&&pr.binding("util")}catch{}}(),Ao=Dt&&Dt.isTypedArray,hr=Ao?dr(Ao):Tf,Mf=Object.prototype,xf=Mf.hasOwnProperty;function To(t,e){var r=F(t),n=!r&&Zt(t),o=!r&&!n&&te(t),a=!r&&!n&&!o&&hr(t),s=r||n||o||a,i=s?Xl(t.length,String):[],u=i.length;for(var c in t)(e||xf.call(t,c))&&!(s&&(c=="length"||o&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Ee(c,u)))&&i.push(c);return i}function Po(t,e){return function(r){return t(e(r))}}var Rf=Po(Object.keys,Object),If=Object.prototype,Df=If.hasOwnProperty;function Lf(t){if(!fr(t))return Rf(t);var e=[];for(var r in Object(t))Df.call(t,r)&&r!="constructor"&&e.push(r);return e}function we(t){return Ce(t)?To(t):Lf(t)}function Ff(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Vf=Object.prototype,Uf=Vf.hasOwnProperty;function Bf(t){if(!W(t))return Ff(t);var e=fr(t),r=[];for(var n in t)n=="constructor"&&(e||!Uf.call(t,n))||r.push(n);return r}function re(t){return Ce(t)?To(t,!0):Bf(t)}var kf=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Gf=/^\w*$/;function gr(t,e){if(F(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||rr(t)?!0:Gf.test(t)||!kf.test(t)||e!=null&&t in Object(e)}var ne=Ct(Object,"create");function Hf(){this.__data__=ne?ne(null):{},this.size=0}function zf(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var qf="__lodash_hash_undefined__",Jf=Object.prototype,Wf=Jf.hasOwnProperty;function Kf(t){var e=this.__data__;if(ne){var r=e[t];return r===qf?void 0:r}return Wf.call(e,t)?e[t]:void 0}var Qf=Object.prototype,Yf=Qf.hasOwnProperty;function Xf(t){var e=this.__data__;return ne?e[t]!==void 0:Yf.call(e,t)}var Zf="__lodash_hash_undefined__";function td(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=ne&&e===void 0?Zf:e,this}function wt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}wt.prototype.clear=Hf,wt.prototype.delete=zf,wt.prototype.get=Kf,wt.prototype.has=Xf,wt.prototype.set=td;function ed(){this.__data__=[],this.size=0}function $e(t,e){for(var r=t.length;r--;)if(Xt(t[r][0],e))return r;return-1}var rd=Array.prototype,nd=rd.splice;function od(t){var e=this.__data__,r=$e(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():nd.call(e,r,1),--this.size,!0}function ad(t){var e=this.__data__,r=$e(e,t);return r<0?void 0:e[r][1]}function sd(t){return $e(this.__data__,t)>-1}function id(t,e){var r=this.__data__,n=$e(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function st(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}st.prototype.clear=ed,st.prototype.delete=od,st.prototype.get=ad,st.prototype.has=sd,st.prototype.set=id;var oe=Ct(Z,"Map");function ud(){this.size=0,this.__data__={hash:new wt,map:new(oe||st),string:new wt}}function cd(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Ne(t,e){var r=t.__data__;return cd(e)?r[typeof e=="string"?"string":"hash"]:r.map}function ld(t){var e=Ne(this,t).delete(t);return this.size-=e?1:0,e}function fd(t){return Ne(this,t).get(t)}function dd(t){return Ne(this,t).has(t)}function pd(t,e){var r=Ne(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function it(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}it.prototype.clear=ud,it.prototype.delete=ld,it.prototype.get=fd,it.prototype.has=dd,it.prototype.set=pd;var hd="Expected a function";function mr(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(hd);var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var s=t.apply(this,n);return r.cache=a.set(o,s)||a,s};return r.cache=new(mr.Cache||it),r}mr.Cache=it;var gd=500;function md(t){var e=mr(t,function(n){return r.size===gd&&r.clear(),n}),r=e.cache;return e}var vd=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,yd=/\\(\\)?/g,bd=md(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(vd,function(r,n,o,a){e.push(o?a.replace(yd,"$1"):n||r)}),e});function _d(t){return t==null?"":go(t)}function Lt(t,e){return F(t)?t:gr(t,e)?[t]:bd(_d(t))}function Ft(t){if(typeof t=="string"||rr(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function je(t,e){e=Lt(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Ft(e[r++])];return r&&r==n?t:void 0}function Mo(t,e,r){var n=t==null?void 0:je(t,e);return n===void 0?r:n}function vr(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}var xo=q?q.isConcatSpreadable:void 0;function Sd(t){return F(t)||Zt(t)||!!(xo&&t&&t[xo])}function Ro(t,e,r,n,o){var a=-1,s=t.length;for(r||(r=Sd),o||(o=[]);++a<s;){var i=t[a];r(i)?vr(o,i):n||(o[o.length]=i)}return o}function Od(t){var e=t==null?0:t.length;return e?Ro(t):[]}function Ed(t){return bo(So(t,void 0,Od),t+"")}var yr=Po(Object.getPrototypeOf,Object),Cd="[object Object]",wd=Function.prototype,$d=Object.prototype,Io=wd.toString,Nd=$d.hasOwnProperty,jd=Io.call(Object);function V(t){if(!tt(t)||Ot(t)!=Cd)return!1;var e=yr(t);if(e===null)return!0;var r=Nd.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Io.call(r)==jd}function Ad(t,e,r){var n=-1,o=t.length;e<0&&(e=-e>o?0:o+e),r=r>o?o:r,r<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(o);++n<o;)a[n]=t[n+e];return a}function Td(){this.__data__=new st,this.size=0}function Pd(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function Md(t){return this.__data__.get(t)}function xd(t){return this.__data__.has(t)}var Rd=200;function Id(t,e){var r=this.__data__;if(r instanceof st){var n=r.__data__;if(!oe||n.length<Rd-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new it(n)}return r.set(t,e),this.size=r.size,this}function K(t){var e=this.__data__=new st(t);this.size=e.size}K.prototype.clear=Td,K.prototype.delete=Pd,K.prototype.get=Md,K.prototype.has=xd,K.prototype.set=Id;function Dd(t,e){return t&&It(e,we(e),t)}function Ld(t,e){return t&&It(e,re(e),t)}var Do=typeof E=="object"&&E&&!E.nodeType&&E,Lo=Do&&typeof module=="object"&&module&&!module.nodeType&&module,Fd=Lo&&Lo.exports===Do,Fo=Fd?Z.Buffer:void 0,Vo=Fo?Fo.allocUnsafe:void 0;function Uo(t,e){if(e)return t.slice();var r=t.length,n=Vo?Vo(r):new t.constructor(r);return t.copy(n),n}function Vd(t,e){for(var r=-1,n=t==null?0:t.length,o=0,a=[];++r<n;){var s=t[r];e(s,r,t)&&(a[o++]=s)}return a}function Bo(){return[]}var Ud=Object.prototype,Bd=Ud.propertyIsEnumerable,ko=Object.getOwnPropertySymbols,br=ko?function(t){return t==null?[]:(t=Object(t),Vd(ko(t),function(e){return Bd.call(t,e)}))}:Bo;function kd(t,e){return It(t,br(t),e)}var Gd=Object.getOwnPropertySymbols,Go=Gd?function(t){for(var e=[];t;)vr(e,br(t)),t=yr(t);return e}:Bo;function Hd(t,e){return It(t,Go(t),e)}function Ho(t,e,r){var n=e(t);return F(t)?n:vr(n,r(t))}function _r(t){return Ho(t,we,br)}function Sr(t){return Ho(t,re,Go)}var Or=Ct(Z,"DataView"),Er=Ct(Z,"Promise"),Vt=Ct(Z,"Set"),zo="[object Map]",zd="[object Object]",qo="[object Promise]",Jo="[object Set]",Wo="[object WeakMap]",Ko="[object DataView]",qd=Et(Or),Jd=Et(oe),Wd=Et(Er),Kd=Et(Vt),Qd=Et(ir),Q=Ot;(Or&&Q(new Or(new ArrayBuffer(1)))!=Ko||oe&&Q(new oe)!=zo||Er&&Q(Er.resolve())!=qo||Vt&&Q(new Vt)!=Jo||ir&&Q(new ir)!=Wo)&&(Q=function(t){var e=Ot(t),r=e==zd?t.constructor:void 0,n=r?Et(r):"";if(n)switch(n){case qd:return Ko;case Jd:return zo;case Wd:return qo;case Kd:return Jo;case Qd:return Wo}return e});var Yd=Object.prototype,Xd=Yd.hasOwnProperty;function Zd(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&Xd.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var Ae=Z.Uint8Array;function Cr(t){var e=new t.constructor(t.byteLength);return new Ae(e).set(new Ae(t)),e}function tp(t,e){var r=e?Cr(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var ep=/\w*$/;function rp(t){var e=new t.constructor(t.source,ep.exec(t));return e.lastIndex=t.lastIndex,e}var Qo=q?q.prototype:void 0,Yo=Qo?Qo.valueOf:void 0;function np(t){return Yo?Object(Yo.call(t)):{}}function Xo(t,e){var r=e?Cr(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var op="[object Boolean]",ap="[object Date]",sp="[object Map]",ip="[object Number]",up="[object RegExp]",cp="[object Set]",lp="[object String]",fp="[object Symbol]",dp="[object ArrayBuffer]",pp="[object DataView]",hp="[object Float32Array]",gp="[object Float64Array]",mp="[object Int8Array]",vp="[object Int16Array]",yp="[object Int32Array]",bp="[object Uint8Array]",_p="[object Uint8ClampedArray]",Sp="[object Uint16Array]",Op="[object Uint32Array]";function Ep(t,e,r){var n=t.constructor;switch(e){case dp:return Cr(t);case op:case ap:return new n(+t);case pp:return tp(t,r);case hp:case gp:case mp:case vp:case yp:case bp:case _p:case Sp:case Op:return Xo(t,r);case sp:return new n;case ip:case lp:return new n(t);case up:return rp(t);case cp:return new n;case fp:return np(t)}}function Zo(t){return typeof t.constructor=="function"&&!fr(t)?Al(yr(t)):{}}var Cp="[object Map]";function wp(t){return tt(t)&&Q(t)==Cp}var ta=Dt&&Dt.isMap,$p=ta?dr(ta):wp,Np="[object Set]";function jp(t){return tt(t)&&Q(t)==Np}var ea=Dt&&Dt.isSet,Ap=ea?dr(ea):jp,Tp=1,Pp=2,Mp=4,ra="[object Arguments]",xp="[object Array]",Rp="[object Boolean]",Ip="[object Date]",Dp="[object Error]",na="[object Function]",Lp="[object GeneratorFunction]",Fp="[object Map]",Vp="[object Number]",oa="[object Object]",Up="[object RegExp]",Bp="[object Set]",kp="[object String]",Gp="[object Symbol]",Hp="[object WeakMap]",zp="[object ArrayBuffer]",qp="[object DataView]",Jp="[object Float32Array]",Wp="[object Float64Array]",Kp="[object Int8Array]",Qp="[object Int16Array]",Yp="[object Int32Array]",Xp="[object Uint8Array]",Zp="[object Uint8ClampedArray]",th="[object Uint16Array]",eh="[object Uint32Array]",x={};x[ra]=x[xp]=x[zp]=x[qp]=x[Rp]=x[Ip]=x[Jp]=x[Wp]=x[Kp]=x[Qp]=x[Yp]=x[Fp]=x[Vp]=x[oa]=x[Up]=x[Bp]=x[kp]=x[Gp]=x[Xp]=x[Zp]=x[th]=x[eh]=!0,x[Dp]=x[na]=x[Hp]=!1;function ae(t,e,r,n,o,a){var s,i=e&Tp,u=e&Pp,c=e&Mp;if(r&&(s=o?r(t,n,o,a):r(t)),s!==void 0)return s;if(!W(t))return t;var d=F(t);if(d){if(s=Zd(t),!i)return yo(t,s)}else{var l=Q(t),f=l==na||l==Lp;if(te(t))return Uo(t,i);if(l==oa||l==ra||f&&!o){if(s=u||f?{}:Zo(t),!i)return u?Hd(t,Ld(s,t)):kd(t,Dd(s,t))}else{if(!x[l])return o?t:{};s=Ep(t,l,i)}}a||(a=new K);var h=a.get(t);if(h)return h;a.set(t,s),Ap(t)?t.forEach(function(p){s.add(ae(p,e,r,p,t,a))}):$p(t)&&t.forEach(function(p,m){s.set(m,ae(p,e,r,m,t,a))});var g=c?u?Sr:_r:u?re:we,b=d?void 0:g(t);return Fl(b||t,function(p,m){b&&(m=p,p=t[m]),cr(s,m,ae(p,e,r,m,t,a))}),s}var rh=1,nh=4;function aa(t){return ae(t,rh|nh)}var oh="__lodash_hash_undefined__";function ah(t){return this.__data__.set(t,oh),this}function sh(t){return this.__data__.has(t)}function se(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new it;++e<r;)this.add(t[e])}se.prototype.add=se.prototype.push=ah,se.prototype.has=sh;function ih(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function sa(t,e){return t.has(e)}var uh=1,ch=2;function ia(t,e,r,n,o,a){var s=r&uh,i=t.length,u=e.length;if(i!=u&&!(s&&u>i))return!1;var c=a.get(t),d=a.get(e);if(c&&d)return c==e&&d==t;var l=-1,f=!0,h=r&ch?new se:void 0;for(a.set(t,e),a.set(e,t);++l<i;){var g=t[l],b=e[l];if(n)var p=s?n(b,g,l,e,t,a):n(g,b,l,t,e,a);if(p!==void 0){if(p)continue;f=!1;break}if(h){if(!ih(e,function(m,v){if(!sa(h,v)&&(g===m||o(g,m,r,n,a)))return h.push(v)})){f=!1;break}}else if(!(g===b||o(g,b,r,n,a))){f=!1;break}}return a.delete(t),a.delete(e),f}function lh(t){var e=-1,r=Array(t.size);return t.forEach(function(n,o){r[++e]=[o,n]}),r}function wr(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var fh=1,dh=2,ph="[object Boolean]",hh="[object Date]",gh="[object Error]",mh="[object Map]",vh="[object Number]",yh="[object RegExp]",bh="[object Set]",_h="[object String]",Sh="[object Symbol]",Oh="[object ArrayBuffer]",Eh="[object DataView]",ua=q?q.prototype:void 0,$r=ua?ua.valueOf:void 0;function Ch(t,e,r,n,o,a,s){switch(r){case Eh:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Oh:return!(t.byteLength!=e.byteLength||!a(new Ae(t),new Ae(e)));case ph:case hh:case vh:return Xt(+t,+e);case gh:return t.name==e.name&&t.message==e.message;case yh:case _h:return t==e+"";case mh:var i=lh;case bh:var u=n&fh;if(i||(i=wr),t.size!=e.size&&!u)return!1;var c=s.get(t);if(c)return c==e;n|=dh,s.set(t,e);var d=ia(i(t),i(e),n,o,a,s);return s.delete(t),d;case Sh:if($r)return $r.call(t)==$r.call(e)}return!1}var wh=1,$h=Object.prototype,Nh=$h.hasOwnProperty;function jh(t,e,r,n,o,a){var s=r&wh,i=_r(t),u=i.length,c=_r(e),d=c.length;if(u!=d&&!s)return!1;for(var l=u;l--;){var f=i[l];if(!(s?f in e:Nh.call(e,f)))return!1}var h=a.get(t),g=a.get(e);if(h&&g)return h==e&&g==t;var b=!0;a.set(t,e),a.set(e,t);for(var p=s;++l<u;){f=i[l];var m=t[f],v=e[f];if(n)var y=s?n(v,m,f,e,t,a):n(m,v,f,t,e,a);if(!(y===void 0?m===v||o(m,v,r,n,a):y)){b=!1;break}p||(p=f=="constructor")}if(b&&!p){var _=t.constructor,O=e.constructor;_!=O&&"constructor"in t&&"constructor"in e&&!(typeof _=="function"&&_ instanceof _&&typeof O=="function"&&O instanceof O)&&(b=!1)}return a.delete(t),a.delete(e),b}var Ah=1,ca="[object Arguments]",la="[object Array]",Te="[object Object]",Th=Object.prototype,fa=Th.hasOwnProperty;function Ph(t,e,r,n,o,a){var s=F(t),i=F(e),u=s?la:Q(t),c=i?la:Q(e);u=u==ca?Te:u,c=c==ca?Te:c;var d=u==Te,l=c==Te,f=u==c;if(f&&te(t)){if(!te(e))return!1;s=!0,d=!1}if(f&&!d)return a||(a=new K),s||hr(t)?ia(t,e,r,n,o,a):Ch(t,e,u,r,n,o,a);if(!(r&Ah)){var h=d&&fa.call(t,"__wrapped__"),g=l&&fa.call(e,"__wrapped__");if(h||g){var b=h?t.value():t,p=g?e.value():e;return a||(a=new K),o(b,p,r,n,a)}}return f?(a||(a=new K),jh(t,e,r,n,o,a)):!1}function Nr(t,e,r,n,o){return t===e?!0:t==null||e==null||!tt(t)&&!tt(e)?t!==t&&e!==e:Ph(t,e,r,n,Nr,o)}var Mh=1,xh=2;function Rh(t,e,r,n){var o=r.length,a=o;if(t==null)return!a;for(t=Object(t);o--;){var s=r[o];if(s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++o<a;){s=r[o];var i=s[0],u=t[i],c=s[1];if(s[2]){if(u===void 0&&!(i in t))return!1}else{var d=new K,l;if(!(l===void 0?Nr(c,u,Mh|xh,n,d):l))return!1}}return!0}function da(t){return t===t&&!W(t)}function Ih(t){for(var e=we(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,da(o)]}return e}function pa(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function Dh(t){var e=Ih(t);return e.length==1&&e[0][2]?pa(e[0][0],e[0][1]):function(r){return r===t||Rh(r,t,e)}}function Lh(t,e){return t!=null&&e in Object(t)}function Fh(t,e,r){e=Lt(e,t);for(var n=-1,o=e.length,a=!1;++n<o;){var s=Ft(e[n]);if(!(a=t!=null&&r(t,s)))break;t=t[s]}return a||++n!=o?a:(o=t==null?0:t.length,!!o&&lr(o)&&Ee(s,o)&&(F(t)||Zt(t)))}function Vh(t,e){return t!=null&&Fh(t,e,Lh)}var Uh=1,Bh=2;function kh(t,e){return gr(t)&&da(e)?pa(Ft(t),e):function(r){var n=Mo(r,t);return n===void 0&&n===e?Vh(r,t):Nr(e,n,Uh|Bh)}}function Gh(t){return function(e){return e==null?void 0:e[t]}}function Hh(t){return function(e){return je(e,t)}}function zh(t){return gr(t)?Gh(Ft(t)):Hh(t)}function jr(t){return typeof t=="function"?t:t==null?or:typeof t=="object"?F(t)?kh(t[0],t[1]):Dh(t):zh(t)}function qh(t){return function(e,r,n){for(var o=-1,a=Object(e),s=n(e),i=s.length;i--;){var u=s[++o];if(r(a[u],u,a)===!1)break}return e}}var Jh=qh();function Ar(t,e,r){(r!==void 0&&!Xt(t[e],r)||r===void 0&&!(e in t))&&ur(t,e,r)}function Tr(t){return tt(t)&&Ce(t)}function Pr(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Wh(t){return It(t,re(t))}function Kh(t,e,r,n,o,a,s){var i=Pr(t,r),u=Pr(e,r),c=s.get(u);if(c){Ar(t,r,c);return}var d=a?a(i,u,r+"",t,e,s):void 0,l=d===void 0;if(l){var f=F(u),h=!f&&te(u),g=!f&&!h&&hr(u);d=u,f||h||g?F(i)?d=i:Tr(i)?d=yo(i):h?(l=!1,d=Uo(u,!0)):g?(l=!1,d=Xo(u,!0)):d=[]:V(u)||Zt(u)?(d=i,Zt(i)?d=Wh(i):(!W(i)||ar(i))&&(d=Zo(u))):l=!1}l&&(s.set(u,d),o(d,u,n,a,s),s.delete(u)),Ar(t,r,d)}function ha(t,e,r,n,o){t!==e&&Jh(e,function(a,s){if(o||(o=new K),W(a))Kh(t,e,s,r,ha,n,o);else{var i=n?n(Pr(t,s),a,s+"",t,e,o):void 0;i===void 0&&(i=a),Ar(t,s,i)}},re)}function ga(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function Qh(t,e){return e.length<2?t:je(t,Ad(e,0,-1))}var ma=Ql(function(t,e,r){ha(t,e,r)}),Yh="Expected a function";function Xh(t){if(typeof t!="function")throw new TypeError(Yh);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function Zh(t,e){return e=Lt(e,t),t=Qh(t,e),t==null||delete t[Ft(ga(e))]}function tg(t){return V(t)?void 0:t}var eg=1,rg=2,ng=4,va=Ed(function(t,e){var r={};if(t==null)return r;var n=!1;e=nr(e,function(a){return a=Lt(a,t),n||(n=a.length>1),a}),It(t,Sr(t),r),n&&(r=ae(r,eg|rg|ng,tg));for(var o=e.length;o--;)Zh(r,e[o]);return r});function og(t,e,r,n){if(!W(t))return t;e=Lt(e,t);for(var o=-1,a=e.length,s=a-1,i=t;i!=null&&++o<a;){var u=Ft(e[o]),c=r;if(u==="__proto__"||u==="constructor"||u==="prototype")return t;if(o!=s){var d=i[u];c=void 0,c===void 0&&(c=W(d)?d:Ee(e[o+1])?[]:{})}cr(i,u,c),i=i[u]}return t}function ag(t,e,r){for(var n=-1,o=e.length,a={};++n<o;){var s=e[n],i=je(t,s);r(i,s)&&og(a,Lt(s,t),i)}return a}function sg(t,e){if(t==null)return{};var r=nr(Sr(t),function(n){return[n]});return e=jr(e),ag(t,r,function(n,o){return e(n,o[0])})}function ig(t,e){return sg(t,Xh(jr(e)))}var ug=1/0,cg=Vt&&1/wr(new Vt([,-0]))[1]==ug?function(t){return new Vt(t)}:Pl,lg=200;function fg(t,e,r){var n=-1,o=Gl,a=t.length,s=!0,i=[],u=i;if(a>=lg){var c=e?null:cg(t);if(c)return wr(c);s=!1,o=sa,u=new se}else u=e?[]:i;t:for(;++n<a;){var d=t[n],l=e?e(d):d;if(d=d!==0?d:0,s&&l===l){for(var f=u.length;f--;)if(u[f]===l)continue t;e&&u.push(l),i.push(d)}else o(u,l,r)||(u!==i&&u.push(l),i.push(d))}return i}var dg=Oo(function(t){var e=ga(t);return Tr(e)&&(e=void 0),fg(Ro(t,1,Tr,!0),jr(e))});class ya extends TypeError{constructor(e,r){let n;const{message:o,...a}=e,{path:s}=e,i=s.length===0?o:`At path: ${s.join(".")} -- ${o}`;super(i),this.value=void 0,this.key=void 0,this.type=void 0,this.refinement=void 0,this.path=void 0,this.branch=void 0,this.failures=void 0,Object.assign(this,a),this.name=this.constructor.name,this.failures=()=>n??(n=[e,...r()])}}function pg(t){return Y(t)&&typeof t[Symbol.iterator]=="function"}function Y(t){return typeof t=="object"&&t!=null}function k(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function hg(t){const{done:e,value:r}=t.next();return e?void 0:r}function gg(t,e,r,n){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:o,branch:a}=e,{type:s}=r,{refinement:i,message:u=`Expected a value of type \`${s}\`${i?` with refinement \`${i}\``:""}, but received: \`${k(n)}\``}=t;return{value:n,type:s,refinement:i,key:o[o.length-1],path:o,branch:a,...t,message:u}}function*ba(t,e,r,n){pg(t)||(t=[t]);for(const o of t){const a=gg(o,e,r,n);a&&(yield a)}}function*Mr(t,e,r){r===void 0&&(r={});const{path:n=[],branch:o=[t],coerce:a=!1,mask:s=!1}=r,i={path:n,branch:o};if(a&&(t=e.coercer(t,i),s&&e.type!=="type"&&Y(e.schema)&&Y(t)&&!Array.isArray(t)))for(const c in t)e.schema[c]===void 0&&delete t[c];let u="valid";for(const c of e.validator(t,i))u="not_valid",yield[c,void 0];for(let[c,d,l]of e.entries(t,i)){const f=Mr(d,l,{path:c===void 0?n:[...n,c],branch:c===void 0?o:[...o,d],coerce:a,mask:s});for(const h of f)h[0]?(u=h[0].refinement!=null?"not_refined":"not_valid",yield[h[0],void 0]):a&&(d=h[1],c===void 0?t=d:t instanceof Map?t.set(c,d):t instanceof Set?t.add(d):Y(t)&&(d!==void 0||c in t)&&(t[c]=d))}if(u!=="not_valid")for(const c of e.refiner(t,i))u="not_refined",yield[c,void 0];u==="valid"&&(yield[void 0,t])}class et{constructor(e){this.TYPE=void 0,this.type=void 0,this.schema=void 0,this.coercer=void 0,this.validator=void 0,this.refiner=void 0,this.entries=void 0;const{type:r,schema:n,validator:o,refiner:a,coercer:s=u=>u,entries:i=function*(){}}=e;this.type=r,this.schema=n,this.entries=i,this.coercer=s,o?this.validator=(u,c)=>{const d=o(u,c);return ba(d,c,this,u)}:this.validator=()=>[],a?this.refiner=(u,c)=>{const d=a(u,c);return ba(d,c,this,u)}:this.refiner=()=>[]}assert(e){return _a(e,this)}create(e){return mg(e,this)}is(e){return yg(e,this)}mask(e){return vg(e,this)}validate(e,r){return r===void 0&&(r={}),Ut(e,this,r)}}function _a(t,e){const r=Ut(t,e);if(r[0])throw r[0]}function mg(t,e){const r=Ut(t,e,{coerce:!0});if(r[0])throw r[0];return r[1]}function vg(t,e){const r=Ut(t,e,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}function yg(t,e){return!Ut(t,e)[0]}function Ut(t,e,r){r===void 0&&(r={});const n=Mr(t,e,r),o=hg(n);return o[0]?[new ya(o[0],function*(){for(const a of n)a[0]&&(yield a[0])}),void 0]:[void 0,o[1]]}function xr(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];const n=e[0].type==="type",o=e.map(s=>s.schema),a=Object.assign({},...o);return n?Ca(a):P(a)}function pt(t,e){return new et({type:t,schema:null,validator:e})}function Bt(t){return new et({type:"dynamic",schema:null,*entries(e,r){yield*t(e,r).entries(e,r)},validator(e,r){return t(e,r).validator(e,r)},coercer(e,r){return t(e,r).coercer(e,r)},refiner(e,r){return t(e,r).refiner(e,r)}})}function Sa(t,e){const{schema:r}=t,n={...r};for(const o of e)delete n[o];switch(t.type){case"type":return Ca(n);default:return P(n)}}function M(){return pt("any",()=>!0)}function D(t){return new et({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${k(e)}`}})}function $t(){return pt("boolean",t=>typeof t=="boolean")}function Rr(t){const e={},r=t.map(n=>k(n)).join();for(const n of t)e[n]=n;return new et({type:"enums",schema:e,validator(n){return t.includes(n)||`Expected one of \`${r}\`, but received: ${k(n)}`}})}function Oa(){return pt("func",t=>typeof t=="function"||`Expected a function, but received: ${k(t)}`)}function G(t){const e=k(t),r=typeof t;return new et({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||`Expected the literal \`${e}\`, but received: ${k(n)}`}})}function bg(){return pt("never",()=>!1)}function Ea(){return pt("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${k(t)}`)}function P(t){const e=t?Object.keys(t):[],r=bg();return new et({type:"object",schema:t||null,*entries(n){if(t&&Y(n)){const o=new Set(Object.keys(n));for(const a of e)o.delete(a),yield[a,n[a],t[a]];for(const a of o)yield[a,n[a],r]}},validator(n){return Y(n)||`Expected an object, but received: ${k(n)}`},coercer(n){return Y(n)?{...n}:n}})}function S(t){return new et({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function ie(t,e){return new et({type:"record",schema:null,*entries(r){if(Y(r))for(const n in r){const o=r[n];yield[n,n,t],yield[n,o,e]}},validator(r){return Y(r)||`Expected an object, but received: ${k(r)}`}})}function C(){return pt("string",t=>typeof t=="string"||`Expected a string, but received: ${k(t)}`)}function Ca(t){const e=Object.keys(t);return new et({type:"type",schema:t,*entries(r){if(Y(r))for(const n of e)yield[n,r[n],t[n]]},validator(r){return Y(r)||`Expected an object, but received: ${k(r)}`}})}function H(t){const e=t.map(r=>r.type).join(" | ");return new et({type:"union",schema:null,coercer(r,n){return(t.find(o=>{const[a]=o.validate(r,{coerce:!0});return!a})||_g()).coercer(r,n)},validator(r,n){const o=[];for(const a of t){const[...s]=Mr(r,a,n),[i]=s;if(i[0])for(const[u]of s)u&&o.push(u);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${k(r)}`,...o]}})}function _g(){return pt("unknown",()=>!0)}const Ir=P({package:C(),version:C(),name:C(),exportName:S(C()),destructuring:S($t()),subName:S(C()),main:S(C()),cssPaths:S(D(C()))}),Sg=D(Ir);var U=(t=>(t.SLOT="SLOT",t.FUNCTION="FUNCTION",t.EXPRESSION="EXPRESSION",t.ACTION="ACTION",t.EVENT="EVENT",t))(U||{}),Dr=(t=>(t.DESIGN="design",t.SAVE="save",t))(Dr||{}),Lr=(t=>(t.FUNC="FUNC",t.COMP="COMP",t))(Lr||{});const Og=()=>pt("normalObj",t=>!V(t)||[U.SLOT,U.EXPRESSION,U.FUNCTION].includes(t==null?void 0:t.type)?!1:(Ut(t,ie(C(),Fr)),!0)),Fr=H([C(),Ea(),$t(),P({type:G(U.SLOT),renderType:Rr([Lr.FUNC,Lr.COMP]),params:S(D(C())),value:Bt(()=>H([kt,D(kt)]))}),P({type:G(U.EXPRESSION),value:C()}),P({type:G(U.FUNCTION),value:C()}),P({type:G(U.ACTION),handler:M()}),Og(),D(Bt(()=>Fr))]);var wa=(t=>(t.COMPONENTS="COMPONENTS",t))(wa||{});const $a=P({type:G(U.EXPRESSION),value:C()}),kt=P({id:S(C()),title:S(C()),componentName:C(),props:S(ie(C(),Fr)),nodeName:S(C()),state:S(ie(C(),M())),children:Bt(()=>S(D(H([C(),kt])))),eventListener:S(D(M())),configure:S(M()),css:S(M()),style:S(M()),classNames:S(D(M())),refId:S(C()),extra:S(ie(M(),M())),condition:S(H([$t(),$a])),loop:S(P({open:$t(),data:H([D(M()),$a]),args:S(D(C())),forName:S(C()),forIndex:S(C()),key:S(M()),name:S(C())})),injectEnvList:S(D(M())),methods:S(D(M()))}),Pe=H([C(),P({label:C(),tip:S(C())})]),Eg=P({type:G("shape"),value:D(P({name:C(),title:Pe,valueType:Bt(()=>Me)}))}),Cg=P({type:G("enums"),value:D(C())});P({type:G("array"),value:Bt(()=>Me)});const wg=P({type:G("array"),value:Bt(()=>D(Me))}),Me=H([Rr(["array","boolean","number","object","string"]),Rr(["component","expression","function"]),Eg,Cg,wg]),$g=H([C(),P({componentName:C(),props:S(M()),initialValue:S(M()),component:S(M()),hiddenLabel:S($t())})]),Vr=P({name:C(),title:Pe,valueType:Me,description:S(C()),defaultValue:M(),setters:S(D($g)),condition:S(Oa())});H([C(),Oa()]);var Ur=(t=>(t.SINGLE="single",t.GROUP="group",t))(Ur||{});H([C(),P({event:C(),name:S(C()),describe:S(C()),params:S(D(P({name:C(),description:C(),example:C()}))),template:S(C())})]);const Ng=P({id:S(C()),title:C(),snapshot:H([C(),M()]),snapshotText:S(C()),description:S(C()),tags:S(D(C())),groupName:S(C()),category:S(C()),schema:xr(Sa(kt,["id"]),P({componentName:S(C())}))}),jg=P({componentName:C(),title:C(),screenshot:S(C()),icon:S(C()),tags:S(D(C())),groupName:S(C()),category:S(C()),priority:S(Ea()),npm:S(Ir),snippets:D(Ng),props:D(H([Vr,P({title:S(Pe),type:G("single"),content:Vr}),P({title:S(Pe),type:G("group"),content:D(Vr)})])),events:S(M()),methods:S(M()),fixedProps:S(M()),isContainer:S(H([$t(),P({placeholder:C(),width:C(),height:C()})])),disableEditorDragDom:S(M()),isLayout:S($t()),rootSelector:S(C()),advanceCustom:S(M()),extra:S(ie(M(),M()))}),Ag=t=>({data:e,message:r,throwError:n})=>{const o=t({data:e,message:r,throwError:n});if(o.isValidate)return o;if(n)throw o.message||r?new Error(`${o.message||r}
|
|
53
56
|
originData: ${JSON.stringify(e)}`):new Error(`${JSON.stringify(e)}
|
|
54
57
|
data struct format is invalidate`);return o.message||r?console.warn(`${o.message||r}
|
|
55
58
|
originData: ${JSON.stringify(e)}`):console.warn(`${JSON.stringify(e)}
|
|
56
|
-
data struct format is invalidate`),o},
|
|
57
|
-
`)),{isValidate:!1,message:i,error:s}}})({data:e,message:r,throwError:n})};var ut=(t=>(t.ROOT_CONTAINER="RootContainer",t))(ut||{});const Mg=M({type:k(U.FUNCTION),value:E()}),Pg=Pr(Sa(Bt,["componentName"]),M({componentName:k("RootContainer")}));function xg(t){return{all:t=t||new Map,on:function(e,r){var n=t.get(e);n?n.push(r):t.set(e,[r])},off:function(e,r){var n=t.get(e);n&&(r?n.splice(n.indexOf(r)>>>0,1):t.set(e,[]))},emit:function(e,r){var n=t.get(e);n&&n.slice().map(function(o){o(r)}),(n=t.get("*"))&&n.slice().map(function(o){o(e,r)})}}}const ue=xg(),Rg=(t,e)=>{const r={...t,value:[]},n=t.value;let o=new kt([]);return e&&(o=e.materialsMode||new kt([])),n&&(F(n)?r.value=n.map(a=>new L(a,{parent:e,materials:o})):V(n)&&r.value.push(new L(n,{parent:e,materials:o}))),r};class Gt{constructor(e,r){j(this,"nodeType","SLOT"),j(this,"rawData"),j(this,"parent"),j(this,"emitter",ue),j(this,"data"),j(this,"id"),j(this,"materialsMode"),this.parent=(r==null?void 0:r.parent)||null,this.rawData=e;const n=(r==null?void 0:r.materials)||new kt([]);this.materialsMode=n,this.id=rt(),this.data=Rg(e,this)}get value(){return this.data}export(e){const r=this.data,n=o=>{if(o instanceof L)return o.export(e);if(V(o)){const a={};return Object.keys(o||{}).forEach(s=>{a[s]=n(o[s])}),a}return F(o)?o.map(a=>n(a)):(e==="design"&&delete o.id,o)};return n(r)}}const $a=t=>{let e=[];return t.forEach(r=>{const n=r;n.type?n.type===Vr.SINGLE?e.push(n.content):n.type===Vr.GROUP&&(e=[...e,...$a(n.content)]):e.push(r)}),e},Br=(t,e,r)=>{if(t.type)return t.type===U.SLOT?new Gt(t,{parent:e,materials:r}):t;if(V(t)){const n={};return Object.keys(t).forEach(o=>{n[o]=Gr(t[o],e,r)}),n}else return Array.isArray(t)?t.map(n=>Br(n,e,r)):t},Gr=(t,e,r)=>V(t)?Br(t,e,r):F(t)?t.map(n=>Br(n,e,r)):t;class ht{constructor(e,r,n){j(this,"nodeType","PROP"),j(this,"rawData"),j(this,"parent"),j(this,"emitter",ue),j(this,"data"),j(this,"name"),j(this,"materialsMode");const o=(n==null?void 0:n.materials)||new kt([]);this.materialsMode=o,this.parent=n==null?void 0:n.parent,this.rawData=r,this.name=e,this.data=Gr(r,this,o)}isIncludeSlot(){return!1}isIncludeExpression(){return!1}get value(){return this.data}updateValue(e){const r=this.data;this.data=Gr(e??r,this,this.materialsMode),this.emitter.emit("onPropChange",{value:this.data,preValue:r,node:this}),this.parent&&!(this.parent instanceof Gt)&&this.emitter.emit("onNodeChange",{value:this.parent.value,preValue:this.parent.value,node:this.parent})}get material(){const e=this.parent;if(e instanceof L){const r=e.material;return $a((r==null?void 0:r.value.props)||[]).find(n=>n.name===this.name)}else return null}export(e){const r=this.data,n=o=>{if(o instanceof ht||o instanceof Gt||o instanceof L)return o.export(e);if(F(o))return o.map(a=>n(a));if(V(o)){const a={};return Object.keys(o||{}).forEach(s=>{a[s]=n(o[s])}),a}return o};return n(r)}}const Ig=t=>{if(typeof t=="string")return!0;Ur({data:t,dataStruct:Bt,throwError:!1})},ja=(t,e,r)=>{if(typeof t=="string")return t;const n={...t,id:t.id??rt(),children:[],props:{},methods:t.methods||[],configure:ma(t.configure||{},{propsSetter:{},advanceSetter:{}})},o=Object.keys(t.props||{});return o.length&&o.forEach(a=>{var s;const i=(s=t.props)==null?void 0:s[a];if(i instanceof ht){n.props[a]=i;return}n.props[a]=new ht(a,i||"",{parent:e,materials:r})}),t.children&&(Array.isArray(t.children)?n.children=t.children.map(a=>{if(a instanceof L)return a;if(V(a)){const s=a;return new L(s,{parent:e,materials:r})}else return a}):(t.children instanceof L&&(n.children=[t.children]),n.children=[new L(t.children,{parent:e,materials:r})])),n};class L{constructor(e,r){j(this,"nodeType","NODE"),j(this,"rawData"),j(this,"data"),j(this,"emitter",ue),j(this,"parent"),j(this,"materialsModel"),j(this,"listenerHandler"),j(this,"onChangeCbQueue"),this.rawData=JSON.parse(JSON.stringify(e)),Ig(e);const n=(r==null?void 0:r.materials)||new kt([]);this.parent=(r==null?void 0:r.parent)||null,this.materialsModel=n,this.data=ja(e,this,n),this.listenerHandler=[],this.onChangeCbQueue=[],this.registerListener()}registerListener(){const e=r=>{const{node:n}=r;n===this&&n.id===this.id&&this.onChangeCbQueue.forEach(o=>o(r))};this.emitter.on("onNodeChange",e),this.listenerHandler.push(()=>{this.emitter.off("onNodeChange",e)})}onChange(e){return this.onChangeCbQueue.push(e),()=>{this.onChangeCbQueue=this.onChangeCbQueue.filter(r=>r!==e)}}destroy(){this.listenerHandler.forEach(e=>e())}get id(){return this.data.id}get value(){return this.data}clone(e){const r={...this.export("design"),id:e||rt()};return new L(r,{materials:this.materialsModel})}updateWithPlainObj(e){const r={...this.data,...e};return this.data=ja(r,this,this.materialsModel),r}updateValue(e){const r=this.data,n=this.updateWithPlainObj(e);this.emitter.emit("onNodeChange",{value:n,preValue:r,node:this})}contains(e){return zr(this,e)}get props(){return this.data.props}get material(){const e=this.materialsModel;return e==null?void 0:e.findByComponentName(this.data.componentName)}getPlainProps(){const e=this.data,r={};return Object.keys(e.props||{}).forEach(n=>{r[n]=e.props[n].export("design")}),r}getMaterialConfig(e){var r;return this.data.configure[e]!==void 0?this.data.configure.isContainer:(r=this.material)==null?void 0:r.value.isContainer}isContainer(){return this.getMaterialConfig("isContainer")}export(e){var r;const n=this.data;if(typeof n=="string")return n;const o={};Object.keys(n.props||{}).forEach(l=>{o[l]=n.props[l].export(e)});const a=(r=n.children)==null?void 0:r.map(l=>l instanceof L?l.export(e):l),s=n.configure||{},i=s.propsSetter||{},u={};Object.keys(i).forEach(l=>{const f=Po(i,l,!1);f&&(u[l]=f)}),s.propsSetter=u;const c=this.materialsModel.usedMaterials.find(l=>{var f;return l.componentName===((f=this.material)==null?void 0:f.componentName)});this.material&&!c&&this.materialsModel.usedMaterials.push(this.material);let d={...n,configure:s,props:o,children:a,condition:n.condition,extra:this.data.extra};return e==="design"&&delete d.id,d=Hr(d),d}}const Aa=(t,e,r)=>{const n={...t,id:rt(),props:{},componentName:ut.ROOT_CONTAINER,children:[],methods:t.methods||[],configure:ma(t.configure||{},{propsSetter:{},advanceSetter:{}}),injectEnvList:t.injectEnvList};let o=[];F(t.children)?o=t.children.map(s=>s instanceof L?s:V(s)?new L(s,{parent:e,materials:r}):s):t.children instanceof L?o.push(t.children):t.children&&V(t.children)&&o.push(new L(t.children,{parent:e,materials:r}));const a=Object.keys(t.props||{});return a.length&&a.forEach(s=>{var i;const u=(i=t.props)==null?void 0:i[s];u instanceof ht?n.props[s]=u:n.props[s]=new ht(s,u||"",{parent:e,materials:r})}),n.children=o,n};class ce{constructor(e,{parent:r,materials:n}){j(this,"rawData"),j(this,"data"),j(this,"nodeType",ut.ROOT_CONTAINER),j(this,"emitter",ue),j(this,"materialsModel"),j(this,"listenerHandler"),j(this,"onChangeCbQueue"),j(this,"parent"),this.materialsModel=n,this.rawData=JSON.parse(JSON.stringify(e)),this.data=Aa(e,this,n),this.listenerHandler=[],this.onChangeCbQueue=[],this.registerListener(),this.parent=r}registerListener(){const e=r=>{const{node:n}=r;n===this&&n.id===this.id&&this.onChangeCbQueue.forEach(o=>o(r))};this.emitter.on("onNodeChange",e),this.listenerHandler.push(()=>{this.emitter.off("onNodeChange",e)})}onChange(e){return this.onChangeCbQueue.push(e),()=>{this.onChangeCbQueue=this.onChangeCbQueue.filter(r=>r!==e)}}get id(){return this.data.id}get value(){return this.data}get props(){return this.data.props}get material(){const e=this.materialsModel;return e==null?void 0:e.findByComponentName(this.data.componentName)}updateWithPlainObj(e){const r={...this.data,...e};return this.data=Aa(r,this,this.materialsModel),r}updateValue(e){const r=this.data;this.updateWithPlainObj(e),this.emitter.emit("onNodeChange",{value:this.data,preValue:r,node:this})}contains(e){return zr(this,e)}getMaterialConfig(e){var r;return this.data.configure[e]!==void 0?this.data.configure.isContainer:(r=this.material)==null?void 0:r.value.isContainer}isContainer(){return this.getMaterialConfig("isContainer")}export(e=Ir.SAVE){var r;const n=this.data,o={};Object.keys(n.props||{}).forEach(u=>{o[u]=n.props[u].export(e)});const a=((r=n.children)==null?void 0:r.map(u=>{var c;return(c=u==null?void 0:u.export)==null?void 0:c.call(u,e)}))||[],s={...n,props:o,children:a.filter(u=>u),condition:n.condition,extra:this.data.extra};let i=va(s,["id"]);return i=Hr(i),i}getPlainProps(){const e=this.data,r={};return Object.keys(e.props||{}).forEach(n=>{r[n]=e.props[n].export("design")}),r}destroy(){this.listenerHandler.forEach(e=>e())}clone(e){const r={...this.export("design"),id:e||rt()};return new ce(r,{materials:this.materialsModel,parent:null})}}const $t=t=>(t==null?void 0:t.type)===U.EXPRESSION,Ta=t=>(t==null?void 0:t.type)===U.FUNCTION,Dg=t=>(t==null?void 0:t.type)===U.ACTION,rt=()=>Math.random().toString(32).slice(3,9),Lg=t=>(t==null?void 0:t.nodeType)==="NODE",kr=t=>(t==null?void 0:t.nodeType)==="PROP",Fg=t=>(t==null?void 0:t.nodeType)==="SLOT",Hr=t=>ig(t,e=>V(e)?!Object.keys(e).length:F(e)?!e.length:!e);function Vg(t,e){const r=[t];for(;r.length;){const n=r.shift();if(n&&e(n))return n;const o=(n==null?void 0:n.props)||{},a=i=>{if(i instanceof L){r.push(i);return}if(i instanceof Gt&&a(i.value.value),i instanceof ht){a(i.value);return}if(V(i)){const u=i;Object.keys(u).forEach(c=>{a(u[c])});return}if(F(i)){i.forEach(u=>{a(u)});return}};a(o);const s=(n==null?void 0:n.value.children.filter(i=>i instanceof L))||[];r.push(...s)}}function zr(t,e){return Vg(t,r=>r.id===e)}const Ug=t=>{const e=aa(t),r=e.snippets;return delete e.snippets,e.snippets=r.map(n=>({...e,...n,id:n.id||`${t.componentName}-${rt()}`,title:n.title||t.title,category:n.category||t.category,tags:[...n.tags||[],...t.tags||[]],groupName:n.groupName||t.groupName,snapshot:n.snapshot||t.icon,snapshotText:n.snapshotText,schema:{...n.schema,componentName:n.schema.componentName||t.componentName}})),e};class Bg{constructor(e){j(this,"rawData"),j(this,"data"),this.rawData=e,this.data=Ug(e)}get value(){return this.data}get rawValue(){return this.rawData}get componentName(){return this.data.componentName}get snippets(){return this.data.snippets}getSnippetById(e){return this.data.snippets.find(r=>r.id===e)}}const qr=t=>{if(!F(t))throw new Error("Materials must be a array");return t.map(e=>new Bg(e))},Gg=t=>{t==null||t.forEach(e=>{Ur({data:e,dataStruct:Ag,throwError:!1})})};class kt{constructor(e){j(this,"rawData"),j(this,"data"),j(this,"usedMaterials",[]),this.rawData=e,Gg(e),this.data=qr(e)}addMaterials(e){const r=qr(e),n=[],o=this.data.map(s=>{const i=r.findIndex(u=>u.componentName===s.componentName);return i>=0?(n.push(i),r[i]):s}),a=r.filter((s,i)=>!n.includes(i));this.data=[...o,...a]}replaceMaterials(e){const r=qr(e);this.data=[...r]}removeMaterial(e){const r=this.data.filter(n=>!e.includes(n.componentName));this.data=r}findByComponentName(e){return this.data.find(r=>r.componentName===e)}findSnippetById(e){const r=[...this.data];let n=null;for(;!n&&r.length;){const o=r.pop();n=o==null?void 0:o.getSnippetById(e)}return n}getAllSnippets(){const e=this.data.reduce((a,s)=>(a.push(...s.snippets),a),[]),r=[],n={default:[]};e.forEach(a=>{const s=a.groupName||"default";r.includes(s)||(r.push(s),n[s]=[]),n[s].push(a)});let o=[];return r.forEach(a=>{const s=["default"],i={default:[]},u=n[a];if(u.length!==0){u.forEach(l=>{const f=l.category||"default";s.includes(f)||(s.push(f),i[f]=[]),i[f].push(l)});const c=[];s.forEach(l=>{i[l].length&&c.push({name:l,list:i[l]})});const d={name:a,list:c};o.push(d)}}),o=o.sort((a,s)=>(a.name||"")>(s.name||"")?1:-1),o}get value(){return this.data}get rawValue(){return this.rawData}}const kg=M({version:S(E()),name:S(E()),css:S(E()),lifecycle:S(P()),props:S(P()),methods:S(D(Mg)),componentsMeta:D(Pr(M({componentName:E()}),Rr)),thirdLibs:S(Sg),componentsTree:Pg,assets:S(D(P())),extra:S(P())}),Ma=t=>(Ur({data:t,dataStruct:kg,throwError:!1}),t),Jr=(t,e,r)=>({...t,componentsTree:new ce(t.componentsTree,{parent:e,materials:r})});class Pe{constructor(e,r){j(this,"nodeType","PAGE"),j(this,"rawData"),j(this,"emitter",ue),j(this,"data"),j(this,"parent"),j(this,"materialsModel"),j(this,"assetPackagesList"),Ma(e),this.rawData=JSON.parse(JSON.stringify(e)),this.materialsModel=new kt((r==null?void 0:r.materials)||[]),this.data=Jr(e,this,this.materialsModel),this.assetPackagesList=[...(r==null?void 0:r.assetPackagesList)||[],...this.data.assets||[]]}updatePage(e){const r=this.data;this.rawData=JSON.parse(JSON.stringify(e)),this.data=Jr(e,this,this.materialsModel),this.emitter.emit("onPageChange",{value:this.data,preValue:r,node:this})}reloadPage(e){const r=this.data;e&&(this.rawData=JSON.parse(JSON.stringify(e)),this.data=Jr(e,this,this.materialsModel)),this.emitter.emit("onReloadPage",{value:this.data,preValue:r,node:this})}get value(){return this.data}getNode(e){if(!e)return;const r=this.data.componentsTree;return zr(r,e)}addNode(e,r,n="AFTER"){var o;if(n==="AFTER"||n==="BEFORE"){const a=r.parent;if(a===null&&r instanceof ce)return console.warn("Not found parent node"),!1;if(a instanceof ht)return console.warn("CProp can not add node"),!1;if(a instanceof Gt){const i=a.value.value,u=i.findIndex(c=>c===r)??-1;return u>=0?(n==="BEFORE"?i.splice(u,0,e):i.splice(u+1,0,e),e.parent=a,(o=a.parent)==null||o.updateValue(),!0):!1}if(a instanceof Pe)return!1;const s=(a==null?void 0:a.value.children.findIndex(i=>i===r))??-1;return s>=0?(n==="BEFORE"?a==null||a.value.children.splice(s,0,e):a==null||a.value.children.splice(s+1,0,e),e.parent=a,a==null||a.updateValue(),!0):(console.warn("Not found target node"),!1)}if(n==="CHILD_START")return r.value.children.unshift(e),e.parent=r,r.updateValue(),!0;if(n==="CHILD_END")return r.value.children.push(e),e.parent=r,r.updateValue(),!0;if(V(n)){const a=n;if(a.type==="CHILD"){const s=a.pos,i=a.index||0;return s==="BEFORE"?r==null||r.value.children.splice(i,0,e):r==null||r.value.children.splice(i+1,0,e),e.parent=r,r.updateValue(),!0}else console.warn("Can not parse pos obj")}return!1}createNode(e){return delete e.id,new L(e,{parent:null,materials:this.materialsModel})}addNodeById(e,r,n="AFTER"){const o=this.getNode(r);return o?this.addNode(e,o,n):(console.warn(`Not find a node by ${r}, pls check it`),!1)}copyNode(e){const r=e.export("design");r.id=rt();const n=new L(r,{parent:e.parent,materials:this.materialsModel});return this.addNode(n,e,"AFTER"),n}copyNodeById(e){const r=this.getNode(e);return r&&r instanceof L?this.copyNode(r):!1}moveNode(e,r,n){this.deleteNode(e);let o=r;return["AFTER","BEFORE"].includes(n)&&(o=r.parent),e.parent=o,this.addNode(e,r,n)}moveNodeById(e,r,n){const o=this.getNode(e),a=this.getNode(r);return o&&a&&o instanceof L&&a instanceof L?this.moveNode(o,a,n):!1}deleteNode(e){var r;const n=e.parent;if(!n)throw new Error("parent node is null or undefined, pls check it");if(n instanceof Gt){const o=n.value.value,a=o.findIndex(i=>i===e),s=o[a];return o.splice(a,1),(r=n.parent)==null||r.updateValue(),s}if(n instanceof L||n instanceof ce){const o=n.value.children,a=o.findIndex(i=>i===e),s=o[a];return o.splice(a,1),n.updateValue(),s}}deleteNodeById(e){const r=this.getNode(e);if(r)return this.deleteNode(r)}export(e=Ir.SAVE){var r;const n=this.data.componentsTree.export(e),o=this.assetPackagesList,a=[],s=this.materialsModel.usedMaterials.map(u=>{const c=o.find(d=>{var l;return d.package===((l=u.value.npm)==null?void 0:l.package)});return c&&a.push(c),{componentName:u.componentName,...aa(u.value.npm||{})}}).filter(u=>u.componentName&&u.package&&u.version?!0:(console.warn(`${JSON.stringify(u,null,2)} not a valid material info`),!1));this.materialsModel.usedMaterials=[];let i={...this.data,componentsTree:Hr(n),componentsMeta:s,thirdLibs:this.data.thirdLibs,assets:[],extra:this.data.extra};return(r=this.data.thirdLibs)==null||r.forEach(u=>{const c=o.find(d=>u.package===d.package);c&&a.push(c)}),i.assets=dg(a,u=>u.package),i=va(i,["id"]),JSON.parse(JSON.stringify(i))}getRootNode(){return this.data.componentsTree}}ut.ROOT_CONTAINER;const le="DYNAMIC",Pa=["$$context","$$nodeModel"],Wr="ON_DID_RENDER",Kr="ON_WILL_DESTROY",xa=[Wr,Kr],Qr=(t,e)=>{let r=t;return e&&(r={...t},r.__proto__=e||null),r},fe=(t,e={},...r)=>typeof t=="string"||typeof t=="number"?String(t):(Pa.forEach(o=>{o in e&&t.__CP_TYPE__!==le&&delete e[o]}),N.createElement(t,e,...r)),Ra=(t={},e)=>{const r=[],n=(o,a)=>{let s=a;kr(a)&&(s=a.value),e(s)?r.push({keyPath:o,val:s}):nt(s)?s.forEach((i,u)=>{n([...o,String(u)],i)}):Pt(s)&&Object.keys(s).forEach(i=>{n([...o,i],s[i])})};return n(["$root"],t),r},Ht=(t,e)=>{const r=t.handler,{context:n,storeManager:o}=e;return e.actionVariableSpace||(e.actionVariableSpace={}),async function(...a){const s={},i=async d=>{const l=d;if(l.type==="RUN_CODE"){const f=xt({funcName:"",funcBody:`function() {
|
|
59
|
+
data struct format is invalidate`),o},Br=t=>{const{data:e,message:r,throwError:n,dataStruct:o}=t;return Ag(({data:a})=>{try{return _a(a,o),{isValidate:!0}}catch(s){let i=s;return s instanceof ya&&(i=s.failures().map(u=>`【${u.path.join(".")}】: ${u.message}
|
|
60
|
+
`)),{isValidate:!1,message:i,error:s}}})({data:e,message:r,throwError:n})};var ut=(t=>(t.ROOT_CONTAINER="RootContainer",t))(ut||{});const Tg=P({type:G(U.FUNCTION),value:C()}),Pg=xr(Sa(kt,["componentName"]),P({componentName:G("RootContainer")}));function Mg(t){return{all:t=t||new Map,on:function(e,r){var n=t.get(e);n?n.push(r):t.set(e,[r])},off:function(e,r){var n=t.get(e);n&&(r?n.splice(n.indexOf(r)>>>0,1):t.set(e,[]))},emit:function(e,r){var n=t.get(e);n&&n.slice().map(function(o){o(r)}),(n=t.get("*"))&&n.slice().map(function(o){o(e,r)})}}}const ue=Mg(),xg=(t,e)=>{const r={...t,value:[]},n=t.value;let o=new Ht([]);return e&&(o=e.materialsMode||new Ht([])),n&&(F(n)?r.value=n.map(a=>new L(a,{parent:e,materials:o})):V(n)&&r.value.push(new L(n,{parent:e,materials:o}))),r};class Gt{constructor(e,r){j(this,"nodeType","SLOT"),j(this,"rawData"),j(this,"parent"),j(this,"emitter",ue),j(this,"data"),j(this,"id"),j(this,"materialsMode"),this.parent=(r==null?void 0:r.parent)||null,this.rawData=e;const n=(r==null?void 0:r.materials)||new Ht([]);this.materialsMode=n,this.id=rt(),this.data=xg(e,this)}get value(){return this.data}export(e){const r=this.data,n=o=>{if(o instanceof L)return o.export(e);if(V(o)){const a={};return Object.keys(o||{}).forEach(s=>{a[s]=n(o[s])}),a}return F(o)?o.map(a=>n(a)):(e==="design"&&delete o.id,o)};return n(r)}}const Na=t=>{let e=[];return t.forEach(r=>{const n=r;n.type?n.type===Ur.SINGLE?e.push(n.content):n.type===Ur.GROUP&&(e=[...e,...Na(n.content)]):e.push(r)}),e},kr=(t,e,r)=>{if(t.type)return t.type===U.SLOT?new Gt(t,{parent:e,materials:r}):t;if(V(t)){const n={};return Object.keys(t).forEach(o=>{n[o]=Gr(t[o],e,r)}),n}else return Array.isArray(t)?t.map(n=>kr(n,e,r)):t},Gr=(t,e,r)=>V(t)?kr(t,e,r):F(t)?t.map(n=>kr(n,e,r)):t;class ht{constructor(e,r,n){j(this,"nodeType","PROP"),j(this,"rawData"),j(this,"parent"),j(this,"emitter",ue),j(this,"data"),j(this,"name"),j(this,"materialsMode");const o=(n==null?void 0:n.materials)||new Ht([]);this.materialsMode=o,this.parent=n==null?void 0:n.parent,this.rawData=r,this.name=e,this.data=Gr(r,this,o)}isIncludeSlot(){return!1}isIncludeExpression(){return!1}get value(){return this.data}updateValue(e){const r=this.data;this.data=Gr(e??r,this,this.materialsMode),this.emitter.emit("onPropChange",{value:this.data,preValue:r,node:this}),this.parent&&!(this.parent instanceof Gt)&&this.emitter.emit("onNodeChange",{value:this.parent.value,preValue:this.parent.value,node:this.parent})}get material(){const e=this.parent;if(e instanceof L){const r=e.material;return Na((r==null?void 0:r.value.props)||[]).find(n=>n.name===this.name)}else return null}export(e){const r=this.data,n=o=>{if(o instanceof ht||o instanceof Gt||o instanceof L)return o.export(e);if(F(o))return o.map(a=>n(a));if(V(o)){const a={};return Object.keys(o||{}).forEach(s=>{a[s]=n(o[s])}),a}return o};return n(r)}}const Rg=t=>{if(typeof t=="string")return!0;Br({data:t,dataStruct:kt,throwError:!1})},ja=(t,e,r)=>{if(typeof t=="string")return t;const n={...t,id:t.id??rt(),children:[],props:{},methods:t.methods||[],configure:ma(t.configure||{},{propsSetter:{},advanceSetter:{}})},o=Object.keys(t.props||{});return o.length&&o.forEach(a=>{var s;const i=(s=t.props)==null?void 0:s[a];if(i instanceof ht){n.props[a]=i;return}n.props[a]=new ht(a,i||"",{parent:e,materials:r})}),t.children&&(Array.isArray(t.children)?n.children=t.children.map(a=>{if(a instanceof L)return a;if(V(a)){const s=a;return new L(s,{parent:e,materials:r})}else return a}):(t.children instanceof L&&(n.children=[t.children]),n.children=[new L(t.children,{parent:e,materials:r})])),n};class L{constructor(e,r){j(this,"nodeType","NODE"),j(this,"rawData"),j(this,"data"),j(this,"emitter",ue),j(this,"parent"),j(this,"materialsModel"),j(this,"listenerHandler"),j(this,"onChangeCbQueue"),this.rawData=JSON.parse(JSON.stringify(e)),Rg(e);const n=(r==null?void 0:r.materials)||new Ht([]);this.parent=(r==null?void 0:r.parent)||null,this.materialsModel=n,this.data=ja(e,this,n),this.listenerHandler=[],this.onChangeCbQueue=[],this.registerListener()}registerListener(){const e=r=>{const{node:n}=r;n===this&&n.id===this.id&&this.onChangeCbQueue.forEach(o=>o(r))};this.emitter.on("onNodeChange",e),this.listenerHandler.push(()=>{this.emitter.off("onNodeChange",e)})}onChange(e){return this.onChangeCbQueue.push(e),()=>{this.onChangeCbQueue=this.onChangeCbQueue.filter(r=>r!==e)}}destroy(){this.listenerHandler.forEach(e=>e())}get id(){return this.data.id}get value(){return this.data}clone(e){const r={...this.export("design"),id:e||rt()};return new L(r,{materials:this.materialsModel})}updateWithPlainObj(e){const r={...this.data,...e};return this.data=ja(r,this,this.materialsModel),r}updateValue(e){const r=this.data,n=this.updateWithPlainObj(e);this.emitter.emit("onNodeChange",{value:n,preValue:r,node:this})}contains(e){return qr(this,e)}get props(){return this.data.props}get material(){const e=this.materialsModel;return e==null?void 0:e.findByComponentName(this.data.componentName)}getPlainProps(){const e=this.data,r={};return Object.keys(e.props||{}).forEach(n=>{r[n]=e.props[n].export("design")}),r}getMaterialConfig(e){var r;return this.data.configure[e]!==void 0?this.data.configure.isContainer:(r=this.material)==null?void 0:r.value.isContainer}isContainer(){return this.getMaterialConfig("isContainer")}export(e){var r;const n=this.data;if(typeof n=="string")return n;const o={};Object.keys(n.props||{}).forEach(l=>{o[l]=n.props[l].export(e)});const a=(r=n.children)==null?void 0:r.map(l=>l instanceof L?l.export(e):l),s=n.configure||{},i=s.propsSetter||{},u={};Object.keys(i).forEach(l=>{const f=Mo(i,l,!1);f&&(u[l]=f)}),s.propsSetter=u;const c=this.materialsModel.usedMaterials.find(l=>{var f;return l.componentName===((f=this.material)==null?void 0:f.componentName)});this.material&&!c&&this.materialsModel.usedMaterials.push(this.material);let d={...n,configure:s,props:o,children:a,condition:n.condition,extra:this.data.extra};return e==="design"&&delete d.id,d=zr(d),d}}const Aa=(t,e,r)=>{const n={...t,id:rt(),props:{},componentName:ut.ROOT_CONTAINER,children:[],methods:t.methods||[],configure:ma(t.configure||{},{propsSetter:{},advanceSetter:{}}),injectEnvList:t.injectEnvList};let o=[];F(t.children)?o=t.children.map(s=>s instanceof L?s:V(s)?new L(s,{parent:e,materials:r}):s):t.children instanceof L?o.push(t.children):t.children&&V(t.children)&&o.push(new L(t.children,{parent:e,materials:r}));const a=Object.keys(t.props||{});return a.length&&a.forEach(s=>{var i;const u=(i=t.props)==null?void 0:i[s];u instanceof ht?n.props[s]=u:n.props[s]=new ht(s,u||"",{parent:e,materials:r})}),n.children=o,n};class ce{constructor(e,{parent:r,materials:n}){j(this,"rawData"),j(this,"data"),j(this,"nodeType",ut.ROOT_CONTAINER),j(this,"emitter",ue),j(this,"materialsModel"),j(this,"listenerHandler"),j(this,"onChangeCbQueue"),j(this,"parent"),this.materialsModel=n,this.rawData=JSON.parse(JSON.stringify(e)),this.data=Aa(e,this,n),this.listenerHandler=[],this.onChangeCbQueue=[],this.registerListener(),this.parent=r}registerListener(){const e=r=>{const{node:n}=r;n===this&&n.id===this.id&&this.onChangeCbQueue.forEach(o=>o(r))};this.emitter.on("onNodeChange",e),this.listenerHandler.push(()=>{this.emitter.off("onNodeChange",e)})}onChange(e){return this.onChangeCbQueue.push(e),()=>{this.onChangeCbQueue=this.onChangeCbQueue.filter(r=>r!==e)}}get id(){return this.data.id}get value(){return this.data}get props(){return this.data.props}get material(){const e=this.materialsModel;return e==null?void 0:e.findByComponentName(this.data.componentName)}updateWithPlainObj(e){const r={...this.data,...e};return this.data=Aa(r,this,this.materialsModel),r}updateValue(e){const r=this.data;this.updateWithPlainObj(e),this.emitter.emit("onNodeChange",{value:this.data,preValue:r,node:this})}contains(e){return qr(this,e)}getMaterialConfig(e){var r;return this.data.configure[e]!==void 0?this.data.configure.isContainer:(r=this.material)==null?void 0:r.value.isContainer}isContainer(){return this.getMaterialConfig("isContainer")}export(e=Dr.SAVE){var r;const n=this.data,o={};Object.keys(n.props||{}).forEach(u=>{o[u]=n.props[u].export(e)});const a=((r=n.children)==null?void 0:r.map(u=>{var c;return(c=u==null?void 0:u.export)==null?void 0:c.call(u,e)}))||[],s={...n,props:o,children:a.filter(u=>u),condition:n.condition,extra:this.data.extra};let i=va(s,["id"]);return i=zr(i),i}getPlainProps(){const e=this.data,r={};return Object.keys(e.props||{}).forEach(n=>{r[n]=e.props[n].export("design")}),r}destroy(){this.listenerHandler.forEach(e=>e())}clone(e){const r={...this.export("design"),id:e||rt()};return new ce(r,{materials:this.materialsModel,parent:null})}}const Nt=t=>(t==null?void 0:t.type)===U.EXPRESSION,Ta=t=>(t==null?void 0:t.type)===U.FUNCTION,Ig=t=>(t==null?void 0:t.type)===U.ACTION,rt=()=>Math.random().toString(32).slice(3,9),Dg=t=>(t==null?void 0:t.nodeType)==="NODE",Hr=t=>(t==null?void 0:t.nodeType)==="PROP",Lg=t=>(t==null?void 0:t.nodeType)==="SLOT",zr=t=>ig(t,e=>V(e)?!Object.keys(e).length:F(e)?!e.length:!e);function Fg(t,e){const r=[t];for(;r.length;){const n=r.shift();if(n&&e(n))return n;const o=(n==null?void 0:n.props)||{},a=i=>{if(i instanceof L){r.push(i);return}if(i instanceof Gt&&a(i.value.value),i instanceof ht){a(i.value);return}if(V(i)){const u=i;Object.keys(u).forEach(c=>{a(u[c])});return}if(F(i)){i.forEach(u=>{a(u)});return}};a(o);const s=(n==null?void 0:n.value.children.filter(i=>i instanceof L))||[];r.push(...s)}}function qr(t,e){return Fg(t,r=>r.id===e)}const Vg=t=>{const e=aa(t),r=e.snippets;return delete e.snippets,e.snippets=r.map(n=>({...e,...n,id:n.id||`${t.componentName}-${rt()}`,title:n.title||t.title,category:n.category||t.category,tags:[...n.tags||[],...t.tags||[]],groupName:n.groupName||t.groupName,snapshot:n.snapshot||t.icon,snapshotText:n.snapshotText,schema:{...n.schema,componentName:n.schema.componentName||t.componentName}})),e};class Ug{constructor(e){j(this,"rawData"),j(this,"data"),this.rawData=e,this.data=Vg(e)}get value(){return this.data}get rawValue(){return this.rawData}get componentName(){return this.data.componentName}get snippets(){return this.data.snippets}getSnippetById(e){return this.data.snippets.find(r=>r.id===e)}}const Jr=t=>{if(!F(t))throw new Error("Materials must be a array");return t.map(e=>new Ug(e))},Bg=t=>{t==null||t.forEach(e=>{Br({data:e,dataStruct:jg,throwError:!1})})};class Ht{constructor(e){j(this,"rawData"),j(this,"data"),j(this,"usedMaterials",[]),this.rawData=e,Bg(e),this.data=Jr(e)}addMaterials(e){const r=Jr(e),n=[],o=this.data.map(s=>{const i=r.findIndex(u=>u.componentName===s.componentName);return i>=0?(n.push(i),r[i]):s}),a=r.filter((s,i)=>!n.includes(i));this.data=[...o,...a]}replaceMaterials(e){const r=Jr(e);this.data=[...r]}removeMaterial(e){const r=this.data.filter(n=>!e.includes(n.componentName));this.data=r}findByComponentName(e){return this.data.find(r=>r.componentName===e)}findSnippetById(e){const r=[...this.data];let n=null;for(;!n&&r.length;){const o=r.pop();n=o==null?void 0:o.getSnippetById(e)}return n}getAllSnippets(){const e=this.data.reduce((a,s)=>(a.push(...s.snippets),a),[]),r=[],n={default:[]};e.forEach(a=>{const s=a.groupName||"default";r.includes(s)||(r.push(s),n[s]=[]),n[s].push(a)});let o=[];return r.forEach(a=>{const s=["default"],i={default:[]},u=n[a];if(u.length!==0){u.forEach(l=>{const f=l.category||"default";s.includes(f)||(s.push(f),i[f]=[]),i[f].push(l)});const c=[];s.forEach(l=>{i[l].length&&c.push({name:l,list:i[l]})});const d={name:a,list:c};o.push(d)}}),o=o.sort((a,s)=>(a.name||"")>(s.name||"")?1:-1),o}get value(){return this.data}get rawValue(){return this.rawData}}const kg=P({version:S(C()),name:S(C()),css:S(C()),lifecycle:S(M()),props:S(M()),methods:S(D(Tg)),componentsMeta:D(xr(P({componentName:C()}),Ir)),thirdLibs:S(Sg),componentsTree:Pg,assets:S(D(M())),extra:S(M())}),Pa=t=>(Br({data:t,dataStruct:kg,throwError:!1}),t),Wr=(t,e,r)=>({...t,componentsTree:new ce(t.componentsTree,{parent:e,materials:r})});class xe{constructor(e,r){j(this,"nodeType","PAGE"),j(this,"rawData"),j(this,"emitter",ue),j(this,"data"),j(this,"parent"),j(this,"materialsModel"),j(this,"assetPackagesList"),Pa(e),this.rawData=JSON.parse(JSON.stringify(e)),this.materialsModel=new Ht((r==null?void 0:r.materials)||[]),this.data=Wr(e,this,this.materialsModel),this.assetPackagesList=[...(r==null?void 0:r.assetPackagesList)||[],...this.data.assets||[]]}updatePage(e){const r=this.data;this.rawData=JSON.parse(JSON.stringify(e)),this.data=Wr(e,this,this.materialsModel),this.emitter.emit("onPageChange",{value:this.data,preValue:r,node:this})}reloadPage(e){const r=this.data;e&&(this.rawData=JSON.parse(JSON.stringify(e)),this.data=Wr(e,this,this.materialsModel)),this.emitter.emit("onReloadPage",{value:this.data,preValue:r,node:this})}get value(){return this.data}getNode(e){if(!e)return;const r=this.data.componentsTree;return qr(r,e)}addNode(e,r,n="AFTER"){var o;if(n==="AFTER"||n==="BEFORE"){const a=r.parent;if(a===null&&r instanceof ce)return console.warn("Not found parent node"),!1;if(a instanceof ht)return console.warn("CProp can not add node"),!1;if(a instanceof Gt){const i=a.value.value,u=i.findIndex(c=>c===r)??-1;return u>=0?(n==="BEFORE"?i.splice(u,0,e):i.splice(u+1,0,e),e.parent=a,(o=a.parent)==null||o.updateValue(),!0):!1}if(a instanceof xe)return!1;const s=(a==null?void 0:a.value.children.findIndex(i=>i===r))??-1;return s>=0?(n==="BEFORE"?a==null||a.value.children.splice(s,0,e):a==null||a.value.children.splice(s+1,0,e),e.parent=a,a==null||a.updateValue(),!0):(console.warn("Not found target node"),!1)}if(n==="CHILD_START")return r.value.children.unshift(e),e.parent=r,r.updateValue(),!0;if(n==="CHILD_END")return r.value.children.push(e),e.parent=r,r.updateValue(),!0;if(V(n)){const a=n;if(a.type==="CHILD"){const s=a.pos,i=a.index||0;return s==="BEFORE"?r==null||r.value.children.splice(i,0,e):r==null||r.value.children.splice(i+1,0,e),e.parent=r,r.updateValue(),!0}else console.warn("Can not parse pos obj")}return!1}createNode(e){return delete e.id,new L(e,{parent:null,materials:this.materialsModel})}addNodeById(e,r,n="AFTER"){const o=this.getNode(r);return o?this.addNode(e,o,n):(console.warn(`Not find a node by ${r}, pls check it`),!1)}copyNode(e){const r=e.export("design");r.id=rt();const n=new L(r,{parent:e.parent,materials:this.materialsModel});return this.addNode(n,e,"AFTER"),n}copyNodeById(e){const r=this.getNode(e);return r&&r instanceof L?this.copyNode(r):!1}moveNode(e,r,n){this.deleteNode(e);let o=r;return["AFTER","BEFORE"].includes(n)&&(o=r.parent),e.parent=o,this.addNode(e,r,n)}moveNodeById(e,r,n){const o=this.getNode(e),a=this.getNode(r);return o&&a&&o instanceof L&&a instanceof L?this.moveNode(o,a,n):!1}deleteNode(e){var r;const n=e.parent;if(!n)throw new Error("parent node is null or undefined, pls check it");if(n instanceof Gt){const o=n.value.value,a=o.findIndex(i=>i===e),s=o[a];return o.splice(a,1),(r=n.parent)==null||r.updateValue(),s}if(n instanceof L||n instanceof ce){const o=n.value.children,a=o.findIndex(i=>i===e),s=o[a];return o.splice(a,1),n.updateValue(),s}}deleteNodeById(e){const r=this.getNode(e);if(r)return this.deleteNode(r)}export(e=Dr.SAVE){var r;const n=this.data.componentsTree.export(e),o=this.assetPackagesList,a=[],s=this.materialsModel.usedMaterials.map(u=>{const c=o.find(d=>{var l;return d.package===((l=u.value.npm)==null?void 0:l.package)});return c&&a.push(c),{componentName:u.componentName,...aa(u.value.npm||{})}}).filter(u=>u.componentName&&u.package&&u.version?!0:(console.warn(`${JSON.stringify(u,null,2)} not a valid material info`),!1));this.materialsModel.usedMaterials=[];let i={...this.data,componentsTree:zr(n),componentsMeta:s,thirdLibs:this.data.thirdLibs,assets:[],extra:this.data.extra};return(r=this.data.thirdLibs)==null||r.forEach(u=>{const c=o.find(d=>u.package===d.package);c&&a.push(c)}),i.assets=dg(a,u=>u.package),i=va(i,["id"]),JSON.parse(JSON.stringify(i))}getRootNode(){return this.data.componentsTree}}ut.ROOT_CONTAINER;const le="DYNAMIC",Ma=["$$context","$$nodeModel"],Kr="ON_DID_RENDER",Qr="ON_WILL_DESTROY",xa=[Kr,Qr],Yr=(t,e)=>{let r=t;return e&&(r={...t},r.__proto__=e||null),r},fe=(t,e={},...r)=>typeof t=="string"||typeof t=="number"?String(t):(Ma.forEach(o=>{o in e&&t.__CP_TYPE__!==le&&delete e[o]}),$.createElement(t,e,...r)),Ra=(t={},e)=>{const r=[],n=(o,a)=>{let s=a;Hr(a)&&(s=a.value),e(s)?r.push({keyPath:o,val:s}):nt(s)?s.forEach((i,u)=>{n([...o,String(u)],i)}):xt(s)&&Object.keys(s).forEach(i=>{n([...o,i],s[i])})};return n(["$root"],t),r},zt=(t,e)=>{const r=t.handler,{context:n,storeManager:o}=e;return e.actionVariableSpace||(e.actionVariableSpace={}),async function(...a){const s={},i=async d=>{const l=d;if(l.type==="RUN_CODE"){const f=Rt({funcName:"",funcBody:`function() {
|
|
58
61
|
${l.value}
|
|
59
|
-
}`,nodeContext:n,storeManager:o,$$response:e.$$response,actionVariableSpace:e.actionVariableSpace,nodeModel:e.nodeModel});let h;e.$$response!==void 0?h=f(e.$$response,...a):h=f(...a),h!=null&&h.then?s[l.id]=await h:s[l.id]=h}if(l.type==="JUMP_LINK"){const h=
|
|
62
|
+
}`,nodeContext:n,storeManager:o,$$response:e.$$response,actionVariableSpace:e.actionVariableSpace,nodeModel:e.nodeModel});let h;e.$$response!==void 0?h=f(e.$$response,...a):h=f(...a),h!=null&&h.then?s[l.id]=await h:s[l.id]=h}if(l.type==="JUMP_LINK"){const h=Gg(l,e)(...a);h!=null&&h.then?s[l.id]=await h:s[l.id]=h}if(l.type==="REQUEST_API"){const{run:f,afterFailedResponse:h,afterSuccessResponse:g}=Hg(l,e);try{const b=f(...a);b!=null&&b.then?s[l.id]=await b:s[l.id]=b,l.responseVarName&&(e.actionVariableSpace[l.responseVarName]=s[l.id]);const p=g(s[l.id],...a);return p!=null&&p.then?await p:p}catch(b){const p=await h(b);return p!=null&&p.then?await p:p}}if(l.type==="CALL_NODE_METHOD"){const h=zg(l,e)(...a);h!=null&&h.then?s[l.id]=await h:s[l.id]=h,l.returnVarName&&(e.actionVariableSpace[l.returnVarName]=s[l.id])}if(l.type==="ASSIGN_VALUE"){const f=qg(l,e);let h=[...a];e.$$response!==void 0&&(h=[e.$$response,h]);const g=f(...h);s[l.id]=await g}};let u=r[0];const c=new Set;for(;u;){if(c.has(u.id))return;await i(u),c.add(u.id),u=r.find(l=>(u==null?void 0:u.next)&&l.id===(u==null?void 0:u.next))}}};function Gg(t,e){return jt(t.link,e)}const jt=(t,e)=>function(...r){return Nt(t)?St(t.value,{...e.context,nodeContext:e.context,storeManager:e.storeManager,$$response:e.$$response,actionVariableSpace:e.actionVariableSpace,nodeModel:e.nodeModel}):Ta(t)?Rt({funcName:t.name||"",funcBody:t.value,nodeContext:e.context,storeManager:e.storeManager,$$response:e.$$response,actionVariableSpace:e.actionVariableSpace,nodeModel:e.nodeModel})(...r):t},Hg=(t,e)=>({run:function(...a){var f,h;let s="";t.apiPath&&(s=jt(t.apiPath,e)(...a));const i=t.body||{};Object.keys(i).forEach(g=>{i[g]=jt(i[g],e)(...a)});const u=t.query||{};Object.keys(u).forEach(g=>{u[g]=jt(u[g],e)(...a)});const c=t.header||{};Object.keys(c).forEach(g=>{c[g]=jt(c[g],e)(...a)});const d=t.method||"GET";return(h=(f=e.context).requestAPI)==null?void 0:h.call(f,{url:s,method:d,header:c,body:i,query:u})},afterSuccessResponse:async(a,...s)=>{if(!t.afterSuccessResponse)return a;const i=[...t.afterSuccessResponse||[],...t.afterFailedResponse||[]];return zt({handler:i},{...e,$$response:a})(...s)},afterFailedResponse:async(a,...s)=>{if(!t.afterFailedResponse)return a;const i=[...t.afterFailedResponse||[],...t.afterSuccessResponse||[]];return zt({handler:i},{...e,$$response:a})(...s)}}),zg=(t,e)=>(...r)=>{const n=Rt({funcName:"",funcBody:`
|
|
60
63
|
function () {
|
|
61
64
|
var args = arguments;
|
|
62
65
|
var nodeRef = $$context.nodeRefs.get(${JSON.stringify(t.nodeId)});
|
|
@@ -66,7 +69,7 @@ ${l.value}
|
|
|
66
69
|
func.apply(null, args);
|
|
67
70
|
}
|
|
68
71
|
}
|
|
69
|
-
}`,nodeContext:e.context,storeManager:e.storeManager,$$response:e.$$response,nodeModel:e.nodeModel});let o=r;return Array.isArray(t.args)&&(o=t.args.map(a=>{const s=[e.$$response,...r].filter(Boolean);return jt(a,e)(...s)})),n(...o)},Jg=(t,e)=>async(...r)=>{const o=jt(t.currentValue,e)(...r);let a;if(o!=null&&o.then?a=await o:a=o,t.valueType==="STATE"){const s=t.targetValueName,i=e.storeManager.getStore(s.nodeId);i&&i.setState({[s.keyPath]:a})}else t.valueType==="MEMORY"&&(e.actionVariableSpace[t.targetValueName]=a);return a},xe=(t={},e)=>{const{$$context:r,getComponent:n,storeManager:o}=e,a=t,s=u=>{if(Array.isArray(u))return u.map(c=>s(c));if(kr(u))return s(u.value);if(Fg(u)){const c=u.value,d=c.value;if(!d)return console.warn("slot value is null, this maybe cause some error, pls check it",t),()=>{};const l=f=>{const h=`${f.id}-${le}`,g=n(f),b=Yr(g,f,{...e}),p=c.params||[];return{component:(...y)=>{const _=Ye(y,p),O=Qr({params:_,nodeRefs:r.nodeRefs,getProps:function(){},callEventMethod:function(){}},r);return fe(b,{$$context:O,key:h})},key:h}};if(Array.isArray(d)){const f=d==null?void 0:d.map(h=>l(h));return(...h)=>f.map(g=>{if(eo(g.component)){const p=g.component;return N.createElement(p,{$$context:r,key:g.key})}else{const p=g.component;return p==null?void 0:p(...h)}})}else return l(d).component}else{if($t(u))return St(u.value,{nodeContext:r,storeManager:e.storeManager,nodeModel:e.nodeModel});if(Ta(u)){const c=u;return xt({funcBody:c.value,funcName:c.name||"",nodeContext:r,storeManager:o,nodeModel:e.nodeModel})}else{if(Dg(u))return Ht(u,{context:r,storeManager:o,actionVariableSpace:{},nodeModel:e.nodeModel});if(Pt(u)){let c=u;kr(u)&&(c=u.value);const d=c,l={};return Object.keys(c).forEach(f=>{l[f]=s(d[f])}),l}else return u}}},i={};return Object.keys(a).forEach(u=>{const c=a[u];i[u]=s(c)}),i},Wg=(t,e)=>{const{runtimeComponentCache:r,$$context:n={},getComponent:o,renderMode:a}=e,{$$context:s,idx:i,...u}=e;return typeof t=="string"?fe(t):Lg(t)?(({currentNode:d})=>{const l=d.value.id;let f=null;if(r.get(l)){const b=r.get(l);f=b==null?void 0:b.component}else{const b=o(d);f=Yr(b,d,{...u}),!r.get(l)&&a!=="design"&&r.set(l,{component:f})}const h=`${l}-${le}`;return fe(f,{$$context:n,$$nodeModel:t,key:h})})({currentNode:t}):void 0},Yr=(t,e,r)=>{const{storeManager:n,variableManager:o,onGetRef:a,onComponentMount:s,onComponentDestroy:i,refManager:u,processNodeConfigHook:c,requestAPI:d,doc:l}=r,{...f}=r;class h extends N.Component{constructor(p){super(p);w(this,"_CONDITION",!0);w(this,"_DESIGN_BOX",!1);w(this,"_NODE_MODEL",e);w(this,"_NODE_ID",e.id);w(this,"UNIQUE_ID",`${e.id}_${rt()}`);w(this,"targetComponentRef");w(this,"listenerHandler",[]);w(this,"storeState");w(this,"storeListenDisposeList",[]);w(this,"domHeader");w(this,"mediaStyleDomMap",{});w(this,"variableSpace");w(this,"nodeName");w(this,"updateState",p=>{e.value.componentName===ut.ROOT_CONTAINER?this.setState(p):this.storeState.setState(p)});w(this,"getStyleDomById",p=>{const m=this.mediaStyleDomMap;let v=m[p];return v||(v=l.createElement("style"),m[p]=v),v.id=p,v});w(this,"addMediaCSS",()=>{var v;let p=this.domHeader;if(p||(p=(v=l.getElementsByTagName("head"))==null?void 0:v[0],this.domHeader=p),!this.domHeader){console.warn("not found header dom");return}const m=this._NODE_MODEL.value.css;m&&m.value.forEach(y=>{var A;const _=`${this.UNIQUE_ID}_${y.state}`;let O=Xe(this._NODE_MODEL);if(y.state!=="normal"&&(O=`${O}:${y.state}`),y.text){const T=this.getStyleDomById(_);T.innerText=`.${O} { ${y.text} }`,p==null||p.appendChild(T)}(A=y.media)!=null&&A.length&&y.media.forEach(T=>{const $=`${_}_${T.type}_${T.value}`,B=this.getStyleDomById($);B.media=`screen and (${T.type}:${T.value}px)`,B.innerHTML=`.${O} { ${T.text} }`,p==null||p.appendChild(B)})})});w(this,"removeMediaCSS",()=>{const p=this.mediaStyleDomMap;Object.keys(p).forEach(m=>{var v;(v=this.domHeader)==null||v.removeChild(p[m])}),this.mediaStyleDomMap={}});w(this,"rebuildNode",()=>{this.storeListenDisposeList.forEach(p=>p()),this.removeMediaCSS(),this.connectStore(),this.addMediaCSS(),this.forceUpdate()});this.targetComponentRef=N.createRef(),this.listenerHandler=[],this.state=e.value.state||{};let m=e.value.nodeName||e.id;e.value.componentName===ut.ROOT_CONTAINER&&(m="globalState"),this.nodeName=m;const v=n.getStore(m);v?(this.storeState=v,v.setState({...e.value.state||{}})):this.storeState=n.addStore(m,()=>({...e.value.state||{}}));const y=this.storeState.subscribe(O=>{this.setStateIfChanged(O)});this.storeListenDisposeList.push(y),this.connectStore();const _=o.get(m);_?this.variableSpace=_:(this.variableSpace={staticVar:{},methods:{}},o.add(m,this.variableSpace))}setStateIfChanged(p){e.value.componentName!==ut.ROOT_CONTAINER&&this.setState(m=>{const v=typeof p=="function"?p(m):p;return kc(m,{...m,...v})?null:v})}connectStore(){const p=Ra(e.props,O=>!!$t(O)),m=Ra({css:e.value.css,class:e.value.classNames},O=>!!$t(O));let v=[];[...p,...m].map(O=>{const A=O.val,T=[new RegExp(`(?<=context\\.stateManager(?:\\.|\\[["'])?)\\w+(?=(?:["']?\\])?(?:\\.|\\[)?["']?state)`,"gim"),/\$ALL_STATE(?:\.|(?:\[\s*["']))(\w+)(?=(?:["']\s*\])?)/gim,/getStateObj\(["']([^"']+)["']\)/gim],$=ao(A.value,T);v=[...v,...$],/\$CTX\.globalState|\$G_STATE/.test(A.value)&&v.push("globalState")}).filter(Boolean);const y=Array.from(new Set(v)),_=[];y.length&&y.forEach(O=>{n.getStore(O)||(n.addStore(O,()=>({})),console.warn(n,O,"not exits, auto create"));const T=n.connect(O,$=>{this.setStateIfChanged($)});_.push(T)}),this.storeListenDisposeList=_}componentDidMount(){var v;this.addMediaCSS(),a==null||a(this.targetComponentRef,e,this),s==null||s(this,e);const p=(v=e.value.eventListener)==null?void 0:v.find(y=>y.name===Wr);p&&Ht(p.func,{context:this.createCurrentNodeCtx(),storeManager:n,actionVariableSpace:{},nodeModel:e})();const m=()=>{n.setStore(e.value.nodeName||e.id,this.storeState),this.storeState.setState({...this.state,...e.value.state||{}}),this.rebuildNode()};e.onChange(m)}componentWillUnmount(){var v;this.storeListenDisposeList.forEach(y=>y()),this.removeMediaCSS(),i==null||i(this,e);const p=Kr,m=(v=e.value.eventListener)==null?void 0:v.find(y=>y.name===p);m&&Ht(m.func,{context:this.createCurrentNodeCtx(),storeManager:n,actionVariableSpace:{},nodeModel:e})()}transformMethods(p){const{context:m}=p,v=xe({methods:e.value.methods},{$$context:m,...f,nodeModel:e}),y=e.value.methods||[],_=v.methods,O=y.reduce((A,T,$)=>(A[T.name]=_[$],A),{});m.methods=O,this.variableSpace.methods=Object.assign(this.variableSpace.methods,O)}processRootContext(p){e.value.componentName===ut.ROOT_CONTAINER&&(p.globalState=this.state,p.updateGlobalState=this.updateState,p.requestAPI=d,p.getGlobalState=()=>this.state)}processNodeClassName(p,m){var _;const v=((_=e.value.classNames)==null?void 0:_.map(O=>{var $;const A=O.name;return($t(O.status)?St((($=O.status)==null?void 0:$.value)||"",{nodeContext:m,nodeModel:e,storeManager:n}):!1)?A:""}))||[];let y=`${p??""} ${v.join(" ")}`.trim();return e.value.css&&(y=`${Xe(e)} ${y}`.trim()),y}processNodeStyle(p){if(!e.value.style)return{};const m=xe({style:e.value.style},{$$context:p,...f,nodeModel:e});return oo(m.style||[])}processNodeChild(p,m){let v=[];if(p!==void 0)v=Array.isArray(p)?p:[p];else{const y=[];e.value.children.forEach((O,A)=>{const T=Wg(O,{$$context:m,idx:A,...f});y.push(T)}),v=y}return v}processNodeConditionAndConfigHook(p,m,v){let y=e.value.condition??!0;typeof y!="boolean"&&(y=St(y.value,{nodeContext:v||{},nodeModel:e,storeManager:n}));let _={condition:y,props:p};c&&(_=c(_,e));const O=fe(t,_.props,...m);return this._CONDITION=_.condition,_.condition?O:N.createElement("div",{style:{display:"none"}},O)}processNodeEventListener(p){const m=e.value.eventListener,v={};return m==null||m.forEach(y=>{if(xa.includes(y.name))return;const _=Ht(y.func,{context:p,storeManager:n,actionVariableSpace:{},nodeModel:e});v[y.name]=_}),v}createCurrentNodeCtx(){const{$$context:p}=this.props,m=e.value.nodeName||e.id,v=e.id,y={state:this.state||{},staticVar:this.variableSpace.staticVar,updateState:this.updateState,storeManager:n,getState:()=>n.getStateObj(m),getStateObj:()=>n.getStateObj(m),getStateObjById:O=>n.getStateObj(O),stateManager:n.getStateSnapshot(),getMethods:()=>{const O=o.get(v).methods,A=u.get(v).current;return Ze(O,A)},getMethodsById:O=>{const A=o.get(O).methods,T=u.get(O).current;return Ze(A,T)},getStaticVar:()=>o.get(m).staticVar,getStaticVarById:O=>o.get(O).staticVar,callEventMethod:(O,A)=>{var $,B;const T=u.get(v).current;(B=T==null?void 0:($=T.props)[O])==null||B.call($,A)},getProps:()=>{const O=u.get(v).current;return O==null?void 0:O.props},nodeRefs:p.nodeRefs};return this.processRootContext(y),Qr(y,p)}injectEngEnv(){const p={},m=e.value.injectEnvList||[];if(Array.isArray(e.value.injectEnvList)){const v={[wa.COMPONENTS]:r.components};m.reduce((y,_)=>(y[_]=v[_],y),p)}return p}renderCore(){const{$$context:p,...m}=this.props,v={key:e.id,...e.props,...m},y=this.createCurrentNodeCtx();this.transformMethods({context:y});let _=xe(v,{$$context:y,...f,nodeModel:e});const O=this.injectEngEnv();Object.assign(_,O);const A=this.processNodeClassName(_.className,y);_.className=A;const T=this.processNodeStyle(y);_.style=T;const{children:$}=_;delete _.children;const B=this.processNodeChild($,y);if(_.ref=this.targetComponentRef,e.value.eventListener){const Tt=this.processNodeEventListener(y);_={..._,...Tt}}return this.processNodeConditionAndConfigHook(_,B,y)}renderLoop(){const{$$context:p,...m}=this.props,v={key:e.id,...e.props,...m},y=this.createCurrentNodeCtx();this.transformMethods({context:y});const _=e.value.loop;let O=[];if(_&&_.open){this.targetComponentRef.current=[];let A=_.data||[];if($t(_.data)){const T=_.data;A=St(T.value,{nodeContext:y||{},storeManager:n,nodeModel:e})||[]}return O=A.map((...T)=>{const $=T[1],B=[_.forName||"item",_.forIndex||"index"],At=Ye(T,B);let Tt="loopData";_.name&&(Tt=`${Tt}${_.name}`);const zt=Qr({[Tt]:At,nodeRefs:y.nodeRefs,getProps:function(){},callEventMethod:function(){}},y),Y=xe(v,{$$context:zt,...f,nodeModel:e}),vm=this.injectEngEnv();Object.assign(Y,vm);const ym=this.processNodeClassName(Y.className,zt);Y.className=ym;const bm=this.processNodeStyle(zt);Y.style=bm;const{children:_m}=Y;delete Y.children;const Sm=this.processNodeChild(_m,zt);if(Y.key=`${Y.key}-${$}`,$t(_.key)){const tn=_.key,Om=St(tn.value,{nodeContext:zt||{},storeManager:n,nodeModel:e});Y.key+=`-${Om}`}return Y.ref=tn=>{this.targetComponentRef.current=this.targetComponentRef.current||[],this.targetComponentRef.current[$]=tn},this.processNodeConditionAndConfigHook(Y,Sm,zt)}),O}}render(){const p=e.value.loop;return p&&p.open?this.renderLoop():this.renderCore()}}return w(h,"__CP_TYPE__",le),h.displayName=`${e.value.componentName}Dynamic`,h};class Ia{constructor(){w(this,"renderMode","normal");w(this,"components",{});w(this,"storeManager",new Zc);w(this,"variableManager",new tl);w(this,"runtimeComponentCache",new Map);w(this,"onGetRef");w(this,"onGetComponent");w(this,"onComponentMount");w(this,"refManager",new tr);w(this,"onComponentDestroy");w(this,"processNodeConfigHook");w(this,"requestAPI",async e=>{throw console.log(e),new Error("Need to implement requestAPI for Render")})}getComponent(e){var o;const r=e.value.componentName;let n=io(r,this.components);return ro(n)||(n=no(n),this.components[r]=n),this.onGetComponent&&(n=(o=this.onGetComponent)==null?void 0:o.call(this,n,e)),n}pageRender(e,{components:r,onGetRef:n,refManager:o,$$context:a={nodeRefs:o,getProps:function(){},callEventMethod:function(){}},onGetComponent:s,onComponentMount:i,onComponentDestroy:u,renderMode:c,processNodeConfigHook:d,requestAPI:l,doc:f}){this.renderMode=c,this.components=r,this.onGetRef=n,this.onGetComponent=s,this.onComponentMount=i,this.onComponentDestroy=u,this.processNodeConfigHook=d,this.refManager=o,this.requestAPI=l;const h=e.value.componentsTree,g=this.getComponent(h),b=Yr(g,e.value.componentsTree,{storeManager:this.storeManager,variableManager:this.variableManager,runtimeComponentCache:this.runtimeComponentCache,getComponent:this.getComponent.bind(this),refManager:this.refManager,onGetRef:this.onGetRef,processNodeConfigHook:d,onComponentMount:i,onComponentDestroy:u,renderMode:c,requestAPI:l,components:this.components,doc:f}),p={},m=h.props;return Object.keys(m).forEach(v=>{p[v]=m[v].value}),p.$$context=a,fe(b,p)}clear(){this.runtimeComponentCache.clear(),this.storeManager.destroy()}}const Kg=rn(new Ia);function Qg(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Xr={exports:{}},de={};/**
|
|
72
|
+
}`,nodeContext:e.context,storeManager:e.storeManager,$$response:e.$$response,nodeModel:e.nodeModel});let o=r;return Array.isArray(t.args)&&(o=t.args.map(a=>{const s=[e.$$response,...r].filter(Boolean);return jt(a,e)(...s)})),n(...o)},qg=(t,e)=>async(...r)=>{const o=jt(t.currentValue,e)(...r);let a;if(o!=null&&o.then?a=await o:a=o,t.valueType==="STATE"){const s=t.targetValueName,i=e.storeManager.getStore(s.nodeId);i&&i.setState({[s.keyPath]:a})}else t.valueType==="MEMORY"&&(e.actionVariableSpace[t.targetValueName]=a);return a},Re=(t={},e)=>{const{$$context:r,getComponent:n,storeManager:o}=e,a=t,s=u=>{if(Array.isArray(u))return u.map(c=>s(c));if(Hr(u))return s(u.value);if(Lg(u)){const c=u.value,d=c.value;if(!d)return console.warn("slot value is null, this maybe cause some error, pls check it",t),()=>{};const l=f=>{const h=`${f.id}-${le}`,g=n(f),b=Xr(g,f,{...e}),p=c.params||[];return{component:(...y)=>{const _=Xe(y,p),O=Yr({params:_,nodeRefs:r.nodeRefs,getProps:function(){},callEventMethod:function(){}},r);return fe(b,{$$context:O,key:h})},key:h}};if(Array.isArray(d)){const f=d==null?void 0:d.map(h=>l(h));return(...h)=>f.map(g=>{if(eo(g.component)){const p=g.component;return $.createElement(p,{$$context:r,key:g.key})}else{const p=g.component;return p==null?void 0:p(...h)}})}else return l(d).component}else{if(Nt(u))return St(u.value,{nodeContext:r,storeManager:e.storeManager,nodeModel:e.nodeModel});if(Ta(u)){const c=u;return Rt({funcBody:c.value,funcName:c.name||"",nodeContext:r,storeManager:o,nodeModel:e.nodeModel})}else{if(Ig(u))return zt(u,{context:r,storeManager:o,actionVariableSpace:{},nodeModel:e.nodeModel});if(xt(u)){let c=u;Hr(u)&&(c=u.value);const d=c,l={};return Object.keys(c).forEach(f=>{l[f]=s(d[f])}),l}else return u}}},i={};return Object.keys(a).forEach(u=>{const c=a[u];i[u]=s(c)}),i},Jg=(t,e)=>{const{runtimeComponentCache:r,$$context:n={},getComponent:o,renderMode:a}=e,{$$context:s,idx:i,...u}=e;return typeof t=="string"?fe(t):Dg(t)?(({currentNode:d})=>{const l=d.value.id;let f=null;if(r.get(l)){const b=r.get(l);f=b==null?void 0:b.component}else{const b=o(d);f=Xr(b,d,{...u}),!r.get(l)&&a!=="design"&&r.set(l,{component:f})}const h=`${l}-${le}`;return fe(f,{$$context:n,$$nodeModel:t,key:h})})({currentNode:t}):void 0},Xr=(t,e,r)=>{const{storeManager:n,variableManager:o,onGetRef:a,onComponentMount:s,onComponentDestroy:i,refManager:u,processNodeConfigHook:c,requestAPI:d,doc:l}=r,{...f}=r;class h extends $.Component{constructor(p){super(p);w(this,"_CONDITION",!0);w(this,"_DESIGN_BOX",!1);w(this,"_NODE_MODEL",e);w(this,"_NODE_ID",e.id);w(this,"UNIQUE_ID",`${e.id}_${rt()}`);w(this,"targetComponentRef");w(this,"listenerHandler",[]);w(this,"storeState");w(this,"storeListenDisposeList",[]);w(this,"domHeader");w(this,"mediaStyleDomMap",{});w(this,"variableSpace");w(this,"nodeName");w(this,"updateState",p=>{e.value.componentName===ut.ROOT_CONTAINER?this.setState(p):this.storeState.setState(p)});w(this,"getStyleDomById",p=>{const m=this.mediaStyleDomMap;let v=m[p];return v||(v=l.createElement("style"),m[p]=v),v.id=p,v});w(this,"addMediaCSS",()=>{var v;let p=this.domHeader;if(p||(p=(v=l.getElementsByTagName("head"))==null?void 0:v[0],this.domHeader=p),!this.domHeader){console.warn("not found header dom");return}const m=this._NODE_MODEL.value.css;m&&m.value.forEach(y=>{var A;const _=`${this.UNIQUE_ID}_${y.state}`;let O=Ze(this._NODE_MODEL);if(y.state!=="normal"&&(O=`${O}:${y.state}`),y.text){const T=this.getStyleDomById(_);T.innerText=`.${O} { ${y.text} }`,p==null||p.appendChild(T)}(A=y.media)!=null&&A.length&&y.media.forEach(T=>{const N=`${_}_${T.type}_${T.value}`,B=this.getStyleDomById(N);B.media=`screen and (${T.type}:${T.value}px)`,B.innerHTML=`.${O} { ${T.text} }`,p==null||p.appendChild(B)})})});w(this,"removeMediaCSS",()=>{const p=this.mediaStyleDomMap;Object.keys(p).forEach(m=>{var v;(v=this.domHeader)==null||v.removeChild(p[m])}),this.mediaStyleDomMap={}});w(this,"rebuildNode",()=>{this.storeListenDisposeList.forEach(p=>p()),this.removeMediaCSS(),this.connectStore(),this.addMediaCSS(),this.forceUpdate()});this.targetComponentRef=$.createRef(),this.listenerHandler=[],this.state=e.value.state||{};let m=e.value.nodeName||e.id;e.value.componentName===ut.ROOT_CONTAINER&&(m="globalState"),this.nodeName=m;const v=n.getStore(m);v?(this.storeState=v,v.setState({...e.value.state||{}})):this.storeState=n.addStore(m,()=>({...e.value.state||{}}));const y=this.storeState.subscribe(O=>{this.setStateIfChanged(O)});this.storeListenDisposeList.push(y),this.connectStore();const _=o.get(m);_?this.variableSpace=_:(this.variableSpace={staticVar:{},methods:{}},o.add(m,this.variableSpace))}setStateIfChanged(p){e.value.componentName!==ut.ROOT_CONTAINER&&this.setState(m=>{const v=typeof p=="function"?p(m):p;return Gc(m,{...m,...v})?null:v})}connectStore(){const p=Ra(e.props,O=>!!Nt(O)),m=Ra({css:e.value.css,class:e.value.classNames},O=>!!Nt(O));let v=[];[...p,...m].map(O=>{const A=O.val,T=[new RegExp(`(?<=context\\.stateManager(?:\\.|\\[["'])?)\\w+(?=(?:["']?\\])?(?:\\.|\\[)?["']?state)`,"gim"),/\$ALL_STATE(?:\.|(?:\[\s*["']))(\w+)(?=(?:["']\s*\])?)/gim,/getStateObj\(["']([^"']+)["']\)/gim],N=ao(A.value,T);v=[...v,...N],/\$CTX\.globalState|\$G_STATE/.test(A.value)&&v.push("globalState")}).filter(Boolean);const y=Array.from(new Set(v)),_=[];y.length&&y.forEach(O=>{n.getStore(O)||(n.addStore(O,()=>({})),console.warn(n,O,"not exits, auto create"));const T=n.connect(O,N=>{this.setStateIfChanged(N)});_.push(T)}),this.storeListenDisposeList=_}componentDidMount(){var v;this.addMediaCSS(),a==null||a(this.targetComponentRef,e,this),s==null||s(this,e);const p=(v=e.value.eventListener)==null?void 0:v.find(y=>y.name===Kr);p&&zt(p.func,{context:this.createCurrentNodeCtx(),storeManager:n,actionVariableSpace:{},nodeModel:e})();const m=()=>{n.setStore(e.value.nodeName||e.id,this.storeState),this.storeState.setState({...this.state,...e.value.state||{}}),this.rebuildNode()};e.onChange(m)}componentWillUnmount(){var v;this.storeListenDisposeList.forEach(y=>y()),this.removeMediaCSS(),i==null||i(this,e);const p=Qr,m=(v=e.value.eventListener)==null?void 0:v.find(y=>y.name===p);m&&zt(m.func,{context:this.createCurrentNodeCtx(),storeManager:n,actionVariableSpace:{},nodeModel:e})()}transformMethods(p){const{context:m}=p,v=Re({methods:e.value.methods},{$$context:m,...f,nodeModel:e}),y=e.value.methods||[],_=v.methods,O=y.reduce((A,T,N)=>(A[T.name]=_[N],A),{});m.methods=O,this.variableSpace.methods=Object.assign(this.variableSpace.methods,O)}processRootContext(p){e.value.componentName===ut.ROOT_CONTAINER&&(p.globalState=this.state,p.updateGlobalState=this.updateState,p.requestAPI=d,p.getGlobalState=()=>this.state)}processNodeClassName(p,m){var _;const v=((_=e.value.classNames)==null?void 0:_.map(O=>{var N;const A=O.name;return(Nt(O.status)?St(((N=O.status)==null?void 0:N.value)||"",{nodeContext:m,nodeModel:e,storeManager:n}):!1)?A:""}))||[];let y=`${p??""} ${v.join(" ")}`.trim();return e.value.css&&(y=`${Ze(e)} ${y}`.trim()),y}processNodeStyle(p){if(!e.value.style)return{};const m=Re({style:e.value.style},{$$context:p,...f,nodeModel:e});return oo(m.style||[])}processNodeChild(p,m){let v=[];if(p!==void 0)v=Array.isArray(p)?p:[p];else{const y=[];e.value.children.forEach((O,A)=>{const T=Jg(O,{$$context:m,idx:A,...f});y.push(T)}),v=y}return v}processNodeConditionAndConfigHook(p,m,v){let y=e.value.condition??!0;typeof y!="boolean"&&(y=St(y.value,{nodeContext:v||{},nodeModel:e,storeManager:n}));let _={condition:y,props:p};c&&(_=c(_,e));const O=fe(t,_.props,...m);return this._CONDITION=_.condition,_.condition?O:$.createElement("div",{key:p.key,style:{display:"none"}},O)}processNodeEventListener(p){const m=e.value.eventListener,v={};return m==null||m.forEach(y=>{if(xa.includes(y.name))return;const _=zt(y.func,{context:p,storeManager:n,actionVariableSpace:{},nodeModel:e});v[y.name]=_}),v}createCurrentNodeCtx(){const{$$context:p}=this.props,m=e.value.nodeName||e.id,v=e.id,y={state:this.state||{},staticVar:this.variableSpace.staticVar,updateState:this.updateState,storeManager:n,getState:()=>n.getStateObj(m),getStateObj:()=>n.getStateObj(m),getStateObjById:O=>n.getStateObj(O),stateManager:n.getStateSnapshot(),getMethods:()=>{const O=o.get(v).methods,A=u.get(v).current;return tr(O,A)},getMethodsById:O=>{const A=o.get(O).methods,T=u.get(O).current;return tr(A,T)},getStaticVar:()=>o.get(m).staticVar,getStaticVarById:O=>o.get(O).staticVar,callEventMethod:(O,A)=>{var N,B;const T=u.get(v).current;(B=T==null?void 0:(N=T.props)[O])==null||B.call(N,A)},getProps:()=>{const O=u.get(v).current;return O==null?void 0:O.props},nodeRefs:p.nodeRefs};return this.processRootContext(y),Yr(y,p)}injectEngEnv(){const p={},m=e.value.injectEnvList||[];if(Array.isArray(e.value.injectEnvList)){const v={[wa.COMPONENTS]:r.components};m.reduce((y,_)=>(y[_]=v[_],y),p)}return p}renderCore(){const{$$context:p,...m}=this.props,v={key:e.id,...e.props,...m},y=this.createCurrentNodeCtx();this.transformMethods({context:y});let _=Re(v,{$$context:y,...f,nodeModel:e});const O=this.injectEngEnv();Object.assign(_,O);const A=this.processNodeClassName(_.className,y);_.className=A;const T=this.processNodeStyle(y);_.style=T;const{children:N}=_;delete _.children;const B=this.processNodeChild(N,y);if(_.ref=this.targetComponentRef,e.value.eventListener){const Tt=this.processNodeEventListener(y);_={..._,...Tt}}return this.processNodeConditionAndConfigHook(_,B,y)}renderLoop(){const{$$context:p,...m}=this.props,v={key:e.id,...e.props,...m},y=this.createCurrentNodeCtx();this.transformMethods({context:y});const _=e.value.loop;let O=[];if(_&&_.open){this.targetComponentRef.current=[];let A=_.data||[];if(Nt(_.data)){const T=_.data;A=St(T.value,{nodeContext:y||{},storeManager:n,nodeModel:e})||[]}return O=A.map((...T)=>{const N=T[1],B=[_.forName||"item",_.forIndex||"index"],At=Xe(T,B);let Tt="loopData";_.name&&(Tt=`${Tt}${_.name}`);const Pt=Yr({[Tt]:At,nodeRefs:y.nodeRefs,getProps:function(){},callEventMethod:function(){}},y);let z=Re(v,{$$context:Pt,...f,nodeModel:e});const mm=this.injectEngEnv();Object.assign(z,mm);const vm=this.processNodeClassName(z.className,Pt);z.className=vm;const ym=this.processNodeStyle(Pt);z.style=ym;const{children:bm}=z;delete z.children;const _m=this.processNodeChild(bm,Pt);if(z.key=`${z.key}-${N}`,Nt(_.key)){const pe=_.key,Sm=St(pe.value,{nodeContext:Pt||{},storeManager:n,nodeModel:e});z.key+=`-${Sm}`}if(z.ref=pe=>{this.targetComponentRef.current=this.targetComponentRef.current||[],this.targetComponentRef.current[N]=pe},e.value.eventListener){const pe=this.processNodeEventListener(Pt);z={...z,...pe}}return this.processNodeConditionAndConfigHook(z,_m,Pt)}),O}}render(){const p=e.value.loop;return p&&p.open?this.renderLoop():this.renderCore()}}return w(h,"__CP_TYPE__",le),h.displayName=`${e.value.componentName}Dynamic`,h};class Ia{constructor(){w(this,"renderMode","normal");w(this,"components",{});w(this,"storeManager",new Zc);w(this,"variableManager",new tl);w(this,"runtimeComponentCache",new Map);w(this,"onGetRef");w(this,"onGetComponent");w(this,"onComponentMount");w(this,"refManager",new er);w(this,"onComponentDestroy");w(this,"processNodeConfigHook");w(this,"requestAPI",async e=>{throw console.log(e),new Error("Need to implement requestAPI for Render")})}getComponent(e){var o;const r=e.value.componentName;let n=io(r,this.components);return ro(n)||(n=no(n),this.components[r]=n),this.onGetComponent&&(n=(o=this.onGetComponent)==null?void 0:o.call(this,n,e)),n}pageRender(e,{components:r,onGetRef:n,refManager:o,$$context:a={nodeRefs:o,getProps:function(){},callEventMethod:function(){}},onGetComponent:s,onComponentMount:i,onComponentDestroy:u,renderMode:c,processNodeConfigHook:d,requestAPI:l,doc:f}){this.renderMode=c,this.components=r,this.onGetRef=n,this.onGetComponent=s,this.onComponentMount=i,this.onComponentDestroy=u,this.processNodeConfigHook=d,this.refManager=o,this.requestAPI=l;const h=e.value.componentsTree,g=this.getComponent(h),b=Xr(g,e.value.componentsTree,{storeManager:this.storeManager,variableManager:this.variableManager,runtimeComponentCache:this.runtimeComponentCache,getComponent:this.getComponent.bind(this),refManager:this.refManager,onGetRef:this.onGetRef,processNodeConfigHook:d,onComponentMount:i,onComponentDestroy:u,renderMode:c,requestAPI:l,components:this.components,doc:f}),p={},m=h.props;return Object.keys(m).forEach(v=>{p[v]=m[v].value}),p.$$context=a,fe(b,p)}clear(){this.runtimeComponentCache.clear(),this.storeManager.destroy()}}const Wg=rn(new Ia);function Kg(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Zr={exports:{}},de={};/**
|
|
70
73
|
* @license React
|
|
71
74
|
* react-jsx-runtime.production.min.js
|
|
72
75
|
*
|
|
@@ -74,7 +77,7 @@ ${l.value}
|
|
|
74
77
|
*
|
|
75
78
|
* This source code is licensed under the MIT license found in the
|
|
76
79
|
* LICENSE file in the root directory of this source tree.
|
|
77
|
-
*/var Da;function
|
|
80
|
+
*/var Da;function Qg(){if(Da)return de;Da=1;var t=$,e=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function s(i,u,c){var d,l={},f=null,h=null;c!==void 0&&(f=""+c),u.key!==void 0&&(f=""+u.key),u.ref!==void 0&&(h=u.ref);for(d in u)n.call(u,d)&&!a.hasOwnProperty(d)&&(l[d]=u[d]);if(i&&i.defaultProps)for(d in u=i.defaultProps,u)l[d]===void 0&&(l[d]=u[d]);return{$$typeof:e,type:i,key:f,ref:h,props:l,_owner:o.current}}return de.Fragment=r,de.jsx=s,de.jsxs=s,de}var La;function Yg(){return La||(La=1,Zr.exports=Qg()),Zr.exports}var Xg=Yg();const Zg=["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","bgsound","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","command","content","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","dt","element","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","image","img","input","ins","isindex","kbd","keygen","label","legend","li","link","listing","main","map","mark","marquee","math","menu","menuitem","meta","meter","multicol","nav","nextid","nobr","noembed","noframes","noscript","object","ol","optgroup","option","output","p","param","picture","plaintext","pre","progress","q","rb","rbc","rp","rt","rtc","ruby","s","samp","script","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr","xmp"],ct=t=>{const e={};return t.forEach(r=>{e[r.key]=r.value}),e},tm=Zg.reduce((t,e)=>(t[e]=({children:r,$$attributes:n=[],...o})=>{let a=r;return Array.isArray(r)||(a=[r]),$.createElement(e,{...o,...ct(n)},...a)},t),{}),em={RootContainer:({children:t})=>t,...tm,CContainer:({children:t,$$attributes:e=[],afterMount:r,beforeDestroy:n,...o})=>{let a=t;return Array.isArray(t)||(a=[t]),$.useEffect(()=>(r==null||r(o),()=>{n==null||n(o)}),[]),Xg.jsx("div",{...o,...ct(e),children:a})},CVideo:({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),$.createElement("video",{...r,...ct(e)},...n)},CAudio:({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),$.createElement("audio",{...r,...ct(e)},...n)},CBlock:({children:t,width:e,height:r,$$attributes:n=[],...o})=>{let a=t;Array.isArray(t)||(a=[t]),a=a.filter(c=>c!==void 0);const{style:s={},...i}=ct(n),u={height:r,width:e,...s,...o.style||{}};return $.createElement("div",{...o,...i,style:u},...a)},CImage:({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),$.createElement("img",{...r,...ct(e)},...n)},CText:({$$attributes:t=[],content:e,...r})=>$.createElement("span",{...r,...ct(t)},e),CCanvas:({afterMount:t,beforeDestroy:e,$$attributes:r=[],...n})=>($.useEffect(()=>(t==null||t(n),()=>{e==null||e(n)}),[]),$.createElement("canvas",{...n,...ct(r)})),CNativeTag:({children:t,$$attributes:e=[],htmlTag:r="div",...n})=>{let o=t;Array.isArray(t)||(o=[t]);const{style:a={},...s}=ct(e),i={...a,...n.style||{}};return $.createElement(r,{...n,...s,style:i},...o)}};class Fa extends $.Component{constructor(r){super(r);w(this,"refManager");w(this,"dynamicComponentInstanceMap",new Map);w(this,"onGetRef",(r,n,o)=>{var a,s;(s=(a=this.props).onGetRef)==null||s.call(a,r,n,o),this.dynamicComponentInstanceMap.set(n.id,o),this.refManager.add(n.value.refId||n.id,r)});w(this,"rerender",r=>{if(this.props.adapter.clear(),(r==null?void 0:r.nodeType)==="PAGE"&&r)this.setState({pageModel:r});else if(xt(r)&&Pa(r)){const n=r;this.setState({pageModel:new xe(n,{materials:this.state.pageModel.materialsModel.rawValue})})}});this.state={pageModel:r.pageModel||new xe(r.page)},this.refManager=new er}getPageModel(){return this.state.pageModel}componentDidMount(){const{render:r}=this.props;r&&(r.ref.current=this),window.parent&&(window.parent.__CB_RENDER_WIN__=window)}componentWillUnmount(){this.refManager.destroy()}render(){const{props:r}=this,{adapter:n,onGetComponent:o,onComponentDestroy:a,onComponentMount:s,doc:i}=r,{pageModel:u}=this.state;if(!u)return console.warn("pageModel is null"),null;const c={...em,...r.components},d=this.props.$$context||{};return n.pageRender(u,{libs:{},components:c,refManager:this.refManager,onGetRef:this.onGetRef,onGetComponent:o,onComponentMount:s,onComponentDestroy:a,$$context:{...d,nodeRefs:this.refManager},renderMode:r.renderMode||"normal",requestAPI:r.requestAPI??n.requestAPI,processNodeConfigHook:r.processNodeConfigHook,doc:i||document})}}const rm=()=>{const t=$.useRef(null);return $.useMemo(()=>({ref:t,rerender:function(...r){t.current&&t.current.rerender(...r)}}),[])};class nm extends $.Component{constructor(r){super(r);w(this,"onDoubleClick",()=>{this.setState({hasError:!1,error:null})});this.state={hasError:!1,error:""}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,n){var o,a;(a=(o=this.props).onError)==null||a.call(o,n)}render(){if(this.state.hasError){const{onDoubleClick:r}=this,n=this.props.node.value;console.error(this.props.node,this.props.children);const o=$.createElement("div",{style:{backgroundColor:"rgb(255 206 215 / 13%)",padding:"5px",color:"#ff0000b0",textAlign:"center",fontSize:"12px"}},"Render error, node id: ",n.id,", node name:",n.title," component name:",n.title||n.componentName,$.createElement("p",null,"msg: ",String(this.state.error)),$.createElement("button",{onDoubleClick:r,style:{border:"1px solid rgba(100,100,100,0.1)",backgroundColor:"#fff",padding:"5px 10px",borderRadius:"2px",color:"gray",cursor:"pointer",marginTop:"5px"}},"double click to refresh"),$.createElement("div",{style:{display:"none"}}));return $.createElement(this.props.targetComponent,{onlyRenderChild:!0},o)}return this.props.children}}var tn={exports:{}},J={};/**
|
|
78
81
|
* @license React
|
|
79
82
|
* react-reconciler-reflection.production.js
|
|
80
83
|
*
|
|
@@ -82,5 +85,5 @@ ${l.value}
|
|
|
82
85
|
*
|
|
83
86
|
* This source code is licensed under the MIT license found in the
|
|
84
87
|
* LICENSE file in the root directory of this source tree.
|
|
85
|
-
*/var Va;function am(){if(Va)return q;Va=1;function t(s){var i="https://react.dev/errors/"+s;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)i+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+s+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function e(s){var i=s,u=s;if(s.alternate)for(;i.return;)i=i.return;else{s=i;do i=s,(i.flags&4098)!==0&&(u=i.return),s=i.return;while(s)}return i.tag===3?u:null}function r(s){if(e(s)!==s)throw Error(t(188))}function n(s){var i=s.alternate;if(!i){if(i=e(s),i===null)throw Error(t(188));return i!==s?null:s}for(var u=s,c=i;;){var d=u.return;if(d===null)break;var l=d.alternate;if(l===null){if(c=d.return,c!==null){u=c;continue}break}if(d.child===l.child){for(l=d.child;l;){if(l===u)return r(d),s;if(l===c)return r(d),i;l=l.sibling}throw Error(t(188))}if(u.return!==c.return)u=d,c=l;else{for(var f=!1,h=d.child;h;){if(h===u){f=!0,u=d,c=l;break}if(h===c){f=!0,c=d,u=l;break}h=h.sibling}if(!f){for(h=l.child;h;){if(h===u){f=!0,u=l,c=d;break}if(h===c){f=!0,c=l,u=d;break}h=h.sibling}if(!f)throw Error(t(189))}}if(u.alternate!==c)throw Error(t(190))}if(u.tag!==3)throw Error(t(188));return u.stateNode.current===u?s:i}function o(s){var i=s.tag;if(i===5||i===26||i===27||i===6)return s;for(s=s.child;s!==null;){if(i=o(s),i!==null)return i;s=s.sibling}return null}function a(s){var i=s.tag;if(i===5||i===26||i===27||i===6)return s;for(s=s.child;s!==null;){if(s.tag!==4&&(i=a(s),i!==null))return i;s=s.sibling}return null}return q.doesFiberContain=function(s,i){for(var u=s.alternate;i!==null;){if(i===s||i===u)return!0;i=i.return}return!1},q.findCurrentFiberUsingSlowPath=n,q.findCurrentHostFiber=function(s){return s=n(s),s!==null?o(s):null},q.findCurrentHostFiberWithNoPortals=function(s){return s=n(s),s!==null?a(s):null},q.getContainerFromFiber=function(s){return s.tag===3?s.stateNode.containerInfo:null},q.getNearestMountedFiber=e,q.getSuspenseInstanceFromFiber=function(s){if(s.tag===13){var i=s.memoizedState;if(i===null&&(s=s.alternate,s!==null&&(i=s.memoizedState)),i!==null)return i.dehydrated}return null},q.isFiberMounted=function(s){return e(s)===s},q.isFiberSuspenseAndTimedOut=function(s){var i=s.memoizedState;return s.tag===13&&i!==null&&i.dehydrated===null},q.isMounted=function(s){return(s=s._reactInternals)?e(s)===s:!1},q}var Ua;function sm(){return Ua||(Ua=1,Zr.exports=am()),Zr.exports}var im=sm();function um(t){return t._reactInternals}function Rm(t){return t}function cm(t){const e=um(t);if(e===void 0){if(typeof t.render=="function")throw new Error("Unable to find node on an unmounted component.");{const n=Object.keys(t).join(",");throw new Error(`Argument appears to not be a ReactComponent. Keys: ${n}`)}}const r=im.findCurrentHostFiber(e);return r===null?null:r.stateNode}function lm(t){return cm(t)}class Ba{constructor(){w(this,"instanceMap",new Map)}get(e){return this.instanceMap.get(e)}add(e,r){const n=this.instanceMap.get(e);n?n.push(r):this.instanceMap.set(e,[r])}remove(e,r){const n=this.instanceMap.get(e);if(r!==void 0&&Array.isArray(n)){const o=n.filter(a=>a!==r);this.instanceMap.set(e,o)}else this.instanceMap.delete(e)}destroy(){this.instanceMap.clear()}}const Ga=t=>{const{node:e}=t,r=N.useMemo(()=>{const i=e.isContainer();return Pt(i)?i:{placeholder:"Drag the component to place it",width:"100%",height:"100%",style:{}}},[e]),{placeholder:n,height:o,width:a,style:s}=r;return N.createElement("div",{style:{margin:0,padding:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(200,200,200,0.1)",border:"1px solid rgba(0,0,0,0.1)",borderRadius:"2px",fontSize:"14px",color:"gray",cursor:"default",minHeight:"50px",width:a,height:o,boxSizing:"border-box",...s}},n)};class fm extends N.Component{constructor(r){super(r);w(this,"instanceManager",new Ba);w(this,"renderRef");w(this,"dropPlaceholder",Ga);w(this,"_components",{});w(this,"onGetComponent",(r,n)=>{var u,c;const o=this;let a=r;const s=(c=(u=n.material)==null?void 0:u.value.advanceCustom)==null?void 0:c.wrapComponent;s&&(a=s(r,{node:n,ctx:window.__C_ENGINE_DESIGNER_PLUGIN_CTX__}));class i extends N.Component{constructor(){super(...arguments);w(this,"_DESIGN_BOX",!0);w(this,"_NODE_MODEL",n);w(this,"_NODE_ID",n.id);w(this,"_UNIQUE_ID",`${n.id}_${rt()}`);w(this,"_STATUS");w(this,"_design_target_component");w(this,"_dom")}componentDidMount(){o.instanceManager.add(n.id,this)}getTargetComponentRef(){return this._design_target_component}componentWillUnmount(){this._STATUS="DESTROY",o.instanceManager.remove(n.id,this)}getDom(){var h,g;return((g=(h=n.material)==null?void 0:h.value.advanceCustom)==null?void 0:g.autoGetDom)??!0?lm(this):this._dom}render(){var v,y,_,O;const{children:f=[],onlyRenderChild:h,...g}=this.props;let b=f;if(nt(f)||(b=[f]),!!!b.filter(Boolean).length&&(n.isContainer()||n.value.componentName===ut.ROOT_CONTAINER)){const A=(y=(v=n.material)==null?void 0:v.value.advanceCustom)==null?void 0:y.dropPlaceholder;b.push(N.createElement(A||o.dropPlaceholder,{node:n}))}return h?b:((O=(_=n.material)==null?void 0:_.value.advanceCustom)==null?void 0:O.autoGetDom)??!0?N.createElement(a,g,...b):N.createElement(a,{...g,$SET_DOM:T=>{this._dom=T}},...b)}}return N.forwardRef(function(l,f){return N.createElement(om,{node:n,targetComponent:i},N.createElement(i,{ref:f,...l}))})});this._components=Object.assign(this._components,this.props.components),this.renderRef=N.createRef(),r.dropPlaceholder&&(this.dropPlaceholder=r.dropPlaceholder)}updateComponents(r={}){this._components=Object.assign(this._components,r),this.forceUpdate()}componentDidMount(){var r,n;window.__CHAMN_RENDER_MODE="DESIGN",this.updateComponents(this.props.components),(n=(r=this.props).onMount)==null||n.call(r,this)}getPageModel(){var r;return(r=this.renderRef.current)==null?void 0:r.state.pageModel}rerender(r){var n;return(n=this.renderRef.current)==null?void 0:n.rerender(r)}getInstancesById(r,n){let o=[...this.instanceManager.get(r)||[]];return n!==void 0&&(o=o.filter(a=>n===(a==null?void 0:a._UNIQUE_ID))),o}getInstanceByDom(r){const n=ka(r);if(!n)return null;const o=Ha(n);return(o==null?void 0:o.stateNode)||null}getDomsById(r,n){const o=this.getInstancesById(r),a=[];return o==null||o.forEach(s=>{var u;if((s==null?void 0:s._STATUS)==="DESTROY")return;const i=s.getDom();if(i&&!(i instanceof Text))if(n){const c=Array.from(((u=i.querySelectorAll)==null?void 0:u.call(i,n))||[]);a.push(...c)}else a.push(i)}),a}getDomRectById(r,n){return this.getDomsById(r,n).map(s=>s==null?void 0:s.getBoundingClientRect()).filter(Boolean)}render(){const{props:r,onGetComponent:n}=this,{render:o,...a}=r;return o&&(o.ref.current=this),N.createElement(Fa,{onGetComponent:n,...a,components:this._components,processNodeConfigHook:(s,i)=>{var g,b;if(i.nodeType!=="NODE")return s;const{props:u,condition:c}=s;let d={...u};const l=((g=i.value.configure)==null?void 0:g.devState)||{},f=(b=i.material)==null?void 0:b.value.fixedProps;if(f!==void 0){if(Pt(f))d={...d,...f};else if(typeof f=="function"){const p=f(d);d={...d,...p}}}let h=c;return l.condition===!1&&(h=l.condition),{props:Hc(d,l.props||{}),condition:h}},renderMode:"design",ref:this.renderRef})}}const ka=t=>{if(!t)return null;const e=Object.keys(t).find(r=>r.startsWith("__reactInternalInstance$")||r.startsWith("__reactFiber$"))||"";return e?t[e]:ka(t.parentElement)},Ha=t=>{var e;return t?(e=t==null?void 0:t.stateNode)!=null&&e._DESIGN_BOX?t:Ha(t.return):null},dm=()=>{const t=N.useRef(null);return{ref:t,rerender:function(...e){t.current&&t.current.rerender(...e)},getInstancesById(e,r){var n;return((n=t.current)==null?void 0:n.getInstancesById(e,r))||[]},getInstanceByDom(e){var r;return((r=t.current)==null?void 0:r.getInstanceByDom(e))||null},getDomsById(e,r){var n;return((n=t.current)==null?void 0:n.getDomsById(e,r))||[]},getDomRectById(e,r){var n;return((n=t.current)==null?void 0:n.getDomRectById(e,r))||[]}}};var Re={exports:{}},pm=Re.exports,za;function hm(){return za||(za=1,function(t,e){(function(r,n){t.exports=n()})(pm,function(){var r=function(){},n={},o={},a={};function s(f,h){f=f.push?f:[f];var g=[],b=f.length,p=b,m,v,y,_;for(m=function(O,A){A.length&&g.push(O),p--,p||h(g)};b--;){if(v=f[b],y=o[v],y){m(v,y);continue}_=a[v]=a[v]||[],_.push(m)}}function i(f,h){if(f){var g=a[f];if(o[f]=h,!!g)for(;g.length;)g[0](f,h),g.splice(0,1)}}function u(f,h){f.call&&(f={success:f}),h.length?(f.error||r)(h):(f.success||r)(f)}function c(f,h,g,b){var p=document,m=g.async,v=(g.numRetries||0)+1,y=g.before||r,_=f.replace(/[\?|#].*$/,""),O=f.replace(/^(css|img|module|nomodule)!/,""),A,T,$;if(b=b||0,/(^css!|\.css$)/.test(_))$=p.createElement("link"),$.rel="stylesheet",$.href=O,A="hideFocus"in $,A&&$.relList&&(A=0,$.rel="preload",$.as="style");else if(/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(_))$=p.createElement("img"),$.src=O;else if($=p.createElement("script"),$.src=O,$.async=m===void 0?!0:m,T="noModule"in $,/^module!/.test(_)){if(!T)return h(f,"l");$.type="module"}else if(/^nomodule!/.test(_)&&T)return h(f,"l");$.onload=$.onerror=$.onbeforeload=function(B){var At=B.type[0];if(A)try{$.sheet.cssText.length||(At="e")}catch(Tt){Tt.code!=18&&(At="e")}if(At=="e"){if(b+=1,b<v)return c(f,h,g,b)}else if($.rel=="preload"&&$.as=="style")return $.rel="stylesheet";h(f,At,B.defaultPrevented)},y(f,$)!==!1&&p.head.appendChild($)}function d(f,h,g){f=f.push?f:[f];var b=f.length,p=b,m=[],v,y;for(v=function(_,O,A){if(O=="e"&&m.push(_),O=="b")if(A)m.push(_);else return;b--,b||h(m)},y=0;y<p;y++)c(f[y],v,g)}function l(f,h,g){var b,p;if(h&&h.trim&&(b=h),p=(b?g:h)||{},b){if(b in n)throw"LoadJS";n[b]=!0}function m(v,y){d(f,function(_){u(p,_),v&&u({success:v,error:y},_),i(b,_)},p)}if(p.returnPromise)return new Promise(m);m()}return l.ready=function(h,g){return s(h,function(b){u(g,b)}),l},l.done=function(h){i(h,[])},l.reset=function(){n={},o={},a={}},l.isDefined=function(h){return h in n},l})}(Re)),Re.exports}var gm=hm();const qa=Qg(gm);class mm{constructor(e,r){w(this,"assets");w(this,"loadStatus");w(this,"win",window);w(this,"_onSuccessList",[]);w(this,"_onErrorList",[]);this.assets=JSON.parse(JSON.stringify(e||[])),this.loadStatus="INIT",r!=null&&r.window&&(this.win=r.window)}load(e){const r=this.assets||[],n=[];for(let o=0;o<r.length;o++){const a=r[o];a.id||(a.id=rt()),n.push(a.id);const s=a.resources.map(i=>i.src);s.length&&qa(s,a.id,{async:(e==null?void 0:e.async)??!1,before:(i,u)=>(this.win.document.body.appendChild(u),!1)})}return new Promise((o,a)=>{if(r.length===0){this._onSuccessList.forEach(s=>s()),o("");return}qa.ready(n,{success:()=>{this._onSuccessList.forEach(s=>s()),o("")},error:s=>{this._onErrorList.forEach(i=>i(s)),a(s)}})})}onSuccess(e){return this._onSuccessList.push(e),this}onError(e){return this._onErrorList.push(e),this}}C.AssetLoader=mm,C.ComponentInstanceManager=Ba,C.DYNAMIC_COMPONENT_TYPE=le,C.DefaultDropPlaceholder=Ga,C.DefineReactAdapter=Ia,C.DesignRender=fm,C.INNER_EVENT_LIST=xa,C.InnerPropList=Pa,C.ON_DID_RENDER=Wr,C.ON_WILL_DESTROY=Kr,C.ReactAdapter=Kg,C.RefManager=tr,C.Render=Fa,C.canAcceptsRef=ro,C.collectVariable=Jc,C.compWrapper=no,C.convertCodeStringToFunction=xt,C.findComponentByChainRefer=io,C.flatObject=Wc,C.formatSourceStylePropertyName=oo,C.getAdapter=rn,C.getCSSTextValue=qc,C.getComponentsLibs=Kc,C.getInheritObj=Ze,C.getMatchVal=ao,C.getNodeCssClassName=Xe,C.getObjFromArrayMap=Ye,C.getThirdLibs=Qc,C.isClass=zc,C.runExpression=St,C.shouldConstruct=eo,C.useDesignRender=dm,C.useRender=nm,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})});
|
|
88
|
+
*/var Va;function om(){if(Va)return J;Va=1;function t(s){var i="https://react.dev/errors/"+s;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)i+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+s+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function e(s){var i=s,u=s;if(s.alternate)for(;i.return;)i=i.return;else{s=i;do i=s,(i.flags&4098)!==0&&(u=i.return),s=i.return;while(s)}return i.tag===3?u:null}function r(s){if(e(s)!==s)throw Error(t(188))}function n(s){var i=s.alternate;if(!i){if(i=e(s),i===null)throw Error(t(188));return i!==s?null:s}for(var u=s,c=i;;){var d=u.return;if(d===null)break;var l=d.alternate;if(l===null){if(c=d.return,c!==null){u=c;continue}break}if(d.child===l.child){for(l=d.child;l;){if(l===u)return r(d),s;if(l===c)return r(d),i;l=l.sibling}throw Error(t(188))}if(u.return!==c.return)u=d,c=l;else{for(var f=!1,h=d.child;h;){if(h===u){f=!0,u=d,c=l;break}if(h===c){f=!0,c=d,u=l;break}h=h.sibling}if(!f){for(h=l.child;h;){if(h===u){f=!0,u=l,c=d;break}if(h===c){f=!0,c=l,u=d;break}h=h.sibling}if(!f)throw Error(t(189))}}if(u.alternate!==c)throw Error(t(190))}if(u.tag!==3)throw Error(t(188));return u.stateNode.current===u?s:i}function o(s){var i=s.tag;if(i===5||i===26||i===27||i===6)return s;for(s=s.child;s!==null;){if(i=o(s),i!==null)return i;s=s.sibling}return null}function a(s){var i=s.tag;if(i===5||i===26||i===27||i===6)return s;for(s=s.child;s!==null;){if(s.tag!==4&&(i=a(s),i!==null))return i;s=s.sibling}return null}return J.doesFiberContain=function(s,i){for(var u=s.alternate;i!==null;){if(i===s||i===u)return!0;i=i.return}return!1},J.findCurrentFiberUsingSlowPath=n,J.findCurrentHostFiber=function(s){return s=n(s),s!==null?o(s):null},J.findCurrentHostFiberWithNoPortals=function(s){return s=n(s),s!==null?a(s):null},J.getContainerFromFiber=function(s){return s.tag===3?s.stateNode.containerInfo:null},J.getNearestMountedFiber=e,J.getSuspenseInstanceFromFiber=function(s){if(s.tag===13){var i=s.memoizedState;if(i===null&&(s=s.alternate,s!==null&&(i=s.memoizedState)),i!==null)return i.dehydrated}return null},J.isFiberMounted=function(s){return e(s)===s},J.isFiberSuspenseAndTimedOut=function(s){var i=s.memoizedState;return s.tag===13&&i!==null&&i.dehydrated===null},J.isMounted=function(s){return(s=s._reactInternals)?e(s)===s:!1},J}var Ua;function am(){return Ua||(Ua=1,tn.exports=om()),tn.exports}var sm=am();function im(t){return t._reactInternals}function Mm(t){return t}function um(t){const e=im(t);if(e===void 0){if(typeof t.render=="function")throw new Error("Unable to find node on an unmounted component.");{const n=Object.keys(t).join(",");throw new Error(`Argument appears to not be a ReactComponent. Keys: ${n}`)}}const r=sm.findCurrentHostFiber(e);return r===null?null:r.stateNode}function cm(t){return um(t)}class Ba{constructor(){w(this,"instanceMap",new Map)}get(e){return this.instanceMap.get(e)}add(e,r){const n=this.instanceMap.get(e);n?n.push(r):this.instanceMap.set(e,[r])}remove(e,r){const n=this.instanceMap.get(e);if(r!==void 0&&Array.isArray(n)){const o=n.filter(a=>a!==r);this.instanceMap.set(e,o)}else this.instanceMap.delete(e)}destroy(){this.instanceMap.clear()}}const ka=t=>{const{node:e}=t,r=$.useMemo(()=>{const i=e.isContainer();return xt(i)?i:{placeholder:"Drag the component to place it",width:"100%",height:"100%",style:{}}},[e]),{placeholder:n,height:o,width:a,style:s}=r;return $.createElement("div",{style:{margin:0,padding:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(200,200,200,0.1)",border:"1px solid rgba(0,0,0,0.1)",borderRadius:"2px",fontSize:"14px",color:"gray",cursor:"default",minHeight:"50px",width:a,height:o,boxSizing:"border-box",...s}},n)};class lm extends $.Component{constructor(r){super(r);w(this,"instanceManager",new Ba);w(this,"renderRef");w(this,"dropPlaceholder",ka);w(this,"_components",{});w(this,"onGetComponent",(r,n)=>{var u,c;const o=this;let a=r;const s=(c=(u=n.material)==null?void 0:u.value.advanceCustom)==null?void 0:c.wrapComponent;s&&(a=s(r,{node:n,ctx:window.__C_ENGINE_DESIGNER_PLUGIN_CTX__}));class i extends $.Component{constructor(){super(...arguments);w(this,"_DESIGN_BOX",!0);w(this,"_NODE_MODEL",n);w(this,"_NODE_ID",n.id);w(this,"_UNIQUE_ID",`${n.id}_${rt()}`);w(this,"_STATUS");w(this,"_design_target_component");w(this,"_dom")}componentDidMount(){o.instanceManager.add(n.id,this)}getTargetComponentRef(){return this._design_target_component}componentWillUnmount(){this._STATUS="DESTROY",o.instanceManager.remove(n.id,this)}getDom(){var h,g;return((g=(h=n.material)==null?void 0:h.value.advanceCustom)==null?void 0:g.autoGetDom)??!0?cm(this):this._dom}render(){var v,y,_,O;const{children:f=[],onlyRenderChild:h,...g}=this.props;let b=f;if(nt(f)||(b=[f]),!!!b.filter(Boolean).length&&(n.isContainer()||n.value.componentName===ut.ROOT_CONTAINER)){const A=(y=(v=n.material)==null?void 0:v.value.advanceCustom)==null?void 0:y.dropPlaceholder;b.push($.createElement(A||o.dropPlaceholder,{node:n}))}return h?b:((O=(_=n.material)==null?void 0:_.value.advanceCustom)==null?void 0:O.autoGetDom)??!0?$.createElement(a,g,...b):$.createElement(a,{...g,$SET_DOM:T=>{this._dom=T}},...b)}}return $.forwardRef(function(l,f){return $.createElement(nm,{node:n,targetComponent:i},$.createElement(i,{ref:f,...l}))})});this._components=Object.assign(this._components,this.props.components),this.renderRef=$.createRef(),r.dropPlaceholder&&(this.dropPlaceholder=r.dropPlaceholder)}updateComponents(r={}){this._components=Object.assign(this._components,r),this.forceUpdate()}componentDidMount(){var r,n;window.__CHAMN_RENDER_MODE="DESIGN",this.updateComponents(this.props.components),(n=(r=this.props).onMount)==null||n.call(r,this)}getPageModel(){var r;return(r=this.renderRef.current)==null?void 0:r.state.pageModel}rerender(r){var n;return(n=this.renderRef.current)==null?void 0:n.rerender(r)}getInstancesById(r,n){let o=[...this.instanceManager.get(r)||[]];return n!==void 0&&(o=o.filter(a=>n===(a==null?void 0:a._UNIQUE_ID))),o}getInstanceByDom(r){const n=Ga(r);if(!n)return null;const o=Ha(n);return(o==null?void 0:o.stateNode)||null}getDomsById(r,n){const o=this.getInstancesById(r),a=[];return o==null||o.forEach(s=>{var u;if((s==null?void 0:s._STATUS)==="DESTROY")return;const i=s.getDom();if(i&&!(i instanceof Text))if(n){const c=Array.from(((u=i.querySelectorAll)==null?void 0:u.call(i,n))||[]);a.push(...c)}else a.push(i)}),a}getDomRectById(r,n){return this.getDomsById(r,n).map(s=>s==null?void 0:s.getBoundingClientRect()).filter(Boolean)}render(){const{props:r,onGetComponent:n}=this,{render:o,...a}=r;return o&&(o.ref.current=this),$.createElement(Fa,{onGetComponent:n,...a,components:this._components,processNodeConfigHook:(s,i)=>{var g,b;if(i.nodeType!=="NODE")return s;const{props:u,condition:c}=s;let d={...u};const l=((g=i.value.configure)==null?void 0:g.devState)||{},f=(b=i.material)==null?void 0:b.value.fixedProps;if(f!==void 0){if(xt(f))d={...d,...f};else if(typeof f=="function"){const p=f(d);d={...d,...p}}}let h=c;return l.condition===!1&&(h=l.condition),{props:Hc(d,l.props||{}),condition:h}},renderMode:"design",ref:this.renderRef})}}const Ga=t=>{if(!t)return null;const e=Object.keys(t).find(r=>r.startsWith("__reactInternalInstance$")||r.startsWith("__reactFiber$"))||"";return e?t[e]:Ga(t.parentElement)},Ha=t=>{var e;return t?(e=t==null?void 0:t.stateNode)!=null&&e._DESIGN_BOX?t:Ha(t.return):null},fm=()=>{const t=$.useRef(null);return{ref:t,rerender:function(...e){t.current&&t.current.rerender(...e)},getInstancesById(e,r){var n;return((n=t.current)==null?void 0:n.getInstancesById(e,r))||[]},getInstanceByDom(e){var r;return((r=t.current)==null?void 0:r.getInstanceByDom(e))||null},getDomsById(e,r){var n;return((n=t.current)==null?void 0:n.getDomsById(e,r))||[]},getDomRectById(e,r){var n;return((n=t.current)==null?void 0:n.getDomRectById(e,r))||[]}}};var Ie={exports:{}},dm=Ie.exports,za;function pm(){return za||(za=1,function(t,e){(function(r,n){t.exports=n()})(dm,function(){var r=function(){},n={},o={},a={};function s(f,h){f=f.push?f:[f];var g=[],b=f.length,p=b,m,v,y,_;for(m=function(O,A){A.length&&g.push(O),p--,p||h(g)};b--;){if(v=f[b],y=o[v],y){m(v,y);continue}_=a[v]=a[v]||[],_.push(m)}}function i(f,h){if(f){var g=a[f];if(o[f]=h,!!g)for(;g.length;)g[0](f,h),g.splice(0,1)}}function u(f,h){f.call&&(f={success:f}),h.length?(f.error||r)(h):(f.success||r)(f)}function c(f,h,g,b){var p=document,m=g.async,v=(g.numRetries||0)+1,y=g.before||r,_=f.replace(/[\?|#].*$/,""),O=f.replace(/^(css|img|module|nomodule)!/,""),A,T,N;if(b=b||0,/(^css!|\.css$)/.test(_))N=p.createElement("link"),N.rel="stylesheet",N.href=O,A="hideFocus"in N,A&&N.relList&&(A=0,N.rel="preload",N.as="style");else if(/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(_))N=p.createElement("img"),N.src=O;else if(N=p.createElement("script"),N.src=O,N.async=m===void 0?!0:m,T="noModule"in N,/^module!/.test(_)){if(!T)return h(f,"l");N.type="module"}else if(/^nomodule!/.test(_)&&T)return h(f,"l");N.onload=N.onerror=N.onbeforeload=function(B){var At=B.type[0];if(A)try{N.sheet.cssText.length||(At="e")}catch(Tt){Tt.code!=18&&(At="e")}if(At=="e"){if(b+=1,b<v)return c(f,h,g,b)}else if(N.rel=="preload"&&N.as=="style")return N.rel="stylesheet";h(f,At,B.defaultPrevented)},y(f,N)!==!1&&p.head.appendChild(N)}function d(f,h,g){f=f.push?f:[f];var b=f.length,p=b,m=[],v,y;for(v=function(_,O,A){if(O=="e"&&m.push(_),O=="b")if(A)m.push(_);else return;b--,b||h(m)},y=0;y<p;y++)c(f[y],v,g)}function l(f,h,g){var b,p;if(h&&h.trim&&(b=h),p=(b?g:h)||{},b){if(b in n)throw"LoadJS";n[b]=!0}function m(v,y){d(f,function(_){u(p,_),v&&u({success:v,error:y},_),i(b,_)},p)}if(p.returnPromise)return new Promise(m);m()}return l.ready=function(h,g){return s(h,function(b){u(g,b)}),l},l.done=function(h){i(h,[])},l.reset=function(){n={},o={},a={}},l.isDefined=function(h){return h in n},l})}(Ie)),Ie.exports}var hm=pm();const qa=Kg(hm);class gm{constructor(e,r){w(this,"assets");w(this,"loadStatus");w(this,"win",window);w(this,"_onSuccessList",[]);w(this,"_onErrorList",[]);this.assets=JSON.parse(JSON.stringify(e||[])),this.loadStatus="INIT",r!=null&&r.window&&(this.win=r.window)}load(e){const r=this.assets||[],n=[];for(let o=0;o<r.length;o++){const a=r[o];a.id||(a.id=rt()),n.push(a.id);const s=a.resources.map(i=>i.src);s.length&&qa(s,a.id,{async:(e==null?void 0:e.async)??!1,before:(i,u)=>(this.win.document.body.appendChild(u),!1)})}return new Promise((o,a)=>{if(r.length===0){this._onSuccessList.forEach(s=>s()),o("");return}qa.ready(n,{success:()=>{this._onSuccessList.forEach(s=>s()),o("")},error:s=>{this._onErrorList.forEach(i=>i(s)),a(s)}})})}onSuccess(e){return this._onSuccessList.push(e),this}onError(e){return this._onErrorList.push(e),this}}E.AssetLoader=gm,E.ComponentInstanceManager=Ba,E.DYNAMIC_COMPONENT_TYPE=le,E.DefaultDropPlaceholder=ka,E.DefineReactAdapter=Ia,E.DesignRender=lm,E.INNER_EVENT_LIST=xa,E.InnerPropList=Ma,E.ON_DID_RENDER=Kr,E.ON_WILL_DESTROY=Qr,E.ReactAdapter=Wg,E.RefManager=er,E.Render=Fa,E.canAcceptsRef=ro,E.collectVariable=Jc,E.compWrapper=no,E.convertCodeStringToFunction=Rt,E.findComponentByChainRefer=io,E.flatObject=Wc,E.formatSourceStylePropertyName=oo,E.getAdapter=rn,E.getCSSTextValue=qc,E.getComponentsLibs=Kc,E.getInheritObj=tr,E.getMatchVal=ao,E.getNodeCssClassName=Ze,E.getObjFromArrayMap=Xe,E.getThirdLibs=Qc,E.isClass=zc,E.runExpression=St,E.shouldConstruct=eo,E.useDesignRender=fm,E.useRender=rm,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
|
|
86
89
|
//# sourceMappingURL=index.umd.js.map
|