@blocklet/pages-kit-inner-components 0.4.85 → 0.4.87
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/lib/cjs/chunks/home-O1tb16Jn.js +542 -0
- package/lib/cjs/chunks/{publish-button-BT-w5Okt.js → publish-button-DEx0XGBW.js} +1 -1
- package/lib/cjs/chunks/site-state-C1M4mrHD.js +57 -0
- package/lib/cjs/components.js +1 -1
- package/lib/cjs/home.js +1 -1
- package/lib/cjs/locales.js +1 -1
- package/lib/cjs/project-html.js +2 -2
- package/lib/cjs/resources.js +1 -1
- package/lib/cjs/setting.js +4 -4
- package/lib/cjs/site-state.js +1 -1
- package/lib/es/chunks/{home-BX1L-H5W.js → home-Y2IIftcZ.js} +542 -536
- package/lib/es/chunks/{publish-button-DUkACr5d.js → publish-button-BTed0K41.js} +1 -1
- package/lib/es/chunks/{site-state-D5tVTSMt.js → site-state-eOo5A_KN.js} +146 -140
- package/lib/es/components.js +1 -1
- package/lib/es/home.js +9 -8
- package/lib/es/locales.js +174 -0
- package/lib/es/project-html.js +27 -27
- package/lib/es/resources.js +3 -2
- package/lib/es/setting.js +805 -776
- package/lib/es/site-state.js +19 -13
- package/package.json +9 -9
- package/lib/cjs/chunks/home-D0r5jd24.js +0 -542
- package/lib/cjs/chunks/site-state-CxabeXSX.js +0 -57
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";var pt=Object.defineProperty;var dt=(t,n,e)=>n in t?pt(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var v=(t,n,e)=>dt(t,typeof n!="symbol"?n+"":n,e);const ft=require("@blocklet/pages-kit/builtin/utils"),pe=require("@blocklet/pages-kit/types"),ne=require("@blocklet/pages-kit/utils/property"),Y=require("@blocklet/quickjs"),mt=require("@blocklet/sdk/lib/config"),De=require("lru-cache"),ze=require("node-fetch"),k=require("ufo"),ge=require("crypto"),gt=require("@blocklet/logger"),ht=require("@blocklet/pages-kit/utils/builtin"),Je=require("@blocklet/pages-kit/utils/typescript/builtin-module-transformer"),xe=require("@blocklet/sdk/lib/component"),yt=require("autoprefixer"),St=require("esbuild"),h=require("fs"),wt=require("postcss"),Et=require("tailwindcss"),bt=require("typescript"),Tt=require("@reactivedata/reactive"),le=require("@syncedstore/core"),je=require("glob"),It=require("lib0/decoding"),jt=require("lib0/encoding"),N=require("lodash"),Ot=require("nanoid"),Ct=require("p-limit"),d=require("path"),Pt=require("stream/promises"),At=require("tar"),vt=require("wait-on"),X=require("y-protocols/awareness"),Ee=require("y-protocols/sync"),_t=require("yaml"),Dt=require("yjs"),xt=require("lodash/isNil"),O=require("sequelize");require("sqlite3");require("@blocklet/pages-kit/types/state");const L=t=>t&&t.__esModule?t:{default:t};function ae(t){if(t&&t.__esModule)return t;const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,s.get?s:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const w=L(mt),kt=L(ze),Rt=L(gt),Nt=L(yt),Lt=ae(St),Ut=L(wt),Mt=L(Et),x=L(bt),be=ae(It),_=ae(jt),Ft=L(Ct),qt=L(d),$t=L(vt),ee=ae(_t),K=ae(Dt),Bt=L(xt);w.default.env.mode;const Ht="image-bin";w.default.env.INIT_TEMPLATE_PATH;const Vt=process.env.DATABASE_URL||qt.default.join(w.default.env.dataDir,"db/pages-kit.db"),qe=w.default,Gt=()=>w.default.env.tenantMode==="multiple",zt=()=>{var t;return(Bt.default(qe.env.preferences.multiTenantAllProjectAccessPassports)?[]:(t=qe.env.preferences.multiTenantAllProjectAccessPassports)==null?void 0:t.split(","))||[]},E=Rt.default("pages-kit"),Jt=O.DataTypes.sqlite.DATE.parse;O.DataTypes.sqlite.DATE.parse=(t,n)=>typeof t=="number"?new Date(t):Jt(t,n);const ie=new O.Sequelize({dialect:"sqlite",storage:Vt,benchmark:process.env.ENABLE_SEQUELIZE_BENCHMARK==="true",retry:{match:[/SQLITE_BUSY/],name:"query",max:10},logging:process.env.ENABLE_SEQUELIZE_LOGGING==="true"?console.log:!1});ie.query("pragma journal_mode = WAL;");ie.query("pragma synchronous = normal;");ie.query("pragma journal_size_limit = 67108864;");class he extends O.Model{}he.init({id:{type:O.DataTypes.UUID,allowNull:!1,primaryKey:!0,defaultValue:O.DataTypes.UUIDV4},projectId:{type:O.DataTypes.UUID,allowNull:!1},componentId:{type:O.DataTypes.STRING,allowNull:!1}},{sequelize:ie,tableName:"ProjectComponents",timestamps:!1});class V extends O.Model{static async getProjectByIdOrSlug(n){return V.findOne({where:{[O.Op.or]:[{id:n},{slug:n}]}})}}V.init({id:{type:O.DataTypes.UUID,defaultValue:O.DataTypes.UUIDV4,primaryKey:!0},name:{type:O.DataTypes.STRING,allowNull:!1},description:O.DataTypes.TEXT,createdAt:O.DataTypes.DATE,updatedAt:O.DataTypes.DATE,createdBy:{type:O.DataTypes.STRING,allowNull:!1},updatedBy:{type:O.DataTypes.STRING,allowNull:!1},slug:O.DataTypes.STRING,icon:O.DataTypes.STRING,pinnedAt:O.DataTypes.DATE,useAllResources:O.DataTypes.BOOLEAN,npmSecret:O.DataTypes.STRING,relatedBlocklets:{type:O.DataTypes.JSON,allowNull:!1,defaultValue:{},get(){return this.getDataValue("relatedBlocklets")||{}},set(t){this.setDataValue("relatedBlocklets",JSON.stringify(t||{}))}}},{sequelize:ie,paranoid:!0});V.hasMany(he,{foreignKey:"projectId",as:"components"});const Kt=async(t,{componentId:n})=>{const e=`@tailwind components;
|
|
2
|
-
@tailwind utilities;
|
|
3
|
-
`,s=`.CustomComponent_${n}`;return(await Ut.default([Mt.default({content:[{raw:t,extension:"tsx"}]}),Nt.default({overrideBrowserslist:["> 1%","last 2 versions"],stats:{}}),r=>{r.walkRules(l=>{l.selectors=l.selectors.map(a=>a.replace(/\.(.+)/g,`${s}.$1,${s} .$1`))})}]).process(e)).css},Yt=async(t,{componentId:n})=>{const e=await Kt(t,{componentId:n});return`export const __PagesKit_CSS__ = ${JSON.stringify(e)};
|
|
4
|
-
|
|
5
|
-
${t}
|
|
6
|
-
`},$e=Y.memoize(async(t,n)=>{let e=x.default.transpileModule(t,{compilerOptions:{jsx:x.default.JsxEmit.React,target:x.default.ScriptTarget.ES2016,module:x.default.ModuleKind.ESNext},transformers:{before:[Je.createBuiltinModuleTransformer(x.default)]}}).outputText;if(n.tailwind&&(e=await Yt(e,{componentId:n.componentId})),n.module===pe.PreloadComponentScriptModule.ESM)return e;const s=x.default.transpileModule(e,{compilerOptions:{jsx:x.default.JsxEmit.React,target:x.default.ScriptTarget.ES2016,module:x.default.ModuleKind.CommonJS,moduleResolution:x.default.ModuleResolutionKind.Node16}}).outputText;return n.module===pe.PreloadComponentScriptModule.CJS?s:Wt(n.moduleName,s)},{keyGenerator:(t,n)=>{const e=ge.createHash("md5").update(t).digest("hex"),s={...n,componentId:n.componentId,module:n.module,...n.module!==pe.PreloadComponentScriptModule.ESM?{moduleName:n.moduleName}:{},tailwind:n.tailwind};return JSON.stringify(["transpileModule",e,s])},lruOptions:{max:100,ttl:1e3*60*60}}),Qt=async(t,n)=>{var l,a;const s=(a=(l=(await Lt.build({entryPoints:["index.tsx"],external:Object.keys(ht.BuiltinModules),format:"esm",target:"esnext",bundle:!0,write:!1,plugins:[{name:"vfs",setup(i){let c=null;i.onResolve({filter:/.*/},u=>u.path==="index.tsx"?{path:"index.tsx",namespace:"vfs"}:u.path==="./component"?{path:"component.tsx",namespace:"vfs"}:null),i.onLoad({filter:/.*/,namespace:"vfs"},async u=>{var p;if(u.path==="index.tsx")return{contents:`export { ${n} } from './component'`,loader:"tsx"};if(u.path==="component.tsx")return{contents:t,loader:"tsx"};if(Je.isRelativeModule(u.path)){const f=u.path.split("/").pop();if(c||(c=await ye({ensureLoaded:!1})),(p=c==null?void 0:c.chunks)!=null&&p[f])try{const g=h.readFileSync(c.chunks[f],"utf-8");return E.info("get chunk from local file system",f),{contents:g,loader:"tsx"}}catch{}}return null})}}]})).outputFiles)==null?void 0:l[0])==null?void 0:a.contents;if(!s)throw new Error("Failed to build server code");const o=Buffer.from(s).toString();return x.default.transpileModule(o,{compilerOptions:{module:x.default.ModuleKind.ESNext,target:x.default.ScriptTarget.ES2020}}).outputText},Ke=Y.memoize(async(t,n)=>{const e=await Qt(t,n);return new RegExp(`export\\s+\\{\\s+${n}\\s+\\}`,"m").test(e)?e:void 0},{keyGenerator:(t,n)=>{const e=ge.createHash("md5").update(t).digest("hex");return JSON.stringify(["extractExportValueSchema",e,n])},lruOptions:{max:100,ttl:1e3*60*60}}),Wt=(t,n)=>{const e=/\bawait\b/.test(n);return`// GENERATED FILE. DO NOT EDIT.
|
|
7
|
-
var ${t} = ${e?"async":""} function () {
|
|
8
|
-
|
|
9
|
-
const exports = {};
|
|
10
|
-
let moduleExports = null;
|
|
11
|
-
|
|
12
|
-
// add commonjs module compatibility layer
|
|
13
|
-
const module = { exports: moduleExports };
|
|
14
|
-
|
|
15
|
-
// execute component code
|
|
16
|
-
${n}
|
|
17
|
-
|
|
18
|
-
// handle possible module.exports
|
|
19
|
-
if (module.exports && module.exports !== moduleExports) {
|
|
20
|
-
// if module.exports is used, use it first
|
|
21
|
-
return typeof module.exports === 'object' ? module.exports : { default: module.exports };
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// ensure a default export
|
|
25
|
-
if (!('default' in exports) && Object.keys(exports).length === 0) {
|
|
26
|
-
// module has no exports, return null to indicate invalid
|
|
27
|
-
return null;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return exports;
|
|
31
|
-
};
|
|
32
|
-
`},te=new De.LRUCache({max:100}),Ye=60*60,Oe=60;function Qe(t){E.info("clear preload components cache",{cacheKey:t}),te.delete(t)}function We(t){for(const n of te.keys())n.includes(t)&&(E.info("clear preload components cache",{cacheKey:n}),Qe(n))}function Xe({mode:t,instanceId:n,componentId:e,locale:s}){return["getPreloadComponents",t,n,e,s].join("-")}async function Xt({mode:t,req:n,state:e,locale:s,instances:o,module:r}){const{supportedLocales:l,config:{defaultLocale:a}}=e;if(!a)return null;const i=(await Promise.all(o.map(async g=>{try{const S=Xe({mode:t,instanceId:g.id,componentId:g.componentId,locale:s});if(t!=="draft"&&g.useCache&&te.has(S))return E.info(`get preload component from cache: ${S}`),te.get(S);const A=oe({state:e,componentId:g.componentId});if(!A)return null;const D=await Ze({req:n,state:e,componentId:A.id,locale:s,defaultLocale:a,properties:g.properties});if(!D)return null;const q={instanceId:g.id,preload:D};if(t!=="draft"&&g.useCache){let R=Ye;g.cacheDuration&&(R=g.cacheDuration),E.info(`set preload component to cache(${R}s): ${S}`),te.set(S,q,{ttl:R*1e3})}return q}catch(S){return E.error("get preload component error",{instanceId:g.id,componentId:g.componentId},{error:S}),null}}))).filter(g=>!!g),c=Object.values(i.reduce((g,S)=>({...g,...S.preload.components}),{}));async function u(){const g=await Promise.all(c.map(async S=>{const A=ne.componentUMDName({componentId:S.component.id}),D=r===pe.PreloadComponentScriptModule.ESM?{module:r,script:await $e(S.script,{componentId:S.component.id,module:r,tailwind:t!=="draft"})}:{module:r,script:await $e(S.script,{componentId:S.component.id,module:r,moduleName:A,tailwind:t!=="draft"}),moduleName:A};return[S.component.id,{component:S.component,script:D}]}));return Object.fromEntries(g)}const p=await u();return{config:{defaultLocale:a,supportedLocales:l},components:p,instances:i.map(g=>({id:g.instanceId,componentId:g.preload.component.id,locales:{[g.preload.locale]:{props:g.preload.props}}}))}}async function Ze({req:t,state:n,componentId:e,locale:s,defaultLocale:o,properties:r}){const{supportedLocales:l}=n,a=oe({state:n,componentId:e});if(!a)return null;const i=l.some(u=>u.locale===s)?s:o;if(!i)return null;const c=await et({req:t,state:n,componentId:e,locale:i,defaultLocale:o,properties:r});return c?{component:a,...c}:null}const Zt=20;async function et({req:t,depth:n=0,state:e,componentId:s,locale:o,defaultLocale:r,properties:l}){if(n>Zt)throw new RangeError("max component depth exceeded");const a=es({state:e,componentId:s,properties:l,locale:o});if(!a)return null;const{props:i}=a,c={locale:o||r,components:{[a.component.id]:{component:a.component,script:a.script}},props:{...i}};try{const u=await ss({...a,req:t});u!=null&&u.props&&Object.assign(c.props,u.props)}catch(u){E.error("preload data at server side error",{componentId:s,name:a.component.name},{error:u})}return await Promise.all(Object.entries(i).map(async([u,p])=>{if((p==null?void 0:p.type)===ne.RenderNestedComponent){const f=await et({req:t,depth:n+1,state:e,componentId:p.componentId,locale:o,defaultLocale:r,properties:p.properties});f&&(Object.assign(c.components,f.components),Object.assign(c.props,{[u]:{type:ne.RenderNestedComponent,componentId:p.componentId,props:f.props}}))}})),c}function es({state:t,componentId:n,locale:e,properties:s}){const o=oe({state:t,componentId:n});if(!o)return null;const r=ne.mergeComponent({componentId:n,getComponent:l=>oe({state:t,componentId:l}),locale:e,defaultLocale:t.config.defaultLocale,properties:s});return r?{component:o,script:r.script,props:{locale:e,...r.properties}}:null}function oe({state:t,componentId:n}){var e,s,o;return((e=t.components[n])==null?void 0:e.data)??((o=(s=t.resources.components)==null?void 0:s[n])==null?void 0:o.component)}function ts({state:t,name:n}){var s,o;const e=n.toLowerCase();return((s=Object.values(t.components).find(r=>{var l;return((l=r.data.name)==null?void 0:l.toLowerCase())===e}))==null?void 0:s.data)??((o=t.resources.components&&Object.values(t.resources.components).find(r=>{var l;return((l=r.component.name)==null?void 0:l.toLowerCase())===e}))==null?void 0:o.component)}async function ss({component:t,script:n,props:e,req:s}){if(!(n!=null&&n.includes("getServerSideProps")))return null;const o=await Ke(n,"getServerSideProps");if(!o)return null;const r=new Promise(a=>{setTimeout(()=>{E.error("getServerSideProps timeout"),a({})},Oe*1e3)});return await Promise.race([r,Y.Sandbox.callFunction({code:`${o}
|
|
33
|
-
|
|
34
|
-
export async function getServerSidePropsWrapper(props) {
|
|
35
|
-
const { location, fetch, props: componentProps } = props;
|
|
36
|
-
// 使用局部变量而不是全局变量
|
|
37
|
-
const originalLocation = typeof window !== 'undefined' ? window.location : undefined;
|
|
38
|
-
const originalFetch = globalThis.fetch;
|
|
39
|
-
|
|
40
|
-
try {
|
|
41
|
-
globalThis.location = location;
|
|
42
|
-
globalThis.fetch = fetch;
|
|
43
|
-
return await getServerSideProps(componentProps);
|
|
44
|
-
} finally {
|
|
45
|
-
// 清理全局状态
|
|
46
|
-
if (originalLocation) globalThis.location = originalLocation;
|
|
47
|
-
if (originalFetch) globalThis.fetch = originalFetch;
|
|
48
|
-
}
|
|
49
|
-
}`,filename:`${t.name||t.id}.js`,moduleLoader:a=>{if(a==="@blocklet/pages-kit/builtin/utils")return`const { joinURL, withQuery, getQuery, getComponentMountPoint } = globalThis
|
|
50
|
-
export { joinURL, withQuery, getQuery, getComponentMountPoint }
|
|
51
|
-
`;if(a==="@blocklet/pages-kit/builtin/dayjs")return Y.BuiltinModules.dayjs},global:{console:{log:(...a)=>{E.info(...a)},warn:(...a)=>{E.warn(...a)},error:(...a)=>{E.error(...a)}},getComponentMountPoint:ft.getComponentMountPoint,joinURL:k.joinURL,withQuery:k.withQuery,getQuery:k.getQuery},functionName:"getServerSidePropsWrapper",args:[{location:{href:k.joinURL(k.withHttps(s.hostname),s.originalUrl)},fetch:(a,{...i}={})=>{const c=typeof a=="string"&&a.startsWith("/")?k.joinURL(w.default.env.appUrl,a):a;if(typeof c=="string"&&k.parseURL(c).host===k.parseURL(w.default.env.appUrl).host){const u=s.get("cookie");if(u){const p=new ze.Headers(i.headers);p.set("cookie",u),i.headers=p}}return kt.default(c,{...i,timeout:Oe*1e3}).then(u=>({ok:u.ok,status:u.status,statusText:u.statusText,headers:Object.fromEntries(u.headers.entries()),json:()=>u.json()}))},props:e}]})])}const tt=Y.memoize(async(t,n,e)=>{if(!(t!=null&&t.includes(n)))return null;const s=await Ke(t,n);if(s)try{return await Y.Sandbox.callFunction({code:`
|
|
52
|
-
${s}
|
|
53
|
-
|
|
54
|
-
export function get${n}SchemaWrapper() {
|
|
55
|
-
return ${n};
|
|
56
|
-
}
|
|
57
|
-
`,filename:`${e}.js`,functionName:`get${n}SchemaWrapper`})}catch(o){return E.error(`获取 ${n} 失败`,{componentId:e,error:o}),null}return null},{keyGenerator:(t,n,e)=>{const s=ge.createHash("md5").update(t).digest("hex");return JSON.stringify(["getExportSchemaValueFromCode",s,n,e])},lruOptions:{max:100,ttl:1e3*60*60}}),ns="z8iZiDFg3vkkrPwsiba1TLXy3H9XHzFERsP8o",Ce="page",Pe="trigger-reload-project-resource",ke=ns,os="z2qa7BQdkEb3TwYyEYC1psK6uvmGnHSUHt5RM",{uploadToMediaKit:rs}=require("@blocklet/uploader-server"),Ae=Ot.customAlphabet("abcdefghijklmnopqrstuvwxyz0123456789",16),Re=/^\w+(\w|-|\.)+\w+\.(jpe?g|png|gif|svg|bmp|webp|mp4|m4v|webm)$/,se=/mediakit:\/\/([a-f0-9]{32}\.(jpe?g|png|gif|svg|bmp|webp|mp4|m4v|webm))/i,Be=/mediakit:\/\/([a-f0-9]{32}\.(jpe?g|png|gif|svg|bmp|webp|mp4|m4v|webm))/gi,as=1e4,is=3e4,ue=0,Te=1,cs=0,ls=1,ve=w.default,Z=d.join(process.env.BLOCKLET_DATA_DIR,"site-state"),us=["production","draft"],ps=["production"];function st(t){return(t==null?void 0:t.replace(/\//g,"|"))||""}function ds(){var e;const t=ve.env.languages.map(s=>({locale:s.code,name:s.name})),n=(e=t[0])==null?void 0:e.locale;return{pageIds:[],pages:{},components:{},supportedLocales:t,config:{defaultLocale:n},resources:{}}}const H=class H extends K.Doc{constructor(e){super();v(this,"states",{});v(this,"syncedStore");v(this,"conns",new Map);v(this,"awareness");v(this,"awarenessChangeHandler",({added:e,updated:s,removed:o},r)=>{const l=e.concat(s,o);if(r!==null){const c=this.conns.get(r);c&&(e.forEach(u=>{c.add(u)}),o.forEach(u=>{c.delete(u)}))}const a=_.createEncoder();_.writeVarUint(a,Te),_.writeVarUint8Array(a,X.encodeAwarenessUpdate(this.awareness,l));const i=_.toUint8Array(a);this.conns.forEach((c,u)=>this.send(u,i))});v(this,"updateHandler",e=>{const s=_.createEncoder();_.writeVarUint(s,ue),Ee.writeUpdate(s,e);const o=_.toUint8Array(s);this.conns.forEach((r,l)=>this.send(l,o))});v(this,"ensureDataStructure",()=>{var l;const{supportedLocales:e,pages:s,pageIds:o,config:r}=this.syncedStore;{const a=new Set(Object.keys(s));let i=0;for(;i<o.length;){const c=o[i];a.has(c)?(a.delete(c),i++):o.splice(i,1)}}e.splice(0,e.length),e.push(...ve.env.languages.map(a=>({locale:a.code,name:a.name}))),r.defaultLocale=(l=e[0])==null?void 0:l.locale;{let a=0;const i=new Set;for(;a<e.length;){const{locale:c}=e[a];i.has(c)?e.splice(a,1):(a++,i.add(c))}}});v(this,"send",(e,s)=>{e.readyState!==cs&&e.readyState!==ls&&this.closeConn(e);try{e.send(s,o=>{o&&this.closeConn(e)})}catch{this.closeConn(e)}});v(this,"closeConn",e=>{if(e.removeAllListeners(),this.conns.has(e)){const s=this.conns.get(e);this.conns.delete(e),s&&X.removeAwarenessStates(this.awareness,Array.from(s),null)}e.close()});v(this,"autoSave",N.debounce(()=>{h.mkdirSync(d.dirname(this.draftYjsFilePath),{recursive:!0}),h.writeFileSync(this.draftYjsFilePath,K.encodeStateAsUpdate(this))},as));v(this,"save",({flush:e=!1}={})=>{this.autoSave(),e&&this.autoSave.flush()});v(this,"publish",async({mode:e,pages:s})=>{const o=await this.getState("draft"),r=await this.getState("production");await _e(o,r,{pages:s,pageMergeMode:"replace",deletePages:!0,publishMode:e}),r.config.publishedAt=new Date().getTime();for(const l of s||Object.keys(this.syncedStore.pages))this.syncedStore.pages[l]&&(this.syncedStore.pages[l].publishedAt=new Date().toISOString());await this.setState(e,r)});v(this,"mergeState",async(e,s)=>{var a,i,c;const o=JSON.parse(JSON.stringify(s));(a=e.config).fontFamily??(a.fontFamily={});const r=(i=o.config)==null?void 0:i.fontFamily,l=(c=e.config)==null?void 0:c.fontFamily;e.config.fontFamily.title=(r==null?void 0:r.title)||(l==null?void 0:l.title),e.config.fontFamily.description=(r==null?void 0:r.description)||(l==null?void 0:l.description),await new Promise((u,p)=>{this.transact(async()=>{try{const f=await _e(e,s);u(f)}catch(f){p(f)}})})});v(this,"addConnection",e=>{if(this.conns.has(e))return;e.binaryType="arraybuffer",this.conns.set(e,new Set),e.on("message",r=>this.messageListener(e,new Uint8Array(r)));let s=!0;const o=setInterval(()=>{if(!s)this.conns.has(e)&&this.closeConn(e),clearInterval(o);else if(this.conns.has(e)){s=!1;try{e.ping()}catch{this.closeConn(e),clearInterval(o)}}},is);e.on("close",()=>{this.closeConn(e),clearInterval(o)}),e.on("pong",()=>{s=!0});{const r=_.createEncoder();_.writeVarUint(r,ue),Ee.writeSyncStep1(r,this),this.send(e,_.toUint8Array(r));const l=this.awareness.getStates();if(l.size>0){const a=_.createEncoder();_.writeVarUint(a,Te),_.writeVarUint8Array(a,X.encodeAwarenessUpdate(this.awareness,Array.from(l.keys()))),this.send(e,_.toUint8Array(a))}}});v(this,"messageListener",(e,s)=>{try{const o=_.createEncoder(),r=be.createDecoder(s),l=be.readVarUint(r);switch(l){case ue:_.writeVarUint(o,ue),Ee.readSyncMessage(r,o,this,null),_.length(o)>1&&(this.ensureDataStructure(),this.send(e,_.toUint8Array(o)));break;case Te:{X.applyAwarenessUpdate(this.awareness,be.readVarUint8Array(r),e);break}default:E.warn(`Unsupported messageType ${l}`)}}catch(o){E.error(o)}this.save()});this.options=e,h.existsSync(this.draftYjsFilePath)&&K.applyUpdate(this,h.readFileSync(this.draftYjsFilePath)),this.syncedStore=Tt.reactive(le.syncedStore({pages:{},pageIds:[],components:{},supportedLocales:[],config:{},resources:{}},this)),this.initObserver(),this.on("update",this.updateHandler),this.awareness=new X.Awareness(this),this.awareness.on("update",this.awarenessChangeHandler),this.ensureDataStructure()}static safeDeleteProjectStateDir(e){if(!e)throw new Error("Should provide project context");try{const s=d.join(Z,e),o=d.join(Z,`@del-${e}`);h.renameSync(s,o)}catch(s){E.error("Failed to safe delete project state dir:",s)}}static get projectIds(){return je.globSync("*/",{cwd:Z,ignore:["@del-*","@tmp-*",".*","staging","production","@backup-*"]})}static get allShared(){return this.projectIds.map(e=>H.shared(e))}static shared(e){if(!e)throw new Error("Should provide project context");let s=this.sharedInstances.get(e);return s||(s=new H({path:d.join(Z,e)}),this.sharedInstances.set(e,s),s)}destroy(){this.conns.forEach((e,s)=>this.closeConn(s)),this.awareness.destroy(),super.destroy()}initObserver(){const e=o=>{o.observeDeep(r=>{r.some(l=>l.changes.keys.has("updatedAt")||l.changes.keys.has("publishedAt"))||o.set("updatedAt",new Date().toISOString())})};this.syncedStore.pages&&Object.keys(this.syncedStore.pages).forEach(o=>{const r=le.getYjsValue(this.syncedStore.pages[o]);r&&r instanceof K.Map&&e(r)});const s=le.getYjsValue(this.syncedStore.pages);s&&s instanceof K.Map&&s.observe(o=>{o.changes.keys.forEach((r,l)=>{if(r.action==="add"){const a=le.getYjsValue(this.syncedStore.pages[l]);a&&a instanceof K.Map&&e(a)}})})}get draftYjsFilePath(){return d.join(this.options.path,"draft.yjs")}async getState(e){var s,o,r,l;if(e==="draft")return JSON.parse(JSON.stringify(this.syncedStore));if(!this.states[e]&&(this.states[e]=await Ne(this.getPublishDir(e),{includeResources:!0})??ds(),!((o=(s=this.states[e])==null?void 0:s.config)!=null&&o.defaultLocale))){(r=this.states[e]).config??(r.config={});const a=ve.env.languages.map(i=>({locale:i.code,name:i.name}));this.states[e].config.defaultLocale=(l=a[0])==null?void 0:l.locale}return{...this.states[e],resources:await ye().then(async a=>{var p,f,g,S;const{pages:i,components:c}=N.pick(a,"pages","components");let u=c;if((f=(p=this.states[e])==null?void 0:p.resources)!=null&&f.components)u={...(S=(g=this.states[e])==null?void 0:g.resources)==null?void 0:S.components};else{const A=d.basename(this.options.path),D=await V.findByPk(A);if(D!=null&&D.useAllResources)u=c;else{const R=(await he.findAll({where:{projectId:A}})).map(b=>b.componentId);u=Object.fromEntries(Object.entries(c||{}).filter(([b])=>R.includes(b)))}}return{pages:i,components:u}}).catch(()=>({}))}}async setState(e,s){const o=await rt(s,{exportAssets:!1,includeResources:!0}),r=this.getPublishDir(e);h.mkdirSync(d.dirname(r),{recursive:!0}),h.rmSync(r,{force:!0,recursive:!0}),h.renameSync(o,r),this.states[e]=s}getPublishDir(e){return d.join(this.options.path,e)}static async pageUrlMap(e){const{projectIds:s}=this,o={};for(const r of s){const l=await V.findByPk(r);if(!l)continue;const a=await H.shared(r).getState(e),i=N.union(w.default.env.languages.map(c=>c.code),a.supportedLocales.map(c=>c.locale));for(const c of a.pageIds){const u=a.pages[c];if(!u||e==="production"&&!u.isPublic)continue;const p=u.slug,f=l.slug||r,g={projectId:r,projectSlug:f,pageSlug:p,pageId:c,defaultLocale:i==null?void 0:i[0],locales:i,publishedAt:a.config.publishedAt,isPublic:u.isPublic,isTemplate:u.isTemplate};f&&(o[k.joinURL("/",f,p)]={...g,shouldRedirect:!0,mainPage:!0}),o[k.joinURL("/",r,p)]={...g,shouldRedirect:!0,mainPage:!0};for(const S of i){const A={...g,locale:S};o[k.joinURL("/",S,r,p)]=A,f&&(o[k.joinURL("/",S,f,p)]=A)}}}return o}getDocumentSize(){return K.encodeStateAsUpdate(this).byteLength}static getInstancesSizeInfo(){const e=[];for(const[s,o]of this.sharedInstances.entries()){const r=o.getDocumentSize();e.push({projectId:s,sizeInBytes:r,sizeInMB:`${(r/(1024*1024)).toFixed(2)} MB`,activeConnections:o.conns.size})}return e}};v(H,"INSTANCE_TTL",30*60*1e3),v(H,"sharedInstances",new De.LRUCache({max:100,ttl:H.INSTANCE_TTL,dispose:e=>{e.destroy()}}));let re=H;function nt(){return h.mkdtempSync(d.join(w.default.env.dataDir,"tmp-"))}function fe(t,n,e=[]){return Array.isArray(t)?t.flatMap((s,o)=>fe(s,n,[...e,o])):typeof t=="object"?t===null?[]:Object.entries(t).flatMap(([s,o])=>fe(o,n,[...e,s])):n(t)?[e]:[]}function F(t){return t.filter(n=>n!=null)}async function fs(t,n,e){if(!t||!h.existsSync(t)||!h.lstatSync(t).isFile())return null;let s=e[t];return s||(s=(async()=>{var o;try{const r=(o=await rs({filePath:t,fileName:n}))==null?void 0:o.data;return r==null?void 0:r.filename}catch(r){return E.error(`Failed to upload asset ${t}:`,r),null}})(),e[t]=s),s}const ms=async(t,n)=>{const e=d.basename(t),s=await xe.call({name:ke,path:k.joinURL("/uploads",e),responseType:"stream",method:"GET"});if(s.status>=200&&s.status<400){const o=h.createWriteStream(n);await Pt.pipeline(s.data,o)}else throw new Error(`download asset failed ${s.status}`)},gs=async(t,n)=>{await Promise.all(t.map(async e=>{try{await ms(e,d.join(n,d.basename(e)))}catch(s){E.error(`Failed to export assets: ${e}, ${s}`)}}))};function ot(t){return Re.test(t)?[t]:se.test(t)?(Be.lastIndex=0,Array.from(t.matchAll(Be)).map(e=>e[1]).filter(e=>!!e)):[]}async function Ie(t,n,e){const{getFilename:s,exportAssets:o}=e,r=d.join(n,s(t));if(h.mkdirSync(d.dirname(r),{recursive:!0}),h.writeFileSync(r,ee.stringify(t)),o){const a=fe(t,i=>typeof i=="string"&&(Re.test(i)||se.test(i))).map(i=>{const c=N.get(t,i);return ot(c)}).flat().filter(Boolean);await gs(a,d.dirname(r))}}const He=new De.LRUCache({max:1e3,ttl:30*24*60*60*1e3});async function Ve(t,n,e){var a;const s=fe(t,i=>typeof i=="string"&&(Re.test(i)||se.test(i))),o=Ft.default(2),r=s.map(i=>o(async()=>{try{const c=N.get(t,i),u=ot(c);for(const p of u){const f=d.basename(p),g=e.getFilePath(p,i),S=g?`${g}:${f}`:f,A=He.get(S);if(A){se.test(c)||N.set(t,i,A);return}const D=await fs(g,f,n);D&&(se.test(c)||N.set(t,i,D),He.set(S,D))}}catch(c){E.error(`Failed to process upload for path ${i.join(".")}:`,c.message||c.reason)}})),l=await Promise.allSettled(r);(a=e.onFinish)==null||a.call(e,l)}async function rt(t,{exportAssets:n,pageIds:e="all",componentIds:s="all",rawConfig:o,includeResources:r=!1}={}){var q,R,y,b,T,I,G,j,U,z,ce,W;const l=e==="all"?t.pageIds:e,a=ne.getComponentDependencies({state:t,pageIds:l,componentIds:s==="all"?Object.keys(t.components):s}),i=(m,C)=>{var P;return{id:m.id,name:m.name,isTemplateSection:m.isTemplateSection??!1,templateDescription:m.templateDescription,llmConfig:m.llmConfig,component:m.component,config:m.config,visibility:m.visibility,properties:((P=m.locales)==null?void 0:P[C])??{}}},c=(m,C)=>{var P;return{id:m.id,createdAt:m.createdAt,updatedAt:m.updatedAt,publishedAt:m.publishedAt,isPublic:m.isPublic??!0,isTemplate:m.isTemplate??!1,meta:((P=m.locales)==null?void 0:P[C])??{},sections:F(m.sectionIds.map(B=>{const $=m.sections[B];return $&&i($,C)}))}},u=F(t.supportedLocales.map(m=>m.locale).flatMap(m=>l.map(C=>{const P=t.pages[C];return P&&{locale:m,slug:P.slug,page:c(P,m)}}))),p=nt(),f=d.join(p,"pages");h.mkdirSync(f,{recursive:!0});const g=d.join(p,"components");h.mkdirSync(g,{recursive:!0});for(const{locale:m,slug:C,page:P}of u)await Ie(P,f,{getFilename:()=>`${st(C)||"index"}.${m}.yml`,exportAssets:n});for(const m of a){const C=(q=t.components[m])==null?void 0:q.data;C&&await Ie(C,g,{getFilename:P=>`${P.name||"unnamed"}.${P.id}.yml`,exportAssets:n})}const S=d.join(p,".blocklet/pages/pages.config.yml");h.mkdirSync(d.dirname(S),{recursive:!0});const A={pages:F(l.map(m=>{const C=t.pages[m];return C&&{id:m,slug:C.slug}})),components:F(a.map(m=>{var P;const C=(P=t.components[m])==null?void 0:P.data;return C&&{id:m,name:C.name}})),...r?{resources:{components:F(Object.keys(((R=t.resources)==null?void 0:R.components)||{}).filter(m=>a.includes(m)).map(m=>{var C,P,B,$;return{id:m,name:($=(B=(P=(C=t.resources)==null?void 0:C.components)==null?void 0:P[m])==null?void 0:B.component)==null?void 0:$.name}}))}}:{},supportedLocales:t.supportedLocales,config:t.config};h.writeFileSync(S,ee.stringify(A));const D=d.join(p,"config.source.json");if(o&&h.writeFileSync(D,JSON.stringify(o)),r){const m=d.join(p,"resources"),C=d.join(m,"components");h.mkdirSync(C,{recursive:!0});for(const $ of Object.keys(((y=t==null?void 0:t.resources)==null?void 0:y.components)??{}).filter(M=>a.includes(M))){const M=(I=(T=(b=t.resources)==null?void 0:b.components)==null?void 0:T[$])==null?void 0:I.component;M&&await Ie(M,C,{getFilename:J=>`${J.name||"unnamed"}.${J.id}.yml`,exportAssets:n})}const P=d.join(p,"chunks");h.mkdirSync(P,{recursive:!0});const{chunks:B}=await ye();for(const $ of Object.keys(((G=t==null?void 0:t.resources)==null?void 0:G.components)??{}).filter(M=>a.includes(M))){const M=(z=(U=(j=t.resources)==null?void 0:j.components)==null?void 0:U[$])==null?void 0:z.component;if(M&&((ce=M.renderer)==null?void 0:ce.type)==="react-component"){const J=((W=M.renderer)==null?void 0:W.chunks)??[];if((J==null?void 0:J.length)>0)for(const Se of J){const Fe=d.join(P,Se),we=B==null?void 0:B[Se];try{we&&h.existsSync(we)&&!h.existsSync(Fe)&&h.copyFileSync(we,Fe)}catch(ut){E.error(`copy chunk ${Se} error`,ut.message)}}}}}return p}async function Ne(t,{importAssets:n,includeResources:e}={}){var r,l,a;if(!h.existsSync(t))return null;let s,o=!1;try{h.lstatSync(t).isDirectory()?s=t:/\.(tgz|gz|tar)$/.test(t)&&(o=!0,s=nt(),await At.x({file:t,C:s}));const i=je.globSync("**/.blocklet/pages/pages.config.yml",{cwd:s,absolute:!0}).at(0),c=i&&d.join(d.dirname(i),"../../pages"),u=i&&d.join(d.dirname(i),"../../components"),p=i&&d.join(d.dirname(i),"../../chunks");if(!i)return null;const f=ee.parse(h.readFileSync(i).toString()),g=(y,b,T)=>{let I=d.join(y,`${b}${T?`.${T}`:""}.yml`);return(!h.existsSync(I)||!h.lstatSync(I).isFile())&&(I=d.join(y,b,`index${T?`.${T}`:""}.yml`),!h.existsSync(I)||!h.lstatSync(I))?null:ee.parse(h.readFileSync(I).toString())},S=(y,b)=>{try{const T=je.globSync(`*.${b}.yml`,{cwd:y,absolute:!0})[0];return T?ee.parse(h.readFileSync(T).toString()):null}catch(T){E.error("parse component error",T)}return null},A=F(f.pages.map(({slug:y})=>{var G;const b=F(f.supportedLocales.map(({locale:j})=>{const U=c?g(c,st(y),j):void 0;if(U)return{locale:j,page:U};const z=c?g(c,y,j):void 0;return z&&{locale:j,page:z}})),T=(G=b[0])==null?void 0:G.page;if(!T)return null;const I=T.sections.map(j=>{const U=j.id||Ae();return{id:U,component:j.component,config:j.config,name:j.name,isTemplateSection:j.isTemplateSection??!1,templateDescription:j.templateDescription,llmConfig:j.llmConfig,visibility:j.visibility,locales:Object.fromEntries(F(b.map(({locale:z,page:ce})=>{const W=ce.sections.find(m=>m.id===U);return W&&[z,W.properties]})))}});return{id:T.id||Ae(),createdAt:T.createdAt,updatedAt:T.updatedAt,publishedAt:T.publishedAt,isPublic:T.isPublic??!0,isTemplate:T.isTemplate??!1,slug:y,sections:Object.fromEntries(I.map(j=>[j.id,j])),sectionIds:I.map(j=>j.id),locales:Object.fromEntries(b.map(({locale:j,page:U})=>[j,U.meta]))}})),D=u?F(((r=f.components)==null?void 0:r.map(({id:y})=>S(u,y)))??[]):[];if(n){const y=(...b)=>{E.info(`[${o?d.basename(t):d.basename(d.join(t,"../../../../"))}] importAssets:`,...b)};try{y("wait image-bin api ready"),await $t.default({resources:[`${xe.getComponentWebEndpoint(Ht)}/api/sdk/uploads`],validateStatus:I=>I>=200&&I<=500}),y("image-bin api is ready");const b={},T={};y("start to upload assets"),await Promise.allSettled([Ve(D,b,{getFilePath:I=>u&&d.join(u,I),onFinish:I=>{y(`upload ${I.length} component assets`)}}),Ve(A,T,{getFilePath:(I,G)=>{const j=N.get(A,G.slice(0,1));return c&&d.join(c,d.dirname(j.slug),I)},onFinish:I=>{y(`upload ${I.length} page assets`)}})]),y("upload assets done"),global.gc&&global.gc()}catch(b){y("Error during asset import:",b)}}const q={};if(e){const y=i&&d.join(d.dirname(i),"../../resources/components"),b=F(((a=(l=f.resources)==null?void 0:l.components)==null?void 0:a.map(({id:T})=>S(y,T)))??[]);b.length>0&&(q.components=Object.fromEntries(b.map((T,I)=>[T.id,{index:I,component:T}])))}const R={};if(p&&h.existsSync(p)){const y=h.readdirSync(p);for(const b of y)R[b]=d.join(p,b)}return{supportedLocales:f.supportedLocales,pageIds:A.map(y=>y.id),components:Object.fromEntries(D.map((y,b)=>[y.id,{index:b,data:y}])),pages:Object.fromEntries(A.map(y=>[y.id,y])),config:f.config||{},resources:q,chunks:R}}finally{o&&s&&h.rmSync(s,{force:!0,recursive:!0})}}async function _e(t,n,{pages:e,pageMergeMode:s="byUpdateTime",deletePages:o=!1,publishMode:r=void 0}={}){try{r&&We(r)}catch(u){E.error("clear preload page cache error",{error:u})}const{pageIds:l,pages:a,supportedLocales:i}=t;for(const u of e??l){const p=a[u];if(!p){const f=n.pageIds.indexOf(u);f!==-1&&o&&(n.pageIds.splice(f,1),delete n.pages[u]);continue}if(n.pageIds.includes(p.id)){if(s==="replace")n.pages[p.id]=p;else if(s==="byUpdateTime"){const f=n.pages[p.id];(!f||p.updatedAt&&p.updatedAt>f.updatedAt)&&(n.pages[p.id]=p)}}else n.pageIds.push(p.id),n.pages[p.id]=p}if(o&&!e)for(const u of n.pageIds)t.pageIds.includes(u)||delete n.pages[u],n.pageIds=[...n.pageIds].filter(p=>t.pageIds.includes(p));if(n.supportedLocales.splice(0,n.supportedLocales.length),n.supportedLocales.push(...N.cloneDeep(i)),o)for(const u of Object.keys(n.components))delete n.components[u];let c=JSON.parse(JSON.stringify(t.components));c=Object.fromEntries(await Promise.all(Object.entries(c).map(async([u,p])=>{const f=await at(p==null?void 0:p.data);return[u,{...p,data:f}]}))),Object.assign(n.components,c),Object.assign(n.config,JSON.parse(JSON.stringify(t.config))),n.resources.components=JSON.parse(JSON.stringify(t.resources.components||{}))}const at=Y.memoize(async t=>{var n;if(!N.isEmpty(t==null?void 0:t.properties))return t;if(((n=t==null?void 0:t.renderer)==null?void 0:n.type)==="react-component"){const{script:e}=(t==null?void 0:t.renderer)||{};if(e&&e.includes("PROPERTIES_SCHEMA"))try{const s=await tt(e,"PROPERTIES_SCHEMA",t.id);s&&s.length>0&&t&&(t.properties={},s.forEach((o,r)=>{t!=null&&t.properties&&(t.properties[o.id]={index:r,data:o})}))}catch(s){E.error("checkPropertiesFromCode error",{componentId:t.id,name:t.name},{error:s})}}return t},{keyGenerator:t=>{var l;const n=(t==null?void 0:t.id)||"",e=(t==null?void 0:t.name)||"",s=((l=t==null?void 0:t.renderer)==null?void 0:l.type)||"",o=(t==null?void 0:t.properties)||{},r=ge.createHash("md5").update(JSON.stringify(o)).digest("hex");return JSON.stringify(["checkPropertiesFromCode",n,e,s,r])},lruOptions:{max:100,ttl:1e3*60*60}});let me,Q,Le,Ue,Me;function it(){return me=(async()=>{const t=xe.getResources({types:[{did:ke,type:Ce},{did:os,type:Ce}]});Q=(await Promise.all(t.map(async e=>{const s=e.path?await Ne(e.path,{importAssets:!1}):void 0;return s?{blockletId:e.did,state:s,blockletTitle:e.title}:void 0}))).filter(e=>!!e),Le=Q.reduce((e,s)=>Object.assign(e,Object.fromEntries(Object.values(s.state.pages).map(o=>o?[o==null?void 0:o.id,{page:o,blockletId:s.blockletId}]:[]))),{});const n=Q.reduce((e,s)=>Object.assign(e,Object.fromEntries(Object.values(s.state.components).map(o=>[o.data.id,{blockletId:s.blockletId,component:o.data}]))),{});Ue=Object.fromEntries(await Promise.all(Object.entries(n).map(async([e,s])=>{const o=await at(s.component);return[e,{...s,component:o}]}))),Me=Q.reduce((e,s)=>Object.assign(e,s.state.chunks),{})})(),me}function ct(t){const n=N.debounce(async()=>{await it().catch(e=>{E.error("load resource states error",{error:e})}),await(t==null?void 0:t({states:Q,pages:Le,components:Ue,chunks:Me}))},3e3,{leading:!1,trailing:!0});return n(),w.default.events.on(w.default.Events.componentAdded,n),w.default.events.on(w.default.Events.componentRemoved,n),w.default.events.on(w.default.Events.componentStarted,n),w.default.events.on(w.default.Events.componentStopped,n),w.default.events.on(w.default.Events.componentUpdated,n),w.default.events.on(Pe,n),()=>{w.default.events.off(w.default.Events.componentAdded,n),w.default.events.off(w.default.Events.componentRemoved,n),w.default.events.off(w.default.Events.componentStarted,n),w.default.events.off(w.default.Events.componentStopped,n),w.default.events.off(w.default.Events.componentUpdated,n),w.default.events.off(Pe,n)}}const lt=Symbol.for("GLOBAL_RESOURCE_STATES_LISTENER_KEY"),de=globalThis;var Ge;(Ge=de[lt])==null||Ge.call(de);de[lt]=ct(async({pages:t,components:n})=>{const{projectIds:e}=re;E.info(`start update resource states projects(${e.length})`,e),await Promise.race([new Promise(s=>{setTimeout(()=>{E.error("update resource states timeout"),s({})},30*1e3)}),Promise.all(e.map(async s=>{const o=re.shared(s);o.syncedStore.resources.pages=t;const r=await V.findByPk(s);if(r!=null&&r.useAllResources)o.syncedStore.resources.components=n;else{const a=(await he.findAll({where:{projectId:s}})).map(c=>c.componentId),i=Object.fromEntries(Object.entries(n||{}).filter(([c])=>a.includes(c)));o.syncedStore.resources.components=i}E.info(`update [${s}] resource states:`,{pages:Object.keys(o.syncedStore.resources.pages||{}).length,components:Object.keys(o.syncedStore.resources.components||{}).length})}))]).catch(s=>{E.error("update resource states failed:",s)})});async function hs(){E.info("trigger reload all project resource"),w.default.events.emit(Pe)}async function ye({ensureLoaded:t=!0}={}){return t&&(me??(me=it()),await me),{states:Q,pages:Le,components:Ue,chunks:Me}}exports.COMPONENT_DID=ke;exports.CUSTOM_COMPONENT_CACHE_DURATION_IN_SECONDS=Ye;exports.GET_SERVER_SIDE_PROPS_TIMEOUT_IN_SECONDS=Oe;exports.PUBLISH_MODES=ps;exports.Project=V;exports.RESOURCE_TYPE=Ce;exports.SITE_STATE_PATH=Z;exports.STATE_MODES=us;exports.SiteState=re;exports.clearPreloadComponentsCache=Qe;exports.clearPreloadComponentsCacheByMode=We;exports.fromPackage=Ne;exports.getComponentFromState=oe;exports.getComponentFromStateByName=ts;exports.getExportSchemaValueFromCode=tt;exports.getMultiTenantAllProjectAccessPassports=zt;exports.getPreloadComponent=Ze;exports.getPreloadComponents=Xt;exports.getPreloadComponentsCacheKey=Xe;exports.getResourceStates=ye;exports.initPackResourceStates=ct;exports.isMultiTenant=Gt;exports.logger=E;exports.mergeState=_e;exports.nextId=Ae;exports.toPackage=rt;exports.triggerReloadAllProjectResource=hs;
|