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