@chamn/render 0.3.4 → 0.3.5

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