@chamn/render 0.0.19 → 0.0.20

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