@arcanewizards/timecode-toolbox 0.1.3 → 0.1.4

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/frontend.js CHANGED
@@ -25238,7 +25238,7 @@
25238
25238
  return t4;
25239
25239
  };
25240
25240
 
25241
- // ../../packages/sigil/dist/chunk-E3VUC3Q4.js
25241
+ // ../../packages/sigil/dist/chunk-LDUYBGRY.js
25242
25242
  var import_compiler_runtime4 = __toESM(require_compiler_runtime(), 1);
25243
25243
 
25244
25244
  // ../../packages/sigil/dist/chunk-BIY5HAXP.js
@@ -35386,7 +35386,7 @@
35386
35386
  return condition ? truthyClassName : falseyClassName;
35387
35387
  }
35388
35388
 
35389
- // ../../packages/sigil/dist/chunk-E3VUC3Q4.js
35389
+ // ../../packages/sigil/dist/chunk-LDUYBGRY.js
35390
35390
  var import_react11 = __toESM(require_react(), 1);
35391
35391
 
35392
35392
  // ../../node_modules/.pnpm/@arcanejs+toolkit-frontend@0.11.0/node_modules/@arcanejs/toolkit-frontend/dist/chunk-DK4BAXVE.mjs
@@ -35425,7 +35425,7 @@
35425
35425
  `;
35426
35426
  var TRANSPARENCY_SVG_URI = `data:image/svg+xml,${encodeURIComponent(TRANSPARENCY_SVG)}`;
35427
35427
 
35428
- // ../../packages/sigil/dist/chunk-E3VUC3Q4.js
35428
+ // ../../packages/sigil/dist/chunk-LDUYBGRY.js
35429
35429
  var import_react12 = __toESM(require_react(), 1);
35430
35430
  var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
35431
35431
  var import_react13 = __toESM(require_react(), 1);
@@ -35486,8 +35486,9 @@
35486
35486
  touching,
35487
35487
  position,
35488
35488
  className,
35489
- primary
35490
- }) => cn(`sigil-control-button`, cnd(variant === "border", `sigil-control-button-variant-border`), cnd(variant === "large", `sigil-control-button-variant-large`), cnd(variant === "properties", `sigil-control-button-variant-properties`), cnd(variant === "table-row", `sigil-control-button-variant-table-row`), cnd(variant === "toolbar", `sigil-control-button-variant-toolbar`), cnd(variant === "titlebar", `sigil-control-button-variant-titlebar`), cnd(touching, `sigil-control-button-touching`), cnd(active, `sigil-control-button-active`), cnd(touching && active, `sigil-control-button-active-touching`), cnd(primary, `sigil-control-button-primary`), clsControlPosition(position), className);
35489
+ primary,
35490
+ destructive
35491
+ }) => cn(`sigil-control-button`, cnd(variant === "border", `sigil-control-button-variant-border`), cnd(variant === "large", `sigil-control-button-variant-large`), cnd(variant === "properties", `sigil-control-button-variant-properties`), cnd(variant === "table-row", `sigil-control-button-variant-table-row`), cnd(variant === "toolbar", `sigil-control-button-variant-toolbar`), cnd(variant === "titlebar", `sigil-control-button-variant-titlebar`), cnd(touching, `sigil-control-button-touching`), cnd(active, `sigil-control-button-active`), cnd(touching && active, `sigil-control-button-active-touching`), cnd(primary, `sigil-control-button-primary`), cnd(destructive, `sigil-control-button-destructive`), clsControlPosition(position), className);
35491
35492
  var ControlButtonFrame = /* @__PURE__ */ (0, import_react12.forwardRef)(({
35492
35493
  children,
35493
35494
  className,
@@ -35501,6 +35502,7 @@
35501
35502
  tooltipSide,
35502
35503
  position,
35503
35504
  primary,
35505
+ destructive,
35504
35506
  ...props
35505
35507
  }, ref) => {
35506
35508
  const btn = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", {
@@ -35514,6 +35516,7 @@
35514
35516
  touching,
35515
35517
  position,
35516
35518
  primary,
35519
+ destructive,
35517
35520
  className
35518
35521
  }),
35519
35522
  children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", {
@@ -35629,7 +35632,7 @@
35629
35632
  subgrid,
35630
35633
  ...props
35631
35634
  }, ref) => {
35632
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", {
35635
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("label", {
35633
35636
  ...props,
35634
35637
  ref,
35635
35638
  className: cn("flex items-center justify-end gap-0.6 p-0.6", clsControlPosition(position), cnd(nonMicro, "max-[550px]:hidden"), cnd(disabled, "opacity-50"), clsControlSubgridPosition(position, subgrid), className)
@@ -35661,9 +35664,12 @@
35661
35664
  children,
35662
35665
  className,
35663
35666
  ...props
35664
- }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ControlButtonGroup, {
35667
+ }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", {
35665
35668
  ref,
35666
- className: cn("control-grid-pos-row", className),
35669
+ className: cn(`
35670
+ flex items-stretch gap-1
35671
+ [&>button]:grow
35672
+ `, clsControlPosition("row"), className),
35667
35673
  ...props,
35668
35674
  children
35669
35675
  }));
@@ -35859,46 +35865,9 @@
35859
35865
  }
35860
35866
  return t1;
35861
35867
  };
35862
- var COLOR_OPTIONS = {
35863
- red: {
35864
- label: "Red",
35865
- value: "red"
35866
- },
35867
- blue: {
35868
- label: "Blue",
35869
- value: "blue"
35870
- },
35871
- teal: {
35872
- label: "Teal",
35873
- value: "teal"
35874
- },
35875
- green: {
35876
- label: "Green",
35877
- value: "green"
35878
- },
35879
- yellow: {
35880
- label: "Yellow",
35881
- value: "yellow"
35882
- },
35883
- purple: {
35884
- label: "Purple",
35885
- value: "purple"
35886
- },
35887
- orange: {
35888
- label: "Orange",
35889
- value: "orange"
35890
- },
35891
- brown: {
35892
- label: "Brown",
35893
- value: "brown"
35894
- },
35895
- gray: {
35896
- label: "Gray",
35897
- value: "gray"
35898
- }
35899
- };
35900
- var ControlColorSelect = ({
35901
- color,
35868
+ var ControlColoredSelect = ({
35869
+ options,
35870
+ value,
35902
35871
  onChange,
35903
35872
  variant,
35904
35873
  position,
@@ -35906,11 +35875,11 @@
35906
35875
  placeholder,
35907
35876
  ...props
35908
35877
  }) => {
35909
- const options = Object.values(COLOR_OPTIONS);
35910
- const selectedColor = sigilColorUsage(color || "gray");
35878
+ const selectedOption = options.find((option) => option.value === value);
35879
+ const selectedColor = sigilColorUsage(selectedOption?.color ?? "gray");
35911
35880
  return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ControlSelect, {
35912
35881
  options,
35913
- value: color,
35882
+ value,
35914
35883
  onChange,
35915
35884
  triggerButton: (option) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(dist_exports2.Trigger, {
35916
35885
  disabled,
@@ -35946,7 +35915,7 @@
35946
35915
  option: (option) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", {
35947
35916
  className: "",
35948
35917
  style: {
35949
- color: `var(--sigil-usage-${option.value}-foreground)`
35918
+ color: `var(--sigil-usage-${option.color}-foreground)`
35950
35919
  },
35951
35920
  children: option.label
35952
35921
  }),
@@ -35956,6 +35925,64 @@
35956
35925
  ...props
35957
35926
  });
35958
35927
  };
35928
+ var COLOR_OPTIONS = {
35929
+ red: {
35930
+ label: "Red",
35931
+ value: "red",
35932
+ color: "red"
35933
+ },
35934
+ blue: {
35935
+ label: "Blue",
35936
+ value: "blue",
35937
+ color: "blue"
35938
+ },
35939
+ teal: {
35940
+ label: "Teal",
35941
+ value: "teal",
35942
+ color: "teal"
35943
+ },
35944
+ green: {
35945
+ label: "Green",
35946
+ value: "green",
35947
+ color: "green"
35948
+ },
35949
+ yellow: {
35950
+ label: "Yellow",
35951
+ value: "yellow",
35952
+ color: "yellow"
35953
+ },
35954
+ purple: {
35955
+ label: "Purple",
35956
+ value: "purple",
35957
+ color: "purple"
35958
+ },
35959
+ orange: {
35960
+ label: "Orange",
35961
+ value: "orange",
35962
+ color: "orange"
35963
+ },
35964
+ brown: {
35965
+ label: "Brown",
35966
+ value: "brown",
35967
+ color: "brown"
35968
+ },
35969
+ gray: {
35970
+ label: "Gray",
35971
+ value: "gray",
35972
+ color: "gray"
35973
+ }
35974
+ };
35975
+ var COLOR_OPTIONS_ARRAY = Object.values(COLOR_OPTIONS);
35976
+ var ControlColorSelect = ({
35977
+ color,
35978
+ ...props
35979
+ }) => {
35980
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ControlColoredSelect, {
35981
+ options: COLOR_OPTIONS_ARRAY,
35982
+ value: color,
35983
+ ...props
35984
+ });
35985
+ };
35959
35986
  var isDarkDialog = (variant) => variant === "dark" || variant === "dark-compact";
35960
35987
  var DialogTitle = /* @__PURE__ */ (0, import_react11.forwardRef)(({
35961
35988
  className,
@@ -37432,6 +37459,7 @@
37432
37459
  };
37433
37460
  var createDefaultBrowserContext = (browser) => {
37434
37461
  const defaults = {
37462
+ appListenerChangesHandledExternally: false,
37435
37463
  openExternalLink: (url) => {
37436
37464
  window.open(url, "_blank", "noopener,noreferrer");
37437
37465
  },
@@ -37680,6 +37708,24 @@ Data Directory: ${system.dataDirectory}`
37680
37708
  return resolvedBrowser;
37681
37709
  };
37682
37710
 
37711
+ // ../../packages/sigil/dist/shared/config.js
37712
+ var APP_LISTENER_CONFIG = zod_default.object({
37713
+ port: zod_default.union([zod_default.number().int().min(1).max(65535), zod_default.object({
37714
+ from: zod_default.number().int().min(1).max(65535),
37715
+ to: zod_default.number().int().min(1).max(65535)
37716
+ }).refine((data) => data.to >= data.from, {
37717
+ message: '"to" must be greater than or equal to "from"'
37718
+ })]),
37719
+ interface: zod_default.string().optional()
37720
+ });
37721
+ var ALL_APP_LISTENER_CONFIG = zod_default.record(zod_default.string(), APP_LISTENER_CONFIG);
37722
+ var portString = (port) => {
37723
+ if (typeof port === "number") {
37724
+ return port.toString();
37725
+ }
37726
+ return `${port.from}-${port.to}`;
37727
+ };
37728
+
37683
37729
  // src/components/proto.ts
37684
37730
  var NET_UTILS_GENERAL_TARGET_DEFINITION = zod_default.union([zod_default.object({
37685
37731
  type: zod_default.literal("host"),
@@ -37742,6 +37788,7 @@ Data Directory: ${system.dataDirectory}`
37742
37788
  link: INPUT_OR_GENERATOR_INSTANCE_ID.nullable()
37743
37789
  });
37744
37790
  var TOOLBOX_CONFIG = zod_default.object({
37791
+ appListener: APP_LISTENER_CONFIG.partial().optional(),
37745
37792
  inputs: zod_default.record(zod_default.string(), INPUT_CONFIG),
37746
37793
  generators: zod_default.record(zod_default.string(), GENERATOR_CONFIG),
37747
37794
  outputs: zod_default.record(zod_default.string(), OUTPUT_CONFIG),
@@ -37757,8 +37804,8 @@ Data Directory: ${system.dataDirectory}`
37757
37804
  var isTimecodeToolboxComponent = (component) => component.namespace === NAMESPACE;
37758
37805
 
37759
37806
  // src/components/frontend/toolbox/root.tsx
37760
- var import_compiler_runtime20 = __toESM(require_compiler_runtime());
37761
- var import_react43 = __toESM(require_react());
37807
+ var import_compiler_runtime28 = __toESM(require_compiler_runtime());
37808
+ var import_react51 = __toESM(require_react());
37762
37809
 
37763
37810
  // ../../packages/artnet/dist/chunk-J2HDMITA.js
37764
37811
  var ARTNET_PORT = 6454;
@@ -37803,7 +37850,9 @@ Data Directory: ${system.dataDirectory}`
37803
37850
  noChildren: "No inputs yet. Please add one using the buttons below.",
37804
37851
  addButton: (protocol) => `Add ${protocol}`,
37805
37852
  addDialog: (protocol) => `Add ${protocol} Input`,
37806
- editDialog: (protocol, name) => `Edit ${protocol} Input ${name}`
37853
+ editDialog: (protocol, name) => `Edit ${protocol} Input ${name}`,
37854
+ deleteDialog: `Delete input?`,
37855
+ deleteDialogDetails: `Are you sure you want to delete this input? This action cannot be undone.`
37807
37856
  },
37808
37857
  smtpeModes: {
37809
37858
  SMPTE: `SMPTE ${TIMECODE_FPS.SMPTE}FPS`,
@@ -37826,17 +37875,37 @@ Data Directory: ${system.dataDirectory}`
37826
37875
  clock: "Clock"
37827
37876
  },
37828
37877
  addDialog: (protocol) => `Add ${protocol} Generator`,
37829
- editDialog: (protocol, name) => `Edit ${protocol} Generator ${name}`
37878
+ editDialog: (protocol, name) => `Edit ${protocol} Generator ${name}`,
37879
+ deleteDialog: `Delete generator?`,
37880
+ deleteDialogDetails: `Are you sure you want to delete this generator? This action cannot be undone.`
37830
37881
  },
37831
37882
  outputs: {
37832
37883
  title: "OUTPUTS",
37833
37884
  noChildren: "No outputs yet. Please add one using the buttons below.",
37834
37885
  addButton: (protocol) => `Add ${protocol}`,
37835
37886
  addDialog: (protocol) => `Add ${protocol} Output`,
37836
- editDialog: (protocol, name) => `Edit ${protocol} Output ${name}`
37887
+ editDialog: (protocol, name) => `Edit ${protocol} Output ${name}`,
37888
+ deleteDialog: `Delete output?`,
37889
+ deleteDialogDetails: `Are you sure you want to delete this output? This action cannot be undone.`
37837
37890
  },
37838
37891
  settings: {
37839
- title: "Settings"
37892
+ title: "Settings",
37893
+ network: {
37894
+ appPortLabel: "Application Port",
37895
+ appInterfaceLabel: "Application Interface",
37896
+ anyInterface: "Any Interface",
37897
+ internalInterfaceUsed: (iface) => `Note: The interface ${iface} is only accessible from this device, which means that other devices will not be able to connect to Timecode Toolbox.`,
37898
+ appPortEnvOverride: (envPort) => `Note: The application port is currently set to ${envPort} via the PORT environment variable, and cannot be configured here.`,
37899
+ defaultPort: (port) => `Default: (${port})`,
37900
+ saveChanges: "Save Changes",
37901
+ saveWarning: {
37902
+ external: "When you hit Save, the UI will reload",
37903
+ internal: "When you hit Save, the app will attempt to reconnect using the new network settings, but may require you to adjust the URL manually."
37904
+ },
37905
+ invalidPortSingle: "Port numbers must be an integer between 1 and 65535",
37906
+ invalidPort: 'Please enter a valid port number or range (e.g. "1234" or "8000-8100")',
37907
+ invalidPortRange: 'The first port in a range must be less than or equal to the second port (e.g. "8000-8100")'
37908
+ }
37840
37909
  },
37841
37910
  controls: {
37842
37911
  play: "Play",
@@ -39411,7 +39480,7 @@ Data Directory: ${system.dataDirectory}`
39411
39480
  var OutputSettingsDialog = ({
39412
39481
  target,
39413
39482
  output,
39414
- close
39483
+ setDialogMode
39415
39484
  }) => {
39416
39485
  const {
39417
39486
  config,
@@ -39430,6 +39499,7 @@ Data Directory: ${system.dataDirectory}`
39430
39499
  },
39431
39500
  link: null
39432
39501
  });
