@fugood/bricks-cli 2.25.0-beta.77 → 2.25.0-beta.79

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/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 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","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI"]);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."})}}})})}}}};
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||"object"!=typeof i||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])=>{i&&"object"==typeof 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","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI"]);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."})}}})})}}}};