@chamn/render 0.8.4 → 0.8.6
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 +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +254 -252
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +6 -6
- package/dist/index.umd.js.map +1 -1
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Ya=Object.defineProperty;var Xa=(t,e,r)=>e in t?Ya(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var w=(t,e,r)=>Xa(t,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("react"),Za=t=>()=>{console.warn(`${t} need to be implement getComponent`)},ts=["customPageRootRender"],Zr=["pageRender","render","convertModelToComponent","getComponent","getContext","getUtils","transformProps","errorCatch","requestAPI","clear"],po=t=>[...Zr,...ts].reduce((r,n)=>{var o;return t!=null&&t[n]?r[n]=(o=t[n])==null?void 0:o.bind(t):Zr.includes(n)&&(r[n]=Za),r},{});var ho=typeof global=="object"&&global&&global.Object===Object&&global,es=typeof self=="object"&&self&&self.Object===Object&&self,X=ho||es||Function("return this")(),lt=X.Symbol,go=Object.prototype,rs=go.hasOwnProperty,ns=go.toString,zt=lt?lt.toStringTag:void 0;function os(t){var e=rs.call(t,zt),r=t[zt];try{t[zt]=void 0;var n=!0}catch{}var o=ns.call(t);return n&&(e?t[zt]=r:delete t[zt]),o}var as=Object.prototype,ss=as.toString;function is(t){return ss.call(t)}var cs="[object Null]",us="[object Undefined]",tn=lt?lt.toStringTag:void 0;function Et(t){return t==null?t===void 0?us:cs:tn&&tn in Object(t)?os(t):is(t)}function ft(t){return t!=null&&typeof t=="object"}var ls="[object Symbol]";function fs(t){return typeof t=="symbol"||ft(t)&&Et(t)==ls}function ds(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 ot=Array.isArray,en=lt?lt.prototype:void 0,rn=en?en.toString:void 0;function vo(t){if(typeof t=="string")return t;if(ot(t))return ds(t,vo)+"";if(fs(t))return rn?rn.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function wt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function mo(t){return t}var ps="[object AsyncFunction]",hs="[object Function]",gs="[object GeneratorFunction]",vs="[object Proxy]";function vr(t){if(!wt(t))return!1;var e=Et(t);return e==hs||e==gs||e==ps||e==vs}var Me=X["__core-js_shared__"],nn=function(){var t=/[^.]+$/.exec(Me&&Me.keys&&Me.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function ms(t){return!!nn&&nn in t}var ys=Function.prototype,bs=ys.toString;function Ct(t){if(t!=null){try{return bs.call(t)}catch{}try{return t+""}catch{}}return""}var _s=/[\\^$.*+?()[\]{}|]/g,Ss=/^\[object .+?Constructor\]$/,Os=Function.prototype,Es=Object.prototype,ws=Os.toString,Cs=Es.hasOwnProperty,$s=RegExp("^"+ws.call(Cs).replace(_s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ns(t){if(!wt(t)||ms(t))return!1;var e=vr(t)?$s:Ss;return e.test(Ct(t))}function js(t,e){return t==null?void 0:t[e]}function $t(t,e){var r=js(t,e);return Ns(r)?r:void 0}var ze=$t(X,"WeakMap"),on=Object.create,xs=function(){function t(){}return function(e){if(!wt(e))return{};if(on)return on(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function As(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 Ts(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var Rs=800,Ps=16,Ms=Date.now;function Is(t){var e=0,r=0;return function(){var n=Ms(),o=Ps-(n-r);if(r=n,o>0){if(++e>=Rs)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Ds(t){return function(){return t}}var ve=function(){try{var t=$t(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Ls=ve?function(t,e){return ve(t,"toString",{configurable:!0,enumerable:!1,value:Ds(e),writable:!0})}:mo,Fs=Is(Ls),Vs=9007199254740991,Us=/^(?:0|[1-9]\d*)$/;function yo(t,e){var r=typeof t;return e=e??Vs,!!e&&(r=="number"||r!="symbol"&&Us.test(t))&&t>-1&&t%1==0&&t<e}function mr(t,e,r){e=="__proto__"&&ve?ve(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function ie(t,e){return t===e||t!==t&&e!==e}var Bs=Object.prototype,Gs=Bs.hasOwnProperty;function ks(t,e,r){var n=t[e];(!(Gs.call(t,e)&&ie(n,r))||r===void 0&&!(e in t))&&mr(t,e,r)}function Hs(t,e,r,n){var o=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var i=e[a],c=void 0;c===void 0&&(c=t[i]),o?mr(r,i,c):ks(r,i,c)}return r}var an=Math.max;function zs(t,e,r){return e=an(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=an(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),As(t,this,i)}}function qs(t,e){return Fs(zs(t,e,mo),t+"")}var Js=9007199254740991;function bo(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Js}function we(t){return t!=null&&bo(t.length)&&!vr(t)}function Ws(t,e,r){if(!wt(r))return!1;var n=typeof e;return(n=="number"?we(r)&&yo(e,r.length):n=="string"&&e in r)?ie(r[e],t):!1}function Ks(t){return qs(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&&Ws(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 Qs=Object.prototype;function yr(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Qs;return t===r}function Ys(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Xs="[object Arguments]";function sn(t){return ft(t)&&Et(t)==Xs}var _o=Object.prototype,Zs=_o.hasOwnProperty,ti=_o.propertyIsEnumerable,qe=sn(function(){return arguments}())?sn:function(t){return ft(t)&&Zs.call(t,"callee")&&!ti.call(t,"callee")};function ei(){return!1}var So=typeof exports=="object"&&exports&&!exports.nodeType&&exports,cn=So&&typeof module=="object"&&module&&!module.nodeType&&module,ri=cn&&cn.exports===So,un=ri?X.Buffer:void 0,ni=un?un.isBuffer:void 0,me=ni||ei,oi="[object Arguments]",ai="[object Array]",si="[object Boolean]",ii="[object Date]",ci="[object Error]",ui="[object Function]",li="[object Map]",fi="[object Number]",di="[object Object]",pi="[object RegExp]",hi="[object Set]",gi="[object String]",vi="[object WeakMap]",mi="[object ArrayBuffer]",yi="[object DataView]",bi="[object Float32Array]",_i="[object Float64Array]",Si="[object Int8Array]",Oi="[object Int16Array]",Ei="[object Int32Array]",wi="[object Uint8Array]",Ci="[object Uint8ClampedArray]",$i="[object Uint16Array]",Ni="[object Uint32Array]",P={};P[bi]=P[_i]=P[Si]=P[Oi]=P[Ei]=P[wi]=P[Ci]=P[$i]=P[Ni]=!0;P[oi]=P[ai]=P[mi]=P[si]=P[yi]=P[ii]=P[ci]=P[ui]=P[li]=P[fi]=P[di]=P[pi]=P[hi]=P[gi]=P[vi]=!1;function ji(t){return ft(t)&&bo(t.length)&&!!P[Et(t)]}function xi(t){return function(e){return t(e)}}var Oo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Wt=Oo&&typeof module=="object"&&module&&!module.nodeType&&module,Ai=Wt&&Wt.exports===Oo,Ie=Ai&&ho.process,ln=function(){try{var t=Wt&&Wt.require&&Wt.require("util").types;return t||Ie&&Ie.binding&&Ie.binding("util")}catch{}}(),fn=ln&&ln.isTypedArray,br=fn?xi(fn):ji,Ti=Object.prototype,Ri=Ti.hasOwnProperty;function Eo(t,e){var r=ot(t),n=!r&&qe(t),o=!r&&!n&&me(t),a=!r&&!n&&!o&&br(t),s=r||n||o||a,i=s?Ys(t.length,String):[],c=i.length;for(var u in t)(e||Ri.call(t,u))&&!(s&&(u=="length"||o&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||yo(u,c)))&&i.push(u);return i}function wo(t,e){return function(r){return t(e(r))}}var Pi=wo(Object.keys,Object),Mi=Object.prototype,Ii=Mi.hasOwnProperty;function Di(t){if(!yr(t))return Pi(t);var e=[];for(var r in Object(t))Ii.call(t,r)&&r!="constructor"&&e.push(r);return e}function Li(t){return we(t)?Eo(t):Di(t)}function Fi(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Vi=Object.prototype,Ui=Vi.hasOwnProperty;function Bi(t){if(!wt(t))return Fi(t);var e=yr(t),r=[];for(var n in t)n=="constructor"&&(e||!Ui.call(t,n))||r.push(n);return r}function Co(t){return we(t)?Eo(t,!0):Bi(t)}var Xt=$t(Object,"create");function Gi(){this.__data__=Xt?Xt(null):{},this.size=0}function ki(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Hi="__lodash_hash_undefined__",zi=Object.prototype,qi=zi.hasOwnProperty;function Ji(t){var e=this.__data__;if(Xt){var r=e[t];return r===Hi?void 0:r}return qi.call(e,t)?e[t]:void 0}var Wi=Object.prototype,Ki=Wi.hasOwnProperty;function Qi(t){var e=this.__data__;return Xt?e[t]!==void 0:Ki.call(e,t)}var Yi="__lodash_hash_undefined__";function Xi(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Xt&&e===void 0?Yi:e,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=Gi;_t.prototype.delete=ki;_t.prototype.get=Ji;_t.prototype.has=Qi;_t.prototype.set=Xi;function Zi(){this.__data__=[],this.size=0}function Ce(t,e){for(var r=t.length;r--;)if(ie(t[r][0],e))return r;return-1}var tc=Array.prototype,ec=tc.splice;function rc(t){var e=this.__data__,r=Ce(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():ec.call(e,r,1),--this.size,!0}function nc(t){var e=this.__data__,r=Ce(e,t);return r<0?void 0:e[r][1]}function oc(t){return Ce(this.__data__,t)>-1}function ac(t,e){var r=this.__data__,n=Ce(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function at(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])}}at.prototype.clear=Zi;at.prototype.delete=rc;at.prototype.get=nc;at.prototype.has=oc;at.prototype.set=ac;var Zt=$t(X,"Map");function sc(){this.size=0,this.__data__={hash:new _t,map:new(Zt||at),string:new _t}}function ic(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function $e(t,e){var r=t.__data__;return ic(e)?r[typeof e=="string"?"string":"hash"]:r.map}function cc(t){var e=$e(this,t).delete(t);return this.size-=e?1:0,e}function uc(t){return $e(this,t).get(t)}function lc(t){return $e(this,t).has(t)}function fc(t,e){var r=$e(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function Nt(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])}}Nt.prototype.clear=sc;Nt.prototype.delete=cc;Nt.prototype.get=uc;Nt.prototype.has=lc;Nt.prototype.set=fc;function $o(t){return t==null?"":vo(t)}function dc(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}var No=wo(Object.getPrototypeOf,Object),pc="[object Object]",hc=Function.prototype,gc=Object.prototype,jo=hc.toString,vc=gc.hasOwnProperty,mc=jo.call(Object);function Ft(t){if(!ft(t)||Et(t)!=pc)return!1;var e=No(t);if(e===null)return!0;var r=vc.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&jo.call(r)==mc}function yc(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 bc(t,e,r){var n=t.length;return r=r===void 0?n:r,yc(t,e,r)}var _c="\\ud800-\\udfff",Sc="\\u0300-\\u036f",Oc="\\ufe20-\\ufe2f",Ec="\\u20d0-\\u20ff",wc=Sc+Oc+Ec,Cc="\\ufe0e\\ufe0f",$c="\\u200d",Nc=RegExp("["+$c+_c+wc+Cc+"]");function xo(t){return Nc.test(t)}function jc(t){return t.split("")}var Ao="\\ud800-\\udfff",xc="\\u0300-\\u036f",Ac="\\ufe20-\\ufe2f",Tc="\\u20d0-\\u20ff",Rc=xc+Ac+Tc,Pc="\\ufe0e\\ufe0f",Mc="["+Ao+"]",Je="["+Rc+"]",We="\\ud83c[\\udffb-\\udfff]",Ic="(?:"+Je+"|"+We+")",To="[^"+Ao+"]",Ro="(?:\\ud83c[\\udde6-\\uddff]){2}",Po="[\\ud800-\\udbff][\\udc00-\\udfff]",Dc="\\u200d",Mo=Ic+"?",Io="["+Pc+"]?",Lc="(?:"+Dc+"(?:"+[To,Ro,Po].join("|")+")"+Io+Mo+")*",Fc=Io+Mo+Lc,Vc="(?:"+[To+Je+"?",Je,Ro,Po,Mc].join("|")+")",Uc=RegExp(We+"(?="+We+")|"+Vc+Fc,"g");function Bc(t){return t.match(Uc)||[]}function Gc(t){return xo(t)?Bc(t):jc(t)}function kc(t){return function(e){e=$o(e);var r=xo(e)?Gc(e):void 0,n=r?r[0]:e.charAt(0),o=r?bc(r,1).join(""):e.slice(1);return n[t]()+o}}var Hc=kc("toUpperCase");function zc(t){return Hc($o(t).toLowerCase())}function qc(){this.__data__=new at,this.size=0}function Jc(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function Wc(t){return this.__data__.get(t)}function Kc(t){return this.__data__.has(t)}var Qc=200;function Yc(t,e){var r=this.__data__;if(r instanceof at){var n=r.__data__;if(!Zt||n.length<Qc-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Nt(n)}return r.set(t,e),this.size=r.size,this}function nt(t){var e=this.__data__=new at(t);this.size=e.size}nt.prototype.clear=qc;nt.prototype.delete=Jc;nt.prototype.get=Wc;nt.prototype.has=Kc;nt.prototype.set=Yc;var Do=typeof exports=="object"&&exports&&!exports.nodeType&&exports,dn=Do&&typeof module=="object"&&module&&!module.nodeType&&module,Xc=dn&&dn.exports===Do,pn=Xc?X.Buffer:void 0;pn&&pn.allocUnsafe;function Zc(t,e){return t.slice()}function tu(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 eu(){return[]}var ru=Object.prototype,nu=ru.propertyIsEnumerable,hn=Object.getOwnPropertySymbols,ou=hn?function(t){return t==null?[]:(t=Object(t),tu(hn(t),function(e){return nu.call(t,e)}))}:eu;function au(t,e,r){var n=e(t);return ot(t)?n:dc(n,r(t))}function gn(t){return au(t,Li,ou)}var Ke=$t(X,"DataView"),Qe=$t(X,"Promise"),Ye=$t(X,"Set"),vn="[object Map]",su="[object Object]",mn="[object Promise]",yn="[object Set]",bn="[object WeakMap]",_n="[object DataView]",iu=Ct(Ke),cu=Ct(Zt),uu=Ct(Qe),lu=Ct(Ye),fu=Ct(ze),ut=Et;(Ke&&ut(new Ke(new ArrayBuffer(1)))!=_n||Zt&&ut(new Zt)!=vn||Qe&&ut(Qe.resolve())!=mn||Ye&&ut(new Ye)!=yn||ze&&ut(new ze)!=bn)&&(ut=function(t){var e=Et(t),r=e==su?t.constructor:void 0,n=r?Ct(r):"";if(n)switch(n){case iu:return _n;case cu:return vn;case uu:return mn;case lu:return yn;case fu:return bn}return e});var ye=X.Uint8Array;function du(t){var e=new t.constructor(t.byteLength);return new ye(e).set(new ye(t)),e}function pu(t,e){var r=du(t.buffer);return new t.constructor(r,t.byteOffset,t.length)}function hu(t){return typeof t.constructor=="function"&&!yr(t)?xs(No(t)):{}}var gu="__lodash_hash_undefined__";function vu(t){return this.__data__.set(t,gu),this}function mu(t){return this.__data__.has(t)}function be(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new Nt;++e<r;)this.add(t[e])}be.prototype.add=be.prototype.push=vu;be.prototype.has=mu;function yu(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 bu(t,e){return t.has(e)}var _u=1,Su=2;function Lo(t,e,r,n,o,a){var s=r&_u,i=t.length,c=e.length;if(i!=c&&!(s&&c>i))return!1;var u=a.get(t),d=a.get(e);if(u&&d)return u==e&&d==t;var l=-1,f=!0,h=r&Su?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(!yu(e,function(v,m){if(!bu(h,m)&&(g===v||o(g,v,r,n,a)))return h.push(m)})){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 Ou(t){var e=-1,r=Array(t.size);return t.forEach(function(n,o){r[++e]=[o,n]}),r}function Eu(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var wu=1,Cu=2,$u="[object Boolean]",Nu="[object Date]",ju="[object Error]",xu="[object Map]",Au="[object Number]",Tu="[object RegExp]",Ru="[object Set]",Pu="[object String]",Mu="[object Symbol]",Iu="[object ArrayBuffer]",Du="[object DataView]",Sn=lt?lt.prototype:void 0,De=Sn?Sn.valueOf:void 0;function Lu(t,e,r,n,o,a,s){switch(r){case Du:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Iu:return!(t.byteLength!=e.byteLength||!a(new ye(t),new ye(e)));case $u:case Nu:case Au:return ie(+t,+e);case ju:return t.name==e.name&&t.message==e.message;case Tu:case Pu:return t==e+"";case xu:var i=Ou;case Ru:var c=n&wu;if(i||(i=Eu),t.size!=e.size&&!c)return!1;var u=s.get(t);if(u)return u==e;n|=Cu,s.set(t,e);var d=Lo(i(t),i(e),n,o,a,s);return s.delete(t),d;case Mu:if(De)return De.call(t)==De.call(e)}return!1}var Fu=1,Vu=Object.prototype,Uu=Vu.hasOwnProperty;function Bu(t,e,r,n,o,a){var s=r&Fu,i=gn(t),c=i.length,u=gn(e),d=u.length;if(c!=d&&!s)return!1;for(var l=c;l--;){var f=i[l];if(!(s?f in e:Uu.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<c;){f=i[l];var v=t[f],m=e[f];if(n)var y=s?n(m,v,f,e,t,a):n(v,m,f,t,e,a);if(!(y===void 0?v===m||o(v,m,r,n,a):y)){b=!1;break}p||(p=f=="constructor")}if(b&&!p){var _=t.constructor,S=e.constructor;_!=S&&"constructor"in t&&"constructor"in e&&!(typeof _=="function"&&_ instanceof _&&typeof S=="function"&&S instanceof S)&&(b=!1)}return a.delete(t),a.delete(e),b}var Gu=1,On="[object Arguments]",En="[object Array]",de="[object Object]",ku=Object.prototype,wn=ku.hasOwnProperty;function Hu(t,e,r,n,o,a){var s=ot(t),i=ot(e),c=s?En:ut(t),u=i?En:ut(e);c=c==On?de:c,u=u==On?de:u;var d=c==de,l=u==de,f=c==u;if(f&&me(t)){if(!me(e))return!1;s=!0,d=!1}if(f&&!d)return a||(a=new nt),s||br(t)?Lo(t,e,r,n,o,a):Lu(t,e,c,r,n,o,a);if(!(r&Gu)){var h=d&&wn.call(t,"__wrapped__"),g=l&&wn.call(e,"__wrapped__");if(h||g){var b=h?t.value():t,p=g?e.value():e;return a||(a=new nt),o(b,p,r,n,a)}}return f?(a||(a=new nt),Bu(t,e,r,n,o,a)):!1}function Fo(t,e,r,n,o){return t===e?!0:t==null||e==null||!ft(t)&&!ft(e)?t!==t&&e!==e:Hu(t,e,r,n,Fo,o)}function zu(t){return function(e,r,n){for(var o=-1,a=Object(e),s=n(e),i=s.length;i--;){var c=s[++o];if(r(a[c],c,a)===!1)break}return e}}var qu=zu();function Xe(t,e,r){(r!==void 0&&!ie(t[e],r)||r===void 0&&!(e in t))&&mr(t,e,r)}function Ju(t){return ft(t)&&we(t)}function Ze(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Wu(t){return Hs(t,Co(t))}function Ku(t,e,r,n,o,a,s){var i=Ze(t,r),c=Ze(e,r),u=s.get(c);if(u){Xe(t,r,u);return}var d=a?a(i,c,r+"",t,e,s):void 0,l=d===void 0;if(l){var f=ot(c),h=!f&&me(c),g=!f&&!h&&br(c);d=c,f||h||g?ot(i)?d=i:Ju(i)?d=Ts(i):h?(l=!1,d=Zc(c)):g?(l=!1,d=pu(c)):d=[]:Ft(c)||qe(c)?(d=i,qe(i)?d=Wu(i):(!wt(i)||vr(i))&&(d=hu(c))):l=!1}l&&(s.set(c,d),o(d,c,n,a,s),s.delete(c)),Xe(t,r,d)}function Vo(t,e,r,n,o){t!==e&&qu(e,function(a,s){if(o||(o=new nt),wt(a))Ku(t,e,s,r,Vo,n,o);else{var i=n?n(Ze(t,s),a,s+"",t,e,o):void 0;i===void 0&&(i=a),Xe(t,s,i)}},Co)}function Qu(t,e){return Fo(t,e)}var Yu=Ks(function(t,e,r){Vo(t,e,r)});const Cn=(t,e={keyListVar:"ALL_NODE_IDS",getReadValCode:""})=>{let r=t;return r[0]===String(Number(r[0]))&&(r=`_${r}`),`
|
|
1
|
+
"use strict";var Ya=Object.defineProperty;var Xa=(t,e,r)=>e in t?Ya(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var w=(t,e,r)=>Xa(t,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("react"),Za=t=>()=>{console.warn(`${t} need to be implement getComponent`)},ts=["customPageRootRender"],Zr=["pageRender","render","convertModelToComponent","getComponent","getContext","getUtils","transformProps","errorCatch","requestAPI","clear"],po=t=>[...Zr,...ts].reduce((r,n)=>{var o;return t!=null&&t[n]?r[n]=(o=t[n])==null?void 0:o.bind(t):Zr.includes(n)&&(r[n]=Za),r},{});var ho=typeof global=="object"&&global&&global.Object===Object&&global,es=typeof self=="object"&&self&&self.Object===Object&&self,X=ho||es||Function("return this")(),lt=X.Symbol,go=Object.prototype,rs=go.hasOwnProperty,ns=go.toString,zt=lt?lt.toStringTag:void 0;function os(t){var e=rs.call(t,zt),r=t[zt];try{t[zt]=void 0;var n=!0}catch{}var o=ns.call(t);return n&&(e?t[zt]=r:delete t[zt]),o}var as=Object.prototype,ss=as.toString;function is(t){return ss.call(t)}var cs="[object Null]",us="[object Undefined]",tn=lt?lt.toStringTag:void 0;function Et(t){return t==null?t===void 0?us:cs:tn&&tn in Object(t)?os(t):is(t)}function ft(t){return t!=null&&typeof t=="object"}var ls="[object Symbol]";function fs(t){return typeof t=="symbol"||ft(t)&&Et(t)==ls}function ds(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 ot=Array.isArray,en=lt?lt.prototype:void 0,rn=en?en.toString:void 0;function vo(t){if(typeof t=="string")return t;if(ot(t))return ds(t,vo)+"";if(fs(t))return rn?rn.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function wt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function mo(t){return t}var ps="[object AsyncFunction]",hs="[object Function]",gs="[object GeneratorFunction]",vs="[object Proxy]";function vr(t){if(!wt(t))return!1;var e=Et(t);return e==hs||e==gs||e==ps||e==vs}var Me=X["__core-js_shared__"],nn=function(){var t=/[^.]+$/.exec(Me&&Me.keys&&Me.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function ms(t){return!!nn&&nn in t}var ys=Function.prototype,bs=ys.toString;function Ct(t){if(t!=null){try{return bs.call(t)}catch{}try{return t+""}catch{}}return""}var _s=/[\\^$.*+?()[\]{}|]/g,Ss=/^\[object .+?Constructor\]$/,Os=Function.prototype,Es=Object.prototype,ws=Os.toString,Cs=Es.hasOwnProperty,$s=RegExp("^"+ws.call(Cs).replace(_s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ns(t){if(!wt(t)||ms(t))return!1;var e=vr(t)?$s:Ss;return e.test(Ct(t))}function js(t,e){return t==null?void 0:t[e]}function $t(t,e){var r=js(t,e);return Ns(r)?r:void 0}var ze=$t(X,"WeakMap"),on=Object.create,As=function(){function t(){}return function(e){if(!wt(e))return{};if(on)return on(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function xs(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 Ts(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var Rs=800,Ps=16,Ms=Date.now;function Is(t){var e=0,r=0;return function(){var n=Ms(),o=Ps-(n-r);if(r=n,o>0){if(++e>=Rs)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Ds(t){return function(){return t}}var ve=function(){try{var t=$t(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Ls=ve?function(t,e){return ve(t,"toString",{configurable:!0,enumerable:!1,value:Ds(e),writable:!0})}:mo,Fs=Is(Ls),Vs=9007199254740991,Us=/^(?:0|[1-9]\d*)$/;function yo(t,e){var r=typeof t;return e=e??Vs,!!e&&(r=="number"||r!="symbol"&&Us.test(t))&&t>-1&&t%1==0&&t<e}function mr(t,e,r){e=="__proto__"&&ve?ve(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function ie(t,e){return t===e||t!==t&&e!==e}var Bs=Object.prototype,Gs=Bs.hasOwnProperty;function ks(t,e,r){var n=t[e];(!(Gs.call(t,e)&&ie(n,r))||r===void 0&&!(e in t))&&mr(t,e,r)}function Hs(t,e,r,n){var o=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var i=e[a],c=void 0;c===void 0&&(c=t[i]),o?mr(r,i,c):ks(r,i,c)}return r}var an=Math.max;function zs(t,e,r){return e=an(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=an(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),xs(t,this,i)}}function qs(t,e){return Fs(zs(t,e,mo),t+"")}var Js=9007199254740991;function bo(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Js}function we(t){return t!=null&&bo(t.length)&&!vr(t)}function Ws(t,e,r){if(!wt(r))return!1;var n=typeof e;return(n=="number"?we(r)&&yo(e,r.length):n=="string"&&e in r)?ie(r[e],t):!1}function Ks(t){return qs(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&&Ws(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 Qs=Object.prototype;function yr(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Qs;return t===r}function Ys(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Xs="[object Arguments]";function sn(t){return ft(t)&&Et(t)==Xs}var _o=Object.prototype,Zs=_o.hasOwnProperty,ti=_o.propertyIsEnumerable,qe=sn(function(){return arguments}())?sn:function(t){return ft(t)&&Zs.call(t,"callee")&&!ti.call(t,"callee")};function ei(){return!1}var So=typeof exports=="object"&&exports&&!exports.nodeType&&exports,cn=So&&typeof module=="object"&&module&&!module.nodeType&&module,ri=cn&&cn.exports===So,un=ri?X.Buffer:void 0,ni=un?un.isBuffer:void 0,me=ni||ei,oi="[object Arguments]",ai="[object Array]",si="[object Boolean]",ii="[object Date]",ci="[object Error]",ui="[object Function]",li="[object Map]",fi="[object Number]",di="[object Object]",pi="[object RegExp]",hi="[object Set]",gi="[object String]",vi="[object WeakMap]",mi="[object ArrayBuffer]",yi="[object DataView]",bi="[object Float32Array]",_i="[object Float64Array]",Si="[object Int8Array]",Oi="[object Int16Array]",Ei="[object Int32Array]",wi="[object Uint8Array]",Ci="[object Uint8ClampedArray]",$i="[object Uint16Array]",Ni="[object Uint32Array]",P={};P[bi]=P[_i]=P[Si]=P[Oi]=P[Ei]=P[wi]=P[Ci]=P[$i]=P[Ni]=!0;P[oi]=P[ai]=P[mi]=P[si]=P[yi]=P[ii]=P[ci]=P[ui]=P[li]=P[fi]=P[di]=P[pi]=P[hi]=P[gi]=P[vi]=!1;function ji(t){return ft(t)&&bo(t.length)&&!!P[Et(t)]}function Ai(t){return function(e){return t(e)}}var Oo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Wt=Oo&&typeof module=="object"&&module&&!module.nodeType&&module,xi=Wt&&Wt.exports===Oo,Ie=xi&&ho.process,ln=function(){try{var t=Wt&&Wt.require&&Wt.require("util").types;return t||Ie&&Ie.binding&&Ie.binding("util")}catch{}}(),fn=ln&&ln.isTypedArray,br=fn?Ai(fn):ji,Ti=Object.prototype,Ri=Ti.hasOwnProperty;function Eo(t,e){var r=ot(t),n=!r&&qe(t),o=!r&&!n&&me(t),a=!r&&!n&&!o&&br(t),s=r||n||o||a,i=s?Ys(t.length,String):[],c=i.length;for(var u in t)(e||Ri.call(t,u))&&!(s&&(u=="length"||o&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||yo(u,c)))&&i.push(u);return i}function wo(t,e){return function(r){return t(e(r))}}var Pi=wo(Object.keys,Object),Mi=Object.prototype,Ii=Mi.hasOwnProperty;function Di(t){if(!yr(t))return Pi(t);var e=[];for(var r in Object(t))Ii.call(t,r)&&r!="constructor"&&e.push(r);return e}function Li(t){return we(t)?Eo(t):Di(t)}function Fi(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Vi=Object.prototype,Ui=Vi.hasOwnProperty;function Bi(t){if(!wt(t))return Fi(t);var e=yr(t),r=[];for(var n in t)n=="constructor"&&(e||!Ui.call(t,n))||r.push(n);return r}function Co(t){return we(t)?Eo(t,!0):Bi(t)}var Xt=$t(Object,"create");function Gi(){this.__data__=Xt?Xt(null):{},this.size=0}function ki(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Hi="__lodash_hash_undefined__",zi=Object.prototype,qi=zi.hasOwnProperty;function Ji(t){var e=this.__data__;if(Xt){var r=e[t];return r===Hi?void 0:r}return qi.call(e,t)?e[t]:void 0}var Wi=Object.prototype,Ki=Wi.hasOwnProperty;function Qi(t){var e=this.__data__;return Xt?e[t]!==void 0:Ki.call(e,t)}var Yi="__lodash_hash_undefined__";function Xi(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Xt&&e===void 0?Yi:e,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=Gi;_t.prototype.delete=ki;_t.prototype.get=Ji;_t.prototype.has=Qi;_t.prototype.set=Xi;function Zi(){this.__data__=[],this.size=0}function Ce(t,e){for(var r=t.length;r--;)if(ie(t[r][0],e))return r;return-1}var tc=Array.prototype,ec=tc.splice;function rc(t){var e=this.__data__,r=Ce(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():ec.call(e,r,1),--this.size,!0}function nc(t){var e=this.__data__,r=Ce(e,t);return r<0?void 0:e[r][1]}function oc(t){return Ce(this.__data__,t)>-1}function ac(t,e){var r=this.__data__,n=Ce(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function at(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])}}at.prototype.clear=Zi;at.prototype.delete=rc;at.prototype.get=nc;at.prototype.has=oc;at.prototype.set=ac;var Zt=$t(X,"Map");function sc(){this.size=0,this.__data__={hash:new _t,map:new(Zt||at),string:new _t}}function ic(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function $e(t,e){var r=t.__data__;return ic(e)?r[typeof e=="string"?"string":"hash"]:r.map}function cc(t){var e=$e(this,t).delete(t);return this.size-=e?1:0,e}function uc(t){return $e(this,t).get(t)}function lc(t){return $e(this,t).has(t)}function fc(t,e){var r=$e(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function Nt(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])}}Nt.prototype.clear=sc;Nt.prototype.delete=cc;Nt.prototype.get=uc;Nt.prototype.has=lc;Nt.prototype.set=fc;function $o(t){return t==null?"":vo(t)}function dc(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}var No=wo(Object.getPrototypeOf,Object),pc="[object Object]",hc=Function.prototype,gc=Object.prototype,jo=hc.toString,vc=gc.hasOwnProperty,mc=jo.call(Object);function Ft(t){if(!ft(t)||Et(t)!=pc)return!1;var e=No(t);if(e===null)return!0;var r=vc.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&jo.call(r)==mc}function yc(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 bc(t,e,r){var n=t.length;return r=r===void 0?n:r,yc(t,e,r)}var _c="\\ud800-\\udfff",Sc="\\u0300-\\u036f",Oc="\\ufe20-\\ufe2f",Ec="\\u20d0-\\u20ff",wc=Sc+Oc+Ec,Cc="\\ufe0e\\ufe0f",$c="\\u200d",Nc=RegExp("["+$c+_c+wc+Cc+"]");function Ao(t){return Nc.test(t)}function jc(t){return t.split("")}var xo="\\ud800-\\udfff",Ac="\\u0300-\\u036f",xc="\\ufe20-\\ufe2f",Tc="\\u20d0-\\u20ff",Rc=Ac+xc+Tc,Pc="\\ufe0e\\ufe0f",Mc="["+xo+"]",Je="["+Rc+"]",We="\\ud83c[\\udffb-\\udfff]",Ic="(?:"+Je+"|"+We+")",To="[^"+xo+"]",Ro="(?:\\ud83c[\\udde6-\\uddff]){2}",Po="[\\ud800-\\udbff][\\udc00-\\udfff]",Dc="\\u200d",Mo=Ic+"?",Io="["+Pc+"]?",Lc="(?:"+Dc+"(?:"+[To,Ro,Po].join("|")+")"+Io+Mo+")*",Fc=Io+Mo+Lc,Vc="(?:"+[To+Je+"?",Je,Ro,Po,Mc].join("|")+")",Uc=RegExp(We+"(?="+We+")|"+Vc+Fc,"g");function Bc(t){return t.match(Uc)||[]}function Gc(t){return Ao(t)?Bc(t):jc(t)}function kc(t){return function(e){e=$o(e);var r=Ao(e)?Gc(e):void 0,n=r?r[0]:e.charAt(0),o=r?bc(r,1).join(""):e.slice(1);return n[t]()+o}}var Hc=kc("toUpperCase");function zc(t){return Hc($o(t).toLowerCase())}function qc(){this.__data__=new at,this.size=0}function Jc(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function Wc(t){return this.__data__.get(t)}function Kc(t){return this.__data__.has(t)}var Qc=200;function Yc(t,e){var r=this.__data__;if(r instanceof at){var n=r.__data__;if(!Zt||n.length<Qc-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Nt(n)}return r.set(t,e),this.size=r.size,this}function nt(t){var e=this.__data__=new at(t);this.size=e.size}nt.prototype.clear=qc;nt.prototype.delete=Jc;nt.prototype.get=Wc;nt.prototype.has=Kc;nt.prototype.set=Yc;var Do=typeof exports=="object"&&exports&&!exports.nodeType&&exports,dn=Do&&typeof module=="object"&&module&&!module.nodeType&&module,Xc=dn&&dn.exports===Do,pn=Xc?X.Buffer:void 0;pn&&pn.allocUnsafe;function Zc(t,e){return t.slice()}function tu(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 eu(){return[]}var ru=Object.prototype,nu=ru.propertyIsEnumerable,hn=Object.getOwnPropertySymbols,ou=hn?function(t){return t==null?[]:(t=Object(t),tu(hn(t),function(e){return nu.call(t,e)}))}:eu;function au(t,e,r){var n=e(t);return ot(t)?n:dc(n,r(t))}function gn(t){return au(t,Li,ou)}var Ke=$t(X,"DataView"),Qe=$t(X,"Promise"),Ye=$t(X,"Set"),vn="[object Map]",su="[object Object]",mn="[object Promise]",yn="[object Set]",bn="[object WeakMap]",_n="[object DataView]",iu=Ct(Ke),cu=Ct(Zt),uu=Ct(Qe),lu=Ct(Ye),fu=Ct(ze),ut=Et;(Ke&&ut(new Ke(new ArrayBuffer(1)))!=_n||Zt&&ut(new Zt)!=vn||Qe&&ut(Qe.resolve())!=mn||Ye&&ut(new Ye)!=yn||ze&&ut(new ze)!=bn)&&(ut=function(t){var e=Et(t),r=e==su?t.constructor:void 0,n=r?Ct(r):"";if(n)switch(n){case iu:return _n;case cu:return vn;case uu:return mn;case lu:return yn;case fu:return bn}return e});var ye=X.Uint8Array;function du(t){var e=new t.constructor(t.byteLength);return new ye(e).set(new ye(t)),e}function pu(t,e){var r=du(t.buffer);return new t.constructor(r,t.byteOffset,t.length)}function hu(t){return typeof t.constructor=="function"&&!yr(t)?As(No(t)):{}}var gu="__lodash_hash_undefined__";function vu(t){return this.__data__.set(t,gu),this}function mu(t){return this.__data__.has(t)}function be(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new Nt;++e<r;)this.add(t[e])}be.prototype.add=be.prototype.push=vu;be.prototype.has=mu;function yu(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 bu(t,e){return t.has(e)}var _u=1,Su=2;function Lo(t,e,r,n,o,a){var s=r&_u,i=t.length,c=e.length;if(i!=c&&!(s&&c>i))return!1;var u=a.get(t),d=a.get(e);if(u&&d)return u==e&&d==t;var l=-1,f=!0,h=r&Su?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(!yu(e,function(v,m){if(!bu(h,m)&&(g===v||o(g,v,r,n,a)))return h.push(m)})){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 Ou(t){var e=-1,r=Array(t.size);return t.forEach(function(n,o){r[++e]=[o,n]}),r}function Eu(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var wu=1,Cu=2,$u="[object Boolean]",Nu="[object Date]",ju="[object Error]",Au="[object Map]",xu="[object Number]",Tu="[object RegExp]",Ru="[object Set]",Pu="[object String]",Mu="[object Symbol]",Iu="[object ArrayBuffer]",Du="[object DataView]",Sn=lt?lt.prototype:void 0,De=Sn?Sn.valueOf:void 0;function Lu(t,e,r,n,o,a,s){switch(r){case Du:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Iu:return!(t.byteLength!=e.byteLength||!a(new ye(t),new ye(e)));case $u:case Nu:case xu:return ie(+t,+e);case ju:return t.name==e.name&&t.message==e.message;case Tu:case Pu:return t==e+"";case Au:var i=Ou;case Ru:var c=n&wu;if(i||(i=Eu),t.size!=e.size&&!c)return!1;var u=s.get(t);if(u)return u==e;n|=Cu,s.set(t,e);var d=Lo(i(t),i(e),n,o,a,s);return s.delete(t),d;case Mu:if(De)return De.call(t)==De.call(e)}return!1}var Fu=1,Vu=Object.prototype,Uu=Vu.hasOwnProperty;function Bu(t,e,r,n,o,a){var s=r&Fu,i=gn(t),c=i.length,u=gn(e),d=u.length;if(c!=d&&!s)return!1;for(var l=c;l--;){var f=i[l];if(!(s?f in e:Uu.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<c;){f=i[l];var v=t[f],m=e[f];if(n)var y=s?n(m,v,f,e,t,a):n(v,m,f,t,e,a);if(!(y===void 0?v===m||o(v,m,r,n,a):y)){b=!1;break}p||(p=f=="constructor")}if(b&&!p){var _=t.constructor,S=e.constructor;_!=S&&"constructor"in t&&"constructor"in e&&!(typeof _=="function"&&_ instanceof _&&typeof S=="function"&&S instanceof S)&&(b=!1)}return a.delete(t),a.delete(e),b}var Gu=1,On="[object Arguments]",En="[object Array]",de="[object Object]",ku=Object.prototype,wn=ku.hasOwnProperty;function Hu(t,e,r,n,o,a){var s=ot(t),i=ot(e),c=s?En:ut(t),u=i?En:ut(e);c=c==On?de:c,u=u==On?de:u;var d=c==de,l=u==de,f=c==u;if(f&&me(t)){if(!me(e))return!1;s=!0,d=!1}if(f&&!d)return a||(a=new nt),s||br(t)?Lo(t,e,r,n,o,a):Lu(t,e,c,r,n,o,a);if(!(r&Gu)){var h=d&&wn.call(t,"__wrapped__"),g=l&&wn.call(e,"__wrapped__");if(h||g){var b=h?t.value():t,p=g?e.value():e;return a||(a=new nt),o(b,p,r,n,a)}}return f?(a||(a=new nt),Bu(t,e,r,n,o,a)):!1}function Fo(t,e,r,n,o){return t===e?!0:t==null||e==null||!ft(t)&&!ft(e)?t!==t&&e!==e:Hu(t,e,r,n,Fo,o)}function zu(t){return function(e,r,n){for(var o=-1,a=Object(e),s=n(e),i=s.length;i--;){var c=s[++o];if(r(a[c],c,a)===!1)break}return e}}var qu=zu();function Xe(t,e,r){(r!==void 0&&!ie(t[e],r)||r===void 0&&!(e in t))&&mr(t,e,r)}function Ju(t){return ft(t)&&we(t)}function Ze(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Wu(t){return Hs(t,Co(t))}function Ku(t,e,r,n,o,a,s){var i=Ze(t,r),c=Ze(e,r),u=s.get(c);if(u){Xe(t,r,u);return}var d=a?a(i,c,r+"",t,e,s):void 0,l=d===void 0;if(l){var f=ot(c),h=!f&&me(c),g=!f&&!h&&br(c);d=c,f||h||g?ot(i)?d=i:Ju(i)?d=Ts(i):h?(l=!1,d=Zc(c)):g?(l=!1,d=pu(c)):d=[]:Ft(c)||qe(c)?(d=i,qe(i)?d=Wu(i):(!wt(i)||vr(i))&&(d=hu(c))):l=!1}l&&(s.set(c,d),o(d,c,n,a,s),s.delete(c)),Xe(t,r,d)}function Vo(t,e,r,n,o){t!==e&&qu(e,function(a,s){if(o||(o=new nt),wt(a))Ku(t,e,s,r,Vo,n,o);else{var i=n?n(Ze(t,s),a,s+"",t,e,o):void 0;i===void 0&&(i=a),Xe(t,s,i)}},Co)}function Qu(t,e){return Fo(t,e)}var Yu=Ks(function(t,e,r){Vo(t,e,r)});const Cn=(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) {
|
|
@@ -17,7 +17,7 @@ ${e.keyListVar}.forEach(function (key) {
|
|
|
17
17
|
var __extraParams = $$$__args__$$$.pop();
|
|
18
18
|
var __$$storeManager__ = __extraParams.storeManager;
|
|
19
19
|
var $ALL_NODE_IDS = Array.from(__$$storeManager__.storeMap.keys().filter(Boolean));;
|
|
20
|
-
var $RESPONSE = __extraParams.$$
|
|
20
|
+
var $RESPONSE = __extraParams.$$response;;
|
|
21
21
|
var $CTX = __extraParams.$$context;
|
|
22
22
|
var $$context = $CTX;
|
|
23
23
|
var $PARAMS = $$context.params || {};
|
|
@@ -52,12 +52,12 @@ ${Cn("$U_STATE",{keyListVar:"$ALL_NODE_IDS ",getReadValCode:"return function (ne
|
|
|
52
52
|
return $$_f_$$.apply($$_f_$$, $$$__args__$$$);
|
|
53
53
|
}
|
|
54
54
|
return $$_run_$$();
|
|
55
|
-
`,new Function(l)(...d,{$$context:n,storeManager:o,$$response:a,actionVariableSpace:i,nodeModel:s})}catch(g){console.warn(g)}}}[c]},_r=(t,e)=>{const r={};return e.forEach((n,o)=>{r[n]=t[o]}),r},ko=(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?zc(s):s)),e[a.join("")]=n}),e},Zu=t=>{let e="";return Object.keys(t||{}).forEach(r=>{e+=`${r}:${t[r]};`}),e},tl=(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},el=(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},Ho=(t,e)=>{const r=[];return e.forEach(n=>{const a=n.exec(t);a!=null&&a.length&&r.push(a[1])}),r},zo=(t,e)=>{const r={};return e.forEach(n=>{t[n.name]&&(r[n.name]=t[n.name])}),r},rl=(t,e)=>zo(t,e),nl=(t,e)=>zo(t,e),tr=t=>{var r;return((r=t.value.css)==null?void 0:r.class)||`c_${t.id}`},qo=(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`)},er=(t,e)=>{const r={...t};return r.__proto__=e,r},ol={},$n=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,c={setState:n,getState:o,getInitialState:()=>u,subscribe:d=>(r.add(d),()=>r.delete(d)),destroy:()=>{(ol?"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()}},u=e=t(n,o,c);return c},al=t=>t?$n(t):$n;class sl{constructor(){w(this,"storeMap",new Map)}addStore(e,r){const n=al(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 il{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 Sr{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 cl=Object.defineProperty,ul=(t,e,r)=>e in t?cl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,$=(t,e,r)=>ul(t,typeof e!="symbol"?e+"":e,r),Jo=typeof global=="object"&&global&&global.Object===Object&&global,ll=typeof self=="object"&&self&&self.Object===Object&&self,Z=Jo||ll||Function("return this")(),q=Z.Symbol,Wo=Object.prototype,fl=Wo.hasOwnProperty,dl=Wo.toString,qt=q?q.toStringTag:void 0;function pl(t){var e=fl.call(t,qt),r=t[qt];try{t[qt]=void 0;var n=!0}catch{}var o=dl.call(t);return n&&(e?t[qt]=r:delete t[qt]),o}var hl=Object.prototype,gl=hl.toString;function vl(t){return gl.call(t)}var ml="[object Null]",yl="[object Undefined]",Nn=q?q.toStringTag:void 0;function jt(t){return t==null?t===void 0?yl:ml:Nn&&Nn in Object(t)?pl(t):vl(t)}function Y(t){return t!=null&&typeof t=="object"}var bl="[object Symbol]";function Or(t){return typeof t=="symbol"||Y(t)&&jt(t)==bl}function Er(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 L=Array.isArray,jn=q?q.prototype:void 0,xn=jn?jn.toString:void 0;function Ko(t){if(typeof t=="string")return t;if(L(t))return Er(t,Ko)+"";if(Or(t))return xn?xn.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function Q(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function wr(t){return t}var _l="[object AsyncFunction]",Sl="[object Function]",Ol="[object GeneratorFunction]",El="[object Proxy]";function Cr(t){if(!Q(t))return!1;var e=jt(t);return e==Sl||e==Ol||e==_l||e==El}var Le=Z["__core-js_shared__"],An=function(){var t=/[^.]+$/.exec(Le&&Le.keys&&Le.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function wl(t){return!!An&&An in t}var Cl=Function.prototype,$l=Cl.toString;function xt(t){if(t!=null){try{return $l.call(t)}catch{}try{return t+""}catch{}}return""}var Nl=/[\\^$.*+?()[\]{}|]/g,jl=/^\[object .+?Constructor\]$/,xl=Function.prototype,Al=Object.prototype,Tl=xl.toString,Rl=Al.hasOwnProperty,Pl=RegExp("^"+Tl.call(Rl).replace(Nl,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ml(t){if(!Q(t)||wl(t))return!1;var e=Cr(t)?Pl:jl;return e.test(xt(t))}function Il(t,e){return t==null?void 0:t[e]}function At(t,e){var r=Il(t,e);return Ml(r)?r:void 0}var rr=At(Z,"WeakMap"),Tn=Object.create,Dl=function(){function t(){}return function(e){if(!Q(e))return{};if(Tn)return Tn(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function Ll(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 Fl(){}function Qo(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var Vl=800,Ul=16,Bl=Date.now;function Gl(t){var e=0,r=0;return function(){var n=Bl(),o=Ul-(n-r);if(r=n,o>0){if(++e>=Vl)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function kl(t){return function(){return t}}var _e=function(){try{var t=At(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Hl=_e?function(t,e){return _e(t,"toString",{configurable:!0,enumerable:!1,value:kl(e),writable:!0})}:wr,Yo=Gl(Hl);function zl(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}function ql(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 Jl(t){return t!==t}function Wl(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?Wl(t,e,r):ql(t,Jl,r)}function Ql(t,e){var r=t==null?0:t.length;return!!r&&Kl(t,e,0)>-1}var Yl=9007199254740991,Xl=/^(?:0|[1-9]\d*)$/;function Ne(t,e){var r=typeof t;return e=e??Yl,!!e&&(r=="number"||r!="symbol"&&Xl.test(t))&&t>-1&&t%1==0&&t<e}function $r(t,e,r){e=="__proto__"&&_e?_e(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function ce(t,e){return t===e||t!==t&&e!==e}var Zl=Object.prototype,tf=Zl.hasOwnProperty;function Nr(t,e,r){var n=t[e];(!(tf.call(t,e)&&ce(n,r))||r===void 0&&!(e in t))&&$r(t,e,r)}function Ut(t,e,r,n){var o=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var i=e[a],c=void 0;c===void 0&&(c=t[i]),o?$r(r,i,c):Nr(r,i,c)}return r}var Rn=Math.max;function Xo(t,e,r){return e=Rn(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=Rn(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),Ll(t,this,i)}}function Zo(t,e){return Yo(Xo(t,e,wr),t+"")}var ef=9007199254740991;function jr(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ef}function je(t){return t!=null&&jr(t.length)&&!Cr(t)}function rf(t,e,r){if(!Q(r))return!1;var n=typeof e;return(n=="number"?je(r)&&Ne(e,r.length):n=="string"&&e in r)?ce(r[e],t):!1}function nf(t){return Zo(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&&rf(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 of=Object.prototype;function xr(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||of;return t===r}function af(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var sf="[object Arguments]";function Pn(t){return Y(t)&&jt(t)==sf}var ta=Object.prototype,cf=ta.hasOwnProperty,uf=ta.propertyIsEnumerable,te=Pn(function(){return arguments}())?Pn:function(t){return Y(t)&&cf.call(t,"callee")&&!uf.call(t,"callee")};function lf(){return!1}var ea=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Mn=ea&&typeof module=="object"&&module&&!module.nodeType&&module,ff=Mn&&Mn.exports===ea,In=ff?Z.Buffer:void 0,df=In?In.isBuffer:void 0,ee=df||lf,pf="[object Arguments]",hf="[object Array]",gf="[object Boolean]",vf="[object Date]",mf="[object Error]",yf="[object Function]",bf="[object Map]",_f="[object Number]",Sf="[object Object]",Of="[object RegExp]",Ef="[object Set]",wf="[object String]",Cf="[object WeakMap]",$f="[object ArrayBuffer]",Nf="[object DataView]",jf="[object Float32Array]",xf="[object Float64Array]",Af="[object Int8Array]",Tf="[object Int16Array]",Rf="[object Int32Array]",Pf="[object Uint8Array]",Mf="[object Uint8ClampedArray]",If="[object Uint16Array]",Df="[object Uint32Array]",M={};M[jf]=M[xf]=M[Af]=M[Tf]=M[Rf]=M[Pf]=M[Mf]=M[If]=M[Df]=!0;M[pf]=M[hf]=M[$f]=M[gf]=M[Nf]=M[vf]=M[mf]=M[yf]=M[bf]=M[_f]=M[Sf]=M[Of]=M[Ef]=M[wf]=M[Cf]=!1;function Lf(t){return Y(t)&&jr(t.length)&&!!M[jt(t)]}function Ar(t){return function(e){return t(e)}}var ra=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Kt=ra&&typeof module=="object"&&module&&!module.nodeType&&module,Ff=Kt&&Kt.exports===ra,Fe=Ff&&Jo.process,Pt=function(){try{var t=Kt&&Kt.require&&Kt.require("util").types;return t||Fe&&Fe.binding&&Fe.binding("util")}catch{}}(),Dn=Pt&&Pt.isTypedArray,Tr=Dn?Ar(Dn):Lf,Vf=Object.prototype,Uf=Vf.hasOwnProperty;function na(t,e){var r=L(t),n=!r&&te(t),o=!r&&!n&&ee(t),a=!r&&!n&&!o&&Tr(t),s=r||n||o||a,i=s?af(t.length,String):[],c=i.length;for(var u in t)(e||Uf.call(t,u))&&!(s&&(u=="length"||o&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Ne(u,c)))&&i.push(u);return i}function oa(t,e){return function(r){return t(e(r))}}var Bf=oa(Object.keys,Object),Gf=Object.prototype,kf=Gf.hasOwnProperty;function Hf(t){if(!xr(t))return Bf(t);var e=[];for(var r in Object(t))kf.call(t,r)&&r!="constructor"&&e.push(r);return e}function xe(t){return je(t)?na(t):Hf(t)}function zf(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var qf=Object.prototype,Jf=qf.hasOwnProperty;function Wf(t){if(!Q(t))return zf(t);var e=xr(t),r=[];for(var n in t)n=="constructor"&&(e||!Jf.call(t,n))||r.push(n);return r}function ue(t){return je(t)?na(t,!0):Wf(t)}var Kf=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Qf=/^\w*$/;function Rr(t,e){if(L(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Or(t)?!0:Qf.test(t)||!Kf.test(t)||e!=null&&t in Object(e)}var re=At(Object,"create");function Yf(){this.__data__=re?re(null):{},this.size=0}function Xf(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Zf="__lodash_hash_undefined__",td=Object.prototype,ed=td.hasOwnProperty;function rd(t){var e=this.__data__;if(re){var r=e[t];return r===Zf?void 0:r}return ed.call(e,t)?e[t]:void 0}var nd=Object.prototype,od=nd.hasOwnProperty;function ad(t){var e=this.__data__;return re?e[t]!==void 0:od.call(e,t)}var sd="__lodash_hash_undefined__";function id(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=re&&e===void 0?sd: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=Yf;St.prototype.delete=Xf;St.prototype.get=rd;St.prototype.has=ad;St.prototype.set=id;function cd(){this.__data__=[],this.size=0}function Ae(t,e){for(var r=t.length;r--;)if(ce(t[r][0],e))return r;return-1}var ud=Array.prototype,ld=ud.splice;function fd(t){var e=this.__data__,r=Ae(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():ld.call(e,r,1),--this.size,!0}function dd(t){var e=this.__data__,r=Ae(e,t);return r<0?void 0:e[r][1]}function pd(t){return Ae(this.__data__,t)>-1}function hd(t,e){var r=this.__data__,n=Ae(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=cd;st.prototype.delete=fd;st.prototype.get=dd;st.prototype.has=pd;st.prototype.set=hd;var ne=At(Z,"Map");function gd(){this.size=0,this.__data__={hash:new St,map:new(ne||st),string:new St}}function vd(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Te(t,e){var r=t.__data__;return vd(e)?r[typeof e=="string"?"string":"hash"]:r.map}function md(t){var e=Te(this,t).delete(t);return this.size-=e?1:0,e}function yd(t){return Te(this,t).get(t)}function bd(t){return Te(this,t).has(t)}function _d(t,e){var r=Te(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=gd;it.prototype.delete=md;it.prototype.get=yd;it.prototype.has=bd;it.prototype.set=_d;var Sd="Expected a function";function Pr(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Sd);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(Pr.Cache||it),r}Pr.Cache=it;var Od=500;function Ed(t){var e=Pr(t,function(n){return r.size===Od&&r.clear(),n}),r=e.cache;return e}var wd=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Cd=/\\(\\)?/g,$d=Ed(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(wd,function(r,n,o,a){e.push(o?a.replace(Cd,"$1"):n||r)}),e});function Nd(t){return t==null?"":Ko(t)}function Bt(t,e){return L(t)?t:Rr(t,e)?[t]:$d(Nd(t))}function Gt(t){if(typeof t=="string"||Or(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function Re(t,e){e=Bt(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Gt(e[r++])];return r&&r==n?t:void 0}function aa(t,e,r){var n=t==null?void 0:Re(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 Ln=q?q.isConcatSpreadable:void 0;function jd(t){return L(t)||te(t)||!!(Ln&&t&&t[Ln])}function sa(t,e,r,n,o){var a=-1,s=t.length;for(r||(r=jd),o||(o=[]);++a<s;){var i=t[a];r(i)?Mr(o,i):n||(o[o.length]=i)}return o}function xd(t){var e=t==null?0:t.length;return e?sa(t):[]}function Ad(t){return Yo(Xo(t,void 0,xd),t+"")}var Ir=oa(Object.getPrototypeOf,Object),Td="[object Object]",Rd=Function.prototype,Pd=Object.prototype,ia=Rd.toString,Md=Pd.hasOwnProperty,Id=ia.call(Object);function U(t){if(!Y(t)||jt(t)!=Td)return!1;var e=Ir(t);if(e===null)return!0;var r=Md.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&ia.call(r)==Id}function Dd(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 Ld(){this.__data__=new st,this.size=0}function Fd(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function Vd(t){return this.__data__.get(t)}function Ud(t){return this.__data__.has(t)}var Bd=200;function Gd(t,e){var r=this.__data__;if(r instanceof st){var n=r.__data__;if(!ne||n.length<Bd-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=Ld;W.prototype.delete=Fd;W.prototype.get=Vd;W.prototype.has=Ud;W.prototype.set=Gd;function kd(t,e){return t&&Ut(e,xe(e),t)}function Hd(t,e){return t&&Ut(e,ue(e),t)}var ca=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Fn=ca&&typeof module=="object"&&module&&!module.nodeType&&module,zd=Fn&&Fn.exports===ca,Vn=zd?Z.Buffer:void 0,Un=Vn?Vn.allocUnsafe:void 0;function ua(t,e){if(e)return t.slice();var r=t.length,n=Un?Un(r):new t.constructor(r);return t.copy(n),n}function qd(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 la(){return[]}var Jd=Object.prototype,Wd=Jd.propertyIsEnumerable,Bn=Object.getOwnPropertySymbols,Dr=Bn?function(t){return t==null?[]:(t=Object(t),qd(Bn(t),function(e){return Wd.call(t,e)}))}:la;function Kd(t,e){return Ut(t,Dr(t),e)}var Qd=Object.getOwnPropertySymbols,fa=Qd?function(t){for(var e=[];t;)Mr(e,Dr(t)),t=Ir(t);return e}:la;function Yd(t,e){return Ut(t,fa(t),e)}function da(t,e,r){var n=e(t);return L(t)?n:Mr(n,r(t))}function nr(t){return da(t,xe,Dr)}function Lr(t){return da(t,ue,fa)}var or=At(Z,"DataView"),ar=At(Z,"Promise"),Tt=At(Z,"Set"),Gn="[object Map]",Xd="[object Object]",kn="[object Promise]",Hn="[object Set]",zn="[object WeakMap]",qn="[object DataView]",Zd=xt(or),tp=xt(ne),ep=xt(ar),rp=xt(Tt),np=xt(rr),J=jt;(or&&J(new or(new ArrayBuffer(1)))!=qn||ne&&J(new ne)!=Gn||ar&&J(ar.resolve())!=kn||Tt&&J(new Tt)!=Hn||rr&&J(new rr)!=zn)&&(J=function(t){var e=jt(t),r=e==Xd?t.constructor:void 0,n=r?xt(r):"";if(n)switch(n){case Zd:return qn;case tp:return Gn;case ep:return kn;case rp:return Hn;case np:return zn}return e});var op=Object.prototype,ap=op.hasOwnProperty;function sp(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&ap.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var Se=Z.Uint8Array;function Fr(t){var e=new t.constructor(t.byteLength);return new Se(e).set(new Se(t)),e}function ip(t,e){var r=e?Fr(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var cp=/\w*$/;function up(t){var e=new t.constructor(t.source,cp.exec(t));return e.lastIndex=t.lastIndex,e}var Jn=q?q.prototype:void 0,Wn=Jn?Jn.valueOf:void 0;function lp(t){return Wn?Object(Wn.call(t)):{}}function pa(t,e){var r=e?Fr(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var fp="[object Boolean]",dp="[object Date]",pp="[object Map]",hp="[object Number]",gp="[object RegExp]",vp="[object Set]",mp="[object String]",yp="[object Symbol]",bp="[object ArrayBuffer]",_p="[object DataView]",Sp="[object Float32Array]",Op="[object Float64Array]",Ep="[object Int8Array]",wp="[object Int16Array]",Cp="[object Int32Array]",$p="[object Uint8Array]",Np="[object Uint8ClampedArray]",jp="[object Uint16Array]",xp="[object Uint32Array]";function Ap(t,e,r){var n=t.constructor;switch(e){case bp:return Fr(t);case fp:case dp:return new n(+t);case _p:return ip(t,r);case Sp:case Op:case Ep:case wp:case Cp:case $p:case Np:case jp:case xp:return pa(t,r);case pp:return new n;case hp:case mp:return new n(t);case gp:return up(t);case vp:return new n;case yp:return lp(t)}}function ha(t){return typeof t.constructor=="function"&&!xr(t)?Dl(Ir(t)):{}}var Tp="[object Map]";function Rp(t){return Y(t)&&J(t)==Tp}var Kn=Pt&&Pt.isMap,Pp=Kn?Ar(Kn):Rp,Mp="[object Set]";function Ip(t){return Y(t)&&J(t)==Mp}var Qn=Pt&&Pt.isSet,Dp=Qn?Ar(Qn):Ip,Lp=1,Fp=2,Vp=4,ga="[object Arguments]",Up="[object Array]",Bp="[object Boolean]",Gp="[object Date]",kp="[object Error]",va="[object Function]",Hp="[object GeneratorFunction]",zp="[object Map]",qp="[object Number]",ma="[object Object]",Jp="[object RegExp]",Wp="[object Set]",Kp="[object String]",Qp="[object Symbol]",Yp="[object WeakMap]",Xp="[object ArrayBuffer]",Zp="[object DataView]",th="[object Float32Array]",eh="[object Float64Array]",rh="[object Int8Array]",nh="[object Int16Array]",oh="[object Int32Array]",ah="[object Uint8Array]",sh="[object Uint8ClampedArray]",ih="[object Uint16Array]",ch="[object Uint32Array]",R={};R[ga]=R[Up]=R[Xp]=R[Zp]=R[Bp]=R[Gp]=R[th]=R[eh]=R[rh]=R[nh]=R[oh]=R[zp]=R[qp]=R[ma]=R[Jp]=R[Wp]=R[Kp]=R[Qp]=R[ah]=R[sh]=R[ih]=R[ch]=!0;R[kp]=R[va]=R[Yp]=!1;function Qt(t,e,r,n,o,a){var s,i=e&Lp,c=e&Fp,u=e&Vp;if(r&&(s=o?r(t,n,o,a):r(t)),s!==void 0)return s;if(!Q(t))return t;var d=L(t);if(d){if(s=sp(t),!i)return Qo(t,s)}else{var l=J(t),f=l==va||l==Hp;if(ee(t))return ua(t,i);if(l==ma||l==ga||f&&!o){if(s=c||f?{}:ha(t),!i)return c?Yd(t,Hd(s,t)):Kd(t,kd(s,t))}else{if(!R[l])return o?t:{};s=Ap(t,l,i)}}a||(a=new W);var h=a.get(t);if(h)return h;a.set(t,s),Dp(t)?t.forEach(function(p){s.add(Qt(p,e,r,p,t,a))}):Pp(t)&&t.forEach(function(p,v){s.set(v,Qt(p,e,r,v,t,a))});var g=u?c?Lr:nr:c?ue:xe,b=d?void 0:g(t);return zl(b||t,function(p,v){b&&(v=p,p=t[v]),Nr(s,v,Qt(p,e,r,v,t,a))}),s}var uh=1,lh=4;function ya(t){return Qt(t,uh|lh)}var fh="__lodash_hash_undefined__";function dh(t){return this.__data__.set(t,fh),this}function ph(t){return this.__data__.has(t)}function oe(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new it;++e<r;)this.add(t[e])}oe.prototype.add=oe.prototype.push=dh;oe.prototype.has=ph;function hh(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 ba(t,e){return t.has(e)}var gh=1,vh=2;function _a(t,e,r,n,o,a){var s=r&gh,i=t.length,c=e.length;if(i!=c&&!(s&&c>i))return!1;var u=a.get(t),d=a.get(e);if(u&&d)return u==e&&d==t;var l=-1,f=!0,h=r&vh?new oe: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(!hh(e,function(v,m){if(!ba(h,m)&&(g===v||o(g,v,r,n,a)))return h.push(m)})){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 mh(t){var e=-1,r=Array(t.size);return t.forEach(function(n,o){r[++e]=[o,n]}),r}function Vr(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var yh=1,bh=2,_h="[object Boolean]",Sh="[object Date]",Oh="[object Error]",Eh="[object Map]",wh="[object Number]",Ch="[object RegExp]",$h="[object Set]",Nh="[object String]",jh="[object Symbol]",xh="[object ArrayBuffer]",Ah="[object DataView]",Yn=q?q.prototype:void 0,Ve=Yn?Yn.valueOf:void 0;function Th(t,e,r,n,o,a,s){switch(r){case Ah:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case xh:return!(t.byteLength!=e.byteLength||!a(new Se(t),new Se(e)));case _h:case Sh:case wh:return ce(+t,+e);case Oh:return t.name==e.name&&t.message==e.message;case Ch:case Nh:return t==e+"";case Eh:var i=mh;case $h:var c=n&yh;if(i||(i=Vr),t.size!=e.size&&!c)return!1;var u=s.get(t);if(u)return u==e;n|=bh,s.set(t,e);var d=_a(i(t),i(e),n,o,a,s);return s.delete(t),d;case jh:if(Ve)return Ve.call(t)==Ve.call(e)}return!1}var Rh=1,Ph=Object.prototype,Mh=Ph.hasOwnProperty;function Ih(t,e,r,n,o,a){var s=r&Rh,i=nr(t),c=i.length,u=nr(e),d=u.length;if(c!=d&&!s)return!1;for(var l=c;l--;){var f=i[l];if(!(s?f in e:Mh.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<c;){f=i[l];var v=t[f],m=e[f];if(n)var y=s?n(m,v,f,e,t,a):n(v,m,f,t,e,a);if(!(y===void 0?v===m||o(v,m,r,n,a):y)){b=!1;break}p||(p=f=="constructor")}if(b&&!p){var _=t.constructor,S=e.constructor;_!=S&&"constructor"in t&&"constructor"in e&&!(typeof _=="function"&&_ instanceof _&&typeof S=="function"&&S instanceof S)&&(b=!1)}return a.delete(t),a.delete(e),b}var Dh=1,Xn="[object Arguments]",Zn="[object Array]",pe="[object Object]",Lh=Object.prototype,to=Lh.hasOwnProperty;function Fh(t,e,r,n,o,a){var s=L(t),i=L(e),c=s?Zn:J(t),u=i?Zn:J(e);c=c==Xn?pe:c,u=u==Xn?pe:u;var d=c==pe,l=u==pe,f=c==u;if(f&&ee(t)){if(!ee(e))return!1;s=!0,d=!1}if(f&&!d)return a||(a=new W),s||Tr(t)?_a(t,e,r,n,o,a):Th(t,e,c,r,n,o,a);if(!(r&Dh)){var h=d&&to.call(t,"__wrapped__"),g=l&&to.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),Ih(t,e,r,n,o,a)):!1}function Ur(t,e,r,n,o){return t===e?!0:t==null||e==null||!Y(t)&&!Y(e)?t!==t&&e!==e:Fh(t,e,r,n,Ur,o)}var Vh=1,Uh=2;function Bh(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],c=t[i],u=s[1];if(s[2]){if(c===void 0&&!(i in t))return!1}else{var d=new W,l;if(!(l===void 0?Ur(u,c,Vh|Uh,n,d):l))return!1}}return!0}function Sa(t){return t===t&&!Q(t)}function Gh(t){for(var e=xe(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,Sa(o)]}return e}function Oa(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function kh(t){var e=Gh(t);return e.length==1&&e[0][2]?Oa(e[0][0],e[0][1]):function(r){return r===t||Bh(r,t,e)}}function Hh(t,e){return t!=null&&e in Object(t)}function zh(t,e,r){e=Bt(e,t);for(var n=-1,o=e.length,a=!1;++n<o;){var s=Gt(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&&jr(o)&&Ne(s,o)&&(L(t)||te(t)))}function qh(t,e){return t!=null&&zh(t,e,Hh)}var Jh=1,Wh=2;function Kh(t,e){return Rr(t)&&Sa(e)?Oa(Gt(t),e):function(r){var n=aa(r,t);return n===void 0&&n===e?qh(r,t):Ur(e,n,Jh|Wh)}}function Qh(t){return function(e){return e==null?void 0:e[t]}}function Yh(t){return function(e){return Re(e,t)}}function Xh(t){return Rr(t)?Qh(Gt(t)):Yh(t)}function Br(t){return typeof t=="function"?t:t==null?wr:typeof t=="object"?L(t)?Kh(t[0],t[1]):kh(t):Xh(t)}function Zh(t){return function(e,r,n){for(var o=-1,a=Object(e),s=n(e),i=s.length;i--;){var c=s[++o];if(r(a[c],c,a)===!1)break}return e}}var tg=Zh();function sr(t,e,r){(r!==void 0&&!ce(t[e],r)||r===void 0&&!(e in t))&&$r(t,e,r)}function ir(t){return Y(t)&&je(t)}function cr(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function eg(t){return Ut(t,ue(t))}function rg(t,e,r,n,o,a,s){var i=cr(t,r),c=cr(e,r),u=s.get(c);if(u){sr(t,r,u);return}var d=a?a(i,c,r+"",t,e,s):void 0,l=d===void 0;if(l){var f=L(c),h=!f&&ee(c),g=!f&&!h&&Tr(c);d=c,f||h||g?L(i)?d=i:ir(i)?d=Qo(i):h?(l=!1,d=ua(c,!0)):g?(l=!1,d=pa(c,!0)):d=[]:U(c)||te(c)?(d=i,te(i)?d=eg(i):(!Q(i)||Cr(i))&&(d=ha(c))):l=!1}l&&(s.set(c,d),o(d,c,n,a,s),s.delete(c)),sr(t,r,d)}function Ea(t,e,r,n,o){t!==e&&tg(e,function(a,s){if(o||(o=new W),Q(a))rg(t,e,s,r,Ea,n,o);else{var i=n?n(cr(t,s),a,s+"",t,e,o):void 0;i===void 0&&(i=a),sr(t,s,i)}},ue)}function wa(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function ng(t,e){return e.length<2?t:Re(t,Dd(e,0,-1))}var Ca=nf(function(t,e,r){Ea(t,e,r)}),og="Expected a function";function ag(t){if(typeof t!="function")throw new TypeError(og);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 sg(t,e){return e=Bt(e,t),t=ng(t,e),t==null||delete t[Gt(wa(e))]}function ig(t){return U(t)?void 0:t}var cg=1,ug=2,lg=4,$a=Ad(function(t,e){var r={};if(t==null)return r;var n=!1;e=Er(e,function(a){return a=Bt(a,t),n||(n=a.length>1),a}),Ut(t,Lr(t),r),n&&(r=Qt(r,cg|ug|lg,ig));for(var o=e.length;o--;)sg(r,e[o]);return r});function fg(t,e,r,n){if(!Q(t))return t;e=Bt(e,t);for(var o=-1,a=e.length,s=a-1,i=t;i!=null&&++o<a;){var c=Gt(e[o]),u=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(o!=s){var d=i[c];u=void 0,u===void 0&&(u=Q(d)?d:Ne(e[o+1])?[]:{})}Nr(i,c,u),i=i[c]}return t}function dg(t,e,r){for(var n=-1,o=e.length,a={};++n<o;){var s=e[n],i=Re(t,s);r(i,s)&&fg(a,Bt(s,t),i)}return a}function pg(t,e){if(t==null)return{};var r=Er(Lr(t),function(n){return[n]});return e=Br(e),dg(t,r,function(n,o){return e(n,o[0])})}function hg(t,e){return pg(t,ag(Br(e)))}var gg=1/0,vg=Tt&&1/Vr(new Tt([,-0]))[1]==gg?function(t){return new Tt(t)}:Fl,mg=200;function yg(t,e,r){var n=-1,o=Ql,a=t.length,s=!0,i=[],c=i;if(a>=mg){var u=e?null:vg(t);if(u)return Vr(u);s=!1,o=ba,c=new oe}else c=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=c.length;f--;)if(c[f]===l)continue t;e&&c.push(l),i.push(d)}else o(c,l,r)||(c!==i&&c.push(l),i.push(d))}return i}var bg=Zo(function(t){var e=wa(t);return ir(e)&&(e=void 0),yg(sa(t,1,ir,!0),Br(e))});class Na 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 _g(t){return K(t)&&typeof t[Symbol.iterator]=="function"}function K(t){return typeof t=="object"&&t!=null}function H(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function Sg(t){const{done:e,value:r}=t.next();return e?void 0:r}function Og(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:c=`Expected a value of type \`${s}\`${i?` with refinement \`${i}\``:""}, but received: \`${H(n)}\``}=t;return{value:n,type:s,refinement:i,key:o[o.length-1],path:o,branch:a,...t,message:c}}function*eo(t,e,r,n){_g(t)||(t=[t]);for(const o of t){const a=Og(o,e,r,n);a&&(yield a)}}function*Gr(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"&&K(e.schema)&&K(t)&&!Array.isArray(t)))for(const u in t)e.schema[u]===void 0&&delete t[u];let c="valid";for(const u of e.validator(t,i))c="not_valid",yield[u,void 0];for(let[u,d,l]of e.entries(t,i)){const f=Gr(d,l,{path:u===void 0?n:[...n,u],branch:u===void 0?o:[...o,d],coerce:a,mask:s});for(const h of f)h[0]?(c=h[0].refinement!=null?"not_refined":"not_valid",yield[h[0],void 0]):a&&(d=h[1],u===void 0?t=d:t instanceof Map?t.set(u,d):t instanceof Set?t.add(d):K(t)&&(d!==void 0||u in t)&&(t[u]=d))}if(c!=="not_valid")for(const u of e.refiner(t,i))c="not_refined",yield[u,void 0];c==="valid"&&(yield[void 0,t])}class tt{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=c=>c,entries:i=function*(){}}=e;this.type=r,this.schema=n,this.entries=i,this.coercer=s,o?this.validator=(c,u)=>{const d=o(c,u);return eo(d,u,this,c)}:this.validator=()=>[],a?this.refiner=(c,u)=>{const d=a(c,u);return eo(d,u,this,c)}:this.refiner=()=>[]}assert(e){return ja(e,this)}create(e){return Eg(e,this)}is(e){return Cg(e,this)}mask(e){return wg(e,this)}validate(e,r){return r===void 0&&(r={}),kt(e,this,r)}}function ja(t,e){const r=kt(t,e);if(r[0])throw r[0]}function Eg(t,e){const r=kt(t,e,{coerce:!0});if(r[0])throw r[0];return r[1]}function wg(t,e){const r=kt(t,e,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}function Cg(t,e){return!kt(t,e)[0]}function kt(t,e,r){r===void 0&&(r={});const n=Gr(t,e,r),o=Sg(n);return o[0]?[new Na(o[0],function*(){for(const a of n)a[0]&&(yield a[0])}),void 0]:[void 0,o[1]]}function kr(){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?Ra(a):A(a)}function pt(t,e){return new tt({type:t,schema:null,validator:e})}function Mt(t){return new tt({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 xa(t,e){const{schema:r}=t,n={...r};for(const o of e)delete n[o];switch(t.type){case"type":return Ra(n);default:return A(n)}}function T(){return pt("any",()=>!0)}function I(t){return new tt({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: ${H(e)}`}})}function Ot(){return pt("boolean",t=>typeof t=="boolean")}function ur(t){const e={},r=t.map(n=>H(n)).join();for(const n of t)e[n]=n;return new tt({type:"enums",schema:e,validator(n){return t.includes(n)||`Expected one of \`${r}\`, but received: ${H(n)}`}})}function Aa(){return pt("func",t=>typeof t=="function"||`Expected a function, but received: ${H(t)}`)}function G(t){const e=H(t),r=typeof t;return new tt({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||`Expected the literal \`${e}\`, but received: ${H(n)}`}})}function $g(){return pt("never",()=>!1)}function Ta(){return pt("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${H(t)}`)}function A(t){const e=t?Object.keys(t):[],r=$g();return new tt({type:"object",schema:t||null,*entries(n){if(t&&K(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 K(n)||`Expected an object, but received: ${H(n)}`},coercer(n){return K(n)?{...n}:n}})}function O(t){return new tt({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function Yt(t,e){return new tt({type:"record",schema:null,*entries(r){if(K(r))for(const n in r){const o=r[n];yield[n,n,t],yield[n,o,e]}},validator(r){return K(r)||`Expected an object, but received: ${H(r)}`}})}function E(){return pt("string",t=>typeof t=="string"||`Expected a string, but received: ${H(t)}`)}function Ra(t){const e=Object.keys(t);return new tt({type:"type",schema:t,*entries(r){if(K(r))for(const n of e)yield[n,r[n],t[n]]},validator(r){return K(r)||`Expected an object, but received: ${H(r)}`}})}function k(t){const e=t.map(r=>r.type).join(" | ");return new tt({type:"union",schema:null,coercer(r,n){return(t.find(o=>{const[a]=o.validate(r,{coerce:!0});return!a})||Ng()).coercer(r,n)},validator(r,n){const o=[];for(const a of t){const[...s]=Gr(r,a,n),[i]=s;if(i[0])for(const[c]of s)c&&o.push(c);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${H(r)}`,...o]}})}function Ng(){return pt("unknown",()=>!0)}const Hr=A({package:E(),version:E(),name:E(),exportName:O(E()),destructuring:O(Ot()),subName:O(E()),main:O(E()),cssPaths:O(I(E()))}),jg=I(Hr);var V=(t=>(t.SLOT="SLOT",t.FUNCTION="FUNCTION",t.EXPRESSION="EXPRESSION",t.ACTION="ACTION",t.EVENT="EVENT",t))(V||{}),zr=(t=>(t.DESIGN="design",t.SAVE="save",t))(zr||{}),lr=(t=>(t.FUNC="FUNC",t.COMP="COMP",t))(lr||{});const xg=()=>pt("normalObj",t=>!U(t)||[V.SLOT,V.EXPRESSION,V.FUNCTION].includes(t==null?void 0:t.type)?!1:(kt(t,Yt(E(),qr)),!0)),qr=k([E(),Ta(),Ot(),A({type:G(V.SLOT),renderType:ur([lr.FUNC,lr.COMP]),params:O(I(E())),value:Mt(()=>k([It,I(It)]))}),A({type:G(V.EXPRESSION),value:E()}),A({type:G(V.FUNCTION),value:E()}),A({type:G(V.ACTION),handler:T()}),xg(),I(Mt(()=>qr))]);var Pa=(t=>(t.COMPONENTS="COMPONENTS",t))(Pa||{});const ro=A({type:G(V.EXPRESSION),value:E()}),It=A({id:O(E()),title:O(E()),componentName:E(),props:O(Yt(E(),qr)),nodeName:O(E()),state:O(Yt(E(),T())),children:Mt(()=>O(I(k([E(),It])))),eventListener:O(I(T())),configure:O(T()),css:O(T()),style:O(T()),classNames:O(I(T())),refId:O(E()),extra:O(Yt(T(),T())),condition:O(k([Ot(),ro])),loop:O(A({open:Ot(),data:k([I(T()),ro]),args:O(I(E())),forName:O(E()),forIndex:O(E()),key:O(T()),name:O(E())})),injectEnvList:O(I(T())),methods:O(I(T()))}),Oe=k([E(),A({label:E(),tip:O(E())})]),Ag=A({type:G("shape"),value:I(A({name:E(),title:Oe,valueType:Mt(()=>Pe)}))}),Tg=A({type:G("enums"),value:I(E())});A({type:G("array"),value:Mt(()=>Pe)});const Rg=A({type:G("array"),value:Mt(()=>I(Pe))}),Pe=k([ur(["array","boolean","number","object","string"]),ur(["component","expression","function"]),Ag,Tg,Rg]),Pg=k([E(),A({componentName:E(),props:O(T()),initialValue:O(T()),component:O(T()),hiddenLabel:O(Ot())})]),Ue=A({name:E(),title:Oe,valueType:Pe,description:O(E()),defaultValue:T(),setters:O(I(Pg)),condition:O(Aa())});k([E(),Aa()]);var fr=(t=>(t.SINGLE="single",t.GROUP="group",t))(fr||{});k([E(),A({event:E(),name:O(E()),describe:O(E()),params:O(I(A({name:E(),description:E(),example:E()}))),template:O(E())})]);const Mg=A({id:O(E()),title:E(),snapshot:k([E(),T()]),snapshotText:O(E()),description:O(E()),tags:O(I(E())),groupName:O(E()),category:O(E()),schema:kr(xa(It,["id"]),A({componentName:O(E())}))}),Ig=A({componentName:E(),title:E(),screenshot:O(E()),icon:O(E()),tags:O(I(E())),groupName:O(E()),category:O(E()),priority:O(Ta()),npm:O(Hr),snippets:I(Mg),props:I(k([Ue,A({title:O(Oe),type:G("single"),content:Ue}),A({title:O(Oe),type:G("group"),content:I(Ue)})])),events:O(T()),methods:O(T()),fixedProps:O(T()),isContainer:O(k([Ot(),A({placeholder:E(),width:E(),height:E()})])),disableEditorDragDom:O(T()),isLayout:O(Ot()),rootSelector:O(E()),advanceCustom:O(T()),extra:O(Yt(T(),T()))}),Dg=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)}}}[c]},_r=(t,e)=>{const r={};return e.forEach((n,o)=>{r[n]=t[o]}),r},ko=(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?zc(s):s)),e[a.join("")]=n}),e},Zu=t=>{let e="";return Object.keys(t||{}).forEach(r=>{e+=`${r}:${t[r]};`}),e},tl=(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},el=(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},Ho=(t,e)=>{const r=[];return e.forEach(n=>{const a=n.exec(t);a!=null&&a.length&&r.push(a[1])}),r},zo=(t,e)=>{const r={};return e.forEach(n=>{t[n.name]&&(r[n.name]=t[n.name])}),r},rl=(t,e)=>zo(t,e),nl=(t,e)=>zo(t,e),tr=t=>{var r;return((r=t.value.css)==null?void 0:r.class)||`c_${t.id}`},qo=(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`)},er=(t,e)=>{const r={...t};return r.__proto__=e,r},ol={},$n=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,c={setState:n,getState:o,getInitialState:()=>u,subscribe:d=>(r.add(d),()=>r.delete(d)),destroy:()=>{(ol?"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()}},u=e=t(n,o,c);return c},al=t=>t?$n(t):$n;class sl{constructor(){w(this,"storeMap",new Map)}addStore(e,r){const n=al(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 il{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 Sr{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 cl=Object.defineProperty,ul=(t,e,r)=>e in t?cl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,$=(t,e,r)=>ul(t,typeof e!="symbol"?e+"":e,r),Jo=typeof global=="object"&&global&&global.Object===Object&&global,ll=typeof self=="object"&&self&&self.Object===Object&&self,Z=Jo||ll||Function("return this")(),q=Z.Symbol,Wo=Object.prototype,fl=Wo.hasOwnProperty,dl=Wo.toString,qt=q?q.toStringTag:void 0;function pl(t){var e=fl.call(t,qt),r=t[qt];try{t[qt]=void 0;var n=!0}catch{}var o=dl.call(t);return n&&(e?t[qt]=r:delete t[qt]),o}var hl=Object.prototype,gl=hl.toString;function vl(t){return gl.call(t)}var ml="[object Null]",yl="[object Undefined]",Nn=q?q.toStringTag:void 0;function jt(t){return t==null?t===void 0?yl:ml:Nn&&Nn in Object(t)?pl(t):vl(t)}function Y(t){return t!=null&&typeof t=="object"}var bl="[object Symbol]";function Or(t){return typeof t=="symbol"||Y(t)&&jt(t)==bl}function Er(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 L=Array.isArray,jn=q?q.prototype:void 0,An=jn?jn.toString:void 0;function Ko(t){if(typeof t=="string")return t;if(L(t))return Er(t,Ko)+"";if(Or(t))return An?An.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function Q(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function wr(t){return t}var _l="[object AsyncFunction]",Sl="[object Function]",Ol="[object GeneratorFunction]",El="[object Proxy]";function Cr(t){if(!Q(t))return!1;var e=jt(t);return e==Sl||e==Ol||e==_l||e==El}var Le=Z["__core-js_shared__"],xn=function(){var t=/[^.]+$/.exec(Le&&Le.keys&&Le.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function wl(t){return!!xn&&xn in t}var Cl=Function.prototype,$l=Cl.toString;function At(t){if(t!=null){try{return $l.call(t)}catch{}try{return t+""}catch{}}return""}var Nl=/[\\^$.*+?()[\]{}|]/g,jl=/^\[object .+?Constructor\]$/,Al=Function.prototype,xl=Object.prototype,Tl=Al.toString,Rl=xl.hasOwnProperty,Pl=RegExp("^"+Tl.call(Rl).replace(Nl,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ml(t){if(!Q(t)||wl(t))return!1;var e=Cr(t)?Pl:jl;return e.test(At(t))}function Il(t,e){return t==null?void 0:t[e]}function xt(t,e){var r=Il(t,e);return Ml(r)?r:void 0}var rr=xt(Z,"WeakMap"),Tn=Object.create,Dl=function(){function t(){}return function(e){if(!Q(e))return{};if(Tn)return Tn(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function Ll(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 Fl(){}function Qo(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var Vl=800,Ul=16,Bl=Date.now;function Gl(t){var e=0,r=0;return function(){var n=Bl(),o=Ul-(n-r);if(r=n,o>0){if(++e>=Vl)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function kl(t){return function(){return t}}var _e=function(){try{var t=xt(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Hl=_e?function(t,e){return _e(t,"toString",{configurable:!0,enumerable:!1,value:kl(e),writable:!0})}:wr,Yo=Gl(Hl);function zl(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}function ql(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 Jl(t){return t!==t}function Wl(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?Wl(t,e,r):ql(t,Jl,r)}function Ql(t,e){var r=t==null?0:t.length;return!!r&&Kl(t,e,0)>-1}var Yl=9007199254740991,Xl=/^(?:0|[1-9]\d*)$/;function Ne(t,e){var r=typeof t;return e=e??Yl,!!e&&(r=="number"||r!="symbol"&&Xl.test(t))&&t>-1&&t%1==0&&t<e}function $r(t,e,r){e=="__proto__"&&_e?_e(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function ce(t,e){return t===e||t!==t&&e!==e}var Zl=Object.prototype,tf=Zl.hasOwnProperty;function Nr(t,e,r){var n=t[e];(!(tf.call(t,e)&&ce(n,r))||r===void 0&&!(e in t))&&$r(t,e,r)}function Ut(t,e,r,n){var o=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var i=e[a],c=void 0;c===void 0&&(c=t[i]),o?$r(r,i,c):Nr(r,i,c)}return r}var Rn=Math.max;function Xo(t,e,r){return e=Rn(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=Rn(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),Ll(t,this,i)}}function Zo(t,e){return Yo(Xo(t,e,wr),t+"")}var ef=9007199254740991;function jr(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ef}function je(t){return t!=null&&jr(t.length)&&!Cr(t)}function rf(t,e,r){if(!Q(r))return!1;var n=typeof e;return(n=="number"?je(r)&&Ne(e,r.length):n=="string"&&e in r)?ce(r[e],t):!1}function nf(t){return Zo(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&&rf(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 of=Object.prototype;function Ar(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||of;return t===r}function af(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var sf="[object Arguments]";function Pn(t){return Y(t)&&jt(t)==sf}var ta=Object.prototype,cf=ta.hasOwnProperty,uf=ta.propertyIsEnumerable,te=Pn(function(){return arguments}())?Pn:function(t){return Y(t)&&cf.call(t,"callee")&&!uf.call(t,"callee")};function lf(){return!1}var ea=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Mn=ea&&typeof module=="object"&&module&&!module.nodeType&&module,ff=Mn&&Mn.exports===ea,In=ff?Z.Buffer:void 0,df=In?In.isBuffer:void 0,ee=df||lf,pf="[object Arguments]",hf="[object Array]",gf="[object Boolean]",vf="[object Date]",mf="[object Error]",yf="[object Function]",bf="[object Map]",_f="[object Number]",Sf="[object Object]",Of="[object RegExp]",Ef="[object Set]",wf="[object String]",Cf="[object WeakMap]",$f="[object ArrayBuffer]",Nf="[object DataView]",jf="[object Float32Array]",Af="[object Float64Array]",xf="[object Int8Array]",Tf="[object Int16Array]",Rf="[object Int32Array]",Pf="[object Uint8Array]",Mf="[object Uint8ClampedArray]",If="[object Uint16Array]",Df="[object Uint32Array]",M={};M[jf]=M[Af]=M[xf]=M[Tf]=M[Rf]=M[Pf]=M[Mf]=M[If]=M[Df]=!0;M[pf]=M[hf]=M[$f]=M[gf]=M[Nf]=M[vf]=M[mf]=M[yf]=M[bf]=M[_f]=M[Sf]=M[Of]=M[Ef]=M[wf]=M[Cf]=!1;function Lf(t){return Y(t)&&jr(t.length)&&!!M[jt(t)]}function xr(t){return function(e){return t(e)}}var ra=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Kt=ra&&typeof module=="object"&&module&&!module.nodeType&&module,Ff=Kt&&Kt.exports===ra,Fe=Ff&&Jo.process,Pt=function(){try{var t=Kt&&Kt.require&&Kt.require("util").types;return t||Fe&&Fe.binding&&Fe.binding("util")}catch{}}(),Dn=Pt&&Pt.isTypedArray,Tr=Dn?xr(Dn):Lf,Vf=Object.prototype,Uf=Vf.hasOwnProperty;function na(t,e){var r=L(t),n=!r&&te(t),o=!r&&!n&&ee(t),a=!r&&!n&&!o&&Tr(t),s=r||n||o||a,i=s?af(t.length,String):[],c=i.length;for(var u in t)(e||Uf.call(t,u))&&!(s&&(u=="length"||o&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Ne(u,c)))&&i.push(u);return i}function oa(t,e){return function(r){return t(e(r))}}var Bf=oa(Object.keys,Object),Gf=Object.prototype,kf=Gf.hasOwnProperty;function Hf(t){if(!Ar(t))return Bf(t);var e=[];for(var r in Object(t))kf.call(t,r)&&r!="constructor"&&e.push(r);return e}function Ae(t){return je(t)?na(t):Hf(t)}function zf(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var qf=Object.prototype,Jf=qf.hasOwnProperty;function Wf(t){if(!Q(t))return zf(t);var e=Ar(t),r=[];for(var n in t)n=="constructor"&&(e||!Jf.call(t,n))||r.push(n);return r}function ue(t){return je(t)?na(t,!0):Wf(t)}var Kf=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Qf=/^\w*$/;function Rr(t,e){if(L(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Or(t)?!0:Qf.test(t)||!Kf.test(t)||e!=null&&t in Object(e)}var re=xt(Object,"create");function Yf(){this.__data__=re?re(null):{},this.size=0}function Xf(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Zf="__lodash_hash_undefined__",td=Object.prototype,ed=td.hasOwnProperty;function rd(t){var e=this.__data__;if(re){var r=e[t];return r===Zf?void 0:r}return ed.call(e,t)?e[t]:void 0}var nd=Object.prototype,od=nd.hasOwnProperty;function ad(t){var e=this.__data__;return re?e[t]!==void 0:od.call(e,t)}var sd="__lodash_hash_undefined__";function id(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=re&&e===void 0?sd: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=Yf;St.prototype.delete=Xf;St.prototype.get=rd;St.prototype.has=ad;St.prototype.set=id;function cd(){this.__data__=[],this.size=0}function xe(t,e){for(var r=t.length;r--;)if(ce(t[r][0],e))return r;return-1}var ud=Array.prototype,ld=ud.splice;function fd(t){var e=this.__data__,r=xe(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():ld.call(e,r,1),--this.size,!0}function dd(t){var e=this.__data__,r=xe(e,t);return r<0?void 0:e[r][1]}function pd(t){return xe(this.__data__,t)>-1}function hd(t,e){var r=this.__data__,n=xe(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=cd;st.prototype.delete=fd;st.prototype.get=dd;st.prototype.has=pd;st.prototype.set=hd;var ne=xt(Z,"Map");function gd(){this.size=0,this.__data__={hash:new St,map:new(ne||st),string:new St}}function vd(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Te(t,e){var r=t.__data__;return vd(e)?r[typeof e=="string"?"string":"hash"]:r.map}function md(t){var e=Te(this,t).delete(t);return this.size-=e?1:0,e}function yd(t){return Te(this,t).get(t)}function bd(t){return Te(this,t).has(t)}function _d(t,e){var r=Te(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=gd;it.prototype.delete=md;it.prototype.get=yd;it.prototype.has=bd;it.prototype.set=_d;var Sd="Expected a function";function Pr(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Sd);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(Pr.Cache||it),r}Pr.Cache=it;var Od=500;function Ed(t){var e=Pr(t,function(n){return r.size===Od&&r.clear(),n}),r=e.cache;return e}var wd=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Cd=/\\(\\)?/g,$d=Ed(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(wd,function(r,n,o,a){e.push(o?a.replace(Cd,"$1"):n||r)}),e});function Nd(t){return t==null?"":Ko(t)}function Bt(t,e){return L(t)?t:Rr(t,e)?[t]:$d(Nd(t))}function Gt(t){if(typeof t=="string"||Or(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function Re(t,e){e=Bt(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Gt(e[r++])];return r&&r==n?t:void 0}function aa(t,e,r){var n=t==null?void 0:Re(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 Ln=q?q.isConcatSpreadable:void 0;function jd(t){return L(t)||te(t)||!!(Ln&&t&&t[Ln])}function sa(t,e,r,n,o){var a=-1,s=t.length;for(r||(r=jd),o||(o=[]);++a<s;){var i=t[a];r(i)?Mr(o,i):n||(o[o.length]=i)}return o}function Ad(t){var e=t==null?0:t.length;return e?sa(t):[]}function xd(t){return Yo(Xo(t,void 0,Ad),t+"")}var Ir=oa(Object.getPrototypeOf,Object),Td="[object Object]",Rd=Function.prototype,Pd=Object.prototype,ia=Rd.toString,Md=Pd.hasOwnProperty,Id=ia.call(Object);function U(t){if(!Y(t)||jt(t)!=Td)return!1;var e=Ir(t);if(e===null)return!0;var r=Md.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&ia.call(r)==Id}function Dd(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 Ld(){this.__data__=new st,this.size=0}function Fd(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function Vd(t){return this.__data__.get(t)}function Ud(t){return this.__data__.has(t)}var Bd=200;function Gd(t,e){var r=this.__data__;if(r instanceof st){var n=r.__data__;if(!ne||n.length<Bd-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=Ld;W.prototype.delete=Fd;W.prototype.get=Vd;W.prototype.has=Ud;W.prototype.set=Gd;function kd(t,e){return t&&Ut(e,Ae(e),t)}function Hd(t,e){return t&&Ut(e,ue(e),t)}var ca=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Fn=ca&&typeof module=="object"&&module&&!module.nodeType&&module,zd=Fn&&Fn.exports===ca,Vn=zd?Z.Buffer:void 0,Un=Vn?Vn.allocUnsafe:void 0;function ua(t,e){if(e)return t.slice();var r=t.length,n=Un?Un(r):new t.constructor(r);return t.copy(n),n}function qd(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 la(){return[]}var Jd=Object.prototype,Wd=Jd.propertyIsEnumerable,Bn=Object.getOwnPropertySymbols,Dr=Bn?function(t){return t==null?[]:(t=Object(t),qd(Bn(t),function(e){return Wd.call(t,e)}))}:la;function Kd(t,e){return Ut(t,Dr(t),e)}var Qd=Object.getOwnPropertySymbols,fa=Qd?function(t){for(var e=[];t;)Mr(e,Dr(t)),t=Ir(t);return e}:la;function Yd(t,e){return Ut(t,fa(t),e)}function da(t,e,r){var n=e(t);return L(t)?n:Mr(n,r(t))}function nr(t){return da(t,Ae,Dr)}function Lr(t){return da(t,ue,fa)}var or=xt(Z,"DataView"),ar=xt(Z,"Promise"),Tt=xt(Z,"Set"),Gn="[object Map]",Xd="[object Object]",kn="[object Promise]",Hn="[object Set]",zn="[object WeakMap]",qn="[object DataView]",Zd=At(or),tp=At(ne),ep=At(ar),rp=At(Tt),np=At(rr),J=jt;(or&&J(new or(new ArrayBuffer(1)))!=qn||ne&&J(new ne)!=Gn||ar&&J(ar.resolve())!=kn||Tt&&J(new Tt)!=Hn||rr&&J(new rr)!=zn)&&(J=function(t){var e=jt(t),r=e==Xd?t.constructor:void 0,n=r?At(r):"";if(n)switch(n){case Zd:return qn;case tp:return Gn;case ep:return kn;case rp:return Hn;case np:return zn}return e});var op=Object.prototype,ap=op.hasOwnProperty;function sp(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&ap.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var Se=Z.Uint8Array;function Fr(t){var e=new t.constructor(t.byteLength);return new Se(e).set(new Se(t)),e}function ip(t,e){var r=e?Fr(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var cp=/\w*$/;function up(t){var e=new t.constructor(t.source,cp.exec(t));return e.lastIndex=t.lastIndex,e}var Jn=q?q.prototype:void 0,Wn=Jn?Jn.valueOf:void 0;function lp(t){return Wn?Object(Wn.call(t)):{}}function pa(t,e){var r=e?Fr(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var fp="[object Boolean]",dp="[object Date]",pp="[object Map]",hp="[object Number]",gp="[object RegExp]",vp="[object Set]",mp="[object String]",yp="[object Symbol]",bp="[object ArrayBuffer]",_p="[object DataView]",Sp="[object Float32Array]",Op="[object Float64Array]",Ep="[object Int8Array]",wp="[object Int16Array]",Cp="[object Int32Array]",$p="[object Uint8Array]",Np="[object Uint8ClampedArray]",jp="[object Uint16Array]",Ap="[object Uint32Array]";function xp(t,e,r){var n=t.constructor;switch(e){case bp:return Fr(t);case fp:case dp:return new n(+t);case _p:return ip(t,r);case Sp:case Op:case Ep:case wp:case Cp:case $p:case Np:case jp:case Ap:return pa(t,r);case pp:return new n;case hp:case mp:return new n(t);case gp:return up(t);case vp:return new n;case yp:return lp(t)}}function ha(t){return typeof t.constructor=="function"&&!Ar(t)?Dl(Ir(t)):{}}var Tp="[object Map]";function Rp(t){return Y(t)&&J(t)==Tp}var Kn=Pt&&Pt.isMap,Pp=Kn?xr(Kn):Rp,Mp="[object Set]";function Ip(t){return Y(t)&&J(t)==Mp}var Qn=Pt&&Pt.isSet,Dp=Qn?xr(Qn):Ip,Lp=1,Fp=2,Vp=4,ga="[object Arguments]",Up="[object Array]",Bp="[object Boolean]",Gp="[object Date]",kp="[object Error]",va="[object Function]",Hp="[object GeneratorFunction]",zp="[object Map]",qp="[object Number]",ma="[object Object]",Jp="[object RegExp]",Wp="[object Set]",Kp="[object String]",Qp="[object Symbol]",Yp="[object WeakMap]",Xp="[object ArrayBuffer]",Zp="[object DataView]",th="[object Float32Array]",eh="[object Float64Array]",rh="[object Int8Array]",nh="[object Int16Array]",oh="[object Int32Array]",ah="[object Uint8Array]",sh="[object Uint8ClampedArray]",ih="[object Uint16Array]",ch="[object Uint32Array]",R={};R[ga]=R[Up]=R[Xp]=R[Zp]=R[Bp]=R[Gp]=R[th]=R[eh]=R[rh]=R[nh]=R[oh]=R[zp]=R[qp]=R[ma]=R[Jp]=R[Wp]=R[Kp]=R[Qp]=R[ah]=R[sh]=R[ih]=R[ch]=!0;R[kp]=R[va]=R[Yp]=!1;function Qt(t,e,r,n,o,a){var s,i=e&Lp,c=e&Fp,u=e&Vp;if(r&&(s=o?r(t,n,o,a):r(t)),s!==void 0)return s;if(!Q(t))return t;var d=L(t);if(d){if(s=sp(t),!i)return Qo(t,s)}else{var l=J(t),f=l==va||l==Hp;if(ee(t))return ua(t,i);if(l==ma||l==ga||f&&!o){if(s=c||f?{}:ha(t),!i)return c?Yd(t,Hd(s,t)):Kd(t,kd(s,t))}else{if(!R[l])return o?t:{};s=xp(t,l,i)}}a||(a=new W);var h=a.get(t);if(h)return h;a.set(t,s),Dp(t)?t.forEach(function(p){s.add(Qt(p,e,r,p,t,a))}):Pp(t)&&t.forEach(function(p,v){s.set(v,Qt(p,e,r,v,t,a))});var g=u?c?Lr:nr:c?ue:Ae,b=d?void 0:g(t);return zl(b||t,function(p,v){b&&(v=p,p=t[v]),Nr(s,v,Qt(p,e,r,v,t,a))}),s}var uh=1,lh=4;function ya(t){return Qt(t,uh|lh)}var fh="__lodash_hash_undefined__";function dh(t){return this.__data__.set(t,fh),this}function ph(t){return this.__data__.has(t)}function oe(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new it;++e<r;)this.add(t[e])}oe.prototype.add=oe.prototype.push=dh;oe.prototype.has=ph;function hh(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 ba(t,e){return t.has(e)}var gh=1,vh=2;function _a(t,e,r,n,o,a){var s=r&gh,i=t.length,c=e.length;if(i!=c&&!(s&&c>i))return!1;var u=a.get(t),d=a.get(e);if(u&&d)return u==e&&d==t;var l=-1,f=!0,h=r&vh?new oe: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(!hh(e,function(v,m){if(!ba(h,m)&&(g===v||o(g,v,r,n,a)))return h.push(m)})){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 mh(t){var e=-1,r=Array(t.size);return t.forEach(function(n,o){r[++e]=[o,n]}),r}function Vr(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var yh=1,bh=2,_h="[object Boolean]",Sh="[object Date]",Oh="[object Error]",Eh="[object Map]",wh="[object Number]",Ch="[object RegExp]",$h="[object Set]",Nh="[object String]",jh="[object Symbol]",Ah="[object ArrayBuffer]",xh="[object DataView]",Yn=q?q.prototype:void 0,Ve=Yn?Yn.valueOf:void 0;function Th(t,e,r,n,o,a,s){switch(r){case xh:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Ah:return!(t.byteLength!=e.byteLength||!a(new Se(t),new Se(e)));case _h:case Sh:case wh:return ce(+t,+e);case Oh:return t.name==e.name&&t.message==e.message;case Ch:case Nh:return t==e+"";case Eh:var i=mh;case $h:var c=n&yh;if(i||(i=Vr),t.size!=e.size&&!c)return!1;var u=s.get(t);if(u)return u==e;n|=bh,s.set(t,e);var d=_a(i(t),i(e),n,o,a,s);return s.delete(t),d;case jh:if(Ve)return Ve.call(t)==Ve.call(e)}return!1}var Rh=1,Ph=Object.prototype,Mh=Ph.hasOwnProperty;function Ih(t,e,r,n,o,a){var s=r&Rh,i=nr(t),c=i.length,u=nr(e),d=u.length;if(c!=d&&!s)return!1;for(var l=c;l--;){var f=i[l];if(!(s?f in e:Mh.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<c;){f=i[l];var v=t[f],m=e[f];if(n)var y=s?n(m,v,f,e,t,a):n(v,m,f,t,e,a);if(!(y===void 0?v===m||o(v,m,r,n,a):y)){b=!1;break}p||(p=f=="constructor")}if(b&&!p){var _=t.constructor,S=e.constructor;_!=S&&"constructor"in t&&"constructor"in e&&!(typeof _=="function"&&_ instanceof _&&typeof S=="function"&&S instanceof S)&&(b=!1)}return a.delete(t),a.delete(e),b}var Dh=1,Xn="[object Arguments]",Zn="[object Array]",pe="[object Object]",Lh=Object.prototype,to=Lh.hasOwnProperty;function Fh(t,e,r,n,o,a){var s=L(t),i=L(e),c=s?Zn:J(t),u=i?Zn:J(e);c=c==Xn?pe:c,u=u==Xn?pe:u;var d=c==pe,l=u==pe,f=c==u;if(f&&ee(t)){if(!ee(e))return!1;s=!0,d=!1}if(f&&!d)return a||(a=new W),s||Tr(t)?_a(t,e,r,n,o,a):Th(t,e,c,r,n,o,a);if(!(r&Dh)){var h=d&&to.call(t,"__wrapped__"),g=l&&to.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),Ih(t,e,r,n,o,a)):!1}function Ur(t,e,r,n,o){return t===e?!0:t==null||e==null||!Y(t)&&!Y(e)?t!==t&&e!==e:Fh(t,e,r,n,Ur,o)}var Vh=1,Uh=2;function Bh(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],c=t[i],u=s[1];if(s[2]){if(c===void 0&&!(i in t))return!1}else{var d=new W,l;if(!(l===void 0?Ur(u,c,Vh|Uh,n,d):l))return!1}}return!0}function Sa(t){return t===t&&!Q(t)}function Gh(t){for(var e=Ae(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,Sa(o)]}return e}function Oa(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function kh(t){var e=Gh(t);return e.length==1&&e[0][2]?Oa(e[0][0],e[0][1]):function(r){return r===t||Bh(r,t,e)}}function Hh(t,e){return t!=null&&e in Object(t)}function zh(t,e,r){e=Bt(e,t);for(var n=-1,o=e.length,a=!1;++n<o;){var s=Gt(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&&jr(o)&&Ne(s,o)&&(L(t)||te(t)))}function qh(t,e){return t!=null&&zh(t,e,Hh)}var Jh=1,Wh=2;function Kh(t,e){return Rr(t)&&Sa(e)?Oa(Gt(t),e):function(r){var n=aa(r,t);return n===void 0&&n===e?qh(r,t):Ur(e,n,Jh|Wh)}}function Qh(t){return function(e){return e==null?void 0:e[t]}}function Yh(t){return function(e){return Re(e,t)}}function Xh(t){return Rr(t)?Qh(Gt(t)):Yh(t)}function Br(t){return typeof t=="function"?t:t==null?wr:typeof t=="object"?L(t)?Kh(t[0],t[1]):kh(t):Xh(t)}function Zh(t){return function(e,r,n){for(var o=-1,a=Object(e),s=n(e),i=s.length;i--;){var c=s[++o];if(r(a[c],c,a)===!1)break}return e}}var tg=Zh();function sr(t,e,r){(r!==void 0&&!ce(t[e],r)||r===void 0&&!(e in t))&&$r(t,e,r)}function ir(t){return Y(t)&&je(t)}function cr(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function eg(t){return Ut(t,ue(t))}function rg(t,e,r,n,o,a,s){var i=cr(t,r),c=cr(e,r),u=s.get(c);if(u){sr(t,r,u);return}var d=a?a(i,c,r+"",t,e,s):void 0,l=d===void 0;if(l){var f=L(c),h=!f&&ee(c),g=!f&&!h&&Tr(c);d=c,f||h||g?L(i)?d=i:ir(i)?d=Qo(i):h?(l=!1,d=ua(c,!0)):g?(l=!1,d=pa(c,!0)):d=[]:U(c)||te(c)?(d=i,te(i)?d=eg(i):(!Q(i)||Cr(i))&&(d=ha(c))):l=!1}l&&(s.set(c,d),o(d,c,n,a,s),s.delete(c)),sr(t,r,d)}function Ea(t,e,r,n,o){t!==e&&tg(e,function(a,s){if(o||(o=new W),Q(a))rg(t,e,s,r,Ea,n,o);else{var i=n?n(cr(t,s),a,s+"",t,e,o):void 0;i===void 0&&(i=a),sr(t,s,i)}},ue)}function wa(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function ng(t,e){return e.length<2?t:Re(t,Dd(e,0,-1))}var Ca=nf(function(t,e,r){Ea(t,e,r)}),og="Expected a function";function ag(t){if(typeof t!="function")throw new TypeError(og);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 sg(t,e){return e=Bt(e,t),t=ng(t,e),t==null||delete t[Gt(wa(e))]}function ig(t){return U(t)?void 0:t}var cg=1,ug=2,lg=4,$a=xd(function(t,e){var r={};if(t==null)return r;var n=!1;e=Er(e,function(a){return a=Bt(a,t),n||(n=a.length>1),a}),Ut(t,Lr(t),r),n&&(r=Qt(r,cg|ug|lg,ig));for(var o=e.length;o--;)sg(r,e[o]);return r});function fg(t,e,r,n){if(!Q(t))return t;e=Bt(e,t);for(var o=-1,a=e.length,s=a-1,i=t;i!=null&&++o<a;){var c=Gt(e[o]),u=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(o!=s){var d=i[c];u=void 0,u===void 0&&(u=Q(d)?d:Ne(e[o+1])?[]:{})}Nr(i,c,u),i=i[c]}return t}function dg(t,e,r){for(var n=-1,o=e.length,a={};++n<o;){var s=e[n],i=Re(t,s);r(i,s)&&fg(a,Bt(s,t),i)}return a}function pg(t,e){if(t==null)return{};var r=Er(Lr(t),function(n){return[n]});return e=Br(e),dg(t,r,function(n,o){return e(n,o[0])})}function hg(t,e){return pg(t,ag(Br(e)))}var gg=1/0,vg=Tt&&1/Vr(new Tt([,-0]))[1]==gg?function(t){return new Tt(t)}:Fl,mg=200;function yg(t,e,r){var n=-1,o=Ql,a=t.length,s=!0,i=[],c=i;if(a>=mg){var u=e?null:vg(t);if(u)return Vr(u);s=!1,o=ba,c=new oe}else c=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=c.length;f--;)if(c[f]===l)continue t;e&&c.push(l),i.push(d)}else o(c,l,r)||(c!==i&&c.push(l),i.push(d))}return i}var bg=Zo(function(t){var e=wa(t);return ir(e)&&(e=void 0),yg(sa(t,1,ir,!0),Br(e))});class Na 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 _g(t){return K(t)&&typeof t[Symbol.iterator]=="function"}function K(t){return typeof t=="object"&&t!=null}function H(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function Sg(t){const{done:e,value:r}=t.next();return e?void 0:r}function Og(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:c=`Expected a value of type \`${s}\`${i?` with refinement \`${i}\``:""}, but received: \`${H(n)}\``}=t;return{value:n,type:s,refinement:i,key:o[o.length-1],path:o,branch:a,...t,message:c}}function*eo(t,e,r,n){_g(t)||(t=[t]);for(const o of t){const a=Og(o,e,r,n);a&&(yield a)}}function*Gr(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"&&K(e.schema)&&K(t)&&!Array.isArray(t)))for(const u in t)e.schema[u]===void 0&&delete t[u];let c="valid";for(const u of e.validator(t,i))c="not_valid",yield[u,void 0];for(let[u,d,l]of e.entries(t,i)){const f=Gr(d,l,{path:u===void 0?n:[...n,u],branch:u===void 0?o:[...o,d],coerce:a,mask:s});for(const h of f)h[0]?(c=h[0].refinement!=null?"not_refined":"not_valid",yield[h[0],void 0]):a&&(d=h[1],u===void 0?t=d:t instanceof Map?t.set(u,d):t instanceof Set?t.add(d):K(t)&&(d!==void 0||u in t)&&(t[u]=d))}if(c!=="not_valid")for(const u of e.refiner(t,i))c="not_refined",yield[u,void 0];c==="valid"&&(yield[void 0,t])}class tt{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=c=>c,entries:i=function*(){}}=e;this.type=r,this.schema=n,this.entries=i,this.coercer=s,o?this.validator=(c,u)=>{const d=o(c,u);return eo(d,u,this,c)}:this.validator=()=>[],a?this.refiner=(c,u)=>{const d=a(c,u);return eo(d,u,this,c)}:this.refiner=()=>[]}assert(e){return ja(e,this)}create(e){return Eg(e,this)}is(e){return Cg(e,this)}mask(e){return wg(e,this)}validate(e,r){return r===void 0&&(r={}),kt(e,this,r)}}function ja(t,e){const r=kt(t,e);if(r[0])throw r[0]}function Eg(t,e){const r=kt(t,e,{coerce:!0});if(r[0])throw r[0];return r[1]}function wg(t,e){const r=kt(t,e,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}function Cg(t,e){return!kt(t,e)[0]}function kt(t,e,r){r===void 0&&(r={});const n=Gr(t,e,r),o=Sg(n);return o[0]?[new Na(o[0],function*(){for(const a of n)a[0]&&(yield a[0])}),void 0]:[void 0,o[1]]}function kr(){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?Ra(a):x(a)}function pt(t,e){return new tt({type:t,schema:null,validator:e})}function Mt(t){return new tt({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 Aa(t,e){const{schema:r}=t,n={...r};for(const o of e)delete n[o];switch(t.type){case"type":return Ra(n);default:return x(n)}}function T(){return pt("any",()=>!0)}function I(t){return new tt({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: ${H(e)}`}})}function Ot(){return pt("boolean",t=>typeof t=="boolean")}function ur(t){const e={},r=t.map(n=>H(n)).join();for(const n of t)e[n]=n;return new tt({type:"enums",schema:e,validator(n){return t.includes(n)||`Expected one of \`${r}\`, but received: ${H(n)}`}})}function xa(){return pt("func",t=>typeof t=="function"||`Expected a function, but received: ${H(t)}`)}function G(t){const e=H(t),r=typeof t;return new tt({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||`Expected the literal \`${e}\`, but received: ${H(n)}`}})}function $g(){return pt("never",()=>!1)}function Ta(){return pt("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${H(t)}`)}function x(t){const e=t?Object.keys(t):[],r=$g();return new tt({type:"object",schema:t||null,*entries(n){if(t&&K(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 K(n)||`Expected an object, but received: ${H(n)}`},coercer(n){return K(n)?{...n}:n}})}function O(t){return new tt({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function Yt(t,e){return new tt({type:"record",schema:null,*entries(r){if(K(r))for(const n in r){const o=r[n];yield[n,n,t],yield[n,o,e]}},validator(r){return K(r)||`Expected an object, but received: ${H(r)}`}})}function E(){return pt("string",t=>typeof t=="string"||`Expected a string, but received: ${H(t)}`)}function Ra(t){const e=Object.keys(t);return new tt({type:"type",schema:t,*entries(r){if(K(r))for(const n of e)yield[n,r[n],t[n]]},validator(r){return K(r)||`Expected an object, but received: ${H(r)}`}})}function k(t){const e=t.map(r=>r.type).join(" | ");return new tt({type:"union",schema:null,coercer(r,n){return(t.find(o=>{const[a]=o.validate(r,{coerce:!0});return!a})||Ng()).coercer(r,n)},validator(r,n){const o=[];for(const a of t){const[...s]=Gr(r,a,n),[i]=s;if(i[0])for(const[c]of s)c&&o.push(c);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${H(r)}`,...o]}})}function Ng(){return pt("unknown",()=>!0)}const Hr=x({package:E(),version:E(),name:E(),exportName:O(E()),destructuring:O(Ot()),subName:O(E()),main:O(E()),cssPaths:O(I(E()))}),jg=I(Hr);var V=(t=>(t.SLOT="SLOT",t.FUNCTION="FUNCTION",t.EXPRESSION="EXPRESSION",t.ACTION="ACTION",t.EVENT="EVENT",t))(V||{}),zr=(t=>(t.DESIGN="design",t.SAVE="save",t))(zr||{}),lr=(t=>(t.FUNC="FUNC",t.COMP="COMP",t))(lr||{});const Ag=()=>pt("normalObj",t=>!U(t)||[V.SLOT,V.EXPRESSION,V.FUNCTION].includes(t==null?void 0:t.type)?!1:(kt(t,Yt(E(),qr)),!0)),qr=k([E(),Ta(),Ot(),x({type:G(V.SLOT),renderType:ur([lr.FUNC,lr.COMP]),params:O(I(E())),value:Mt(()=>k([It,I(It)]))}),x({type:G(V.EXPRESSION),value:E()}),x({type:G(V.FUNCTION),value:E()}),x({type:G(V.ACTION),handler:T()}),Ag(),I(Mt(()=>qr))]);var Pa=(t=>(t.COMPONENTS="COMPONENTS",t))(Pa||{});const ro=x({type:G(V.EXPRESSION),value:E()}),It=x({id:O(E()),title:O(E()),componentName:E(),props:O(Yt(E(),qr)),nodeName:O(E()),state:O(Yt(E(),T())),children:Mt(()=>O(I(k([E(),It])))),eventListener:O(I(T())),configure:O(T()),css:O(T()),style:O(T()),classNames:O(I(T())),refId:O(E()),extra:O(Yt(T(),T())),condition:O(k([Ot(),ro])),loop:O(x({open:Ot(),data:k([I(T()),ro]),args:O(I(E())),forName:O(E()),forIndex:O(E()),key:O(T()),name:O(E())})),injectEnvList:O(I(T())),methods:O(I(T()))}),Oe=k([E(),x({label:E(),tip:O(E())})]),xg=x({type:G("shape"),value:I(x({name:E(),title:Oe,valueType:Mt(()=>Pe)}))}),Tg=x({type:G("enums"),value:I(E())});x({type:G("array"),value:Mt(()=>Pe)});const Rg=x({type:G("array"),value:Mt(()=>I(Pe))}),Pe=k([ur(["array","boolean","number","object","string"]),ur(["component","expression","function"]),xg,Tg,Rg]),Pg=k([E(),x({componentName:E(),props:O(T()),initialValue:O(T()),component:O(T()),hiddenLabel:O(Ot())})]),Ue=x({name:E(),title:Oe,valueType:Pe,description:O(E()),defaultValue:T(),setters:O(I(Pg)),condition:O(xa())});k([E(),xa()]);var fr=(t=>(t.SINGLE="single",t.GROUP="group",t))(fr||{});k([E(),x({event:E(),name:O(E()),describe:O(E()),params:O(I(x({name:E(),description:E(),example:E()}))),template:O(E())})]);const Mg=x({id:O(E()),title:E(),snapshot:k([E(),T()]),snapshotText:O(E()),description:O(E()),tags:O(I(E())),groupName:O(E()),category:O(E()),schema:kr(Aa(It,["id"]),x({componentName:O(E())}))}),Ig=x({componentName:E(),title:E(),screenshot:O(E()),icon:O(E()),tags:O(I(E())),groupName:O(E()),category:O(E()),priority:O(Ta()),npm:O(Hr),snippets:I(Mg),props:I(k([Ue,x({title:O(Oe),type:G("single"),content:Ue}),x({title:O(Oe),type:G("group"),content:I(Ue)})])),events:O(T()),methods:O(T()),fixedProps:O(T()),isContainer:O(k([Ot(),x({placeholder:E(),width:E(),height:E()})])),disableEditorDragDom:O(T()),isLayout:O(Ot()),rootSelector:O(E()),advanceCustom:O(T()),extra:O(Yt(T(),T()))}),Dg=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}
|
|
56
56
|
originData: ${JSON.stringify(e)}`):new Error(`${JSON.stringify(e)}
|
|
57
57
|
data struct format is invalidate`);return o.message||r?console.warn(`${o.message||r}
|
|
58
58
|
originData: ${JSON.stringify(e)}`):console.warn(`${JSON.stringify(e)}
|
|
59
59
|
data struct format is invalidate`),o},Jr=t=>{const{data:e,message:r,throwError:n,dataStruct:o}=t;return Dg(({data:a})=>{try{return ja(a,o),{isValidate:!0}}catch(s){let i=s;return s instanceof Na&&(i=s.failures().map(c=>`【${c.path.join(".")}】: ${c.message}
|
|
60
|
-
`)),{isValidate:!1,message:i,error:s}}})({data:e,message:r,throwError:n})};var rt=(t=>(t.ROOT_CONTAINER="RootContainer",t))(rt||{});const Lg=A({type:G(V.FUNCTION),value:E()}),Fg=kr(xa(It,["componentName"]),A({componentName:G("RootContainer")}));function Vg(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 le=Vg(),Ug=(t,e)=>{const r={...t,value:[]},n=t.value;let o=new Lt([]);return e&&(o=e.materialsMode||new Lt([])),n&&(L(n)?r.value=n.map(a=>new D(a,{parent:e,materials:o})):U(n)&&r.value.push(new D(n,{parent:e,materials:o}))),r};class Dt{constructor(e,r){$(this,"nodeType","SLOT"),$(this,"rawData"),$(this,"parent"),$(this,"emitter",le),$(this,"data"),$(this,"id"),$(this,"materialsMode"),this.parent=(r==null?void 0:r.parent)||null,this.rawData=e;const n=(r==null?void 0:r.materials)||new Lt([]);this.materialsMode=n,this.id=et(),this.data=Ug(e,this)}get value(){return this.data}export(e){const r=this.data,n=o=>{if(o instanceof D)return o.export(e);if(U(o)){const a={};return Object.keys(o||{}).forEach(s=>{a[s]=n(o[s])}),a}return L(o)?o.map(a=>n(a)):(e==="design"&&delete o.id,o)};return n(r)}}const Ma=t=>{let e=[];return t.forEach(r=>{const n=r;n.type?n.type===fr.SINGLE?e.push(n.content):n.type===fr.GROUP&&(e=[...e,...Ma(n.content)]):e.push(r)}),e},dr=(t,e,r)=>{if(t.type)return t.type===V.SLOT?new Dt(t,{parent:e,materials:r}):t;if(U(t)){const n={};return Object.keys(t).forEach(o=>{n[o]=pr(t[o],e,r)}),n}else return Array.isArray(t)?t.map(n=>dr(n,e,r)):t},pr=(t,e,r)=>U(t)?dr(t,e,r):L(t)?t.map(n=>dr(n,e,r)):t;class dt{constructor(e,r,n){$(this,"nodeType","PROP"),$(this,"rawData"),$(this,"parent"),$(this,"emitter",le),$(this,"data"),$(this,"name"),$(this,"materialsMode");const o=(n==null?void 0:n.materials)||new Lt([]);this.materialsMode=o,this.parent=n==null?void 0:n.parent,this.rawData=r,this.name=e,this.data=pr(r,this,o)}isIncludeSlot(){return!1}isIncludeExpression(){return!1}get value(){return this.data}updateValue(e){const r=this.data;this.data=pr(e??r,this,this.materialsMode),this.emitter.emit("onPropChange",{value:this.data,preValue:r,node:this}),this.parent&&!(this.parent instanceof Dt)&&this.emitter.emit("onNodeChange",{value:this.parent.value,preValue:this.parent.value,node:this.parent})}get material(){const e=this.parent;if(e instanceof D){const r=e.material;return Ma((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 dt||o instanceof Dt||o instanceof D)return o.export(e);if(L(o))return o.map(a=>n(a));if(U(o)){const a={};return Object.keys(o||{}).forEach(s=>{a[s]=n(o[s])}),a}return o};return n(r)}}const Bg=t=>{if(typeof t=="string")return!0;Jr({data:t,dataStruct:It,throwError:!1})},no=(t,e,r)=>{if(typeof t=="string")return t;const n={...t,id:t.id??et(),children:[],props:{},methods:t.methods||[],configure:Ca(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 dt){n.props[a]=i;return}n.props[a]=new dt(a,i||"",{parent:e,materials:r})}),t.children&&(Array.isArray(t.children)?n.children=t.children.map(a=>{if(a instanceof D)return a;if(U(a)){const s=a;return new D(s,{parent:e,materials:r})}else return a}):(t.children instanceof D&&(n.children=[t.children]),n.children=[new D(t.children,{parent:e,materials:r})])),n};class D{constructor(e,r){$(this,"nodeType","NODE"),$(this,"rawData"),$(this,"data"),$(this,"emitter",le),$(this,"parent"),$(this,"materialsModel"),$(this,"listenerHandler"),$(this,"onChangeCbQueue"),this.rawData=JSON.parse(JSON.stringify(e)),Bg(e);const n=(r==null?void 0:r.materials)||new Lt([]);this.parent=(r==null?void 0:r.parent)||null,this.materialsModel=n,this.data=no(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||et()};return new D(r,{materials:this.materialsModel})}updateWithPlainObj(e){const r={...this.data,...e};return this.data=no(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 Kr(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 D?l.export(e):l),s=n.configure||{},i=s.propsSetter||{},c={};Object.keys(i).forEach(l=>{const f=aa(i,l,!1);f&&(c[l]=f)}),s.propsSetter=c;const u=this.materialsModel.usedMaterials.find(l=>{var f;return l.componentName===((f=this.material)==null?void 0:f.componentName)});this.material&&!u&&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=Wr(d),d}}const oo=(t,e,r)=>{const n={...t,id:et(),props:{},componentName:rt.ROOT_CONTAINER,children:[],methods:t.methods||[],configure:Ca(t.configure||{},{propsSetter:{},advanceSetter:{}}),injectEnvList:t.injectEnvList};let o=[];L(t.children)?o=t.children.map(s=>s instanceof D?s:U(s)?new D(s,{parent:e,materials:r}):s):t.children instanceof D?o.push(t.children):t.children&&U(t.children)&&o.push(new D(t.children,{parent:e,materials:r}));const a=Object.keys(t.props||{});return a.length&&a.forEach(s=>{var i;const c=(i=t.props)==null?void 0:i[s];c instanceof dt?n.props[s]=c:n.props[s]=new dt(s,c||"",{parent:e,materials:r})}),n.children=o,n};class ae{constructor(e,{parent:r,materials:n}){$(this,"rawData"),$(this,"data"),$(this,"nodeType",rt.ROOT_CONTAINER),$(this,"emitter",le),$(this,"materialsModel"),$(this,"listenerHandler"),$(this,"onChangeCbQueue"),$(this,"parent"),this.materialsModel=n,this.rawData=JSON.parse(JSON.stringify(e)),this.data=oo(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=oo(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 Kr(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=zr.SAVE){var r;const n=this.data,o={};Object.keys(n.props||{}).forEach(c=>{o[c]=n.props[c].export(e)});const a=((r=n.children)==null?void 0:r.map(c=>{var u;return(u=c==null?void 0:c.export)==null?void 0:u.call(c,e)}))||[],s={...n,props:o,children:a.filter(c=>c),condition:n.condition,extra:this.data.extra};let i=$a(s,["id"]);return i=Wr(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||et()};return new ae(r,{materials:this.materialsModel,parent:null})}}const mt=t=>(t==null?void 0:t.type)===V.EXPRESSION,Ia=t=>(t==null?void 0:t.type)===V.FUNCTION,Gg=t=>(t==null?void 0:t.type)===V.ACTION,et=()=>Math.random().toString(32).slice(3,9),kg=t=>(t==null?void 0:t.nodeType)==="NODE",hr=t=>(t==null?void 0:t.nodeType)==="PROP",Hg=t=>(t==null?void 0:t.nodeType)==="SLOT",Wr=t=>hg(t,e=>U(e)?!Object.keys(e).length:L(e)?!e.length:!e);function zg(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 D){r.push(i);return}if(i instanceof Dt&&a(i.value.value),i instanceof dt){a(i.value);return}if(U(i)){const c=i;Object.keys(c).forEach(u=>{a(c[u])});return}if(L(i)){i.forEach(c=>{a(c)});return}};a(o);const s=(n==null?void 0:n.value.children.filter(i=>i instanceof D))||[];r.push(...s)}}function Kr(t,e){return zg(t,r=>r.id===e)}const qg=t=>{const e=ya(t),r=e.snippets;return delete e.snippets,e.snippets=r.map(n=>({...e,...n,id:n.id||`${t.componentName}-${et()}`,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 Jg{constructor(e){$(this,"rawData"),$(this,"data"),this.rawData=e,this.data=qg(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 Be=t=>{if(!L(t))throw new Error("Materials must be a array");return t.map(e=>new Jg(e))},Wg=t=>{t==null||t.forEach(e=>{Jr({data:e,dataStruct:Ig,throwError:!1})})};class Lt{constructor(e){$(this,"rawData"),$(this,"data"),$(this,"usedMaterials",[]),this.rawData=e,Wg(e),this.data=Be(e)}addMaterials(e){const r=Be(e),n=[],o=this.data.map(s=>{const i=r.findIndex(c=>c.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=Be(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:[]},c=n[a];if(c.length!==0){c.forEach(l=>{const f=l.category||"default";s.includes(f)||(s.push(f),i[f]=[]),i[f].push(l)});const u=[];s.forEach(l=>{i[l].length&&u.push({name:l,list:i[l]})});const d={name:a,list:u};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=A({version:O(E()),name:O(E()),css:O(E()),lifecycle:O(T()),props:O(T()),methods:O(I(Lg)),componentsMeta:I(kr(A({componentName:E()}),Hr)),thirdLibs:O(jg),componentsTree:Fg,assets:O(I(T())),extra:O(T())}),Da=t=>(Jr({data:t,dataStruct:Kg,throwError:!1}),t),Ge=(t,e,r)=>({...t,componentsTree:new ae(t.componentsTree,{parent:e,materials:r})});class Ee{constructor(e,r){$(this,"nodeType","PAGE"),$(this,"rawData"),$(this,"emitter",le),$(this,"data"),$(this,"parent"),$(this,"materialsModel"),$(this,"assetPackagesList"),Da(e),this.rawData=JSON.parse(JSON.stringify(e)),this.materialsModel=new Lt((r==null?void 0:r.materials)||[]),this.data=Ge(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=Ge(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=Ge(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 Kr(r,e)}addNode(e,r,n="AFTER"){var o;if(n==="AFTER"||n==="BEFORE"){const a=r.parent;if(a===null&&r instanceof ae)return console.warn("Not found parent node"),!1;if(a instanceof dt)return console.warn("CProp can not add node"),!1;if(a instanceof Dt){const i=a.value.value,c=i.findIndex(u=>u===r)??-1;return c>=0?(n==="BEFORE"?i.splice(c,0,e):i.splice(c+1,0,e),e.parent=a,(o=a.parent)==null||o.updateValue(),!0):!1}if(a instanceof Ee)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(U(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 D(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=et();const n=new D(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 D?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 D&&a instanceof D?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 Dt){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 D||n instanceof ae){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=zr.SAVE){var r;const n=this.data.componentsTree.export(e),o=this.assetPackagesList,a=[],s=this.materialsModel.usedMaterials.map(c=>{const u=o.find(d=>{var l;return d.package===((l=c.value.npm)==null?void 0:l.package)});return u&&a.push(u),{componentName:c.componentName,...ya(c.value.npm||{})}}).filter(c=>c.componentName&&c.package&&c.version?!0:(console.warn(`${JSON.stringify(c,null,2)} not a valid material info`),!1));this.materialsModel.usedMaterials=[];let i={...this.data,componentsTree:Wr(n),componentsMeta:s,thirdLibs:this.data.thirdLibs,assets:[],extra:this.data.extra};return(r=this.data.thirdLibs)==null||r.forEach(c=>{const u=o.find(d=>c.package===d.package);u&&a.push(u)}),i.assets=bg(a,c=>c.package),i=$a(i,["id"]),JSON.parse(JSON.stringify(i))}getRootNode(){return this.data.componentsTree}}rt.ROOT_CONTAINER;const fe="DYNAMIC",La=["$$context","$$nodeModel"],Qr="ON_DID_RENDER",Yr="ON_WILL_DESTROY",Fa=[Qr,Yr],gr=(t,e)=>{let r=t;return e&&(r={...t},r.__proto__=e||null),r},se=(t,e={},...r)=>typeof t=="string"||typeof t=="number"?String(t):(La.forEach(o=>{o in e&&t.__CP_TYPE__!==fe&&delete e[o]}),N.createElement(t,e,...r)),ao=(t={},e)=>{const r=[],n=(o,a)=>{let s=a;hr(a)&&(s=a.value),e(s)?r.push({keyPath:o,val:s}):ot(s)?s.forEach((i,c)=>{n([...o,String(c)],i)}):Ft(s)&&Object.keys(s).forEach(i=>{n([...o,i],s[i])})};return n(["$root"],t),r},Rt=(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=Vt({funcName:"",funcBody:`function() {
|
|
60
|
+
`)),{isValidate:!1,message:i,error:s}}})({data:e,message:r,throwError:n})};var rt=(t=>(t.ROOT_CONTAINER="RootContainer",t))(rt||{});const Lg=x({type:G(V.FUNCTION),value:E()}),Fg=kr(Aa(It,["componentName"]),x({componentName:G("RootContainer")}));function Vg(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 le=Vg(),Ug=(t,e)=>{const r={...t,value:[]},n=t.value;let o=new Lt([]);return e&&(o=e.materialsMode||new Lt([])),n&&(L(n)?r.value=n.map(a=>new D(a,{parent:e,materials:o})):U(n)&&r.value.push(new D(n,{parent:e,materials:o}))),r};class Dt{constructor(e,r){$(this,"nodeType","SLOT"),$(this,"rawData"),$(this,"parent"),$(this,"emitter",le),$(this,"data"),$(this,"id"),$(this,"materialsMode"),this.parent=(r==null?void 0:r.parent)||null,this.rawData=e;const n=(r==null?void 0:r.materials)||new Lt([]);this.materialsMode=n,this.id=et(),this.data=Ug(e,this)}get value(){return this.data}export(e){const r=this.data,n=o=>{if(o instanceof D)return o.export(e);if(U(o)){const a={};return Object.keys(o||{}).forEach(s=>{a[s]=n(o[s])}),a}return L(o)?o.map(a=>n(a)):(e==="design"&&delete o.id,o)};return n(r)}}const Ma=t=>{let e=[];return t.forEach(r=>{const n=r;n.type?n.type===fr.SINGLE?e.push(n.content):n.type===fr.GROUP&&(e=[...e,...Ma(n.content)]):e.push(r)}),e},dr=(t,e,r)=>{if(t.type)return t.type===V.SLOT?new Dt(t,{parent:e,materials:r}):t;if(U(t)){const n={};return Object.keys(t).forEach(o=>{n[o]=pr(t[o],e,r)}),n}else return Array.isArray(t)?t.map(n=>dr(n,e,r)):t},pr=(t,e,r)=>U(t)?dr(t,e,r):L(t)?t.map(n=>dr(n,e,r)):t;class dt{constructor(e,r,n){$(this,"nodeType","PROP"),$(this,"rawData"),$(this,"parent"),$(this,"emitter",le),$(this,"data"),$(this,"name"),$(this,"materialsMode");const o=(n==null?void 0:n.materials)||new Lt([]);this.materialsMode=o,this.parent=n==null?void 0:n.parent,this.rawData=r,this.name=e,this.data=pr(r,this,o)}isIncludeSlot(){return!1}isIncludeExpression(){return!1}get value(){return this.data}updateValue(e){const r=this.data;this.data=pr(e??r,this,this.materialsMode),this.emitter.emit("onPropChange",{value:this.data,preValue:r,node:this}),this.parent&&!(this.parent instanceof Dt)&&this.emitter.emit("onNodeChange",{value:this.parent.value,preValue:this.parent.value,node:this.parent})}get material(){const e=this.parent;if(e instanceof D){const r=e.material;return Ma((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 dt||o instanceof Dt||o instanceof D)return o.export(e);if(L(o))return o.map(a=>n(a));if(U(o)){const a={};return Object.keys(o||{}).forEach(s=>{a[s]=n(o[s])}),a}return o};return n(r)}}const Bg=t=>{if(typeof t=="string")return!0;Jr({data:t,dataStruct:It,throwError:!1})},no=(t,e,r)=>{if(typeof t=="string")return t;const n={...t,id:t.id??et(),children:[],props:{},methods:t.methods||[],configure:Ca(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 dt){n.props[a]=i;return}n.props[a]=new dt(a,i||"",{parent:e,materials:r})}),t.children&&(Array.isArray(t.children)?n.children=t.children.map(a=>{if(a instanceof D)return a;if(U(a)){const s=a;return new D(s,{parent:e,materials:r})}else return a}):(t.children instanceof D&&(n.children=[t.children]),n.children=[new D(t.children,{parent:e,materials:r})])),n};class D{constructor(e,r){$(this,"nodeType","NODE"),$(this,"rawData"),$(this,"data"),$(this,"emitter",le),$(this,"parent"),$(this,"materialsModel"),$(this,"listenerHandler"),$(this,"onChangeCbQueue"),this.rawData=JSON.parse(JSON.stringify(e)),Bg(e);const n=(r==null?void 0:r.materials)||new Lt([]);this.parent=(r==null?void 0:r.parent)||null,this.materialsModel=n,this.data=no(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||et()};return new D(r,{materials:this.materialsModel})}updateWithPlainObj(e){const r={...this.data,...e};return this.data=no(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 Kr(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 D?l.export(e):l),s=n.configure||{},i=s.propsSetter||{},c={};Object.keys(i).forEach(l=>{const f=aa(i,l,!1);f&&(c[l]=f)}),s.propsSetter=c;const u=this.materialsModel.usedMaterials.find(l=>{var f;return l.componentName===((f=this.material)==null?void 0:f.componentName)});this.material&&!u&&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=Wr(d),d}}const oo=(t,e,r)=>{const n={...t,id:et(),props:{},componentName:rt.ROOT_CONTAINER,children:[],methods:t.methods||[],configure:Ca(t.configure||{},{propsSetter:{},advanceSetter:{}}),injectEnvList:t.injectEnvList};let o=[];L(t.children)?o=t.children.map(s=>s instanceof D?s:U(s)?new D(s,{parent:e,materials:r}):s):t.children instanceof D?o.push(t.children):t.children&&U(t.children)&&o.push(new D(t.children,{parent:e,materials:r}));const a=Object.keys(t.props||{});return a.length&&a.forEach(s=>{var i;const c=(i=t.props)==null?void 0:i[s];c instanceof dt?n.props[s]=c:n.props[s]=new dt(s,c||"",{parent:e,materials:r})}),n.children=o,n};class ae{constructor(e,{parent:r,materials:n}){$(this,"rawData"),$(this,"data"),$(this,"nodeType",rt.ROOT_CONTAINER),$(this,"emitter",le),$(this,"materialsModel"),$(this,"listenerHandler"),$(this,"onChangeCbQueue"),$(this,"parent"),this.materialsModel=n,this.rawData=JSON.parse(JSON.stringify(e)),this.data=oo(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=oo(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 Kr(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=zr.SAVE){var r;const n=this.data,o={};Object.keys(n.props||{}).forEach(c=>{o[c]=n.props[c].export(e)});const a=((r=n.children)==null?void 0:r.map(c=>{var u;return(u=c==null?void 0:c.export)==null?void 0:u.call(c,e)}))||[],s={...n,props:o,children:a.filter(c=>c),condition:n.condition,extra:this.data.extra};let i=$a(s,["id"]);return i=Wr(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||et()};return new ae(r,{materials:this.materialsModel,parent:null})}}const mt=t=>(t==null?void 0:t.type)===V.EXPRESSION,Ia=t=>(t==null?void 0:t.type)===V.FUNCTION,Gg=t=>(t==null?void 0:t.type)===V.ACTION,et=()=>Math.random().toString(32).slice(3,9),kg=t=>(t==null?void 0:t.nodeType)==="NODE",hr=t=>(t==null?void 0:t.nodeType)==="PROP",Hg=t=>(t==null?void 0:t.nodeType)==="SLOT",Wr=t=>hg(t,e=>U(e)?!Object.keys(e).length:L(e)?!e.length:!e);function zg(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 D){r.push(i);return}if(i instanceof Dt&&a(i.value.value),i instanceof dt){a(i.value);return}if(U(i)){const c=i;Object.keys(c).forEach(u=>{a(c[u])});return}if(L(i)){i.forEach(c=>{a(c)});return}};a(o);const s=(n==null?void 0:n.value.children.filter(i=>i instanceof D))||[];r.push(...s)}}function Kr(t,e){return zg(t,r=>r.id===e)}const qg=t=>{const e=ya(t),r=e.snippets;return delete e.snippets,e.snippets=r.map(n=>({...e,...n,id:n.id||`${t.componentName}-${et()}`,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 Jg{constructor(e){$(this,"rawData"),$(this,"data"),this.rawData=e,this.data=qg(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 Be=t=>{if(!L(t))throw new Error("Materials must be a array");return t.map(e=>new Jg(e))},Wg=t=>{t==null||t.forEach(e=>{Jr({data:e,dataStruct:Ig,throwError:!1})})};class Lt{constructor(e){$(this,"rawData"),$(this,"data"),$(this,"usedMaterials",[]),this.rawData=e,Wg(e),this.data=Be(e)}addMaterials(e){const r=Be(e),n=[],o=this.data.map(s=>{const i=r.findIndex(c=>c.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=Be(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:[]},c=n[a];if(c.length!==0){c.forEach(l=>{const f=l.category||"default";s.includes(f)||(s.push(f),i[f]=[]),i[f].push(l)});const u=[];s.forEach(l=>{i[l].length&&u.push({name:l,list:i[l]})});const d={name:a,list:u};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=x({version:O(E()),name:O(E()),css:O(E()),lifecycle:O(T()),props:O(T()),methods:O(I(Lg)),componentsMeta:I(kr(x({componentName:E()}),Hr)),thirdLibs:O(jg),componentsTree:Fg,assets:O(I(T())),extra:O(T())}),Da=t=>(Jr({data:t,dataStruct:Kg,throwError:!1}),t),Ge=(t,e,r)=>({...t,componentsTree:new ae(t.componentsTree,{parent:e,materials:r})});class Ee{constructor(e,r){$(this,"nodeType","PAGE"),$(this,"rawData"),$(this,"emitter",le),$(this,"data"),$(this,"parent"),$(this,"materialsModel"),$(this,"assetPackagesList"),Da(e),this.rawData=JSON.parse(JSON.stringify(e)),this.materialsModel=new Lt((r==null?void 0:r.materials)||[]),this.data=Ge(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=Ge(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=Ge(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 Kr(r,e)}addNode(e,r,n="AFTER"){var o;if(n==="AFTER"||n==="BEFORE"){const a=r.parent;if(a===null&&r instanceof ae)return console.warn("Not found parent node"),!1;if(a instanceof dt)return console.warn("CProp can not add node"),!1;if(a instanceof Dt){const i=a.value.value,c=i.findIndex(u=>u===r)??-1;return c>=0?(n==="BEFORE"?i.splice(c,0,e):i.splice(c+1,0,e),e.parent=a,(o=a.parent)==null||o.updateValue(),!0):!1}if(a instanceof Ee)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(U(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 D(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=et();const n=new D(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 D?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 D&&a instanceof D?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 Dt){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 D||n instanceof ae){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=zr.SAVE){var r;const n=this.data.componentsTree.export(e),o=this.assetPackagesList,a=[],s=this.materialsModel.usedMaterials.map(c=>{const u=o.find(d=>{var l;return d.package===((l=c.value.npm)==null?void 0:l.package)});return u&&a.push(u),{componentName:c.componentName,...ya(c.value.npm||{})}}).filter(c=>c.componentName&&c.package&&c.version?!0:(console.warn(`${JSON.stringify(c,null,2)} not a valid material info`),!1));this.materialsModel.usedMaterials=[];let i={...this.data,componentsTree:Wr(n),componentsMeta:s,thirdLibs:this.data.thirdLibs,assets:[],extra:this.data.extra};return(r=this.data.thirdLibs)==null||r.forEach(c=>{const u=o.find(d=>c.package===d.package);u&&a.push(u)}),i.assets=bg(a,c=>c.package),i=$a(i,["id"]),JSON.parse(JSON.stringify(i))}getRootNode(){return this.data.componentsTree}}rt.ROOT_CONTAINER;const fe="DYNAMIC",La=["$$context","$$nodeModel"],Qr="ON_DID_RENDER",Yr="ON_WILL_DESTROY",Fa=[Qr,Yr],gr=(t,e)=>{let r=t;return e&&(r={...t},r.__proto__=e||null),r},se=(t,e={},...r)=>typeof t=="string"||typeof t=="number"?String(t):(La.forEach(o=>{o in e&&t.__CP_TYPE__!==fe&&delete e[o]}),N.createElement(t,e,...r)),ao=(t={},e)=>{const r=[],n=(o,a)=>{let s=a;hr(a)&&(s=a.value),e(s)?r.push({keyPath:o,val:s}):ot(s)?s.forEach((i,c)=>{n([...o,String(c)],i)}):Ft(s)&&Object.keys(s).forEach(i=>{n([...o,i],s[i])})};return n(["$root"],t),r},Rt=(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=Vt({funcName:"",funcBody:`function() {
|
|
61
61
|
${l.value}
|
|
62
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=Qg(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}=Yg(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=Xg(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=Zg(l,e);let h=[...a];e.$$response!==void 0&&(h=[e.$$response,h]);const g=f(...h);s[l.id]=await g}};let c=r[0];const u=new Set;for(;c;){if(u.has(c.id))return;await i(c),u.add(c.id),c=r.find(l=>(c==null?void 0:c.next)&&l.id===(c==null?void 0:c.next))}}};function Qg(t,e){return bt(t.link,e)}const bt=(t,e)=>function(...r){return mt(t)?yt(t.value,{...e.context,nodeContext:e.context,storeManager:e.storeManager,$$response:e.$$response,actionVariableSpace:e.actionVariableSpace,nodeModel:e.nodeModel}):Ia(t)?Vt({funcName:t.name||"",funcBody:t.value,nodeContext:e.context,storeManager:e.storeManager,$$response:e.$$response,actionVariableSpace:e.actionVariableSpace,nodeModel:e.nodeModel})(...r):t},Yg=(t,e)=>({run:function(...a){var f,h;let s="";t.apiPath&&(s=bt(t.apiPath,e)(...a));const i=t.body||{};Object.keys(i).forEach(g=>{i[g]=bt(i[g],e)(...a)});const c=t.query||{};Object.keys(c).forEach(g=>{c[g]=bt(c[g],e)(...a)});const u=t.header||{};Object.keys(u).forEach(g=>{u[g]=bt(u[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:u,body:i,query:c})},afterSuccessResponse:async(a,...s)=>{if(!t.afterSuccessResponse)return a;const i=[...t.afterSuccessResponse||[],...t.afterFailedResponse||[]];return Rt({handler:i},{...e,$$response:a})(...s)},afterFailedResponse:async(a,...s)=>{if(!t.afterFailedResponse)return a;const i=[...t.afterFailedResponse||[],...t.afterSuccessResponse||[]];return Rt({handler:i},{...e,$$response:a})(...s)}}),Xg=(t,e)=>(...r)=>{const n=Vt({funcName:"",funcBody:`
|
|
63
63
|
function () {
|
|
@@ -69,7 +69,7 @@ ${l.value}
|
|
|
69
69
|
func.apply(null, args);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
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 bt(a,e)(...s)})),n(...o)},Zg=(t,e)=>async(...r)=>{const o=bt(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},he=(t={},e)=>{const{$$context:r,getComponent:n,storeManager:o}=e,a=t,s=c=>{if(Array.isArray(c))return c.map(u=>s(u));if(hr(c))return s(c.value);if(Hg(c)){const u=c.value,d=u.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}-${fe}`,g=n(f),b=Xr(g,f,{...e}),p=u.params||[];return{component:(...y)=>{const _=_r(y,p),S=gr({params:_,nodeRefs:r.nodeRefs,getProps:function(){},callEventMethod:function(){}},r);return se(b,{$$context:S,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(Uo(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(mt(c))return yt(c.value,{nodeContext:r,storeManager:e.storeManager,nodeModel:e.nodeModel});if(Ia(c)){const u=c;return Vt({funcBody:u.value,funcName:u.name||"",nodeContext:r,storeManager:o,nodeModel:e.nodeModel})}else{if(Gg(c))return Rt(c,{context:r,storeManager:o,actionVariableSpace:{},nodeModel:e.nodeModel});if(Ft(c)){let u=c;hr(c)&&(u=c.value);const d=u,l={};return Object.keys(u).forEach(f=>{l[f]=s(d[f])}),l}else return c}}},i={};return Object.keys(a).forEach(c=>{const u=a[c];i[c]=s(u)}),i},tv=(t,e)=>{const{runtimeComponentCache:r,$$context:n={},getComponent:o,renderMode:a}=e,{$$context:s,idx:i,...c}=e;return typeof t=="string"?se(t):kg(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,{...c}),!r.get(l)&&a!=="design"&&r.set(l,{component:f})}const h=`${l}-${fe}`;return se(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:c,processNodeConfigHook:u,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}_${et()}`);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===rt.ROOT_CONTAINER?this.setState(p):this.storeState.setState(p)});w(this,"getStyleDomById",p=>{const v=this.mediaStyleDomMap;let m=v[p];return m||(m=l.createElement("style"),v[p]=m),m.id=p,m});w(this,"addMediaCSS",()=>{var m;let p=this.domHeader;if(p||(p=(m=l.getElementsByTagName("head"))==null?void 0:m[0],this.domHeader=p),!this.domHeader){console.warn("not found header dom");return}const v=this._NODE_MODEL.value.css;v&&v.value.forEach(y=>{var j;const _=`${this.UNIQUE_ID}_${y.state}`;let S=tr(this._NODE_MODEL);if(y.state!=="normal"&&(S=`${S}:${y.state}`),y.text){const x=this.getStyleDomById(_);x.innerText=`.${S} { ${y.text} }`,p==null||p.appendChild(x)}(j=y.media)!=null&&j.length&&y.media.forEach(x=>{const C=`${_}_${x.type}_${x.value}`,F=this.getStyleDomById(C);F.media=`screen and (${x.type}:${x.value}px)`,F.innerHTML=`.${S} { ${x.text} }`,p==null||p.appendChild(F)})})});w(this,"removeMediaCSS",()=>{const p=this.mediaStyleDomMap;Object.keys(p).forEach(v=>{var m;(m=this.domHeader)==null||m.removeChild(p[v])}),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 v=e.value.nodeName||e.id;e.value.componentName===rt.ROOT_CONTAINER&&(v="globalState"),this.nodeName=v;const m=n.getStore(v);m?(this.storeState=m,m.setState({...e.value.state||{}})):this.storeState=n.addStore(v,()=>({...e.value.state||{}}));const y=this.storeState.subscribe(S=>{this.setStateIfChanged(S)});this.storeListenDisposeList.push(y),this.connectStore();const _=o.get(v);_?this.variableSpace=_:(this.variableSpace={staticVar:{},methods:{}},o.add(v,this.variableSpace))}setStateIfChanged(p){e.value.componentName!==rt.ROOT_CONTAINER&&this.setState(v=>{const m=typeof p=="function"?p(v):p;return Qu(v,{...v,...m})?null:m})}connectStore(){const p=ao(e.props,S=>!!mt(S)),v=ao({css:e.value.css,class:e.value.classNames},S=>!!mt(S));let m=[];[...p,...v].map(S=>{const j=S.val,x=[new RegExp(`(?<=context\\.stateManager(?:\\.|\\[["'])?)\\w+(?=(?:["']?\\])?(?:\\.|\\[)?["']?state)`,"gim"),/\$ALL_STATE(?:\.|(?:\[\s*["']))(\w+)(?=(?:["']\s*\])?)/gim,/getStateObj\(["']([^"']+)["']\)/gim],C=Ho(j.value,x);m=[...m,...C],/\$CTX\.globalState|\$G_STATE/.test(j.value)&&m.push("globalState")}).filter(Boolean);const y=Array.from(new Set(m)),_=[];y.length&&y.forEach(S=>{n.getStore(S)||(n.addStore(S,()=>({})),console.warn(n,S,"not exits, auto create"));const x=n.connect(S,C=>{this.setStateIfChanged(C)});_.push(x)}),this.storeListenDisposeList=_}componentDidMount(){var m;this.addMediaCSS(),a==null||a(this.targetComponentRef,e,this),s==null||s(this,e);const p=(m=e.value.eventListener)==null?void 0:m.find(y=>y.name===Qr);p&&Rt(p.func,{context:this.createCurrentNodeCtx(),storeManager:n,actionVariableSpace:{},nodeModel:e})();const v=()=>{n.setStore(e.value.nodeName||e.id,this.storeState),this.storeState.setState({...this.state,...e.value.state||{}}),this.rebuildNode()};e.onChange(v)}componentWillUnmount(){var m;this.storeListenDisposeList.forEach(y=>y()),this.removeMediaCSS(),i==null||i(this,e);const p=Yr,v=(m=e.value.eventListener)==null?void 0:m.find(y=>y.name===p);v&&Rt(v.func,{context:this.createCurrentNodeCtx(),storeManager:n,actionVariableSpace:{},nodeModel:e})()}transformMethods(p){const{context:v}=p,m=he({methods:e.value.methods},{$$context:v,...f,nodeModel:e}),y=e.value.methods||[],_=m.methods,S=y.reduce((j,x,C)=>(j[x.name]=_[C],j),{});v.methods=S,this.variableSpace.methods=Object.assign(this.variableSpace.methods,S)}processRootContext(p){e.value.componentName===rt.ROOT_CONTAINER&&(p.globalState=this.state,p.updateGlobalState=this.updateState,p.requestAPI=d,p.getGlobalState=()=>this.state)}processNodeClassName(p,v){var _;const m=((_=e.value.classNames)==null?void 0:_.map(S=>{var C;const j=S.name;return(mt(S.status)?yt(((C=S.status)==null?void 0:C.value)||"",{nodeContext:v,nodeModel:e,storeManager:n}):!1)?j:""}))||[];let y=`${p??""} ${m.join(" ")}`.trim();return e.value.css&&(y=`${tr(e)} ${y}`.trim()),y}processNodeStyle(p){if(!e.value.style)return{};const v=he({style:e.value.style},{$$context:p,...f,nodeModel:e});return ko(v.style||[])}processNodeChild(p,v){let m=[];if(p!==void 0)m=Array.isArray(p)?p:[p];else{const y=[];e.value.children.forEach((S,j)=>{const x=tv(S,{$$context:v,idx:j,...f});y.push(x)}),m=y}return m}processNodeConditionAndConfigHook(p,v,m){let y=e.value.condition??!0;typeof y!="boolean"&&(y=yt(y.value,{nodeContext:m||{},nodeModel:e,storeManager:n}));let _={condition:y,props:p};u&&(_=u(_,e));const S=se(t,_.props,...v);return this._CONDITION=_.condition,_.condition?S:N.createElement("div",{key:p.key,style:{display:"none"}},S)}processNodeEventListener(p){const v=e.value.eventListener,m={};return v==null||v.forEach(y=>{if(Fa.includes(y.name))return;const _=Rt(y.func,{context:p,storeManager:n,actionVariableSpace:{},nodeModel:e});m[y.name]=_}),m}createCurrentNodeCtx(){const{$$context:p}=this.props,v=e.value.nodeName||e.id,m=e.id,y={state:this.state||{},staticVar:this.variableSpace.staticVar,updateState:this.updateState,storeManager:n,getState:()=>n.getStateObj(v),getStateObj:()=>n.getStateObj(v),getStateObjById:S=>n.getStateObj(S),stateManager:n.getStateSnapshot(),getMethods:()=>{const S=o.get(m).methods,j=c.get(m).current;return er(S,j)},getMethodsById:S=>{const j=o.get(S).methods,x=c.get(S).current;return er(j,x)},getStaticVar:()=>o.get(v).staticVar,getStaticVarById:S=>o.get(S).staticVar,callEventMethod:(S,j)=>{var C,F;const x=c.get(m).current;(F=x==null?void 0:(C=x.props)[S])==null||F.call(C,j)},getProps:()=>{const S=c.get(m).current;return S==null?void 0:S.props},nodeRefs:p.nodeRefs};return this.processRootContext(y),gr(y,p)}injectEngEnv(){const p={},v=e.value.injectEnvList||[];if(Array.isArray(e.value.injectEnvList)){const m={[Pa.COMPONENTS]:r.components};v.reduce((y,_)=>(y[_]=m[_],y),p)}return p}renderCore(){const{$$context:p,...v}=this.props,m={key:e.id,...e.props,...v},y=this.createCurrentNodeCtx();this.transformMethods({context:y});let _=he(m,{$$context:y,...f,nodeModel:e});const S=this.injectEngEnv();Object.assign(_,S);const j=this.processNodeClassName(_.className,y);_.className=j;const x=this.processNodeStyle(y);_.style=x;const{children:C}=_;delete _.children;const F=this.processNodeChild(C,y);if(_.ref=this.targetComponentRef,e.value.eventListener){const gt=this.processNodeEventListener(y);_={..._,...gt}}return this.processNodeConditionAndConfigHook(_,F,y)}renderLoop(){const{$$context:p,...v}=this.props,m={key:e.id,...e.props,...v},y=this.createCurrentNodeCtx();this.transformMethods({context:y});const _=e.value.loop;let S=[];if(_&&_.open){this.targetComponentRef.current=[];let j=_.data||[];if(mt(_.data)){const x=_.data;j=yt(x.value,{nodeContext:y||{},storeManager:n,nodeModel:e})||[]}return S=j.map((...x)=>{const C=x[1],F=[_.forName||"item",_.forIndex||"index"],ht=_r(x,F);let gt="loopData";_.name&&(gt=`${gt}${_.name}`);const vt=gr({[gt]:ht,nodeRefs:y.nodeRefs,getProps:function(){},callEventMethod:function(){}},y);let B=he(m,{$$context:vt,...f,nodeModel:e});const za=this.injectEngEnv();Object.assign(B,za);const qa=this.processNodeClassName(B.className,vt);B.className=qa;const Ja=this.processNodeStyle(vt);B.style=Ja;const{children:Wa}=B;delete B.children;const Ka=this.processNodeChild(Wa,vt);if(B.key=`${B.key}-${C}`,mt(_.key)){const Ht=_.key,Qa=yt(Ht.value,{nodeContext:vt||{},storeManager:n,nodeModel:e});B.key+=`-${Qa}`}if(B.ref=Ht=>{this.targetComponentRef.current=this.targetComponentRef.current||[],this.targetComponentRef.current[C]=Ht},e.value.eventListener){const Ht=this.processNodeEventListener(vt);B={...B,...Ht}}return this.processNodeConditionAndConfigHook(B,Ka,vt)}),S}}render(){const p=e.value.loop;return p&&p.open?this.renderLoop():this.renderCore()}}return w(h,"__CP_TYPE__",fe),h.displayName=`${e.value.componentName}Dynamic`,h};class Va{constructor(){w(this,"renderMode","normal");w(this,"components",{});w(this,"storeManager",new sl);w(this,"variableManager",new il);w(this,"runtimeComponentCache",new Map);w(this,"onGetRef");w(this,"onGetComponent");w(this,"onComponentMount");w(this,"refManager",new Sr);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=qo(r,this.components);return Bo(n)||(n=Go(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:c,renderMode:u,processNodeConfigHook:d,requestAPI:l,doc:f}){this.renderMode=u,this.components=r,this.onGetRef=n,this.onGetComponent=s,this.onComponentMount=i,this.onComponentDestroy=c,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:c,renderMode:u,requestAPI:l,components:this.components,doc:f}),p={},v=h.props;return Object.keys(v).forEach(m=>{p[m]=v[m].value}),p.$$context=a,se(b,p)}clear(){this.runtimeComponentCache.clear(),this.storeManager.destroy()}}const ev=po(new Va);function rv(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ke={exports:{}},Jt={};/**
|
|
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 bt(a,e)(...s)})),n(...o)},Zg=(t,e)=>async(...r)=>{const o=bt(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},he=(t={},e)=>{const{$$context:r,getComponent:n,storeManager:o}=e,a=t,s=c=>{if(Array.isArray(c))return c.map(u=>s(u));if(hr(c))return s(c.value);if(Hg(c)){const u=c.value,d=u.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}-${fe}`,g=n(f),b=Xr(g,f,{...e}),p=u.params||[];return{component:(...y)=>{const _=_r(y,p),S=gr({params:_,nodeRefs:r.nodeRefs,getProps:function(){},callEventMethod:function(){}},r);return se(b,{$$context:S,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(Uo(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(mt(c))return yt(c.value,{nodeContext:r,storeManager:e.storeManager,nodeModel:e.nodeModel});if(Ia(c)){const u=c;return Vt({funcBody:u.value,funcName:u.name||"",nodeContext:r,storeManager:o,nodeModel:e.nodeModel})}else{if(Gg(c))return Rt(c,{context:r,storeManager:o,actionVariableSpace:{},nodeModel:e.nodeModel});if(Ft(c)){let u=c;hr(c)&&(u=c.value);const d=u,l={};return Object.keys(u).forEach(f=>{l[f]=s(d[f])}),l}else return c}}},i={};return Object.keys(a).forEach(c=>{const u=a[c];i[c]=s(u)}),i},tv=(t,e)=>{const{runtimeComponentCache:r,$$context:n={},getComponent:o,renderMode:a}=e,{$$context:s,idx:i,...c}=e;return typeof t=="string"?se(t):kg(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,{...c}),!r.get(l)&&a!=="design"&&r.set(l,{component:f})}const h=`${l}-${fe}`;return se(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:c,processNodeConfigHook:u,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}_${et()}`);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===rt.ROOT_CONTAINER?this.setState(p):this.storeState.setState(p)});w(this,"getStyleDomById",p=>{const v=this.mediaStyleDomMap;let m=v[p];return m||(m=l.createElement("style"),v[p]=m),m.id=p,m});w(this,"addMediaCSS",()=>{var m;let p=this.domHeader;if(p||(p=(m=l.getElementsByTagName("head"))==null?void 0:m[0],this.domHeader=p),!this.domHeader){console.warn("not found header dom");return}const v=this._NODE_MODEL.value.css;v&&v.value.forEach(y=>{var j;const _=`${this.UNIQUE_ID}_${y.state}`;let S=tr(this._NODE_MODEL);if(y.state!=="normal"&&(S=`${S}:${y.state}`),y.text){const A=this.getStyleDomById(_);A.innerText=`.${S} { ${y.text} }`,p==null||p.appendChild(A)}(j=y.media)!=null&&j.length&&y.media.forEach(A=>{const C=`${_}_${A.type}_${A.value}`,F=this.getStyleDomById(C);F.media=`screen and (${A.type}:${A.value}px)`,F.innerHTML=`.${S} { ${A.text} }`,p==null||p.appendChild(F)})})});w(this,"removeMediaCSS",()=>{const p=this.mediaStyleDomMap;Object.keys(p).forEach(v=>{var m;(m=this.domHeader)==null||m.removeChild(p[v])}),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 v=e.value.nodeName||e.id;e.value.componentName===rt.ROOT_CONTAINER&&(v="globalState"),this.nodeName=v;const m=n.getStore(v);m?(this.storeState=m,m.setState({...e.value.state||{}})):this.storeState=n.addStore(v,()=>({...e.value.state||{}}));const y=this.storeState.subscribe(S=>{this.setStateIfChanged(S)});this.storeListenDisposeList.push(y),this.connectStore();const _=o.get(v);_?this.variableSpace=_:(this.variableSpace={staticVar:{},methods:{}},o.add(v,this.variableSpace))}setStateIfChanged(p){e.value.componentName!==rt.ROOT_CONTAINER&&this.setState(v=>{const m=typeof p=="function"?p(v):p;return Qu(v,{...v,...m})?null:m})}connectStore(){const p=ao(e.props,S=>!!mt(S)),v=ao({css:e.value.css,class:e.value.classNames},S=>!!mt(S));let m=[];[...p,...v].map(S=>{const j=S.val,A=[new RegExp(`(?<=context\\.stateManager(?:\\.|\\[["'])?)\\w+(?=(?:["']?\\])?(?:\\.|\\[)?["']?state)`,"gim"),/\$ALL_STATE(?:\.|(?:\[\s*["']))(\w+)(?=(?:["']\s*\])?)/gim,/getStateObj\(["']([^"']+)["']\)/gim],C=Ho(j.value,A);m=[...m,...C],/\$CTX\.globalState|\$G_STATE/.test(j.value)&&m.push("globalState")}).filter(Boolean);const y=Array.from(new Set(m)),_=[];y.length&&y.forEach(S=>{if(!S)return;n.getStore(S)||(n.addStore(S,()=>({})),console.warn(n,S,"not exits, auto create"));const A=n.connect(S,C=>{this.setStateIfChanged(C)});_.push(A)}),this.storeListenDisposeList=_}componentDidMount(){var m;this.addMediaCSS(),a==null||a(this.targetComponentRef,e,this),s==null||s(this,e);const p=(m=e.value.eventListener)==null?void 0:m.find(y=>y.name===Qr);p&&Rt(p.func,{context:this.createCurrentNodeCtx(),storeManager:n,actionVariableSpace:{},nodeModel:e})();const v=()=>{n.setStore(e.value.nodeName||e.id,this.storeState),this.storeState.setState({...this.state,...e.value.state||{}}),this.rebuildNode()};e.onChange(v)}componentWillUnmount(){var m;this.storeListenDisposeList.forEach(y=>y()),this.removeMediaCSS(),i==null||i(this,e);const p=Yr,v=(m=e.value.eventListener)==null?void 0:m.find(y=>y.name===p);v&&Rt(v.func,{context:this.createCurrentNodeCtx(),storeManager:n,actionVariableSpace:{},nodeModel:e})()}transformMethods(p){const{context:v}=p,m=he({methods:e.value.methods},{$$context:v,...f,nodeModel:e}),y=e.value.methods||[],_=m.methods,S=y.reduce((j,A,C)=>(j[A.name]=_[C],j),{});v.methods=S,this.variableSpace.methods=Object.assign(this.variableSpace.methods,S)}processRootContext(p){e.value.componentName===rt.ROOT_CONTAINER&&(p.globalState=this.state,p.updateGlobalState=this.updateState,p.requestAPI=d,p.getGlobalState=()=>this.state)}processNodeClassName(p,v){var _;const m=((_=e.value.classNames)==null?void 0:_.map(S=>{var C;const j=S.name;return(mt(S.status)?yt(((C=S.status)==null?void 0:C.value)||"",{nodeContext:v,nodeModel:e,storeManager:n}):!1)?j:""}))||[];let y=`${p??""} ${m.join(" ")}`.trim();return e.value.css&&(y=`${tr(e)} ${y}`.trim()),y}processNodeStyle(p){if(!e.value.style)return{};const v=he({style:e.value.style},{$$context:p,...f,nodeModel:e});return ko(v.style||[])}processNodeChild(p,v){let m=[];if(p!==void 0)m=Array.isArray(p)?p:[p];else{const y=[];e.value.children.forEach((S,j)=>{const A=tv(S,{$$context:v,idx:j,...f});y.push(A)}),m=y}return m}processNodeConditionAndConfigHook(p,v,m){let y=e.value.condition??!0;typeof y!="boolean"&&(y=yt(y.value,{nodeContext:m||{},nodeModel:e,storeManager:n}));let _={condition:y,props:p};u&&(_=u(_,e));const S=se(t,_.props,...v);return this._CONDITION=_.condition,_.condition?S:N.createElement("div",{key:p.key,style:{display:"none"}},S)}processNodeEventListener(p){const v=e.value.eventListener,m={};return v==null||v.forEach(y=>{if(Fa.includes(y.name))return;const _=Rt(y.func,{context:p,storeManager:n,actionVariableSpace:{},nodeModel:e});m[y.name]=_}),m}createCurrentNodeCtx(){const{$$context:p}=this.props,v=e.value.nodeName||e.id,m=e.id,y={state:this.state||{},staticVar:this.variableSpace.staticVar,updateState:this.updateState,storeManager:n,getState:()=>n.getStateObj(v),getStateObj:()=>n.getStateObj(v),getStateObjById:S=>n.getStateObj(S),stateManager:n.getStateSnapshot(),getMethods:()=>{const S=o.get(m).methods,j=c.get(m).current;return er(S,j)},getMethodsById:S=>{const j=o.get(S).methods,A=c.get(S).current;return er(j,A)},getStaticVar:()=>o.get(v).staticVar,getStaticVarById:S=>o.get(S).staticVar,callEventMethod:(S,j)=>{var C,F;const A=c.get(m).current;(F=A==null?void 0:(C=A.props)[S])==null||F.call(C,j)},getProps:()=>{const S=c.get(m).current;return S==null?void 0:S.props},nodeRefs:p.nodeRefs};return this.processRootContext(y),gr(y,p)}injectEngEnv(){const p={},v=e.value.injectEnvList||[];if(Array.isArray(e.value.injectEnvList)){const m={[Pa.COMPONENTS]:r.components};v.reduce((y,_)=>(y[_]=m[_],y),p)}return p}renderCore(){const{$$context:p,...v}=this.props,m={key:e.id,...e.props,...v},y=this.createCurrentNodeCtx();this.transformMethods({context:y});let _=he(m,{$$context:y,...f,nodeModel:e});const S=this.injectEngEnv();Object.assign(_,S);const j=this.processNodeClassName(_.className,y);_.className=j;const A=this.processNodeStyle(y);_.style=A;const{children:C}=_;delete _.children;const F=this.processNodeChild(C,y);if(_.ref=this.targetComponentRef,e.value.eventListener){const gt=this.processNodeEventListener(y);_={..._,...gt}}return this.processNodeConditionAndConfigHook(_,F,y)}renderLoop(){const{$$context:p,...v}=this.props,m={key:e.id,...e.props,...v},y=this.createCurrentNodeCtx();this.transformMethods({context:y});const _=e.value.loop;let S=[];if(_&&_.open){this.targetComponentRef.current=[];let j=_.data||[];if(mt(_.data)){const A=_.data;j=yt(A.value,{nodeContext:y||{},storeManager:n,nodeModel:e})||[]}return S=j.map((...A)=>{const C=A[1],F=[_.forName||"item",_.forIndex||"index"],ht=_r(A,F);let gt="loopData";_.name&&(gt=`${gt}${_.name}`);const vt=gr({[gt]:ht,nodeRefs:y.nodeRefs,getProps:function(){},callEventMethod:function(){}},y);let B=he(m,{$$context:vt,...f,nodeModel:e});const za=this.injectEngEnv();Object.assign(B,za);const qa=this.processNodeClassName(B.className,vt);B.className=qa;const Ja=this.processNodeStyle(vt);B.style=Ja;const{children:Wa}=B;delete B.children;const Ka=this.processNodeChild(Wa,vt);if(B.key=`${B.key}-${C}`,mt(_.key)){const Ht=_.key,Qa=yt(Ht.value,{nodeContext:vt||{},storeManager:n,nodeModel:e});B.key+=`-${Qa}`}if(B.ref=Ht=>{this.targetComponentRef.current=this.targetComponentRef.current||[],this.targetComponentRef.current[C]=Ht},e.value.eventListener){const Ht=this.processNodeEventListener(vt);B={...B,...Ht}}return this.processNodeConditionAndConfigHook(B,Ka,vt)}),S}}render(){const p=e.value.loop;return p&&p.open?this.renderLoop():this.renderCore()}}return w(h,"__CP_TYPE__",fe),h.displayName=`${e.value.componentName}Dynamic`,h};class Va{constructor(){w(this,"renderMode","normal");w(this,"components",{});w(this,"storeManager",new sl);w(this,"variableManager",new il);w(this,"runtimeComponentCache",new Map);w(this,"onGetRef");w(this,"onGetComponent");w(this,"onComponentMount");w(this,"refManager",new Sr);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=qo(r,this.components);return Bo(n)||(n=Go(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:c,renderMode:u,processNodeConfigHook:d,requestAPI:l,doc:f}){this.renderMode=u,this.components=r,this.onGetRef=n,this.onGetComponent=s,this.onComponentMount=i,this.onComponentDestroy=c,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:c,renderMode:u,requestAPI:l,components:this.components,doc:f}),p={},v=h.props;return Object.keys(v).forEach(m=>{p[m]=v[m].value}),p.$$context=a,se(b,p)}clear(){this.runtimeComponentCache.clear(),this.storeManager.destroy()}}const ev=po(new Va);function rv(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ke={exports:{}},Jt={};/**
|
|
73
73
|
* @license React
|
|
74
74
|
* react-jsx-runtime.production.min.js
|
|
75
75
|
*
|
|
@@ -85,5 +85,5 @@ ${l.value}
|
|
|
85
85
|
*
|
|
86
86
|
* This source code is licensed under the MIT license found in the
|
|
87
87
|
* LICENSE file in the root directory of this source tree.
|
|
88
|
-
*/var co;function bv(){if(co)return z;co=1;function t(s){var i="https://react.dev/errors/"+s;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)i+="&args[]="+encodeURIComponent(arguments[c])}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,c=s;if(s.alternate)for(;i.return;)i=i.return;else{s=i;do i=s,(i.flags&4098)!==0&&(c=i.return),s=i.return;while(s)}return i.tag===3?c: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 c=s,u=i;;){var d=c.return;if(d===null)break;var l=d.alternate;if(l===null){if(u=d.return,u!==null){c=u;continue}break}if(d.child===l.child){for(l=d.child;l;){if(l===c)return r(d),s;if(l===u)return r(d),i;l=l.sibling}throw Error(t(188))}if(c.return!==u.return)c=d,u=l;else{for(var f=!1,h=d.child;h;){if(h===c){f=!0,c=d,u=l;break}if(h===u){f=!0,u=d,c=l;break}h=h.sibling}if(!f){for(h=l.child;h;){if(h===c){f=!0,c=l,u=d;break}if(h===u){f=!0,u=l,c=d;break}h=h.sibling}if(!f)throw Error(t(189))}}if(c.alternate!==u)throw Error(t(190))}if(c.tag!==3)throw Error(t(188));return c.stateNode.current===c?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 z.doesFiberContain=function(s,i){for(var c=s.alternate;i!==null;){if(i===s||i===c)return!0;i=i.return}return!1},z.findCurrentFiberUsingSlowPath=n,z.findCurrentHostFiber=function(s){return s=n(s),s!==null?o(s):null},z.findCurrentHostFiberWithNoPortals=function(s){return s=n(s),s!==null?a(s):null},z.getContainerFromFiber=function(s){return s.tag===3?s.stateNode.containerInfo:null},z.getNearestMountedFiber=e,z.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},z.isFiberMounted=function(s){return e(s)===s},z.isFiberSuspenseAndTimedOut=function(s){var i=s.memoizedState;return s.tag===13&&i!==null&&i.dehydrated===null},z.isMounted=function(s){return(s=s._reactInternals)?e(s)===s:!1},z}var uo;function _v(){return uo||(uo=1,He.exports=bv()),He.exports}var Sv=_v();function Ov(t){return t._reactInternals}function Ev(t){const e=Ov(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=Sv.findCurrentHostFiber(e);return r===null?null:r.stateNode}function wv(t){return Ev(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 Ft(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 Cv 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 c,u;const o=this;let a=r;const s=(u=(c=n.material)==null?void 0:c.value.advanceCustom)==null?void 0:u.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}_${et()}`);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?wv(this):this._dom}render(){var m,y,_,S;const{children:f=[],onlyRenderChild:h,...g}=this.props;let b=f;if(ot(f)||(b=[f]),!!!b.filter(Boolean).length&&(n.isContainer()||n.value.componentName===rt.ROOT_CONTAINER)){const j=(y=(m=n.material)==null?void 0:m.value.advanceCustom)==null?void 0:y.dropPlaceholder;b.push(N.createElement(j||o.dropPlaceholder,{node:n}))}return h?b:((S=(_=n.material)==null?void 0:_.value.advanceCustom)==null?void 0:S.autoGetDom)??!0?N.createElement(a,g,...b):N.createElement(a,{...g,$SET_DOM:x=>{this._dom=x}},...b)}}return N.forwardRef(function(l,f){return N.createElement(yv,{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 c;if((s==null?void 0:s._STATUS)==="DESTROY")return;const i=s.getDom();if(i&&!(i instanceof Text))if(n){const u=Array.from(((c=i.querySelectorAll)==null?void 0:c.call(i,n))||[]);a.push(...u)}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(Ua,{onGetComponent:n,...a,components:this._components,processNodeConfigHook:(s,i)=>{var g,b;if(i.nodeType!=="NODE")return s;const{props:c,condition:u}=s;let d={...c};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(Ft(f))d={...d,...f};else if(typeof f=="function"){const p=f(d);d={...d,...p}}}let h=u;return l.condition===!1&&(h=l.condition),{props:Yu(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},$v=()=>{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 ge={exports:{}},Nv=ge.exports,lo;function jv(){return lo||(lo=1,function(t,e){(function(r,n){t.exports=n()})(Nv,function(){var r=function(){},n={},o={},a={};function s(f,h){f=f.push?f:[f];var g=[],b=f.length,p=b,v,m,y,_;for(v=function(S,j){j.length&&g.push(S),p--,p||h(g)};b--;){if(m=f[b],y=o[m],y){v(m,y);continue}_=a[m]=a[m]||[],_.push(v)}}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 c(f,h){f.call&&(f={success:f}),h.length?(f.error||r)(h):(f.success||r)(f)}function u(f,h,g,b){var p=document,v=g.async,m=(g.numRetries||0)+1,y=g.before||r,_=f.replace(/[\?|#].*$/,""),S=f.replace(/^(css|img|module|nomodule)!/,""),j,x,C;if(b=b||0,/(^css!|\.css$)/.test(_))C=p.createElement("link"),C.rel="stylesheet",C.href=S,j="hideFocus"in C,j&&C.relList&&(j=0,C.rel="preload",C.as="style");else if(/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(_))C=p.createElement("img"),C.src=S;else if(C=p.createElement("script"),C.src=S,C.async=v===void 0?!0:v,x="noModule"in C,/^module!/.test(_)){if(!x)return h(f,"l");C.type="module"}else if(/^nomodule!/.test(_)&&x)return h(f,"l");C.onload=C.onerror=C.onbeforeload=function(F){var ht=F.type[0];if(j)try{C.sheet.cssText.length||(ht="e")}catch(gt){gt.code!=18&&(ht="e")}if(ht=="e"){if(b+=1,b<m)return u(f,h,g,b)}else if(C.rel=="preload"&&C.as=="style")return C.rel="stylesheet";h(f,ht,F.defaultPrevented)},y(f,C)!==!1&&p.head.appendChild(C)}function d(f,h,g){f=f.push?f:[f];var b=f.length,p=b,v=[],m,y;for(m=function(_,S,j){if(S=="e"&&v.push(_),S=="b")if(j)v.push(_);else return;b--,b||h(v)},y=0;y<p;y++)u(f[y],m,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 v(m,y){d(f,function(_){c(p,_),m&&c({success:m,error:y},_),i(b,_)},p)}if(p.returnPromise)return new Promise(v);v()}return l.ready=function(h,g){return s(h,function(b){c(g,b)}),l},l.done=function(h){i(h,[])},l.reset=function(){n={},o={},a={}},l.isDefined=function(h){return h in n},l})}(ge)),ge.exports}var xv=jv();const fo=rv(xv);class Av{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=et()),n.push(a.id);const s=a.resources.map(i=>i.src);s.length&&fo(s,a.id,{async:(e==null?void 0:e.async)??!1,before:(i,c)=>(this.win.document.body.appendChild(c),!1)})}return new Promise((o,a)=>{if(r.length===0){this._onSuccessList.forEach(s=>s()),o("");return}fo.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}}exports.AssetLoader=Av;exports.ComponentInstanceManager=Ba;exports.DYNAMIC_COMPONENT_TYPE=fe;exports.DefaultDropPlaceholder=Ga;exports.DefineReactAdapter=Va;exports.DesignRender=Cv;exports.INNER_EVENT_LIST=Fa;exports.InnerPropList=La;exports.ON_DID_RENDER=Qr;exports.ON_WILL_DESTROY=Yr;exports.ReactAdapter=ev;exports.RefManager=Sr;exports.Render=Ua;exports.canAcceptsRef=Bo;exports.collectVariable=tl;exports.compWrapper=Go;exports.convertCodeStringToFunction=Vt;exports.findComponentByChainRefer=qo;exports.flatObject=el;exports.formatSourceStylePropertyName=ko;exports.getAdapter=po;exports.getCSSTextValue=Zu;exports.getComponentsLibs=rl;exports.getInheritObj=er;exports.getMatchVal=Ho;exports.getNodeCssClassName=tr;exports.getObjFromArrayMap=_r;exports.getThirdLibs=nl;exports.isClass=Xu;exports.runExpression=yt;exports.shouldConstruct=Uo;exports.useDesignRender=$v;exports.useRender=mv;
|
|
88
|
+
*/var co;function bv(){if(co)return z;co=1;function t(s){var i="https://react.dev/errors/"+s;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)i+="&args[]="+encodeURIComponent(arguments[c])}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,c=s;if(s.alternate)for(;i.return;)i=i.return;else{s=i;do i=s,(i.flags&4098)!==0&&(c=i.return),s=i.return;while(s)}return i.tag===3?c: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 c=s,u=i;;){var d=c.return;if(d===null)break;var l=d.alternate;if(l===null){if(u=d.return,u!==null){c=u;continue}break}if(d.child===l.child){for(l=d.child;l;){if(l===c)return r(d),s;if(l===u)return r(d),i;l=l.sibling}throw Error(t(188))}if(c.return!==u.return)c=d,u=l;else{for(var f=!1,h=d.child;h;){if(h===c){f=!0,c=d,u=l;break}if(h===u){f=!0,u=d,c=l;break}h=h.sibling}if(!f){for(h=l.child;h;){if(h===c){f=!0,c=l,u=d;break}if(h===u){f=!0,u=l,c=d;break}h=h.sibling}if(!f)throw Error(t(189))}}if(c.alternate!==u)throw Error(t(190))}if(c.tag!==3)throw Error(t(188));return c.stateNode.current===c?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 z.doesFiberContain=function(s,i){for(var c=s.alternate;i!==null;){if(i===s||i===c)return!0;i=i.return}return!1},z.findCurrentFiberUsingSlowPath=n,z.findCurrentHostFiber=function(s){return s=n(s),s!==null?o(s):null},z.findCurrentHostFiberWithNoPortals=function(s){return s=n(s),s!==null?a(s):null},z.getContainerFromFiber=function(s){return s.tag===3?s.stateNode.containerInfo:null},z.getNearestMountedFiber=e,z.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},z.isFiberMounted=function(s){return e(s)===s},z.isFiberSuspenseAndTimedOut=function(s){var i=s.memoizedState;return s.tag===13&&i!==null&&i.dehydrated===null},z.isMounted=function(s){return(s=s._reactInternals)?e(s)===s:!1},z}var uo;function _v(){return uo||(uo=1,He.exports=bv()),He.exports}var Sv=_v();function Ov(t){return t._reactInternals}function Ev(t){const e=Ov(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=Sv.findCurrentHostFiber(e);return r===null?null:r.stateNode}function wv(t){return Ev(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 Ft(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 Cv 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 c,u;const o=this;let a=r;const s=(u=(c=n.material)==null?void 0:c.value.advanceCustom)==null?void 0:u.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}_${et()}`);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?wv(this):this._dom}render(){var m,y,_,S;const{children:f=[],onlyRenderChild:h,...g}=this.props;let b=f;if(ot(f)||(b=[f]),!!!b.filter(Boolean).length&&(n.isContainer()||n.value.componentName===rt.ROOT_CONTAINER)){const j=(y=(m=n.material)==null?void 0:m.value.advanceCustom)==null?void 0:y.dropPlaceholder;b.push(N.createElement(j||o.dropPlaceholder,{node:n}))}return h?b:((S=(_=n.material)==null?void 0:_.value.advanceCustom)==null?void 0:S.autoGetDom)??!0?N.createElement(a,g,...b):N.createElement(a,{...g,$SET_DOM:A=>{this._dom=A}},...b)}}return N.forwardRef(function(l,f){return N.createElement(yv,{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 c;if((s==null?void 0:s._STATUS)==="DESTROY")return;const i=s.getDom();if(i&&!(i instanceof Text))if(n){const u=Array.from(((c=i.querySelectorAll)==null?void 0:c.call(i,n))||[]);a.push(...u)}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(Ua,{onGetComponent:n,...a,components:this._components,processNodeConfigHook:(s,i)=>{var g,b;if(i.nodeType!=="NODE")return s;const{props:c,condition:u}=s;let d={...c};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(Ft(f))d={...d,...f};else if(typeof f=="function"){const p=f(d);d={...d,...p}}}let h=u;return l.condition===!1&&(h=l.condition),{props:Yu(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},$v=()=>{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 ge={exports:{}},Nv=ge.exports,lo;function jv(){return lo||(lo=1,function(t,e){(function(r,n){t.exports=n()})(Nv,function(){var r=function(){},n={},o={},a={};function s(f,h){f=f.push?f:[f];var g=[],b=f.length,p=b,v,m,y,_;for(v=function(S,j){j.length&&g.push(S),p--,p||h(g)};b--;){if(m=f[b],y=o[m],y){v(m,y);continue}_=a[m]=a[m]||[],_.push(v)}}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 c(f,h){f.call&&(f={success:f}),h.length?(f.error||r)(h):(f.success||r)(f)}function u(f,h,g,b){var p=document,v=g.async,m=(g.numRetries||0)+1,y=g.before||r,_=f.replace(/[\?|#].*$/,""),S=f.replace(/^(css|img|module|nomodule)!/,""),j,A,C;if(b=b||0,/(^css!|\.css$)/.test(_))C=p.createElement("link"),C.rel="stylesheet",C.href=S,j="hideFocus"in C,j&&C.relList&&(j=0,C.rel="preload",C.as="style");else if(/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(_))C=p.createElement("img"),C.src=S;else if(C=p.createElement("script"),C.src=S,C.async=v===void 0?!0:v,A="noModule"in C,/^module!/.test(_)){if(!A)return h(f,"l");C.type="module"}else if(/^nomodule!/.test(_)&&A)return h(f,"l");C.onload=C.onerror=C.onbeforeload=function(F){var ht=F.type[0];if(j)try{C.sheet.cssText.length||(ht="e")}catch(gt){gt.code!=18&&(ht="e")}if(ht=="e"){if(b+=1,b<m)return u(f,h,g,b)}else if(C.rel=="preload"&&C.as=="style")return C.rel="stylesheet";h(f,ht,F.defaultPrevented)},y(f,C)!==!1&&p.head.appendChild(C)}function d(f,h,g){f=f.push?f:[f];var b=f.length,p=b,v=[],m,y;for(m=function(_,S,j){if(S=="e"&&v.push(_),S=="b")if(j)v.push(_);else return;b--,b||h(v)},y=0;y<p;y++)u(f[y],m,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 v(m,y){d(f,function(_){c(p,_),m&&c({success:m,error:y},_),i(b,_)},p)}if(p.returnPromise)return new Promise(v);v()}return l.ready=function(h,g){return s(h,function(b){c(g,b)}),l},l.done=function(h){i(h,[])},l.reset=function(){n={},o={},a={}},l.isDefined=function(h){return h in n},l})}(ge)),ge.exports}var Av=jv();const fo=rv(Av);class xv{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=et()),n.push(a.id);const s=a.resources.map(i=>i.src);s.length&&fo(s,a.id,{async:(e==null?void 0:e.async)??!1,before:(i,c)=>(this.win.document.body.appendChild(c),!1)})}return new Promise((o,a)=>{if(r.length===0){this._onSuccessList.forEach(s=>s()),o("");return}fo.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}}exports.AssetLoader=xv;exports.ComponentInstanceManager=Ba;exports.DYNAMIC_COMPONENT_TYPE=fe;exports.DefaultDropPlaceholder=Ga;exports.DefineReactAdapter=Va;exports.DesignRender=Cv;exports.INNER_EVENT_LIST=Fa;exports.InnerPropList=La;exports.ON_DID_RENDER=Qr;exports.ON_WILL_DESTROY=Yr;exports.ReactAdapter=ev;exports.RefManager=Sr;exports.Render=Ua;exports.canAcceptsRef=Bo;exports.collectVariable=tl;exports.compWrapper=Go;exports.convertCodeStringToFunction=Vt;exports.findComponentByChainRefer=qo;exports.flatObject=el;exports.formatSourceStylePropertyName=ko;exports.getAdapter=po;exports.getCSSTextValue=Zu;exports.getComponentsLibs=rl;exports.getInheritObj=er;exports.getMatchVal=Ho;exports.getNodeCssClassName=tr;exports.getObjFromArrayMap=_r;exports.getThirdLibs=nl;exports.isClass=Xu;exports.runExpression=yt;exports.shouldConstruct=Uo;exports.useDesignRender=$v;exports.useRender=mv;
|
|
89
89
|
//# sourceMappingURL=index.cjs.map
|