39502
+ const close = (0, import_react33.useCallback)(() => setDialogMode(null), [setDialogMode]);
39433
39503
  const updateSettings = (0, import_react33.useCallback)((change) => {
39434
39504
  if (target.type === "add") {
39435
39505
  setNewData(change);
@@ -39537,7 +39607,7 @@ Data Directory: ${system.dataDirectory}`
39537
39607
  commitChanges();
39538
39608
  }
39539
39609
  }
39540
- }), resolvedTarget === "add" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(ControlDialogButtons, {
39610
+ }), target.type === "add" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(ControlDialogButtons, {
39541
39611
  children: [/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(ControlButton, {
39542
39612
  onClick: close,
39543
39613
  variant: "large",
@@ -39547,13 +39617,28 @@ Data Directory: ${system.dataDirectory}`
39547
39617
  variant: "large",
39548
39618
  children: "Add Output"
39549
39619
  })]
39550
- }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(ControlDialogButtons, {
39551
- children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(ControlButton, {
39620
+ }) : target.type === "edit" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(ControlDialogButtons, {
39621
+ children: [/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(ControlButton, {
39622
+ onClick: () => setDialogMode({
39623
+ section: {
39624
+ type: "outputs",
39625
+ output
39626
+ },
39627
+ target: {
39628
+ type: "delete",
39629
+ uuid: target.uuid
39630
+ }
39631
+ }),
39632
+ variant: "large",
39633
+ destructive: true,
39634
+ icon: "delete",
39635
+ children: "Delete"
39636
+ }), /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(ControlButton, {
39552
39637
  onClick: close,
39553
39638
  variant: "large",
39554
39639
  children: "Close"
39555
- })
39556
- })]
39640
+ })]
39641
+ }) : null]
39557
39642
  })
39558
39643
  });
39559
39644
  };
@@ -40002,7 +40087,7 @@ Data Directory: ${system.dataDirectory}`
40002
40087
  var GeneratorSettingsDialog = ({
40003
40088
  target,
40004
40089
  generator,
40005
- close
40090
+ setDialogMode
40006
40091
  }) => {
40007
40092
  const {
40008
40093
  config,
@@ -40015,6 +40100,7 @@ Data Directory: ${system.dataDirectory}`
40015
40100
  speed: 1
40016
40101
  }
40017
40102
  });
40103
+ const close = (0, import_react34.useCallback)(() => setDialogMode(null), [setDialogMode]);
40018
40104
  const updateSettings = (0, import_react34.useCallback)((change) => {
40019
40105
  if (target.type === "add") {
40020
40106
  setNewData(change);
@@ -40102,7 +40188,7 @@ Data Directory: ${system.dataDirectory}`
40102
40188
  }), data.definition.type === "clock" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ClockSpecificSettings, {
40103
40189
  data: data.definition,
40104
40190
  updateSettings: updateDefinition
40105
- }) : null, resolvedTarget === "add" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(ControlDialogButtons, {
40191
+ }) : null, target.type === "add" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(ControlDialogButtons, {
40106
40192
  children: [/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ControlButton, {
40107
40193
  onClick: close,
40108
40194
  variant: "large",
@@ -40112,13 +40198,28 @@ Data Directory: ${system.dataDirectory}`
40112
40198
  variant: "large",
40113
40199
  children: "Add Generator"
40114
40200
  })]
40115
- }) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ControlDialogButtons, {
40116
- children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ControlButton, {
40201
+ }) : target.type === "edit" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(ControlDialogButtons, {
40202
+ children: [/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ControlButton, {
40203
+ onClick: () => setDialogMode({
40204
+ section: {
40205
+ type: "generators",
40206
+ generator
40207
+ },
40208
+ target: {
40209
+ type: "delete",
40210
+ uuid: target.uuid
40211
+ }
40212
+ }),
40213
+ variant: "large",
40214
+ destructive: true,
40215
+ icon: "delete",
40216
+ children: "Delete"
40217
+ }), /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ControlButton, {
40117
40218
  onClick: close,
40118
40219
  variant: "large",
40119
40220
  children: "Close"
40120
- })
40121
- })]
40221
+ })]
40222
+ }) : null]
40122
40223
  })
40123
40224
  });
40124
40225
  };
@@ -40624,7 +40725,7 @@ Data Directory: ${system.dataDirectory}`
40624
40725
  var InputSettingsDialog = ({
40625
40726
  target,
40626
40727
  input,
40627
- close
40728
+ setDialogMode
40628
40729
  }) => {
40629
40730
  const {
40630
40731
  config,
@@ -40642,6 +40743,7 @@ Data Directory: ${system.dataDirectory}`
40642
40743
  iface: ""
40643
40744
  }
40644
40745
  });
40746
+ const close = (0, import_react35.useCallback)(() => setDialogMode(null), [setDialogMode]);
40645
40747
  const updateSettings = (0, import_react35.useCallback)((change) => {
40646
40748
  if (target.type === "add") {
40647
40749
  setNewData(change);
@@ -40752,7 +40854,7 @@ Data Directory: ${system.dataDirectory}`
40752
40854
  commitChanges();
40753
40855
  }
40754
40856
  }
40755
- }), resolvedTarget === "add" ? /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(ControlDialogButtons, {
40857
+ }), target.type === "add" ? /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(ControlDialogButtons, {
40756
40858
  children: [/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ControlButton, {
40757
40859
  onClick: close,
40758
40860
  variant: "large",
@@ -40760,15 +40862,31 @@ Data Directory: ${system.dataDirectory}`
40760
40862
  }), /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ControlButton, {
40761
40863
  onClick: addInput,
40762
40864
  variant: "large",
40865
+ primary: true,
40763
40866
  children: "Add Input"
40764
40867
  })]
40765
- }) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ControlDialogButtons, {
40766
- children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ControlButton, {
40868
+ }) : target?.type === "edit" ? /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(ControlDialogButtons, {
40869
+ children: [/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ControlButton, {
40870
+ onClick: () => setDialogMode({
40871
+ section: {
40872
+ type: "inputs",
40873
+ input
40874
+ },
40875
+ target: {
40876
+ type: "delete",
40877
+ uuid: target.uuid
40878
+ }
40879
+ }),
40880
+ variant: "large",
40881
+ destructive: true,
40882
+ icon: "delete",
40883
+ children: "Delete"
40884
+ }), /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ControlButton, {
40767
40885
  onClick: close,
40768
40886
  variant: "large",
40769
40887
  children: "Close"
40770
- })
40771
- })]
40888
+ })]
40889
+ }) : null]
40772
40890
  })
40773
40891
  });
40774
40892
  };
@@ -41012,6 +41130,11 @@ Data Directory: ${system.dataDirectory}`
41012
41130
  };
41013
41131
  }
41014
41132
 
41133
+ // src/components/frontend/toolbox/types.ts
41134
+ var isDeleteDialogMode = (mode) => {
41135
+ return mode?.target.type === "delete";
41136
+ };
41137
+
41015
41138
  // src/components/frontend/toolbox/settings.tsx
41016
41139
  var import_compiler_runtime13 = __toESM(require_compiler_runtime());
41017
41140
  var import_react38 = __toESM(require_react());
@@ -41207,8 +41330,179 @@ Data Directory: ${system.dataDirectory}`
41207
41330
  var DATE_FORMATTER = new Intl.DateTimeFormat(void 0, {
41208
41331
  timeStyle: "medium"
41209
41332
  });
