@fugood/bricks-cli 2.25.0-beta.41 → 2.25.0-beta.42
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/117.js +1 -1
- package/lib/341.js +1 -0
- package/lib/511.js +1 -1
- package/lib/index.js +8 -6
- package/package.json +2 -2
package/lib/117.js
CHANGED
|
@@ -2469,7 +2469,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2469
2469
|
timestamp
|
|
2470
2470
|
}
|
|
2471
2471
|
}
|
|
2472
|
-
`,tK=z(function e(i,t){H(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(tj,{filter:n})).events}),function(e){return r.apply(this,arguments)})},{key:"screenshots",value:(s=$(function*(e){return(yield this.graphql(tV,{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 tY="bricks-mcp",tG={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 tL=t(1639);let tz=({type:e,title:i,template_key:t})=>{var n,a,o=(0,tL.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=j(W.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,tL.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=j(W.dK.Basic),d=j(W.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:{}};case"generator":var l=j(W.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(W.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,tL.M4)("property_bank_command"),u=(0,tL.M4)("property_bank_command"),m=(0,tL.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 tH="2.25.0-beta.41";function tJ(){return tX.apply(this,arguments)}function tX(){return(tX=$(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:tY,version:tH}),o={...n,client:function(e,i,t){switch(t){case"user":return new iB(e,i);case"workspace":return new i3(e,i);default:throw Error(`Invalid token type: ${t}.`)}}(tG.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.
|
|
2472
|
+
`,tK=z(function e(i,t){H(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(tj,{filter:n})).events}),function(e){return r.apply(this,arguments)})},{key:"screenshots",value:(s=$(function*(e){return(yield this.graphql(tV,{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 tY="bricks-mcp",tG={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 tL=t(1639);let tz=({type:e,title:i,template_key:t})=>{var n,a,o=(0,tL.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=j(W.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,tL.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=j(W.dK.Basic),d=j(W.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:{}};case"generator":var l=j(W.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(W.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,tL.M4)("property_bank_command"),u=(0,tL.M4)("property_bank_command"),m=(0,tL.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 tH="2.25.0-beta.42";function tJ(){return tX.apply(this,arguments)}function tX(){return(tX=$(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:tY,version:tH}),o={...n,client:function(e,i,t){switch(t){case"user":return new iB(e,i);case"workspace":return new i3(e,i);default:throw Error(`Invalid token type: ${t}.`)}}(tG.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.
|
|
2473
2473
|
|
|
2474
2474
|
Before doing any complex work (application design, deployments, etc.),
|
|
2475
2475
|
always consult the official docs rather than guessing.
|
package/lib/341.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const __rspack_esm_id=341;export const __rspack_esm_ids=[341];export const __webpack_modules__={89236(t,e){!function(t){"use strict";var e=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],i=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],s="\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",r={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},a="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",n={5:a,"5module":a+" export import",6:a+" const class extends export import super"},o=/^in(stanceof)?$/,h=RegExp("["+s+"]"),p=RegExp("["+s+"\xb7̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ--ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・]");function c(t,e){for(var i=65536,s=0;s<e.length&&!((i+=e[s])>t);s+=2)if((i+=e[s+1])>=t)return!0;return!1}function l(t,e){return t<65?36===t:t<91||(t<97?95===t:t<123||(t<=65535?t>=170&&h.test(String.fromCharCode(t)):!1!==e&&c(t,i)))}function u(t,s){return t<48?36===t:t<58||!(t<65)&&(t<91||(t<97?95===t:t<123||(t<=65535?t>=170&&p.test(String.fromCharCode(t)):!1!==s&&(c(t,i)||c(t,e)))))}var d=function(t,e){void 0===e&&(e={}),this.label=t,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.startsExpr=!!e.startsExpr,this.isLoop=!!e.isLoop,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop||null,this.updateContext=null};function f(t,e){return new d(t,{beforeExpr:!0,binop:e})}var m={beforeExpr:!0},g={startsExpr:!0},x={};function v(t,e){return void 0===e&&(e={}),e.keyword=t,x[t]=new d(t,e)}var y={num:new d("num",g),regexp:new d("regexp",g),string:new d("string",g),name:new d("name",g),privateId:new d("privateId",g),eof:new d("eof"),bracketL:new d("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new d("]"),braceL:new d("{",{beforeExpr:!0,startsExpr:!0}),braceR:new d("}"),parenL:new d("(",{beforeExpr:!0,startsExpr:!0}),parenR:new d(")"),comma:new d(",",m),semi:new d(";",m),colon:new d(":",m),dot:new d("."),question:new d("?",m),questionDot:new d("?."),arrow:new d("=>",m),template:new d("template"),invalidTemplate:new d("invalidTemplate"),ellipsis:new d("...",m),backQuote:new d("`",g),dollarBraceL:new d("${",{beforeExpr:!0,startsExpr:!0}),eq:new d("=",{beforeExpr:!0,isAssign:!0}),assign:new d("_=",{beforeExpr:!0,isAssign:!0}),incDec:new d("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new d("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:f("||",1),logicalAND:f("&&",2),bitwiseOR:f("|",3),bitwiseXOR:f("^",4),bitwiseAND:f("&",5),equality:f("==/!=/===/!==",6),relational:f("</>/<=/>=",7),bitShift:f("<</>>/>>>",8),plusMin:new d("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:f("%",10),star:f("*",10),slash:f("/",10),starstar:new d("**",{beforeExpr:!0}),coalesce:f("??",1),_break:v("break"),_case:v("case",m),_catch:v("catch"),_continue:v("continue"),_debugger:v("debugger"),_default:v("default",m),_do:v("do",{isLoop:!0,beforeExpr:!0}),_else:v("else",m),_finally:v("finally"),_for:v("for",{isLoop:!0}),_function:v("function",g),_if:v("if"),_return:v("return",m),_switch:v("switch"),_throw:v("throw",m),_try:v("try"),_var:v("var"),_const:v("const"),_while:v("while",{isLoop:!0}),_with:v("with"),_new:v("new",{beforeExpr:!0,startsExpr:!0}),_this:v("this",g),_super:v("super",g),_class:v("class",g),_extends:v("extends",m),_export:v("export"),_import:v("import",g),_null:v("null",g),_true:v("true",g),_false:v("false",g),_in:v("in",{beforeExpr:!0,binop:7}),_instanceof:v("instanceof",{beforeExpr:!0,binop:7}),_typeof:v("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:v("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:v("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},b=/\r\n?|\n|\u2028|\u2029/,_=RegExp(b.source,"g");function k(t){return 10===t||13===t||8232===t||8233===t}function S(t,e,i){void 0===i&&(i=t.length);for(var s=e;s<i;s++){var r=t.charCodeAt(s);if(k(r))return s<i-1&&13===r&&10===t.charCodeAt(s+1)?s+2:s+1}return -1}var C=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,w=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,E=Object.prototype,A=E.hasOwnProperty,I=E.toString,P=Object.hasOwn||function(t,e){return A.call(t,e)},V=Array.isArray||function(t){return"[object Array]"===I.call(t)},N=Object.create(null);function T(t){return N[t]||(N[t]=RegExp("^(?:"+t.replace(/ /g,"|")+")$"))}function L(t){return t<=65535?String.fromCharCode(t):String.fromCharCode(((t-=65536)>>10)+55296,(1023&t)+56320)}var R=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,D=function(t,e){this.line=t,this.column=e};D.prototype.offset=function(t){return new D(this.line,this.column+t)};var O=function(t,e,i){this.start=e,this.end=i,null!==t.sourceFile&&(this.source=t.sourceFile)};function B(t,e){for(var i=1,s=0;;){var r=S(t,s,e);if(r<0)return new D(i,e-s);++i,s=r}}var M={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},F=!1;function U(t,e){return 2|4*!!t|8*!!e}var q=function(t,e,i){this.options=t=function(t){var e,i,s={};for(var r in M)s[r]=t&&P(t,r)?t[r]:M[r];if("latest"===s.ecmaVersion?s.ecmaVersion=1e8:null==s.ecmaVersion?(!F&&"object"==typeof console&&console.warn&&(F=!0,console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.")),s.ecmaVersion=11):s.ecmaVersion>=2015&&(s.ecmaVersion-=2009),null==s.allowReserved&&(s.allowReserved=s.ecmaVersion<5),t&&null!=t.allowHashBang||(s.allowHashBang=s.ecmaVersion>=14),V(s.onToken)){var a=s.onToken;s.onToken=function(t){return a.push(t)}}if(V(s.onComment)&&(e=s,i=s.onComment,s.onComment=function(t,s,r,a,n,o){var h={type:t?"Block":"Line",value:s,start:r,end:a};e.locations&&(h.loc=new O(this,n,o)),e.ranges&&(h.range=[r,a]),i.push(h)}),"commonjs"===s.sourceType&&s.allowAwaitOutsideFunction)throw Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return s}(t),this.sourceFile=t.sourceFile,this.keywords=T(n[t.ecmaVersion>=6?6:"module"===t.sourceType?"5module":5]);var s="";!0!==t.allowReserved&&(s=r[t.ecmaVersion>=6?6:5===t.ecmaVersion?5:3],"module"===t.sourceType&&(s+=" await")),this.reservedWords=T(s);var a=(s?s+" ":"")+r.strict;this.reservedWordsStrict=T(a),this.reservedWordsStrictBind=T(a+" "+r.strictBind),this.input=String(e),this.containsEsc=!1,i?(this.pos=i,this.lineStart=this.input.lastIndexOf("\n",i-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(b).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=y.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===t.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),0===this.pos&&t.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope("commonjs"===this.options.sourceType?2:1),this.regexpState=null,this.privateNameStack=[]},j={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};q.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)},j.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},j.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0},j.inAsync.get=function(){return(4&this.currentVarScope().flags)>0},j.canAwait.get=function(){for(var t=this.scopeStack.length-1;t>=0;t--){var e=this.scopeStack[t].flags;if(768&e)return!1;if(2&e)return(4&e)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},j.allowReturn.get=function(){return!!this.inFunction||!!this.options.allowReturnOutsideFunction&&!!(1&this.currentVarScope().flags)},j.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0||this.options.allowSuperOutsideMethod},j.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},j.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},j.allowNewDotTarget.get=function(){for(var t=this.scopeStack.length-1;t>=0;t--){var e=this.scopeStack[t].flags;if(768&e||2&e&&!(16&e))return!0}return!1},j.allowUsing.get=function(){var t=this.currentScope().flags;return!(1024&t)&&(!!this.inModule||!(1&t))},j.inClassStaticBlock.get=function(){return(256&this.currentVarScope().flags)>0},q.extend=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];for(var i=this,s=0;s<t.length;s++)i=t[s](i);return i},q.parse=function(t,e){return new this(e,t).parse()},q.parseExpressionAt=function(t,e,i){var s=new this(i,t,e);return s.nextToken(),s.parseExpression()},q.tokenizer=function(t,e){return new this(e,t)},Object.defineProperties(q.prototype,j);var G=q.prototype,H=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;G.strictDirective=function(t){if(this.options.ecmaVersion<5)return!1;for(;;){w.lastIndex=t,t+=w.exec(this.input)[0].length;var e=H.exec(this.input.slice(t));if(!e)return!1;if("use strict"===(e[1]||e[2])){w.lastIndex=t+e[0].length;var i=w.exec(this.input),s=i.index+i[0].length,r=this.input.charAt(s);return";"===r||"}"===r||b.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(r)||"!"===r&&"="===this.input.charAt(s+1))}w.lastIndex=t+=e[0].length,t+=w.exec(this.input)[0].length,";"===this.input[t]&&t++}},G.eat=function(t){return this.type===t&&(this.next(),!0)},G.isContextual=function(t){return this.type===y.name&&this.value===t&&!this.containsEsc},G.eatContextual=function(t){return!!this.isContextual(t)&&(this.next(),!0)},G.expectContextual=function(t){this.eatContextual(t)||this.unexpected()},G.canInsertSemicolon=function(){return this.type===y.eof||this.type===y.braceR||b.test(this.input.slice(this.lastTokEnd,this.start))},G.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},G.semicolon=function(){this.eat(y.semi)||this.insertSemicolon()||this.unexpected()},G.afterTrailingComma=function(t,e){if(this.type===t)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),e||this.next(),!0},G.expect=function(t){this.eat(t)||this.unexpected()},G.unexpected=function(t){this.raise(null!=t?t:this.start,"Unexpected token")};var W=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};G.checkPatternErrors=function(t,e){if(t){t.trailingComma>-1&&this.raiseRecoverable(t.trailingComma,"Comma is not permitted after the rest element");var i=e?t.parenthesizedAssign:t.parenthesizedBind;i>-1&&this.raiseRecoverable(i,e?"Assigning to rvalue":"Parenthesized pattern")}},G.checkExpressionErrors=function(t,e){if(!t)return!1;var i=t.shorthandAssign,s=t.doubleProto;if(!e)return i>=0||s>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),s>=0&&this.raiseRecoverable(s,"Redefinition of __proto__ property")},G.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},G.isSimpleAssignTarget=function(t){return"ParenthesizedExpression"===t.type?this.isSimpleAssignTarget(t.expression):"Identifier"===t.type||"MemberExpression"===t.type};var z=q.prototype;z.parseTopLevel=function(t){var e=Object.create(null);for(t.body||(t.body=[]);this.type!==y.eof;){var i=this.parseStatement(null,!0,e);t.body.push(i)}if(this.inModule)for(var s=0,r=Object.keys(this.undefinedExports);s<r.length;s+=1){var a=r[s];this.raiseRecoverable(this.undefinedExports[a].start,"Export '"+a+"' is not defined")}return this.adaptDirectivePrologue(t.body),this.next(),t.sourceType="commonjs"===this.options.sourceType?"script":this.options.sourceType,this.finishNode(t,"Program")};var K={kind:"loop"},Q={kind:"switch"};z.isLet=function(t){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;w.lastIndex=this.pos;var e=w.exec(this.input),i=this.pos+e[0].length,s=this.fullCharCodeAt(i);if(91===s||92===s)return!0;if(t)return!1;if(123===s)return!0;if(l(s)){var r=i;do i+=s<=65535?1:2;while(u(s=this.fullCharCodeAt(i)));if(92===s)return!0;var a=this.input.slice(r,i);if(!o.test(a))return!0}return!1},z.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;w.lastIndex=this.pos;var t,e=w.exec(this.input),i=this.pos+e[0].length;return!b.test(this.input.slice(this.pos,i))&&"function"===this.input.slice(i,i+8)&&(i+8===this.input.length||!(u(t=this.fullCharCodeAt(i+8))||92===t))},z.isUsingKeyword=function(t,e){if(this.options.ecmaVersion<17||!this.isContextual(t?"await":"using"))return!1;w.lastIndex=this.pos;var i=w.exec(this.input),s=this.pos+i[0].length;if(b.test(this.input.slice(this.pos,s)))return!1;if(t){var r,a=s+5;if("using"!==this.input.slice(s,a)||a===this.input.length||u(r=this.fullCharCodeAt(a))||92===r)return!1;w.lastIndex=a;var n=w.exec(this.input);if(s=a+n[0].length,n&&b.test(this.input.slice(a,s)))return!1}var h=this.fullCharCodeAt(s);if(!l(h)&&92!==h)return!1;var p=s;do s+=h<=65535?1:2;while(u(h=this.fullCharCodeAt(s)));if(92===h)return!0;var c=this.input.slice(p,s);return!o.test(c)&&(!e||"of"!==c)},z.isAwaitUsing=function(t){return this.isUsingKeyword(!0,t)},z.isUsing=function(t){return this.isUsingKeyword(!1,t)},z.parseStatement=function(t,e,i){var s,r=this.type,a=this.startNode();switch(this.isLet(t)&&(r=y._var,s="let"),r){case y._break:case y._continue:return this.parseBreakContinueStatement(a,r.keyword);case y._debugger:return this.parseDebuggerStatement(a);case y._do:return this.parseDoStatement(a);case y._for:return this.parseForStatement(a);case y._function:return t&&(this.strict||"if"!==t&&"label"!==t)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(a,!1,!t);case y._class:return t&&this.unexpected(),this.parseClass(a,!0);case y._if:return this.parseIfStatement(a);case y._return:return this.parseReturnStatement(a);case y._switch:return this.parseSwitchStatement(a);case y._throw:return this.parseThrowStatement(a);case y._try:return this.parseTryStatement(a);case y._const:case y._var:return s=s||this.value,t&&"var"!==s&&this.unexpected(),this.parseVarStatement(a,s);case y._while:return this.parseWhileStatement(a);case y._with:return this.parseWithStatement(a);case y.braceL:return this.parseBlock(!0,a);case y.semi:return this.parseEmptyStatement(a);case y._export:case y._import:if(this.options.ecmaVersion>10&&r===y._import){w.lastIndex=this.pos;var n=w.exec(this.input),o=this.pos+n[0].length,h=this.input.charCodeAt(o);if(40===h||46===h)return this.parseExpressionStatement(a,this.parseExpression())}return!this.options.allowImportExportEverywhere&&(e||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===y._import?this.parseImport(a):this.parseExport(a,i);default:if(this.isAsyncFunction())return t&&this.unexpected(),this.next(),this.parseFunctionStatement(a,!0,!t);var p=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(p)return this.allowUsing||this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"),"await using"===p&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(a,!1,p),this.semicolon(),this.finishNode(a,"VariableDeclaration");var c=this.value,l=this.parseExpression();if(r===y.name&&"Identifier"===l.type&&this.eat(y.colon))return this.parseLabeledStatement(a,c,l,t);return this.parseExpressionStatement(a,l)}},z.parseBreakContinueStatement=function(t,e){var i="break"===e;this.next(),this.eat(y.semi)||this.insertSemicolon()?t.label=null:this.type!==y.name?this.unexpected():(t.label=this.parseIdent(),this.semicolon());for(var s=0;s<this.labels.length;++s){var r=this.labels[s];if((null==t.label||r.name===t.label.name)&&(null!=r.kind&&(i||"loop"===r.kind)||t.label&&i))break}return s===this.labels.length&&this.raise(t.start,"Unsyntactic "+e),this.finishNode(t,i?"BreakStatement":"ContinueStatement")},z.parseDebuggerStatement=function(t){return this.next(),this.semicolon(),this.finishNode(t,"DebuggerStatement")},z.parseDoStatement=function(t){return this.next(),this.labels.push(K),t.body=this.parseStatement("do"),this.labels.pop(),this.expect(y._while),t.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(y.semi):this.semicolon(),this.finishNode(t,"DoWhileStatement")},z.parseForStatement=function(t){this.next();var e=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(K),this.enterScope(0),this.expect(y.parenL),this.type===y.semi)return e>-1&&this.unexpected(e),this.parseFor(t,null);var i=this.isLet();if(this.type===y._var||this.type===y._const||i){var s=this.startNode(),r=i?"let":this.value;return this.next(),this.parseVar(s,!0,r),this.finishNode(s,"VariableDeclaration"),this.parseForAfterInit(t,s,e)}var a=this.isContextual("let"),n=!1,o=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(o){var h=this.startNode();return this.next(),"await using"===o&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.parseVar(h,!0,o),this.finishNode(h,"VariableDeclaration"),this.parseForAfterInit(t,h,e)}var p=this.containsEsc,c=new W,l=this.start,u=e>-1?this.parseExprSubscripts(c,"await"):this.parseExpression(!0,c);return this.type===y._in||(n=this.options.ecmaVersion>=6&&this.isContextual("of"))?(e>-1?(this.type===y._in&&this.unexpected(e),t.await=!0):n&&this.options.ecmaVersion>=8&&(u.start!==l||p||"Identifier"!==u.type||"async"!==u.name?this.options.ecmaVersion>=9&&(t.await=!1):this.unexpected()),a&&n&&this.raise(u.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(u,!1,c),this.checkLValPattern(u),this.parseForIn(t,u)):(this.checkExpressionErrors(c,!0),e>-1&&this.unexpected(e),this.parseFor(t,u))},z.parseForAfterInit=function(t,e,i){return(this.type===y._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===e.declarations.length?(this.options.ecmaVersion>=9&&(this.type===y._in?i>-1&&this.unexpected(i):t.await=i>-1),this.parseForIn(t,e)):(i>-1&&this.unexpected(i),this.parseFor(t,e))},z.parseFunctionStatement=function(t,e,i){return this.next(),this.parseFunction(t,X|(i?0:Z),!1,e)},z.parseIfStatement=function(t){return this.next(),t.test=this.parseParenExpression(),t.consequent=this.parseStatement("if"),t.alternate=this.eat(y._else)?this.parseStatement("if"):null,this.finishNode(t,"IfStatement")},z.parseReturnStatement=function(t){return this.allowReturn||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(y.semi)||this.insertSemicolon()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")},z.parseSwitchStatement=function(t){this.next(),t.discriminant=this.parseParenExpression(),t.cases=[],this.expect(y.braceL),this.labels.push(Q),this.enterScope(1024);for(var e,i=!1;this.type!==y.braceR;)if(this.type===y._case||this.type===y._default){var s=this.type===y._case;e&&this.finishNode(e,"SwitchCase"),t.cases.push(e=this.startNode()),e.consequent=[],this.next(),s?e.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,e.test=null),this.expect(y.colon)}else e||this.unexpected(),e.consequent.push(this.parseStatement(null));return this.exitScope(),e&&this.finishNode(e,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(t,"SwitchStatement")},z.parseThrowStatement=function(t){return this.next(),b.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")};var Y=[];z.parseCatchClauseParam=function(){var t=this.parseBindingAtom(),e="Identifier"===t.type;return this.enterScope(32*!!e),this.checkLValPattern(t,e?4:2),this.expect(y.parenR),t},z.parseTryStatement=function(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.type===y._catch){var e=this.startNode();this.next(),this.eat(y.parenL)?e.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),e.param=null,this.enterScope(0)),e.body=this.parseBlock(!1),this.exitScope(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(y._finally)?this.parseBlock():null,t.handler||t.finalizer||this.raise(t.start,"Missing catch or finally clause"),this.finishNode(t,"TryStatement")},z.parseVarStatement=function(t,e,i){return this.next(),this.parseVar(t,!1,e,i),this.semicolon(),this.finishNode(t,"VariableDeclaration")},z.parseWhileStatement=function(t){return this.next(),t.test=this.parseParenExpression(),this.labels.push(K),t.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(t,"WhileStatement")},z.parseWithStatement=function(t){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),t.object=this.parseParenExpression(),t.body=this.parseStatement("with"),this.finishNode(t,"WithStatement")},z.parseEmptyStatement=function(t){return this.next(),this.finishNode(t,"EmptyStatement")},z.parseLabeledStatement=function(t,e,i,s){for(var r=0,a=this.labels;r<a.length;r+=1)a[r].name===e&&this.raise(i.start,"Label '"+e+"' is already declared");for(var n=this.type.isLoop?"loop":this.type===y._switch?"switch":null,o=this.labels.length-1;o>=0;o--){var h=this.labels[o];if(h.statementStart===t.start)h.statementStart=this.start,h.kind=n;else break}return this.labels.push({name:e,kind:n,statementStart:this.start}),t.body=this.parseStatement(s?-1===s.indexOf("label")?s+"label":s:"label"),this.labels.pop(),t.label=i,this.finishNode(t,"LabeledStatement")},z.parseExpressionStatement=function(t,e){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")},z.parseBlock=function(t,e,i){for(void 0===t&&(t=!0),void 0===e&&(e=this.startNode()),e.body=[],this.expect(y.braceL),t&&this.enterScope(0);this.type!==y.braceR;){var s=this.parseStatement(null);e.body.push(s)}return i&&(this.strict=!1),this.next(),t&&this.exitScope(),this.finishNode(e,"BlockStatement")},z.parseFor=function(t,e){return t.init=e,this.expect(y.semi),t.test=this.type===y.semi?null:this.parseExpression(),this.expect(y.semi),t.update=this.type===y.parenR?null:this.parseExpression(),this.expect(y.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,"ForStatement")},z.parseForIn=function(t,e){var i=this.type===y._in;return this.next(),"VariableDeclaration"===e.type&&null!=e.declarations[0].init&&(!i||this.options.ecmaVersion<8||this.strict||"var"!==e.kind||"Identifier"!==e.declarations[0].id.type)&&this.raise(e.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"),t.left=e,t.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(y.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,i?"ForInStatement":"ForOfStatement")},z.parseVar=function(t,e,i,s){for(t.declarations=[],t.kind=i;;){var r=this.startNode();if(this.parseVarId(r,i),this.eat(y.eq)?r.init=this.parseMaybeAssign(e):s||"const"!==i||this.type===y._in||this.options.ecmaVersion>=6&&this.isContextual("of")?s||"using"!==i&&"await using"!==i||!(this.options.ecmaVersion>=17)||this.type===y._in||this.isContextual("of")?s||"Identifier"===r.id.type||e&&(this.type===y._in||this.isContextual("of"))?r.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.raise(this.lastTokEnd,"Missing initializer in "+i+" declaration"):this.unexpected(),t.declarations.push(this.finishNode(r,"VariableDeclarator")),!this.eat(y.comma))break}return t},z.parseVarId=function(t,e){t.id="using"===e||"await using"===e?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(t.id,"var"===e?1:2,!1)};var X=1,Z=2;function $(t,e){var i=t.computed,s=t.key;return!i&&("Identifier"===s.type&&s.name===e||"Literal"===s.type&&s.value===e)}z.parseFunction=function(t,e,i,s,r){this.initFunction(t),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!s)&&(this.type===y.star&&e&Z&&this.unexpected(),t.generator=this.eat(y.star)),this.options.ecmaVersion>=8&&(t.async=!!s),e&X&&(t.id=4&e&&this.type!==y.name?null:this.parseIdent(),t.id&&!(e&Z)&&this.checkLValSimple(t.id,this.strict||t.generator||t.async?this.treatFunctionsAsVar?1:2:3));var a=this.yieldPos,n=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(U(t.async,t.generator)),e&X||(t.id=this.type===y.name?this.parseIdent():null),this.parseFunctionParams(t),this.parseFunctionBody(t,i,!1,r),this.yieldPos=a,this.awaitPos=n,this.awaitIdentPos=o,this.finishNode(t,e&X?"FunctionDeclaration":"FunctionExpression")},z.parseFunctionParams=function(t){this.expect(y.parenL),t.params=this.parseBindingList(y.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},z.parseClass=function(t,e){this.next();var i=this.strict;this.strict=!0,this.parseClassId(t,e),this.parseClassSuper(t);var s=this.enterClassBody(),r=this.startNode(),a=!1;for(r.body=[],this.expect(y.braceL);this.type!==y.braceR;){var n=this.parseClassElement(null!==t.superClass);n&&(r.body.push(n),"MethodDefinition"===n.type&&"constructor"===n.kind?(a&&this.raiseRecoverable(n.start,"Duplicate constructor in the same class"),a=!0):n.key&&"PrivateIdentifier"===n.key.type&&function(t,e){var i=e.key.name,s=t[i],r="true";return("MethodDefinition"===e.type&&("get"===e.kind||"set"===e.kind)&&(r=(e.static?"s":"i")+e.kind),"iget"===s&&"iset"===r||"iset"===s&&"iget"===r||"sget"===s&&"sset"===r||"sset"===s&&"sget"===r)?(t[i]="true",!1):!!s||(t[i]=r,!1)}(s,n)&&this.raiseRecoverable(n.key.start,"Identifier '#"+n.key.name+"' has already been declared"))}return this.strict=i,this.next(),t.body=this.finishNode(r,"ClassBody"),this.exitClassBody(),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")},z.parseClassElement=function(t){if(this.eat(y.semi))return null;var e=this.options.ecmaVersion,i=this.startNode(),s="",r=!1,a=!1,n="method",o=!1;if(this.eatContextual("static")){if(e>=13&&this.eat(y.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===y.star?o=!0:s="static"}if(i.static=o,!s&&e>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===y.star)&&!this.canInsertSemicolon()?a=!0:s="async"),!s&&(e>=9||!a)&&this.eat(y.star)&&(r=!0),!s&&!a&&!r){var h=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?n=h:s=h)}if(s?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=s,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),e<13||this.type===y.parenL||"method"!==n||r||a){var p=!i.static&&$(i,"constructor");p&&"method"!==n&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=p?"constructor":n,this.parseClassMethod(i,r,a,p&&t)}else this.parseClassField(i);return i},z.isClassElementNameStart=function(){return this.type===y.name||this.type===y.privateId||this.type===y.num||this.type===y.string||this.type===y.bracketL||this.type.keyword},z.parseClassElementName=function(t){this.type===y.privateId?("constructor"===this.value&&this.raise(this.start,"Classes can't have an element named '#constructor'"),t.computed=!1,t.key=this.parsePrivateIdent()):this.parsePropertyName(t)},z.parseClassMethod=function(t,e,i,s){var r=t.key;"constructor"===t.kind?(e&&this.raise(r.start,"Constructor can't be a generator"),i&&this.raise(r.start,"Constructor can't be an async method")):t.static&&$(t,"prototype")&&this.raise(r.start,"Classes may not have a static property named prototype");var a=t.value=this.parseMethod(e,i,s);return"get"===t.kind&&0!==a.params.length&&this.raiseRecoverable(a.start,"getter should have no params"),"set"===t.kind&&1!==a.params.length&&this.raiseRecoverable(a.start,"setter should have exactly one param"),"set"===t.kind&&"RestElement"===a.params[0].type&&this.raiseRecoverable(a.params[0].start,"Setter cannot use rest params"),this.finishNode(t,"MethodDefinition")},z.parseClassField=function(t){return $(t,"constructor")?this.raise(t.key.start,"Classes can't have a field named 'constructor'"):t.static&&$(t,"prototype")&&this.raise(t.key.start,"Classes can't have a static field named 'prototype'"),this.eat(y.eq)?(this.enterScope(576),t.value=this.parseMaybeAssign(),this.exitScope()):t.value=null,this.semicolon(),this.finishNode(t,"PropertyDefinition")},z.parseClassStaticBlock=function(t){t.body=[];var e=this.labels;for(this.labels=[],this.enterScope(320);this.type!==y.braceR;){var i=this.parseStatement(null);t.body.push(i)}return this.next(),this.exitScope(),this.labels=e,this.finishNode(t,"StaticBlock")},z.parseClassId=function(t,e){this.type===y.name?(t.id=this.parseIdent(),e&&this.checkLValSimple(t.id,2,!1)):(!0===e&&this.unexpected(),t.id=null)},z.parseClassSuper=function(t){t.superClass=this.eat(y._extends)?this.parseExprSubscripts(null,!1):null},z.enterClassBody=function(){var t={declared:Object.create(null),used:[]};return this.privateNameStack.push(t),t.declared},z.exitClassBody=function(){var t=this.privateNameStack.pop(),e=t.declared,i=t.used;if(this.options.checkPrivateFields)for(var s=this.privateNameStack.length,r=0===s?null:this.privateNameStack[s-1],a=0;a<i.length;++a){var n=i[a];P(e,n.name)||(r?r.used.push(n):this.raiseRecoverable(n.start,"Private field '#"+n.name+"' must be declared in an enclosing class"))}},z.parseExportAllDeclaration=function(t,e){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(t.exported=this.parseModuleExportName(),this.checkExport(e,t.exported,this.lastTokStart)):t.exported=null),this.expectContextual("from"),this.type!==y.string&&this.unexpected(),t.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(t.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(t,"ExportAllDeclaration")},z.parseExport=function(t,e){if(this.next(),this.eat(y.star))return this.parseExportAllDeclaration(t,e);if(this.eat(y._default))return this.checkExport(e,"default",this.lastTokStart),t.declaration=this.parseExportDefaultDeclaration(),this.finishNode(t,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())t.declaration=this.parseExportDeclaration(t),"VariableDeclaration"===t.declaration.type?this.checkVariableExport(e,t.declaration.declarations):this.checkExport(e,t.declaration.id,t.declaration.id.start),t.specifiers=[],t.source=null,this.options.ecmaVersion>=16&&(t.attributes=[]);else{if(t.declaration=null,t.specifiers=this.parseExportSpecifiers(e),this.eatContextual("from"))this.type!==y.string&&this.unexpected(),t.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(t.attributes=this.parseWithClause());else{for(var i=0,s=t.specifiers;i<s.length;i+=1){var r=s[i];this.checkUnreserved(r.local),this.checkLocalExport(r.local),"Literal"===r.local.type&&this.raise(r.local.start,"A string literal cannot be used as an exported binding without `from`.")}t.source=null,this.options.ecmaVersion>=16&&(t.attributes=[])}this.semicolon()}return this.finishNode(t,"ExportNamedDeclaration")},z.parseExportDeclaration=function(t){return this.parseStatement(null)},z.parseExportDefaultDeclaration=function(){if(this.type===y._function||(t=this.isAsyncFunction())){var t,e=this.startNode();return this.next(),t&&this.next(),this.parseFunction(e,4|X,!1,t)}if(this.type===y._class){var i=this.startNode();return this.parseClass(i,"nullableID")}var s=this.parseMaybeAssign();return this.semicolon(),s},z.checkExport=function(t,e,i){t&&("string"!=typeof e&&(e="Identifier"===e.type?e.name:e.value),P(t,e)&&this.raiseRecoverable(i,"Duplicate export '"+e+"'"),t[e]=!0)},z.checkPatternExport=function(t,e){var i=e.type;if("Identifier"===i)this.checkExport(t,e,e.start);else if("ObjectPattern"===i)for(var s=0,r=e.properties;s<r.length;s+=1){var a=r[s];this.checkPatternExport(t,a)}else if("ArrayPattern"===i)for(var n=0,o=e.elements;n<o.length;n+=1){var h=o[n];h&&this.checkPatternExport(t,h)}else"Property"===i?this.checkPatternExport(t,e.value):"AssignmentPattern"===i?this.checkPatternExport(t,e.left):"RestElement"===i&&this.checkPatternExport(t,e.argument)},z.checkVariableExport=function(t,e){if(t)for(var i=0;i<e.length;i+=1){var s=e[i];this.checkPatternExport(t,s.id)}},z.shouldParseExportStatement=function(){return"var"===this.type.keyword||"const"===this.type.keyword||"class"===this.type.keyword||"function"===this.type.keyword||this.isLet()||this.isAsyncFunction()},z.parseExportSpecifier=function(t){var e=this.startNode();return e.local=this.parseModuleExportName(),e.exported=this.eatContextual("as")?this.parseModuleExportName():e.local,this.checkExport(t,e.exported,e.exported.start),this.finishNode(e,"ExportSpecifier")},z.parseExportSpecifiers=function(t){var e=[],i=!0;for(this.expect(y.braceL);!this.eat(y.braceR);){if(i)i=!1;else if(this.expect(y.comma),this.afterTrailingComma(y.braceR))break;e.push(this.parseExportSpecifier(t))}return e},z.parseImport=function(t){return this.next(),this.type===y.string?(t.specifiers=Y,t.source=this.parseExprAtom()):(t.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),t.source=this.type===y.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(t.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(t,"ImportDeclaration")},z.parseImportSpecifier=function(){var t=this.startNode();return t.imported=this.parseModuleExportName(),this.eatContextual("as")?t.local=this.parseIdent():(this.checkUnreserved(t.imported),t.local=t.imported),this.checkLValSimple(t.local,2),this.finishNode(t,"ImportSpecifier")},z.parseImportDefaultSpecifier=function(){var t=this.startNode();return t.local=this.parseIdent(),this.checkLValSimple(t.local,2),this.finishNode(t,"ImportDefaultSpecifier")},z.parseImportNamespaceSpecifier=function(){var t=this.startNode();return this.next(),this.expectContextual("as"),t.local=this.parseIdent(),this.checkLValSimple(t.local,2),this.finishNode(t,"ImportNamespaceSpecifier")},z.parseImportSpecifiers=function(){var t=[],e=!0;if(this.type===y.name&&(t.push(this.parseImportDefaultSpecifier()),!this.eat(y.comma)))return t;if(this.type===y.star)return t.push(this.parseImportNamespaceSpecifier()),t;for(this.expect(y.braceL);!this.eat(y.braceR);){if(e)e=!1;else if(this.expect(y.comma),this.afterTrailingComma(y.braceR))break;t.push(this.parseImportSpecifier())}return t},z.parseWithClause=function(){var t=[];if(!this.eat(y._with))return t;this.expect(y.braceL);for(var e={},i=!0;!this.eat(y.braceR);){if(i)i=!1;else if(this.expect(y.comma),this.afterTrailingComma(y.braceR))break;var s=this.parseImportAttribute(),r="Identifier"===s.key.type?s.key.name:s.key.value;P(e,r)&&this.raiseRecoverable(s.key.start,"Duplicate attribute key '"+r+"'"),e[r]=!0,t.push(s)}return t},z.parseImportAttribute=function(){var t=this.startNode();return t.key=this.type===y.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved),this.expect(y.colon),this.type!==y.string&&this.unexpected(),t.value=this.parseExprAtom(),this.finishNode(t,"ImportAttribute")},z.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===y.string){var t=this.parseLiteral(this.value);return R.test(t.value)&&this.raise(t.start,"An export name cannot include a lone surrogate."),t}return this.parseIdent(!0)},z.adaptDirectivePrologue=function(t){for(var e=0;e<t.length&&this.isDirectiveCandidate(t[e]);++e)t[e].directive=t[e].expression.raw.slice(1,-1)},z.isDirectiveCandidate=function(t){return this.options.ecmaVersion>=5&&"ExpressionStatement"===t.type&&"Literal"===t.expression.type&&"string"==typeof t.expression.value&&('"'===this.input[t.start]||"'"===this.input[t.start])};var J=q.prototype;J.toAssignable=function(t,e,i){if(this.options.ecmaVersion>=6&&t)switch(t.type){case"Identifier":this.inAsync&&"await"===t.name&&this.raise(t.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":t.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var s=0,r=t.properties;s<r.length;s+=1){var a=r[s];this.toAssignable(a,e),"RestElement"===a.type&&("ArrayPattern"===a.argument.type||"ObjectPattern"===a.argument.type)&&this.raise(a.argument.start,"Unexpected token")}break;case"Property":"init"!==t.kind&&this.raise(t.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(t.value,e);break;case"ArrayExpression":t.type="ArrayPattern",i&&this.checkPatternErrors(i,!0),this.toAssignableList(t.elements,e);break;case"SpreadElement":t.type="RestElement",this.toAssignable(t.argument,e),"AssignmentPattern"===t.argument.type&&this.raise(t.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":"="!==t.operator&&this.raise(t.left.end,"Only '=' operator can be used for specifying default value."),t.type="AssignmentPattern",delete t.operator,this.toAssignable(t.left,e);break;case"ParenthesizedExpression":this.toAssignable(t.expression,e,i);break;case"ChainExpression":this.raiseRecoverable(t.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!e)break;default:this.raise(t.start,"Assigning to rvalue")}else i&&this.checkPatternErrors(i,!0);return t},J.toAssignableList=function(t,e){for(var i=t.length,s=0;s<i;s++){var r=t[s];r&&this.toAssignable(r,e)}if(i){var a=t[i-1];6===this.options.ecmaVersion&&e&&a&&"RestElement"===a.type&&"Identifier"!==a.argument.type&&this.unexpected(a.argument.start)}return t},J.parseSpread=function(t){var e=this.startNode();return this.next(),e.argument=this.parseMaybeAssign(!1,t),this.finishNode(e,"SpreadElement")},J.parseRestBinding=function(){var t=this.startNode();return this.next(),6===this.options.ecmaVersion&&this.type!==y.name&&this.unexpected(),t.argument=this.parseBindingAtom(),this.finishNode(t,"RestElement")},J.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case y.bracketL:var t=this.startNode();return this.next(),t.elements=this.parseBindingList(y.bracketR,!0,!0),this.finishNode(t,"ArrayPattern");case y.braceL:return this.parseObj(!0)}return this.parseIdent()},J.parseBindingList=function(t,e,i,s){for(var r=[],a=!0;!this.eat(t);)if(a?a=!1:this.expect(y.comma),e&&this.type===y.comma)r.push(null);else if(i&&this.afterTrailingComma(t))break;else if(this.type===y.ellipsis){var n=this.parseRestBinding();this.parseBindingListItem(n),r.push(n),this.type===y.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(t);break}else r.push(this.parseAssignableListItem(s));return r},J.parseAssignableListItem=function(t){var e=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(e),e},J.parseBindingListItem=function(t){return t},J.parseMaybeDefault=function(t,e,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(y.eq))return i;var s=this.startNodeAt(t,e);return s.left=i,s.right=this.parseMaybeAssign(),this.finishNode(s,"AssignmentPattern")},J.checkLValSimple=function(t,e,i){void 0===e&&(e=0);var s=0!==e;switch(t.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(t.name)&&this.raiseRecoverable(t.start,(s?"Binding ":"Assigning to ")+t.name+" in strict mode"),s&&(2===e&&"let"===t.name&&this.raiseRecoverable(t.start,"let is disallowed as a lexically bound name"),i&&(P(i,t.name)&&this.raiseRecoverable(t.start,"Argument name clash"),i[t.name]=!0),5!==e&&this.declareName(t.name,e,t.start));break;case"ChainExpression":this.raiseRecoverable(t.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":s&&this.raiseRecoverable(t.start,"Binding member expression");break;case"ParenthesizedExpression":return s&&this.raiseRecoverable(t.start,"Binding parenthesized expression"),this.checkLValSimple(t.expression,e,i);default:this.raise(t.start,(s?"Binding":"Assigning to")+" rvalue")}},J.checkLValPattern=function(t,e,i){switch(void 0===e&&(e=0),t.type){case"ObjectPattern":for(var s=0,r=t.properties;s<r.length;s+=1){var a=r[s];this.checkLValInnerPattern(a,e,i)}break;case"ArrayPattern":for(var n=0,o=t.elements;n<o.length;n+=1){var h=o[n];h&&this.checkLValInnerPattern(h,e,i)}break;default:this.checkLValSimple(t,e,i)}},J.checkLValInnerPattern=function(t,e,i){switch(void 0===e&&(e=0),t.type){case"Property":this.checkLValInnerPattern(t.value,e,i);break;case"AssignmentPattern":this.checkLValPattern(t.left,e,i);break;case"RestElement":this.checkLValPattern(t.argument,e,i);break;default:this.checkLValPattern(t,e,i)}};var tt=function(t,e,i,s,r){this.token=t,this.isExpr=!!e,this.preserveSpace=!!i,this.override=s,this.generator=!!r},te={b_stat:new tt("{",!1),b_expr:new tt("{",!0),b_tmpl:new tt("${",!1),p_stat:new tt("(",!1),p_expr:new tt("(",!0),q_tmpl:new tt("`",!0,!0,function(t){return t.tryReadTemplateToken()}),f_stat:new tt("function",!1),f_expr:new tt("function",!0),f_expr_gen:new tt("function",!0,!1,null,!0),f_gen:new tt("function",!1,!1,null,!0)},ti=q.prototype;ti.initialContext=function(){return[te.b_stat]},ti.curContext=function(){return this.context[this.context.length-1]},ti.braceIsBlock=function(t){var e=this.curContext();return e===te.f_expr||e===te.f_stat||(t===y.colon&&(e===te.b_stat||e===te.b_expr)?!e.isExpr:t===y._return||t===y.name&&this.exprAllowed?b.test(this.input.slice(this.lastTokEnd,this.start)):t===y._else||t===y.semi||t===y.eof||t===y.parenR||t===y.arrow||(t===y.braceL?e===te.b_stat:t!==y._var&&t!==y._const&&t!==y.name&&!this.exprAllowed))},ti.inGeneratorContext=function(){for(var t=this.context.length-1;t>=1;t--){var e=this.context[t];if("function"===e.token)return e.generator}return!1},ti.updateContext=function(t){var e,i=this.type;i.keyword&&t===y.dot?this.exprAllowed=!1:(e=i.updateContext)?e.call(this,t):this.exprAllowed=i.beforeExpr},ti.overrideContext=function(t){this.curContext()!==t&&(this.context[this.context.length-1]=t)},y.parenR.updateContext=y.braceR.updateContext=function(){if(1===this.context.length){this.exprAllowed=!0;return}var t=this.context.pop();t===te.b_stat&&"function"===this.curContext().token&&(t=this.context.pop()),this.exprAllowed=!t.isExpr},y.braceL.updateContext=function(t){this.context.push(this.braceIsBlock(t)?te.b_stat:te.b_expr),this.exprAllowed=!0},y.dollarBraceL.updateContext=function(){this.context.push(te.b_tmpl),this.exprAllowed=!0},y.parenL.updateContext=function(t){var e=t===y._if||t===y._for||t===y._with||t===y._while;this.context.push(e?te.p_stat:te.p_expr),this.exprAllowed=!0},y.incDec.updateContext=function(){},y._function.updateContext=y._class.updateContext=function(t){t.beforeExpr&&t!==y._else&&(t!==y.semi||this.curContext()===te.p_stat)&&!(t===y._return&&b.test(this.input.slice(this.lastTokEnd,this.start)))&&(t!==y.colon&&t!==y.braceL||this.curContext()!==te.b_stat)?this.context.push(te.f_expr):this.context.push(te.f_stat),this.exprAllowed=!1},y.colon.updateContext=function(){"function"===this.curContext().token&&this.context.pop(),this.exprAllowed=!0},y.backQuote.updateContext=function(){this.curContext()===te.q_tmpl?this.context.pop():this.context.push(te.q_tmpl),this.exprAllowed=!1},y.star.updateContext=function(t){if(t===y._function){var e=this.context.length-1;this.context[e]===te.f_expr?this.context[e]=te.f_expr_gen:this.context[e]=te.f_gen}this.exprAllowed=!0},y.name.updateContext=function(t){var e=!1;this.options.ecmaVersion>=6&&t!==y.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(e=!0),this.exprAllowed=e};var ts=q.prototype;ts.checkPropClash=function(t,e,i){if((!(this.options.ecmaVersion>=9)||"SpreadElement"!==t.type)&&(!(this.options.ecmaVersion>=6)||!t.computed&&!t.method&&!t.shorthand)){var s,r=t.key;switch(r.type){case"Identifier":s=r.name;break;case"Literal":s=String(r.value);break;default:return}var a=t.kind;if(this.options.ecmaVersion>=6){"__proto__"===s&&"init"===a&&(e.proto&&(i?i.doubleProto<0&&(i.doubleProto=r.start):this.raiseRecoverable(r.start,"Redefinition of __proto__ property")),e.proto=!0);return}var n=e[s="$"+s];n?("init"===a?this.strict&&n.init||n.get||n.set:n.init||n[a])&&this.raiseRecoverable(r.start,"Redefinition of property"):n=e[s]={init:!1,get:!1,set:!1},n[a]=!0}},ts.parseExpression=function(t,e){var i=this.start,s=this.startLoc,r=this.parseMaybeAssign(t,e);if(this.type===y.comma){var a=this.startNodeAt(i,s);for(a.expressions=[r];this.eat(y.comma);)a.expressions.push(this.parseMaybeAssign(t,e));return this.finishNode(a,"SequenceExpression")}return r},ts.parseMaybeAssign=function(t,e,i){if(this.isContextual("yield"))if(this.inGenerator)return this.parseYield(t);else this.exprAllowed=!1;var s=!1,r=-1,a=-1,n=-1;e?(r=e.parenthesizedAssign,a=e.trailingComma,n=e.doubleProto,e.parenthesizedAssign=e.trailingComma=-1):(e=new W,s=!0);var o=this.start,h=this.startLoc;(this.type===y.parenL||this.type===y.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait="await"===t);var p=this.parseMaybeConditional(t,e);if(i&&(p=i.call(this,p,o,h)),this.type.isAssign){var c=this.startNodeAt(o,h);return c.operator=this.value,this.type===y.eq&&(p=this.toAssignable(p,!1,e)),s||(e.parenthesizedAssign=e.trailingComma=e.doubleProto=-1),e.shorthandAssign>=p.start&&(e.shorthandAssign=-1),this.type===y.eq?this.checkLValPattern(p):this.checkLValSimple(p),c.left=p,this.next(),c.right=this.parseMaybeAssign(t),n>-1&&(e.doubleProto=n),this.finishNode(c,"AssignmentExpression")}return s&&this.checkExpressionErrors(e,!0),r>-1&&(e.parenthesizedAssign=r),a>-1&&(e.trailingComma=a),p},ts.parseMaybeConditional=function(t,e){var i=this.start,s=this.startLoc,r=this.parseExprOps(t,e);if(this.checkExpressionErrors(e))return r;if(this.eat(y.question)){var a=this.startNodeAt(i,s);return a.test=r,a.consequent=this.parseMaybeAssign(),this.expect(y.colon),a.alternate=this.parseMaybeAssign(t),this.finishNode(a,"ConditionalExpression")}return r},ts.parseExprOps=function(t,e){var i=this.start,s=this.startLoc,r=this.parseMaybeUnary(e,!1,!1,t);return this.checkExpressionErrors(e)||r.start===i&&"ArrowFunctionExpression"===r.type?r:this.parseExprOp(r,i,s,-1,t)},ts.parseExprOp=function(t,e,i,s,r){var a=this.type.binop;if(null!=a&&(!r||this.type!==y._in)&&a>s){var n=this.type===y.logicalOR||this.type===y.logicalAND,o=this.type===y.coalesce;o&&(a=y.logicalAND.binop);var h=this.value;this.next();var p=this.start,c=this.startLoc,l=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,r),p,c,a,r),u=this.buildBinary(e,i,t,l,h,n||o);return(n&&this.type===y.coalesce||o&&(this.type===y.logicalOR||this.type===y.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(u,e,i,s,r)}return t},ts.buildBinary=function(t,e,i,s,r,a){"PrivateIdentifier"===s.type&&this.raise(s.start,"Private identifier can only be left side of binary expression");var n=this.startNodeAt(t,e);return n.left=i,n.operator=r,n.right=s,this.finishNode(n,a?"LogicalExpression":"BinaryExpression")},ts.parseMaybeUnary=function(t,e,i,s){var r,a=this.start,n=this.startLoc;if(this.isContextual("await")&&this.canAwait)r=this.parseAwait(s),e=!0;else if(this.type.prefix){var o=this.startNode(),h=this.type===y.incDec;o.operator=this.value,o.prefix=!0,this.next(),o.argument=this.parseMaybeUnary(null,!0,h,s),this.checkExpressionErrors(t,!0),h?this.checkLValSimple(o.argument):this.strict&&"delete"===o.operator&&function t(e){return"Identifier"===e.type||"ParenthesizedExpression"===e.type&&t(e.expression)}(o.argument)?this.raiseRecoverable(o.start,"Deleting local variable in strict mode"):"delete"===o.operator&&function t(e){return"MemberExpression"===e.type&&"PrivateIdentifier"===e.property.type||"ChainExpression"===e.type&&t(e.expression)||"ParenthesizedExpression"===e.type&&t(e.expression)}(o.argument)?this.raiseRecoverable(o.start,"Private fields can not be deleted"):e=!0,r=this.finishNode(o,h?"UpdateExpression":"UnaryExpression")}else if(e||this.type!==y.privateId){if(r=this.parseExprSubscripts(t,s),this.checkExpressionErrors(t))return r;for(;this.type.postfix&&!this.canInsertSemicolon();){var p=this.startNodeAt(a,n);p.operator=this.value,p.prefix=!1,p.argument=r,this.checkLValSimple(r),this.next(),r=this.finishNode(p,"UpdateExpression")}}else(s||0===this.privateNameStack.length)&&this.options.checkPrivateFields&&this.unexpected(),r=this.parsePrivateIdent(),this.type!==y._in&&this.unexpected();return!i&&this.eat(y.starstar)?e?void this.unexpected(this.lastTokStart):this.buildBinary(a,n,r,this.parseMaybeUnary(null,!1,!1,s),"**",!1):r},ts.parseExprSubscripts=function(t,e){var i=this.start,s=this.startLoc,r=this.parseExprAtom(t,e);if("ArrowFunctionExpression"===r.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd))return r;var a=this.parseSubscripts(r,i,s,!1,e);return t&&"MemberExpression"===a.type&&(t.parenthesizedAssign>=a.start&&(t.parenthesizedAssign=-1),t.parenthesizedBind>=a.start&&(t.parenthesizedBind=-1),t.trailingComma>=a.start&&(t.trailingComma=-1)),a},ts.parseSubscripts=function(t,e,i,s,r){for(var a=this.options.ecmaVersion>=8&&"Identifier"===t.type&&"async"===t.name&&this.lastTokEnd===t.end&&!this.canInsertSemicolon()&&t.end-t.start==5&&this.potentialArrowAt===t.start,n=!1;;){var o=this.parseSubscript(t,e,i,s,a,n,r);if(o.optional&&(n=!0),o===t||"ArrowFunctionExpression"===o.type){if(n){var h=this.startNodeAt(e,i);h.expression=o,o=this.finishNode(h,"ChainExpression")}return o}t=o}},ts.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(y.arrow)},ts.parseSubscriptAsyncArrow=function(t,e,i,s){return this.parseArrowExpression(this.startNodeAt(t,e),i,!0,s)},ts.parseSubscript=function(t,e,i,s,r,a,n){var o=this.options.ecmaVersion>=11,h=o&&this.eat(y.questionDot);s&&h&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var p=this.eat(y.bracketL);if(p||h&&this.type!==y.parenL&&this.type!==y.backQuote||this.eat(y.dot)){var c=this.startNodeAt(e,i);c.object=t,p?(c.property=this.parseExpression(),this.expect(y.bracketR)):this.type===y.privateId&&"Super"!==t.type?c.property=this.parsePrivateIdent():c.property=this.parseIdent("never"!==this.options.allowReserved),c.computed=!!p,o&&(c.optional=h),t=this.finishNode(c,"MemberExpression")}else if(!s&&this.eat(y.parenL)){var l=new W,u=this.yieldPos,d=this.awaitPos,f=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var m=this.parseExprList(y.parenR,this.options.ecmaVersion>=8,!1,l);if(r&&!h&&this.shouldParseAsyncArrow())return this.checkPatternErrors(l,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=u,this.awaitPos=d,this.awaitIdentPos=f,this.parseSubscriptAsyncArrow(e,i,m,n);this.checkExpressionErrors(l,!0),this.yieldPos=u||this.yieldPos,this.awaitPos=d||this.awaitPos,this.awaitIdentPos=f||this.awaitIdentPos;var g=this.startNodeAt(e,i);g.callee=t,g.arguments=m,o&&(g.optional=h),t=this.finishNode(g,"CallExpression")}else if(this.type===y.backQuote){(h||a)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var x=this.startNodeAt(e,i);x.tag=t,x.quasi=this.parseTemplate({isTagged:!0}),t=this.finishNode(x,"TaggedTemplateExpression")}return t},ts.parseExprAtom=function(t,e,i){this.type===y.slash&&this.readRegexp();var s,r=this.potentialArrowAt===this.start;switch(this.type){case y._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),s=this.startNode(),this.next(),this.type!==y.parenL||this.allowDirectSuper||this.raise(s.start,"super() call outside constructor of a subclass"),this.type!==y.dot&&this.type!==y.bracketL&&this.type!==y.parenL&&this.unexpected(),this.finishNode(s,"Super");case y._this:return s=this.startNode(),this.next(),this.finishNode(s,"ThisExpression");case y.name:var a=this.start,n=this.startLoc,o=this.containsEsc,h=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!o&&"async"===h.name&&!this.canInsertSemicolon()&&this.eat(y._function))return this.overrideContext(te.f_expr),this.parseFunction(this.startNodeAt(a,n),0,!1,!0,e);if(r&&!this.canInsertSemicolon()){if(this.eat(y.arrow))return this.parseArrowExpression(this.startNodeAt(a,n),[h],!1,e);if(this.options.ecmaVersion>=8&&"async"===h.name&&this.type===y.name&&!o&&(!this.potentialArrowInForAwait||"of"!==this.value||this.containsEsc))return h=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(y.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,n),[h],!0,e)}return h;case y.regexp:var p=this.value;return(s=this.parseLiteral(p.value)).regex={pattern:p.pattern,flags:p.flags},s;case y.num:case y.string:return this.parseLiteral(this.value);case y._null:case y._true:case y._false:return(s=this.startNode()).value=this.type===y._null?null:this.type===y._true,s.raw=this.type.keyword,this.next(),this.finishNode(s,"Literal");case y.parenL:var c=this.start,l=this.parseParenAndDistinguishExpression(r,e);return t&&(t.parenthesizedAssign<0&&!this.isSimpleAssignTarget(l)&&(t.parenthesizedAssign=c),t.parenthesizedBind<0&&(t.parenthesizedBind=c)),l;case y.bracketL:return s=this.startNode(),this.next(),s.elements=this.parseExprList(y.bracketR,!0,!0,t),this.finishNode(s,"ArrayExpression");case y.braceL:return this.overrideContext(te.b_expr),this.parseObj(!1,t);case y._function:return s=this.startNode(),this.next(),this.parseFunction(s,0);case y._class:return this.parseClass(this.startNode(),!1);case y._new:return this.parseNew();case y.backQuote:return this.parseTemplate();case y._import:if(this.options.ecmaVersion>=11)return this.parseExprImport(i);return this.unexpected();default:return this.parseExprAtomDefault()}},ts.parseExprAtomDefault=function(){this.unexpected()},ts.parseExprImport=function(t){var e=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===y.parenL&&!t)return this.parseDynamicImport(e);if(this.type===y.dot){var i=this.startNodeAt(e.start,e.loc&&e.loc.start);return i.name="import",e.meta=this.finishNode(i,"Identifier"),this.parseImportMeta(e)}this.unexpected()},ts.parseDynamicImport=function(t){if(this.next(),t.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(y.parenR)?t.options=null:(this.expect(y.comma),this.afterTrailingComma(y.parenR)?t.options=null:(t.options=this.parseMaybeAssign(),!this.eat(y.parenR)&&(this.expect(y.comma),this.afterTrailingComma(y.parenR)||this.unexpected())));else if(!this.eat(y.parenR)){var e=this.start;this.eat(y.comma)&&this.eat(y.parenR)?this.raiseRecoverable(e,"Trailing comma is not allowed in import()"):this.unexpected(e)}return this.finishNode(t,"ImportExpression")},ts.parseImportMeta=function(t){this.next();var e=this.containsEsc;return t.property=this.parseIdent(!0),"meta"!==t.property.name&&this.raiseRecoverable(t.property.start,"The only valid meta property for import is 'import.meta'"),e&&this.raiseRecoverable(t.start,"'import.meta' must not contain escaped characters"),"module"===this.options.sourceType||this.options.allowImportExportEverywhere||this.raiseRecoverable(t.start,"Cannot use 'import.meta' outside a module"),this.finishNode(t,"MetaProperty")},ts.parseLiteral=function(t){var e=this.startNode();return e.value=t,e.raw=this.input.slice(this.start,this.end),110===e.raw.charCodeAt(e.raw.length-1)&&(e.bigint=null!=e.value?e.value.toString():e.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(e,"Literal")},ts.parseParenExpression=function(){this.expect(y.parenL);var t=this.parseExpression();return this.expect(y.parenR),t},ts.shouldParseArrow=function(t){return!this.canInsertSemicolon()},ts.parseParenAndDistinguishExpression=function(t,e){var i,s=this.start,r=this.startLoc,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var n,o=this.start,h=this.startLoc,p=[],c=!0,l=!1,u=new W,d=this.yieldPos,f=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==y.parenR;){if(c?c=!1:this.expect(y.comma),a&&this.afterTrailingComma(y.parenR,!0)){l=!0;break}if(this.type===y.ellipsis){n=this.start,p.push(this.parseParenItem(this.parseRestBinding())),this.type===y.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}p.push(this.parseMaybeAssign(!1,u,this.parseParenItem))}var m=this.lastTokEnd,g=this.lastTokEndLoc;if(this.expect(y.parenR),t&&this.shouldParseArrow(p)&&this.eat(y.arrow))return this.checkPatternErrors(u,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=d,this.awaitPos=f,this.parseParenArrowList(s,r,p,e);(!p.length||l)&&this.unexpected(this.lastTokStart),n&&this.unexpected(n),this.checkExpressionErrors(u,!0),this.yieldPos=d||this.yieldPos,this.awaitPos=f||this.awaitPos,p.length>1?((i=this.startNodeAt(o,h)).expressions=p,this.finishNodeAt(i,"SequenceExpression",m,g)):i=p[0]}else i=this.parseParenExpression();if(!this.options.preserveParens)return i;var x=this.startNodeAt(s,r);return x.expression=i,this.finishNode(x,"ParenthesizedExpression")},ts.parseParenItem=function(t){return t},ts.parseParenArrowList=function(t,e,i,s){return this.parseArrowExpression(this.startNodeAt(t,e),i,!1,s)};var tr=[];ts.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var t=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===y.dot){var e=this.startNodeAt(t.start,t.loc&&t.loc.start);e.name="new",t.meta=this.finishNode(e,"Identifier"),this.next();var i=this.containsEsc;return t.property=this.parseIdent(!0),"target"!==t.property.name&&this.raiseRecoverable(t.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(t.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(t.start,"'new.target' can only be used in functions and class static block"),this.finishNode(t,"MetaProperty")}var s=this.start,r=this.startLoc;return t.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),s,r,!0,!1),this.eat(y.parenL)?t.arguments=this.parseExprList(y.parenR,this.options.ecmaVersion>=8,!1):t.arguments=tr,this.finishNode(t,"NewExpression")},ts.parseTemplateElement=function(t){var e=t.isTagged,i=this.startNode();return this.type===y.invalidTemplate?(e||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value.replace(/\r\n?/g,"\n"),cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),i.tail=this.type===y.backQuote,this.finishNode(i,"TemplateElement")},ts.parseTemplate=function(t){void 0===t&&(t={});var e=t.isTagged;void 0===e&&(e=!1);var i=this.startNode();this.next(),i.expressions=[];var s=this.parseTemplateElement({isTagged:e});for(i.quasis=[s];!s.tail;)this.type===y.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(y.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(y.braceR),i.quasis.push(s=this.parseTemplateElement({isTagged:e}));return this.next(),this.finishNode(i,"TemplateLiteral")},ts.isAsyncProp=function(t){return!t.computed&&"Identifier"===t.key.type&&"async"===t.key.name&&(this.type===y.name||this.type===y.num||this.type===y.string||this.type===y.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===y.star)&&!b.test(this.input.slice(this.lastTokEnd,this.start))},ts.parseObj=function(t,e){var i=this.startNode(),s=!0,r={};for(i.properties=[],this.next();!this.eat(y.braceR);){if(s)s=!1;else if(this.expect(y.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(y.braceR))break;var a=this.parseProperty(t,e);t||this.checkPropClash(a,r,e),i.properties.push(a)}return this.finishNode(i,t?"ObjectPattern":"ObjectExpression")},ts.parseProperty=function(t,e){var i,s,r,a,n=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(y.ellipsis))return t?(n.argument=this.parseIdent(!1),this.type===y.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(n,"RestElement")):(n.argument=this.parseMaybeAssign(!1,e),this.type===y.comma&&e&&e.trailingComma<0&&(e.trailingComma=this.start),this.finishNode(n,"SpreadElement"));this.options.ecmaVersion>=6&&(n.method=!1,n.shorthand=!1,(t||e)&&(r=this.start,a=this.startLoc),t||(i=this.eat(y.star)));var o=this.containsEsc;return this.parsePropertyName(n),!t&&!o&&this.options.ecmaVersion>=8&&!i&&this.isAsyncProp(n)?(s=!0,i=this.options.ecmaVersion>=9&&this.eat(y.star),this.parsePropertyName(n)):s=!1,this.parsePropertyValue(n,t,i,s,r,a,e,o),this.finishNode(n,"Property")},ts.parseGetterSetter=function(t){var e=t.key.name;this.parsePropertyName(t),t.value=this.parseMethod(!1),t.kind=e;var i=+("get"!==t.kind);if(t.value.params.length!==i){var s=t.value.start;"get"===t.kind?this.raiseRecoverable(s,"getter should have no params"):this.raiseRecoverable(s,"setter should have exactly one param")}else"set"===t.kind&&"RestElement"===t.value.params[0].type&&this.raiseRecoverable(t.value.params[0].start,"Setter cannot use rest params")},ts.parsePropertyValue=function(t,e,i,s,r,a,n,o){(i||s)&&this.type===y.colon&&this.unexpected(),this.eat(y.colon)?(t.value=e?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,n),t.kind="init"):this.options.ecmaVersion>=6&&this.type===y.parenL?(e&&this.unexpected(),t.method=!0,t.value=this.parseMethod(i,s),t.kind="init"):e||o||!(this.options.ecmaVersion>=5)||t.computed||"Identifier"!==t.key.type||"get"!==t.key.name&&"set"!==t.key.name||this.type===y.comma||this.type===y.braceR||this.type===y.eq?this.options.ecmaVersion>=6&&!t.computed&&"Identifier"===t.key.type?((i||s)&&this.unexpected(),this.checkUnreserved(t.key),"await"!==t.key.name||this.awaitIdentPos||(this.awaitIdentPos=r),e?t.value=this.parseMaybeDefault(r,a,this.copyNode(t.key)):this.type===y.eq&&n?(n.shorthandAssign<0&&(n.shorthandAssign=this.start),t.value=this.parseMaybeDefault(r,a,this.copyNode(t.key))):t.value=this.copyNode(t.key),t.kind="init",t.shorthand=!0):this.unexpected():((i||s)&&this.unexpected(),this.parseGetterSetter(t))},ts.parsePropertyName=function(t){if(this.options.ecmaVersion>=6)if(this.eat(y.bracketL))return t.computed=!0,t.key=this.parseMaybeAssign(),this.expect(y.bracketR),t.key;else t.computed=!1;return t.key=this.type===y.num||this.type===y.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},ts.initFunction=function(t){t.id=null,this.options.ecmaVersion>=6&&(t.generator=t.expression=!1),this.options.ecmaVersion>=8&&(t.async=!1)},ts.parseMethod=function(t,e,i){var s=this.startNode(),r=this.yieldPos,a=this.awaitPos,n=this.awaitIdentPos;return this.initFunction(s),this.options.ecmaVersion>=6&&(s.generator=t),this.options.ecmaVersion>=8&&(s.async=!!e),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|U(e,s.generator)|128*!!i),this.expect(y.parenL),s.params=this.parseBindingList(y.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(s,!1,!0,!1),this.yieldPos=r,this.awaitPos=a,this.awaitIdentPos=n,this.finishNode(s,"FunctionExpression")},ts.parseArrowExpression=function(t,e,i,s){var r=this.yieldPos,a=this.awaitPos,n=this.awaitIdentPos;return this.enterScope(16|U(i,!1)),this.initFunction(t),this.options.ecmaVersion>=8&&(t.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,t.params=this.toAssignableList(e,!0),this.parseFunctionBody(t,!0,!1,s),this.yieldPos=r,this.awaitPos=a,this.awaitIdentPos=n,this.finishNode(t,"ArrowFunctionExpression")},ts.parseFunctionBody=function(t,e,i,s){var r=e&&this.type!==y.braceL,a=this.strict,n=!1;if(r)t.body=this.parseMaybeAssign(s),t.expression=!0,this.checkParams(t,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(t.params);(!a||o)&&(n=this.strictDirective(this.end))&&o&&this.raiseRecoverable(t.start,"Illegal 'use strict' directive in function with non-simple parameter list");var h=this.labels;this.labels=[],n&&(this.strict=!0),this.checkParams(t,!a&&!n&&!e&&!i&&this.isSimpleParamList(t.params)),this.strict&&t.id&&this.checkLValSimple(t.id,5),t.body=this.parseBlock(!1,void 0,n&&!a),t.expression=!1,this.adaptDirectivePrologue(t.body.body),this.labels=h}this.exitScope()},ts.isSimpleParamList=function(t){for(var e=0;e<t.length;e+=1)if("Identifier"!==t[e].type)return!1;return!0},ts.checkParams=function(t,e){for(var i=Object.create(null),s=0,r=t.params;s<r.length;s+=1){var a=r[s];this.checkLValInnerPattern(a,1,e?null:i)}},ts.parseExprList=function(t,e,i,s){for(var r=[],a=!0;!this.eat(t);){if(a)a=!1;else if(this.expect(y.comma),e&&this.afterTrailingComma(t))break;var n=void 0;i&&this.type===y.comma?n=null:this.type===y.ellipsis?(n=this.parseSpread(s),s&&this.type===y.comma&&s.trailingComma<0&&(s.trailingComma=this.start)):n=this.parseMaybeAssign(!1,s),r.push(n)}return r},ts.checkUnreserved=function(t){var e=t.start,i=t.end,s=t.name;this.inGenerator&&"yield"===s&&this.raiseRecoverable(e,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&"await"===s&&this.raiseRecoverable(e,"Cannot use 'await' as identifier inside an async function"),259&this.currentThisScope().flags||"arguments"!==s||this.raiseRecoverable(e,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&("arguments"===s||"await"===s)&&this.raise(e,"Cannot use "+s+" in class static initialization block"),this.keywords.test(s)&&this.raise(e,"Unexpected keyword '"+s+"'"),(!(this.options.ecmaVersion<6)||-1===this.input.slice(e,i).indexOf("\\"))&&(this.strict?this.reservedWordsStrict:this.reservedWords).test(s)&&(this.inAsync||"await"!==s||this.raiseRecoverable(e,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(e,"The keyword '"+s+"' is reserved"))},ts.parseIdent=function(t){var e=this.parseIdentNode();return this.next(!!t),this.finishNode(e,"Identifier"),!t&&(this.checkUnreserved(e),"await"!==e.name||this.awaitIdentPos||(this.awaitIdentPos=e.start)),e},ts.parseIdentNode=function(){var t=this.startNode();return this.type===y.name?t.name=this.value:this.type.keyword?(t.name=this.type.keyword,("class"===t.name||"function"===t.name)&&(this.lastTokEnd!==this.lastTokStart+1||46!==this.input.charCodeAt(this.lastTokStart))&&this.context.pop(),this.type=y.name):this.unexpected(),t},ts.parsePrivateIdent=function(){var t=this.startNode();return this.type===y.privateId?t.name=this.value:this.unexpected(),this.next(),this.finishNode(t,"PrivateIdentifier"),this.options.checkPrivateFields&&(0===this.privateNameStack.length?this.raise(t.start,"Private field '#"+t.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(t)),t},ts.parseYield=function(t){this.yieldPos||(this.yieldPos=this.start);var e=this.startNode();return this.next(),this.type===y.semi||this.canInsertSemicolon()||this.type!==y.star&&!this.type.startsExpr?(e.delegate=!1,e.argument=null):(e.delegate=this.eat(y.star),e.argument=this.parseMaybeAssign(t)),this.finishNode(e,"YieldExpression")},ts.parseAwait=function(t){this.awaitPos||(this.awaitPos=this.start);var e=this.startNode();return this.next(),e.argument=this.parseMaybeUnary(null,!0,!1,t),this.finishNode(e,"AwaitExpression")};var ta=q.prototype;ta.raise=function(t,e){var i=B(this.input,t);e+=" ("+i.line+":"+i.column+")",this.sourceFile&&(e+=" in "+this.sourceFile);var s=SyntaxError(e);throw s.pos=t,s.loc=i,s.raisedAt=this.pos,s},ta.raiseRecoverable=ta.raise,ta.curPosition=function(){if(this.options.locations)return new D(this.curLine,this.pos-this.lineStart)};var tn=q.prototype,to=function(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[]};tn.enterScope=function(t){this.scopeStack.push(new to(t))},tn.exitScope=function(){this.scopeStack.pop()},tn.treatFunctionsAsVarInScope=function(t){return 2&t.flags||!this.inModule&&1&t.flags},tn.declareName=function(t,e,i){var s=!1;if(2===e){var r=this.currentScope();s=r.lexical.indexOf(t)>-1||r.functions.indexOf(t)>-1||r.var.indexOf(t)>-1,r.lexical.push(t),this.inModule&&1&r.flags&&delete this.undefinedExports[t]}else if(4===e)this.currentScope().lexical.push(t);else if(3===e){var a=this.currentScope();s=this.treatFunctionsAsVar?a.lexical.indexOf(t)>-1:a.lexical.indexOf(t)>-1||a.var.indexOf(t)>-1,a.functions.push(t)}else for(var n=this.scopeStack.length-1;n>=0;--n){var o=this.scopeStack[n];if(o.lexical.indexOf(t)>-1&&!(32&o.flags&&o.lexical[0]===t)||!this.treatFunctionsAsVarInScope(o)&&o.functions.indexOf(t)>-1){s=!0;break}if(o.var.push(t),this.inModule&&1&o.flags&&delete this.undefinedExports[t],259&o.flags)break}s&&this.raiseRecoverable(i,"Identifier '"+t+"' has already been declared")},tn.checkLocalExport=function(t){-1===this.scopeStack[0].lexical.indexOf(t.name)&&-1===this.scopeStack[0].var.indexOf(t.name)&&(this.undefinedExports[t.name]=t)},tn.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},tn.currentVarScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(771&e.flags)return e}},tn.currentThisScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(771&e.flags&&!(16&e.flags))return e}};var th=function(t,e,i){this.type="",this.start=e,this.end=0,t.options.locations&&(this.loc=new O(t,i)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[e,0])},tp=q.prototype;function tc(t,e,i,s){return t.type=e,t.end=i,this.options.locations&&(t.loc.end=s),this.options.ranges&&(t.range[1]=i),t}tp.startNode=function(){return new th(this,this.start,this.startLoc)},tp.startNodeAt=function(t,e){return new th(this,t,e)},tp.finishNode=function(t,e){return tc.call(this,t,e,this.lastTokEnd,this.lastTokEndLoc)},tp.finishNodeAt=function(t,e,i,s){return tc.call(this,t,e,i,s)},tp.copyNode=function(t){var e=new th(this,t.start,this.startLoc);for(var i in t)e[i]=t[i];return e};for(var tl="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",tu=tl+" Extended_Pictographic",td=tu+" EBase EComp EMod EPres ExtPict",tf={9:tl,10:tu,11:tu,12:td,13:td,14:td},tm={9:"",10:"",11:"",12:"",13:"",14:"Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji"},tg="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",tx="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",tv=tx+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",ty=tv+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",tb=ty+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",t_=tb+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",tk={9:tx,10:tv,11:ty,12:tb,13:t_,14:t_+" Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz"},tS={},tC=0,tw=[9,10,11,12,13,14];tC<tw.length;tC+=1)!function(t){var e=tS[t]={binary:T(tf[t]+" "+tg),binaryOfStrings:T(tm[t]),nonBinary:{General_Category:T(tg),Script:T(tk[t])}};e.nonBinary.Script_Extensions=e.nonBinary.Script,e.nonBinary.gc=e.nonBinary.General_Category,e.nonBinary.sc=e.nonBinary.Script,e.nonBinary.scx=e.nonBinary.Script_Extensions}(tw[tC]);var tE=q.prototype,tA=function(t,e){this.parent=t,this.base=e||this};tA.prototype.separatedFrom=function(t){for(var e=this;e;e=e.parent)for(var i=t;i;i=i.parent)if(e.base===i.base&&e!==i)return!0;return!1},tA.prototype.sibling=function(){return new tA(this.parent,this.base)};var tI=function(t){this.parser=t,this.validFlags="gim"+(t.options.ecmaVersion>=6?"uy":"")+(t.options.ecmaVersion>=9?"s":"")+(t.options.ecmaVersion>=13?"d":"")+(t.options.ecmaVersion>=15?"v":""),this.unicodeProperties=tS[t.options.ecmaVersion>=14?14:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};function tP(t){return 36===t||t>=40&&t<=43||46===t||63===t||t>=91&&t<=94||t>=123&&t<=125}function tV(t){return t>=65&&t<=90||t>=97&&t<=122}function tN(t){return tV(t)||95===t}function tT(t){return t>=48&&t<=57}function tL(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function tR(t){return t>=65&&t<=70?10+(t-65):t>=97&&t<=102?10+(t-97):t-48}function tD(t){return t>=48&&t<=55}tI.prototype.reset=function(t,e,i){var s=-1!==i.indexOf("v"),r=-1!==i.indexOf("u");this.start=0|t,this.source=e+"",this.flags=i,s&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=r&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=r&&this.parser.options.ecmaVersion>=9)},tI.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)},tI.prototype.at=function(t,e){void 0===e&&(e=!1);var i=this.source,s=i.length;if(t>=s)return -1;var r=i.charCodeAt(t);if(!(e||this.switchU)||r<=55295||r>=57344||t+1>=s)return r;var a=i.charCodeAt(t+1);return a>=56320&&a<=57343?(r<<10)+a-0x35fdc00:r},tI.prototype.nextIndex=function(t,e){void 0===e&&(e=!1);var i=this.source,s=i.length;if(t>=s)return s;var r,a=i.charCodeAt(t);return!(e||this.switchU)||a<=55295||a>=57344||t+1>=s||(r=i.charCodeAt(t+1))<56320||r>57343?t+1:t+2},tI.prototype.current=function(t){return void 0===t&&(t=!1),this.at(this.pos,t)},tI.prototype.lookahead=function(t){return void 0===t&&(t=!1),this.at(this.nextIndex(this.pos,t),t)},tI.prototype.advance=function(t){void 0===t&&(t=!1),this.pos=this.nextIndex(this.pos,t)},tI.prototype.eat=function(t,e){return void 0===e&&(e=!1),this.current(e)===t&&(this.advance(e),!0)},tI.prototype.eatChars=function(t,e){void 0===e&&(e=!1);for(var i=this.pos,s=0;s<t.length;s+=1){var r=t[s],a=this.at(i,e);if(-1===a||a!==r)return!1;i=this.nextIndex(i,e)}return this.pos=i,!0},tE.validateRegExpFlags=function(t){for(var e=t.validFlags,i=t.flags,s=!1,r=!1,a=0;a<i.length;a++){var n=i.charAt(a);-1===e.indexOf(n)&&this.raise(t.start,"Invalid regular expression flag"),i.indexOf(n,a+1)>-1&&this.raise(t.start,"Duplicate regular expression flag"),"u"===n&&(s=!0),"v"===n&&(r=!0)}this.options.ecmaVersion>=15&&s&&r&&this.raise(t.start,"Invalid regular expression flag")},tE.validateRegExpPattern=function(t){this.regexp_pattern(t),!t.switchN&&this.options.ecmaVersion>=9&&function(t){for(var e in t)return!0;return!1}(t.groupNames)&&(t.switchN=!0,this.regexp_pattern(t))},tE.regexp_pattern=function(t){t.pos=0,t.lastIntValue=0,t.lastStringValue="",t.lastAssertionIsQuantifiable=!1,t.numCapturingParens=0,t.maxBackReference=0,t.groupNames=Object.create(null),t.backReferenceNames.length=0,t.branchID=null,this.regexp_disjunction(t),t.pos!==t.source.length&&(t.eat(41)&&t.raise("Unmatched ')'"),(t.eat(93)||t.eat(125))&&t.raise("Lone quantifier brackets")),t.maxBackReference>t.numCapturingParens&&t.raise("Invalid escape");for(var e=0,i=t.backReferenceNames;e<i.length;e+=1){var s=i[e];t.groupNames[s]||t.raise("Invalid named capture referenced")}},tE.regexp_disjunction=function(t){var e=this.options.ecmaVersion>=16;for(e&&(t.branchID=new tA(t.branchID,null)),this.regexp_alternative(t);t.eat(124);)e&&(t.branchID=t.branchID.sibling()),this.regexp_alternative(t);e&&(t.branchID=t.branchID.parent),this.regexp_eatQuantifier(t,!0)&&t.raise("Nothing to repeat"),t.eat(123)&&t.raise("Lone quantifier brackets")},tE.regexp_alternative=function(t){for(;t.pos<t.source.length&&this.regexp_eatTerm(t););},tE.regexp_eatTerm=function(t){return this.regexp_eatAssertion(t)?(t.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(t)&&t.switchU&&t.raise("Invalid quantifier"),!0):(t.switchU?!!this.regexp_eatAtom(t):!!this.regexp_eatExtendedAtom(t))&&(this.regexp_eatQuantifier(t),!0)},tE.regexp_eatAssertion=function(t){var e=t.pos;if(t.lastAssertionIsQuantifiable=!1,t.eat(94)||t.eat(36))return!0;if(t.eat(92)){if(t.eat(66)||t.eat(98))return!0;t.pos=e}if(t.eat(40)&&t.eat(63)){var i=!1;if(this.options.ecmaVersion>=9&&(i=t.eat(60)),t.eat(61)||t.eat(33))return this.regexp_disjunction(t),t.eat(41)||t.raise("Unterminated group"),t.lastAssertionIsQuantifiable=!i,!0}return t.pos=e,!1},tE.regexp_eatQuantifier=function(t,e){return void 0===e&&(e=!1),!!this.regexp_eatQuantifierPrefix(t,e)&&(t.eat(63),!0)},tE.regexp_eatQuantifierPrefix=function(t,e){return t.eat(42)||t.eat(43)||t.eat(63)||this.regexp_eatBracedQuantifier(t,e)},tE.regexp_eatBracedQuantifier=function(t,e){var i=t.pos;if(t.eat(123)){var s=0,r=-1;if(this.regexp_eatDecimalDigits(t)&&(s=t.lastIntValue,t.eat(44)&&this.regexp_eatDecimalDigits(t)&&(r=t.lastIntValue),t.eat(125)))return -1!==r&&r<s&&!e&&t.raise("numbers out of order in {} quantifier"),!0;t.switchU&&!e&&t.raise("Incomplete quantifier"),t.pos=i}return!1},tE.regexp_eatAtom=function(t){return this.regexp_eatPatternCharacters(t)||t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)},tE.regexp_eatReverseSolidusAtomEscape=function(t){var e=t.pos;if(t.eat(92)){if(this.regexp_eatAtomEscape(t))return!0;t.pos=e}return!1},tE.regexp_eatUncapturingGroup=function(t){var e=t.pos;if(t.eat(40)){if(t.eat(63)){if(this.options.ecmaVersion>=16){var i=this.regexp_eatModifiers(t),s=t.eat(45);if(i||s){for(var r=0;r<i.length;r++){var a=i.charAt(r);i.indexOf(a,r+1)>-1&&t.raise("Duplicate regular expression modifiers")}if(s){var n=this.regexp_eatModifiers(t);i||n||58!==t.current()||t.raise("Invalid regular expression modifiers");for(var o=0;o<n.length;o++){var h=n.charAt(o);(n.indexOf(h,o+1)>-1||i.indexOf(h)>-1)&&t.raise("Duplicate regular expression modifiers")}}}}if(t.eat(58)){if(this.regexp_disjunction(t),t.eat(41))return!0;t.raise("Unterminated group")}}t.pos=e}return!1},tE.regexp_eatCapturingGroup=function(t){if(t.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(t):63===t.current()&&t.raise("Invalid group"),this.regexp_disjunction(t),t.eat(41))return t.numCapturingParens+=1,!0;t.raise("Unterminated group")}return!1},tE.regexp_eatModifiers=function(t){for(var e,i="",s=0;-1!==(s=t.current())&&(105===(e=s)||109===e||115===e);)i+=L(s),t.advance();return i},tE.regexp_eatExtendedAtom=function(t){return t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)||this.regexp_eatInvalidBracedQuantifier(t)||this.regexp_eatExtendedPatternCharacter(t)},tE.regexp_eatInvalidBracedQuantifier=function(t){return this.regexp_eatBracedQuantifier(t,!0)&&t.raise("Nothing to repeat"),!1},tE.regexp_eatSyntaxCharacter=function(t){var e=t.current();return!!tP(e)&&(t.lastIntValue=e,t.advance(),!0)},tE.regexp_eatPatternCharacters=function(t){for(var e=t.pos,i=0;-1!==(i=t.current())&&!tP(i);)t.advance();return t.pos!==e},tE.regexp_eatExtendedPatternCharacter=function(t){var e=t.current();return -1!==e&&36!==e&&(!(e>=40)||!(e<=43))&&46!==e&&63!==e&&91!==e&&94!==e&&124!==e&&(t.advance(),!0)},tE.regexp_groupSpecifier=function(t){if(t.eat(63)){this.regexp_eatGroupName(t)||t.raise("Invalid group");var e=this.options.ecmaVersion>=16,i=t.groupNames[t.lastStringValue];if(i)if(e)for(var s=0;s<i.length;s+=1)i[s].separatedFrom(t.branchID)||t.raise("Duplicate capture group name");else t.raise("Duplicate capture group name");e?(i||(t.groupNames[t.lastStringValue]=[])).push(t.branchID):t.groupNames[t.lastStringValue]=!0}},tE.regexp_eatGroupName=function(t){if(t.lastStringValue="",t.eat(60)){if(this.regexp_eatRegExpIdentifierName(t)&&t.eat(62))return!0;t.raise("Invalid capture group name")}return!1},tE.regexp_eatRegExpIdentifierName=function(t){if(t.lastStringValue="",this.regexp_eatRegExpIdentifierStart(t)){for(t.lastStringValue+=L(t.lastIntValue);this.regexp_eatRegExpIdentifierPart(t);)t.lastStringValue+=L(t.lastIntValue);return!0}return!1},tE.regexp_eatRegExpIdentifierStart=function(t){var e,i=t.pos,s=this.options.ecmaVersion>=11,r=t.current(s);return(t.advance(s),92===r&&this.regexp_eatRegExpUnicodeEscapeSequence(t,s)&&(r=t.lastIntValue),l(e=r,!0)||36===e||95===e)?(t.lastIntValue=r,!0):(t.pos=i,!1)},tE.regexp_eatRegExpIdentifierPart=function(t){var e,i=t.pos,s=this.options.ecmaVersion>=11,r=t.current(s);return(t.advance(s),92===r&&this.regexp_eatRegExpUnicodeEscapeSequence(t,s)&&(r=t.lastIntValue),u(e=r,!0)||36===e||95===e||8204===e||8205===e)?(t.lastIntValue=r,!0):(t.pos=i,!1)},tE.regexp_eatAtomEscape=function(t){return!!(this.regexp_eatBackReference(t)||this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)||t.switchN&&this.regexp_eatKGroupName(t))||(t.switchU&&(99===t.current()&&t.raise("Invalid unicode escape"),t.raise("Invalid escape")),!1)},tE.regexp_eatBackReference=function(t){var e=t.pos;if(this.regexp_eatDecimalEscape(t)){var i=t.lastIntValue;if(t.switchU)return i>t.maxBackReference&&(t.maxBackReference=i),!0;if(i<=t.numCapturingParens)return!0;t.pos=e}return!1},tE.regexp_eatKGroupName=function(t){if(t.eat(107)){if(this.regexp_eatGroupName(t))return t.backReferenceNames.push(t.lastStringValue),!0;t.raise("Invalid named reference")}return!1},tE.regexp_eatCharacterEscape=function(t){return this.regexp_eatControlEscape(t)||this.regexp_eatCControlLetter(t)||this.regexp_eatZero(t)||this.regexp_eatHexEscapeSequence(t)||this.regexp_eatRegExpUnicodeEscapeSequence(t,!1)||!t.switchU&&this.regexp_eatLegacyOctalEscapeSequence(t)||this.regexp_eatIdentityEscape(t)},tE.regexp_eatCControlLetter=function(t){var e=t.pos;if(t.eat(99)){if(this.regexp_eatControlLetter(t))return!0;t.pos=e}return!1},tE.regexp_eatZero=function(t){return!(48!==t.current()||tT(t.lookahead()))&&(t.lastIntValue=0,t.advance(),!0)},tE.regexp_eatControlEscape=function(t){var e=t.current();return 116===e?(t.lastIntValue=9,t.advance(),!0):110===e?(t.lastIntValue=10,t.advance(),!0):118===e?(t.lastIntValue=11,t.advance(),!0):102===e?(t.lastIntValue=12,t.advance(),!0):114===e&&(t.lastIntValue=13,t.advance(),!0)},tE.regexp_eatControlLetter=function(t){var e=t.current();return!!tV(e)&&(t.lastIntValue=e%32,t.advance(),!0)},tE.regexp_eatRegExpUnicodeEscapeSequence=function(t,e){void 0===e&&(e=!1);var i=t.pos,s=e||t.switchU;if(t.eat(117)){if(this.regexp_eatFixedHexDigits(t,4)){var r,a=t.lastIntValue;if(s&&a>=55296&&a<=56319){var n=t.pos;if(t.eat(92)&&t.eat(117)&&this.regexp_eatFixedHexDigits(t,4)){var o=t.lastIntValue;if(o>=56320&&o<=57343)return t.lastIntValue=(a-55296)*1024+(o-56320)+65536,!0}t.pos=n,t.lastIntValue=a}return!0}if(s&&t.eat(123)&&this.regexp_eatHexDigits(t)&&t.eat(125)&&(r=t.lastIntValue)>=0&&r<=1114111)return!0;s&&t.raise("Invalid unicode escape"),t.pos=i}return!1},tE.regexp_eatIdentityEscape=function(t){if(t.switchU)return!!this.regexp_eatSyntaxCharacter(t)||!!t.eat(47)&&(t.lastIntValue=47,!0);var e=t.current();return 99!==e&&(!t.switchN||107!==e)&&(t.lastIntValue=e,t.advance(),!0)},tE.regexp_eatDecimalEscape=function(t){t.lastIntValue=0;var e=t.current();if(e>=49&&e<=57){do t.lastIntValue=10*t.lastIntValue+(e-48),t.advance();while((e=t.current())>=48&&e<=57);return!0}return!1},tE.regexp_eatCharacterClassEscape=function(t){var e,i,s=t.current();if(100===(e=s)||68===e||115===e||83===e||119===e||87===e)return t.lastIntValue=-1,t.advance(),1;var r=!1;if(t.switchU&&this.options.ecmaVersion>=9&&((r=80===s)||112===s)){if(t.lastIntValue=-1,t.advance(),t.eat(123)&&(i=this.regexp_eatUnicodePropertyValueExpression(t))&&t.eat(125))return r&&2===i&&t.raise("Invalid property name"),i;t.raise("Invalid property name")}return 0},tE.regexp_eatUnicodePropertyValueExpression=function(t){var e=t.pos;if(this.regexp_eatUnicodePropertyName(t)&&t.eat(61)){var i=t.lastStringValue;if(this.regexp_eatUnicodePropertyValue(t)){var s=t.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(t,i,s),1}}if(t.pos=e,this.regexp_eatLoneUnicodePropertyNameOrValue(t)){var r=t.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(t,r)}return 0},tE.regexp_validateUnicodePropertyNameAndValue=function(t,e,i){P(t.unicodeProperties.nonBinary,e)||t.raise("Invalid property name"),t.unicodeProperties.nonBinary[e].test(i)||t.raise("Invalid property value")},tE.regexp_validateUnicodePropertyNameOrValue=function(t,e){return t.unicodeProperties.binary.test(e)?1:t.switchV&&t.unicodeProperties.binaryOfStrings.test(e)?2:void t.raise("Invalid property name")},tE.regexp_eatUnicodePropertyName=function(t){var e=0;for(t.lastStringValue="";tN(e=t.current());)t.lastStringValue+=L(e),t.advance();return""!==t.lastStringValue},tE.regexp_eatUnicodePropertyValue=function(t){var e,i=0;for(t.lastStringValue="";tN(e=i=t.current())||tT(e);)t.lastStringValue+=L(i),t.advance();return""!==t.lastStringValue},tE.regexp_eatLoneUnicodePropertyNameOrValue=function(t){return this.regexp_eatUnicodePropertyValue(t)},tE.regexp_eatCharacterClass=function(t){if(t.eat(91)){var e=t.eat(94),i=this.regexp_classContents(t);return t.eat(93)||t.raise("Unterminated character class"),e&&2===i&&t.raise("Negated character class may contain strings"),!0}return!1},tE.regexp_classContents=function(t){return 93===t.current()?1:t.switchV?this.regexp_classSetExpression(t):(this.regexp_nonEmptyClassRanges(t),1)},tE.regexp_nonEmptyClassRanges=function(t){for(;this.regexp_eatClassAtom(t);){var e=t.lastIntValue;if(t.eat(45)&&this.regexp_eatClassAtom(t)){var i=t.lastIntValue;t.switchU&&(-1===e||-1===i)&&t.raise("Invalid character class"),-1!==e&&-1!==i&&e>i&&t.raise("Range out of order in character class")}}},tE.regexp_eatClassAtom=function(t){var e=t.pos;if(t.eat(92)){if(this.regexp_eatClassEscape(t))return!0;if(t.switchU){var i=t.current();(99===i||tD(i))&&t.raise("Invalid class escape"),t.raise("Invalid escape")}t.pos=e}var s=t.current();return 93!==s&&(t.lastIntValue=s,t.advance(),!0)},tE.regexp_eatClassEscape=function(t){var e=t.pos;if(t.eat(98))return t.lastIntValue=8,!0;if(t.switchU&&t.eat(45))return t.lastIntValue=45,!0;if(!t.switchU&&t.eat(99)){if(this.regexp_eatClassControlLetter(t))return!0;t.pos=e}return this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)},tE.regexp_classSetExpression=function(t){var e,i=1;if(this.regexp_eatClassSetRange(t));else if(e=this.regexp_eatClassSetOperand(t)){2===e&&(i=2);for(var s=t.pos;t.eatChars([38,38]);){if(38!==t.current()&&(e=this.regexp_eatClassSetOperand(t))){2!==e&&(i=1);continue}t.raise("Invalid character in character class")}if(s!==t.pos)return i;for(;t.eatChars([45,45]);)this.regexp_eatClassSetOperand(t)||t.raise("Invalid character in character class");if(s!==t.pos)return i}else t.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(t)){if(!(e=this.regexp_eatClassSetOperand(t)))return i;2===e&&(i=2)}},tE.regexp_eatClassSetRange=function(t){var e=t.pos;if(this.regexp_eatClassSetCharacter(t)){var i=t.lastIntValue;if(t.eat(45)&&this.regexp_eatClassSetCharacter(t)){var s=t.lastIntValue;return -1!==i&&-1!==s&&i>s&&t.raise("Range out of order in character class"),!0}t.pos=e}return!1},tE.regexp_eatClassSetOperand=function(t){return this.regexp_eatClassSetCharacter(t)?1:this.regexp_eatClassStringDisjunction(t)||this.regexp_eatNestedClass(t)},tE.regexp_eatNestedClass=function(t){var e=t.pos;if(t.eat(91)){var i=t.eat(94),s=this.regexp_classContents(t);if(t.eat(93))return i&&2===s&&t.raise("Negated character class may contain strings"),s;t.pos=e}if(t.eat(92)){var r=this.regexp_eatCharacterClassEscape(t);if(r)return r;t.pos=e}return null},tE.regexp_eatClassStringDisjunction=function(t){var e=t.pos;if(t.eatChars([92,113])){if(t.eat(123)){var i=this.regexp_classStringDisjunctionContents(t);if(t.eat(125))return i}else t.raise("Invalid escape");t.pos=e}return null},tE.regexp_classStringDisjunctionContents=function(t){for(var e=this.regexp_classString(t);t.eat(124);)2===this.regexp_classString(t)&&(e=2);return e},tE.regexp_classString=function(t){for(var e=0;this.regexp_eatClassSetCharacter(t);)e++;return 1===e?1:2},tE.regexp_eatClassSetCharacter=function(t){var e,i,s=t.pos;if(t.eat(92))return!!(this.regexp_eatCharacterEscape(t)||this.regexp_eatClassSetReservedPunctuator(t))||(t.eat(98)?(t.lastIntValue=8,!0):(t.pos=s,!1));var r=t.current();return!(r<0||r===t.lookahead()&&(33===(e=r)||e>=35&&e<=38||e>=42&&e<=44||46===e||e>=58&&e<=64||94===e||96===e||126===e)||40===(i=r)||41===i||45===i||47===i||i>=91&&i<=93||i>=123&&i<=125)&&(t.advance(),t.lastIntValue=r,!0)},tE.regexp_eatClassSetReservedPunctuator=function(t){var e,i=t.current();return!!(33===(e=i)||35===e||37===e||38===e||44===e||45===e||e>=58&&e<=62||64===e||96===e||126===e)&&(t.lastIntValue=i,t.advance(),!0)},tE.regexp_eatClassControlLetter=function(t){var e=t.current();return(!!tT(e)||95===e)&&(t.lastIntValue=e%32,t.advance(),!0)},tE.regexp_eatHexEscapeSequence=function(t){var e=t.pos;if(t.eat(120)){if(this.regexp_eatFixedHexDigits(t,2))return!0;t.switchU&&t.raise("Invalid escape"),t.pos=e}return!1},tE.regexp_eatDecimalDigits=function(t){var e=t.pos,i=0;for(t.lastIntValue=0;tT(i=t.current());)t.lastIntValue=10*t.lastIntValue+(i-48),t.advance();return t.pos!==e},tE.regexp_eatHexDigits=function(t){var e=t.pos,i=0;for(t.lastIntValue=0;tL(i=t.current());)t.lastIntValue=16*t.lastIntValue+tR(i),t.advance();return t.pos!==e},tE.regexp_eatLegacyOctalEscapeSequence=function(t){if(this.regexp_eatOctalDigit(t)){var e=t.lastIntValue;if(this.regexp_eatOctalDigit(t)){var i=t.lastIntValue;e<=3&&this.regexp_eatOctalDigit(t)?t.lastIntValue=64*e+8*i+t.lastIntValue:t.lastIntValue=8*e+i}else t.lastIntValue=e;return!0}return!1},tE.regexp_eatOctalDigit=function(t){var e=t.current();return tD(e)?(t.lastIntValue=e-48,t.advance(),!0):(t.lastIntValue=0,!1)},tE.regexp_eatFixedHexDigits=function(t,e){var i=t.pos;t.lastIntValue=0;for(var s=0;s<e;++s){var r=t.current();if(!tL(r))return t.pos=i,!1;t.lastIntValue=16*t.lastIntValue+tR(r),t.advance()}return!0};var tO=function(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new O(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end])},tB=q.prototype;function tM(t){return"function"!=typeof BigInt?null:BigInt(t.replace(/_/g,""))}tB.next=function(t){!t&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new tO(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},tB.getToken=function(){return this.next(),new tO(this)},"u">typeof Symbol&&(tB[Symbol.iterator]=function(){var t=this;return{next:function(){var e=t.getToken();return{done:e.type===y.eof,value:e}}}}),tB.nextToken=function(){var t=this.curContext();return(t&&t.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)?this.finishToken(y.eof):t.override?t.override(this):void this.readToken(this.fullCharCodeAtPos())},tB.readToken=function(t){return l(t,this.options.ecmaVersion>=6)||92===t?this.readWord():this.getTokenFromCode(t)},tB.fullCharCodeAt=function(t){var e=this.input.charCodeAt(t);if(e<=55295||e>=56320)return e;var i=this.input.charCodeAt(t+1);return i<=56319||i>=57344?e:(e<<10)+i-0x35fdc00},tB.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)},tB.skipBlockComment=function(){var t=this.options.onComment&&this.curPosition(),e=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(-1===i&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(var s=void 0,r=e;(s=S(this.input,r,this.pos))>-1;)++this.curLine,r=this.lineStart=s;this.options.onComment&&this.options.onComment(!0,this.input.slice(e+2,i),e,this.pos,t,this.curPosition())},tB.skipLineComment=function(t){for(var e=this.pos,i=this.options.onComment&&this.curPosition(),s=this.input.charCodeAt(this.pos+=t);this.pos<this.input.length&&!k(s);)s=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(e+t,this.pos),e,this.pos,i,this.curPosition())},tB.skipSpace=function(){t:for(;this.pos<this.input.length;){var t=this.input.charCodeAt(this.pos);switch(t){case 32:case 160:++this.pos;break;case 13:10===this.input.charCodeAt(this.pos+1)&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break t}break;default:if(t>8&&t<14||t>=5760&&C.test(String.fromCharCode(t)))++this.pos;else break t}}},tB.finishToken=function(t,e){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=t,this.value=e,this.updateContext(i)},tB.readToken_dot=function(){var t=this.input.charCodeAt(this.pos+1);if(t>=48&&t<=57)return this.readNumber(!0);var e=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===t&&46===e?(this.pos+=3,this.finishToken(y.ellipsis)):(++this.pos,this.finishToken(y.dot))},tB.readToken_slash=function(){var t=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===t?this.finishOp(y.assign,2):this.finishOp(y.slash,1)},tB.readToken_mult_modulo_exp=function(t){var e=this.input.charCodeAt(this.pos+1),i=1,s=42===t?y.star:y.modulo;return(this.options.ecmaVersion>=7&&42===t&&42===e&&(++i,s=y.starstar,e=this.input.charCodeAt(this.pos+2)),61===e)?this.finishOp(y.assign,i+1):this.finishOp(s,i)},tB.readToken_pipe_amp=function(t){var e=this.input.charCodeAt(this.pos+1);if(e===t)return this.options.ecmaVersion>=12&&61===this.input.charCodeAt(this.pos+2)?this.finishOp(y.assign,3):this.finishOp(124===t?y.logicalOR:y.logicalAND,2);return 61===e?this.finishOp(y.assign,2):this.finishOp(124===t?y.bitwiseOR:y.bitwiseAND,1)},tB.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(y.assign,2):this.finishOp(y.bitwiseXOR,1)},tB.readToken_plus_min=function(t){var e=this.input.charCodeAt(this.pos+1);return e===t?45===e&&!this.inModule&&62===this.input.charCodeAt(this.pos+2)&&(0===this.lastTokEnd||b.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(y.incDec,2):61===e?this.finishOp(y.assign,2):this.finishOp(y.plusMin,1)},tB.readToken_lt_gt=function(t){var e=this.input.charCodeAt(this.pos+1),i=1;return e===t?(i=62===t&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+i))?this.finishOp(y.assign,i+1):this.finishOp(y.bitShift,i):33!==e||60!==t||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===e&&(i=2),this.finishOp(y.relational,i)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},tB.readToken_eq_excl=function(t){var e=this.input.charCodeAt(this.pos+1);return 61===e?this.finishOp(y.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===t&&62===e&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(y.arrow)):this.finishOp(61===t?y.eq:y.prefix,1)},tB.readToken_question=function(){var t=this.options.ecmaVersion;if(t>=11){var e=this.input.charCodeAt(this.pos+1);if(46===e){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(y.questionDot,2)}if(63===e)return t>=12&&61===this.input.charCodeAt(this.pos+2)?this.finishOp(y.assign,3):this.finishOp(y.coalesce,2)}return this.finishOp(y.question,1)},tB.readToken_numberSign=function(){var t=this.options.ecmaVersion,e=35;if(t>=13&&(++this.pos,l(e=this.fullCharCodeAtPos(),!0)||92===e))return this.finishToken(y.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+L(e)+"'")},tB.getTokenFromCode=function(t){switch(t){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(y.parenL);case 41:return++this.pos,this.finishToken(y.parenR);case 59:return++this.pos,this.finishToken(y.semi);case 44:return++this.pos,this.finishToken(y.comma);case 91:return++this.pos,this.finishToken(y.bracketL);case 93:return++this.pos,this.finishToken(y.bracketR);case 123:return++this.pos,this.finishToken(y.braceL);case 125:return++this.pos,this.finishToken(y.braceR);case 58:return++this.pos,this.finishToken(y.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(y.backQuote);case 48:var e=this.input.charCodeAt(this.pos+1);if(120===e||88===e)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===e||79===e)return this.readRadixNumber(8);if(98===e||66===e)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(t);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(t);case 124:case 38:return this.readToken_pipe_amp(t);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(t);case 60:case 62:return this.readToken_lt_gt(t);case 61:case 33:return this.readToken_eq_excl(t);case 63:return this.readToken_question();case 126:return this.finishOp(y.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+L(t)+"'")},tB.finishOp=function(t,e){var i=this.input.slice(this.pos,this.pos+e);return this.pos+=e,this.finishToken(t,i)},tB.readRegexp=function(){for(var t,e,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var s=this.input.charAt(this.pos);if(b.test(s)&&this.raise(i,"Unterminated regular expression"),t)t=!1;else{if("["===s)e=!0;else if("]"===s&&e)e=!1;else if("/"===s&&!e)break;t="\\"===s}++this.pos}var r=this.input.slice(i,this.pos);++this.pos;var a=this.pos,n=this.readWord1();this.containsEsc&&this.unexpected(a);var o=this.regexpState||(this.regexpState=new tI(this));o.reset(i,r,n),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var h=null;try{h=new RegExp(r,n)}catch(t){}return this.finishToken(y.regexp,{pattern:r,flags:n,value:h})},tB.readInt=function(t,e,i){for(var s=this.options.ecmaVersion>=12&&void 0===e,r=i&&48===this.input.charCodeAt(this.pos),a=this.pos,n=0,o=0,h=0,p=null==e?1/0:e;h<p;++h,++this.pos){var c=this.input.charCodeAt(this.pos),l=void 0;if(s&&95===c){r&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),95===o&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),0===h&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),o=c;continue}if((l=c>=97?c-97+10:c>=65?c-65+10:c>=48&&c<=57?c-48:1/0)>=t)break;o=c,n=n*t+l}return(s&&95===o&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===a||null!=e&&this.pos-a!==e)?null:n},tB.readRadixNumber=function(t){var e=this.pos;this.pos+=2;var i=this.readInt(t);return null==i&&this.raise(this.start+2,"Expected number in radix "+t),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(i=tM(this.input.slice(e,this.pos)),++this.pos):l(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(y.num,i)},tB.readNumber=function(t){var e,i=this.pos;t||null!==this.readInt(10,void 0,!0)||this.raise(i,"Invalid number");var s=this.pos-i>=2&&48===this.input.charCodeAt(i);s&&this.strict&&this.raise(i,"Invalid number");var r=this.input.charCodeAt(this.pos);if(!s&&!t&&this.options.ecmaVersion>=11&&110===r){var a=tM(this.input.slice(i,this.pos));return++this.pos,l(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(y.num,a)}s&&/[89]/.test(this.input.slice(i,this.pos))&&(s=!1),46!==r||s||(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),69!==r&&101!==r||s||((43===(r=this.input.charCodeAt(++this.pos))||45===r)&&++this.pos,null===this.readInt(10)&&this.raise(i,"Invalid number")),l(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var n=(e=this.input.slice(i,this.pos),s?parseInt(e,8):parseFloat(e.replace(/_/g,"")));return this.finishToken(y.num,n)},tB.readCodePoint=function(){var t;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var e=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(e,"Code point out of bounds")}else t=this.readHexChar(4);return t},tB.readString=function(t){for(var e="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var s=this.input.charCodeAt(this.pos);if(s===t)break;92===s?(e+=this.input.slice(i,this.pos),e+=this.readEscapedChar(!1),i=this.pos):8232===s||8233===s?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(k(s)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return e+=this.input.slice(i,this.pos++),this.finishToken(y.string,e)};var tF={};tB.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(t){if(t===tF)this.readInvalidTemplateToken();else throw t}this.inTemplateElement=!1},tB.invalidStringToken=function(t,e){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw tF;this.raise(t,e)},tB.readTmplToken=function(){for(var t="",e=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(96===i||36===i&&123===this.input.charCodeAt(this.pos+1)){if(this.pos===this.start&&(this.type===y.template||this.type===y.invalidTemplate))if(36===i)return this.pos+=2,this.finishToken(y.dollarBraceL);else return++this.pos,this.finishToken(y.backQuote);return t+=this.input.slice(e,this.pos),this.finishToken(y.template,t)}if(92===i)t+=this.input.slice(e,this.pos),t+=this.readEscapedChar(!0),e=this.pos;else if(k(i)){switch(t+=this.input.slice(e,this.pos),++this.pos,i){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:t+="\n";break;default:t+=String.fromCharCode(i)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),e=this.pos}else++this.pos}},tB.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if("{"!==this.input[this.pos+1])break;case"`":return this.finishToken(y.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":"\n"===this.input[this.pos+1]&&++this.pos;case"\n":case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1}this.raise(this.start,"Unterminated template")},tB.readEscapedChar=function(t){var e=this.input.charCodeAt(++this.pos);switch(++this.pos,e){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return L(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),t){var i=this.pos-1;this.invalidStringToken(i,"Invalid escape sequence in template string")}default:if(e>=48&&e<=55){var s=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],r=parseInt(s,8);return r>255&&(r=parseInt(s=s.slice(0,-1),8)),this.pos+=s.length-1,e=this.input.charCodeAt(this.pos),("0"!==s||56===e||57===e)&&(this.strict||t)&&this.invalidStringToken(this.pos-1-s.length,t?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(r)}if(k(e))return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";return String.fromCharCode(e)}},tB.readHexChar=function(t){var e=this.pos,i=this.readInt(16,t);return null===i&&this.invalidStringToken(e,"Bad character escape sequence"),i},tB.readWord1=function(){this.containsEsc=!1;for(var t="",e=!0,i=this.pos,s=this.options.ecmaVersion>=6;this.pos<this.input.length;){var r=this.fullCharCodeAtPos();if(u(r,s))this.pos+=r<=65535?1:2;else if(92===r){this.containsEsc=!0,t+=this.input.slice(i,this.pos);var a=this.pos;117!==this.input.charCodeAt(++this.pos)&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var n=this.readCodePoint();(e?l:u)(n,s)||this.invalidStringToken(a,"Invalid Unicode escape"),t+=L(n),i=this.pos}else break;e=!1}return t+this.input.slice(i,this.pos)},tB.readWord=function(){var t=this.readWord1(),e=y.name;return this.keywords.test(t)&&(e=x[t]),this.finishToken(e,t)};var tU="8.16.0";q.acorn={Parser:q,version:tU,defaultOptions:M,Position:D,SourceLocation:O,getLineInfo:B,Node:th,TokenType:d,tokTypes:y,keywordTypes:x,TokContext:tt,tokContexts:te,isIdentifierChar:u,isIdentifierStart:l,Token:tO,isNewLine:k,lineBreak:b,lineBreakG:_,nonASCIIwhitespace:C},t.Node=th,t.Parser=q,t.Position=D,t.SourceLocation=O,t.TokContext=tt,t.Token=tO,t.TokenType=d,t.defaultOptions=M,t.getLineInfo=B,t.isIdentifierChar=u,t.isIdentifierStart=l,t.isNewLine=k,t.keywordTypes=x,t.lineBreak=b,t.lineBreakG=_,t.nonASCIIwhitespace=C,t.parse=function(t,e){return q.parse(t,e)},t.parseExpressionAt=function(t,e,i){return q.parseExpressionAt(t,e,i)},t.tokContexts=te,t.tokTypes=y,t.tokenizer=function(t,e){return q.tokenizer(t,e)},t.version=tU}(e)}};
|
package/lib/511.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const __rspack_esm_id=511;export const __rspack_esm_ids=[511];export const __webpack_modules__={18501(e,t,r){let{docs:a}=r(5867);t.isCommand=e=>!!(e&&e.type&&e.type.startsWith("command-node-")),t.getPorts=e=>e?Array.isArray(e)?e:[e]:[],t.getCommandCallbackFromPort=(e,r)=>{let n=e[r];if(!t.isCommand(n))return null;let i=a[n.type.replace("command-node-","")]?.commands?.[n.properties?.command];return i?.iterateeFrom||i?.invocationFrom||null},t.checkDisableTriggerCommand=(e,r)=>t.getPorts(e[r.id]?.in?.[r.port]).some(e=>e?.disable_trigger_command);let n=(e,r,a)=>Object.values(e[r]?.out||{}).every(r=>t.getPorts(r).every(r=>{if(!r||!e[r.id]||r.port===t.getCommandCallbackFromPort(e,r.id)||t.checkDisableTriggerCommand(e,r))return!0;if(a.has(r.id))return!1;a.add(r.id);let i=n(e,r.id,a);return a.delete(r.id),i}));t.findCircularReferenceIds=e=>Object.keys(e).filter(t=>e[t]?.type==="data-node").filter(t=>!n(e,t,new Set([t]))),t.hasCircularReference=e=>t.findCircularReferenceIds(e).length>0,t.composeMap=e=>Object.values(e).reduce((e,r)=>Object.entries(r?.map||{}).reduce((e,[r,a])=>{if(e[r]){if(t.isCommand(a))throw Error(`Doesn't allow same command id in another map, ${r}`);let n=e[r];Object.keys(n.in).forEach(e=>{a?.in?.[e]&&(n.in[e]=(n.in[e]||[]).concat(a.in[e]).filter(Boolean))}),Object.keys(n.out).forEach(e=>{a?.out?.[e]&&(n.out[e]=(n.out[e]||[]).concat(a.out[e]).filter(Boolean))})}else e[r]={...a,in:{...a?.in},out:{...a?.out}};return e},e),{})},86343(e,t,r){let{v4:a}=r(45620),n=r(95479),{nameMap:i,brickMapping:o,generatorMapping:
|
|
1
|
+
export const __rspack_esm_id=511;export const __rspack_esm_ids=[511];export const __webpack_modules__={18501(e,t,r){let{docs:a}=r(5867);t.isCommand=e=>!!(e&&e.type&&e.type.startsWith("command-node-")),t.getPorts=e=>e?Array.isArray(e)?e:[e]:[],t.getCommandCallbackFromPort=(e,r)=>{let n=e[r];if(!t.isCommand(n))return null;let i=a[n.type.replace("command-node-","")]?.commands?.[n.properties?.command];return i?.iterateeFrom||i?.invocationFrom||null},t.checkDisableTriggerCommand=(e,r)=>t.getPorts(e[r.id]?.in?.[r.port]).some(e=>e?.disable_trigger_command);let n=(e,r,a)=>Object.values(e[r]?.out||{}).every(r=>t.getPorts(r).every(r=>{if(!r||!e[r.id]||r.port===t.getCommandCallbackFromPort(e,r.id)||t.checkDisableTriggerCommand(e,r))return!0;if(a.has(r.id))return!1;a.add(r.id);let i=n(e,r.id,a);return a.delete(r.id),i}));t.findCircularReferenceIds=e=>Object.keys(e).filter(t=>e[t]?.type==="data-node").filter(t=>!n(e,t,new Set([t]))),t.hasCircularReference=e=>t.findCircularReferenceIds(e).length>0,t.composeMap=e=>Object.values(e).reduce((e,r)=>Object.entries(r?.map||{}).reduce((e,[r,a])=>{if(e[r]){if(t.isCommand(a))throw Error(`Doesn't allow same command id in another map, ${r}`);let n=e[r];Object.keys(n.in).forEach(e=>{a?.in?.[e]&&(n.in[e]=(n.in[e]||[]).concat(a.in[e]).filter(Boolean))}),Object.keys(n.out).forEach(e=>{a?.out?.[e]&&(n.out[e]=(n.out[e]||[]).concat(a.out[e]).filter(Boolean))})}else e[r]={...a,in:{...a?.in},out:{...a?.out}};return e},e),{})},86343(e,t,r){let{v4:a}=r(45620),n=r(95479),{nameMap:i,brickMapping:o,generatorMapping:s}=r(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,r])=>((r.type||r.compose_type)&&(e[t]=r),e),{}),t.matchItemByItem=(e,t)=>{let r;if(!e)return!1;switch("string"==typeof t&&(r=t),e.type){case"brick":return e.brick_id===(r||t.brick_id);case"subspace":return e.subspace_id===(r||t.subspace_id);case"canvas":return e.canvas_id===(r||t.canvas_id);case"generator":return e.generator_id===(r||t.generator_id);case"property_bank":return e.property_bank_id===(r||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,r)=>"array"===e?"object"===r?t.kindOneOfTypes[`${e}-${r}`]: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,r,a)=>{let o;if(!r)return e.toUpperCase();if(r.title)return r.title;switch(e){case"bank":o="BANK";break;case"subspace":o="SUBSPACE";break;case"canvas":o="CANVAS";break;case"animation":o=`<${n(t.getAnimationType(r))}>`;break;case"property_bank":o="<Data>";break;case"property_bank_calc":o="<Map>";break;case"state_group":o="<Switch Case>";break;default:o=`<${i[r.template_key||r.templateKey]||"Unknown"}>`}return a&&a.length>10?o+=` (${a.replace(/[A-Z_]+/g,"").substr(0,6)}...)`:a&&(o+=` (${a})`),o},t.getCallInternalActions=e=>{let t=o[e]||s[e];if(t)return t.callInternalActions},t.mapToList=(e,r)=>Object.entries(r).reduce((r,[a,n])=>(r.push({id:a,...n,title:t.getBrickName(e,n,a)}),r),[]);let c={subspaceMap:"subspace",brickMap:"brick",generatorMap:"generator",propertyBankMap:"property_bank",propertyAvailableToAdd:"property_bank",canvasMap:"canvas",animationMap:"animation"},p={};t.mapToListForDerivedState=(e,r,a,n)=>{let i=a[e]||p;return i!==n[e]?{[e]:i,[r]:t.mapToList(c[e],i)}:{}},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 r=e.indexOf(t.arrayTypePrefix)>-1,a=e.replace(t.arrayTypePrefix,"");return{type:a,properties:"object"===a?{}:void 0,allowNewItem:r,allowCustomProperty:"object"===a}}},37517(e,t,r){let{composeMap:a,findCircularReferenceIds:n}=r(18501);e.exports=function(e){let t=[];return Object.entries(e.subspace_map||{}).forEach(([e,r])=>{if(r.module?.link)return;let i=r.property_bank_calc_map;if(!i||0===Object.keys(i).length)return;let o=`subspace_map.${e}.property_bank_calc_map`;try{let e=a(i),r=n(e);if(r.length>0){let a=r.slice(0,5).map(t=>e[t].title||t),n=r.length>5?` and ${r.length-5} more`:"";t.push({field:o,message:`Circular reference detected in data calculation. Affected nodes: ${a.join(", ")}${n}. Please check the data connections for loops.`})}}catch(e){t.push({field:o,message:e.message})}}),t}},78078(e,t,r){let{parse:a}=r(89236),n={ecmaVersion:2020},i=(e,t,r)=>{if(e&&"object"==typeof e){if(Array.isArray(e))return void e.forEach((e,a)=>i(e,`${t}[${a}]`,r));Object.entries(e).forEach(([e,o])=>{("event_map"===e||"eventMap"===e)&&o&&"object"==typeof o?Object.entries(o).forEach(([i,o])=>{Array.isArray(o)&&o.forEach((o,s)=>{if(o?.action!=="PROPERTY_BANK_EXPRESSION")return;let c=(e=>{let t=e.parameter_list||e.parameterList||[];if(!Array.isArray(t))return;let r=t.find(e=>"EXPRESSION"===(e?.input_to_receiver||e?.inputToReceiver));return r?r.result_from_sender??r.resultFromSender:void 0})(o);if("string"!=typeof c||c.startsWith("PROPERTY_BANK#"))return;let p=(e=>{let t;if(!e.trim())return"Expression is empty";try{t=a(e,n)}catch(e){return`Expression does not parse: ${e.message}`}let r=(e=>{for(let t=0;t<e.length;t+=1){let r=e[t];if("ExpressionStatement"!==r.type){if("VariableDeclaration"===r.type){if(r.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"!==r.type)return`an unsupported ${r.type}`}}return null})(t.body);return r?`Expression contains ${r}; statements must fold into a single expression (expression statements, simple const/let declarations, and a final return only). Use ternaries instead of if/for/while, or move branching logic to a DataCalculationScript.`:null})(c);p&&r.push({field:`${t}.${e}.${i}[${s}]`,message:p})})}):o&&"object"==typeof o&&i(o,`${t}.${e}`,r)})}};e.exports=function(e){let t=[];return Object.entries(e.subspace_map||{}).forEach(([e,r])=>{r.module?.link||i(r,`subspace_map.${e}`,t)}),t}},38890(e,t,r){let{getDocByTemplateKey:a}=r(63981),n=r(80211),i=r(45907),o=r(37517),s=r(78078),{getBrickName:c}=r(86343);t.checkConfigDeprecatedFeatures=e=>{let t=[];return Object.entries(e.subspace_map||{}).forEach(([e,r])=>{Object.entries(r.brick_map||{}).forEach(([n,i])=>{(void 0!==i.property?.borderLeftWidth||void 0!==i.property?.borderRightWidth||void 0!==i.property?.borderTopWidth||void 0!==i.property?.borderBottomWidth)&&t.push({id:n,name:"Used Deprecated Feature",data:`In v2.16, we have been changed \`Border Width\` to \`Border Size\` (Unit \`px\` to \`grid\`). The \`${c("brick",i,n)}\` brick still used the border width. Please re-edit it to transfer to the new unit.`});let o=a(i.template_key);o?.brickMeta?.deprecated&&t.push({id:n,name:"Used Deprecated Feature",data:`The \`${c("brick",i,n)}\` brick in \`${c("subspace",r,e)}\` 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.`})}),Object.entries(r.generator_map||{}).forEach(([n,i])=>{let o=a(i.template_key);o?.brickMeta?.deprecated&&t.push({id:n,name:"Used Deprecated Feature",data:`The \`${c("brick",i,n)}\` brick in \`${c("subspace",r,e)}\` 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},t.checkConfig=(e,t={})=>{let r={schema:n(e),ref:i(e,t),calc:t.checkCalc?o(e):[],expression:t.checkExpressions?s(e):[]};return r.valid=0===r.schema.length&&0===r.ref.length&&0===r.calc.length&&0===r.expression.length,r.message=r.schema.concat(r.ref).concat(r.calc).concat(r.expression).map(({instancePath:e,field:t,message:r})=>{let a=e||t;return a?`${a}: ${r}`:r}).join("\n"),r}}};
|
package/lib/index.js
CHANGED
|
@@ -29,15 +29,17 @@ ${x.Ay.bold("Bound Devices")} (${n.devices.length})`),n.devices.forEach(e=>{var
|
|
|
29
29
|
${x.Ay.bold("Bound Devices")}: ${x.Ay.gray("None")}`),console.log("─".repeat(60))}catch(e){i.fail(`Failed to get application: ${e.message}`),process.exit(1)}}),function(e,t){return s.apply(this,arguments)})),O.command("resolve <query>").description("Resolve an application name or ID to stable IDs").option("-l, --limit <limit>","Limit search results",e=>Number.parseInt(e,10),10).option("-j, --json","Output as JSON").action((p=b(function*(e,t){var a=(0,A.o)(),i=t.json?null:(0,w.default)("Resolving application...").start();try{var n=yield(0,C.Y)(()=>a.application({id:e})),r=n?[n]:yield a.applications({keyword:e,paginate:{limit:t.limit}}),o=(0,C.K)({resource:"application",query:e,items:r||[],fields:["_id","name"],selectedBy:n?"id":null});if(i&&i.stop(),t.json)return void(0,F.GF)(o);if(o.resolved){var s=o.resolved;console.log(x.Ay.bold("\nResolved Application")),console.log("─".repeat(60)),console.log(`Name: ${x.Ay.cyan(s.name||"Unnamed")}`),console.log(`ID: ${x.Ay.gray(s._id)}`),console.log(`Selected By: ${o.selectedBy}`),console.log("─".repeat(60));return}if(0===o.matches.length)return void console.log(x.Ay.yellow(`No applications matched "${e}"`));console.log(x.Ay.bold(`
|
|
30
30
|
Matching Applications (${o.matches.length})`)),console.log("─".repeat(80)),o.matches.forEach(e=>{console.log(`${x.Ay.cyan(e.name||"Unnamed")} ${x.Ay.gray(e._id)}`)}),console.log("─".repeat(80))}catch(t){i?i.fail(`Failed to resolve application: ${t.message}`):(0,F.OW)(t.message,{resource:"application",query:e}),process.exit(1)}}),function(e,t){return p.apply(this,arguments)})),O.command("update <id>").description("Update application name, description, and/or configuration").option("-n, --name <name>","Application name").option("-d, --description <description>","Application description").option("-c, --config <json>","Application config as JSON string").option("-f, --file <path>","Application config from file").option("--validate","Validate configuration (default: true when config is set)",!0).option("--no-validate","Skip server-side config validation").option("--last-commit-id <id>","Reject if server config.bricks_project_last_commit_id does not match this value").option("-j, --json","Output as JSON").action((l=b(function*(e,t){var a=(0,A.o)(),i=t.json?null:(0,w.default)("Updating application...").start();try{var n={id:e};t.name&&(n.name=t.name),t.description&&(n.description=t.description),t.config?n.config=t.config:t.file&&(n.config=_.readFileSync(t.file,"utf-8")),void 0!==n.config&&(n.validateConfig=!1!==t.validate),t.lastCommitId&&(n.lastCommitId=t.lastCommitId);var r=yield a.updateApplication(n);t.json?(0,k.yd)({action:"application.update",target:N(r,e),result:{lastCommitId:t.lastCommitId||null},json:!0}):(i.succeed(`Application updated: ${x.Ay.green(r.name)}`),r.has_unreleased_changes&&console.log(x.Ay.yellow("Note: Application has unreleased changes")))}catch(a){t.json?(0,F.OW)(a.message,{action:"application.update",target:{id:e}}):i.fail(`Failed to update application: ${a.message}`),process.exit(1)}}),function(e,t){return l.apply(this,arguments)})),O.command("short-edit <id>").description("Short edit application properties").requiredOption("-l, --list <json>","Short edit list as JSON array").action((d=b(function*(e,t){var a=(0,A.o)(),i=(0,w.default)("Applying short edit...").start();try{var n=JSON.parse(t.list);Array.isArray(n)||(i.fail("List must be a JSON array"),process.exit(1));var r=yield a.shortEditApplication({id:e,list:n});i.succeed(`Short edit applied to: ${x.Ay.green(r.name)}`)}catch(e){i.fail(`Failed to apply short edit: ${e.message}`),process.exit(1)}}),function(e,t){return d.apply(this,arguments)})),O.command("short-refs <id>").description("List short edit references for an application").option("-k, --keyword <keyword>","Filter by shortId or title").option("-t, --types <types>","Comma-separated shortId prefixes to include (e.g. B,C,S)").option("-j, --json","Output as JSON").action((u=b(function*(e,t){var a=(0,A.o)(),i=(0,w.default)("Fetching short edit references...").start();try{var n=yield a.application({id:e});if(i.stop(),!n?.short_edit?.enabled)return void console.log(x.Ay.yellow("Short Edit is not enabled for this application"));var r=t.types?t.types.split(",").map(e=>e.trim()).filter(Boolean):[],o=(0,E.V)(n.short_edit.ref_map,{keyword:t.keyword,types:r});if(t.json)return void console.log(JSON.stringify(o,null,2));if(0===o.length)return void console.log(x.Ay.yellow("No short edit references found"));console.log(x.Ay.bold(`
|
|
31
31
|
Short Edit References: ${n.name}`)),o.forEach(e=>{console.log(x.Ay.cyan(`
|
|
32
|
-
${e.label} (${e.prefix}_)`)),e.refs.forEach(({shortId:e,ref:t})=>{var a=t?.title?x.Ay.gray(`- ${t.title}`):"";console.log(` ${x.Ay.green(e)} ${a}`)})}),console.log()}catch(e){i.fail(`Failed to fetch short edit references: ${e.message}`),process.exit(1)}}),function(e,t){return u.apply(this,arguments)})),O.command("bind <id>").description("Bind devices to application").option("-b, --bind <devices>","Device IDs to bind (comma-separated)").option("-u, --unbind <devices>","Device IDs to unbind (comma-separated)").option("--dry-run","Validate inputs and show the binding plan without applying it").option("-j, --json","Output as JSON").action((c=b(function*(e,t){var a=(0,A.o)(),i=t.json?null:(0,w.default)("Updating device bindings...").start();try{var n=yield a.application({id:e});if(!n)throw Error("Application not found");var r=t.bind?t.bind.split(",").map(e=>e.trim()):[],o=t.unbind?t.unbind.split(",").map(e=>e.trim()):[],s={id:e};if(r.length>0&&(s.bindDevices=r),o.length>0&&(s.unbindDevices=o),t.dryRun){i&&i.stop(),(0,k.S5)({action:"application.bind",target:N(n,e),request:{bindDevices:r,unbindDevices:o},checks:[(0,k.Iy)("application exists",!0,`${n.name} (${n._id})`),(0,k.Iy)("device changes provided",r.length+o.length>0,`bind=${r.length}, unbind=${o.length}`)],json:t.json});return}yield a.bindApplication(s),t.json?(0,k.yd)({action:"application.bind",target:N(n,e),result:{bindDevices:r,unbindDevices:o},json:!0}):i.succeed("Device bindings updated")}catch(a){t.json?(0,F.OW)(a.message,{action:"application.bind",target:{id:e}}):i.fail(`Failed to update bindings: ${a.message}`),process.exit(1)}}),function(e,t){return c.apply(this,arguments)})),O.command("remove <id>").description("Remove an application").option("--dry-run","Validate the target and show the removal plan without deleting it").option("-j, --json","Output as JSON").action((m=b(function*(e,t){var a=(0,A.o)(),i=t.json?null:(0,w.default)("Removing application...").start();try{var n=yield a.application({id:e});if(!n)throw Error("Application not found");var r=N(n,e);if(t.dryRun){i&&i.stop(),(0,k.S5)({action:"application.remove",target:r,request:{id:e},checks:[(0,k.Iy)("application exists",!0,`${r.name} (${r.id})`)],json:t.json});return}var o=yield a.removeApplication({id:e});t.json?(0,k.yd)({action:"application.remove",target:r,result:{removed:!!o},json:!0}):i.succeed(`Application removed: ${x.Ay.green(r.name)}`)}catch(a){t.json?(0,F.OW)(a.message,{action:"application.remove",target:{id:e}}):i.fail(`Failed to remove application: ${a.message}`),process.exit(1)}}),function(e,t){return m.apply(this,arguments)})),O.command("trigger <id> <testId>").description("Trigger automation test on application").option("--play","Play the test",!0).option("--stop","Stop the test").option("--setup-at-launch","Setup to run at app launch").option("-g, --match-group <group>","Match group").action((f=b(function*(e,t,a){var i=(0,A.o)(),n=(0,w.default)("Triggering automation...").start();try{yield i.triggerApplicationCanvasControl({id:e,testId:t,play:!a.stop&&a.play,setupAtLaunch:a.setupAtLaunch,matchGroup:a.matchGroup}),n.succeed(`Automation triggered: ${x.Ay.green(t)}`)}catch(e){n.fail(`Failed to trigger automation: ${e.message}`),process.exit(1)}}),function(e,t,a){return f.apply(this,arguments)})),O.command("release <id>").description("Release application to BRICKS platform").requiredOption("-c, --config <path|json>","Application config file path or JSON string").option("-n, --name <name>","Update application name as part of the release").option("--version <version>","Version name").option("--changelogs <text>","Release changelogs").option("--dry-run","Validate inputs and show the release plan without publishing").option("-j, --json","Output as JSON").action((h=b(function*(e,t){var a=(0,A.o)(),i=t.json?null:(0,w.default)("Releasing application...").start();try{var n=(0,S.Ku)(t.config),r=n.config,o=n.source,s=n.sizeBytes,p=yield a.application({id:e});if(!p)throw Error("Application not found");if(p.lock?.enabled)throw Error("Application is locked");var l=t.version||t.name||p.name||"Untitled",d=(0,S.w9)(t.changelogs);if(t.dryRun){i&&i.stop(),(0,k.S5)({action:"application.release",target:N(p,e),request:{name:t.name||null,version:l,changelogs:t.changelogs||null,configSource:o,configSizeBytes:s},checks:[(0,k.Iy)("application exists",!0,`${p.name} (${p._id})`),(0,k.Iy)("application is unlocked",!p.lock?.enabled),(0,k.Iy)("release config loaded",!0,`${s} bytes`)],json:t.json});return}var u=yield a.releaseApplication({id:e,config:r,...t.name?{name:t.name}:{},releaseCurrentVersion:l,releaseCurrentVersionNote:d});t.json?(0,k.yd)({action:"application.release",target:N(u||p,e),result:{name:t.name||null,version:l,configSource:o,configSizeBytes:s},json:!0}):i.succeed(`Application released: ${x.Ay.green(u?.name||p.name)}`)}catch(a){t.json?(0,F.OW)(a.message,{action:"application.release",target:{id:e}}):i.fail(`Failed to release application: ${a.message}`),process.exit(1)}}),function(e,t){return h.apply(this,arguments)})),O.command("project-pull <id>").description("Pull application source files from BRICKS platform").option("-j, --json","Output as JSON (for programmatic use)").action((v=b(function*(e,t){var a=(0,A.o)(),i=t.json?null:(0,w.default)("Pulling application project...").start();try{var n=yield a.applicationProject({id:e,buildApplicationOnly:!0});n||(i?i.fail("Application project not found"):console.error(JSON.stringify({error:"Application project not found"})),process.exit(1)),t.json?console.log(JSON.stringify(n)):(i.succeed(`Application project fetched: ${x.Ay.green(n.files?.length||0)} files`),console.log(JSON.stringify(n,null,2)))}catch(e){t.json?console.error(JSON.stringify({error:e.message})):i.fail(`Failed to pull application project: ${e.message}`),process.exit(1)}}),function(e,t){return v.apply(this,arguments)})),O.command("check-config <path>").description("Validate application config against BRICKS schema").option("-j, --json","Output as JSON").option("--validate-automation","Also validate automation_map and test_map references (skips commented/unfinished steps)").action((g=b(function*(e,t){_.existsSync(e)||(console.error(x.Ay.red(`Config file not found: ${e}`)),process.exit(1));var i=(0,w.default)("Validating config...").start();try{var n=_.readFileSync(e,"utf-8"),r=JSON.parse(n),o=yield Promise.all([a.e(587),a.e(10),a.e(511)]).then(a.t.bind(a,38890,19)),s=o.checkConfig,p=o.checkConfigDeprecatedFeatures,l=s(r,{checkAutomation:!!t.validateAutomation,checkCalc:!0}),d=p(r);if(i.stop(),t.json){console.log(JSON.stringify({...l,deprecations:d},null,2)),l.valid||process.exit(1);return}if(l.valid&&0===d.length)return void console.log(x.Ay.green("✓ Config is valid"));console.log(x.Ay.bold("\nConfig Validation Report")),console.log("─".repeat(60)),l.schema.length>0&&(console.log(x.Ay.red(`
|
|
32
|
+
${e.label} (${e.prefix}_)`)),e.refs.forEach(({shortId:e,ref:t})=>{var a=t?.title?x.Ay.gray(`- ${t.title}`):"";console.log(` ${x.Ay.green(e)} ${a}`)})}),console.log()}catch(e){i.fail(`Failed to fetch short edit references: ${e.message}`),process.exit(1)}}),function(e,t){return u.apply(this,arguments)})),O.command("bind <id>").description("Bind devices to application").option("-b, --bind <devices>","Device IDs to bind (comma-separated)").option("-u, --unbind <devices>","Device IDs to unbind (comma-separated)").option("--dry-run","Validate inputs and show the binding plan without applying it").option("-j, --json","Output as JSON").action((c=b(function*(e,t){var a=(0,A.o)(),i=t.json?null:(0,w.default)("Updating device bindings...").start();try{var n=yield a.application({id:e});if(!n)throw Error("Application not found");var r=t.bind?t.bind.split(",").map(e=>e.trim()):[],o=t.unbind?t.unbind.split(",").map(e=>e.trim()):[],s={id:e};if(r.length>0&&(s.bindDevices=r),o.length>0&&(s.unbindDevices=o),t.dryRun){i&&i.stop(),(0,k.S5)({action:"application.bind",target:N(n,e),request:{bindDevices:r,unbindDevices:o},checks:[(0,k.Iy)("application exists",!0,`${n.name} (${n._id})`),(0,k.Iy)("device changes provided",r.length+o.length>0,`bind=${r.length}, unbind=${o.length}`)],json:t.json});return}yield a.bindApplication(s),t.json?(0,k.yd)({action:"application.bind",target:N(n,e),result:{bindDevices:r,unbindDevices:o},json:!0}):i.succeed("Device bindings updated")}catch(a){t.json?(0,F.OW)(a.message,{action:"application.bind",target:{id:e}}):i.fail(`Failed to update bindings: ${a.message}`),process.exit(1)}}),function(e,t){return c.apply(this,arguments)})),O.command("remove <id>").description("Remove an application").option("--dry-run","Validate the target and show the removal plan without deleting it").option("-j, --json","Output as JSON").action((m=b(function*(e,t){var a=(0,A.o)(),i=t.json?null:(0,w.default)("Removing application...").start();try{var n=yield a.application({id:e});if(!n)throw Error("Application not found");var r=N(n,e);if(t.dryRun){i&&i.stop(),(0,k.S5)({action:"application.remove",target:r,request:{id:e},checks:[(0,k.Iy)("application exists",!0,`${r.name} (${r.id})`)],json:t.json});return}var o=yield a.removeApplication({id:e});t.json?(0,k.yd)({action:"application.remove",target:r,result:{removed:!!o},json:!0}):i.succeed(`Application removed: ${x.Ay.green(r.name)}`)}catch(a){t.json?(0,F.OW)(a.message,{action:"application.remove",target:{id:e}}):i.fail(`Failed to remove application: ${a.message}`),process.exit(1)}}),function(e,t){return m.apply(this,arguments)})),O.command("trigger <id> <testId>").description("Trigger automation test on application").option("--play","Play the test",!0).option("--stop","Stop the test").option("--setup-at-launch","Setup to run at app launch").option("-g, --match-group <group>","Match group").action((f=b(function*(e,t,a){var i=(0,A.o)(),n=(0,w.default)("Triggering automation...").start();try{yield i.triggerApplicationCanvasControl({id:e,testId:t,play:!a.stop&&a.play,setupAtLaunch:a.setupAtLaunch,matchGroup:a.matchGroup}),n.succeed(`Automation triggered: ${x.Ay.green(t)}`)}catch(e){n.fail(`Failed to trigger automation: ${e.message}`),process.exit(1)}}),function(e,t,a){return f.apply(this,arguments)})),O.command("release <id>").description("Release application to BRICKS platform").requiredOption("-c, --config <path|json>","Application config file path or JSON string").option("-n, --name <name>","Update application name as part of the release").option("--version <version>","Version name").option("--changelogs <text>","Release changelogs").option("--dry-run","Validate inputs and show the release plan without publishing").option("-j, --json","Output as JSON").action((h=b(function*(e,t){var a=(0,A.o)(),i=t.json?null:(0,w.default)("Releasing application...").start();try{var n=(0,S.Ku)(t.config),r=n.config,o=n.source,s=n.sizeBytes,p=yield a.application({id:e});if(!p)throw Error("Application not found");if(p.lock?.enabled)throw Error("Application is locked");var l=t.version||t.name||p.name||"Untitled",d=(0,S.w9)(t.changelogs);if(t.dryRun){i&&i.stop(),(0,k.S5)({action:"application.release",target:N(p,e),request:{name:t.name||null,version:l,changelogs:t.changelogs||null,configSource:o,configSizeBytes:s},checks:[(0,k.Iy)("application exists",!0,`${p.name} (${p._id})`),(0,k.Iy)("application is unlocked",!p.lock?.enabled),(0,k.Iy)("release config loaded",!0,`${s} bytes`)],json:t.json});return}var u=yield a.releaseApplication({id:e,config:r,...t.name?{name:t.name}:{},releaseCurrentVersion:l,releaseCurrentVersionNote:d});t.json?(0,k.yd)({action:"application.release",target:N(u||p,e),result:{name:t.name||null,version:l,configSource:o,configSizeBytes:s},json:!0}):i.succeed(`Application released: ${x.Ay.green(u?.name||p.name)}`)}catch(a){t.json?(0,F.OW)(a.message,{action:"application.release",target:{id:e}}):i.fail(`Failed to release application: ${a.message}`),process.exit(1)}}),function(e,t){return h.apply(this,arguments)})),O.command("project-pull <id>").description("Pull application source files from BRICKS platform").option("-j, --json","Output as JSON (for programmatic use)").action((v=b(function*(e,t){var a=(0,A.o)(),i=t.json?null:(0,w.default)("Pulling application project...").start();try{var n=yield a.applicationProject({id:e,buildApplicationOnly:!0});n||(i?i.fail("Application project not found"):console.error(JSON.stringify({error:"Application project not found"})),process.exit(1)),t.json?console.log(JSON.stringify(n)):(i.succeed(`Application project fetched: ${x.Ay.green(n.files?.length||0)} files`),console.log(JSON.stringify(n,null,2)))}catch(e){t.json?console.error(JSON.stringify({error:e.message})):i.fail(`Failed to pull application project: ${e.message}`),process.exit(1)}}),function(e,t){return v.apply(this,arguments)})),O.command("check-config <path>").description("Validate application config against BRICKS schema").option("-j, --json","Output as JSON").option("--validate-automation","Also validate automation_map and test_map references (skips commented/unfinished steps)").option("--no-validate-expressions","Skip validating PROPERTY_BANK_EXPRESSION strings against the runtime expression rules").action((g=b(function*(e,t){_.existsSync(e)||(console.error(x.Ay.red(`Config file not found: ${e}`)),process.exit(1));var i=(0,w.default)("Validating config...").start();try{var n=_.readFileSync(e,"utf-8"),r=JSON.parse(n),o=yield Promise.all([a.e(587),a.e(341),a.e(10),a.e(511)]).then(a.t.bind(a,38890,19)),s=o.checkConfig,p=o.checkConfigDeprecatedFeatures,l=s(r,{checkAutomation:!!t.validateAutomation,checkCalc:!0,checkExpressions:!1!==t.validateExpressions}),d=p(r);if(i.stop(),t.json){console.log(JSON.stringify({...l,deprecations:d},null,2)),l.valid||process.exit(1);return}if(l.valid&&0===d.length)return void console.log(x.Ay.green("✓ Config is valid"));console.log(x.Ay.bold("\nConfig Validation Report")),console.log("─".repeat(60)),l.schema.length>0&&(console.log(x.Ay.red(`
|
|
33
33
|
Schema Errors (${l.schema.length})
|
|
34
34
|
`)),l.schema.forEach((e,t)=>{var a=e.instancePath||e.dataPath||"/";console.log(` ${x.Ay.red(`${t+1}.`)} ${x.Ay.bold(a)}`),console.log(` ${e.message}`),e.params?.pattern&&console.log(` ${x.Ay.gray(`pattern: ${e.params.pattern}`)}`)})),l.ref.length>0&&(console.log(x.Ay.red(`
|
|
35
35
|
Reference Errors (${l.ref.length})
|
|
36
36
|
`)),l.ref.forEach((e,t)=>{console.log(` ${x.Ay.red(`${t+1}.`)} ${x.Ay.bold(e.field)}`),console.log(` ${e.message}`)})),l.calc.length>0&&(console.log(x.Ay.red(`
|
|
37
37
|
Data Calculation Errors (${l.calc.length})
|
|
38
|
-
`)),l.calc.forEach((e,t)=>{console.log(` ${x.Ay.red(`${t+1}.`)} ${x.Ay.bold(e.field)}`),console.log(` ${e.message}`)})),
|
|
38
|
+
`)),l.calc.forEach((e,t)=>{console.log(` ${x.Ay.red(`${t+1}.`)} ${x.Ay.bold(e.field)}`),console.log(` ${e.message}`)})),l.expression?.length>0&&(console.log(x.Ay.red(`
|
|
39
|
+
Expression Errors (${l.expression.length})
|
|
40
|
+
`)),l.expression.forEach((e,t)=>{console.log(` ${x.Ay.red(`${t+1}.`)} ${x.Ay.bold(e.field)}`),console.log(` ${e.message}`)})),d.length>0&&(console.log(x.Ay.yellow(`
|
|
39
41
|
Deprecation Warnings (${d.length})
|
|
40
|
-
`)),d.forEach((e,t)=>{console.log(` ${x.Ay.yellow(`${t+1}.`)} ${x.Ay.bold(e.id)}`),console.log(` ${e.data}`)})),console.log("\n"+"─".repeat(60));var u=l.schema.length+l.ref.length+l.calc.length;l.valid?console.log(x.Ay.yellow(`⚠ ${d.length} warning(s)`)):console.log(x.Ay.red(`✗ ${u} error(s)`)+(d.length>0?x.Ay.yellow(`, ${d.length} warning(s)`):"")),l.valid||process.exit(1)}catch(e){i.fail(`Failed to validate config: ${e.message}`),process.exit(1)}}),function(e,t){return g.apply(this,arguments)})),O.command("ctor-init <id>").alias("project-init").description("Initialize a BRICKS Project from an application").option("-o, --output <dir>","Output directory (default: current directory)").option("--github-actions","Include GitHub Actions workflow (default: true)").option("--no-github-actions","Skip GitHub Actions workflow setup").option("--agents","Include AGENTS.md (default: true)").option("--no-agents","Skip AGENTS.md setup").option("--claude","Include CLAUDE.md (default: true)").option("--no-claude","Skip CLAUDE.md setup").option("--gemini","Include GEMINI.md (default: false)").option("--no-gemini","Skip GEMINI.md setup").option("--install","Run bun install after generation (default: true)").option("--no-install","Skip bun install after generation").option("--git","Initialize git repository (default: true)").option("--no-git","Skip git initialization").option("-y, --yes","Skip prompts and use defaults/flags").option("-j, --json","Output as JSON (for programmatic use)").action((y=b(function*(e,t){var i=(yield a.e(602).then(a.bind(a,6553))).initProject;yield i("application",e,t)}),function(e,t){return y.apply(this,arguments)}))},55614(e,t,i){i.d(t,{s:()=>D});var n,r,o,s,p,l=i(99436),d=i(35679),u=i(73284),c=i(30155);let m=a("readline");var f=i(47988),h=i(85382),v=i(7586),g=e=>!!e&&"object"==typeof e&&!Array.isArray(e),y=(e={})=>{var t=g(e)?e:{},a=t.plan,i=g(a)?a:{},n=g(t.lock)?t.lock:{},r="string"==typeof a?a:i.type;return{...t,plan:{...i,type:r||"free"},lock:{...n,features:!!n.features}}},b=(n=l(function*(){var e=(0,f.getCurrentProfile)(),t=(0,f.getCurrentProfileSource)(),a=(0,f.getTokenInfo)(e),i=(0,f.getBaseUrl)();if(!a?.token)return{ok:!1,profile:e,profileSource:t,baseUrl:i,auth:{available:!1,source:"missing",workspaceId:null,workspaceName:null,createdAt:null,tokenPreview:null},workspace:null,error:null};try{var n=(0,h.createClient)(i,a.token),r=yield n.workspace();return{ok:!0,profile:e,profileSource:t,baseUrl:i,auth:{available:!0,source:"config",workspaceId:r?._id||a.workspaceId||null,workspaceName:r?.name||a.workspaceName||null,createdAt:a.createdAt||null,tokenPreview:(0,v.$l)(a.token)},workspace:r?{_id:r._id,name:r.name,description:r.description||null}:null,error:null}}catch(n){return{ok:!1,profile:e,profileSource:t,baseUrl:i,auth:{available:!0,source:"config",workspaceId:a.workspaceId||null,workspaceName:a.workspaceName||null,createdAt:a.createdAt||null,tokenPreview:(0,v.$l)(a.token)},workspace:null,error:{message:n.message}}}}),function(){return n.apply(this,arguments)}),D=new d.uB("auth").description("Authentication and token management");D.command("login").description("Login with a one-time passcode from BRICKS Controller (recommended)").argument("[passcode]","One-time passcode from BRICKS Controller").option("-p, --profile <profile>","Profile name to save the token").option("-n, --name <name>","Profile display name").action((r=l(function*(e,t){var a,i=t.profile||(0,f.getCurrentProfile)(),n=t.name,r=e;!r&&(console.log(u.Ay.cyan("Generate a one-time passcode from BRICKS Controller:")),console.log(u.Ay.gray(" 1. Open the link below (or select your workspace first)")),console.log(` ${u.Ay.underline.blue("https://control.bricks.tools/#/?action=manage-tokens")}`),console.log(u.Ay.gray(' 2. Click "Generate OTP" to create a one-time passcode\n')),(r=yield(a=m.createInterface({input:process.stdin,output:process.stdout}),new Promise(e=>{a.question("Enter passcode: ",t=>{a.close(),e(t.trim())})})))||(console.log(u.Ay.red("Passcode is required")),process.exit(1)));var o=(0,c.default)("Validating passcode...").start();try{var s=(0,h.createPublicClient)((0,f.getBaseUrl)()),p=yield s.checkWorkspaceOTP(r);p.valid||(o.fail(`Invalid passcode: ${p.error||"Unknown error"}`),process.exit(1)),o.text=`Exchanging passcode for token (workspace: ${p.workspaceName})...`;var l=yield s.exchangeWorkspaceOTP(r);l.token||(o.fail("Failed to obtain token"),process.exit(1));var d=(0,h.createClient)((0,f.getBaseUrl)(),l.token),v=yield d.workspace();v||(o.fail("Token validation failed"),process.exit(1)),(0,f.setToken)(i,{token:l.token,name:n||v.name,workspaceId:v._id,workspaceName:v.name,workspaceBilling:y(v.billing)}),(0,f.setCurrentProfile)(i),o.succeed(`Logged in to workspace: ${u.Ay.green(v.name)} (profile: ${u.Ay.cyan(i)})`)}catch(e){o.fail(`Login failed: ${e.message}`),process.exit(1)}}),function(e,t){return r.apply(this,arguments)})),D.command("login-token").description("Login with a workspace token directly").option("-t, --token <token>","Workspace token").option("-p, --profile <profile>","Profile name to save the token").option("-n, --name <name>","Profile display name").action((o=l(function*(e){var t=e.profile||(0,f.getCurrentProfile)(),a=e.token,i=e.name;a||(console.error(u.Ay.red("Error: Token is required. Use -t or --token to provide it.")),console.log(u.Ay.gray("\nYou can get a workspace token from BRICKS Controller:")+u.Ay.underline.blue("https://control.bricks.tools/#/?action=manage-tokens")),console.log(` ${u.Ay.underline.blue("https://control.bricks.tools/#/?action=manage-tokens")}`),console.log(u.Ay.gray("Select your workspace and create a new token.\n")),console.log(u.Ay.yellow("Tip: Use `bricks auth login` for a simpler OTP-based login.")),process.exit(1));var n=(0,c.default)("Validating token...").start();try{var r=(0,h.createClient)((0,f.getBaseUrl)(),a),o=yield r.workspace();o||(n.fail("Invalid token or unable to access workspace"),process.exit(1)),(0,f.setToken)(t,{token:a,name:i||o.name,workspaceId:o._id,workspaceName:o.name,workspaceBilling:y(o.billing)}),(0,f.setCurrentProfile)(t),n.succeed(`Logged in to workspace: ${u.Ay.green(o.name)} (profile: ${u.Ay.cyan(t)})`)}catch(e){n.fail(`Login failed: ${e.message}`),process.exit(1)}}),function(e){return o.apply(this,arguments)})),D.command("logout").description("Remove saved token").option("-p, --profile <profile>","Profile to remove").option("-a, --all","Remove all profiles").action((s=l(function*(e){var t=e.profile;if(e.all){(0,f.listProfiles)().forEach(e=>(0,f.removeToken)(e.name)),console.log(u.Ay.green("All profiles removed"));return}var a=t||(0,f.getCurrentProfile)();(0,f.getTokenInfo)(a)?((0,f.removeToken)(a),console.log(u.Ay.green(`Logged out from profile: ${a}`))):console.log(u.Ay.yellow(`No token found for profile: ${a}`))}),function(e){return s.apply(this,arguments)})),D.command("status").description("Show current authentication status").option("-j, --json","Output as JSON").action((p=l(function*(e){var t=(0,f.getCurrentProfile)(),a=(0,f.getTokenInfo)(t);if(!a)return e.json?void(0,v.GF)((yield b())):(console.log(u.Ay.yellow("Not logged in")),void console.log(u.Ay.gray("Use `bricks auth login` to login")));if(e.json)return void(0,v.GF)((yield b()));var i=(0,c.default)("Checking connection...").start();try{var n=(0,h.createClient)((0,f.getBaseUrl)(),a.token),r=yield n.workspace();i.stop(),console.log(u.Ay.bold("\nAuthentication Status")),console.log("─".repeat(40)),console.log(`Profile: ${u.Ay.cyan(t)}`),console.log(`Workspace: ${u.Ay.green(r.name)}`),console.log(`Workspace ID: ${u.Ay.gray(r._id)}`);var o=(0,f.getBaseUrl)(),s=a.baseUrl;console.log(`Base URL: ${u.Ay.gray(o)}${s?"":u.Ay.gray(" (global)")}`),console.log(`Logged in: ${u.Ay.gray(a.createdAt)}`),console.log("─".repeat(40))}catch(e){i.fail(`Connection failed: ${e.message}`)}}),function(e){return p.apply(this,arguments)})),D.command("list").description("List all saved profiles").action(()=>{var e=(0,f.listProfiles)();if(0===e.length){console.log(u.Ay.yellow("No saved profiles")),console.log(u.Ay.gray("Use `bricks auth login` to login"));return}console.log(u.Ay.bold("\nSaved Profiles")),console.log("─".repeat(60)),e.forEach(e=>{var t=e.current?u.Ay.green("● "):" ",a=e.current?u.Ay.green(e.name):e.name,i=e.baseUrl?u.Ay.gray(` [${e.baseUrl}]`):"";console.log(`${t}${a.padEnd(15)} ${u.Ay.gray(e.workspaceName||"Unknown")}${i}`)}),console.log("─".repeat(60))}),D.command("use <profile>").description("Switch to a different profile").action(e=>{var t=(0,f.getTokenInfo)(e);if(!t){console.log(u.Ay.red(`Profile not found: ${e}`)),console.log(u.Ay.gray("Use `bricks auth list` to see available profiles"));return}(0,f.setCurrentProfile)(e),console.log(u.Ay.green(`Switched to profile: ${e}`)),t.workspaceName&&console.log(u.Ay.gray(`Workspace: ${t.workspaceName}`))}),D.command("set-url <url>").description("Set the base URL for the current profile").option("-g, --global","Set the global base URL instead of per-profile").action((e,t)=>{if(t.global)(0,f.setBaseUrl)(e),console.log(u.Ay.green(`Global base URL set to: ${e}`));else{var a=(0,f.getCurrentProfile)();(0,f.setBaseUrl)(e,a),console.log(u.Ay.green(`Base URL for profile ${u.Ay.cyan(a)} set to: ${e}`))}})},59845(e,t,a){a.d(t,{Q:()=>I});var i,n,r,o,s,p,l,d,u,c,m,f=a(99436),h=a(35679),v=a(73284),g=a(77598),y=a(48161),b=a(76760),D=a(51455),x=a(27549),w=a(41314),_=8089,E=(i=f(function*(e,t,a=3e3){var i;try{var n=new AbortController;i=setTimeout(()=>n.abort(),a);var r=yield fetch(`http://${e}:${t}/buttress/info`,{signal:n.signal});if(!r.ok)return null;return yield r.json()}catch{return null}finally{void 0!==i&&clearTimeout(i)}}),function(e,t){return i.apply(this,arguments)}),F=b.join(y.homedir(),".bricks-cli","buttress"),A=e=>b.join(e||F,"state.json"),C=()=>{try{return`buttress-${x.machineIdSync()}`}catch{return null}},S=(n=f(function*(e){var t=A(e);try{var a=yield D.readFile(t,"utf8");return JSON.parse(a)}catch(e){if("ENOENT"===e.code)return null;throw e}}),function(e){return n.apply(this,arguments)}),T=(r=f(function*(e,t){var a=t||F,i=A(t);yield D.mkdir(a,{recursive:!0});var n=`${i}.tmp-${process.pid}`;return yield D.writeFile(n,JSON.stringify(e,null,2),"utf8"),yield D.rename(n,i),i}),function(e,t){return r.apply(this,arguments)}),k=(o=f(function*(e){var t=A(e);try{return yield D.unlink(t),!0}catch(e){if("ENOENT"===e.code)return!1;throw e}}),function(e){return o.apply(this,arguments)}),N=(s=f(function*({timeout:e=3e3,verify:t=!0,port:a=_,onStatus:i}={}){i?.(`Scanning UDP ${a} for ${e}ms...`);var n,r=yield(({timeout:e=3e3,idleTimeout:t=0,port:a=_}={})=>new Promise((i,n)=>{var r=new Map,o=w.createSocket("udp4"),s=null,p=null,l=!1,d=()=>{if(!l){l=!0,clearTimeout(s),clearTimeout(p);try{o.close()}catch{}i([...r.values()])}};o.on("error",e=>{if(!l){l=!0,clearTimeout(s),clearTimeout(p);try{o.close()}catch{}n(e)}}),o.on("message",(e,a)=>{try{var i=JSON.parse(e.toString());if("2.0"!==i.v||"ANNOUNCE"!==i.t&&"RESPONSE"!==i.t)return;var n=i.d?.info;if(!n)return;var o={...n,address:a.address},s=o.id||`${a.address}:${o.port}`;r.has(s)||(r.set(s,o),t&&!l&&(clearTimeout(p),p=setTimeout(d,t)))}catch{}}),o.bind(()=>{o.setBroadcast(!0);var t=Buffer.from(JSON.stringify({t:"QUERY",v:"2.0",d:{id:`cli-${Math.random().toString(36).slice(2,9)}`}}));for(var i of(()=>{var e=new Set(["255.255.255.255","127.0.0.1"]);for(var t of Object.values(y.networkInterfaces()))for(var a of t)if(function(){if("IPv4"!==a.family||a.internal)return 1;var t=a.address.split(".").map(Number),i=a.netmask.split(".").map(Number),n=t.map((e,t)=>(e|255&~i[t]).toString()).join(".");e.add(n)}())continue;return[...e]})())o.send(t,0,t.length,a,i);s=setTimeout(d,e)})}))({timeout:e,port:a});return 0===r.length?[]:t?(i?.(`Verifying ${r.length} server(s)...`),yield Promise.all(r.map((n=f(function*(e){var t=yield E(e.address,e.port,2e3);return t?{...e,...t,address:e.address,verified:!0}:{...e,verified:!1}}),function(e){return n.apply(this,arguments)})))):r}),function(){return s.apply(this,arguments)}),O=(p=f(function*(){var e=yield Promise.resolve().then(a.bind(a,47988)),t=e.getToken,i=e.getBaseUrl,n=e.getCurrentProfile,r=(yield Promise.resolve().then(a.bind(a,85382))).createClient,o=t(n());return o||(console.error(v.Ay.red("Not logged in. Use `bricks auth login` first.")),process.exit(1)),r(i(),o)}),function(){return p.apply(this,arguments)}),I=new h.uB("buttress").description("Pair and inspect buttress-server bindings for the current workspace").alias("butr");I.command("bind").description("Pair a local buttress-server with the current workspace").option("-s, --server-id <id>","Buttress server id (auto-detected from machine id by default)").option("-n, --name <name>","Friendly name for this buttress server").option("--state-dir <dir>","Override the buttress state directory (defaults to ~/.bricks-cli/buttress)").option("--print","Print state.json to stdout instead of writing to disk (useful for remote setups)").action((l=f(function*(e){var t,i,n,r,o,s,p=(yield Promise.resolve().then(a.bind(a,30155))).default,l=e.serverId||C();l||(console.error(v.Ay.red("Could not detect a local server id. Pass --server-id <id> explicitly.")),process.exit(1));var d=(i=(t=g.generateKeyPairSync("ed25519")).publicKey,n=t.privateKey,r=i.export({type:"spki",format:"der"}),o=n.export({type:"pkcs8",format:"der"}),s=g.createHash("sha256").update(r).digest("hex").slice(0,16),{publicKeySpki:r.toString("base64"),privateKeyPkcs8:o.toString("base64"),kid:s}),u=yield O(),c=p(`Binding buttress server ${v.Ay.cyan(l)}...`).start();try{var m=yield u.bindButtressServer({serverId:l,name:e.name,serverPublicKey:{spkiBase64:d.publicKeySpki,kid:d.kid}});c.stop();var f={workspace:{id:m.workspaceId,name:m.workspaceName,serverId:m.serverId,issuerPublicKey:m.issuerPublicKey.pem,kid:m.issuerPublicKey.kid,boundAt:new Date().toISOString()},serverKeyPair:d};if(e.print){console.warn(v.Ay.yellow("⚠ Output contains the server announce private key. Treat as a secret.")),process.stdout.write(`${JSON.stringify(f,null,2)}
|
|
42
|
+
`)),d.forEach((e,t)=>{console.log(` ${x.Ay.yellow(`${t+1}.`)} ${x.Ay.bold(e.id)}`),console.log(` ${e.data}`)})),console.log("\n"+"─".repeat(60));var u=l.schema.length+l.ref.length+l.calc.length+(l.expression?.length||0);l.valid?console.log(x.Ay.yellow(`⚠ ${d.length} warning(s)`)):console.log(x.Ay.red(`✗ ${u} error(s)`)+(d.length>0?x.Ay.yellow(`, ${d.length} warning(s)`):"")),l.valid||process.exit(1)}catch(e){i.fail(`Failed to validate config: ${e.message}`),process.exit(1)}}),function(e,t){return g.apply(this,arguments)})),O.command("ctor-init <id>").alias("project-init").description("Initialize a BRICKS Project from an application").option("-o, --output <dir>","Output directory (default: current directory)").option("--github-actions","Include GitHub Actions workflow (default: true)").option("--no-github-actions","Skip GitHub Actions workflow setup").option("--agents","Include AGENTS.md (default: true)").option("--no-agents","Skip AGENTS.md setup").option("--claude","Include CLAUDE.md (default: true)").option("--no-claude","Skip CLAUDE.md setup").option("--gemini","Include GEMINI.md (default: false)").option("--no-gemini","Skip GEMINI.md setup").option("--install","Run bun install after generation (default: true)").option("--no-install","Skip bun install after generation").option("--git","Initialize git repository (default: true)").option("--no-git","Skip git initialization").option("-y, --yes","Skip prompts and use defaults/flags").option("-j, --json","Output as JSON (for programmatic use)").action((y=b(function*(e,t){var i=(yield a.e(602).then(a.bind(a,6553))).initProject;yield i("application",e,t)}),function(e,t){return y.apply(this,arguments)}))},55614(e,t,i){i.d(t,{s:()=>D});var n,r,o,s,p,l=i(99436),d=i(35679),u=i(73284),c=i(30155);let m=a("readline");var f=i(47988),h=i(85382),v=i(7586),g=e=>!!e&&"object"==typeof e&&!Array.isArray(e),y=(e={})=>{var t=g(e)?e:{},a=t.plan,i=g(a)?a:{},n=g(t.lock)?t.lock:{},r="string"==typeof a?a:i.type;return{...t,plan:{...i,type:r||"free"},lock:{...n,features:!!n.features}}},b=(n=l(function*(){var e=(0,f.getCurrentProfile)(),t=(0,f.getCurrentProfileSource)(),a=(0,f.getTokenInfo)(e),i=(0,f.getBaseUrl)();if(!a?.token)return{ok:!1,profile:e,profileSource:t,baseUrl:i,auth:{available:!1,source:"missing",workspaceId:null,workspaceName:null,createdAt:null,tokenPreview:null},workspace:null,error:null};try{var n=(0,h.createClient)(i,a.token),r=yield n.workspace();return{ok:!0,profile:e,profileSource:t,baseUrl:i,auth:{available:!0,source:"config",workspaceId:r?._id||a.workspaceId||null,workspaceName:r?.name||a.workspaceName||null,createdAt:a.createdAt||null,tokenPreview:(0,v.$l)(a.token)},workspace:r?{_id:r._id,name:r.name,description:r.description||null}:null,error:null}}catch(n){return{ok:!1,profile:e,profileSource:t,baseUrl:i,auth:{available:!0,source:"config",workspaceId:a.workspaceId||null,workspaceName:a.workspaceName||null,createdAt:a.createdAt||null,tokenPreview:(0,v.$l)(a.token)},workspace:null,error:{message:n.message}}}}),function(){return n.apply(this,arguments)}),D=new d.uB("auth").description("Authentication and token management");D.command("login").description("Login with a one-time passcode from BRICKS Controller (recommended)").argument("[passcode]","One-time passcode from BRICKS Controller").option("-p, --profile <profile>","Profile name to save the token").option("-n, --name <name>","Profile display name").action((r=l(function*(e,t){var a,i=t.profile||(0,f.getCurrentProfile)(),n=t.name,r=e;!r&&(console.log(u.Ay.cyan("Generate a one-time passcode from BRICKS Controller:")),console.log(u.Ay.gray(" 1. Open the link below (or select your workspace first)")),console.log(` ${u.Ay.underline.blue("https://control.bricks.tools/#/?action=manage-tokens")}`),console.log(u.Ay.gray(' 2. Click "Generate OTP" to create a one-time passcode\n')),(r=yield(a=m.createInterface({input:process.stdin,output:process.stdout}),new Promise(e=>{a.question("Enter passcode: ",t=>{a.close(),e(t.trim())})})))||(console.log(u.Ay.red("Passcode is required")),process.exit(1)));var o=(0,c.default)("Validating passcode...").start();try{var s=(0,h.createPublicClient)((0,f.getBaseUrl)()),p=yield s.checkWorkspaceOTP(r);p.valid||(o.fail(`Invalid passcode: ${p.error||"Unknown error"}`),process.exit(1)),o.text=`Exchanging passcode for token (workspace: ${p.workspaceName})...`;var l=yield s.exchangeWorkspaceOTP(r);l.token||(o.fail("Failed to obtain token"),process.exit(1));var d=(0,h.createClient)((0,f.getBaseUrl)(),l.token),v=yield d.workspace();v||(o.fail("Token validation failed"),process.exit(1)),(0,f.setToken)(i,{token:l.token,name:n||v.name,workspaceId:v._id,workspaceName:v.name,workspaceBilling:y(v.billing)}),(0,f.setCurrentProfile)(i),o.succeed(`Logged in to workspace: ${u.Ay.green(v.name)} (profile: ${u.Ay.cyan(i)})`)}catch(e){o.fail(`Login failed: ${e.message}`),process.exit(1)}}),function(e,t){return r.apply(this,arguments)})),D.command("login-token").description("Login with a workspace token directly").option("-t, --token <token>","Workspace token").option("-p, --profile <profile>","Profile name to save the token").option("-n, --name <name>","Profile display name").action((o=l(function*(e){var t=e.profile||(0,f.getCurrentProfile)(),a=e.token,i=e.name;a||(console.error(u.Ay.red("Error: Token is required. Use -t or --token to provide it.")),console.log(u.Ay.gray("\nYou can get a workspace token from BRICKS Controller:")+u.Ay.underline.blue("https://control.bricks.tools/#/?action=manage-tokens")),console.log(` ${u.Ay.underline.blue("https://control.bricks.tools/#/?action=manage-tokens")}`),console.log(u.Ay.gray("Select your workspace and create a new token.\n")),console.log(u.Ay.yellow("Tip: Use `bricks auth login` for a simpler OTP-based login.")),process.exit(1));var n=(0,c.default)("Validating token...").start();try{var r=(0,h.createClient)((0,f.getBaseUrl)(),a),o=yield r.workspace();o||(n.fail("Invalid token or unable to access workspace"),process.exit(1)),(0,f.setToken)(t,{token:a,name:i||o.name,workspaceId:o._id,workspaceName:o.name,workspaceBilling:y(o.billing)}),(0,f.setCurrentProfile)(t),n.succeed(`Logged in to workspace: ${u.Ay.green(o.name)} (profile: ${u.Ay.cyan(t)})`)}catch(e){n.fail(`Login failed: ${e.message}`),process.exit(1)}}),function(e){return o.apply(this,arguments)})),D.command("logout").description("Remove saved token").option("-p, --profile <profile>","Profile to remove").option("-a, --all","Remove all profiles").action((s=l(function*(e){var t=e.profile;if(e.all){(0,f.listProfiles)().forEach(e=>(0,f.removeToken)(e.name)),console.log(u.Ay.green("All profiles removed"));return}var a=t||(0,f.getCurrentProfile)();(0,f.getTokenInfo)(a)?((0,f.removeToken)(a),console.log(u.Ay.green(`Logged out from profile: ${a}`))):console.log(u.Ay.yellow(`No token found for profile: ${a}`))}),function(e){return s.apply(this,arguments)})),D.command("status").description("Show current authentication status").option("-j, --json","Output as JSON").action((p=l(function*(e){var t=(0,f.getCurrentProfile)(),a=(0,f.getTokenInfo)(t);if(!a)return e.json?void(0,v.GF)((yield b())):(console.log(u.Ay.yellow("Not logged in")),void console.log(u.Ay.gray("Use `bricks auth login` to login")));if(e.json)return void(0,v.GF)((yield b()));var i=(0,c.default)("Checking connection...").start();try{var n=(0,h.createClient)((0,f.getBaseUrl)(),a.token),r=yield n.workspace();i.stop(),console.log(u.Ay.bold("\nAuthentication Status")),console.log("─".repeat(40)),console.log(`Profile: ${u.Ay.cyan(t)}`),console.log(`Workspace: ${u.Ay.green(r.name)}`),console.log(`Workspace ID: ${u.Ay.gray(r._id)}`);var o=(0,f.getBaseUrl)(),s=a.baseUrl;console.log(`Base URL: ${u.Ay.gray(o)}${s?"":u.Ay.gray(" (global)")}`),console.log(`Logged in: ${u.Ay.gray(a.createdAt)}`),console.log("─".repeat(40))}catch(e){i.fail(`Connection failed: ${e.message}`)}}),function(e){return p.apply(this,arguments)})),D.command("list").description("List all saved profiles").action(()=>{var e=(0,f.listProfiles)();if(0===e.length){console.log(u.Ay.yellow("No saved profiles")),console.log(u.Ay.gray("Use `bricks auth login` to login"));return}console.log(u.Ay.bold("\nSaved Profiles")),console.log("─".repeat(60)),e.forEach(e=>{var t=e.current?u.Ay.green("● "):" ",a=e.current?u.Ay.green(e.name):e.name,i=e.baseUrl?u.Ay.gray(` [${e.baseUrl}]`):"";console.log(`${t}${a.padEnd(15)} ${u.Ay.gray(e.workspaceName||"Unknown")}${i}`)}),console.log("─".repeat(60))}),D.command("use <profile>").description("Switch to a different profile").action(e=>{var t=(0,f.getTokenInfo)(e);if(!t){console.log(u.Ay.red(`Profile not found: ${e}`)),console.log(u.Ay.gray("Use `bricks auth list` to see available profiles"));return}(0,f.setCurrentProfile)(e),console.log(u.Ay.green(`Switched to profile: ${e}`)),t.workspaceName&&console.log(u.Ay.gray(`Workspace: ${t.workspaceName}`))}),D.command("set-url <url>").description("Set the base URL for the current profile").option("-g, --global","Set the global base URL instead of per-profile").action((e,t)=>{if(t.global)(0,f.setBaseUrl)(e),console.log(u.Ay.green(`Global base URL set to: ${e}`));else{var a=(0,f.getCurrentProfile)();(0,f.setBaseUrl)(e,a),console.log(u.Ay.green(`Base URL for profile ${u.Ay.cyan(a)} set to: ${e}`))}})},59845(e,t,a){a.d(t,{Q:()=>I});var i,n,r,o,s,p,l,d,u,c,m,f=a(99436),h=a(35679),v=a(73284),g=a(77598),y=a(48161),b=a(76760),D=a(51455),x=a(27549),w=a(41314),_=8089,E=(i=f(function*(e,t,a=3e3){var i;try{var n=new AbortController;i=setTimeout(()=>n.abort(),a);var r=yield fetch(`http://${e}:${t}/buttress/info`,{signal:n.signal});if(!r.ok)return null;return yield r.json()}catch{return null}finally{void 0!==i&&clearTimeout(i)}}),function(e,t){return i.apply(this,arguments)}),F=b.join(y.homedir(),".bricks-cli","buttress"),A=e=>b.join(e||F,"state.json"),C=()=>{try{return`buttress-${x.machineIdSync()}`}catch{return null}},S=(n=f(function*(e){var t=A(e);try{var a=yield D.readFile(t,"utf8");return JSON.parse(a)}catch(e){if("ENOENT"===e.code)return null;throw e}}),function(e){return n.apply(this,arguments)}),T=(r=f(function*(e,t){var a=t||F,i=A(t);yield D.mkdir(a,{recursive:!0});var n=`${i}.tmp-${process.pid}`;return yield D.writeFile(n,JSON.stringify(e,null,2),"utf8"),yield D.rename(n,i),i}),function(e,t){return r.apply(this,arguments)}),k=(o=f(function*(e){var t=A(e);try{return yield D.unlink(t),!0}catch(e){if("ENOENT"===e.code)return!1;throw e}}),function(e){return o.apply(this,arguments)}),N=(s=f(function*({timeout:e=3e3,verify:t=!0,port:a=_,onStatus:i}={}){i?.(`Scanning UDP ${a} for ${e}ms...`);var n,r=yield(({timeout:e=3e3,idleTimeout:t=0,port:a=_}={})=>new Promise((i,n)=>{var r=new Map,o=w.createSocket("udp4"),s=null,p=null,l=!1,d=()=>{if(!l){l=!0,clearTimeout(s),clearTimeout(p);try{o.close()}catch{}i([...r.values()])}};o.on("error",e=>{if(!l){l=!0,clearTimeout(s),clearTimeout(p);try{o.close()}catch{}n(e)}}),o.on("message",(e,a)=>{try{var i=JSON.parse(e.toString());if("2.0"!==i.v||"ANNOUNCE"!==i.t&&"RESPONSE"!==i.t)return;var n=i.d?.info;if(!n)return;var o={...n,address:a.address},s=o.id||`${a.address}:${o.port}`;r.has(s)||(r.set(s,o),t&&!l&&(clearTimeout(p),p=setTimeout(d,t)))}catch{}}),o.bind(()=>{o.setBroadcast(!0);var t=Buffer.from(JSON.stringify({t:"QUERY",v:"2.0",d:{id:`cli-${Math.random().toString(36).slice(2,9)}`}}));for(var i of(()=>{var e=new Set(["255.255.255.255","127.0.0.1"]);for(var t of Object.values(y.networkInterfaces()))for(var a of t)if(function(){if("IPv4"!==a.family||a.internal)return 1;var t=a.address.split(".").map(Number),i=a.netmask.split(".").map(Number),n=t.map((e,t)=>(e|255&~i[t]).toString()).join(".");e.add(n)}())continue;return[...e]})())o.send(t,0,t.length,a,i);s=setTimeout(d,e)})}))({timeout:e,port:a});return 0===r.length?[]:t?(i?.(`Verifying ${r.length} server(s)...`),yield Promise.all(r.map((n=f(function*(e){var t=yield E(e.address,e.port,2e3);return t?{...e,...t,address:e.address,verified:!0}:{...e,verified:!1}}),function(e){return n.apply(this,arguments)})))):r}),function(){return s.apply(this,arguments)}),O=(p=f(function*(){var e=yield Promise.resolve().then(a.bind(a,47988)),t=e.getToken,i=e.getBaseUrl,n=e.getCurrentProfile,r=(yield Promise.resolve().then(a.bind(a,85382))).createClient,o=t(n());return o||(console.error(v.Ay.red("Not logged in. Use `bricks auth login` first.")),process.exit(1)),r(i(),o)}),function(){return p.apply(this,arguments)}),I=new h.uB("buttress").description("Pair and inspect buttress-server bindings for the current workspace").alias("butr");I.command("bind").description("Pair a local buttress-server with the current workspace").option("-s, --server-id <id>","Buttress server id (auto-detected from machine id by default)").option("-n, --name <name>","Friendly name for this buttress server").option("--state-dir <dir>","Override the buttress state directory (defaults to ~/.bricks-cli/buttress)").option("--print","Print state.json to stdout instead of writing to disk (useful for remote setups)").action((l=f(function*(e){var t,i,n,r,o,s,p=(yield Promise.resolve().then(a.bind(a,30155))).default,l=e.serverId||C();l||(console.error(v.Ay.red("Could not detect a local server id. Pass --server-id <id> explicitly.")),process.exit(1));var d=(i=(t=g.generateKeyPairSync("ed25519")).publicKey,n=t.privateKey,r=i.export({type:"spki",format:"der"}),o=n.export({type:"pkcs8",format:"der"}),s=g.createHash("sha256").update(r).digest("hex").slice(0,16),{publicKeySpki:r.toString("base64"),privateKeyPkcs8:o.toString("base64"),kid:s}),u=yield O(),c=p(`Binding buttress server ${v.Ay.cyan(l)}...`).start();try{var m=yield u.bindButtressServer({serverId:l,name:e.name,serverPublicKey:{spkiBase64:d.publicKeySpki,kid:d.kid}});c.stop();var f={workspace:{id:m.workspaceId,name:m.workspaceName,serverId:m.serverId,issuerPublicKey:m.issuerPublicKey.pem,kid:m.issuerPublicKey.kid,boundAt:new Date().toISOString()},serverKeyPair:d};if(e.print){console.warn(v.Ay.yellow("⚠ Output contains the server announce private key. Treat as a secret.")),process.stdout.write(`${JSON.stringify(f,null,2)}
|
|
41
43
|
`);return}var h=yield T(f,e.stateDir);console.log(v.Ay.green("✓"),"Buttress server bound to workspace."),console.log(` Workspace: ${v.Ay.bold(m.workspaceName)} (${m.workspaceId})`),console.log(` Server id: ${v.Ay.cyan(m.serverId)}`),console.log(` Issuer kid: ${v.Ay.gray(m.issuerPublicKey.kid)}`),console.log(` Announce kid: ${v.Ay.gray(d.kid)}`),console.log(` State file: ${v.Ay.gray(h)}`),console.log(),console.log(v.Ay.yellow("Restart buttress-server for the binding to take effect."))}catch(e){c.fail(`Bind failed: ${e.message}`),process.exit(1)}}),function(e){return l.apply(this,arguments)})),I.command("unbind").description("Unbind a buttress server from this workspace").option("-s, --server-id <id>","Buttress server id (auto-detected by default)").option("--state-dir <dir>","Override the buttress state directory").option("--keep-local","Do not remove the local state.json file").action((d=f(function*(e){var t=e.serverId||C();t||(console.error(v.Ay.red("Could not detect a local server id. Pass --server-id explicitly.")),process.exit(1));var a=yield O();try{if((yield a.unbindButtressServer({serverId:t}))?console.log(v.Ay.green("✓"),`Unbound ${v.Ay.cyan(t)} from workspace.`):console.log(v.Ay.yellow("!"),`${v.Ay.cyan(t)} was not bound to this workspace.`),!e.keepLocal){var i=A(e.stateDir),n=yield S(e.stateDir);n?.workspace?.serverId===t&&(yield k(e.stateDir),console.log(v.Ay.gray(`Removed local state file: ${i}`)))}}catch(e){console.error(v.Ay.red(`Unbind failed: ${e.message}`)),process.exit(1)}}),function(e){return d.apply(this,arguments)})),I.command("status").description("Show local buttress binding state and the workspace-side bound list").option("--state-dir <dir>","Override the buttress state directory").option("-j, --json","Output as JSON").action((u=f(function*(e){var t=yield S(e.stateDir),a=null;try{var i=yield O();a=yield i.buttressServers()}catch(e){a={error:e.message}}e.json?console.log(JSON.stringify({local:t,remote:a},null,2)):(console.log(v.Ay.bold("\nLocal buttress state")),console.log("─".repeat(60)),t?.workspace?(console.log(` Workspace: ${v.Ay.bold(t.workspace.name)} (${t.workspace.id})`),console.log(` Server id: ${v.Ay.cyan(t.workspace.serverId)}`),console.log(` Issuer kid: ${v.Ay.gray(t.workspace.kid)}`),console.log(` Bound at: ${v.Ay.gray(t.workspace.boundAt)}`),console.log(` File: ${v.Ay.gray(A(e.stateDir))}`)):console.log(v.Ay.gray(" not bound (no state.json found)")),console.log(v.Ay.bold("\nWorkspace-side bound servers")),console.log("─".repeat(60)),Array.isArray(a)?0===a.length?console.log(v.Ay.gray(" none")):a.forEach(e=>{console.log(` ${v.Ay.cyan(e.serverId)} ${v.Ay.gray(e.name||"")} ${v.Ay.gray(e.boundAt||"")}`)}):a?.error&&console.log(v.Ay.red(` failed to fetch: ${a.error}`)))}),function(e){return u.apply(this,arguments)})),I.command("issue-token").description("Issue a long-lived workspace-scoped buttress access token (CLI/CTOR usage)").option("--ttl <seconds>","Time-to-live in seconds (default 30 days)",e=>parseInt(e,10)).option("-j, --json","Output as JSON").action((c=f(function*(e){var t=yield O();try{var a=yield t.issueButtressAccessToken({ttlSeconds:e.ttl});if(e.json)return void console.log(JSON.stringify(a,null,2));console.log(v.Ay.green("✓"),"Buttress access token issued."),console.log(` Workspace: ${a.workspaceId}`),console.log(` Expires: ${a.expiresAt}`),console.log(` jti: ${v.Ay.gray(a.jti)}`),console.log(),console.log(v.Ay.cyan(a.token))}catch(e){console.error(v.Ay.red(`Issue token failed: ${e.message}`)),process.exit(1)}}),function(e){return c.apply(this,arguments)})),I.command("scan").description("Scan LAN for buttress-servers via UDP and verify each via /buttress/info").option("-t, --timeout <ms>","Scan timeout in milliseconds","3000").option("-p, --port <port>","UDP discovery port",String(_)).option("--udp-only","Skip HTTP /buttress/info verification").option("-j, --json","Output as JSON").action((m=f(function*(e){var t=(yield Promise.resolve().then(a.bind(a,30155))).default,i=yield Promise.resolve().then(a.bind(a,47988)),n=i.getCurrentProfile,r=i.getTokenInfo,o=parseInt(e.timeout,10),s=parseInt(e.port,10),p=[],l=t(`Scanning for buttress-servers (${o}ms)...`).start();try{p=yield N({timeout:o,port:s,verify:!e.udpOnly,onStatus:e=>{l.text=e}}),l.stop()}catch(e){l.fail(`Scan failed: ${e.message}`),process.exit(1)}var d=n(),u=r(d)?.workspaceId||null;if(e.json)return void console.log(JSON.stringify({servers:p,workspaceId:u},null,2));if(0===p.length)return void console.log(v.Ay.yellow("No buttress-servers found on the LAN."));for(var c of(console.log(v.Ay.bold(`
|
|
42
44
|
Found ${p.length} buttress-server(s)`)),console.log("─".repeat(70)),p)){var m=!1===c.verified?v.Ay.red("unverified"):v.Ay.green("online"),f=c.workspace?.id,h=f&&u&&f===u,g=c.authentication?.bound?v.Ay.yellow("JWT required"):v.Ay.gray("open");console.log(` ${v.Ay.bold(c.name||"Unknown")} ${v.Ay.gray(`(${c.address}:${c.port})`)} [${m}]`),c.id&&console.log(` Server id: ${v.Ay.cyan(c.id)}`),c.version&&console.log(` Version: ${v.Ay.green(c.version)}`);var y=c.authentication?.kid?v.Ay.gray(` (kid: ${c.authentication.kid})`):"";if(console.log(` Auth: ${g}${y}`),f){var b=h?v.Ay.green(`${f} ${v.Ay.bold("(current profile)")}`):v.Ay.gray(f);console.log(` Workspace: ${b}`)}if(Array.isArray(c.generators)&&c.generators.length>0)for(var D of(console.log(" Generators:"),c.generators)){var x=[];"number"==typeof D.score&&x.push(`score ${D.score.toFixed(1)}`),!0===D.hasGpu?x.push("GPU ✓"):!1===D.hasGpu&&x.push("GPU ✗"),"number"==typeof D.usableBytes&&x.push(`${(D.usableBytes/0x40000000).toFixed(1)} GB usable`);var w=x.length>0?` ${v.Ay.gray(x.join(" "))}`:"";console.log(` - ${v.Ay.cyan(D.type)}${w}`)}}console.log("─".repeat(70)),p.some(e=>e.authentication?.bound)&&(console.log(),console.log(v.Ay.gray("To connect to a bound server, run `bricks buttress issue-token` for a workspace access token.")))}),function(e){return m.apply(this,arguments)}))},71335(e,t,a){a.d(t,{oT:()=>d});var i=a(35679),n=a(73284),r=a(47988),o={prod:"https://display.bricks.tools",beta:"https://display-beta.bricks.tools",dev:"http://localhost:3001"},s=e=>{var t=Object.entries(o).find(([,t])=>e===t);return t?t[0]:null},p={prod:"https://activity-log.bricks.tools",beta:"https://activity-log-beta.bricks.tools",dev:"http://localhost:8088"},l=e=>{var t=Object.entries(p).find(([,t])=>e===t);return t?t[0]:null},d=new i.uB("config").description("CLI configuration management");d.command("endpoint").argument("[environment]","Environment to use (prod, beta, dev)").description("Show or set endpoint environment").option("-p, --profile","Set for current profile instead of global").action((e,t)=>{if(!e){var a=(0,r.getBaseUrl)(),i=s(a),d=(0,r.getActivityLogBaseUrl)(),u=l(d);console.log(n.Ay.bold("\nEndpoint Configuration")),console.log("─".repeat(50)),console.log(n.Ay.bold("BRICKS")),console.log(` URL: ${n.Ay.cyan(a)}`),console.log(` Environment: ${i?n.Ay.green(i):n.Ay.yellow("custom")}`),console.log(n.Ay.bold("Activity Log")),console.log(` URL: ${n.Ay.cyan(d)}`),console.log(` Environment: ${u?n.Ay.green(u):n.Ay.yellow("custom")}`),console.log("─".repeat(50)),console.log(n.Ay.gray("\nUsage: bricks config endpoint <prod|beta|dev>"));return}var c=Object.keys(o);c.includes(e)||(console.error(n.Ay.red(`Invalid environment: ${e}`)),console.log(n.Ay.gray(`Valid options: ${c.join(", ")}`)),process.exit(1));var m=o[e],f=p[e],h=t.profile?(0,r.getCurrentProfile)():null;(0,r.setBaseUrl)(m,h),(0,r.setActivityLogBaseUrl)(f,h);var v=t.profile?` (profile: ${(0,r.getCurrentProfile)()})`:"";console.log(n.Ay.green(`✓ Endpoint changed to ${e}${v}`)),console.log(n.Ay.gray(` BRICKS: ${m}`)),console.log(n.Ay.gray(` Activity Log: ${f}`)),console.log(n.Ay.yellow("\nNote: You may need to re-authenticate if your token is for a different environment.")),console.log(n.Ay.gray("Use `bricks auth status` to check your connection."))}),d.command("show").description("Show current configuration").option("-j, --json","Output as JSON").action(e=>{var t=(0,r.getBaseUrl)(),a=s(t);if(e.json)return void console.log(JSON.stringify({endpoint:t,environment:a||"custom"},null,2));console.log(n.Ay.bold("\nBRICKS CLI Configuration")),console.log("─".repeat(50)),console.log(`BRICKS: ${n.Ay.cyan(t)}`),a?console.log(`Environment: ${n.Ay.green(a)}`):console.log(`Environment: ${n.Ay.yellow("custom")}`);var i=(0,r.getActivityLogBaseUrl)(),o=l(i);console.log(`Activity Log: ${n.Ay.cyan(i)} ${o?n.Ay.green(`(${o})`):n.Ay.yellow("(custom)")}`),console.log("─".repeat(50))})},23699(e,t,a){a.d(t,{E:()=>W});var i,n,r,o,s,p,l,d,u,c,m,f,h,v,g,y,b,D=a(68832),x=a(99436),w=a(79896),_=a(35679),E=a(73284),F=a(30155),A=a(88958),C=a(7586),S=a(56493),T=a(8479),k=a(47988),N=a(85382),O=["InSubspace","Global"],I={"https://display.bricks.tools":"https://bank.bricks.tools","https://display-beta.bricks.tools":"https://bank-beta.bricks.tools"},$=e=>{if(e&&!O.includes(e))throw Error(`Invalid meta "${e}" (expected ${O.join(" | ")})`)},j=`
|
|
43
45
|
propertyId
|
|
@@ -101,7 +103,7 @@ ${b.Ay.gray("Press Ctrl+C to stop")}`)}catch(e){console.error(b.Ay.red(`Error: $
|
|
|
101
103
|
Found ${p.length} DevTools server(s)`)),console.log("─".repeat(80));var c=function*(e){var t=!1===e.verified?R.Ay.red("unverified"):R.Ay.green("online"),a=H(e),i=K(a),n=(e.protocols||[]).map(e=>R.Ay.cyan(e)).join(", "),r=e.workspaceId&&u&&e.workspaceId===u,o=e.addresses||[e.address],s=o.filter(t=>t!==e.address),p=s.length>0?`${e.address}:${e.port} +${s.length} more`:`${e.address}:${e.port}`;if(console.log(` ${R.Ay.bold(e.name||"Unknown")} ${R.Ay.gray(`(${p})`)} [${t}]`),s.length>0&&console.log(` Addresses: ${o.map(e=>R.Ay.gray(e)).join(", ")}`),e.version&&console.log(` Version: ${R.Ay.green(e.version)}`),e.chromeInspect){var l=e.passcode?R.Ay.cyan(e.passcode):R.Ay.gray("no passcode");console.log(` Chrome Inspect: ${R.Ay.green("supported")} (passcode: ${l})`)}var d=` Protocols: ${n||R.Ay.gray("none")} Auth: ${i}`;if(e.deviceId&&(d+=` Device: ${R.Ay.gray(e.deviceId)}`),console.log(d),e.workspaceId){var c=r?R.Ay.green(`${e.workspaceId} (current profile)`):R.Ay.gray(e.workspaceId);console.log(` Workspace: ${c}`)}};for(var m of p)yield*c(m);console.log("─".repeat(80));var f=p[0],h=`${f.address}:${f.port||19851}`,v=H(f),g=f.passcode?`/ws/${encodeURIComponent(f.passcode)}`:"workspace-jwt"===v?"/ws/<workspace-token>":"/ws/<passcode>";console.log(R.Ay.gray(`
|
|
102
104
|
Connect via: http://${h}/devtools-frontend/inspector.html?ws=${h}${g}`)),console.log(R.Ay.gray(`Legacy: devtools://devtools/bundled/inspector.html?ws=${h}${g}`)),process.exit(0)}catch(e){s.fail(`Scan failed: ${e.message}`),process.exit(1)}}),function(e){return l.apply(this,arguments)})),Z.command("open <address>").description("Show DevTools server information").option("-p, --port <port>",`Server port (default: ${Y})`).option("--info","Show connection URLs").action((d=j(function*(e,t){var i=(yield Promise.resolve().then(a.bind(a,30155))).default,n=(yield Promise.resolve().then(a.bind(a,75646))).verifyDevToolsServer,r=Q(e),o=r.host??J,s=parseInt(t.port??r.port??Y,10),p=`${o}:${s}`,l=i(`Fetching server info from ${p}...`).start(),d=yield n(o,s);d||(l.fail(`Could not reach DevTools server at ${p}`),process.exit(1)),l.stop();var u=yield M(o,s),c=u?U(u?.[0]?.webSocketDebuggerUrl):null,m=H(d),f=c?`/ws/${encodeURIComponent(c)}`:"workspace-jwt"===m?"/ws/<workspace-token>":"/ws/<passcode>";if(t.info){console.log(R.Ay.bold("Connection URLs")),console.log("─".repeat(60)),console.log(` Web UI: ${R.Ay.cyan(`http://${p}`)}`),console.log(` CDP: ${R.Ay.cyan(`http://${p}/devtools-frontend/inspector.html?ws=${p}${f}`)}`),console.log(` CDP legacy: ${R.Ay.cyan(`devtools://devtools/bundled/inspector.html?ws=${p}${f}`)}`),console.log(` MCP: ${R.Ay.cyan(`http://${p}/mcp`)}`),console.log(` MCP SSE: ${R.Ay.cyan(`http://${p}/sse`)}`),console.log(` Info: ${R.Ay.cyan(`http://${p}/devtools/info`)}`),console.log("─".repeat(60)),console.log(),console.log(R.Ay.bold("Authorization")),d.auth?.workspaceJwt?.enabled&&console.log(` Workspace JWT: ${R.Ay.green("enabled")} (kid: ${d.auth.workspaceJwt.kid})`),c&&console.log(` Passcode: ${R.Ay.cyan(c)}`),console.log(" MCP and MCP SSE require a Bearer token header:"),console.log(` ${R.Ay.gray(`Authorization: Bearer ${d.auth?.workspaceJwt?.enabled?"<workspace-token>":c||"<passcode>"}`)}`);return}if(console.log(R.Ay.bold("DevTools Server")),console.log("─".repeat(60)),console.log(` Name: ${R.Ay.cyan(d.name||"Unknown")}`),console.log(` Version: ${d.version?R.Ay.green(d.version):R.Ay.gray("N/A")}`),console.log(` Device ID: ${R.Ay.gray(d.deviceId||"N/A")}`),console.log(` Workspace: ${R.Ay.gray(d.workspaceId||"N/A")}`),console.log(` Protocols: ${(d.protocols||[]).map(e=>R.Ay.cyan(e)).join(", ")||R.Ay.gray("none")}`),console.log(` Auth: ${K(m)}`),console.log(` Port: ${d.port}`),u){var h=c?R.Ay.cyan(c):R.Ay.gray("no passcode");console.log(` Inspect: ${R.Ay.green("chrome://inspect supported")} (passcode: ${h})`)}else console.log(` Inspect: ${R.Ay.gray("chrome://inspect not available")}`);console.log("─".repeat(60)),d.version&&!W(d.version)&&console.log(R.Ay.yellow(`
|
|
103
105
|
CDP commands require version >= ${z}`)),console.log(R.Ay.gray(`
|
|
104
|
-
Use --info to see connection URLs`))}),function(e,t){return d.apply(this,arguments)})),ee(Z.command("screenshot").description("Capture device screenshot").option("-o, --output <path>","Output file path")).action((u=j(function*(e){var t;yield et(e,(t=j(function*(t){var i=yield t.send("Page.captureScreenshot",{format:"png"});i.data||(console.error(R.Ay.red("No screenshot data received")),process.exit(1));var n=yield Promise.resolve().then(a.t.bind(a,73024,19)),r=yield Promise.resolve().then(a.t.bind(a,76760,19)),o=e.output||`screenshot-${Date.now()}.png`,s=r.resolve(o);n.writeFileSync(s,Buffer.from(i.data,"base64")),console.log(R.Ay.green(`Screenshot saved to ${s}`))}),function(e){return t.apply(this,arguments)}))}),function(e){return u.apply(this,arguments)}));var er=Z.command("brick").description("Brick component inspection");ee(er.command("tree").description("Print brick component tree").option("-d, --depth <depth>","Max depth (-1 for full)","3")).action((c=j(function*(e){var t;yield et(e,(t=j(function*(t){yield t.send("DOM.enable");var a=parseInt(e.depth,10),i=(yield t.send("DOM.getDocument",{depth:a})).root;e.json?console.log(JSON.stringify(i,null,2)):console.log(en(i).join("\n"))}),function(e){return t.apply(this,arguments)}))}),function(e){return c.apply(this,arguments)})),ee(er.command("query <selector>").description("Find brick by CSS selector")).action((m=j(function*(e,t){var a;yield et(t,(a=j(function*(a){yield a.send("DOM.enable");var i=(yield a.send("DOM.getDocument",{depth:0})).root,n=(yield a.send("DOM.querySelector",{nodeId:i.nodeId,selector:e})).nodeId;if(0===n)return void console.log(R.Ay.yellow("No element found"));var r=yield a.send("DOM.describeNode",{nodeId:n}),o=ea((yield a.send("DOM.getAttributes",{nodeId:n})).attributes);if(t.json)return void console.log(JSON.stringify({nodeId:n,...r.node,attributes:o},null,2));if(console.log(R.Ay.bold(`Node ${n}: ${r.node?.nodeName||"unknown"}`)),Object.keys(o).length>0)for(var s of(console.log(R.Ay.bold("Attributes:")),Object.entries(o))){var p=$(s,2),l=p[0],d=p[1];console.log(` ${R.Ay.cyan(l)}: ${d}`)}}),function(e){return a.apply(this,arguments)}))}),function(e,t){return m.apply(this,arguments)})),ee(er.command("query-all <selector>").description("Find all bricks matching CSS selector")).action((f=j(function*(e,t){var a;yield et(t,(a=j(function*(a){yield a.send("DOM.enable");var i=(yield a.send("DOM.getDocument",{depth:0})).root,n=(yield a.send("DOM.querySelectorAll",{nodeId:i.nodeId,selector:e})).nodeIds;if(t.json)return void console.log(JSON.stringify({nodeIds:n,count:n.length},null,2));for(var r of(console.log(R.Ay.bold(`Found ${n.length} element(s)`)),n)){var o=yield a.send("DOM.describeNode",{nodeId:r}),s=ea((yield a.send("DOM.getAttributes",{nodeId:r})).attributes),p=s.id||s["short-id"]||"";console.log(` ${r}: ${o.node?.nodeName}${p?R.Ay.gray(`#${p}`):""}`)}}),function(e){return a.apply(this,arguments)}))}),function(e,t){return f.apply(this,arguments)})),ee(er.command("attributes <nodeId>").description("Get brick attributes")).action((h=j(function*(e,t){var a;yield et(t,(a=j(function*(a){yield a.send("DOM.enable");var i=parseInt(e,10),n=ea((yield a.send("DOM.getAttributes",{nodeId:i})).attributes);if(t.json)return void console.log(JSON.stringify(n,null,2));if(0===Object.keys(n).length)return void console.log(R.Ay.gray("No attributes"));for(var r of Object.entries(n)){var o=$(r,2),s=o[0],p=o[1];console.log(` ${R.Ay.cyan(s)}: ${p}`)}}),function(e){return a.apply(this,arguments)}))}),function(e,t){return h.apply(this,arguments)})),ee(er.command("box-model <nodeId>").description("Get brick dimensions and position")).action((v=j(function*(e,t){var a;yield et(t,(a=j(function*(a){yield a.send("DOM.enable");var i=parseInt(e,10),n=(yield a.send("DOM.getBoxModel",{nodeId:i})).model;t.json?console.log(JSON.stringify(n,null,2)):(console.log(R.Ay.bold(`Box Model for node ${i}`)),console.log(` Width: ${n.width}`),console.log(` Height: ${n.height}`),n.content&&console.log(` Content: [${n.content.join(", ")}]`),n.padding&&console.log(` Padding: [${n.padding.join(", ")}]`),n.border&&console.log(` Border: [${n.border.join(", ")}]`),n.margin&&console.log(` Margin: [${n.margin.join(", ")}]`))}),function(e){return a.apply(this,arguments)}))}),function(e,t){return v.apply(this,arguments)})),ee(er.command("resolve <nodeId>").description("Resolve brick to JavaScript object with properties")).action((g=j(function*(e,t){var a;yield et(t,(a=j(function*(a){yield a.send("DOM.enable");var i=parseInt(e,10),n=(yield a.send("DOM.resolveNode",{nodeId:i})).object;if(t.json)return void console.log(JSON.stringify(n,null,2));if(console.log(R.Ay.bold(`Resolved node ${i}`)),console.log(` Type: ${n.type}`),n.className&&console.log(` Class: ${n.className}`),n.description&&console.log(` Description: ${n.description}`),n.objectId&&console.log(` Object ID: ${R.Ay.gray(n.objectId)}`),n.preview?.properties)for(var r of(console.log(R.Ay.bold(" Properties:")),n.preview.properties))console.log(` ${R.Ay.cyan(r.name)}: ${r.value}`)}),function(e){return a.apply(this,arguments)}))}),function(e,t){return g.apply(this,arguments)})),ee(er.command("focus <nodeId>").description("Focus a brick element")).action((y=j(function*(e,t){var a;yield et(t,(a=j(function*(t){yield t.send("DOM.enable");var a=parseInt(e,10);yield t.send("DOM.focus",{nodeId:a}),console.log(R.Ay.green(`Focused node ${a}`))}),function(e){return a.apply(this,arguments)}))}),function(e,t){return y.apply(this,arguments)}));var eo=Z.command("input").description("Input emulation");ee(eo.command("tap <x> <y>").description("Tap/click at coordinates")).action((b=j(function*(e,t,a){var i;yield et(a,(i=j(function*(i){var n=parseFloat(e),r=parseFloat(t),o=yield i.send("Input.dispatchMouseEvent",{type:"mousePressed",x:n,y:r,button:"left",clickCount:1});yield i.send("Input.dispatchMouseEvent",{type:"mouseReleased",x:n,y:r,button:"left",clickCount:1}),(({x:e,y:t,tapResult:a,json:i})=>{if(i)return console.log(JSON.stringify({x:e,y:t,...a||{}},null,2));console.log(R.Ay.green(`Tapped at (${e}, ${t})`));var n=ei(a?.element||a?.tappedElement||a?.hitElement);if(!n)return console.log(R.Ay.yellow(" Element: none"));console.log(` Element: ${n}`);var r=a?.hitElement,o=a?.tappedElement;if(r&&o&&r.nodeId!==o.nodeId){var s=ei(r);s&&console.log(` Hit: ${s}`)}a&&!1===a.dispatched&&console.log(R.Ay.yellow(" Action: no pressable handler"))})({x:n,y:r,tapResult:o,json:a.json})}),function(e){return i.apply(this,arguments)}))}),function(e,t,a){return b.apply(this,arguments)})),ee(eo.command("type <text>").description("Insert text into focused element")).action((D=j(function*(e,t){var a;yield et(t,(a=j(function*(t){yield t.send("Input.insertText",{text:e}),console.log(R.Ay.green(`Typed: ${e}`))}),function(e){return a.apply(this,arguments)}))}),function(e,t){return D.apply(this,arguments)})),ee(eo.command("key <key>").description("Dispatch key event (e.g., Enter, Escape, Tab)")).action((x=j(function*(e,t){var a;yield et(t,(a=j(function*(t){yield t.send("Input.dispatchKeyEvent",{type:"keyDown",key:e}),yield t.send("Input.dispatchKeyEvent",{type:"keyUp",key:e}),console.log(R.Ay.green(`Key: ${e}`))}),function(e){return a.apply(this,arguments)}))}),function(e,t){return x.apply(this,arguments)}));var es=Z.command("network").description("Network inspection");ee(es.command("list").description("Capture snapshot of network activity").option("--duration <ms>","Capture duration in milliseconds","2000")).action((w=j(function*(e){var t;yield et(e,(t=j(function*(t){var a=new Map,i=parseInt(e.duration,10);t.on("Network.requestWillBeSent",e=>{a.set(e.requestId,{method:e.request.method,url:e.request.url,requestId:e.requestId,timestamp:e.timestamp})}),t.on("Network.responseReceived",e=>{var t=a.get(e.requestId);t&&(t.status=e.response.status,t.mimeType=e.response.mimeType)}),t.on("Network.loadingFailed",e=>{var t=a.get(e.requestId);t&&(t.error=e.errorText)}),yield t.send("Network.enable"),yield new Promise(e=>setTimeout(e,i)),yield t.send("Network.disable");var n=[...a.values()];if(e.json)return void console.log(JSON.stringify(n,null,2));if(console.log(R.Ay.bold(`Network Activity (captured ${(i/1e3).toFixed(1)}s, ${n.length} requests)`)),0===n.length)return void console.log(R.Ay.gray(" No network activity captured"));for(var r of n){var o=r.error?R.Ay.red("ERR"):r.status?r.status<300?R.Ay.green(r.status):r.status<400?R.Ay.yellow(r.status):R.Ay.red(r.status):R.Ay.gray("..."),s=r.url.length>60?r.url.substring(0,57)+"...":r.url;console.log(` ${o} ${R.Ay.bold(r.method.padEnd(6))} ${s} ${R.Ay.gray(`(${r.requestId})`)}`)}}),function(e){return t.apply(this,arguments)}))}),function(e){return w.apply(this,arguments)})),ee(es.command("get <requestId>").description("Get response body for a network request")).action((_=j(function*(e,t){var a;yield et(t,(a=j(function*(a){yield a.send("Network.enable");var i=yield a.send("Network.getResponseBody",{requestId:e}),n=i.body,r=i.base64Encoded;t.json?console.log(JSON.stringify({body:n,base64Encoded:r},null,2)):r?console.log(R.Ay.gray(`[base64 encoded, ${n.length} chars]`)):console.log(n)}),function(e){return a.apply(this,arguments)}))}),function(e,t){return _.apply(this,arguments)}));var ep="bricks://app",el="DATA-",ed="properties",eu="entries",ec=e=>{if(null==e||"object"!=typeof e)return{value:e};if("value"in e)return{value:e.value};if("unserializableValue"in e)return{value:e.unserializableValue};if(e.objectId){var t=e.preview?.properties;return Array.isArray(t)&&t.length>0?{value:t.reduce((e,t)=>(e[t.name]=t.value,e),{}),byRef:!0}:{value:e.description||`[${e.type}]`,byRef:!0}}return{value:"undefined"===e.type?void 0:e.description}},em=e=>{var t=e.startsWith(el)?e.slice(el.length):e,a=t.indexOf(":");return a<0?{shortId:t,title:null}:{shortId:t.slice(0,a),title:t.slice(a+1)}},ef=e=>{if(e.startsWith("global:"))return{scope:"global",name:e.slice(7)};if(e.startsWith("subspace:")){var t=e.slice(9),a=t.indexOf(":");return a>0?{scope:"subspace",subspaceUuid:t.slice(0,a),name:t.slice(a+1)}:{scope:"subspace",subspaceUuid:t,name:""}}return{scope:null,name:e}},eh=(E=j(function*(e){try{var t=yield e.send("Runtime.evaluate",{expression:"JSON.stringify(Object.values(system.subspaces()).map((s) => ({ shortId: s.shortId, uuid: s.uuid, title: s.title })))",objectGroup:"console",returnByValue:!0}),a=t.result;if(t.exceptionDetails||"string"!=typeof a?.value)return[];return JSON.parse(a.value)}catch{return[]}}),function(e){return E.apply(this,arguments)}),ev=(e,{full:t=!1,width:a=100}={})=>{var i="string"==typeof e?e:JSON.stringify(e);return void 0===i?R.Ay.gray("undefined"):t||i.length<=a?i:`${i.substring(0,a)}…`},eg=(e,t)=>{var a=e.subspaceUuid?t.find(t=>t.uuid===e.subspaceUuid):null;return{key:e.rawKey,scope:e.scope,...e.subspaceUuid?{subspaceUuid:e.subspaceUuid}:{},...a?.shortId?{subspaceShortId:a.shortId}:{},name:e.name,value:e.value}},ey=(F=j(function*(e,{databaseName:t,objectStoreName:a,options:i}){var n=parseInt(i.skip??"0",10)||0,r=parseInt(i.limit??"25",10)||25,o=null;try{o=(yield e.send("IndexedDB.getMetadata",{securityOrigin:ep,databaseName:t,objectStoreName:a})).entriesCount}catch{}var s=yield e.send("IndexedDB.requestData",{securityOrigin:ep,databaseName:t,objectStoreName:a,indexName:"",skipCount:n,pageSize:r,returnByValue:!0}),p=s.objectStoreDataEntries,l=s.hasMore,d=!1,u=p.map(e=>{var t=ec(e.key).value,a=ec(e.value),i=a.value;return a.byRef&&(d=!0),{key:t,value:i}});if(i.json)return void console.log(JSON.stringify({database:t,objectStore:a,skip:n,limit:r,total:o,hasMore:!!l,entries:u},null,2));var c=null==o?"":` of ${o}`,m=n>0?`, skipped ${n}`:"";for(var f of(console.log(R.Ay.bold(`${t} / ${a} (${u.length}${c} entries${m})`)),console.log("─".repeat(60)),0===u.length&&console.log(R.Ay.gray(" No entries")),u)){var h=f.key,v=f.value,g="string"==typeof h?h:JSON.stringify(h);console.log(` ${R.Ay.cyan(g)}: ${ev(v,{full:!!i.full})}`)}l&&console.log(R.Ay.gray(" …more entries available — use -l/--limit and -s/--skip")),d&&console.log(R.Ay.yellow("\n Some values came back as object handles (device app without by-value reads).\n Update the device app to see full values."))}),function(e,t){return F.apply(this,arguments)}),eb=e=>e.option("-l, --limit <count>","Max items to fetch","25").option("-s, --skip <count>","Items to skip","0").option("--full","Do not truncate values"),eD=Z.command("storage").description("Storage inspection (read-only — CDP cannot mutate device storage)");ee(eD.command("list").description("Overview of all storage stores with entry counts")).action((A=j(function*(e){var t;yield et(e,(t=j(function*(t){yield t.send("DOMStorage.enable"),yield t.send("IndexedDB.enable");var a,i=(a=j(function*(e){return(yield t.send("DOMStorage.getDOMStorageItems",{storageId:{securityOrigin:ep,isLocalStorage:e}})).entries.length}),function(e){return a.apply(this,arguments)}),n=yield i(!0),r=yield i(!1),o=(yield t.send("IndexedDB.requestDatabaseNames",{securityOrigin:ep})).databaseNames,s=[];for(var p of o){var l=p.startsWith(el)?ed:eu,d=null;try{d=(yield t.send("IndexedDB.getMetadata",{securityOrigin:ep,databaseName:p,objectStoreName:l})).entriesCount}catch{}s.push({name:p,objectStoreName:l,entriesCount:d})}var u=s.filter(e=>e.name.startsWith(el)).map(e=>({...e,...em(e.name)})),c=s.filter(e=>!e.name.startsWith(el));if(e.json)return void console.log(JSON.stringify({system:{persist:n,memory:r},dataBanks:u,caches:c},null,2));var m=e=>null==e?R.Ay.gray("? entries"):`${e} entries`;for(var f of(console.log(R.Ay.bold("Storage Overview")+R.Ay.gray(" (read-only)")),console.log("─".repeat(60)),console.log(` ${R.Ay.bold("System storage")}${R.Ay.gray(" → storage system persist|memory")}`),console.log(` persist ${m(n)}`),console.log(` memory ${m(r)}`),console.log(` ${R.Ay.bold("Data banks")}${R.Ay.gray(" → storage data-bank get <S_xxxx|title>")}`),0===u.length&&console.log(R.Ay.gray(" none")),u)){var h=f.title?` "${f.title}"`:"";console.log(` ${R.Ay.cyan(f.shortId)}${h} ${m(f.entriesCount)}`)}for(var v of(console.log(` ${R.Ay.bold("Caches")}${R.Ay.gray(" → storage cache generator|generative-media")}`),0===c.length&&console.log(R.Ay.gray(" none")),c))console.log(` ${R.Ay.cyan(v.name)} ${m(v.entriesCount)}`);console.log("─".repeat(60))}),function(e){return t.apply(this,arguments)}))}),function(e){return A.apply(this,arguments)}));var ex=eD.command("system").description("System key-value storage"),ew=e=>e.option("--scope <scope>","Filter by scope: global or a subspace S_xxxx/UUID").option("--prefix <prefix>","Filter by key-name prefix (within the scope)").option("--full","Do not truncate values"),e_=(e,t)=>{var a;return a=j(function*(a){var i;yield et(a,(i=j(function*(i){yield i.send("DOMStorage.enable");var n=(yield i.send("DOMStorage.getDOMStorageItems",{storageId:{securityOrigin:ep,isLocalStorage:e}})).entries,r=yield eh(i),o=((e,{scope:t,prefix:a,subspaceIndex:i=[]}={})=>{var n=t&&"global"!==t?i.find(e=>e.shortId===t||e.uuid===t)?.uuid||t:null;return e.map(([e,t])=>({rawKey:e,value:t,...ef(e)})).filter(e=>("global"!==t||"global"===e.scope)&&(!n||"subspace"===e.scope&&e.subspaceUuid===n)&&(!a||!!e.name.startsWith(a)))})(n,{scope:a.scope,prefix:a.prefix,subspaceIndex:r});if(a.json)return void console.log(JSON.stringify(o.map(e=>eg(e,r)),null,2));if(((e,{label:t,subspaceIndex:a,full:i})=>{if(console.log(R.Ay.bold(`${t} (${e.length} items)`)),console.log("─".repeat(60)),0===e.length)return console.log(R.Ay.gray(" No entries"));var n=null,r=function(e){var t="subspace"===e.scope?`subspace:${e.subspaceUuid}`:e.scope;if(t!==n)if(n=t,"subspace"===e.scope){var r=a.find(t=>t.uuid===e.subspaceUuid),o=r?`${r.shortId}${r.title?` "${r.title}"`:""} `:"";console.log(` ${R.Ay.bold(`subspace ${o}`)}${R.Ay.gray(`(${e.subspaceUuid})`)}`)}else console.log(` ${R.Ay.bold(e.scope||"other")}`);var s=e.name||e.rawKey;console.log(` ${R.Ay.cyan(s)}: ${ev(e.value,{full:i,width:80})}`)};for(var o of e)r(o)})(o,{label:t,subspaceIndex:r,full:!!a.full}),0===o.length&&a.scope&&"global"!==a.scope&&!r.some(e=>e.shortId===a.scope||e.uuid===a.scope)){var s=r.map(e=>e.shortId).join(", ");console.log(R.Ay.yellow(` Scope "${a.scope}" did not match a known subspace${s?` (known: ${s})`:""}`))}}),function(e){return i.apply(this,arguments)}))}),function(e){return a.apply(this,arguments)}};ew(ee(ex.command("persist").description("Show persistent system storage entries"))).action(e_(!0,"Persistent Storage")),ew(ee(ex.command("memory").description("Show in-memory system storage entries"))).action(e_(!1,"Memory Storage")),ee(ex.command("get <key>").description("Show a single system storage value (full, untruncated)").option("--scope <scope>","Key scope: global (default) or a subspace S_xxxx/UUID","global").option("--memory","Read from in-memory storage instead of persistent")).action((C=j(function*(e,t){var a;yield et(t,(a=j(function*(a){yield a.send("DOMStorage.enable");var i=(yield a.send("DOMStorage.getDOMStorageItems",{storageId:{securityOrigin:ep,isLocalStorage:!t.memory}})).entries,n=yield eh(a),r=[e];if("global"===t.scope)r.push(`global:${e}`);else{var o=n.find(e=>e.shortId===t.scope||e.uuid===t.scope)?.uuid||t.scope;r.push(`subspace:${o}:${e}`)}var s=i.map(([e,t])=>({rawKey:e,value:t,...ef(e)})).find(e=>r.includes(e.rawKey));if(!s){var p=i.map(([e])=>e).filter(t=>t.toLowerCase().includes(e.toLowerCase())).slice(0,5);if(p.length>0)for(var l of(console.error(R.Ay.yellow("Similar keys:")),p))console.error(` ${l}`);throw Error(`Key not found: ${r[r.length-1]}`)}if(t.json)return void console.log(JSON.stringify(eg(s,n),null,2));if("string"==typeof s.value)try{console.log(JSON.stringify(JSON.parse(s.value),null,2));return}catch{}console.log("string"==typeof s.value?s.value:JSON.stringify(s.value,null,2))}),function(e){return a.apply(this,arguments)}))}),function(e,t){return C.apply(this,arguments)}));var eE=eD.command("data-bank").description("Data bank (Property Bank) stores");ee(eE.command("list").description("List data banks")).action((S=j(function*(e){var t;yield et(e,(t=j(function*(t){yield t.send("IndexedDB.enable");var a=(yield t.send("IndexedDB.requestDatabaseNames",{securityOrigin:ep})).databaseNames,i=[];for(var n of a.filter(e=>e.startsWith(el))){var r=null;try{r=(yield t.send("IndexedDB.getMetadata",{securityOrigin:ep,databaseName:n,objectStoreName:ed})).entriesCount}catch{}i.push({name:n,...em(n),entriesCount:r})}if(e.json)return void console.log(JSON.stringify(i,null,2));for(var o of(console.log(R.Ay.bold(`Data Banks (${i.length})`)),console.log("─".repeat(60)),0===i.length&&console.log(R.Ay.gray(" No data banks")),i)){var s=o.title?` ${R.Ay.green(`"${o.title}"`)}`:"",p=null===o.entriesCount||void 0===o.entriesCount?"":R.Ay.gray(` ${o.entriesCount} entries`);console.log(` ${R.Ay.cyan(o.shortId)}${s}${p}`)}console.log(R.Ay.gray("\nInspect: bricks devtools storage data-bank get <S_xxxx|title>"))}),function(e){return t.apply(this,arguments)}))}),function(e){return S.apply(this,arguments)})),eb(ee(eE.command("get <bank> [store]").description(`Show data bank entries — <bank> accepts a subspace S_xxxx, a title keyword, or the full DATA-* database name; [store] defaults to "${ed}"`))).action((T=j(function*(e,t,a){var i;yield et(a,(i=j(function*(i){yield i.send("IndexedDB.enable");var n=(yield i.send("IndexedDB.requestDatabaseNames",{securityOrigin:ep})).databaseNames,r=((e,t)=>{var a=e.filter(e=>e.startsWith(el)),i=a.find(e=>e===t||e===`${el}${t}`);if(i)return{match:i};if(t.startsWith("S_")){var n=a.filter(e=>em(e).shortId===t);if(1===n.length)return{match:n[0]};if(n.length>1)return{candidates:n}}var r=t.toLowerCase(),o=a.filter(e=>e.slice(el.length).toLowerCase().includes(r));return 1===o.length?{match:o[0]}:{candidates:o}})(n,e);if(!r.match){var o=n.filter(e=>e.startsWith(el)),s=(r.candidates?.length||0)>1,p=s?r.candidates:o;for(var l of(console.error(R.Ay.yellow(s?`Data bank "${e}" is ambiguous. Candidates:`:`Data bank "${e}" not found. Available:`)),p)){var d=em(l),u=d.shortId,c=d.title;console.error(` ${u}${c?` "${c}"`:""}`)}process.exit(1)}yield ey(i,{databaseName:r.match,objectStoreName:t||ed,options:a})}),function(e){return i.apply(this,arguments)}))}),function(e,t,a){return T.apply(this,arguments)}));var eF=eD.command("cache").description("Cache stores (generator, generative-media)"),eA=e=>{var t;return t=j(function*(t){var a;yield et(t,(a=j(function*(a){yield a.send("IndexedDB.enable"),yield ey(a,{databaseName:e,objectStoreName:eu,options:t})}),function(e){return a.apply(this,arguments)}))}),function(e){return t.apply(this,arguments)}};eb(ee(eF.command("generator").description("Show generator cache entries"))).action(eA("GENERATOR_CACHE")),eb(ee(eF.command("generative-media").description("Show generative media cache entries"))).action(eA("GENERATIVE_MEDIA_CACHE")),eb(ee(eD.command("generator-cache",{hidden:!0}).description("Alias of `storage cache generator`"))).action(eA("GENERATOR_CACHE"));var eC=Z.command("runtime").description("Runtime and evaluation");ee(eC.command("eval <expression>").description("Evaluate JavaScript expression").option("--await","Await promise result")).action((k=j(function*(e,t){var a;yield et(t,(a=j(function*(a){yield a.send("Runtime.enable");var i=yield a.send("Runtime.evaluate",{expression:e,objectGroup:"console",returnByValue:!0,awaitPromise:!!t.await,generatePreview:!0});if(t.json)return void console.log(JSON.stringify(i,null,2));i.exceptionDetails&&(console.error(R.Ay.red(`Error: ${i.exceptionDetails.text}`)),i.exceptionDetails.exception?.description&&console.error(R.Ay.red(i.exceptionDetails.exception.description)),process.exit(1));var n=i.result;"undefined"===n.type?console.log(R.Ay.gray("undefined")):void 0!==n.value?console.log("object"==typeof n.value?JSON.stringify(n.value,null,2):String(n.value)):n.description?console.log(n.description):console.log(R.Ay.gray(`[${n.type}${n.subtype?`:${n.subtype}`:""}]`))}),function(e){return a.apply(this,arguments)}))}),function(e,t){return k.apply(this,arguments)})),ee(eC.command("properties <objectId>").description("Get properties of a remote object")).action((N=j(function*(e,t){var a;yield et(t,(a=j(function*(a){var i=(yield a.send("Runtime.getProperties",{objectId:e,ownProperties:!0})).result;if(t.json)return void console.log(JSON.stringify(i,null,2));for(var n of(console.log(R.Ay.bold(`Properties of ${e}`)),i))if(n.enumerable){var r=n.value,o=r?.description||r?.value?.toString()||R.Ay.gray(`[${r?.type}]`);console.log(` ${R.Ay.cyan(n.name)}: ${o}`)}}),function(e){return a.apply(this,arguments)}))}),function(e,t){return N.apply(this,arguments)}));var eS=Z.command("simulator").description("Inspect simulated peripherals (Application Simulator / web preview servers only)").command("thermal-printer").description("Simulated thermal printers and their print results"),eT="This DevTools server does not expose simulator inspection. Connect to an Application Simulator preview (e.g. the CTOR project simulator) running a preview build with the Simulator CDP domain.",ek=e=>{if(!e)return"unknown time";var t=new Date(e);return Number.isNaN(t.getTime())?"unknown time":t.toLocaleString()},eN=e=>{if(e.raw)return"raw data";var t=(e=>{if(!e?.length)return"";var t=[];for(var a of e){var i=t[t.length-1];i&&i.type===a?i.count+=1:t.push({type:a,count:1})}return t.map(({type:e,count:t})=>t>1?`${e}\xd7${t}`:e).join(", ")})(e.commandTypes);return`${e.commandCount} command(s)${t?`: ${t}`:""}`};ee(eS.command("list").description("List simulated thermal printers and their print history").option("--commands","Include full print command payloads (use with -j)")).action((O=j(function*(e){var t;yield et(e,(t=j(function*(t){var a=yield t.send("Simulator.listThermalPrinters",{includeCommands:!!e.commands}),i=a?.printers;if(Array.isArray(i)||(console.error(R.Ay.red(eT)),process.exit(1)),e.json)return void console.log(JSON.stringify(i,null,2));if(0===i.length){console.log(R.Ay.yellow("No simulated thermal printers registered.")),console.log(R.Ay.gray("A printer appears once the application configures GENERATOR_THERMAL_PRINTER."));return}for(var n of(console.log(R.Ay.bold(`Simulated Thermal Printers (${i.length})`)),console.log("─".repeat(60)),i)){var r=n.errored?R.Ay.red("fault"):n.connected?R.Ay.green("connected"):R.Ay.gray("idle");console.log(` ${R.Ay.bold(n.label||n.driver)} ${R.Ay.gray(`(${n.driver})`)} [${r}]`),console.log(` Printer ID: ${R.Ay.cyan(n.id)}`),n.connectString&&console.log(` Connect: ${R.Ay.gray(n.connectString)}`);var o=n.printHistory||[];if(0===o.length){console.log(R.Ay.gray(" No print results yet."));continue}var s="memory"===n.printHistorySource?R.Ay.gray(" (restored from memory)"):"";for(var p of(console.log(` Print results, newest first${s}:`),o))console.log(` --index ${p.index} ${ek(p.printedAt)} ${R.Ay.gray(eN(p))}`)}console.log("─".repeat(60)),console.log(R.Ay.gray("Save one as PNG: bricks devtools simulator thermal-printer print-result"))}),function(e){return t.apply(this,arguments)}))}),function(e){return O.apply(this,arguments)})),ee(eS.command("print-result").description("Render a simulated print result to a PNG image").option("--printer <id>","Printer ID (see `list`; defaults to the only registered printer)").option("-i, --index <n>","Print history index, 0 = latest","0").option("--scale <factor>","Image scale factor (1-4)","2").option("-o, --output <path>","Output file path")).action((I=j(function*(e){var t;yield et(e,(t=j(function*(t){var i=yield t.send("Simulator.captureThermalPrinterPrintResult",{id:e.printer,index:parseInt(e.index,10)||0,scale:parseFloat(e.scale)||2},3e4);i?.data||(console.error(R.Ay.red(eT)),process.exit(1));var n=yield Promise.resolve().then(a.t.bind(a,73024,19)),r=yield Promise.resolve().then(a.t.bind(a,76760,19)),o=e.output||`print-result-${Date.now()}.png`,s=r.resolve(o);(n.writeFileSync(s,Buffer.from(i.data,"base64")),e.json)?console.log(JSON.stringify({path:s,id:i.id,driver:i.driver,label:i.label,index:i.index,printedAt:i.printedAt,width:i.width,height:i.height},null,2)):(console.log(R.Ay.green(`Print result saved to ${s}`)),console.log(` Printer: ${i.label} ${R.Ay.gray(`(${i.driver}, ${i.id})`)}`),console.log(` Printed: ${ek(i.printedAt)} (--index ${i.index})`),i.width&&i.height&&console.log(` Size: ${i.width}\xd7${i.height}`))}),function(e){return t.apply(this,arguments)}))}),function(e){return I.apply(this,arguments)}))},11405(e,t,a){a.d(t,{l:()=>v});var i,n,r,o=a(99436),s=a(35679),p=a(7586),l=a(85382),d=a(8479),u=a(47988),c=(i=o(function*(){try{return yield Promise.all([a.e(587),a.e(647),a.e(10),a.e(117)]).then(a.bind(a,98372)),{available:!0}}catch(e){return{available:!1,error:e.message}}}),function(){return i.apply(this,arguments)}),m=(e,t,a)=>({severity:e,code:t,message:a}),f=(n=o(function*({version:e="2.25.0-beta.41",mcpCheck:t=c}={}){var a=(0,u.getCurrentProfile)(),i=(0,u.getCurrentProfileSource)(),n=(0,u.getTokenInfo)(a),r=(0,u.getBaseUrl)(),o=(0,u.getActivityLogBaseUrl)(),s=[],f={ok:!1,timestamp:new Date().toISOString(),cli:{name:"bricks",version:e},profile:{name:a,source:i},config:{path:u.CONFIG_PATH,baseUrl:r,activityLogBaseUrl:o},auth:{available:!!n?.token,source:n?.token?"config":"missing",workspaceId:n?.workspaceId||null,workspaceName:n?.workspaceName||null,createdAt:n?.createdAt||null,tokenPreview:(0,p.$l)(n?.token)},connectivity:{workspace:{ok:!1,skipped:!n?.token,error:null}},capabilities:{zeroArgMode:(0,d.z)()?"interactive":"help",mcp:{available:!1,error:null}},issues:s};if(n?.token)try{var h=yield(0,l.createClient)(r,n.token).workspace();f.connectivity.workspace={ok:!0,skipped:!1,error:null,id:h?._id||n.workspaceId||null,name:h?.name||n.workspaceName||null},f.auth.workspaceId=h?._id||f.auth.workspaceId,f.auth.workspaceName=h?.name||f.auth.workspaceName}catch(e){f.connectivity.workspace={ok:!1,skipped:!1,error:e.message},s.push(m("error","workspace_unreachable",`Workspace query failed for ${r}: ${e.message}`))}else s.push(m("warning","auth_missing","No saved token for the current profile."));var v=yield t();return f.capabilities.mcp={available:v.available,error:v.error||null},v.available||s.push(m("warning","mcp_unavailable",`MCP stdio server is unavailable: ${v.error||"Unknown error"}`)),f.ok=0===s.length,f}),function(){return n.apply(this,arguments)}),h=(e,t,a)=>`${e.padEnd(14)} ${t}${a?` ${a}`:""}`,v=new s.uB("doctor").description("Check CLI configuration, auth state, and workspace reachability").option("-j, --json","Output as JSON").action((r=o(function*(e){try{var t=yield f();if(e.json)return void(0,p.GF)(t);console.log((e=>{var t=[];if(t.push("BRICKS CLI Doctor"),t.push("─".repeat(60)),t.push(h("CLI","OK",`bricks v${e.cli.version}`)),t.push(h("Profile","OK",`${e.profile.name} (${e.profile.source})`)),t.push(h("BRICKS API","OK",e.config.baseUrl)),t.push(h("Activity Log","OK",e.config.activityLogBaseUrl)),e.auth.available){var a=e.auth.workspaceName||e.auth.workspaceId||"Unknown workspace";t.push(h("Auth","OK",`${a} (${e.auth.source}, ${e.auth.tokenPreview})`))}else t.push(h("Auth","WARN","No saved token for the current profile"));if(e.connectivity.workspace.skipped)t.push(h("Workspace","WARN","Skipped because no token is available"));else if(e.connectivity.workspace.ok){var i=e.connectivity.workspace.name||e.connectivity.workspace.id||"Unknown workspace";t.push(h("Workspace","OK",i))}else t.push(h("Workspace","FAIL",e.connectivity.workspace.error));return e.capabilities.mcp.available?t.push(h("MCP","OK","STDIO server import is available")):t.push(h("MCP","WARN",e.capabilities.mcp.error)),t.push(h("Zero-arg mode",((e,t=!1)=>e?"OK":t?"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&&(t.push("─".repeat(60)),t.push("Issues"),e.issues.forEach(e=>{t.push(`- [${e.severity}] ${e.message}`)})),t.join("\n")})(t))}catch(t){e.json?(0,p.OW)(t.message):console.error(`Doctor failed: ${t.message}`),process.exit(1)}}),function(e){return r.apply(this,arguments)}))},28634(e,t,a){a.d(t,{p:()=>w});var i,n,r,o,s,p,l,d=a(68832),u=a(99436),c=a(35679),m=a(73284),f=a(30155),h=a(7586),v=a(56493),g=a(68168),y=a(98593),b=e=>{if(!e)return m.Ay.gray("○");var t=Date.now()-new Date(e).getTime();return t<=3e5?m.Ay.green("●"):60>Math.floor(t/6e4)?m.Ay.yellow("○"):m.Ay.red("○")},D=(e,t)=>({id:e?._id||t,name:e?.name||"Unnamed",deviceCount:e?.devices?.length||0}),x=["refresh","clear-cache","system-menu-open","system-menu-close","system-info-open","system-info-close","local-sync-panel-open","local-sync-panel-close","debug-panel-open","debug-panel-close","logging-on","logging-off","test-panel-open","test-panel-close"],w=new c.uB("group").description("Device Group management");w.command("list").description("List all device groups").option("-j, --json","Output as JSON").action((i=u(function*(e){var t=(0,v.o)(),a=(0,f.default)("Fetching device groups...").start();try{var i=yield t.deviceGroups({});if(a.stop(),e.json)return void console.log(JSON.stringify(i,null,2));if(!i||0===i.length)return void console.log(m.Ay.yellow("No device groups found"));console.log(m.Ay.bold("\nDevice Groups")),console.log("─".repeat(80)),i.forEach(e=>{var t=e.devices?.length||0;console.log(`● ${m.Ay.cyan(e.name)} ${m.Ay.gray(`(${t} devices)`)}`),console.log(` ID: ${m.Ay.gray(e._id)}`),e.description&&console.log(` ${m.Ay.gray(e.description)}`),console.log()})}catch(e){a.fail(`Failed to list groups: ${e.message}`),process.exit(1)}}),function(e){return i.apply(this,arguments)})),w.command("get <id>").description("Get device group details").option("-j, --json","Output as JSON").action((n=u(function*(e,t){var a=(0,v.o)(),i=(0,f.default)("Fetching device group...").start();try{var n=yield a.deviceGroup({id:e});if(i.stop(),n||(console.log(m.Ay.red("Device group not found")),process.exit(1)),t.json)return void console.log(JSON.stringify(n,null,2));console.log(m.Ay.bold(`
|
|
106
|
+
Use --info to see connection URLs`))}),function(e,t){return d.apply(this,arguments)})),ee(Z.command("screenshot").description("Capture device screenshot").option("-o, --output <path>","Output file path")).action((u=j(function*(e){var t;yield et(e,(t=j(function*(t){var i=yield t.send("Page.captureScreenshot",{format:"png"});i.data||(console.error(R.Ay.red("No screenshot data received")),process.exit(1));var n=yield Promise.resolve().then(a.t.bind(a,73024,19)),r=yield Promise.resolve().then(a.t.bind(a,76760,19)),o=e.output||`screenshot-${Date.now()}.png`,s=r.resolve(o);n.writeFileSync(s,Buffer.from(i.data,"base64")),console.log(R.Ay.green(`Screenshot saved to ${s}`))}),function(e){return t.apply(this,arguments)}))}),function(e){return u.apply(this,arguments)}));var er=Z.command("brick").description("Brick component inspection");ee(er.command("tree").description("Print brick component tree").option("-d, --depth <depth>","Max depth (-1 for full)","3")).action((c=j(function*(e){var t;yield et(e,(t=j(function*(t){yield t.send("DOM.enable");var a=parseInt(e.depth,10),i=(yield t.send("DOM.getDocument",{depth:a})).root;e.json?console.log(JSON.stringify(i,null,2)):console.log(en(i).join("\n"))}),function(e){return t.apply(this,arguments)}))}),function(e){return c.apply(this,arguments)})),ee(er.command("query <selector>").description("Find brick by CSS selector")).action((m=j(function*(e,t){var a;yield et(t,(a=j(function*(a){yield a.send("DOM.enable");var i=(yield a.send("DOM.getDocument",{depth:0})).root,n=(yield a.send("DOM.querySelector",{nodeId:i.nodeId,selector:e})).nodeId;if(0===n)return void console.log(R.Ay.yellow("No element found"));var r=yield a.send("DOM.describeNode",{nodeId:n}),o=ea((yield a.send("DOM.getAttributes",{nodeId:n})).attributes);if(t.json)return void console.log(JSON.stringify({nodeId:n,...r.node,attributes:o},null,2));if(console.log(R.Ay.bold(`Node ${n}: ${r.node?.nodeName||"unknown"}`)),Object.keys(o).length>0)for(var s of(console.log(R.Ay.bold("Attributes:")),Object.entries(o))){var p=$(s,2),l=p[0],d=p[1];console.log(` ${R.Ay.cyan(l)}: ${d}`)}}),function(e){return a.apply(this,arguments)}))}),function(e,t){return m.apply(this,arguments)})),ee(er.command("query-all <selector>").description("Find all bricks matching CSS selector")).action((f=j(function*(e,t){var a;yield et(t,(a=j(function*(a){yield a.send("DOM.enable");var i=(yield a.send("DOM.getDocument",{depth:0})).root,n=(yield a.send("DOM.querySelectorAll",{nodeId:i.nodeId,selector:e})).nodeIds;if(t.json)return void console.log(JSON.stringify({nodeIds:n,count:n.length},null,2));for(var r of(console.log(R.Ay.bold(`Found ${n.length} element(s)`)),n)){var o=yield a.send("DOM.describeNode",{nodeId:r}),s=ea((yield a.send("DOM.getAttributes",{nodeId:r})).attributes),p=s.id||s["short-id"]||"";console.log(` ${r}: ${o.node?.nodeName}${p?R.Ay.gray(`#${p}`):""}`)}}),function(e){return a.apply(this,arguments)}))}),function(e,t){return f.apply(this,arguments)})),ee(er.command("attributes <nodeId>").description("Get brick attributes")).action((h=j(function*(e,t){var a;yield et(t,(a=j(function*(a){yield a.send("DOM.enable");var i=parseInt(e,10),n=ea((yield a.send("DOM.getAttributes",{nodeId:i})).attributes);if(t.json)return void console.log(JSON.stringify(n,null,2));if(0===Object.keys(n).length)return void console.log(R.Ay.gray("No attributes"));for(var r of Object.entries(n)){var o=$(r,2),s=o[0],p=o[1];console.log(` ${R.Ay.cyan(s)}: ${p}`)}}),function(e){return a.apply(this,arguments)}))}),function(e,t){return h.apply(this,arguments)})),ee(er.command("box-model <nodeId>").description("Get brick dimensions and position")).action((v=j(function*(e,t){var a;yield et(t,(a=j(function*(a){yield a.send("DOM.enable");var i=parseInt(e,10),n=(yield a.send("DOM.getBoxModel",{nodeId:i})).model;t.json?console.log(JSON.stringify(n,null,2)):(console.log(R.Ay.bold(`Box Model for node ${i}`)),console.log(` Width: ${n.width}`),console.log(` Height: ${n.height}`),n.content&&console.log(` Content: [${n.content.join(", ")}]`),n.padding&&console.log(` Padding: [${n.padding.join(", ")}]`),n.border&&console.log(` Border: [${n.border.join(", ")}]`),n.margin&&console.log(` Margin: [${n.margin.join(", ")}]`))}),function(e){return a.apply(this,arguments)}))}),function(e,t){return v.apply(this,arguments)})),ee(er.command("resolve <nodeId>").description("Resolve brick to JavaScript object with properties")).action((g=j(function*(e,t){var a;yield et(t,(a=j(function*(a){yield a.send("DOM.enable");var i=parseInt(e,10),n=(yield a.send("DOM.resolveNode",{nodeId:i})).object;if(t.json)return void console.log(JSON.stringify(n,null,2));if(console.log(R.Ay.bold(`Resolved node ${i}`)),console.log(` Type: ${n.type}`),n.className&&console.log(` Class: ${n.className}`),n.description&&console.log(` Description: ${n.description}`),n.objectId&&console.log(` Object ID: ${R.Ay.gray(n.objectId)}`),n.preview?.properties)for(var r of(console.log(R.Ay.bold(" Properties:")),n.preview.properties))console.log(` ${R.Ay.cyan(r.name)}: ${r.value}`)}),function(e){return a.apply(this,arguments)}))}),function(e,t){return g.apply(this,arguments)})),ee(er.command("focus <nodeId>").description("Focus a brick element")).action((y=j(function*(e,t){var a;yield et(t,(a=j(function*(t){yield t.send("DOM.enable");var a=parseInt(e,10);yield t.send("DOM.focus",{nodeId:a}),console.log(R.Ay.green(`Focused node ${a}`))}),function(e){return a.apply(this,arguments)}))}),function(e,t){return y.apply(this,arguments)}));var eo=Z.command("input").description("Input emulation");ee(eo.command("tap <x> <y>").description("Tap/click at coordinates")).action((b=j(function*(e,t,a){var i;yield et(a,(i=j(function*(i){var n=parseFloat(e),r=parseFloat(t),o=yield i.send("Input.dispatchMouseEvent",{type:"mousePressed",x:n,y:r,button:"left",clickCount:1});yield i.send("Input.dispatchMouseEvent",{type:"mouseReleased",x:n,y:r,button:"left",clickCount:1}),(({x:e,y:t,tapResult:a,json:i})=>{if(i)return console.log(JSON.stringify({x:e,y:t,...a||{}},null,2));console.log(R.Ay.green(`Tapped at (${e}, ${t})`));var n=ei(a?.element||a?.tappedElement||a?.hitElement);if(!n)return console.log(R.Ay.yellow(" Element: none"));console.log(` Element: ${n}`);var r=a?.hitElement,o=a?.tappedElement;if(r&&o&&r.nodeId!==o.nodeId){var s=ei(r);s&&console.log(` Hit: ${s}`)}a&&!1===a.dispatched&&console.log(R.Ay.yellow(" Action: no pressable handler"))})({x:n,y:r,tapResult:o,json:a.json})}),function(e){return i.apply(this,arguments)}))}),function(e,t,a){return b.apply(this,arguments)})),ee(eo.command("type <text>").description("Insert text into focused element")).action((D=j(function*(e,t){var a;yield et(t,(a=j(function*(t){yield t.send("Input.insertText",{text:e}),console.log(R.Ay.green(`Typed: ${e}`))}),function(e){return a.apply(this,arguments)}))}),function(e,t){return D.apply(this,arguments)})),ee(eo.command("key <key>").description("Dispatch key event (e.g., Enter, Escape, Tab)")).action((x=j(function*(e,t){var a;yield et(t,(a=j(function*(t){yield t.send("Input.dispatchKeyEvent",{type:"keyDown",key:e}),yield t.send("Input.dispatchKeyEvent",{type:"keyUp",key:e}),console.log(R.Ay.green(`Key: ${e}`))}),function(e){return a.apply(this,arguments)}))}),function(e,t){return x.apply(this,arguments)}));var es=Z.command("network").description("Network inspection");ee(es.command("list").description("Capture snapshot of network activity").option("--duration <ms>","Capture duration in milliseconds","2000")).action((w=j(function*(e){var t;yield et(e,(t=j(function*(t){var a=new Map,i=parseInt(e.duration,10);t.on("Network.requestWillBeSent",e=>{a.set(e.requestId,{method:e.request.method,url:e.request.url,requestId:e.requestId,timestamp:e.timestamp})}),t.on("Network.responseReceived",e=>{var t=a.get(e.requestId);t&&(t.status=e.response.status,t.mimeType=e.response.mimeType)}),t.on("Network.loadingFailed",e=>{var t=a.get(e.requestId);t&&(t.error=e.errorText)}),yield t.send("Network.enable"),yield new Promise(e=>setTimeout(e,i)),yield t.send("Network.disable");var n=[...a.values()];if(e.json)return void console.log(JSON.stringify(n,null,2));if(console.log(R.Ay.bold(`Network Activity (captured ${(i/1e3).toFixed(1)}s, ${n.length} requests)`)),0===n.length)return void console.log(R.Ay.gray(" No network activity captured"));for(var r of n){var o=r.error?R.Ay.red("ERR"):r.status?r.status<300?R.Ay.green(r.status):r.status<400?R.Ay.yellow(r.status):R.Ay.red(r.status):R.Ay.gray("..."),s=r.url.length>60?r.url.substring(0,57)+"...":r.url;console.log(` ${o} ${R.Ay.bold(r.method.padEnd(6))} ${s} ${R.Ay.gray(`(${r.requestId})`)}`)}}),function(e){return t.apply(this,arguments)}))}),function(e){return w.apply(this,arguments)})),ee(es.command("get <requestId>").description("Get response body for a network request")).action((_=j(function*(e,t){var a;yield et(t,(a=j(function*(a){yield a.send("Network.enable");var i=yield a.send("Network.getResponseBody",{requestId:e}),n=i.body,r=i.base64Encoded;t.json?console.log(JSON.stringify({body:n,base64Encoded:r},null,2)):r?console.log(R.Ay.gray(`[base64 encoded, ${n.length} chars]`)):console.log(n)}),function(e){return a.apply(this,arguments)}))}),function(e,t){return _.apply(this,arguments)}));var ep="bricks://app",el="DATA-",ed="properties",eu="entries",ec=e=>{if(null==e||"object"!=typeof e)return{value:e};if("value"in e)return{value:e.value};if("unserializableValue"in e)return{value:e.unserializableValue};if(e.objectId){var t=e.preview?.properties;return Array.isArray(t)&&t.length>0?{value:t.reduce((e,t)=>(e[t.name]=t.value,e),{}),byRef:!0}:{value:e.description||`[${e.type}]`,byRef:!0}}return{value:"undefined"===e.type?void 0:e.description}},em=e=>{var t=e.startsWith(el)?e.slice(el.length):e,a=t.indexOf(":");return a<0?{shortId:t,title:null}:{shortId:t.slice(0,a),title:t.slice(a+1)}},ef=e=>{if(e.startsWith("global:"))return{scope:"global",name:e.slice(7)};if(e.startsWith("subspace:")){var t=e.slice(9),a=t.indexOf(":");return a>0?{scope:"subspace",subspaceUuid:t.slice(0,a),name:t.slice(a+1)}:{scope:"subspace",subspaceUuid:t,name:""}}return{scope:null,name:e}},eh=(E=j(function*(e){try{var t=yield e.send("Runtime.evaluate",{expression:"JSON.stringify(Object.values(system.subspaces()).map((s) => ({ shortId: s.shortId, uuid: s.uuid, title: s.title })))",objectGroup:"console",returnByValue:!0}),a=t.result;if(t.exceptionDetails||"string"!=typeof a?.value)return[];return JSON.parse(a.value)}catch{return[]}}),function(e){return E.apply(this,arguments)}),ev=(e,{full:t=!1,width:a=100}={})=>{var i="string"==typeof e?e:JSON.stringify(e);return void 0===i?R.Ay.gray("undefined"):t||i.length<=a?i:`${i.substring(0,a)}…`},eg=(e,t)=>{var a=e.subspaceUuid?t.find(t=>t.uuid===e.subspaceUuid):null;return{key:e.rawKey,scope:e.scope,...e.subspaceUuid?{subspaceUuid:e.subspaceUuid}:{},...a?.shortId?{subspaceShortId:a.shortId}:{},name:e.name,value:e.value}},ey=(F=j(function*(e,{databaseName:t,objectStoreName:a,options:i}){var n=parseInt(i.skip??"0",10)||0,r=parseInt(i.limit??"25",10)||25,o=null;try{o=(yield e.send("IndexedDB.getMetadata",{securityOrigin:ep,databaseName:t,objectStoreName:a})).entriesCount}catch{}var s=yield e.send("IndexedDB.requestData",{securityOrigin:ep,databaseName:t,objectStoreName:a,indexName:"",skipCount:n,pageSize:r,returnByValue:!0}),p=s.objectStoreDataEntries,l=s.hasMore,d=!1,u=p.map(e=>{var t=ec(e.key).value,a=ec(e.value),i=a.value;return a.byRef&&(d=!0),{key:t,value:i}});if(i.json)return void console.log(JSON.stringify({database:t,objectStore:a,skip:n,limit:r,total:o,hasMore:!!l,entries:u},null,2));var c=null==o?"":` of ${o}`,m=n>0?`, skipped ${n}`:"";for(var f of(console.log(R.Ay.bold(`${t} / ${a} (${u.length}${c} entries${m})`)),console.log("─".repeat(60)),0===u.length&&console.log(R.Ay.gray(" No entries")),u)){var h=f.key,v=f.value,g="string"==typeof h?h:JSON.stringify(h);console.log(` ${R.Ay.cyan(g)}: ${ev(v,{full:!!i.full})}`)}l&&console.log(R.Ay.gray(" …more entries available — use -l/--limit and -s/--skip")),d&&console.log(R.Ay.yellow("\n Some values came back as object handles (device app without by-value reads).\n Update the device app to see full values."))}),function(e,t){return F.apply(this,arguments)}),eb=e=>e.option("-l, --limit <count>","Max items to fetch","25").option("-s, --skip <count>","Items to skip","0").option("--full","Do not truncate values"),eD=Z.command("storage").description("Storage inspection (read-only — CDP cannot mutate device storage)");ee(eD.command("list").description("Overview of all storage stores with entry counts")).action((A=j(function*(e){var t;yield et(e,(t=j(function*(t){yield t.send("DOMStorage.enable"),yield t.send("IndexedDB.enable");var a,i=(a=j(function*(e){return(yield t.send("DOMStorage.getDOMStorageItems",{storageId:{securityOrigin:ep,isLocalStorage:e}})).entries.length}),function(e){return a.apply(this,arguments)}),n=yield i(!0),r=yield i(!1),o=(yield t.send("IndexedDB.requestDatabaseNames",{securityOrigin:ep})).databaseNames,s=[];for(var p of o){var l=p.startsWith(el)?ed:eu,d=null;try{d=(yield t.send("IndexedDB.getMetadata",{securityOrigin:ep,databaseName:p,objectStoreName:l})).entriesCount}catch{}s.push({name:p,objectStoreName:l,entriesCount:d})}var u=s.filter(e=>e.name.startsWith(el)).map(e=>({...e,...em(e.name)})),c=s.filter(e=>!e.name.startsWith(el));if(e.json)return void console.log(JSON.stringify({system:{persist:n,memory:r},dataBanks:u,caches:c},null,2));var m=e=>null==e?R.Ay.gray("? entries"):`${e} entries`;for(var f of(console.log(R.Ay.bold("Storage Overview")+R.Ay.gray(" (read-only)")),console.log("─".repeat(60)),console.log(` ${R.Ay.bold("System storage")}${R.Ay.gray(" → storage system persist|memory")}`),console.log(` persist ${m(n)}`),console.log(` memory ${m(r)}`),console.log(` ${R.Ay.bold("Data banks")}${R.Ay.gray(" → storage data-bank get <S_xxxx|title>")}`),0===u.length&&console.log(R.Ay.gray(" none")),u)){var h=f.title?` "${f.title}"`:"";console.log(` ${R.Ay.cyan(f.shortId)}${h} ${m(f.entriesCount)}`)}for(var v of(console.log(` ${R.Ay.bold("Caches")}${R.Ay.gray(" → storage cache generator|generative-media")}`),0===c.length&&console.log(R.Ay.gray(" none")),c))console.log(` ${R.Ay.cyan(v.name)} ${m(v.entriesCount)}`);console.log("─".repeat(60))}),function(e){return t.apply(this,arguments)}))}),function(e){return A.apply(this,arguments)}));var ex=eD.command("system").description("System key-value storage"),ew=e=>e.option("--scope <scope>","Filter by scope: global or a subspace S_xxxx/UUID").option("--prefix <prefix>","Filter by key-name prefix (within the scope)").option("--full","Do not truncate values"),e_=(e,t)=>{var a;return a=j(function*(a){var i;yield et(a,(i=j(function*(i){yield i.send("DOMStorage.enable");var n=(yield i.send("DOMStorage.getDOMStorageItems",{storageId:{securityOrigin:ep,isLocalStorage:e}})).entries,r=yield eh(i),o=((e,{scope:t,prefix:a,subspaceIndex:i=[]}={})=>{var n=t&&"global"!==t?i.find(e=>e.shortId===t||e.uuid===t)?.uuid||t:null;return e.map(([e,t])=>({rawKey:e,value:t,...ef(e)})).filter(e=>("global"!==t||"global"===e.scope)&&(!n||"subspace"===e.scope&&e.subspaceUuid===n)&&(!a||!!e.name.startsWith(a)))})(n,{scope:a.scope,prefix:a.prefix,subspaceIndex:r});if(a.json)return void console.log(JSON.stringify(o.map(e=>eg(e,r)),null,2));if(((e,{label:t,subspaceIndex:a,full:i})=>{if(console.log(R.Ay.bold(`${t} (${e.length} items)`)),console.log("─".repeat(60)),0===e.length)return console.log(R.Ay.gray(" No entries"));var n=null,r=function(e){var t="subspace"===e.scope?`subspace:${e.subspaceUuid}`:e.scope;if(t!==n)if(n=t,"subspace"===e.scope){var r=a.find(t=>t.uuid===e.subspaceUuid),o=r?`${r.shortId}${r.title?` "${r.title}"`:""} `:"";console.log(` ${R.Ay.bold(`subspace ${o}`)}${R.Ay.gray(`(${e.subspaceUuid})`)}`)}else console.log(` ${R.Ay.bold(e.scope||"other")}`);var s=e.name||e.rawKey;console.log(` ${R.Ay.cyan(s)}: ${ev(e.value,{full:i,width:80})}`)};for(var o of e)r(o)})(o,{label:t,subspaceIndex:r,full:!!a.full}),0===o.length&&a.scope&&"global"!==a.scope&&!r.some(e=>e.shortId===a.scope||e.uuid===a.scope)){var s=r.map(e=>e.shortId).join(", ");console.log(R.Ay.yellow(` Scope "${a.scope}" did not match a known subspace${s?` (known: ${s})`:""}`))}}),function(e){return i.apply(this,arguments)}))}),function(e){return a.apply(this,arguments)}};ew(ee(ex.command("persist").description("Show persistent system storage entries"))).action(e_(!0,"Persistent Storage")),ew(ee(ex.command("memory").description("Show in-memory system storage entries"))).action(e_(!1,"Memory Storage")),ee(ex.command("get <key>").description("Show a single system storage value (full, untruncated)").option("--scope <scope>","Key scope: global (default) or a subspace S_xxxx/UUID","global").option("--memory","Read from in-memory storage instead of persistent")).action((C=j(function*(e,t){var a;yield et(t,(a=j(function*(a){yield a.send("DOMStorage.enable");var i=(yield a.send("DOMStorage.getDOMStorageItems",{storageId:{securityOrigin:ep,isLocalStorage:!t.memory}})).entries,n=yield eh(a),r=[e];if("global"===t.scope)r.push(`global:${e}`);else{var o=n.find(e=>e.shortId===t.scope||e.uuid===t.scope)?.uuid||t.scope;r.push(`subspace:${o}:${e}`)}var s=i.map(([e,t])=>({rawKey:e,value:t,...ef(e)})).find(e=>r.includes(e.rawKey));if(!s){var p=i.map(([e])=>e).filter(t=>t.toLowerCase().includes(e.toLowerCase())).slice(0,5);if(p.length>0)for(var l of(console.error(R.Ay.yellow("Similar keys:")),p))console.error(` ${l}`);throw Error(`Key not found: ${r[r.length-1]}`)}if(t.json)return void console.log(JSON.stringify(eg(s,n),null,2));if("string"==typeof s.value)try{console.log(JSON.stringify(JSON.parse(s.value),null,2));return}catch{}console.log("string"==typeof s.value?s.value:JSON.stringify(s.value,null,2))}),function(e){return a.apply(this,arguments)}))}),function(e,t){return C.apply(this,arguments)}));var eE=eD.command("data-bank").description("Data bank (Property Bank) stores");ee(eE.command("list").description("List data banks")).action((S=j(function*(e){var t;yield et(e,(t=j(function*(t){yield t.send("IndexedDB.enable");var a=(yield t.send("IndexedDB.requestDatabaseNames",{securityOrigin:ep})).databaseNames,i=[];for(var n of a.filter(e=>e.startsWith(el))){var r=null;try{r=(yield t.send("IndexedDB.getMetadata",{securityOrigin:ep,databaseName:n,objectStoreName:ed})).entriesCount}catch{}i.push({name:n,...em(n),entriesCount:r})}if(e.json)return void console.log(JSON.stringify(i,null,2));for(var o of(console.log(R.Ay.bold(`Data Banks (${i.length})`)),console.log("─".repeat(60)),0===i.length&&console.log(R.Ay.gray(" No data banks")),i)){var s=o.title?` ${R.Ay.green(`"${o.title}"`)}`:"",p=null===o.entriesCount||void 0===o.entriesCount?"":R.Ay.gray(` ${o.entriesCount} entries`);console.log(` ${R.Ay.cyan(o.shortId)}${s}${p}`)}console.log(R.Ay.gray("\nInspect: bricks devtools storage data-bank get <S_xxxx|title>"))}),function(e){return t.apply(this,arguments)}))}),function(e){return S.apply(this,arguments)})),eb(ee(eE.command("get <bank> [store]").description(`Show data bank entries — <bank> accepts a subspace S_xxxx, a title keyword, or the full DATA-* database name; [store] defaults to "${ed}"`))).action((T=j(function*(e,t,a){var i;yield et(a,(i=j(function*(i){yield i.send("IndexedDB.enable");var n=(yield i.send("IndexedDB.requestDatabaseNames",{securityOrigin:ep})).databaseNames,r=((e,t)=>{var a=e.filter(e=>e.startsWith(el)),i=a.find(e=>e===t||e===`${el}${t}`);if(i)return{match:i};if(t.startsWith("S_")){var n=a.filter(e=>em(e).shortId===t);if(1===n.length)return{match:n[0]};if(n.length>1)return{candidates:n}}var r=t.toLowerCase(),o=a.filter(e=>e.slice(el.length).toLowerCase().includes(r));return 1===o.length?{match:o[0]}:{candidates:o}})(n,e);if(!r.match){var o=n.filter(e=>e.startsWith(el)),s=(r.candidates?.length||0)>1,p=s?r.candidates:o;for(var l of(console.error(R.Ay.yellow(s?`Data bank "${e}" is ambiguous. Candidates:`:`Data bank "${e}" not found. Available:`)),p)){var d=em(l),u=d.shortId,c=d.title;console.error(` ${u}${c?` "${c}"`:""}`)}process.exit(1)}yield ey(i,{databaseName:r.match,objectStoreName:t||ed,options:a})}),function(e){return i.apply(this,arguments)}))}),function(e,t,a){return T.apply(this,arguments)}));var eF=eD.command("cache").description("Cache stores (generator, generative-media)"),eA=e=>{var t;return t=j(function*(t){var a;yield et(t,(a=j(function*(a){yield a.send("IndexedDB.enable"),yield ey(a,{databaseName:e,objectStoreName:eu,options:t})}),function(e){return a.apply(this,arguments)}))}),function(e){return t.apply(this,arguments)}};eb(ee(eF.command("generator").description("Show generator cache entries"))).action(eA("GENERATOR_CACHE")),eb(ee(eF.command("generative-media").description("Show generative media cache entries"))).action(eA("GENERATIVE_MEDIA_CACHE")),eb(ee(eD.command("generator-cache",{hidden:!0}).description("Alias of `storage cache generator`"))).action(eA("GENERATOR_CACHE"));var eC=Z.command("runtime").description("Runtime and evaluation");ee(eC.command("eval <expression>").description("Evaluate JavaScript expression").option("--await","Await promise result")).action((k=j(function*(e,t){var a;yield et(t,(a=j(function*(a){yield a.send("Runtime.enable");var i=yield a.send("Runtime.evaluate",{expression:e,objectGroup:"console",returnByValue:!0,awaitPromise:!!t.await,generatePreview:!0});if(t.json)return void console.log(JSON.stringify(i,null,2));i.exceptionDetails&&(console.error(R.Ay.red(`Error: ${i.exceptionDetails.text}`)),i.exceptionDetails.exception?.description&&console.error(R.Ay.red(i.exceptionDetails.exception.description)),process.exit(1));var n=i.result;"undefined"===n.type?console.log(R.Ay.gray("undefined")):void 0!==n.value?console.log("object"==typeof n.value?JSON.stringify(n.value,null,2):String(n.value)):n.description?console.log(n.description):console.log(R.Ay.gray(`[${n.type}${n.subtype?`:${n.subtype}`:""}]`))}),function(e){return a.apply(this,arguments)}))}),function(e,t){return k.apply(this,arguments)})),ee(eC.command("properties <objectId>").description("Get properties of a remote object")).action((N=j(function*(e,t){var a;yield et(t,(a=j(function*(a){var i=(yield a.send("Runtime.getProperties",{objectId:e,ownProperties:!0})).result;if(t.json)return void console.log(JSON.stringify(i,null,2));for(var n of(console.log(R.Ay.bold(`Properties of ${e}`)),i))if(n.enumerable){var r=n.value,o=r?.description||r?.value?.toString()||R.Ay.gray(`[${r?.type}]`);console.log(` ${R.Ay.cyan(n.name)}: ${o}`)}}),function(e){return a.apply(this,arguments)}))}),function(e,t){return N.apply(this,arguments)}));var eS=Z.command("simulator").description("Inspect simulated peripherals (Application Simulator / web preview servers only)").command("thermal-printer").description("Simulated thermal printers and their print results"),eT="This DevTools server does not expose simulator inspection. Connect to an Application Simulator preview (e.g. the CTOR project simulator) running a preview build with the Simulator CDP domain.",ek=e=>{if(!e)return"unknown time";var t=new Date(e);return Number.isNaN(t.getTime())?"unknown time":t.toLocaleString()},eN=e=>{if(e.raw)return"raw data";var t=(e=>{if(!e?.length)return"";var t=[];for(var a of e){var i=t[t.length-1];i&&i.type===a?i.count+=1:t.push({type:a,count:1})}return t.map(({type:e,count:t})=>t>1?`${e}\xd7${t}`:e).join(", ")})(e.commandTypes);return`${e.commandCount} command(s)${t?`: ${t}`:""}`};ee(eS.command("list").description("List simulated thermal printers and their print history").option("--commands","Include full print command payloads (use with -j)")).action((O=j(function*(e){var t;yield et(e,(t=j(function*(t){var a=yield t.send("Simulator.listThermalPrinters",{includeCommands:!!e.commands}),i=a?.printers;if(Array.isArray(i)||(console.error(R.Ay.red(eT)),process.exit(1)),e.json)return void console.log(JSON.stringify(i,null,2));if(0===i.length){console.log(R.Ay.yellow("No simulated thermal printers registered.")),console.log(R.Ay.gray("A printer appears once the application configures GENERATOR_THERMAL_PRINTER."));return}for(var n of(console.log(R.Ay.bold(`Simulated Thermal Printers (${i.length})`)),console.log("─".repeat(60)),i)){var r=n.errored?R.Ay.red("fault"):n.connected?R.Ay.green("connected"):R.Ay.gray("idle");console.log(` ${R.Ay.bold(n.label||n.driver)} ${R.Ay.gray(`(${n.driver})`)} [${r}]`),console.log(` Printer ID: ${R.Ay.cyan(n.id)}`),n.connectString&&console.log(` Connect: ${R.Ay.gray(n.connectString)}`);var o=n.printHistory||[];if(0===o.length){console.log(R.Ay.gray(" No print results yet."));continue}var s="memory"===n.printHistorySource?R.Ay.gray(" (restored from memory)"):"";for(var p of(console.log(` Print results, newest first${s}:`),o))console.log(` --index ${p.index} ${ek(p.printedAt)} ${R.Ay.gray(eN(p))}`)}console.log("─".repeat(60)),console.log(R.Ay.gray("Save one as PNG: bricks devtools simulator thermal-printer print-result"))}),function(e){return t.apply(this,arguments)}))}),function(e){return O.apply(this,arguments)})),ee(eS.command("print-result").description("Render a simulated print result to a PNG image").option("--printer <id>","Printer ID (see `list`; defaults to the only registered printer)").option("-i, --index <n>","Print history index, 0 = latest","0").option("--scale <factor>","Image scale factor (1-4)","2").option("-o, --output <path>","Output file path")).action((I=j(function*(e){var t;yield et(e,(t=j(function*(t){var i=yield t.send("Simulator.captureThermalPrinterPrintResult",{id:e.printer,index:parseInt(e.index,10)||0,scale:parseFloat(e.scale)||2},3e4);i?.data||(console.error(R.Ay.red(eT)),process.exit(1));var n=yield Promise.resolve().then(a.t.bind(a,73024,19)),r=yield Promise.resolve().then(a.t.bind(a,76760,19)),o=e.output||`print-result-${Date.now()}.png`,s=r.resolve(o);(n.writeFileSync(s,Buffer.from(i.data,"base64")),e.json)?console.log(JSON.stringify({path:s,id:i.id,driver:i.driver,label:i.label,index:i.index,printedAt:i.printedAt,width:i.width,height:i.height},null,2)):(console.log(R.Ay.green(`Print result saved to ${s}`)),console.log(` Printer: ${i.label} ${R.Ay.gray(`(${i.driver}, ${i.id})`)}`),console.log(` Printed: ${ek(i.printedAt)} (--index ${i.index})`),i.width&&i.height&&console.log(` Size: ${i.width}\xd7${i.height}`))}),function(e){return t.apply(this,arguments)}))}),function(e){return I.apply(this,arguments)}))},11405(e,t,a){a.d(t,{l:()=>v});var i,n,r,o=a(99436),s=a(35679),p=a(7586),l=a(85382),d=a(8479),u=a(47988),c=(i=o(function*(){try{return yield Promise.all([a.e(587),a.e(647),a.e(10),a.e(117)]).then(a.bind(a,98372)),{available:!0}}catch(e){return{available:!1,error:e.message}}}),function(){return i.apply(this,arguments)}),m=(e,t,a)=>({severity:e,code:t,message:a}),f=(n=o(function*({version:e="2.25.0-beta.42",mcpCheck:t=c}={}){var a=(0,u.getCurrentProfile)(),i=(0,u.getCurrentProfileSource)(),n=(0,u.getTokenInfo)(a),r=(0,u.getBaseUrl)(),o=(0,u.getActivityLogBaseUrl)(),s=[],f={ok:!1,timestamp:new Date().toISOString(),cli:{name:"bricks",version:e},profile:{name:a,source:i},config:{path:u.CONFIG_PATH,baseUrl:r,activityLogBaseUrl:o},auth:{available:!!n?.token,source:n?.token?"config":"missing",workspaceId:n?.workspaceId||null,workspaceName:n?.workspaceName||null,createdAt:n?.createdAt||null,tokenPreview:(0,p.$l)(n?.token)},connectivity:{workspace:{ok:!1,skipped:!n?.token,error:null}},capabilities:{zeroArgMode:(0,d.z)()?"interactive":"help",mcp:{available:!1,error:null}},issues:s};if(n?.token)try{var h=yield(0,l.createClient)(r,n.token).workspace();f.connectivity.workspace={ok:!0,skipped:!1,error:null,id:h?._id||n.workspaceId||null,name:h?.name||n.workspaceName||null},f.auth.workspaceId=h?._id||f.auth.workspaceId,f.auth.workspaceName=h?.name||f.auth.workspaceName}catch(e){f.connectivity.workspace={ok:!1,skipped:!1,error:e.message},s.push(m("error","workspace_unreachable",`Workspace query failed for ${r}: ${e.message}`))}else s.push(m("warning","auth_missing","No saved token for the current profile."));var v=yield t();return f.capabilities.mcp={available:v.available,error:v.error||null},v.available||s.push(m("warning","mcp_unavailable",`MCP stdio server is unavailable: ${v.error||"Unknown error"}`)),f.ok=0===s.length,f}),function(){return n.apply(this,arguments)}),h=(e,t,a)=>`${e.padEnd(14)} ${t}${a?` ${a}`:""}`,v=new s.uB("doctor").description("Check CLI configuration, auth state, and workspace reachability").option("-j, --json","Output as JSON").action((r=o(function*(e){try{var t=yield f();if(e.json)return void(0,p.GF)(t);console.log((e=>{var t=[];if(t.push("BRICKS CLI Doctor"),t.push("─".repeat(60)),t.push(h("CLI","OK",`bricks v${e.cli.version}`)),t.push(h("Profile","OK",`${e.profile.name} (${e.profile.source})`)),t.push(h("BRICKS API","OK",e.config.baseUrl)),t.push(h("Activity Log","OK",e.config.activityLogBaseUrl)),e.auth.available){var a=e.auth.workspaceName||e.auth.workspaceId||"Unknown workspace";t.push(h("Auth","OK",`${a} (${e.auth.source}, ${e.auth.tokenPreview})`))}else t.push(h("Auth","WARN","No saved token for the current profile"));if(e.connectivity.workspace.skipped)t.push(h("Workspace","WARN","Skipped because no token is available"));else if(e.connectivity.workspace.ok){var i=e.connectivity.workspace.name||e.connectivity.workspace.id||"Unknown workspace";t.push(h("Workspace","OK",i))}else t.push(h("Workspace","FAIL",e.connectivity.workspace.error));return e.capabilities.mcp.available?t.push(h("MCP","OK","STDIO server import is available")):t.push(h("MCP","WARN",e.capabilities.mcp.error)),t.push(h("Zero-arg mode",((e,t=!1)=>e?"OK":t?"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&&(t.push("─".repeat(60)),t.push("Issues"),e.issues.forEach(e=>{t.push(`- [${e.severity}] ${e.message}`)})),t.join("\n")})(t))}catch(t){e.json?(0,p.OW)(t.message):console.error(`Doctor failed: ${t.message}`),process.exit(1)}}),function(e){return r.apply(this,arguments)}))},28634(e,t,a){a.d(t,{p:()=>w});var i,n,r,o,s,p,l,d=a(68832),u=a(99436),c=a(35679),m=a(73284),f=a(30155),h=a(7586),v=a(56493),g=a(68168),y=a(98593),b=e=>{if(!e)return m.Ay.gray("○");var t=Date.now()-new Date(e).getTime();return t<=3e5?m.Ay.green("●"):60>Math.floor(t/6e4)?m.Ay.yellow("○"):m.Ay.red("○")},D=(e,t)=>({id:e?._id||t,name:e?.name||"Unnamed",deviceCount:e?.devices?.length||0}),x=["refresh","clear-cache","system-menu-open","system-menu-close","system-info-open","system-info-close","local-sync-panel-open","local-sync-panel-close","debug-panel-open","debug-panel-close","logging-on","logging-off","test-panel-open","test-panel-close"],w=new c.uB("group").description("Device Group management");w.command("list").description("List all device groups").option("-j, --json","Output as JSON").action((i=u(function*(e){var t=(0,v.o)(),a=(0,f.default)("Fetching device groups...").start();try{var i=yield t.deviceGroups({});if(a.stop(),e.json)return void console.log(JSON.stringify(i,null,2));if(!i||0===i.length)return void console.log(m.Ay.yellow("No device groups found"));console.log(m.Ay.bold("\nDevice Groups")),console.log("─".repeat(80)),i.forEach(e=>{var t=e.devices?.length||0;console.log(`● ${m.Ay.cyan(e.name)} ${m.Ay.gray(`(${t} devices)`)}`),console.log(` ID: ${m.Ay.gray(e._id)}`),e.description&&console.log(` ${m.Ay.gray(e.description)}`),console.log()})}catch(e){a.fail(`Failed to list groups: ${e.message}`),process.exit(1)}}),function(e){return i.apply(this,arguments)})),w.command("get <id>").description("Get device group details").option("-j, --json","Output as JSON").action((n=u(function*(e,t){var a=(0,v.o)(),i=(0,f.default)("Fetching device group...").start();try{var n=yield a.deviceGroup({id:e});if(i.stop(),n||(console.log(m.Ay.red("Device group not found")),process.exit(1)),t.json)return void console.log(JSON.stringify(n,null,2));console.log(m.Ay.bold(`
|
|
105
107
|
Device Group: ${n.name}`)),console.log("─".repeat(60)),console.log(`ID: ${m.Ay.gray(n._id)}`),console.log(`Description: ${n.description||m.Ay.gray("N/A")}`),console.log(`Tags: ${n.tags?.join(", ")||m.Ay.gray("None")}`),console.log(`Created: ${m.Ay.gray(n.create_datetime)}`),console.log(`Modified: ${m.Ay.gray(n.last_modify_datetime)}`),n.devices?.length>0&&(console.log(`
|
|
106
108
|
${m.Ay.bold("Devices")} (${n.devices.length})`),n.devices.forEach(e=>{var t=e.device_target_name||e.device_id;console.log(` - ${t} ${m.Ay.gray(`(${e.device_id})`)}`)})),console.log("─".repeat(60))}catch(e){i.fail(`Failed to get group: ${e.message}`),process.exit(1)}}),function(e,t){return n.apply(this,arguments)})),w.command("resolve <query>").description("Resolve a device group name or ID to stable IDs").option("-l, --limit <limit>","Limit search results",e=>Number.parseInt(e,10),10).option("-j, --json","Output as JSON").action((r=u(function*(e,t){var a=(0,v.o)(),i=t.json?null:(0,f.default)("Resolving device group...").start();try{var n=yield(0,g.Y)(()=>a.deviceGroup({id:e})),r=n?[n]:yield a.deviceGroups({paginate:{limit:t.limit}}),o=n?r:(r||[]).filter(t=>t.name?.toLowerCase().includes(e.trim().toLowerCase())),s=(0,g.K)({resource:"group",query:e,items:o||[],fields:["_id","name"],selectedBy:n?"id":null});if(i&&i.stop(),t.json)return void(0,h.GF)(s);if(s.resolved){var p=s.resolved;console.log(m.Ay.bold("\nResolved Device Group")),console.log("─".repeat(60)),console.log(`Name: ${m.Ay.cyan(p.name||"Unnamed")}`),console.log(`ID: ${m.Ay.gray(p._id)}`),console.log(`Selected By: ${s.selectedBy}`),console.log("─".repeat(60));return}if(0===s.matches.length)return void console.log(m.Ay.yellow(`No device groups matched "${e}"`));console.log(m.Ay.bold(`
|
|
107
109
|
Matching Device Groups (${s.matches.length})`)),console.log("─".repeat(80)),s.matches.forEach(e=>{console.log(`${m.Ay.cyan(e.name||"Unnamed")} ${m.Ay.gray(e._id)}`)}),console.log("─".repeat(80))}catch(t){i?i.fail(`Failed to resolve device group: ${t.message}`):(0,h.OW)(t.message,{resource:"group",query:e}),process.exit(1)}}),function(e,t){return r.apply(this,arguments)})),w.command("devices <id>").description("List devices in a group with status").option("-j, --json","Output as JSON").action((o=u(function*(e,t){var a=(0,v.o)(),i=(0,f.default)("Fetching devices...").start();try{var n=yield a.devicesByGroup({id:e});if(i.stop(),t.json)return void console.log(JSON.stringify(n,null,2));if(!n||0===n.length)return void console.log(m.Ay.yellow("No devices in this group"));console.log(m.Ay.bold("\nDevices in Group")),console.log("─".repeat(80)),n.forEach(e=>{var t=e.entry_detail?.watch_dog_timer?.last_alive_time,a=b(t),i=e.name||e.device_name||e.device_target_name,n=e.entry_detail?.application?.name||m.Ay.gray("No app");console.log(`${a} ${m.Ay.cyan(i.padEnd(30))} ${n}`)}),console.log("─".repeat(80))}catch(e){i.fail(`Failed to get devices: ${e.message}`),process.exit(1)}}),function(e,t){return o.apply(this,arguments)})),w.command("dispatch <id> <action>").description("Dispatch action to all devices in group").option("--dry-run","Validate inputs and show the dispatch plan without sending it").option("-j, --json","Output as JSON").action((s=u(function*(e,t,a){var i=(0,v.o)(),n=a.json?null:(0,f.default)(`Dispatching ${t}...`).start();x.includes(t)||(a.json?(0,h.OW)(`Invalid action. Valid actions: ${x.join(", ")}`,{action:"group.dispatch",target:{id:e}}):n.fail(`Invalid action. Valid actions: ${x.join(", ")}`),process.exit(1));try{var r=yield i.deviceGroup({id:e});if(!r)throw Error("Device group not found");if(a.dryRun){n&&n.stop(),(0,y.S5)({action:"group.dispatch",target:D(r,e),request:{action:t},checks:[(0,y.Iy)("group exists",!0,`${r.name} (${r._id})`),(0,y.Iy)("action is valid",!0)],json:a.json});return}var o=yield i.dispatchDeviceGroupAction({id:e,action:t});a.json?(0,y.yd)({action:"group.dispatch",target:D(r,e),result:{action:t,success:o?.success||0,failed:o?.failed||0},json:!0}):(n.succeed(`Action dispatched: ${m.Ay.green(t)}`),o&&(console.log(`Success: ${m.Ay.green(o.success||0)}`),console.log(`Failed: ${m.Ay.red(o.failed||0)}`)))}catch(t){a.json?(0,h.OW)(t.message,{action:"group.dispatch",target:{id:e}}):n.fail(`Failed to dispatch action: ${t.message}`),process.exit(1)}}),function(e,t,a){return s.apply(this,arguments)})),w.command("refresh <id>").description("Refresh all devices in group").option("--dry-run","Validate inputs and show the refresh plan without sending it").option("-j, --json","Output as JSON").action((p=u(function*(e,t){var a=(0,v.o)(),i=t.json?null:(0,f.default)("Refreshing devices...").start();try{var n=yield a.deviceGroup({id:e});if(!n)throw Error("Device group not found");if(t.dryRun){i&&i.stop(),(0,y.S5)({action:"group.refresh",target:D(n,e),request:{action:"refresh"},checks:[(0,y.Iy)("group exists",!0,`${n.name} (${n._id})`)],json:t.json});return}var r=yield a.dispatchDeviceGroupAction({id:e,action:"refresh"});t.json?(0,y.yd)({action:"group.refresh",target:D(n,e),result:{success:r?.success||0,failed:r?.failed||0},json:!0}):(i.succeed("Devices refreshed"),r&&(console.log(`Success: ${m.Ay.green(r.success||0)}`),console.log(`Failed: ${m.Ay.red(r.failed||0)}`)))}catch(a){t.json?(0,h.OW)(a.message,{action:"group.refresh",target:{id:e}}):i.fail(`Failed to refresh: ${a.message}`),process.exit(1)}}),function(e,t){return p.apply(this,arguments)})),w.command("monitor <id>").description("Monitor devices in group (polls every 60s)").option("-i, --interval <seconds>","Polling interval in seconds","60").action((l=u(function*(e,t){var a,i=(0,v.o)(),n=1e3*parseInt(t.interval,10);console.log(m.Ay.bold("\nDevice Group Monitor")),console.log(m.Ay.gray(`Polling every ${t.interval}s. Press Ctrl+C to stop.
|
|
@@ -120,7 +122,7 @@ ${g.Ay.bold("Usage")}`),console.log(`Used In: ${n.use_count.total_count} ap
|
|
|
120
122
|
${g.Ay.bold("Exposed Properties")} (${n.expose_properties.length})`),n.expose_properties.forEach(e=>{console.log(` - ${g.Ay.cyan(e)}`)})),console.log("─".repeat(60))}catch(e){i.fail(`Failed to get module: ${e.message}`),process.exit(1)}}),function(e,t){return o.apply(this,arguments)})),T.command("resolve <query>").description("Resolve a module name or ID to stable IDs").option("-l, --limit <limit>","Limit search results",e=>Number.parseInt(e,10),10).option("-j, --json","Output as JSON").action((s=h(function*(e,t){var a=(0,E.o)(),i=t.json?null:(0,y.default)("Resolving module...").start();try{var n=yield(0,F.Y)(()=>a.module({id:e})),r=n?[n]:yield a.modules({keyword:e,paginate:{limit:t.limit}}),o=(0,F.K)({resource:"module",query:e,items:r||[],fields:["_id","name"],selectedBy:n?"id":null});if(i&&i.stop(),t.json)return void(0,_.GF)(o);if(o.resolved){var s=o.resolved;console.log(g.Ay.bold("\nResolved Module")),console.log("─".repeat(60)),console.log(`Name: ${g.Ay.cyan(s.name||"Unnamed")}`),console.log(`ID: ${g.Ay.gray(s._id)}`),console.log(`Selected By: ${o.selectedBy}`),console.log("─".repeat(60));return}if(0===o.matches.length)return void console.log(g.Ay.yellow(`No modules matched "${e}"`));console.log(g.Ay.bold(`
|
|
121
123
|
Matching Modules (${o.matches.length})`)),console.log("─".repeat(80)),o.matches.forEach(e=>{console.log(`${g.Ay.cyan(e.name||"Unnamed")} ${g.Ay.gray(e._id)}`)}),console.log("─".repeat(80))}catch(t){i?i.fail(`Failed to resolve module: ${t.message}`):(0,_.OW)(t.message,{resource:"module",query:e}),process.exit(1)}}),function(e,t){return s.apply(this,arguments)})),T.command("update <id>").description("Update module name, description, and/or configuration").option("-n, --name <name>","Module name").option("-d, --description <description>","Module description").option("-c, --config <json>","Module config as JSON string").option("-f, --file <path>","Module config from file").option("--validate","Validate configuration (default: true when config is set)",!0).option("--no-validate","Skip server-side config validation").option("--last-commit-id <id>","Reject if server config.bricks_project_last_commit_id does not match this value").option("-j, --json","Output as JSON").action((p=h(function*(e,t){var a=(0,E.o)(),i=t.json?null:(0,y.default)("Updating module...").start();try{var n={id:e};t.name&&(n.name=t.name),t.description&&(n.description=t.description),t.config?n.config=t.config:t.file&&(n.config=b.readFileSync(t.file,"utf-8")),void 0!==n.config&&(n.validateConfig=!1!==t.validate),t.lastCommitId&&(n.lastCommitId=t.lastCommitId);var r=yield a.updateModule(n);t.json?(0,C.yd)({action:"module.update",target:S(r,e),result:{lastCommitId:t.lastCommitId||null},json:!0}):(i.succeed(`Module updated: ${g.Ay.green(r.name)}`),r.has_unreleased_changes&&console.log(g.Ay.yellow("Note: Module has unreleased changes")))}catch(a){t.json?(0,_.OW)(a.message,{action:"module.update",target:{id:e}}):i.fail(`Failed to update module: ${a.message}`),process.exit(1)}}),function(e,t){return p.apply(this,arguments)})),T.command("short-edit <id>").description("Short edit module properties").requiredOption("-l, --list <json>","Short edit list as JSON array").action((l=h(function*(e,t){var a=(0,E.o)(),i=(0,y.default)("Applying short edit...").start();try{var n=JSON.parse(t.list);Array.isArray(n)||(i.fail("List must be a JSON array"),process.exit(1));var r=yield a.shortEditModule({id:e,list:n});i.succeed(`Short edit applied to: ${g.Ay.green(r.name)}`)}catch(e){i.fail(`Failed to apply short edit: ${e.message}`),process.exit(1)}}),function(e,t){return l.apply(this,arguments)})),T.command("short-refs <id>").description("List short edit references for a module").option("-k, --keyword <keyword>","Filter by shortId or title").option("-t, --types <types>","Comma-separated shortId prefixes to include (e.g. B,C,S)").option("-j, --json","Output as JSON").action((d=h(function*(e,t){var a=(0,E.o)(),i=(0,y.default)("Fetching short edit references...").start();try{var n=yield a.module({id:e});if(i.stop(),!n?.short_edit?.enabled)return void console.log(g.Ay.yellow("Short Edit is not enabled for this module"));var r=t.types?t.types.split(",").map(e=>e.trim()).filter(Boolean):[],o=(0,w.V)(n.short_edit.ref_map,{keyword:t.keyword,types:r});if(t.json)return void console.log(JSON.stringify(o,null,2));if(0===o.length)return void console.log(g.Ay.yellow("No short edit references found"));console.log(g.Ay.bold(`
|
|
122
124
|
Short Edit References: ${n.name}`)),o.forEach(e=>{console.log(g.Ay.cyan(`
|
|
123
|
-
${e.label} (${e.prefix}_)`)),e.refs.forEach(({shortId:e,ref:t})=>{var a=t?.title?g.Ay.gray(`- ${t.title}`):"";console.log(` ${g.Ay.green(e)} ${a}`)})}),console.log()}catch(e){i.fail(`Failed to fetch short edit references: ${e.message}`),process.exit(1)}}),function(e,t){return d.apply(this,arguments)})),T.command("remove <id>").description("Remove a module").option("--dry-run","Validate the target and show the removal plan without deleting it").option("-j, --json","Output as JSON").action((u=h(function*(e,t){var a=(0,E.o)(),i=t.json?null:(0,y.default)("Removing module...").start();try{var n=yield a.module({id:e});if(!n)throw Error("Module not found");var r=S(n,e);if(t.dryRun){i&&i.stop(),(0,C.S5)({action:"module.remove",target:r,request:{id:e},checks:[(0,C.Iy)("module exists",!0,`${r.name} (${r.id})`)],json:t.json});return}var o=yield a.removeModule({id:e});t.json?(0,C.yd)({action:"module.remove",target:r,result:{removed:!!o},json:!0}):i.succeed(`Module removed: ${g.Ay.green(r.name)}`)}catch(a){t.json?(0,_.OW)(a.message,{action:"module.remove",target:{id:e}}):i.fail(`Failed to remove module: ${a.message}`),process.exit(1)}}),function(e,t){return u.apply(this,arguments)})),T.command("release <id>").description("Release module to BRICKS platform").requiredOption("-c, --config <path|json>","Module config file path or JSON string").option("-n, --name <name>","Update module name as part of the release").option("--version <version>","Version name").option("--changelogs <text>","Release changelogs").option("--dry-run","Validate inputs and show the release plan without publishing").option("-j, --json","Output as JSON").action((c=h(function*(e,t){var a=(0,E.o)(),i=t.json?null:(0,y.default)("Releasing module...").start();try{var n=(0,A.Ku)(t.config),r=n.config,o=n.source,s=n.sizeBytes,p=yield a.module({id:e});if(!p)throw Error("Module not found");if(p.is_public)throw Error("Public module deployment is temporarily not recommended");var l=t.version||t.name||p.name||"Untitled",d=(0,A.w9)(t.changelogs);if(t.dryRun){i&&i.stop(),(0,C.S5)({action:"module.release",target:S(p,e),request:{name:t.name||null,version:l,changelogs:t.changelogs||null,configSource:o,configSizeBytes:s},checks:[(0,C.Iy)("module exists",!0,`${p.name} (${p._id})`),(0,C.Iy)("module is private",!p.is_public),(0,C.Iy)("release config loaded",!0,`${s} bytes`)],json:t.json});return}var u=yield a.releaseModule({id:e,config:r,...t.name?{name:t.name}:{},releaseCurrentVersion:l,releaseCurrentVersionNote:d});t.json?(0,C.yd)({action:"module.release",target:S(u||p,e),result:{name:t.name||null,version:l,configSource:o,configSizeBytes:s},json:!0}):i.succeed(`Module released: ${g.Ay.green(u?.name||p.name)}`)}catch(a){t.json?(0,_.OW)(a.message,{action:"module.release",target:{id:e}}):i.fail(`Failed to release module: ${a.message}`),process.exit(1)}}),function(e,t){return c.apply(this,arguments)})),T.command("project-pull <id>").description("Pull module source files from BRICKS platform").option("-j, --json","Output as JSON (for programmatic use)").action((m=h(function*(e,t){var a=(0,E.o)(),i=t.json?null:(0,y.default)("Pulling module project...").start();try{var n=yield a.moduleProject({id:e,buildApplicationOnly:!0});n||(i?i.fail("Module project not found"):console.error(JSON.stringify({error:"Module project not found"})),process.exit(1)),t.json?console.log(JSON.stringify(n)):(i.succeed(`Module project fetched: ${g.Ay.green(n.files?.length||0)} files`),console.log(JSON.stringify(n,null,2)))}catch(e){t.json?console.error(JSON.stringify({error:e.message})):i.fail(`Failed to pull module project: ${e.message}`),process.exit(1)}}),function(e,t){return m.apply(this,arguments)})),T.command("ctor-init <id>").alias("project-init").description("Initialize a BRICKS Project from a module").option("-o, --output <dir>","Output directory (default: current directory)").option("--github-actions","Include GitHub Actions workflow (default: true)").option("--no-github-actions","Skip GitHub Actions workflow setup").option("--agents","Include AGENTS.md (default: true)").option("--no-agents","Skip AGENTS.md setup").option("--claude","Include CLAUDE.md (default: true)").option("--no-claude","Skip CLAUDE.md setup").option("--gemini","Include GEMINI.md (default: false)").option("--no-gemini","Skip GEMINI.md setup").option("--install","Run bun install after generation (default: true)").option("--no-install","Skip bun install after generation").option("--git","Initialize git repository (default: true)").option("--no-git","Skip git initialization").option("-y, --yes","Skip prompts and use defaults/flags").option("-j, --json","Output as JSON (for programmatic use)").action((f=h(function*(e,t){var i=(yield a.e(602).then(a.bind(a,6553))).initProject;yield i("module",e,t)}),function(e,t){return f.apply(this,arguments)}))},86141(e,t,a){a.d(t,{D:()=>V});var i,n,r,o,s,p,l,d,u,c=a(99436),m=a(35679),f=a(73284),h=a(30155),v=a(88958),g=a(73024),y=a(76760),b=a(48161),D=e=>{if(!e)return e;try{return g.realpathSync(e)}catch{return e}},x=a(68832),w=a(31421),_=a(51455),E="@fugood/bricks-cli",F="win32"===process.platform,A=(e,t)=>`https://cdn.bricks.tools/bricks-cli/${e}/${t}`,C=e=>"beta"===e?"beta":"latest",S=(i=c(function*(e){var t=yield fetch(e);if(!t.ok)throw Error(`Failed to fetch ${e}: HTTP ${t.status}`);return t}),function(e){return i.apply(this,arguments)}),T=(n=c(function*(e){return(yield S(A(e,"version.json"))).json()}),function(e){return n.apply(this,arguments)}),k=(r=c(function*(e){var t=C(e),a=yield S(`https://registry.npmjs.org/-/package/${E}/dist-tags`),i=(yield a.json())[t];if(!i)throw Error(`No '${t}' dist-tag for ${E}`);return{version:i}}),function(e){return r.apply(this,arguments)}),N=(o=c(function*(e,t){return"npm"===t||"bun"===t?k(e):T(e)}),function(e,t){return o.apply(this,arguments)}),O=(e,t,a={})=>{var i=(0,w.spawnSync)(e,t,{stdio:"inherit",...a});if(i.error){if("ENOENT"===i.error.code)throw Error(`Command not found: ${e}`);throw i.error}if(0!==i.status){var n=Error(`${e} exited with code ${i.status}`);throw n.code=i.status,n}},I=(s=c(function*(e,t){var a=yield S(e),i=Buffer.from((yield a.arrayBuffer())),n=y.join(b.tmpdir(),`bricks-cli-update-${process.pid}-${t}`);return yield _.writeFile(n,i),F||(yield _.chmod(n,493)),n}),function(e,t){return s.apply(this,arguments)}),$=(p=c(function*(e,{installDir:t}={}){var a=F?"install.ps1":"install.sh",i=yield I(A(e,a),a);try{var n=F?["powershell",["-NoProfile","-ExecutionPolicy","Bypass","-File",i,..."beta"===e?["-Beta"]:[],...t?["-InstallDir",t]:[]]]:["sh",[i,..."beta"===e?["--beta"]:[],...t?[`--dir=${t}`]:[]]],r=x(n,2),o=r[0],s=r[1];O(o,s)}finally{yield _.unlink(i).catch(()=>{})}}),function(e){return p.apply(this,arguments)}),j=(l=c(function*(e,t,a={}){if("npm"===e)return void O("npm",["install","-g",`${E}@${C(t)}`]);if("bun"===e)return void O("bun",["install","-g",`${E}@${C(t)}`]);if("binary"===e)return $(t,{installDir:a.installDir});throw Error(`Unsupported update method: ${e}`)}),function(e,t){return l.apply(this,arguments)}),B=a(8479),R=(d=c(function*({message:e,defaultValue:t,autoYes:a}){if(a)return!0;(0,B.z)()||(console.error(f.Ay.red("Refusing to prompt in a non-interactive shell. Pass -y/--yes to confirm.")),process.exit(1));try{return yield(0,v.lJ)({message:e,default:t})}catch{return!1}}),function(e){return d.apply(this,arguments)}),V=new m.uB("update-cli").description("Update the BRICKS CLI to the latest version").option("-y, --yes","Skip confirmation prompts").option("--channel <channel>","Override channel (release|beta)").option("--check-update","Only check whether a newer version is available and exit").action((u=c(function*(e){var t,a="2.25.0-beta.
|
|
125
|
+
${e.label} (${e.prefix}_)`)),e.refs.forEach(({shortId:e,ref:t})=>{var a=t?.title?g.Ay.gray(`- ${t.title}`):"";console.log(` ${g.Ay.green(e)} ${a}`)})}),console.log()}catch(e){i.fail(`Failed to fetch short edit references: ${e.message}`),process.exit(1)}}),function(e,t){return d.apply(this,arguments)})),T.command("remove <id>").description("Remove a module").option("--dry-run","Validate the target and show the removal plan without deleting it").option("-j, --json","Output as JSON").action((u=h(function*(e,t){var a=(0,E.o)(),i=t.json?null:(0,y.default)("Removing module...").start();try{var n=yield a.module({id:e});if(!n)throw Error("Module not found");var r=S(n,e);if(t.dryRun){i&&i.stop(),(0,C.S5)({action:"module.remove",target:r,request:{id:e},checks:[(0,C.Iy)("module exists",!0,`${r.name} (${r.id})`)],json:t.json});return}var o=yield a.removeModule({id:e});t.json?(0,C.yd)({action:"module.remove",target:r,result:{removed:!!o},json:!0}):i.succeed(`Module removed: ${g.Ay.green(r.name)}`)}catch(a){t.json?(0,_.OW)(a.message,{action:"module.remove",target:{id:e}}):i.fail(`Failed to remove module: ${a.message}`),process.exit(1)}}),function(e,t){return u.apply(this,arguments)})),T.command("release <id>").description("Release module to BRICKS platform").requiredOption("-c, --config <path|json>","Module config file path or JSON string").option("-n, --name <name>","Update module name as part of the release").option("--version <version>","Version name").option("--changelogs <text>","Release changelogs").option("--dry-run","Validate inputs and show the release plan without publishing").option("-j, --json","Output as JSON").action((c=h(function*(e,t){var a=(0,E.o)(),i=t.json?null:(0,y.default)("Releasing module...").start();try{var n=(0,A.Ku)(t.config),r=n.config,o=n.source,s=n.sizeBytes,p=yield a.module({id:e});if(!p)throw Error("Module not found");if(p.is_public)throw Error("Public module deployment is temporarily not recommended");var l=t.version||t.name||p.name||"Untitled",d=(0,A.w9)(t.changelogs);if(t.dryRun){i&&i.stop(),(0,C.S5)({action:"module.release",target:S(p,e),request:{name:t.name||null,version:l,changelogs:t.changelogs||null,configSource:o,configSizeBytes:s},checks:[(0,C.Iy)("module exists",!0,`${p.name} (${p._id})`),(0,C.Iy)("module is private",!p.is_public),(0,C.Iy)("release config loaded",!0,`${s} bytes`)],json:t.json});return}var u=yield a.releaseModule({id:e,config:r,...t.name?{name:t.name}:{},releaseCurrentVersion:l,releaseCurrentVersionNote:d});t.json?(0,C.yd)({action:"module.release",target:S(u||p,e),result:{name:t.name||null,version:l,configSource:o,configSizeBytes:s},json:!0}):i.succeed(`Module released: ${g.Ay.green(u?.name||p.name)}`)}catch(a){t.json?(0,_.OW)(a.message,{action:"module.release",target:{id:e}}):i.fail(`Failed to release module: ${a.message}`),process.exit(1)}}),function(e,t){return c.apply(this,arguments)})),T.command("project-pull <id>").description("Pull module source files from BRICKS platform").option("-j, --json","Output as JSON (for programmatic use)").action((m=h(function*(e,t){var a=(0,E.o)(),i=t.json?null:(0,y.default)("Pulling module project...").start();try{var n=yield a.moduleProject({id:e,buildApplicationOnly:!0});n||(i?i.fail("Module project not found"):console.error(JSON.stringify({error:"Module project not found"})),process.exit(1)),t.json?console.log(JSON.stringify(n)):(i.succeed(`Module project fetched: ${g.Ay.green(n.files?.length||0)} files`),console.log(JSON.stringify(n,null,2)))}catch(e){t.json?console.error(JSON.stringify({error:e.message})):i.fail(`Failed to pull module project: ${e.message}`),process.exit(1)}}),function(e,t){return m.apply(this,arguments)})),T.command("ctor-init <id>").alias("project-init").description("Initialize a BRICKS Project from a module").option("-o, --output <dir>","Output directory (default: current directory)").option("--github-actions","Include GitHub Actions workflow (default: true)").option("--no-github-actions","Skip GitHub Actions workflow setup").option("--agents","Include AGENTS.md (default: true)").option("--no-agents","Skip AGENTS.md setup").option("--claude","Include CLAUDE.md (default: true)").option("--no-claude","Skip CLAUDE.md setup").option("--gemini","Include GEMINI.md (default: false)").option("--no-gemini","Skip GEMINI.md setup").option("--install","Run bun install after generation (default: true)").option("--no-install","Skip bun install after generation").option("--git","Initialize git repository (default: true)").option("--no-git","Skip git initialization").option("-y, --yes","Skip prompts and use defaults/flags").option("-j, --json","Output as JSON (for programmatic use)").action((f=h(function*(e,t){var i=(yield a.e(602).then(a.bind(a,6553))).initProject;yield i("module",e,t)}),function(e,t){return f.apply(this,arguments)}))},86141(e,t,a){a.d(t,{D:()=>V});var i,n,r,o,s,p,l,d,u,c=a(99436),m=a(35679),f=a(73284),h=a(30155),v=a(88958),g=a(73024),y=a(76760),b=a(48161),D=e=>{if(!e)return e;try{return g.realpathSync(e)}catch{return e}},x=a(68832),w=a(31421),_=a(51455),E="@fugood/bricks-cli",F="win32"===process.platform,A=(e,t)=>`https://cdn.bricks.tools/bricks-cli/${e}/${t}`,C=e=>"beta"===e?"beta":"latest",S=(i=c(function*(e){var t=yield fetch(e);if(!t.ok)throw Error(`Failed to fetch ${e}: HTTP ${t.status}`);return t}),function(e){return i.apply(this,arguments)}),T=(n=c(function*(e){return(yield S(A(e,"version.json"))).json()}),function(e){return n.apply(this,arguments)}),k=(r=c(function*(e){var t=C(e),a=yield S(`https://registry.npmjs.org/-/package/${E}/dist-tags`),i=(yield a.json())[t];if(!i)throw Error(`No '${t}' dist-tag for ${E}`);return{version:i}}),function(e){return r.apply(this,arguments)}),N=(o=c(function*(e,t){return"npm"===t||"bun"===t?k(e):T(e)}),function(e,t){return o.apply(this,arguments)}),O=(e,t,a={})=>{var i=(0,w.spawnSync)(e,t,{stdio:"inherit",...a});if(i.error){if("ENOENT"===i.error.code)throw Error(`Command not found: ${e}`);throw i.error}if(0!==i.status){var n=Error(`${e} exited with code ${i.status}`);throw n.code=i.status,n}},I=(s=c(function*(e,t){var a=yield S(e),i=Buffer.from((yield a.arrayBuffer())),n=y.join(b.tmpdir(),`bricks-cli-update-${process.pid}-${t}`);return yield _.writeFile(n,i),F||(yield _.chmod(n,493)),n}),function(e,t){return s.apply(this,arguments)}),$=(p=c(function*(e,{installDir:t}={}){var a=F?"install.ps1":"install.sh",i=yield I(A(e,a),a);try{var n=F?["powershell",["-NoProfile","-ExecutionPolicy","Bypass","-File",i,..."beta"===e?["-Beta"]:[],...t?["-InstallDir",t]:[]]]:["sh",[i,..."beta"===e?["--beta"]:[],...t?[`--dir=${t}`]:[]]],r=x(n,2),o=r[0],s=r[1];O(o,s)}finally{yield _.unlink(i).catch(()=>{})}}),function(e){return p.apply(this,arguments)}),j=(l=c(function*(e,t,a={}){if("npm"===e)return void O("npm",["install","-g",`${E}@${C(t)}`]);if("bun"===e)return void O("bun",["install","-g",`${E}@${C(t)}`]);if("binary"===e)return $(t,{installDir:a.installDir});throw Error(`Unsupported update method: ${e}`)}),function(e,t){return l.apply(this,arguments)}),B=a(8479),R=(d=c(function*({message:e,defaultValue:t,autoYes:a}){if(a)return!0;(0,B.z)()||(console.error(f.Ay.red("Refusing to prompt in a non-interactive shell. Pass -y/--yes to confirm.")),process.exit(1));try{return yield(0,v.lJ)({message:e,default:t})}catch{return!1}}),function(e){return d.apply(this,arguments)}),V=new m.uB("update-cli").description("Update the BRICKS CLI to the latest version").option("-y, --yes","Skip confirmation prompts").option("--channel <channel>","Override channel (release|beta)").option("--check-update","Only check whether a newer version is available and exit").action((u=c(function*(e){var t,a="2.25.0-beta.42",i=(({execPath:e=process.execPath,scriptPath:t=process.argv[1],homeDir:a=b.homedir(),realpath:i=D}={})=>{let n;var r=(n=e)?y.basename(n).replace(/\.exe$/i,""):"";if("bricks"===r||"bricks-beta"===r)return{method:"binary",execPath:e,installDir:y.dirname(e)};var o=i(t),s=((e,t)=>{if(!e)return null;var a=y.sep,i=`${a}node_modules${a}${t.replace(/\//g,a)}${a}`,n=e.indexOf(i);return -1===n?null:e.slice(0,n)})(o,"@fugood/bricks-cli");if(s){var p=y.sep,l=y.join(a,".bun","install","global");return s===l||s.startsWith(l+p)?{method:"bun",installRoot:s}:/[\\/](?:\.pnpm|pnpm[\\/]global)[\\/]/.test(s)?{method:"pnpm",installRoot:s}:/[\\/](?:\.yarn|yarn[\\/]global)[\\/]/.test(s)?{method:"yarn",installRoot:s}:{method:"npm",installRoot:s.endsWith(`${p}lib`)?s.slice(0,-`${p}lib`.length):s}}return{method:"unknown",execPath:e,scriptPath:o}})(),n=e.channel||(({version:e,execPath:t}={})=>{var a=t||process.execPath;return a&&/[\\/]bricks-beta(?:\.exe)?$/i.test(a)||/-(beta|alpha|rc|next)\b/i.test(e||"2.25.0-beta.42")?"beta":"release"})({version:a,execPath:i.execPath});console.log(f.Ay.bold(e.checkUpdate?"BRICKS CLI Update Check":"BRICKS CLI Update")),console.log("─".repeat(60)),console.log(`Current version : ${f.Ay.cyan(a)}`),console.log(`Channel : ${f.Ay.cyan(n)}`),console.log(`Detected method : ${f.Ay.cyan(i.method)}`),i.execPath&&"binary"===i.method&&console.log(`Binary path : ${f.Ay.gray(i.execPath)}`),i.installRoot&&console.log(`Install root : ${f.Ay.gray(i.installRoot)}`);var r="npm"===i.method||"bun"===i.method?"npm":"cdn",o=(0,h.default)(`Fetching latest version info (${r})...`).start(),s=null,p=null;try{s=(yield N(n,i.method)).version,o.succeed(`Latest ${n} (${r}): ${f.Ay.green(s)}`)}catch(e){p=e,o.warn(`Could not fetch version info: ${e.message}`)}var l=s&&s===a;if(e.checkUpdate){if(p&&process.exit(2),l)return void console.log(f.Ay.green("\nUp to date."));s&&(console.log(f.Ay.yellow(`
|
|
124
126
|
Update available: ${a} → ${s}. Run 'bricks update-cli' to install.`)),process.exit(1)),console.log(f.Ay.yellow("\nCould not determine current version.")),process.exit(2)}if(l&&(console.log(f.Ay.green("\nAlready running the latest version.")),!(yield R({message:"Reinstall anyway?",defaultValue:!1,autoYes:e.yes}))))return void console.log(f.Ay.gray("Skipped."));var d=["npm","bun","binary"].includes(i.method);d||console.log(f.Ay.yellow(`Cannot auto-detect installer (method: ${i.method}); falling back to binary install.`));var u=d?i.method:"binary";if(!(yield R({message:`Update CLI using "${u}" method?`,defaultValue:!0,autoYes:e.yes})))return void console.log(f.Ay.yellow("Cancelled."));var m=(t=c(function*(e){console.log(f.Ay.cyan(`
|
|
125
127
|
→ Running ${e} update...`));try{return yield j(e,n,i),!0}catch(t){return console.error(f.Ay.yellow(`
|
|
126
128
|
${e} update failed: ${t.message}`)),!1}}),function(e){return t.apply(this,arguments)}),v=yield m(u);!v&&"binary"!==u&&(console.log(f.Ay.cyan("\nFalling back to binary install (same method used by the desktop app).")),(yield R({message:"Try the binary installer as a fallback?",defaultValue:!0,autoYes:e.yes}))&&(v=yield m("binary"))),v||(console.error(f.Ay.red("\nUpdate failed. See messages above.")),process.exit(1)),console.log(f.Ay.green("\nUpdate complete."))}),function(e){return u.apply(this,arguments)}))},92642(e,t,a){a.d(t,{W:()=>w});var i,n,r,o=a(99436),s=a(5018),p=a(44668),l=a(4275),d=a(32235),u=a(62192),c=a(79657),m=a(64007);function f(e){var t,a,i,n=2;for("u">typeof Symbol&&(a=Symbol.asyncIterator,i=Symbol.iterator);n--;){if(a&&null!=(t=e[a]))return t.call(e);if(i&&null!=(t=e[i]))return new h(t.call(e));a="@@asyncIterator",i="@@iterator"}throw TypeError("Object is not async iterable")}function h(e){function t(e){if(Object(e)!==e)return Promise.reject(TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return(h=function(e){this.s=e,this.n=e.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var a=this.s.return;return void 0===a?Promise.resolve({value:e,done:!0}):t(a.apply(this.s,arguments))},throw:function(e){var a=this.s.return;return void 0===a?Promise.reject(e):t(a.apply(this.s,arguments))}},new h(e)}function v(){return(v=l(function*(e){var t=e.headers.get("content-type")||"";if(t.includes("application/json")){var a=yield d(e.json());if(a.errors?.length)throw Error(a.errors.map(e=>e.message).join("\n"));var i=Object.keys(a.data||{})[0];if(i&&Array.isArray(a.data[i]))for(var n of a.data[i])yield n;return}var r=t.match(/boundary="?([^";]+)"?/),o=r?r[1]:"-",s=`--${o}`,p="",l=!1,c=new TextDecoder,m=function*(){for(var e;-1!==(e=p.indexOf(s));){var t=p.slice(0,e);(p=p.slice(e+s.length)).startsWith("\r\n")?p=p.slice(2):p.startsWith("\n")&&(p=p.slice(1));var a=t.indexOf("\r\n\r\n"),i=-1!==a?t.slice(a+4).trim():t.trim();if(i){var n=void 0;try{n=JSON.parse(i)}catch{continue}if(n.errors?.length)throw Error(n.errors.map(e=>e.message).join("\n"));if(n.data){for(var r of Object.values(n.data))if(Array.isArray(r))for(var o of r)yield o}if(Array.isArray(n.incremental)){for(var d of n.incremental)if(Array.isArray(d.items))for(var u of d.items)yield u}if(!1===n.hasNext){l=!0;return}}}};try{var h=!1,v=!1;try{for(var g,y,b=f(e.body);h=!(y=yield d(b.next())).done;h=!1){var D=y.value;if(p+=c.decode(D,{stream:!0}),yield*u(f(m()),d),l)break}}catch(e){v=!0,g=e}finally{try{h&&null!=b.return&&(yield d(b.return()))}finally{if(v)throw g}}}catch(e){if(!e.message?.includes("Premature close")||!l)throw e}if(!l&&p.trim()){var x,w=p.indexOf("\r\n\r\n"),_=-1!==w?p.slice(w+4).trim():p.trim();if(_&&!_.startsWith("--")){try{x=JSON.parse(_)}catch{}if(x){if(x.errors?.length)throw Error(x.errors.map(e=>e.message).join("\n"));if(x.data){for(var E of Object.values(x.data))if(Array.isArray(E))for(var F of E)yield F}if(Array.isArray(x.incremental)){for(var A of x.incremental)if(Array.isArray(A.items))for(var C of A.items)yield C}!1===x.hasNext&&(l=!0)}}}e.body?.destroy()})).apply(this,arguments)}var g=`
|
|
@@ -1012,7 +1014,7 @@ ${e} update failed: ${t.message}`)),!1}}),function(e){return t.apply(this,argume
|
|
|
1012
1014
|
lastSeenAt
|
|
1013
1015
|
}
|
|
1014
1016
|
}
|
|
1015
|
-
`},1878(e,t,a){a.a(e,async function(e,i){try{a.d(t,{A:()=>C,e:()=>A});var n,r=a(99436),o=a(35679),s=a(73284),p=a(47988),l=a(8479),d=a(55614),u=a(1983),c=a(17422),m=a(32541),f=a(28634),h=a(37818),v=a(23699),g=a(71335),y=a(429),b=a(80274),D=a(42400),x=a(98247),w=a(11405),_=a(86141),E=a(59845),F=e([D]);D=(F.then?(await F)():F)[0];var A=(n=r(function*(){var e,t=process.argv.findIndex(e=>"--auth-profile"===e||"-ap"===e);-1!==t&&process.argv[t+1]&&((0,p.setProfileOverride)(process.argv[t+1]),process.argv.splice(t,2)),o.DM.name("bricks").description("BRICKS CLI - Command-line interface for BRICKS Workspace API").version("2.25.0-beta.
|
|
1017
|
+
`},1878(e,t,a){a.a(e,async function(e,i){try{a.d(t,{A:()=>C,e:()=>A});var n,r=a(99436),o=a(35679),s=a(73284),p=a(47988),l=a(8479),d=a(55614),u=a(1983),c=a(17422),m=a(32541),f=a(28634),h=a(37818),v=a(23699),g=a(71335),y=a(429),b=a(80274),D=a(42400),x=a(98247),w=a(11405),_=a(86141),E=a(59845),F=e([D]);D=(F.then?(await F)():F)[0];var A=(n=r(function*(){var e,t=process.argv.findIndex(e=>"--auth-profile"===e||"-ap"===e);-1!==t&&process.argv[t+1]&&((0,p.setProfileOverride)(process.argv[t+1]),process.argv.splice(t,2)),o.DM.name("bricks").description("BRICKS CLI - Command-line interface for BRICKS Workspace API").version("2.25.0-beta.42","-v, --version","output the version number").enablePositionalOptions(),o.DM.addCommand(d.s),o.DM.addCommand(u._),o.DM.addCommand(c.B),o.DM.addCommand(m.A),o.DM.addCommand(f.p),o.DM.addCommand(h.u),o.DM.addCommand(v.E),o.DM.addCommand(g.oT),o.DM.addCommand(y.K),o.DM.addCommand(b.gf),o.DM.addCommand(D.D),o.DM.addCommand(x.v),o.DM.addCommand(w.l),o.DM.addCommand(_.D),o.DM.addCommand(E.Q),o.DM.command("interactive").alias("i").description("Start interactive mode with Ink UI").action(r(function*(){try{var e=(yield Promise.all([a.e(3),a.e(940)]).then(a.bind(a,92319))).runInteractiveMode;yield e()}catch(e){console.error(s.Ay.red(`Failed to start interactive mode: ${e.message}`)),process.exit(1)}})),o.DM.command("workspace").alias("ws").description("Show current workspace information").option("-j, --json","Output as JSON").action((e=r(function*(e){var t=yield Promise.resolve().then(a.bind(a,47988)),i=t.getToken,n=t.getBaseUrl,r=t.getCurrentProfile,o=(yield Promise.resolve().then(a.bind(a,85382))).createClient,p=(yield Promise.resolve().then(a.bind(a,30155))).default,l=r(),d=i(l);d||(console.error(s.Ay.red("Not logged in. Use `bricks auth login` first.")),process.exit(1));var u=p("Fetching workspace info...").start();try{var c=o(n(),d),m=yield c.workspace();if(u.stop(),e.json)return void console.log(JSON.stringify(m,null,2));console.log(s.Ay.bold("\nWorkspace Information")),console.log("─".repeat(60)),console.log(`Name: ${s.Ay.green(m.name)}`),console.log(`ID: ${s.Ay.gray(m._id)}`),console.log(`Description: ${m.description||s.Ay.gray("N/A")}`),console.log(`
|
|
1016
1018
|
${s.Ay.bold("Data")}`),console.log(`Remote Update: ${m.bank?.enable_remote_update?s.Ay.green("Enabled"):s.Ay.gray("Disabled")}`),console.log(`Spacename: ${m.bank?.spacename||s.Ay.gray("N/A")}`),console.log("─".repeat(60))}catch(e){u.fail(`Failed to get workspace: ${e.message}`),process.exit(1)}}),function(t){return e.apply(this,arguments)})),o.DM.on("--help",()=>{console.log(""),console.log(s.Ay.bold("Examples:")),console.log(""),console.log(s.Ay.gray(" # Login with a one-time passcode (recommended)")),console.log(" $ bricks auth login <passcode>"),console.log(""),console.log(s.Ay.gray(" # List all devices")),console.log(" $ bricks device list"),console.log(""),console.log(s.Ay.gray(" # Monitor devices in real-time")),console.log(" $ bricks device monitor"),console.log(""),console.log(s.Ay.gray(" # Control a device")),console.log(" $ bricks device refresh <device-id>"),console.log(" $ bricks device control <device-id> clear-cache"),console.log(""),console.log(s.Ay.gray(" # Bind a new device")),console.log(' $ bricks device bind <passcode> -n "My Device"'),console.log(""),console.log(s.Ay.gray(" # List applications")),console.log(" $ bricks app list"),console.log(""),console.log(s.Ay.gray(" # Start interactive mode")),console.log(" $ bricks interactive"),console.log(""),console.log(s.Ay.gray(" # Change API endpoint")),console.log(" $ bricks config endpoint beta"),console.log(""),console.log(s.Ay.gray("Get workspace token from BRICKS Controller:")),console.log(s.Ay.cyan(" https://control.bricks.tools")),console.log(s.Ay.gray(" Go to Workspace Settings > API Token"))});var i=process.argv.slice(2);if(0===i.length){if((0,l.b)(i))try{var n=(yield Promise.all([a.e(3),a.e(940)]).then(a.bind(a,92319))).runInteractiveMode;yield n();return}catch(e){console.error(s.Ay.red(`Failed to start interactive mode: ${e.message}`)),process.exit(1)}console.error(s.Ay.gray("No command provided. Interactive mode requires a TTY, so showing help instead.\n")),o.DM.outputHelp();return}yield o.DM.parseAsync(process.argv)}),function(){return n.apply(this,arguments)});let C=A;i()}catch(e){i(e)}})},56493(e,t,a){a.d(t,{o:()=>o});var i=a(73284),n=a(47988),r=a(85382),o=()=>{var e=(0,n.getCurrentProfile)(),t=(0,n.getToken)(e);return t||(console.error(i.Ay.red("Not logged in. Use `bricks auth login` first.")),process.exit(1)),(0,r.createClient)((0,n.getBaseUrl)(),t)}},7586(e,t,a){a.d(t,{$l:()=>r,GF:()=>i,OW:()=>n});var i=e=>{console.log(JSON.stringify(e,null,2))},n=(e,t={})=>{console.error(JSON.stringify({ok:!1,error:{message:e,...t}},null,2))},r=(e,t=4)=>e?e.length<=2*t?"*".repeat(e.length):`${e.slice(0,t)}…${e.slice(-t)}`:null},8479(e,t,a){a.d(t,{b:()=>n,z:()=>i});var i=()=>!!(process.stdin.isTTY&&process.stdout.isTTY&&"function"==typeof process.stdin.setRawMode),n=(e=[])=>0===e.length&&i()},47988(e,t,a){a.r(t),a.d(t,{CONFIG_DIR:()=>o,CONFIG_PATH:()=>s,clearBankCredentials:()=>E,clearConfig:()=>C,default:()=>S,getActivityLogBaseUrl:()=>F,getBankCredentials:()=>w,getBaseUrl:()=>l,getCurrentProfile:()=>y,getCurrentProfileSource:()=>b,getToken:()=>c,getTokenInfo:()=>m,getTokens:()=>u,listProfiles:()=>x,removeToken:()=>h,setActivityLogBaseUrl:()=>A,setBankCredentials:()=>_,setBaseUrl:()=>d,setCurrentProfile:()=>D,setProfileOverride:()=>g,setToken:()=>f});var i=a(83440),n=a(16928),r=a(70857),o=n.join(r.homedir(),".bricks-cli"),s=n.join(o,"config.json"),p=new i.default({projectName:"bricks-cli",cwd:o,schema:{tokens:{type:"object",default:{},additionalProperties:{type:"object",properties:{token:{type:"string"},name:{type:"string"},workspaceId:{type:"string"},workspaceName:{type:"string"},workspaceBilling:{type:"object"},createdAt:{type:"string"},baseUrl:{type:"string"},bank:{type:"object"}}}},currentProfile:{type:"string",default:"default"},baseUrl:{type:"string",default:"https://display.bricks.tools"},activityLogBaseUrl:{type:"string",default:"https://activity-log.bricks.tools"},devtoolsTokens:{type:"object",default:{},additionalProperties:{type:"object",additionalProperties:{type:"object",properties:{token:{type:"string"},expiresAt:{type:"string"},jti:{type:"string"},workspaceId:{type:"string"}}}}}}}),l=()=>{var e=y(),t=p.get("tokens");return t[e]?.baseUrl||p.get("baseUrl")},d=(e,t)=>{if(!t)return void p.set("baseUrl",e);var a=p.get("tokens");a[t]||(a[t]={}),a[t].baseUrl=e,p.set("tokens",a)},u=()=>p.get("tokens"),c=(e="default")=>{var t=p.get("tokens");return t[e]?.token},m=(e="default")=>p.get("tokens")[e],f=(e,t)=>{var a=p.get("tokens"),i=a[e];a[e]={...i?.baseUrl?{baseUrl:i.baseUrl}:{},...i?.activityLogBaseUrl?{activityLogBaseUrl:i.activityLogBaseUrl}:{},...t,createdAt:new Date().toISOString()},p.set("tokens",a)},h=e=>{var t=p.get("tokens");delete t[e],p.set("tokens",t)},v=null,g=e=>{v=e},y=()=>v||process.env.BRICKS_PROFILE||p.get("currentProfile"),b=()=>v?"override":process.env.BRICKS_PROFILE?"env":"config",D=e=>p.set("currentProfile",e),x=()=>{var e=p.get("tokens"),t=p.get("currentProfile");return Object.keys(e).map(a=>({...e[a],name:a,current:a===t}))},w=(e="default")=>{var t=p.get("tokens");return t[e]?.bank||null},_=(e,t)=>{var a=p.get("tokens");a[e]||(a[e]={}),a[e].bank=t,p.set("tokens",a)},E=e=>{var t=p.get("tokens");return!!t[e]?.bank&&(delete t[e].bank,p.set("tokens",t),!0)},F=()=>{var e=y(),t=p.get("tokens");return t[e]?.activityLogBaseUrl||p.get("activityLogBaseUrl")},A=(e,t)=>{if(!t)return void p.set("activityLogBaseUrl",e);var a=p.get("tokens");a[t]||(a[t]={}),a[t].activityLogBaseUrl=e,p.set("tokens",a)},C=()=>{p.clear()};let S=p},75646(e,t,a){a.r(t),a.d(t,{discoverDevToolsServers:()=>d,httpProbeSubnet:()=>u,verifyDevToolsServer:()=>c});var i,n,r=a(99436),o=a(41314),s=a(48161),p="bricks-devtools",l=()=>{var e=[];for(var t of Object.values(s.networkInterfaces()))for(var a of t)if(function(){if("IPv4"!==a.family||a.internal)return 1;var t=a.address.split(".").map(Number),i=a.netmask.split(".").map(Number),n=t.map((e,t)=>(e|255&~i[t]).toString()).join(".");e.push({address:a.address,broadcast:n})}())continue;return e},d=({timeout:e=3e3,idleTimeout:t=0}={})=>new Promise((a,i)=>{var n=new Map,r=o.createSocket("udp4"),s=null,d=null,u=!1,c=()=>{if(!u){u=!0,clearTimeout(s),clearTimeout(d);try{r.close()}catch{}a([...n.values()])}};r.on("error",e=>{if(!u){u=!0,clearTimeout(s),clearTimeout(d);try{r.close()}catch{}i(e)}}),r.on("message",(e,a)=>{try{var i=JSON.parse(e.toString());if(i.s!==p||"ANNOUNCE"!==i.t&&"RESPONSE"!==i.t)return;var r=i.d?.info;if(!r)return;var o=a.address,s=`${o}:${r.port}`;n.has(s)||(n.set(s,{...r,address:o}),t&&!u&&(clearTimeout(d),d=setTimeout(c,t)))}catch{}}),r.bind(()=>{r.setBroadcast(!0);var t=Buffer.from(JSON.stringify({t:"QUERY",v:"1.0",s:p,d:{id:`cli-${Math.random().toString(36).substring(2,9)}`}})),a=new Set(["255.255.255.255","127.0.0.1"]);for(var i of l())a.add(i.broadcast);for(var n of a)r.send(t,0,t.length,19900,n);s=setTimeout(c,e)})}),u=(i=r(function*({port:e=19851,connectTimeout:t=500,concurrency:a=50,timeout:i=0}={}){var n=l();if(0===n.length)return[];var o=[],s=i>0?Date.now()+i:0,p=[],d=new Set;for(var u of n){var m=u.address.split(".").slice(0,3).join(".");if(!d.has(m)){d.add(m);for(var f=1;f<255;f++)p.push(`${m}.${f}`)}}for(var h=0;h<p.length&&!(s&&Date.now()>=s);h+=a){var v=p.slice(h,h+a);yield Promise.allSettled(v.map(function(){var a=r(function*(a){var i=yield c(a,e,t);i&&o.push({...i,address:a,port:e})});return function(e){return a.apply(this,arguments)}}()))}return o}),function(){return i.apply(this,arguments)}),c=(n=r(function*(e,t,a=3e3){try{var i=new AbortController,n=setTimeout(()=>i.abort(),a),r=yield fetch(`http://${e}:${t}/devtools/info`,{signal:i.signal});if(clearTimeout(n),!r.ok)return null;return yield r.json()}catch{return null}}),function(e,t){return n.apply(this,arguments)})},74049(e,t,a){a.d(t,{Ku:()=>s,w9:()=>o});var i=a(79896),n=a(16928),r=new Set(["CTOR","CTOR Desktop"]),o=e=>{var t,a=`Release by ${(t=process.env.BRICKS_RELEASE_SIGN)&&r.has(t)?t:"BRICKS CLI"}`;return e?`${e}
|
|
1017
1019
|
|
|
1018
1020
|
${a}`:a},s=e=>{if(e.endsWith(".json")||e.includes("/")){if(!i.existsSync(e))throw Error(`Config file not found: ${e}`);var t=i.readFileSync(e,"utf-8");return{config:t,source:{type:"file",path:n.resolve(e)},sizeBytes:Buffer.byteLength(t)}}return{config:e,source:{type:"inline"},sizeBytes:Buffer.byteLength(e)}}},68168(e,t,a){a.d(t,{K:()=>o,Y:()=>s});var i,n=a(99436),r=e=>String(e||"").trim().toLowerCase(),o=({resource:e,query:t,items:a,fields:i,selectedBy:n=null})=>{var o=r(t),s=a.filter(e=>i.some(t=>r(t.split(".").reduce((e,t)=>e?.[t],e)??null)===o)),p=null,l=n;return"id"===n?p=a[0]||null:1===s.length?(p=s[0],l="exact"):1===a.length&&(p=a[0],l="single"),{resource:e,query:t,exactMatchCount:s.length,matchCount:a.length,selectedBy:l,ambiguous:a.length>1&&!p,resolved:p,matches:a}},s=(i=n(function*(e){try{return yield e()}catch(e){if(/not found/i.test(e.message))return null;throw e}}),function(e){return i.apply(this,arguments)})},60450(e,t,a){a.d(t,{Gu:()=>m,he:()=>h,wR:()=>u});var i,n,r,o=a(99436),s=a(79657),p=a(73024),l=a(76760),d=a(48161),u=e=>e?.media_resource?.enable_media_workspace===!0,c=(i=o(function*(e,t,a){var i=yield e.mediaFiles({boxId:t,userTags:[`bricks_screenshot_${a}`],limit:1});return i?.[0]||null}),function(e,t,a){return i.apply(this,arguments)}),m=(e,{preferThumbnail:t=!1}={})=>{if(!e?.meta?.storageEndpoint)return null;var a=e.meta,i=a.storageEndpoint,n=a.originalFileKey,r=(t?(e=>{var t=e?.meta;if(!t)return null;if("Video"===e.fileType&&t.videoThumbOriginalFileKey)return t.videoThumbOriginalFileKey;var a=t.imageVersions||[];if(!Array.isArray(a)||0===a.length)return null;var i=a.filter(e=>e?.strategy==="BOUNDED"&&"number"==typeof e.width).sort((e,t)=>e.width-t.width);return(i[0]||a[0])?.key||null})(e):null)||n;return r?`${i}/${r}`:null},f=(n=o(function*(e,t=null){var a=yield(0,s.Ay)(e);if(!a.ok)throw Error(`Failed to download screenshot: ${a.statusText}`);var i=yield a.buffer(),n=t||l.join(d.tmpdir(),`bricks-screenshot-${Date.now()}.png`),r=l.dirname(n);return p.existsSync(r)||p.mkdirSync(r,{recursive:!0}),p.writeFileSync(n,i),n}),function(e){return n.apply(this,arguments)}),h=(r=o(function*(e,t,a,i=null,n={}){var r=u(t)&&t.media_resource?.system_media_box_id||null;if(!r)return{error:"Media workspace not enabled for this workspace"};var o=yield c(e,r,a);if(!o)return{error:"No screenshot available for this device"};var s=m(o,n);return s?{path:yield f(s,i),file:o,url:s}:{error:"Could not build screenshot URL"}}),function(e,t,a){return r.apply(this,arguments)})},44618(e,t,a){a.d(t,{V:()=>r});var i={S:"Subspace",B:"Brick",C:"Canvas",A:"Animation",G:"Generator",D:"Data",F:"Data Calc",N:"Calc Node",T:"Test",TC:"Test Case",AT:"Automation Map"},n=e=>e?.split("_")?.[0]||"",r=(e,{keyword:t,types:a}={})=>{var r=t?.trim().toLowerCase()||"",o=a?.length>0?new Set(a.flatMap(e=>{var t=String(e).trim().toUpperCase();return t?[t]:[]})):null;return Object.entries(Object.entries(e||{}).filter(([,e])=>e&&!e.hide).filter(([e,t])=>{var a=n(e);if(o&&!o.has(a))return!1;if(!r)return!0;var i=t?.title?String(t.title).toLowerCase():"";return e.toLowerCase().includes(r)||i.includes(r)}).reduce((e,[t,a])=>{var i=n(t);return e[i]||(e[i]=[]),e[i].push({shortId:t,ref:a}),e},{})).map(([e,t])=>({prefix:e,label:i[e]||e,refs:t.sort((e,t)=>{var a=e.ref?.title||e.shortId,i=t.ref?.title||t.shortId;return String(a).localeCompare(String(i))})})).sort((e,t)=>e.label.localeCompare(t.label))}},94979(e,t,a){a.d(t,{p:()=>r});var i=/^(\d+)(s|m|h|d|w)$/,n={s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5};function r(e){var t=e.match(i);if(t){var a=parseInt(t[1],10),r=n[t[2]];return new Date(Date.now()-a*r).toISOString()}var o=new Date(e);if(isNaN(o.getTime()))throw Error(`Invalid time format: "${e}". Use ISO 8601 or relative (e.g. 1h, 30m, 2d)`);return o.toISOString()}},98593(e,t,a){a.d(t,{Iy:()=>r,S5:()=>s,yd:()=>p});var i=a(73284),n=a(7586),r=(e,t,a)=>({label:e,ok:t,detail:a}),o=e=>null==e?i.Ay.gray("N/A"):"object"==typeof e?i.Ay.gray(JSON.stringify(e,null,2)):String(e),s=({action:e,target:t,request:a,checks:r=[],json:s=!1})=>{s?(0,n.GF)({ok:!0,dryRun:!0,action:e,target:t||null,request:a||null,checks:r}):(console.log(i.Ay.bold(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fugood/bricks-cli",
|
|
3
|
-
"version": "2.25.0-beta.
|
|
3
|
+
"version": "2.25.0-beta.42",
|
|
4
4
|
"description": "BRICKS CLI - Command-line interface for BRICKS Workspace API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bricks",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"engines": {
|
|
71
71
|
"node": ">=18.0.0"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "ef7ddb9d131b8e0f429f68d16585eb254f85e8e1"
|
|
74
74
|
}
|