@chamn/render 0.0.33 → 0.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
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},xr=t=>{const{data:e,message:r,throwError:n,dataStruct:o}=t;return Pf(({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 Rf=w({type:L(V.FUNCTION),value:v()}),Df=Er(_o(Ot,["componentName"]),w({componentName:L("RootContainer")}));function If(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=If(),Lf=(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 wt{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=Lf(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 wo=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,...wo(n.content)]):e.push(r)}),e},qe=(t,e,r)=>{if(t.type)return t.type===V.SLOT?new wt(t,{parent:e,materials:r}):t;if(B(t)){const n={};return Object.keys(t).forEach(o=>{n[o]=Ye(t[o],e,r)}),n}else return Array.isArray(t)?t.map(n=>qe(n,e,r)):t},Ye=(t,e,r)=>B(t)?qe(t,e,r):R(t)?t.map(n=>qe(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=Ye(r,this,o)}isIncludeSlot(){return!1}isIncludeExpression(){return!1}get value(){return this.data}updateValue(e){const r=this.data;this.data=Ye(e??r,this,this.materialsMode),this.emitter.emit("onPropChange",{value:this.data,preValue:r,node:this}),this.parent&&!(this.parent instanceof wt)&&this.emitter.emit("onNodeChange",{value:this.parent.value,preValue:this.parent.value,node:this.parent})}get material(){const e=this.parent;if(e instanceof M){const r=e.material;return wo((r==null?void 0:r.value.props)||[]).find(n=>n.name===this.name)}else return null}export(e){const r=this.data,n=o=>{if(o instanceof at||o instanceof wt||o instanceof 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 Ff=t=>{if(typeof t=="string")return!0;xr({data:t,dataStruct:Ot,throwError:!1})},gn=(t,e,r=new dt([]))=>{if(typeof t=="string")return t;const n={...t,id:t.id??Z(),children:[],props:{},methods:t.methods||[],configure: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(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)),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=gn(e,this,n),this.listenerHandle=[],this.onChangeCbQueue=[],this.registerListener()}registerListener(){const e=r=>{const{node:n}=r;n===this&&n.id===this.id&&this.onChangeCbQueue.forEach(o=>o(r))};this.emitter.on("onNodeChange",e),this.listenerHandle.push(()=>{this.emitter.off("onNodeChange",e)})}onChange(e){return this.onChangeCbQueue.push(e),()=>{this.onChangeCbQueue=this.onChangeCbQueue.filter(r=>r!==e)}}destroy(){this.listenerHandle.forEach(e=>e())}get id(){return this.data.id}get value(){return this.data}clone(e){const r={...this.export("design"),id:e||Z()};return new M(r,{materials:this.materialsModel})}updateWithPlainObj(e){const r={...this.data,...e};return this.data=gn(r,this),r}updateValue(e){const r=this.data,n=this.updateWithPlainObj(e);this.emitter.emit("onNodeChange",{value:n,preValue:r,node:this})}contains(e){return Ar(this,e)}get props(){return this.data.props}get material(){const e=this.materialsModel;return e==null?void 0:e.findByComponentName(this.data.componentName)}getPlainProps(){const e=this.data,r={};return Object.keys(e.props||{}).forEach(n=>{r[n]=e.props[n].export("design")}),r}getMaterialConfig(e){var r;return this.data.configure[e]!==void 0?this.data.configure.isContainer:(r=this.material)==null?void 0:r.value.isContainer}isContainer(){return this.getMaterialConfig("isContainer")}export(e){var r;const n=this.data;if(typeof n=="string")return n;const o={};Object.keys(n.props||{}).forEach(l=>{o[l]=n.props[l].export(e)});const a=(r=n.children)==null?void 0:r.map(l=>l instanceof 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=Mr(u),u}}const yn=(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: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=yn(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=yn(r,this,this.materialsModel),r}updateValue(e){const r=this.data;this.updateWithPlainObj(e),this.emitter.emit("onNodeChange",{value:this.data,preValue:r,node:this})}contains(e){return Ar(this,e)}getMaterialConfig(e){var r;return this.data.configure[e]!==void 0?this.data.configure.isContainer:(r=this.material)==null?void 0:r.value.isContainer}isContainer(){return this.getMaterialConfig("isContainer")}export(e=Nr.SAVE){var r;const n=this.data,o={};Object.keys(n.props||{}).forEach(c=>{o[c]=n.props[c].export(e)});const a=((r=n.children)==null?void 0:r.map(c=>{var u;return(u=c==null?void 0:c.export)==null?void 0:u.call(c,e)}))||[],i={...n,props:o,children:a.filter(c=>c),condition:n.condition};let s=go(i,["id"]);return s=Mr(s),s}getPlainProps(){const e=this.data,r={};return Object.keys(e.props||{}).forEach(n=>{r[n]=e.props[n].export("design")}),r}destroy(){this.listenerHandle.forEach(e=>e())}clone(e){const r={...this.export("design"),id:e||Z()};return new Zt(r,{materials:this.materialsModel,parent:null})}}const ct=t=>(t==null?void 0:t.type)===V.EXPRESSION,Bf=t=>(t==null?void 0:t.type)===V.FUNCTION,Z=()=>Math.random().toString(32).slice(3,9),Uf=t=>(t==null?void 0:t.nodeType)==="NODE",De=t=>(t==null?void 0:t.nodeType)==="PROP",kf=t=>(t==null?void 0:t.nodeType)==="SLOT",Mr=t=>cf(t,e=>B(e)?!Object.keys(e).length:R(e)?!e.length:!e);function Vf(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 wt&&a(s.value.value),s instanceof at){a(s.value);return}if(B(s)){const c=s;Object.keys(c).forEach(u=>{a(c[u])});return}if(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 Ar(t,e){return Vf(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 Gf{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 bn=t=>{if(!R(t))throw new Error("Materials must be a array");return t.map(e=>new Gf(e))},Hf=t=>{t==null||t.forEach(e=>{xr({data:e,dataStruct:Af,throwError:!1})})};class dt{constructor(e){_(this,"rawData"),_(this,"data"),_(this,"usedMaterials",[]),this.rawData=e,Hf(e),this.data=bn(e)}addMaterials(e){const r=bn(e);this.data.push(...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 Wf=w({version:v(),name:v(),css:m(v()),renderType:m(F([L("COMPONENT"),L("PAGE")])),loadType:m(x()),lifecycle:m(x()),props:m(x()),methods:m(P(Rf)),componentsMeta:P(Er(w({componentName:v()}),$r)),thirdLibs:m(wf),componentsTree:Df,assets:m(P(x()))}),Co=t=>(xr({data:t,dataStruct:Wf,throwError:!1}),t),Ie=(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"),Co(e),this.rawData=JSON.parse(JSON.stringify(e)),this.materialsModel=new dt((r==null?void 0:r.materials)||[]),this.data=Ie(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=Ie(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=Ie(e,this,this.materialsModel),this.emitter.emit("onReloadPage",{value:this.data,preValue:r,node:this})}get value(){return this.data}getNode(e){if(!e)return;const r=this.data.componentsTree;return Ar(r,e)}addNode(e,r,n="AFTER"){var o;if(n==="AFTER"||n==="BEFORE"){const a=r.parent;if(a===null&&r instanceof 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 wt){const s=a.value.value,c=s.findIndex(u=>u===r)??-1;return c>=0?(n==="BEFORE"?s.splice(c,0,e):s.splice(c+1,0,e),e.parent=a,(o=a.parent)==null||o.updateValue(),!0):!1}if(a instanceof 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 wt){const o=n.value.value,a=o.findIndex(s=>s===e),i=o[a];return o.splice(a,1),(r=n.parent)==null||r.updateValue(),i}if(n instanceof 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=Nr.SAVE){var r;const n=this.data.componentsTree.export(e),o=this.assetPackagesList,a=[],i=this.materialsModel.usedMaterials.map(c=>{const u=o.find(l=>{var p;return l.package===((p=c.value.npm)==null?void 0:p.package)});return u&&a.push(u),{componentName:c.componentName,...co(c.value.npm||{})}}).filter(c=>!!(c.componentName&&c.package&&c.version));this.materialsModel.usedMaterials=[];let s={...this.data,componentsTree:Mr(n),componentsMeta:i,thirdLibs:this.data.thirdLibs,assets:[]};return(r=this.data.thirdLibs)==null||r.forEach(c=>{const u=o.find(l=>c.package===l.package);u&&a.push(u)}),s.assets=mf(a,c=>c.package),s=go(s,["id"]),JSON.parse(JSON.stringify(s))}getRootNode(){return this.data.componentsTree}}At.ROOT_CONTAINER;var Jf=typeof global=="object"&&global&&global.Object===Object&&global;const Eo=Jf;var Qf=typeof self=="object"&&self&&self.Object===Object&&self,qf=Eo||Qf||Function("return this")();const Pt=qf;var Yf=Pt.Symbol;const Ct=Yf;var $o=Object.prototype,Kf=$o.hasOwnProperty,Xf=$o.toString,Vt=Ct?Ct.toStringTag:void 0;function Zf(t){var e=Kf.call(t,Vt),r=t[Vt];try{t[Vt]=void 0;var n=!0}catch{}var o=Xf.call(t);return n&&(e?t[Vt]=r:delete t[Vt]),o}var tp=Object.prototype,ep=tp.toString;function rp(t){return ep.call(t)}var np="[object Null]",op="[object Undefined]",_n=Ct?Ct.toStringTag:void 0;function oe(t){return t==null?t===void 0?op:np:_n&&_n in Object(t)?Zf(t):rp(t)}function Rt(t){return t!=null&&typeof t=="object"}var ap="[object Symbol]";function sp(t){return typeof t=="symbol"||Rt(t)&&oe(t)==ap}function ip(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 cp=Array.isArray;const Et=cp;var up=1/0,Sn=Ct?Ct.prototype:void 0,jn=Sn?Sn.toString:void 0;function No(t){if(typeof t=="string")return t;if(Et(t))return ip(t,No)+"";if(sp(t))return jn?jn.call(t):"";var e=t+"";return e=="0"&&1/t==-up?"-0":e}function yt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function To(t){return t}var lp="[object AsyncFunction]",fp="[object Function]",pp="[object GeneratorFunction]",dp="[object Proxy]";function Pr(t){if(!yt(t))return!1;var e=oe(t);return e==fp||e==pp||e==lp||e==dp}var hp=Pt["__core-js_shared__"];const Le=hp;var On=function(){var t=/[^.]+$/.exec(Le&&Le.keys&&Le.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function mp(t){return!!On&&On in t}var vp=Function.prototype,gp=vp.toString;function yp(t){if(t!=null){try{return gp.call(t)}catch{}try{return t+""}catch{}}return""}var bp=/[\\^$.*+?()[\]{}|]/g,_p=/^\[object .+?Constructor\]$/,Sp=Function.prototype,jp=Object.prototype,Op=Sp.toString,wp=jp.hasOwnProperty,Cp=RegExp("^"+Op.call(wp).replace(bp,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ep(t){if(!yt(t)||mp(t))return!1;var e=Pr(t)?Cp:_p;return e.test(yp(t))}function $p(t,e){return t==null?void 0:t[e]}function Rr(t,e){var r=$p(t,e);return Ep(r)?r:void 0}var wn=Object.create,Np=function(){function t(){}return function(e){if(!yt(e))return{};if(wn)return wn(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();const Tp=Np;function xp(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 Mp(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var Ap=800,Pp=16,Rp=Date.now;function Dp(t){var e=0,r=0;return function(){var n=Rp(),o=Pp-(n-r);if(r=n,o>0){if(++e>=Ap)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Ip(t){return function(){return t}}var Lp=function(){try{var t=Rr(Object,"defineProperty");return t({},"",{}),t}catch{}}();const me=Lp;var Fp=me?function(t,e){return me(t,"toString",{configurable:!0,enumerable:!1,value:Ip(e),writable:!0})}:To;const Bp=Fp;var Up=Dp(Bp);const kp=Up;var Vp=9007199254740991,zp=/^(?:0|[1-9]\d*)$/;function xo(t,e){var r=typeof t;return e=e??Vp,!!e&&(r=="number"||r!="symbol"&&zp.test(t))&&t>-1&&t%1==0&&t<e}function Dr(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 Gp=Object.prototype,Hp=Gp.hasOwnProperty;function Wp(t,e,r){var n=t[e];(!(Hp.call(t,e)&&Oe(n,r))||r===void 0&&!(e in t))&&Dr(t,e,r)}function Jp(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?Dr(r,s,c):Wp(r,s,c)}return r}var Cn=Math.max;function Qp(t,e,r){return e=Cn(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=Cn(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),xp(t,this,s)}}function qp(t,e){return kp(Qp(t,e,To),t+"")}var Yp=9007199254740991;function Mo(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Yp}function Ir(t){return t!=null&&Mo(t.length)&&!Pr(t)}function Kp(t,e,r){if(!yt(r))return!1;var n=typeof e;return(n=="number"?Ir(r)&&xo(e,r.length):n=="string"&&e in r)?Oe(r[e],t):!1}function Xp(t){return qp(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&&Kp(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 Zp=Object.prototype;function Ao(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Zp;return t===r}function td(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var ed="[object Arguments]";function En(t){return Rt(t)&&oe(t)==ed}var Po=Object.prototype,rd=Po.hasOwnProperty,nd=Po.propertyIsEnumerable,od=En(function(){return arguments}())?En:function(t){return Rt(t)&&rd.call(t,"callee")&&!nd.call(t,"callee")};const Ke=od;function ad(){return!1}var Ro=typeof exports=="object"&&exports&&!exports.nodeType&&exports,$n=Ro&&typeof module=="object"&&module&&!module.nodeType&&module,sd=$n&&$n.exports===Ro,Nn=sd?Pt.Buffer:void 0,id=Nn?Nn.isBuffer:void 0,cd=id||ad;const Do=cd;var ud="[object Arguments]",ld="[object Array]",fd="[object Boolean]",pd="[object Date]",dd="[object Error]",hd="[object Function]",md="[object Map]",vd="[object Number]",gd="[object Object]",yd="[object RegExp]",bd="[object Set]",_d="[object String]",Sd="[object WeakMap]",jd="[object ArrayBuffer]",Od="[object DataView]",wd="[object Float32Array]",Cd="[object Float64Array]",Ed="[object Int8Array]",$d="[object Int16Array]",Nd="[object Int32Array]",Td="[object Uint8Array]",xd="[object Uint8ClampedArray]",Md="[object Uint16Array]",Ad="[object Uint32Array]",N={};N[wd]=N[Cd]=N[Ed]=N[$d]=N[Nd]=N[Td]=N[xd]=N[Md]=N[Ad]=!0;N[ud]=N[ld]=N[jd]=N[fd]=N[Od]=N[pd]=N[dd]=N[hd]=N[md]=N[vd]=N[gd]=N[yd]=N[bd]=N[_d]=N[Sd]=!1;function Pd(t){return Rt(t)&&Mo(t.length)&&!!N[oe(t)]}function Rd(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,Dd=Wt&&Wt.exports===Io,Fe=Dd&&Eo.process,Id=function(){try{var t=Wt&&Wt.require&&Wt.require("util").types;return t||Fe&&Fe.binding&&Fe.binding("util")}catch{}}();const Tn=Id;var xn=Tn&&Tn.isTypedArray,Ld=xn?Rd(xn):Pd;const Lo=Ld;var Fd=Object.prototype,Bd=Fd.hasOwnProperty;function Ud(t,e){var r=Et(t),n=!r&&Ke(t),o=!r&&!n&&Do(t),a=!r&&!n&&!o&&Lo(t),i=r||n||o||a,s=i?td(t.length,String):[],c=s.length;for(var u in t)(e||Bd.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 kd(t,e){return function(r){return t(e(r))}}function Vd(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var zd=Object.prototype,Gd=zd.hasOwnProperty;function Hd(t){if(!yt(t))return Vd(t);var e=Ao(t),r=[];for(var n in t)n=="constructor"&&(e||!Gd.call(t,n))||r.push(n);return r}function Fo(t){return Ir(t)?Ud(t,!0):Hd(t)}var Wd=Rr(Object,"create");const te=Wd;function Jd(){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 qd="__lodash_hash_undefined__",Yd=Object.prototype,Kd=Yd.hasOwnProperty;function Xd(t){var e=this.__data__;if(te){var r=e[t];return r===qd?void 0:r}return Kd.call(e,t)?e[t]:void 0}var Zd=Object.prototype,th=Zd.hasOwnProperty;function eh(t){var e=this.__data__;return te?e[t]!==void 0:th.call(e,t)}var rh="__lodash_hash_undefined__";function nh(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=te&&e===void 0?rh: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=Jd;ht.prototype.delete=Qd;ht.prototype.get=Xd;ht.prototype.has=eh;ht.prototype.set=nh;function oh(){this.__data__=[],this.size=0}function we(t,e){for(var r=t.length;r--;)if(Oe(t[r][0],e))return r;return-1}var ah=Array.prototype,sh=ah.splice;function ih(t){var e=this.__data__,r=we(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():sh.call(e,r,1),--this.size,!0}function ch(t){var e=this.__data__,r=we(e,t);return r<0?void 0:e[r][1]}function uh(t){return we(this.__data__,t)>-1}function lh(t,e){var r=this.__data__,n=we(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=oh;rt.prototype.delete=ih;rt.prototype.get=ch;rt.prototype.has=uh;rt.prototype.set=lh;var fh=Rr(Pt,"Map");const Bo=fh;function ph(){this.size=0,this.__data__={hash:new ht,map:new(Bo||rt),string:new ht}}function dh(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Ce(t,e){var r=t.__data__;return dh(e)?r[typeof e=="string"?"string":"hash"]:r.map}function hh(t){var e=Ce(this,t).delete(t);return this.size-=e?1:0,e}function mh(t){return Ce(this,t).get(t)}function vh(t){return Ce(this,t).has(t)}function gh(t,e){var r=Ce(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=ph;Dt.prototype.delete=hh;Dt.prototype.get=mh;Dt.prototype.has=vh;Dt.prototype.set=gh;function Uo(t){return t==null?"":No(t)}var yh=kd(Object.getPrototypeOf,Object);const ko=yh;var bh="[object Object]",_h=Function.prototype,Sh=Object.prototype,Vo=_h.toString,jh=Sh.hasOwnProperty,Oh=Vo.call(Object);function $t(t){if(!Rt(t)||oe(t)!=bh)return!1;var e=ko(t);if(e===null)return!0;var r=jh.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Vo.call(r)==Oh}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 Ch(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",$h="\\u0300-\\u036f",Nh="\\ufe20-\\ufe2f",Th="\\u20d0-\\u20ff",xh=$h+Nh+Th,Mh="\\ufe0e\\ufe0f",Ah="\\u200d",Ph=RegExp("["+Ah+Eh+xh+Mh+"]");function zo(t){return Ph.test(t)}function Rh(t){return t.split("")}var Go="\\ud800-\\udfff",Dh="\\u0300-\\u036f",Ih="\\ufe20-\\ufe2f",Lh="\\u20d0-\\u20ff",Fh=Dh+Ih+Lh,Bh="\\ufe0e\\ufe0f",Uh="["+Go+"]",Xe="["+Fh+"]",Ze="\\ud83c[\\udffb-\\udfff]",kh="(?:"+Xe+"|"+Ze+")",Ho="[^"+Go+"]",Wo="(?:\\ud83c[\\udde6-\\uddff]){2}",Jo="[\\ud800-\\udbff][\\udc00-\\udfff]",Vh="\\u200d",Qo=kh+"?",qo="["+Bh+"]?",zh="(?:"+Vh+"(?:"+[Ho,Wo,Jo].join("|")+")"+qo+Qo+")*",Gh=qo+Qo+zh,Hh="(?:"+[Ho+Xe+"?",Xe,Wo,Jo,Uh].join("|")+")",Wh=RegExp(Ze+"(?="+Ze+")|"+Hh+Gh,"g");function Jh(t){return t.match(Wh)||[]}function Qh(t){return zo(t)?Jh(t):Rh(t)}function qh(t){return function(e){e=Uo(e);var r=zo(e)?Qh(e):void 0,n=r?r[0]:e.charAt(0),o=r?Ch(r,1).join(""):e.slice(1);return n[t]()+o}}var Yh=qh("toUpperCase");const Kh=Yh;function Xh(t){return Kh(Uo(t).toLowerCase())}function Zh(){this.__data__=new rt,this.size=0}function tm(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function em(t){return this.__data__.get(t)}function rm(t){return this.__data__.has(t)}var nm=200;function om(t,e){var r=this.__data__;if(r instanceof rt){var n=r.__data__;if(!Bo||n.length<nm-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=Zh;It.prototype.delete=tm;It.prototype.get=em;It.prototype.has=rm;It.prototype.set=om;var Yo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Mn=Yo&&typeof module=="object"&&module&&!module.nodeType&&module,am=Mn&&Mn.exports===Yo,An=am?Pt.Buffer:void 0,Pn=An?An.allocUnsafe:void 0;function sm(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 im=Pt.Uint8Array;const Rn=im;function cm(t){var e=new t.constructor(t.byteLength);return new Rn(e).set(new Rn(t)),e}function um(t,e){var r=e?cm(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function lm(t){return typeof t.constructor=="function"&&!Ao(t)?Tp(ko(t)):{}}function fm(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 pm=fm();const dm=pm;function tr(t,e,r){(r!==void 0&&!Oe(t[e],r)||r===void 0&&!(e in t))&&Dr(t,e,r)}function hm(t){return Rt(t)&&Ir(t)}function er(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function mm(t){return Jp(t,Fo(t))}function vm(t,e,r,n,o,a,i){var s=er(t,r),c=er(e,r),u=i.get(c);if(u){tr(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:hm(s)?l=Mp(s):d?(p=!1,l=sm(c,!0)):h?(p=!1,l=um(c,!0)):l=[]:$t(c)||Ke(c)?(l=s,Ke(s)?l=mm(s):(!yt(s)||Pr(s))&&(l=lm(c))):p=!1}p&&(i.set(c,l),o(l,c,n,a,i),i.delete(c)),tr(t,r,l)}function Ko(t,e,r,n,o){t!==e&&dm(e,function(a,i){if(o||(o=new It),yt(a))vm(t,e,i,r,Ko,n,o);else{var s=n?n(er(t,i),a,i+"",t,e,o):void 0;s===void 0&&(s=a),tr(t,i,s)}},Fo)}var gm=Xp(function(t,e,r){Ko(t,e,r)});const ym=gm,bm=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 Rf=w({type:L(V.FUNCTION),value:v()}),Df=Er(_o(Ot,["componentName"]),w({componentName:L("RootContainer")}));function If(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=If(),Lf=(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 wt{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=Lf(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 wo=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,...wo(n.content)]):e.push(r)}),e},qe=(t,e,r)=>{if(t.type)return t.type===V.SLOT?new wt(t,{parent:e,materials:r}):t;if(B(t)){const n={};return Object.keys(t).forEach(o=>{n[o]=Ye(t[o],e,r)}),n}else return Array.isArray(t)?t.map(n=>qe(n,e,r)):t},Ye=(t,e,r)=>B(t)?qe(t,e,r):R(t)?t.map(n=>qe(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=Ye(r,this,o)}isIncludeSlot(){return!1}isIncludeExpression(){return!1}get value(){return this.data}updateValue(e){const r=this.data;this.data=Ye(e??r,this,this.materialsMode),this.emitter.emit("onPropChange",{value:this.data,preValue:r,node:this}),this.parent&&!(this.parent instanceof wt)&&this.emitter.emit("onNodeChange",{value:this.parent.value,preValue:this.parent.value,node:this.parent})}get material(){const e=this.parent;if(e instanceof M){const r=e.material;return wo((r==null?void 0:r.value.props)||[]).find(n=>n.name===this.name)}else return null}export(e){const r=this.data,n=o=>{if(o instanceof at||o instanceof wt||o instanceof 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 Ff=t=>{if(typeof t=="string")return!0;xr({data:t,dataStruct:Ot,throwError:!1})},gn=(t,e,r=new dt([]))=>{if(typeof t=="string")return t;const n={...t,id:t.id??Z(),children:[],props:{},methods:t.methods||[],configure: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(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)),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=gn(e,this,n),this.listenerHandle=[],this.onChangeCbQueue=[],this.registerListener()}registerListener(){const e=r=>{const{node:n}=r;n===this&&n.id===this.id&&this.onChangeCbQueue.forEach(o=>o(r))};this.emitter.on("onNodeChange",e),this.listenerHandle.push(()=>{this.emitter.off("onNodeChange",e)})}onChange(e){return this.onChangeCbQueue.push(e),()=>{this.onChangeCbQueue=this.onChangeCbQueue.filter(r=>r!==e)}}destroy(){this.listenerHandle.forEach(e=>e())}get id(){return this.data.id}get value(){return this.data}clone(e){const r={...this.export("design"),id:e||Z()};return new M(r,{materials:this.materialsModel})}updateWithPlainObj(e){const r={...this.data,...e};return this.data=gn(r,this),r}updateValue(e){const r=this.data,n=this.updateWithPlainObj(e);this.emitter.emit("onNodeChange",{value:n,preValue:r,node:this})}contains(e){return Ar(this,e)}get props(){return this.data.props}get material(){const e=this.materialsModel;return e==null?void 0:e.findByComponentName(this.data.componentName)}getPlainProps(){const e=this.data,r={};return Object.keys(e.props||{}).forEach(n=>{r[n]=e.props[n].export("design")}),r}getMaterialConfig(e){var r;return this.data.configure[e]!==void 0?this.data.configure.isContainer:(r=this.material)==null?void 0:r.value.isContainer}isContainer(){return this.getMaterialConfig("isContainer")}export(e){var r;const n=this.data;if(typeof n=="string")return n;const o={};Object.keys(n.props||{}).forEach(l=>{o[l]=n.props[l].export(e)});const a=(r=n.children)==null?void 0:r.map(l=>l instanceof 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=Mr(u),u}}const yn=(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: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=yn(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=yn(r,this,this.materialsModel),r}updateValue(e){const r=this.data;this.updateWithPlainObj(e),this.emitter.emit("onNodeChange",{value:this.data,preValue:r,node:this})}contains(e){return Ar(this,e)}getMaterialConfig(e){var r;return this.data.configure[e]!==void 0?this.data.configure.isContainer:(r=this.material)==null?void 0:r.value.isContainer}isContainer(){return this.getMaterialConfig("isContainer")}export(e=Nr.SAVE){var r;const n=this.data,o={};Object.keys(n.props||{}).forEach(c=>{o[c]=n.props[c].export(e)});const a=((r=n.children)==null?void 0:r.map(c=>{var u;return(u=c==null?void 0:c.export)==null?void 0:u.call(c,e)}))||[],i={...n,props:o,children:a.filter(c=>c),condition:n.condition};let s=go(i,["id"]);return s=Mr(s),s}getPlainProps(){const e=this.data,r={};return Object.keys(e.props||{}).forEach(n=>{r[n]=e.props[n].export("design")}),r}destroy(){this.listenerHandle.forEach(e=>e())}clone(e){const r={...this.export("design"),id:e||Z()};return new Zt(r,{materials:this.materialsModel,parent:null})}}const ct=t=>(t==null?void 0:t.type)===V.EXPRESSION,Bf=t=>(t==null?void 0:t.type)===V.FUNCTION,Z=()=>Math.random().toString(32).slice(3,9),Uf=t=>(t==null?void 0:t.nodeType)==="NODE",De=t=>(t==null?void 0:t.nodeType)==="PROP",kf=t=>(t==null?void 0:t.nodeType)==="SLOT",Mr=t=>cf(t,e=>B(e)?!Object.keys(e).length:R(e)?!e.length:!e);function Vf(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 wt&&a(s.value.value),s instanceof at){a(s.value);return}if(B(s)){const c=s;Object.keys(c).forEach(u=>{a(c[u])});return}if(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 Ar(t,e){return Vf(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 Gf{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 bn=t=>{if(!R(t))throw new Error("Materials must be a array");return t.map(e=>new Gf(e))},Hf=t=>{t==null||t.forEach(e=>{xr({data:e,dataStruct:Af,throwError:!1})})};class dt{constructor(e){_(this,"rawData"),_(this,"data"),_(this,"usedMaterials",[]),this.rawData=e,Hf(e),this.data=bn(e)}addMaterials(e){const r=bn(e);this.data.push(...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 Wf=w({version:v(),name:v(),css:m(v()),renderType:m(F([L("COMPONENT"),L("PAGE")])),loadType:m(x()),lifecycle:m(x()),props:m(x()),methods:m(P(Rf)),componentsMeta:P(Er(w({componentName:v()}),$r)),thirdLibs:m(wf),componentsTree:Df,assets:m(P(x()))}),Co=t=>(xr({data:t,dataStruct:Wf,throwError:!1}),t),Ie=(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"),Co(e),this.rawData=JSON.parse(JSON.stringify(e)),this.materialsModel=new dt((r==null?void 0:r.materials)||[]),this.data=Ie(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=Ie(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=Ie(e,this,this.materialsModel),this.emitter.emit("onReloadPage",{value:this.data,preValue:r,node:this})}get value(){return this.data}getNode(e){if(!e)return;const r=this.data.componentsTree;return Ar(r,e)}addNode(e,r,n="AFTER"){var o;if(n==="AFTER"||n==="BEFORE"){const a=r.parent;if(a===null&&r instanceof 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 wt){const s=a.value.value,c=s.findIndex(u=>u===r)??-1;return c>=0?(n==="BEFORE"?s.splice(c,0,e):s.splice(c+1,0,e),e.parent=a,(o=a.parent)==null||o.updateValue(),!0):!1}if(a instanceof 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 wt){const o=n.value.value,a=o.findIndex(s=>s===e),i=o[a];return o.splice(a,1),(r=n.parent)==null||r.updateValue(),i}if(n instanceof 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=Nr.SAVE){var r;const n=this.data.componentsTree.export(e),o=this.assetPackagesList,a=[],i=this.materialsModel.usedMaterials.map(c=>{const u=o.find(l=>{var p;return l.package===((p=c.value.npm)==null?void 0:p.package)});return u&&a.push(u),{componentName:c.componentName,...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:Mr(n),componentsMeta:i,thirdLibs:this.data.thirdLibs,assets:[]};return(r=this.data.thirdLibs)==null||r.forEach(c=>{const u=o.find(l=>c.package===l.package);u&&a.push(u)}),s.assets=mf(a,c=>c.package),s=go(s,["id"]),JSON.parse(JSON.stringify(s))}getRootNode(){return this.data.componentsTree}}At.ROOT_CONTAINER;var Jf=typeof global=="object"&&global&&global.Object===Object&&global;const Eo=Jf;var Qf=typeof self=="object"&&self&&self.Object===Object&&self,qf=Eo||Qf||Function("return this")();const Pt=qf;var Yf=Pt.Symbol;const Ct=Yf;var $o=Object.prototype,Kf=$o.hasOwnProperty,Xf=$o.toString,Vt=Ct?Ct.toStringTag:void 0;function Zf(t){var e=Kf.call(t,Vt),r=t[Vt];try{t[Vt]=void 0;var n=!0}catch{}var o=Xf.call(t);return n&&(e?t[Vt]=r:delete t[Vt]),o}var tp=Object.prototype,ep=tp.toString;function rp(t){return ep.call(t)}var np="[object Null]",op="[object Undefined]",_n=Ct?Ct.toStringTag:void 0;function oe(t){return t==null?t===void 0?op:np:_n&&_n in Object(t)?Zf(t):rp(t)}function Rt(t){return t!=null&&typeof t=="object"}var ap="[object Symbol]";function sp(t){return typeof t=="symbol"||Rt(t)&&oe(t)==ap}function ip(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 cp=Array.isArray;const Et=cp;var up=1/0,Sn=Ct?Ct.prototype:void 0,jn=Sn?Sn.toString:void 0;function No(t){if(typeof t=="string")return t;if(Et(t))return ip(t,No)+"";if(sp(t))return jn?jn.call(t):"";var e=t+"";return e=="0"&&1/t==-up?"-0":e}function yt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function To(t){return t}var lp="[object AsyncFunction]",fp="[object Function]",pp="[object GeneratorFunction]",dp="[object Proxy]";function Pr(t){if(!yt(t))return!1;var e=oe(t);return e==fp||e==pp||e==lp||e==dp}var hp=Pt["__core-js_shared__"];const Le=hp;var On=function(){var t=/[^.]+$/.exec(Le&&Le.keys&&Le.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function mp(t){return!!On&&On in t}var vp=Function.prototype,gp=vp.toString;function yp(t){if(t!=null){try{return gp.call(t)}catch{}try{return t+""}catch{}}return""}var bp=/[\\^$.*+?()[\]{}|]/g,_p=/^\[object .+?Constructor\]$/,Sp=Function.prototype,jp=Object.prototype,Op=Sp.toString,wp=jp.hasOwnProperty,Cp=RegExp("^"+Op.call(wp).replace(bp,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ep(t){if(!yt(t)||mp(t))return!1;var e=Pr(t)?Cp:_p;return e.test(yp(t))}function $p(t,e){return t==null?void 0:t[e]}function Rr(t,e){var r=$p(t,e);return Ep(r)?r:void 0}var wn=Object.create,Np=function(){function t(){}return function(e){if(!yt(e))return{};if(wn)return wn(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();const Tp=Np;function xp(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 Mp(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var Ap=800,Pp=16,Rp=Date.now;function Dp(t){var e=0,r=0;return function(){var n=Rp(),o=Pp-(n-r);if(r=n,o>0){if(++e>=Ap)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Ip(t){return function(){return t}}var Lp=function(){try{var t=Rr(Object,"defineProperty");return t({},"",{}),t}catch{}}();const me=Lp;var Fp=me?function(t,e){return me(t,"toString",{configurable:!0,enumerable:!1,value:Ip(e),writable:!0})}:To;const Bp=Fp;var Up=Dp(Bp);const kp=Up;var Vp=9007199254740991,zp=/^(?:0|[1-9]\d*)$/;function xo(t,e){var r=typeof t;return e=e??Vp,!!e&&(r=="number"||r!="symbol"&&zp.test(t))&&t>-1&&t%1==0&&t<e}function Dr(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 Gp=Object.prototype,Hp=Gp.hasOwnProperty;function Wp(t,e,r){var n=t[e];(!(Hp.call(t,e)&&Oe(n,r))||r===void 0&&!(e in t))&&Dr(t,e,r)}function Jp(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?Dr(r,s,c):Wp(r,s,c)}return r}var Cn=Math.max;function Qp(t,e,r){return e=Cn(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=Cn(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),xp(t,this,s)}}function qp(t,e){return kp(Qp(t,e,To),t+"")}var Yp=9007199254740991;function Mo(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Yp}function Ir(t){return t!=null&&Mo(t.length)&&!Pr(t)}function Kp(t,e,r){if(!yt(r))return!1;var n=typeof e;return(n=="number"?Ir(r)&&xo(e,r.length):n=="string"&&e in r)?Oe(r[e],t):!1}function Xp(t){return qp(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&&Kp(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 Zp=Object.prototype;function Ao(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Zp;return t===r}function td(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var ed="[object Arguments]";function En(t){return Rt(t)&&oe(t)==ed}var Po=Object.prototype,rd=Po.hasOwnProperty,nd=Po.propertyIsEnumerable,od=En(function(){return arguments}())?En:function(t){return Rt(t)&&rd.call(t,"callee")&&!nd.call(t,"callee")};const Ke=od;function ad(){return!1}var Ro=typeof exports=="object"&&exports&&!exports.nodeType&&exports,$n=Ro&&typeof module=="object"&&module&&!module.nodeType&&module,sd=$n&&$n.exports===Ro,Nn=sd?Pt.Buffer:void 0,id=Nn?Nn.isBuffer:void 0,cd=id||ad;const Do=cd;var ud="[object Arguments]",ld="[object Array]",fd="[object Boolean]",pd="[object Date]",dd="[object Error]",hd="[object Function]",md="[object Map]",vd="[object Number]",gd="[object Object]",yd="[object RegExp]",bd="[object Set]",_d="[object String]",Sd="[object WeakMap]",jd="[object ArrayBuffer]",Od="[object DataView]",wd="[object Float32Array]",Cd="[object Float64Array]",Ed="[object Int8Array]",$d="[object Int16Array]",Nd="[object Int32Array]",Td="[object Uint8Array]",xd="[object Uint8ClampedArray]",Md="[object Uint16Array]",Ad="[object Uint32Array]",N={};N[wd]=N[Cd]=N[Ed]=N[$d]=N[Nd]=N[Td]=N[xd]=N[Md]=N[Ad]=!0;N[ud]=N[ld]=N[jd]=N[fd]=N[Od]=N[pd]=N[dd]=N[hd]=N[md]=N[vd]=N[gd]=N[yd]=N[bd]=N[_d]=N[Sd]=!1;function Pd(t){return Rt(t)&&Mo(t.length)&&!!N[oe(t)]}function Rd(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,Dd=Wt&&Wt.exports===Io,Fe=Dd&&Eo.process,Id=function(){try{var t=Wt&&Wt.require&&Wt.require("util").types;return t||Fe&&Fe.binding&&Fe.binding("util")}catch{}}();const Tn=Id;var xn=Tn&&Tn.isTypedArray,Ld=xn?Rd(xn):Pd;const Lo=Ld;var Fd=Object.prototype,Bd=Fd.hasOwnProperty;function Ud(t,e){var r=Et(t),n=!r&&Ke(t),o=!r&&!n&&Do(t),a=!r&&!n&&!o&&Lo(t),i=r||n||o||a,s=i?td(t.length,String):[],c=s.length;for(var u in t)(e||Bd.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 kd(t,e){return function(r){return t(e(r))}}function Vd(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var zd=Object.prototype,Gd=zd.hasOwnProperty;function Hd(t){if(!yt(t))return Vd(t);var e=Ao(t),r=[];for(var n in t)n=="constructor"&&(e||!Gd.call(t,n))||r.push(n);return r}function Fo(t){return Ir(t)?Ud(t,!0):Hd(t)}var Wd=Rr(Object,"create");const te=Wd;function Jd(){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 qd="__lodash_hash_undefined__",Yd=Object.prototype,Kd=Yd.hasOwnProperty;function Xd(t){var e=this.__data__;if(te){var r=e[t];return r===qd?void 0:r}return Kd.call(e,t)?e[t]:void 0}var Zd=Object.prototype,th=Zd.hasOwnProperty;function eh(t){var e=this.__data__;return te?e[t]!==void 0:th.call(e,t)}var rh="__lodash_hash_undefined__";function nh(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=te&&e===void 0?rh: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=Jd;ht.prototype.delete=Qd;ht.prototype.get=Xd;ht.prototype.has=eh;ht.prototype.set=nh;function oh(){this.__data__=[],this.size=0}function we(t,e){for(var r=t.length;r--;)if(Oe(t[r][0],e))return r;return-1}var ah=Array.prototype,sh=ah.splice;function ih(t){var e=this.__data__,r=we(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():sh.call(e,r,1),--this.size,!0}function ch(t){var e=this.__data__,r=we(e,t);return r<0?void 0:e[r][1]}function uh(t){return we(this.__data__,t)>-1}function lh(t,e){var r=this.__data__,n=we(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=oh;rt.prototype.delete=ih;rt.prototype.get=ch;rt.prototype.has=uh;rt.prototype.set=lh;var fh=Rr(Pt,"Map");const Bo=fh;function ph(){this.size=0,this.__data__={hash:new ht,map:new(Bo||rt),string:new ht}}function dh(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Ce(t,e){var r=t.__data__;return dh(e)?r[typeof e=="string"?"string":"hash"]:r.map}function hh(t){var e=Ce(this,t).delete(t);return this.size-=e?1:0,e}function mh(t){return Ce(this,t).get(t)}function vh(t){return Ce(this,t).has(t)}function gh(t,e){var r=Ce(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=ph;Dt.prototype.delete=hh;Dt.prototype.get=mh;Dt.prototype.has=vh;Dt.prototype.set=gh;function Uo(t){return t==null?"":No(t)}var yh=kd(Object.getPrototypeOf,Object);const ko=yh;var bh="[object Object]",_h=Function.prototype,Sh=Object.prototype,Vo=_h.toString,jh=Sh.hasOwnProperty,Oh=Vo.call(Object);function $t(t){if(!Rt(t)||oe(t)!=bh)return!1;var e=ko(t);if(e===null)return!0;var r=jh.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Vo.call(r)==Oh}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 Ch(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",$h="\\u0300-\\u036f",Nh="\\ufe20-\\ufe2f",Th="\\u20d0-\\u20ff",xh=$h+Nh+Th,Mh="\\ufe0e\\ufe0f",Ah="\\u200d",Ph=RegExp("["+Ah+Eh+xh+Mh+"]");function zo(t){return Ph.test(t)}function Rh(t){return t.split("")}var Go="\\ud800-\\udfff",Dh="\\u0300-\\u036f",Ih="\\ufe20-\\ufe2f",Lh="\\u20d0-\\u20ff",Fh=Dh+Ih+Lh,Bh="\\ufe0e\\ufe0f",Uh="["+Go+"]",Xe="["+Fh+"]",Ze="\\ud83c[\\udffb-\\udfff]",kh="(?:"+Xe+"|"+Ze+")",Ho="[^"+Go+"]",Wo="(?:\\ud83c[\\udde6-\\uddff]){2}",Jo="[\\ud800-\\udbff][\\udc00-\\udfff]",Vh="\\u200d",Qo=kh+"?",qo="["+Bh+"]?",zh="(?:"+Vh+"(?:"+[Ho,Wo,Jo].join("|")+")"+qo+Qo+")*",Gh=qo+Qo+zh,Hh="(?:"+[Ho+Xe+"?",Xe,Wo,Jo,Uh].join("|")+")",Wh=RegExp(Ze+"(?="+Ze+")|"+Hh+Gh,"g");function Jh(t){return t.match(Wh)||[]}function Qh(t){return zo(t)?Jh(t):Rh(t)}function qh(t){return function(e){e=Uo(e);var r=zo(e)?Qh(e):void 0,n=r?r[0]:e.charAt(0),o=r?Ch(r,1).join(""):e.slice(1);return n[t]()+o}}var Yh=qh("toUpperCase");const Kh=Yh;function Xh(t){return Kh(Uo(t).toLowerCase())}function Zh(){this.__data__=new rt,this.size=0}function tm(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function em(t){return this.__data__.get(t)}function rm(t){return this.__data__.has(t)}var nm=200;function om(t,e){var r=this.__data__;if(r instanceof rt){var n=r.__data__;if(!Bo||n.length<nm-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=Zh;It.prototype.delete=tm;It.prototype.get=em;It.prototype.has=rm;It.prototype.set=om;var Yo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Mn=Yo&&typeof module=="object"&&module&&!module.nodeType&&module,am=Mn&&Mn.exports===Yo,An=am?Pt.Buffer:void 0,Pn=An?An.allocUnsafe:void 0;function sm(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 im=Pt.Uint8Array;const Rn=im;function cm(t){var e=new t.constructor(t.byteLength);return new Rn(e).set(new Rn(t)),e}function um(t,e){var r=e?cm(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function lm(t){return typeof t.constructor=="function"&&!Ao(t)?Tp(ko(t)):{}}function fm(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 pm=fm();const dm=pm;function tr(t,e,r){(r!==void 0&&!Oe(t[e],r)||r===void 0&&!(e in t))&&Dr(t,e,r)}function hm(t){return Rt(t)&&Ir(t)}function er(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function mm(t){return Jp(t,Fo(t))}function vm(t,e,r,n,o,a,i){var s=er(t,r),c=er(e,r),u=i.get(c);if(u){tr(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:hm(s)?l=Mp(s):d?(p=!1,l=sm(c,!0)):h?(p=!1,l=um(c,!0)):l=[]:$t(c)||Ke(c)?(l=s,Ke(s)?l=mm(s):(!yt(s)||Pr(s))&&(l=lm(c))):p=!1}p&&(i.set(c,l),o(l,c,n,a,i),i.delete(c)),tr(t,r,l)}function Ko(t,e,r,n,o){t!==e&&dm(e,function(a,i){if(o||(o=new It),yt(a))vm(t,e,i,r,Ko,n,o);else{var s=n?n(er(t,i),a,i+"",t,e,o):void 0;s===void 0&&(s=a),tr(t,i,s)}},Fo)}var gm=Xp(function(t,e,r){Ko(t,e,r)});const ym=gm,bm=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};
|