41333
+ var AppPortConfig = () => {
41334
+ const {
41335
+ getNetworkInterfaces
41336
+ } = (0, import_react38.useContext)(NetworkContext);
41337
+ const [interfaces, setInterfaces] = (0, import_react38.useState)(null);
41338
+ const refreshInterfaces = (0, import_react38.useCallback)(() => {
41339
+ setInterfaces(null);
41340
+ getNetworkInterfaces().then((ifs) => setInterfaces(ifs));
41341
+ }, [getNetworkInterfaces]);
41342
+ (0, import_react38.useEffect)(() => {
41343
+ refreshInterfaces();
41344
+ }, [refreshInterfaces]);
41345
+ const {
41346
+ appListenerChangesHandledExternally
41347
+ } = useBrowserContext();
41348
+ const {
41349
+ network,
41350
+ config,
41351
+ updateConfig
41352
+ } = (0, import_react38.useContext)(ConfigContext);
41353
+ const [nextPort, setNextPort] = (0, import_react38.useState)(null);
41354
+ const [nextInterface, setNextInterface] = (0, import_react38.useState)(null);
41355
+ const iface = nextInterface ?? (config.appListener?.interface ? `specific:${config.appListener?.interface}` : "any");
41356
+ const port = nextPort ?? config.appListener?.port;
41357
+ const currentPortString = !port ? "" : typeof port === "string" ? port : portString(port);
41358
+ const hasNetworkChanges = nextPort !== null || nextInterface !== null;
41359
+ const nextUrlRef = (0, import_react38.useRef)(null);
41360
+ const validatedPort = (0, import_react38.useMemo)(() => {
41361
+ if (nextPort === null) {
41362
+ return {
41363
+ type: "unchanged"
41364
+ };
41365
+ }
41366
+ if (nextPort.trim() === "") {
41367
+ return {
41368
+ type: "empty"
41369
+ };
41370
+ }
41371
+ const portParts = nextPort.split("-").map((part) => parseInt(part.trim(), 10));
41372
+ if (portParts.length === 1) {
41373
+ const [singlePort] = portParts;
41374
+ if (!singlePort || isNaN(singlePort) || singlePort < 1 || singlePort > 65535) {
41375
+ return {
41376
+ type: "invalid",
41377
+ error: STRINGS.settings.network.invalidPortSingle
41378
+ };
41379
+ }
41380
+ return {
41381
+ type: "valid",
41382
+ port: singlePort
41383
+ };
41384
+ }
41385
+ if (portParts.length === 2) {
41386
+ const [from, to] = portParts;
41387
+ if (!from || isNaN(from) || from < 1 || from > 65535 || !to || isNaN(to) || to < 1 || to > 65535) {
41388
+ return {
41389
+ type: "invalid",
41390
+ error: STRINGS.settings.network.invalidPortSingle
41391
+ };
41392
+ } else if (from > to) {
41393
+ return {
41394
+ type: "invalid",
41395
+ error: STRINGS.settings.network.invalidPortRange
41396
+ };
41397
+ }
41398
+ return {
41399
+ type: "valid",
41400
+ port: {
41401
+ from,
41402
+ to
41403
+ }
41404
+ };
41405
+ }
41406
+ return {
41407
+ type: "invalid",
41408
+ error: STRINGS.settings.network.invalidPort
41409
+ };
41410
+ }, [nextPort]);
41411
+ const canSave = hasNetworkChanges && validatedPort?.type !== "invalid";
41412
+ const saveNetworkConfig = (0, import_react38.useCallback)(() => {
41413
+ if (validatedPort?.type === "invalid") {
41414
+ return;
41415
+ }
41416
+ const newPort = validatedPort;
41417
+ updateConfig((current) => {
41418
+ const config_0 = {
41419
+ ...current,
41420
+ appListener: {
41421
+ port: newPort.type === "empty" ? void 0 : newPort.type === "valid" ? newPort.port : current.appListener?.port,
41422
+ interface: nextInterface === "any" ? void 0 : nextInterface ? nextInterface.replace("specific:", "") : current.appListener?.interface
41423
+ }
41424
+ };
41425
+ const nextUrl = new URL(window.location.href);
41426
+ if (config_0.appListener?.interface) {
41427
+ nextUrl.hostname = interfaces?.[config_0.appListener.interface]?.address ?? nextUrl.hostname;
41428
+ }
41429
+ const port_0 = config_0.appListener?.port ?? network.defaultPort;
41430
+ nextUrl.port = (typeof port_0 === "number" ? port_0 : port_0.from).toString();
41431
+ nextUrlRef.current = nextUrl;
41432
+ return config_0;
41433
+ });
41434
+ setNextPort(null);
41435
+ setNextInterface(null);
41436
+ }, [interfaces, nextInterface, validatedPort, updateConfig, network.defaultPort]);
41437
+ (0, import_react38.useEffect)(() => {
41438
+ return () => {
41439
+ if (!appListenerChangesHandledExternally && nextUrlRef.current) {
41440
+ window.location.href = nextUrlRef.current.href;
41441
+ }
41442
+ };
41443
+ }, [appListenerChangesHandledExternally]);
41444
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, {
41445
+ children: [/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ControlLabel, {
41446
+ children: STRINGS.settings.network.appInterfaceLabel
41447
+ }), /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ControlSelect, {
41448
+ value: iface,
41449
+ options: [{
41450
+ label: STRINGS.settings.network.anyInterface,
41451
+ value: "any"
41452
+ }, ...!interfaces ? [] : Object.values(interfaces).map((iface_0) => ({
41453
+ label: `${iface_0.name} (${iface_0.address})`,
41454
+ value: `specific:${iface_0.name}`
41455
+ }))],
41456
+ onChange: setNextInterface,
41457
+ position: "first",
41458
+ variant: "large",
41459
+ triggerClassName: cn("text-sigil-control")
41460
+ }), iface && interfaces?.[iface]?.internal && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ControlDetails, {
41461
+ position: "second",
41462
+ className: "text-sigil-warning-foreground",
41463
+ children: STRINGS.settings.network.internalInterfaceUsed(iface)
41464
+ }), /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ControlButton, {
41465
+ onClick: refreshInterfaces,
41466
+ title: "Refresh Interfaces",
41467
+ position: "extra",
41468
+ variant: "large",
41469
+ children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Icon2, {
41470
+ icon: "refresh",
41471
+ className: "text-arcane-normal"
41472
+ })
41473
+ }), /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ControlLabel, {
41474
+ children: STRINGS.settings.network.appPortLabel
41475
+ }), network.envPort ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ControlDetails, {
41476
+ position: "both",
41477
+ children: STRINGS.settings.network.appPortEnvOverride(network.envPort)
41478
+ }) : /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, {
41479
+ children: [/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ControlInput, {
41480
+ value: currentPortString,
41481
+ onChange: setNextPort,
41482
+ placeholder: STRINGS.settings.network.defaultPort(portString(network.defaultPort))
41483
+ }), validatedPort.type === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ControlDetails, {
41484
+ position: "second",
41485
+ className: "text-sigil-error-foreground",
41486
+ children: validatedPort.error
41487
+ })]
41488
+ }), /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ControlButton, {
41489
+ onClick: saveNetworkConfig,
41490
+ variant: "large",
41491
+ position: "first",
41492
+ disabled: !canSave,
41493
+ children: STRINGS.settings.network.saveChanges
41494
+ }), hasNetworkChanges && appListenerChangesHandledExternally && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ControlDetails, {
41495
+ position: "second",
41496
+ children: STRINGS.settings.network.saveWarning.external
41497
+ }), hasNetworkChanges && !appListenerChangesHandledExternally && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ControlDetails, {
41498
+ position: "second",
41499
+ className: "text-sigil-warning-foreground",
41500
+ children: STRINGS.settings.network.saveWarning.internal
41501
+ })]
41502
+ });
41503
+ };
41210
41504
  var Settings = (t0) => {
41211
- const $ = (0, import_compiler_runtime13.c)(29);
41505
+ const $ = (0, import_compiler_runtime13.c)(30);
41212
41506
  const {
41213
41507
  setWindowMode
41214
41508
  } = t0;
@@ -41356,34 +41650,41 @@ Data Directory: ${system.dataDirectory}`
41356
41650
  t14 = $[21];
41357
41651
  }
41358
41652
  let t15;
41359
- if ($[22] !== t12 || $[23] !== t14 || $[24] !== t8) {
41360
- t15 = /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", {
41653
+ if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
41654
+ t15 = /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(AppPortConfig, {});
41655
+ $[22] = t15;
41656
+ } else {
41657
+ t15 = $[22];
41658
+ }
41659
+ let t16;
41660
+ if ($[23] !== t12 || $[24] !== t14 || $[25] !== t8) {
41661
+ t16 = /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", {
41361
41662
  className: "\n grow basis-0 overflow-y-auto bg-sigil-bg-light scrollbar-sigil\n ",
41362
41663
  children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", {
41363
41664
  className: "control-grid-large",
41364
- children: [t6, t8, t9, t12, t13, t14]
41665
+ children: [t6, t8, t9, t12, t13, t14, t15]
41365
41666
  })
41366
41667
  });
41367
- $[22] = t12;
41368
- $[23] = t14;
41369
- $[24] = t8;
41370
- $[25] = t15;
41668
+ $[23] = t12;
41669
+ $[24] = t14;
41670
+ $[25] = t8;
41671
+ $[26] = t16;
41371
41672
  } else {
41372
- t15 = $[25];
41673
+ t16 = $[26];
41373
41674
  }
41374
- let t16;
41375
- if ($[26] !== t15 || $[27] !== t5) {
41376
- t16 = /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", {
41675
+ let t17;
41676
+ if ($[27] !== t16 || $[28] !== t5) {
41677
+ t17 = /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", {
41377
41678
  className: "flex grow flex-col",
41378
- children: [t5, t15]
41679
+ children: [t5, t16]
41379
41680
  });
41380
- $[26] = t15;
41381
- $[27] = t5;
41382
- $[28] = t16;
41681
+ $[27] = t16;
41682
+ $[28] = t5;
41683
+ $[29] = t17;
41383
41684
  } else {
41384
- t16 = $[28];
41685
+ t17 = $[29];
41385
41686
  }
41386
- return t16;
41687
+ return t17;
41387
41688
  };
41388
41689
 
41389
41690
  // src/components/frontend/toolbox/license.tsx
@@ -42019,7 +42320,7 @@ Data Directory: ${system.dataDirectory}`
42019
42320
  let t7;
42020
42321
  if ($[17] !== t3 || $[18] !== t5 || $[19] !== t6) {
42021
42322
  t7 = /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", {
42022
- className: "flex h-screen flex-col",
42323
+ className: "flex h-dvh flex-col",
42023
42324
  children: [t3, t5, t6]
42024
42325
  });
42025
42326
  $[17] = t3;
