@chamn/render 0.0.25 → 0.0.26
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.js +7 -25
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2075 -2676
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +6 -24
- package/dist/index.umd.js.map +1 -1
- package/package.json +6 -6
package/dist/index.umd.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
(function(_,C){typeof exports=="object"&&typeof module<"u"?C(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],C):(_=typeof globalThis<"u"?globalThis:_||self,C(_.CRender={},_.React,_.ReactDOM))})(this,function(_,C,Tt){"use strict";var Km=Object.defineProperty;var Xm=(_,C,Tt)=>C in _?Km(_,C,{enumerable:!0,configurable:!0,writable:!0,value:Tt}):_[C]=Tt;var j=(_,C,Tt)=>(Xm(_,typeof C!="symbol"?C+"":C,Tt),Tt);function ni(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const oi=ni(Tt),ai=t=>()=>{console.warn(`${t} need to be implement getComponent`)},ii=["customPageRootRender"],gn=["pageRender","render","convertModelToComponent","getComponent","getContext","getUtils","getDataLink","createDataLink","transformProps","transformData","transformGlobalData","errorCatch","clear"],yn=t=>[...gn,...ii].reduce((r,n)=>{var o;return t!=null&&t[n]?r[n]=(o=t[n])==null?void 0:o.bind(t):gn.includes(n)&&(r[n]=ai),r},{});var si=Object.defineProperty,ci=(t,e,r)=>e in t?si(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,T=(t,e,r)=>(ci(t,typeof e!="symbol"?e+"":e,r),r),ui=typeof global=="object"&&global&&global.Object===Object&&global;const bn=ui;var li=typeof self=="object"&&self&&self.Object===Object&&self,fi=bn||li||Function("return this")();const dt=fi;var di=dt.Symbol;const ot=di;var _n=Object.prototype,pi=_n.hasOwnProperty,hi=_n.toString,de=ot?ot.toStringTag:void 0;function vi(t){var e=pi.call(t,de),r=t[de];try{t[de]=void 0;var n=!0}catch{}var o=hi.call(t);return n&&(e?t[de]=r:delete t[de]),o}var mi=Object.prototype,gi=mi.toString;function yi(t){return gi.call(t)}var bi="[object Null]",_i="[object Undefined]",Sn=ot?ot.toStringTag:void 0;function $t(t){return t==null?t===void 0?_i:bi:Sn&&Sn in Object(t)?vi(t):yi(t)}function pt(t){return t!=null&&typeof t=="object"}var Si="[object Symbol]";function nr(t){return typeof t=="symbol"||pt(t)&&$t(t)==Si}function or(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 Oi=Array.isArray;const G=Oi;var ji=1/0,On=ot?ot.prototype:void 0,jn=On?On.toString:void 0;function Cn(t){if(typeof t=="string")return t;if(G(t))return or(t,Cn)+"";if(nr(t))return jn?jn.call(t):"";var e=t+"";return e=="0"&&1/t==-ji?"-0":e}function ct(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function ar(t){return t}var Ci="[object AsyncFunction]",Ei="[object Function]",wi="[object GeneratorFunction]",Ti="[object Proxy]";function ir(t){if(!ct(t))return!1;var e=$t(t);return e==Ei||e==wi||e==Ci||e==Ti}var $i=dt["__core-js_shared__"];const sr=$i;var En=function(){var t=/[^.]+$/.exec(sr&&sr.keys&&sr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Ni(t){return!!En&&En in t}var Pi=Function.prototype,Ai=Pi.toString;function Nt(t){if(t!=null){try{return Ai.call(t)}catch{}try{return t+""}catch{}}return""}var Ri=/[\\^$.*+?()[\]{}|]/g,Mi=/^\[object .+?Constructor\]$/,xi=Function.prototype,Di=Object.prototype,Ii=xi.toString,Li=Di.hasOwnProperty,Fi=RegExp("^"+Ii.call(Li).replace(Ri,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ki(t){if(!ct(t)||Ni(t))return!1;var e=ir(t)?Fi:Mi;return e.test(Nt(t))}function Ui(t,e){return t==null?void 0:t[e]}function Pt(t,e){var r=Ui(t,e);return ki(r)?r:void 0}var Bi=Pt(dt,"WeakMap");const cr=Bi;var wn=Object.create,Vi=function(){function t(){}return function(e){if(!ct(e))return{};if(wn)return wn(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();const Gi=Vi;function zi(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 Wi(){}function Tn(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var Hi=800,Yi=16,Ji=Date.now;function qi(t){var e=0,r=0;return function(){var n=Ji(),o=Yi-(n-r);if(r=n,o>0){if(++e>=Hi)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Qi(t){return function(){return t}}var Ki=function(){try{var t=Pt(Object,"defineProperty");return t({},"",{}),t}catch{}}();const xe=Ki;var Xi=xe?function(t,e){return xe(t,"toString",{configurable:!0,enumerable:!1,value:Qi(e),writable:!0})}:ar,Zi=qi(Xi);const $n=Zi;function ts(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}function es(t,e,r,n){for(var o=t.length,a=r+(n?1:-1);n?a--:++a<o;)if(e(t[a],a,t))return a;return-1}function rs(t){return t!==t}function ns(t,e,r){for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}function os(t,e,r){return e===e?ns(t,e,r):es(t,rs,r)}function as(t,e){var r=t==null?0:t.length;return!!r&&os(t,e,0)>-1}var is=9007199254740991,ss=/^(?:0|[1-9]\d*)$/;function De(t,e){var r=typeof t;return e=e??is,!!e&&(r=="number"||r!="symbol"&&ss.test(t))&&t>-1&&t%1==0&&t<e}function ur(t,e,r){e=="__proto__"&&xe?xe(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function pe(t,e){return t===e||t!==t&&e!==e}var cs=Object.prototype,us=cs.hasOwnProperty;function lr(t,e,r){var n=t[e];(!(us.call(t,e)&&pe(n,r))||r===void 0&&!(e in t))&&ur(t,e,r)}function Bt(t,e,r,n){var o=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var i=e[a],c=n?n(r[i],t[i],i,r,t):void 0;c===void 0&&(c=t[i]),o?ur(r,i,c):lr(r,i,c)}return r}var Nn=Math.max;function Pn(t,e,r){return e=Nn(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=Nn(n.length-e,0),s=Array(a);++o<a;)s[o]=n[e+o];o=-1;for(var i=Array(e+1);++o<e;)i[o]=n[o];return i[e]=r(s),zi(t,this,i)}}function An(t,e){return $n(Pn(t,e,ar),t+"")}var ls=9007199254740991;function fr(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ls}function Ie(t){return t!=null&&fr(t.length)&&!ir(t)}function fs(t,e,r){if(!ct(r))return!1;var n=typeof e;return(n=="number"?Ie(r)&&De(e,r.length):n=="string"&&e in r)?pe(r[e],t):!1}function ds(t){return An(function(e,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,s=o>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(o--,a):void 0,s&&fs(r[0],r[1],s)&&(a=o<3?void 0:a,o=1),e=Object(e);++n<o;){var i=r[n];i&&t(e,i,n,a)}return e})}var ps=Object.prototype;function dr(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||ps;return t===r}function hs(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var vs="[object Arguments]";function Rn(t){return pt(t)&&$t(t)==vs}var Mn=Object.prototype,ms=Mn.hasOwnProperty,gs=Mn.propertyIsEnumerable,ys=Rn(function(){return arguments}())?Rn:function(t){return pt(t)&&ms.call(t,"callee")&&!gs.call(t,"callee")};const he=ys;function bs(){return!1}var xn=typeof _=="object"&&_&&!_.nodeType&&_,Dn=xn&&typeof module=="object"&&module&&!module.nodeType&&module,_s=Dn&&Dn.exports===xn,In=_s?dt.Buffer:void 0,Ss=In?In.isBuffer:void 0,Os=Ss||bs;const ve=Os;var js="[object Arguments]",Cs="[object Array]",Es="[object Boolean]",ws="[object Date]",Ts="[object Error]",$s="[object Function]",Ns="[object Map]",Ps="[object Number]",As="[object Object]",Rs="[object RegExp]",Ms="[object Set]",xs="[object String]",Ds="[object WeakMap]",Is="[object ArrayBuffer]",Ls="[object DataView]",Fs="[object Float32Array]",ks="[object Float64Array]",Us="[object Int8Array]",Bs="[object Int16Array]",Vs="[object Int32Array]",Gs="[object Uint8Array]",zs="[object Uint8ClampedArray]",Ws="[object Uint16Array]",Hs="[object Uint32Array]",I={};I[Fs]=I[ks]=I[Us]=I[Bs]=I[Vs]=I[Gs]=I[zs]=I[Ws]=I[Hs]=!0,I[js]=I[Cs]=I[Is]=I[Es]=I[Ls]=I[ws]=I[Ts]=I[$s]=I[Ns]=I[Ps]=I[As]=I[Rs]=I[Ms]=I[xs]=I[Ds]=!1;function Ys(t){return pt(t)&&fr(t.length)&&!!I[$t(t)]}function pr(t){return function(e){return t(e)}}var Ln=typeof _=="object"&&_&&!_.nodeType&&_,me=Ln&&typeof module=="object"&&module&&!module.nodeType&&module,Js=me&&me.exports===Ln,hr=Js&&bn.process,qs=function(){try{var t=me&&me.require&&me.require("util").types;return t||hr&&hr.binding&&hr.binding("util")}catch{}}();const Vt=qs;var Fn=Vt&&Vt.isTypedArray,Qs=Fn?pr(Fn):Ys;const vr=Qs;var Ks=Object.prototype,Xs=Ks.hasOwnProperty;function kn(t,e){var r=G(t),n=!r&&he(t),o=!r&&!n&&ve(t),a=!r&&!n&&!o&&vr(t),s=r||n||o||a,i=s?hs(t.length,String):[],c=i.length;for(var l in t)(e||Xs.call(t,l))&&!(s&&(l=="length"||o&&(l=="offset"||l=="parent")||a&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||De(l,c)))&&i.push(l);return i}function Un(t,e){return function(r){return t(e(r))}}var Zs=Un(Object.keys,Object);const tc=Zs;var ec=Object.prototype,rc=ec.hasOwnProperty;function nc(t){if(!dr(t))return tc(t);var e=[];for(var r in Object(t))rc.call(t,r)&&r!="constructor"&&e.push(r);return e}function Le(t){return Ie(t)?kn(t):nc(t)}function oc(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var ac=Object.prototype,ic=ac.hasOwnProperty;function sc(t){if(!ct(t))return oc(t);var e=dr(t),r=[];for(var n in t)n=="constructor"&&(e||!ic.call(t,n))||r.push(n);return r}function ge(t){return Ie(t)?kn(t,!0):sc(t)}var cc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,uc=/^\w*$/;function mr(t,e){if(G(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||nr(t)?!0:uc.test(t)||!cc.test(t)||e!=null&&t in Object(e)}var lc=Pt(Object,"create");const ye=lc;function fc(){this.__data__=ye?ye(null):{},this.size=0}function dc(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var pc="__lodash_hash_undefined__",hc=Object.prototype,vc=hc.hasOwnProperty;function mc(t){var e=this.__data__;if(ye){var r=e[t];return r===pc?void 0:r}return vc.call(e,t)?e[t]:void 0}var gc=Object.prototype,yc=gc.hasOwnProperty;function bc(t){var e=this.__data__;return ye?e[t]!==void 0:yc.call(e,t)}var _c="__lodash_hash_undefined__";function Sc(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=ye&&e===void 0?_c:e,this}function At(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}At.prototype.clear=fc,At.prototype.delete=dc,At.prototype.get=mc,At.prototype.has=bc,At.prototype.set=Sc;function Oc(){this.__data__=[],this.size=0}function Fe(t,e){for(var r=t.length;r--;)if(pe(t[r][0],e))return r;return-1}var jc=Array.prototype,Cc=jc.splice;function Ec(t){var e=this.__data__,r=Fe(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Cc.call(e,r,1),--this.size,!0}function wc(t){var e=this.__data__,r=Fe(e,t);return r<0?void 0:e[r][1]}function Tc(t){return Fe(this.__data__,t)>-1}function $c(t,e){var r=this.__data__,n=Fe(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=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=Oc,mt.prototype.delete=Ec,mt.prototype.get=wc,mt.prototype.has=Tc,mt.prototype.set=$c;var Nc=Pt(dt,"Map");const be=Nc;function Pc(){this.size=0,this.__data__={hash:new At,map:new(be||mt),string:new At}}function Ac(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function ke(t,e){var r=t.__data__;return Ac(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Rc(t){var e=ke(this,t).delete(t);return this.size-=e?1:0,e}function Mc(t){return ke(this,t).get(t)}function xc(t){return ke(this,t).has(t)}function Dc(t,e){var r=ke(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function gt(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])}}gt.prototype.clear=Pc,gt.prototype.delete=Rc,gt.prototype.get=Mc,gt.prototype.has=xc,gt.prototype.set=Dc;var Ic="Expected a function";function gr(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Ic);var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var s=t.apply(this,n);return r.cache=a.set(o,s)||a,s};return r.cache=new(gr.Cache||gt),r}gr.Cache=gt;var Lc=500;function Fc(t){var e=gr(t,function(n){return r.size===Lc&&r.clear(),n}),r=e.cache;return e}var kc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Uc=/\\(\\)?/g,Bc=Fc(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(kc,function(r,n,o,a){e.push(o?a.replace(Uc,"$1"):n||r)}),e});const Vc=Bc;function Gc(t){return t==null?"":Cn(t)}function Gt(t,e){return G(t)?t:mr(t,e)?[t]:Vc(Gc(t))}var zc=1/0;function zt(t){if(typeof t=="string"||nr(t))return t;var e=t+"";return e=="0"&&1/t==-zc?"-0":e}function Ue(t,e){e=Gt(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[zt(e[r++])];return r&&r==n?t:void 0}function Bn(t,e,r){var n=t==null?void 0:Ue(t,e);return n===void 0?r:n}function yr(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}var Vn=ot?ot.isConcatSpreadable:void 0;function Wc(t){return G(t)||he(t)||!!(Vn&&t&&t[Vn])}function br(t,e,r,n,o){var a=-1,s=t.length;for(r||(r=Wc),o||(o=[]);++a<s;){var i=t[a];e>0&&r(i)?e>1?br(i,e-1,r,n,o):yr(o,i):n||(o[o.length]=i)}return o}function Hc(t){var e=t==null?0:t.length;return e?br(t,1):[]}function Yc(t){return $n(Pn(t,void 0,Hc),t+"")}var Jc=Un(Object.getPrototypeOf,Object);const _r=Jc;var qc="[object Object]",Qc=Function.prototype,Kc=Object.prototype,Gn=Qc.toString,Xc=Kc.hasOwnProperty,Zc=Gn.call(Object);function K(t){if(!pt(t)||$t(t)!=qc)return!1;var e=_r(t);if(e===null)return!0;var r=Xc.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Gn.call(r)==Zc}function tu(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 eu(){this.__data__=new mt,this.size=0}function ru(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function nu(t){return this.__data__.get(t)}function ou(t){return this.__data__.has(t)}var au=200;function iu(t,e){var r=this.__data__;if(r instanceof mt){var n=r.__data__;if(!be||n.length<au-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new gt(n)}return r.set(t,e),this.size=r.size,this}function ut(t){var e=this.__data__=new mt(t);this.size=e.size}ut.prototype.clear=eu,ut.prototype.delete=ru,ut.prototype.get=nu,ut.prototype.has=ou,ut.prototype.set=iu;function su(t,e){return t&&Bt(e,Le(e),t)}function cu(t,e){return t&&Bt(e,ge(e),t)}var zn=typeof _=="object"&&_&&!_.nodeType&&_,Wn=zn&&typeof module=="object"&&module&&!module.nodeType&&module,uu=Wn&&Wn.exports===zn,Hn=uu?dt.Buffer:void 0,Yn=Hn?Hn.allocUnsafe:void 0;function Jn(t,e){if(e)return t.slice();var r=t.length,n=Yn?Yn(r):new t.constructor(r);return t.copy(n),n}function lu(t,e){for(var r=-1,n=t==null?0:t.length,o=0,a=[];++r<n;){var s=t[r];e(s,r,t)&&(a[o++]=s)}return a}function qn(){return[]}var fu=Object.prototype,du=fu.propertyIsEnumerable,Qn=Object.getOwnPropertySymbols,pu=Qn?function(t){return t==null?[]:(t=Object(t),lu(Qn(t),function(e){return du.call(t,e)}))}:qn;const Sr=pu;function hu(t,e){return Bt(t,Sr(t),e)}var vu=Object.getOwnPropertySymbols,mu=vu?function(t){for(var e=[];t;)yr(e,Sr(t)),t=_r(t);return e}:qn;const Kn=mu;function gu(t,e){return Bt(t,Kn(t),e)}function Xn(t,e,r){var n=e(t);return G(t)?n:yr(n,r(t))}function Or(t){return Xn(t,Le,Sr)}function jr(t){return Xn(t,ge,Kn)}var yu=Pt(dt,"DataView");const Cr=yu;var bu=Pt(dt,"Promise");const Er=bu;var _u=Pt(dt,"Set");const Wt=_u;var Zn="[object Map]",Su="[object Object]",to="[object Promise]",eo="[object Set]",ro="[object WeakMap]",no="[object DataView]",Ou=Nt(Cr),ju=Nt(be),Cu=Nt(Er),Eu=Nt(Wt),wu=Nt(cr),Rt=$t;(Cr&&Rt(new Cr(new ArrayBuffer(1)))!=no||be&&Rt(new be)!=Zn||Er&&Rt(Er.resolve())!=to||Wt&&Rt(new Wt)!=eo||cr&&Rt(new cr)!=ro)&&(Rt=function(t){var e=$t(t),r=e==Su?t.constructor:void 0,n=r?Nt(r):"";if(n)switch(n){case Ou:return no;case ju:return Zn;case Cu:return to;case Eu:return eo;case wu:return ro}return e});const _e=Rt;var Tu=Object.prototype,$u=Tu.hasOwnProperty;function Nu(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&$u.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var Pu=dt.Uint8Array;const Be=Pu;function wr(t){var e=new t.constructor(t.byteLength);return new Be(e).set(new Be(t)),e}function Au(t,e){var r=e?wr(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var Ru=/\w*$/;function Mu(t){var e=new t.constructor(t.source,Ru.exec(t));return e.lastIndex=t.lastIndex,e}var oo=ot?ot.prototype:void 0,ao=oo?oo.valueOf:void 0;function xu(t){return ao?Object(ao.call(t)):{}}function io(t,e){var r=e?wr(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var Du="[object Boolean]",Iu="[object Date]",Lu="[object Map]",Fu="[object Number]",ku="[object RegExp]",Uu="[object Set]",Bu="[object String]",Vu="[object Symbol]",Gu="[object ArrayBuffer]",zu="[object DataView]",Wu="[object Float32Array]",Hu="[object Float64Array]",Yu="[object Int8Array]",Ju="[object Int16Array]",qu="[object Int32Array]",Qu="[object Uint8Array]",Ku="[object Uint8ClampedArray]",Xu="[object Uint16Array]",Zu="[object Uint32Array]";function tl(t,e,r){var n=t.constructor;switch(e){case Gu:return wr(t);case Du:case Iu:return new n(+t);case zu:return Au(t,r);case Wu:case Hu:case Yu:case Ju:case qu:case Qu:case Ku:case Xu:case Zu:return io(t,r);case Lu:return new n;case Fu:case Bu:return new n(t);case ku:return Mu(t);case Uu:return new n;case Vu:return xu(t)}}function so(t){return typeof t.constructor=="function"&&!dr(t)?Gi(_r(t)):{}}var el="[object Map]";function rl(t){return pt(t)&&_e(t)==el}var co=Vt&&Vt.isMap,nl=co?pr(co):rl;const ol=nl;var al="[object Set]";function il(t){return pt(t)&&_e(t)==al}var uo=Vt&&Vt.isSet,sl=uo?pr(uo):il;const cl=sl;var ul=1,ll=2,fl=4,lo="[object Arguments]",dl="[object Array]",pl="[object Boolean]",hl="[object Date]",vl="[object Error]",fo="[object Function]",ml="[object GeneratorFunction]",gl="[object Map]",yl="[object Number]",po="[object Object]",bl="[object RegExp]",_l="[object Set]",Sl="[object String]",Ol="[object Symbol]",jl="[object WeakMap]",Cl="[object ArrayBuffer]",El="[object DataView]",wl="[object Float32Array]",Tl="[object Float64Array]",$l="[object Int8Array]",Nl="[object Int16Array]",Pl="[object Int32Array]",Al="[object Uint8Array]",Rl="[object Uint8ClampedArray]",Ml="[object Uint16Array]",xl="[object Uint32Array]",D={};D[lo]=D[dl]=D[Cl]=D[El]=D[pl]=D[hl]=D[wl]=D[Tl]=D[$l]=D[Nl]=D[Pl]=D[gl]=D[yl]=D[po]=D[bl]=D[_l]=D[Sl]=D[Ol]=D[Al]=D[Rl]=D[Ml]=D[xl]=!0,D[vl]=D[fo]=D[jl]=!1;function Se(t,e,r,n,o,a){var s,i=e&ul,c=e&ll,l=e&fl;if(r&&(s=o?r(t,n,o,a):r(t)),s!==void 0)return s;if(!ct(t))return t;var f=G(t);if(f){if(s=Nu(t),!i)return Tn(t,s)}else{var p=_e(t),d=p==fo||p==ml;if(ve(t))return Jn(t,i);if(p==po||p==lo||d&&!o){if(s=c||d?{}:so(t),!i)return c?gu(t,cu(s,t)):hu(t,su(s,t))}else{if(!D[p])return o?t:{};s=tl(t,p,i)}}a||(a=new ut);var v=a.get(t);if(v)return v;a.set(t,s),cl(t)?t.forEach(function(O){s.add(Se(O,e,r,O,t,a))}):ol(t)&&t.forEach(function(O,$){s.set($,Se(O,e,r,$,t,a))});var y=l?c?jr:Or:c?ge:Le,S=f?void 0:y(t);return ts(S||t,function(O,$){S&&($=O,O=t[$]),lr(s,$,Se(O,e,r,$,t,a))}),s}var Dl=1,Il=4;function ho(t){return Se(t,Dl|Il)}var Ll="__lodash_hash_undefined__";function Fl(t){return this.__data__.set(t,Ll),this}function kl(t){return this.__data__.has(t)}function Oe(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new gt;++e<r;)this.add(t[e])}Oe.prototype.add=Oe.prototype.push=Fl,Oe.prototype.has=kl;function Ul(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 vo(t,e){return t.has(e)}var Bl=1,Vl=2;function mo(t,e,r,n,o,a){var s=r&Bl,i=t.length,c=e.length;if(i!=c&&!(s&&c>i))return!1;var l=a.get(t),f=a.get(e);if(l&&f)return l==e&&f==t;var p=-1,d=!0,v=r&Vl?new Oe:void 0;for(a.set(t,e),a.set(e,t);++p<i;){var y=t[p],S=e[p];if(n)var O=s?n(S,y,p,e,t,a):n(y,S,p,t,e,a);if(O!==void 0){if(O)continue;d=!1;break}if(v){if(!Ul(e,function($,E){if(!vo(v,E)&&(y===$||o(y,$,r,n,a)))return v.push(E)})){d=!1;break}}else if(!(y===S||o(y,S,r,n,a))){d=!1;break}}return a.delete(t),a.delete(e),d}function Gl(t){var e=-1,r=Array(t.size);return t.forEach(function(n,o){r[++e]=[o,n]}),r}function Tr(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var zl=1,Wl=2,Hl="[object Boolean]",Yl="[object Date]",Jl="[object Error]",ql="[object Map]",Ql="[object Number]",Kl="[object RegExp]",Xl="[object Set]",Zl="[object String]",tf="[object Symbol]",ef="[object ArrayBuffer]",rf="[object DataView]",go=ot?ot.prototype:void 0,$r=go?go.valueOf:void 0;function nf(t,e,r,n,o,a,s){switch(r){case rf:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case ef:return!(t.byteLength!=e.byteLength||!a(new Be(t),new Be(e)));case Hl:case Yl:case Ql:return pe(+t,+e);case Jl:return t.name==e.name&&t.message==e.message;case Kl:case Zl:return t==e+"";case ql:var i=Gl;case Xl:var c=n&zl;if(i||(i=Tr),t.size!=e.size&&!c)return!1;var l=s.get(t);if(l)return l==e;n|=Wl,s.set(t,e);var f=mo(i(t),i(e),n,o,a,s);return s.delete(t),f;case tf:if($r)return $r.call(t)==$r.call(e)}return!1}var of=1,af=Object.prototype,sf=af.hasOwnProperty;function cf(t,e,r,n,o,a){var s=r&of,i=Or(t),c=i.length,l=Or(e),f=l.length;if(c!=f&&!s)return!1;for(var p=c;p--;){var d=i[p];if(!(s?d in e:sf.call(e,d)))return!1}var v=a.get(t),y=a.get(e);if(v&&y)return v==e&&y==t;var S=!0;a.set(t,e),a.set(e,t);for(var O=s;++p<c;){d=i[p];var $=t[d],E=e[d];if(n)var U=s?n(E,$,d,e,t,a):n($,E,d,t,e,a);if(!(U===void 0?$===E||o($,E,r,n,a):U)){S=!1;break}O||(O=d=="constructor")}if(S&&!O){var F=t.constructor,J=e.constructor;F!=J&&"constructor"in t&&"constructor"in e&&!(typeof F=="function"&&F instanceof F&&typeof J=="function"&&J instanceof J)&&(S=!1)}return a.delete(t),a.delete(e),S}var uf=1,yo="[object Arguments]",bo="[object Array]",Ve="[object Object]",lf=Object.prototype,_o=lf.hasOwnProperty;function ff(t,e,r,n,o,a){var s=G(t),i=G(e),c=s?bo:_e(t),l=i?bo:_e(e);c=c==yo?Ve:c,l=l==yo?Ve:l;var f=c==Ve,p=l==Ve,d=c==l;if(d&&ve(t)){if(!ve(e))return!1;s=!0,f=!1}if(d&&!f)return a||(a=new ut),s||vr(t)?mo(t,e,r,n,o,a):nf(t,e,c,r,n,o,a);if(!(r&uf)){var v=f&&_o.call(t,"__wrapped__"),y=p&&_o.call(e,"__wrapped__");if(v||y){var S=v?t.value():t,O=y?e.value():e;return a||(a=new ut),o(S,O,r,n,a)}}return d?(a||(a=new ut),cf(t,e,r,n,o,a)):!1}function Nr(t,e,r,n,o){return t===e?!0:t==null||e==null||!pt(t)&&!pt(e)?t!==t&&e!==e:ff(t,e,r,n,Nr,o)}var df=1,pf=2;function hf(t,e,r,n){var o=r.length,a=o,s=!n;if(t==null)return!a;for(t=Object(t);o--;){var i=r[o];if(s&&i[2]?i[1]!==t[i[0]]:!(i[0]in t))return!1}for(;++o<a;){i=r[o];var c=i[0],l=t[c],f=i[1];if(s&&i[2]){if(l===void 0&&!(c in t))return!1}else{var p=new ut;if(n)var d=n(l,f,c,t,e,p);if(!(d===void 0?Nr(f,l,df|pf,n,p):d))return!1}}return!0}function So(t){return t===t&&!ct(t)}function vf(t){for(var e=Le(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,So(o)]}return e}function Oo(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function mf(t){var e=vf(t);return e.length==1&&e[0][2]?Oo(e[0][0],e[0][1]):function(r){return r===t||hf(r,t,e)}}function gf(t,e){return t!=null&&e in Object(t)}function yf(t,e,r){e=Gt(e,t);for(var n=-1,o=e.length,a=!1;++n<o;){var s=zt(e[n]);if(!(a=t!=null&&r(t,s)))break;t=t[s]}return a||++n!=o?a:(o=t==null?0:t.length,!!o&&fr(o)&&De(s,o)&&(G(t)||he(t)))}function bf(t,e){return t!=null&&yf(t,e,gf)}var _f=1,Sf=2;function Of(t,e){return mr(t)&&So(e)?Oo(zt(t),e):function(r){var n=Bn(r,t);return n===void 0&&n===e?bf(r,t):Nr(e,n,_f|Sf)}}function jf(t){return function(e){return e==null?void 0:e[t]}}function Cf(t){return function(e){return Ue(e,t)}}function Ef(t){return mr(t)?jf(zt(t)):Cf(t)}function Pr(t){return typeof t=="function"?t:t==null?ar:typeof t=="object"?G(t)?Of(t[0],t[1]):mf(t):Ef(t)}function wf(t){return function(e,r,n){for(var o=-1,a=Object(e),s=n(e),i=s.length;i--;){var c=s[t?i:++o];if(r(a[c],c,a)===!1)break}return e}}var Tf=wf();const $f=Tf;function Ar(t,e,r){(r!==void 0&&!pe(t[e],r)||r===void 0&&!(e in t))&&ur(t,e,r)}function Rr(t){return pt(t)&&Ie(t)}function Mr(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Nf(t){return Bt(t,ge(t))}function Pf(t,e,r,n,o,a,s){var i=Mr(t,r),c=Mr(e,r),l=s.get(c);if(l){Ar(t,r,l);return}var f=a?a(i,c,r+"",t,e,s):void 0,p=f===void 0;if(p){var d=G(c),v=!d&&ve(c),y=!d&&!v&&vr(c);f=c,d||v||y?G(i)?f=i:Rr(i)?f=Tn(i):v?(p=!1,f=Jn(c,!0)):y?(p=!1,f=io(c,!0)):f=[]:K(c)||he(c)?(f=i,he(i)?f=Nf(i):(!ct(i)||ir(i))&&(f=so(c))):p=!1}p&&(s.set(c,f),o(f,c,n,a,s),s.delete(c)),Ar(t,r,f)}function jo(t,e,r,n,o){t!==e&&$f(e,function(a,s){if(o||(o=new ut),ct(a))Pf(t,e,s,r,jo,n,o);else{var i=n?n(Mr(t,s),a,s+"",t,e,o):void 0;i===void 0&&(i=a),Ar(t,s,i)}},ge)}function Af(t,e,r){for(var n=-1,o=t==null?0:t.length;++n<o;)if(r(e,t[n]))return!0;return!1}function Co(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function Rf(t,e){return e.length<2?t:Ue(t,tu(e,0,-1))}var Mf=ds(function(t,e,r){jo(t,e,r)});const Eo=Mf;var xf="Expected a function";function Df(t){if(typeof t!="function")throw new TypeError(xf);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 If(t,e){return e=Gt(e,t),t=Rf(t,e),t==null||delete t[zt(Co(e))]}function Lf(t){return K(t)?void 0:t}var Ff=1,kf=2,Uf=4,Bf=Yc(function(t,e){var r={};if(t==null)return r;var n=!1;e=or(e,function(a){return a=Gt(a,t),n||(n=a.length>1),a}),Bt(t,jr(t),r),n&&(r=Se(r,Ff|kf|Uf,Lf));for(var o=e.length;o--;)If(r,e[o]);return r});const wo=Bf;function Vf(t,e,r,n){if(!ct(t))return t;e=Gt(e,t);for(var o=-1,a=e.length,s=a-1,i=t;i!=null&&++o<a;){var c=zt(e[o]),l=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(o!=s){var f=i[c];l=n?n(f,c,i):void 0,l===void 0&&(l=ct(f)?f:De(e[o+1])?[]:{})}lr(i,c,l),i=i[c]}return t}function Gf(t,e,r){for(var n=-1,o=e.length,a={};++n<o;){var s=e[n],i=Ue(t,s);r(i,s)&&Vf(a,Gt(s,t),i)}return a}function zf(t,e){if(t==null)return{};var r=or(jr(t),function(n){return[n]});return e=Pr(e),Gf(t,r,function(n,o){return e(n,o[0])})}function Wf(t,e){return zf(t,Df(Pr(e)))}var Hf=1/0,Yf=Wt&&1/Tr(new Wt([,-0]))[1]==Hf?function(t){return new Wt(t)}:Wi;const Jf=Yf;var qf=200;function Qf(t,e,r){var n=-1,o=as,a=t.length,s=!0,i=[],c=i;if(r)s=!1,o=Af;else if(a>=qf){var l=e?null:Jf(t);if(l)return Tr(l);s=!1,o=vo,c=new Oe}else c=e?[]:i;t:for(;++n<a;){var f=t[n],p=e?e(f):f;if(f=r||f!==0?f:0,s&&p===p){for(var d=c.length;d--;)if(c[d]===p)continue t;e&&c.push(p),i.push(f)}else o(c,p,r)||(c!==i&&c.push(p),i.push(f))}return i}var Kf=An(function(t){var e=Co(t);return Rr(e)&&(e=void 0),Qf(br(t,1,Rr,!0),Pr(e))});const Xf=Kf;class To extends TypeError{constructor(e,r){let n;const{message:o,...a}=e,{path:s}=e,i=s.length===0?o:"At path: "+s.join(".")+" -- "+o;super(i),this.value=void 0,this.key=void 0,this.type=void 0,this.refinement=void 0,this.path=void 0,this.branch=void 0,this.failures=void 0,Object.assign(this,a),this.name=this.constructor.name,this.failures=()=>{var c;return(c=n)!=null?c:n=[e,...r()]}}}function Zf(t){return lt(t)&&typeof t[Symbol.iterator]=="function"}function lt(t){return typeof t=="object"&&t!=null}function et(t){return typeof t=="string"?JSON.stringify(t):""+t}function td(t){const{done:e,value:r}=t.next();return e?void 0:r}function ed(t,e,r,n){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:o,branch:a}=e,{type:s}=r,{refinement:i,message:c="Expected a value of type `"+s+"`"+(i?" with refinement `"+i+"`":"")+", but received: `"+et(n)+"`"}=t;return{value:n,type:s,refinement:i,key:o[o.length-1],path:o,branch:a,...t,message:c}}function*$o(t,e,r,n){Zf(t)||(t=[t]);for(const o of t){const a=ed(o,e,r,n);a&&(yield a)}}function*xr(t,e,r){r===void 0&&(r={});const{path:n=[],branch:o=[t],coerce:a=!1,mask:s=!1}=r,i={path:n,branch:o};if(a&&(t=e.coercer(t,i),s&&e.type!=="type"&<(e.schema)&<(t)&&!Array.isArray(t)))for(const l in t)e.schema[l]===void 0&&delete t[l];let c="valid";for(const l of e.validator(t,i))c="not_valid",yield[l,void 0];for(let[l,f,p]of e.entries(t,i)){const d=xr(f,p,{path:l===void 0?n:[...n,l],branch:l===void 0?o:[...o,f],coerce:a,mask:s});for(const v of d)v[0]?(c=v[0].refinement!=null?"not_refined":"not_valid",yield[v[0],void 0]):a&&(f=v[1],l===void 0?t=f:t instanceof Map?t.set(l,f):t instanceof Set?t.add(f):lt(t)&&(t[l]=f))}if(c!=="not_valid")for(const l of e.refiner(t,i))c="not_refined",yield[l,void 0];c==="valid"&&(yield[void 0,t])}class ht{constructor(e){this.TYPE=void 0,this.type=void 0,this.schema=void 0,this.coercer=void 0,this.validator=void 0,this.refiner=void 0,this.entries=void 0;const{type:r,schema:n,validator:o,refiner:a,coercer:s=c=>c,entries:i=function*(){}}=e;this.type=r,this.schema=n,this.entries=i,this.coercer=s,o?this.validator=(c,l)=>{const f=o(c,l);return $o(f,l,this,c)}:this.validator=()=>[],a?this.refiner=(c,l)=>{const f=a(c,l);return $o(f,l,this,c)}:this.refiner=()=>[]}assert(e){return No(e,this)}create(e){return rd(e,this)}is(e){return od(e,this)}mask(e){return nd(e,this)}validate(e,r){return r===void 0&&(r={}),Ht(e,this,r)}}function No(t,e){const r=Ht(t,e);if(r[0])throw r[0]}function rd(t,e){const r=Ht(t,e,{coerce:!0});if(r[0])throw r[0];return r[1]}function nd(t,e){const r=Ht(t,e,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}function od(t,e){return!Ht(t,e)[0]}function Ht(t,e,r){r===void 0&&(r={});const n=xr(t,e,r),o=td(n);return o[0]?[new To(o[0],function*(){for(const a of n)a[0]&&(yield a[0])}),void 0]:[void 0,o[1]]}function Dr(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];const n=e[0].type==="type",o=e.map(s=>s.schema),a=Object.assign({},...o);return n?Mo(a):M(a)}function Ot(t,e){return new ht({type:t,schema:null,validator:e})}function Yt(t){return new ht({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 Po(t,e){const{schema:r}=t,n={...r};for(const o of e)delete n[o];switch(t.type){case"type":return Mo(n);default:return M(n)}}function z(){return Ot("any",()=>!0)}function V(t){return new ht({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: "+et(e)}})}function Jt(){return Ot("boolean",t=>typeof t=="boolean")}function Ir(t){const e={},r=t.map(n=>et(n)).join();for(const n of t)e[n]=n;return new ht({type:"enums",schema:e,validator(n){return t.includes(n)||"Expected one of `"+r+"`, but received: "+et(n)}})}function Ao(){return Ot("func",t=>typeof t=="function"||"Expected a function, but received: "+et(t))}function X(t){const e=et(t),r=typeof t;return new ht({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||"Expected the literal `"+e+"`, but received: "+et(n)}})}function ad(){return Ot("never",()=>!1)}function Ro(){return Ot("number",t=>typeof t=="number"&&!isNaN(t)||"Expected a number, but received: "+et(t))}function M(t){const e=t?Object.keys(t):[],r=ad();return new ht({type:"object",schema:t||null,*entries(n){if(t&<(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 lt(n)||"Expected an object, but received: "+et(n)},coercer(n){return lt(n)?{...n}:n}})}function b(t){return new ht({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function je(t,e){return new ht({type:"record",schema:null,*entries(r){if(lt(r))for(const n in r){const o=r[n];yield[n,n,t],yield[n,o,e]}},validator(r){return lt(r)||"Expected an object, but received: "+et(r)}})}function g(){return Ot("string",t=>typeof t=="string"||"Expected a string, but received: "+et(t))}function Mo(t){const e=Object.keys(t);return new ht({type:"type",schema:t,*entries(r){if(lt(r))for(const n of e)yield[n,r[n],t[n]]},validator(r){return lt(r)||"Expected an object, but received: "+et(r)}})}function Z(t){const e=t.map(r=>r.type).join(" | ");return new ht({type:"union",schema:null,coercer(r,n){return(t.find(o=>{const[a]=o.validate(r,{coerce:!0});return!a})||id()).coercer(r,n)},validator(r,n){const o=[];for(const a of t){const[...s]=xr(r,a,n),[i]=s;if(i[0])for(const[c]of s)c&&o.push(c);else return[]}return["Expected the value to satisfy a union of `"+e+"`, but received: "+et(r),...o]}})}function id(){return Ot("unknown",()=>!0)}const Lr=M({package:g(),version:g(),name:g(),exportName:b(g()),destructuring:b(Jt()),subName:b(g()),main:b(g()),cssPaths:b(V(g()))}),sd=V(Lr),cd=["CBlock","CContainer","CImage","CCanvas","CVideo","CAudio","CText","CNativeTag"];var at=(t=>(t.SLOT="SLOT",t.FUNCTION="FUNCTION",t.EXPRESSION="EXPRESSION",t))(at||{}),Fr=(t=>(t.DESIGN="design",t.SAVE="save",t))(Fr||{}),kr=(t=>(t.FUNC="FUNC",t.COMP="COMP",t))(kr||{});const ud=()=>Ot("normalObj",t=>!K(t)||[at.SLOT,at.EXPRESSION,at.FUNCTION].includes(t==null?void 0:t.type)?!1:(Ht(t,je(g(),Ur)),!0)),Ur=Z([g(),Ro(),Jt(),M({type:X(at.SLOT),renderType:Ir([kr.FUNC,kr.COMP]),params:b(V(g())),value:Yt(()=>Z([qt,V(qt)]))}),M({type:X(at.EXPRESSION),value:g()}),M({type:X(at.FUNCTION),value:g()}),ud(),V(Yt(()=>Ur))]),xo=M({type:X(at.EXPRESSION),value:g()}),qt=M({id:b(g()),title:b(g()),componentName:g(),props:b(je(g(),Ur)),nodeName:b(g()),state:b(je(g(),z())),children:Yt(()=>b(V(Z([g(),qt])))),configure:b(z()),css:b(z()),style:b(z()),classNames:b(V(z())),refId:b(g()),extra:b(je(z(),z())),condition:b(Z([Jt(),xo])),loop:b(M({open:Jt(),data:Z([V(z()),xo]),args:b(V(g())),forName:b(g()),forIndex:b(g()),key:b(z()),name:b(g())})),methods:b(V(z()))}),Ge=Z([g(),M({label:g(),tip:b(g())})]),ld=M({type:X("shape"),value:V(M({name:g(),title:Ge,valueType:Yt(()=>ze)}))}),fd=M({type:X("enums"),value:V(g())});M({type:X("array"),value:Yt(()=>ze)});const dd=M({type:X("array"),value:Yt(()=>V(ze))}),ze=Z([Ir(["array","boolean","number","object","string"]),Ir(["component","expression","function"]),ld,fd,dd]),pd=Z([g(),M({componentName:g(),props:b(z()),initialValue:b(z()),component:b(z())})]),Br=M({name:g(),title:Ge,valueType:ze,description:b(g()),defaultValue:z(),setters:b(V(pd)),condition:b(Ao())});Z([g(),Ao()]);var Vr=(t=>(t.SINGLE="single",t.GROUP="group",t))(Vr||{});Z([g(),M({name:g(),describe:b(g()),params:b(M({name:g(),description:g()})),template:g()})]);const hd=M({id:b(g()),title:g(),snapshot:Z([g(),z()]),snapshotText:b(g()),description:b(g()),tags:b(V(g())),groupName:b(g()),category:b(g()),schema:Dr(Po(qt,["id"]),M({componentName:b(g())}))}),vd=M({componentName:g(),title:g(),screenshot:b(g()),icon:b(g()),tags:b(V(g())),groupName:b(g()),category:b(g()),priority:b(Ro()),npm:b(Lr),snippets:V(hd),props:V(Z([Br,M({title:b(Ge),type:X("single"),content:Br}),M({title:b(Ge),type:X("group"),content:V(Br)})])),fixedProps:b(z()),isContainer:b(Z([Jt(),M({placeholder:g(),width:g(),height:g()})])),disableEditorDragDom:b(z()),isLayout:b(Jt()),rootSelector:b(g()),advanceCustom:b(z()),extra:b(je(z(),z()))}),md=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}
|
|
1
|
+
(function(g,S){typeof exports=="object"&&typeof module<"u"?S(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],S):(g=typeof globalThis<"u"?globalThis:g||self,S(g.CRender={},g.React,g.ReactDOM))})(this,function(g,S,ct){"use strict";var Wm=Object.defineProperty;var Jm=(g,S,ct)=>S in g?Wm(g,S,{enumerable:!0,configurable:!0,writable:!0,value:ct}):g[S]=ct;var b=(g,S,ct)=>(Jm(g,typeof S!="symbol"?S+"":S,ct),ct);function ha(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const ma=ha(ct),va=t=>()=>{console.warn(`${t} need to be implement getComponent`)},ga=["customPageRootRender"],Br=["pageRender","render","convertModelToComponent","getComponent","getContext","getUtils","getDataLink","createDataLink","transformProps","transformData","transformGlobalData","errorCatch","clear"],Ur=t=>[...Br,...ga].reduce((r,n)=>{var o;return t!=null&&t[n]?r[n]=(o=t[n])==null?void 0:o.bind(t):Br.includes(n)&&(r[n]=va),r},{});var ya=Object.defineProperty,ba=(t,e,r)=>e in t?ya(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,j=(t,e,r)=>(ba(t,typeof e!="symbol"?e+"":e,r),r),_a=typeof global=="object"&&global&&global.Object===Object&&global;const kr=_a;var Sa=typeof self=="object"&&self&&self.Object===Object&&self,ja=kr||Sa||Function("return this")();const q=ja;var Oa=q.Symbol;const V=Oa;var Vr=Object.prototype,wa=Vr.hasOwnProperty,Ca=Vr.toString,Bt=V?V.toStringTag:void 0;function Ea(t){var e=wa.call(t,Bt),r=t[Bt];try{t[Bt]=void 0;var n=!0}catch{}var o=Ca.call(t);return n&&(e?t[Bt]=r:delete t[Bt]),o}var $a=Object.prototype,Na=$a.toString;function Ta(t){return Na.call(t)}var Aa="[object Null]",Ma="[object Undefined]",zr=V?V.toStringTag:void 0;function ut(t){return t==null?t===void 0?Ma:Aa:zr&&zr in Object(t)?Ea(t):Ta(t)}function Y(t){return t!=null&&typeof t=="object"}var Pa="[object Symbol]";function Ne(t){return typeof t=="symbol"||Y(t)&&ut(t)==Pa}function Te(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 xa=Array.isArray;const I=xa;var Ia=1/0,Gr=V?V.prototype:void 0,Hr=Gr?Gr.toString:void 0;function Wr(t){if(typeof t=="string")return t;if(I(t))return Te(t,Wr)+"";if(Ne(t))return Hr?Hr.call(t):"";var e=t+"";return e=="0"&&1/t==-Ia?"-0":e}function H(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function Ae(t){return t}var Da="[object AsyncFunction]",Ra="[object Function]",La="[object GeneratorFunction]",Fa="[object Proxy]";function Me(t){if(!H(t))return!1;var e=ut(t);return e==Ra||e==La||e==Da||e==Fa}var Ba=q["__core-js_shared__"];const Pe=Ba;var Jr=function(){var t=/[^.]+$/.exec(Pe&&Pe.keys&&Pe.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Ua(t){return!!Jr&&Jr in t}var ka=Function.prototype,Va=ka.toString;function lt(t){if(t!=null){try{return Va.call(t)}catch{}try{return t+""}catch{}}return""}var za=/[\\^$.*+?()[\]{}|]/g,Ga=/^\[object .+?Constructor\]$/,Ha=Function.prototype,Wa=Object.prototype,Ja=Ha.toString,Qa=Wa.hasOwnProperty,qa=RegExp("^"+Ja.call(Qa).replace(za,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ya(t){if(!H(t)||Ua(t))return!1;var e=Me(t)?qa:Ga;return e.test(lt(t))}function Ka(t,e){return t==null?void 0:t[e]}function ft(t,e){var r=Ka(t,e);return Ya(r)?r:void 0}var Xa=ft(q,"WeakMap");const xe=Xa;var Qr=Object.create,Za=function(){function t(){}return function(e){if(!H(e))return{};if(Qr)return Qr(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();const ti=Za;function ei(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 ri(){}function qr(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var ni=800,oi=16,ai=Date.now;function ii(t){var e=0,r=0;return function(){var n=ai(),o=oi-(n-r);if(r=n,o>0){if(++e>=ni)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function si(t){return function(){return t}}var ci=function(){try{var t=ft(Object,"defineProperty");return t({},"",{}),t}catch{}}();const ie=ci;var ui=ie?function(t,e){return ie(t,"toString",{configurable:!0,enumerable:!1,value:si(e),writable:!0})}:Ae,li=ii(ui);const Yr=li;function fi(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}function di(t,e,r,n){for(var o=t.length,a=r+(n?1:-1);n?a--:++a<o;)if(e(t[a],a,t))return a;return-1}function pi(t){return t!==t}function hi(t,e,r){for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}function mi(t,e,r){return e===e?hi(t,e,r):di(t,pi,r)}function vi(t,e){var r=t==null?0:t.length;return!!r&&mi(t,e,0)>-1}var gi=9007199254740991,yi=/^(?:0|[1-9]\d*)$/;function se(t,e){var r=typeof t;return e=e??gi,!!e&&(r=="number"||r!="symbol"&&yi.test(t))&&t>-1&&t%1==0&&t<e}function Ie(t,e,r){e=="__proto__"&&ie?ie(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Ut(t,e){return t===e||t!==t&&e!==e}var bi=Object.prototype,_i=bi.hasOwnProperty;function De(t,e,r){var n=t[e];(!(_i.call(t,e)&&Ut(n,r))||r===void 0&&!(e in t))&&Ie(t,e,r)}function _t(t,e,r,n){var o=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var i=e[a],c=n?n(r[i],t[i],i,r,t):void 0;c===void 0&&(c=t[i]),o?Ie(r,i,c):De(r,i,c)}return r}var Kr=Math.max;function Xr(t,e,r){return e=Kr(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=Kr(n.length-e,0),s=Array(a);++o<a;)s[o]=n[e+o];o=-1;for(var i=Array(e+1);++o<e;)i[o]=n[o];return i[e]=r(s),ei(t,this,i)}}function Zr(t,e){return Yr(Xr(t,e,Ae),t+"")}var Si=9007199254740991;function Re(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Si}function ce(t){return t!=null&&Re(t.length)&&!Me(t)}function ji(t,e,r){if(!H(r))return!1;var n=typeof e;return(n=="number"?ce(r)&&se(e,r.length):n=="string"&&e in r)?Ut(r[e],t):!1}function Oi(t){return Zr(function(e,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,s=o>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(o--,a):void 0,s&&ji(r[0],r[1],s)&&(a=o<3?void 0:a,o=1),e=Object(e);++n<o;){var i=r[n];i&&t(e,i,n,a)}return e})}var wi=Object.prototype;function Le(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||wi;return t===r}function Ci(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Ei="[object Arguments]";function tn(t){return Y(t)&&ut(t)==Ei}var en=Object.prototype,$i=en.hasOwnProperty,Ni=en.propertyIsEnumerable,Ti=tn(function(){return arguments}())?tn:function(t){return Y(t)&&$i.call(t,"callee")&&!Ni.call(t,"callee")};const kt=Ti;function Ai(){return!1}var rn=typeof g=="object"&&g&&!g.nodeType&&g,nn=rn&&typeof module=="object"&&module&&!module.nodeType&&module,Mi=nn&&nn.exports===rn,on=Mi?q.Buffer:void 0,Pi=on?on.isBuffer:void 0,xi=Pi||Ai;const Vt=xi;var Ii="[object Arguments]",Di="[object Array]",Ri="[object Boolean]",Li="[object Date]",Fi="[object Error]",Bi="[object Function]",Ui="[object Map]",ki="[object Number]",Vi="[object Object]",zi="[object RegExp]",Gi="[object Set]",Hi="[object String]",Wi="[object WeakMap]",Ji="[object ArrayBuffer]",Qi="[object DataView]",qi="[object Float32Array]",Yi="[object Float64Array]",Ki="[object Int8Array]",Xi="[object Int16Array]",Zi="[object Int32Array]",ts="[object Uint8Array]",es="[object Uint8ClampedArray]",rs="[object Uint16Array]",ns="[object Uint32Array]",N={};N[qi]=N[Yi]=N[Ki]=N[Xi]=N[Zi]=N[ts]=N[es]=N[rs]=N[ns]=!0,N[Ii]=N[Di]=N[Ji]=N[Ri]=N[Qi]=N[Li]=N[Fi]=N[Bi]=N[Ui]=N[ki]=N[Vi]=N[zi]=N[Gi]=N[Hi]=N[Wi]=!1;function os(t){return Y(t)&&Re(t.length)&&!!N[ut(t)]}function Fe(t){return function(e){return t(e)}}var an=typeof g=="object"&&g&&!g.nodeType&&g,zt=an&&typeof module=="object"&&module&&!module.nodeType&&module,as=zt&&zt.exports===an,Be=as&&kr.process,is=function(){try{var t=zt&&zt.require&&zt.require("util").types;return t||Be&&Be.binding&&Be.binding("util")}catch{}}();const St=is;var sn=St&&St.isTypedArray,ss=sn?Fe(sn):os;const Ue=ss;var cs=Object.prototype,us=cs.hasOwnProperty;function cn(t,e){var r=I(t),n=!r&&kt(t),o=!r&&!n&&Vt(t),a=!r&&!n&&!o&&Ue(t),s=r||n||o||a,i=s?Ci(t.length,String):[],c=i.length;for(var u in t)(e||us.call(t,u))&&!(s&&(u=="length"||o&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||se(u,c)))&&i.push(u);return i}function un(t,e){return function(r){return t(e(r))}}var ls=un(Object.keys,Object);const fs=ls;var ds=Object.prototype,ps=ds.hasOwnProperty;function hs(t){if(!Le(t))return fs(t);var e=[];for(var r in Object(t))ps.call(t,r)&&r!="constructor"&&e.push(r);return e}function ue(t){return ce(t)?cn(t):hs(t)}function ms(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var vs=Object.prototype,gs=vs.hasOwnProperty;function ys(t){if(!H(t))return ms(t);var e=Le(t),r=[];for(var n in t)n=="constructor"&&(e||!gs.call(t,n))||r.push(n);return r}function Gt(t){return ce(t)?cn(t,!0):ys(t)}var bs=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_s=/^\w*$/;function ke(t,e){if(I(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Ne(t)?!0:_s.test(t)||!bs.test(t)||e!=null&&t in Object(e)}var Ss=ft(Object,"create");const Ht=Ss;function js(){this.__data__=Ht?Ht(null):{},this.size=0}function Os(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var ws="__lodash_hash_undefined__",Cs=Object.prototype,Es=Cs.hasOwnProperty;function $s(t){var e=this.__data__;if(Ht){var r=e[t];return r===ws?void 0:r}return Es.call(e,t)?e[t]:void 0}var Ns=Object.prototype,Ts=Ns.hasOwnProperty;function As(t){var e=this.__data__;return Ht?e[t]!==void 0:Ts.call(e,t)}var Ms="__lodash_hash_undefined__";function Ps(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Ht&&e===void 0?Ms:e,this}function dt(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])}}dt.prototype.clear=js,dt.prototype.delete=Os,dt.prototype.get=$s,dt.prototype.has=As,dt.prototype.set=Ps;function xs(){this.__data__=[],this.size=0}function le(t,e){for(var r=t.length;r--;)if(Ut(t[r][0],e))return r;return-1}var Is=Array.prototype,Ds=Is.splice;function Rs(t){var e=this.__data__,r=le(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Ds.call(e,r,1),--this.size,!0}function Ls(t){var e=this.__data__,r=le(e,t);return r<0?void 0:e[r][1]}function Fs(t){return le(this.__data__,t)>-1}function Bs(t,e){var r=this.__data__,n=le(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=xs,et.prototype.delete=Rs,et.prototype.get=Ls,et.prototype.has=Fs,et.prototype.set=Bs;var Us=ft(q,"Map");const Wt=Us;function ks(){this.size=0,this.__data__={hash:new dt,map:new(Wt||et),string:new dt}}function Vs(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function fe(t,e){var r=t.__data__;return Vs(e)?r[typeof e=="string"?"string":"hash"]:r.map}function zs(t){var e=fe(this,t).delete(t);return this.size-=e?1:0,e}function Gs(t){return fe(this,t).get(t)}function Hs(t){return fe(this,t).has(t)}function Ws(t,e){var r=fe(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,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=ks,rt.prototype.delete=zs,rt.prototype.get=Gs,rt.prototype.has=Hs,rt.prototype.set=Ws;var Js="Expected a function";function Ve(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Js);var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var s=t.apply(this,n);return r.cache=a.set(o,s)||a,s};return r.cache=new(Ve.Cache||rt),r}Ve.Cache=rt;var Qs=500;function qs(t){var e=Ve(t,function(n){return r.size===Qs&&r.clear(),n}),r=e.cache;return e}var Ys=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ks=/\\(\\)?/g,Xs=qs(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Ys,function(r,n,o,a){e.push(o?a.replace(Ks,"$1"):n||r)}),e});const Zs=Xs;function tc(t){return t==null?"":Wr(t)}function jt(t,e){return I(t)?t:ke(t,e)?[t]:Zs(tc(t))}var ec=1/0;function Ot(t){if(typeof t=="string"||Ne(t))return t;var e=t+"";return e=="0"&&1/t==-ec?"-0":e}function de(t,e){e=jt(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Ot(e[r++])];return r&&r==n?t:void 0}function ln(t,e,r){var n=t==null?void 0:de(t,e);return n===void 0?r:n}function ze(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}var fn=V?V.isConcatSpreadable:void 0;function rc(t){return I(t)||kt(t)||!!(fn&&t&&t[fn])}function Ge(t,e,r,n,o){var a=-1,s=t.length;for(r||(r=rc),o||(o=[]);++a<s;){var i=t[a];e>0&&r(i)?e>1?Ge(i,e-1,r,n,o):ze(o,i):n||(o[o.length]=i)}return o}function nc(t){var e=t==null?0:t.length;return e?Ge(t,1):[]}function oc(t){return Yr(Xr(t,void 0,nc),t+"")}var ac=un(Object.getPrototypeOf,Object);const He=ac;var ic="[object Object]",sc=Function.prototype,cc=Object.prototype,dn=sc.toString,uc=cc.hasOwnProperty,lc=dn.call(Object);function F(t){if(!Y(t)||ut(t)!=ic)return!1;var e=He(t);if(e===null)return!0;var r=uc.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&dn.call(r)==lc}function fc(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 dc(){this.__data__=new et,this.size=0}function pc(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function hc(t){return this.__data__.get(t)}function mc(t){return this.__data__.has(t)}var vc=200;function gc(t,e){var r=this.__data__;if(r instanceof et){var n=r.__data__;if(!Wt||n.length<vc-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new rt(n)}return r.set(t,e),this.size=r.size,this}function W(t){var e=this.__data__=new et(t);this.size=e.size}W.prototype.clear=dc,W.prototype.delete=pc,W.prototype.get=hc,W.prototype.has=mc,W.prototype.set=gc;function yc(t,e){return t&&_t(e,ue(e),t)}function bc(t,e){return t&&_t(e,Gt(e),t)}var pn=typeof g=="object"&&g&&!g.nodeType&&g,hn=pn&&typeof module=="object"&&module&&!module.nodeType&&module,_c=hn&&hn.exports===pn,mn=_c?q.Buffer:void 0,vn=mn?mn.allocUnsafe:void 0;function gn(t,e){if(e)return t.slice();var r=t.length,n=vn?vn(r):new t.constructor(r);return t.copy(n),n}function Sc(t,e){for(var r=-1,n=t==null?0:t.length,o=0,a=[];++r<n;){var s=t[r];e(s,r,t)&&(a[o++]=s)}return a}function yn(){return[]}var jc=Object.prototype,Oc=jc.propertyIsEnumerable,bn=Object.getOwnPropertySymbols,wc=bn?function(t){return t==null?[]:(t=Object(t),Sc(bn(t),function(e){return Oc.call(t,e)}))}:yn;const We=wc;function Cc(t,e){return _t(t,We(t),e)}var Ec=Object.getOwnPropertySymbols,$c=Ec?function(t){for(var e=[];t;)ze(e,We(t)),t=He(t);return e}:yn;const _n=$c;function Nc(t,e){return _t(t,_n(t),e)}function Sn(t,e,r){var n=e(t);return I(t)?n:ze(n,r(t))}function Je(t){return Sn(t,ue,We)}function Qe(t){return Sn(t,Gt,_n)}var Tc=ft(q,"DataView");const qe=Tc;var Ac=ft(q,"Promise");const Ye=Ac;var Mc=ft(q,"Set");const wt=Mc;var jn="[object Map]",Pc="[object Object]",On="[object Promise]",wn="[object Set]",Cn="[object WeakMap]",En="[object DataView]",xc=lt(qe),Ic=lt(Wt),Dc=lt(Ye),Rc=lt(wt),Lc=lt(xe),pt=ut;(qe&&pt(new qe(new ArrayBuffer(1)))!=En||Wt&&pt(new Wt)!=jn||Ye&&pt(Ye.resolve())!=On||wt&&pt(new wt)!=wn||xe&&pt(new xe)!=Cn)&&(pt=function(t){var e=ut(t),r=e==Pc?t.constructor:void 0,n=r?lt(r):"";if(n)switch(n){case xc:return En;case Ic:return jn;case Dc:return On;case Rc:return wn;case Lc:return Cn}return e});const Jt=pt;var Fc=Object.prototype,Bc=Fc.hasOwnProperty;function Uc(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&Bc.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var kc=q.Uint8Array;const pe=kc;function Ke(t){var e=new t.constructor(t.byteLength);return new pe(e).set(new pe(t)),e}function Vc(t,e){var r=e?Ke(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var zc=/\w*$/;function Gc(t){var e=new t.constructor(t.source,zc.exec(t));return e.lastIndex=t.lastIndex,e}var $n=V?V.prototype:void 0,Nn=$n?$n.valueOf:void 0;function Hc(t){return Nn?Object(Nn.call(t)):{}}function Tn(t,e){var r=e?Ke(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var Wc="[object Boolean]",Jc="[object Date]",Qc="[object Map]",qc="[object Number]",Yc="[object RegExp]",Kc="[object Set]",Xc="[object String]",Zc="[object Symbol]",tu="[object ArrayBuffer]",eu="[object DataView]",ru="[object Float32Array]",nu="[object Float64Array]",ou="[object Int8Array]",au="[object Int16Array]",iu="[object Int32Array]",su="[object Uint8Array]",cu="[object Uint8ClampedArray]",uu="[object Uint16Array]",lu="[object Uint32Array]";function fu(t,e,r){var n=t.constructor;switch(e){case tu:return Ke(t);case Wc:case Jc:return new n(+t);case eu:return Vc(t,r);case ru:case nu:case ou:case au:case iu:case su:case cu:case uu:case lu:return Tn(t,r);case Qc:return new n;case qc:case Xc:return new n(t);case Yc:return Gc(t);case Kc:return new n;case Zc:return Hc(t)}}function An(t){return typeof t.constructor=="function"&&!Le(t)?ti(He(t)):{}}var du="[object Map]";function pu(t){return Y(t)&&Jt(t)==du}var Mn=St&&St.isMap,hu=Mn?Fe(Mn):pu;const mu=hu;var vu="[object Set]";function gu(t){return Y(t)&&Jt(t)==vu}var Pn=St&&St.isSet,yu=Pn?Fe(Pn):gu;const bu=yu;var _u=1,Su=2,ju=4,xn="[object Arguments]",Ou="[object Array]",wu="[object Boolean]",Cu="[object Date]",Eu="[object Error]",In="[object Function]",$u="[object GeneratorFunction]",Nu="[object Map]",Tu="[object Number]",Dn="[object Object]",Au="[object RegExp]",Mu="[object Set]",Pu="[object String]",xu="[object Symbol]",Iu="[object WeakMap]",Du="[object ArrayBuffer]",Ru="[object DataView]",Lu="[object Float32Array]",Fu="[object Float64Array]",Bu="[object Int8Array]",Uu="[object Int16Array]",ku="[object Int32Array]",Vu="[object Uint8Array]",zu="[object Uint8ClampedArray]",Gu="[object Uint16Array]",Hu="[object Uint32Array]",$={};$[xn]=$[Ou]=$[Du]=$[Ru]=$[wu]=$[Cu]=$[Lu]=$[Fu]=$[Bu]=$[Uu]=$[ku]=$[Nu]=$[Tu]=$[Dn]=$[Au]=$[Mu]=$[Pu]=$[xu]=$[Vu]=$[zu]=$[Gu]=$[Hu]=!0,$[Eu]=$[In]=$[Iu]=!1;function Qt(t,e,r,n,o,a){var s,i=e&_u,c=e&Su,u=e&ju;if(r&&(s=o?r(t,n,o,a):r(t)),s!==void 0)return s;if(!H(t))return t;var l=I(t);if(l){if(s=Uc(t),!i)return qr(t,s)}else{var d=Jt(t),f=d==In||d==$u;if(Vt(t))return gn(t,i);if(d==Dn||d==xn||f&&!o){if(s=c||f?{}:An(t),!i)return c?Nc(t,bc(s,t)):Cc(t,yc(s,t))}else{if(!$[d])return o?t:{};s=fu(t,d,i)}}a||(a=new W);var p=a.get(t);if(p)return p;a.set(t,s),bu(t)?t.forEach(function(_){s.add(Qt(_,e,r,_,t,a))}):mu(t)&&t.forEach(function(_,O){s.set(O,Qt(_,e,r,O,t,a))});var v=u?c?Qe:Je:c?Gt:ue,y=l?void 0:v(t);return fi(y||t,function(_,O){y&&(O=_,_=t[O]),De(s,O,Qt(_,e,r,O,t,a))}),s}var Wu=1,Ju=4;function Rn(t){return Qt(t,Wu|Ju)}var Qu="__lodash_hash_undefined__";function qu(t){return this.__data__.set(t,Qu),this}function Yu(t){return this.__data__.has(t)}function qt(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new rt;++e<r;)this.add(t[e])}qt.prototype.add=qt.prototype.push=qu,qt.prototype.has=Yu;function Ku(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 Ln(t,e){return t.has(e)}var Xu=1,Zu=2;function Fn(t,e,r,n,o,a){var s=r&Xu,i=t.length,c=e.length;if(i!=c&&!(s&&c>i))return!1;var u=a.get(t),l=a.get(e);if(u&&l)return u==e&&l==t;var d=-1,f=!0,p=r&Zu?new qt:void 0;for(a.set(t,e),a.set(e,t);++d<i;){var v=t[d],y=e[d];if(n)var _=s?n(y,v,d,e,t,a):n(v,y,d,t,e,a);if(_!==void 0){if(_)continue;f=!1;break}if(p){if(!Ku(e,function(O,w){if(!Ln(p,w)&&(v===O||o(v,O,r,n,a)))return p.push(w)})){f=!1;break}}else if(!(v===y||o(v,y,r,n,a))){f=!1;break}}return a.delete(t),a.delete(e),f}function tl(t){var e=-1,r=Array(t.size);return t.forEach(function(n,o){r[++e]=[o,n]}),r}function Xe(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var el=1,rl=2,nl="[object Boolean]",ol="[object Date]",al="[object Error]",il="[object Map]",sl="[object Number]",cl="[object RegExp]",ul="[object Set]",ll="[object String]",fl="[object Symbol]",dl="[object ArrayBuffer]",pl="[object DataView]",Bn=V?V.prototype:void 0,Ze=Bn?Bn.valueOf:void 0;function hl(t,e,r,n,o,a,s){switch(r){case pl:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case dl:return!(t.byteLength!=e.byteLength||!a(new pe(t),new pe(e)));case nl:case ol:case sl:return Ut(+t,+e);case al:return t.name==e.name&&t.message==e.message;case cl:case ll:return t==e+"";case il:var i=tl;case ul:var c=n⪙if(i||(i=Xe),t.size!=e.size&&!c)return!1;var u=s.get(t);if(u)return u==e;n|=rl,s.set(t,e);var l=Fn(i(t),i(e),n,o,a,s);return s.delete(t),l;case fl:if(Ze)return Ze.call(t)==Ze.call(e)}return!1}var ml=1,vl=Object.prototype,gl=vl.hasOwnProperty;function yl(t,e,r,n,o,a){var s=r&ml,i=Je(t),c=i.length,u=Je(e),l=u.length;if(c!=l&&!s)return!1;for(var d=c;d--;){var f=i[d];if(!(s?f in e:gl.call(e,f)))return!1}var p=a.get(t),v=a.get(e);if(p&&v)return p==e&&v==t;var y=!0;a.set(t,e),a.set(e,t);for(var _=s;++d<c;){f=i[d];var O=t[f],w=e[f];if(n)var x=s?n(w,O,f,e,t,a):n(O,w,f,t,e,a);if(!(x===void 0?O===w||o(O,w,r,n,a):x)){y=!1;break}_||(_=f=="constructor")}if(y&&!_){var M=t.constructor,L=e.constructor;M!=L&&"constructor"in t&&"constructor"in e&&!(typeof M=="function"&&M instanceof M&&typeof L=="function"&&L instanceof L)&&(y=!1)}return a.delete(t),a.delete(e),y}var bl=1,Un="[object Arguments]",kn="[object Array]",he="[object Object]",_l=Object.prototype,Vn=_l.hasOwnProperty;function Sl(t,e,r,n,o,a){var s=I(t),i=I(e),c=s?kn:Jt(t),u=i?kn:Jt(e);c=c==Un?he:c,u=u==Un?he:u;var l=c==he,d=u==he,f=c==u;if(f&&Vt(t)){if(!Vt(e))return!1;s=!0,l=!1}if(f&&!l)return a||(a=new W),s||Ue(t)?Fn(t,e,r,n,o,a):hl(t,e,c,r,n,o,a);if(!(r&bl)){var p=l&&Vn.call(t,"__wrapped__"),v=d&&Vn.call(e,"__wrapped__");if(p||v){var y=p?t.value():t,_=v?e.value():e;return a||(a=new W),o(y,_,r,n,a)}}return f?(a||(a=new W),yl(t,e,r,n,o,a)):!1}function tr(t,e,r,n,o){return t===e?!0:t==null||e==null||!Y(t)&&!Y(e)?t!==t&&e!==e:Sl(t,e,r,n,tr,o)}var jl=1,Ol=2;function wl(t,e,r,n){var o=r.length,a=o,s=!n;if(t==null)return!a;for(t=Object(t);o--;){var i=r[o];if(s&&i[2]?i[1]!==t[i[0]]:!(i[0]in t))return!1}for(;++o<a;){i=r[o];var c=i[0],u=t[c],l=i[1];if(s&&i[2]){if(u===void 0&&!(c in t))return!1}else{var d=new W;if(n)var f=n(u,l,c,t,e,d);if(!(f===void 0?tr(l,u,jl|Ol,n,d):f))return!1}}return!0}function zn(t){return t===t&&!H(t)}function Cl(t){for(var e=ue(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,zn(o)]}return e}function Gn(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function El(t){var e=Cl(t);return e.length==1&&e[0][2]?Gn(e[0][0],e[0][1]):function(r){return r===t||wl(r,t,e)}}function $l(t,e){return t!=null&&e in Object(t)}function Nl(t,e,r){e=jt(e,t);for(var n=-1,o=e.length,a=!1;++n<o;){var s=Ot(e[n]);if(!(a=t!=null&&r(t,s)))break;t=t[s]}return a||++n!=o?a:(o=t==null?0:t.length,!!o&&Re(o)&&se(s,o)&&(I(t)||kt(t)))}function Tl(t,e){return t!=null&&Nl(t,e,$l)}var Al=1,Ml=2;function Pl(t,e){return ke(t)&&zn(e)?Gn(Ot(t),e):function(r){var n=ln(r,t);return n===void 0&&n===e?Tl(r,t):tr(e,n,Al|Ml)}}function xl(t){return function(e){return e==null?void 0:e[t]}}function Il(t){return function(e){return de(e,t)}}function Dl(t){return ke(t)?xl(Ot(t)):Il(t)}function er(t){return typeof t=="function"?t:t==null?Ae:typeof t=="object"?I(t)?Pl(t[0],t[1]):El(t):Dl(t)}function Rl(t){return function(e,r,n){for(var o=-1,a=Object(e),s=n(e),i=s.length;i--;){var c=s[t?i:++o];if(r(a[c],c,a)===!1)break}return e}}var Ll=Rl();const Fl=Ll;function rr(t,e,r){(r!==void 0&&!Ut(t[e],r)||r===void 0&&!(e in t))&&Ie(t,e,r)}function nr(t){return Y(t)&&ce(t)}function or(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Bl(t){return _t(t,Gt(t))}function Ul(t,e,r,n,o,a,s){var i=or(t,r),c=or(e,r),u=s.get(c);if(u){rr(t,r,u);return}var l=a?a(i,c,r+"",t,e,s):void 0,d=l===void 0;if(d){var f=I(c),p=!f&&Vt(c),v=!f&&!p&&Ue(c);l=c,f||p||v?I(i)?l=i:nr(i)?l=qr(i):p?(d=!1,l=gn(c,!0)):v?(d=!1,l=Tn(c,!0)):l=[]:F(c)||kt(c)?(l=i,kt(i)?l=Bl(i):(!H(i)||Me(i))&&(l=An(c))):d=!1}d&&(s.set(c,l),o(l,c,n,a,s),s.delete(c)),rr(t,r,l)}function Hn(t,e,r,n,o){t!==e&&Fl(e,function(a,s){if(o||(o=new W),H(a))Ul(t,e,s,r,Hn,n,o);else{var i=n?n(or(t,s),a,s+"",t,e,o):void 0;i===void 0&&(i=a),rr(t,s,i)}},Gt)}function kl(t,e,r){for(var n=-1,o=t==null?0:t.length;++n<o;)if(r(e,t[n]))return!0;return!1}function Wn(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function Vl(t,e){return e.length<2?t:de(t,fc(e,0,-1))}var zl=Oi(function(t,e,r){Hn(t,e,r)});const Jn=zl;var Gl="Expected a function";function Hl(t){if(typeof t!="function")throw new TypeError(Gl);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 Wl(t,e){return e=jt(e,t),t=Vl(t,e),t==null||delete t[Ot(Wn(e))]}function Jl(t){return F(t)?void 0:t}var Ql=1,ql=2,Yl=4,Kl=oc(function(t,e){var r={};if(t==null)return r;var n=!1;e=Te(e,function(a){return a=jt(a,t),n||(n=a.length>1),a}),_t(t,Qe(t),r),n&&(r=Qt(r,Ql|ql|Yl,Jl));for(var o=e.length;o--;)Wl(r,e[o]);return r});const Qn=Kl;function Xl(t,e,r,n){if(!H(t))return t;e=jt(e,t);for(var o=-1,a=e.length,s=a-1,i=t;i!=null&&++o<a;){var c=Ot(e[o]),u=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(o!=s){var l=i[c];u=n?n(l,c,i):void 0,u===void 0&&(u=H(l)?l:se(e[o+1])?[]:{})}De(i,c,u),i=i[c]}return t}function Zl(t,e,r){for(var n=-1,o=e.length,a={};++n<o;){var s=e[n],i=de(t,s);r(i,s)&&Xl(a,jt(s,t),i)}return a}function tf(t,e){if(t==null)return{};var r=Te(Qe(t),function(n){return[n]});return e=er(e),Zl(t,r,function(n,o){return e(n,o[0])})}function ef(t,e){return tf(t,Hl(er(e)))}var rf=1/0,nf=wt&&1/Xe(new wt([,-0]))[1]==rf?function(t){return new wt(t)}:ri;const of=nf;var af=200;function sf(t,e,r){var n=-1,o=vi,a=t.length,s=!0,i=[],c=i;if(r)s=!1,o=kl;else if(a>=af){var u=e?null:of(t);if(u)return Xe(u);s=!1,o=Ln,c=new qt}else c=e?[]:i;t:for(;++n<a;){var l=t[n],d=e?e(l):l;if(l=r||l!==0?l:0,s&&d===d){for(var f=c.length;f--;)if(c[f]===d)continue t;e&&c.push(d),i.push(l)}else o(c,d,r)||(c!==i&&c.push(d),i.push(l))}return i}var cf=Zr(function(t){var e=Wn(t);return nr(e)&&(e=void 0),sf(Ge(t,1,nr,!0),er(e))});const uf=cf;class qn extends TypeError{constructor(e,r){let n;const{message:o,...a}=e,{path:s}=e,i=s.length===0?o:"At path: "+s.join(".")+" -- "+o;super(i),this.value=void 0,this.key=void 0,this.type=void 0,this.refinement=void 0,this.path=void 0,this.branch=void 0,this.failures=void 0,Object.assign(this,a),this.name=this.constructor.name,this.failures=()=>{var c;return(c=n)!=null?c:n=[e,...r()]}}}function lf(t){return J(t)&&typeof t[Symbol.iterator]=="function"}function J(t){return typeof t=="object"&&t!=null}function k(t){return typeof t=="string"?JSON.stringify(t):""+t}function ff(t){const{done:e,value:r}=t.next();return e?void 0:r}function df(t,e,r,n){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:o,branch:a}=e,{type:s}=r,{refinement:i,message:c="Expected a value of type `"+s+"`"+(i?" with refinement `"+i+"`":"")+", but received: `"+k(n)+"`"}=t;return{value:n,type:s,refinement:i,key:o[o.length-1],path:o,branch:a,...t,message:c}}function*Yn(t,e,r,n){lf(t)||(t=[t]);for(const o of t){const a=df(o,e,r,n);a&&(yield a)}}function*ar(t,e,r){r===void 0&&(r={});const{path:n=[],branch:o=[t],coerce:a=!1,mask:s=!1}=r,i={path:n,branch:o};if(a&&(t=e.coercer(t,i),s&&e.type!=="type"&&J(e.schema)&&J(t)&&!Array.isArray(t)))for(const u in t)e.schema[u]===void 0&&delete t[u];let c="valid";for(const u of e.validator(t,i))c="not_valid",yield[u,void 0];for(let[u,l,d]of e.entries(t,i)){const f=ar(l,d,{path:u===void 0?n:[...n,u],branch:u===void 0?o:[...o,l],coerce:a,mask:s});for(const p of f)p[0]?(c=p[0].refinement!=null?"not_refined":"not_valid",yield[p[0],void 0]):a&&(l=p[1],u===void 0?t=l:t instanceof Map?t.set(u,l):t instanceof Set?t.add(l):J(t)&&(t[u]=l))}if(c!=="not_valid")for(const u of e.refiner(t,i))c="not_refined",yield[u,void 0];c==="valid"&&(yield[void 0,t])}class K{constructor(e){this.TYPE=void 0,this.type=void 0,this.schema=void 0,this.coercer=void 0,this.validator=void 0,this.refiner=void 0,this.entries=void 0;const{type:r,schema:n,validator:o,refiner:a,coercer:s=c=>c,entries:i=function*(){}}=e;this.type=r,this.schema=n,this.entries=i,this.coercer=s,o?this.validator=(c,u)=>{const l=o(c,u);return Yn(l,u,this,c)}:this.validator=()=>[],a?this.refiner=(c,u)=>{const l=a(c,u);return Yn(l,u,this,c)}:this.refiner=()=>[]}assert(e){return Kn(e,this)}create(e){return pf(e,this)}is(e){return mf(e,this)}mask(e){return hf(e,this)}validate(e,r){return r===void 0&&(r={}),Ct(e,this,r)}}function Kn(t,e){const r=Ct(t,e);if(r[0])throw r[0]}function pf(t,e){const r=Ct(t,e,{coerce:!0});if(r[0])throw r[0];return r[1]}function hf(t,e){const r=Ct(t,e,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}function mf(t,e){return!Ct(t,e)[0]}function Ct(t,e,r){r===void 0&&(r={});const n=ar(t,e,r),o=ff(n);return o[0]?[new qn(o[0],function*(){for(const a of n)a[0]&&(yield a[0])}),void 0]:[void 0,o[1]]}function ir(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];const n=e[0].type==="type",o=e.map(s=>s.schema),a=Object.assign({},...o);return n?eo(a):C(a)}function at(t,e){return new K({type:t,schema:null,validator:e})}function Et(t){return new K({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 Xn(t,e){const{schema:r}=t,n={...r};for(const o of e)delete n[o];switch(t.type){case"type":return eo(n);default:return C(n)}}function D(){return at("any",()=>!0)}function P(t){return new K({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||"Expected an array value, but received: "+k(e)}})}function $t(){return at("boolean",t=>typeof t=="boolean")}function sr(t){const e={},r=t.map(n=>k(n)).join();for(const n of t)e[n]=n;return new K({type:"enums",schema:e,validator(n){return t.includes(n)||"Expected one of `"+r+"`, but received: "+k(n)}})}function Zn(){return at("func",t=>typeof t=="function"||"Expected a function, but received: "+k(t))}function B(t){const e=k(t),r=typeof t;return new K({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||"Expected the literal `"+e+"`, but received: "+k(n)}})}function vf(){return at("never",()=>!1)}function to(){return at("number",t=>typeof t=="number"&&!isNaN(t)||"Expected a number, but received: "+k(t))}function C(t){const e=t?Object.keys(t):[],r=vf();return new K({type:"object",schema:t||null,*entries(n){if(t&&J(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 J(n)||"Expected an object, but received: "+k(n)},coercer(n){return J(n)?{...n}:n}})}function m(t){return new K({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function Yt(t,e){return new K({type:"record",schema:null,*entries(r){if(J(r))for(const n in r){const o=r[n];yield[n,n,t],yield[n,o,e]}},validator(r){return J(r)||"Expected an object, but received: "+k(r)}})}function h(){return at("string",t=>typeof t=="string"||"Expected a string, but received: "+k(t))}function eo(t){const e=Object.keys(t);return new K({type:"type",schema:t,*entries(r){if(J(r))for(const n of e)yield[n,r[n],t[n]]},validator(r){return J(r)||"Expected an object, but received: "+k(r)}})}function U(t){const e=t.map(r=>r.type).join(" | ");return new K({type:"union",schema:null,coercer(r,n){return(t.find(o=>{const[a]=o.validate(r,{coerce:!0});return!a})||gf()).coercer(r,n)},validator(r,n){const o=[];for(const a of t){const[...s]=ar(r,a,n),[i]=s;if(i[0])for(const[c]of s)c&&o.push(c);else return[]}return["Expected the value to satisfy a union of `"+e+"`, but received: "+k(r),...o]}})}function gf(){return at("unknown",()=>!0)}const cr=C({package:h(),version:h(),name:h(),exportName:m(h()),destructuring:m($t()),subName:m(h()),main:m(h()),cssPaths:m(P(h()))}),yf=P(cr),bf=["CBlock","CContainer","CImage","CCanvas","CVideo","CAudio","CText","CNativeTag"];var z=(t=>(t.SLOT="SLOT",t.FUNCTION="FUNCTION",t.EXPRESSION="EXPRESSION",t))(z||{}),ur=(t=>(t.DESIGN="design",t.SAVE="save",t))(ur||{}),lr=(t=>(t.FUNC="FUNC",t.COMP="COMP",t))(lr||{});const _f=()=>at("normalObj",t=>!F(t)||[z.SLOT,z.EXPRESSION,z.FUNCTION].includes(t==null?void 0:t.type)?!1:(Ct(t,Yt(h(),fr)),!0)),fr=U([h(),to(),$t(),C({type:B(z.SLOT),renderType:sr([lr.FUNC,lr.COMP]),params:m(P(h())),value:Et(()=>U([Nt,P(Nt)]))}),C({type:B(z.EXPRESSION),value:h()}),C({type:B(z.FUNCTION),value:h()}),_f(),P(Et(()=>fr))]),ro=C({type:B(z.EXPRESSION),value:h()}),Nt=C({id:m(h()),title:m(h()),componentName:h(),props:m(Yt(h(),fr)),nodeName:m(h()),state:m(Yt(h(),D())),children:Et(()=>m(P(U([h(),Nt])))),configure:m(D()),css:m(D()),style:m(D()),classNames:m(P(D())),refId:m(h()),extra:m(Yt(D(),D())),condition:m(U([$t(),ro])),loop:m(C({open:$t(),data:U([P(D()),ro]),args:m(P(h())),forName:m(h()),forIndex:m(h()),key:m(D()),name:m(h())})),methods:m(P(D()))}),me=U([h(),C({label:h(),tip:m(h())})]),Sf=C({type:B("shape"),value:P(C({name:h(),title:me,valueType:Et(()=>ve)}))}),jf=C({type:B("enums"),value:P(h())});C({type:B("array"),value:Et(()=>ve)});const Of=C({type:B("array"),value:Et(()=>P(ve))}),ve=U([sr(["array","boolean","number","object","string"]),sr(["component","expression","function"]),Sf,jf,Of]),wf=U([h(),C({componentName:h(),props:m(D()),initialValue:m(D()),component:m(D())})]),dr=C({name:h(),title:me,valueType:ve,description:m(h()),defaultValue:D(),setters:m(P(wf)),condition:m(Zn())});U([h(),Zn()]);var pr=(t=>(t.SINGLE="single",t.GROUP="group",t))(pr||{});U([h(),C({name:h(),describe:m(h()),params:m(C({name:h(),description:h()})),template:h()})]);const Cf=C({id:m(h()),title:h(),snapshot:U([h(),D()]),snapshotText:m(h()),description:m(h()),tags:m(P(h())),groupName:m(h()),category:m(h()),schema:ir(Xn(Nt,["id"]),C({componentName:m(h())}))}),Ef=C({componentName:h(),title:h(),screenshot:m(h()),icon:m(h()),tags:m(P(h())),groupName:m(h()),category:m(h()),priority:m(to()),npm:m(cr),snippets:P(Cf),props:P(U([dr,C({title:m(me),type:B("single"),content:dr}),C({title:m(me),type:B("group"),content:P(dr)})])),fixedProps:m(D()),isContainer:m(U([$t(),C({placeholder:h(),width:h(),height:h()})])),disableEditorDragDom:m(D()),isLayout:m($t()),rootSelector:m(h()),advanceCustom:m(D()),extra:m(Yt(D(),D()))}),$f=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}
|
|
2
2
|
originData: ${JSON.stringify(e)}`):new Error(`${JSON.stringify(e)}
|
|
3
3
|
data struct format is invalidate`);return o.message||r?console.warn(`${o.message||r}
|
|
4
4
|
originData: ${JSON.stringify(e)}`):console.warn(`${JSON.stringify(e)}
|
|
5
|
-
data struct format is invalidate`),o},
|
|
6
|
-
`)),{isValidate:!1,message:i,error:s}}})({data:e,message:r,throwError:n})};var Qt=(t=>(t.ROOT_CONTAINER="RootContainer",t))(Qt||{});const gd=M({type:X(at.FUNCTION),value:g()}),yd=Dr(Po(qt,["componentName"]),M({componentName:X("RootContainer")}));function bd(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 Ce=bd(),_d=(t,e)=>{const r={...t,value:[]},n=t.value;let o=new xt([]);return e&&(o=e.materialsMode||new xt([])),n&&(G(n)?r.value=n.map(a=>new k(a,{parent:e,materials:o})):K(n)&&r.value.push(new k(n,{parent:e,materials:o}))),r};class Kt{constructor(e,r){T(this,"nodeType","SLOT"),T(this,"rawData"),T(this,"parent"),T(this,"emitter",Ce),T(this,"data"),T(this,"id"),T(this,"materialsMode"),this.parent=(r==null?void 0:r.parent)||null,this.rawData=e;const n=(r==null?void 0:r.materials)||new xt([]);this.materialsMode=n,this.id=vt(),this.data=_d(e,this)}get value(){return this.data}export(e){const r=this.data,n=o=>{if(o instanceof k)return o.export(e);if(K(o)){const a={};return Object.keys(o||{}).forEach(s=>{a[s]=n(o[s])}),a}return G(o)?o.map(a=>n(a)):(e==="design"&&delete o.id,o)};return n(r)}}const Do=t=>{let e=[];return t.forEach(r=>{const n=r;n.type?n.type===Vr.SINGLE?e.push(n.content):n.type===Vr.GROUP&&(e=[...e,...Do(n.content)]):e.push(r)}),e},zr=(t,e,r)=>{if(t.type)return t.type===at.SLOT?new Kt(t,{parent:e,materials:r}):t;if(K(t)){const n={};return Object.keys(t).forEach(o=>{n[o]=Wr(t[o],e,r)}),n}else return Array.isArray(t)?t.map(n=>zr(n,e,r)):t},Wr=(t,e,r)=>K(t)?zr(t,e,r):G(t)?t.map(n=>zr(n,e,r)):t;class jt{constructor(e,r,n){T(this,"nodeType","PROP"),T(this,"rawData"),T(this,"parent"),T(this,"emitter",Ce),T(this,"data"),T(this,"name"),T(this,"materialsMode");const o=(n==null?void 0:n.materials)||new xt([]);this.materialsMode=o,this.parent=n==null?void 0:n.parent,this.rawData=r,this.name=e,this.data=Wr(r,this,o)}isIncludeSlot(){return!1}isIncludeExpression(){return!1}get value(){return this.data}updateValue(e){const r=this.data;this.data=Wr(e??r,this,this.materialsMode),this.emitter.emit("onPropChange",{value:this.data,preValue:r,node:this}),this.parent&&!(this.parent instanceof Kt)&&this.emitter.emit("onNodeChange",{value:this.parent.value,preValue:this.parent.value,node:this.parent})}get material(){const e=this.parent;if(e instanceof k){const r=e.material;return Do((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 jt||o instanceof Kt||o instanceof k)return o.export(e);if(G(o))return o.map(a=>n(a));if(K(o)){const a={};return Object.keys(o||{}).forEach(s=>{a[s]=n(o[s])}),a}return o};return n(r)}}const Sd=t=>{if(typeof t=="string")return!0;Gr({data:t,dataStruct:qt,throwError:!1})},Io=(t,e,r=new xt([]))=>{if(typeof t=="string")return t;const n={...t,id:t.id??vt(),children:[],props:{},methods:t.methods||[],configure:Eo(t.configure||{},{propsSetter:{},advanceSetter:{}})},o=Object.keys(t.props||{});return o.length&&o.forEach(a=>{var s;const i=(s=t.props)==null?void 0:s[a];if(i instanceof jt){n.props[a]=i;return}n.props[a]=new jt(a,i||"",{parent:e,materials:r})}),t.children&&(Array.isArray(t.children)?n.children=t.children.map(a=>{if(a instanceof k)return a;if(K(a)){const s=a;return new k(s,{parent:e,materials:r})}else return a}):(t.children instanceof k&&(n.children=[t.children]),n.children=[new k(t.children,{parent:e,materials:r})])),n};class k{constructor(e,r){T(this,"nodeType","NODE"),T(this,"rawData"),T(this,"data"),T(this,"emitter",Ce),T(this,"parent"),T(this,"materialsModel"),T(this,"listenerHandle"),T(this,"onChangeCbQueue"),this.rawData=JSON.parse(JSON.stringify(e)),Sd(e);const n=(r==null?void 0:r.materials)||new xt([]);this.parent=(r==null?void 0:r.parent)||null,this.materialsModel=n,this.data=Io(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||vt()};return new k(r,{materials:this.materialsModel})}updateWithPlainObj(e){const r={...this.data,...e};return this.data=Io(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 Jr(this,e)}get props(){return this.data.props}get material(){const e=this.materialsModel;return e==null?void 0:e.findByComponentName(this.data.componentName)}getPlainProps(){const e=this.data,r={};return Object.keys(e.props||{}).forEach(n=>{r[n]=e.props[n].export("design")}),r}getMaterialConfig(e){var r;return this.data.configure[e]!==void 0?this.data.configure.isContainer:(r=this.material)==null?void 0:r.value.isContainer}isContainer(){return this.getMaterialConfig("isContainer")}export(e){var r;const n=this.data;if(typeof n=="string")return n;const o={};Object.keys(n.props||{}).forEach(f=>{o[f]=n.props[f].export(e)});const a=(r=n.children)==null?void 0:r.map(f=>f instanceof k?f.export(e):f),s=n.configure||{},i=s.propsSetter||{},c={};Object.keys(i).forEach(f=>{const p=Bn(i,f,!1);p&&(c[f]=p)}),s.propsSetter=c,this.material&&this.materialsModel.usedMaterials.push(this.material);let l={...n,configure:s,props:o,children:a};return e==="design"&&delete l.id,l=Yr(l),l}}const Lo=(t,e,r)=>{const n={...t,id:vt(),props:{},componentName:Qt.ROOT_CONTAINER,children:[],methods:t.methods||[],configure:Eo(t.configure||{},{propsSetter:{},advanceSetter:{}})};let o=[];G(t.children)?o=t.children.map(s=>s instanceof k?s:K(s)?new k(s,{parent:e,materials:r}):s):t.children instanceof k?o.push(t.children):t.children&&K(t.children)&&o.push(new k(t.children,{parent:e,materials:r}));const a=Object.keys(t.props||{});return a.length&&a.forEach(s=>{var i;const c=(i=t.props)==null?void 0:i[s];c instanceof jt?n.props[s]=c:n.props[s]=new jt(s,c||"",{parent:e,materials:r})}),n.children=o,n};class Ee{constructor(e,{parent:r,materials:n}){T(this,"rawData"),T(this,"data"),T(this,"nodeType",Qt.ROOT_CONTAINER),T(this,"emitter",Ce),T(this,"materialsModel"),T(this,"listenerHandle"),T(this,"onChangeCbQueue"),T(this,"parent"),this.materialsModel=n,this.rawData=JSON.parse(JSON.stringify(e)),this.data=Lo(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=Lo(r,this,this.materialsModel),r}updateValue(e){const r=this.data;this.updateWithPlainObj(e),this.emitter.emit("onNodeChange",{value:this.data,preValue:r,node:this})}contains(e){return Jr(this,e)}getMaterialConfig(e){var r;return this.data.configure[e]!==void 0?this.data.configure.isContainer:(r=this.material)==null?void 0:r.value.isContainer}isContainer(){return this.getMaterialConfig("isContainer")}export(e=Fr.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 l;return(l=c==null?void 0:c.export)==null?void 0:l.call(c,e)}))||[],s={...n,props:o,children:a.filter(c=>c)};let i=wo(s,["id"]);return i=Yr(i),i}getPlainProps(){const e=this.data,r={};return Object.keys(e.props||{}).forEach(n=>{r[n]=e.props[n].export("design")}),r}destroy(){this.listenerHandle.forEach(e=>e())}clone(e){const r={...this.export("design"),id:e||vt()};return new Ee(r,{materials:this.materialsModel,parent:null})}}const Mt=t=>(t==null?void 0:t.type)===at.EXPRESSION,Od=t=>(t==null?void 0:t.type)===at.FUNCTION,vt=()=>Math.random().toString(32).slice(3,9),jd=t=>(t==null?void 0:t.nodeType)==="NODE",Hr=t=>(t==null?void 0:t.nodeType)==="PROP",Cd=t=>(t==null?void 0:t.nodeType)==="SLOT",Yr=t=>Wf(t,e=>K(e)?!Object.keys(e).length:G(e)?!e.length:!e);function Ed(t,e){const r=[t];for(;r.length;){const n=r.shift();if(n&&e(n))return n;const o=(n==null?void 0:n.props)||{},a=i=>{if(i instanceof k){r.push(i);return}if(i instanceof Kt&&a(i.value.value),i instanceof jt){a(i.value);return}if(K(i)){const c=i;Object.keys(c).forEach(l=>{a(c[l])});return}if(G(i)){i.forEach(c=>{a(c)});return}};a(o);const s=(n==null?void 0:n.value.children.filter(i=>i instanceof k))||[];r.push(...s)}}function Jr(t,e){return Ed(t,r=>r.id===e)}const wd=t=>{const e=ho(t),r=e.snippets;return delete e.snippets,e.snippets=r.map(n=>({...e,...n,id:n.id||`${t.componentName}-${vt()}`,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 Td{constructor(e){T(this,"rawData"),T(this,"data"),this.rawData=e,this.data=wd(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 $d=t=>{if(!G(t))throw new Error("Materials must be a array");return t.map(e=>new Td(e))},Nd=t=>{t==null||t.forEach(e=>{Gr({data:e,dataStruct:vd,throwError:!1})})};class xt{constructor(e){T(this,"rawData"),T(this,"data"),T(this,"usedMaterials",[]),this.rawData=e,Nd(e),this.data=$d(e)}findByComponentName(e){return this.data.find(r=>r.componentName===e)}findSnippetById(e){const r=[...this.data];let n=null;for(;!n&&r.length;){const o=r.pop();n=o==null?void 0:o.getSnippetById(e)}return n}getAllSnippets(){const e=this.data.reduce((a,s)=>(a.push(...s.snippets),a),[]),r=[],n={default:[]};e.forEach(a=>{const s=a.groupName||"default";r.includes(s)||(r.push(s),n[s]=[]),n[s].push(a)});let o=[];return r.forEach(a=>{const s=["default"],i={default:[]},c=n[a];if(c.length!==0){c.forEach(p=>{const d=p.category||"default";s.includes(d)||(s.push(d),i[d]=[]),i[d].push(p)});const l=[];s.forEach(p=>{i[p].length&&l.push({name:p,list:i[p]})});const f={name:a,list:l};o.push(f)}}),o=o.sort((a,s)=>(a.name||"")>(s.name||"")?1:-1),o}get value(){return this.data}get rawValue(){return this.rawData}}const Pd=M({version:g(),name:g(),css:b(g()),renderType:b(Z([X("COMPONENT"),X("PAGE")])),methods:b(V(gd)),componentsMeta:V(Dr(M({componentName:g()}),Lr)),thirdLibs:b(sd),componentsTree:yd,assets:b(V(z()))}),Fo=t=>(Gr({data:t,dataStruct:Pd,throwError:!1}),t),qr=(t,e,r)=>({...t,componentsTree:new Ee(t.componentsTree,{parent:e,materials:r})});class We{constructor(e,r){T(this,"nodeType","PAGE"),T(this,"rawData"),T(this,"emitter",Ce),T(this,"data"),T(this,"parent"),T(this,"materialsModel"),T(this,"assetPackagesList"),Fo(e),this.rawData=JSON.parse(JSON.stringify(e)),this.materialsModel=new xt((r==null?void 0:r.materials)||[]),this.data=qr(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=qr(e,this,this.materialsModel),this.emitter.emit("onPageChange",{value:this.data,preValue:r,node:this})}reloadPage(e){const r=this.data;this.rawData=JSON.parse(JSON.stringify(e)),this.data=qr(e,this,this.materialsModel),this.emitter.emit("onReloadPage",{value:this.data,preValue:r,node:this})}get value(){return this.data}getNode(e){if(!e)return;const r=this.data.componentsTree;return Jr(r,e)}addNode(e,r,n="AFTER"){var o;if(n==="AFTER"||n==="BEFORE"){const a=r.parent;if(a===null&&r instanceof Ee)return console.warn("Not found parent node"),!1;if(a instanceof jt)return console.warn("CProp can not add node"),!1;if(a instanceof Kt){const i=a.value.value,c=i.findIndex(l=>l===r)??-1;return c>=0?(n==="BEFORE"?i.splice(c,0,e):i.splice(c+1,0,e),e.parent=a,(o=a.parent)==null||o.updateValue(),!0):!1}if(a instanceof We)return!1;const s=(a==null?void 0:a.value.children.findIndex(i=>i===r))??-1;return s>=0?(n==="BEFORE"?a==null||a.value.children.splice(s,0,e):a==null||a.value.children.splice(s+1,0,e),e.parent=a,a==null||a.updateValue(),!0):(console.warn("Not found target node"),!1)}if(n==="CHILD_START")return r.value.children.unshift(e),e.parent=r,r.updateValue(),!0;if(n==="CHILD_END")return r.value.children.push(e),e.parent=r,r.updateValue(),!0;if(K(n)){const a=n;if(a.type==="CHILD"){const s=a.pos,i=a.index||0;return s==="BEFORE"?r==null||r.value.children.splice(i,0,e):r==null||r.value.children.splice(i+1,0,e),e.parent=r,r.updateValue(),!0}else console.warn("Can not parse pos obj")}return!1}createNode(e){return delete e.id,new k(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=vt();const n=new k(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 k?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 k&&a instanceof k?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 Kt){const o=n.value.value,a=o.findIndex(i=>i===e),s=o[a];return o.splice(a,1),(r=n.parent)==null||r.updateValue(),s}if(n instanceof k||n instanceof Ee){const o=n.value.children,a=o.findIndex(i=>i===e),s=o[a];return o.splice(a,1),n.updateValue(),s}}deleteNodeById(e){const r=this.getNode(e);if(r)return this.deleteNode(r)}export(e=Fr.SAVE){var r;const n=this.data.componentsTree.export(e),o=this.assetPackagesList,a=[],s=this.materialsModel.usedMaterials.map(c=>{const l=o.find(f=>{var p;return f.package===((p=c.value.npm)==null?void 0:p.package)});return l&&a.push(l),{componentName:c.componentName,...ho(c.value.npm||{})}}).filter(c=>!!(c.componentName&&c.package&&c.version));this.materialsModel.usedMaterials=[];let i={...this.data,componentsTree:Yr(n),componentsMeta:s,thirdLibs:this.data.thirdLibs,assets:[]};return(r=this.data.thirdLibs)==null||r.forEach(c=>{const l=o.find(f=>c.package===f.package);l&&a.push(l)}),i.assets=Xf(a,c=>c.package),i=wo(i,["id"]),JSON.parse(JSON.stringify(i))}getRootNode(){return this.data.componentsTree}}Qt.ROOT_CONTAINER;var Ad=typeof global=="object"&&global&&global.Object===Object&&global;const ko=Ad;var Rd=typeof self=="object"&&self&&self.Object===Object&&self,Md=ko||Rd||Function("return this")();const Xt=Md;var xd=Xt.Symbol;const Zt=xd;var Uo=Object.prototype,Dd=Uo.hasOwnProperty,Id=Uo.toString,we=Zt?Zt.toStringTag:void 0;function Ld(t){var e=Dd.call(t,we),r=t[we];try{t[we]=void 0;var n=!0}catch{}var o=Id.call(t);return n&&(e?t[we]=r:delete t[we]),o}var Fd=Object.prototype,kd=Fd.toString;function Ud(t){return kd.call(t)}var Bd="[object Null]",Vd="[object Undefined]",Bo=Zt?Zt.toStringTag:void 0;function Te(t){return t==null?t===void 0?Vd:Bd:Bo&&Bo in Object(t)?Ld(t):Ud(t)}function te(t){return t!=null&&typeof t=="object"}var Gd="[object Symbol]";function zd(t){return typeof t=="symbol"||te(t)&&Te(t)==Gd}function Wd(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 Hd=Array.isArray;const ee=Hd;var Yd=1/0,Vo=Zt?Zt.prototype:void 0,Go=Vo?Vo.toString:void 0;function zo(t){if(typeof t=="string")return t;if(ee(t))return Wd(t,zo)+"";if(zd(t))return Go?Go.call(t):"";var e=t+"";return e=="0"&&1/t==-Yd?"-0":e}function Dt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function Wo(t){return t}var Jd="[object AsyncFunction]",qd="[object Function]",Qd="[object GeneratorFunction]",Kd="[object Proxy]";function Qr(t){if(!Dt(t))return!1;var e=Te(t);return e==qd||e==Qd||e==Jd||e==Kd}var Xd=Xt["__core-js_shared__"];const Kr=Xd;var Ho=function(){var t=/[^.]+$/.exec(Kr&&Kr.keys&&Kr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Zd(t){return!!Ho&&Ho in t}var tp=Function.prototype,ep=tp.toString;function rp(t){if(t!=null){try{return ep.call(t)}catch{}try{return t+""}catch{}}return""}var np=/[\\^$.*+?()[\]{}|]/g,op=/^\[object .+?Constructor\]$/,ap=Function.prototype,ip=Object.prototype,sp=ap.toString,cp=ip.hasOwnProperty,up=RegExp("^"+sp.call(cp).replace(np,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function lp(t){if(!Dt(t)||Zd(t))return!1;var e=Qr(t)?up:op;return e.test(rp(t))}function fp(t,e){return t==null?void 0:t[e]}function Xr(t,e){var r=fp(t,e);return lp(r)?r:void 0}var Yo=Object.create,dp=function(){function t(){}return function(e){if(!Dt(e))return{};if(Yo)return Yo(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();const pp=dp;function hp(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 vp(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var mp=800,gp=16,yp=Date.now;function bp(t){var e=0,r=0;return function(){var n=yp(),o=gp-(n-r);if(r=n,o>0){if(++e>=mp)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function _p(t){return function(){return t}}var Sp=function(){try{var t=Xr(Object,"defineProperty");return t({},"",{}),t}catch{}}();const He=Sp;var Op=He?function(t,e){return He(t,"toString",{configurable:!0,enumerable:!1,value:_p(e),writable:!0})}:Wo,jp=bp(Op);const Cp=jp;var Ep=9007199254740991,wp=/^(?:0|[1-9]\d*)$/;function Jo(t,e){var r=typeof t;return e=e??Ep,!!e&&(r=="number"||r!="symbol"&&wp.test(t))&&t>-1&&t%1==0&&t<e}function Zr(t,e,r){e=="__proto__"&&He?He(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Ye(t,e){return t===e||t!==t&&e!==e}var Tp=Object.prototype,$p=Tp.hasOwnProperty;function Np(t,e,r){var n=t[e];(!($p.call(t,e)&&Ye(n,r))||r===void 0&&!(e in t))&&Zr(t,e,r)}function Pp(t,e,r,n){var o=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var i=e[a],c=n?n(r[i],t[i],i,r,t):void 0;c===void 0&&(c=t[i]),o?Zr(r,i,c):Np(r,i,c)}return r}var qo=Math.max;function Ap(t,e,r){return e=qo(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=qo(n.length-e,0),s=Array(a);++o<a;)s[o]=n[e+o];o=-1;for(var i=Array(e+1);++o<e;)i[o]=n[o];return i[e]=r(s),hp(t,this,i)}}function Rp(t,e){return Cp(Ap(t,e,Wo),t+"")}var Mp=9007199254740991;function Qo(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Mp}function tn(t){return t!=null&&Qo(t.length)&&!Qr(t)}function xp(t,e,r){if(!Dt(r))return!1;var n=typeof e;return(n=="number"?tn(r)&&Jo(e,r.length):n=="string"&&e in r)?Ye(r[e],t):!1}function Dp(t){return Rp(function(e,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,s=o>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(o--,a):void 0,s&&xp(r[0],r[1],s)&&(a=o<3?void 0:a,o=1),e=Object(e);++n<o;){var i=r[n];i&&t(e,i,n,a)}return e})}var Ip=Object.prototype;function Ko(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Ip;return t===r}function Lp(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Fp="[object Arguments]";function Xo(t){return te(t)&&Te(t)==Fp}var Zo=Object.prototype,kp=Zo.hasOwnProperty,Up=Zo.propertyIsEnumerable,Bp=Xo(function(){return arguments}())?Xo:function(t){return te(t)&&kp.call(t,"callee")&&!Up.call(t,"callee")};const en=Bp;function Vp(){return!1}var ta=typeof _=="object"&&_&&!_.nodeType&&_,ea=ta&&typeof module=="object"&&module&&!module.nodeType&&module,Gp=ea&&ea.exports===ta,ra=Gp?Xt.Buffer:void 0,zp=ra?ra.isBuffer:void 0,Wp=zp||Vp;const na=Wp;var Hp="[object Arguments]",Yp="[object Array]",Jp="[object Boolean]",qp="[object Date]",Qp="[object Error]",Kp="[object Function]",Xp="[object Map]",Zp="[object Number]",th="[object Object]",eh="[object RegExp]",rh="[object Set]",nh="[object String]",oh="[object WeakMap]",ah="[object ArrayBuffer]",ih="[object DataView]",sh="[object Float32Array]",ch="[object Float64Array]",uh="[object Int8Array]",lh="[object Int16Array]",fh="[object Int32Array]",dh="[object Uint8Array]",ph="[object Uint8ClampedArray]",hh="[object Uint16Array]",vh="[object Uint32Array]",L={};L[sh]=L[ch]=L[uh]=L[lh]=L[fh]=L[dh]=L[ph]=L[hh]=L[vh]=!0,L[Hp]=L[Yp]=L[ah]=L[Jp]=L[ih]=L[qp]=L[Qp]=L[Kp]=L[Xp]=L[Zp]=L[th]=L[eh]=L[rh]=L[nh]=L[oh]=!1;function mh(t){return te(t)&&Qo(t.length)&&!!L[Te(t)]}function gh(t){return function(e){return t(e)}}var oa=typeof _=="object"&&_&&!_.nodeType&&_,$e=oa&&typeof module=="object"&&module&&!module.nodeType&&module,yh=$e&&$e.exports===oa,rn=yh&&ko.process,bh=function(){try{var t=$e&&$e.require&&$e.require("util").types;return t||rn&&rn.binding&&rn.binding("util")}catch{}}();const aa=bh;var ia=aa&&aa.isTypedArray,_h=ia?gh(ia):mh;const sa=_h;var Sh=Object.prototype,Oh=Sh.hasOwnProperty;function jh(t,e){var r=ee(t),n=!r&&en(t),o=!r&&!n&&na(t),a=!r&&!n&&!o&&sa(t),s=r||n||o||a,i=s?Lp(t.length,String):[],c=i.length;for(var l in t)(e||Oh.call(t,l))&&!(s&&(l=="length"||o&&(l=="offset"||l=="parent")||a&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||Jo(l,c)))&&i.push(l);return i}function Ch(t,e){return function(r){return t(e(r))}}function Eh(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var wh=Object.prototype,Th=wh.hasOwnProperty;function $h(t){if(!Dt(t))return Eh(t);var e=Ko(t),r=[];for(var n in t)n=="constructor"&&(e||!Th.call(t,n))||r.push(n);return r}function ca(t){return tn(t)?jh(t,!0):$h(t)}var Nh=Xr(Object,"create");const Ne=Nh;function Ph(){this.__data__=Ne?Ne(null):{},this.size=0}function Ah(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Rh="__lodash_hash_undefined__",Mh=Object.prototype,xh=Mh.hasOwnProperty;function Dh(t){var e=this.__data__;if(Ne){var r=e[t];return r===Rh?void 0:r}return xh.call(e,t)?e[t]:void 0}var Ih=Object.prototype,Lh=Ih.hasOwnProperty;function Fh(t){var e=this.__data__;return Ne?e[t]!==void 0:Lh.call(e,t)}var kh="__lodash_hash_undefined__";function Uh(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Ne&&e===void 0?kh:e,this}function It(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}It.prototype.clear=Ph,It.prototype.delete=Ah,It.prototype.get=Dh,It.prototype.has=Fh,It.prototype.set=Uh;function Bh(){this.__data__=[],this.size=0}function Je(t,e){for(var r=t.length;r--;)if(Ye(t[r][0],e))return r;return-1}var Vh=Array.prototype,Gh=Vh.splice;function zh(t){var e=this.__data__,r=Je(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Gh.call(e,r,1),--this.size,!0}function Wh(t){var e=this.__data__,r=Je(e,t);return r<0?void 0:e[r][1]}function Hh(t){return Je(this.__data__,t)>-1}function Yh(t,e){var r=this.__data__,n=Je(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function yt(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])}}yt.prototype.clear=Bh,yt.prototype.delete=zh,yt.prototype.get=Wh,yt.prototype.has=Hh,yt.prototype.set=Yh;var Jh=Xr(Xt,"Map");const ua=Jh;function qh(){this.size=0,this.__data__={hash:new It,map:new(ua||yt),string:new It}}function Qh(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function qe(t,e){var r=t.__data__;return Qh(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Kh(t){var e=qe(this,t).delete(t);return this.size-=e?1:0,e}function Xh(t){return qe(this,t).get(t)}function Zh(t){return qe(this,t).has(t)}function tv(t,e){var r=qe(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function re(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])}}re.prototype.clear=qh,re.prototype.delete=Kh,re.prototype.get=Xh,re.prototype.has=Zh,re.prototype.set=tv;function la(t){return t==null?"":zo(t)}var ev=Ch(Object.getPrototypeOf,Object);const fa=ev;var rv="[object Object]",nv=Function.prototype,ov=Object.prototype,da=nv.toString,av=ov.hasOwnProperty,iv=da.call(Object);function ne(t){if(!te(t)||Te(t)!=rv)return!1;var e=fa(t);if(e===null)return!0;var r=av.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&da.call(r)==iv}function sv(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 cv(t,e,r){var n=t.length;return r=r===void 0?n:r,!e&&r>=n?t:sv(t,e,r)}var uv="\\ud800-\\udfff",lv="\\u0300-\\u036f",fv="\\ufe20-\\ufe2f",dv="\\u20d0-\\u20ff",pv=lv+fv+dv,hv="\\ufe0e\\ufe0f",vv="\\u200d",mv=RegExp("["+vv+uv+pv+hv+"]");function pa(t){return mv.test(t)}function gv(t){return t.split("")}var ha="\\ud800-\\udfff",yv="\\u0300-\\u036f",bv="\\ufe20-\\ufe2f",_v="\\u20d0-\\u20ff",Sv=yv+bv+_v,Ov="\\ufe0e\\ufe0f",jv="["+ha+"]",nn="["+Sv+"]",on="\\ud83c[\\udffb-\\udfff]",Cv="(?:"+nn+"|"+on+")",va="[^"+ha+"]",ma="(?:\\ud83c[\\udde6-\\uddff]){2}",ga="[\\ud800-\\udbff][\\udc00-\\udfff]",Ev="\\u200d",ya=Cv+"?",ba="["+Ov+"]?",wv="(?:"+Ev+"(?:"+[va,ma,ga].join("|")+")"+ba+ya+")*",Tv=ba+ya+wv,$v="(?:"+[va+nn+"?",nn,ma,ga,jv].join("|")+")",Nv=RegExp(on+"(?="+on+")|"+$v+Tv,"g");function Pv(t){return t.match(Nv)||[]}function Av(t){return pa(t)?Pv(t):gv(t)}function Rv(t){return function(e){e=la(e);var r=pa(e)?Av(e):void 0,n=r?r[0]:e.charAt(0),o=r?cv(r,1).join(""):e.slice(1);return n[t]()+o}}var Mv=Rv("toUpperCase");const xv=Mv;function Dv(t){return xv(la(t).toLowerCase())}function Iv(){this.__data__=new yt,this.size=0}function Lv(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function Fv(t){return this.__data__.get(t)}function kv(t){return this.__data__.has(t)}var Uv=200;function Bv(t,e){var r=this.__data__;if(r instanceof yt){var n=r.__data__;if(!ua||n.length<Uv-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new re(n)}return r.set(t,e),this.size=r.size,this}function oe(t){var e=this.__data__=new yt(t);this.size=e.size}oe.prototype.clear=Iv,oe.prototype.delete=Lv,oe.prototype.get=Fv,oe.prototype.has=kv,oe.prototype.set=Bv;var _a=typeof _=="object"&&_&&!_.nodeType&&_,Sa=_a&&typeof module=="object"&&module&&!module.nodeType&&module,Vv=Sa&&Sa.exports===_a,Oa=Vv?Xt.Buffer:void 0,ja=Oa?Oa.allocUnsafe:void 0;function Gv(t,e){if(e)return t.slice();var r=t.length,n=ja?ja(r):new t.constructor(r);return t.copy(n),n}var zv=Xt.Uint8Array;const Ca=zv;function Wv(t){var e=new t.constructor(t.byteLength);return new Ca(e).set(new Ca(t)),e}function Hv(t,e){var r=e?Wv(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Yv(t){return typeof t.constructor=="function"&&!Ko(t)?pp(fa(t)):{}}function Jv(t){return function(e,r,n){for(var o=-1,a=Object(e),s=n(e),i=s.length;i--;){var c=s[t?i:++o];if(r(a[c],c,a)===!1)break}return e}}var qv=Jv();const Qv=qv;function an(t,e,r){(r!==void 0&&!Ye(t[e],r)||r===void 0&&!(e in t))&&Zr(t,e,r)}function Kv(t){return te(t)&&tn(t)}function sn(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Xv(t){return Pp(t,ca(t))}function Zv(t,e,r,n,o,a,s){var i=sn(t,r),c=sn(e,r),l=s.get(c);if(l){an(t,r,l);return}var f=a?a(i,c,r+"",t,e,s):void 0,p=f===void 0;if(p){var d=ee(c),v=!d&&na(c),y=!d&&!v&&sa(c);f=c,d||v||y?ee(i)?f=i:Kv(i)?f=vp(i):v?(p=!1,f=Gv(c,!0)):y?(p=!1,f=Hv(c,!0)):f=[]:ne(c)||en(c)?(f=i,en(i)?f=Xv(i):(!Dt(i)||Qr(i))&&(f=Yv(c))):p=!1}p&&(s.set(c,f),o(f,c,n,a,s),s.delete(c)),an(t,r,f)}function Ea(t,e,r,n,o){t!==e&&Qv(e,function(a,s){if(o||(o=new oe),Dt(a))Zv(t,e,s,r,Ea,n,o);else{var i=n?n(sn(t,s),a,s+"",t,e,o):void 0;i===void 0&&(i=a),an(t,s,i)}},ca)}var tm=Dp(function(t,e,r){Ea(t,e,r)});const em=tm,rm=function(t){return!(!t||typeof t!="function"||!t.prototype)};function wa(t){const e=t.prototype;return!!(e&&e.isReactComponent)}function Ta(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 $a(t){class e extends C.Component{render(){return C.createElement(t,this.props)}}return e.displayName=t.displayName,e}const Lt=(t,e)=>{const r=n=>{const a=`
|
|
5
|
+
data struct format is invalidate`),o},hr=t=>{const{data:e,message:r,throwError:n,dataStruct:o}=t;return $f(({data:a})=>{try{return Kn(a,o),{isValidate:!0}}catch(s){let i=s;return s instanceof qn&&(i=s.failures().map(c=>`【${c.path.join(".")}】: ${c.message}
|
|
6
|
+
`)),{isValidate:!1,message:i,error:s}}})({data:e,message:r,throwError:n})};var Tt=(t=>(t.ROOT_CONTAINER="RootContainer",t))(Tt||{});const Nf=C({type:B(z.FUNCTION),value:h()}),Tf=ir(Xn(Nt,["componentName"]),C({componentName:B("RootContainer")}));function Af(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 Kt=Af(),Mf=(t,e)=>{const r={...t,value:[]},n=t.value;let o=new mt([]);return e&&(o=e.materialsMode||new mt([])),n&&(I(n)?r.value=n.map(a=>new A(a,{parent:e,materials:o})):F(n)&&r.value.push(new A(n,{parent:e,materials:o}))),r};class At{constructor(e,r){j(this,"nodeType","SLOT"),j(this,"rawData"),j(this,"parent"),j(this,"emitter",Kt),j(this,"data"),j(this,"id"),j(this,"materialsMode"),this.parent=(r==null?void 0:r.parent)||null,this.rawData=e;const n=(r==null?void 0:r.materials)||new mt([]);this.materialsMode=n,this.id=X(),this.data=Mf(e,this)}get value(){return this.data}export(e){const r=this.data,n=o=>{if(o instanceof A)return o.export(e);if(F(o)){const a={};return Object.keys(o||{}).forEach(s=>{a[s]=n(o[s])}),a}return I(o)?o.map(a=>n(a)):(e==="design"&&delete o.id,o)};return n(r)}}const no=t=>{let e=[];return t.forEach(r=>{const n=r;n.type?n.type===pr.SINGLE?e.push(n.content):n.type===pr.GROUP&&(e=[...e,...no(n.content)]):e.push(r)}),e},mr=(t,e,r)=>{if(t.type)return t.type===z.SLOT?new At(t,{parent:e,materials:r}):t;if(F(t)){const n={};return Object.keys(t).forEach(o=>{n[o]=vr(t[o],e,r)}),n}else return Array.isArray(t)?t.map(n=>mr(n,e,r)):t},vr=(t,e,r)=>F(t)?mr(t,e,r):I(t)?t.map(n=>mr(n,e,r)):t;class it{constructor(e,r,n){j(this,"nodeType","PROP"),j(this,"rawData"),j(this,"parent"),j(this,"emitter",Kt),j(this,"data"),j(this,"name"),j(this,"materialsMode");const o=(n==null?void 0:n.materials)||new mt([]);this.materialsMode=o,this.parent=n==null?void 0:n.parent,this.rawData=r,this.name=e,this.data=vr(r,this,o)}isIncludeSlot(){return!1}isIncludeExpression(){return!1}get value(){return this.data}updateValue(e){const r=this.data;this.data=vr(e??r,this,this.materialsMode),this.emitter.emit("onPropChange",{value:this.data,preValue:r,node:this}),this.parent&&!(this.parent instanceof At)&&this.emitter.emit("onNodeChange",{value:this.parent.value,preValue:this.parent.value,node:this.parent})}get material(){const e=this.parent;if(e instanceof A){const r=e.material;return no((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 At||o instanceof A)return o.export(e);if(I(o))return o.map(a=>n(a));if(F(o)){const a={};return Object.keys(o||{}).forEach(s=>{a[s]=n(o[s])}),a}return o};return n(r)}}const Pf=t=>{if(typeof t=="string")return!0;hr({data:t,dataStruct:Nt,throwError:!1})},oo=(t,e,r=new mt([]))=>{if(typeof t=="string")return t;const n={...t,id:t.id??X(),children:[],props:{},methods:t.methods||[],configure:Jn(t.configure||{},{propsSetter:{},advanceSetter:{}})},o=Object.keys(t.props||{});return o.length&&o.forEach(a=>{var s;const i=(s=t.props)==null?void 0:s[a];if(i instanceof it){n.props[a]=i;return}n.props[a]=new it(a,i||"",{parent:e,materials:r})}),t.children&&(Array.isArray(t.children)?n.children=t.children.map(a=>{if(a instanceof A)return a;if(F(a)){const s=a;return new A(s,{parent:e,materials:r})}else return a}):(t.children instanceof A&&(n.children=[t.children]),n.children=[new A(t.children,{parent:e,materials:r})])),n};class A{constructor(e,r){j(this,"nodeType","NODE"),j(this,"rawData"),j(this,"data"),j(this,"emitter",Kt),j(this,"parent"),j(this,"materialsModel"),j(this,"listenerHandle"),j(this,"onChangeCbQueue"),this.rawData=JSON.parse(JSON.stringify(e)),Pf(e);const n=(r==null?void 0:r.materials)||new mt([]);this.parent=(r==null?void 0:r.parent)||null,this.materialsModel=n,this.data=oo(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||X()};return new A(r,{materials:this.materialsModel})}updateWithPlainObj(e){const r={...this.data,...e};return this.data=oo(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 br(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 A?l.export(e):l),s=n.configure||{},i=s.propsSetter||{},c={};Object.keys(i).forEach(l=>{const d=ln(i,l,!1);d&&(c[l]=d)}),s.propsSetter=c,this.material&&this.materialsModel.usedMaterials.push(this.material);let u={...n,configure:s,props:o,children:a};return e==="design"&&delete u.id,u=yr(u),u}}const ao=(t,e,r)=>{const n={...t,id:X(),props:{},componentName:Tt.ROOT_CONTAINER,children:[],methods:t.methods||[],configure:Jn(t.configure||{},{propsSetter:{},advanceSetter:{}})};let o=[];I(t.children)?o=t.children.map(s=>s instanceof A?s:F(s)?new A(s,{parent:e,materials:r}):s):t.children instanceof A?o.push(t.children):t.children&&F(t.children)&&o.push(new A(t.children,{parent:e,materials:r}));const a=Object.keys(t.props||{});return a.length&&a.forEach(s=>{var i;const c=(i=t.props)==null?void 0:i[s];c instanceof it?n.props[s]=c:n.props[s]=new it(s,c||"",{parent:e,materials:r})}),n.children=o,n};class Xt{constructor(e,{parent:r,materials:n}){j(this,"rawData"),j(this,"data"),j(this,"nodeType",Tt.ROOT_CONTAINER),j(this,"emitter",Kt),j(this,"materialsModel"),j(this,"listenerHandle"),j(this,"onChangeCbQueue"),j(this,"parent"),this.materialsModel=n,this.rawData=JSON.parse(JSON.stringify(e)),this.data=ao(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=ao(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 br(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=ur.SAVE){var r;const n=this.data,o={};Object.keys(n.props||{}).forEach(c=>{o[c]=n.props[c].export(e)});const a=((r=n.children)==null?void 0:r.map(c=>{var u;return(u=c==null?void 0:c.export)==null?void 0:u.call(c,e)}))||[],s={...n,props:o,children:a.filter(c=>c)};let i=Qn(s,["id"]);return i=yr(i),i}getPlainProps(){const e=this.data,r={};return Object.keys(e.props||{}).forEach(n=>{r[n]=e.props[n].export("design")}),r}destroy(){this.listenerHandle.forEach(e=>e())}clone(e){const r={...this.export("design"),id:e||X()};return new Xt(r,{materials:this.materialsModel,parent:null})}}const ht=t=>(t==null?void 0:t.type)===z.EXPRESSION,xf=t=>(t==null?void 0:t.type)===z.FUNCTION,X=()=>Math.random().toString(32).slice(3,9),If=t=>(t==null?void 0:t.nodeType)==="NODE",gr=t=>(t==null?void 0:t.nodeType)==="PROP",Df=t=>(t==null?void 0:t.nodeType)==="SLOT",yr=t=>ef(t,e=>F(e)?!Object.keys(e).length:I(e)?!e.length:!e);function Rf(t,e){const r=[t];for(;r.length;){const n=r.shift();if(n&&e(n))return n;const o=(n==null?void 0:n.props)||{},a=i=>{if(i instanceof A){r.push(i);return}if(i instanceof At&&a(i.value.value),i instanceof it){a(i.value);return}if(F(i)){const c=i;Object.keys(c).forEach(u=>{a(c[u])});return}if(I(i)){i.forEach(c=>{a(c)});return}};a(o);const s=(n==null?void 0:n.value.children.filter(i=>i instanceof A))||[];r.push(...s)}}function br(t,e){return Rf(t,r=>r.id===e)}const Lf=t=>{const e=Rn(t),r=e.snippets;return delete e.snippets,e.snippets=r.map(n=>({...e,...n,id:n.id||`${t.componentName}-${X()}`,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 Ff{constructor(e){j(this,"rawData"),j(this,"data"),this.rawData=e,this.data=Lf(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 Bf=t=>{if(!I(t))throw new Error("Materials must be a array");return t.map(e=>new Ff(e))},Uf=t=>{t==null||t.forEach(e=>{hr({data:e,dataStruct:Ef,throwError:!1})})};class mt{constructor(e){j(this,"rawData"),j(this,"data"),j(this,"usedMaterials",[]),this.rawData=e,Uf(e),this.data=Bf(e)}findByComponentName(e){return this.data.find(r=>r.componentName===e)}findSnippetById(e){const r=[...this.data];let n=null;for(;!n&&r.length;){const o=r.pop();n=o==null?void 0:o.getSnippetById(e)}return n}getAllSnippets(){const e=this.data.reduce((a,s)=>(a.push(...s.snippets),a),[]),r=[],n={default:[]};e.forEach(a=>{const s=a.groupName||"default";r.includes(s)||(r.push(s),n[s]=[]),n[s].push(a)});let o=[];return r.forEach(a=>{const s=["default"],i={default:[]},c=n[a];if(c.length!==0){c.forEach(d=>{const f=d.category||"default";s.includes(f)||(s.push(f),i[f]=[]),i[f].push(d)});const u=[];s.forEach(d=>{i[d].length&&u.push({name:d,list:i[d]})});const l={name:a,list:u};o.push(l)}}),o=o.sort((a,s)=>(a.name||"")>(s.name||"")?1:-1),o}get value(){return this.data}get rawValue(){return this.rawData}}const kf=C({version:h(),name:h(),css:m(h()),renderType:m(U([B("COMPONENT"),B("PAGE")])),methods:m(P(Nf)),componentsMeta:P(ir(C({componentName:h()}),cr)),thirdLibs:m(yf),componentsTree:Tf,assets:m(P(D()))}),io=t=>(hr({data:t,dataStruct:kf,throwError:!1}),t),_r=(t,e,r)=>({...t,componentsTree:new Xt(t.componentsTree,{parent:e,materials:r})});class ge{constructor(e,r){j(this,"nodeType","PAGE"),j(this,"rawData"),j(this,"emitter",Kt),j(this,"data"),j(this,"parent"),j(this,"materialsModel"),j(this,"assetPackagesList"),io(e),this.rawData=JSON.parse(JSON.stringify(e)),this.materialsModel=new mt((r==null?void 0:r.materials)||[]),this.data=_r(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=_r(e,this,this.materialsModel),this.emitter.emit("onPageChange",{value:this.data,preValue:r,node:this})}reloadPage(e){const r=this.data;this.rawData=JSON.parse(JSON.stringify(e)),this.data=_r(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 br(r,e)}addNode(e,r,n="AFTER"){var o;if(n==="AFTER"||n==="BEFORE"){const a=r.parent;if(a===null&&r instanceof Xt)return console.warn("Not found parent node"),!1;if(a instanceof it)return console.warn("CProp can not add node"),!1;if(a instanceof At){const i=a.value.value,c=i.findIndex(u=>u===r)??-1;return c>=0?(n==="BEFORE"?i.splice(c,0,e):i.splice(c+1,0,e),e.parent=a,(o=a.parent)==null||o.updateValue(),!0):!1}if(a instanceof ge)return!1;const s=(a==null?void 0:a.value.children.findIndex(i=>i===r))??-1;return s>=0?(n==="BEFORE"?a==null||a.value.children.splice(s,0,e):a==null||a.value.children.splice(s+1,0,e),e.parent=a,a==null||a.updateValue(),!0):(console.warn("Not found target node"),!1)}if(n==="CHILD_START")return r.value.children.unshift(e),e.parent=r,r.updateValue(),!0;if(n==="CHILD_END")return r.value.children.push(e),e.parent=r,r.updateValue(),!0;if(F(n)){const a=n;if(a.type==="CHILD"){const s=a.pos,i=a.index||0;return s==="BEFORE"?r==null||r.value.children.splice(i,0,e):r==null||r.value.children.splice(i+1,0,e),e.parent=r,r.updateValue(),!0}else console.warn("Can not parse pos obj")}return!1}createNode(e){return delete e.id,new A(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=X();const n=new A(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 A?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 A&&a instanceof A?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 At){const o=n.value.value,a=o.findIndex(i=>i===e),s=o[a];return o.splice(a,1),(r=n.parent)==null||r.updateValue(),s}if(n instanceof A||n instanceof Xt){const o=n.value.children,a=o.findIndex(i=>i===e),s=o[a];return o.splice(a,1),n.updateValue(),s}}deleteNodeById(e){const r=this.getNode(e);if(r)return this.deleteNode(r)}export(e=ur.SAVE){var r;const n=this.data.componentsTree.export(e),o=this.assetPackagesList,a=[],s=this.materialsModel.usedMaterials.map(c=>{const u=o.find(l=>{var d;return l.package===((d=c.value.npm)==null?void 0:d.package)});return u&&a.push(u),{componentName:c.componentName,...Rn(c.value.npm||{})}}).filter(c=>!!(c.componentName&&c.package&&c.version));this.materialsModel.usedMaterials=[];let i={...this.data,componentsTree:yr(n),componentsMeta:s,thirdLibs:this.data.thirdLibs,assets:[]};return(r=this.data.thirdLibs)==null||r.forEach(c=>{const u=o.find(l=>c.package===l.package);u&&a.push(u)}),i.assets=uf(a,c=>c.package),i=Qn(i,["id"]),JSON.parse(JSON.stringify(i))}getRootNode(){return this.data.componentsTree}}Tt.ROOT_CONTAINER;var Vf=typeof global=="object"&&global&&global.Object===Object&&global;const so=Vf;var zf=typeof self=="object"&&self&&self.Object===Object&&self,Gf=so||zf||Function("return this")();const Mt=Gf;var Hf=Mt.Symbol;const Pt=Hf;var co=Object.prototype,Wf=co.hasOwnProperty,Jf=co.toString,Zt=Pt?Pt.toStringTag:void 0;function Qf(t){var e=Wf.call(t,Zt),r=t[Zt];try{t[Zt]=void 0;var n=!0}catch{}var o=Jf.call(t);return n&&(e?t[Zt]=r:delete t[Zt]),o}var qf=Object.prototype,Yf=qf.toString;function Kf(t){return Yf.call(t)}var Xf="[object Null]",Zf="[object Undefined]",uo=Pt?Pt.toStringTag:void 0;function te(t){return t==null?t===void 0?Zf:Xf:uo&&uo in Object(t)?Qf(t):Kf(t)}function xt(t){return t!=null&&typeof t=="object"}var td="[object Symbol]";function ed(t){return typeof t=="symbol"||xt(t)&&te(t)==td}function rd(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 nd=Array.isArray;const It=nd;var od=1/0,lo=Pt?Pt.prototype:void 0,fo=lo?lo.toString:void 0;function po(t){if(typeof t=="string")return t;if(It(t))return rd(t,po)+"";if(ed(t))return fo?fo.call(t):"";var e=t+"";return e=="0"&&1/t==-od?"-0":e}function vt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function ho(t){return t}var ad="[object AsyncFunction]",id="[object Function]",sd="[object GeneratorFunction]",cd="[object Proxy]";function Sr(t){if(!vt(t))return!1;var e=te(t);return e==id||e==sd||e==ad||e==cd}var ud=Mt["__core-js_shared__"];const jr=ud;var mo=function(){var t=/[^.]+$/.exec(jr&&jr.keys&&jr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function ld(t){return!!mo&&mo in t}var fd=Function.prototype,dd=fd.toString;function pd(t){if(t!=null){try{return dd.call(t)}catch{}try{return t+""}catch{}}return""}var hd=/[\\^$.*+?()[\]{}|]/g,md=/^\[object .+?Constructor\]$/,vd=Function.prototype,gd=Object.prototype,yd=vd.toString,bd=gd.hasOwnProperty,_d=RegExp("^"+yd.call(bd).replace(hd,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Sd(t){if(!vt(t)||ld(t))return!1;var e=Sr(t)?_d:md;return e.test(pd(t))}function jd(t,e){return t==null?void 0:t[e]}function Or(t,e){var r=jd(t,e);return Sd(r)?r:void 0}var vo=Object.create,Od=function(){function t(){}return function(e){if(!vt(e))return{};if(vo)return vo(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();const wd=Od;function Cd(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 Ed(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var $d=800,Nd=16,Td=Date.now;function Ad(t){var e=0,r=0;return function(){var n=Td(),o=Nd-(n-r);if(r=n,o>0){if(++e>=$d)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Md(t){return function(){return t}}var Pd=function(){try{var t=Or(Object,"defineProperty");return t({},"",{}),t}catch{}}();const ye=Pd;var xd=ye?function(t,e){return ye(t,"toString",{configurable:!0,enumerable:!1,value:Md(e),writable:!0})}:ho,Id=Ad(xd);const Dd=Id;var Rd=9007199254740991,Ld=/^(?:0|[1-9]\d*)$/;function go(t,e){var r=typeof t;return e=e??Rd,!!e&&(r=="number"||r!="symbol"&&Ld.test(t))&&t>-1&&t%1==0&&t<e}function wr(t,e,r){e=="__proto__"&&ye?ye(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function be(t,e){return t===e||t!==t&&e!==e}var Fd=Object.prototype,Bd=Fd.hasOwnProperty;function Ud(t,e,r){var n=t[e];(!(Bd.call(t,e)&&be(n,r))||r===void 0&&!(e in t))&&wr(t,e,r)}function kd(t,e,r,n){var o=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var i=e[a],c=n?n(r[i],t[i],i,r,t):void 0;c===void 0&&(c=t[i]),o?wr(r,i,c):Ud(r,i,c)}return r}var yo=Math.max;function Vd(t,e,r){return e=yo(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=yo(n.length-e,0),s=Array(a);++o<a;)s[o]=n[e+o];o=-1;for(var i=Array(e+1);++o<e;)i[o]=n[o];return i[e]=r(s),Cd(t,this,i)}}function zd(t,e){return Dd(Vd(t,e,ho),t+"")}var Gd=9007199254740991;function bo(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Gd}function Cr(t){return t!=null&&bo(t.length)&&!Sr(t)}function Hd(t,e,r){if(!vt(r))return!1;var n=typeof e;return(n=="number"?Cr(r)&&go(e,r.length):n=="string"&&e in r)?be(r[e],t):!1}function Wd(t){return zd(function(e,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,s=o>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(o--,a):void 0,s&&Hd(r[0],r[1],s)&&(a=o<3?void 0:a,o=1),e=Object(e);++n<o;){var i=r[n];i&&t(e,i,n,a)}return e})}var Jd=Object.prototype;function _o(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Jd;return t===r}function Qd(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var qd="[object Arguments]";function So(t){return xt(t)&&te(t)==qd}var jo=Object.prototype,Yd=jo.hasOwnProperty,Kd=jo.propertyIsEnumerable,Xd=So(function(){return arguments}())?So:function(t){return xt(t)&&Yd.call(t,"callee")&&!Kd.call(t,"callee")};const Er=Xd;function Zd(){return!1}var Oo=typeof g=="object"&&g&&!g.nodeType&&g,wo=Oo&&typeof module=="object"&&module&&!module.nodeType&&module,tp=wo&&wo.exports===Oo,Co=tp?Mt.Buffer:void 0,ep=Co?Co.isBuffer:void 0,rp=ep||Zd;const Eo=rp;var np="[object Arguments]",op="[object Array]",ap="[object Boolean]",ip="[object Date]",sp="[object Error]",cp="[object Function]",up="[object Map]",lp="[object Number]",fp="[object Object]",dp="[object RegExp]",pp="[object Set]",hp="[object String]",mp="[object WeakMap]",vp="[object ArrayBuffer]",gp="[object DataView]",yp="[object Float32Array]",bp="[object Float64Array]",_p="[object Int8Array]",Sp="[object Int16Array]",jp="[object Int32Array]",Op="[object Uint8Array]",wp="[object Uint8ClampedArray]",Cp="[object Uint16Array]",Ep="[object Uint32Array]",T={};T[yp]=T[bp]=T[_p]=T[Sp]=T[jp]=T[Op]=T[wp]=T[Cp]=T[Ep]=!0,T[np]=T[op]=T[vp]=T[ap]=T[gp]=T[ip]=T[sp]=T[cp]=T[up]=T[lp]=T[fp]=T[dp]=T[pp]=T[hp]=T[mp]=!1;function $p(t){return xt(t)&&bo(t.length)&&!!T[te(t)]}function Np(t){return function(e){return t(e)}}var $o=typeof g=="object"&&g&&!g.nodeType&&g,ee=$o&&typeof module=="object"&&module&&!module.nodeType&&module,Tp=ee&&ee.exports===$o,$r=Tp&&so.process,Ap=function(){try{var t=ee&&ee.require&&ee.require("util").types;return t||$r&&$r.binding&&$r.binding("util")}catch{}}();const No=Ap;var To=No&&No.isTypedArray,Mp=To?Np(To):$p;const Ao=Mp;var Pp=Object.prototype,xp=Pp.hasOwnProperty;function Ip(t,e){var r=It(t),n=!r&&Er(t),o=!r&&!n&&Eo(t),a=!r&&!n&&!o&&Ao(t),s=r||n||o||a,i=s?Qd(t.length,String):[],c=i.length;for(var u in t)(e||xp.call(t,u))&&!(s&&(u=="length"||o&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||go(u,c)))&&i.push(u);return i}function Dp(t,e){return function(r){return t(e(r))}}function Rp(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Lp=Object.prototype,Fp=Lp.hasOwnProperty;function Bp(t){if(!vt(t))return Rp(t);var e=_o(t),r=[];for(var n in t)n=="constructor"&&(e||!Fp.call(t,n))||r.push(n);return r}function Mo(t){return Cr(t)?Ip(t,!0):Bp(t)}var Up=Or(Object,"create");const re=Up;function kp(){this.__data__=re?re(null):{},this.size=0}function Vp(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var zp="__lodash_hash_undefined__",Gp=Object.prototype,Hp=Gp.hasOwnProperty;function Wp(t){var e=this.__data__;if(re){var r=e[t];return r===zp?void 0:r}return Hp.call(e,t)?e[t]:void 0}var Jp=Object.prototype,Qp=Jp.hasOwnProperty;function qp(t){var e=this.__data__;return re?e[t]!==void 0:Qp.call(e,t)}var Yp="__lodash_hash_undefined__";function Kp(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=re&&e===void 0?Yp:e,this}function gt(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])}}gt.prototype.clear=kp,gt.prototype.delete=Vp,gt.prototype.get=Wp,gt.prototype.has=qp,gt.prototype.set=Kp;function Xp(){this.__data__=[],this.size=0}function _e(t,e){for(var r=t.length;r--;)if(be(t[r][0],e))return r;return-1}var Zp=Array.prototype,th=Zp.splice;function eh(t){var e=this.__data__,r=_e(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():th.call(e,r,1),--this.size,!0}function rh(t){var e=this.__data__,r=_e(e,t);return r<0?void 0:e[r][1]}function nh(t){return _e(this.__data__,t)>-1}function oh(t,e){var r=this.__data__,n=_e(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function 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=Xp,nt.prototype.delete=eh,nt.prototype.get=rh,nt.prototype.has=nh,nt.prototype.set=oh;var ah=Or(Mt,"Map");const Po=ah;function ih(){this.size=0,this.__data__={hash:new gt,map:new(Po||nt),string:new gt}}function sh(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Se(t,e){var r=t.__data__;return sh(e)?r[typeof e=="string"?"string":"hash"]:r.map}function ch(t){var e=Se(this,t).delete(t);return this.size-=e?1:0,e}function uh(t){return Se(this,t).get(t)}function lh(t){return Se(this,t).has(t)}function fh(t,e){var r=Se(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function Dt(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])}}Dt.prototype.clear=ih,Dt.prototype.delete=ch,Dt.prototype.get=uh,Dt.prototype.has=lh,Dt.prototype.set=fh;function xo(t){return t==null?"":po(t)}var dh=Dp(Object.getPrototypeOf,Object);const Io=dh;var ph="[object Object]",hh=Function.prototype,mh=Object.prototype,Do=hh.toString,vh=mh.hasOwnProperty,gh=Do.call(Object);function Rt(t){if(!xt(t)||te(t)!=ph)return!1;var e=Io(t);if(e===null)return!0;var r=vh.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Do.call(r)==gh}function yh(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 bh(t,e,r){var n=t.length;return r=r===void 0?n:r,!e&&r>=n?t:yh(t,e,r)}var _h="\\ud800-\\udfff",Sh="\\u0300-\\u036f",jh="\\ufe20-\\ufe2f",Oh="\\u20d0-\\u20ff",wh=Sh+jh+Oh,Ch="\\ufe0e\\ufe0f",Eh="\\u200d",$h=RegExp("["+Eh+_h+wh+Ch+"]");function Ro(t){return $h.test(t)}function Nh(t){return t.split("")}var Lo="\\ud800-\\udfff",Th="\\u0300-\\u036f",Ah="\\ufe20-\\ufe2f",Mh="\\u20d0-\\u20ff",Ph=Th+Ah+Mh,xh="\\ufe0e\\ufe0f",Ih="["+Lo+"]",Nr="["+Ph+"]",Tr="\\ud83c[\\udffb-\\udfff]",Dh="(?:"+Nr+"|"+Tr+")",Fo="[^"+Lo+"]",Bo="(?:\\ud83c[\\udde6-\\uddff]){2}",Uo="[\\ud800-\\udbff][\\udc00-\\udfff]",Rh="\\u200d",ko=Dh+"?",Vo="["+xh+"]?",Lh="(?:"+Rh+"(?:"+[Fo,Bo,Uo].join("|")+")"+Vo+ko+")*",Fh=Vo+ko+Lh,Bh="(?:"+[Fo+Nr+"?",Nr,Bo,Uo,Ih].join("|")+")",Uh=RegExp(Tr+"(?="+Tr+")|"+Bh+Fh,"g");function kh(t){return t.match(Uh)||[]}function Vh(t){return Ro(t)?kh(t):Nh(t)}function zh(t){return function(e){e=xo(e);var r=Ro(e)?Vh(e):void 0,n=r?r[0]:e.charAt(0),o=r?bh(r,1).join(""):e.slice(1);return n[t]()+o}}var Gh=zh("toUpperCase");const Hh=Gh;function Wh(t){return Hh(xo(t).toLowerCase())}function Jh(){this.__data__=new nt,this.size=0}function Qh(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function qh(t){return this.__data__.get(t)}function Yh(t){return this.__data__.has(t)}var Kh=200;function Xh(t,e){var r=this.__data__;if(r instanceof nt){var n=r.__data__;if(!Po||n.length<Kh-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Dt(n)}return r.set(t,e),this.size=r.size,this}function Lt(t){var e=this.__data__=new nt(t);this.size=e.size}Lt.prototype.clear=Jh,Lt.prototype.delete=Qh,Lt.prototype.get=qh,Lt.prototype.has=Yh,Lt.prototype.set=Xh;var zo=typeof g=="object"&&g&&!g.nodeType&&g,Go=zo&&typeof module=="object"&&module&&!module.nodeType&&module,Zh=Go&&Go.exports===zo,Ho=Zh?Mt.Buffer:void 0,Wo=Ho?Ho.allocUnsafe:void 0;function tm(t,e){if(e)return t.slice();var r=t.length,n=Wo?Wo(r):new t.constructor(r);return t.copy(n),n}var em=Mt.Uint8Array;const Jo=em;function rm(t){var e=new t.constructor(t.byteLength);return new Jo(e).set(new Jo(t)),e}function nm(t,e){var r=e?rm(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function om(t){return typeof t.constructor=="function"&&!_o(t)?wd(Io(t)):{}}function am(t){return function(e,r,n){for(var o=-1,a=Object(e),s=n(e),i=s.length;i--;){var c=s[t?i:++o];if(r(a[c],c,a)===!1)break}return e}}var im=am();const sm=im;function Ar(t,e,r){(r!==void 0&&!be(t[e],r)||r===void 0&&!(e in t))&&wr(t,e,r)}function cm(t){return xt(t)&&Cr(t)}function Mr(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function um(t){return kd(t,Mo(t))}function lm(t,e,r,n,o,a,s){var i=Mr(t,r),c=Mr(e,r),u=s.get(c);if(u){Ar(t,r,u);return}var l=a?a(i,c,r+"",t,e,s):void 0,d=l===void 0;if(d){var f=It(c),p=!f&&Eo(c),v=!f&&!p&&Ao(c);l=c,f||p||v?It(i)?l=i:cm(i)?l=Ed(i):p?(d=!1,l=tm(c,!0)):v?(d=!1,l=nm(c,!0)):l=[]:Rt(c)||Er(c)?(l=i,Er(i)?l=um(i):(!vt(i)||Sr(i))&&(l=om(c))):d=!1}d&&(s.set(c,l),o(l,c,n,a,s),s.delete(c)),Ar(t,r,l)}function Qo(t,e,r,n,o){t!==e&&sm(e,function(a,s){if(o||(o=new Lt),vt(a))lm(t,e,s,r,Qo,n,o);else{var i=n?n(Mr(t,s),a,s+"",t,e,o):void 0;i===void 0&&(i=a),Ar(t,s,i)}},Mo)}var fm=Wd(function(t,e,r){Qo(t,e,r)});const dm=fm,pm=function(t){return!(!t||typeof t!="function"||!t.prototype)};function qo(t){const e=t.prototype;return!!(e&&e.isReactComponent)}function Yo(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 Ko(t){class e extends S.Component{render(){return S.createElement(t,this.props)}}return e.displayName=t.displayName,e}const yt=(t,e)=>{const r=n=>{const a=`
|
|
7
7
|
${Object.keys(e).map(s=>`const ${s} = $$context['${s}'];`).join(`
|
|
8
8
|
`)}
|
|
9
9
|
return ${n};
|
|
10
|
-
`;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}},
|
|
10
|
+
`;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}},Xo=(t,e,r)=>function(...o){let a;try{a=`
|
|
11
11
|
var $$$__args__$$$ = Array.from(arguments);
|
|
12
12
|
function $$_run_$$() {
|
|
13
13
|
var $$_f_$$ = ${t||"function () {}"};
|
|
@@ -17,7 +17,7 @@ function $$_run_$$() {
|
|
|
17
17
|
return $$_f_$$.apply($$_f_$$, $$$__args__$$$);
|
|
18
18
|
}
|
|
19
19
|
return $$_run_$$();
|
|
20
|
-
`,new Function(a)(...o,e,r)}catch(s){console.log(a),console.warn(s)}},cn=(t,e)=>{const r={};return e.forEach((n,o)=>{r[n]=t[o]}),r},un=t=>{const e={};return Object.keys(t).forEach(r=>{let n=r.replace("-webkit","Webkit");n=n.replace("-ms","ms"),n=n.replace("-moz","Moz"),n=n.replace("-o","O");let o=n.split("-");o.length>=2&&(o=o.map((a,s)=>s!==0?Dv(a):a)),e[o.join("")]=t[r]}),e},ln=t=>{let e="";return Object.keys(t).forEach(r=>{e+=`${r}:${t[r]};`}),e},nm=(t,e)=>{const r={};return t.forEach(n=>{if(n.globalName){const o=e[n.globalName];o&&(r[n.globalName]=o)}}),r},om=(t,e=1)=>{let r=0,n=t,o={},a={};for(;r<e;)Object.keys(n).forEach(s=>{o={...o,...n[s]}}),a=o,n=o,o={},r+=1;return a},Pa=(t,e)=>{const r=[];return e.forEach(n=>{const a=n.exec(t);a!=null&&a.length&&r.push(a[1])}),r},Aa=(t,e)=>{const r={};return e.forEach(n=>{t[n.name]&&(r[n.name]=t[n.name])}),r},am=(t,e)=>Aa(t,e),im=(t,e)=>Aa(t,e),Qe="DYNAMIC",sm=["$$context","$$nodeModel"],Ra=t=>{let e;const r=new Set,n=(c,l)=>{const f=typeof c=="function"?c(e):c;if(!Object.is(f,e)){const p=e;e=l??typeof f!="object"?f:Object.assign({},e,f),r.forEach(d=>d(e,p))}},o=()=>e,i={setState:n,getState:o,subscribe:c=>(r.add(c),()=>r.delete(c)),destroy:()=>{({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1}&&"production")!=="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()}};return e=t(n,o,i),i},cm=t=>t?Ra(t):Ra;class um{constructor(){j(this,"storeMap",new Map)}addStore(e,r){const n=cm(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 lm{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 Ma{constructor(){j(this,"renderMode","normal");j(this,"components",{});j(this,"storeManager",new um);j(this,"variableManager",new lm);j(this,"runtimeComponentCache",new Map);j(this,"onGetRef");j(this,"onGetComponent");j(this,"onComponentMount");j(this,"onComponentDestroy");j(this,"processNodeConfigHook")}getComponent(e){var o;const r=e.value.componentName;let n=this.components[r]||(()=>`Component [${r}] not found`);return Ta(n)||(n=$a(n),this.components[r]=n),this.onGetComponent&&(n=(o=this.onGetComponent)==null?void 0:o.call(this,n,e)),n}getContext(e={},r){let n=e;return r&&(n={...e},n.__proto__=r||null),n}pageRender(e,{components:r,onGetRef:n,$$context:o={},onGetComponent:a,onComponentMount:s,onComponentDestroy:i,renderMode:c,processNodeConfigHook:l}){this.renderMode=c,this.components=r,this.onGetRef=n,this.onGetComponent=a,this.onComponentMount=s,this.onComponentDestroy=i,this.processNodeConfigHook=l;const f=e.value.componentsTree,p=this.getComponent(f),d=this.convertModelToComponent(p,e.value.componentsTree),v={},y=f.props;return Object.keys(y).forEach(S=>{v[S]=y[S].value}),v.$$context=o,this.render(d,v)}transformProps(e={},{$$context:r}){const n=e,o=s=>{if(Array.isArray(s))return s.map(i=>o(i));if(Hr(s))return o(s.value);if(Cd(s)){const i=s.value,c=i.value;if(!c)return console.warn("slot value is null, this maybe cause some error, pls check it",e),()=>{};const l=f=>{const p=`${f.id}-${Qe}`;if(this.runtimeComponentCache.get(f.id))return{key:p,component:this.runtimeComponentCache.get(f.id)};const d=this.getComponent(f),v=this.convertModelToComponent(d,f),y=i.params||[];return{component:(...$)=>{const E=cn($,y),U=this.getContext({params:E},r);return this.render(v,{$$context:U,key:p})},key:p}};if(Array.isArray(c)){const f=c==null?void 0:c.map(p=>l(p));return(...p)=>f.map(d=>wa(d.component)?C.createElement(d.component,{$$context:r,key:d.key}):d.component(...p))}else return l(c).component}else{if(Mt(s))return Lt(s.value,r||{});if(Od(s))return Na(s.value,r,this.storeManager);if(ne(s)){let i=s;Hr(s)&&(i=s.value);const c=i,l={};return Object.keys(i).forEach(f=>{l[f]=o(c[f])}),l}else return s}},a={};return Object.keys(n).forEach(s=>{const i=n[s];a[s]=o(i)}),a}collectSpecialProps(e={},r){const n=[],o=(a,s)=>{let i=s;Hr(s)&&(i=s.value),r(i)?n.push({keyPath:a,val:i}):ee(i)?i.forEach((c,l)=>{o([...a,String(l)],c)}):ne(i)&&Object.keys(i).forEach(c=>{o([...a,c],i[c])})};return o(["$root"],e),n}convertModelToComponent(e,r){const n=this;class o extends C.Component{constructor(i){super(i);j(this,"_CONDITION",!0);j(this,"_DESIGN_BOX",!1);j(this,"_NODE_MODEL",r);j(this,"_NODE_ID",r.id);j(this,"UNIQUE_ID",`${r.id}_${vt()}`);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",i=>{this.storeState.setState(i),this.forceUpdate()});j(this,"getStyleDomById",i=>{const c=this.mediaStyleDomMap;let l=c[i];return l||(l=document.createElement("style"),c[i]=l),l.id=i,l});j(this,"addMediaCSS",()=>{var l;let i=this.domHeader;if(i||(i=(l=document.getElementsByTagName("head"))==null?void 0:l[0],this.domHeader=i),!this.domHeader)return;const c=this._NODE_MODEL.value.css;c&&c.value.forEach(f=>{var v;const p=`${this.UNIQUE_ID}_${f.state}`;let d=`.${c.class}`;if(f.state!=="normal"&&(d=`${d}:${f.state}`),Object.keys(f.style).length!==0){const y=this.getStyleDomById(p);y.innerText=`${d} { ${ln(f.style)} }`,i==null||i.appendChild(y)}(v=f.media)!=null&&v.length&&f.media.forEach(y=>{const S=`${p}_${y.type}_${y.value}`,O=this.getStyleDomById(S);O.media=`screen and (${y.type}:${y.value}px)`,O.innerHTML=`${d} { ${ln(y.style)} }`,i==null||i.appendChild(O)})})});j(this,"removeMediaCSS",()=>{const i=this.mediaStyleDomMap;Object.keys(i).forEach(c=>{var l;(l=this.domHeader)==null||l.removeChild(i[c])}),this.mediaStyleDomMap={}});j(this,"rebuildNode",()=>{this.storeListenDisposeList.forEach(i=>i()),this.removeMediaCSS(),this.connectStore(),this.addMediaCSS(),this.forceUpdate()});this.targetComponentRef=C.createRef(),this.state=r.value.state||{};const c=r.value.nodeName||r.id;this.nodeName=c;const l=n.storeManager.getStore(c);l?(this.storeState=l,l.setState({...r.value.state||{}})):this.storeState=n.storeManager.addStore(c,()=>({...r.value.state||{}})),this.storeState.subscribe(p=>{this.setState({...p})}),this.connectStore();const f=n.variableManager.get(c);f?this.variableSpace=f:(this.variableSpace={staticVar:{},methods:{}},n.variableManager.add(c,this.variableSpace))}connectStore(){const i=n.collectSpecialProps(r.props,d=>!!Mt(d)),c=n.collectSpecialProps({css:r.value.css,class:r.value.classNames},d=>!!Mt(d));let l=[];[...i,...c].map(d=>{const v=d.val,y=[/\$\$context.stateManager\.(.+?)\./gim,/\$\$context.stateManager\["(.+?)"\]/gim,/\$\$context.stateManager\['(.+?)'\]/gim,/getStateObj\('(.+?)'\)/gim,/getStateObj\("(.+?)"\)/gim,/getStateById\('(.+?)'\)/gim,/getStateById\("(.+?)"\)/gim],S=Pa(v.value,y);l=[...l,...S]}).filter(Boolean);const f=Array.from(new Set(l)),p=[];f.length&&f.forEach(d=>{n.storeManager.getStore(d)||(n.storeManager.addStore(d,()=>({})),console.warn(n.storeManager,d,"not exits"));const y=n.storeManager.connect(d,()=>{this.forceUpdate()});p.push(y)}),this.storeListenDisposeList=p}componentDidMount(){var c;this.addMediaCSS(),n.onGetRef&&n.onGetRef(this.targetComponentRef,r,this),(c=n.onComponentMount)==null||c.call(n,this,r);const i=()=>{n.storeManager.setStore(r.value.nodeName||r.id,this.storeState),this.storeState.setState({...this.state,...r.value.state||{}}),this.rebuildNode()};r.onChange(i)}componentWillUnmount(){var i;this.storeListenDisposeList.forEach(c=>c()),this.removeMediaCSS(),(i=n.onComponentDestroy)==null||i.call(n,this,r)}render(){var ae;const{$$context:i,...c}=this.props,l=r.value.nodeName||r.id,f={key:r.id,...r.props,...c},p={state:this.state||{},staticVar:this.variableSpace.staticVar,updateState:this.updateState,storeManager:n.storeManager,getState:()=>n.storeManager.getStateObj(l),getStateObj:()=>n.storeManager.getStateObj(l),getStateObjById:B=>n.storeManager.getStateObj(B),stateManager:n.storeManager.getStateSnapshot(),getMethods:()=>n.variableManager.get(l).methods,getMethodsById:B=>n.variableManager.get(B).methods,getStaticVar:()=>n.variableManager.get(l).staticVar,getStaticVarById:B=>n.variableManager.get(B).staticVar};r.value.componentName===Qt.ROOT_CONTAINER&&(p.globalState=this.state,p.updateGlobalState=this.updateState);const d=n.getContext(p,i),S=n.transformProps({methods:r.value.methods},{$$context:d}).methods.reduce((B,H)=>(B[H.name]=H.define,B),{});d.methods=S,this.variableSpace.methods=Object.assign(this.variableSpace.methods,S);const O=r.value.loop;let $=[];if(O&&O.open){this.targetComponentRef.current=[];let B=O.data||[];if(Mt(O.data)){const H=O.data;B=Lt(H.value,d||{})}return $=B.map((...H)=>{var Ze;const rt=H[1],it=[O.forName||"item",O.forIndex||"index"],ie=cn(H,it);let se="loopData";O.name&&(se=`${se}${O.name}`);const Ct=n.getContext({[se]:ie},d),nt=n.transformProps(f,{$$context:Ct}),Ke=((Ze=r.value.classNames)==null?void 0:Ze.map(q=>{var wt;const Et=q.name;return(Mt(q.status)?Lt(String(((wt=q.status)==null?void 0:wt.value)||""),Ct):!1)?Et:""}))||[];let ce=`${nt.className??""} ${Ke.join(" ")}`.trim();r.value.css&&(ce=`${r.value.css.class} ${ce}`.trim()),nt.className=ce;const Xe=n.transformProps(r.value.style,{$$context:Ct});r.value.style&&(nt.style=un(Xe||{}));const{children:kt}=nt;let Re=[];if(kt!==void 0)delete nt.children,Re=Array.isArray(kt)?kt:[kt];else{const q=[];r.value.children.forEach((Ut,wt)=>{const ue=n.buildComponent(Ut,{$$context:Ct,idx:wt});q.push(ue)}),Re=q}if(nt.key=`${nt.key}-${rt}`,Mt(O.key)){const q=O.key,Et=Lt(q.value,Ct||{});nt.key+=`-${Et}`}return nt.ref=q=>{this.targetComponentRef.current=this.targetComponentRef.current||[],this.targetComponentRef.current[rt]=q},n.render(e,nt,...Re)}),$}const E=n.transformProps(f,{$$context:d}),{children:U}=E;let F=[];if(U!==void 0)delete E.children,F=Array.isArray(U)?U:[U];else{const B=[];r.value.children.forEach((rt,it)=>{const ie=n.buildComponent(rt,{$$context:d,idx:it});B.push(ie)}),F=B}E.ref=this.targetComponentRef;const J=((ae=r.value.classNames)==null?void 0:ae.map(B=>{var it;const H=B.name;return(Mt(B.status)?Lt(((it=B.status)==null?void 0:it.value)||"",d):!1)?H:""}))||[];let tt=`${E.className??""} ${J.join(" ")}`.trim();r.value.css&&(tt=`${r.value.css.class} ${tt}`.trim()),E.className=tt;const Ft=n.transformProps(r.value.style,{$$context:d});r.value.style&&(E.style=un(Ft||{}));let R=r.value.condition??!0;typeof R!="boolean"&&(R=Lt(R.value,d||{}));let ft={condition:R,props:E};n.processNodeConfigHook&&(ft=n.processNodeConfigHook(ft,r));const _t=n.render(e,ft.props,...F);return this._CONDITION=ft.condition,ft.condition?_t:C.createElement("div",{style:{display:"none"}},_t)}}return j(o,"__CP_TYPE__",Qe),o.displayName=`${r.value.componentName}Dynamic`,o}buildComponent(e,{$$context:r={}}){const n=this.runtimeComponentCache;return typeof e=="string"?this.render(e):jd(e)?(({currentNode:a})=>{const s=a.value.id;let i=null;if(n.get(s))i=n.get(s);else{const f=this.getComponent(a);i=this.convertModelToComponent(f,a)}!n.get(s)&&this.renderMode!=="design"&&n.set(s,i);const c=`${s}-${Qe}`,l={$$context:r,$$nodeModel:e,key:c};return this.render(i,l)})({currentNode:e}):void 0}render(e,r={},...n){return typeof e=="string"||typeof e=="number"?String(e):(sm.forEach(a=>{a in r&&e.__CP_TYPE__!==Qe&&delete r[a]}),C.createElement(e,r,...n))}clear(){this.runtimeComponentCache.clear(),this.storeManager.destroy()}}const fm=yn(new Ma),dm=["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","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"];var pm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function hm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var fn={exports:{}},Pe={};/**
|
|
20
|
+
`,new Function(a)(...o,e,r)}catch(s){console.log(a),console.warn(s)}},Pr=(t,e)=>{const r={};return e.forEach((n,o)=>{r[n]=t[o]}),r},xr=t=>{const e={};return Object.keys(t).forEach(r=>{let n=r.replace("-webkit","Webkit");n=n.replace("-ms","ms"),n=n.replace("-moz","Moz"),n=n.replace("-o","O");let o=n.split("-");o.length>=2&&(o=o.map((a,s)=>s!==0?Wh(a):a)),e[o.join("")]=t[r]}),e},Ir=t=>{let e="";return Object.keys(t).forEach(r=>{e+=`${r}:${t[r]};`}),e},hm=(t,e)=>{const r={};return t.forEach(n=>{if(n.globalName){const o=e[n.globalName];o&&(r[n.globalName]=o)}}),r},mm=(t,e=1)=>{let r=0,n=t,o={},a={};for(;r<e;)Object.keys(n).forEach(s=>{o={...o,...n[s]}}),a=o,n=o,o={},r+=1;return a},Zo=(t,e)=>{const r=[];return e.forEach(n=>{const a=n.exec(t);a!=null&&a.length&&r.push(a[1])}),r},ta=(t,e)=>{const r={};return e.forEach(n=>{t[n.name]&&(r[n.name]=t[n.name])}),r},vm=(t,e)=>ta(t,e),gm=(t,e)=>ta(t,e),je="DYNAMIC",ym=["$$context","$$nodeModel"],ea=t=>{let e;const r=new Set,n=(c,u)=>{const l=typeof c=="function"?c(e):c;if(!Object.is(l,e)){const d=e;e=u??typeof l!="object"?l:Object.assign({},e,l),r.forEach(f=>f(e,d))}},o=()=>e,i={setState:n,getState:o,subscribe:c=>(r.add(c),()=>r.delete(c)),destroy:()=>{({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1}&&"production")!=="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()}};return e=t(n,o,i),i},bm=t=>t?ea(t):ea;class _m{constructor(){b(this,"storeMap",new Map)}addStore(e,r){const n=bm(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 Sm{constructor(){b(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 ra{constructor(){b(this,"renderMode","normal");b(this,"components",{});b(this,"storeManager",new _m);b(this,"variableManager",new Sm);b(this,"runtimeComponentCache",new Map);b(this,"onGetRef");b(this,"onGetComponent");b(this,"onComponentMount");b(this,"onComponentDestroy");b(this,"processNodeConfigHook")}getComponent(e){var o;const r=e.value.componentName;let n=this.components[r]||(()=>`Component [${r}] not found`);return Yo(n)||(n=Ko(n),this.components[r]=n),this.onGetComponent&&(n=(o=this.onGetComponent)==null?void 0:o.call(this,n,e)),n}getContext(e={},r){let n=e;return r&&(n={...e},n.__proto__=r||null),n}pageRender(e,{components:r,onGetRef:n,$$context:o={},onGetComponent:a,onComponentMount:s,onComponentDestroy:i,renderMode:c,processNodeConfigHook:u}){this.renderMode=c,this.components=r,this.onGetRef=n,this.onGetComponent=a,this.onComponentMount=s,this.onComponentDestroy=i,this.processNodeConfigHook=u;const l=e.value.componentsTree,d=this.getComponent(l),f=this.convertModelToComponent(d,e.value.componentsTree),p={},v=l.props;return Object.keys(v).forEach(y=>{p[y]=v[y].value}),p.$$context=o,this.render(f,p)}transformProps(e={},{$$context:r}){const n=e,o=s=>{if(Array.isArray(s))return s.map(i=>o(i));if(gr(s))return o(s.value);if(Df(s)){const i=s.value,c=i.value;if(!c)return console.warn("slot value is null, this maybe cause some error, pls check it",e),()=>{};const u=l=>{const d=`${l.id}-${je}`;if(this.runtimeComponentCache.get(l.id))return{key:d,component:this.runtimeComponentCache.get(l.id)};const f=this.getComponent(l),p=this.convertModelToComponent(f,l),v=i.params||[];return{component:(...O)=>{const w=Pr(O,v),x=this.getContext({params:w},r);return this.render(p,{$$context:x,key:d})},key:d}};if(Array.isArray(c)){const l=c==null?void 0:c.map(d=>u(d));return(...d)=>l.map(f=>qo(f.component)?S.createElement(f.component,{$$context:r,key:f.key}):f.component(...d))}else return u(c).component}else{if(ht(s))return yt(s.value,r||{});if(xf(s))return Xo(s.value,r,this.storeManager);if(Rt(s)){let i=s;gr(s)&&(i=s.value);const c=i,u={};return Object.keys(i).forEach(l=>{u[l]=o(c[l])}),u}else return s}},a={};return Object.keys(n).forEach(s=>{const i=n[s];a[s]=o(i)}),a}collectSpecialProps(e={},r){const n=[],o=(a,s)=>{let i=s;gr(s)&&(i=s.value),r(i)?n.push({keyPath:a,val:i}):It(i)?i.forEach((c,u)=>{o([...a,String(u)],c)}):Rt(i)&&Object.keys(i).forEach(c=>{o([...a,c],i[c])})};return o(["$root"],e),n}convertModelToComponent(e,r){const n=this;class o extends S.Component{constructor(i){super(i);b(this,"_CONDITION",!0);b(this,"_DESIGN_BOX",!1);b(this,"_NODE_MODEL",r);b(this,"_NODE_ID",r.id);b(this,"UNIQUE_ID",`${r.id}_${X()}`);b(this,"targetComponentRef");b(this,"listenerHandle",[]);b(this,"storeState");b(this,"storeListenDisposeList",[]);b(this,"domHeader");b(this,"mediaStyleDomMap",{});b(this,"variableSpace");b(this,"nodeName");b(this,"updateState",i=>{this.storeState.setState(i),this.forceUpdate()});b(this,"getStyleDomById",i=>{const c=this.mediaStyleDomMap;let u=c[i];return u||(u=document.createElement("style"),c[i]=u),u.id=i,u});b(this,"addMediaCSS",()=>{var u;let i=this.domHeader;if(i||(i=(u=document.getElementsByTagName("head"))==null?void 0:u[0],this.domHeader=i),!this.domHeader)return;const c=this._NODE_MODEL.value.css;c&&c.value.forEach(l=>{var p;const d=`${this.UNIQUE_ID}_${l.state}`;let f=`.${c.class}`;if(l.state!=="normal"&&(f=`${f}:${l.state}`),Object.keys(l.style).length!==0){const v=this.getStyleDomById(d);v.innerText=`${f} { ${Ir(l.style)} }`,i==null||i.appendChild(v)}(p=l.media)!=null&&p.length&&l.media.forEach(v=>{const y=`${d}_${v.type}_${v.value}`,_=this.getStyleDomById(y);_.media=`screen and (${v.type}:${v.value}px)`,_.innerHTML=`${f} { ${Ir(v.style)} }`,i==null||i.appendChild(_)})})});b(this,"removeMediaCSS",()=>{const i=this.mediaStyleDomMap;Object.keys(i).forEach(c=>{var u;(u=this.domHeader)==null||u.removeChild(i[c])}),this.mediaStyleDomMap={}});b(this,"rebuildNode",()=>{this.storeListenDisposeList.forEach(i=>i()),this.removeMediaCSS(),this.connectStore(),this.addMediaCSS(),this.forceUpdate()});this.targetComponentRef=S.createRef(),this.state=r.value.state||{};const c=r.value.nodeName||r.id;this.nodeName=c;const u=n.storeManager.getStore(c);u?(this.storeState=u,u.setState({...r.value.state||{}})):this.storeState=n.storeManager.addStore(c,()=>({...r.value.state||{}})),this.storeState.subscribe(d=>{this.setState({...d})}),this.connectStore();const l=n.variableManager.get(c);l?this.variableSpace=l:(this.variableSpace={staticVar:{},methods:{}},n.variableManager.add(c,this.variableSpace))}connectStore(){const i=n.collectSpecialProps(r.props,f=>!!ht(f)),c=n.collectSpecialProps({css:r.value.css,class:r.value.classNames},f=>!!ht(f));let u=[];[...i,...c].map(f=>{const p=f.val,v=[/\$\$context.stateManager\.(.+?)\./gim,/\$\$context.stateManager\["(.+?)"\]/gim,/\$\$context.stateManager\['(.+?)'\]/gim,/getStateObj\('(.+?)'\)/gim,/getStateObj\("(.+?)"\)/gim,/getStateById\('(.+?)'\)/gim,/getStateById\("(.+?)"\)/gim],y=Zo(p.value,v);u=[...u,...y]}).filter(Boolean);const l=Array.from(new Set(u)),d=[];l.length&&l.forEach(f=>{n.storeManager.getStore(f)||(n.storeManager.addStore(f,()=>({})),console.warn(n.storeManager,f,"not exits"));const v=n.storeManager.connect(f,()=>{this.forceUpdate()});d.push(v)}),this.storeListenDisposeList=d}componentDidMount(){var c;this.addMediaCSS(),n.onGetRef&&n.onGetRef(this.targetComponentRef,r,this),(c=n.onComponentMount)==null||c.call(n,this,r);const i=()=>{n.storeManager.setStore(r.value.nodeName||r.id,this.storeState),this.storeState.setState({...this.state,...r.value.state||{}}),this.rebuildNode()};r.onChange(i)}componentWillUnmount(){var i;this.storeListenDisposeList.forEach(c=>c()),this.removeMediaCSS(),(i=n.onComponentDestroy)==null||i.call(n,this,r)}render(){var we;const{$$context:i,...c}=this.props,u=r.value.nodeName||r.id,l={key:r.id,...r.props,...c},d={state:this.state||{},staticVar:this.variableSpace.staticVar,updateState:this.updateState,storeManager:n.storeManager,getState:()=>n.storeManager.getStateObj(u),getStateObj:()=>n.storeManager.getStateObj(u),getStateObjById:R=>n.storeManager.getStateObj(R),stateManager:n.storeManager.getStateSnapshot(),getMethods:()=>n.variableManager.get(u).methods,getMethodsById:R=>n.variableManager.get(R).methods,getStaticVar:()=>n.variableManager.get(u).staticVar,getStaticVarById:R=>n.variableManager.get(R).staticVar};r.value.componentName===Tt.ROOT_CONTAINER&&(d.globalState=this.state,d.updateGlobalState=this.updateState);const f=n.getContext(d,i),y=n.transformProps({methods:r.value.methods},{$$context:f}).methods.reduce((R,Z)=>(R[Z.name]=Z.define,R),{});f.methods=y,this.variableSpace.methods=Object.assign(this.variableSpace.methods,y);const _=r.value.loop;let O=[];if(_&&_.open){this.targetComponentRef.current=[];let R=_.data||[];if(ht(_.data)){const Z=_.data;R=yt(Z.value,f||{})}return O=R.map((...Z)=>{var da;const oe=Z[1],Ft=[_.forName||"item",_.forIndex||"index"],Dr=Pr(Z,Ft);let Rr="loopData";_.name&&(Rr=`${Rr}${_.name}`);const ae=n.getContext({[Rr]:Dr},f),tt=n.transformProps(l,{$$context:ae}),zm=((da=r.value.classNames)==null?void 0:da.map(Q=>{var $e;const Ee=Q.name;return(ht(Q.status)?yt(String((($e=Q.status)==null?void 0:$e.value)||""),ae):!1)?Ee:""}))||[];let Lr=`${tt.className??""} ${zm.join(" ")}`.trim();r.value.css&&(Lr=`${r.value.css.class} ${Lr}`.trim()),tt.className=Lr;const Gm=n.transformProps(r.value.style,{$$context:ae});r.value.style&&(tt.style=xr(Gm||{}));const{children:Ce}=tt;let Fr=[];if(Ce!==void 0)delete tt.children,Fr=Array.isArray(Ce)?Ce:[Ce];else{const Q=[];r.value.children.forEach((pa,$e)=>{const Hm=n.buildComponent(pa,{$$context:ae,idx:$e});Q.push(Hm)}),Fr=Q}if(tt.key=`${tt.key}-${oe}`,ht(_.key)){const Q=_.key,Ee=yt(Q.value,ae||{});tt.key+=`-${Ee}`}return tt.ref=Q=>{this.targetComponentRef.current=this.targetComponentRef.current||[],this.targetComponentRef.current[oe]=Q},n.render(e,tt,...Fr)}),O}const w=n.transformProps(l,{$$context:f}),{children:x}=w;let M=[];if(x!==void 0)delete w.children,M=Array.isArray(x)?x:[x];else{const R=[];r.value.children.forEach((oe,Ft)=>{const Dr=n.buildComponent(oe,{$$context:f,idx:Ft});R.push(Dr)}),M=R}w.ref=this.targetComponentRef;const L=((we=r.value.classNames)==null?void 0:we.map(R=>{var Ft;const Z=R.name;return(ht(R.status)?yt(((Ft=R.status)==null?void 0:Ft.value)||"",f):!1)?Z:""}))||[];let G=`${w.className??""} ${L.join(" ")}`.trim();r.value.css&&(G=`${r.value.css.class} ${G}`.trim()),w.className=G;const ne=n.transformProps(r.value.style,{$$context:f});r.value.style&&(w.style=xr(ne||{}));let E=r.value.condition??!0;typeof E!="boolean"&&(E=yt(E.value,f||{}));let st={condition:E,props:w};n.processNodeConfigHook&&(st=n.processNodeConfigHook(st,r));const bt=n.render(e,st.props,...M);return this._CONDITION=st.condition,st.condition?bt:S.createElement("div",{style:{display:"none"}},bt)}}return b(o,"__CP_TYPE__",je),o.displayName=`${r.value.componentName}Dynamic`,o}buildComponent(e,{$$context:r={}}){const n=this.runtimeComponentCache;return typeof e=="string"?this.render(e):If(e)?(({currentNode:a})=>{const s=a.value.id;let i=null;if(n.get(s))i=n.get(s);else{const l=this.getComponent(a);i=this.convertModelToComponent(l,a)}!n.get(s)&&this.renderMode!=="design"&&n.set(s,i);const c=`${s}-${je}`,u={$$context:r,$$nodeModel:e,key:c};return this.render(i,u)})({currentNode:e}):void 0}render(e,r={},...n){return typeof e=="string"||typeof e=="number"?String(e):(ym.forEach(a=>{a in r&&e.__CP_TYPE__!==je&&delete r[a]}),S.createElement(e,r,...n))}clear(){this.runtimeComponentCache.clear(),this.storeManager.destroy()}}const jm=Ur(new ra),Om=["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","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"];var wm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Cm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var na={exports:{}},Oe={};/**
|
|
21
21
|
* @license React
|
|
22
22
|
* react-jsx-runtime.production.min.js
|
|
23
23
|
*
|
|
@@ -25,23 +25,5 @@ return $$_run_$$();
|
|
|
25
25
|
*
|
|
26
26
|
* This source code is licensed under the MIT license found in the
|
|
27
27
|
* LICENSE file in the root directory of this source tree.
|
|
28
|
-
*/var xa;function vm(){if(xa)return Pe;xa=1;var t=C,e=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function s(i,c,l){var f,p={},d=null,v=null;l!==void 0&&(d=""+l),c.key!==void 0&&(d=""+c.key),c.ref!==void 0&&(v=c.ref);for(f in c)n.call(c,f)&&!a.hasOwnProperty(f)&&(p[f]=c[f]);if(i&&i.defaultProps)for(f in c=i.defaultProps,c)p[f]===void 0&&(p[f]=c[f]);return{$$typeof:e,type:i,key:d,ref:v,props:p,_owner:o.current}}return Pe.Fragment=r,Pe.jsx=s,Pe.jsxs=s,Pe}var Ae={};/**
|
|
29
|
-
* @license React
|
|
30
|
-
* react-jsx-runtime.development.js
|
|
31
|
-
*
|
|
32
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
33
|
-
*
|
|
34
|
-
* This source code is licensed under the MIT license found in the
|
|
35
|
-
* LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/var Da;function mm(){return Da||(Da=1,process.env.NODE_ENV!=="production"&&function(){var t=C,e=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),i=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen"),y=Symbol.iterator,S="@@iterator";function O(u){if(u===null||typeof u!="object")return null;var h=y&&u[y]||u[S];return typeof h=="function"?h:null}var $=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function E(u){{for(var h=arguments.length,m=new Array(h>1?h-1:0),w=1;w<h;w++)m[w-1]=arguments[w];U("error",u,m)}}function U(u,h,m){{var w=$.ReactDebugCurrentFrame,A=w.getStackAddendum();A!==""&&(h+="%s",m=m.concat([A]));var x=m.map(function(P){return String(P)});x.unshift("Warning: "+h),Function.prototype.apply.call(console[u],console,x)}}var F=!1,J=!1,tt=!1,Ft=!1,R=!1,ft;ft=Symbol.for("react.module.reference");function _t(u){return!!(typeof u=="string"||typeof u=="function"||u===n||u===a||R||u===o||u===l||u===f||Ft||u===v||F||J||tt||typeof u=="object"&&u!==null&&(u.$$typeof===d||u.$$typeof===p||u.$$typeof===s||u.$$typeof===i||u.$$typeof===c||u.$$typeof===ft||u.getModuleId!==void 0))}function ae(u,h,m){var w=u.displayName;if(w)return w;var A=h.displayName||h.name||"";return A!==""?m+"("+A+")":m}function B(u){return u.displayName||"Context"}function H(u){if(u==null)return null;if(typeof u.tag=="number"&&E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case n:return"Fragment";case r:return"Portal";case a:return"Profiler";case o:return"StrictMode";case l:return"Suspense";case f:return"SuspenseList"}if(typeof u=="object")switch(u.$$typeof){case i:var h=u;return B(h)+".Consumer";case s:var m=u;return B(m._context)+".Provider";case c:return ae(u,u.render,"ForwardRef");case p:var w=u.displayName||null;return w!==null?w:H(u.type)||"Memo";case d:{var A=u,x=A._payload,P=A._init;try{return H(P(x))}catch{return null}}}return null}var rt=Object.assign,it=0,ie,se,Ct,nt,Ke,ce,Xe;function kt(){}kt.__reactDisabledLog=!0;function Re(){{if(it===0){ie=console.log,se=console.info,Ct=console.warn,nt=console.error,Ke=console.group,ce=console.groupCollapsed,Xe=console.groupEnd;var u={configurable:!0,enumerable:!0,value:kt,writable:!0};Object.defineProperties(console,{info:u,log:u,warn:u,error:u,group:u,groupCollapsed:u,groupEnd:u})}it++}}function Ze(){{if(it--,it===0){var u={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:rt({},u,{value:ie}),info:rt({},u,{value:se}),warn:rt({},u,{value:Ct}),error:rt({},u,{value:nt}),group:rt({},u,{value:Ke}),groupCollapsed:rt({},u,{value:ce}),groupEnd:rt({},u,{value:Xe})})}it<0&&E("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var q=$.ReactCurrentDispatcher,Et;function Ut(u,h,m){{if(Et===void 0)try{throw Error()}catch(A){var w=A.stack.trim().match(/\n( *(at )?)/);Et=w&&w[1]||""}return`
|
|
37
|
-
`+Et+u}}var wt=!1,ue;{var $m=typeof WeakMap=="function"?WeakMap:Map;ue=new $m}function Ga(u,h){if(!u||wt)return"";{var m=ue.get(u);if(m!==void 0)return m}var w;wt=!0;var A=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var x;x=q.current,q.current=null,Re();try{if(h){var P=function(){throw Error()};if(Object.defineProperty(P.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(P,[])}catch(St){w=St}Reflect.construct(u,[],P)}else{try{P.call()}catch(St){w=St}u.call(P.prototype)}}else{try{throw Error()}catch(St){w=St}u()}}catch(St){if(St&&w&&typeof St.stack=="string"){for(var N=St.stack.split(`
|
|
38
|
-
`),Q=w.stack.split(`
|
|
39
|
-
`),W=N.length-1,Y=Q.length-1;W>=1&&Y>=0&&N[W]!==Q[Y];)Y--;for(;W>=1&&Y>=0;W--,Y--)if(N[W]!==Q[Y]){if(W!==1||Y!==1)do if(W--,Y--,Y<0||N[W]!==Q[Y]){var st=`
|
|
40
|
-
`+N[W].replace(" at new "," at ");return u.displayName&&st.includes("<anonymous>")&&(st=st.replace("<anonymous>",u.displayName)),typeof u=="function"&&ue.set(u,st),st}while(W>=1&&Y>=0);break}}}finally{wt=!1,q.current=x,Ze(),Error.prepareStackTrace=A}var fe=u?u.displayName||u.name:"",ri=fe?Ut(fe):"";return typeof u=="function"&&ue.set(u,ri),ri}function Nm(u,h,m){return Ga(u,!1)}function Pm(u){var h=u.prototype;return!!(h&&h.isReactComponent)}function tr(u,h,m){if(u==null)return"";if(typeof u=="function")return Ga(u,Pm(u));if(typeof u=="string")return Ut(u);switch(u){case l:return Ut("Suspense");case f:return Ut("SuspenseList")}if(typeof u=="object")switch(u.$$typeof){case c:return Nm(u.render);case p:return tr(u.type,h,m);case d:{var w=u,A=w._payload,x=w._init;try{return tr(x(A),h,m)}catch{}}}return""}var er=Object.prototype.hasOwnProperty,za={},Wa=$.ReactDebugCurrentFrame;function rr(u){if(u){var h=u._owner,m=tr(u.type,u._source,h?h.type:null);Wa.setExtraStackFrame(m)}else Wa.setExtraStackFrame(null)}function Am(u,h,m,w,A){{var x=Function.call.bind(er);for(var P in u)if(x(u,P)){var N=void 0;try{if(typeof u[P]!="function"){var Q=Error((w||"React class")+": "+m+" type `"+P+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof u[P]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Q.name="Invariant Violation",Q}N=u[P](h,P,w,m,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(W){N=W}N&&!(N instanceof Error)&&(rr(A),E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",w||"React class",m,P,typeof N),rr(null)),N instanceof Error&&!(N.message in za)&&(za[N.message]=!0,rr(A),E("Failed %s type: %s",m,N.message),rr(null))}}}var Rm=Array.isArray;function dn(u){return Rm(u)}function Mm(u){{var h=typeof Symbol=="function"&&Symbol.toStringTag,m=h&&u[Symbol.toStringTag]||u.constructor.name||"Object";return m}}function xm(u){try{return Ha(u),!1}catch{return!0}}function Ha(u){return""+u}function Ya(u){if(xm(u))return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Mm(u)),Ha(u)}var Me=$.ReactCurrentOwner,Dm={key:!0,ref:!0,__self:!0,__source:!0},Ja,qa,pn;pn={};function Im(u){if(er.call(u,"ref")){var h=Object.getOwnPropertyDescriptor(u,"ref").get;if(h&&h.isReactWarning)return!1}return u.ref!==void 0}function Lm(u){if(er.call(u,"key")){var h=Object.getOwnPropertyDescriptor(u,"key").get;if(h&&h.isReactWarning)return!1}return u.key!==void 0}function Fm(u,h){if(typeof u.ref=="string"&&Me.current&&h&&Me.current.stateNode!==h){var m=H(Me.current.type);pn[m]||(E('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',H(Me.current.type),u.ref),pn[m]=!0)}}function km(u,h){{var m=function(){Ja||(Ja=!0,E("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",h))};m.isReactWarning=!0,Object.defineProperty(u,"key",{get:m,configurable:!0})}}function Um(u,h){{var m=function(){qa||(qa=!0,E("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",h))};m.isReactWarning=!0,Object.defineProperty(u,"ref",{get:m,configurable:!0})}}var Bm=function(u,h,m,w,A,x,P){var N={$$typeof:e,type:u,key:h,ref:m,props:P,_owner:x};return N._store={},Object.defineProperty(N._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(N,"_self",{configurable:!1,enumerable:!1,writable:!1,value:w}),Object.defineProperty(N,"_source",{configurable:!1,enumerable:!1,writable:!1,value:A}),Object.freeze&&(Object.freeze(N.props),Object.freeze(N)),N};function Vm(u,h,m,w,A){{var x,P={},N=null,Q=null;m!==void 0&&(Ya(m),N=""+m),Lm(h)&&(Ya(h.key),N=""+h.key),Im(h)&&(Q=h.ref,Fm(h,A));for(x in h)er.call(h,x)&&!Dm.hasOwnProperty(x)&&(P[x]=h[x]);if(u&&u.defaultProps){var W=u.defaultProps;for(x in W)P[x]===void 0&&(P[x]=W[x])}if(N||Q){var Y=typeof u=="function"?u.displayName||u.name||"Unknown":u;N&&km(P,Y),Q&&Um(P,Y)}return Bm(u,N,Q,A,w,Me.current,P)}}var hn=$.ReactCurrentOwner,Qa=$.ReactDebugCurrentFrame;function le(u){if(u){var h=u._owner,m=tr(u.type,u._source,h?h.type:null);Qa.setExtraStackFrame(m)}else Qa.setExtraStackFrame(null)}var vn;vn=!1;function mn(u){return typeof u=="object"&&u!==null&&u.$$typeof===e}function Ka(){{if(hn.current){var u=H(hn.current.type);if(u)return`
|
|
41
|
-
|
|
42
|
-
Check the render method of \``+u+"`."}return""}}function Gm(u){{if(u!==void 0){var h=u.fileName.replace(/^.*[\\\/]/,""),m=u.lineNumber;return`
|
|
43
|
-
|
|
44
|
-
Check your code at `+h+":"+m+"."}return""}}var Xa={};function zm(u){{var h=Ka();if(!h){var m=typeof u=="string"?u:u.displayName||u.name;m&&(h=`
|
|
45
|
-
|
|
46
|
-
Check the top-level render call using <`+m+">.")}return h}}function Za(u,h){{if(!u._store||u._store.validated||u.key!=null)return;u._store.validated=!0;var m=zm(h);if(Xa[m])return;Xa[m]=!0;var w="";u&&u._owner&&u._owner!==hn.current&&(w=" It was passed a child from "+H(u._owner.type)+"."),le(u),E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',m,w),le(null)}}function ti(u,h){{if(typeof u!="object")return;if(dn(u))for(var m=0;m<u.length;m++){var w=u[m];mn(w)&&Za(w,h)}else if(mn(u))u._store&&(u._store.validated=!0);else if(u){var A=O(u);if(typeof A=="function"&&A!==u.entries)for(var x=A.call(u),P;!(P=x.next()).done;)mn(P.value)&&Za(P.value,h)}}}function Wm(u){{var h=u.type;if(h==null||typeof h=="string")return;var m;if(typeof h=="function")m=h.propTypes;else if(typeof h=="object"&&(h.$$typeof===c||h.$$typeof===p))m=h.propTypes;else return;if(m){var w=H(h);Am(m,u.props,"prop",w,u)}else if(h.PropTypes!==void 0&&!vn){vn=!0;var A=H(h);E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",A||"Unknown")}typeof h.getDefaultProps=="function"&&!h.getDefaultProps.isReactClassApproved&&E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Hm(u){{for(var h=Object.keys(u.props),m=0;m<h.length;m++){var w=h[m];if(w!=="children"&&w!=="key"){le(u),E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",w),le(null);break}}u.ref!==null&&(le(u),E("Invalid attribute `ref` supplied to `React.Fragment`."),le(null))}}function ei(u,h,m,w,A,x){{var P=_t(u);if(!P){var N="";(u===void 0||typeof u=="object"&&u!==null&&Object.keys(u).length===0)&&(N+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Q=Gm(A);Q?N+=Q:N+=Ka();var W;u===null?W="null":dn(u)?W="array":u!==void 0&&u.$$typeof===e?(W="<"+(H(u.type)||"Unknown")+" />",N=" Did you accidentally export a JSX literal instead of a component?"):W=typeof u,E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",W,N)}var Y=Vm(u,h,m,A,x);if(Y==null)return Y;if(P){var st=h.children;if(st!==void 0)if(w)if(dn(st)){for(var fe=0;fe<st.length;fe++)ti(st[fe],u);Object.freeze&&Object.freeze(st)}else E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else ti(st,u)}return u===n?Hm(Y):Wm(Y),Y}}function Ym(u,h,m){return ei(u,h,m,!0)}function Jm(u,h,m){return ei(u,h,m,!1)}var qm=Jm,Qm=Ym;Ae.Fragment=n,Ae.jsx=qm,Ae.jsxs=Qm}()),Ae}process.env.NODE_ENV==="production"?fn.exports=vm():fn.exports=mm();var gm=fn.exports;const ym=gm.jsx,bt=t=>{const e={};return t.forEach(r=>{e[r.key]=r.value}),e},bm=[...dm,...cd].reduce((t,e)=>(t[e]=({children:r,$$attributes:n=[],...o})=>{let a=r;return Array.isArray(r)||(a=[r]),C.createElement(e,{...o,...bt(n)},...a)},t),{}),_m={RootContainer:({children:t})=>t,...bm,CContainer:({children:t,$$attributes:e=[],afterMount:r,beforeDestroy:n,...o})=>{let a=t;return Array.isArray(t)||(a=[t]),C.useEffect(()=>(r==null||r(o),()=>{n==null||n(o)}),[]),ym("div",{...o,...bt(e),children:a})},CVideo:({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),C.createElement("video",{...r,...bt(e)},...n)},CAudio:({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),C.createElement("audio",{...r,...bt(e)},...n)},CBlock:({children:t,width:e,height:r,$$attributes:n=[],...o})=>{let a=t;Array.isArray(t)||(a=[t]),a=a.filter(l=>l!==void 0);const{style:s={},...i}=bt(n),c={height:r,width:e,...s,...o.style||{}};return C.createElement("div",{...o,...i,style:c},...a)},CImage:({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),C.createElement("img",{...r,...bt(e)},...n)},CText:({$$attributes:t=[],content:e,...r})=>C.createElement("span",{...r,...bt(t)},e),CCanvas:({afterMount:t,beforeDestroy:e,$$attributes:r=[],...n})=>(C.useEffect(()=>(t==null||t(n),()=>{e==null||e(n)}),[]),C.createElement("canvas",{...n,...bt(r)})),CNativeTag:({children:t,$$attributes:e=[],htmlTag:r="div",...n})=>{let o=t;Array.isArray(t)||(o=[t]);const{style:a={},...s}=bt(e),i={...a,...n.style||{}};return C.createElement(r,{...n,...s,style:i},...o)}};class Sm{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()}}class Ia extends C.Component{constructor(r){super(r);j(this,"refManager");j(this,"dynamicComponentInstanceMap",new Map);j(this,"onGetRef",(r,n,o)=>{var a,s;(s=(a=this.props).onGetRef)==null||s.call(a,r,n,o),this.dynamicComponentInstanceMap.set(n.id,o),this.refManager.add(n.value.refId||n.id,r)});j(this,"rerender",r=>{if(this.props.adapter.clear(),(r==null?void 0:r.nodeType)==="PAGE"&&r)this.setState({pageModel:r});else if(ne(r)&&Fo(r)){const n=r;this.setState({pageModel:new We(n,{materials:this.state.pageModel.materialsModel.rawValue})})}});this.state={pageModel:r.pageModel||new We(r.page)},this.refManager=new Sm}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:s}=r,{pageModel:i}=this.state;if(!i)return console.warn("pageModel is null"),null;const c={..._m,...r.components},l=this.props.$$context??{};return l.refs=this.refManager,n.pageRender(i,{libs:{},components:c,onGetRef:this.onGetRef,onGetComponent:o,onComponentMount:s,onComponentDestroy:a,$$context:l,renderMode:r.renderMode,processNodeConfigHook:r.processNodeConfigHook})}}const Om=()=>{const t=C.useRef(null);return{ref:t,rerender:function(...e){t.current&&t.current.rerender(...e)}}};class jm extends C.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=C.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,C.createElement("p",null,"msg: ",String(this.state.error)),C.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"),C.createElement("div",{style:{display:"none"}}));return C.createElement(this.props.targetComponent,{onlyRenderChild:!0},o)}return this.props.children}}class La{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 Fa=t=>{const{node:e}=t,r=C.useMemo(()=>{const i=e.isContainer();return ne(i)?i:{placeholder:"Drag the component to place it",width:"100%",height:"100%",style:{}}},[t.node]),{placeholder:n,height:o,width:a,style:s}=r;return C.createElement("div",{style:{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",minWidth:"300px",minHeight:"50px",width:a,height:o,...s}},n)};class Cm extends C.Component{constructor(r){super(r);j(this,"instanceManager",new La);j(this,"renderRef");j(this,"dropPlaceholder",Fa);j(this,"onGetComponent",(r,n)=>{var c,l;const o=this;let a=r;const s=(l=(c=n.material)==null?void 0:c.value.advanceCustom)==null?void 0:l.wrapComponent;s&&(a=s(r,{node:n,ctx:window.__C_ENGINE_DESIGNER_PLUGIN_CTX__}));class i extends C.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}_${vt()}`);j(this,"_STATUS")}componentDidMount(){o.instanceManager.add(n.id,this)}componentWillUnmount(){this._STATUS="DESTROY",o.instanceManager.remove(n.id,this)}render(){const{children:d=[],onlyRenderChild:v,...y}=this.props;let S=d;return ee(d)||(S=[d]),!!!S.filter(Boolean).length&&(n.isContainer()||n.value.componentName===Qt.ROOT_CONTAINER)&&S.push(C.createElement(o.dropPlaceholder,{node:n})),v?S:C.createElement(a,y,...S)}}return C.forwardRef(function(p,d){return C.createElement(jm,{node:n,targetComponent:i},C.createElement(i,{ref:d,...p}))})});this.renderRef=C.createRef(),r.dropPlaceholder&&(this.dropPlaceholder=r.dropPlaceholder)}componentDidMount(){var r,n;(n=(r=this.props).onMount)==null||n.call(r,this)}getPageModel(){var r;return(r=this.renderRef.current)==null?void 0:r.state.pageModel}rerender(r){var n;return(n=this.renderRef.current)==null?void 0:n.rerender(r)}getInstancesById(r,n){let o=[...this.instanceManager.get(r)||[]];return n!==void 0&&(o=o.filter(a=>n===(a==null?void 0:a._UNIQUE_ID))),o}getInstanceByDom(r){const n=ka(r);if(!n)return null;const o=Ua(n);return(o==null?void 0:o.stateNode)||null}getDomsById(r,n){const o=this.getInstancesById(r),a=[];return o==null||o.forEach(s=>{var c;if((s==null?void 0:s._STATUS)==="DESTROY")return;const i=oi.findDOMNode(s);if(i&&!(i instanceof Text))if(n){const l=Array.from(((c=i.querySelectorAll)==null?void 0:c.call(i,n))||[]);a.push(...l)}else a.push(i)}),a}getDomRectById(r,n){return this.getDomsById(r,n).map(s=>s==null?void 0:s.getBoundingClientRect()).filter(Boolean)}render(){const{props:r,onGetComponent:n}=this,{render:o,...a}=r;return o&&(o.ref.current=this),C.createElement(Ia,{onGetComponent:n,...a,processNodeConfigHook:(s,i)=>{var y,S;if(i.nodeType!=="NODE")return s;const{props:c,condition:l}=s;let f={...c};const p=((y=i.value.configure)==null?void 0:y.devState)||{},d=(S=i.material)==null?void 0:S.value.fixedProps;if(d!==void 0){if(ne(d))f={...f,...d};else if(typeof d=="function"){const O=d(f);f={...f,...O}}}let v=l;return p.condition===!1&&(v=p.condition),{props:em(f,p.props||{}),condition:v}},ref:this.renderRef})}}const ka=t=>{if(!t)return null;const e=Object.keys(t).find(r=>r.startsWith("__reactInternalInstance$")||r.startsWith("__reactFiber$"))||"";return e?t[e]:ka(t.parentElement)},Ua=t=>{var e;return t?(e=t==null?void 0:t.stateNode)!=null&&e._DESIGN_BOX?t:Ua(t.return):null},Em=()=>{const t=C.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 Ba={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(pm,function(){var r=function(){},n={},o={},a={};function s(d,v){d=d.push?d:[d];var y=[],S=d.length,O=S,$,E,U,F;for($=function(J,tt){tt.length&&y.push(J),O--,O||v(y)};S--;){if(E=d[S],U=o[E],U){$(E,U);continue}F=a[E]=a[E]||[],F.push($)}}function i(d,v){if(d){var y=a[d];if(o[d]=v,!!y)for(;y.length;)y[0](d,v),y.splice(0,1)}}function c(d,v){d.call&&(d={success:d}),v.length?(d.error||r)(v):(d.success||r)(d)}function l(d,v,y,S){var O=document,$=y.async,E=(y.numRetries||0)+1,U=y.before||r,F=d.replace(/[\?|#].*$/,""),J=d.replace(/^(css|img|module|nomodule)!/,""),tt,Ft,R;if(S=S||0,/(^css!|\.css$)/.test(F))R=O.createElement("link"),R.rel="stylesheet",R.href=J,tt="hideFocus"in R,tt&&R.relList&&(tt=0,R.rel="preload",R.as="style");else if(/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(F))R=O.createElement("img"),R.src=J;else if(R=O.createElement("script"),R.src=J,R.async=$===void 0?!0:$,Ft="noModule"in R,/^module!/.test(F)){if(!Ft)return v(d,"l");R.type="module"}else if(/^nomodule!/.test(F)&&Ft)return v(d,"l");R.onload=R.onerror=R.onbeforeload=function(ft){var _t=ft.type[0];if(tt)try{R.sheet.cssText.length||(_t="e")}catch(ae){ae.code!=18&&(_t="e")}if(_t=="e"){if(S+=1,S<E)return l(d,v,y,S)}else if(R.rel=="preload"&&R.as=="style")return R.rel="stylesheet";v(d,_t,ft.defaultPrevented)},U(d,R)!==!1&&O.head.appendChild(R)}function f(d,v,y){d=d.push?d:[d];var S=d.length,O=S,$=[],E,U;for(E=function(F,J,tt){if(J=="e"&&$.push(F),J=="b")if(tt)$.push(F);else return;S--,S||v($)},U=0;U<O;U++)l(d[U],E,y)}function p(d,v,y){var S,O;if(v&&v.trim&&(S=v),O=(S?y:v)||{},S){if(S in n)throw"LoadJS";n[S]=!0}function $(E,U){f(d,function(F){c(O,F),E&&c({success:E,error:U},F),i(S,F)},O)}if(O.returnPromise)return new Promise($);$()}return p.ready=function(v,y){return s(v,function(S){c(y,S)}),p},p.done=function(v){i(v,[])},p.reset=function(){n={},o={},a={}},p.isDefined=function(v){return v in n},p})})(Ba);var wm=Ba.exports;const Va=hm(wm);class Tm{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(){const e=this.assets||[],r=[];for(let n=0;n<e.length;n++){const o=e[n];o.id||(o.id=vt()),r.push(o.id);const a=o.resources.map(s=>s.src);a.length&&Va(a,o.id,{async:!1,before:(s,i)=>(this.win.document.body.appendChild(i),!1)})}return new Promise((n,o)=>{if(e.length===0){this._onSuccessList.forEach(a=>a()),n("");return}Va.ready(r,{success:()=>{this._onSuccessList.forEach(a=>a()),n("")},error:a=>{this._onErrorList.forEach(s=>s(a)),o(a)}})})}onSuccess(e){return this._onSuccessList.push(e),this}onError(e){return this._onErrorList.push(e),this}}_.AssetLoader=Tm,_.ComponentInstanceManager=La,_.DefaultDropPlaceholder=Fa,_.DefineReactAdapter=Ma,_.DesignRender=Cm,_.ReactAdapter=fm,_.Render=Ia,_.canAcceptsRef=Ta,_.collectVariable=nm,_.compWrapper=$a,_.convertCodeStringToFunction=Na,_.flatObject=om,_.formatSourceStylePropertyName=un,_.getAdapter=yn,_.getCSSTextValue=ln,_.getComponentsLibs=am,_.getMatchVal=Pa,_.getObjFromArrayMap=cn,_.getThirdLibs=im,_.isClass=rm,_.runExpression=Lt,_.shouldConstruct=wa,_.useDesignRender=Em,_.useRender=Om,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})});
|
|
28
|
+
*/var Em=S,$m=Symbol.for("react.element"),Nm=Symbol.for("react.fragment"),Tm=Object.prototype.hasOwnProperty,Am=Em.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Mm={key:!0,ref:!0,__self:!0,__source:!0};function oa(t,e,r){var n,o={},a=null,s=null;r!==void 0&&(a=""+r),e.key!==void 0&&(a=""+e.key),e.ref!==void 0&&(s=e.ref);for(n in e)Tm.call(e,n)&&!Mm.hasOwnProperty(n)&&(o[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)o[n]===void 0&&(o[n]=e[n]);return{$$typeof:$m,type:t,key:a,ref:s,props:o,_owner:Am.current}}Oe.Fragment=Nm,Oe.jsx=oa,Oe.jsxs=oa,na.exports=Oe;var Pm=na.exports;const xm=Pm.jsx,ot=t=>{const e={};return t.forEach(r=>{e[r.key]=r.value}),e},Im=[...Om,...bf].reduce((t,e)=>(t[e]=({children:r,$$attributes:n=[],...o})=>{let a=r;return Array.isArray(r)||(a=[r]),S.createElement(e,{...o,...ot(n)},...a)},t),{}),Dm={RootContainer:({children:t})=>t,...Im,CContainer:({children:t,$$attributes:e=[],afterMount:r,beforeDestroy:n,...o})=>{let a=t;return Array.isArray(t)||(a=[t]),S.useEffect(()=>(r==null||r(o),()=>{n==null||n(o)}),[]),xm("div",{...o,...ot(e),children:a})},CVideo:({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),S.createElement("video",{...r,...ot(e)},...n)},CAudio:({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),S.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:s={},...i}=ot(n),c={height:r,width:e,...s,...o.style||{}};return S.createElement("div",{...o,...i,style:c},...a)},CImage:({children:t,$$attributes:e=[],...r})=>{let n=t;return Array.isArray(t)||(n=[t]),S.createElement("img",{...r,...ot(e)},...n)},CText:({$$attributes:t=[],content:e,...r})=>S.createElement("span",{...r,...ot(t)},e),CCanvas:({afterMount:t,beforeDestroy:e,$$attributes:r=[],...n})=>(S.useEffect(()=>(t==null||t(n),()=>{e==null||e(n)}),[]),S.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={},...s}=ot(e),i={...a,...n.style||{}};return S.createElement(r,{...n,...s,style:i},...o)}};class Rm{constructor(){b(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()}}class aa extends S.Component{constructor(r){super(r);b(this,"refManager");b(this,"dynamicComponentInstanceMap",new Map);b(this,"onGetRef",(r,n,o)=>{var a,s;(s=(a=this.props).onGetRef)==null||s.call(a,r,n,o),this.dynamicComponentInstanceMap.set(n.id,o),this.refManager.add(n.value.refId||n.id,r)});b(this,"rerender",r=>{if(this.props.adapter.clear(),(r==null?void 0:r.nodeType)==="PAGE"&&r)this.setState({pageModel:r});else if(Rt(r)&&io(r)){const n=r;this.setState({pageModel:new ge(n,{materials:this.state.pageModel.materialsModel.rawValue})})}});this.state={pageModel:r.pageModel||new ge(r.page)},this.refManager=new Rm}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:s}=r,{pageModel:i}=this.state;if(!i)return console.warn("pageModel is null"),null;const c={...Dm,...r.components},u=this.props.$$context??{};return u.refs=this.refManager,n.pageRender(i,{libs:{},components:c,onGetRef:this.onGetRef,onGetComponent:o,onComponentMount:s,onComponentDestroy:a,$$context:u,renderMode:r.renderMode,processNodeConfigHook:r.processNodeConfigHook})}}const Lm=()=>{const t=S.useRef(null);return{ref:t,rerender:function(...e){t.current&&t.current.rerender(...e)}}};class Fm extends S.Component{constructor(r){super(r);b(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=S.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,S.createElement("p",null,"msg: ",String(this.state.error)),S.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"),S.createElement("div",{style:{display:"none"}}));return S.createElement(this.props.targetComponent,{onlyRenderChild:!0},o)}return this.props.children}}class ia{constructor(){b(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 sa=t=>{const{node:e}=t,r=S.useMemo(()=>{const i=e.isContainer();return Rt(i)?i:{placeholder:"Drag the component to place it",width:"100%",height:"100%",style:{}}},[t.node]),{placeholder:n,height:o,width:a,style:s}=r;return S.createElement("div",{style:{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",minWidth:"300px",minHeight:"50px",width:a,height:o,...s}},n)};class Bm extends S.Component{constructor(r){super(r);b(this,"instanceManager",new ia);b(this,"renderRef");b(this,"dropPlaceholder",sa);b(this,"onGetComponent",(r,n)=>{var c,u;const o=this;let a=r;const s=(u=(c=n.material)==null?void 0:c.value.advanceCustom)==null?void 0:u.wrapComponent;s&&(a=s(r,{node:n,ctx:window.__C_ENGINE_DESIGNER_PLUGIN_CTX__}));class i extends S.Component{constructor(){super(...arguments);b(this,"_DESIGN_BOX",!0);b(this,"_NODE_MODEL",n);b(this,"_NODE_ID",n.id);b(this,"_UNIQUE_ID",`${n.id}_${X()}`);b(this,"_STATUS")}componentDidMount(){o.instanceManager.add(n.id,this)}componentWillUnmount(){this._STATUS="DESTROY",o.instanceManager.remove(n.id,this)}render(){const{children:f=[],onlyRenderChild:p,...v}=this.props;let y=f;return It(f)||(y=[f]),!!!y.filter(Boolean).length&&(n.isContainer()||n.value.componentName===Tt.ROOT_CONTAINER)&&y.push(S.createElement(o.dropPlaceholder,{node:n})),p?y:S.createElement(a,v,...y)}}return S.forwardRef(function(d,f){return S.createElement(Fm,{node:n,targetComponent:i},S.createElement(i,{ref:f,...d}))})});this.renderRef=S.createRef(),r.dropPlaceholder&&(this.dropPlaceholder=r.dropPlaceholder)}componentDidMount(){var r,n;(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=ca(r);if(!n)return null;const o=ua(n);return(o==null?void 0:o.stateNode)||null}getDomsById(r,n){const o=this.getInstancesById(r),a=[];return o==null||o.forEach(s=>{var c;if((s==null?void 0:s._STATUS)==="DESTROY")return;const i=ma.findDOMNode(s);if(i&&!(i instanceof Text))if(n){const u=Array.from(((c=i.querySelectorAll)==null?void 0:c.call(i,n))||[]);a.push(...u)}else a.push(i)}),a}getDomRectById(r,n){return this.getDomsById(r,n).map(s=>s==null?void 0:s.getBoundingClientRect()).filter(Boolean)}render(){const{props:r,onGetComponent:n}=this,{render:o,...a}=r;return o&&(o.ref.current=this),S.createElement(aa,{onGetComponent:n,...a,processNodeConfigHook:(s,i)=>{var v,y;if(i.nodeType!=="NODE")return s;const{props:c,condition:u}=s;let l={...c};const d=((v=i.value.configure)==null?void 0:v.devState)||{},f=(y=i.material)==null?void 0:y.value.fixedProps;if(f!==void 0){if(Rt(f))l={...l,...f};else if(typeof f=="function"){const _=f(l);l={...l,..._}}}let p=u;return d.condition===!1&&(p=d.condition),{props:dm(l,d.props||{}),condition:p}},ref:this.renderRef})}}const ca=t=>{if(!t)return null;const e=Object.keys(t).find(r=>r.startsWith("__reactInternalInstance$")||r.startsWith("__reactFiber$"))||"";return e?t[e]:ca(t.parentElement)},ua=t=>{var e;return t?(e=t==null?void 0:t.stateNode)!=null&&e._DESIGN_BOX?t:ua(t.return):null},Um=()=>{const t=S.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 la={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(wm,function(){var r=function(){},n={},o={},a={};function s(f,p){f=f.push?f:[f];var v=[],y=f.length,_=y,O,w,x,M;for(O=function(L,G){G.length&&v.push(L),_--,_||p(v)};y--;){if(w=f[y],x=o[w],x){O(w,x);continue}M=a[w]=a[w]||[],M.push(O)}}function i(f,p){if(f){var v=a[f];if(o[f]=p,!!v)for(;v.length;)v[0](f,p),v.splice(0,1)}}function c(f,p){f.call&&(f={success:f}),p.length?(f.error||r)(p):(f.success||r)(f)}function u(f,p,v,y){var _=document,O=v.async,w=(v.numRetries||0)+1,x=v.before||r,M=f.replace(/[\?|#].*$/,""),L=f.replace(/^(css|img|module|nomodule)!/,""),G,ne,E;if(y=y||0,/(^css!|\.css$)/.test(M))E=_.createElement("link"),E.rel="stylesheet",E.href=L,G="hideFocus"in E,G&&E.relList&&(G=0,E.rel="preload",E.as="style");else if(/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(M))E=_.createElement("img"),E.src=L;else if(E=_.createElement("script"),E.src=L,E.async=O===void 0?!0:O,ne="noModule"in E,/^module!/.test(M)){if(!ne)return p(f,"l");E.type="module"}else if(/^nomodule!/.test(M)&&ne)return p(f,"l");E.onload=E.onerror=E.onbeforeload=function(st){var bt=st.type[0];if(G)try{E.sheet.cssText.length||(bt="e")}catch(we){we.code!=18&&(bt="e")}if(bt=="e"){if(y+=1,y<w)return u(f,p,v,y)}else if(E.rel=="preload"&&E.as=="style")return E.rel="stylesheet";p(f,bt,st.defaultPrevented)},x(f,E)!==!1&&_.head.appendChild(E)}function l(f,p,v){f=f.push?f:[f];var y=f.length,_=y,O=[],w,x;for(w=function(M,L,G){if(L=="e"&&O.push(M),L=="b")if(G)O.push(M);else return;y--,y||p(O)},x=0;x<_;x++)u(f[x],w,v)}function d(f,p,v){var y,_;if(p&&p.trim&&(y=p),_=(y?v:p)||{},y){if(y in n)throw"LoadJS";n[y]=!0}function O(w,x){l(f,function(M){c(_,M),w&&c({success:w,error:x},M),i(y,M)},_)}if(_.returnPromise)return new Promise(O);O()}return d.ready=function(p,v){return s(p,function(y){c(v,y)}),d},d.done=function(p){i(p,[])},d.reset=function(){n={},o={},a={}},d.isDefined=function(p){return p in n},d})})(la);var km=la.exports;const fa=Cm(km);class Vm{constructor(e,r){b(this,"assets");b(this,"loadStatus");b(this,"win",window);b(this,"_onSuccessList",[]);b(this,"_onErrorList",[]);this.assets=JSON.parse(JSON.stringify(e||[])),this.loadStatus="INIT",r!=null&&r.window&&(this.win=r.window)}load(){const e=this.assets||[],r=[];for(let n=0;n<e.length;n++){const o=e[n];o.id||(o.id=X()),r.push(o.id);const a=o.resources.map(s=>s.src);a.length&&fa(a,o.id,{async:!1,before:(s,i)=>(this.win.document.body.appendChild(i),!1)})}return new Promise((n,o)=>{if(e.length===0){this._onSuccessList.forEach(a=>a()),n("");return}fa.ready(r,{success:()=>{this._onSuccessList.forEach(a=>a()),n("")},error:a=>{this._onErrorList.forEach(s=>s(a)),o(a)}})})}onSuccess(e){return this._onSuccessList.push(e),this}onError(e){return this._onErrorList.push(e),this}}g.AssetLoader=Vm,g.ComponentInstanceManager=ia,g.DefaultDropPlaceholder=sa,g.DefineReactAdapter=ra,g.DesignRender=Bm,g.ReactAdapter=jm,g.Render=aa,g.canAcceptsRef=Yo,g.collectVariable=hm,g.compWrapper=Ko,g.convertCodeStringToFunction=Xo,g.flatObject=mm,g.formatSourceStylePropertyName=xr,g.getAdapter=Ur,g.getCSSTextValue=Ir,g.getComponentsLibs=vm,g.getMatchVal=Zo,g.getObjFromArrayMap=Pr,g.getThirdLibs=gm,g.isClass=pm,g.runExpression=yt,g.shouldConstruct=qo,g.useDesignRender=Um,g.useRender=Lm,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
|
|
47
29
|
//# sourceMappingURL=index.umd.js.map
|