@viasoftbr/shared-ui 0.0.4 → 0.0.6

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.
@@ -152,7 +152,6 @@ __export(components_exports, {
152
152
  Protocol: () => Protocol_default,
153
153
  ProtocolGroup: () => ProtocolGroup_default,
154
154
  RangeField: () => RangeField_default,
155
- RemoteModule: () => RemoteModule,
156
155
  RequireAuth: () => RequireAuth_default,
157
156
  SaveDiscard: () => SaveDiscard_default,
158
157
  Section: () => Section_default,
@@ -166,7 +165,9 @@ __export(components_exports, {
166
165
  VideoGroup: () => VideoGroup_default,
167
166
  VideoPlayer: () => VideoPlayer_default,
168
167
  ViewLog: () => ViewLog_default,
169
- getGridLabel: () => getGridLabel
168
+ getGridLabel: () => getGridLabel,
169
+ isValidIPv4: () => isValidIPv4,
170
+ isValidIPv6: () => isValidIPv6
170
171
  });
171
172
  module.exports = __toCommonJS(components_exports);
172
173
 
@@ -25627,12 +25628,61 @@ function buildWsUrl(path = "/") {
25627
25628
  return `${proto}://${host}${path.startsWith("/") ? path : "/" + path}`;
25628
25629
  }
25629
25630
  }
25631
+ function extractBearerToken(headers, explicitToken) {
25632
+ if (explicitToken)
25633
+ return explicitToken;
25634
+ if (!headers)
25635
+ return null;
25636
+ const authHeader = headers.Authorization || headers.authorization;
25637
+ if (!authHeader)
25638
+ return null;
25639
+ const match = authHeader.match(/^Bearer\s+(.+)$/i);
25640
+ return match ? match[1] : null;
25641
+ }
25642
+ function appendWsQueryParam(url, key, value) {
25643
+ try {
25644
+ const parsed = new URL(
25645
+ url,
25646
+ typeof window !== "undefined" ? window.location.href : void 0
25647
+ );
25648
+ parsed.searchParams.set(key, value);
25649
+ return parsed.toString();
25650
+ } catch {
25651
+ const separator = url.includes("?") ? "&" : "?";
25652
+ return `${url}${separator}${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
25653
+ }
25654
+ }
25655
+ function normalizeProtocols(protocols) {
25656
+ if (!protocols)
25657
+ return void 0;
25658
+ return Array.isArray(protocols) ? protocols.filter(Boolean) : [protocols];
25659
+ }
25630
25660
  async function decodeFfurl(ffurl) {
25631
25661
  const { settings } = await fetchApi.postJson("/auth/protocols/ffurl/decode", { ffurl });
25632
25662
  return settings;
25633
25663
  }
25634
- function subscribeToWebsocket(url, onMessage) {
25635
- const socket = new WebSocket(url);
25664
+ function subscribeToWebsocket(url, onMessage, options = {}) {
25665
+ const bearerToken = extractBearerToken(options.headers, options.bearerToken);
25666
+ const bearerStrategy = options.bearerStrategy ?? "query";
25667
+ let resolvedUrl = url;
25668
+ const protocols = normalizeProtocols(options.protocols) ?? [];
25669
+ if (options.headers && Object.keys(options.headers).length > 0) {
25670
+ console.warn(
25671
+ "WebSocket connections in browsers do not support custom HTTP headers. shared-ui will derive bearer auth from Authorization and forward it using query string or subprotocol."
25672
+ );
25673
+ }
25674
+ if (bearerToken) {
25675
+ if (bearerStrategy === "protocol") {
25676
+ protocols.push("bearer", bearerToken);
25677
+ } else {
25678
+ resolvedUrl = appendWsQueryParam(
25679
+ url,
25680
+ options.bearerQueryParam ?? "access_token",
25681
+ bearerToken
25682
+ );
25683
+ }
25684
+ }
25685
+ const socket = protocols.length > 0 ? new WebSocket(resolvedUrl, protocols) : new WebSocket(resolvedUrl);
25636
25686
  socket.onmessage = (event) => {
25637
25687
  try {
25638
25688
  const data = JSON.parse(event.data);
@@ -25647,140 +25697,6 @@ function subscribeToWebsocket(url, onMessage) {
25647
25697
  };
25648
25698
  }
25649
25699
 
25650
- // src/services/loadRemoteModule.ts
25651
- var React2 = __toESM(require("react"), 1);
25652
- var ReactDOM = __toESM(require("react-dom"), 1);
25653
- var sharedScopeInitialized = false;
25654
- function getSharedScope() {
25655
- if (!globalThis.__federation_shared__) {
25656
- globalThis.__federation_shared__ = {};
25657
- }
25658
- if (!sharedScopeInitialized) {
25659
- globalThis.__federation_shared__["react"] = {
25660
- "18.3.1": {
25661
- get: () => Promise.resolve(() => React2),
25662
- loaded: true,
25663
- from: "core",
25664
- scope: "default"
25665
- }
25666
- };
25667
- globalThis.__federation_shared__["react-dom"] = {
25668
- "18.3.1": {
25669
- get: () => Promise.resolve(() => ReactDOM),
25670
- loaded: true,
25671
- from: "core",
25672
- scope: "default"
25673
- }
25674
- };
25675
- sharedScopeInitialized = true;
25676
- }
25677
- return globalThis.__federation_shared__;
25678
- }
25679
- var loadedContainers = /* @__PURE__ */ new Map();
25680
- var initializedContainers = /* @__PURE__ */ new Set();
25681
- async function loadContainer(url) {
25682
- if (loadedContainers.has(url)) {
25683
- return loadedContainers.get(url);
25684
- }
25685
- const loadPromise = (async () => {
25686
- try {
25687
- const container = await import(
25688
- /* @vite-ignore */
25689
- url
25690
- );
25691
- if (container.init && !initializedContainers.has(url)) {
25692
- await container.init(getSharedScope());
25693
- initializedContainers.add(url);
25694
- }
25695
- return container;
25696
- } catch (error2) {
25697
- loadedContainers.delete(url);
25698
- initializedContainers.delete(url);
25699
- throw error2;
25700
- }
25701
- })();
25702
- loadedContainers.set(url, loadPromise);
25703
- return loadPromise;
25704
- }
25705
- async function loadRemoteModule(config) {
25706
- const container = await loadContainer(config.url);
25707
- if (!container || typeof container.get !== "function") {
25708
- throw new Error(`Container inv\xE1lido ou sem m\xE9todo get: ${config.scope}`);
25709
- }
25710
- if (typeof container.dynamicLoadingCss === "function") {
25711
- try {
25712
- await container.dynamicLoadingCss([]);
25713
- } catch (err) {
25714
- console.warn(`Aviso: Falha ao carregar CSS global do remote ${config.scope}`, err);
25715
- }
25716
- }
25717
- const factory2 = await container.get(config.module);
25718
- const moduleExports = await factory2();
25719
- if (moduleExports && typeof moduleExports === "object" && "default" in moduleExports) {
25720
- return moduleExports.default;
25721
- }
25722
- return moduleExports;
25723
- }
25724
-
25725
- // src/services/metadataLoader.ts
25726
- var MetadataLoader = class {
25727
- constructor() {
25728
- __publicField(this, "metadataCache", /* @__PURE__ */ new Map());
25729
- }
25730
- async loadMetadata(metadataUrl) {
25731
- if (this.metadataCache.has(metadataUrl)) {
25732
- return this.metadataCache.get(metadataUrl) || [];
25733
- }
25734
- try {
25735
- const response = await fetch(metadataUrl);
25736
- console.log(response);
25737
- if (!response.ok) {
25738
- throw new Error(`Failed to fetch metadata: ${response.statusText}`);
25739
- }
25740
- const data = await response.json();
25741
- let metadata;
25742
- if (Array.isArray(data)) {
25743
- metadata = data;
25744
- } else if (data.pages && Array.isArray(data.pages)) {
25745
- metadata = data.pages;
25746
- } else {
25747
- throw new Error(
25748
- "Invalid metadata format: expected array or object with pages property"
25749
- );
25750
- }
25751
- metadata.forEach((page, index3) => {
25752
- if (!page.id || !page.name || !page.path || !page.url) {
25753
- throw new Error(
25754
- `Invalid page metadata at index ${index3}: missing required fields`
25755
- );
25756
- }
25757
- });
25758
- this.metadataCache.set(metadataUrl, metadata);
25759
- return metadata;
25760
- } catch (error2) {
25761
- console.warn(`Failed to load metadata from ${metadataUrl}:`, error2);
25762
- return [];
25763
- }
25764
- }
25765
- async loadFromDirectory(directoryUrl) {
25766
- try {
25767
- const manifestUrl = `${directoryUrl}/manifest.json`;
25768
- return await this.loadMetadata(manifestUrl);
25769
- } catch (error2) {
25770
- throw new Error(
25771
- `Directory manifest not found at ${directoryUrl}/manifest.json: ${error2}`
25772
- );
25773
- }
25774
- }
25775
- clearCache() {
25776
- this.metadataCache.clear();
25777
- }
25778
- getCachedMetadata(metadataUrl) {
25779
- return this.metadataCache.get(metadataUrl);
25780
- }
25781
- };
25782
- var metadataLoader = new MetadataLoader();
25783
-
25784
25700
  // src/services/registry.ts
25785
25701
  var PluginRegistryImpl = class {
25786
25702
  constructor() {
@@ -25878,7 +25794,7 @@ var saveConfig = async (payload, basePath = "./php") => {
25878
25794
  var import_jsx_runtime2 = require("react/jsx-runtime");
25879
25795
  var AuthContext = (0, import_react4.createContext)(void 0);
25880
25796
  function useAuth() {
25881
- const ctx = (0, import_react4.useContext)(AuthContext);
25797
+ const ctx = (0, import_react4.use)(AuthContext);
25882
25798
  if (!ctx)
25883
25799
  throw new Error("useAuth must be used within AuthProvider");
25884
25800
  return ctx;
@@ -25918,7 +25834,7 @@ var SkeletonBlock = ({ lines = 3, className = "" }) => {
25918
25834
  var import_jsx_runtime4 = require("react/jsx-runtime");
25919
25835
  var SectionContext = (0, import_react5.createContext)(void 0);
25920
25836
  function useSection() {
25921
- const ctx = (0, import_react5.useContext)(SectionContext);
25837
+ const ctx = (0, import_react5.use)(SectionContext);
25922
25838
  return ctx ?? { readonly: false };
25923
25839
  }
25924
25840
  var Section2 = ({ id, title, icon, expanded, onToggle, children, readonly, loading = false }) => {
@@ -25963,7 +25879,7 @@ var Section2 = ({ id, title, icon, expanded, onToggle, children, readonly, loadi
25963
25879
  overflow-hidden
25964
25880
  ${expanded ? "max-h-fit opacity-100" : "max-h-0 opacity-0"}
25965
25881
  `,
25966
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "px-6 py-4 border-t transition-all transition-discrete border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/50", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SectionContext.Provider, { value: { readonly: !!effectiveReadonly }, children: loading ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SkeletonBlock, { lines: 5 }) : children }) })
25882
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "px-6 py-4 border-t transition-all transition-discrete border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/50", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SectionContext, { value: { readonly: !!effectiveReadonly }, children: loading ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SkeletonBlock, { lines: 5 }) : children }) })
25967
25883
  }