@@ -42369,94 +42670,1593 @@ Data Directory: ${system.dataDirectory}`
42369
42670
  return null;
42370
42671
  };
42371
42672
 
42372
- // src/components/frontend/toolbox/root.tsx
42373
- var import_jsx_runtime55 = __toESM(require_jsx_runtime());
42374
- var ToolboxRoot = (t0) => {
42375
- const $ = (0, import_compiler_runtime20.c)(43);
42376
- const {
42377
- info
42378
- } = t0;
42379
- const {
42380
- config
42381
- } = info;
42382
- const {
42383
- sendMessage,
42384
- call
42385
- } = (0, import_react43.useContext)(StageContext);
42386
- const [dialogMode, setDialogMode] = (0, import_react43.useState)(null);
42387
- const [assignToOutput, setAssignToOutput] = (0, import_react43.useState)(null);
42388
- let t1;
42389
- let t2;
42390
- if ($[0] !== assignToOutput) {
42391
- t1 = () => {
42392
- if (assignToOutput) {
42393
- const onEscape = (e) => {
42394
- if (e.key === "Escape") {
42395
- setAssignToOutput(null);
42396
- }
42397
- };
42398
- window.addEventListener("keydown", onEscape);
42399
- return () => {
42400
- window.removeEventListener("keydown", onEscape);
42401
- };
42402
- }
42403
- };
42404
- t2 = [assignToOutput];
42405
- $[0] = assignToOutput;
42406
- $[1] = t1;
42407
- $[2] = t2;
42673
+ // ../../packages/sigil/src/frontend/controls/dialogs.tsx
42674
+ var import_compiler_runtime27 = __toESM(require_compiler_runtime(), 1);
42675
+ var import_react50 = __toESM(require_react(), 1);
42676
+
42677
+ // ../../packages/sigil/src/frontend/dialogs.tsx
42678
+ var import_compiler_runtime26 = __toESM(require_compiler_runtime(), 1);
42679
+ var import_react49 = __toESM(require_react(), 1);
42680
+
42681
+ // ../../packages/sigil/src/frontend/controls/buttons.tsx
42682
+ var import_compiler_runtime22 = __toESM(require_compiler_runtime(), 1);
42683
+ var import_react45 = __toESM(require_react(), 1);
42684
+
42685
+ // ../../packages/sigil/src/frontend/styling.ts
42686
+ var SIGIL_COLOR2 = external_exports.enum(["purple", "blue", "teal", "red", "green", "yellow", "brown", "orange", "gray"]);
42687
+ function cnd2(condition, truthyClassName, falseyClassName) {
42688
+ return condition ? truthyClassName : falseyClassName;
42689
+ }
42690
+
42691
+ // ../../packages/sigil/src/frontend/tooltip.tsx
42692
+ var import_compiler_runtime20 = __toESM(require_compiler_runtime(), 1);
42693
+ var import_react43 = __toESM(require_react(), 1);
42694
+ var import_jsx_runtime55 = __toESM(require_jsx_runtime(), 1);
42695
+ var Content4 = /* @__PURE__ */ (0, import_react43.forwardRef)((t0, ref) => {
42696
+ const $ = (0, import_compiler_runtime20.c)(9);
42697
+ let className;
42698
+ let props;
42699
+ if ($[0] !== t0) {
42700
+ ({
42701
+ className,
42702
+ ...props
42703
+ } = t0);
42704
+ $[0] = t0;
42705
+ $[1] = className;
42706
+ $[2] = props;
42408
42707
  } else {
42409
- t1 = $[1];
42410
- t2 = $[2];
42708
+ className = $[1];
42709
+ props = $[2];
42411
42710
  }
42412
- (0, import_react43.useEffect)(t1, t2);
42413
- let t3;
42414
- if ($[3] !== config || $[4] !== info.key || $[5] !== sendMessage) {
42415
- t3 = (change) => {
42416
- const diff = diffJson(config, change(config));
42417
- sendMessage?.({
42418
- type: "component-message",
42419
- namespace: "timecode-toolbox",
42420
- component: "toolbox-root",
42421
- componentKey: info.key,
42422
- action: "update-config",
42423
- diff
42424
- });
42425
- };
42426
- $[3] = config;
42427
- $[4] = info.key;
42428
- $[5] = sendMessage;
42429
- $[6] = t3;
42711
+ let t1;
42712
+ if ($[3] !== className) {
42713
+ t1 = cn(`
42714
+ relative z-sigil-tooltip rounded-sigil-control
42715
+ bg-sigil-usage-hint-background px-1 py-0.5 leading-[1.5]
42716
+ text-sigil-usage-hint-text shadow-sigil-box
42717
+ `, className);
42718
+ $[3] = className;
42719
+ $[4] = t1;
42430
42720
  } else {
42431
- t3 = $[6];
42721
+ t1 = $[4];
42432
42722
  }
42433
- const updateConfig = t3;
42434
- let t4;
42435
- let t5;
42436
- if ($[7] !== config || $[8] !== updateConfig) {
42437
- t5 = {
42438
- config,
42439
- updateConfig
42723
+ let t2;
42724
+ if ($[5] !== props || $[6] !== ref || $[7] !== t1) {
42725
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(dist_exports4.Content, {
42726
+ ...props,
42727
+ ref,
42728
+ className: t1
42729
+ });
42730
+ $[5] = props;
42731
+ $[6] = ref;
42732
+ $[7] = t1;
42733
+ $[8] = t2;
42734
+ } else {
42735
+ t2 = $[8];
42736
+ }
42737
+ return t2;
42738
+ });
42739
+ Content4.displayName = "Content";
42740
+ var Arrow4 = /* @__PURE__ */ (0, import_react43.forwardRef)((t0, ref) => {
42741
+ const $ = (0, import_compiler_runtime20.c)(9);
42742
+ let className;
42743
+ let props;
42744
+ if ($[0] !== t0) {
42745
+ ({
42746
+ className,
42747
+ ...props
42748
+ } = t0);
42749
+ $[0] = t0;
42750
+ $[1] = className;
42751
+ $[2] = props;
42752
+ } else {
42753
+ className = $[1];
42754
+ props = $[2];
42755
+ }
42756
+ let t1;
42757
+ if ($[3] !== className) {
42758
+ t1 = cn("fill-sigil-usage-hint-background drop-shadow-sigil-tooltip-arrow", className);
42759
+ $[3] = className;
42760
+ $[4] = t1;
42761
+ } else {
42762
+ t1 = $[4];
42763
+ }
42764
+ let t2;
42765
+ if ($[5] !== props || $[6] !== ref || $[7] !== t1) {
42766
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(dist_exports4.Arrow, {
42767
+ ...props,
42768
+ ref,
42769
+ className: t1
42770
+ });
42771
+ $[5] = props;
42772
+ $[6] = ref;
42773
+ $[7] = t1;
42774
+ $[8] = t2;
42775
+ } else {
42776
+ t2 = $[8];
42777
+ }
42778
+ return t2;
42779
+ });
42780
+ Arrow4.displayName = "Arrow";
42781
+ var TooltipBoundaryContext2 = /* @__PURE__ */ (0, import_react43.createContext)(null);
42782
+ var TooltipWrapper2 = (t0) => {
42783
+ const $ = (0, import_compiler_runtime20.c)(12);
42784
+ const {
42785
+ tooltip,
42786
+ children,
42787
+ side: t1
42788
+ } = t0;
42789
+ const side = t1 === void 0 ? "top" : t1;
42790
+ const boundary = (0, import_react43.useContext)(TooltipBoundaryContext2);
42791
+ if (!tooltip) {
42792
+ return children;
42793
+ }
42794
+ let t2;
42795
+ if ($[0] !== children) {
42796
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(dist_exports4.Trigger, {
42797
+ asChild: true,
42798
+ children
42799
+ });
42800
+ $[0] = children;
42801
+ $[1] = t2;
42802
+ } else {
42803
+ t2 = $[1];
42804
+ }
42805
+ let t3;
42806
+ if ($[2] !== boundary) {
42807
+ t3 = boundary ? [boundary] : [];
42808
+ $[2] = boundary;
42809
+ $[3] = t3;
42810
+ } else {
42811
+ t3 = $[3];
42812
+ }
42813
+ let t4;
42814
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
42815
+ t4 = /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Arrow4, {});
42816
+ $[4] = t4;
42817
+ } else {
42818
+ t4 = $[4];
42819
+ }
42820
+ let t5;
42821
+ if ($[5] !== side || $[6] !== t3 || $[7] !== tooltip) {
42822
+ t5 = /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Content4, {
42823
+ side,
42824
+ align: "center",
42825
+ sideOffset: 5,
42826
+ alignOffset: 0,
42827
+ collisionBoundary: t3,
42828
+ collisionPadding: 10,
42829
+ children: [t4, tooltip]
42830
+ });
42831
+ $[5] = side;
42832
+ $[6] = t3;
42833
+ $[7] = tooltip;
42834
+ $[8] = t5;
42835
+ } else {
42836
+ t5 = $[8];
42837
+ }
42838
+ let t6;
42839
+ if ($[9] !== t2 || $[10] !== t5) {
42840
+ t6 = /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(dist_exports4.Root, {
42841
+ children: [t2, t5]
42842
+ });
42843
+ $[9] = t2;
42844
+ $[10] = t5;
42845
+ $[11] = t6;
42846
+ } else {
42847
+ t6 = $[11];
42848
+ }
42849
+ return t6;
42850
+ };
42851
+
42852
+ // ../../packages/sigil/src/frontend/input.ts
42853
+ var import_compiler_runtime21 = __toESM(require_compiler_runtime(), 1);
42854
+ var import_react44 = __toESM(require_react(), 1);
42855
+ var usePressable3 = (click) => {
42856
+ const $ = (0, import_compiler_runtime21.c)(11);
42857
+ const [touching, setTouching] = (0, import_react44.useState)(false);
42858
+ let t0;
42859
+ let t1;
42860
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
42861
+ t0 = () => {
42862
+ setTouching(true);
42863
+ };
42864
+ t1 = () => {
42865
+ setTouching(false);
42866
+ };
42867
+ $[0] = t0;
42868
+ $[1] = t1;
42869
+ } else {
42870
+ t0 = $[0];
42871
+ t1 = $[1];
42872
+ }
42873
+ let t2;
42874
+ if ($[2] !== click || $[3] !== touching) {
42875
+ t2 = (event) => {
42876
+ if (touching) {
42877
+ event.preventDefault();
42878
+ setTouching(false);
42879
+ click(event);
42880
+ }
42881
+ };
42882
+ $[2] = click;
42883
+ $[3] = touching;
42884
+ $[4] = t2;
42885
+ } else {
42886
+ t2 = $[4];
42887
+ }
42888
+ let t3;
42889
+ if ($[5] !== click || $[6] !== t2) {
42890
+ t3 = {
42891
+ onClick: click,
42892
+ onTouchStart: t0,
42893
+ onTouchMove: t1,
42894
+ onTouchEnd: t2
42895
+ };
42896
+ $[5] = click;
42897
+ $[6] = t2;
42898
+ $[7] = t3;
42899
+ } else {
42900
+ t3 = $[7];
42901
+ }
42902
+ let t4;
42903
+ if ($[8] !== t3 || $[9] !== touching) {
42904
+ t4 = {
42905
+ touching,
42906
+ handlers: t3
42907
+ };
42908
+ $[8] = t3;
42909
+ $[9] = touching;
42910
+ $[10] = t4;
42911
+ } else {
42912
+ t4 = $[10];
42913
+ }
42914
+ return t4;
42915
+ };
42916
+ var useLongPressable3 = (t0) => {
42917
+ const $ = (0, import_compiler_runtime21.c)(18);
42918
+ const {
42919
+ onPress,
42920
+ onRelease
42921
+ } = t0;
42922
+ const [touching, setTouching] = (0, import_react44.useState)(false);
42923
+ let t1;
42924
+ let t2;
42925
+ let t3;
42926
+ if ($[0] !== onPress) {
42927
+ t2 = () => {
42928
+ setTouching(true);
42929
+ onPress();
42930
+ };
42931
+ t3 = () => {
42932
+ setTouching(true);
42933
+ onPress();
42934
+ };
42935
+ $[0] = onPress;
42936
+ $[1] = t2;
42937
+ $[2] = t3;
42938
+ } else {
42939
+ t2 = $[1];
42940
+ t3 = $[2];
42941
+ }
42942
+ let t4;
42943
+ let t5;
42944
+ if ($[3] !== onRelease) {
42945
+ t4 = () => {
42946
+ setTouching(false);
42947
+ onRelease();
42948
+ };
42949
+ t5 = () => {
42950
+ setTouching(false);
42951
+ onRelease();
42952
+ };
42953
+ $[3] = onRelease;
42954
+ $[4] = t4;
42955
+ $[5] = t5;
42956
+ } else {
42957
+ t4 = $[4];
42958
+ t5 = $[5];
42959
+ }
42960
+ let t6;
42961
+ if ($[6] !== onRelease || $[7] !== touching) {
42962
+ t6 = (event) => {
42963
+ if (touching) {
42964
+ event.preventDefault();
42965
+ setTouching(false);
42966
+ onRelease();
42967
+ }
42968
+ };
42969
+ $[6] = onRelease;
42970
+ $[7] = touching;
42971
+ $[8] = t6;
42972
+ } else {
42973
+ t6 = $[8];
42974
+ }
42975
+ let t7;
42976
+ if ($[9] !== t2 || $[10] !== t3 || $[11] !== t4 || $[12] !== t5 || $[13] !== t6) {
42977
+ t7 = {
42978
+ onTouchStart: t2,
42979
+ onMouseDown: t3,
42980
+ onMouseUp: t4,
42981
+ onTouchMove: t5,
42982
+ onTouchEnd: t6
42983
+ };
42984
+ $[9] = t2;
42985
+ $[10] = t3;
42986
+ $[11] = t4;
42987
+ $[12] = t5;
42988
+ $[13] = t6;
42989
+ $[14] = t7;
42990
+ } else {
42991
+ t7 = $[14];
42992
+ }
42993
+ let t8;
42994
+ if ($[15] !== t7 || $[16] !== touching) {
42995
+ t8 = {
42996
+ touching,
42997
+ handlers: t7
42998
+ };
42999
+ $[15] = t7;
43000
+ $[16] = touching;
43001
+ $[17] = t8;
43002
+ } else {
43003
+ t8 = $[17];
43004
+ }
43005
+ t1 = t8;
43006
+ return t1;
43007
+ };
43008
+
43009
+ // ../../packages/sigil/src/frontend/controls/utils.ts
43010
+ var clsControlPosition2 = (position) => {
43011
+ if (!position) return void 0;
43012
+ switch (position) {
43013
+ case "row":
43014
+ return "control-grid-pos-row";
43015
+ case "label":
43016
+ return "control-grid-pos-label";
43017
+ case "first":
43018
+ return "control-grid-pos-first";
43019
+ case "second":
43020
+ return "control-grid-pos-second";
43021
+ case "both":
43022
+ return "control-grid-pos-both";
43023
+ case "all":
43024
+ return "control-grid-pos-all";
43025
+ case "extra":
43026
+ return "control-grid-pos-extra";
43027
+ }
43028
+ };
43029
+ var clsControlSubgridPosition2 = (position, subgrid) => {
43030
+ if (!subgrid) return void 0;
43031
+ switch (position) {
43032
+ case "label":
43033
+ return "col-[1/span_1]";
43034
+ case "first":
43035
+ return "col-[2/span_1]";
43036
+ case "second":
43037
+ return "col-[3/span_1]";
43038
+ }
43039
+ };
43040
+
43041
+ // ../../packages/sigil/src/frontend/controls/buttons.tsx
43042
+ var import_jsx_runtime56 = __toESM(require_jsx_runtime(), 1);
43043
+ var clsControlButton2 = ({
43044
+ variant,
43045
+ active,
43046
+ touching,
43047
+ position,
43048
+ className,
43049
+ primary,
43050
+ destructive
43051
+ }) => cn(`sigil-control-button`, cnd2(variant === "border", `sigil-control-button-variant-border`), cnd2(variant === "large", `sigil-control-button-variant-large`), cnd2(variant === "properties", `sigil-control-button-variant-properties`), cnd2(variant === "table-row", `sigil-control-button-variant-table-row`), cnd2(variant === "toolbar", `sigil-control-button-variant-toolbar`), cnd2(variant === "titlebar", `sigil-control-button-variant-titlebar`), cnd2(touching, `sigil-control-button-touching`), cnd2(active, `sigil-control-button-active`), cnd2(touching && active, `sigil-control-button-active-touching`), cnd2(primary, `sigil-control-button-primary`), cnd2(destructive, `sigil-control-button-destructive`), clsControlPosition2(position), className);
43052
+ var ControlButtonFrame2 = /* @__PURE__ */ (0, import_react45.forwardRef)((t0, ref) => {
43053
+ const $ = (0, import_compiler_runtime22.c)(40);
43054
+ let active;
43055
+ let children;
43056
+ let className;
43057
+ let destructive;
43058
+ let disabled;
43059
+ let icon;
43060
+ let position;
43061
+ let primary;
43062
+ let props;
43063
+ let t1;
43064
+ let title;
43065
+ let tooltipSide;
43066
+ let touching;
43067
+ let type;
43068
+ if ($[0] !== t0) {
43069
+ ({
43070
+ children,
43071
+ className,
43072
+ type,
43073
+ variant: t1,
43074
+ icon,
43075
+ active,
43076
+ touching,
43077
+ disabled,
43078
+ title,
43079
+ tooltipSide,
43080
+ position,
43081
+ primary,
43082
+ destructive,
43083
+ ...props
43084
+ } = t0);
43085
+ $[0] = t0;
43086
+ $[1] = active;
43087
+ $[2] = children;
43088
+ $[3] = className;
43089
+ $[4] = destructive;
43090
+ $[5] = disabled;
43091
+ $[6] = icon;
43092
+ $[7] = position;
43093
+ $[8] = primary;
43094
+ $[9] = props;
43095
+ $[10] = t1;
43096
+ $[11] = title;
43097
+ $[12] = tooltipSide;
43098
+ $[13] = touching;
43099
+ $[14] = type;
43100
+ } else {
43101
+ active = $[1];
43102
+ children = $[2];
43103
+ className = $[3];
43104
+ destructive = $[4];
43105
+ disabled = $[5];
43106
+ icon = $[6];
43107
+ position = $[7];
43108
+ primary = $[8];
43109
+ props = $[9];
43110
+ t1 = $[10];
43111
+ title = $[11];
43112
+ tooltipSide = $[12];
43113
+ touching = $[13];
43114
+ type = $[14];
43115
+ }
43116
+ const variant = t1 === void 0 ? "toolbar" : t1;
43117
+ const t2 = type ?? "button";
43118
+ let t3;
43119
+ if ($[15] !== active || $[16] !== className || $[17] !== destructive || $[18] !== position || $[19] !== primary || $[20] !== touching || $[21] !== variant) {
43120
+ t3 = clsControlButton2({
43121
+ variant,
43122
+ active,
43123
+ touching,
43124
+ position,
43125
+ primary,
43126
+ destructive,
43127
+ className
43128
+ });
43129
+ $[15] = active;
43130
+ $[16] = className;
43131
+ $[17] = destructive;
43132
+ $[18] = position;
43133
+ $[19] = primary;
43134
+ $[20] = touching;
43135
+ $[21] = variant;
43136
+ $[22] = t3;
43137
+ } else {
43138
+ t3 = $[22];
43139
+ }
43140
+ let t4;
43141
+ if ($[23] !== children || $[24] !== icon) {
43142
+ t4 = icon && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Icon2, {
43143
+ icon,
43144
+ className: cn(cnd2(children, "text-[120%]", "text-[150%]"))
43145
+ });
43146
+ $[23] = children;
43147
+ $[24] = icon;
43148
+ $[25] = t4;
43149
+ } else {
43150
+ t4 = $[25];
43151
+ }
43152
+ let t5;
43153
+ if ($[26] !== children || $[27] !== t4) {
43154
+ t5 = /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("span", {
43155
+ children: [t4, children]
43156
+ });
43157
+ $[26] = children;
43158
+ $[27] = t4;
43159
+ $[28] = t5;
43160
+ } else {
43161
+ t5 = $[28];
43162
+ }
43163
+ let t6;
43164
+ if ($[29] !== disabled || $[30] !== props || $[31] !== ref || $[32] !== t2 || $[33] !== t3 || $[34] !== t5) {
43165
+ t6 = /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("button", {
43166
+ ...props,
43167
+ ref,
43168
+ type: t2,
43169
+ disabled,
43170
+ className: t3,
43171
+ children: t5
43172
+ });
43173
+ $[29] = disabled;
43174
+ $[30] = props;
43175
+ $[31] = ref;
43176
+ $[32] = t2;
43177
+ $[33] = t3;
43178
+ $[34] = t5;
43179
+ $[35] = t6;
43180
+ } else {
43181
+ t6 = $[35];
43182
+ }
43183
+ const btn = t6;
43184
+ if (!title) {
43185
+ return btn;
43186
+ }
43187
+ let t7;
43188
+ if ($[36] !== btn || $[37] !== title || $[38] !== tooltipSide) {
43189
+ t7 = /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(TooltipWrapper2, {
43190
+ tooltip: title,
43191
+ side: tooltipSide,
43192
+ children: btn
43193
+ });
43194
+ $[36] = btn;
43195
+ $[37] = title;
43196
+ $[38] = tooltipSide;
43197
+ $[39] = t7;
43198
+ } else {
43199
+ t7 = $[39];
43200
+ }
43201
+ return t7;
43202
+ });
43203
+ ControlButtonFrame2.displayName = "ControlButtonFrame";
43204
+ var ControlButton2 = /* @__PURE__ */ (0, import_react45.forwardRef)((t0, ref) => {
43205
+ const $ = (0, import_compiler_runtime22.c)(13);
43206
+ let disabled;
43207
+ let onClick;
43208
+ let props;
43209
+ if ($[0] !== t0) {
43210
+ ({
43211
+ onClick,
43212
+ disabled,
43213
+ ...props
43214
+ } = t0);
43215
+ $[0] = t0;
43216
+ $[1] = disabled;
43217
+ $[2] = onClick;
43218
+ $[3] = props;
43219
+ } else {
43220
+ disabled = $[1];
43221
+ onClick = $[2];
43222
+ props = $[3];
43223
+ }
43224
+ const {
43225
+ handlers,
43226
+ touching
43227
+ } = usePressable3(onClick);
43228
+ let t1;
43229
+ if ($[4] !== disabled || $[5] !== handlers) {
43230
+ t1 = !disabled ? handlers : {};
43231
+ $[4] = disabled;
43232
+ $[5] = handlers;
43233
+ $[6] = t1;
43234
+ } else {
43235
+ t1 = $[6];
43236
+ }
43237
+ let t2;
43238
+ if ($[7] !== disabled || $[8] !== props || $[9] !== ref || $[10] !== t1 || $[11] !== touching) {
43239
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ControlButtonFrame2, {
43240
+ ...props,
43241
+ ref,
43242
+ disabled,
43243
+ touching,
43244
+ ...t1
43245
+ });
43246
+ $[7] = disabled;
43247
+ $[8] = props;
43248
+ $[9] = ref;
43249
+ $[10] = t1;
43250
+ $[11] = touching;
43251
+ $[12] = t2;
43252
+ } else {
43253
+ t2 = $[12];
43254
+ }
43255
+ return t2;
43256
+ });
43257
+ ControlButton2.displayName = "ControlButton";
43258
+ var CheckboxControlButton2 = /* @__PURE__ */ (0, import_react45.forwardRef)((t0, ref) => {
43259
+ const $ = (0, import_compiler_runtime22.c)(12);
43260
+ let active;
43261
+ let label;
43262
+ let props;
43263
+ if ($[0] !== t0) {
43264
+ ({
43265
+ active,
43266
+ label,
43267
+ ...props
43268
+ } = t0);
43269
+ $[0] = t0;
43270
+ $[1] = active;
43271
+ $[2] = label;
43272
+ $[3] = props;
43273
+ } else {
43274
+ active = $[1];
43275
+ label = $[2];
43276
+ props = $[3];
43277
+ }
43278
+ const t1 = active ? "check_box" : "check_box_outline_blank";
43279
+ let t2;
43280
+ if ($[4] !== t1) {
43281
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Icon2, {
43282
+ icon: t1
43283
+ });
43284
+ $[4] = t1;
43285
+ $[5] = t2;
43286
+ } else {
43287
+ t2 = $[5];
43288
+ }
43289
+ let t3;
43290
+ if ($[6] !== active || $[7] !== label || $[8] !== props || $[9] !== ref || $[10] !== t2) {
43291
+ t3 = /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(ControlButton2, {
43292
+ ...props,
43293
+ ref,
43294
+ active,
43295
+ children: [t2, label]
43296
+ });
43297
+ $[6] = active;
43298
+ $[7] = label;
43299
+ $[8] = props;
43300
+ $[9] = ref;
43301
+ $[10] = t2;
43302
+ $[11] = t3;
43303
+ } else {
43304
+ t3 = $[11];
43305
+ }
43306
+ return t3;
43307
+ });
43308
+ CheckboxControlButton2.displayName = "CheckboxControlButton";
43309
+ var LongPressableControlButton2 = /* @__PURE__ */ (0, import_react45.forwardRef)((t0, ref) => {
43310
+ const $ = (0, import_compiler_runtime22.c)(18);
43311
+ let active;
43312
+ let disabled;
43313
+ let onPress;
43314
+ let onRelease;
43315
+ let props;
43316
+ if ($[0] !== t0) {
43317
+ ({
43318
+ active,
43319
+ disabled,
43320
+ onPress,
43321
+ onRelease,
43322
+ ...props
43323
+ } = t0);
43324
+ $[0] = t0;
43325
+ $[1] = active;
43326
+ $[2] = disabled;
43327
+ $[3] = onPress;
43328
+ $[4] = onRelease;
43329
+ $[5] = props;
43330
+ } else {
43331
+ active = $[1];
43332
+ disabled = $[2];
43333
+ onPress = $[3];
43334
+ onRelease = $[4];
43335
+ props = $[5];
43336
+ }
43337
+ let t1;
43338
+ if ($[6] !== onPress || $[7] !== onRelease) {
43339
+ t1 = {
43340
+ onPress,
43341
+ onRelease
43342
+ };
43343
+ $[6] = onPress;
43344
+ $[7] = onRelease;
43345
+ $[8] = t1;
43346
+ } else {
43347
+ t1 = $[8];
43348
+ }
43349
+ const {
43350
+ handlers,
43351
+ touching
43352
+ } = useLongPressable3(t1);
43353
+ const t2 = active || touching;
43354
+ let t3;
43355
+ if ($[9] !== disabled || $[10] !== handlers) {
43356
+ t3 = !disabled ? handlers : {};
43357
+ $[9] = disabled;
43358
+ $[10] = handlers;
43359
+ $[11] = t3;
43360
+ } else {
43361
+ t3 = $[11];
43362
+ }
43363
+ let t4;
43364
+ if ($[12] !== disabled || $[13] !== props || $[14] !== ref || $[15] !== t2 || $[16] !== t3) {
43365
+ t4 = /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ControlButtonFrame2, {
43366
+ ...props,
43367
+ ref,
43368
+ active: t2,
43369
+ disabled,
43370
+ ...t3
43371
+ });
43372
+ $[12] = disabled;
43373
+ $[13] = props;
43374
+ $[14] = ref;
43375
+ $[15] = t2;
43376
+ $[16] = t3;
43377
+ $[17] = t4;
43378
+ } else {
43379
+ t4 = $[17];
43380
+ }
43381
+ return t4;
43382
+ });
43383
+ LongPressableControlButton2.displayName = "LongPressableControlButton";
43384
+ var ControlButtonGroup2 = /* @__PURE__ */ (0, import_react45.forwardRef)((t0, ref) => {
43385
+ const $ = (0, import_compiler_runtime22.c)(13);
43386
+ let children;
43387
+ let className;
43388
+ let position;
43389
+ let props;
43390
+ if ($[0] !== t0) {
43391
+ ({
43392
+ children,
43393
+ className,
43394
+ position,
43395
+ ...props
43396
+ } = t0);
43397
+ $[0] = t0;
43398
+ $[1] = children;
43399
+ $[2] = className;
43400
+ $[3] = position;
43401
+ $[4] = props;
43402
+ } else {
43403
+ children = $[1];
43404
+ className = $[2];
43405
+ position = $[3];
43406
+ props = $[4];
43407
+ }
43408
+ let t1;
43409
+ if ($[5] !== className || $[6] !== position) {
43410
+ t1 = cn(`
43411
+ flex items-stretch gap-sigil-control-gap
43412
+ [&>button]:grow
43413
+ `, clsControlPosition2(position), className);
43414
+ $[5] = className;
43415
+ $[6] = position;
43416
+ $[7] = t1;
43417
+ } else {
43418
+ t1 = $[7];
43419
+ }
43420
+ let t2;
43421
+ if ($[8] !== children || $[9] !== props || $[10] !== ref || $[11] !== t1) {
43422
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", {
43423
+ ...props,
43424
+ ref,
43425
+ className: t1,
43426
+ children
43427
+ });
43428
+ $[8] = children;
43429
+ $[9] = props;
43430
+ $[10] = ref;
43431
+ $[11] = t1;
43432
+ $[12] = t2;
43433
+ } else {
43434
+ t2 = $[12];
43435
+ }
43436
+ return t2;
43437
+ });
43438
+ ControlButtonGroup2.displayName = "ControlButtonGroup";
43439
+
43440
+ // ../../packages/sigil/src/frontend/controls/content.tsx
43441
+ var import_compiler_runtime23 = __toESM(require_compiler_runtime(), 1);
43442
+ var import_react46 = __toESM(require_react(), 1);
43443
+ var import_jsx_runtime57 = __toESM(require_jsx_runtime(), 1);
43444
+ var ControlParagraph2 = /* @__PURE__ */ (0, import_react46.forwardRef)((t0, ref) => {
43445
+ const $ = (0, import_compiler_runtime23.c)(13);
43446
+ let className;
43447
+ let mode;
43448
+ let props;
43449
+ let t1;
43450
+ if ($[0] !== t0) {
43451
+ ({
43452
+ className,
43453
+ mode,
43454
+ position: t1,
43455
+ ...props
43456
+ } = t0);
43457
+ $[0] = t0;
43458
+ $[1] = className;
43459
+ $[2] = mode;
43460
+ $[3] = props;
43461
+ $[4] = t1;
43462
+ } else {
43463
+ className = $[1];
43464
+ mode = $[2];
43465
+ props = $[3];
43466
+ t1 = $[4];
43467
+ }
43468
+ const position = t1 === void 0 ? "all" : t1;
43469
+ let t2;
43470
+ if ($[5] !== className || $[6] !== mode || $[7] !== position) {
43471
+ t2 = cn("border border-transparent", clsControlPosition2(position), cnd2(mode === "success", `
43472
+ border-sigil-usage-green-dimmed-border
43473
+ bg-sigil-usage-green-dimmed-background p-1 text-sigil-usage-green-text
43474
+ `), cnd2(mode === "warning", `
43475
+ border-sigil-usage-yellow-dimmed-border
43476
+ bg-sigil-usage-yellow-dimmed-background p-1
43477
+ text-sigil-usage-yellow-text
43478
+ `), cnd2(mode === "error", `
43479
+ border-sigil-usage-red-dimmed-border
43480
+ bg-sigil-usage-red-dimmed-background p-1 text-sigil-usage-red-text
43481
+ `), className);
43482
+ $[5] = className;
43483
+ $[6] = mode;
43484
+ $[7] = position;
43485
+ $[8] = t2;
43486
+ } else {
43487
+ t2 = $[8];
43488
+ }
43489
+ let t3;
43490
+ if ($[9] !== props || $[10] !== ref || $[11] !== t2) {
43491
+ t3 = /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", {
43492
+ ...props,
43493
+ ref,
43494
+ className: t2
43495
+ });
43496
+ $[9] = props;
43497
+ $[10] = ref;
43498
+ $[11] = t2;
43499
+ $[12] = t3;
43500
+ } else {
43501
+ t3 = $[12];
43502
+ }
43503
+ return t3;
43504
+ });
43505
+ ControlParagraph2.displayName = "ControlParagraph";
43506
+ var ControlLabel2 = /* @__PURE__ */ (0, import_react46.forwardRef)((t0, ref) => {
43507
+ const $ = (0, import_compiler_runtime23.c)(17);
43508
+ let className;
43509
+ let disabled;
43510
+ let nonMicro;
43511
+ let props;
43512
+ let subgrid;
43513
+ let t1;
43514
+ if ($[0] !== t0) {
43515
+ ({
43516
+ className,
43517
+ disabled,
43518
+ nonMicro,
43519
+ position: t1,
43520
+ subgrid,
43521
+ ...props
43522
+ } = t0);
43523
+ $[0] = t0;
43524
+ $[1] = className;
43525
+ $[2] = disabled;
43526
+ $[3] = nonMicro;
43527
+ $[4] = props;
43528
+ $[5] = subgrid;
43529
+ $[6] = t1;
43530
+ } else {
43531
+ className = $[1];
43532
+ disabled = $[2];
43533
+ nonMicro = $[3];
43534
+ props = $[4];
43535
+ subgrid = $[5];
43536
+ t1 = $[6];
43537
+ }
43538
+ const position = t1 === void 0 ? "label" : t1;
43539
+ let t2;
43540
+ if ($[7] !== className || $[8] !== disabled || $[9] !== nonMicro || $[10] !== position || $[11] !== subgrid) {
43541
+ t2 = cn("flex items-center justify-end gap-0.6 p-0.6", clsControlPosition2(position), cnd2(nonMicro, "max-[550px]:hidden"), cnd2(disabled, "opacity-50"), clsControlSubgridPosition2(position, subgrid), className);
43542
+ $[7] = className;
43543
+ $[8] = disabled;
43544
+ $[9] = nonMicro;
43545
+ $[10] = position;
43546
+ $[11] = subgrid;
43547
+ $[12] = t2;
43548
+ } else {
43549
+ t2 = $[12];
43550
+ }
43551
+ let t3;
43552
+ if ($[13] !== props || $[14] !== ref || $[15] !== t2) {
43553
+ t3 = /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("label", {
43554
+ ...props,
43555
+ ref,
43556
+ className: t2
43557
+ });
43558
+ $[13] = props;
43559
+ $[14] = ref;
43560
+ $[15] = t2;
43561
+ $[16] = t3;
43562
+ } else {
43563
+ t3 = $[16];
43564
+ }
43565
+ return t3;
43566
+ });
43567
+ ControlLabel2.displayName = "ControlLabel";
43568
+ var ControlDetails2 = /* @__PURE__ */ (0, import_react46.forwardRef)((t0, ref) => {
43569
+ const $ = (0, import_compiler_runtime23.c)(13);
43570
+ let align;
43571
+ let className;
43572
+ let props;
43573
+ let t1;
43574
+ if ($[0] !== t0) {
43575
+ ({
43576
+ align,
43577
+ className,
43578
+ position: t1,
43579
+ ...props
43580
+ } = t0);
43581
+ $[0] = t0;
43582
+ $[1] = align;
43583
+ $[2] = className;
43584
+ $[3] = props;
43585
+ $[4] = t1;
43586
+ } else {
43587
+ align = $[1];
43588
+ className = $[2];
43589
+ props = $[3];
43590
+ t1 = $[4];
43591
+ }
43592
+ const position = t1 === void 0 ? "all" : t1;
43593
+ let t2;
43594
+ if ($[5] !== align || $[6] !== className || $[7] !== position) {
43595
+ t2 = cn("flex items-center px-0.3 text-sigil-foreground-muted", clsControlPosition2(position), cnd2(align === "start", "justify-start"), cnd2(align === "center", "justify-center"), cnd2(align === "end", "justify-end"), className);
43596
+ $[5] = align;
43597
+ $[6] = className;
43598
+ $[7] = position;
43599
+ $[8] = t2;
43600
+ } else {
43601
+ t2 = $[8];
43602
+ }
43603
+ let t3;
43604
+ if ($[9] !== props || $[10] !== ref || $[11] !== t2) {
43605
+ t3 = /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", {
43606
+ ...props,
43607
+ ref,
43608
+ className: t2
43609
+ });
43610
+ $[9] = props;
43611
+ $[10] = ref;
43612
+ $[11] = t2;
43613
+ $[12] = t3;
43614
+ } else {
43615
+ t3 = $[12];
43616
+ }
43617
+ return t3;
43618
+ });
43619
+ ControlDetails2.displayName = "ControlDetails";
43620
+ var InputSpanningTitle2 = /* @__PURE__ */ (0, import_react46.forwardRef)((t0, ref) => {
43621
+ const $ = (0, import_compiler_runtime23.c)(11);
43622
+ let className;
43623
+ let props;
43624
+ let t1;
43625
+ if ($[0] !== t0) {
43626
+ ({
43627
+ className,
43628
+ position: t1,
43629
+ ...props
43630
+ } = t0);
43631
+ $[0] = t0;
43632
+ $[1] = className;
43633
+ $[2] = props;
43634
+ $[3] = t1;
43635
+ } else {
43636
+ className = $[1];
43637
+ props = $[2];
43638
+ t1 = $[3];
43639
+ }
43640
+ const position = t1 === void 0 ? "row" : t1;
43641
+ let t2;
43642
+ if ($[4] !== className || $[5] !== position) {
43643
+ t2 = cn("truncate p-0.6 text-center text-[0.8rem] font-bold", clsControlPosition2(position), className);
43644
+ $[4] = className;
43645
+ $[5] = position;
43646
+ $[6] = t2;
43647
+ } else {
43648
+ t2 = $[6];
43649
+ }
43650
+ let t3;
43651
+ if ($[7] !== props || $[8] !== ref || $[9] !== t2) {
43652
+ t3 = /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", {
43653
+ ...props,
43654
+ ref,
43655
+ className: t2
43656
+ });
43657
+ $[7] = props;
43658
+ $[8] = ref;
43659
+ $[9] = t2;
43660
+ $[10] = t3;
43661
+ } else {
43662
+ t3 = $[10];
43663
+ }
43664
+ return t3;
43665
+ });
43666
+ InputSpanningTitle2.displayName = "InputSpanningTitle";
43667
+
43668
+ // ../../packages/sigil/src/frontend/controls/input.tsx
43669
+ var import_compiler_runtime24 = __toESM(require_compiler_runtime(), 1);
43670
+ var import_react47 = __toESM(require_react(), 1);
43671
+ var import_jsx_runtime58 = __toESM(require_jsx_runtime(), 1);
43672
+
43673
+ // ../../packages/sigil/src/frontend/controls/select.tsx
43674
+ var import_compiler_runtime25 = __toESM(require_compiler_runtime(), 1);
43675
+ var import_react48 = __toESM(require_react(), 1);
43676
+ var import_jsx_runtime59 = __toESM(require_jsx_runtime(), 1);
43677
+ var COLOR_OPTIONS2 = {
43678
+ red: {
43679
+ label: "Red",
43680
+ value: "red",
43681
+ color: "red"
43682
+ },
43683
+ blue: {
43684
+ label: "Blue",
43685
+ value: "blue",
43686
+ color: "blue"
43687
+ },
43688
+ teal: {
43689
+ label: "Teal",
43690
+ value: "teal",
43691
+ color: "teal"
43692
+ },
43693
+ green: {
43694
+ label: "Green",
43695
+ value: "green",
43696
+ color: "green"
43697
+ },
43698
+ yellow: {
43699
+ label: "Yellow",
43700
+ value: "yellow",
43701
+ color: "yellow"
43702
+ },
43703
+ purple: {
43704
+ label: "Purple",
43705
+ value: "purple",
43706
+ color: "purple"
43707
+ },
43708
+ orange: {
43709
+ label: "Orange",
43710
+ value: "orange",
43711
+ color: "orange"
43712
+ },
43713
+ brown: {
43714
+ label: "Brown",
43715
+ value: "brown",
43716
+ color: "brown"
43717
+ },
43718
+ gray: {
43719
+ label: "Gray",
43720
+ value: "gray",
43721
+ color: "gray"
43722
+ }
43723
+ };
43724
+ var COLOR_OPTIONS_ARRAY2 = Object.values(COLOR_OPTIONS2);
43725
+
43726
+ // ../../packages/sigil/src/frontend/dialogs.tsx
43727
+ var import_jsx_runtime60 = __toESM(require_jsx_runtime(), 1);
43728
+ var isDarkDialog2 = (variant) => variant === "dark" || variant === "dark-compact";
43729
+ var DialogTitle2 = /* @__PURE__ */ (0, import_react49.forwardRef)((t0, ref) => {
43730
+ const $ = (0, import_compiler_runtime26.c)(11);
43731
+ let className;
43732
+ let props;
43733
+ let t1;
43734
+ if ($[0] !== t0) {
43735
+ ({
43736
+ className,
43737
+ variant: t1,
43738
+ ...props
43739
+ } = t0);
43740
+ $[0] = t0;
43741
+ $[1] = className;
43742
+ $[2] = props;
43743
+ $[3] = t1;
43744
+ } else {
43745
+ className = $[1];
43746
+ props = $[2];
43747
+ t1 = $[3];
43748
+ }
43749
+ const variant = t1 === void 0 ? "light" : t1;
43750
+ let t2;
43751
+ if ($[4] !== className || $[5] !== variant) {
43752
+ t2 = cn(`
43753
+ flex items-center justify-center gap-0.6 border-b border-sigil-border
43754
+ p-arcane font-bold
43755
+ `, cnd2(isDarkDialog2(variant), "bg-sigil-bg-light", "bg-sigil-bg-dark"), className);
43756
+ $[4] = className;
43757
+ $[5] = variant;
43758
+ $[6] = t2;
43759
+ } else {
43760
+ t2 = $[6];
43761
+ }
43762
+ let t3;
43763
+ if ($[7] !== props || $[8] !== ref || $[9] !== t2) {
43764
+ t3 = /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", {
43765
+ ...props,
43766
+ ref,
43767
+ className: t2
43768
+ });
43769
+ $[7] = props;
43770
+ $[8] = ref;
43771
+ $[9] = t2;
43772
+ $[10] = t3;
43773
+ } else {
43774
+ t3 = $[10];
43775
+ }
43776
+ return t3;
43777
+ });
43778
+ DialogTitle2.displayName = "DialogTitle";
43779
+ var DialogButtons2 = /* @__PURE__ */ (0, import_react49.forwardRef)((t0, ref) => {
43780
+ const $ = (0, import_compiler_runtime26.c)(9);
43781
+ let className;
43782
+ let props;
43783
+ if ($[0] !== t0) {
43784
+ ({
43785
+ className,
43786
+ ...props
43787
+ } = t0);
43788
+ $[0] = t0;
43789
+ $[1] = className;
43790
+ $[2] = props;
43791
+ } else {
43792
+ className = $[1];
43793
+ props = $[2];
43794
+ }
43795
+ let t1;
43796
+ if ($[3] !== className) {
43797
+ t1 = cn("mt-arcane flex justify-end gap-0.6", className);
43798
+ $[3] = className;
43799
+ $[4] = t1;
43800
+ } else {
43801
+ t1 = $[4];
43802
+ }
43803
+ let t2;
43804
+ if ($[5] !== props || $[6] !== ref || $[7] !== t1) {
43805
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", {
43806
+ ...props,
43807
+ ref,
43808
+ className: t1
43809
+ });
43810
+ $[5] = props;
43811
+ $[6] = ref;
43812
+ $[7] = t1;
43813
+ $[8] = t2;
43814
+ } else {
43815
+ t2 = $[8];
43816
+ }
43817
+ return t2;
43818
+ });
43819
+ DialogButtons2.displayName = "DialogButtons";
43820
+ var Dialog2 = (t0) => {
43821
+ const $ = (0, import_compiler_runtime26.c)(29);
43822
+ const {
43823
+ children,
43824
+ dialogClosed,
43825
+ closable: t1,
43826
+ title,
43827
+ variant: t2
43828
+ } = t0;
43829
+ const closable = t1 === void 0 ? true : t1;
43830
+ const variant = t2 === void 0 ? "light" : t2;
43831
+ const [dialogRef, setDialogRef] = (0, import_react49.useState)(null);
43832
+ let t3;
43833
+ let t4;
43834
+ if ($[0] !== dialogRef) {
43835
+ t3 = () => {
43836
+ if (!dialogRef) {
43837
+ return;
43838
+ }
43839
+ dialogRef.showModal();
43840
+ };
43841
+ t4 = [dialogRef];
43842
+ $[0] = dialogRef;
43843
+ $[1] = t3;
43844
+ $[2] = t4;
43845
+ } else {
43846
+ t3 = $[1];
43847
+ t4 = $[2];
43848
+ }
43849
+ (0, import_react49.useEffect)(t3, t4);
43850
+ let t5;
43851
+ if ($[3] !== dialogRef) {
43852
+ t5 = () => dialogRef?.close();
43853
+ $[3] = dialogRef;
43854
+ $[4] = t5;
43855
+ } else {
43856
+ t5 = $[4];
43857
+ }
43858
+ const close = t5;
43859
+ let t6;
43860
+ if ($[5] !== closable || $[6] !== dialogClosed) {
43861
+ t6 = (event) => {
43862
+ if (closable) {
43863
+ dialogClosed();
43864
+ return;
43865
+ }
43866
+ event.preventDefault();
43867
+ event.currentTarget.showModal();
43868
+ };
43869
+ $[5] = closable;
43870
+ $[6] = dialogClosed;
43871
+ $[7] = t6;
43872
+ } else {
43873
+ t6 = $[7];
43874
+ }
43875
+ const onClose = t6;
43876
+ let t7;
43877
+ if ($[8] !== close) {
43878
+ t7 = (event_0) => {
43879
+ if (event_0.target === event_0.currentTarget) {
43880
+ close();
43881
+ }
43882
+ };
43883
+ $[8] = close;
43884
+ $[9] = t7;
43885
+ } else {
43886
+ t7 = $[9];
43887
+ }
43888
+ const onMouseDown = t7;
43889
+ let t8;
43890
+ if ($[10] !== variant) {
43891
+ t8 = cn(`
43892
+ max-w-[80vw] min-w-[10vw] border-none p-0 text-sigil-dialog-foreground
43893
+ outline-none backdrop-sigil-dialog
43894
+ `, cnd2(isDarkDialog2(variant), "bg-sigil-bg-dark", "bg-sigil-bg-light"));
43895
+ $[10] = variant;
43896
+ $[11] = t8;
43897
+ } else {
43898
+ t8 = $[11];
43899
+ }
43900
+ let t9;
43901
+ if ($[12] !== title || $[13] !== variant) {
43902
+ t9 = title && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(DialogTitle2, {
43903
+ variant,
43904
+ children: title
43905
+ });
43906
+ $[12] = title;
43907
+ $[13] = variant;
43908
+ $[14] = t9;
43909
+ } else {
43910
+ t9 = $[14];
43911
+ }
43912
+ const t10 = variant === "light-compact" || variant === "dark-compact";
43913
+ let t11;
43914
+ if ($[15] !== t10 || $[16] !== variant) {
43915
+ t11 = cn("text-sigil-foreground", cnd2(t10, "p-0"), cnd2(variant !== "light-compact" && variant !== "dark-compact", "p-arcane"));
43916
+ $[15] = t10;
43917
+ $[16] = variant;
43918
+ $[17] = t11;
43919
+ } else {
43920
+ t11 = $[17];
43921
+ }
43922
+ let t12;
43923
+ if ($[18] !== children || $[19] !== t11) {
43924
+ t12 = /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", {
43925
+ className: t11,
43926
+ children
43927
+ });
43928
+ $[18] = children;
43929
+ $[19] = t11;
43930
+ $[20] = t12;
43931
+ } else {
43932
+ t12 = $[20];
43933
+ }
43934
+ let t13;
43935
+ if ($[21] !== t12 || $[22] !== t9) {
43936
+ t13 = /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", {
43937
+ className: "border border-sigil-border",
43938
+ children: [t9, t12]
43939
+ });
43940
+ $[21] = t12;
43941
+ $[22] = t9;
43942
+ $[23] = t13;
43943
+ } else {
43944
+ t13 = $[23];
43945
+ }
43946
+ let t14;
43947
+ if ($[24] !== onClose || $[25] !== onMouseDown || $[26] !== t13 || $[27] !== t8) {
43948
+ t14 = /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("dialog", {
43949
+ ref: setDialogRef,
43950
+ onMouseDown,
43951
+ onClose,
43952
+ className: t8,
43953
+ children: t13
43954
+ });
43955
+ $[24] = onClose;
43956
+ $[25] = onMouseDown;
43957
+ $[26] = t13;
43958
+ $[27] = t8;
43959
+ $[28] = t14;
43960
+ } else {
43961
+ t14 = $[28];
43962
+ }
43963
+ return t14;
43964
+ };
43965
+
43966
+ // ../../packages/sigil/src/frontend/controls/dialogs.tsx
43967
+ var import_jsx_runtime61 = __toESM(require_jsx_runtime(), 1);
43968
+ var ControlDialogButtons2 = /* @__PURE__ */ (0, import_react50.forwardRef)((t0, ref) => {
43969
+ const $ = (0, import_compiler_runtime27.c)(11);
43970
+ let children;
43971
+ let className;
43972
+ let props;
43973
+ if ($[0] !== t0) {
43974
+ ({
43975
+ children,
43976
+ className,
43977
+ ...props
43978
+ } = t0);
43979
+ $[0] = t0;
43980
+ $[1] = children;
43981
+ $[2] = className;
43982
+ $[3] = props;
43983
+ } else {
43984
+ children = $[1];
43985
+ className = $[2];
43986
+ props = $[3];
43987
+ }
43988
+ let t1;
43989
+ if ($[4] !== className) {
43990
+ t1 = cn(`
43991
+ flex items-stretch gap-1
43992
+ [&>button]:grow
43993
+ `, clsControlPosition2("row"), className);
43994
+ $[4] = className;
43995
+ $[5] = t1;
43996
+ } else {
43997
+ t1 = $[5];
43998
+ }
43999
+ let t2;
44000
+ if ($[6] !== children || $[7] !== props || $[8] !== ref || $[9] !== t1) {
44001
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", {
44002
+ ref,
44003
+ className: t1,
44004
+ ...props,
44005
+ children
44006
+ });
44007
+ $[6] = children;
44008
+ $[7] = props;
44009
+ $[8] = ref;
44010
+ $[9] = t1;
44011
+ $[10] = t2;
44012
+ } else {
44013
+ t2 = $[10];
44014
+ }
44015
+ return t2;
44016
+ });
44017
+ var ControlDialog2 = (t0) => {
44018
+ const $ = (0, import_compiler_runtime27.c)(12);
44019
+ let children;
44020
+ let large;
44021
+ let props;
44022
+ if ($[0] !== t0) {
44023
+ ({
44024
+ children,
44025
+ large,
44026
+ ...props
44027
+ } = t0);
44028
+ $[0] = t0;
44029
+ $[1] = children;
44030
+ $[2] = large;
44031
+ $[3] = props;
44032
+ } else {
44033
+ children = $[1];
44034
+ large = $[2];
44035
+ props = $[3];
44036
+ }
44037
+ let t1;
44038
+ if ($[4] !== large) {
44039
+ t1 = cn("gap-1 bg-sigil-bg-dark select-none", cnd2(large, "control-grid-large", "control-grid"));
44040
+ $[4] = large;
44041
+ $[5] = t1;
44042
+ } else {
44043
+ t1 = $[5];
44044
+ }
44045
+ let t2;
44046
+ if ($[6] !== children || $[7] !== t1) {
44047
+ t2 = /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", {
44048
+ className: t1,
44049
+ children
44050
+ });
44051
+ $[6] = children;
44052
+ $[7] = t1;
44053
+ $[8] = t2;
44054
+ } else {
44055
+ t2 = $[8];
44056
+ }
44057
+ let t3;
44058
+ if ($[9] !== props || $[10] !== t2) {
44059
+ t3 = /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Dialog2, {
44060
+ ...props,
44061
+ variant: "dark",
44062
+ children: t2
44063
+ });
44064
+ $[9] = props;
44065
+ $[10] = t2;
44066
+ $[11] = t3;
44067
+ } else {
44068
+ t3 = $[11];
44069
+ }
44070
+ return t3;
44071
+ };
44072
+
44073
+ // src/components/frontend/toolbox/root.tsx
44074
+ var import_jsx_runtime62 = __toESM(require_jsx_runtime());
44075
+ var DeleteConfirmationDialog = (t0) => {
44076
+ const $ = (0, import_compiler_runtime28.c)(21);
44077
+ const {
44078
+ dialogMode,
44079
+ setDialogMode
44080
+ } = t0;
44081
+ const {
44082
+ updateConfig
44083
+ } = (0, import_react51.useContext)(ConfigContext);
44084
+ let t1;
44085
+ if ($[0] !== dialogMode.section.type || $[1] !== dialogMode.target || $[2] !== setDialogMode || $[3] !== updateConfig) {
44086
+ t1 = () => {
44087
+ updateConfig((current) => ({
44088
+ ...current,
44089
+ [dialogMode.section.type]: Object.fromEntries(Object.entries(current[dialogMode.section.type]).filter((t22) => {
44090
+ const [uuid] = t22;
44091
+ return uuid !== dialogMode.target.uuid;
44092
+ }))
44093
+ }));
44094
+ setDialogMode(null);
42440
44095
  };
42441
- $[7] = config;
42442
- $[8] = updateConfig;
42443
- $[9] = t5;
44096
+ $[0] = dialogMode.section.type;
44097
+ $[1] = dialogMode.target;
44098
+ $[2] = setDialogMode;
44099
+ $[3] = updateConfig;
44100
+ $[4] = t1;
42444
44101
  } else {
42445
- t5 = $[9];
44102
+ t1 = $[4];
44103
+ }
44104
+ const deleteTarget = t1;
44105
+ let t2;
44106
+ if ($[5] !== setDialogMode) {
44107
+ t2 = () => setDialogMode(null);
44108
+ $[5] = setDialogMode;
44109
+ $[6] = t2;
44110
+ } else {
44111
+ t2 = $[6];
44112
+ }
44113
+ const t3 = STRINGS[dialogMode.section.type];
44114
+ const t4 = STRINGS[dialogMode.section.type];
44115
+ let t5;
44116
+ if ($[7] !== t4.deleteDialogDetails) {
44117
+ t5 = /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ControlDetails, {
44118
+ position: "row",
44119
+ children: t4.deleteDialogDetails
44120
+ });
44121
+ $[7] = t4.deleteDialogDetails;
44122
+ $[8] = t5;
44123
+ } else {
44124
+ t5 = $[8];
42446
44125
  }
42447
- t4 = t5;
42448
- const configContext = t4;
42449
44126
  let t6;
42450
- if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
42451
- t6 = () => setDialogMode(null);
44127
+ if ($[9] !== setDialogMode) {
44128
+ t6 = /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ControlButton, {
44129
+ onClick: () => setDialogMode(null),
44130
+ variant: "large",
44131
+ children: "Cancel"
44132
+ });
44133
+ $[9] = setDialogMode;
42452
44134
  $[10] = t6;
42453
44135
  } else {
42454
44136
  t6 = $[10];
42455
44137
  }
42456
- const closeDialog = t6;
42457
44138
  let t7;
44139
+ if ($[11] !== deleteTarget) {
44140
+ t7 = /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ControlButton, {
44141
+ onClick: deleteTarget,
44142
+ variant: "large",
44143
+ destructive: true,
44144
+ icon: "delete",
44145
+ children: "Delete"
44146
+ });
44147
+ $[11] = deleteTarget;
44148
+ $[12] = t7;
44149
+ } else {
44150
+ t7 = $[12];
44151
+ }
44152
+ let t8;
44153
+ if ($[13] !== t6 || $[14] !== t7) {
44154
+ t8 = /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(ControlDialogButtons2, {
44155
+ children: [t6, t7]
44156
+ });
44157
+ $[13] = t6;
44158
+ $[14] = t7;
44159
+ $[15] = t8;
44160
+ } else {
44161
+ t8 = $[15];
44162
+ }
44163
+ let t9;
44164
+ if ($[16] !== t2 || $[17] !== t3.deleteDialog || $[18] !== t5 || $[19] !== t8) {
44165
+ t9 = /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(ControlDialog2, {
44166
+ dialogClosed: t2,
44167
+ title: t3.deleteDialog,
44168
+ children: [t5, t8]
44169
+ });
44170
+ $[16] = t2;
44171
+ $[17] = t3.deleteDialog;
44172
+ $[18] = t5;
44173
+ $[19] = t8;
44174
+ $[20] = t9;
44175
+ } else {
44176
+ t9 = $[20];
44177
+ }
44178
+ return t9;
44179
+ };
44180
+ var ToolboxRoot = (t0) => {
44181
+ const $ = (0, import_compiler_runtime28.c)(43);
44182
+ const {
44183
+ info
44184
+ } = t0;
44185
+ const {
44186
+ config
44187
+ } = info;
44188
+ const {
44189
+ sendMessage,
44190
+ call
44191
+ } = (0, import_react51.useContext)(StageContext);
44192
+ const [dialogMode, setDialogMode] = (0, import_react51.useState)(null);
44193
+ const [assignToOutput, setAssignToOutput] = (0, import_react51.useState)(null);
44194
+ let t1;
44195
+ let t2;
44196
+ if ($[0] !== assignToOutput) {
44197
+ t1 = () => {
44198
+ if (assignToOutput) {
44199
+ const onEscape = (e) => {
44200
+ if (e.key === "Escape") {
44201
+ setAssignToOutput(null);
44202
+ }
44203
+ };
44204
+ window.addEventListener("keydown", onEscape);
44205
+ return () => {
44206
+ window.removeEventListener("keydown", onEscape);
44207
+ };
44208
+ }
44209
+ };
44210
+ t2 = [assignToOutput];
44211
+ $[0] = assignToOutput;
44212
+ $[1] = t1;
44213
+ $[2] = t2;
44214
+ } else {
44215
+ t1 = $[1];
44216
+ t2 = $[2];
44217
+ }
44218
+ (0, import_react51.useEffect)(t1, t2);
44219
+ let t3;
44220
+ if ($[3] !== config || $[4] !== info.key || $[5] !== sendMessage) {
44221
+ t3 = (change) => {
44222
+ const diff = diffJson(config, change(config));
44223
+ sendMessage?.({
44224
+ type: "component-message",
44225
+ namespace: "timecode-toolbox",
44226
+ component: "toolbox-root",
44227
+ componentKey: info.key,
44228
+ action: "update-config",
44229
+ diff
44230
+ });
44231
+ };
44232
+ $[3] = config;
44233
+ $[4] = info.key;
44234
+ $[5] = sendMessage;
44235
+ $[6] = t3;
44236
+ } else {
44237
+ t3 = $[6];
44238
+ }
44239
+ const updateConfig = t3;
44240
+ let t4;
44241
+ let t5;
44242
+ if ($[7] !== config || $[8] !== info.network || $[9] !== updateConfig) {
44243
+ t5 = {
44244
+ config,
44245
+ network: info.network,
44246
+ updateConfig
44247
+ };
44248
+ $[7] = config;
44249
+ $[8] = info.network;
44250
+ $[9] = updateConfig;
44251
+ $[10] = t5;
44252
+ } else {
44253
+ t5 = $[10];
44254
+ }
44255
+ t4 = t5;
44256
+ const configContext = t4;
44257
+ let t6;
42458
44258
  if ($[11] !== call || $[12] !== info.key) {
42459
- t7 = async () => {
44259
+ t6 = async () => {
42460
44260
  if (!call) {
42461
44261
  throw new Error("No call function available");
42462
44262
  }
@@ -42469,34 +44269,34 @@ Data Directory: ${system.dataDirectory}`
42469
44269
  };
