@fugood/bricks-cli 2.25.0-beta.68 → 2.25.0-beta.70
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/1010.js +1 -1
- package/lib/1708.js +2 -2
- package/lib/2486.js +1 -1
- package/lib/6818.js +1 -1
- package/lib/7511.js +1 -1
- package/lib/8117.js +1 -1
- package/lib/9590.js +3 -3
- package/lib/index.js +2 -2
- package/package.json +9 -9
package/lib/2486.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const __rspack_esm_id=2486;export const __rspack_esm_ids=[2486];export const __webpack_modules__={421(e,r,a){a.r(r),a.d(r,{buildDoctorReport:()=>k,renderDoctorReport:()=>v});var o,i,t=a(99436),s=a(85382),n=a(8479),c=a(7586),p=a(47988),l=(o=t(function*(){try{return yield Promise.all([a.e(9866),a.e(6645),a.e(4479),a.e(7648),a.e(853),a.e(1010),a.e(8117)]).then(a.bind(a,98372)),{available:!0}}catch(e){return{available:!1,error:e.message}}}),function(){return o.apply(this,arguments)}),u=(e,r,a)=>({severity:e,code:r,message:a}),k=(i=t(function*({version:e="2.25.0-beta.
|
|
1
|
+
export const __rspack_esm_id=2486;export const __rspack_esm_ids=[2486];export const __webpack_modules__={421(e,r,a){a.r(r),a.d(r,{buildDoctorReport:()=>k,renderDoctorReport:()=>v});var o,i,t=a(99436),s=a(85382),n=a(8479),c=a(7586),p=a(47988),l=(o=t(function*(){try{return yield Promise.all([a.e(9866),a.e(6645),a.e(4479),a.e(7648),a.e(853),a.e(1010),a.e(8117)]).then(a.bind(a,98372)),{available:!0}}catch(e){return{available:!1,error:e.message}}}),function(){return o.apply(this,arguments)}),u=(e,r,a)=>({severity:e,code:r,message:a}),k=(i=t(function*({version:e="2.25.0-beta.70",mcpCheck:r=l}={}){var a=(0,p.getCurrentProfile)(),o=(0,p.getCurrentProfileSource)(),i=(0,p.getTokenInfo)(a),t=(0,p.getBaseUrl)(),k=(0,p.getActivityLogBaseUrl)(),h=[],v={ok:!1,timestamp:new Date().toISOString(),cli:{name:"bricks",version:e},profile:{name:a,source:o},config:{path:p.CONFIG_PATH,baseUrl:t,activityLogBaseUrl:k},auth:{available:!!i?.token,source:i?.token?"config":"missing",workspaceId:i?.workspaceId||null,workspaceName:i?.workspaceName||null,createdAt:i?.createdAt||null,tokenPreview:(0,c.$l)(i?.token)},connectivity:{workspace:{ok:!1,skipped:!i?.token,error:null}},capabilities:{zeroArgMode:(0,n.isInteractiveTerminal)()?"interactive":"help",mcp:{available:!1,error:null}},issues:h};if(i?.token)try{var d=yield(0,s.createClient)(t,i.token).workspace();v.connectivity.workspace={ok:!0,skipped:!1,error:null,id:d?._id||i.workspaceId||null,name:d?.name||i.workspaceName||null},v.auth.workspaceId=d?._id||v.auth.workspaceId,v.auth.workspaceName=d?.name||v.auth.workspaceName}catch(e){v.connectivity.workspace={ok:!1,skipped:!1,error:e.message},h.push(u("error","workspace_unreachable",`Workspace query failed for ${t}: ${e.message}`))}else h.push(u("warning","auth_missing","No saved token for the current profile."));var m=yield r();return v.capabilities.mcp={available:m.available,error:m.error||null},m.available||h.push(u("warning","mcp_unavailable",`MCP stdio server is unavailable: ${m.error||"Unknown error"}`)),v.ok=0===h.length,v}),function(){return i.apply(this,arguments)}),h=(e,r,a)=>`${e.padEnd(14)} ${r}${a?` ${a}`:""}`,v=e=>{var r=[];if(r.push("BRICKS CLI Doctor"),r.push("─".repeat(60)),r.push(h("CLI","OK",`bricks v${e.cli.version}`)),r.push(h("Profile","OK",`${e.profile.name} (${e.profile.source})`)),r.push(h("BRICKS API","OK",e.config.baseUrl)),r.push(h("Activity Log","OK",e.config.activityLogBaseUrl)),e.auth.available){var a=e.auth.workspaceName||e.auth.workspaceId||"Unknown workspace";r.push(h("Auth","OK",`${a} (${e.auth.source}, ${e.auth.tokenPreview})`))}else r.push(h("Auth","WARN","No saved token for the current profile"));if(e.connectivity.workspace.skipped)r.push(h("Workspace","WARN","Skipped because no token is available"));else if(e.connectivity.workspace.ok){var o=e.connectivity.workspace.name||e.connectivity.workspace.id||"Unknown workspace";r.push(h("Workspace","OK",o))}else r.push(h("Workspace","FAIL",e.connectivity.workspace.error));return e.capabilities.mcp.available?r.push(h("MCP","OK","STDIO server import is available")):r.push(h("MCP","WARN",e.capabilities.mcp.error)),r.push(h("Zero-arg mode",((e,r=!1)=>e?"OK":r?"WARN":"FAIL")("interactive"===e.capabilities.zeroArgMode,"help"===e.capabilities.zeroArgMode),"interactive"===e.capabilities.zeroArgMode?"Starts Ink interactive mode on TTY":"Shows help outside TTY contexts")),e.issues.length>0&&(r.push("─".repeat(60)),r.push("Issues"),e.issues.forEach(e=>{r.push(`- [${e.severity}] ${e.message}`)})),r.join("\n")}}};
|
package/lib/6818.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const __rspack_esm_id=6818;export const __rspack_esm_ids=[6818];export const __webpack_modules__={53241(e,t,r){r.r(t),r.d(t,{detectChannel:()=>i,detectInstallMethod:()=>o});var a=r(73024),n=r(76760),s=r(48161),l=e=>{if(!e)return e;try{return a.realpathSync(e)}catch{return e}},i=({version:e,execPath:t}={})=>{var r=t||process.execPath;return r&&/[\\/]bricks-beta(?:\.exe)?$/i.test(r)||/-(beta|alpha|rc|next)\b/i.test(e||"2.25.0-beta.
|
|
1
|
+
export const __rspack_esm_id=6818;export const __rspack_esm_ids=[6818];export const __webpack_modules__={53241(e,t,r){r.r(t),r.d(t,{detectChannel:()=>i,detectInstallMethod:()=>o});var a=r(73024),n=r(76760),s=r(48161),l=e=>{if(!e)return e;try{return a.realpathSync(e)}catch{return e}},i=({version:e,execPath:t}={})=>{var r=t||process.execPath;return r&&/[\\/]bricks-beta(?:\.exe)?$/i.test(r)||/-(beta|alpha|rc|next)\b/i.test(e||"2.25.0-beta.70")?"beta":"release"},o=({execPath:e=process.execPath,scriptPath:t=process.argv[1],homeDir:r=s.homedir(),realpath:a=l}={})=>{let i;var o=(i=e)?n.basename(i).replace(/\.exe$/i,""):"";if("bricks"===o||"bricks-beta"===o)return{method:"binary",execPath:e,installDir:n.dirname(e)};var c=a(t),p=((e,t)=>{if(!e)return null;var r=n.sep,a=`${r}node_modules${r}${t.replace(/\//g,r)}${r}`,s=e.indexOf(a);return -1===s?null:e.slice(0,s)})(c,"@fugood/bricks-cli");if(p){var b=n.sep,d=n.join(r,".bun","install","global");return p===d||p.startsWith(d+b)?{method:"bun",installRoot:p}:/[\\/](?:\.pnpm|pnpm[\\/]global)[\\/]/.test(p)?{method:"pnpm",installRoot:p}:/[\\/](?:\.yarn|yarn[\\/]global)[\\/]/.test(p)?{method:"yarn",installRoot:p}:{method:"npm",installRoot:p.endsWith(`${b}lib`)?p.slice(0,-`${b}lib`.length):p}}return{method:"unknown",execPath:e,scriptPath:c}}}};
|
package/lib/7511.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const __rspack_esm_id=7511;export const __rspack_esm_ids=[7511];export const __webpack_modules__={66422(e,t){let a=e=>`PROPERTY_BANK_DATA_NODE_${e}`,i={isLocalSyncMainDevice:{id:a("325068e3-89b6-4c6a-942b-126d38c84a62"),title:"SYSTEM: Is Local Sync Main Device",description:"The current device is main for local sync",type:"bool",value:!0},currentCanvasId:{id:a("2dfeb635-deb4-481a-9d17-ea7b1fe19f74"),title:"SYSTEM: Current Canvas ID",description:"ID for known current canvas",type:"string",value:""},previousCanvasId:{id:a("2971e463-0b0e-45b7-bbfb-a01d8fd49db3"),title:"SYSTEM: Previous Canvas ID",description:"ID for known previous canvas",type:"string",value:""},canvasIdHistory:{id:a("1a086f39-817d-40ed-92f0-5a999535d3dd"),title:"SYSTEM: Change Canvas History",description:"Change Canvas ID History (Limit: 10)",type:"array",schema:{type:"string",allowNewItem:!1,allowCustomProperty:!1},value:[]},rootSubspaceInfo:{id:a("c0817f4a-1ff3-40ed-9cbf-71d8cefd2cd9"),title:"SYSTEM: Root Subspace Info",description:"Root Subspace Information",type:"object",value:{}},subspaceInfo:{id:a("2657ec09-7323-46c3-a96e-3d8b5a0f79b3"),title:"SYSTEM: Current Subspace Info",description:"Current Subspace Information",type:"object",value:{}},uniqueID:{id:a("6f4a543f-a88a-4a83-bf53-223259263be3"),title:"SYSTEM: Unique ID",description:"Unique ID of current device",type:"string",value:"unknown"},appVersion:{id:a("d614a258-2a45-4f91-9f6b-3936038cb2b1"),title:"SYSTEM: App Version",description:"App Version of current installed BRICKS Foundation app",type:"string",value:"unknown"},lastUpdateTime:{id:a("956f3b3e-cb0b-47ca-8119-65663910d110"),title:"SYSTEM: Last Update Time",description:"Last update time of current installed BRICKS Foundation app",type:"string",value:"2019-07-09T03:32:27.058Z"},deviceName:{id:a("7b9d9ad4-e9a2-47cd-91d3-b64187895c16"),title:"SYSTEM: Device Name",description:"Name of current device",type:"string",value:"Default Device Name"},deviceType:{id:a("b0beae12-e45e-4870-ae15-858eeac566fa"),title:"SYSTEM: Device Type",description:"Type of current device (Handset, Tv, Tablet)",type:"string",value:"Tv"},operationMode:{id:a("2e715d3b-92bf-4761-b5c0-ca21f7c1ada8"),title:"SYSTEM: Operation Mode",description:"Operation Mode of current device (android, ios, ...)",type:"string",value:"android"},operationVersion:{id:a("fa886963-0a16-4b5f-b4ea-6c25b049db03"),title:"SYSTEM: Operation Version",description:"Operation Version of current device",type:"string",value:""},screenWidth:{id:a("2942470a-c3bc-413e-8f2c-30a89aded3f8"),title:"SYSTEM: Screen Width",description:"Width of current device main screen",type:"number",value:1280},screenHeight:{id:a("4f031e27-f67b-40e0-a317-9f6c5215d97d"),title:"SYSTEM: Screen Height",description:"Height of current device main screen",type:"number",value:768},screenScale:{id:a("c3c9b7aa-1dc1-4be1-8a4a-d9e299b9eeaa"),title:"SYSTEM: Screen Scale",description:"Scale of current device main screen",type:"number",value:2},screenFontScale:{id:a("0312f380-d525-4938-82d2-5b35ef8ef1e8"),title:"SYSTEM: Screen Font Scale",description:"Font scale of current device main screen",type:"number",value:1},orientation:{id:a("4f584f51-a250-4f97-a2f8-d5e6a3affb4f"),title:"SYSTEM: Orientation",description:"Orientation of current device main screen",type:"string",value:"landspace"},touchAvailable:{id:a("1fe7555f-df41-43ce-a268-3ea1b5efda6d"),title:"SYSTEM: Touch Available",description:"Is touch available of current device main screen?",type:"bool",value:!0},soundAvailable:{id:a("bf839498-f7d6-4212-ac3a-b409e3ad77a5"),title:"SYSTEM: Sound Available",description:"Is sound available of current device?",type:"bool",value:!0},cameraAvailable:{id:a("4878f3c2-8bb8-4c94-855c-06bda5a287d5"),title:"SYSTEM: Camera Available",description:"Is camera available of current device?",type:"bool",value:!0},audioInputAvailable:{id:a("4854b259-96c1-40d7-b17b-47156b4698dc"),title:"SYSTEM: Audio Input Available",description:"Is audio input available of current device?",type:"bool",value:!1},networkType:{id:a("1cbb1756-e53c-45a9-be23-5d84a214e144"),title:"SYSTEM: Network Type",description:"Network Type of current device",type:"string",value:"wifi"},networkConnected:{id:a("687b62fe-ead5-417a-b415-9bd5233784a4"),title:"SYSTEM: Network Connected",description:"Is Network connected of current device?",type:"bool",value:!0},networkIpAddress:{id:a("41971ba7-8294-4aa6-a425-ecd39853c3e6"),title:"SYSTEM: Network IP Address",description:"Current network IP address",type:"string",value:""},networkDetails:{id:a("9351fbfc-4ace-477a-b05d-41ac9b05087d"),title:"SYSTEM: Network Details",description:"Network details, provide different data depends on Network Type",type:"object",value:null},isInternetReachable:{id:a("e367ae7e-46ec-46d0-b87d-51e544591ff9"),title:"SYSTEM: Internet Reachable",description:"Is Internet reachable?",type:"bool",value:!0},isWifiEnabled:{id:a("be395305-fb85-4d05-8506-22a4ae8c7b9e"),title:"SYSTEM: Wifi Enabled",description:"Is WiFi enabled?",type:"bool",value:!0},deviceDisplayName:{id:a("76356a9a-fc46-11ec-9905-db53d6811cb7"),title:"SYSTEM: Device Display Name",description:"Current device display name",type:"string",value:""},workspaceName:{id:a("d857125e-0401-40f1-b768-56190aa8e147"),title:"SYSTEM: Workspace Name",description:"Current workspace name",type:"string",value:""},applicationInfo:{id:a("935d3322-84aa-4465-b1e7-241d1f024267"),title:"SYSTEM: Application Info",description:"Current application info",type:"object",value:{}},applicationName:{id:a("df395fd6-a754-4b60-8bac-1360933e6707"),title:"SYSTEM: Application Name",description:"Current application name",type:"string",value:""},deviceID:{id:a("8b5c2d9e-f0a1-4b2c-8d3e-4f5a6b7c8d9e"),title:"SYSTEM: Device ID",description:"Device ID of current device",type:"string",value:"unknown"},macAddress:{id:a("f01fcc78-0723-11ed-ac00-877339de1030"),title:"SYSTEM: MAC Address",description:"Network adapter MAC address of current device",type:"string",value:""},bindDeviceCode:{id:a("1ca90262-3584-11ed-8c9a-174949844872"),title:"SYSTEM: Bind Device Code",description:"The passcode to bind the device",type:"string",value:"",hide:!0},bindDeviceCodeExpire:{id:a("5b52d204-3584-11ed-bb5e-abb4d270daf1"),title:"SYSTEM: Bind Device Code Expire Time",description:"The expire time of bind passcode",type:"string",value:"",hide:!0},bindDeviceUrl:{id:a("833a7db2-3584-11ed-88dd-3b3d3ff58855"),title:"SYSTEM: Bind Device URL",description:"The URL to bind the device",type:"string",value:"",hide:!0},bindDeviceUseApplication:{id:a("631bbce8-9c90-4590-b8ec-8b27f4a0e50b"),title:"SYSTEM: Selected Application on Bind Device",description:"Current selected use application info on Bind Device",type:"object",value:null,hide:!0},isApplicationPreview:{id:a("c673967a-3996-11ed-96d9-efbc3f7eac53"),title:"SYSTEM: Is Preview Mode",description:"Is current in preview mode?",type:"bool",value:"",hide:!0},isSupportAuthInDevice:{id:a("beb2a666-3e18-11ed-bdab-6f0cb082fa67"),title:"SYSTEM: Is Support Auth In Device",description:"Is current device support auth in device?",type:"bool",value:"",hide:!0},env:{id:a("74e7a574-1099-4fe5-b193-8a9ea7d20ed0"),title:"SYSTEM: Environment Variables",description:"Environment Variables of the device",type:"object",value:{}},isViewDebugModeEnabled:{id:a("3f61c4f6-1e02-492e-8e4c-a8dc4a5bc101"),title:"SYSTEM: Is View Debug mode Enabled",description:"Is View Debug mode enabled?",type:"bool",value:!1},language:{id:a("f0ed0a03-6195-459f-9ffe-bca61923f94e"),title:"SYSTEM: Language",description:"Language of the device",type:"string",value:""},aiFilters:{id:a("3ffc1e98-8f65-4cc8-a949-3da8d2092ccb"),title:"SYSTEM: AI Filters",description:"AI filters configuration from the application",type:"array",value:[]},systemOpenAIApiKey:{id:a("a1b2c3d4-5e6f-7890-abcd-ef1234567890"),title:"SYSTEM: OpenAI API Key",description:"System OpenAI API Key (only available if application enabled)",type:"string",value:""},systemAnthropicApiKey:{id:a("b2c3d4e5-6f78-9012-bcde-f23456789012"),title:"SYSTEM: Anthropic API Key",description:"System Anthropic API Key (only available if application enabled)",type:"string",value:""},systemGeminiApiKey:{id:a("c3d4e5f6-7890-1234-cdef-345678901234"),title:"SYSTEM: Gemini API Key",description:"System Gemini API Key (only available if application enabled)",type:"string",value:""},ggmlBackendDevices:{id:a("9e8f7a6b-5c4d-3e2f-1a0b-9c8d7e6f5a4b"),title:"SYSTEM: GGML Backend Devices",description:"Available GGML backend devices with supported generators",type:"array",schema:{type:"object",allowNewItem:!1,allowCustomProperty:!1},value:[]}};t.idMap=Object.entries(i).reduce((e,[t,a])=>(e[t]=a.id,e),{}),Object.fromEntries(Object.entries(t.idMap).map(([e,t])=>[t,e])),t.MI=Object.entries(i).reduce((e,[t,a])=>{let{id:i,...r}=a;return e[t]=r,e},{}),Object.keys(t.MI)},18501(e,t,a){let{docs:i}=a(5867);t.isCommand=e=>!!(e&&e.type&&e.type.startsWith("command-node-")),t.getPorts=e=>e?Array.isArray(e)?e:[e]:[],t.getCommandCallbackFromPort=(e,a)=>{let r=e[a];if(!t.isCommand(r))return null;let n=i[r.type.replace("command-node-","")]?.commands?.[r.properties?.command];return n?.iterateeFrom||n?.invocationFrom||null},t.checkDisableTriggerCommand=(e,a)=>t.getPorts(e[a.id]?.in?.[a.port]).some(e=>e?.disable_trigger_command),t.findCircularReferenceIds=e=>{let a,i=(a=new Map,Object.keys(e).reduce((i,r)=>{let n=[];return Object.values(e[r]?.out||{}).forEach(i=>{t.getPorts(i).forEach(i=>{((e,a,i)=>{var r;return!!a&&!!e[a.id]&&!(a.port===(r=a.id,i.has(r)||i.set(r,t.getCommandCallbackFromPort(e,r)),i.get(r))||t.checkDisableTriggerCommand(e,a))})(e,i,a)&&n.push(i.id)})}),i[r]=n,i},{})),r=new Map;return Object.keys(e).filter(t=>e[t]?.type==="data-node").filter(e=>((e,t,a)=>{if(a.has(e))return a.get(e);let i=[{id:e,edgeIndex:0,reachesCycle:!1}],r=new Set([e]);for(;i.length>0;){let e=i[i.length-1],n=t[e.id]||[];if(e.reachesCycle||e.edgeIndex>=n.length){r.delete(e.id),a.set(e.id,e.reachesCycle),i.pop(),e.reachesCycle&&i.length>0&&(i[i.length-1].reachesCycle=!0);continue}let o=n[e.edgeIndex];if(e.edgeIndex+=1,a.has(o)){a.get(o)&&(e.reachesCycle=!0);continue}if(r.has(o)){e.reachesCycle=!0;continue}r.add(o),i.push({id:o,edgeIndex:0,reachesCycle:!1})}return a.get(e)||!1})(e,i,r))},t.hasCircularReference=e=>t.findCircularReferenceIds(e).length>0;let r=(e={})=>Object.entries(e).reduce((e,[t,a])=>(e[t]=Array.isArray(a)?a.slice():a,e),{}),n=new WeakSet,o=(e,t,a)=>{if(!a)return;let i=((e,t)=>{let a=e[t];if(!a)return e[t]=[],e[t];if(!Array.isArray(a))return e[t]=[a],e[t];if(!n.has(a)){let e=0;for(let t of a)t&&(a[e]=t,e+=1);a.length=e,n.add(a)}return a})(e,t);(Array.isArray(a)?a:[a]).forEach(e=>{e&&i.push(e)})};t.getCalcMap=e=>e?.script_map||e?.scriptMap||e?.map||{},t.composeMap=e=>Object.values(e).reduce((e,a)=>Object.entries(t.getCalcMap(a)).reduce((e,[a,i])=>{if(e[a]){if(t.isCommand(i))throw Error(`Doesn't allow same command id in another map, ${a}`);let r=e[a];Object.keys(i?.in||{}).forEach(e=>{o(r.in,e,i.in[e])}),Object.keys(i?.out||{}).forEach(e=>{o(r.out,e,i.out[e])})}else e[a]={...i,in:r(i?.in),out:r(i?.out)};return e},e),{})},86343(e,t,a){let{v4:i}=a(45620),r=a(95479),n=a(56005),{nameMap:o,brickMapping:s,generatorMapping:c}=a(63981);t.idByItem=(e={})=>e.canvas_id||e.subspace_id||e.brick_id||e.generator_id||e.property_bank_id||e.property_bank_calc_id||e.bank_id||e.scene_id,t.getAnimationType=e=>e.type||e.compose_type||e.composeType,t.cleanUpAnimationMap=e=>Object.entries(e).reduce((e,[t,a])=>((a.type||a.compose_type)&&(e[t]=a),e),{}),t.matchItemByItem=(e,t)=>{let a;if(!e)return!1;switch("string"==typeof t&&(a=t),e.type){case"brick":return e.brick_id===(a||t.brick_id);case"subspace":return e.subspace_id===(a||t.subspace_id);case"canvas":return e.canvas_id===(a||t.canvas_id);case"generator":return e.generator_id===(a||t.generator_id);case"property_bank":return e.property_bank_id===(a||t.property_bank_id);default:return!1}},t.makePasscode=()=>i(),t.kindOneOfTypes={string:["color","datetime","id","graphql","rich-text-content","sandbox-script","llm-prompt","media-resource-image","media-resource-video","media-resource-audio","media-resource-file","lottie-file-uri","rive-file-uri","ggml-model-asset","gguf-model-asset","mlx-model-asset","binary-asset","scene3d-objects"],number:["unit"],object:["tts-speaker-config"],"array-object":["llm-tools","llm-messages","mcp-server-resources","mcp-server-tools","mcp-server-prompts"]},t.getKindOneOfTypes=(e,a)=>"array"===e?"object"===a?t.kindOneOfTypes[`${e}-${a}`]:void 0:t.kindOneOfTypes[e],t.unitOneOfTypes=["grid","px","ms"],t.idOneOfTypes=["canvas","brick","generator","animation","property_bank"],t.typeToName={brick:"Brick",generator:"Generator",subspace:"Subspace",canvas:"Canvas",animation:"Animation",property_bank:"Data",property_bank_calc:"Calculation"},t.getBrickName=(e,a,i)=>{let n;if(!a)return e.toUpperCase();if(a.title)return a.title;switch(e){case"bank":n="BANK";break;case"subspace":n="SUBSPACE";break;case"canvas":n="CANVAS";break;case"animation":n=`<${r(t.getAnimationType(a))}>`;break;case"property_bank":n="<Data>";break;case"property_bank_calc":n="<Map>";break;case"state_group":n="<Switch Case>";break;default:n=`<${o[a.template_key||a.templateKey]||"Unknown"}>`}return i&&i.length>10?n+=` (${i.replace(/[A-Z_]+/g,"").substr(0,6)}...)`:i&&(n+=` (${i})`),n},t.getEventLabel=(e,{templateKey:t,itemType:a}={})=>{if(!e)return"";let i=e;return"subspace"===a?i=e.replace("SUBSPACE_ACTION_",""):t&&(i=e.replace(`${t}_`,"").replace("CANVAS_","")),r(n(r(i)))},t.getCallInternalActions=e=>{let t=s[e]||c[e];if(t)return t.callInternalActions},t.mapToList=(e,a)=>Object.entries(a).reduce((a,[i,r])=>(a.push({id:i,...r,title:t.getBrickName(e,r,i)}),a),[]);let d={subspaceMap:"subspace",brickMap:"brick",generatorMap:"generator",propertyBankMap:"property_bank",propertyAvailableToAdd:"property_bank",canvasMap:"canvas",animationMap:"animation"},l={};t.mapToListForDerivedState=(e,a,i,r)=>{let n=i[e]||l;return n!==r[e]?{[e]:n,[a]:t.mapToList(d[e],n)}:{}},t.arrayTypePrefix="array of ",t.propertyBankTypes=["string","number","bool","object","any",`${t.arrayTypePrefix}string`,`${t.arrayTypePrefix}number`,`${t.arrayTypePrefix}bool`,`${t.arrayTypePrefix}object`],t.animationRunTypes=["once","loop"],t.stopPropagationOnKeyBackspace=e=>{8===e.keyCode&&e.stopPropagation()},t.nestedTypes=["object","array","any"],t.isPropertyBankTypeNested=e=>t.nestedTypes.includes(e),t.propertyTypeToSchema=e=>{let a=e.indexOf(t.arrayTypePrefix)>-1,i=e.replace(t.arrayTypePrefix,"");return{type:i,properties:"object"===i?{}:void 0,allowNewItem:a,allowCustomProperty:"object"===i}}},33770(e,t,a){let{idMap:i}=a(66422),{forEachEventAction:r,getActionParam:n}=a(78078),o="PROPERTY_BANK_DATA_NODE_",s=new Set(Object.values(i||{}).filter(e=>"string"==typeof e&&e.startsWith(o)));e.exports=function(e){let t,a,i=[],c=(t=new Set(s),Object.values(e.subspace_map||{}).forEach(e=>{e&&"object"==typeof e&&Object.keys(e.property_bank_map||{}).forEach(e=>t.add(e))}),t),d=(a=new Set,Object.values(e.subspace_map||{}).forEach(e=>{e&&"object"==typeof e&&Object.keys(e.canvas_map||{}).forEach(e=>a.add(e))}),a);return r(e,(e,t)=>{if("PROPERTY_BANK_EXPRESSION"===e.action){let a;Array.isArray(a=n(e,"VARIABLES"))&&a.forEach((e,a)=>{let r=e?.id;if("string"!=typeof r||!r.startsWith(o)||c.has(r))return;let n=e.key?`\`${e.key}\``:`at index ${a}`;i.push({field:`${t}.VARIABLES[${a}].id`,message:`PROPERTY_BANK_EXPRESSION variable ${n} references data node \`${r}\`, which is not defined in any subspace.`})})}else"CHANGE_CANVAS"===e.action&&((e,t,a,i)=>{if("SYSTEM"!==e.handler)return;let r=n(e,"CANVAS_ID");"string"!=typeof r||!r||r.startsWith("PROPERTY_BANK#")||r.startsWith("VARIABLE#")||!r.startsWith("CANVAS_")||a.has(r)||i.push({field:`${t}.CANVAS_ID`,message:`CHANGE_CANVAS references canvas \`${r}\`, which is not defined in any subspace.`})})(e,t,d,i)}),i}},37517(e,t,a){let{composeMap:i,findCircularReferenceIds:r}=a(18501);e.exports=function(e){let t=[];return Object.entries(e.subspace_map||{}).forEach(([e,a])=>{if(a.module?.link)return;let n=a.property_bank_calc_map;if(!n||0===Object.keys(n).length)return;let o=`subspace_map.${e}.property_bank_calc_map`;try{let e=i(n),a=r(e);if(a.length>0){let i=a.slice(0,5).map(t=>e[t].title||t),r=a.length>5?` and ${a.length-5} more`:"";t.push({field:o,message:`Circular reference detected in data calculation. Affected nodes: ${i.join(", ")}${r}. Please check the data connections for loops.`})}}catch(e){t.push({field:o,message:e.message})}}),t}},41900(e){e.exports={expressionFoldAcornOptions:{ecmaVersion:2022,allowReturnOutsideFunction:!0,allowAwaitOutsideFunction:!0},getUnfoldableStatementDescription:(e,t=null)=>{for(let t=0;t<e.length;t+=1){let a=e[t];if("ExpressionStatement"!==a.type){if("VariableDeclaration"===a.type){if(a.declarations.some(e=>"Identifier"!==e.id.type||!e.init))return"a variable declaration with destructuring or no initializer";continue}if(t!==e.length-1||"ReturnStatement"!==a.type)return`an unsupported ${a.type}`}}return t}}},78078(e,t,a){let{parse:i}=a(89236),{expressionFoldAcornOptions:r}=a(41900),n=(e,t)=>{let a=e.parameter_list||e.parameterList||[];if(!Array.isArray(a))return;let i=a.find(e=>(e?.input_to_receiver||e?.inputToReceiver)===t);return i?i.result_from_sender??i.resultFromSender:void 0},o=(e,t,a)=>{if(e&&"object"==typeof e){if(Array.isArray(e))return void e.forEach((e,i)=>o(e,`${t}[${i}]`,a));Object.entries(e).forEach(([e,i])=>{("event_map"===e||"eventMap"===e)&&i&&"object"==typeof i?Object.entries(i).forEach(([i,r])=>{Array.isArray(r)&&r.forEach((r,n)=>{r&&"object"==typeof r&&a(r,`${t}.${e}.${i}[${n}]`)})}):i&&"object"==typeof i&&o(i,`${t}.${e}`,a)})}},s=(e,t)=>{Object.entries(e.subspace_map||{}).forEach(([e,a])=>{!a||"object"!=typeof a||a.module?.link||o(a,`subspace_map.${e}`,t)})};e.exports=function(e){let t=[];return s(e,(e,a)=>{if("PROPERTY_BANK_EXPRESSION"!==e.action)return;let o=n(e,"EXPRESSION");if("string"!=typeof o||o.startsWith("PROPERTY_BANK#"))return;let s=(e=>{if(!e.trim())return"Expression is empty";try{i(e,r)}catch(e){return`Expression does not parse: ${e.message}`}return null})(o);s&&t.push({field:a,message:s})}),t},e.exports.forEachEventAction=s,e.exports.getActionParam=n},38890(e,t,a){let{getDocByTemplateKey:i}=a(63981),r=a(80211),n=a(45907),o=a(37517),s=a(78078),c=a(33770),{lintConfig:d,lintRuleCodes:l}=a(9098),{getBrickName:p}=a(86343);t.lintConfig=d,t.lintRuleCodes=l;let u=(e,t,a,i)=>({id:e,name:"Used Deprecated Feature",data:`The \`${p("brick",t,e)}\` brick in \`${p("subspace",a,i)}\` have been deprecated, it may not work in the future, please consider to remove it. If you can't see the item, please enable \`Show Deprecated Features\` in setting.`});t.checkConfigDeprecatedFeatures=e=>{let t=[];return Object.entries(e.subspace_map||{}).forEach(([e,a])=>{Object.entries(a.brick_map||{}).forEach(([r,n])=>{(void 0!==n.property?.borderLeftWidth||void 0!==n.property?.borderRightWidth||void 0!==n.property?.borderTopWidth||void 0!==n.property?.borderBottomWidth)&&t.push({id:r,name:"Used Deprecated Feature",data:`In v2.16, we have been changed \`Border Width\` to \`Border Size\` (Unit \`px\` to \`grid\`). The \`${p("brick",n,r)}\` brick still used the border width. Please re-edit it to transfer to the new unit.`});let o=i(n.template_key);o?.brickMeta?.deprecated&&t.push(u(r,n,a,e))}),Object.entries(a.generator_map||{}).forEach(([r,n])=>{let o=i(n.template_key);o?.brickMeta?.deprecated&&t.push(u(r,n,a,e))})}),t},t.checkConfig=(e,t={})=>{let a={schema:r(e),ref:n(e,t),calc:t.checkCalc?o(e):[],expression:t.checkExpressions?s(e):[],actionRef:t.checkActionRefs?c(e):[]};return a.valid=0===a.schema.length&&0===a.ref.length&&0===a.calc.length&&0===a.expression.length&&0===a.actionRef.length,a.message=a.schema.concat(a.ref).concat(a.calc).concat(a.expression).concat(a.actionRef).map(({instancePath:e,field:t,message:a})=>{let i=e||t;return i?`${i}: ${a}`:a}).join("\n"),a}},27899(e){let t=["x","y","width","height"],a=e=>"string"==typeof e&&e.startsWith("PROPERTY_BANK_"),i=/PROPERTY_BANK#(PROPERTY_BANK_[A-Za-z0-9_-]+)/g,r=/(?:BRICK|ANIMATION|SUBSPACE)_[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}/g,n=(e,t=new Set)=>{if("string"==typeof e){let a;for(i.lastIndex=0;a=i.exec(e);)t.add(a[1])}else Array.isArray(e)?e.forEach(e=>n(e,t)):e&&"object"==typeof e&&(a(e.id)&&t.add(e.id),Object.values(e).forEach(e=>n(e,t)));return t},o=(e,t)=>{if("string"==typeof e){let a;for(r.lastIndex=0;a=r.exec(e);)t.add(a[0])}else Array.isArray(e)?e.forEach(e=>o(e,t)):e&&"object"==typeof e&&Object.values(e).forEach(e=>o(e,t));return t},s=(e,t)=>{Object.entries(e.subspace_map||{}).forEach(([e,a])=>{!a||"object"!=typeof a||a.module?.link||t(e,a)})},c=(e,t)=>{s(e,(e,a)=>{Object.entries(a.canvas_map||{}).forEach(([i,r])=>{let n=Array.isArray(r?.item_list)?r.item_list:[];t({subspaceId:e,subspace:a,canvasId:i,canvas:r,items:n})})})},d=[["brick_map","brick"],["generator_map","generator"],["property_bank_map","property_bank"],["canvas_map","canvas"]],l=(e,t,a)=>{d.forEach(([i,r])=>{Object.entries(t[i]||{}).forEach(([t,n])=>{Object.entries(n?.event_map||{}).forEach(([n,o])=>{Array.isArray(o)&&a({ownerType:r,ownerId:t,eventKey:n,list:o,path:`subspace_map.${e}.${i}.${t}.event_map.${n}`})})})})},p=(e,t)=>(e.parameter_list||[]).find(e=>e?.input_to_receiver===t)?.result_from_sender;e.exports={FRAME_KEYS:t,isBankNodeId:a,collectBankReads:n,forEachSubspace:s,forEachCanvas:c,forEachCanvasItem:(e,t)=>{c(e,e=>{e.items.forEach((a,i)=>{t({...e,item:a,index:i})})})},forEachEventList:l,getParamValue:p,hasParamValue:(e,t)=>{let a=p(e,t);return null!=a&&""!==a},collectDynamicallyReferencedIds:e=>{let t=new Set;return s(e,(e,a)=>{l(e,a,({list:e})=>{e.forEach(e=>o(e?.parameter_list,t))})}),o(e.automation_map,t),o(e.test_map,t),t},frameIsNumeric:e=>!!e&&t.every(t=>"number"==typeof e[t]),framesAlmostEqual:(e,a,i=.01)=>t.every(t=>Math.abs(e[t]-a[t])<=i),frameContains:(e,t,a=.01)=>e.x<=t.x+a&&e.y<=t.y+a&&e.x+e.width>=t.x+t.width-a&&e.y+e.height>=t.y+t.height-a,framesIntersect:(e,t)=>!(e.x+e.width<=t.x||t.x+t.width<=e.x||e.y+e.height<=t.y||t.y+t.height<=e.y),getItemId:e=>e?.brick_id||e?.subspace_id||null,itemHasAnimations:e=>!!e?.animations&&Object.keys(e.animations).length>0}},9098(e,t,a){let{collectDynamicallyReferencedIds:i}=a(27899),r=[a(98632),a(84223),a(92260),a(96810),a(60760),a(40566),a(31172),a(59707),a(39425)],n=r.map(e=>e.code),o=e=>Array.isArray(e)?e:"string"==typeof e&&e?e.split(",").map(e=>e.trim()).filter(Boolean):null;e.exports={lintConfig:(e,t={})=>{let a,s=o(t.only),c=o(t.ignore),d=[...s||[],...c||[]].filter(e=>!n.includes(e));if(d.length>0)throw Error(`Unknown lint rule code(s): ${d.join(", ")}. Valid codes: ${n.join(", ")}`);if(!e||"object"!=typeof e)return[];let l=r.filter(e=>(!s||s.includes(e.code))&&(!c||!c.includes(e.code)));if(0===l.length)return[];let p={configType:"module"===t.configType?"module":"app",gridStep:"number"==typeof t.gridStep&&t.gridStep>0?t.gridStep:.5,get dynamicRefIds(){return a||(a=i(e)),a}},u=[];return l.forEach(t=>{try{t.check(e,p,e=>u.push({severity:t.severity,code:t.code,path:"",subspaceId:null,itemId:null,hint:null,...e}))}catch(e){u.push({severity:"warning",code:t.code,path:"",subspaceId:null,itemId:null,message:`Lint rule crashed: ${e.message}`,hint:null})}}),u},lintRuleCodes:n}},98632(e,t,a){let{composeMap:i}=a(18501),{forEachSubspace:r,forEachEventList:n,collectBankReads:o,isBankNodeId:s,getParamValue:c}=a(27899),d=(e,t)=>t.map(t=>c(e,t)).filter(s),l={PROPERTY_BANK:{waitable:!0,targets:e=>(e.parameter_list||[]).map(e=>e?.input_to_receiver).filter(s)},PROPERTY_BANK_EXPRESSION:{waitable:!0,targets:e=>d(e,["RESULT","ERROR_RESULT"])},PROPERTY_BANK_COMMAND:{waitable:!0,targets:(e,t)=>((e,t)=>{let a=t();if(!a)return[];let i=[],r=new Set,n=(e.parameter_list||[]).map(e=>e?.input_to_receiver).filter(s);for(let e=0;e<n.length;e+=1){let t=n[e];if(r.has(t))continue;r.add(t);let o=a[t];o&&Object.values(o.out||{}).forEach(e=>{(e||[]).forEach(e=>{e?.id&&(e.id.includes("DATA_NODE")&&i.push(e.id),n.push(e.id))})})}return i})(e,t)},STORAGE_RETRIEVE:{waitable:!0,targets:e=>d(e,["STORAGE_RETRIEVE_RESULT"])},OPEN_FILE:{waitable:!0,targets:e=>d(e,["SAVE_PROPERTY","SAVE_DETAIL_PROPERTY","ERROR_SAVE_PROPERTY"])},SAVE_UPDATE_SNAPSHOT:{waitable:!0,targets:e=>d(e,["SNAPSHOT_SAVE_RESULT","SNAPSHOT_ERROR_RESULT"])},TRIGGER_APPLICATION_FILTER:{waitable:!0,targets:e=>d(e,["RESULT","ERROR_RESULT"])},TAKE_SCREENSHOT:{waitable:!1,targets:e=>d(e,["TAKE_SCREENSHOT_SAVE_PROPERTY"])}},p=/(^|_)RESULT$|_SAVE_PROPERTY$/;e.exports={code:"data-update-race",severity:"warning",description:"A data node is written without wait_async and read by a later action in the same event",check(e,t,a){r(e,(e,t)=>{let r,c=()=>{if(void 0===r)try{r=i(t.property_bank_calc_map||{})}catch{r=null}return r};n(e,t,({path:t,list:i})=>{let r=new Map;i.forEach((i,n)=>{if(!i||"object"!=typeof i)return;if("SYSTEM"===i.handler&&"DELAY"===i.action)return void r.clear();let d=new Set;(i.parameter_list||[]).forEach(e=>o(e?.result_from_sender,d)),d.forEach(o=>{let s=r.get(o);s&&(a({path:`${t}.${n}`,subspaceId:e,itemId:o,message:`\`${o}\` is written by action #${s.index} (${s.action}) without waiting, then read by action #${n} (${i.action}) — the read can still see the previous value.`,hint:s.waitable?`Set \`wait_async: true\` on action #${s.index} (${s.action}).`:`${s.action} ignores \`wait_async\` for its data write — insert a SYSTEM DELAY action between the two, or move the read into the data node's value-change event.`}),r.delete(o))});let u=((e,t)=>{if("SYSTEM"===e.handler){let a=l[e.action];if(!a)return null;let i=a.targets(e,t);return i.length>0?{targets:i,waitable:a.waitable}:null}let a=(e.parameter_list||[]).filter(e=>"string"==typeof e?.input_to_receiver&&p.test(e.input_to_receiver)&&s(e.result_from_sender)).map(e=>e.result_from_sender);return a.length>0?{targets:a,waitable:!0}:null})(i,c);if(!u)return;let f=!0===i.wait_async&&u.waitable;u.targets.forEach(e=>{f?r.delete(e):r.set(e,{index:n,action:i.action,waitable:u.waitable})})})})})}}},39425(e,t,a){let{forEachSubspace:i,forEachEventList:r,getParamValue:n}=a(27899),o=new Set(["Math","Date","Object","Array","Number","String","Boolean","JSON","RegExp","Intl","isNaN","isFinite","parseInt","parseFloat"]);e.exports={code:"expression-global-variable",severity:"error",description:"A PROPERTY_BANK_EXPRESSION variable is named after a JS global and is silently ignored at runtime",check(e,t,a){i(e,(e,t)=>{r(e,t,({path:t,list:i})=>{i.forEach((i,r)=>{if(i?.handler!=="SYSTEM"||"PROPERTY_BANK_EXPRESSION"!==i.action)return;let s=n(i,"VARIABLES");Array.isArray(s)&&s.forEach(i=>{let n=i?.key;"string"==typeof n&&o.has(n)&&a({path:`${t}.${r}`,subspaceId:e,itemId:null,message:`Expression variable "${n}" is named after the JS global \`${n}\` and is silently ignored — the global takes precedence in the expression scope, so the bound value is never used.`,hint:`Rename the variable (e.g. "${n}Value") so the expression reads the bound value.`})})})})})}}},40566(e,t,a){let{forEachSubspace:i,forEachEventList:r,hasParamValue:n}=a(27899),o=[{action:"STORAGE_RETRIEVE",severity:"error",isMissing:e=>!n(e,"STORAGE_RETRIEVE_RESULT"),message:"STORAGE_RETRIEVE requires a STORAGE_RETRIEVE_RESULT parameter — without it the action throws at runtime.",hint:"Add a STORAGE_RETRIEVE_RESULT parameter pointing at a data node."},{action:"TAKE_SCREENSHOT",severity:"warning",isMissing:e=>!n(e,"TAKE_SCREENSHOT_SAVE_PROPERTY"),message:"TAKE_SCREENSHOT without TAKE_SCREENSHOT_SAVE_PROPERTY is silently skipped at runtime.",hint:"Add a TAKE_SCREENSHOT_SAVE_PROPERTY parameter pointing at a data node."},{action:"OPEN_FILE",severity:"warning",isMissing:e=>!n(e,"SAVE_PROPERTY")&&!n(e,"SAVE_DETAIL_PROPERTY"),message:"OPEN_FILE has no SAVE_PROPERTY / SAVE_DETAIL_PROPERTY — the picked file is discarded.",hint:"Add SAVE_PROPERTY (file uri) or SAVE_DETAIL_PROPERTY (file detail) parameters."},{action:"OPEN_URL",severity:"warning",isMissing:e=>!n(e,"URL"),message:"OPEN_URL has no URL parameter — the action does nothing.",hint:"Add a URL parameter."}];e.exports={code:"missing-result-param",severity:"warning",description:"An action is missing the parameter that receives or drives its effect",check(e,t,a){i(e,(e,t)=>{r(e,t,({path:t,list:i})=>{i.forEach((i,r)=>{if(i?.handler!=="SYSTEM")return;let n=o.find(e=>e.action===i.action);n&&n.isMissing(i)&&a({path:`${t}.${r}`,subspaceId:e,itemId:null,severity:n.severity,message:n.message,hint:n.hint})})})})}}},92260(e,t,a){let{forEachCanvasItem:i,frameIsNumeric:r,getItemId:n,FRAME_KEYS:o}=a(27899),s=["width","height"];e.exports={code:"off-grid-frame",severity:"warning",description:"Frame values should be multiples of the 0.5 grid step",check(e,t,a){let c=t.gridStep;i(e,({subspaceId:e,canvasId:t,item:i,index:d})=>{let l=i?.frame;if(!r(l))return;let p=o.filter(e=>{let t=l[e];return(!s.includes(e)||!(t<=c))&&Math.abs(t-Math.round(t/c)*c)>.001});0!==p.length&&a({path:`subspace_map.${e}.canvas_map.${t}.item_list.${d}.frame`,subspaceId:e,itemId:n(i),message:`Frame ${p.map(e=>`${e}=${l[e]}`).join(", ")} ${1===p.length?"is":"are"} not aligned to the ${c} grid step.`,hint:`Round frame values to multiples of ${c}.`})})}}},96810(e,t,a){let{forEachCanvasItem:i,frameIsNumeric:r,getItemId:n,itemHasAnimations:o}=a(27899);e.exports={code:"out-of-bounds-frame",severity:"warning",description:"An element is fully outside the subspace layout or has a non-positive size",check(e,t,a){i(e,({subspaceId:i,subspace:s,canvasId:c,item:d,index:l})=>{let p=s.layout;if("number"!=typeof p?.width||"number"!=typeof p?.height||p.width<=0||p.height<=0)return;let u=d?.frame;if(!r(u)||!0===u.exceed_boundary||u.standby_frame||o(d))return;let f=n(d);if(f&&t.dynamicRefIds.has(f))return;let b=`subspace_map.${i}.canvas_map.${c}.item_list.${l}.frame`;if(u.width<=0||u.height<=0)return void a({path:b,subspaceId:i,itemId:f,message:`Frame has a non-positive size (width=${u.width}, height=${u.height}) — the element renders nothing.`,hint:"Give the element a positive size, or remove it if unused."});let h=i===e.root_subspace_id,m=u.x>=p.width||u.x+u.width<=0,y=u.y>=p.height||u.y+u.height<=0;(m||!h&&y)&&a({path:b,subspaceId:i,itemId:f,message:`Frame (x=${u.x}, y=${u.y}, width=${u.width}, height=${u.height}) is fully outside the ${p.width}\xd7${p.height} layout — nothing is visible.`,hint:"Move the element back into the layout, or set `exceed_boundary` if the placement is intentional."})})}}},84223(e,t,a){let{FRAME_KEYS:i,forEachCanvas:r,frameIsNumeric:n,framesAlmostEqual:o,framesIntersect:s,itemHasAnimations:c}=a(27899),d=new Set(["BRICK_TEXT","BRICK_RICH_TEXT"]),l=["linearGradientEnabled","blurEnabled"],p=e=>Object.values(e?.event_map||{}).some(e=>Array.isArray(e)&&e.length>0),u=/^backgroundColor$|^border/,f=(e,t)=>{if(e?.type!=="brick")return null;let a=t[e.brick_id];return d.has(a?.template_key)?a:null},b=e=>i.map(t=>Math.floor(e[t]/.01)),h=e=>e.join(":"),m=(e,t,a,i)=>{if(!n(t?.frame)||!f(t,a))return;let r=h(b(t.frame)),o=(e.get(r)||0)+i;o>0?e.set(r,o):e.delete(r)};e.exports={code:"redundant-rect-overlay",severity:"info",description:"A plain Rect behind a same-frame Text/RichText can be folded into the text brick",check(e,t,a){r(e,({subspaceId:e,subspace:i,canvasId:r,items:d})=>{let y,E=i.brick_map||{},_=(y=new Map,d.forEach(e=>m(y,e,E,1)),y);d.forEach((i,y)=>{if(m(_,i,E,-1),i?.type!=="brick"||!n(i.frame))return;let g=E[i.brick_id];if(g?.template_key!=="BRICK_RECT"||c(i)||t.dynamicRefIds.has(i.brick_id))return;let S={...g.property,...i.property};if(l.some(e=>S[e])||!((e,t)=>{let[a,i,r,n]=b(t);for(let t=-1;t<=1;t+=1)for(let o=-1;o<=1;o+=1)for(let s=-1;s<=1;s+=1)for(let c=-1;c<=1;c+=1)if(e.has(h([a+t,i+o,r+s,n+c])))return!0;return!1})(_,i.frame))return;let v=p(g);for(let t=y+1;t<d.length;t+=1){let c=d[t];if(!n(c?.frame))continue;let l=f(c,E);if(l&&o(i.frame,c.frame,.01)){let t={...l.property,...c.property};if(Object.keys(t).some(e=>u.test(e)&&void 0!==t[e])||v&&p(l))return;a({path:`subspace_map.${e}.canvas_map.${r}.item_list.${y}`,subspaceId:e,itemId:i.brick_id,message:`Rect \`${g.title||i.brick_id}\` has the same frame as the ${l.template_key} above it and only uses base styles`+(v?", behind its press handler.":"."),hint:v?"Make the Text brick pressable, move backgroundColor / border / radius and the press handler onto it, then remove the Rect.":"Set backgroundColor / border / radius directly on the text brick and remove the Rect."});return}if(s(i.frame,c.frame))return}})})}}},31172(e,t,a){let{autoGeneratedItemIdKind:i}=a(99470),{forEachSubspace:r}=a(27899),n="PROPERTY_BANK_",o=()=>({children:Object.create(null),ids:null}),s=(e,t)=>{let a=e;for(let e of t)a.children[e]||(a.children[e]=o()),a=a.children[e];a.ids||(a.ids=[]),a.ids.push(t)},c=(e,t,a,i)=>{let r=a.children[e[i]];if(r){r.ids&&r.ids.forEach(e=>{t.set(e,t.get(e)+1)});for(let a=i+1;a<e.length&&(r=r.children[e[a]]);a+=1)r.ids&&r.ids.forEach(e=>{t.set(e,t.get(e)+1)})}};e.exports={code:"unused-data-node",severity:"info",description:"A data node is defined but never referenced anywhere in the config",check(e,t,a){let d=JSON.stringify(e),l=[];r(e,(a,r)=>{("module"!==t.configType||a!==e.root_subspace_id)&&Object.entries(r.property_bank_map||{}).forEach(([e,t])=>{!(!t||"object"!=typeof t||t.kind===i||t.enable_remote_update||t.global_remote_update_prop||t.linkedFrom||t.alias||t.preload||r.routing?.[e]?.enabled_routing)&&(Object.values(t?.event_map||{}).some(e=>Array.isArray(e)&&e.length>0)||l.push({subspaceId:a,nodeId:e,node:t}))})});let p=((e,t)=>{let a=[...new Set(t)];if(0===a.length)return new Map;let i=new Map(a.map(e=>[e,0])),r=o(),d=o(),l=!1,p=!1;if(a.forEach(e=>{e.startsWith(n)?(s(r,e),l=!0):(s(d,e),p=!0)}),l){let t=e.indexOf(n);for(;-1!==t;)c(e,i,r,t),t=e.indexOf(n,t+1)}if(p)for(let t=0;t<e.length;t+=1)c(e,i,d,t);return i})(d,l.map(({nodeId:e})=>e));l.forEach(({subspaceId:e,nodeId:t,node:i})=>{(p.get(t)||0)>1||a({path:`subspace_map.${e}.property_bank_map.${t}`,subspaceId:e,itemId:t,message:`Data node \`${i.title||t}\` is never referenced in the config.`,hint:"Remove it, or keep it if external tooling depends on it."})})}}},60760(e,t,a){let{forEachSubspace:i,forEachEventList:r}=a(27899),n=new Set(["MESSAGE","ALERT","POPUP_RESET","TAKE_SCREENSHOT","THROW_EXCEPTION","RESTART_FOUNDATION","DYNAMIC_BRICK","DYNAMIC_BRICK_RESET","DYNAMIC_ANIMATION","DYNAMIC_ANIMATION_RESET","DYNAMIC_ANIMATION_STOP","CHANNEL_SUBSCRIBE","CHANNEL_UNSUBSCRIBE","CHANNEL_PUBLISH","DISMISS_KEYBOARD","STORAGE_SET","STORAGE_DELETE","DELAY","USE_SHARE_APPLICATION","AUTH_IN_DEVICE","REFRESH_BINDCODE","STOP_APPLICATION_FILTER"]);e.exports={code:"wait-async-no-op",severity:"info",description:"wait_async is set on an action that ignores it",check(e,t,a){i(e,(e,t)=>{r(e,t,({path:t,list:i})=>{i.forEach((i,r)=>{i?.handler!=="SYSTEM"||!0!==i.wait_async||n.has(i.action)&&a({path:`${t}.${r}`,subspaceId:e,itemId:null,message:"DELAY"===i.action?"DELAY always waits for its timeout — `wait_async: true` is redundant.":`\`wait_async: true\` has no effect on ${i.action}; the action does not block the chain.`,hint:"DELAY"===i.action?"Remove the redundant flag.":"Remove the flag, or restructure if you relied on it for sequencing."})})})})}}},59707(e,t,a){let{forEachCanvas:i,frameIsNumeric:r,frameContains:n,itemHasAnimations:o}=a(27899);e.exports={code:"z-order-cover",severity:"info",description:"A later opaque element fully covers an earlier pressable element",check(e,t,a){i(e,({subspaceId:e,subspace:i,canvasId:s,items:c})=>{let d=i.brick_map||{},l=[];if(c.forEach((e,t)=>{if(e?.type!=="brick"||!r(e.frame))return;let a=d[e.brick_id];a&&Object.entries(a?.event_map||{}).some(([e,t])=>e.includes("_ON_PRESS")&&Array.isArray(t)&&t.length>0)&&l.push({item:e,index:t,brick:a})}),0===l.length)return;let p=t.dynamicRefIds,u=c.map((e,t)=>((e,t,a,i)=>{let n;if(e?.type!=="brick"||!r(e.frame)||o(e)||i.has(e.brick_id))return null;let s=a[e.brick_id],c={...s?.property,...e.property};return"string"==typeof(n=c.backgroundColor)&&(/^rgba\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*1(?:\.0+)?\s*\)$/.test(n)||/^rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)$/.test(n)||/^#[0-9a-fA-F]{6}$/.test(n))&&(void 0===c.opacity||1===c.opacity)?{index:t,item:e,brick:s,frame:e.frame}:null})(e,t,d,p)).filter(Boolean),f=(e=>{let t=Array(e.length),a=1/0,i=1/0,r=-1/0,n=-1/0,o=-1/0,s=-1/0;for(let c=e.length-1;c>=0;c-=1){let{frame:d}=e[c];a=Math.min(a,d.x),i=Math.min(i,d.y),r=Math.max(r,d.x+d.width),n=Math.max(n,d.y+d.height),o=Math.max(o,d.width),s=Math.max(s,d.height),t[c]={minX:a,minY:i,maxRight:r,maxBottom:n,maxWidth:o,maxHeight:s}}return t})(u),b=0;l.forEach(({item:t,index:i,brick:r})=>{let c,d;if(!(o(t)||p.has(t.brick_id))){for(;b<u.length&&u[b].index<=i;)b+=1;if(c=f[b],d=t.frame,c&&c.minX<=d.x+.01&&c.minY<=d.y+.01&&c.maxRight>=d.x+d.width-.01&&c.maxBottom>=d.y+d.height-.01&&c.maxWidth>=d.width-.02&&c.maxHeight>=d.height-.02)for(let o=b;o<u.length;o+=1){let c=u[o];if(n(c.frame,t.frame))return void a({path:`subspace_map.${e}.canvas_map.${s}.item_list.${i}`,subspaceId:e,itemId:t.brick_id,message:`Pressable \`${r.title||t.brick_id}\` is fully covered by the opaque \`${c.brick?.title||c.item.brick_id}\` later in the item list — it is invisible and untappable.`,hint:"Reorder the items, shrink the covering element, or remove the hidden one."})}}})})}}}};
|
|
1
|
+
export const __rspack_esm_id=7511;export const __rspack_esm_ids=[7511];export const __webpack_modules__={66422(e,t){let i=e=>`PROPERTY_BANK_DATA_NODE_${e}`,a={isLocalSyncMainDevice:{id:i("325068e3-89b6-4c6a-942b-126d38c84a62"),title:"SYSTEM: Is Local Sync Main Device",description:"The current device is main for local sync",type:"bool",value:!0},currentCanvasId:{id:i("2dfeb635-deb4-481a-9d17-ea7b1fe19f74"),title:"SYSTEM: Current Canvas ID",description:"ID for known current canvas",type:"string",value:""},previousCanvasId:{id:i("2971e463-0b0e-45b7-bbfb-a01d8fd49db3"),title:"SYSTEM: Previous Canvas ID",description:"ID for known previous canvas",type:"string",value:""},canvasIdHistory:{id:i("1a086f39-817d-40ed-92f0-5a999535d3dd"),title:"SYSTEM: Change Canvas History",description:"Change Canvas ID History (Limit: 10)",type:"array",schema:{type:"string",allowNewItem:!1,allowCustomProperty:!1},value:[]},rootSubspaceInfo:{id:i("c0817f4a-1ff3-40ed-9cbf-71d8cefd2cd9"),title:"SYSTEM: Root Subspace Info",description:"Root Subspace Information",type:"object",value:{}},subspaceInfo:{id:i("2657ec09-7323-46c3-a96e-3d8b5a0f79b3"),title:"SYSTEM: Current Subspace Info",description:"Current Subspace Information",type:"object",value:{}},uniqueID:{id:i("6f4a543f-a88a-4a83-bf53-223259263be3"),title:"SYSTEM: Unique ID",description:"Unique ID of current device",type:"string",value:"unknown"},appVersion:{id:i("d614a258-2a45-4f91-9f6b-3936038cb2b1"),title:"SYSTEM: App Version",description:"App Version of current installed BRICKS Foundation app",type:"string",value:"unknown"},lastUpdateTime:{id:i("956f3b3e-cb0b-47ca-8119-65663910d110"),title:"SYSTEM: Last Update Time",description:"Last update time of current installed BRICKS Foundation app",type:"string",value:"2019-07-09T03:32:27.058Z"},deviceName:{id:i("7b9d9ad4-e9a2-47cd-91d3-b64187895c16"),title:"SYSTEM: Device Name",description:"Name of current device",type:"string",value:"Default Device Name"},deviceType:{id:i("b0beae12-e45e-4870-ae15-858eeac566fa"),title:"SYSTEM: Device Type",description:"Type of current device (Handset, Tv, Tablet)",type:"string",value:"Tv"},operationMode:{id:i("2e715d3b-92bf-4761-b5c0-ca21f7c1ada8"),title:"SYSTEM: Operation Mode",description:"Operation Mode of current device (android, ios, ...)",type:"string",value:"android"},operationVersion:{id:i("fa886963-0a16-4b5f-b4ea-6c25b049db03"),title:"SYSTEM: Operation Version",description:"Operation Version of current device",type:"string",value:""},screenWidth:{id:i("2942470a-c3bc-413e-8f2c-30a89aded3f8"),title:"SYSTEM: Screen Width",description:"Width of current device main screen",type:"number",value:1280},screenHeight:{id:i("4f031e27-f67b-40e0-a317-9f6c5215d97d"),title:"SYSTEM: Screen Height",description:"Height of current device main screen",type:"number",value:768},screenScale:{id:i("c3c9b7aa-1dc1-4be1-8a4a-d9e299b9eeaa"),title:"SYSTEM: Screen Scale",description:"Scale of current device main screen",type:"number",value:2},screenFontScale:{id:i("0312f380-d525-4938-82d2-5b35ef8ef1e8"),title:"SYSTEM: Screen Font Scale",description:"Font scale of current device main screen",type:"number",value:1},orientation:{id:i("4f584f51-a250-4f97-a2f8-d5e6a3affb4f"),title:"SYSTEM: Orientation",description:"Orientation of current device main screen",type:"string",value:"landspace"},touchAvailable:{id:i("1fe7555f-df41-43ce-a268-3ea1b5efda6d"),title:"SYSTEM: Touch Available",description:"Is touch available of current device main screen?",type:"bool",value:!0},soundAvailable:{id:i("bf839498-f7d6-4212-ac3a-b409e3ad77a5"),title:"SYSTEM: Sound Available",description:"Is sound available of current device?",type:"bool",value:!0},cameraAvailable:{id:i("4878f3c2-8bb8-4c94-855c-06bda5a287d5"),title:"SYSTEM: Camera Available",description:"Is camera available of current device?",type:"bool",value:!0},audioInputAvailable:{id:i("4854b259-96c1-40d7-b17b-47156b4698dc"),title:"SYSTEM: Audio Input Available",description:"Is audio input available of current device?",type:"bool",value:!1},networkType:{id:i("1cbb1756-e53c-45a9-be23-5d84a214e144"),title:"SYSTEM: Network Type",description:"Network Type of current device",type:"string",value:"wifi"},networkConnected:{id:i("687b62fe-ead5-417a-b415-9bd5233784a4"),title:"SYSTEM: Network Connected",description:"Is Network connected of current device?",type:"bool",value:!0},networkIpAddress:{id:i("41971ba7-8294-4aa6-a425-ecd39853c3e6"),title:"SYSTEM: Network IP Address",description:"Current network IP address",type:"string",value:""},networkDetails:{id:i("9351fbfc-4ace-477a-b05d-41ac9b05087d"),title:"SYSTEM: Network Details",description:"Network details, provide different data depends on Network Type",type:"object",value:null},isInternetReachable:{id:i("e367ae7e-46ec-46d0-b87d-51e544591ff9"),title:"SYSTEM: Internet Reachable",description:"Is Internet reachable?",type:"bool",value:!0},isWifiEnabled:{id:i("be395305-fb85-4d05-8506-22a4ae8c7b9e"),title:"SYSTEM: Wifi Enabled",description:"Is WiFi enabled?",type:"bool",value:!0},deviceDisplayName:{id:i("76356a9a-fc46-11ec-9905-db53d6811cb7"),title:"SYSTEM: Device Display Name",description:"Current device display name",type:"string",value:""},workspaceName:{id:i("d857125e-0401-40f1-b768-56190aa8e147"),title:"SYSTEM: Workspace Name",description:"Current workspace name",type:"string",value:""},applicationInfo:{id:i("935d3322-84aa-4465-b1e7-241d1f024267"),title:"SYSTEM: Application Info",description:"Current application info",type:"object",value:{}},applicationName:{id:i("df395fd6-a754-4b60-8bac-1360933e6707"),title:"SYSTEM: Application Name",description:"Current application name",type:"string",value:""},deviceID:{id:i("8b5c2d9e-f0a1-4b2c-8d3e-4f5a6b7c8d9e"),title:"SYSTEM: Device ID",description:"Device ID of current device",type:"string",value:"unknown"},macAddress:{id:i("f01fcc78-0723-11ed-ac00-877339de1030"),title:"SYSTEM: MAC Address",description:"Network adapter MAC address of current device",type:"string",value:""},bindDeviceCode:{id:i("1ca90262-3584-11ed-8c9a-174949844872"),title:"SYSTEM: Bind Device Code",description:"The passcode to bind the device",type:"string",value:"",hide:!0},bindDeviceCodeExpire:{id:i("5b52d204-3584-11ed-bb5e-abb4d270daf1"),title:"SYSTEM: Bind Device Code Expire Time",description:"The expire time of bind passcode",type:"string",value:"",hide:!0},bindDeviceUrl:{id:i("833a7db2-3584-11ed-88dd-3b3d3ff58855"),title:"SYSTEM: Bind Device URL",description:"The URL to bind the device",type:"string",value:"",hide:!0},bindDeviceUseApplication:{id:i("631bbce8-9c90-4590-b8ec-8b27f4a0e50b"),title:"SYSTEM: Selected Application on Bind Device",description:"Current selected use application info on Bind Device",type:"object",value:null,hide:!0},isApplicationPreview:{id:i("c673967a-3996-11ed-96d9-efbc3f7eac53"),title:"SYSTEM: Is Preview Mode",description:"Is current in preview mode?",type:"bool",value:"",hide:!0},isSupportAuthInDevice:{id:i("beb2a666-3e18-11ed-bdab-6f0cb082fa67"),title:"SYSTEM: Is Support Auth In Device",description:"Is current device support auth in device?",type:"bool",value:"",hide:!0},env:{id:i("74e7a574-1099-4fe5-b193-8a9ea7d20ed0"),title:"SYSTEM: Environment Variables",description:"Environment Variables of the device",type:"object",value:{}},isViewDebugModeEnabled:{id:i("3f61c4f6-1e02-492e-8e4c-a8dc4a5bc101"),title:"SYSTEM: Is View Debug mode Enabled",description:"Is View Debug mode enabled?",type:"bool",value:!1},language:{id:i("f0ed0a03-6195-459f-9ffe-bca61923f94e"),title:"SYSTEM: Language",description:"Language of the device",type:"string",value:""},aiFilters:{id:i("3ffc1e98-8f65-4cc8-a949-3da8d2092ccb"),title:"SYSTEM: AI Filters",description:"AI filters configuration from the application",type:"array",value:[]},systemOpenAIApiKey:{id:i("a1b2c3d4-5e6f-7890-abcd-ef1234567890"),title:"SYSTEM: OpenAI API Key",description:"System OpenAI API Key (only available if application enabled)",type:"string",value:""},systemAnthropicApiKey:{id:i("b2c3d4e5-6f78-9012-bcde-f23456789012"),title:"SYSTEM: Anthropic API Key",description:"System Anthropic API Key (only available if application enabled)",type:"string",value:""},systemGeminiApiKey:{id:i("c3d4e5f6-7890-1234-cdef-345678901234"),title:"SYSTEM: Gemini API Key",description:"System Gemini API Key (only available if application enabled)",type:"string",value:""},ggmlBackendDevices:{id:i("9e8f7a6b-5c4d-3e2f-1a0b-9c8d7e6f5a4b"),title:"SYSTEM: GGML Backend Devices",description:"Available GGML backend devices with supported generators",type:"array",schema:{type:"object",allowNewItem:!1,allowCustomProperty:!1},value:[]}};t.idMap=Object.entries(a).reduce((e,[t,i])=>(e[t]=i.id,e),{}),Object.fromEntries(Object.entries(t.idMap).map(([e,t])=>[t,e])),t.MI=Object.entries(a).reduce((e,[t,i])=>{let{id:a,...r}=i;return e[t]=r,e},{}),Object.keys(t.MI)},18501(e,t,i){let{docs:a}=i(5867);t.isCommand=e=>!!(e&&e.type&&e.type.startsWith("command-node-")),t.getPorts=e=>e?Array.isArray(e)?e:[e]:[],t.getCommandCallbackFromPort=(e,i)=>{let r=e[i];if(!t.isCommand(r))return null;let n=a[r.type.replace("command-node-","")]?.commands?.[r.properties?.command];return n?.iterateeFrom||n?.invocationFrom||null},t.checkDisableTriggerCommand=(e,i)=>t.getPorts(e[i.id]?.in?.[i.port]).some(e=>e?.disable_trigger_command),t.findCircularReferenceIds=e=>{let i,a=(i=new Map,Object.keys(e).reduce((a,r)=>{let n=[];return Object.values(e[r]?.out||{}).forEach(a=>{t.getPorts(a).forEach(a=>{((e,i,a)=>{var r;return!!i&&!!e[i.id]&&!(i.port===(r=i.id,a.has(r)||a.set(r,t.getCommandCallbackFromPort(e,r)),a.get(r))||t.checkDisableTriggerCommand(e,i))})(e,a,i)&&n.push(a.id)})}),a[r]=n,a},{})),r=new Map;return Object.keys(e).filter(t=>e[t]?.type==="data-node").filter(e=>((e,t,i)=>{if(i.has(e))return i.get(e);let a=[{id:e,edgeIndex:0,reachesCycle:!1}],r=new Set([e]);for(;a.length>0;){let e=a[a.length-1],n=t[e.id]||[];if(e.reachesCycle||e.edgeIndex>=n.length){r.delete(e.id),i.set(e.id,e.reachesCycle),a.pop(),e.reachesCycle&&a.length>0&&(a[a.length-1].reachesCycle=!0);continue}let o=n[e.edgeIndex];if(e.edgeIndex+=1,i.has(o)){i.get(o)&&(e.reachesCycle=!0);continue}if(r.has(o)){e.reachesCycle=!0;continue}r.add(o),a.push({id:o,edgeIndex:0,reachesCycle:!1})}return i.get(e)||!1})(e,a,r))},t.hasCircularReference=e=>t.findCircularReferenceIds(e).length>0;let r=(e={})=>Object.entries(e).reduce((e,[t,i])=>(e[t]=Array.isArray(i)?i.slice():i,e),{}),n=new WeakSet,o=(e,t,i)=>{if(!i)return;let a=((e,t)=>{let i=e[t];if(!i)return e[t]=[],e[t];if(!Array.isArray(i))return e[t]=[i],e[t];if(!n.has(i)){let e=0;for(let t of i)t&&(i[e]=t,e+=1);i.length=e,n.add(i)}return i})(e,t);(Array.isArray(i)?i:[i]).forEach(e=>{e&&a.push(e)})};t.getCalcMap=e=>e?.script_map||e?.scriptMap||e?.map||{},t.composeMap=e=>Object.values(e).reduce((e,i)=>Object.entries(t.getCalcMap(i)).reduce((e,[i,a])=>{if(e[i]){if(t.isCommand(a))throw Error(`Doesn't allow same command id in another map, ${i}`);let r=e[i];Object.keys(a?.in||{}).forEach(e=>{o(r.in,e,a.in[e])}),Object.keys(a?.out||{}).forEach(e=>{o(r.out,e,a.out[e])})}else e[i]={...a,in:r(a?.in),out:r(a?.out)};return e},e),{})},86343(e,t,i){let{v4:a}=i(45620),r=i(95479),n=i(56005),{nameMap:o,brickMapping:s,generatorMapping:c}=i(63981);t.idByItem=(e={})=>e.canvas_id||e.subspace_id||e.brick_id||e.generator_id||e.property_bank_id||e.property_bank_calc_id||e.bank_id||e.scene_id,t.getAnimationType=e=>e.type||e.compose_type||e.composeType,t.cleanUpAnimationMap=e=>Object.entries(e).reduce((e,[t,i])=>((i.type||i.compose_type)&&(e[t]=i),e),{}),t.matchItemByItem=(e,t)=>{let i;if(!e)return!1;switch("string"==typeof t&&(i=t),e.type){case"brick":return e.brick_id===(i||t.brick_id);case"subspace":return e.subspace_id===(i||t.subspace_id);case"canvas":return e.canvas_id===(i||t.canvas_id);case"generator":return e.generator_id===(i||t.generator_id);case"property_bank":return e.property_bank_id===(i||t.property_bank_id);default:return!1}},t.makePasscode=()=>a(),t.kindOneOfTypes={string:["color","datetime","id","graphql","rich-text-content","sandbox-script","llm-prompt","media-resource-image","media-resource-video","media-resource-audio","media-resource-file","lottie-file-uri","rive-file-uri","ggml-model-asset","gguf-model-asset","mlx-model-asset","binary-asset","scene3d-objects"],number:["unit"],object:["tts-speaker-config"],"array-object":["llm-tools","llm-messages","mcp-server-resources","mcp-server-tools","mcp-server-prompts"]},t.getKindOneOfTypes=(e,i)=>"array"===e?"object"===i?t.kindOneOfTypes[`${e}-${i}`]:void 0:t.kindOneOfTypes[e],t.unitOneOfTypes=["grid","px","ms"],t.idOneOfTypes=["canvas","brick","generator","animation","property_bank"],t.typeToName={brick:"Brick",generator:"Generator",subspace:"Subspace",canvas:"Canvas",animation:"Animation",property_bank:"Data",property_bank_calc:"Calculation"},t.getBrickName=(e,i,a)=>{let n;if(!i)return e.toUpperCase();if(i.title)return i.title;switch(e){case"bank":n="BANK";break;case"subspace":n="SUBSPACE";break;case"canvas":n="CANVAS";break;case"animation":n=`<${r(t.getAnimationType(i))}>`;break;case"property_bank":n="<Data>";break;case"property_bank_calc":n="<Map>";break;case"state_group":n="<Switch Case>";break;default:n=`<${o[i.template_key||i.templateKey]||"Unknown"}>`}return a&&a.length>10?n+=` (${a.replace(/[A-Z_]+/g,"").substr(0,6)}...)`:a&&(n+=` (${a})`),n},t.getEventLabel=(e,{templateKey:t,itemType:i}={})=>{if(!e)return"";let a=e;return"subspace"===i?a=e.replace("SUBSPACE_ACTION_",""):t&&(a=e.replace(`${t}_`,"").replace("CANVAS_","")),r(n(r(a)))},t.getCallInternalActions=e=>{let t=s[e]||c[e];if(t)return t.callInternalActions},t.mapToList=(e,i)=>Object.entries(i).reduce((i,[a,r])=>(i.push({id:a,...r,title:t.getBrickName(e,r,a)}),i),[]);let d={subspaceMap:"subspace",brickMap:"brick",generatorMap:"generator",propertyBankMap:"property_bank",propertyAvailableToAdd:"property_bank",canvasMap:"canvas",animationMap:"animation"},l={};t.mapToListForDerivedState=(e,i,a,r)=>{let n=a[e]||l;return n!==r[e]?{[e]:n,[i]:t.mapToList(d[e],n)}:{}},t.arrayTypePrefix="array of ",t.propertyBankTypes=["string","number","bool","object","any",`${t.arrayTypePrefix}string`,`${t.arrayTypePrefix}number`,`${t.arrayTypePrefix}bool`,`${t.arrayTypePrefix}object`],t.animationRunTypes=["once","loop"],t.stopPropagationOnKeyBackspace=e=>{8===e.keyCode&&e.stopPropagation()},t.nestedTypes=["object","array","any"],t.isPropertyBankTypeNested=e=>t.nestedTypes.includes(e),t.propertyTypeToSchema=e=>{let i=e.indexOf(t.arrayTypePrefix)>-1,a=e.replace(t.arrayTypePrefix,"");return{type:a,properties:"object"===a?{}:void 0,allowNewItem:i,allowCustomProperty:"object"===a}}},33770(e,t,i){let{idMap:a}=i(66422),{forEachEventAction:r,getActionParam:n}=i(78078),o="PROPERTY_BANK_DATA_NODE_",s=new Set(Object.values(a||{}).filter(e=>"string"==typeof e&&e.startsWith(o)));e.exports=function(e){let t,i,a=[],c=(t=new Set(s),Object.values(e.subspace_map||{}).forEach(e=>{e&&"object"==typeof e&&Object.keys(e.property_bank_map||{}).forEach(e=>t.add(e))}),t),d=(i=new Set,Object.values(e.subspace_map||{}).forEach(e=>{e&&"object"==typeof e&&Object.keys(e.canvas_map||{}).forEach(e=>i.add(e))}),i);return r(e,(e,t)=>{if("PROPERTY_BANK_EXPRESSION"===e.action){let i;Array.isArray(i=n(e,"VARIABLES"))&&i.forEach((e,i)=>{let r=e?.id;if("string"!=typeof r||!r.startsWith(o)||c.has(r))return;let n=e.key?`\`${e.key}\``:`at index ${i}`;a.push({field:`${t}.VARIABLES[${i}].id`,message:`PROPERTY_BANK_EXPRESSION variable ${n} references data node \`${r}\`, which is not defined in any subspace.`})})}else"CHANGE_CANVAS"===e.action&&((e,t,i,a)=>{if("SYSTEM"!==e.handler)return;let r=n(e,"CANVAS_ID");"string"!=typeof r||!r||r.startsWith("PROPERTY_BANK#")||r.startsWith("VARIABLE#")||!r.startsWith("CANVAS_")||i.has(r)||a.push({field:`${t}.CANVAS_ID`,message:`CHANGE_CANVAS references canvas \`${r}\`, which is not defined in any subspace.`})})(e,t,d,a)}),a}},37517(e,t,i){let{composeMap:a,findCircularReferenceIds:r}=i(18501);e.exports=function(e){let t=[];return Object.entries(e.subspace_map||{}).forEach(([e,i])=>{if(i.module?.link)return;let n=i.property_bank_calc_map;if(!n||0===Object.keys(n).length)return;let o=`subspace_map.${e}.property_bank_calc_map`;try{let e=a(n),i=r(e);if(i.length>0){let a=i.slice(0,5).map(t=>e[t].title||t),r=i.length>5?` and ${i.length-5} more`:"";t.push({field:o,message:`Circular reference detected in data calculation. Affected nodes: ${a.join(", ")}${r}. Please check the data connections for loops.`})}}catch(e){t.push({field:o,message:e.message})}}),t}},41900(e){e.exports={expressionFoldAcornOptions:{ecmaVersion:2022,allowReturnOutsideFunction:!0,allowAwaitOutsideFunction:!0},getUnfoldableStatementDescription:(e,t=null)=>{for(let t=0;t<e.length;t+=1){let i=e[t];if("ExpressionStatement"===i.type){let{expression:e}=i;if("AssignmentExpression"===e.type&&"Identifier"!==e.left.type)return"an assignment to a member or computed target";continue}if("VariableDeclaration"===i.type){if(i.declarations.some(e=>"Identifier"!==e.id.type||!e.init))return"a variable declaration with destructuring or no initializer";continue}if(t!==e.length-1||"ReturnStatement"!==i.type)return`an unsupported ${i.type}`}return t}}},78078(e,t,i){let{parse:a}=i(89236),{expressionFoldAcornOptions:r}=i(41900),n=(e,t)=>{let i=e.parameter_list||e.parameterList||[];if(!Array.isArray(i))return;let a=i.find(e=>(e?.input_to_receiver||e?.inputToReceiver)===t);return a?a.result_from_sender??a.resultFromSender:void 0},o=(e,t,i)=>{if(e&&"object"==typeof e){if(Array.isArray(e))return void e.forEach((e,a)=>o(e,`${t}[${a}]`,i));Object.entries(e).forEach(([e,a])=>{("event_map"===e||"eventMap"===e)&&a&&"object"==typeof a?Object.entries(a).forEach(([a,r])=>{Array.isArray(r)&&r.forEach((r,n)=>{r&&"object"==typeof r&&i(r,`${t}.${e}.${a}[${n}]`)})}):a&&"object"==typeof a&&o(a,`${t}.${e}`,i)})}},s=(e,t)=>{Object.entries(e.subspace_map||{}).forEach(([e,i])=>{!i||"object"!=typeof i||i.module?.link||o(i,`subspace_map.${e}`,t)})};e.exports=function(e){let t=[];return s(e,(e,i)=>{if("PROPERTY_BANK_EXPRESSION"!==e.action)return;let o=n(e,"EXPRESSION");if("string"!=typeof o||o.startsWith("PROPERTY_BANK#"))return;let s=(e=>{if(!e.trim())return"Expression is empty";try{a(e,r)}catch(e){return`Expression does not parse: ${e.message}`}return null})(o);s&&t.push({field:i,message:s})}),t},e.exports.forEachEventAction=s,e.exports.getActionParam=n},38890(e,t,i){let{getDocByTemplateKey:a}=i(63981),r=i(80211),n=i(45907),o=i(37517),s=i(78078),c=i(33770),{lintConfig:d,lintRuleCodes:l}=i(9098),{getBrickName:p}=i(86343);t.lintConfig=d,t.lintRuleCodes=l;let u=(e,t,i,a)=>({id:e,name:"Used Deprecated Feature",data:`The \`${p("brick",t,e)}\` brick in \`${p("subspace",i,a)}\` have been deprecated, it may not work in the future, please consider to remove it. If you can't see the item, please enable \`Show Deprecated Features\` in setting.`});t.checkConfigDeprecatedFeatures=e=>{let t=[];return Object.entries(e.subspace_map||{}).forEach(([e,i])=>{Object.entries(i.brick_map||{}).forEach(([r,n])=>{(void 0!==n.property?.borderLeftWidth||void 0!==n.property?.borderRightWidth||void 0!==n.property?.borderTopWidth||void 0!==n.property?.borderBottomWidth)&&t.push({id:r,name:"Used Deprecated Feature",data:`In v2.16, we have been changed \`Border Width\` to \`Border Size\` (Unit \`px\` to \`grid\`). The \`${p("brick",n,r)}\` brick still used the border width. Please re-edit it to transfer to the new unit.`});let o=a(n.template_key);o?.brickMeta?.deprecated&&t.push(u(r,n,i,e))}),Object.entries(i.generator_map||{}).forEach(([r,n])=>{let o=a(n.template_key);o?.brickMeta?.deprecated&&t.push(u(r,n,i,e))})}),t},t.checkConfig=(e,t={})=>{let i={schema:r(e),ref:n(e,t),calc:t.checkCalc?o(e):[],expression:t.checkExpressions?s(e):[],actionRef:t.checkActionRefs?c(e):[]};return i.valid=0===i.schema.length&&0===i.ref.length&&0===i.calc.length&&0===i.expression.length&&0===i.actionRef.length,i.message=i.schema.concat(i.ref).concat(i.calc).concat(i.expression).concat(i.actionRef).map(({instancePath:e,field:t,message:i})=>{let a=e||t;return a?`${a}: ${i}`:i}).join("\n"),i}},27899(e){let t=["x","y","width","height"],i=e=>"string"==typeof e&&e.startsWith("PROPERTY_BANK_"),a=/PROPERTY_BANK#(PROPERTY_BANK_[A-Za-z0-9_-]+)/g,r=/(?:BRICK|ANIMATION|SUBSPACE)_[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}/g,n=(e,t=new Set)=>{if("string"==typeof e){let i;for(a.lastIndex=0;i=a.exec(e);)t.add(i[1])}else Array.isArray(e)?e.forEach(e=>n(e,t)):e&&"object"==typeof e&&(i(e.id)&&t.add(e.id),Object.values(e).forEach(e=>n(e,t)));return t},o=(e,t)=>{if("string"==typeof e){let i;for(r.lastIndex=0;i=r.exec(e);)t.add(i[0])}else Array.isArray(e)?e.forEach(e=>o(e,t)):e&&"object"==typeof e&&Object.values(e).forEach(e=>o(e,t));return t},s=(e,t)=>{Object.entries(e.subspace_map||{}).forEach(([e,i])=>{!i||"object"!=typeof i||i.module?.link||t(e,i)})},c=(e,t)=>{s(e,(e,i)=>{Object.entries(i.canvas_map||{}).forEach(([a,r])=>{let n=Array.isArray(r?.item_list)?r.item_list:[];t({subspaceId:e,subspace:i,canvasId:a,canvas:r,items:n})})})},d=[["brick_map","brick"],["generator_map","generator"],["property_bank_map","property_bank"],["canvas_map","canvas"]],l=(e,t,i)=>{d.forEach(([a,r])=>{Object.entries(t[a]||{}).forEach(([t,n])=>{Object.entries(n?.event_map||{}).forEach(([n,o])=>{Array.isArray(o)&&i({ownerType:r,ownerId:t,eventKey:n,list:o,path:`subspace_map.${e}.${a}.${t}.event_map.${n}`})})})})},p=(e,t)=>(e.parameter_list||[]).find(e=>e?.input_to_receiver===t)?.result_from_sender;e.exports={FRAME_KEYS:t,isBankNodeId:i,collectBankReads:n,forEachSubspace:s,forEachCanvas:c,forEachCanvasItem:(e,t)=>{c(e,e=>{e.items.forEach((i,a)=>{t({...e,item:i,index:a})})})},forEachEventList:l,getParamValue:p,hasParamValue:(e,t)=>{let i=p(e,t);return null!=i&&""!==i},collectDynamicallyReferencedIds:e=>{let t=new Set;return s(e,(e,i)=>{l(e,i,({list:e})=>{e.forEach(e=>o(e?.parameter_list,t))})}),o(e.automation_map,t),o(e.test_map,t),t},frameIsNumeric:e=>!!e&&t.every(t=>"number"==typeof e[t]),framesAlmostEqual:(e,i,a=.01)=>t.every(t=>Math.abs(e[t]-i[t])<=a),frameContains:(e,t,i=.01)=>e.x<=t.x+i&&e.y<=t.y+i&&e.x+e.width>=t.x+t.width-i&&e.y+e.height>=t.y+t.height-i,framesIntersect:(e,t)=>!(e.x+e.width<=t.x||t.x+t.width<=e.x||e.y+e.height<=t.y||t.y+t.height<=e.y),getItemId:e=>e?.brick_id||e?.subspace_id||null,itemHasAnimations:e=>!!e?.animations&&Object.keys(e.animations).length>0}},9098(e,t,i){let{collectDynamicallyReferencedIds:a}=i(27899),r=[i(98632),i(84223),i(92260),i(96810),i(60760),i(40566),i(31172),i(59707),i(39425)],n=r.map(e=>e.code),o=e=>Array.isArray(e)?e:"string"==typeof e&&e?e.split(",").map(e=>e.trim()).filter(Boolean):null;e.exports={lintConfig:(e,t={})=>{let i,s=o(t.only),c=o(t.ignore),d=[...s||[],...c||[]].filter(e=>!n.includes(e));if(d.length>0)throw Error(`Unknown lint rule code(s): ${d.join(", ")}. Valid codes: ${n.join(", ")}`);if(!e||"object"!=typeof e)return[];let l=r.filter(e=>(!s||s.includes(e.code))&&(!c||!c.includes(e.code)));if(0===l.length)return[];let p={configType:"module"===t.configType?"module":"app",gridStep:"number"==typeof t.gridStep&&t.gridStep>0?t.gridStep:.5,get dynamicRefIds(){return i||(i=a(e)),i}},u=[];return l.forEach(t=>{try{t.check(e,p,e=>u.push({severity:t.severity,code:t.code,path:"",subspaceId:null,itemId:null,hint:null,...e}))}catch(e){u.push({severity:"warning",code:t.code,path:"",subspaceId:null,itemId:null,message:`Lint rule crashed: ${e.message}`,hint:null})}}),u},lintRuleCodes:n}},98632(e,t,i){let{composeMap:a}=i(18501),{forEachSubspace:r,forEachEventList:n,collectBankReads:o,isBankNodeId:s,getParamValue:c}=i(27899),d=(e,t)=>t.map(t=>c(e,t)).filter(s),l={PROPERTY_BANK:{waitable:!0,targets:e=>(e.parameter_list||[]).map(e=>e?.input_to_receiver).filter(s)},PROPERTY_BANK_EXPRESSION:{waitable:!0,targets:e=>d(e,["RESULT","ERROR_RESULT"])},PROPERTY_BANK_COMMAND:{waitable:!0,targets:(e,t)=>((e,t)=>{let i=t();if(!i)return[];let a=[],r=new Set,n=(e.parameter_list||[]).map(e=>e?.input_to_receiver).filter(s);for(let e=0;e<n.length;e+=1){let t=n[e];if(r.has(t))continue;r.add(t);let o=i[t];o&&Object.values(o.out||{}).forEach(e=>{(e||[]).forEach(e=>{e?.id&&(e.id.includes("DATA_NODE")&&a.push(e.id),n.push(e.id))})})}return a})(e,t)},STORAGE_RETRIEVE:{waitable:!0,targets:e=>d(e,["STORAGE_RETRIEVE_RESULT"])},OPEN_FILE:{waitable:!0,targets:e=>d(e,["SAVE_PROPERTY","SAVE_DETAIL_PROPERTY","ERROR_SAVE_PROPERTY"])},SAVE_UPDATE_SNAPSHOT:{waitable:!0,targets:e=>d(e,["SNAPSHOT_SAVE_RESULT","SNAPSHOT_ERROR_RESULT"])},TRIGGER_APPLICATION_FILTER:{waitable:!0,targets:e=>d(e,["RESULT","ERROR_RESULT"])},TAKE_SCREENSHOT:{waitable:!1,targets:e=>d(e,["TAKE_SCREENSHOT_SAVE_PROPERTY"])}},p=/(^|_)RESULT$|_SAVE_PROPERTY$/;e.exports={code:"data-update-race",severity:"warning",description:"A data node is written without wait_async and read by a later action in the same event",check(e,t,i){r(e,(e,t)=>{let r,c=()=>{if(void 0===r)try{r=a(t.property_bank_calc_map||{})}catch{r=null}return r};n(e,t,({path:t,list:a})=>{let r=new Map;a.forEach((a,n)=>{if(!a||"object"!=typeof a)return;if("SYSTEM"===a.handler&&"DELAY"===a.action)return void r.clear();let d=new Set;(a.parameter_list||[]).forEach(e=>o(e?.result_from_sender,d)),d.forEach(o=>{let s=r.get(o);s&&(i({path:`${t}.${n}`,subspaceId:e,itemId:o,message:`\`${o}\` is written by action #${s.index} (${s.action}) without waiting, then read by action #${n} (${a.action}) — the read can still see the previous value.`,hint:s.waitable?`Set \`wait_async: true\` on action #${s.index} (${s.action}).`:`${s.action} ignores \`wait_async\` for its data write — insert a SYSTEM DELAY action between the two, or move the read into the data node's value-change event.`}),r.delete(o))});let u=((e,t)=>{if("SYSTEM"===e.handler){let i=l[e.action];if(!i)return null;let a=i.targets(e,t);return a.length>0?{targets:a,waitable:i.waitable}:null}let i=(e.parameter_list||[]).filter(e=>"string"==typeof e?.input_to_receiver&&p.test(e.input_to_receiver)&&s(e.result_from_sender)).map(e=>e.result_from_sender);return i.length>0?{targets:i,waitable:!0}:null})(a,c);if(!u)return;let f=!0===a.wait_async&&u.waitable;u.targets.forEach(e=>{f?r.delete(e):r.set(e,{index:n,action:a.action,waitable:u.waitable})})})})})}}},39425(e,t,i){let{forEachSubspace:a,forEachEventList:r,getParamValue:n}=i(27899),o=new Set(["Math","Date","Object","Array","Number","String","Boolean","JSON","RegExp","Intl","isNaN","isFinite","parseInt","parseFloat"]);e.exports={code:"expression-global-variable",severity:"error",description:"A PROPERTY_BANK_EXPRESSION variable is named after a JS global and is silently ignored at runtime",check(e,t,i){a(e,(e,t)=>{r(e,t,({path:t,list:a})=>{a.forEach((a,r)=>{if(a?.handler!=="SYSTEM"||"PROPERTY_BANK_EXPRESSION"!==a.action)return;let s=n(a,"VARIABLES");Array.isArray(s)&&s.forEach(a=>{let n=a?.key;"string"==typeof n&&o.has(n)&&i({path:`${t}.${r}`,subspaceId:e,itemId:null,message:`Expression variable "${n}" is named after the JS global \`${n}\` and is silently ignored — the global takes precedence in the expression scope, so the bound value is never used.`,hint:`Rename the variable (e.g. "${n}Value") so the expression reads the bound value.`})})})})})}}},40566(e,t,i){let{forEachSubspace:a,forEachEventList:r,hasParamValue:n}=i(27899),o=[{action:"STORAGE_RETRIEVE",severity:"error",isMissing:e=>!n(e,"STORAGE_RETRIEVE_RESULT"),message:"STORAGE_RETRIEVE requires a STORAGE_RETRIEVE_RESULT parameter — without it the action throws at runtime.",hint:"Add a STORAGE_RETRIEVE_RESULT parameter pointing at a data node."},{action:"TAKE_SCREENSHOT",severity:"warning",isMissing:e=>!n(e,"TAKE_SCREENSHOT_SAVE_PROPERTY"),message:"TAKE_SCREENSHOT without TAKE_SCREENSHOT_SAVE_PROPERTY is silently skipped at runtime.",hint:"Add a TAKE_SCREENSHOT_SAVE_PROPERTY parameter pointing at a data node."},{action:"OPEN_FILE",severity:"warning",isMissing:e=>!n(e,"SAVE_PROPERTY")&&!n(e,"SAVE_DETAIL_PROPERTY"),message:"OPEN_FILE has no SAVE_PROPERTY / SAVE_DETAIL_PROPERTY — the picked file is discarded.",hint:"Add SAVE_PROPERTY (file uri) or SAVE_DETAIL_PROPERTY (file detail) parameters."},{action:"OPEN_URL",severity:"warning",isMissing:e=>!n(e,"URL"),message:"OPEN_URL has no URL parameter — the action does nothing.",hint:"Add a URL parameter."}];e.exports={code:"missing-result-param",severity:"warning",description:"An action is missing the parameter that receives or drives its effect",check(e,t,i){a(e,(e,t)=>{r(e,t,({path:t,list:a})=>{a.forEach((a,r)=>{if(a?.handler!=="SYSTEM")return;let n=o.find(e=>e.action===a.action);n&&n.isMissing(a)&&i({path:`${t}.${r}`,subspaceId:e,itemId:null,severity:n.severity,message:n.message,hint:n.hint})})})})}}},92260(e,t,i){let{forEachCanvasItem:a,frameIsNumeric:r,getItemId:n,FRAME_KEYS:o}=i(27899),s=["width","height"];e.exports={code:"off-grid-frame",severity:"warning",description:"Frame values should be multiples of the 0.5 grid step",check(e,t,i){let c=t.gridStep;a(e,({subspaceId:e,canvasId:t,item:a,index:d})=>{let l=a?.frame;if(!r(l))return;let p=o.filter(e=>{let t=l[e];return(!s.includes(e)||!(t<=c))&&Math.abs(t-Math.round(t/c)*c)>.001});0!==p.length&&i({path:`subspace_map.${e}.canvas_map.${t}.item_list.${d}.frame`,subspaceId:e,itemId:n(a),message:`Frame ${p.map(e=>`${e}=${l[e]}`).join(", ")} ${1===p.length?"is":"are"} not aligned to the ${c} grid step.`,hint:`Round frame values to multiples of ${c}.`})})}}},96810(e,t,i){let{forEachCanvasItem:a,frameIsNumeric:r,getItemId:n,itemHasAnimations:o}=i(27899);e.exports={code:"out-of-bounds-frame",severity:"warning",description:"An element is fully outside the subspace layout or has a non-positive size",check(e,t,i){a(e,({subspaceId:a,subspace:s,canvasId:c,item:d,index:l})=>{let p=s.layout;if("number"!=typeof p?.width||"number"!=typeof p?.height||p.width<=0||p.height<=0)return;let u=d?.frame;if(!r(u)||!0===u.exceed_boundary||u.standby_frame||o(d))return;let f=n(d);if(f&&t.dynamicRefIds.has(f))return;let b=`subspace_map.${a}.canvas_map.${c}.item_list.${l}.frame`;if(u.width<=0||u.height<=0)return void i({path:b,subspaceId:a,itemId:f,message:`Frame has a non-positive size (width=${u.width}, height=${u.height}) — the element renders nothing.`,hint:"Give the element a positive size, or remove it if unused."});let h=a===e.root_subspace_id,m=u.x>=p.width||u.x+u.width<=0,y=u.y>=p.height||u.y+u.height<=0;(m||!h&&y)&&i({path:b,subspaceId:a,itemId:f,message:`Frame (x=${u.x}, y=${u.y}, width=${u.width}, height=${u.height}) is fully outside the ${p.width}\xd7${p.height} layout — nothing is visible.`,hint:"Move the element back into the layout, or set `exceed_boundary` if the placement is intentional."})})}}},84223(e,t,i){let{FRAME_KEYS:a,forEachCanvas:r,frameIsNumeric:n,framesAlmostEqual:o,framesIntersect:s,itemHasAnimations:c}=i(27899),d=new Set(["BRICK_TEXT","BRICK_RICH_TEXT"]),l=["linearGradientEnabled","blurEnabled"],p=e=>Object.values(e?.event_map||{}).some(e=>Array.isArray(e)&&e.length>0),u=/^backgroundColor$|^border/,f=(e,t)=>{if(e?.type!=="brick")return null;let i=t[e.brick_id];return d.has(i?.template_key)?i:null},b=e=>a.map(t=>Math.floor(e[t]/.01)),h=e=>e.join(":"),m=(e,t,i,a)=>{if(!n(t?.frame)||!f(t,i))return;let r=h(b(t.frame)),o=(e.get(r)||0)+a;o>0?e.set(r,o):e.delete(r)};e.exports={code:"redundant-rect-overlay",severity:"info",description:"A plain Rect behind a same-frame Text/RichText can be folded into the text brick",check(e,t,i){r(e,({subspaceId:e,subspace:a,canvasId:r,items:d})=>{let y,E=a.brick_map||{},_=(y=new Map,d.forEach(e=>m(y,e,E,1)),y);d.forEach((a,y)=>{if(m(_,a,E,-1),a?.type!=="brick"||!n(a.frame))return;let g=E[a.brick_id];if(g?.template_key!=="BRICK_RECT"||c(a)||t.dynamicRefIds.has(a.brick_id))return;let S={...g.property,...a.property};if(l.some(e=>S[e])||!((e,t)=>{let[i,a,r,n]=b(t);for(let t=-1;t<=1;t+=1)for(let o=-1;o<=1;o+=1)for(let s=-1;s<=1;s+=1)for(let c=-1;c<=1;c+=1)if(e.has(h([i+t,a+o,r+s,n+c])))return!0;return!1})(_,a.frame))return;let v=p(g);for(let t=y+1;t<d.length;t+=1){let c=d[t];if(!n(c?.frame))continue;let l=f(c,E);if(l&&o(a.frame,c.frame,.01)){let t={...l.property,...c.property};if(Object.keys(t).some(e=>u.test(e)&&void 0!==t[e])||v&&p(l))return;i({path:`subspace_map.${e}.canvas_map.${r}.item_list.${y}`,subspaceId:e,itemId:a.brick_id,message:`Rect \`${g.title||a.brick_id}\` has the same frame as the ${l.template_key} above it and only uses base styles`+(v?", behind its press handler.":"."),hint:v?"Make the Text brick pressable, move backgroundColor / border / radius and the press handler onto it, then remove the Rect.":"Set backgroundColor / border / radius directly on the text brick and remove the Rect."});return}if(s(a.frame,c.frame))return}})})}}},31172(e,t,i){let{autoGeneratedItemIdKind:a}=i(99470),{forEachSubspace:r}=i(27899),n="PROPERTY_BANK_",o=()=>({children:Object.create(null),ids:null}),s=(e,t)=>{let i=e;for(let e of t)i.children[e]||(i.children[e]=o()),i=i.children[e];i.ids||(i.ids=[]),i.ids.push(t)},c=(e,t,i,a)=>{let r=i.children[e[a]];if(r){r.ids&&r.ids.forEach(e=>{t.set(e,t.get(e)+1)});for(let i=a+1;i<e.length&&(r=r.children[e[i]]);i+=1)r.ids&&r.ids.forEach(e=>{t.set(e,t.get(e)+1)})}};e.exports={code:"unused-data-node",severity:"info",description:"A data node is defined but never referenced anywhere in the config",check(e,t,i){let d=JSON.stringify(e),l=[];r(e,(i,r)=>{("module"!==t.configType||i!==e.root_subspace_id)&&Object.entries(r.property_bank_map||{}).forEach(([e,t])=>{!(!t||"object"!=typeof t||t.kind===a||t.enable_remote_update||t.global_remote_update_prop||t.linkedFrom||t.alias||t.preload||r.routing?.[e]?.enabled_routing)&&(Object.values(t?.event_map||{}).some(e=>Array.isArray(e)&&e.length>0)||l.push({subspaceId:i,nodeId:e,node:t}))})});let p=((e,t)=>{let i=[...new Set(t)];if(0===i.length)return new Map;let a=new Map(i.map(e=>[e,0])),r=o(),d=o(),l=!1,p=!1;if(i.forEach(e=>{e.startsWith(n)?(s(r,e),l=!0):(s(d,e),p=!0)}),l){let t=e.indexOf(n);for(;-1!==t;)c(e,a,r,t),t=e.indexOf(n,t+1)}if(p)for(let t=0;t<e.length;t+=1)c(e,a,d,t);return a})(d,l.map(({nodeId:e})=>e));l.forEach(({subspaceId:e,nodeId:t,node:a})=>{(p.get(t)||0)>1||i({path:`subspace_map.${e}.property_bank_map.${t}`,subspaceId:e,itemId:t,message:`Data node \`${a.title||t}\` is never referenced in the config.`,hint:"Remove it, or keep it if external tooling depends on it."})})}}},60760(e,t,i){let{forEachSubspace:a,forEachEventList:r}=i(27899),n=new Set(["MESSAGE","ALERT","POPUP_RESET","TAKE_SCREENSHOT","THROW_EXCEPTION","RESTART_FOUNDATION","DYNAMIC_BRICK","DYNAMIC_BRICK_RESET","DYNAMIC_ANIMATION","DYNAMIC_ANIMATION_RESET","DYNAMIC_ANIMATION_STOP","CHANNEL_SUBSCRIBE","CHANNEL_UNSUBSCRIBE","CHANNEL_PUBLISH","DISMISS_KEYBOARD","STORAGE_SET","STORAGE_DELETE","DELAY","USE_SHARE_APPLICATION","AUTH_IN_DEVICE","REFRESH_BINDCODE","STOP_APPLICATION_FILTER"]);e.exports={code:"wait-async-no-op",severity:"info",description:"wait_async is set on an action that ignores it",check(e,t,i){a(e,(e,t)=>{r(e,t,({path:t,list:a})=>{a.forEach((a,r)=>{a?.handler!=="SYSTEM"||!0!==a.wait_async||n.has(a.action)&&i({path:`${t}.${r}`,subspaceId:e,itemId:null,message:"DELAY"===a.action?"DELAY always waits for its timeout — `wait_async: true` is redundant.":`\`wait_async: true\` has no effect on ${a.action}; the action does not block the chain.`,hint:"DELAY"===a.action?"Remove the redundant flag.":"Remove the flag, or restructure if you relied on it for sequencing."})})})})}}},59707(e,t,i){let{forEachCanvas:a,frameIsNumeric:r,frameContains:n,itemHasAnimations:o}=i(27899);e.exports={code:"z-order-cover",severity:"info",description:"A later opaque element fully covers an earlier pressable element",check(e,t,i){a(e,({subspaceId:e,subspace:a,canvasId:s,items:c})=>{let d=a.brick_map||{},l=[];if(c.forEach((e,t)=>{if(e?.type!=="brick"||!r(e.frame))return;let i=d[e.brick_id];i&&Object.entries(i?.event_map||{}).some(([e,t])=>e.includes("_ON_PRESS")&&Array.isArray(t)&&t.length>0)&&l.push({item:e,index:t,brick:i})}),0===l.length)return;let p=t.dynamicRefIds,u=c.map((e,t)=>((e,t,i,a)=>{let n;if(e?.type!=="brick"||!r(e.frame)||o(e)||a.has(e.brick_id))return null;let s=i[e.brick_id],c={...s?.property,...e.property};return"string"==typeof(n=c.backgroundColor)&&(/^rgba\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*1(?:\.0+)?\s*\)$/.test(n)||/^rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)$/.test(n)||/^#[0-9a-fA-F]{6}$/.test(n))&&(void 0===c.opacity||1===c.opacity)?{index:t,item:e,brick:s,frame:e.frame}:null})(e,t,d,p)).filter(Boolean),f=(e=>{let t=Array(e.length),i=1/0,a=1/0,r=-1/0,n=-1/0,o=-1/0,s=-1/0;for(let c=e.length-1;c>=0;c-=1){let{frame:d}=e[c];i=Math.min(i,d.x),a=Math.min(a,d.y),r=Math.max(r,d.x+d.width),n=Math.max(n,d.y+d.height),o=Math.max(o,d.width),s=Math.max(s,d.height),t[c]={minX:i,minY:a,maxRight:r,maxBottom:n,maxWidth:o,maxHeight:s}}return t})(u),b=0;l.forEach(({item:t,index:a,brick:r})=>{let c,d;if(!(o(t)||p.has(t.brick_id))){for(;b<u.length&&u[b].index<=a;)b+=1;if(c=f[b],d=t.frame,c&&c.minX<=d.x+.01&&c.minY<=d.y+.01&&c.maxRight>=d.x+d.width-.01&&c.maxBottom>=d.y+d.height-.01&&c.maxWidth>=d.width-.02&&c.maxHeight>=d.height-.02)for(let o=b;o<u.length;o+=1){let c=u[o];if(n(c.frame,t.frame))return void i({path:`subspace_map.${e}.canvas_map.${s}.item_list.${a}`,subspaceId:e,itemId:t.brick_id,message:`Pressable \`${r.title||t.brick_id}\` is fully covered by the opaque \`${c.brick?.title||c.item.brick_id}\` later in the item list — it is invisible and untappable.`,hint:"Reorder the items, shrink the covering element, or remove the hidden one."})}}})})}}}};
|
package/lib/8117.js
CHANGED
|
@@ -2472,7 +2472,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2472
2472
|
timestamp
|
|
2473
2473
|
}
|
|
2474
2474
|
}
|
|
2475
|
-
`,tY=H(function e(i,t){J(this,e),this.baseUrl=i,this.token=t,this.graphqlUrl=`${i}/api/graphql`},[{key:"graphql",value:(o=$(function*(e,i){var t=yield(0,x.Ay)(this.graphqlUrl,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.token}`,Accept:"application/json"},body:JSON.stringify({query:e,variables:i})});if(!t.ok){var n=yield t.text().catch(()=>"");throw Error(`Activity-log query failed (${t.status}): ${n}`)}var a=yield t.json();if(a.errors?.length)throw Error(a.errors.map(e=>e.message).join("\n"));return a.data}),function(e,i){return o.apply(this,arguments)})},{key:"events",value:(r=$(function*(e,{limit:i,offset:t}={}){var n={...e};return null!=i&&(n.limit=i),null!=t&&(n.offset=t),(yield this.graphql(tV,{filter:n})).events}),function(e){return r.apply(this,arguments)})},{key:"screenshots",value:(s=$(function*(e){return(yield this.graphql(tK,{filter:e})).screenshots}),function(e){return s.apply(this,arguments)})},{key:"downloadScreenshot",value:(d=$(function*(e,i,t){var n=`${this.baseUrl}/api/v1/${encodeURIComponent(e)}/${encodeURIComponent(i)}/screenshot?ts=${encodeURIComponent(t)}`,a=yield(0,x.Ay)(n,{headers:{Authorization:`Bearer ${this.token}`}});if(!a.ok){var o=yield a.text().catch(()=>"");throw Error(`Screenshot fetch failed (${a.status}): ${o}`)}return Buffer.from((yield a.arrayBuffer()))}),function(e,i,t){return d.apply(this,arguments)})}]);process.env.STAGE,process.env.URL_BASE;var tG="bricks-mcp",tL={bricks:process.env.BRICKS_API_SERVER||"https://display-beta.bricks.tools",media:process.env.MEDIA_API_SERVER||"https://media-beta.bricks.tools",activityLog:process.env.ACTIVITY_LOG_API_SERVER||"https://activity-log-beta.bricks.tools"};process.env.AUTH0_DOMAIN,process.env.CACHE_URL;var tz=t(1639);let tH=({type:e,title:i,template_key:t})=>{var n,a,o=(0,tz.M4)(e);switch(e){case"subspace":n={title:i,layout:{width:"number",height:"number"},root_canvas_id:"CANVAS_<UUID>",canvas_map:{},brick_map:{},animation_map:{},generator_map:{},property_bank_map:{},property_bank_calc_map:{}},a={"canvas_map.CANVAS_<UUID>.item_list":[{type:"subspace",subspace_id:"SUBSPACE_<UUID>",$note:"If not a root subspace, it can be linked to canvas in other subspace"}]};break;case"canvas":var r=V(j.Ji);n={title:i,item_list:[],property:{$definitions:Object.fromEntries(Object.entries(r.propTypes).map(([e,i])=>[e,{...i,description:r.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(r.eventTypes).map(([e])=>[e,{description:r.brickEventDescriptions[e]}]))}},a={property_bank_map:{[(0,tz.M4)("property_bank")]:{title:`Canvas ID: ${i}`,type:"string",value:o,routing:"read-only",kind:"auto-generated-item-id",idType:"canvas"}}};break;case"brick":var s=V(j.dK.Basic),d=V(j.brickMapping[t]);if(!d)throw Error(`Brick ${t} not found`);var c={...d,propTypes:{...s.propTypes,...d.propTypes},brickPropDescriptions:{...s.brickPropDescriptions,...d.brickPropDescriptions},eventTypes:{...s.eventTypes,...d.eventTypes},brickEventDescriptions:{...s.brickEventDescriptions,...d.brickEventDescriptions}};n={title:i,template_key:t,property:{$definitions:Object.fromEntries(Object.entries(c.propTypes).map(([e,i])=>[e,{...i,description:c.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(c.eventTypes).map(([e])=>[e,{description:c.brickEventDescriptions[e]}]))},outlet:{$definitions:Object.fromEntries(Object.entries(c.outletTypes??{}).map(([e])=>[e,{description:(c.brickOutletDescriptions??{})[e]}]))},state_group:{"BRICK_STATE_GROUP_<UUID>":{}}},a={canvas_map:{"CANVAS_<UUID WHICH NEED DISPLAY THIS BRICK>":{item_list:[{type:"brick",brick_id:o,frame:{x:"number",y:"number",width:"number",height:"number",standby_mode:"custom|top|left|right|bottom",standby_delay:"number",standby_easing:{default:{method:"ease",duration:"number"}}}}]}}};break;case"state_group":n={title:i,description:"State Group Description",conds:[{type:"property_bank|inner_state",key:"PROPERTY_BANK#<Data Node ID>|[current_canvas|BRICK_<OUTLET NAME>]|",method:"==|!=|>|>=|<|<=",value:"value_to_compare"}],override:{property:!1,event:!1,outlet:!1},commented:!1,break:!1,property:{},outlet:{},animation:{}};break;case"generator":var l=V(j.generatorMapping[t]);if(!l)throw Error(`Generator ${t} not found`);n={title:i,template_key:t,property:{$definitions:Object.fromEntries(Object.entries(l.propTypes).map(([e,i])=>[e,{...i,description:l.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(l.eventTypes).map(([e])=>[e,{description:l.brickEventDescriptions[e]}]))},outlet:{$definitions:Object.fromEntries(Object.entries(l.outletTypes).map(([e])=>[e,{description:l.brickOutletDescriptions[e]}]))}};break;case"animation":n={title:i,type:"timing|decay|spring",property:"opacity|transform.translateX|transform.scale|etc",config:{$note:"Config for the animation"},compose_type:"parallel|sequence",item_list:[{animation_id:"ANIMATION_<SUB ANIMATION UUID>"}]};break;case"property_bank":n={title:i,description:"Property Bank Description",linkedFrom:"SUBSPACE_<UUID WHICH IS CROSS SUBSPACE>",type:"string|number|bool|object|array|any",kind:"color|datetime|id|media-resource-*|lottie-file-uri",unit:"grid|px|ms",routing:"read-only|default",value:"fit-to-type",event_map:{$note:`Available events: ${Object.keys(j.qJ.eventTypes).join(", ")}`},local_sync:{update_mode:"all|main-only|minor-only|dont-sync"},$remote_update_additional:{$note:"Configure remote update behavior",enable_remote_update:!0,bank_type:"create|create-device-specific"}};break;case"property_bank_command":break;case"property_bank_calc":var p=(0,tz.M4)("property_bank_command"),u=(0,tz.M4)("property_bank_command"),m=(0,tz.M4)("property_bank_command"),_="const { arg_name } = inputs;\n\nreturn { arg_name };";n={title:i,map:{$note:"Required, actual implementation","PROPERTY_BANK_DATA_NODE_<UUID>":{type:"data-node",properties:{},in:{change:null},out:{value:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID>",port:"value"}]},$note:"Use this to input data to the sandbox"},"PROPERTY_BANK_COMMAND_NODE_<UUID FIRST>":{type:"command-node-object",title:"Command: OBJECT_SET",properties:{command:"OBJECT_SET",args:{path:"arg_name"}},in:{obj:null,path:null,value:[{id:"PROPERTY_BANK_DATA_NODE_<UUID>",port:"value"}]},out:{result:[{id:`PROPERTY_BANK_COMMAND_NODE_<UUID NEXT> | ${p}`,port:"obj | inputs"}]}},"PROPERTY_BANK_COMMAND_NODE_<UUID SECOND>":{type:"command-node-object",title:"Command: OBJECT_SET",properties:{command:"OBJECT_SET",args:{path:"arg_name"}},in:{obj:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID PREVIOUS>",port:"result"}],path:null,value:[{id:"PROPERTY_BANK_DATA_NODE_<UUID SECOND>",port:"value"}]},out:{result:[{id:`PROPERTY_BANK_COMMAND_NODE_<UUID NEXT> | ${p}`,port:"obj | inputs"}]}},[p]:{type:"command-node-sandbox",title:"Command: SANDBOX_RUN_JAVASCRIPT",properties:{command:"SANDBOX_RUN_JAVASCRIPT",args:{code:_,enable_async:!1}},in:{code:null,inputs:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID FINAL>",port:"result"}]},out:{result:[{id:m,port:"result"},{id:u,port:"result"}]}},[m]:{type:"command-node-sandbox",title:"Command: SANDBOX_GET_ERROR",properties:{command:"SANDBOX_GET_ERROR"},in:{result:[{id:p,port:"result"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE ERROR>",port:"change"}],$note:"Set `result` as null if there is no error"}},[u]:{type:"command-node-sandbox",title:"Command: SANDBOX_GET_RETURN_VALUE",properties:{command:"SANDBOX_GET_RETURN_VALUE"},in:{result:[{id:p,port:"result"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT> | PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT> | null",port:"change"}]}},"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT>":{type:"data-node",properties:{},in:{change:[{id:u,port:"result"}]},out:{value:null},$note:"Put full result into data node"},"PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT>":{type:"command-node-object",title:"Command: OBJECT_GET",properties:{command:"OBJECT_GET",args:{path:"obj_key"}},in:{obj:[{id:u,port:"obj"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>",port:"change"}]},$note:"Parse result object into data node"},"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>":{type:"data-node",properties:{},in:{change:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT>",port:"result"}]},out:{value:null},$note:"Put partial result into data node"}},editor_info:{},type:"script",script_config:{title:i,enable_async:!1,inputs:{"PROPERTY_BANK_DATA_NODE_<UUID>":"arg_name"},disabled_triggers:{},error:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE ERROR> | null",output:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT> | null",outputs:{obj_key:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>"},code:_,$note:"Required, info for GUI editor"}}}return C({id:o,example:n,extraInfo:a})};var tJ="2.25.0-beta.68";function tX(){return tQ.apply(this,arguments)}function tQ(){return(tQ=$(function*(e={}){var i,t=e.token||process.env.BRICKS_API_TOKEN;if(!t)throw console.error("Error: API token is required"),console.error("Please provide a token via options or set BRICKS_API_TOKEN environment variable"),Error("API token is required");var n=function(e){try{var i=e.queryStringParameters?.token;if(!i){var t=new Headers(e.headers);i=t.get("authorization")?.replace("Bearer ","")}if(!i)return{success:!1,message:"Authentication failed: No token provided"};var n=function(e){try{var i=e.split(".");if(i.length<3)return null;var t=JSON.parse(Buffer.from(i[0],"base64url").toString());if(!k.includes(t?.alg))return null;return JSON.parse(Buffer.from(i[1],"base64url").toString())}catch{return null}}(i);if(!n)return{success:!1,message:"Authentication failed: Invalid token"};var a=D.includes(n.iss)?"user":"workspace";if("workspace"===a){var o=Array.isArray(n.t)?n.t:[];n.permissions=o.reduce((e,i)=>{var t=I[i];return t&&e.push(t),e},[])}else n.permissions=Object.keys(b);return{success:!0,token:i,tokenInfo:n,tokenType:a}}catch(e){return{success:!1,message:`Authentication failed: ${e.message}`}}}({queryStringParameters:{token:t}});if(!n.success)throw console.error("Error: Invalid BRICKS_API_TOKEN"),console.error(n.message),Error("Invalid BRICKS_API_TOKEN");var a=new v._({name:tG,version:tJ}),o={...n,client:function(e,i,t){switch(t){case"user":return new iE(e,i);case"workspace":return new i8(e,i);default:throw Error(`Invalid token type: ${t}.`)}}(tL.bricks,n.token,n.tokenType)};a.prompt("getting-started","Getting started with BRICKS",{},$(function*(){return{messages:[{role:"user",content:{type:"text",text:`Welcome to BRICKS — start here.
|
|
2475
|
+
`,tY=H(function e(i,t){J(this,e),this.baseUrl=i,this.token=t,this.graphqlUrl=`${i}/api/graphql`},[{key:"graphql",value:(o=$(function*(e,i){var t=yield(0,x.Ay)(this.graphqlUrl,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.token}`,Accept:"application/json"},body:JSON.stringify({query:e,variables:i})});if(!t.ok){var n=yield t.text().catch(()=>"");throw Error(`Activity-log query failed (${t.status}): ${n}`)}var a=yield t.json();if(a.errors?.length)throw Error(a.errors.map(e=>e.message).join("\n"));return a.data}),function(e,i){return o.apply(this,arguments)})},{key:"events",value:(r=$(function*(e,{limit:i,offset:t}={}){var n={...e};return null!=i&&(n.limit=i),null!=t&&(n.offset=t),(yield this.graphql(tV,{filter:n})).events}),function(e){return r.apply(this,arguments)})},{key:"screenshots",value:(s=$(function*(e){return(yield this.graphql(tK,{filter:e})).screenshots}),function(e){return s.apply(this,arguments)})},{key:"downloadScreenshot",value:(d=$(function*(e,i,t){var n=`${this.baseUrl}/api/v1/${encodeURIComponent(e)}/${encodeURIComponent(i)}/screenshot?ts=${encodeURIComponent(t)}`,a=yield(0,x.Ay)(n,{headers:{Authorization:`Bearer ${this.token}`}});if(!a.ok){var o=yield a.text().catch(()=>"");throw Error(`Screenshot fetch failed (${a.status}): ${o}`)}return Buffer.from((yield a.arrayBuffer()))}),function(e,i,t){return d.apply(this,arguments)})}]);process.env.STAGE,process.env.URL_BASE;var tG="bricks-mcp",tL={bricks:process.env.BRICKS_API_SERVER||"https://display-beta.bricks.tools",media:process.env.MEDIA_API_SERVER||"https://media-beta.bricks.tools",activityLog:process.env.ACTIVITY_LOG_API_SERVER||"https://activity-log-beta.bricks.tools"};process.env.AUTH0_DOMAIN,process.env.CACHE_URL;var tz=t(1639);let tH=({type:e,title:i,template_key:t})=>{var n,a,o=(0,tz.M4)(e);switch(e){case"subspace":n={title:i,layout:{width:"number",height:"number"},root_canvas_id:"CANVAS_<UUID>",canvas_map:{},brick_map:{},animation_map:{},generator_map:{},property_bank_map:{},property_bank_calc_map:{}},a={"canvas_map.CANVAS_<UUID>.item_list":[{type:"subspace",subspace_id:"SUBSPACE_<UUID>",$note:"If not a root subspace, it can be linked to canvas in other subspace"}]};break;case"canvas":var r=V(j.Ji);n={title:i,item_list:[],property:{$definitions:Object.fromEntries(Object.entries(r.propTypes).map(([e,i])=>[e,{...i,description:r.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(r.eventTypes).map(([e])=>[e,{description:r.brickEventDescriptions[e]}]))}},a={property_bank_map:{[(0,tz.M4)("property_bank")]:{title:`Canvas ID: ${i}`,type:"string",value:o,routing:"read-only",kind:"auto-generated-item-id",idType:"canvas"}}};break;case"brick":var s=V(j.dK.Basic),d=V(j.brickMapping[t]);if(!d)throw Error(`Brick ${t} not found`);var c={...d,propTypes:{...s.propTypes,...d.propTypes},brickPropDescriptions:{...s.brickPropDescriptions,...d.brickPropDescriptions},eventTypes:{...s.eventTypes,...d.eventTypes},brickEventDescriptions:{...s.brickEventDescriptions,...d.brickEventDescriptions}};n={title:i,template_key:t,property:{$definitions:Object.fromEntries(Object.entries(c.propTypes).map(([e,i])=>[e,{...i,description:c.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(c.eventTypes).map(([e])=>[e,{description:c.brickEventDescriptions[e]}]))},outlet:{$definitions:Object.fromEntries(Object.entries(c.outletTypes??{}).map(([e])=>[e,{description:(c.brickOutletDescriptions??{})[e]}]))},state_group:{"BRICK_STATE_GROUP_<UUID>":{}}},a={canvas_map:{"CANVAS_<UUID WHICH NEED DISPLAY THIS BRICK>":{item_list:[{type:"brick",brick_id:o,frame:{x:"number",y:"number",width:"number",height:"number",standby_mode:"custom|top|left|right|bottom",standby_delay:"number",standby_easing:{default:{method:"ease",duration:"number"}}}}]}}};break;case"state_group":n={title:i,description:"State Group Description",conds:[{type:"property_bank|inner_state",key:"PROPERTY_BANK#<Data Node ID>|[current_canvas|BRICK_<OUTLET NAME>]|",method:"==|!=|>|>=|<|<=",value:"value_to_compare"}],override:{property:!1,event:!1,outlet:!1},commented:!1,break:!1,property:{},outlet:{},animation:{}};break;case"generator":var l=V(j.generatorMapping[t]);if(!l)throw Error(`Generator ${t} not found`);n={title:i,template_key:t,property:{$definitions:Object.fromEntries(Object.entries(l.propTypes).map(([e,i])=>[e,{...i,description:l.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(l.eventTypes).map(([e])=>[e,{description:l.brickEventDescriptions[e]}]))},outlet:{$definitions:Object.fromEntries(Object.entries(l.outletTypes).map(([e])=>[e,{description:l.brickOutletDescriptions[e]}]))}};break;case"animation":n={title:i,type:"timing|decay|spring",property:"opacity|transform.translateX|transform.scale|etc",config:{$note:"Config for the animation"},compose_type:"parallel|sequence",item_list:[{animation_id:"ANIMATION_<SUB ANIMATION UUID>"}]};break;case"property_bank":n={title:i,description:"Property Bank Description",linkedFrom:"SUBSPACE_<UUID WHICH IS CROSS SUBSPACE>",type:"string|number|bool|object|array|any",kind:"color|datetime|id|media-resource-*|lottie-file-uri",unit:"grid|px|ms",routing:"read-only|default",value:"fit-to-type",event_map:{$note:`Available events: ${Object.keys(j.qJ.eventTypes).join(", ")}`},local_sync:{update_mode:"all|main-only|minor-only|dont-sync"},$remote_update_additional:{$note:"Configure remote update behavior",enable_remote_update:!0,bank_type:"create|create-device-specific"}};break;case"property_bank_command":break;case"property_bank_calc":var p=(0,tz.M4)("property_bank_command"),u=(0,tz.M4)("property_bank_command"),m=(0,tz.M4)("property_bank_command"),_="const { arg_name } = inputs;\n\nreturn { arg_name };";n={title:i,map:{$note:"Required, actual implementation","PROPERTY_BANK_DATA_NODE_<UUID>":{type:"data-node",properties:{},in:{change:null},out:{value:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID>",port:"value"}]},$note:"Use this to input data to the sandbox"},"PROPERTY_BANK_COMMAND_NODE_<UUID FIRST>":{type:"command-node-object",title:"Command: OBJECT_SET",properties:{command:"OBJECT_SET",args:{path:"arg_name"}},in:{obj:null,path:null,value:[{id:"PROPERTY_BANK_DATA_NODE_<UUID>",port:"value"}]},out:{result:[{id:`PROPERTY_BANK_COMMAND_NODE_<UUID NEXT> | ${p}`,port:"obj | inputs"}]}},"PROPERTY_BANK_COMMAND_NODE_<UUID SECOND>":{type:"command-node-object",title:"Command: OBJECT_SET",properties:{command:"OBJECT_SET",args:{path:"arg_name"}},in:{obj:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID PREVIOUS>",port:"result"}],path:null,value:[{id:"PROPERTY_BANK_DATA_NODE_<UUID SECOND>",port:"value"}]},out:{result:[{id:`PROPERTY_BANK_COMMAND_NODE_<UUID NEXT> | ${p}`,port:"obj | inputs"}]}},[p]:{type:"command-node-sandbox",title:"Command: SANDBOX_RUN_JAVASCRIPT",properties:{command:"SANDBOX_RUN_JAVASCRIPT",args:{code:_,enable_async:!1}},in:{code:null,inputs:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID FINAL>",port:"result"}]},out:{result:[{id:m,port:"result"},{id:u,port:"result"}]}},[m]:{type:"command-node-sandbox",title:"Command: SANDBOX_GET_ERROR",properties:{command:"SANDBOX_GET_ERROR"},in:{result:[{id:p,port:"result"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE ERROR>",port:"change"}],$note:"Set `result` as null if there is no error"}},[u]:{type:"command-node-sandbox",title:"Command: SANDBOX_GET_RETURN_VALUE",properties:{command:"SANDBOX_GET_RETURN_VALUE"},in:{result:[{id:p,port:"result"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT> | PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT> | null",port:"change"}]}},"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT>":{type:"data-node",properties:{},in:{change:[{id:u,port:"result"}]},out:{value:null},$note:"Put full result into data node"},"PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT>":{type:"command-node-object",title:"Command: OBJECT_GET",properties:{command:"OBJECT_GET",args:{path:"obj_key"}},in:{obj:[{id:u,port:"obj"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>",port:"change"}]},$note:"Parse result object into data node"},"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>":{type:"data-node",properties:{},in:{change:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT>",port:"result"}]},out:{value:null},$note:"Put partial result into data node"}},editor_info:{},type:"script",script_config:{title:i,enable_async:!1,inputs:{"PROPERTY_BANK_DATA_NODE_<UUID>":"arg_name"},disabled_triggers:{},error:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE ERROR> | null",output:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT> | null",outputs:{obj_key:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>"},code:_,$note:"Required, info for GUI editor"}}}return C({id:o,example:n,extraInfo:a})};var tJ="2.25.0-beta.70";function tX(){return tQ.apply(this,arguments)}function tQ(){return(tQ=$(function*(e={}){var i,t=e.token||process.env.BRICKS_API_TOKEN;if(!t)throw console.error("Error: API token is required"),console.error("Please provide a token via options or set BRICKS_API_TOKEN environment variable"),Error("API token is required");var n=function(e){try{var i=e.queryStringParameters?.token;if(!i){var t=new Headers(e.headers);i=t.get("authorization")?.replace("Bearer ","")}if(!i)return{success:!1,message:"Authentication failed: No token provided"};var n=function(e){try{var i=e.split(".");if(i.length<3)return null;var t=JSON.parse(Buffer.from(i[0],"base64url").toString());if(!k.includes(t?.alg))return null;return JSON.parse(Buffer.from(i[1],"base64url").toString())}catch{return null}}(i);if(!n)return{success:!1,message:"Authentication failed: Invalid token"};var a=D.includes(n.iss)?"user":"workspace";if("workspace"===a){var o=Array.isArray(n.t)?n.t:[];n.permissions=o.reduce((e,i)=>{var t=I[i];return t&&e.push(t),e},[])}else n.permissions=Object.keys(b);return{success:!0,token:i,tokenInfo:n,tokenType:a}}catch(e){return{success:!1,message:`Authentication failed: ${e.message}`}}}({queryStringParameters:{token:t}});if(!n.success)throw console.error("Error: Invalid BRICKS_API_TOKEN"),console.error(n.message),Error("Invalid BRICKS_API_TOKEN");var a=new v._({name:tG,version:tJ}),o={...n,client:function(e,i,t){switch(t){case"user":return new iE(e,i);case"workspace":return new i8(e,i);default:throw Error(`Invalid token type: ${t}.`)}}(tL.bricks,n.token,n.tokenType)};a.prompt("getting-started","Getting started with BRICKS",{},$(function*(){return{messages:[{role:"user",content:{type:"text",text:`Welcome to BRICKS — start here.
|
|
2476
2476
|
|
|
2477
2477
|
Before doing any complex work (application design, deployments, etc.),
|
|
2478
2478
|
always consult the official docs rather than guessing.
|