@superblocksteam/cli 2.0.3-next.171 → 2.0.3-next.173

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -78160,16 +78160,16 @@ var require_socket = __commonJS({
78160
78160
  }
78161
78161
  };
78162
78162
  exports2.ISocket = ISocket3;
78163
- var proxyTarget2 = Object.freeze(() => {
78163
+ var proxyTarget = Object.freeze(() => {
78164
78164
  });
78165
- function createIsocketProxy2(socket, path45) {
78166
- return new Proxy(proxyTarget2, {
78165
+ function createIsocketProxy(socket, path45) {
78166
+ return new Proxy(proxyTarget, {
78167
78167
  get(_target, prop) {
78168
78168
  const childPath = path45 ? `${path45}.${prop}` : prop;
78169
78169
  if (childPath === "then") {
78170
78170
  return void 0;
78171
78171
  }
78172
- return createIsocketProxy2(socket, childPath);
78172
+ return createIsocketProxy(socket, childPath);
78173
78173
  },
78174
78174
  apply(_target, _thisArg, args) {
78175
78175
  if (path45 === void 0) {
@@ -78187,7 +78187,7 @@ var require_socket = __commonJS({
78187
78187
  return {
78188
78188
  close: () => socket.close(),
78189
78189
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
78190
- call: createIsocketProxy2(socket, void 0)
78190
+ call: createIsocketProxy(socket, void 0)
78191
78191
  };
78192
78192
  }
78193
78193
  exports2.createISocketClient = createISocketClient4;
@@ -252397,7 +252397,7 @@ init_cjs_shims();
252397
252397
  // ../sdk/dist/client.js
252398
252398
  init_cjs_shims();
252399
252399
  var import_bucketeer_sdk = __toESM(require_dist2(), 1);
252400
- var import_shared = __toESM(require_dist3(), 1);
252400
+ var import_shared2 = __toESM(require_dist3(), 1);
252401
252401
  var import_util4 = __toESM(require_dist4(), 1);
252402
252402
  import * as fs from "fs";
252403
252403
 
@@ -255848,6 +255848,7 @@ var FeatureFlags = class {
255848
255848
 
255849
255849
  // ../sdk/dist/socket/index.js
255850
255850
  init_cjs_shims();
255851
+ var import_shared = __toESM(require_dist3(), 1);
255851
255852
 
255852
255853
  // ../../../../node_modules/.pnpm/ws@8.18.2/node_modules/ws/wrapper.mjs
255853
255854
  init_cjs_shims();
@@ -255894,15 +255895,6 @@ var ProfileType;
255894
255895
 
255895
255896
  // ../sdk/dist/types/socket.js
255896
255897
  init_cjs_shims();
255897
- var SocketErrorException = class extends Error {
255898
- code;
255899
- message;
255900
- constructor(code, message) {
255901
- super(message);
255902
- this.code = code;
255903
- this.message = message;
255904
- }
255905
- };
255906
255898
 
255907
255899
  // ../sdk/dist/types/plugin.js
255908
255900
  init_cjs_shims();
@@ -256120,227 +256112,6 @@ function createRequestHandlers({ agentUrl, token: token2 }) {
256120
256112
  return requestHandlers;
256121
256113
  }
256122
256114
 
256123
- // ../sdk/dist/socket/socket.js
256124
- init_cjs_shims();
256125
- var ISocket = class {
256126
- ws;
256127
- requestHandlers;
256128
- globalMiddlewares;
256129
- responseHandler = /* @__PURE__ */ new Map();
256130
- peerAuthorization;
256131
- nxtRequestId;
256132
- connectionTimeout;
256133
- // pino library not available in shared
256134
- logger;
256135
- timeouts;
256136
- constructor(ws, requestHandlers, globalMiddlewares, timeouts, logger3) {
256137
- this.ws = ws;
256138
- this.requestHandlers = requestHandlers;
256139
- this.globalMiddlewares = globalMiddlewares;
256140
- this.nxtRequestId = 0;
256141
- this.logger = logger3 ?? { error: console.error };
256142
- this.timeouts = timeouts;
256143
- this.resetConnectionTimeout();
256144
- this.ws.addEventListener("message", async (event) => {
256145
- const eventData = JSON.parse(event.data.toString());
256146
- return this.handleMessage(eventData);
256147
- });
256148
- }
256149
- async handleMessage(message) {
256150
- this.resetConnectionTimeout();
256151
- if (message.request) {
256152
- const parts = message.request.method.split(".");
256153
- let handlers = this.requestHandlers;
256154
- for (const part of parts) {
256155
- handlers = handlers[part];
256156
- if (!handlers) {
256157
- return this.respondError(message.request.id, {
256158
- code: 2,
256159
- message: `unknown method ${message.request.method}`
256160
- });
256161
- }
256162
- }
256163
- if (!Array.isArray(handlers)) {
256164
- return this.respondError(message.request.id, {
256165
- code: 2,
256166
- message: "unknown method"
256167
- });
256168
- }
256169
- handlers = [...this.globalMiddlewares, ...handlers];
256170
- if (message.request.setAuthorization) {
256171
- this.peerAuthorization = message.request.setAuthorization;
256172
- }
256173
- const reqCtx = {
256174
- peerAuthorization: this.peerAuthorization,
256175
- method: message.request.method,
256176
- requestId: message.request.id
256177
- };
256178
- const client = createISocketClient(this);
256179
- const payload = message.request.payload;
256180
- let alreadyResponded = false;
256181
- const generateNextFn = (idx) => {
256182
- let wasCalled = false;
256183
- return async () => {
256184
- if (alreadyResponded) {
256185
- throw new SocketErrorException(4, "next() was called after the response was sent");
256186
- }
256187
- const handler = handlers[idx];
256188
- if (!handler) {
256189
- throw new SocketErrorException(5, "cannot call past the last handler in the chain");
256190
- }
256191
- if (wasCalled) {
256192
- throw new SocketErrorException(6, "next() was called multiple times");
256193
- }
256194
- wasCalled = true;
256195
- return this.callHandler(handler, payload, reqCtx, client, generateNextFn(idx + 1));
256196
- };
256197
- };
256198
- let response;
256199
- try {
256200
- response = await generateNextFn(0)();
256201
- } catch (error) {
256202
- const socketError = error instanceof SocketErrorException ? { code: error.code, message: error.message } : { code: 3, message: error.toString() };
256203
- return this.respondError(message.request.id, socketError);
256204
- }
256205
- this.respond(message.request.id, response);
256206
- alreadyResponded = true;
256207
- } else if (message.response && message.response.id) {
256208
- const responseHandler = this.responseHandler.get(message.response.id);
256209
- if (!responseHandler) {
256210
- return;
256211
- }
256212
- if (message.response.error) {
256213
- responseHandler.reject(message.response.error);
256214
- }
256215
- responseHandler.resolve(message.response.payload);
256216
- clearTimeout(responseHandler.timeout);
256217
- this.responseHandler.delete(message.response.id);
256218
- } else {
256219
- return this.respondError(-1, {
256220
- code: 3,
256221
- message: "unknown request id"
256222
- });
256223
- }
256224
- }
256225
- async callHandler(handler, params, ctx, client, next) {
256226
- return handler(params, ctx, client, next);
256227
- }
256228
- request(method, params, authorization) {
256229
- return new Promise((resolve8, reject) => {
256230
- const requestId = ++this.nxtRequestId;
256231
- this.responseHandler.set(requestId, {
256232
- resolve: (result) => resolve8(result),
256233
- reject: (error) => reject(error)
256234
- });
256235
- const toSend = {
256236
- request: {
256237
- method,
256238
- payload: params,
256239
- id: requestId,
256240
- setAuthorization: authorization
256241
- }
256242
- };
256243
- this.ws.send(JSON.stringify(toSend));
256244
- this.resetNoResponseTimeout(requestId);
256245
- });
256246
- }
256247
- respond(requestId, result) {
256248
- const toSend = {
256249
- response: {
256250
- payload: result,
256251
- id: requestId,
256252
- error: null
256253
- }
256254
- };
256255
- return this.ws.send(JSON.stringify(toSend));
256256
- }
256257
- respondError(requestId, error) {
256258
- const toSend = {
256259
- response: {
256260
- payload: null,
256261
- id: requestId,
256262
- error
256263
- }
256264
- };
256265
- return this.ws.send(JSON.stringify(toSend));
256266
- }
256267
- resetConnectionTimeout() {
256268
- if (!this.timeouts?.connectionTimeoutInSeconds) {
256269
- return;
256270
- }
256271
- if (this.connectionTimeout) {
256272
- clearTimeout(this.connectionTimeout);
256273
- }
256274
- this.connectionTimeout = setTimeout(this.handleConnectionTimeout(), this.timeouts?.connectionTimeoutInSeconds * 1e3);
256275
- }
256276
- handleConnectionTimeout() {
256277
- return () => {
256278
- this.logger.error(`Connection timed out after ${this.timeouts?.connectionTimeoutInSeconds} seconds`);
256279
- this.close();
256280
- };
256281
- }
256282
- resetNoResponseTimeout(requestId) {
256283
- if (!this.timeouts?.noResponseTimeoutInSeconds) {
256284
- return;
256285
- }
256286
- const responseHandler = this.responseHandler.get(requestId);
256287
- if (!responseHandler) {
256288
- return;
256289
- }
256290
- const noResponseTimeout = responseHandler.timeout;
256291
- const reject = responseHandler.reject;
256292
- if (responseHandler.timeout) {
256293
- clearTimeout(noResponseTimeout);
256294
- }
256295
- responseHandler.timeout = setTimeout(this.handleNoResponseTimeout(reject), this.timeouts?.noResponseTimeoutInSeconds * 1e3);
256296
- }
256297
- handleNoResponseTimeout(reject) {
256298
- return () => {
256299
- const message = `Request timed out after ${this.timeouts?.noResponseTimeoutInSeconds} seconds`;
256300
- this.logger.error(message);
256301
- reject({ code: 7, message });
256302
- };
256303
- }
256304
- close() {
256305
- clearTimeout(this.connectionTimeout);
256306
- this.responseHandler.forEach((handler, key2) => {
256307
- clearTimeout(handler.timeout);
256308
- this.logger.error(`Rejecting pending requestId ${key2} due to connection close`);
256309
- handler.reject({ code: 8, message: "Connection closed" });
256310
- });
256311
- this.ws.close();
256312
- }
256313
- };
256314
- var proxyTarget = Object.freeze(() => {
256315
- });
256316
- function createIsocketProxy(socket, path45) {
256317
- return new Proxy(proxyTarget, {
256318
- get(_target, prop) {
256319
- const childPath = path45 ? `${path45}.${prop}` : prop;
256320
- if (childPath === "then") {
256321
- return void 0;
256322
- }
256323
- return createIsocketProxy(socket, childPath);
256324
- },
256325
- apply(_target, _thisArg, args) {
256326
- if (path45 === void 0) {
256327
- throw new Error("The root object is not callable");
256328
- }
256329
- if (path45.endsWith(".apply") && args.length === 2 && Array.isArray(args[1])) {
256330
- path45 = path45.slice(0, -".apply".length);
256331
- args = args[1];
256332
- }
256333
- return socket.request(path45, args[0]);
256334
- }
256335
- });
256336
- }
256337
- function createISocketClient(socket) {
256338
- return {
256339
- close: () => socket.close(),
256340
- call: createIsocketProxy(socket, void 0)
256341
- };
256342
- }
256343
-
256344
256115
  // ../sdk/dist/socket/index.js
256345
256116
  async function connectToISocketRPCServer({ superblocksBaseUrl, agentUrl, token: token2 }) {
256346
256117
  const requestHandlers = createRequestHandlers({
@@ -256366,7 +256137,7 @@ async function connectToISocketRPCServer({ superblocksBaseUrl, agentUrl, token:
256366
256137
  // 5 minutes
256367
256138
  });
256368
256139
  }
256369
- var ISocketWithClientAuth = class extends ISocket {
256140
+ var ISocketWithClientAuth = class extends import_shared.ISocket {
256370
256141
  authorization;
256371
256142
  hasSentAuth = false;
256372
256143
  constructor(ws, authorization, requestHandlers, globalMiddlewares, timeouts) {
@@ -256384,7 +256155,7 @@ var ISocketWithClientAuth = class extends ISocket {
256384
256155
  async function connectISocket(wsUrl, authorization, requestHandlers, globalMiddlewares, timeouts) {
256385
256156
  const ws = await connectWebSocket(wsUrl);
256386
256157
  const isocket = new ISocketWithClientAuth(ws, authorization, requestHandlers, globalMiddlewares, timeouts);
256387
- return createISocketClient(isocket);
256158
+ return (0, import_shared.createISocketClient)(isocket);
256388
256159
  }
256389
256160
  function connectWebSocket(wsUrl) {
256390
256161
  return new Promise((resolve8, reject) => {
@@ -256413,7 +256184,7 @@ var ResourceType;
256413
256184
  ResourceType2["BACKEND"] = "BACKEND";
256414
256185
  })(ResourceType || (ResourceType = {}));
256415
256186
  async function fetchApplication({ cliVersion, applicationId, branch, token: token2, superblocksBaseUrl, viewMode, commitId, skipSigningVerification = false, injectedHeaders = {} }) {
256416
- if (commitId && viewMode !== import_shared.ExportViewMode.EXPORT_COMMIT) {
256187
+ if (commitId && viewMode !== import_shared2.ExportViewMode.EXPORT_COMMIT) {
256417
256188
  throw new Error(`If commitId ${commitId} is provided, viewMode cannot be ${viewMode}`);
256418
256189
  }
256419
256190
  try {
@@ -257074,7 +256845,7 @@ function filesToFileDescriptors(files) {
257074
256845
 
257075
256846
  // ../sdk/dist/sdk.js
257076
256847
  init_cjs_shims();
257077
- var import_shared3 = __toESM(require_dist3(), 1);
256848
+ var import_shared4 = __toESM(require_dist3(), 1);
257078
256849
 
257079
256850
  // ../sdk/dist/dbfs/client.js
257080
256851
  init_cjs_shims();
@@ -257082,7 +256853,7 @@ var import_util6 = __toESM(require_dist4(), 1);
257082
256853
 
257083
256854
  // ../sdk/dist/dbfs/local.js
257084
256855
  init_cjs_shims();
257085
- var import_shared2 = __toESM(require_dist3(), 1);
256856
+ var import_shared3 = __toESM(require_dist3(), 1);
257086
256857
  var import_util5 = __toESM(require_dist4(), 1);
257087
256858
  import * as fsp2 from "node:fs/promises";
257088
256859
 
@@ -257181,7 +256952,7 @@ async function hashLocalDirectory(localDirectoryPath) {
257181
256952
  let entry;
257182
256953
  switch (localDirEntry.type) {
257183
256954
  case "-": {
257184
- const hash3 = await (0, import_shared2.hashFileContents)(localDirEntry.contents);
256955
+ const hash3 = await (0, import_shared3.hashFileContents)(localDirEntry.contents);
257185
256956
  entry = {
257186
256957
  type: "-",
257187
256958
  executable: localDirEntry.executable,
@@ -257213,7 +256984,7 @@ async function hashLocalDirectory(localDirectoryPath) {
257213
256984
  }
257214
256985
  directoryContents.push(entry);
257215
256986
  }
257216
- const hash2 = await (0, import_shared2.hashDirectoryContents)(directoryContents);
256987
+ const hash2 = await (0, import_shared3.hashDirectoryContents)(directoryContents);
257217
256988
  return { contents: directoryContents, hash: hash2 };
257218
256989
  }
257219
256990
  async function doUploadLocalDirectory(rpcClient, localDirectoryPath) {
@@ -257373,7 +257144,7 @@ var SuperblocksSdk = class {
257373
257144
  getFeatureFlagsForUser(user) {
257374
257145
  return new FeatureFlags(user.flagBootstrap);
257375
257146
  }
257376
- async fetchApplication({ applicationId, branch, headers = {}, viewMode = import_shared3.ExportViewMode.EXPORT_LIVE, skipSigningVerification = false }) {
257147
+ async fetchApplication({ applicationId, branch, headers = {}, viewMode = import_shared4.ExportViewMode.EXPORT_LIVE, skipSigningVerification = false }) {
257377
257148
  return fetchApplication({
257378
257149
  cliVersion: this.cliVersion,
257379
257150
  applicationId,
@@ -257394,7 +257165,7 @@ var SuperblocksSdk = class {
257394
257165
  injectedHeaders: headers
257395
257166
  });
257396
257167
  }
257397
- async fetchApplicationWithComponents({ applicationId, branch, headers = {}, viewMode = import_shared3.ExportViewMode.EXPORT_LIVE, commitId, skipSigningVerification = false }) {
257168
+ async fetchApplicationWithComponents({ applicationId, branch, headers = {}, viewMode = import_shared4.ExportViewMode.EXPORT_LIVE, commitId, skipSigningVerification = false }) {
257398
257169
  return fetchApplicationWithComponents({
257399
257170
  cliVersion: this.cliVersion,
257400
257171
  applicationId,
@@ -257434,7 +257205,7 @@ var SuperblocksSdk = class {
257434
257205
  async fetchApplications(headers) {
257435
257206
  return fetchApplications(this.cliVersion, this.token, this.superblocksBaseUrl, headers);
257436
257207
  }
257437
- async fetchApi({ apiId, branch, viewMode = import_shared3.ExportViewMode.EXPORT_LIVE, commitId, skipSigningVerification = false }) {
257208
+ async fetchApi({ apiId, branch, viewMode = import_shared4.ExportViewMode.EXPORT_LIVE, commitId, skipSigningVerification = false }) {
257438
257209
  return fetchApi(this.cliVersion, apiId, this.token, this.superblocksBaseUrl, viewMode, branch, commitId, skipSigningVerification);
257439
257210
  }
257440
257211
  async fetchApis() {
@@ -257510,7 +257281,7 @@ var SuperblocksSdk = class {
257510
257281
 
257511
257282
  // ../sdk/dist/version-control.mjs
257512
257283
  init_cjs_shims();
257513
- var import_shared4 = __toESM(require_dist3(), 1);
257284
+ var import_shared5 = __toESM(require_dist3(), 1);
257514
257285
  var import_util7 = __toESM(require_dist4(), 1);
257515
257286
  import * as https2 from "https";
257516
257287
  import path from "node:path";
@@ -262209,11 +261980,11 @@ var FileStructureType;
262209
261980
  function modeFlagToViewMode(modeFlag) {
262210
261981
  switch (modeFlag) {
262211
261982
  case LATEST_EDITS_MODE:
262212
- return import_shared4.ExportViewMode.EXPORT_LIVE;
261983
+ return import_shared5.ExportViewMode.EXPORT_LIVE;
262213
261984
  case MOST_RECENT_COMMIT_MODE:
262214
- return import_shared4.ExportViewMode.EXPORT_LATEST;
261985
+ return import_shared5.ExportViewMode.EXPORT_LATEST;
262215
261986
  case DEPLOYED_MODE:
262216
- return import_shared4.ExportViewMode.EXPORT_DEPLOYED;
261987
+ return import_shared5.ExportViewMode.EXPORT_DEPLOYED;
262217
261988
  default:
262218
261989
  throw new Error(`Unsupported mode flag: ${modeFlag}`);
262219
261990
  }
@@ -262972,7 +262743,7 @@ var import_sdk_node = __toESM(require_src32(), 1);
262972
262743
  // ../sdk/package.json
262973
262744
  var package_default = {
262974
262745
  name: "@superblocksteam/sdk",
262975
- version: "2.0.3-next.171",
262746
+ version: "2.0.3-next.173",
262976
262747
  type: "module",
262977
262748
  description: "Superblocks JS SDK",
262978
262749
  homepage: "https://www.superblocks.com",
@@ -263007,8 +262778,8 @@ var package_default = {
263007
262778
  "@rollup/wasm-node": "^4.35.0",
263008
262779
  "@superblocksteam/bucketeer-sdk": "0.4.1",
263009
262780
  "@superblocksteam/shared": "0.9122.0",
263010
- "@superblocksteam/util": "2.0.3-next.171",
263011
- "@superblocksteam/vite-plugin-file-sync": "2.0.3-next.171",
262781
+ "@superblocksteam/util": "2.0.3-next.173",
262782
+ "@superblocksteam/vite-plugin-file-sync": "2.0.3-next.173",
263012
262783
  "@vitejs/plugin-react": "^4.3.4",
263013
262784
  axios: "^1.4.0",
263014
262785
  chokidar: "^4.0.3",
@@ -263114,7 +262885,7 @@ import path21 from "node:path";
263114
262885
 
263115
262886
  // ../../../vite-plugin-file-sync/dist/file-sync-vite-plugin.js
263116
262887
  init_cjs_shims();
263117
- var import_shared20 = __toESM(require_dist3(), 1);
262888
+ var import_shared21 = __toESM(require_dist3(), 1);
263118
262889
  var import_body_parser = __toESM(require_body_parser(), 1);
263119
262890
  var import_common_tags2 = __toESM(require_lib7(), 1);
263120
262891
  import path17 from "node:path";
@@ -263273,13 +263044,13 @@ init_cjs_shims();
263273
263044
 
263274
263045
  // ../../../library-shared/dist/scope.js
263275
263046
  init_cjs_shims();
263276
- var import_shared5 = __toESM(require_dist3(), 1);
263047
+ var import_shared6 = __toESM(require_dist3(), 1);
263277
263048
  function getStableScopeId(scopeName) {
263278
- return (0, import_shared5.generatePredictableId)(`sc-${scopeName}`);
263049
+ return (0, import_shared6.generatePredictableId)(`sc-${scopeName}`);
263279
263050
  }
263280
263051
 
263281
263052
  // ../../../vite-plugin-file-sync/dist/binding-extraction/extract-identifiers.js
263282
- var import_shared7 = __toESM(require_dist3(), 1);
263053
+ var import_shared8 = __toESM(require_dist3(), 1);
263283
263054
 
263284
263055
  // ../../../vite-plugin-file-sync/dist/binding-extraction/extract-control-block-identifiers.js
263285
263056
  init_cjs_shims();
@@ -268014,9 +267785,9 @@ var extractPythonEvaluationBindings = async (pythonSnippet) => {
268014
267785
  async function extractBindingsFromValue(value2, pluginID) {
268015
267786
  if (value2?.toString) {
268016
267787
  const stringValue = value2.toString();
268017
- if (pluginID === import_shared7.LanguagePluginID.JavaScript) {
267788
+ if (pluginID === import_shared8.LanguagePluginID.JavaScript) {
268018
267789
  return await extractJsEvaluationBindings(stringValue);
268019
- } else if (pluginID === import_shared7.LanguagePluginID.Python) {
267790
+ } else if (pluginID === import_shared8.LanguagePluginID.Python) {
268020
267791
  return await extractPythonEvaluationBindings(stringValue);
268021
267792
  }
268022
267793
  const { jsSnippets } = getDynamicBindings(stringValue);
@@ -268053,14 +267824,14 @@ async function extractBindingsFromAction(action) {
268053
267824
  }
268054
267825
  var getLanguageConfiguration = (block) => {
268055
267826
  switch (block.step?.integration) {
268056
- case import_shared7.LanguagePluginID.JavaScript:
267827
+ case import_shared8.LanguagePluginID.JavaScript:
268057
267828
  return {
268058
- pluginId: import_shared7.LanguagePluginID.JavaScript,
267829
+ pluginId: import_shared8.LanguagePluginID.JavaScript,
268059
267830
  configuration: block.step?.javascript
268060
267831
  };
268061
- case import_shared7.LanguagePluginID.Python:
267832
+ case import_shared8.LanguagePluginID.Python:
268062
267833
  return {
268063
- pluginId: import_shared7.LanguagePluginID.Python,
267834
+ pluginId: import_shared8.LanguagePluginID.Python,
268064
267835
  configuration: block.step?.python
268065
267836
  };
268066
267837
  default:
@@ -268073,7 +267844,7 @@ var getLanguageConfiguration = (block) => {
268073
267844
  var computeStepBlockBindings = async (block) => {
268074
267845
  const { name: name17 } = block;
268075
267846
  const config2 = {
268076
- type: import_shared7.ActionType.Integration,
267847
+ type: import_shared8.ActionType.Integration,
268077
267848
  name: name17,
268078
267849
  id: name17,
268079
267850
  datasourceId: block.step?.integration,
@@ -274859,7 +274630,7 @@ var makeServerError = (error, { critical = "critical" in error ? error.critical
274859
274630
  // ../../../vite-plugin-file-sync/dist/file-system-manager.js
274860
274631
  init_cjs_shims();
274861
274632
  var import_core3 = __toESM(require_lib31(), 1);
274862
- var import_types25 = __toESM(require_lib10(), 1);
274633
+ var import_types24 = __toESM(require_lib10(), 1);
274863
274634
  import fs8 from "fs/promises";
274864
274635
  import EventEmitter6 from "node:events";
274865
274636
  import path16 from "node:path";
@@ -274869,12 +274640,12 @@ var import_yaml3 = __toESM(require_dist(), 1);
274869
274640
 
274870
274641
  // ../../../vite-plugin-file-sync/dist/codegen.js
274871
274642
  init_cjs_shims();
274872
- var import_types12 = __toESM(require_lib10(), 1);
274643
+ var import_types11 = __toESM(require_lib10(), 1);
274873
274644
  var import_json5 = __toESM(require_lib4(), 1);
274874
274645
 
274875
274646
  // ../../../vite-plugin-file-sync/dist/parsing/ids.js
274876
274647
  init_cjs_shims();
274877
- var import_types11 = __toESM(require_lib10(), 1);
274648
+ var import_types10 = __toESM(require_lib10(), 1);
274878
274649
 
274879
274650
  // ../../../vite-plugin-file-sync/dist/ids.js
274880
274651
  init_cjs_shims();
@@ -274897,8 +274668,8 @@ var generatePredictableId2 = (name17) => {
274897
274668
 
274898
274669
  // ../../../vite-plugin-file-sync/dist/parsing/jsx.js
274899
274670
  init_cjs_shims();
274900
- var import_types10 = __toESM(require_lib10(), 1);
274901
- var import_shared11 = __toESM(require_dist3(), 1);
274671
+ var import_types9 = __toESM(require_lib10(), 1);
274672
+ var import_shared12 = __toESM(require_dist3(), 1);
274902
274673
 
274903
274674
  // ../../../vite-plugin-file-sync/dist/parsing/properties.js
274904
274675
  init_cjs_shims();
@@ -274909,7 +274680,7 @@ init_cjs_shims();
274909
274680
  // ../../../vite-plugin-file-sync/dist/parsing/util.js
274910
274681
  init_cjs_shims();
274911
274682
  var import_parser2 = __toESM(require_lib8(), 1);
274912
- var import_types7 = __toESM(require_lib10(), 1);
274683
+ var import_types6 = __toESM(require_lib10(), 1);
274913
274684
  import path5 from "node:path";
274914
274685
 
274915
274686
  // ../../../vite-plugin-file-sync/dist/generate.js
@@ -274930,7 +274701,7 @@ function objectExpressionToObject(obj, context2) {
274930
274701
  }, {});
274931
274702
  }
274932
274703
  function stringToTaggedTemplate(str2) {
274933
- return import_types7.default.taggedTemplateExpression(import_types7.default.identifier("SB"), import_types7.default.templateLiteral([import_types7.default.templateElement({ raw: str2, cooked: str2 }, true)], []));
274704
+ return import_types6.default.taggedTemplateExpression(import_types6.default.identifier("SB"), import_types6.default.templateLiteral([import_types6.default.templateElement({ raw: str2, cooked: str2 }, true)], []));
274934
274705
  }
274935
274706
  function nodeToValue(node, context2) {
274936
274707
  switch (node.type) {
@@ -274949,7 +274720,7 @@ function nodeToValue(node, context2) {
274949
274720
  if (element) {
274950
274721
  return nodeToValue(element);
274951
274722
  }
274952
- return import_types7.default.nullLiteral();
274723
+ return import_types6.default.nullLiteral();
274953
274724
  });
274954
274725
  case "ObjectExpression":
274955
274726
  return objectExpressionToObject(node, context2);
@@ -275061,9 +274832,9 @@ function addImport({ path: path45, importName, importPath, isDefaultImport, onAd
275061
274832
  return;
275062
274833
  }
275063
274834
  const existingImportDeclaration = programPath.get("body").find((p) => p.isImportDeclaration() && p.node.source.value === importPath);
275064
- const importSpecifier = isDefaultImport ? import_types7.default.importDefaultSpecifier(import_types7.default.identifier(importName)) : import_types7.default.importSpecifier(import_types7.default.identifier(importName), import_types7.default.identifier(importName));
274835
+ const importSpecifier = isDefaultImport ? import_types6.default.importDefaultSpecifier(import_types6.default.identifier(importName)) : import_types6.default.importSpecifier(import_types6.default.identifier(importName), import_types6.default.identifier(importName));
275065
274836
  if (!existingImportDeclaration) {
275066
- programPath.unshiftContainer("body", import_types7.default.importDeclaration([importSpecifier], import_types7.default.stringLiteral(importPath)));
274837
+ programPath.unshiftContainer("body", import_types6.default.importDeclaration([importSpecifier], import_types6.default.stringLiteral(importPath)));
275067
274838
  } else {
275068
274839
  const existingSpecifier = existingImportDeclaration.node.specifiers.find((specifier) => specifier.type === "ImportSpecifier" && specifier.local.name === importName);
275069
274840
  if (existingSpecifier) {
@@ -275122,18 +274893,18 @@ function isSbScopeFunction(name17) {
275122
274893
  }
275123
274894
  function extractNameFromBindAttribute(bindAttribute, identifierOnly = false) {
275124
274895
  const bindValue = bindAttribute.value;
275125
- if (!bindValue || !import_types7.default.isJSXExpressionContainer(bindValue)) {
274896
+ if (!bindValue || !import_types6.default.isJSXExpressionContainer(bindValue)) {
275126
274897
  return null;
275127
274898
  }
275128
274899
  const expression = bindValue.expression;
275129
- if (import_types7.default.isIdentifier(expression)) {
274900
+ if (import_types6.default.isIdentifier(expression)) {
275130
274901
  return expression.name;
275131
274902
  }
275132
274903
  if (identifierOnly) {
275133
274904
  return null;
275134
274905
  }
275135
- if (import_types7.default.isMemberExpression(expression)) {
275136
- if (import_types7.default.isIdentifier(expression.property)) {
274906
+ if (import_types6.default.isMemberExpression(expression)) {
274907
+ if (import_types6.default.isIdentifier(expression.property)) {
275137
274908
  return expression.property.name;
275138
274909
  }
275139
274910
  }
@@ -275154,7 +274925,7 @@ function parseExpression(value2) {
275154
274925
  sourceType: "module",
275155
274926
  plugins: [["typescript", {}], "jsx"]
275156
274927
  });
275157
- const exprStatement = compiled.program.body.find((node) => import_types7.default.isExpressionStatement(node));
274928
+ const exprStatement = compiled.program.body.find((node) => import_types6.default.isExpressionStatement(node));
275158
274929
  if (exprStatement) {
275159
274930
  return exprStatement.expression;
275160
274931
  } else {
@@ -275394,7 +275165,7 @@ init_cjs_shims();
275394
275165
 
275395
275166
  // ../../../library-shared/dist/types/entities.js
275396
275167
  init_cjs_shims();
275397
- var import_shared8 = __toESM(require_dist3(), 1);
275168
+ var import_shared9 = __toESM(require_dist3(), 1);
275398
275169
  var sbEntitySymbol = Symbol("sbEntity");
275399
275170
  var SbEntityType = {
275400
275171
  VARIABLE: "SbVariable",
@@ -275470,14 +275241,14 @@ init_cjs_shims();
275470
275241
  init_cjs_shims();
275471
275242
 
275472
275243
  // ../../../vite-plugin-file-sync/dist/parsing/events/to-code-events.js
275473
- var import_shared9 = __toESM(require_dist3(), 1);
275244
+ var import_shared10 = __toESM(require_dist3(), 1);
275474
275245
  function toCodeEventFlow(stepDefs_) {
275475
275246
  if (!stepDefs_.length) {
275476
275247
  return "SbEventFlow.start()";
275477
275248
  }
275478
275249
  let code = `SbEventFlow`;
275479
275250
  for (const stepDef_ of stepDefs_) {
275480
- if (!(0, import_shared9.isValidStepDef)(stepDef_))
275251
+ if (!(0, import_shared10.isValidStepDef)(stepDef_))
275481
275252
  continue;
275482
275253
  const stepDef = stepDef_;
275483
275254
  switch (stepDef.type) {
@@ -275510,7 +275281,7 @@ function toCodeEventFlow(stepDefs_) {
275510
275281
  }
275511
275282
  case TriggerStepType.NAVIGATE_TO: {
275512
275283
  const url3 = stepDef.url;
275513
- if ((0, import_shared9.containsBindingsAnywhere)(url3)) {
275284
+ if ((0, import_shared10.containsBindingsAnywhere)(url3)) {
275514
275285
  code = `${code}.navigateTo({
275515
275286
  url: SB\`${url3}\`,
275516
275287
  })`;
@@ -275522,14 +275293,14 @@ function toCodeEventFlow(stepDefs_) {
275522
275293
  break;
275523
275294
  }
275524
275295
  case TriggerStepType.SET_STATE_VAR: {
275525
- const name17 = `${stepDef.state?.scope === import_shared9.ApplicationScope.APP ? "App." : ""}${stepDef.state?.name ?? ""}`;
275296
+ const name17 = `${stepDef.state?.scope === import_shared10.ApplicationScope.APP ? "App." : ""}${stepDef.state?.name ?? ""}`;
275526
275297
  const value2 = stepDef.value ?? "";
275527
275298
  if (isComputedPropertyInfo(value2)) {
275528
275299
  const computedValue = parser5.toCode(value2.value);
275529
275300
  code = `${code}.setStateVar("${name17}", ${computedValue})`;
275530
275301
  } else if (containsStringInterpolation(value2)) {
275531
275302
  code = `${code}.setStateVar("${name17}", sbComputed(() => \`${value2}\`))`;
275532
- } else if (typeof value2 === "string" && (0, import_shared9.containsBindingsAnywhere)(value2)) {
275303
+ } else if (typeof value2 === "string" && (0, import_shared10.containsBindingsAnywhere)(value2)) {
275533
275304
  code = `${code}.setStateVar("${name17}", SB\`${value2}\`)`;
275534
275305
  } else if (typeof value2 === "object" && value2 != null) {
275535
275306
  code = `${code}.setStateVar("${name17}", ${JSON.stringify(value2)})`;
@@ -275557,10 +275328,10 @@ function toCodeEventFlow(stepDefs_) {
275557
275328
 
275558
275329
  // ../../../vite-plugin-file-sync/dist/parsing/events/to-value-events.js
275559
275330
  init_cjs_shims();
275560
- var import_types9 = __toESM(require_lib10(), 1);
275561
- var import_shared10 = __toESM(require_dist3(), 1);
275331
+ var import_types8 = __toESM(require_lib10(), 1);
275332
+ var import_shared11 = __toESM(require_dist3(), 1);
275562
275333
  var getApiCallbackNode = (nodePath) => {
275563
- if (nodePath && (0, import_types9.isCallExpression)(nodePath.node) && (0, import_types9.isMemberExpression)(nodePath.node.callee) && (0, import_types9.isIdentifier)(nodePath.node.callee.object) && nodePath.node.callee.object.name === "SbEventFlow") {
275334
+ if (nodePath && (0, import_types8.isCallExpression)(nodePath.node) && (0, import_types8.isMemberExpression)(nodePath.node.callee) && (0, import_types8.isIdentifier)(nodePath.node.callee.object) && nodePath.node.callee.object.name === "SbEventFlow") {
275564
275335
  return toValueEventFlow(nodePath);
275565
275336
  }
275566
275337
  return [];
@@ -275620,7 +275391,7 @@ function toValueEventFlow(nodePath, existingSteps = [], parentId) {
275620
275391
  ...existingSteps,
275621
275392
  {
275622
275393
  id: id2,
275623
- type: import_shared10.TriggerStepType.RUN_JS,
275394
+ type: import_shared11.TriggerStepType.RUN_JS,
275624
275395
  code: expression.toString()
275625
275396
  }
275626
275397
  ];
@@ -275637,7 +275408,7 @@ function toValueEventFlow(nodePath, existingSteps = [], parentId) {
275637
275408
  ...existingSteps,
275638
275409
  {
275639
275410
  id: id2,
275640
- type: import_shared10.TriggerStepType.NAVIGATE_TO,
275411
+ type: import_shared11.TriggerStepType.NAVIGATE_TO,
275641
275412
  url: obj.url ?? "",
275642
275413
  newWindow: obj.newWindow ?? false,
275643
275414
  replaceHistory: obj.replaceHistory ?? false,
@@ -275658,7 +275429,7 @@ function toValueEventFlow(nodePath, existingSteps = [], parentId) {
275658
275429
  ...existingSteps,
275659
275430
  {
275660
275431
  id: id2,
275661
- type: import_shared10.TriggerStepType.RUN_APIS,
275432
+ type: import_shared11.TriggerStepType.RUN_APIS,
275662
275433
  apiNames: nodeToValue(expression.node),
275663
275434
  onSuccess,
275664
275435
  onError: onError2
@@ -275672,7 +275443,7 @@ function toValueEventFlow(nodePath, existingSteps = [], parentId) {
275672
275443
  const apiNames = nodeToValue(expression.node);
275673
275444
  return [
275674
275445
  ...existingSteps,
275675
- { id: id2, type: import_shared10.TriggerStepType.CANCEL_APIS, apiNames }
275446
+ { id: id2, type: import_shared11.TriggerStepType.CANCEL_APIS, apiNames }
275676
275447
  ];
275677
275448
  }
275678
275449
  case "setStateVar": {
@@ -275693,11 +275464,11 @@ function toValueEventFlow(nodePath, existingSteps = [], parentId) {
275693
275464
  ...existingSteps,
275694
275465
  {
275695
275466
  id: id2,
275696
- type: import_shared10.TriggerStepType.SET_STATE_VAR,
275467
+ type: import_shared11.TriggerStepType.SET_STATE_VAR,
275697
275468
  state: {
275698
275469
  id: variableName,
275699
275470
  name: variableName,
275700
- scope: isAppScoped ? import_shared10.ApplicationScope.APP : import_shared10.ApplicationScope.PAGE
275471
+ scope: isAppScoped ? import_shared11.ApplicationScope.APP : import_shared11.ApplicationScope.PAGE
275701
275472
  },
275702
275473
  value: value2
275703
275474
  }
@@ -275716,7 +275487,7 @@ function toValueEventFlow(nodePath, existingSteps = [], parentId) {
275716
275487
  ...existingSteps,
275717
275488
  {
275718
275489
  id: id2,
275719
- type: import_shared10.TriggerStepType.CONTROL_MODAL,
275490
+ type: import_shared11.TriggerStepType.CONTROL_MODAL,
275720
275491
  name: name17,
275721
275492
  direction
275722
275493
  }
@@ -275859,48 +275630,48 @@ function parseNodeProperties(node) {
275859
275630
 
275860
275631
  // ../../../vite-plugin-file-sync/dist/parsing/jsx.js
275861
275632
  function makeJSXAttribute(key2, value2) {
275862
- return import_types10.default.jsxAttribute(import_types10.default.jsxIdentifier(key2), import_types10.default.stringLiteral(value2));
275633
+ return import_types9.default.jsxAttribute(import_types9.default.jsxIdentifier(key2), import_types9.default.stringLiteral(value2));
275863
275634
  }
275864
275635
  function tagNameToWidgetType(tagName) {
275865
275636
  switch (tagName) {
275866
275637
  case "SbPage":
275867
- return import_shared11.WidgetTypes.PAGE_WIDGET;
275638
+ return import_shared12.WidgetTypes.PAGE_WIDGET;
275868
275639
  case "SbText":
275869
- return import_shared11.WidgetTypes.TEXT_WIDGET;
275640
+ return import_shared12.WidgetTypes.TEXT_WIDGET;
275870
275641
  case "SbButton":
275871
- return import_shared11.WidgetTypes.BUTTON_WIDGET;
275642
+ return import_shared12.WidgetTypes.BUTTON_WIDGET;
275872
275643
  case "SbInput":
275873
- return import_shared11.WidgetTypes.INPUT_WIDGET;
275644
+ return import_shared12.WidgetTypes.INPUT_WIDGET;
275874
275645
  case "SbModal":
275875
- return import_shared11.WidgetTypes.MODAL_WIDGET;
275646
+ return import_shared12.WidgetTypes.MODAL_WIDGET;
275876
275647
  case "SbSlideout":
275877
- return import_shared11.WidgetTypes.SLIDEOUT_WIDGET;
275648
+ return import_shared12.WidgetTypes.SLIDEOUT_WIDGET;
275878
275649
  case "SbKeyValue":
275879
- return import_shared11.WidgetTypes.KEY_VALUE_WIDGET;
275650
+ return import_shared12.WidgetTypes.KEY_VALUE_WIDGET;
275880
275651
  case "SbContainer":
275881
- return import_shared11.WidgetTypes.CONTAINER_WIDGET;
275652
+ return import_shared12.WidgetTypes.CONTAINER_WIDGET;
275882
275653
  case "SbColumn":
275883
- return import_shared11.WidgetTypes.CANVAS_WIDGET;
275654
+ return import_shared12.WidgetTypes.CANVAS_WIDGET;
275884
275655
  case "SbSection":
275885
- return import_shared11.WidgetTypes.SECTION_WIDGET;
275656
+ return import_shared12.WidgetTypes.SECTION_WIDGET;
275886
275657
  case "SbCheckbox":
275887
- return import_shared11.WidgetTypes.CHECKBOX_WIDGET;
275658
+ return import_shared12.WidgetTypes.CHECKBOX_WIDGET;
275888
275659
  case "SbCustom":
275889
- return import_shared11.WidgetTypes.CUSTOM_WIDGET;
275660
+ return import_shared12.WidgetTypes.CUSTOM_WIDGET;
275890
275661
  case "SbDatePicker":
275891
- return import_shared11.WidgetTypes.DATE_PICKER_WIDGET;
275662
+ return import_shared12.WidgetTypes.DATE_PICKER_WIDGET;
275892
275663
  case "SbTable":
275893
- return import_shared11.WidgetTypes.TABLE_WIDGET;
275664
+ return import_shared12.WidgetTypes.TABLE_WIDGET;
275894
275665
  case "SbImage":
275895
- return import_shared11.WidgetTypes.IMAGE_WIDGET;
275666
+ return import_shared12.WidgetTypes.IMAGE_WIDGET;
275896
275667
  case "SbDropdown":
275897
- return import_shared11.WidgetTypes.DROP_DOWN_WIDGET;
275668
+ return import_shared12.WidgetTypes.DROP_DOWN_WIDGET;
275898
275669
  case "SbSwitch":
275899
- return import_shared11.WidgetTypes.SWITCH_WIDGET;
275670
+ return import_shared12.WidgetTypes.SWITCH_WIDGET;
275900
275671
  case "SbIcon":
275901
- return import_shared11.WidgetTypes.ICON_WIDGET;
275672
+ return import_shared12.WidgetTypes.ICON_WIDGET;
275902
275673
  default:
275903
- return import_shared11.WidgetTypes.CUSTOM_WIDGET;
275674
+ return import_shared12.WidgetTypes.CUSTOM_WIDGET;
275904
275675
  }
275905
275676
  }
275906
275677
  function getProperties(element) {
@@ -276084,18 +275855,18 @@ function getVariableReferences(jsxAttribute, variablesToCheck) {
276084
275855
  let visit2 = function(node) {
276085
275856
  if (!node || typeof node !== "object")
276086
275857
  return;
276087
- if (import_types10.default.isIdentifier(node)) {
275858
+ if (import_types9.default.isIdentifier(node)) {
276088
275859
  if (variablesToCheck.has(node.name)) {
276089
275860
  result.add(node.name);
276090
275861
  }
276091
275862
  }
276092
- if (import_types10.default.isMemberExpression(node)) {
276093
- if (import_types10.default.isIdentifier(node.object) && variablesToCheck.has(node.object.name)) {
275863
+ if (import_types9.default.isMemberExpression(node)) {
275864
+ if (import_types9.default.isIdentifier(node.object) && variablesToCheck.has(node.object.name)) {
276094
275865
  result.add(node.object.name);
276095
275866
  }
276096
275867
  }
276097
- if (import_types10.default.isCallExpression(node)) {
276098
- if (import_types10.default.isIdentifier(node.callee) && variablesToCheck.has(node.callee.name)) {
275868
+ if (import_types9.default.isCallExpression(node)) {
275869
+ if (import_types9.default.isIdentifier(node.callee) && variablesToCheck.has(node.callee.name)) {
276099
275870
  result.add(node.callee.name);
276100
275871
  }
276101
275872
  }
@@ -276165,7 +275936,7 @@ function supplementElementIds({ fileName, ast, shouldModifyAst, scopeId }) {
276165
275936
  }
276166
275937
  });
276167
275938
  }
276168
- if (entitiesObject && (0, import_types11.isObjectExpression)(entitiesObject.node)) {
275939
+ if (entitiesObject && (0, import_types10.isObjectExpression)(entitiesObject.node)) {
276169
275940
  entitiesObject.node.properties.forEach((property, index) => {
276170
275941
  if (property.type === "ObjectProperty") {
276171
275942
  const name17 = nodeToValue(property.key);
@@ -276173,9 +275944,9 @@ function supplementElementIds({ fileName, ast, shouldModifyAst, scopeId }) {
276173
275944
  idMap.set(id2, entitiesObject.get(`properties.${index}`));
276174
275945
  setSbElementId(property, id2);
276175
275946
  if (shouldModifyAst) {
276176
- if ((0, import_types11.isCallExpression)(property.value) && (0, import_types11.isObjectExpression)(property.value.arguments[0])) {
275947
+ if ((0, import_types10.isCallExpression)(property.value) && (0, import_types10.isObjectExpression)(property.value.arguments[0])) {
276177
275948
  const entityConfig = property.value.arguments[0];
276178
- entityConfig.properties.push((0, import_types11.objectProperty)((0, import_types11.identifier)("id"), (0, import_types11.stringLiteral)(id2)));
275949
+ entityConfig.properties.push((0, import_types10.objectProperty)((0, import_types10.identifier)("id"), (0, import_types10.stringLiteral)(id2)));
276179
275950
  }
276180
275951
  }
276181
275952
  }
@@ -276239,11 +276010,11 @@ function generateElementId(fileName, parentPath, count) {
276239
276010
  function generateJSXElement({ id: id2, tagName, properties, children }) {
276240
276011
  const attributes = Object.entries(properties).map(([name17, value2]) => generateJSXAttribute(name17, value2));
276241
276012
  const selfClosing = children.length === 0;
276242
- const openingElement = import_types12.default.jsxOpeningElement(import_types12.default.jsxIdentifier(tagName), attributes, selfClosing);
276013
+ const openingElement = import_types11.default.jsxOpeningElement(import_types11.default.jsxIdentifier(tagName), attributes, selfClosing);
276243
276014
  if (id2) {
276244
276015
  setSbElementId(openingElement, id2);
276245
276016
  }
276246
- const jsxElement = import_types12.default.jsxElement(openingElement, selfClosing ? null : import_types12.default.jsxClosingElement(import_types12.default.jsxIdentifier(tagName)), [], selfClosing);
276017
+ const jsxElement = import_types11.default.jsxElement(openingElement, selfClosing ? null : import_types11.default.jsxClosingElement(import_types11.default.jsxIdentifier(tagName)), [], selfClosing);
276247
276018
  const childElements = children.map((child) => {
276248
276019
  return generateJSXElement(child);
276249
276020
  });
@@ -276252,10 +276023,10 @@ function generateJSXElement({ id: id2, tagName, properties, children }) {
276252
276023
  }
276253
276024
  function generateJSXAttribute(name17, { value: value2, type: type2 }) {
276254
276025
  const valueNode = getPropertyExpression(Property.Any(value2, type2), name17);
276255
- if (import_types12.default.isStringLiteral(valueNode)) {
276256
- return import_types12.default.jsxAttribute(import_types12.default.jsxIdentifier(name17), valueNode);
276026
+ if (import_types11.default.isStringLiteral(valueNode)) {
276027
+ return import_types11.default.jsxAttribute(import_types11.default.jsxIdentifier(name17), valueNode);
276257
276028
  } else {
276258
- return import_types12.default.jsxAttribute(import_types12.default.jsxIdentifier(name17), import_types12.default.jsxExpressionContainer(valueNode));
276029
+ return import_types11.default.jsxAttribute(import_types11.default.jsxIdentifier(name17), import_types11.default.jsxExpressionContainer(valueNode));
276259
276030
  }
276260
276031
  }
276261
276032
  function writeNestedProperty({ node, paths, value: value2, type: type2 }) {
@@ -276277,9 +276048,9 @@ function writeNestedProperty({ node, paths, value: value2, type: type2 }) {
276277
276048
  if (currentNode.isObjectExpression()) {
276278
276049
  let property = currentNode.get("properties").find((prop) => prop.isObjectProperty() && getIdentiferName(prop.node.key) === currentKey);
276279
276050
  if (!property) {
276280
- const value4 = cleanedPaths.length > 0 ? import_types12.default.objectExpression([]) : import_types12.default.stringLiteral("");
276051
+ const value4 = cleanedPaths.length > 0 ? import_types11.default.objectExpression([]) : import_types11.default.stringLiteral("");
276281
276052
  property = currentNode.pushContainer("properties", [
276282
- import_types12.default.objectProperty(import_types12.default.identifier(currentKey.toString()), value4)
276053
+ import_types11.default.objectProperty(import_types11.default.identifier(currentKey.toString()), value4)
276283
276054
  ])[0];
276284
276055
  }
276285
276056
  const value3 = property?.get("value");
@@ -276292,7 +276063,7 @@ function writeNestedProperty({ node, paths, value: value2, type: type2 }) {
276292
276063
  const nodeAtIndex = currentNode.get("elements")[index];
276293
276064
  if (!nodeAtIndex || nodeAtIndex.node == null) {
276294
276065
  if (cleanedPaths.length > 0) {
276295
- const newObjectNode = import_types12.default.objectExpression([]);
276066
+ const newObjectNode = import_types11.default.objectExpression([]);
276296
276067
  if (currentNode.get("elements").length > 0) {
276297
276068
  if (index === 0) {
276298
276069
  currentNode = currentNode.unshiftContainer("elements", [
@@ -276311,7 +276082,7 @@ function writeNestedProperty({ node, paths, value: value2, type: type2 }) {
276311
276082
  }
276312
276083
  } else {
276313
276084
  currentNode = currentNode.pushContainer("elements", [
276314
- import_types12.default.stringLiteral(String(value2))
276085
+ import_types11.default.stringLiteral(String(value2))
276315
276086
  ])[0];
276316
276087
  }
276317
276088
  } else {
@@ -276336,7 +276107,7 @@ function getPropertyExpression({ value: value2, type: type2 }, fieldName = "") {
276336
276107
  if (expression) {
276337
276108
  return expression;
276338
276109
  } else {
276339
- return import_types12.default.stringLiteral(code);
276110
+ return import_types11.default.stringLiteral(code);
276340
276111
  }
276341
276112
  } else if (type2 === "DIMENSION") {
276342
276113
  const code = parsingRegistry.DIMENSION.toCode(value2);
@@ -276344,7 +276115,7 @@ function getPropertyExpression({ value: value2, type: type2 }, fieldName = "") {
276344
276115
  if (expression) {
276345
276116
  return expression;
276346
276117
  } else {
276347
- return import_types12.default.stringLiteral(code);
276118
+ return import_types11.default.stringLiteral(code);
276348
276119
  }
276349
276120
  }
276350
276121
  if (type2 === "EVENT") {
@@ -276353,7 +276124,7 @@ function getPropertyExpression({ value: value2, type: type2 }, fieldName = "") {
276353
276124
  if (expression) {
276354
276125
  return expression;
276355
276126
  } else {
276356
- return import_types12.default.stringLiteral(code);
276127
+ return import_types11.default.stringLiteral(code);
276357
276128
  }
276358
276129
  }
276359
276130
  if (type2 === "EXPRESSION" && typeof value2 === "string") {
@@ -276361,7 +276132,7 @@ function getPropertyExpression({ value: value2, type: type2 }, fieldName = "") {
276361
276132
  if (expression) {
276362
276133
  return expression;
276363
276134
  } else {
276364
- return import_types12.default.stringLiteral(value2);
276135
+ return import_types11.default.stringLiteral(value2);
276365
276136
  }
276366
276137
  } else if (type2 === "COMPUTED" && typeof value2 === "string") {
276367
276138
  let parsed;
@@ -276380,42 +276151,42 @@ function getPropertyExpression({ value: value2, type: type2 }, fieldName = "") {
276380
276151
  } catch (e) {
276381
276152
  getLogger().error("could not generate computed expression", getErrorMeta(e));
276382
276153
  }
276383
- return import_types12.default.templateLiteral([import_types12.default.templateElement({ raw: value2, cooked: value2 }, true)], []);
276154
+ return import_types11.default.templateLiteral([import_types11.default.templateElement({ raw: value2, cooked: value2 }, true)], []);
276384
276155
  }
276385
276156
  }
276386
276157
  if (Array.isArray(value2)) {
276387
- return import_types12.default.arrayExpression(value2.map((v) => isPropertyInfo(v) ? getPropertyExpression(v, fieldName) : (0, import_types12.valueToNode)(v)));
276158
+ return import_types11.default.arrayExpression(value2.map((v) => isPropertyInfo(v) ? getPropertyExpression(v, fieldName) : (0, import_types11.valueToNode)(v)));
276388
276159
  }
276389
276160
  if (typeof value2 === "object" && value2 !== null) {
276390
- return import_types12.default.objectExpression(Object.entries(value2).map(([key2, value3]) => import_types12.default.objectProperty(import_types12.default.stringLiteral(key2), isPropertyInfo(value3) ? getPropertyExpression(value3, fieldName) : (0, import_types12.valueToNode)(value3))));
276161
+ return import_types11.default.objectExpression(Object.entries(value2).map(([key2, value3]) => import_types11.default.objectProperty(import_types11.default.stringLiteral(key2), isPropertyInfo(value3) ? getPropertyExpression(value3, fieldName) : (0, import_types11.valueToNode)(value3))));
276391
276162
  }
276392
276163
  if (typeof value2 === "number") {
276393
- return import_types12.default.numericLiteral(value2);
276164
+ return import_types11.default.numericLiteral(value2);
276394
276165
  }
276395
276166
  if (typeof value2 === "boolean") {
276396
- return import_types12.default.booleanLiteral(value2);
276167
+ return import_types11.default.booleanLiteral(value2);
276397
276168
  }
276398
276169
  if (typeof value2 === "string") {
276399
276170
  if (canBeAStringLiteral(value2)) {
276400
- return import_types12.default.stringLiteral(value2);
276171
+ return import_types11.default.stringLiteral(value2);
276401
276172
  } else {
276402
- return import_types12.default.templateLiteral([import_types12.default.templateElement({ raw: value2, cooked: value2 }, true)], []);
276173
+ return import_types11.default.templateLiteral([import_types11.default.templateElement({ raw: value2, cooked: value2 }, true)], []);
276403
276174
  }
276404
276175
  }
276405
276176
  if (typeof value2 === "object" || value2 === void 0) {
276406
- return (0, import_types12.valueToNode)(value2);
276177
+ return (0, import_types11.valueToNode)(value2);
276407
276178
  }
276408
276179
  logger3.warn(`Unsupported value type: ${value2} ${type2}`);
276409
- return import_types12.default.stringLiteral(String(value2));
276180
+ return import_types11.default.stringLiteral(String(value2));
276410
276181
  } catch (e) {
276411
276182
  logger3.error(`Error generating code value: ${value2} ${type2}`, getErrorMeta(e));
276412
- return import_types12.default.stringLiteral(String(value2));
276183
+ return import_types11.default.stringLiteral(String(value2));
276413
276184
  }
276414
276185
  }
276415
276186
 
276416
276187
  // ../../../vite-plugin-file-sync/dist/custom-components.js
276417
276188
  init_cjs_shims();
276418
- var import_types13 = __toESM(require_lib10(), 1);
276189
+ var import_types12 = __toESM(require_lib10(), 1);
276419
276190
 
276420
276191
  // ../../../vite-plugin-file-sync/dist/plugin-options.js
276421
276192
  init_cjs_shims();
@@ -276440,31 +276211,31 @@ function modifyLegacyCustomComponentImports(path45, tracker) {
276440
276211
  if (!specifier)
276441
276212
  return;
276442
276213
  tracker.add(specifier.local.name);
276443
- path45.get("source").replaceWith(import_types13.default.stringLiteral(source2.replace(customFolder, `${customFolder}dist/`)));
276214
+ path45.get("source").replaceWith(import_types12.default.stringLiteral(source2.replace(customFolder, `${customFolder}dist/`)));
276444
276215
  const program = path45.scope.getProgramParent()?.path;
276445
276216
  const existingImport = program?.get("body").find((p) => p.isImportDeclaration() && p.node.source.value === "virtual:legacy-wrapper");
276446
276217
  if (existingImport) {
276447
276218
  return;
276448
276219
  }
276449
- program?.unshiftContainer("body", import_types13.default.importDeclaration([
276450
- import_types13.default.importSpecifier(import_types13.default.identifier("wrapCustomComponent"), import_types13.default.identifier("wrapCustomComponent"))
276451
- ], import_types13.default.stringLiteral("virtual:legacy-wrapper")));
276220
+ program?.unshiftContainer("body", import_types12.default.importDeclaration([
276221
+ import_types12.default.importSpecifier(import_types12.default.identifier("wrapCustomComponent"), import_types12.default.identifier("wrapCustomComponent"))
276222
+ ], import_types12.default.stringLiteral("virtual:legacy-wrapper")));
276452
276223
  }
276453
276224
  function modifyLegacyCustomComponentElements(path45, tracker) {
276454
276225
  const elementName = getTagName(path45.node.openingElement.name);
276455
276226
  if (elementName && tracker.has(elementName)) {
276456
- path45.get("openingElement").get("name").replaceWith(import_types13.default.jsxIdentifier(`Wrapped${elementName}`));
276227
+ path45.get("openingElement").get("name").replaceWith(import_types12.default.jsxIdentifier(`Wrapped${elementName}`));
276457
276228
  const closingElement = path45.get("closingElement");
276458
276229
  if (closingElement) {
276459
- closingElement.replaceWith(import_types13.default.jsxClosingElement(import_types13.default.jsxIdentifier(`Wrapped${elementName}`)));
276230
+ closingElement.replaceWith(import_types12.default.jsxClosingElement(import_types12.default.jsxIdentifier(`Wrapped${elementName}`)));
276460
276231
  }
276461
276232
  }
276462
276233
  }
276463
276234
  function addLegacyCustomComponentVariables(path45, tracker) {
276464
276235
  tracker.forEach((name17) => {
276465
- path45.unshiftContainer("body", import_types13.default.variableDeclaration("const", [
276466
- import_types13.default.variableDeclarator(import_types13.default.identifier(`Wrapped${name17}`), import_types13.default.callExpression(import_types13.default.identifier("wrapCustomComponent"), [
276467
- import_types13.default.identifier(name17)
276236
+ path45.unshiftContainer("body", import_types12.default.variableDeclaration("const", [
276237
+ import_types12.default.variableDeclarator(import_types12.default.identifier(`Wrapped${name17}`), import_types12.default.callExpression(import_types12.default.identifier("wrapCustomComponent"), [
276238
+ import_types12.default.identifier(name17)
276468
276239
  ]))
276469
276240
  ]));
276470
276241
  });
@@ -276632,7 +276403,7 @@ function getPageName(file) {
276632
276403
  init_cjs_shims();
276633
276404
  var import_core2 = __toESM(require_lib31(), 1);
276634
276405
  var import_parser4 = __toESM(require_lib8(), 1);
276635
- var import_types16 = __toESM(require_lib10(), 1);
276406
+ var import_types15 = __toESM(require_lib10(), 1);
276636
276407
  var t6 = __toESM(require_lib10(), 1);
276637
276408
  var import_appDSL = __toESM(require_appDSL(), 1);
276638
276409
 
@@ -276641,10 +276412,10 @@ init_cjs_shims();
276641
276412
 
276642
276413
  // ../../../vite-plugin-file-sync/dist/parsing/entity/to-code-entity.js
276643
276414
  init_cjs_shims();
276644
- var import_shared12 = __toESM(require_dist3(), 1);
276415
+ var import_shared13 = __toESM(require_dist3(), 1);
276645
276416
  var toCodeProperty = (value2) => {
276646
276417
  if (typeof value2 === "string") {
276647
- if ((0, import_shared12.containsBindingsAnywhere)(value2)) {
276418
+ if ((0, import_shared13.containsBindingsAnywhere)(value2)) {
276648
276419
  return `SB\`${value2}\``;
276649
276420
  }
276650
276421
  return `"${value2}"`;
@@ -276663,7 +276434,7 @@ function toCodeEntity(entity) {
276663
276434
  case SbEntityType.VARIABLE:
276664
276435
  return `SbVariable({
276665
276436
  defaultValue: ${toCodeProperty(entity.defaultValue)},
276666
- persistence: ${entity.persistence === import_shared8.AppStateVarPersistence6.LOCAL_STORAGE ? "SbVariablePersistence.LOCAL_STORAGE" : "SbVariablePersistence.TEMPORARY"}
276437
+ persistence: ${entity.persistence === import_shared9.AppStateVarPersistence6.LOCAL_STORAGE ? "SbVariablePersistence.LOCAL_STORAGE" : "SbVariablePersistence.TEMPORARY"}
276667
276438
  })`;
276668
276439
  case SbEntityType.API:
276669
276440
  return `SbApi({
@@ -276744,7 +276515,7 @@ function toValueEntity(nodePath, { key: key2, id: id2 }) {
276744
276515
  type: SbEntityType.VARIABLE,
276745
276516
  name: key2,
276746
276517
  defaultValue: args.defaultValue ?? Property.Static(""),
276747
- persistence: args.persistence ?? Property.Expression(import_shared8.AppStateVarPersistence6.TEMPORARY),
276518
+ persistence: args.persistence ?? Property.Expression(import_shared9.AppStateVarPersistence6.TEMPORARY),
276748
276519
  value: args.defaultValue ?? Property.Static(""),
276749
276520
  id: id2
276750
276521
  };
@@ -276876,9 +276647,9 @@ function updateEntityNode(node, updates, entityId) {
276876
276647
  return property2.isObjectProperty() && property2.get("key").isIdentifier() && getIdentiferName(property2.node.key) === key2;
276877
276648
  });
276878
276649
  if (!property) {
276879
- configObject.pushContainer("properties", (0, import_types16.objectProperty)((0, import_types16.identifier)(key2), getPropertyExpression(info)));
276650
+ configObject.pushContainer("properties", (0, import_types15.objectProperty)((0, import_types15.identifier)(key2), getPropertyExpression(info)));
276880
276651
  } else {
276881
- property.replaceWith((0, import_types16.objectProperty)((0, import_types16.identifier)(key2), getPropertyExpression(info)));
276652
+ property.replaceWith((0, import_types15.objectProperty)((0, import_types15.identifier)(key2), getPropertyExpression(info)));
276882
276653
  }
276883
276654
  if (info.type in REQUIRED_IMPORTS_BY_PROPERTY_TYPE) {
276884
276655
  const requiredImports = REQUIRED_IMPORTS_BY_PROPERTY_TYPE[info.type];
@@ -276900,7 +276671,7 @@ function fromEntityToNode(entity) {
276900
276671
  throw new Error("Invalid entity ast definition");
276901
276672
  }
276902
276673
  return {
276903
- entity: (0, import_types16.objectProperty)((0, import_types16.identifier)(entity.name), parsedEntity.program.body[0].expression),
276674
+ entity: (0, import_types15.objectProperty)((0, import_types15.identifier)(entity.name), parsedEntity.program.body[0].expression),
276904
276675
  imports
276905
276676
  };
276906
276677
  }
@@ -276987,9 +276758,9 @@ function updateScopeUsages(scopeUsages, entityNames) {
276987
276758
  continue;
276988
276759
  const id2 = declaration.get("id");
276989
276760
  if (id2.isObjectPattern()) {
276990
- const newProperties = entityNames.map((name17) => (0, import_types16.objectProperty)(
276991
- (0, import_types16.identifier)(name17),
276992
- (0, import_types16.identifier)(name17),
276761
+ const newProperties = entityNames.map((name17) => (0, import_types15.objectProperty)(
276762
+ (0, import_types15.identifier)(name17),
276763
+ (0, import_types15.identifier)(name17),
276993
276764
  false,
276994
276765
  // computed
276995
276766
  true
@@ -277020,14 +276791,14 @@ function findEnclosingComponent(elementPath) {
277020
276791
  }
277021
276792
  function addScopeDestructuring(componentPath, scopeDefinition) {
277022
276793
  const uniqueEntityNames = [...new Set(scopeDefinition.entityNames)];
277023
- const destructuringDeclaration = (0, import_types16.variableDeclaration)("const", [
277024
- (0, import_types16.variableDeclarator)((0, import_types16.objectPattern)(uniqueEntityNames.map((name17) => (0, import_types16.objectProperty)(
277025
- (0, import_types16.identifier)(name17),
277026
- (0, import_types16.identifier)(name17),
276794
+ const destructuringDeclaration = (0, import_types15.variableDeclaration)("const", [
276795
+ (0, import_types15.variableDeclarator)((0, import_types15.objectPattern)(uniqueEntityNames.map((name17) => (0, import_types15.objectProperty)(
276796
+ (0, import_types15.identifier)(name17),
276797
+ (0, import_types15.identifier)(name17),
277027
276798
  false,
277028
276799
  // computed
277029
276800
  true
277030
- ))), (0, import_types16.identifier)(scopeDefinition.name))
276801
+ ))), (0, import_types15.identifier)(scopeDefinition.name))
277031
276802
  ]);
277032
276803
  let addedNodePath = null;
277033
276804
  if (componentPath.isFunctionDeclaration() || componentPath.isFunctionExpression() || componentPath.isArrowFunctionExpression()) {
@@ -277042,8 +276813,8 @@ function addScopeDestructuring(componentPath, scopeDefinition) {
277042
276813
  const [newPath] = body.unshiftContainer("body", destructuringDeclaration);
277043
276814
  addedNodePath = newPath;
277044
276815
  } else {
277045
- const retStatement = (0, import_types16.returnStatement)(body.node);
277046
- componentPath.node.body = (0, import_types16.blockStatement)([
276816
+ const retStatement = (0, import_types15.returnStatement)(body.node);
276817
+ componentPath.node.body = (0, import_types15.blockStatement)([
277047
276818
  destructuringDeclaration,
277048
276819
  retStatement
277049
276820
  ]);
@@ -277301,15 +277072,15 @@ function updateDestructuredEntitiesParam(scopeDef) {
277301
277072
  }
277302
277073
  return;
277303
277074
  }
277304
- const entitiesDestructuring = (0, import_types16.objectPattern)(uniqueEntityNames.map((name17) => (0, import_types16.objectProperty)(
277305
- (0, import_types16.identifier)(name17),
277306
- (0, import_types16.identifier)(name17),
277075
+ const entitiesDestructuring = (0, import_types15.objectPattern)(uniqueEntityNames.map((name17) => (0, import_types15.objectProperty)(
277076
+ (0, import_types15.identifier)(name17),
277077
+ (0, import_types15.identifier)(name17),
277307
277078
  false,
277308
277079
  // computed
277309
277080
  true
277310
277081
  )));
277311
- const entitiesProperty = (0, import_types16.objectProperty)((0, import_types16.identifier)("entities"), entitiesDestructuring);
277312
- const mainDestructuringPattern = (0, import_types16.objectPattern)([entitiesProperty]);
277082
+ const entitiesProperty = (0, import_types15.objectProperty)((0, import_types15.identifier)("entities"), entitiesDestructuring);
277083
+ const mainDestructuringPattern = (0, import_types15.objectPattern)([entitiesProperty]);
277313
277084
  if (scopeDef.scopeFunction.node.params.length > 0) {
277314
277085
  const firstParam = scopeDef.scopeFunction.get("params")[0];
277315
277086
  if (firstParam && firstParam.isObjectPattern()) {
@@ -277327,11 +277098,11 @@ function updateDestructuredEntitiesParam(scopeDef) {
277327
277098
 
277328
277099
  // ../../../vite-plugin-file-sync/dist/rename-manager.js
277329
277100
  init_cjs_shims();
277330
- var import_types19 = __toESM(require_lib10(), 1);
277101
+ var import_types18 = __toESM(require_lib10(), 1);
277331
277102
 
277332
277103
  // ../../../vite-plugin-file-sync/dist/refactor/blocks.js
277333
277104
  init_cjs_shims();
277334
- var import_shared13 = __toESM(require_dist3(), 1);
277105
+ var import_shared14 = __toESM(require_dist3(), 1);
277335
277106
  var import_esprima2 = __toESM(require_esprima(), 1);
277336
277107
  init_lodash();
277337
277108
  function flattenBlocks(blocks) {
@@ -277339,19 +277110,19 @@ function flattenBlocks(blocks) {
277339
277110
  return [];
277340
277111
  }
277341
277112
  return blocks.flatMap((block) => {
277342
- const localBlock = (0, import_shared13.convertBlock)(block);
277113
+ const localBlock = (0, import_shared14.convertBlock)(block);
277343
277114
  if (!localBlock) {
277344
277115
  return null;
277345
277116
  }
277346
- if ((0, import_shared13.isStepBlock)(localBlock)) {
277117
+ if ((0, import_shared14.isStepBlock)(localBlock)) {
277347
277118
  return localBlock;
277348
- } else if ((0, import_shared13.isControlBlock)(localBlock)) {
277119
+ } else if ((0, import_shared14.isControlBlock)(localBlock)) {
277349
277120
  switch (localBlock.type) {
277350
- case import_shared13.BlockType.PARALLEL: {
277121
+ case import_shared14.BlockType.PARALLEL: {
277351
277122
  const config2 = localBlock.config;
277352
277123
  return flattenBlocks(config2.dynamic?.blocks);
277353
277124
  }
277354
- case import_shared13.BlockType.CONDITION: {
277125
+ case import_shared14.BlockType.CONDITION: {
277355
277126
  const config2 = localBlock.config;
277356
277127
  const blocks2 = [
277357
277128
  ...flattenBlocks(config2.if?.blocks),
@@ -277360,7 +277131,7 @@ function flattenBlocks(blocks) {
277360
277131
  ];
277361
277132
  if (config2.if?.condition) {
277362
277133
  blocks2.push({
277363
- type: import_shared13.BlockType.CONDITION,
277134
+ type: import_shared14.BlockType.CONDITION,
277364
277135
  config: {
277365
277136
  if: config2.if
277366
277137
  }
@@ -277368,7 +277139,7 @@ function flattenBlocks(blocks) {
277368
277139
  }
277369
277140
  if (config2.elseIf?.length) {
277370
277141
  blocks2.push({
277371
- type: import_shared13.BlockType.CONDITION,
277142
+ type: import_shared14.BlockType.CONDITION,
277372
277143
  config: {
277373
277144
  elseIf: config2.elseIf
277374
277145
  }
@@ -277376,11 +277147,11 @@ function flattenBlocks(blocks) {
277376
277147
  }
277377
277148
  return blocks2;
277378
277149
  }
277379
- case import_shared13.BlockType.LOOP: {
277150
+ case import_shared14.BlockType.LOOP: {
277380
277151
  const config2 = localBlock.config;
277381
277152
  return flattenBlocks(config2.blocks);
277382
277153
  }
277383
- case import_shared13.BlockType.TRY_CATCH: {
277154
+ case import_shared14.BlockType.TRY_CATCH: {
277384
277155
  const config2 = localBlock.config;
277385
277156
  return [
277386
277157
  ...flattenBlocks(config2.try?.blocks),
@@ -277388,7 +277159,7 @@ function flattenBlocks(blocks) {
277388
277159
  ...flattenBlocks(config2.finally?.blocks)
277389
277160
  ];
277390
277161
  }
277391
- case import_shared13.BlockType.STREAM: {
277162
+ case import_shared14.BlockType.STREAM: {
277392
277163
  const config2 = localBlock.config;
277393
277164
  return flattenBlocks(config2.process?.blocks);
277394
277165
  }
@@ -277399,19 +277170,19 @@ function flattenBlocks(blocks) {
277399
277170
  }).filter(Boolean);
277400
277171
  }
277401
277172
  var extractPythonEvaluationPairs2 = async (code, entities, dataTree, namespacedEntitiesToExtract) => {
277402
- return (0, import_shared13.extractPythonEvaluationPairsWithParser)(code, entities, dataTree, parser4, namespacedEntitiesToExtract);
277173
+ return (0, import_shared14.extractPythonEvaluationPairsWithParser)(code, entities, dataTree, parser4, namespacedEntitiesToExtract);
277403
277174
  };
277404
277175
  var extractJsEvaluationPairs2 = async (jsSnippet, entitiesToExtract, dataTree, namespacedEntitiesToExtract) => {
277405
- return (0, import_shared13.extractJsEvaluationPairsWithTokenizer)(jsSnippet, entitiesToExtract, dataTree, import_esprima2.tokenize, namespacedEntitiesToExtract);
277176
+ return (0, import_shared14.extractJsEvaluationPairsWithTokenizer)(jsSnippet, entitiesToExtract, dataTree, import_esprima2.tokenize, namespacedEntitiesToExtract);
277406
277177
  };
277407
277178
  function getExtractorByPluginId(pluginId) {
277408
277179
  if (!pluginId) {
277409
277180
  return extractJsEvaluationPairs2;
277410
277181
  }
277411
277182
  switch (pluginId.trim().toLowerCase()) {
277412
- case import_shared13.LanguagePluginID.Python:
277183
+ case import_shared14.LanguagePluginID.Python:
277413
277184
  return extractPythonEvaluationPairs2;
277414
- case import_shared13.LanguagePluginID.JavaScript:
277185
+ case import_shared14.LanguagePluginID.JavaScript:
277415
277186
  default:
277416
277187
  return extractJsEvaluationPairs2;
277417
277188
  }
@@ -277420,14 +277191,14 @@ async function refactorNameInBlocks(params) {
277420
277191
  const { blocks, oldName, newName, namespace } = params;
277421
277192
  const flattenedBlocks = flattenBlocks(blocks);
277422
277193
  for (const block of flattenedBlocks) {
277423
- const pluginType = (0, import_shared13.getPluginType)(block) ?? void 0;
277194
+ const pluginType = (0, import_shared14.getPluginType)(block) ?? void 0;
277424
277195
  const extractor = getExtractorByPluginId(pluginType);
277425
- if ((0, import_shared13.isStepBlock)(block) && pluginType) {
277196
+ if ((0, import_shared14.isStepBlock)(block) && pluginType) {
277426
277197
  const configuration = block.config[pluginType];
277427
277198
  if (typeof configuration !== "object" || configuration == null) {
277428
277199
  continue;
277429
277200
  }
277430
- await (0, import_shared13.refactorNameInStep)({
277201
+ await (0, import_shared14.refactorNameInStep)({
277431
277202
  ...params,
277432
277203
  dataTree: {
277433
277204
  [newName]: {},
@@ -277437,9 +277208,9 @@ async function refactorNameInBlocks(params) {
277437
277208
  configuration,
277438
277209
  extractor
277439
277210
  });
277440
- } else if ((0, import_shared13.isControlBlock)(block)) {
277211
+ } else if ((0, import_shared14.isControlBlock)(block)) {
277441
277212
  for (const [value2, setValue] of getSetControlBlockExpressions2(block)) {
277442
- const newValue = await (0, import_shared13.refactorNameInString)({
277213
+ const newValue = await (0, import_shared14.refactorNameInString)({
277443
277214
  value: value2,
277444
277215
  oldName,
277445
277216
  newName,
@@ -277469,34 +277240,34 @@ function getSetControlBlockExpressions2(block) {
277469
277240
  const { config: config2, type: type2 } = block;
277470
277241
  const results = [];
277471
277242
  switch (type2) {
277472
- case import_shared13.BlockType.BREAK: {
277243
+ case import_shared14.BlockType.BREAK: {
277473
277244
  const controlConfig = config2;
277474
277245
  results.push(makeGetSet2(controlConfig, "condition"));
277475
277246
  break;
277476
277247
  }
277477
- case import_shared13.BlockType.THROW: {
277248
+ case import_shared14.BlockType.THROW: {
277478
277249
  const controlConfig = config2;
277479
277250
  results.push(makeGetSet2(controlConfig, "error"));
277480
277251
  break;
277481
277252
  }
277482
- case import_shared13.BlockType.RETURN: {
277253
+ case import_shared14.BlockType.RETURN: {
277483
277254
  const controlConfig = config2;
277484
277255
  results.push(makeGetSet2(controlConfig, "data"));
277485
277256
  break;
277486
277257
  }
277487
- case import_shared13.BlockType.WAIT: {
277258
+ case import_shared14.BlockType.WAIT: {
277488
277259
  const controlConfig = config2;
277489
277260
  results.push(makeGetSet2(controlConfig, "condition"));
277490
277261
  break;
277491
277262
  }
277492
- case import_shared13.BlockType.PARALLEL: {
277263
+ case import_shared14.BlockType.PARALLEL: {
277493
277264
  const controlConfig = config2;
277494
277265
  if (controlConfig.dynamic) {
277495
277266
  results.push(makeGetSet2(controlConfig.dynamic, "paths"));
277496
277267
  }
277497
277268
  break;
277498
277269
  }
277499
- case import_shared13.BlockType.CONDITION: {
277270
+ case import_shared14.BlockType.CONDITION: {
277500
277271
  const controlConfig = config2;
277501
277272
  if (controlConfig.if) {
277502
277273
  results.push(makeGetSet2(controlConfig.if, "condition"));
@@ -277506,15 +277277,15 @@ function getSetControlBlockExpressions2(block) {
277506
277277
  }
277507
277278
  break;
277508
277279
  }
277509
- case import_shared13.BlockType.LOOP: {
277280
+ case import_shared14.BlockType.LOOP: {
277510
277281
  const controlConfig = config2;
277511
277282
  results.push(makeGetSet2(controlConfig, "range"));
277512
277283
  break;
277513
277284
  }
277514
- case import_shared13.BlockType.TRY_CATCH: {
277285
+ case import_shared14.BlockType.TRY_CATCH: {
277515
277286
  break;
277516
277287
  }
277517
- case import_shared13.BlockType.VARIABLES: {
277288
+ case import_shared14.BlockType.VARIABLES: {
277518
277289
  const controlConfig = config2;
277519
277290
  for (const variable of controlConfig.items) {
277520
277291
  if (variable.value) {
@@ -277523,12 +277294,12 @@ function getSetControlBlockExpressions2(block) {
277523
277294
  }
277524
277295
  break;
277525
277296
  }
277526
- case import_shared13.BlockType.SEND: {
277297
+ case import_shared14.BlockType.SEND: {
277527
277298
  const controlConfig = config2;
277528
277299
  results.push(makeGetSet2(controlConfig, "message"));
277529
277300
  break;
277530
277301
  }
277531
- case import_shared13.BlockType.STREAM: {
277302
+ case import_shared14.BlockType.STREAM: {
277532
277303
  break;
277533
277304
  }
277534
277305
  default: {
@@ -277541,8 +277312,8 @@ function getSetControlBlockExpressions2(block) {
277541
277312
 
277542
277313
  // ../../../vite-plugin-file-sync/dist/refactor/javascript.js
277543
277314
  init_cjs_shims();
277544
- var import_types18 = __toESM(require_lib10(), 1);
277545
- var import_shared14 = __toESM(require_dist3(), 1);
277315
+ var import_types17 = __toESM(require_lib10(), 1);
277316
+ var import_shared15 = __toESM(require_dist3(), 1);
277546
277317
  function renameEntityInJavascript({ oldName, newName, nodePath, parentBinding, checkFunctionBinding = false }) {
277547
277318
  const functionVisitor = checkFunctionBinding ? {
277548
277319
  Function(path45) {
@@ -277556,7 +277327,7 @@ function renameEntityInJavascript({ oldName, newName, nodePath, parentBinding, c
277556
277327
  continue;
277557
277328
  const keyName = getIdentiferName(property.get("key").node);
277558
277329
  if (keyName === oldName && !property.node.shorthand) {
277559
- property.get("key").replaceInline(import_types18.default.identifier(newName));
277330
+ property.get("key").replaceInline(import_types17.default.identifier(newName));
277560
277331
  path45.skip();
277561
277332
  return;
277562
277333
  }
@@ -277573,8 +277344,8 @@ function renameEntityInJavascript({ oldName, newName, nodePath, parentBinding, c
277573
277344
  continue;
277574
277345
  const keyName = getIdentiferName(property.get("key").node);
277575
277346
  if (keyName === oldName) {
277576
- property.get("key").replaceInline(import_types18.default.identifier(newName));
277577
- property.get("value").replaceInline(import_types18.default.identifier(newName));
277347
+ property.get("key").replaceInline(import_types17.default.identifier(newName));
277348
+ property.get("value").replaceInline(import_types17.default.identifier(newName));
277578
277349
  property.set("shorthand", true);
277579
277350
  }
277580
277351
  }
@@ -277600,7 +277371,7 @@ function renameEntityInJavascript({ oldName, newName, nodePath, parentBinding, c
277600
277371
  return;
277601
277372
  }
277602
277373
  if (property.isIdentifier() && property.node.name === oldName) {
277603
- property.replaceInline(import_types18.default.identifier(newName));
277374
+ property.replaceInline(import_types17.default.identifier(newName));
277604
277375
  path45.skip();
277605
277376
  }
277606
277377
  }
@@ -277616,7 +277387,7 @@ function renameEntityInJavascript({ oldName, newName, nodePath, parentBinding, c
277616
277387
  if (path45.node.computed) {
277617
277388
  const property = path45.get("property");
277618
277389
  if (property.isIdentifier() && property.node.name === oldName) {
277619
- property.replaceInline(import_types18.default.identifier(newName));
277390
+ property.replaceInline(import_types17.default.identifier(newName));
277620
277391
  path45.skip();
277621
277392
  return;
277622
277393
  }
@@ -277646,7 +277417,7 @@ function renameEntityInJavascript({ oldName, newName, nodePath, parentBinding, c
277646
277417
  if (parentBinding) {
277647
277418
  for (let i2 = 0; i2 < components2.length - 1; i2++) {
277648
277419
  if (components2[i2]?.name === parentBinding && components2[i2 + 1]?.name === oldName) {
277649
- components2[i2 + 1]?.path.replaceInline(import_types18.default.identifier(newName));
277420
+ components2[i2 + 1]?.path.replaceInline(import_types17.default.identifier(newName));
277650
277421
  path45.skip();
277651
277422
  return;
277652
277423
  }
@@ -277654,7 +277425,7 @@ function renameEntityInJavascript({ oldName, newName, nodePath, parentBinding, c
277654
277425
  } else {
277655
277426
  for (const component of components2) {
277656
277427
  if (component.name === oldName) {
277657
- component.path.replaceInline(import_types18.default.identifier(newName));
277428
+ component.path.replaceInline(import_types17.default.identifier(newName));
277658
277429
  path45.skip();
277659
277430
  return;
277660
277431
  }
@@ -277688,40 +277459,40 @@ var RenameManager = class {
277688
277459
  oldName = extractNameFromBindAttribute(bindAttribute.node);
277689
277460
  if (oldName) {
277690
277461
  const bindValue = bindAttribute.node.value;
277691
- if (bindValue && import_types19.default.isJSXExpressionContainer(bindValue)) {
277462
+ if (bindValue && import_types18.default.isJSXExpressionContainer(bindValue)) {
277692
277463
  const expression = bindValue.expression;
277693
- if (import_types19.default.isIdentifier(expression)) {
277694
- bindAttribute.node.value = import_types19.default.jsxExpressionContainer(import_types19.default.identifier(newName));
277695
- } else if (import_types19.default.isMemberExpression(expression)) {
277464
+ if (import_types18.default.isIdentifier(expression)) {
277465
+ bindAttribute.node.value = import_types18.default.jsxExpressionContainer(import_types18.default.identifier(newName));
277466
+ } else if (import_types18.default.isMemberExpression(expression)) {
277696
277467
  const parentParts = [];
277697
277468
  let current = expression;
277698
- while (import_types19.default.isMemberExpression(current)) {
277699
- if (import_types19.default.isIdentifier(current.property)) {
277469
+ while (import_types18.default.isMemberExpression(current)) {
277470
+ if (import_types18.default.isIdentifier(current.property)) {
277700
277471
  parentParts.unshift(current.property.name);
277701
277472
  }
277702
277473
  current = current.object;
277703
277474
  }
277704
- if (import_types19.default.isIdentifier(current)) {
277475
+ if (import_types18.default.isIdentifier(current)) {
277705
277476
  parentParts.unshift(current.name);
277706
277477
  }
277707
- const newExpression = import_types19.default.cloneNode(expression, true);
277478
+ const newExpression = import_types18.default.cloneNode(expression, true);
277708
277479
  let finalMember = newExpression;
277709
- while (import_types19.default.isMemberExpression(finalMember) && import_types19.default.isMemberExpression(finalMember.property)) {
277480
+ while (import_types18.default.isMemberExpression(finalMember) && import_types18.default.isMemberExpression(finalMember.property)) {
277710
277481
  finalMember = finalMember.property;
277711
277482
  }
277712
- if (import_types19.default.isMemberExpression(finalMember) && import_types19.default.isIdentifier(finalMember.property)) {
277713
- finalMember.property = import_types19.default.identifier(newName);
277483
+ if (import_types18.default.isMemberExpression(finalMember) && import_types18.default.isIdentifier(finalMember.property)) {
277484
+ finalMember.property = import_types18.default.identifier(newName);
277714
277485
  }
277715
- bindAttribute.node.value = import_types19.default.jsxExpressionContainer(newExpression);
277486
+ bindAttribute.node.value = import_types18.default.jsxExpressionContainer(newExpression);
277716
277487
  }
277717
277488
  }
277718
277489
  }
277719
277490
  } else if (!nameAttribute) {
277720
- widgetNode.pushContainer("attributes", import_types19.default.jsxAttribute(import_types19.default.jsxIdentifier("bind"), import_types19.default.jsxExpressionContainer(import_types19.default.identifier(newName))));
277491
+ widgetNode.pushContainer("attributes", import_types18.default.jsxAttribute(import_types18.default.jsxIdentifier("bind"), import_types18.default.jsxExpressionContainer(import_types18.default.identifier(newName))));
277721
277492
  return;
277722
277493
  } else {
277723
277494
  oldName = nameAttribute.node.value ? nodeToValue(nameAttribute.node.value) : null;
277724
- nameAttribute.node.value = import_types19.default.stringLiteral(newName);
277495
+ nameAttribute.node.value = import_types18.default.stringLiteral(newName);
277725
277496
  }
277726
277497
  if (!oldName) {
277727
277498
  getLogger().error("Existing widget name is not found");
@@ -277787,7 +277558,7 @@ var RenameManager = class {
277787
277558
  // ../../../vite-plugin-file-sync/dist/source-tracker.js
277788
277559
  init_cjs_shims();
277789
277560
  var import_parser5 = __toESM(require_lib8(), 1);
277790
- var import_types23 = __toESM(require_lib10(), 1);
277561
+ var import_types22 = __toESM(require_lib10(), 1);
277791
277562
  import path14 from "node:path";
277792
277563
 
277793
277564
  // ../../../../node_modules/.pnpm/prettier@3.5.3/node_modules/prettier/index.mjs
@@ -300695,52 +300466,52 @@ var src_default = index_exports;
300695
300466
 
300696
300467
  // ../../../vite-plugin-file-sync/dist/parsing/theme.js
300697
300468
  init_cjs_shims();
300698
- var import_types20 = __toESM(require_lib10(), 1);
300469
+ var import_types19 = __toESM(require_lib10(), 1);
300699
300470
  function getKeyValue(key2) {
300700
- if (import_types20.default.isStringLiteral(key2.node)) {
300471
+ if (import_types19.default.isStringLiteral(key2.node)) {
300701
300472
  return key2.node.value;
300702
- } else if (import_types20.default.isIdentifier(key2.node)) {
300473
+ } else if (import_types19.default.isIdentifier(key2.node)) {
300703
300474
  return key2.node.name;
300704
300475
  }
300705
300476
  throw new Error(`Unsupported key type: ${key2.type}`);
300706
300477
  }
300707
300478
  function getKeyAst(key2) {
300708
- return /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(key2) ? import_types20.default.identifier(key2) : import_types20.default.stringLiteral(key2);
300479
+ return /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(key2) ? import_types19.default.identifier(key2) : import_types19.default.stringLiteral(key2);
300709
300480
  }
300710
300481
  function createAstFromValue(value2) {
300711
300482
  if (typeof value2 === "object" && value2 !== null) {
300712
300483
  const properties = [];
300713
300484
  for (const [key2, val] of Object.entries(value2)) {
300714
- properties.push(import_types20.default.objectProperty(getKeyAst(key2), createAstFromValue(val)));
300485
+ properties.push(import_types19.default.objectProperty(getKeyAst(key2), createAstFromValue(val)));
300715
300486
  }
300716
- return import_types20.default.objectExpression(properties);
300487
+ return import_types19.default.objectExpression(properties);
300717
300488
  } else if (typeof value2 === "string") {
300718
- return import_types20.default.stringLiteral(value2);
300489
+ return import_types19.default.stringLiteral(value2);
300719
300490
  } else if (typeof value2 === "number") {
300720
- return import_types20.default.numericLiteral(value2);
300491
+ return import_types19.default.numericLiteral(value2);
300721
300492
  } else if (typeof value2 === "boolean") {
300722
- return import_types20.default.booleanLiteral(value2);
300493
+ return import_types19.default.booleanLiteral(value2);
300723
300494
  } else if (value2 === null) {
300724
- return import_types20.default.nullLiteral();
300495
+ return import_types19.default.nullLiteral();
300725
300496
  }
300726
300497
  throw new Error(`Unsupported value type: ${typeof value2}`);
300727
300498
  }
300728
300499
  function mergeThemeUpdates(nodePath, updates) {
300729
- if (!import_types20.default.isObjectExpression(nodePath.node)) {
300500
+ if (!import_types19.default.isObjectExpression(nodePath.node)) {
300730
300501
  throw new Error("Current node must be an object expression");
300731
300502
  }
300732
300503
  Object.keys(updates).forEach((updatedKey) => {
300733
300504
  const propertyNodePath = nodePath.get("properties").find((prop) => getKeyValue(prop.get("key")) === updatedKey);
300734
300505
  const currentValue = propertyNodePath?.get("value");
300735
300506
  if (!currentValue) {
300736
- const newProperty = import_types20.default.objectProperty(getKeyAst(updatedKey), createAstFromValue(updates[updatedKey]));
300507
+ const newProperty = import_types19.default.objectProperty(getKeyAst(updatedKey), createAstFromValue(updates[updatedKey]));
300737
300508
  nodePath.node.properties.push(newProperty);
300738
300509
  return;
300739
300510
  }
300740
300511
  if (Array.isArray(currentValue)) {
300741
300512
  throw new Error("Array values are not supported yet");
300742
300513
  }
300743
- if (currentValue && import_types20.default.isObjectExpression(currentValue.node)) {
300514
+ if (currentValue && import_types19.default.isObjectExpression(currentValue.node)) {
300744
300515
  mergeThemeUpdates(currentValue, updates[updatedKey]);
300745
300516
  return;
300746
300517
  }
@@ -300751,7 +300522,7 @@ var updateThemeAst = (ast, updates) => {
300751
300522
  traverse(ast, {
300752
300523
  ExportDefaultDeclaration(path45) {
300753
300524
  const themeObject = path45.get("declaration").get("expression");
300754
- if (!(import_types20.default.isTSSatisfiesExpression(path45.node.declaration) && import_types20.default.isTSTypeReference(path45.node.declaration.typeAnnotation) && import_types20.default.isIdentifier(path45.node.declaration.typeAnnotation.typeName) && path45.node.declaration.typeAnnotation.typeName.name === "Theme" && !Array.isArray(themeObject) && import_types20.default.isObjectExpression(themeObject.node))) {
300525
+ if (!(import_types19.default.isTSSatisfiesExpression(path45.node.declaration) && import_types19.default.isTSTypeReference(path45.node.declaration.typeAnnotation) && import_types19.default.isIdentifier(path45.node.declaration.typeAnnotation.typeName) && path45.node.declaration.typeAnnotation.typeName.name === "Theme" && !Array.isArray(themeObject) && import_types19.default.isObjectExpression(themeObject.node))) {
300755
300526
  throw new Error(`Could not update theme because the default export is not an object expression. We currently only support exporting the theme as a default export which should satisfy the Theme type from @superblocks/library. Example:
300756
300527
 
300757
300528
  import type { Theme } from "@superblocksteam/library";
@@ -300767,7 +300538,7 @@ var updateThemeAst = (ast, updates) => {
300767
300538
 
300768
300539
  // ../../../vite-plugin-file-sync/dist/sb-scope-manager.js
300769
300540
  init_cjs_shims();
300770
- var import_types21 = __toESM(require_lib10(), 1);
300541
+ var import_types20 = __toESM(require_lib10(), 1);
300771
300542
  import EventEmitter5 from "node:events";
300772
300543
  import path13 from "node:path";
300773
300544
  var SbScopeManager = class extends EventEmitter5 {
@@ -301009,7 +300780,7 @@ var SbScopeManager = class extends EventEmitter5 {
301009
300780
  updateScopeEntity({ entityId, updates }) {
301010
300781
  const entityNode = this.sourceTracker.getElementToLocation(entityId);
301011
300782
  const filePath = this.sourceTracker.getElementToFilePath(entityId);
301012
- if (!entityNode || !(0, import_types21.isObjectProperty)(entityNode.node)) {
300783
+ if (!entityNode || !(0, import_types20.isObjectProperty)(entityNode.node)) {
301013
300784
  throw new Error("Entity to update not found" + entityId);
301014
300785
  }
301015
300786
  if (!filePath) {
@@ -301047,7 +300818,7 @@ var SbScopeManager = class extends EventEmitter5 {
301047
300818
  }
301048
300819
  const entityName = (entityNode?.node?.key).name;
301049
300820
  const filePath = this.sourceTracker.getElementToFilePath(entityId);
301050
- if (!entityNode || !(0, import_types21.isObjectProperty)(entityNode.node)) {
300821
+ if (!entityNode || !(0, import_types20.isObjectProperty)(entityNode.node)) {
301051
300822
  throw new Error("Entity to delete not found" + entityId);
301052
300823
  }
301053
300824
  if (!filePath) {
@@ -301085,14 +300856,14 @@ var SbScopeManager = class extends EventEmitter5 {
301085
300856
  };
301086
300857
  }
301087
300858
  const entityNode = this.sourceTracker.getElementToLocation(entityId);
301088
- if (!entityNode || !(0, import_types21.isObjectProperty)(entityNode.node)) {
300859
+ if (!entityNode || !(0, import_types20.isObjectProperty)(entityNode.node)) {
301089
300860
  return {
301090
300861
  changedFiles: []
301091
300862
  };
301092
300863
  }
301093
300864
  const key2 = entityNode.get("key");
301094
300865
  if (key2) {
301095
- key2.replaceWith(import_types21.default.identifier(newName));
300866
+ key2.replaceWith(import_types20.default.identifier(newName));
301096
300867
  }
301097
300868
  scopeDef.entityNames = scopeDef.entityNames.map((name17) => name17 === oldName ? newName : name17);
301098
300869
  scopeDef.scopeNameToEntityId[newName] = entityId;
@@ -301120,7 +300891,7 @@ var SbScopeManager = class extends EventEmitter5 {
301120
300891
  if (!scopeDef.scopeComponents) {
301121
300892
  throw new Error("Scope components not found, even though we added type parameters");
301122
300893
  }
301123
- const newProperty = import_types21.default.tsPropertySignature(import_types21.default.identifier(componentName), import_types21.default.tsTypeAnnotation(import_types21.default.tsAnyKeyword()));
300894
+ const newProperty = import_types20.default.tsPropertySignature(import_types20.default.identifier(componentName), import_types20.default.tsTypeAnnotation(import_types20.default.tsAnyKeyword()));
301124
300895
  const newComponents = scopeDef.scopeComponents.pushContainer("members", newProperty);
301125
300896
  scopeDef.entityNames.push(componentName);
301126
300897
  const updatedFiles = this.updateScopeUsages(scopeDef.name, scopeDef.entityNames);
@@ -301141,7 +300912,7 @@ var SbScopeManager = class extends EventEmitter5 {
301141
300912
  const componentTypeId = getScopeElementId(scopeDef.id, componentName);
301142
300913
  const componentNode = this.sourceTracker.getElementToLocation(componentTypeId);
301143
300914
  const filePath = this.sourceTracker.getElementToFilePath(componentTypeId);
301144
- if (!componentNode || !import_types21.default.isTSPropertySignature(componentNode.node) || !filePath) {
300915
+ if (!componentNode || !import_types20.default.isTSPropertySignature(componentNode.node) || !filePath) {
301145
300916
  return [];
301146
300917
  }
301147
300918
  componentNode.remove();
@@ -301175,7 +300946,7 @@ var SbScopeManager = class extends EventEmitter5 {
301175
300946
  }
301176
300947
  const key2 = componentNode.get("key");
301177
300948
  if (key2) {
301178
- key2.replaceWith(import_types21.default.identifier(newName));
300949
+ key2.replaceWith(import_types20.default.identifier(newName));
301179
300950
  }
301180
300951
  scopeDef.entityNames = scopeDef.entityNames.map((name17) => name17 === oldName ? newName : name17);
301181
300952
  delete scopeDef.scopeNameToEntityId[oldName];
@@ -301828,7 +301599,7 @@ var SourceTracker = class {
301828
301599
  let parentAttr = openingTag.get("attributes").find((attr) => attr.isJSXAttribute() && attr.node.name.name === parent);
301829
301600
  if (!parentAttr && parent) {
301830
301601
  const newAttr = openingTag.pushContainer("attributes", [
301831
- import_types23.default.jsxAttribute(import_types23.default.jsxIdentifier(parent), import_types23.default.jSXExpressionContainer(import_types23.default.objectExpression([])))
301602
+ import_types22.default.jsxAttribute(import_types22.default.jsxIdentifier(parent), import_types22.default.jSXExpressionContainer(import_types22.default.objectExpression([])))
301832
301603
  ]);
301833
301604
  parentAttr = newAttr[0];
301834
301605
  }
@@ -301853,7 +301624,7 @@ var SourceTracker = class {
301853
301624
  let attr = openingTag.get("attributes").find((attr2) => attr2.isJSXAttribute() && attr2.node.name.name === property);
301854
301625
  if (!attr) {
301855
301626
  attr = openingTag.pushContainer("attributes", [
301856
- import_types23.default.jsxAttribute(import_types23.default.jsxIdentifier(property), import_types23.default.stringLiteral(""))
301627
+ import_types22.default.jsxAttribute(import_types22.default.jsxIdentifier(property), import_types22.default.stringLiteral(""))
301857
301628
  ])[0];
301858
301629
  }
301859
301630
  if (value2 === void 0 || typeof value2 === "string" && value2 === "") {
@@ -301879,7 +301650,7 @@ var SourceTracker = class {
301879
301650
  const openingElement = element.get("openingElement");
301880
301651
  if (openingElement.node.selfClosing) {
301881
301652
  openingElement.node.selfClosing = false;
301882
- element.node.closingElement = import_types23.default.jsxClosingElement(import_types23.default.jsxIdentifier(getTagName(openingElement.node.name) ?? ""));
301653
+ element.node.closingElement = import_types22.default.jsxClosingElement(import_types22.default.jsxIdentifier(getTagName(openingElement.node.name) ?? ""));
301883
301654
  }
301884
301655
  };
301885
301656
  setProperty = async ({ source: source2, property, value: value2, type: type2 }) => {
@@ -302063,7 +301834,7 @@ var SourceTracker = class {
302063
301834
  }
302064
301835
  const attributes = pageElement.get("attributes");
302065
301836
  const attribute = attributes?.find((attr) => attr.isJSXAttribute() && attr.node.name.name === "name");
302066
- attribute?.replaceWith(import_types23.default.jsxAttribute(import_types23.default.jsxIdentifier("name"), import_types23.default.stringLiteral(newName)));
301837
+ attribute?.replaceWith(import_types22.default.jsxAttribute(import_types22.default.jsxIdentifier("name"), import_types22.default.stringLiteral(newName)));
302067
301838
  this.changedFiles.add(filePath);
302068
301839
  };
302069
301840
  getAddElementImports = ({ properties, children }) => {
@@ -302594,7 +302365,7 @@ var FileSyncManager = class extends EventEmitter6 {
302594
302365
  }
302595
302366
  path46.traverse({
302596
302367
  ObjectExpression(path47) {
302597
- path47.pushContainer("properties", import_types25.default.objectProperty(import_types25.default.identifier("id"), import_types25.default.stringLiteral(elementId)));
302368
+ path47.pushContainer("properties", import_types24.default.objectProperty(import_types24.default.identifier("id"), import_types24.default.stringLiteral(elementId)));
302598
302369
  path47.skip();
302599
302370
  }
302600
302371
  });
@@ -303320,19 +303091,19 @@ var indexHtml = (
303320
303091
 
303321
303092
  // ../../../vite-plugin-file-sync/dist/lock-service/index.js
303322
303093
  init_cjs_shims();
303323
- var import_shared18 = __toESM(require_dist3(), 1);
303094
+ var import_shared19 = __toESM(require_dist3(), 1);
303324
303095
  import EventEmitter7 from "node:events";
303325
303096
 
303326
303097
  // ../../../vite-plugin-file-sync/dist/sync-service/server-rpc/client.js
303327
303098
  init_cjs_shims();
303328
- var import_shared16 = __toESM(require_dist3(), 1);
303329
303099
  var import_shared17 = __toESM(require_dist3(), 1);
303100
+ var import_shared18 = __toESM(require_dist3(), 1);
303330
303101
 
303331
303102
  // ../../../vite-plugin-file-sync/dist/sync-service/server-rpc/handlers.js
303332
303103
  init_cjs_shims();
303333
- var import_shared15 = __toESM(require_dist3(), 1);
303104
+ var import_shared16 = __toESM(require_dist3(), 1);
303334
303105
  async function notImplemented() {
303335
- throw new import_shared15.NotImplementedError("Signing methods are not implemented");
303106
+ throw new import_shared16.NotImplementedError("Signing methods are not implemented");
303336
303107
  }
303337
303108
  function createRequestHandlers2() {
303338
303109
  const requestHandlers = {
@@ -303352,7 +303123,7 @@ function createRequestHandlers2() {
303352
303123
  async function connectToISocketRPCServer2({ superblocksBaseUrl, token: token2 }) {
303353
303124
  const requestHandlers = createRequestHandlers2();
303354
303125
  const authorization = `Bearer ${token2}`;
303355
- const wsUrl = new URL(`api/${import_shared16.serverWsPath}`, superblocksBaseUrl);
303126
+ const wsUrl = new URL(`api/${import_shared17.serverWsPath}`, superblocksBaseUrl);
303356
303127
  if (wsUrl.protocol === "http:") {
303357
303128
  wsUrl.protocol = "ws:";
303358
303129
  } else if (wsUrl.protocol === "https:") {
@@ -303372,8 +303143,8 @@ async function connectToISocketRPCServer2({ superblocksBaseUrl, token: token2 })
303372
303143
  }
303373
303144
  async function connectISocket2(wsUrl, authorization, requestHandlers, globalMiddlewares, timeouts) {
303374
303145
  const ws = await connectWebSocket2(wsUrl);
303375
- const isocket = new import_shared16.ISocketWithClientAuth(ws, authorization, requestHandlers, globalMiddlewares, timeouts);
303376
- return (0, import_shared16.createISocketClient)(isocket);
303146
+ const isocket = new import_shared17.ISocketWithClientAuth(ws, authorization, requestHandlers, globalMiddlewares, timeouts);
303147
+ return (0, import_shared17.createISocketClient)(isocket);
303377
303148
  }
303378
303149
  function connectWebSocket2(wsUrl) {
303379
303150
  return new Promise((resolve8, reject) => {
@@ -303391,9 +303162,9 @@ async function unwrapResponseDto(request) {
303391
303162
  if (!response.responseMeta.success || response.responseMeta.error || response.responseMeta.status !== 200) {
303392
303163
  const errorMessage = response.responseMeta.error?.message ?? response.responseMeta.message ?? `Request failed with status ${response.responseMeta.status}`;
303393
303164
  if (response.responseMeta.status === 409) {
303394
- throw new import_shared17.ConflictError(errorMessage);
303165
+ throw new import_shared18.ConflictError(errorMessage);
303395
303166
  } else if (response.responseMeta.status === 404) {
303396
- throw new import_shared16.NotFoundError(errorMessage);
303167
+ throw new import_shared17.NotFoundError(errorMessage);
303397
303168
  }
303398
303169
  throw new Error(errorMessage);
303399
303170
  }
@@ -303454,7 +303225,7 @@ var LockService = class extends EventEmitter7 {
303454
303225
  "shutdown",
303455
303226
  "shutdownAndExit"
303456
303227
  ];
303457
- (0, import_shared18.addTracingToMethods)(this, methods, this._tracer);
303228
+ (0, import_shared19.addTracingToMethods)(this, methods, this._tracer);
303458
303229
  }
303459
303230
  setSyncCallback(callback) {
303460
303231
  this.syncCallback = callback;
@@ -303499,7 +303270,7 @@ var LockService = class extends EventEmitter7 {
303499
303270
  return;
303500
303271
  }
303501
303272
  } catch (error) {
303502
- if (error instanceof import_shared18.ConflictError) {
303273
+ if (error instanceof import_shared19.ConflictError) {
303503
303274
  logger3.error(`[lock-service] Lock is already acquired by another user. Please try again later.`, getErrorMeta(error));
303504
303275
  this.emit("statusChange", LockServiceStatus.FAILED_TO_ACQUIRE_LOCK);
303505
303276
  this.status = LockServiceStatus.FAILED_TO_ACQUIRE_LOCK;
@@ -303555,12 +303326,12 @@ var LockService = class extends EventEmitter7 {
303555
303326
  return true;
303556
303327
  }
303557
303328
  } catch (error) {
303558
- if (error instanceof import_shared18.ConflictError) {
303329
+ if (error instanceof import_shared19.ConflictError) {
303559
303330
  logger3.error("[lock-service] Lock has been overridden by another user", getErrorMeta(error));
303560
303331
  this.emit("statusChange", LockServiceStatus.LOCK_INVALID);
303561
303332
  this.status = LockServiceStatus.LOCK_INVALID;
303562
303333
  await this.shutdownAndExit();
303563
- } else if (error instanceof import_shared18.NotFoundError) {
303334
+ } else if (error instanceof import_shared19.NotFoundError) {
303564
303335
  logger3.error("[lock-service] Lock is not found, shutting down", getErrorMeta(error));
303565
303336
  this.emit("statusChange", LockServiceStatus.LOCK_INVALID);
303566
303337
  this.status = LockServiceStatus.LOCK_INVALID;
@@ -303768,7 +303539,7 @@ function generateRootSource(code, fileSyncManager) {
303768
303539
 
303769
303540
  // ../../../vite-plugin-file-sync/dist/socket-manager.js
303770
303541
  init_cjs_shims();
303771
- var import_shared19 = __toESM(require_dist3(), 1);
303542
+ var import_shared20 = __toESM(require_dist3(), 1);
303772
303543
  import EventEmitter8 from "node:events";
303773
303544
 
303774
303545
  // ../../../vite-plugin-file-sync/dist/util/tracing.js
@@ -303862,7 +303633,7 @@ var SocketManager = class extends EventEmitter8 {
303862
303633
  }
303863
303634
  });
303864
303635
  wss.on("connection", (ws, isEditor, peerId, userId) => {
303865
- const socket = (0, import_shared19.createISocketClient)(new import_shared19.ISocket(ws, withMethodTracing(tracer2, {
303636
+ const socket = (0, import_shared20.createISocketClient)(new import_shared20.ISocket(ws, withMethodTracing(tracer2, {
303866
303637
  editor: {
303867
303638
  // Update widgets
303868
303639
  setProperties: [fileSyncManager.handleSetProperties],
@@ -304637,7 +304408,7 @@ async function getAppScope(fileSyncManager) {
304637
304408
  pageId: apiPb.trigger.application?.pageId,
304638
304409
  organizationId: apiPb.metadata.organization,
304639
304410
  updated: apiPb.metadata?.timestamps?.updated ? new Date(apiPb.metadata?.timestamps?.updated) : void 0,
304640
- triggerType: import_shared20.ApiTriggerType.UI,
304411
+ triggerType: import_shared21.ApiTriggerType.UI,
304641
304412
  apiPb
304642
304413
  }));
304643
304414
  const appScope = {
@@ -307770,7 +307541,7 @@ async function startVite({ app, httpServer: httpServer2, root: root2, mode, port
307770
307541
  };
307771
307542
  const isCustomBuildEnabled2 = await isCustomComponentsEnabled();
307772
307543
  const customFolder = path21.join(root2, "custom");
307773
- const cdnUrl = "https://assets-cdn.superblocks.com/library/2.0.3-next.171";
307544
+ const cdnUrl = "https://assets-cdn.superblocks.com/library/2.0.3-next.173";
307774
307545
  const env3 = loadEnv(mode, root2, "");
307775
307546
  const hmrPort = await getFreePort();
307776
307547
  const hmrOptions = {
@@ -321963,7 +321734,7 @@ var OperationQueue = class {
321963
321734
  // ../../../vite-plugin-file-sync/dist/sync-service/index.js
321964
321735
  init_cjs_shims();
321965
321736
  import EventEmitter11 from "node:events";
321966
- var import_shared33 = __toESM(require_dist3(), 1);
321737
+ var import_shared34 = __toESM(require_dist3(), 1);
321967
321738
 
321968
321739
  // ../../../vite-plugin-file-sync/dist/util/with-resolvers.js
321969
321740
  init_cjs_shims();
@@ -321983,7 +321754,7 @@ import * as fsp3 from "node:fs/promises";
321983
321754
 
321984
321755
  // ../../../vite-plugin-file-sync/dist/sync-service/hash-dir-tree.js
321985
321756
  init_cjs_shims();
321986
- var import_shared31 = __toESM(require_dist3(), 1);
321757
+ var import_shared32 = __toESM(require_dist3(), 1);
321987
321758
  var import_util32 = __toESM(require_dist4(), 1);
321988
321759
  async function hashLocalDirectory2(localDirectoryPath) {
321989
321760
  const directoryContents = [];
@@ -321992,7 +321763,7 @@ async function hashLocalDirectory2(localDirectoryPath) {
321992
321763
  let entry;
321993
321764
  switch (localDirEntry.type) {
321994
321765
  case "-": {
321995
- const hash3 = await (0, import_shared31.hashFileContents)(localDirEntry.contents);
321766
+ const hash3 = await (0, import_shared32.hashFileContents)(localDirEntry.contents);
321996
321767
  entry = {
321997
321768
  type: "-",
321998
321769
  executable: localDirEntry.executable,
@@ -322024,7 +321795,7 @@ async function hashLocalDirectory2(localDirectoryPath) {
322024
321795
  }
322025
321796
  directoryContents.push(entry);
322026
321797
  }
322027
- const hash2 = await (0, import_shared31.hashDirectoryContents)(directoryContents);
321798
+ const hash2 = await (0, import_shared32.hashDirectoryContents)(directoryContents);
322028
321799
  return { contents: directoryContents, hash: hash2 };
322029
321800
  }
322030
321801
 
@@ -322504,7 +322275,7 @@ var HashCache = class {
322504
322275
 
322505
322276
  // ../../../vite-plugin-file-sync/dist/sync-service/snapshot/take-snapshot.js
322506
322277
  init_cjs_shims();
322507
- var import_shared32 = __toESM(require_dist3(), 1);
322278
+ var import_shared33 = __toESM(require_dist3(), 1);
322508
322279
  var import_util33 = __toESM(require_dist4(), 1);
322509
322280
  async function snapshotLocalDirectory(localDirectoryPath) {
322510
322281
  const directoryContents = [];
@@ -322513,7 +322284,7 @@ async function snapshotLocalDirectory(localDirectoryPath) {
322513
322284
  let entry;
322514
322285
  switch (localDirEntry.type) {
322515
322286
  case "-": {
322516
- const hash2 = await (0, import_shared32.hashFileContents)(localDirEntry.contents);
322287
+ const hash2 = await (0, import_shared33.hashFileContents)(localDirEntry.contents);
322517
322288
  entry = {
322518
322289
  type: "-",
322519
322290
  name: localDirEntry.name,
@@ -322546,7 +322317,7 @@ async function snapshotLocalDirectory(localDirectoryPath) {
322546
322317
  }
322547
322318
  directoryContents.push(entry);
322548
322319
  }
322549
- const directoryHash = await (0, import_shared32.hashDirectoryContents)(directoryContents);
322320
+ const directoryHash = await (0, import_shared33.hashDirectoryContents)(directoryContents);
322550
322321
  return {
322551
322322
  hash: directoryHash,
322552
322323
  contents: directoryContents
@@ -322677,7 +322448,7 @@ var SyncService = class extends EventEmitter11 {
322677
322448
  "discardLocalDraftChanges",
322678
322449
  "commitLocalDraftChanges"
322679
322450
  ];
322680
- (0, import_shared33.addTracingToMethods)(this, methods, this._tracer);
322451
+ (0, import_shared34.addTracingToMethods)(this, methods, this._tracer);
322681
322452
  }
322682
322453
  /** The current status of the sync service, which indicates what the service is currently doing */
322683
322454
  get status() {
@@ -323922,11 +323693,11 @@ async function dev(options8) {
323922
323693
 
323923
323694
  // ../sdk/dist/cli-replacement/init.js
323924
323695
  init_cjs_shims();
323925
- var import_shared34 = __toESM(require_dist3(), 1);
323696
+ var import_shared35 = __toESM(require_dist3(), 1);
323926
323697
  var import_util35 = __toESM(require_dist4(), 1);
323927
323698
  async function fetchAndWriteApplication({ resourceId, viewMode, featureFlags, projectRootFolder, appRelativePath, sdk: sdk2, skipSigningVerification }) {
323928
323699
  const headers = {
323929
- [import_util35.COMPONENT_EVENT_HEADER]: import_shared34.ComponentEvent.INIT
323700
+ [import_util35.COMPONENT_EVENT_HEADER]: import_shared35.ComponentEvent.INIT
323930
323701
  };
323931
323702
  const application = await sdk2.fetchApplicationWithComponents({
323932
323703
  applicationId: resourceId,
@@ -323947,7 +323718,7 @@ async function fetchAndWriteApplication({ resourceId, viewMode, featureFlags, pr
323947
323718
  }
323948
323719
 
323949
323720
  // ../sdk/dist/index.js
323950
- var import_shared35 = __toESM(require_dist3(), 1);
323721
+ var import_shared36 = __toESM(require_dist3(), 1);
323951
323722
 
323952
323723
  // src/commands/commits.mts
323953
323724
  var import_util38 = __toESM(require_dist4(), 1);
@@ -329030,7 +328801,7 @@ ${error.message}.`
329030
328801
  task.title = `Pulling resources from branch ${ctx.localBranchName}...`;
329031
328802
  let viewMode;
329032
328803
  if (commitId) {
329033
- viewMode = import_shared35.ExportViewMode.EXPORT_COMMIT;
328804
+ viewMode = import_shared36.ExportViewMode.EXPORT_COMMIT;
329034
328805
  } else {
329035
328806
  viewMode = await getMode(task, mode);
329036
328807
  }