42470
44270
  $[11] = call;
42471
44271
  $[12] = info.key;
42472
- $[13] = t7;
44272
+ $[13] = t6;
42473
44273
  } else {
42474
- t7 = $[13];
44274
+ t6 = $[13];
42475
44275
  }
42476
- const getNetworkInterfaces = t7;
44276
+ const getNetworkInterfaces = t6;
44277
+ let t7;
42477
44278
  let t8;
42478
- let t9;
42479
44279
  if ($[14] !== getNetworkInterfaces) {
42480
- t9 = {
44280
+ t8 = {
42481
44281
  getNetworkInterfaces
42482
44282
  };
42483
44283
  $[14] = getNetworkInterfaces;
42484
- $[15] = t9;
44284
+ $[15] = t8;
42485
44285
  } else {
42486
- t9 = $[15];
44286
+ t8 = $[15];
42487
44287
  }
42488
- t8 = t9;
42489
- const networkContextValue = t8;
42490
- let t10;
44288
+ t7 = t8;
44289
+ const networkContextValue = t7;
44290
+ let t9;
42491
44291
  bb0: {
42492
44292
  if (!assignToOutput) {
42493
- t10 = null;
44293
+ t9 = null;
42494
44294
  break bb0;
42495
44295
  }
42496
44296
  const outputUuid = assignToOutput;
42497
- let t112;
44297
+ let t102;
42498
44298
  if ($[16] !== outputUuid || $[17] !== updateConfig) {
42499
- t112 = (id) => {
44299
+ t102 = (id) => {
42500
44300
  updateConfig((current) => {
42501
44301
  const output = current.outputs[outputUuid];
42502
44302
  if (!output) {
@@ -42517,21 +44317,21 @@ Data Directory: ${system.dataDirectory}`
42517
44317
  };
42518
44318
  $[16] = outputUuid;
42519
44319
  $[17] = updateConfig;
42520
- $[18] = t112;
44320
+ $[18] = t102;
42521
44321
  } else {
42522
- t112 = $[18];
44322
+ t102 = $[18];
42523
44323
  }
42524
- t10 = t112;
44324
+ t9 = t102;
42525
44325
  }
42526
- const assignToOutputCallback = t10;
42527
- let t11;
44326
+ const assignToOutputCallback = t9;
44327
+ let t10;
42528
44328
  if ($[19] !== call || $[20] !== info.key) {
42529
- t11 = async (t122) => {
44329
+ t10 = async (t112) => {
42530
44330
  const {
42531
44331
  path,
42532
44332
  handler,
42533
44333
  args
42534
- } = t122;
44334
+ } = t112;
42535
44335
  if (!call) {
42536
44336
  throw new Error("No call function available");
42537
44337
  }
@@ -42547,50 +44347,50 @@ Data Directory: ${system.dataDirectory}`
42547
44347
  };
42548
44348
  $[19] = call;
42549
44349
  $[20] = info.key;
42550
- $[21] = t11;
44350
+ $[21] = t10;
42551
44351
  } else {
42552
- t11 = $[21];
44352
+ t10 = $[21];
42553
44353
  }
42554
- const callHandler = t11;
44354
+ const callHandler = t10;
44355
+ let t11;
42555
44356
  let t12;
42556
- let t13;
42557
44357
  if ($[22] !== callHandler || $[23] !== info.handlers) {
42558
- t13 = {
44358
+ t12 = {
42559
44359
  handlers: info.handlers,
42560
44360
  callHandler
42561
44361
  };
42562
44362
  $[22] = callHandler;
42563
44363
  $[23] = info.handlers;
42564
- $[24] = t13;
44364
+ $[24] = t12;
42565
44365
  } else {
42566
- t13 = $[24];
44366
+ t12 = $[24];
42567
44367
  }
42568
- t12 = t13;
42569
- const handlers = t12;
44368
+ t11 = t12;
44369
+ const handlers = t11;
44370
+ let t13;
42570
44371
  let t14;
42571
- let t15;
42572
44372
  if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
42573
- t15 = getFragmentValue("tc", TIMECODE_INSTANCE_ID);
42574
- $[25] = t15;
44373
+ t14 = getFragmentValue("tc", TIMECODE_INSTANCE_ID);
44374
+ $[25] = t14;
42575
44375
  } else {
42576
- t15 = $[25];
44376
+ t14 = $[25];
42577
44377
  }
42578
- t14 = t15;
42579
- const windowedTimecodeId = t14;
44378
+ t13 = t14;
44379
+ const windowedTimecodeId = t13;
44380
+ let t15;
42580
44381
  let t16;
42581
- let t17;
42582
44382
  if ($[26] !== assignToOutput || $[27] !== assignToOutputCallback || $[28] !== dialogMode || $[29] !== info.license) {
42583
- t17 = windowedTimecodeId ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Layout, {
44383
+ t16 = windowedTimecodeId ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Layout, {
42584
44384
  modes: null,
42585
- children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(FullscreenTimecodeDisplay, {
44385
+ children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(FullscreenTimecodeDisplay, {
42586
44386
  id: windowedTimecodeId
42587
44387
  })
42588
- }) : /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, {
42589
- children: [/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Layout, {
44388
+ }) : /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_jsx_runtime62.Fragment, {
44389
+ children: [/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Layout, {
42590
44390
  footer: true,
42591
44391
  modes: {
42592
44392
  license: {
42593
- child: (setWindowMode) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(License, {
44393
+ child: (setWindowMode) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(License, {
42594
44394
  license: info.license,
42595
44395
  setWindowMode
42596
44396
  }),
@@ -42609,110 +44409,115 @@ Data Directory: ${system.dataDirectory}`
42609
44409
  }
42610
44410
  },
42611
44411
  licenseMode: "license",
42612
- children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, {
42613
- children: [/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(UpdateBanner, {}), /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", {
44412
+ children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_jsx_runtime62.Fragment, {
44413
+ children: [/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(UpdateBanner, {}), /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", {
42614
44414
  className: "\n flex h-0 grow flex-col gap-px overflow-y-auto bg-sigil-border\n scrollbar-sigil\n ",
42615
- children: [/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(InputsSection, {
44415
+ children: [/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(InputsSection, {
42616
44416
  setDialogMode,
42617
44417
  assignToOutput: assignToOutputCallback
42618
- }), /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GeneratorsSection, {
44418
+ }), /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(GeneratorsSection, {
42619
44419
  setDialogMode,
42620
44420
  assignToOutput: assignToOutputCallback
42621
- }), /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(OutputsSection, {
44421
+ }), /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(OutputsSection, {
42622
44422
  setDialogMode,
42623
44423
  assignToOutput,
42624
44424
  setAssignToOutput
42625
44425
  })]
42626
44426
  })]
42627
44427
  })
42628
- }), dialogMode?.section.type === "inputs" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(InputSettingsDialog, {
42629
- close: closeDialog,
42630
- input: dialogMode.section.input,
42631
- target: dialogMode.target
42632
- }), dialogMode?.section.type === "generators" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GeneratorSettingsDialog, {
42633
- close: closeDialog,
42634
- generator: dialogMode.section.generator,
42635
- target: dialogMode.target
42636
- }), dialogMode?.section.type === "outputs" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(OutputSettingsDialog, {
42637
- close: closeDialog,
42638
- output: dialogMode.section.output,
42639
- target: dialogMode.target
44428
+ }), isDeleteDialogMode(dialogMode) ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(DeleteConfirmationDialog, {
44429
+ dialogMode,
44430
+ setDialogMode
44431
+ }) : /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_jsx_runtime62.Fragment, {
44432
+ children: [dialogMode?.section.type === "inputs" && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(InputSettingsDialog, {
44433
+ setDialogMode,
44434
+ input: dialogMode.section.input,
44435
+ target: dialogMode.target
44436
+ }), dialogMode?.section.type === "generators" && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(GeneratorSettingsDialog, {
44437
+ setDialogMode,
44438
+ generator: dialogMode.section.generator,
44439
+ target: dialogMode.target
44440
+ }), dialogMode?.section.type === "outputs" && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(OutputSettingsDialog, {
44441
+ setDialogMode,
44442
+ output: dialogMode.section.output,
44443
+ target: dialogMode.target
44444
+ })]
42640
44445
  })]
42641
44446
  });
42642
44447
  $[26] = assignToOutput;
42643
44448
  $[27] = assignToOutputCallback;
42644
44449
  $[28] = dialogMode;
42645
44450
  $[29] = info.license;
42646
- $[30] = t17;
44451
+ $[30] = t16;
42647
44452
  } else {
42648
- t17 = $[30];
44453
+ t16 = $[30];
42649
44454
  }
42650
- t16 = t17;
42651
- const root = t16;
42652
- let t18;
44455
+ t15 = t16;
44456
+ const root = t15;
44457
+ let t17;
42653
44458
  if ($[31] !== handlers || $[32] !== root) {
42654
- t18 = /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ApplicationHandlersContext.Provider, {
44459
+ t17 = /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ApplicationHandlersContext.Provider, {
42655
44460
  value: handlers,
42656
44461
  children: root
42657
44462
  });
42658
44463
  $[31] = handlers;
42659
44464
  $[32] = root;
42660
- $[33] = t18;
44465
+ $[33] = t17;
42661
44466
  } else {
42662
- t18 = $[33];
44467
+ t17 = $[33];
42663
44468
  }
42664
- let t19;
42665
- if ($[34] !== info.state || $[35] !== t18) {
42666
- t19 = /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ApplicationStateContext.Provider, {
44469
+ let t18;
44470
+ if ($[34] !== info.state || $[35] !== t17) {
44471
+ t18 = /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ApplicationStateContext.Provider, {
42667
44472
  value: info.state,
42668
- children: t18
44473
+ children: t17
42669
44474
  });
42670
44475
  $[34] = info.state;
42671
- $[35] = t18;
42672
- $[36] = t19;
44476
+ $[35] = t17;
44477
+ $[36] = t18;
42673
44478
  } else {
42674
- t19 = $[36];
44479
+ t18 = $[36];
42675
44480
  }
42676
- let t20;
42677
- if ($[37] !== networkContextValue || $[38] !== t19) {
42678
- t20 = /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(NetworkContext.Provider, {
44481
+ let t19;
44482
+ if ($[37] !== networkContextValue || $[38] !== t18) {
44483
+ t19 = /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(NetworkContext.Provider, {
42679
44484
  value: networkContextValue,
42680
- children: t19
44485
+ children: t18
42681
44486
  });
42682
44487
  $[37] = networkContextValue;
42683
- $[38] = t19;
42684
- $[39] = t20;
44488
+ $[38] = t18;
44489
+ $[39] = t19;
42685
44490
  } else {
42686
- t20 = $[39];
44491
+ t19 = $[39];
42687
44492
  }
42688
- let t21;
42689
- if ($[40] !== configContext || $[41] !== t20) {
42690
- t21 = /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ConfigContext.Provider, {
44493
+ let t20;
44494
+ if ($[40] !== configContext || $[41] !== t19) {
44495
+ t20 = /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ConfigContext.Provider, {
42691
44496
  value: configContext,
42692
- children: t20
44497
+ children: t19
42693
44498
  });
42694
44499
  $[40] = configContext;
42695
- $[41] = t20;
42696
- $[42] = t21;
44500
+ $[41] = t19;
44501
+ $[42] = t20;
42697
44502
  } else {
42698
- t21 = $[42];
44503
+ t20 = $[42];
42699
44504
  }
42700
- return t21;
44505
+ return t20;
42701
44506
  };
42702
44507
  function _temp5(setWindowMode_0) {
42703
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Settings, {
44508
+ return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Settings, {
42704
44509
  setWindowMode: setWindowMode_0
42705
44510
  });
42706
44511
  }
42707
44512
  function _temp24() {
42708
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Debugger, {
44513
+ return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Debugger, {
42709
44514
  title: STRINGS.debugger,
42710
44515
  className: "size-full"
42711
44516
  });
42712
44517
  }
42713
44518
 
42714
44519
  // src/components/frontend/index.tsx
42715
- var import_jsx_runtime56 = __toESM(require_jsx_runtime());
44520
+ var import_jsx_runtime63 = __toESM(require_jsx_runtime());
42716
44521
  var timecodeToolboxFrontendComponents = () => ({
42717
44522
  namespace: NAMESPACE,
42718
44523
  render: (info) => {
@@ -42721,11 +44526,11 @@ Data Directory: ${system.dataDirectory}`
42721
44526
  }
42722
44527
  switch (info.component) {
42723
44528
  case "toolbox-root":
42724
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ToolboxRoot, {
44529
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(ToolboxRoot, {
42725
44530
  info
42726
44531
  });
42727
44532
  case "license-gate":
42728
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(LicenseGate, {
44533
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(LicenseGate, {
42729
44534
  info
42730
44535
  });
42731
44536
  }
@@ -42735,7 +44540,7 @@ Data Directory: ${system.dataDirectory}`
42735
44540
  startSigilFrontend({
42736
44541
  browser,
42737
44542
  appRenderers: [timecodeToolboxFrontendComponents()],
42738
- loadingState: () => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", {
44543
+ loadingState: () => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", {
42739
44544
  style: {
42740
44545
  width: "100%",
42741
44546
  textAlign: "center",
@@ -42746,6 +44551,7 @@ Data Directory: ${system.dataDirectory}`
42746
44551
  });
42747
44552
  };
42748
44553
  window.startTimecodeToolboxServerFrontend = startTimecodeToolboxServerFrontend;
44554
+ window.createBrowserMediaSession = createBrowserMediaSession;
42749
44555
  })();
42750
44556
  /*! Bundled license information:
42751
44557