25968
25884
  )
25969
25885
  ] });
@@ -28122,7 +28038,7 @@ function m6(u16, t15) {
28122
28038
  }
28123
28039
 
28124
28040
  // node_modules/.pnpm/@floating-ui+react@0.26.28_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@floating-ui/react/dist/floating-ui.react.mjs
28125
- var React6 = __toESM(require("react"), 1);
28041
+ var React5 = __toESM(require("react"), 1);
28126
28042
  var import_react48 = require("react");
28127
28043
 
28128
28044
  // node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
@@ -28427,7 +28343,7 @@ function rectToClientRect(rect) {
28427
28343
  }
28428
28344
 
28429
28345
  // node_modules/.pnpm/@floating-ui+react@0.26.28_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@floating-ui/react/dist/floating-ui.react.mjs
28430
- var ReactDOM3 = __toESM(require("react-dom"), 1);
28346
+ var ReactDOM2 = __toESM(require("react-dom"), 1);
28431
28347
 
28432
28348
  // node_modules/.pnpm/@floating-ui+core@1.7.4/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
28433
28349
  function computeCoordsFromPlacement(_ref, placement, rtl) {
@@ -29630,9 +29546,9 @@ var computePosition2 = (reference, floating, options) => {
29630
29546
  };
29631
29547
 
29632
29548
  // node_modules/.pnpm/@floating-ui+react-dom@2.1.7_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs
29633
- var React5 = __toESM(require("react"), 1);
29549
+ var React4 = __toESM(require("react"), 1);
29634
29550
  var import_react47 = require("react");
29635
- var ReactDOM2 = __toESM(require("react-dom"), 1);
29551
+ var ReactDOM = __toESM(require("react-dom"), 1);
29636
29552
  var isClient = typeof document !== "undefined";
29637
29553
  var noop2 = function noop3() {
29638
29554
  };
@@ -29697,7 +29613,7 @@ function roundByDPR(element, value) {
29697
29613
  return Math.round(value * dpr) / dpr;
29698
29614
  }
29699
29615
  function useLatestRef(value) {
29700
- const ref = React5.useRef(value);
29616
+ const ref = React4.useRef(value);
29701
29617
  index(() => {
29702
29618
  ref.current = value;
29703
29619
  });
@@ -29720,7 +29636,7 @@ function useFloating(options) {
29720
29636
  whileElementsMounted,
29721
29637
  open
29722
29638
  } = options;
29723
- const [data, setData] = React5.useState({
29639
+ const [data, setData] = React4.useState({
29724
29640
  x: 0,
29725
29641
  y: 0,
29726
29642
  strategy,
@@ -29728,19 +29644,19 @@ function useFloating(options) {
29728
29644
  middlewareData: {},
29729
29645
  isPositioned: false
29730
29646
  });
29731
- const [latestMiddleware, setLatestMiddleware] = React5.useState(middleware);
29647
+ const [latestMiddleware, setLatestMiddleware] = React4.useState(middleware);
29732
29648
  if (!deepEqual(latestMiddleware, middleware)) {
29733
29649
  setLatestMiddleware(middleware);
29734
29650
  }
29735
- const [_reference, _setReference] = React5.useState(null);
29736
- const [_floating, _setFloating] = React5.useState(null);
29737
- const setReference = React5.useCallback((node) => {
29651
+ const [_reference, _setReference] = React4.useState(null);
29652
+ const [_floating, _setFloating] = React4.useState(null);
29653
+ const setReference = React4.useCallback((node) => {
29738
29654
  if (node !== referenceRef.current) {
29739
29655
  referenceRef.current = node;
29740
29656
  _setReference(node);
29741
29657
  }
29742
29658
  }, []);
29743
- const setFloating = React5.useCallback((node) => {
29659
+ const setFloating = React4.useCallback((node) => {
29744
29660
  if (node !== floatingRef.current) {
29745
29661
  floatingRef.current = node;
29746
29662
  _setFloating(node);
@@ -29748,14 +29664,14 @@ function useFloating(options) {
29748
29664
  }, []);
29749
29665
  const referenceEl = externalReference || _reference;
29750
29666
  const floatingEl = externalFloating || _floating;
29751
- const referenceRef = React5.useRef(null);
29752
- const floatingRef = React5.useRef(null);
29753
- const dataRef = React5.useRef(data);
29667
+ const referenceRef = React4.useRef(null);
29668
+ const floatingRef = React4.useRef(null);
29669
+ const dataRef = React4.useRef(data);
29754
29670
  const hasWhileElementsMounted = whileElementsMounted != null;
29755
29671
  const whileElementsMountedRef = useLatestRef(whileElementsMounted);
29756
29672
  const platformRef = useLatestRef(platform2);
29757
29673
  const openRef = useLatestRef(open);
29758
- const update = React5.useCallback(() => {
29674
+ const update = React4.useCallback(() => {
29759
29675
  if (!referenceRef.current || !floatingRef.current) {
29760
29676
  return;
29761
29677
  }
@@ -29778,7 +29694,7 @@ function useFloating(options) {
29778
29694
  };
29779
29695
  if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
29780
29696
  dataRef.current = fullData;
29781
- ReactDOM2.flushSync(() => {
29697
+ ReactDOM.flushSync(() => {
29782
29698
  setData(fullData);
29783
29699
  });
29784
29700
  }
@@ -29793,7 +29709,7 @@ function useFloating(options) {
29793
29709
  }));
29794
29710
  }
29795
29711
  }, [open]);
29796
- const isMountedRef = React5.useRef(false);
29712
+ const isMountedRef = React4.useRef(false);
29797
29713
  index(() => {
29798
29714
  isMountedRef.current = true;
29799
29715
  return () => {
@@ -29812,17 +29728,17 @@ function useFloating(options) {
29812
29728
  update();
29813
29729
  }
29814
29730
  }, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
29815
- const refs = React5.useMemo(() => ({
29731
+ const refs = React4.useMemo(() => ({
29816
29732
  reference: referenceRef,
29817
29733
  floating: floatingRef,
29818
29734
  setReference,
29819
29735
  setFloating
29820
29736
  }), [setReference, setFloating]);
29821
- const elements = React5.useMemo(() => ({
29737
+ const elements = React4.useMemo(() => ({
29822
29738
  reference: referenceEl,
29823
29739
  floating: floatingEl
29824
29740
  }), [referenceEl, floatingEl]);
29825
- const floatingStyles = React5.useMemo(() => {
29741
+ const floatingStyles = React4.useMemo(() => {
29826
29742
  const initialStyles = {
29827
29743
  position: strategy,
29828
29744
  left: 0,
@@ -29848,7 +29764,7 @@ function useFloating(options) {
29848
29764
  top: y8
29849
29765
  };
29850
29766
  }, [strategy, transform, elements.floating, data.x, data.y]);
29851
- return React5.useMemo(() => ({
29767
+ return React4.useMemo(() => ({
29852
29768
  ...data,
29853
29769
  update,
29854
29770
  refs,
@@ -29875,12 +29791,12 @@ var size3 = (options, deps) => ({
29875
29791
 
29876
29792
  // node_modules/.pnpm/@floating-ui+react@0.26.28_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@floating-ui/react/dist/floating-ui.react.mjs
29877
29793
  var SafeReact = {
29878
- ...React6
29794
+ ...React5
29879
29795
  };
29880
29796
  var useInsertionEffect = SafeReact.useInsertionEffect;
29881
29797
  var useSafeInsertionEffect = useInsertionEffect || ((fn) => fn());
29882
29798
  function useEffectEvent(callback) {
29883
- const ref = React6.useRef(() => {
29799
+ const ref = React5.useRef(() => {
29884
29800
  if (true) {
29885
29801
  throw new Error("Cannot call an event handler while rendering.");
29886
29802
  }
@@ -29888,7 +29804,7 @@ function useEffectEvent(callback) {
29888
29804
  useSafeInsertionEffect(() => {
29889
29805
  ref.current = callback;
29890
29806
  });
29891
- return React6.useCallback(function() {
29807
+ return React5.useCallback(function() {
29892
29808
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
29893
29809
  args[_key] = arguments[_key];
29894
29810
  }
@@ -29911,13 +29827,13 @@ var genId = () => (
29911
29827
  "floating-ui-" + Math.random().toString(36).slice(2, 6) + count++
29912
29828
  );
29913
29829
  function useFloatingId() {
29914
- const [id, setId] = React6.useState(() => serverHandoffComplete ? genId() : void 0);
29830
+ const [id, setId] = React5.useState(() => serverHandoffComplete ? genId() : void 0);
29915
29831
  index2(() => {
29916
29832
  if (id == null) {
29917
29833
  setId(genId());
29918
29834
  }
29919
29835
  }, []);
29920
- React6.useEffect(() => {
29836
+ React5.useEffect(() => {
29921
29837
  serverHandoffComplete = true;
29922
29838
  }, []);
29923
29839
  return id;
@@ -29968,13 +29884,13 @@ function createPubSub() {
29968
29884
  }
29969
29885
  };
29970
29886
  }
29971
- var FloatingNodeContext = /* @__PURE__ */ React6.createContext(null);
29972
- var FloatingTreeContext = /* @__PURE__ */ React6.createContext(null);
29887
+ var FloatingNodeContext = /* @__PURE__ */ React5.createContext(null);
29888
+ var FloatingTreeContext = /* @__PURE__ */ React5.createContext(null);
29973
29889
  var useFloatingParentNodeId = () => {
29974
29890
  var _React$useContext;
29975
- return ((_React$useContext = React6.useContext(FloatingNodeContext)) == null ? void 0 : _React$useContext.id) || null;
29891
+ return ((_React$useContext = React5.useContext(FloatingNodeContext)) == null ? void 0 : _React$useContext.id) || null;
29976
29892
  };
29977
- var useFloatingTree = () => React6.useContext(FloatingTreeContext);
29893
+ var useFloatingTree = () => React5.useContext(FloatingTreeContext);
29978
29894
  var FOCUSABLE_ATTRIBUTE = "data-floating-ui-focusable";
29979
29895
  function useFloatingRootContext(options) {
29980
29896
  const {
@@ -29983,8 +29899,8 @@ function useFloatingRootContext(options) {
29983
29899
  elements: elementsProp
29984
29900
  } = options;
29985
29901
  const floatingId = useId();
29986
- const dataRef = React6.useRef({});
29987
- const [events] = React6.useState(() => createPubSub());
29902
+ const dataRef = React5.useRef({});
29903
+ const [events] = React5.useState(() => createPubSub());
29988
29904
  const nested = useFloatingParentNodeId() != null;
29989
29905
  if (true) {
29990
29906
  const optionDomReference = elementsProp.reference;
@@ -29992,7 +29908,7 @@ function useFloatingRootContext(options) {
29992
29908
  error("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
29993
29909
  }
29994
29910
  }
29995
- const [positionReference, setPositionReference] = React6.useState(elementsProp.reference);
29911
+ const [positionReference, setPositionReference] = React5.useState(elementsProp.reference);
29996
29912
  const onOpenChange = useEffectEvent((open2, event, reason) => {
29997
29913
  dataRef.current.openEvent = open2 ? event : void 0;
29998
29914
  events.emit("openchange", {
@@ -30003,15 +29919,15 @@ function useFloatingRootContext(options) {
30003
29919
  });
30004
29920
  onOpenChangeProp == null || onOpenChangeProp(open2, event, reason);
30005
29921
  });
30006
- const refs = React6.useMemo(() => ({
29922
+ const refs = React5.useMemo(() => ({
30007
29923
  setPositionReference
30008
29924
  }), []);
30009
- const elements = React6.useMemo(() => ({
29925
+ const elements = React5.useMemo(() => ({
30010
29926
  reference: positionReference || elementsProp.reference || null,
30011
29927
  floating: elementsProp.floating || null,
30012
29928
  domReference: elementsProp.reference
30013
29929
  }), [positionReference, elementsProp.reference, elementsProp.floating]);
30014
- return React6.useMemo(() => ({
29930
+ return React5.useMemo(() => ({
30015
29931
  dataRef,
30016
29932
  open,
30017
29933
  onOpenChange,
@@ -30038,11 +29954,11 @@ function useFloating2(options) {
30038
29954
  });
30039
29955
  const rootContext = options.rootContext || internalRootContext;
30040
29956
  const computedElements = rootContext.elements;
30041
- const [_domReference, setDomReference] = React6.useState(null);
30042
- const [positionReference, _setPositionReference] = React6.useState(null);
29957
+ const [_domReference, setDomReference] = React5.useState(null);
29958
+ const [positionReference, _setPositionReference] = React5.useState(null);
30043
29959
  const optionDomReference = computedElements == null ? void 0 : computedElements.domReference;
30044
29960
  const domReference = optionDomReference || _domReference;
30045
- const domReferenceRef = React6.useRef(null);
29961
+ const domReferenceRef = React5.useRef(null);
30046
29962
  const tree = useFloatingTree();
30047
29963
  index2(() => {
30048
29964
  if (domReference) {
@@ -30058,7 +29974,7 @@ function useFloating2(options) {
30058
29974
  }
30059
29975
  }
30060
29976
  });
30061
- const setPositionReference = React6.useCallback((node) => {
29977
+ const setPositionReference = React5.useCallback((node) => {
30062
29978
  const computedPositionReference = isElement(node) ? {
30063
29979
  getBoundingClientRect: () => node.getBoundingClientRect(),
30064
29980
  contextElement: node
@@ -30066,7 +29982,7 @@ function useFloating2(options) {
30066
29982
  _setPositionReference(computedPositionReference);
30067
29983
  position.refs.setReference(computedPositionReference);
30068
29984
  }, [position.refs]);
30069
- const setReference = React6.useCallback((node) => {
29985
+ const setReference = React5.useCallback((node) => {
30070
29986
  if (isElement(node) || node === null) {
30071
29987
  domReferenceRef.current = node;
30072
29988
  setDomReference(node);
@@ -30078,17 +29994,17 @@ function useFloating2(options) {
30078
29994
  position.refs.setReference(node);
30079
29995
  }
30080
29996
  }, [position.refs]);
30081
- const refs = React6.useMemo(() => ({
29997
+ const refs = React5.useMemo(() => ({
30082
29998
  ...position.refs,
30083
29999
  setReference,
30084
30000
  setPositionReference,
30085
30001
  domReference: domReferenceRef
30086
30002
  }), [position.refs, setReference, setPositionReference]);
30087
- const elements = React6.useMemo(() => ({
30003
+ const elements = React5.useMemo(() => ({
30088
30004
  ...position.elements,
30089
30005
  domReference
30090
30006
  }), [position.elements, domReference]);
30091
- const context = React6.useMemo(() => ({
30007
+ const context = React5.useMemo(() => ({
30092
30008
  ...position,
30093
30009
  ...rootContext,
30094
30010
  refs,
@@ -30102,7 +30018,7 @@ function useFloating2(options) {
30102
30018
  node.context = context;
30103
30019
  }
30104
30020
  });
30105
- return React6.useMemo(() => ({
30021
+ return React5.useMemo(() => ({
30106
30022
  ...position,
30107
30023
  context,
30108
30024
  refs,
@@ -30174,22 +30090,22 @@ function useInteractions(propsList) {
30174
30090
  const referenceDeps = propsList.map((key) => key == null ? void 0 : key.reference);
30175
30091
  const floatingDeps = propsList.map((key) => key == null ? void 0 : key.floating);
30176
30092
  const itemDeps = propsList.map((key) => key == null ? void 0 : key.item);
30177
- const getReferenceProps = React6.useCallback(
30093
+ const getReferenceProps = React5.useCallback(
30178
30094
  (userProps) => mergeProps(userProps, propsList, "reference"),
30179
30095
  // eslint-disable-next-line react-hooks/exhaustive-deps
30180
30096
  referenceDeps
30181
30097
  );
30182
- const getFloatingProps = React6.useCallback(
30098
+ const getFloatingProps = React5.useCallback(
30183
30099
  (userProps) => mergeProps(userProps, propsList, "floating"),
30184
30100
  // eslint-disable-next-line react-hooks/exhaustive-deps
30185
30101
  floatingDeps
30186
30102
  );
30187
- const getItemProps = React6.useCallback(
30103
+ const getItemProps = React5.useCallback(
30188
30104
  (userProps) => mergeProps(userProps, propsList, "item"),
30189
30105
  // eslint-disable-next-line react-hooks/exhaustive-deps
30190
30106
  itemDeps
30191
30107
  );
30192
- return React6.useMemo(() => ({
30108
+ return React5.useMemo(() => ({
30193
30109
  getReferenceProps,
30194
30110
  getFloatingProps,
30195
30111
  getItemProps
@@ -30260,7 +30176,7 @@ var inner = (props) => ({
30260
30176
  scrollEl.scrollTop = diffY;
30261
30177
  if (onFallbackChange) {
30262
30178
  const shouldFallback = scrollEl.offsetHeight < item.offsetHeight * min(minItemsVisible, listRef.current.length) - 1 || refOverflow.top >= -referenceOverflowThreshold || refOverflow.bottom >= -referenceOverflowThreshold;
30263
- ReactDOM3.flushSync(() => onFallbackChange(shouldFallback));
30179
+ ReactDOM2.flushSync(() => onFallbackChange(shouldFallback));
30264
30180
  }
30265
30181
  if (overflowRef) {
30266
30182
  overflowRef.current = await detectOverflow2(getArgsWithCustomFloatingHeight({
@@ -30285,10 +30201,10 @@ function useInnerOffset(context, props) {
30285
30201
  onChange: unstable_onChange
30286
30202
  } = props;
30287
30203
  const onChange = useEffectEvent(unstable_onChange);
30288
- const controlledScrollingRef = React6.useRef(false);
30289
- const prevScrollTopRef = React6.useRef(null);
30290
- const initialOverflowRef = React6.useRef(null);
30291
- React6.useEffect(() => {
30204
+ const controlledScrollingRef = React5.useRef(false);
30205
+ const prevScrollTopRef = React5.useRef(null);
30206
+ const initialOverflowRef = React5.useRef(null);
30207
+ React5.useEffect(() => {
30292
30208
  if (!enabled)
30293
30209
  return;
30294
30210
  function onWheel(e10) {
@@ -30306,7 +30222,7 @@ function useInnerOffset(context, props) {
30306
30222
  }
30307
30223
  if (!isAtTop && dY > 0 || !isAtBottom && dY < 0) {
30308
30224
  e10.preventDefault();
30309
- ReactDOM3.flushSync(() => {
30225
+ ReactDOM2.flushSync(() => {
30310
30226
  onChange((d9) => d9 + Math[method](dY, remainingScroll * sign));
30311
30227
  });
30312
30228
  } else if (/firefox/i.test(getUserAgent())) {
@@ -30331,7 +30247,7 @@ function useInnerOffset(context, props) {
30331
30247
  };
30332
30248
  }
30333
30249
  }, [enabled, open, elements.floating, overflowRef, scrollRef, onChange]);
30334
- const floating = React6.useMemo(() => ({
30250
+ const floating = React5.useMemo(() => ({
30335
30251
  onKeyDown() {
30336
30252
  controlledScrollingRef.current = true;
30337
30253
  },
@@ -30349,7 +30265,7 @@ function useInnerOffset(context, props) {
30349
30265
  if (prevScrollTopRef.current !== null) {
30350
30266
  const scrollDiff = el.scrollTop - prevScrollTopRef.current;
30351
30267
  if (overflowRef.current.bottom < -0.5 && scrollDiff < -1 || overflowRef.current.top < -0.5 && scrollDiff > 1) {
30352
- ReactDOM3.flushSync(() => onChange((d9) => d9 + scrollDiff));
30268
+ ReactDOM2.flushSync(() => onChange((d9) => d9 + scrollDiff));
30353
30269
  }
30354
30270
  }
30355
30271
  requestAnimationFrame(() => {
@@ -30357,7 +30273,7 @@ function useInnerOffset(context, props) {
30357
30273
  });
30358
30274
  }
30359
30275
  }), [elements.floating, onChange, overflowRef, scrollRef]);
30360
- return React6.useMemo(() => enabled ? {
30276
+ return React5.useMemo(() => enabled ? {
30361
30277
  floating
30362
30278
  } : {}, [enabled, floating]);
30363
30279
  }
@@ -32860,7 +32776,8 @@ var normalizeDvBData = (data) => {
32860
32776
  protocol: parseProtocolUrl(data.output_url || defaultProtocolSettings.ffurl)
32861
32777
  };
32862
32778
  };
32863
- var DvB = (0, import_react74.forwardRef)(function DvB2({ settings, setSettings, encoderId, isLoading, setIsLoading }, ref) {
32779
+ var DvB = function DvB2(props) {
32780
+ const { settings, setSettings, encoderId, isLoading, setIsLoading, ref } = props;
32864
32781
  const [internalSettings, setInternalSettings] = (0, import_react74.useState)(defaultDvBSettings);
32865
32782
  const [expandedSections, setExpandedSections] = (0, import_react74.useState)({
32866
32783
  video: true,
@@ -32921,13 +32838,33 @@ var DvB = (0, import_react74.forwardRef)(function DvB2({ settings, setSettings,
32921
32838
  newTracks[idx] = { label: newTracks[idx].label, value: !newTracks[idx].value };
32922
32839
  setTracks(newTracks);
32923
32840
  };
32924
- (0, import_react74.useImperativeHandle)(ref, () => ({
32925
- getSettings: () => ({ ...effectiveSettings, output_url: buildProtocolUrl(effectiveSettings.protocol) }),
32926
- reset: () => {
32927
- effectiveSetSettings(savedSettings);
32928
- },
32929
- isDirty: () => JSON.stringify(effectiveSettings) !== JSON.stringify(savedSettings)
32930
- }));
32841
+ (0, import_react74.useEffect)(() => {
32842
+ if (!ref)
32843
+ return;
32844
+ const impl = {
32845
+ getSettings: () => ({ ...effectiveSettings, output_url: buildProtocolUrl(effectiveSettings.protocol) }),
32846
+ reset: () => {
32847
+ effectiveSetSettings(savedSettings);
32848
+ },
32849
+ isDirty: () => JSON.stringify(effectiveSettings) !== JSON.stringify(savedSettings)
32850
+ };
32851
+ try {
32852
+ if (typeof ref === "function")
32853
+ ref(impl);
32854
+ else if ("current" in ref)
32855
+ ref.current = impl;
32856
+ } catch {
32857
+ }
32858
+ return () => {
32859
+ try {
32860
+ if (typeof ref === "function")
32861
+ ref(null);
32862
+ else if ("current" in ref)
32863
+ ref.current = null;
32864
+ } catch {
32865
+ }
32866
+ };
32867
+ }, [ref, effectiveSettings, savedSettings, effectiveSetSettings]);
32931
32868
  return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "space-y-4 pl-4 border-l-[1px] border-gray-600 custom-scroll overflow-y-auto max-h-[670px]", children: [
32932
32869
  /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(VideoGroup_default, { expanded: expandedSections.video, onToggle: toggleSection, loading: isLoading ?? false, children: [
32933
32870
  /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { children: [
@@ -33274,7 +33211,7 @@ var DvB = (0, import_react74.forwardRef)(function DvB2({ settings, setSettings,
33274
33211
  }
33275
33212
  )
33276
33213
  ] });
33277
- });
33214
+ };
33278
33215
  var DvB_default = DvB;
33279
33216
 
33280
33217
  // src/components/encoder/Livecast.tsx
@@ -33402,7 +33339,8 @@ var normalizeLivecastData = (data) => {
33402
33339
  protocol: parsed
33403
33340
  };
33404
33341
  };
33405
- var Livecast = (0, import_react75.forwardRef)(function Livecast2({ settings, setSettings, encoderId, isLoading, setIsLoading }, ref) {
33342
+ var Livecast = function Livecast2(props) {
33343
+ const { settings, setSettings, encoderId, isLoading, setIsLoading, ref } = props;
33406
33344
  const [expandedSections, setExpandedSections] = (0, import_react75.useState)({
33407
33345
  video: true,
33408
33346
  audio: false,
@@ -33458,16 +33396,33 @@ var Livecast = (0, import_react75.forwardRef)(function Livecast2({ settings, set
33458
33396
  const next = { ...effectiveSettings, [key]: !effectiveSettings[key] };
33459
33397
  effectiveSetSettings(next);
33460
33398
  };
33461
- (0, import_react75.useImperativeHandle)(ref, () => ({
33462
- getSettings: () => ({
33463
- ...effectiveSettings,
33464
- send_url: buildProtocolUrl2(effectiveSettings.protocol)
33465
- }),
33466
- reset: () => {
33467
- effectiveSetSettings(savedSettings);
33468
- },
33469
- isDirty: () => JSON.stringify(effectiveSettings) !== JSON.stringify(savedSettings)
33470
- }));
33399
+ (0, import_react75.useEffect)(() => {
33400
+ if (!ref)
33401
+ return;
33402
+ const impl = {
33403
+ getSettings: () => ({ ...effectiveSettings, send_url: buildProtocolUrl2(effectiveSettings.protocol) }),
33404
+ reset: () => {
33405
+ effectiveSetSettings(savedSettings);
33406
+ },
33407
+ isDirty: () => JSON.stringify(effectiveSettings) !== JSON.stringify(savedSettings)
33408
+ };
33409
+ try {
33410
+ if (typeof ref === "function")
33411
+ ref(impl);
33412
+ else if ("current" in ref)
33413
+ ref.current = impl;
33414
+ } catch {
33415
+ }
33416
+ return () => {
33417
+ try {
33418
+ if (typeof ref === "function")
33419
+ ref(null);
33420
+ else if ("current" in ref)
33421
+ ref.current = null;
33422
+ } catch {
33423
+ }
33424
+ };
33425
+ }, [ref, effectiveSettings, savedSettings, effectiveSetSettings]);
33471
33426
  return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "space-y-4 px-4 border-x-[1px] border-gray-500 custom-scroll overflow-y-auto max-h-[670px]", children: [
33472
33427
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(VideoGroup_default, { expanded: expandedSections.video, onToggle: toggleSection, loading: isLoading ?? false, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-4 gap-4", children: [
33473
33428
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
@@ -33618,7 +33573,7 @@ var Livecast = (0, import_react75.forwardRef)(function Livecast2({ settings, set
33618
33573
  }
33619
33574
  )
33620
33575
  ] });
33621
- });
33576
+ };
33622
33577
  var Livecast_default = Livecast;
33623
33578
 
33624
33579
  // src/components/encoder/ViewLog.tsx
@@ -34405,7 +34360,7 @@ var import_react80 = require("react");
34405
34360
  var import_jsx_runtime25 = require("react/jsx-runtime");
34406
34361
  var ThemeContext = (0, import_react80.createContext)(void 0);
34407
34362
  function useTheme() {
34408
- const context = (0, import_react80.useContext)(ThemeContext);
34363
+ const context = (0, import_react80.use)(ThemeContext);
34409
34364
  if (context === void 0) {
34410
34365
  throw new Error("useTheme must be used within a ThemeProvider");
34411
34366
  }
@@ -35382,7 +35337,7 @@ var Footer = () => {
35382
35337
  var Footer_default = Footer;
35383
35338
 
35384
35339
  // src/components/main/Header.tsx
35385
- var import_react86 = __toESM(require("react"), 1);
35340
+ var import_react86 = __toESM(require("react"));
35386
35341
  var import_react_router_dom = require("react-router-dom");
35387
35342
  var import_jsx_runtime33 = require("react/jsx-runtime");
35388
35343
  function classNames(...classes) {
@@ -35752,7 +35707,7 @@ var Header = ({ isSidebarOpen, setSidebarOpen, onNavigate }) => {
35752
35707
  var Header_default = Header;
35753
35708
 
35754
35709
  // src/components/main/PageHeader.tsx
35755
- var import_react88 = __toESM(require("react"), 1);
35710
+ var import_react88 = __toESM(require("react"));
35756
35711
  var import_jsx_runtime34 = require("react/jsx-runtime");
35757
35712
  var PageHeader = ({
35758
35713
  icon,
@@ -36642,6 +36597,20 @@ var InterfacesTimeseries = ({
36642
36597
  };
36643
36598
  var InterfacesTimeseries_default = InterfacesTimeseries;
36644
36599
 
36600
+ // src/components/network/validators.ts
36601
+ var isValidIPv4 = (ip) => {
36602
+ if (!ip)
36603
+ return false;
36604
+ const ipv4Regex = /^(25[0-5]|2[0-4]\d|1?\d?\d)(\.(25[0-5]|2[0-4]\d|1?\d?\d)){3}$/;
36605
+ return ipv4Regex.test(ip.trim());
36606
+ };
36607
+ var isValidIPv6 = (ip) => {
36608
+ if (!ip)
36609
+ return false;
36610
+ const ipv6Regex = /^(?:[A-F0-9]{1,4}:){7}[A-F0-9]{1,4}$|^((?:[A-F0-9]{1,4}(?::|$)){1,8})$/i;
36611
+ return ipv6Regex.test(ip.trim());
36612
+ };
36613
+
36645
36614
  // src/components/system/RequireAuth.tsx
36646
36615
  var import_react_router_dom3 = require("react-router-dom");
36647
36616
  var import_jsx_runtime40 = require("react/jsx-runtime");
@@ -39074,7 +39043,7 @@ var dir = instance.dir;
39074
39043
  var init = instance.init;
39075
39044
  var loadResources = instance.loadResources;
39076
39045
  var reloadResources = instance.reloadResources;
39077
- var use = instance.use;
39046
+ var use4 = instance.use;
39078
39047
  var changeLanguage = instance.changeLanguage;
39079
39048
  var getFixedT = instance.getFixedT;
39080
39049
  var t14 = instance.t;
@@ -40115,7 +40084,7 @@ instance.use(initReactI18next).init({
40115
40084
  var i18n_default = instance;
40116
40085
 
40117
40086
  // src/context/SharedUiProvider.tsx
40118
- var import_react104 = __toESM(require("react"), 1);
40087
+ var import_react104 = __toESM(require("react"));
40119
40088
  var import_react_query2 = require("@tanstack/react-query");
40120
40089
  var import_jsx_runtime41 = require("react/jsx-runtime");
40121
40090
 
@@ -40358,48 +40327,13 @@ var ConfigWizard = ({ basePath = "./config-xcoder-wizard/php", onComplete }) =>
40358
40327
  };
40359
40328
  var Wizard_default = ConfigWizard;
40360
40329
 
40361
- // src/components/RemoteModule.tsx
40330
+ // src/components/xcoder/Fflog.tsx
40362
40331
  var import_react106 = require("react");
40363
40332
  var import_jsx_runtime43 = require("react/jsx-runtime");
40364
- function RemoteModule({ scope, url, module: module2, fallback }) {
40365
- const [Component2, setComponent] = (0, import_react106.useState)(null);
40366
- const [error2, setError] = (0, import_react106.useState)(null);
40367
- const [loading, setLoading] = (0, import_react106.useState)(true);
40368
- (0, import_react106.useEffect)(() => {
40369
- setLoading(true);
40370
- setError(null);
40371
- loadRemoteModule({ scope, url, module: module2 }).then((mod) => {
40372
- setComponent(() => mod);
40373
- }).catch((err) => {
40374
- console.error("Erro ao carregar m\xF3dulo:", err);
40375
- setError(err.message);
40376
- }).finally(() => {
40377
- setLoading(false);
40378
- });
40379
- }, [scope, url, module2]);
40380
- if (loading) {
40381
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "flex items-center justify-center h-64", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "animate-spin rounded-full h-12 w-12 border-b-2 border-primary dark:border-primary-purple" }) });
40382
- }
40383
- if (error2) {
40384
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "p-6 bg-red-50 dark:bg-red-950/30 border border-red-200 dark:border-red-800 rounded-lg", children: [
40385
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("h3", { className: "text-lg font-semibold text-red-800 dark:text-red-300 mb-2", children: "Erro ao carregar m\xF3dulo" }),
40386
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "text-red-600 dark:text-red-400", children: error2 }),
40387
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "text-sm text-red-500 dark:text-red-500 mt-2", children: "Verifique se o m\xF3dulo est\xE1 instalado e o servidor est\xE1 rodando." })
40388
- ] });
40389
- }
40390
- if (!Component2) {
40391
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_jsx_runtime43.Fragment, { children: fallback || /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "p-4 text-neutral-500 dark:text-neutral-400", children: "M\xF3dulo n\xE3o encontrado" }) });
40392
- }
40393
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Component2, {});
40394
- }
40395
-
40396
- // src/components/xcoder/Fflog.tsx
40397
- var import_react107 = require("react");
40398
- var import_jsx_runtime44 = require("react/jsx-runtime");
40399
40333
  var Fflog = ({ index: index3 }) => {
40400
- const [message, setMessage] = (0, import_react107.useState)("");
40401
- const [tooltip, setTooltip] = (0, import_react107.useState)("Copy to Clipboard");
40402
- (0, import_react107.useEffect)(() => {
40334
+ const [message, setMessage] = (0, import_react106.useState)("");
40335
+ const [tooltip, setTooltip] = (0, import_react106.useState)("Copy to Clipboard");
40336
+ (0, import_react106.useEffect)(() => {
40403
40337
  const cleanupSocket = subscribeToWebsocket(buildWsUrl("/ws"), (data) => {
40404
40338
  const aux = data?.logs[index3 - 1];
40405
40339
  setMessage(aux.log);
@@ -40412,7 +40346,7 @@ var Fflog = ({ index: index3 }) => {
40412
40346
  cleanupSocket();
40413
40347
  };
40414
40348
  }, []);
40415
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
40349
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
40416
40350
  "div",
40417
40351
  {
40418
40352
  "data-tooltip-id": "tooltip",
@@ -40427,8 +40361,8 @@ var Fflog = ({ index: index3 }) => {
40427
40361
  },
40428
40362
  onMouseLeave: () => message == "" ? setTooltip("Copy to Clipboard") : "",
40429
40363
  children: [
40430
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(M10, { id: "tooltip" }),
40431
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "relative mt-[-10px] text-justify text-gray-900 dark:text-slate-200 font-mono", style: { overflow: "hidden", whiteSpace: "nowrap", textOverflow: "ellipsis" }, children: message })
40364
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(M10, { id: "tooltip" }),
40365
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "relative mt-[-10px] text-justify text-gray-900 dark:text-slate-200 font-mono", style: { overflow: "hidden", whiteSpace: "nowrap", textOverflow: "ellipsis" }, children: message })
40432
40366
  ]
40433
40367
  }
40434
40368
  );
@@ -40436,7 +40370,7 @@ var Fflog = ({ index: index3 }) => {
40436
40370
  var Fflog_default = Fflog;
40437
40371
 
40438
40372
  // src/components/xcoder/Metrics.tsx
40439
- var import_jsx_runtime45 = require("react/jsx-runtime");
40373
+ var import_jsx_runtime44 = require("react/jsx-runtime");
40440
40374
  var MetricBar = ({ label, value, suffix, color }) => {
40441
40375
  const colorClasses = {
40442
40376
  blue: "bg-blue-500",
@@ -40445,15 +40379,15 @@ var MetricBar = ({ label, value, suffix, color }) => {
40445
40379
  cyan: "bg-cyan-500",
40446
40380
  pink: "bg-pink-500"
40447
40381
  };
40448
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "space-y-1", children: [
40449
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-center justify-between text-sm", children: [
40450
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "text-gray-900 dark:text-slate-400", children: label }),
40451
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("span", { className: "text-gray-900 dark:text-white font-mono", children: [
40382
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "space-y-1", children: [
40383
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex items-center justify-between text-sm", children: [
40384
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "text-gray-900 dark:text-slate-400", children: label }),
40385
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: "text-gray-900 dark:text-white font-mono", children: [
40452
40386
  Math.round(value),
40453
40387
  suffix
40454
40388
  ] })
40455
40389
  ] }),
40456
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "h-2 bg-slate-300 dark:bg-slate-800 rounded-full overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
40390
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "h-2 bg-slate-300 dark:bg-slate-800 rounded-full overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
40457
40391
  "div",
40458
40392
  {
40459
40393
  className: `h-full transition-all duration-300 ${colorClasses[color]}`,
@@ -40465,8 +40399,8 @@ var MetricBar = ({ label, value, suffix, color }) => {
40465
40399
  var Metrics_default = MetricBar;
40466
40400
 
40467
40401
  // src/components/xcoder/Panel.tsx
40468
- var import_react108 = require("react");
40469
- var import_jsx_runtime46 = require("react/jsx-runtime");
40402
+ var import_react107 = require("react");
40403
+ var import_jsx_runtime45 = require("react/jsx-runtime");
40470
40404
  var convertServiceToOption = (serviceString) => {
40471
40405
  const match = serviceString.match(/^([^@]+)@/);
40472
40406
  if (!match) {
@@ -40480,12 +40414,12 @@ var convertServiceToOption = (serviceString) => {
40480
40414
  return { label, value: rawValue };
40481
40415
  };
40482
40416
  var EncoderDecoderPanel = ({ index: index3 }) => {
40483
- const [status, setStatus] = (0, import_react108.useState)("idle");
40484
- const [modes, setModes] = (0, import_react108.useState)([]);
40485
- const [oldModes, setOldModes] = (0, import_react108.useState)(modes);
40486
- const [open, setOpen] = (0, import_react108.useState)(false);
40487
- const [optionsList, setOptionsList] = (0, import_react108.useState)([]);
40488
- (0, import_react108.useEffect)(() => {
40417
+ const [status, setStatus] = (0, import_react107.useState)("idle");
40418
+ const [modes, setModes] = (0, import_react107.useState)([]);
40419
+ const [oldModes, setOldModes] = (0, import_react107.useState)(modes);
40420
+ const [open, setOpen] = (0, import_react107.useState)(false);
40421
+ const [optionsList, setOptionsList] = (0, import_react107.useState)([]);
40422
+ (0, import_react107.useEffect)(() => {
40489
40423
  const cleanupSocket = subscribeToWebsocket(buildWsUrl("/"), (data) => {
40490
40424
  setStatus(data?.services[`xcoder_${index3}`].status);
40491
40425
  });
@@ -40519,52 +40453,52 @@ var EncoderDecoderPanel = ({ index: index3 }) => {
40519
40453
  m: state ? "stop" : "start"
40520
40454
  });
40521
40455
  };
40522
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "bg-gray-200 dark:bg-slate-900/50 border bg-gray-200 border-gray-400 dark:border-slate-800 rounded-lg", children: [
40523
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "px-6 py-3 border-b border-slate-800 flex items-center justify-between", children: [
40524
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex items-center gap-3", children: [
40525
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Radio, { className: "w-5 h-5 text-blue-500" }),
40526
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("h1", { className: "text-base font-medium text-gray-800 dark:text-white hover:underline", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("a", { href: `/page/${modes[index3 - 1]?.split("@")[0] ?? "encoder-dvb"}?channel=${index3}`, children: [
40456
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "bg-gray-200 dark:bg-slate-900/50 border bg-gray-200 border-gray-400 dark:border-slate-800 rounded-lg", children: [
40457
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "px-6 py-3 border-b border-slate-800 flex items-center justify-between", children: [
40458
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-center gap-3", children: [
40459
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Radio, { className: "w-5 h-5 text-blue-500" }),
40460
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("h1", { className: "text-base font-medium text-gray-800 dark:text-white hover:underline", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("a", { href: `/page/${modes[index3 - 1]?.split("@")[0] ?? "encoder-dvb"}?channel=${index3}`, children: [
40527
40461
  "Xcoder BMD Video Interface (",
40528
40462
  index3,
40529
40463
  ")"
40530
40464
  ] }) })
40531
40465
  ] }),
40532
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex items-center gap-4", children: [
40533
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
40466
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-center gap-4", children: [
40467
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
40534
40468
  "button",
40535
40469
  {
40536
40470
  onClick: () => startStop(status == "running"),
40537
40471
  className: `flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium transition-all ${status == "running" ? "bg-red-600 hover:bg-red-700 text-white" : "bg-blue-600 hover:bg-blue-700 text-white"}`,
40538
- children: status == "running" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
40539
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Pause, { className: "w-4 h-4" }),
40472
+ children: status == "running" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
40473
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Pause, { className: "w-4 h-4" }),
40540
40474
  "Stop"
40541
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
40542
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Play, { className: "w-4 h-4" }),
40475
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
40476
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Play, { className: "w-4 h-4" }),
40543
40477
  "Start"
40544
40478
  ] })
40545
40479
  }
40546
40480
  ),
40547
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: `flex w-[100px] justify-center items-center gap-2 px-4 py-2 rounded-md ${status == "running" ? "bg-yellow-600" : "bg-slate-700"}`, children: [
40548
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: `w-2 h-2 rounded-full bg-white ${status == "running" ? "block" : "hidden"}` }),
40549
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-sm text-slate-100 font-mono font-bold", children: status == "running" ? "READY" : "STANDBY" })
40481
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: `flex w-[100px] justify-center items-center gap-2 px-4 py-2 rounded-md ${status == "running" ? "bg-yellow-600" : "bg-slate-700"}`, children: [
40482
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: `w-2 h-2 rounded-full bg-white ${status == "running" ? "block" : "hidden"}` }),
40483
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "text-sm text-slate-100 font-mono font-bold", children: status == "running" ? "READY" : "STANDBY" })
40550
40484
  ] }),
40551
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
40485
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
40552
40486
  "button",
40553
40487
  {
40554
40488
  onClick: () => setOpen(true),
40555
40489
  className: "p-2 rounded-md transition-colors",
40556
- children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Settings, { className: "w-5 h-5 text-slate-400 hover:text-blue-400" })
40490
+ children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Settings, { className: "w-5 h-5 text-slate-400 hover:text-blue-400" })
40557
40491
  }
40558
40492
  )
40559
40493
  ] })
40560
40494
  ] }),
40561
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
40495
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
40562
40496
  Modal_default,
40563
40497
  {
40564
40498
  open,
40565
40499
  setOpen,
40566
40500
  title: "Switching Operation Mode",
40567
- element: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { children: optionsList[index3 - 1] && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "relative p-6", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
40501
+ element: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { children: optionsList[index3 - 1] && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "relative p-6", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
40568
40502
  SelectField_default,
40569
40503
  {
40570
40504
  label: "New Mode",
@@ -40585,15 +40519,15 @@ var EncoderDecoderPanel = ({ index: index3 }) => {
40585
40519
  }
40586
40520
  }
40587
40521
  ),
40588
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "p-6", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Preview_default, { index: index3, setVuPts: () => {
40522
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "p-6", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Preview_default, { index: index3, setVuPts: () => {
40589
40523
  } }) })
40590
40524
  ] });
40591
40525
  };
40592
40526
  var Panel_default = EncoderDecoderPanel;
40593
40527
 
40594
40528
  // src/components/xcoder/Preview.tsx
40595
- var import_react109 = require("react");
40596
- var import_jsx_runtime47 = require("react/jsx-runtime");
40529
+ var import_react108 = require("react");
40530
+ var import_jsx_runtime46 = require("react/jsx-runtime");
40597
40531
  var Preview = ({
40598
40532
  index: index3,
40599
40533
  setVuPts,
@@ -40602,9 +40536,9 @@ var Preview = ({
40602
40536
  showStreamControl = false,
40603
40537
  orientation = "horizontal"
40604
40538
  }) => {
40605
- const logEndRef = (0, import_react109.useRef)(null);
40606
- const [message, setMessage] = (0, import_react109.useState)([]);
40607
- (0, import_react109.useEffect)(() => {
40539
+ const logEndRef = (0, import_react108.useRef)(null);
40540
+ const [message, setMessage] = (0, import_react108.useState)([]);
40541
+ (0, import_react108.useEffect)(() => {
40608
40542
  const cleanupSocket = subscribeToWebsocket(buildWsUrl("/"), (data) => {
40609
40543
  const aux = data?.services[`xcoder_${index3}`];
40610
40544
  setMessage(aux.decklinkEvents.split("\n"));
@@ -40613,22 +40547,22 @@ var Preview = ({
40613
40547
  cleanupSocket();
40614
40548
  };
40615
40549
  }, []);
40616
- (0, import_react109.useEffect)(() => {
40550
+ (0, import_react108.useEffect)(() => {
40617
40551
  if (logEndRef.current) {
40618
40552
  logEndRef.current.scrollTop = logEndRef.current.scrollHeight;
40619
40553
  }
40620
40554
  }, [message]);
40621
- const [vuChannels, setVuChannels] = (0, import_react109.useState)(
40555
+ const [vuChannels, setVuChannels] = (0, import_react108.useState)(
40622
40556
  Array(8).fill({ left: 0, right: 0 })
40623
40557
  );
40624
40558
  const channelCount = 8;
40625
- const vuBars = (0, import_react109.useMemo)(() => {
40626
- return Array.from({ length: channelCount }, (_7, i14) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(VUMeter_default, { index: i14, volume: vuChannels }, `vu-bar-${i14}`));
40559
+ const vuBars = (0, import_react108.useMemo)(() => {
40560
+ return Array.from({ length: channelCount }, (_7, i14) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(VUMeter_default, { index: i14, volume: vuChannels }, `vu-bar-${i14}`));
40627
40561
  }, [channelCount, vuChannels]);
40628
- const playerRef = (0, import_react109.useRef)(null);
40629
- const vuRef = (0, import_react109.useRef)(null);
40630
- const [height, setHeight] = (0, import_react109.useState)("auto");
40631
- (0, import_react109.useLayoutEffect)(() => {
40562
+ const playerRef = (0, import_react108.useRef)(null);
40563
+ const vuRef = (0, import_react108.useRef)(null);
40564
+ const [height, setHeight] = (0, import_react108.useState)("auto");
40565
+ (0, import_react108.useLayoutEffect)(() => {
40632
40566
  const p8 = playerRef.current;
40633
40567
  const v6 = vuRef.current;
40634
40568
  if (p8 && p8 != null && v6 && v6 != null) {
@@ -40642,15 +40576,15 @@ var Preview = ({
40642
40576
  }
40643
40577
  ;
40644
40578
  }, []);
40645
- const [isOpen, setIsOpen] = (0, import_react109.useState)(false);
40646
- const logData = message.map((log, i14) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "flex gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "text-slate-900 dark:text-slate-300 break-words", children: log }) }, i14));
40647
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: `"w-full h-full" ${orientation === "horizontal" ? "" : "py-6"}`, children: [
40648
- /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
40579
+ const [isOpen, setIsOpen] = (0, import_react108.useState)(false);
40580
+ const logData = message.map((log, i14) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "flex gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-slate-900 dark:text-slate-300 break-words", children: log }) }, i14));
40581
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: `"w-full h-full" ${orientation === "horizontal" ? "" : "py-6"}`, children: [
40582
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
40649
40583
  "div",
40650
40584
  {
40651
40585
  className: `grid gap-6 mb-5 ${orientation === "horizontal" ? "grid-cols-[1fr_300px] items-start" : "grid-cols-1"}`,
40652
40586
  children: [
40653
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { ref: playerRef, className: "bg-black rounded-lg overflow-hidden aspect-video", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "w-full h-full relative flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
40587
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { ref: playerRef, className: "bg-black rounded-lg overflow-hidden aspect-video", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "w-full h-full relative flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
40654
40588
  VideoPlayer_default,
40655
40589
  {
40656
40590
  pgmIndex: index3,
@@ -40659,10 +40593,10 @@ var Preview = ({
40659
40593
  setVuChannels
40660
40594
  }
40661
40595
  ) }) }),
40662
- /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: `flex flex-col ${orientation === "horizontal" ? "h-full" : "h-[200px]"}`, children: [
40663
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { ref: vuRef, className: `bg-gray-100 dark:bg-slate-800/50 border border-slate-200 dark:border-slate-700 rounded-lg p-4 ${showDlog || showStreamControl ? "mb-5" : "flex-1"}`, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: `flex justify-between items-end ${showDlog || showStreamControl ? "h-32" : "h-full"}`, children: vuBars }) }),
40664
- showStreamControl && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(StreamControl_default, { index: index3 }),
40665
- showDlog && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "bg-gray-100 dark:bg-slate-800/50 border border-slate-200 dark:border-slate-700 rounded-lg overflow-hidden flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
40596
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: `flex flex-col ${orientation === "horizontal" ? "h-full" : "h-[200px]"}`, children: [
40597
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { ref: vuRef, className: `bg-gray-100 dark:bg-slate-800/50 border border-slate-200 dark:border-slate-700 rounded-lg p-4 ${showDlog || showStreamControl ? "mb-5" : "flex-1"}`, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: `flex justify-between items-end ${showDlog || showStreamControl ? "h-32" : "h-full"}`, children: vuBars }) }),
40598
+ showStreamControl && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(StreamControl_default, { index: index3 }),
40599
+ showDlog && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "bg-gray-100 dark:bg-slate-800/50 border border-slate-200 dark:border-slate-700 rounded-lg overflow-hidden flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
40666
40600
  "div",
40667
40601
  {
40668
40602
  ref: logEndRef,
@@ -40673,7 +40607,7 @@ var Preview = ({
40673
40607
  style: { height },
40674
40608
  onClick: () => setIsOpen(true),
40675
40609
  children: [
40676
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(M10, { id: "tooltip" }),
40610
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(M10, { id: "tooltip" }),
40677
40611
  logData
40678
40612
  ]
40679
40613
  }
@@ -40682,15 +40616,15 @@ var Preview = ({
40682
40616
  ]
40683
40617
  }
40684
40618
  ),
40685
- showFflog && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Fflog_default, { index: index3 }),
40686
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
40619
+ showFflog && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Fflog_default, { index: index3 }),
40620
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
40687
40621
  Modal_default,
40688
40622
  {
40689
40623
  open: isOpen,
40690
40624
  setOpen: () => setIsOpen(!isOpen),
40691
40625
  title: "Log Message",
40692
- element: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "custom-scroll overflow-y-auto p-3 h-[300px]", children: logData }),
40693
- icon: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FileClock, { "aria-hidden": "true", className: "size-6 text-yellow-600" }),
40626
+ element: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "custom-scroll overflow-y-auto p-3 h-[300px]", children: logData }),
40627
+ icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FileClock, { "aria-hidden": "true", className: "size-6 text-yellow-600" }),
40694
40628
  positiveLabel: "Copy",
40695
40629
  positiveCommand: () => {
40696
40630
  navigator.clipboard.writeText(message.join("\n"));
@@ -40702,11 +40636,11 @@ var Preview = ({
40702
40636
  var Preview_default = Preview;
40703
40637
 
40704
40638
  // src/components/xcoder/StreamControl.tsx
40705
- var import_react110 = require("react");
40706
- var import_jsx_runtime48 = require("react/jsx-runtime");
40639
+ var import_react109 = require("react");
40640
+ var import_jsx_runtime47 = require("react/jsx-runtime");
40707
40641
  var StreamControl = ({ index: index3 }) => {
40708
- const [bufferValue, setBufferValue] = (0, import_react110.useState)(0);
40709
- const [syncValue, setSyncValue] = (0, import_react110.useState)(0);
40642
+ const [bufferValue, setBufferValue] = (0, import_react109.useState)(0);
40643
+ const [syncValue, setSyncValue] = (0, import_react109.useState)(0);
40710
40644
  const minBuffer = 0;
40711
40645
  const maxBuffer = 100;
40712
40646
  const minSync = -30;
@@ -40719,45 +40653,45 @@ var StreamControl = ({ index: index3 }) => {
40719
40653
  true,
40720
40654
  1e3
40721
40655
  );
40722
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "w-80 space-y-3", children: [
40723
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "bg-gray-100 dark:bg-slate-800/50 border border-slate-200 dark:border-slate-700 rounded-lg p-3 max-h-[300px] min-h-[100px] overflow-auto", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "text-xs space-y-2 text-gray-800 dark:text-slate-200", children: [
40724
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "space-y-1", children: [
40725
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex gap-2", children: [
40726
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "font-medium", children: "Service Name:" }),
40727
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "truncate", children: data?.service_name ?? "\u2014" })
40656
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "w-80 space-y-3", children: [
40657
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "bg-gray-100 dark:bg-slate-800/50 border border-slate-200 dark:border-slate-700 rounded-lg p-3 max-h-[300px] min-h-[100px] overflow-auto", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "text-xs space-y-2 text-gray-800 dark:text-slate-200", children: [
40658
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "space-y-1", children: [
40659
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex gap-2", children: [
40660
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "font-medium", children: "Service Name:" }),
40661
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "truncate", children: data?.service_name ?? "\u2014" })
40728
40662
  ] }),
40729
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex gap-2", children: [
40730
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "font-medium", children: "Service Provider:" }),
40731
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "truncate", children: data?.service_provider ?? "\u2014" })
40663
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex gap-2", children: [
40664
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "font-medium", children: "Service Provider:" }),
40665
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "truncate", children: data?.service_provider ?? "\u2014" })
40732
40666
  ] })
40733
40667
  ] }),
40734
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "space-y-1.5 pt-2", children: [
40735
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex items-center gap-2", children: [
40736
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Video, { className: "w-4 h-4 text-sky-400" }),
40737
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { className: "truncate", children: [
40668
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "space-y-1.5 pt-2", children: [
40669
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex items-center gap-2", children: [
40670
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Video, { className: "w-4 h-4 text-sky-400" }),
40671
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { className: "truncate", children: [
40738
40672
  "Video 0: ",
40739
40673
  data?.input_streans[1].input_stream.type
40740
40674
  ] })
40741
40675
  ] }),
40742
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex items-center gap-2", children: [
40743
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Volume2, { className: "w-4 h-4 text-emerald-400" }),
40744
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { className: "truncate", children: [
40676
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex items-center gap-2", children: [
40677
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Volume2, { className: "w-4 h-4 text-emerald-400" }),
40678
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { className: "truncate", children: [
40745
40679
  "Audio 1: ",
40746
40680
  data?.input_streans[0].input_stream.type
40747
40681
  ] })
40748
40682
  ] })
40749
40683
  ] })
40750
40684
  ] }) }),
40751
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "bg-gray-100 dark:bg-slate-800/50 border border-slate-200 dark:border-slate-700 rounded-lg p-3", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "space-y-3 text-slate-200 text-xs", children: [
40752
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SliderField_default, { value: bufferValue, setValue: setBufferValue, label: "Fifo Size:", min: minBuffer, max: maxBuffer }),
40753
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SliderField_default, { value: syncValue, setValue: setSyncValue, label: "A/V Sync:", min: minSync, max: maxSync, content: ["<", ">"], step: 10 }),
40754
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "pt-2 border-t border-slate-700 text-xs text-gray-700 dark:text-slate-300 flex justify-between", children: [
40755
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { children: [
40685
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "bg-gray-100 dark:bg-slate-800/50 border border-slate-200 dark:border-slate-700 rounded-lg p-3", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "space-y-3 text-slate-200 text-xs", children: [
40686
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SliderField_default, { value: bufferValue, setValue: setBufferValue, label: "Fifo Size:", min: minBuffer, max: maxBuffer }),
40687
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SliderField_default, { value: syncValue, setValue: setSyncValue, label: "A/V Sync:", min: minSync, max: maxSync, content: ["<", ">"], step: 10 }),
40688
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "pt-2 border-t border-slate-700 text-xs text-gray-700 dark:text-slate-300 flex justify-between", children: [
40689
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { children: [
40756
40690
  "Buffer: ",
40757
40691
  bufferValue,
40758
40692
  " frames"
40759
40693
  ] }),
40760
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { children: [
40694
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { children: [
40761
40695
  "Sync: ",
40762
40696
  syncValue > 0 ? "+" : "",
40763
40697
  syncValue,
@@ -40770,8 +40704,8 @@ var StreamControl = ({ index: index3 }) => {
40770
40704
  var StreamControl_default = StreamControl;
40771
40705
 
40772
40706
  // src/components/xcoder/VideoPlayer.tsx
40773
- var import_react111 = require("react");
40774
- var import_jsx_runtime49 = require("react/jsx-runtime");
40707
+ var import_react110 = require("react");
40708
+ var import_jsx_runtime48 = require("react/jsx-runtime");
40775
40709
  var import_meta2 = {};
40776
40710
  var VideoPlayer = ({
40777
40711
  pgmIndex,
@@ -40779,11 +40713,11 @@ var VideoPlayer = ({
40779
40713
  setVuPts,
40780
40714
  setVuChannels
40781
40715
  }) => {
40782
- const dummyCanvas = (0, import_react111.useMemo)(() => document.createElement("canvas"), []);
40783
- const videoRef = (0, import_react111.useRef)(dummyCanvas);
40784
- const prevRawChannelsRef = (0, import_react111.useRef)(null);
40785
- const playerRef = (0, import_react111.useRef)(null);
40786
- (0, import_react111.useEffect)(() => {
40716
+ const dummyCanvas = (0, import_react110.useMemo)(() => document.createElement("canvas"), []);
40717
+ const videoRef = (0, import_react110.useRef)(dummyCanvas);
40718
+ const prevRawChannelsRef = (0, import_react110.useRef)(null);
40719
+ const playerRef = (0, import_react110.useRef)(null);
40720
+ (0, import_react110.useEffect)(() => {
40787
40721
  let cancelled = false;
40788
40722
  if (!videoRef.current) {
40789
40723
  console.warn("Video canvas not ready yet");
@@ -40904,7 +40838,7 @@ var VideoPlayer = ({
40904
40838
  initPlayer();
40905
40839
  }
40906
40840
  }, [pgmIndex]);
40907
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
40841
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
40908
40842
  "canvas",
40909
40843
  {
40910
40844
  ref: videoRef,
@@ -40915,21 +40849,21 @@ var VideoPlayer = ({
40915
40849
  var VideoPlayer_default = VideoPlayer;
40916
40850
 
40917
40851
  // src/components/xcoder/VUMeter.tsx
40918
- var import_react112 = require("react");
40919
- var import_jsx_runtime50 = require("react/jsx-runtime");
40852
+ var import_react111 = require("react");
40853
+ var import_jsx_runtime49 = require("react/jsx-runtime");
40920
40854
  var VUBar = ({ index: index3, volume, width = "15px", displayMarks = false }) => {
40921
- const [tickerTarget, setTickerTarget] = (0, import_react112.useState)({ left: 0, right: 0 });
40922
- const [tickerTransition, setTickerTransition] = (0, import_react112.useState)({
40855
+ const [tickerTarget, setTickerTarget] = (0, import_react111.useState)({ left: 0, right: 0 });
40856
+ const [tickerTransition, setTickerTransition] = (0, import_react111.useState)({
40923
40857
  left: 0,
40924
40858
  right: 0
40925
40859
  });
40926
- const [resetVUTimeout, setResetVUTimeout] = (0, import_react112.useState)(0);
40927
- const tickerLeftRef = (0, import_react112.useRef)(null);
40928
- const tickerRightRef = (0, import_react112.useRef)(null);
40929
- const blockerLeftRef = (0, import_react112.useRef)(null);
40930
- const blockerRightRef = (0, import_react112.useRef)(null);
40931
- const fillerRef = (0, import_react112.useRef)(null);
40932
- const calcVolume = (0, import_react112.useCallback)(() => {
40860
+ const [resetVUTimeout, setResetVUTimeout] = (0, import_react111.useState)(0);
40861
+ const tickerLeftRef = (0, import_react111.useRef)(null);
40862
+ const tickerRightRef = (0, import_react111.useRef)(null);
40863
+ const blockerLeftRef = (0, import_react111.useRef)(null);
40864
+ const blockerRightRef = (0, import_react111.useRef)(null);
40865
+ const fillerRef = (0, import_react111.useRef)(null);
40866
+ const calcVolume = (0, import_react111.useCallback)(() => {
40933
40867
  try {
40934
40868
  const fillerRect = fillerRef.current?.getBoundingClientRect();
40935
40869
  const blockerLeftRect = blockerLeftRef.current?.getBoundingClientRect();
@@ -40978,7 +40912,7 @@ var VUBar = ({ index: index3, volume, width = "15px", displayMarks = false }) =>
40978
40912
  } catch (e10) {
40979
40913
  }
40980
40914
  }, []);
40981
- (0, import_react112.useEffect)(() => {
40915
+ (0, import_react111.useEffect)(() => {
40982
40916
  calcVolume();
40983
40917
  if (resetVUTimeout) {
40984
40918
  clearTimeout(resetVUTimeout);
@@ -40993,9 +40927,9 @@ var VUBar = ({ index: index3, volume, width = "15px", displayMarks = false }) =>
40993
40927
  const MIN_DB = -70;
40994
40928
  const MAX_DB = 0;
40995
40929
  const measures = [0, -10, -20, -30, -40, -50, -60, -70];
40996
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex w-full h-full justify-center", children: [
40997
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: displayMarks ? "mt-[60px]" : "hidden", children: measures.map((db) => {
40998
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
40930
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex w-full h-full justify-center", children: [
40931
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: displayMarks ? "mt-[60px]" : "hidden", children: measures.map((db) => {
40932
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
40999
40933
  "div",
41000
40934
  {
41001
40935
  style: { marginBottom: `${(db - MIN_DB) / (MAX_DB - MIN_DB) * 100}px`, marginRight: "25px", textAlignLast: "center" },
@@ -41016,15 +40950,15 @@ var VUBar = ({ index: index3, volume, width = "15px", displayMarks = false }) =>
41016
40950
  db
41017
40951
  );
41018
40952
  }) }),
41019
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: `h-full w-full text-xs text-center text-white`, style: { maxWidth: `${width}` }, children: [
41020
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex border border-gray-400 w-full h-[96%] rotate-180 scale-x-[-1]", children: [
41021
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { ref: fillerRef, className: "w-1/2 h-full", style: { background: "linear-gradient(180deg, rgba(0, 187, 0, 1) 0%, rgba(255, 162, 0, 1) 50%, rgba(255, 0, 0, 1) 100%)", borderRadius: "inherit" }, children: [
41022
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { ref: blockerLeftRef, className: "absolute bg-gray-200 dark:bg-[#18191d] bottom-0 w-1/2", style: { height: `${100 - volume[index3].left}%`, transition: "height 0.1s ease-out" } }),
41023
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { ref: tickerLeftRef, className: "absolute h-[5px] w-1/2 bg-white border border-black", style: { top: `${tickerTarget.left}%`, transition: `top ${tickerTransition.left}s ease-out` } })
40953
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: `h-full w-full text-xs text-center text-white`, style: { maxWidth: `${width}` }, children: [
40954
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex border border-gray-400 w-full h-[96%] rotate-180 scale-x-[-1]", children: [
40955
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { ref: fillerRef, className: "w-1/2 h-full", style: { background: "linear-gradient(180deg, rgba(0, 187, 0, 1) 0%, rgba(255, 162, 0, 1) 50%, rgba(255, 0, 0, 1) 100%)", borderRadius: "inherit" }, children: [
40956
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { ref: blockerLeftRef, className: "absolute bg-gray-200 dark:bg-[#18191d] bottom-0 w-1/2", style: { height: `${100 - volume[index3].left}%`, transition: "height 0.1s ease-out" } }),
40957
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { ref: tickerLeftRef, className: "absolute h-[5px] w-1/2 bg-white border border-black", style: { top: `${tickerTarget.left}%`, transition: `top ${tickerTransition.left}s ease-out` } })
41024
40958
  ] }),
41025
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "w-1/2 h-full", style: { background: "linear-gradient(180deg, rgba(0, 187, 0, 1) 0%, rgba(255, 162, 0, 1) 50%, rgba(255, 0, 0, 1) 100%)", borderRadius: "inherit" }, children: [
41026
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { ref: blockerRightRef, className: "absolute bg-gray-200 dark:bg-[#18191d] bottom-0 w-1/2", style: { height: `${100 - volume[index3].right}%`, transition: "height 0.1s ease-out" } }),
41027
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { ref: tickerRightRef, className: "absolute h-[5px] w-1/2 bg-white border border-black", style: { top: `${tickerTarget.right}%`, transition: `top ${tickerTransition.right}s ease-out` } })
40959
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "w-1/2 h-full", style: { background: "linear-gradient(180deg, rgba(0, 187, 0, 1) 0%, rgba(255, 162, 0, 1) 50%, rgba(255, 0, 0, 1) 100%)", borderRadius: "inherit" }, children: [
40960
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { ref: blockerRightRef, className: "absolute bg-gray-200 dark:bg-[#18191d] bottom-0 w-1/2", style: { height: `${100 - volume[index3].right}%`, transition: "height 0.1s ease-out" } }),
40961
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { ref: tickerRightRef, className: "absolute h-[5px] w-1/2 bg-white border border-black", style: { top: `${tickerTarget.right}%`, transition: `top ${tickerTransition.right}s ease-out` } })
41028
40962
  ] })
41029
40963
  ] }),
41030
40964
  index3 + 1