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