@viasoftbr/shared-ui 0.0.4 → 0.0.5

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,
@@ -25647,140 +25646,6 @@ function subscribeToWebsocket(url, onMessage) {
25647
25646
  };
25648
25647
  }
25649
25648
 
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
25649
  // src/services/registry.ts
25785
25650
  var PluginRegistryImpl = class {
25786
25651
  constructor() {
@@ -25878,7 +25743,7 @@ var saveConfig = async (payload, basePath = "./php") => {
25878
25743
  var import_jsx_runtime2 = require("react/jsx-runtime");
25879
25744
  var AuthContext = (0, import_react4.createContext)(void 0);
25880
25745
  function useAuth() {
25881
- const ctx = (0, import_react4.useContext)(AuthContext);
25746
+ const ctx = (0, import_react4.use)(AuthContext);
25882
25747
  if (!ctx)
25883
25748
  throw new Error("useAuth must be used within AuthProvider");
25884
25749
  return ctx;
@@ -25918,7 +25783,7 @@ var SkeletonBlock = ({ lines = 3, className = "" }) => {
25918
25783
  var import_jsx_runtime4 = require("react/jsx-runtime");
25919
25784
  var SectionContext = (0, import_react5.createContext)(void 0);
25920
25785
  function useSection() {
25921
- const ctx = (0, import_react5.useContext)(SectionContext);
25786
+ const ctx = (0, import_react5.use)(SectionContext);
25922
25787
  return ctx ?? { readonly: false };
25923
25788
  }
25924
25789
  var Section2 = ({ id, title, icon, expanded, onToggle, children, readonly, loading = false }) => {
@@ -25963,7 +25828,7 @@ var Section2 = ({ id, title, icon, expanded, onToggle, children, readonly, loadi
25963
25828
  overflow-hidden
25964
25829
  ${expanded ? "max-h-fit opacity-100" : "max-h-0 opacity-0"}
25965
25830
  `,
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 }) })
25831
+ 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
25832
  }
25968
25833
  )
25969
25834
  ] });
@@ -28122,7 +27987,7 @@ function m6(u16, t15) {
28122
27987
  }
28123
27988
 
28124
27989
  // 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);
27990
+ var React5 = __toESM(require("react"), 1);
28126
27991
  var import_react48 = require("react");
28127
27992
 
28128
27993
  // node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
@@ -28427,7 +28292,7 @@ function rectToClientRect(rect) {
28427
28292
  }
28428
28293
 
28429
28294
  // 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);
28295
+ var ReactDOM2 = __toESM(require("react-dom"), 1);
28431
28296
 
28432
28297
  // node_modules/.pnpm/@floating-ui+core@1.7.4/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
28433
28298
  function computeCoordsFromPlacement(_ref, placement, rtl) {
@@ -29630,9 +29495,9 @@ var computePosition2 = (reference, floating, options) => {
29630
29495
  };
29631
29496
 
29632
29497
  // 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);
29498
+ var React4 = __toESM(require("react"), 1);
29634
29499
  var import_react47 = require("react");
29635
- var ReactDOM2 = __toESM(require("react-dom"), 1);
29500
+ var ReactDOM = __toESM(require("react-dom"), 1);
29636
29501
  var isClient = typeof document !== "undefined";
29637
29502
  var noop2 = function noop3() {
29638
29503
  };
@@ -29697,7 +29562,7 @@ function roundByDPR(element, value) {
29697
29562
  return Math.round(value * dpr) / dpr;
29698
29563
  }
29699
29564
  function useLatestRef(value) {
29700
- const ref = React5.useRef(value);
29565
+ const ref = React4.useRef(value);
29701
29566
  index(() => {
29702
29567
  ref.current = value;
29703
29568
  });
@@ -29720,7 +29585,7 @@ function useFloating(options) {
29720
29585
  whileElementsMounted,
29721
29586
  open
29722
29587
  } = options;
29723
- const [data, setData] = React5.useState({
29588
+ const [data, setData] = React4.useState({
29724
29589
  x: 0,
29725
29590
  y: 0,
29726
29591
  strategy,
@@ -29728,19 +29593,19 @@ function useFloating(options) {
29728
29593
  middlewareData: {},
29729
29594
  isPositioned: false
29730
29595
  });
29731
- const [latestMiddleware, setLatestMiddleware] = React5.useState(middleware);
29596
+ const [latestMiddleware, setLatestMiddleware] = React4.useState(middleware);
29732
29597
  if (!deepEqual(latestMiddleware, middleware)) {
29733
29598
  setLatestMiddleware(middleware);
29734
29599
  }
29735
- const [_reference, _setReference] = React5.useState(null);
29736
- const [_floating, _setFloating] = React5.useState(null);
29737
- const setReference = React5.useCallback((node) => {
29600
+ const [_reference, _setReference] = React4.useState(null);
29601
+ const [_floating, _setFloating] = React4.useState(null);
29602
+ const setReference = React4.useCallback((node) => {
29738
29603
  if (node !== referenceRef.current) {
29739
29604
  referenceRef.current = node;
29740
29605
  _setReference(node);
29741
29606
  }
29742
29607
  }, []);
29743
- const setFloating = React5.useCallback((node) => {
29608
+ const setFloating = React4.useCallback((node) => {
29744
29609
  if (node !== floatingRef.current) {
29745
29610
  floatingRef.current = node;
29746
29611
  _setFloating(node);
@@ -29748,14 +29613,14 @@ function useFloating(options) {
29748
29613
  }, []);
29749
29614
  const referenceEl = externalReference || _reference;
29750
29615
  const floatingEl = externalFloating || _floating;
29751
- const referenceRef = React5.useRef(null);
29752
- const floatingRef = React5.useRef(null);
29753
- const dataRef = React5.useRef(data);
29616
+ const referenceRef = React4.useRef(null);
29617
+ const floatingRef = React4.useRef(null);
29618
+ const dataRef = React4.useRef(data);
29754
29619
  const hasWhileElementsMounted = whileElementsMounted != null;
29755
29620
  const whileElementsMountedRef = useLatestRef(whileElementsMounted);
29756
29621
  const platformRef = useLatestRef(platform2);
29757
29622
  const openRef = useLatestRef(open);
29758
- const update = React5.useCallback(() => {
29623
+ const update = React4.useCallback(() => {
29759
29624
  if (!referenceRef.current || !floatingRef.current) {
29760
29625
  return;
29761
29626
  }
@@ -29778,7 +29643,7 @@ function useFloating(options) {
29778
29643
  };
29779
29644
  if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
29780
29645
  dataRef.current = fullData;
29781
- ReactDOM2.flushSync(() => {
29646
+ ReactDOM.flushSync(() => {
29782
29647
  setData(fullData);
29783
29648
  });
29784
29649
  }
@@ -29793,7 +29658,7 @@ function useFloating(options) {
29793
29658
  }));
29794
29659
  }
29795
29660
  }, [open]);
29796
- const isMountedRef = React5.useRef(false);
29661
+ const isMountedRef = React4.useRef(false);
29797
29662
  index(() => {
29798
29663
  isMountedRef.current = true;
29799
29664
  return () => {
@@ -29812,17 +29677,17 @@ function useFloating(options) {
29812
29677
  update();
29813
29678
  }
29814
29679
  }, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
29815
- const refs = React5.useMemo(() => ({
29680
+ const refs = React4.useMemo(() => ({
29816
29681
  reference: referenceRef,
29817
29682
  floating: floatingRef,
29818
29683
  setReference,
29819
29684
  setFloating
29820
29685
  }), [setReference, setFloating]);
29821
- const elements = React5.useMemo(() => ({
29686
+ const elements = React4.useMemo(() => ({
29822
29687
  reference: referenceEl,
29823
29688
  floating: floatingEl
29824
29689
  }), [referenceEl, floatingEl]);
29825
- const floatingStyles = React5.useMemo(() => {
29690
+ const floatingStyles = React4.useMemo(() => {
29826
29691
  const initialStyles = {
29827
29692
  position: strategy,
29828
29693
  left: 0,
@@ -29848,7 +29713,7 @@ function useFloating(options) {
29848
29713
  top: y8
29849
29714
  };
29850
29715
  }, [strategy, transform, elements.floating, data.x, data.y]);
29851
- return React5.useMemo(() => ({
29716
+ return React4.useMemo(() => ({
29852
29717
  ...data,
29853
29718
  update,
29854
29719
  refs,
@@ -29875,12 +29740,12 @@ var size3 = (options, deps) => ({
29875
29740
 
29876
29741
  // 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
29742
  var SafeReact = {
29878
- ...React6
29743
+ ...React5
29879
29744
  };
29880
29745
  var useInsertionEffect = SafeReact.useInsertionEffect;
29881
29746
  var useSafeInsertionEffect = useInsertionEffect || ((fn) => fn());
29882
29747
  function useEffectEvent(callback) {
29883
- const ref = React6.useRef(() => {
29748
+ const ref = React5.useRef(() => {
29884
29749
  if (true) {
29885
29750
  throw new Error("Cannot call an event handler while rendering.");
29886
29751
  }
@@ -29888,7 +29753,7 @@ function useEffectEvent(callback) {
29888
29753
  useSafeInsertionEffect(() => {
29889
29754
  ref.current = callback;
29890
29755
  });
29891
- return React6.useCallback(function() {
29756
+ return React5.useCallback(function() {
29892
29757
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
29893
29758
  args[_key] = arguments[_key];
29894
29759
  }
@@ -29911,13 +29776,13 @@ var genId = () => (
29911
29776
  "floating-ui-" + Math.random().toString(36).slice(2, 6) + count++
29912
29777
  );
29913
29778
  function useFloatingId() {
29914
- const [id, setId] = React6.useState(() => serverHandoffComplete ? genId() : void 0);
29779
+ const [id, setId] = React5.useState(() => serverHandoffComplete ? genId() : void 0);
29915
29780
  index2(() => {
29916
29781
  if (id == null) {
29917
29782
  setId(genId());
29918
29783
  }
29919
29784
  }, []);
29920
- React6.useEffect(() => {
29785
+ React5.useEffect(() => {
29921
29786
  serverHandoffComplete = true;
29922
29787
  }, []);
29923
29788
  return id;
@@ -29968,13 +29833,13 @@ function createPubSub() {
29968
29833
  }
29969
29834
  };
29970
29835
  }
29971
- var FloatingNodeContext = /* @__PURE__ */ React6.createContext(null);
29972
- var FloatingTreeContext = /* @__PURE__ */ React6.createContext(null);
29836
+ var FloatingNodeContext = /* @__PURE__ */ React5.createContext(null);
29837
+ var FloatingTreeContext = /* @__PURE__ */ React5.createContext(null);
29973
29838
  var useFloatingParentNodeId = () => {
29974
29839
  var _React$useContext;
29975
- return ((_React$useContext = React6.useContext(FloatingNodeContext)) == null ? void 0 : _React$useContext.id) || null;
29840
+ return ((_React$useContext = React5.useContext(FloatingNodeContext)) == null ? void 0 : _React$useContext.id) || null;
29976
29841
  };
29977
- var useFloatingTree = () => React6.useContext(FloatingTreeContext);
29842
+ var useFloatingTree = () => React5.useContext(FloatingTreeContext);
29978
29843
  var FOCUSABLE_ATTRIBUTE = "data-floating-ui-focusable";
29979
29844
  function useFloatingRootContext(options) {
29980
29845
  const {
@@ -29983,8 +29848,8 @@ function useFloatingRootContext(options) {
29983
29848
  elements: elementsProp
29984
29849
  } = options;
29985
29850
  const floatingId = useId();
29986
- const dataRef = React6.useRef({});
29987
- const [events] = React6.useState(() => createPubSub());
29851
+ const dataRef = React5.useRef({});
29852
+ const [events] = React5.useState(() => createPubSub());
29988
29853
  const nested = useFloatingParentNodeId() != null;
29989
29854
  if (true) {
29990
29855
  const optionDomReference = elementsProp.reference;
@@ -29992,7 +29857,7 @@ function useFloatingRootContext(options) {
29992
29857
  error("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
29993
29858
  }
29994
29859
  }
29995
- const [positionReference, setPositionReference] = React6.useState(elementsProp.reference);
29860
+ const [positionReference, setPositionReference] = React5.useState(elementsProp.reference);
29996
29861
  const onOpenChange = useEffectEvent((open2, event, reason) => {
29997
29862
  dataRef.current.openEvent = open2 ? event : void 0;
29998
29863
  events.emit("openchange", {
@@ -30003,15 +29868,15 @@ function useFloatingRootContext(options) {
30003
29868
  });
30004
29869
  onOpenChangeProp == null || onOpenChangeProp(open2, event, reason);
30005
29870
  });
30006
- const refs = React6.useMemo(() => ({
29871
+ const refs = React5.useMemo(() => ({
30007
29872
  setPositionReference
30008
29873
  }), []);
30009
- const elements = React6.useMemo(() => ({
29874
+ const elements = React5.useMemo(() => ({
30010
29875
  reference: positionReference || elementsProp.reference || null,
30011
29876
  floating: elementsProp.floating || null,
30012
29877
  domReference: elementsProp.reference
30013
29878
  }), [positionReference, elementsProp.reference, elementsProp.floating]);
30014
- return React6.useMemo(() => ({
29879
+ return React5.useMemo(() => ({
30015
29880
  dataRef,
30016
29881
  open,
30017
29882
  onOpenChange,
@@ -30038,11 +29903,11 @@ function useFloating2(options) {
30038
29903
  });
30039
29904
  const rootContext = options.rootContext || internalRootContext;
30040
29905
  const computedElements = rootContext.elements;
30041
- const [_domReference, setDomReference] = React6.useState(null);
30042
- const [positionReference, _setPositionReference] = React6.useState(null);
29906
+ const [_domReference, setDomReference] = React5.useState(null);
29907
+ const [positionReference, _setPositionReference] = React5.useState(null);
30043
29908
  const optionDomReference = computedElements == null ? void 0 : computedElements.domReference;
30044
29909
  const domReference = optionDomReference || _domReference;
30045
- const domReferenceRef = React6.useRef(null);
29910
+ const domReferenceRef = React5.useRef(null);
30046
29911
  const tree = useFloatingTree();
30047
29912
  index2(() => {
30048
29913
  if (domReference) {
@@ -30058,7 +29923,7 @@ function useFloating2(options) {
30058
29923
  }
30059
29924
  }
30060
29925
  });
30061
- const setPositionReference = React6.useCallback((node) => {
29926
+ const setPositionReference = React5.useCallback((node) => {
30062
29927
  const computedPositionReference = isElement(node) ? {
30063
29928
  getBoundingClientRect: () => node.getBoundingClientRect(),
30064
29929
  contextElement: node
@@ -30066,7 +29931,7 @@ function useFloating2(options) {
30066
29931
  _setPositionReference(computedPositionReference);
30067
29932
  position.refs.setReference(computedPositionReference);
30068
29933
  }, [position.refs]);
30069
- const setReference = React6.useCallback((node) => {
29934
+ const setReference = React5.useCallback((node) => {
30070
29935
  if (isElement(node) || node === null) {
30071
29936
  domReferenceRef.current = node;
30072
29937
  setDomReference(node);
@@ -30078,17 +29943,17 @@ function useFloating2(options) {
30078
29943
  position.refs.setReference(node);
30079
29944
  }
30080
29945
  }, [position.refs]);
30081
- const refs = React6.useMemo(() => ({
29946
+ const refs = React5.useMemo(() => ({
30082
29947
  ...position.refs,
30083
29948
  setReference,
30084
29949
  setPositionReference,
30085
29950
  domReference: domReferenceRef
30086
29951
  }), [position.refs, setReference, setPositionReference]);
30087
- const elements = React6.useMemo(() => ({
29952
+ const elements = React5.useMemo(() => ({
30088
29953
  ...position.elements,
30089
29954
  domReference
30090
29955
  }), [position.elements, domReference]);
30091
- const context = React6.useMemo(() => ({
29956
+ const context = React5.useMemo(() => ({
30092
29957
  ...position,
30093
29958
  ...rootContext,
30094
29959
  refs,
@@ -30102,7 +29967,7 @@ function useFloating2(options) {
30102
29967
  node.context = context;
30103
29968
  }
30104
29969
  });
30105
- return React6.useMemo(() => ({
29970
+ return React5.useMemo(() => ({
30106
29971
  ...position,
30107
29972
  context,
30108
29973
  refs,
@@ -30174,22 +30039,22 @@ function useInteractions(propsList) {
30174
30039
  const referenceDeps = propsList.map((key) => key == null ? void 0 : key.reference);
30175
30040
  const floatingDeps = propsList.map((key) => key == null ? void 0 : key.floating);
30176
30041
  const itemDeps = propsList.map((key) => key == null ? void 0 : key.item);
30177
- const getReferenceProps = React6.useCallback(
30042
+ const getReferenceProps = React5.useCallback(
30178
30043
  (userProps) => mergeProps(userProps, propsList, "reference"),
30179
30044
  // eslint-disable-next-line react-hooks/exhaustive-deps
30180
30045
  referenceDeps
30181
30046
  );
30182
- const getFloatingProps = React6.useCallback(
30047
+ const getFloatingProps = React5.useCallback(
30183
30048
  (userProps) => mergeProps(userProps, propsList, "floating"),
30184
30049
  // eslint-disable-next-line react-hooks/exhaustive-deps
30185
30050
  floatingDeps
30186
30051
  );
30187
- const getItemProps = React6.useCallback(
30052
+ const getItemProps = React5.useCallback(
30188
30053
  (userProps) => mergeProps(userProps, propsList, "item"),
30189
30054
  // eslint-disable-next-line react-hooks/exhaustive-deps
30190
30055
  itemDeps
30191
30056
  );
30192
- return React6.useMemo(() => ({
30057
+ return React5.useMemo(() => ({
30193
30058
  getReferenceProps,
30194
30059
  getFloatingProps,
30195
30060
  getItemProps
@@ -30260,7 +30125,7 @@ var inner = (props) => ({
30260
30125
  scrollEl.scrollTop = diffY;
30261
30126
  if (onFallbackChange) {
30262
30127
  const shouldFallback = scrollEl.offsetHeight < item.offsetHeight * min(minItemsVisible, listRef.current.length) - 1 || refOverflow.top >= -referenceOverflowThreshold || refOverflow.bottom >= -referenceOverflowThreshold;
30263
- ReactDOM3.flushSync(() => onFallbackChange(shouldFallback));
30128
+ ReactDOM2.flushSync(() => onFallbackChange(shouldFallback));
30264
30129
  }
30265
30130
  if (overflowRef) {
30266
30131
  overflowRef.current = await detectOverflow2(getArgsWithCustomFloatingHeight({
@@ -30285,10 +30150,10 @@ function useInnerOffset(context, props) {
30285
30150
  onChange: unstable_onChange
30286
30151
  } = props;
30287
30152
  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(() => {
30153
+ const controlledScrollingRef = React5.useRef(false);
30154
+ const prevScrollTopRef = React5.useRef(null);
30155
+ const initialOverflowRef = React5.useRef(null);
30156
+ React5.useEffect(() => {
30292
30157
  if (!enabled)
30293
30158
  return;
30294
30159
  function onWheel(e10) {
@@ -30306,7 +30171,7 @@ function useInnerOffset(context, props) {
30306
30171
  }
30307
30172
  if (!isAtTop && dY > 0 || !isAtBottom && dY < 0) {
30308
30173
  e10.preventDefault();
30309
- ReactDOM3.flushSync(() => {
30174
+ ReactDOM2.flushSync(() => {
30310
30175
  onChange((d9) => d9 + Math[method](dY, remainingScroll * sign));
30311
30176
  });
30312
30177
  } else if (/firefox/i.test(getUserAgent())) {
@@ -30331,7 +30196,7 @@ function useInnerOffset(context, props) {
30331
30196
  };
30332
30197
  }
30333
30198
  }, [enabled, open, elements.floating, overflowRef, scrollRef, onChange]);
30334
- const floating = React6.useMemo(() => ({
30199
+ const floating = React5.useMemo(() => ({
30335
30200
  onKeyDown() {
30336
30201
  controlledScrollingRef.current = true;
30337
30202
  },
@@ -30349,7 +30214,7 @@ function useInnerOffset(context, props) {
30349
30214
  if (prevScrollTopRef.current !== null) {
30350
30215
  const scrollDiff = el.scrollTop - prevScrollTopRef.current;
30351
30216
  if (overflowRef.current.bottom < -0.5 && scrollDiff < -1 || overflowRef.current.top < -0.5 && scrollDiff > 1) {
30352
- ReactDOM3.flushSync(() => onChange((d9) => d9 + scrollDiff));
30217
+ ReactDOM2.flushSync(() => onChange((d9) => d9 + scrollDiff));
30353
30218
  }
30354
30219
  }
30355
30220
  requestAnimationFrame(() => {
@@ -30357,7 +30222,7 @@ function useInnerOffset(context, props) {
30357
30222
  });
30358
30223
  }
30359
30224
  }), [elements.floating, onChange, overflowRef, scrollRef]);
30360
- return React6.useMemo(() => enabled ? {
30225
+ return React5.useMemo(() => enabled ? {
30361
30226
  floating
30362
30227
  } : {}, [enabled, floating]);
30363
30228
  }
@@ -32860,7 +32725,8 @@ var normalizeDvBData = (data) => {
32860
32725
  protocol: parseProtocolUrl(data.output_url || defaultProtocolSettings.ffurl)
32861
32726
  };
32862
32727
  };
32863
- var DvB = (0, import_react74.forwardRef)(function DvB2({ settings, setSettings, encoderId, isLoading, setIsLoading }, ref) {
32728
+ var DvB = function DvB2(props) {
32729
+ const { settings, setSettings, encoderId, isLoading, setIsLoading, ref } = props;
32864
32730
  const [internalSettings, setInternalSettings] = (0, import_react74.useState)(defaultDvBSettings);
32865
32731
  const [expandedSections, setExpandedSections] = (0, import_react74.useState)({
32866
32732
  video: true,
@@ -32921,13 +32787,33 @@ var DvB = (0, import_react74.forwardRef)(function DvB2({ settings, setSettings,
32921
32787
  newTracks[idx] = { label: newTracks[idx].label, value: !newTracks[idx].value };
32922
32788
  setTracks(newTracks);
32923
32789
  };
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
- }));
32790
+ (0, import_react74.useEffect)(() => {
32791
+ if (!ref)
32792
+ return;
32793
+ const impl = {
32794
+ getSettings: () => ({ ...effectiveSettings, output_url: buildProtocolUrl(effectiveSettings.protocol) }),
32795
+ reset: () => {
32796
+ effectiveSetSettings(savedSettings);
32797
+ },
32798
+ isDirty: () => JSON.stringify(effectiveSettings) !== JSON.stringify(savedSettings)
32799
+ };
32800
+ try {
32801
+ if (typeof ref === "function")
32802
+ ref(impl);
32803
+ else if ("current" in ref)
32804
+ ref.current = impl;
32805
+ } catch {
32806
+ }
32807
+ return () => {
32808
+ try {
32809
+ if (typeof ref === "function")
32810
+ ref(null);
32811
+ else if ("current" in ref)
32812
+ ref.current = null;
32813
+ } catch {
32814
+ }
32815
+ };
32816
+ }, [ref, effectiveSettings, savedSettings, effectiveSetSettings]);
32931
32817
  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
32818
  /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(VideoGroup_default, { expanded: expandedSections.video, onToggle: toggleSection, loading: isLoading ?? false, children: [
32933
32819
  /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { children: [
@@ -33274,7 +33160,7 @@ var DvB = (0, import_react74.forwardRef)(function DvB2({ settings, setSettings,
33274
33160
  }
33275
33161
  )
33276
33162
  ] });
33277
- });
33163
+ };
33278
33164
  var DvB_default = DvB;
33279
33165
 
33280
33166
  // src/components/encoder/Livecast.tsx
@@ -33402,7 +33288,8 @@ var normalizeLivecastData = (data) => {
33402
33288
  protocol: parsed
33403
33289
  };
33404
33290
  };
33405
- var Livecast = (0, import_react75.forwardRef)(function Livecast2({ settings, setSettings, encoderId, isLoading, setIsLoading }, ref) {
33291
+ var Livecast = function Livecast2(props) {
33292
+ const { settings, setSettings, encoderId, isLoading, setIsLoading, ref } = props;
33406
33293
  const [expandedSections, setExpandedSections] = (0, import_react75.useState)({
33407
33294
  video: true,
33408
33295
  audio: false,
@@ -33458,16 +33345,33 @@ var Livecast = (0, import_react75.forwardRef)(function Livecast2({ settings, set
33458
33345
  const next = { ...effectiveSettings, [key]: !effectiveSettings[key] };
33459
33346
  effectiveSetSettings(next);
33460
33347
  };
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
- }));
33348
+ (0, import_react75.useEffect)(() => {
33349
+ if (!ref)
33350
+ return;
33351
+ const impl = {
33352
+ getSettings: () => ({ ...effectiveSettings, send_url: buildProtocolUrl2(effectiveSettings.protocol) }),
33353
+ reset: () => {
33354
+ effectiveSetSettings(savedSettings);
33355
+ },
33356
+ isDirty: () => JSON.stringify(effectiveSettings) !== JSON.stringify(savedSettings)
33357
+ };
33358
+ try {
33359
+ if (typeof ref === "function")
33360
+ ref(impl);
33361
+ else if ("current" in ref)
33362
+ ref.current = impl;
33363
+ } catch {
33364
+ }
33365
+ return () => {
33366
+ try {
33367
+ if (typeof ref === "function")
33368
+ ref(null);
33369
+ else if ("current" in ref)
33370
+ ref.current = null;
33371
+ } catch {
33372
+ }
33373
+ };
33374
+ }, [ref, effectiveSettings, savedSettings, effectiveSetSettings]);
33471
33375
  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
33376
  /* @__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
33377
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
@@ -33618,7 +33522,7 @@ var Livecast = (0, import_react75.forwardRef)(function Livecast2({ settings, set
33618
33522
  }
33619
33523
  )
33620
33524
  ] });
33621
- });
33525
+ };
33622
33526
  var Livecast_default = Livecast;
33623
33527
 
33624
33528
  // src/components/encoder/ViewLog.tsx
@@ -34405,7 +34309,7 @@ var import_react80 = require("react");
34405
34309
  var import_jsx_runtime25 = require("react/jsx-runtime");
34406
34310
  var ThemeContext = (0, import_react80.createContext)(void 0);
34407
34311
  function useTheme() {
34408
- const context = (0, import_react80.useContext)(ThemeContext);
34312
+ const context = (0, import_react80.use)(ThemeContext);
34409
34313
  if (context === void 0) {
34410
34314
  throw new Error("useTheme must be used within a ThemeProvider");
34411
34315
  }
@@ -39074,7 +38978,7 @@ var dir = instance.dir;
39074
38978
  var init = instance.init;
39075
38979
  var loadResources = instance.loadResources;
39076
38980
  var reloadResources = instance.reloadResources;
39077
- var use = instance.use;
38981
+ var use4 = instance.use;
39078
38982
  var changeLanguage = instance.changeLanguage;
39079
38983
  var getFixedT = instance.getFixedT;
39080
38984
  var t14 = instance.t;
@@ -40358,48 +40262,13 @@ var ConfigWizard = ({ basePath = "./config-xcoder-wizard/php", onComplete }) =>
40358
40262
  };
40359
40263
  var Wizard_default = ConfigWizard;
40360
40264
 
40361
- // src/components/RemoteModule.tsx
40265
+ // src/components/xcoder/Fflog.tsx
40362
40266
  var import_react106 = require("react");
40363
40267
  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
40268
  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)(() => {
40269
+ const [message, setMessage] = (0, import_react106.useState)("");
40270
+ const [tooltip, setTooltip] = (0, import_react106.useState)("Copy to Clipboard");
40271
+ (0, import_react106.useEffect)(() => {
40403
40272
  const cleanupSocket = subscribeToWebsocket(buildWsUrl("/ws"), (data) => {
40404
40273
  const aux = data?.logs[index3 - 1];
40405
40274
  setMessage(aux.log);
@@ -40412,7 +40281,7 @@ var Fflog = ({ index: index3 }) => {
40412
40281
  cleanupSocket();
40413
40282
  };
40414
40283
  }, []);
40415
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
40284
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
40416
40285
  "div",
40417
40286
  {
40418
40287
  "data-tooltip-id": "tooltip",
@@ -40427,8 +40296,8 @@ var Fflog = ({ index: index3 }) => {
40427
40296
  },
40428
40297
  onMouseLeave: () => message == "" ? setTooltip("Copy to Clipboard") : "",
40429
40298
  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 })
40299
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(M10, { id: "tooltip" }),
40300
+ /* @__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
40301
  ]
40433
40302
  }
40434
40303
  );
@@ -40436,7 +40305,7 @@ var Fflog = ({ index: index3 }) => {
40436
40305
  var Fflog_default = Fflog;
40437
40306
 
40438
40307
  // src/components/xcoder/Metrics.tsx
40439
- var import_jsx_runtime45 = require("react/jsx-runtime");
40308
+ var import_jsx_runtime44 = require("react/jsx-runtime");
40440
40309
  var MetricBar = ({ label, value, suffix, color }) => {
40441
40310
  const colorClasses = {
40442
40311
  blue: "bg-blue-500",
@@ -40445,15 +40314,15 @@ var MetricBar = ({ label, value, suffix, color }) => {
40445
40314
  cyan: "bg-cyan-500",
40446
40315
  pink: "bg-pink-500"
40447
40316
  };
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: [
40317
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "space-y-1", children: [
40318
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex items-center justify-between text-sm", children: [
40319
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "text-gray-900 dark:text-slate-400", children: label }),
40320
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: "text-gray-900 dark:text-white font-mono", children: [
40452
40321
  Math.round(value),
40453
40322
  suffix
40454
40323
  ] })
40455
40324
  ] }),
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)(
40325
+ /* @__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
40326
  "div",
40458
40327
  {
40459
40328
  className: `h-full transition-all duration-300 ${colorClasses[color]}`,
@@ -40465,8 +40334,8 @@ var MetricBar = ({ label, value, suffix, color }) => {
40465
40334
  var Metrics_default = MetricBar;
40466
40335
 
40467
40336
  // src/components/xcoder/Panel.tsx
40468
- var import_react108 = require("react");
40469
- var import_jsx_runtime46 = require("react/jsx-runtime");
40337
+ var import_react107 = require("react");
40338
+ var import_jsx_runtime45 = require("react/jsx-runtime");
40470
40339
  var convertServiceToOption = (serviceString) => {
40471
40340
  const match = serviceString.match(/^([^@]+)@/);
40472
40341
  if (!match) {
@@ -40480,12 +40349,12 @@ var convertServiceToOption = (serviceString) => {
40480
40349
  return { label, value: rawValue };
40481
40350
  };
40482
40351
  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)(() => {
40352
+ const [status, setStatus] = (0, import_react107.useState)("idle");
40353
+ const [modes, setModes] = (0, import_react107.useState)([]);
40354
+ const [oldModes, setOldModes] = (0, import_react107.useState)(modes);
40355
+ const [open, setOpen] = (0, import_react107.useState)(false);
40356
+ const [optionsList, setOptionsList] = (0, import_react107.useState)([]);
40357
+ (0, import_react107.useEffect)(() => {
40489
40358
  const cleanupSocket = subscribeToWebsocket(buildWsUrl("/"), (data) => {
40490
40359
  setStatus(data?.services[`xcoder_${index3}`].status);
40491
40360
  });
@@ -40519,52 +40388,52 @@ var EncoderDecoderPanel = ({ index: index3 }) => {
40519
40388
  m: state ? "stop" : "start"
40520
40389
  });
40521
40390
  };
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: [
40391
+ 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: [
40392
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "px-6 py-3 border-b border-slate-800 flex items-center justify-between", children: [
40393
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-center gap-3", children: [
40394
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Radio, { className: "w-5 h-5 text-blue-500" }),
40395
+ /* @__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
40396
  "Xcoder BMD Video Interface (",
40528
40397
  index3,
40529
40398
  ")"
40530
40399
  ] }) })
40531
40400
  ] }),
40532
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex items-center gap-4", children: [
40533
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
40401
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-center gap-4", children: [
40402
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
40534
40403
  "button",
40535
40404
  {
40536
40405
  onClick: () => startStop(status == "running"),
40537
40406
  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" }),
40407
+ children: status == "running" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
40408
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Pause, { className: "w-4 h-4" }),
40540
40409
  "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" }),
40410
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
40411
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Play, { className: "w-4 h-4" }),
40543
40412
  "Start"
40544
40413
  ] })
40545
40414
  }
40546
40415
  ),
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" })
40416
+ /* @__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: [
40417
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: `w-2 h-2 rounded-full bg-white ${status == "running" ? "block" : "hidden"}` }),
40418
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "text-sm text-slate-100 font-mono font-bold", children: status == "running" ? "READY" : "STANDBY" })
40550
40419
  ] }),
40551
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
40420
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
40552
40421
  "button",
40553
40422
  {
40554
40423
  onClick: () => setOpen(true),
40555
40424
  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" })
40425
+ children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Settings, { className: "w-5 h-5 text-slate-400 hover:text-blue-400" })
40557
40426
  }
40558
40427
  )
40559
40428
  ] })
40560
40429
  ] }),
40561
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
40430
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
40562
40431
  Modal_default,
40563
40432
  {
40564
40433
  open,
40565
40434
  setOpen,
40566
40435
  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)(
40436
+ 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
40437
  SelectField_default,
40569
40438
  {
40570
40439
  label: "New Mode",
@@ -40585,15 +40454,15 @@ var EncoderDecoderPanel = ({ index: index3 }) => {
40585
40454
  }
40586
40455
  }
40587
40456
  ),
40588
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "p-6", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Preview_default, { index: index3, setVuPts: () => {
40457
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "p-6", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Preview_default, { index: index3, setVuPts: () => {
40589
40458
  } }) })
40590
40459
  ] });
40591
40460
  };
40592
40461
  var Panel_default = EncoderDecoderPanel;
40593
40462
 
40594
40463
  // src/components/xcoder/Preview.tsx
40595
- var import_react109 = require("react");
40596
- var import_jsx_runtime47 = require("react/jsx-runtime");
40464
+ var import_react108 = require("react");
40465
+ var import_jsx_runtime46 = require("react/jsx-runtime");
40597
40466
  var Preview = ({
40598
40467
  index: index3,
40599
40468
  setVuPts,
@@ -40602,9 +40471,9 @@ var Preview = ({
40602
40471
  showStreamControl = false,
40603
40472
  orientation = "horizontal"
40604
40473
  }) => {
40605
- const logEndRef = (0, import_react109.useRef)(null);
40606
- const [message, setMessage] = (0, import_react109.useState)([]);
40607
- (0, import_react109.useEffect)(() => {
40474
+ const logEndRef = (0, import_react108.useRef)(null);
40475
+ const [message, setMessage] = (0, import_react108.useState)([]);
40476
+ (0, import_react108.useEffect)(() => {
40608
40477
  const cleanupSocket = subscribeToWebsocket(buildWsUrl("/"), (data) => {
40609
40478
  const aux = data?.services[`xcoder_${index3}`];
40610
40479
  setMessage(aux.decklinkEvents.split("\n"));
@@ -40613,22 +40482,22 @@ var Preview = ({
40613
40482
  cleanupSocket();
40614
40483
  };
40615
40484
  }, []);
40616
- (0, import_react109.useEffect)(() => {
40485
+ (0, import_react108.useEffect)(() => {
40617
40486
  if (logEndRef.current) {
40618
40487
  logEndRef.current.scrollTop = logEndRef.current.scrollHeight;
40619
40488
  }
40620
40489
  }, [message]);
40621
- const [vuChannels, setVuChannels] = (0, import_react109.useState)(
40490
+ const [vuChannels, setVuChannels] = (0, import_react108.useState)(
40622
40491
  Array(8).fill({ left: 0, right: 0 })
40623
40492
  );
40624
40493
  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}`));
40494
+ const vuBars = (0, import_react108.useMemo)(() => {
40495
+ return Array.from({ length: channelCount }, (_7, i14) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(VUMeter_default, { index: i14, volume: vuChannels }, `vu-bar-${i14}`));
40627
40496
  }, [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)(() => {
40497
+ const playerRef = (0, import_react108.useRef)(null);
40498
+ const vuRef = (0, import_react108.useRef)(null);
40499
+ const [height, setHeight] = (0, import_react108.useState)("auto");
40500
+ (0, import_react108.useLayoutEffect)(() => {
40632
40501
  const p8 = playerRef.current;
40633
40502
  const v6 = vuRef.current;
40634
40503
  if (p8 && p8 != null && v6 && v6 != null) {
@@ -40642,15 +40511,15 @@ var Preview = ({
40642
40511
  }
40643
40512
  ;
40644
40513
  }, []);
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)(
40514
+ const [isOpen, setIsOpen] = (0, import_react108.useState)(false);
40515
+ 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));
40516
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: `"w-full h-full" ${orientation === "horizontal" ? "" : "py-6"}`, children: [
40517
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
40649
40518
  "div",
40650
40519
  {
40651
40520
  className: `grid gap-6 mb-5 ${orientation === "horizontal" ? "grid-cols-[1fr_300px] items-start" : "grid-cols-1"}`,
40652
40521
  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)(
40522
+ /* @__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
40523
  VideoPlayer_default,
40655
40524
  {
40656
40525
  pgmIndex: index3,
@@ -40659,10 +40528,10 @@ var Preview = ({
40659
40528
  setVuChannels
40660
40529
  }
40661
40530
  ) }) }),
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)(
40531
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: `flex flex-col ${orientation === "horizontal" ? "h-full" : "h-[200px]"}`, children: [
40532
+ /* @__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 }) }),
40533
+ showStreamControl && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(StreamControl_default, { index: index3 }),
40534
+ 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
40535
  "div",
40667
40536
  {
40668
40537
  ref: logEndRef,
@@ -40673,7 +40542,7 @@ var Preview = ({
40673
40542
  style: { height },
40674
40543
  onClick: () => setIsOpen(true),
40675
40544
  children: [
40676
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(M10, { id: "tooltip" }),
40545
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(M10, { id: "tooltip" }),
40677
40546
  logData
40678
40547
  ]
40679
40548
  }
@@ -40682,15 +40551,15 @@ var Preview = ({
40682
40551
  ]
40683
40552
  }
40684
40553
  ),
40685
- showFflog && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Fflog_default, { index: index3 }),
40686
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
40554
+ showFflog && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Fflog_default, { index: index3 }),
40555
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
40687
40556
  Modal_default,
40688
40557
  {
40689
40558
  open: isOpen,
40690
40559
  setOpen: () => setIsOpen(!isOpen),
40691
40560
  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" }),
40561
+ element: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "custom-scroll overflow-y-auto p-3 h-[300px]", children: logData }),
40562
+ icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FileClock, { "aria-hidden": "true", className: "size-6 text-yellow-600" }),
40694
40563
  positiveLabel: "Copy",
40695
40564
  positiveCommand: () => {
40696
40565
  navigator.clipboard.writeText(message.join("\n"));
@@ -40702,11 +40571,11 @@ var Preview = ({
40702
40571
  var Preview_default = Preview;
40703
40572
 
40704
40573
  // src/components/xcoder/StreamControl.tsx
40705
- var import_react110 = require("react");
40706
- var import_jsx_runtime48 = require("react/jsx-runtime");
40574
+ var import_react109 = require("react");
40575
+ var import_jsx_runtime47 = require("react/jsx-runtime");
40707
40576
  var StreamControl = ({ index: index3 }) => {
40708
- const [bufferValue, setBufferValue] = (0, import_react110.useState)(0);
40709
- const [syncValue, setSyncValue] = (0, import_react110.useState)(0);
40577
+ const [bufferValue, setBufferValue] = (0, import_react109.useState)(0);
40578
+ const [syncValue, setSyncValue] = (0, import_react109.useState)(0);
40710
40579
  const minBuffer = 0;
40711
40580
  const maxBuffer = 100;
40712
40581
  const minSync = -30;
@@ -40719,45 +40588,45 @@ var StreamControl = ({ index: index3 }) => {
40719
40588
  true,
40720
40589
  1e3
40721
40590
  );
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" })
40591
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "w-80 space-y-3", children: [
40592
+ /* @__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: [
40593
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "space-y-1", children: [
40594
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex gap-2", children: [
40595
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "font-medium", children: "Service Name:" }),
40596
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "truncate", children: data?.service_name ?? "\u2014" })
40728
40597
  ] }),
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" })
40598
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex gap-2", children: [
40599
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "font-medium", children: "Service Provider:" }),
40600
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "truncate", children: data?.service_provider ?? "\u2014" })
40732
40601
  ] })
40733
40602
  ] }),
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: [
40603
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "space-y-1.5 pt-2", children: [
40604
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex items-center gap-2", children: [
40605
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Video, { className: "w-4 h-4 text-sky-400" }),
40606
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { className: "truncate", children: [
40738
40607
  "Video 0: ",
40739
40608
  data?.input_streans[1].input_stream.type
40740
40609
  ] })
40741
40610
  ] }),
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: [
40611
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex items-center gap-2", children: [
40612
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Volume2, { className: "w-4 h-4 text-emerald-400" }),
40613
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { className: "truncate", children: [
40745
40614
  "Audio 1: ",
40746
40615
  data?.input_streans[0].input_stream.type
40747
40616
  ] })
40748
40617
  ] })
40749
40618
  ] })
40750
40619
  ] }) }),
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: [
40620
+ /* @__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: [
40621
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SliderField_default, { value: bufferValue, setValue: setBufferValue, label: "Fifo Size:", min: minBuffer, max: maxBuffer }),
40622
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SliderField_default, { value: syncValue, setValue: setSyncValue, label: "A/V Sync:", min: minSync, max: maxSync, content: ["<", ">"], step: 10 }),
40623
+ /* @__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: [
40624
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { children: [
40756
40625
  "Buffer: ",
40757
40626
  bufferValue,
40758
40627
  " frames"
40759
40628
  ] }),
40760
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { children: [
40629
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { children: [
40761
40630
  "Sync: ",
40762
40631
  syncValue > 0 ? "+" : "",
40763
40632
  syncValue,
@@ -40770,8 +40639,8 @@ var StreamControl = ({ index: index3 }) => {
40770
40639
  var StreamControl_default = StreamControl;
40771
40640
 
40772
40641
  // src/components/xcoder/VideoPlayer.tsx
40773
- var import_react111 = require("react");
40774
- var import_jsx_runtime49 = require("react/jsx-runtime");
40642
+ var import_react110 = require("react");
40643
+ var import_jsx_runtime48 = require("react/jsx-runtime");
40775
40644
  var import_meta2 = {};
40776
40645
  var VideoPlayer = ({
40777
40646
  pgmIndex,
@@ -40779,11 +40648,11 @@ var VideoPlayer = ({
40779
40648
  setVuPts,
40780
40649
  setVuChannels
40781
40650
  }) => {
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)(() => {
40651
+ const dummyCanvas = (0, import_react110.useMemo)(() => document.createElement("canvas"), []);
40652
+ const videoRef = (0, import_react110.useRef)(dummyCanvas);
40653
+ const prevRawChannelsRef = (0, import_react110.useRef)(null);
40654
+ const playerRef = (0, import_react110.useRef)(null);
40655
+ (0, import_react110.useEffect)(() => {
40787
40656
  let cancelled = false;
40788
40657
  if (!videoRef.current) {
40789
40658
  console.warn("Video canvas not ready yet");
@@ -40904,7 +40773,7 @@ var VideoPlayer = ({
40904
40773
  initPlayer();
40905
40774
  }
40906
40775
  }, [pgmIndex]);
40907
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
40776
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
40908
40777
  "canvas",
40909
40778
  {
40910
40779
  ref: videoRef,
@@ -40915,21 +40784,21 @@ var VideoPlayer = ({
40915
40784
  var VideoPlayer_default = VideoPlayer;
40916
40785
 
40917
40786
  // src/components/xcoder/VUMeter.tsx
40918
- var import_react112 = require("react");
40919
- var import_jsx_runtime50 = require("react/jsx-runtime");
40787
+ var import_react111 = require("react");
40788
+ var import_jsx_runtime49 = require("react/jsx-runtime");
40920
40789
  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)({
40790
+ const [tickerTarget, setTickerTarget] = (0, import_react111.useState)({ left: 0, right: 0 });
40791
+ const [tickerTransition, setTickerTransition] = (0, import_react111.useState)({
40923
40792
  left: 0,
40924
40793
  right: 0
40925
40794
  });
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)(() => {
40795
+ const [resetVUTimeout, setResetVUTimeout] = (0, import_react111.useState)(0);
40796
+ const tickerLeftRef = (0, import_react111.useRef)(null);
40797
+ const tickerRightRef = (0, import_react111.useRef)(null);
40798
+ const blockerLeftRef = (0, import_react111.useRef)(null);
40799
+ const blockerRightRef = (0, import_react111.useRef)(null);
40800
+ const fillerRef = (0, import_react111.useRef)(null);
40801
+ const calcVolume = (0, import_react111.useCallback)(() => {
40933
40802
  try {
40934
40803
  const fillerRect = fillerRef.current?.getBoundingClientRect();
40935
40804
  const blockerLeftRect = blockerLeftRef.current?.getBoundingClientRect();
@@ -40978,7 +40847,7 @@ var VUBar = ({ index: index3, volume, width = "15px", displayMarks = false }) =>
40978
40847
  } catch (e10) {
40979
40848
  }
40980
40849
  }, []);
40981
- (0, import_react112.useEffect)(() => {
40850
+ (0, import_react111.useEffect)(() => {
40982
40851
  calcVolume();
40983
40852
  if (resetVUTimeout) {
40984
40853
  clearTimeout(resetVUTimeout);
@@ -40993,9 +40862,9 @@ var VUBar = ({ index: index3, volume, width = "15px", displayMarks = false }) =>
40993
40862
  const MIN_DB = -70;
40994
40863
  const MAX_DB = 0;
40995
40864
  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)(
40865
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex w-full h-full justify-center", children: [
40866
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: displayMarks ? "mt-[60px]" : "hidden", children: measures.map((db) => {
40867
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
40999
40868
  "div",
41000
40869
  {
41001
40870
  style: { marginBottom: `${(db - MIN_DB) / (MAX_DB - MIN_DB) * 100}px`, marginRight: "25px", textAlignLast: "center" },
@@ -41016,15 +40885,15 @@ var VUBar = ({ index: index3, volume, width = "15px", displayMarks = false }) =>
41016
40885
  db
41017
40886
  );
41018
40887
  }) }),
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` } })
40888
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: `h-full w-full text-xs text-center text-white`, style: { maxWidth: `${width}` }, children: [
40889
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex border border-gray-400 w-full h-[96%] rotate-180 scale-x-[-1]", children: [
40890
+ /* @__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: [
40891
+ /* @__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" } }),
40892
+ /* @__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
40893
  ] }),
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` } })
40894
+ /* @__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: [
40895
+ /* @__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" } }),
40896
+ /* @__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
40897
  ] })
41029
40898
  ] }),
41030
40899
  index3 + 1