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