@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.
- package/dist/components/encoder/DvB.d.ts +5 -2
- package/dist/components/encoder/Livecast.d.ts +4 -2
- package/dist/components/index.d.ts +1 -2
- package/dist/components.cjs +247 -378
- package/dist/components.js +261 -392
- package/dist/context/AuthContext.d.ts +10 -2
- package/dist/context/ThemeContext.d.ts +3 -1
- package/dist/context/index.d.ts +3 -3
- package/dist/context.cjs +51 -90
- package/dist/context.js +54 -93
- package/dist/hooks.cjs +0 -73
- package/dist/hooks.js +0 -63
- package/dist/index.cjs +310 -420
- package/dist/index.js +319 -429
- package/dist/services/index.d.ts +0 -2
- package/dist/services.cjs +0 -147
- package/dist/services.js +0 -137
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -123,6 +123,7 @@ __export(src_exports, {
|
|
|
123
123
|
Accordion: () => Accordion_default,
|
|
124
124
|
AddNetwork: () => AddNetwork_default,
|
|
125
125
|
AudioGroup: () => AudioGroup_default,
|
|
126
|
+
AuthContext: () => AuthContext,
|
|
126
127
|
AuthProvider: () => AuthProvider,
|
|
127
128
|
CheckboxField: () => CheckboxField_default,
|
|
128
129
|
ColorField: () => ColorField_default,
|
|
@@ -140,7 +141,6 @@ __export(src_exports, {
|
|
|
140
141
|
InterfacesTable: () => InterfacesTable_default,
|
|
141
142
|
InterfacesTimeseries: () => InterfacesTimeseries_default,
|
|
142
143
|
Livecast: () => Livecast_default,
|
|
143
|
-
MetadataLoader: () => MetadataLoader,
|
|
144
144
|
MetricBar: () => Metrics_default,
|
|
145
145
|
MiddlewareAuthGroup: () => Auth_default,
|
|
146
146
|
MiddlewareChannelsGroup: () => Channels_default,
|
|
@@ -154,7 +154,6 @@ __export(src_exports, {
|
|
|
154
154
|
Protocol: () => Protocol_default,
|
|
155
155
|
ProtocolGroup: () => ProtocolGroup_default,
|
|
156
156
|
RangeField: () => RangeField_default,
|
|
157
|
-
RemoteModule: () => RemoteModule,
|
|
158
157
|
RequireAuth: () => RequireAuth_default,
|
|
159
158
|
Role: () => Role,
|
|
160
159
|
SaveDiscard: () => SaveDiscard_default,
|
|
@@ -165,6 +164,7 @@ __export(src_exports, {
|
|
|
165
164
|
SliderField: () => SliderField_default,
|
|
166
165
|
StreamControl: () => StreamControl_default,
|
|
167
166
|
SwitchField: () => SwitchField_default,
|
|
167
|
+
ThemeContext: () => ThemeContext,
|
|
168
168
|
ThemeProvider: () => ThemeProvider,
|
|
169
169
|
VUBar: () => VUMeter_default,
|
|
170
170
|
ValidationItem: () => Validation_default,
|
|
@@ -186,8 +186,6 @@ __export(src_exports, {
|
|
|
186
186
|
getRefreshToken: () => getRefreshToken,
|
|
187
187
|
hostConfigLoader: () => hostConfigLoader,
|
|
188
188
|
isFirstRun: () => isFirstRun,
|
|
189
|
-
loadRemoteModule: () => loadRemoteModule,
|
|
190
|
-
metadataLoader: () => metadataLoader,
|
|
191
189
|
registry: () => registry,
|
|
192
190
|
saveConfig: () => saveConfig,
|
|
193
191
|
setAccessToken: () => setAccessToken,
|
|
@@ -3100,140 +3098,6 @@ var authService = {
|
|
|
3100
3098
|
}
|
|
3101
3099
|
};
|
|
3102
3100
|
|
|
3103
|
-
// src/services/loadRemoteModule.ts
|
|
3104
|
-
var React = __toESM(require("react"), 1);
|
|
3105
|
-
var ReactDOM = __toESM(require("react-dom"), 1);
|
|
3106
|
-
var sharedScopeInitialized = false;
|
|
3107
|
-
function getSharedScope() {
|
|
3108
|
-
if (!globalThis.__federation_shared__) {
|
|
3109
|
-
globalThis.__federation_shared__ = {};
|
|
3110
|
-
}
|
|
3111
|
-
if (!sharedScopeInitialized) {
|
|
3112
|
-
globalThis.__federation_shared__["react"] = {
|
|
3113
|
-
"18.3.1": {
|
|
3114
|
-
get: () => Promise.resolve(() => React),
|
|
3115
|
-
loaded: true,
|
|
3116
|
-
from: "core",
|
|
3117
|
-
scope: "default"
|
|
3118
|
-
}
|
|
3119
|
-
};
|
|
3120
|
-
globalThis.__federation_shared__["react-dom"] = {
|
|
3121
|
-
"18.3.1": {
|
|
3122
|
-
get: () => Promise.resolve(() => ReactDOM),
|
|
3123
|
-
loaded: true,
|
|
3124
|
-
from: "core",
|
|
3125
|
-
scope: "default"
|
|
3126
|
-
}
|
|
3127
|
-
};
|
|
3128
|
-
sharedScopeInitialized = true;
|
|
3129
|
-
}
|
|
3130
|
-
return globalThis.__federation_shared__;
|
|
3131
|
-
}
|
|
3132
|
-
var loadedContainers = /* @__PURE__ */ new Map();
|
|
3133
|
-
var initializedContainers = /* @__PURE__ */ new Set();
|
|
3134
|
-
async function loadContainer(url) {
|
|
3135
|
-
if (loadedContainers.has(url)) {
|
|
3136
|
-
return loadedContainers.get(url);
|
|
3137
|
-
}
|
|
3138
|
-
const loadPromise = (async () => {
|
|
3139
|
-
try {
|
|
3140
|
-
const container = await import(
|
|
3141
|
-
/* @vite-ignore */
|
|
3142
|
-
url
|
|
3143
|
-
);
|
|
3144
|
-
if (container.init && !initializedContainers.has(url)) {
|
|
3145
|
-
await container.init(getSharedScope());
|
|
3146
|
-
initializedContainers.add(url);
|
|
3147
|
-
}
|
|
3148
|
-
return container;
|
|
3149
|
-
} catch (error2) {
|
|
3150
|
-
loadedContainers.delete(url);
|
|
3151
|
-
initializedContainers.delete(url);
|
|
3152
|
-
throw error2;
|
|
3153
|
-
}
|
|
3154
|
-
})();
|
|
3155
|
-
loadedContainers.set(url, loadPromise);
|
|
3156
|
-
return loadPromise;
|
|
3157
|
-
}
|
|
3158
|
-
async function loadRemoteModule(config) {
|
|
3159
|
-
const container = await loadContainer(config.url);
|
|
3160
|
-
if (!container || typeof container.get !== "function") {
|
|
3161
|
-
throw new Error(`Container inv\xE1lido ou sem m\xE9todo get: ${config.scope}`);
|
|
3162
|
-
}
|
|
3163
|
-
if (typeof container.dynamicLoadingCss === "function") {
|
|
3164
|
-
try {
|
|
3165
|
-
await container.dynamicLoadingCss([]);
|
|
3166
|
-
} catch (err) {
|
|
3167
|
-
console.warn(`Aviso: Falha ao carregar CSS global do remote ${config.scope}`, err);
|
|
3168
|
-
}
|
|
3169
|
-
}
|
|
3170
|
-
const factory2 = await container.get(config.module);
|
|
3171
|
-
const moduleExports = await factory2();
|
|
3172
|
-
if (moduleExports && typeof moduleExports === "object" && "default" in moduleExports) {
|
|
3173
|
-
return moduleExports.default;
|
|
3174
|
-
}
|
|
3175
|
-
return moduleExports;
|
|
3176
|
-
}
|
|
3177
|
-
|
|
3178
|
-
// src/services/metadataLoader.ts
|
|
3179
|
-
var MetadataLoader = class {
|
|
3180
|
-
constructor() {
|
|
3181
|
-
__publicField(this, "metadataCache", /* @__PURE__ */ new Map());
|
|
3182
|
-
}
|
|
3183
|
-
async loadMetadata(metadataUrl) {
|
|
3184
|
-
if (this.metadataCache.has(metadataUrl)) {
|
|
3185
|
-
return this.metadataCache.get(metadataUrl) || [];
|
|
3186
|
-
}
|
|
3187
|
-
try {
|
|
3188
|
-
const response = await fetch(metadataUrl);
|
|
3189
|
-
console.log(response);
|
|
3190
|
-
if (!response.ok) {
|
|
3191
|
-
throw new Error(`Failed to fetch metadata: ${response.statusText}`);
|
|
3192
|
-
}
|
|
3193
|
-
const data = await response.json();
|
|
3194
|
-
let metadata;
|
|
3195
|
-
if (Array.isArray(data)) {
|
|
3196
|
-
metadata = data;
|
|
3197
|
-
} else if (data.pages && Array.isArray(data.pages)) {
|
|
3198
|
-
metadata = data.pages;
|
|
3199
|
-
} else {
|
|
3200
|
-
throw new Error(
|
|
3201
|
-
"Invalid metadata format: expected array or object with pages property"
|
|
3202
|
-
);
|
|
3203
|
-
}
|
|
3204
|
-
metadata.forEach((page, index3) => {
|
|
3205
|
-
if (!page.id || !page.name || !page.path || !page.url) {
|
|
3206
|
-
throw new Error(
|
|
3207
|
-
`Invalid page metadata at index ${index3}: missing required fields`
|
|
3208
|
-
);
|
|
3209
|
-
}
|
|
3210
|
-
});
|
|
3211
|
-
this.metadataCache.set(metadataUrl, metadata);
|
|
3212
|
-
return metadata;
|
|
3213
|
-
} catch (error2) {
|
|
3214
|
-
console.warn(`Failed to load metadata from ${metadataUrl}:`, error2);
|
|
3215
|
-
return [];
|
|
3216
|
-
}
|
|
3217
|
-
}
|
|
3218
|
-
async loadFromDirectory(directoryUrl) {
|
|
3219
|
-
try {
|
|
3220
|
-
const manifestUrl = `${directoryUrl}/manifest.json`;
|
|
3221
|
-
return await this.loadMetadata(manifestUrl);
|
|
3222
|
-
} catch (error2) {
|
|
3223
|
-
throw new Error(
|
|
3224
|
-
`Directory manifest not found at ${directoryUrl}/manifest.json: ${error2}`
|
|
3225
|
-
);
|
|
3226
|
-
}
|
|
3227
|
-
}
|
|
3228
|
-
clearCache() {
|
|
3229
|
-
this.metadataCache.clear();
|
|
3230
|
-
}
|
|
3231
|
-
getCachedMetadata(metadataUrl) {
|
|
3232
|
-
return this.metadataCache.get(metadataUrl);
|
|
3233
|
-
}
|
|
3234
|
-
};
|
|
3235
|
-
var metadataLoader = new MetadataLoader();
|
|
3236
|
-
|
|
3237
3101
|
// src/services/registry.ts
|
|
3238
3102
|
var PluginRegistryImpl = class {
|
|
3239
3103
|
constructor() {
|
|
@@ -26029,20 +25893,27 @@ var import_react5 = require("react");
|
|
|
26029
25893
|
var import_react4 = require("react");
|
|
26030
25894
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
26031
25895
|
var AuthContext = (0, import_react4.createContext)(void 0);
|
|
26032
|
-
var AuthProvider = ({
|
|
26033
|
-
|
|
26034
|
-
|
|
25896
|
+
var AuthProvider = ({
|
|
25897
|
+
children,
|
|
25898
|
+
onNavigate,
|
|
25899
|
+
storage = typeof window !== "undefined" ? window.localStorage : null,
|
|
25900
|
+
authService: authService2 = authService,
|
|
25901
|
+
initialUser = null,
|
|
25902
|
+
initialAccessToken = null
|
|
25903
|
+
}) => {
|
|
25904
|
+
const [user, setUser] = (0, import_react4.useState)(initialUser);
|
|
25905
|
+
const [accessToken, setToken] = (0, import_react4.useState)(initialAccessToken ?? null);
|
|
26035
25906
|
const [loading, setLoading] = (0, import_react4.useState)(true);
|
|
26036
25907
|
(0, import_react4.useEffect)(() => {
|
|
26037
25908
|
try {
|
|
26038
|
-
const storedUser =
|
|
25909
|
+
const storedUser = storage?.getItem("user");
|
|
26039
25910
|
if (storedUser)
|
|
26040
25911
|
setUser(JSON.parse(storedUser));
|
|
26041
25912
|
} catch {
|
|
26042
25913
|
}
|
|
26043
25914
|
try {
|
|
26044
|
-
const savedAccess =
|
|
26045
|
-
const savedRefresh =
|
|
25915
|
+
const savedAccess = storage?.getItem("accessToken");
|
|
25916
|
+
const savedRefresh = storage?.getItem("refreshToken");
|
|
26046
25917
|
if (savedAccess) {
|
|
26047
25918
|
setToken(savedAccess);
|
|
26048
25919
|
setAccessToken(savedAccess);
|
|
@@ -26053,15 +25924,17 @@ var AuthProvider = ({ children, onNavigate }) => {
|
|
|
26053
25924
|
} catch {
|
|
26054
25925
|
}
|
|
26055
25926
|
setLoading(false);
|
|
26056
|
-
}, []);
|
|
25927
|
+
}, [storage]);
|
|
26057
25928
|
const login = async (username, password, options) => {
|
|
26058
|
-
const resp = await
|
|
25929
|
+
const resp = await authService2.login(username, password);
|
|
26059
25930
|
setToken(resp.accessToken);
|
|
26060
25931
|
setAccessToken(resp.accessToken);
|
|
26061
25932
|
setRefreshToken(resp.refreshToken);
|
|
26062
25933
|
setUser(resp.user);
|
|
26063
25934
|
try {
|
|
26064
|
-
|
|
25935
|
+
storage?.setItem("user", JSON.stringify(resp.user));
|
|
25936
|
+
storage?.setItem("accessToken", resp.accessToken);
|
|
25937
|
+
storage?.setItem("refreshToken", resp.refreshToken);
|
|
26065
25938
|
} catch {
|
|
26066
25939
|
}
|
|
26067
25940
|
if (options?.redirect !== false)
|
|
@@ -26069,13 +25942,15 @@ var AuthProvider = ({ children, onNavigate }) => {
|
|
|
26069
25942
|
};
|
|
26070
25943
|
const logout = async () => {
|
|
26071
25944
|
try {
|
|
26072
|
-
await
|
|
25945
|
+
await authService2.logout();
|
|
26073
25946
|
} finally {
|
|
26074
25947
|
setToken(null);
|
|
26075
25948
|
clearTokens();
|
|
26076
25949
|
setUser(null);
|
|
26077
25950
|
try {
|
|
26078
|
-
|
|
25951
|
+
storage?.removeItem("user");
|
|
25952
|
+
storage?.removeItem("accessToken");
|
|
25953
|
+
storage?.removeItem("refreshToken");
|
|
26079
25954
|
} catch {
|
|
26080
25955
|
}
|
|
26081
25956
|
onNavigate?.("/login");
|
|
@@ -26087,10 +25962,10 @@ var AuthProvider = ({ children, onNavigate }) => {
|
|
|
26087
25962
|
const want = Array.isArray(roles) ? roles : [roles];
|
|
26088
25963
|
return want.some((r17) => user.role === r17);
|
|
26089
25964
|
};
|
|
26090
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(AuthContext
|
|
25965
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(AuthContext, { value: { user, accessToken, loading, login, logout, hasRole }, children });
|
|
26091
25966
|
};
|
|
26092
25967
|
function useAuth() {
|
|
26093
|
-
const ctx = (0, import_react4.
|
|
25968
|
+
const ctx = (0, import_react4.use)(AuthContext);
|
|
26094
25969
|
if (!ctx)
|
|
26095
25970
|
throw new Error("useAuth must be used within AuthProvider");
|
|
26096
25971
|
return ctx;
|
|
@@ -26139,7 +26014,7 @@ var SkeletonBlock = ({ lines = 3, className = "" }) => {
|
|
|
26139
26014
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
26140
26015
|
var SectionContext = (0, import_react5.createContext)(void 0);
|
|
26141
26016
|
function useSection() {
|
|
26142
|
-
const ctx = (0, import_react5.
|
|
26017
|
+
const ctx = (0, import_react5.use)(SectionContext);
|
|
26143
26018
|
return ctx ?? { readonly: false };
|
|
26144
26019
|
}
|
|
26145
26020
|
var Section2 = ({ id, title, icon, expanded, onToggle, children, readonly, loading = false }) => {
|
|
@@ -26184,7 +26059,7 @@ var Section2 = ({ id, title, icon, expanded, onToggle, children, readonly, loadi
|
|
|
26184
26059
|
overflow-hidden
|
|
26185
26060
|
${expanded ? "max-h-fit opacity-100" : "max-h-0 opacity-0"}
|
|
26186
26061
|
`,
|
|
26187
|
-
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
|
|
26062
|
+
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 }) })
|
|
26188
26063
|
}
|
|
26189
26064
|
)
|
|
26190
26065
|
] });
|
|
@@ -28343,7 +28218,7 @@ function m6(u16, t15) {
|
|
|
28343
28218
|
}
|
|
28344
28219
|
|
|
28345
28220
|
// 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
|
|
28346
|
-
var
|
|
28221
|
+
var React5 = __toESM(require("react"), 1);
|
|
28347
28222
|
var import_react48 = require("react");
|
|
28348
28223
|
|
|
28349
28224
|
// node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
|
|
@@ -28648,7 +28523,7 @@ function rectToClientRect(rect) {
|
|
|
28648
28523
|
}
|
|
28649
28524
|
|
|
28650
28525
|
// 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
|
|
28651
|
-
var
|
|
28526
|
+
var ReactDOM2 = __toESM(require("react-dom"), 1);
|
|
28652
28527
|
|
|
28653
28528
|
// node_modules/.pnpm/@floating-ui+core@1.7.4/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
|
|
28654
28529
|
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
@@ -29851,9 +29726,9 @@ var computePosition2 = (reference, floating, options) => {
|
|
|
29851
29726
|
};
|
|
29852
29727
|
|
|
29853
29728
|
// 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
|
|
29854
|
-
var
|
|
29729
|
+
var React4 = __toESM(require("react"), 1);
|
|
29855
29730
|
var import_react47 = require("react");
|
|
29856
|
-
var
|
|
29731
|
+
var ReactDOM = __toESM(require("react-dom"), 1);
|
|
29857
29732
|
var isClient = typeof document !== "undefined";
|
|
29858
29733
|
var noop2 = function noop3() {
|
|
29859
29734
|
};
|
|
@@ -29918,7 +29793,7 @@ function roundByDPR(element, value) {
|
|
|
29918
29793
|
return Math.round(value * dpr) / dpr;
|
|
29919
29794
|
}
|
|
29920
29795
|
function useLatestRef(value) {
|
|
29921
|
-
const ref =
|
|
29796
|
+
const ref = React4.useRef(value);
|
|
29922
29797
|
index(() => {
|
|
29923
29798
|
ref.current = value;
|
|
29924
29799
|
});
|
|
@@ -29941,7 +29816,7 @@ function useFloating(options) {
|
|
|
29941
29816
|
whileElementsMounted,
|
|
29942
29817
|
open
|
|
29943
29818
|
} = options;
|
|
29944
|
-
const [data, setData] =
|
|
29819
|
+
const [data, setData] = React4.useState({
|
|
29945
29820
|
x: 0,
|
|
29946
29821
|
y: 0,
|
|
29947
29822
|
strategy,
|
|
@@ -29949,19 +29824,19 @@ function useFloating(options) {
|
|
|
29949
29824
|
middlewareData: {},
|
|
29950
29825
|
isPositioned: false
|
|
29951
29826
|
});
|
|
29952
|
-
const [latestMiddleware, setLatestMiddleware] =
|
|
29827
|
+
const [latestMiddleware, setLatestMiddleware] = React4.useState(middleware);
|
|
29953
29828
|
if (!deepEqual(latestMiddleware, middleware)) {
|
|
29954
29829
|
setLatestMiddleware(middleware);
|
|
29955
29830
|
}
|
|
29956
|
-
const [_reference, _setReference] =
|
|
29957
|
-
const [_floating, _setFloating] =
|
|
29958
|
-
const setReference =
|
|
29831
|
+
const [_reference, _setReference] = React4.useState(null);
|
|
29832
|
+
const [_floating, _setFloating] = React4.useState(null);
|
|
29833
|
+
const setReference = React4.useCallback((node) => {
|
|
29959
29834
|
if (node !== referenceRef.current) {
|
|
29960
29835
|
referenceRef.current = node;
|
|
29961
29836
|
_setReference(node);
|
|
29962
29837
|
}
|
|
29963
29838
|
}, []);
|
|
29964
|
-
const setFloating =
|
|
29839
|
+
const setFloating = React4.useCallback((node) => {
|
|
29965
29840
|
if (node !== floatingRef.current) {
|
|
29966
29841
|
floatingRef.current = node;
|
|
29967
29842
|
_setFloating(node);
|
|
@@ -29969,14 +29844,14 @@ function useFloating(options) {
|
|
|
29969
29844
|
}, []);
|
|
29970
29845
|
const referenceEl = externalReference || _reference;
|
|
29971
29846
|
const floatingEl = externalFloating || _floating;
|
|
29972
|
-
const referenceRef =
|
|
29973
|
-
const floatingRef =
|
|
29974
|
-
const dataRef =
|
|
29847
|
+
const referenceRef = React4.useRef(null);
|
|
29848
|
+
const floatingRef = React4.useRef(null);
|
|
29849
|
+
const dataRef = React4.useRef(data);
|
|
29975
29850
|
const hasWhileElementsMounted = whileElementsMounted != null;
|
|
29976
29851
|
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
29977
29852
|
const platformRef = useLatestRef(platform2);
|
|
29978
29853
|
const openRef = useLatestRef(open);
|
|
29979
|
-
const update =
|
|
29854
|
+
const update = React4.useCallback(() => {
|
|
29980
29855
|
if (!referenceRef.current || !floatingRef.current) {
|
|
29981
29856
|
return;
|
|
29982
29857
|
}
|
|
@@ -29999,7 +29874,7 @@ function useFloating(options) {
|
|
|
29999
29874
|
};
|
|
30000
29875
|
if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
|
|
30001
29876
|
dataRef.current = fullData;
|
|
30002
|
-
|
|
29877
|
+
ReactDOM.flushSync(() => {
|
|
30003
29878
|
setData(fullData);
|
|
30004
29879
|
});
|
|
30005
29880
|
}
|
|
@@ -30014,7 +29889,7 @@ function useFloating(options) {
|
|
|
30014
29889
|
}));
|
|
30015
29890
|
}
|
|
30016
29891
|
}, [open]);
|
|
30017
|
-
const isMountedRef =
|
|
29892
|
+
const isMountedRef = React4.useRef(false);
|
|
30018
29893
|
index(() => {
|
|
30019
29894
|
isMountedRef.current = true;
|
|
30020
29895
|
return () => {
|
|
@@ -30033,17 +29908,17 @@ function useFloating(options) {
|
|
|
30033
29908
|
update();
|
|
30034
29909
|
}
|
|
30035
29910
|
}, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
|
|
30036
|
-
const refs =
|
|
29911
|
+
const refs = React4.useMemo(() => ({
|
|
30037
29912
|
reference: referenceRef,
|
|
30038
29913
|
floating: floatingRef,
|
|
30039
29914
|
setReference,
|
|
30040
29915
|
setFloating
|
|
30041
29916
|
}), [setReference, setFloating]);
|
|
30042
|
-
const elements =
|
|
29917
|
+
const elements = React4.useMemo(() => ({
|
|
30043
29918
|
reference: referenceEl,
|
|
30044
29919
|
floating: floatingEl
|
|
30045
29920
|
}), [referenceEl, floatingEl]);
|
|
30046
|
-
const floatingStyles =
|
|
29921
|
+
const floatingStyles = React4.useMemo(() => {
|
|
30047
29922
|
const initialStyles = {
|
|
30048
29923
|
position: strategy,
|
|
30049
29924
|
left: 0,
|
|
@@ -30069,7 +29944,7 @@ function useFloating(options) {
|
|
|
30069
29944
|
top: y8
|
|
30070
29945
|
};
|
|
30071
29946
|
}, [strategy, transform, elements.floating, data.x, data.y]);
|
|
30072
|
-
return
|
|
29947
|
+
return React4.useMemo(() => ({
|
|
30073
29948
|
...data,
|
|
30074
29949
|
update,
|
|
30075
29950
|
refs,
|
|
@@ -30096,12 +29971,12 @@ var size3 = (options, deps) => ({
|
|
|
30096
29971
|
|
|
30097
29972
|
// 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
|
|
30098
29973
|
var SafeReact = {
|
|
30099
|
-
...
|
|
29974
|
+
...React5
|
|
30100
29975
|
};
|
|
30101
29976
|
var useInsertionEffect = SafeReact.useInsertionEffect;
|
|
30102
29977
|
var useSafeInsertionEffect = useInsertionEffect || ((fn) => fn());
|
|
30103
29978
|
function useEffectEvent(callback) {
|
|
30104
|
-
const ref =
|
|
29979
|
+
const ref = React5.useRef(() => {
|
|
30105
29980
|
if (true) {
|
|
30106
29981
|
throw new Error("Cannot call an event handler while rendering.");
|
|
30107
29982
|
}
|
|
@@ -30109,7 +29984,7 @@ function useEffectEvent(callback) {
|
|
|
30109
29984
|
useSafeInsertionEffect(() => {
|
|
30110
29985
|
ref.current = callback;
|
|
30111
29986
|
});
|
|
30112
|
-
return
|
|
29987
|
+
return React5.useCallback(function() {
|
|
30113
29988
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
30114
29989
|
args[_key] = arguments[_key];
|
|
30115
29990
|
}
|
|
@@ -30132,13 +30007,13 @@ var genId = () => (
|
|
|
30132
30007
|
"floating-ui-" + Math.random().toString(36).slice(2, 6) + count++
|
|
30133
30008
|
);
|
|
30134
30009
|
function useFloatingId() {
|
|
30135
|
-
const [id, setId] =
|
|
30010
|
+
const [id, setId] = React5.useState(() => serverHandoffComplete ? genId() : void 0);
|
|
30136
30011
|
index2(() => {
|
|
30137
30012
|
if (id == null) {
|
|
30138
30013
|
setId(genId());
|
|
30139
30014
|
}
|
|
30140
30015
|
}, []);
|
|
30141
|
-
|
|
30016
|
+
React5.useEffect(() => {
|
|
30142
30017
|
serverHandoffComplete = true;
|
|
30143
30018
|
}, []);
|
|
30144
30019
|
return id;
|
|
@@ -30189,13 +30064,13 @@ function createPubSub() {
|
|
|
30189
30064
|
}
|
|
30190
30065
|
};
|
|
30191
30066
|
}
|
|
30192
|
-
var FloatingNodeContext = /* @__PURE__ */
|
|
30193
|
-
var FloatingTreeContext = /* @__PURE__ */
|
|
30067
|
+
var FloatingNodeContext = /* @__PURE__ */ React5.createContext(null);
|
|
30068
|
+
var FloatingTreeContext = /* @__PURE__ */ React5.createContext(null);
|
|
30194
30069
|
var useFloatingParentNodeId = () => {
|
|
30195
30070
|
var _React$useContext;
|
|
30196
|
-
return ((_React$useContext =
|
|
30071
|
+
return ((_React$useContext = React5.useContext(FloatingNodeContext)) == null ? void 0 : _React$useContext.id) || null;
|
|
30197
30072
|
};
|
|
30198
|
-
var useFloatingTree = () =>
|
|
30073
|
+
var useFloatingTree = () => React5.useContext(FloatingTreeContext);
|
|
30199
30074
|
var FOCUSABLE_ATTRIBUTE = "data-floating-ui-focusable";
|
|
30200
30075
|
function useFloatingRootContext(options) {
|
|
30201
30076
|
const {
|
|
@@ -30204,8 +30079,8 @@ function useFloatingRootContext(options) {
|
|
|
30204
30079
|
elements: elementsProp
|
|
30205
30080
|
} = options;
|
|
30206
30081
|
const floatingId = useId();
|
|
30207
|
-
const dataRef =
|
|
30208
|
-
const [events] =
|
|
30082
|
+
const dataRef = React5.useRef({});
|
|
30083
|
+
const [events] = React5.useState(() => createPubSub());
|
|
30209
30084
|
const nested = useFloatingParentNodeId() != null;
|
|
30210
30085
|
if (true) {
|
|
30211
30086
|
const optionDomReference = elementsProp.reference;
|
|
@@ -30213,7 +30088,7 @@ function useFloatingRootContext(options) {
|
|
|
30213
30088
|
error("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
|
|
30214
30089
|
}
|
|
30215
30090
|
}
|
|
30216
|
-
const [positionReference, setPositionReference] =
|
|
30091
|
+
const [positionReference, setPositionReference] = React5.useState(elementsProp.reference);
|
|
30217
30092
|
const onOpenChange = useEffectEvent((open2, event, reason) => {
|
|
30218
30093
|
dataRef.current.openEvent = open2 ? event : void 0;
|
|
30219
30094
|
events.emit("openchange", {
|
|
@@ -30224,15 +30099,15 @@ function useFloatingRootContext(options) {
|
|
|
30224
30099
|
});
|
|
30225
30100
|
onOpenChangeProp == null || onOpenChangeProp(open2, event, reason);
|
|
30226
30101
|
});
|
|
30227
|
-
const refs =
|
|
30102
|
+
const refs = React5.useMemo(() => ({
|
|
30228
30103
|
setPositionReference
|
|
30229
30104
|
}), []);
|
|
30230
|
-
const elements =
|
|
30105
|
+
const elements = React5.useMemo(() => ({
|
|
30231
30106
|
reference: positionReference || elementsProp.reference || null,
|
|
30232
30107
|
floating: elementsProp.floating || null,
|
|
30233
30108
|
domReference: elementsProp.reference
|
|
30234
30109
|
}), [positionReference, elementsProp.reference, elementsProp.floating]);
|
|
30235
|
-
return
|
|
30110
|
+
return React5.useMemo(() => ({
|
|
30236
30111
|
dataRef,
|
|
30237
30112
|
open,
|
|
30238
30113
|
onOpenChange,
|
|
@@ -30259,11 +30134,11 @@ function useFloating2(options) {
|
|
|
30259
30134
|
});
|
|
30260
30135
|
const rootContext = options.rootContext || internalRootContext;
|
|
30261
30136
|
const computedElements = rootContext.elements;
|
|
30262
|
-
const [_domReference, setDomReference] =
|
|
30263
|
-
const [positionReference, _setPositionReference] =
|
|
30137
|
+
const [_domReference, setDomReference] = React5.useState(null);
|
|
30138
|
+
const [positionReference, _setPositionReference] = React5.useState(null);
|
|
30264
30139
|
const optionDomReference = computedElements == null ? void 0 : computedElements.domReference;
|
|
30265
30140
|
const domReference = optionDomReference || _domReference;
|
|
30266
|
-
const domReferenceRef =
|
|
30141
|
+
const domReferenceRef = React5.useRef(null);
|
|
30267
30142
|
const tree = useFloatingTree();
|
|
30268
30143
|
index2(() => {
|
|
30269
30144
|
if (domReference) {
|
|
@@ -30279,7 +30154,7 @@ function useFloating2(options) {
|
|
|
30279
30154
|
}
|
|
30280
30155
|
}
|
|
30281
30156
|
});
|
|
30282
|
-
const setPositionReference =
|
|
30157
|
+
const setPositionReference = React5.useCallback((node) => {
|
|
30283
30158
|
const computedPositionReference = isElement(node) ? {
|
|
30284
30159
|
getBoundingClientRect: () => node.getBoundingClientRect(),
|
|
30285
30160
|
contextElement: node
|
|
@@ -30287,7 +30162,7 @@ function useFloating2(options) {
|
|
|
30287
30162
|
_setPositionReference(computedPositionReference);
|
|
30288
30163
|
position.refs.setReference(computedPositionReference);
|
|
30289
30164
|
}, [position.refs]);
|
|
30290
|
-
const setReference =
|
|
30165
|
+
const setReference = React5.useCallback((node) => {
|
|
30291
30166
|
if (isElement(node) || node === null) {
|
|
30292
30167
|
domReferenceRef.current = node;
|
|
30293
30168
|
setDomReference(node);
|
|
@@ -30299,17 +30174,17 @@ function useFloating2(options) {
|
|
|
30299
30174
|
position.refs.setReference(node);
|
|
30300
30175
|
}
|
|
30301
30176
|
}, [position.refs]);
|
|
30302
|
-
const refs =
|
|
30177
|
+
const refs = React5.useMemo(() => ({
|
|
30303
30178
|
...position.refs,
|
|
30304
30179
|
setReference,
|
|
30305
30180
|
setPositionReference,
|
|
30306
30181
|
domReference: domReferenceRef
|
|
30307
30182
|
}), [position.refs, setReference, setPositionReference]);
|
|
30308
|
-
const elements =
|
|
30183
|
+
const elements = React5.useMemo(() => ({
|
|
30309
30184
|
...position.elements,
|
|
30310
30185
|
domReference
|
|
30311
30186
|
}), [position.elements, domReference]);
|
|
30312
|
-
const context =
|
|
30187
|
+
const context = React5.useMemo(() => ({
|
|
30313
30188
|
...position,
|
|
30314
30189
|
...rootContext,
|
|
30315
30190
|
refs,
|
|
@@ -30323,7 +30198,7 @@ function useFloating2(options) {
|
|
|
30323
30198
|
node.context = context;
|
|
30324
30199
|
}
|
|
30325
30200
|
});
|
|
30326
|
-
return
|
|
30201
|
+
return React5.useMemo(() => ({
|
|
30327
30202
|
...position,
|
|
30328
30203
|
context,
|
|
30329
30204
|
refs,
|
|
@@ -30395,22 +30270,22 @@ function useInteractions(propsList) {
|
|
|
30395
30270
|
const referenceDeps = propsList.map((key) => key == null ? void 0 : key.reference);
|
|
30396
30271
|
const floatingDeps = propsList.map((key) => key == null ? void 0 : key.floating);
|
|
30397
30272
|
const itemDeps = propsList.map((key) => key == null ? void 0 : key.item);
|
|
30398
|
-
const getReferenceProps =
|
|
30273
|
+
const getReferenceProps = React5.useCallback(
|
|
30399
30274
|
(userProps) => mergeProps(userProps, propsList, "reference"),
|
|
30400
30275
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
30401
30276
|
referenceDeps
|
|
30402
30277
|
);
|
|
30403
|
-
const getFloatingProps =
|
|
30278
|
+
const getFloatingProps = React5.useCallback(
|
|
30404
30279
|
(userProps) => mergeProps(userProps, propsList, "floating"),
|
|
30405
30280
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
30406
30281
|
floatingDeps
|
|
30407
30282
|
);
|
|
30408
|
-
const getItemProps =
|
|
30283
|
+
const getItemProps = React5.useCallback(
|
|
30409
30284
|
(userProps) => mergeProps(userProps, propsList, "item"),
|
|
30410
30285
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
30411
30286
|
itemDeps
|
|
30412
30287
|
);
|
|
30413
|
-
return
|
|
30288
|
+
return React5.useMemo(() => ({
|
|
30414
30289
|
getReferenceProps,
|
|
30415
30290
|
getFloatingProps,
|
|
30416
30291
|
getItemProps
|
|
@@ -30481,7 +30356,7 @@ var inner = (props) => ({
|
|
|
30481
30356
|
scrollEl.scrollTop = diffY;
|
|
30482
30357
|
if (onFallbackChange) {
|
|
30483
30358
|
const shouldFallback = scrollEl.offsetHeight < item.offsetHeight * min(minItemsVisible, listRef.current.length) - 1 || refOverflow.top >= -referenceOverflowThreshold || refOverflow.bottom >= -referenceOverflowThreshold;
|
|
30484
|
-
|
|
30359
|
+
ReactDOM2.flushSync(() => onFallbackChange(shouldFallback));
|
|
30485
30360
|
}
|
|
30486
30361
|
if (overflowRef) {
|
|
30487
30362
|
overflowRef.current = await detectOverflow2(getArgsWithCustomFloatingHeight({
|
|
@@ -30506,10 +30381,10 @@ function useInnerOffset(context, props) {
|
|
|
30506
30381
|
onChange: unstable_onChange
|
|
30507
30382
|
} = props;
|
|
30508
30383
|
const onChange = useEffectEvent(unstable_onChange);
|
|
30509
|
-
const controlledScrollingRef =
|
|
30510
|
-
const prevScrollTopRef =
|
|
30511
|
-
const initialOverflowRef =
|
|
30512
|
-
|
|
30384
|
+
const controlledScrollingRef = React5.useRef(false);
|
|
30385
|
+
const prevScrollTopRef = React5.useRef(null);
|
|
30386
|
+
const initialOverflowRef = React5.useRef(null);
|
|
30387
|
+
React5.useEffect(() => {
|
|
30513
30388
|
if (!enabled)
|
|
30514
30389
|
return;
|
|
30515
30390
|
function onWheel(e10) {
|
|
@@ -30527,7 +30402,7 @@ function useInnerOffset(context, props) {
|
|
|
30527
30402
|
}
|
|
30528
30403
|
if (!isAtTop && dY > 0 || !isAtBottom && dY < 0) {
|
|
30529
30404
|
e10.preventDefault();
|
|
30530
|
-
|
|
30405
|
+
ReactDOM2.flushSync(() => {
|
|
30531
30406
|
onChange((d9) => d9 + Math[method](dY, remainingScroll * sign));
|
|
30532
30407
|
});
|
|
30533
30408
|
} else if (/firefox/i.test(getUserAgent())) {
|
|
@@ -30552,7 +30427,7 @@ function useInnerOffset(context, props) {
|
|
|
30552
30427
|
};
|
|
30553
30428
|
}
|
|
30554
30429
|
}, [enabled, open, elements.floating, overflowRef, scrollRef, onChange]);
|
|
30555
|
-
const floating =
|
|
30430
|
+
const floating = React5.useMemo(() => ({
|
|
30556
30431
|
onKeyDown() {
|
|
30557
30432
|
controlledScrollingRef.current = true;
|
|
30558
30433
|
},
|
|
@@ -30570,7 +30445,7 @@ function useInnerOffset(context, props) {
|
|
|
30570
30445
|
if (prevScrollTopRef.current !== null) {
|
|
30571
30446
|
const scrollDiff = el.scrollTop - prevScrollTopRef.current;
|
|
30572
30447
|
if (overflowRef.current.bottom < -0.5 && scrollDiff < -1 || overflowRef.current.top < -0.5 && scrollDiff > 1) {
|
|
30573
|
-
|
|
30448
|
+
ReactDOM2.flushSync(() => onChange((d9) => d9 + scrollDiff));
|
|
30574
30449
|
}
|
|
30575
30450
|
}
|
|
30576
30451
|
requestAnimationFrame(() => {
|
|
@@ -30578,7 +30453,7 @@ function useInnerOffset(context, props) {
|
|
|
30578
30453
|
});
|
|
30579
30454
|
}
|
|
30580
30455
|
}), [elements.floating, onChange, overflowRef, scrollRef]);
|
|
30581
|
-
return
|
|
30456
|
+
return React5.useMemo(() => enabled ? {
|
|
30582
30457
|
floating
|
|
30583
30458
|
} : {}, [enabled, floating]);
|
|
30584
30459
|
}
|
|
@@ -33081,7 +32956,8 @@ var normalizeDvBData = (data) => {
|
|
|
33081
32956
|
protocol: parseProtocolUrl(data.output_url || defaultProtocolSettings.ffurl)
|
|
33082
32957
|
};
|
|
33083
32958
|
};
|
|
33084
|
-
var DvB =
|
|
32959
|
+
var DvB = function DvB2(props) {
|
|
32960
|
+
const { settings, setSettings, encoderId, isLoading, setIsLoading, ref } = props;
|
|
33085
32961
|
const [internalSettings, setInternalSettings] = (0, import_react74.useState)(defaultDvBSettings);
|
|
33086
32962
|
const [expandedSections, setExpandedSections] = (0, import_react74.useState)({
|
|
33087
32963
|
video: true,
|
|
@@ -33142,13 +33018,33 @@ var DvB = (0, import_react74.forwardRef)(function DvB2({ settings, setSettings,
|
|
|
33142
33018
|
newTracks[idx] = { label: newTracks[idx].label, value: !newTracks[idx].value };
|
|
33143
33019
|
setTracks(newTracks);
|
|
33144
33020
|
};
|
|
33145
|
-
(0, import_react74.
|
|
33146
|
-
|
|
33147
|
-
|
|
33148
|
-
|
|
33149
|
-
|
|
33150
|
-
|
|
33151
|
-
|
|
33021
|
+
(0, import_react74.useEffect)(() => {
|
|
33022
|
+
if (!ref)
|
|
33023
|
+
return;
|
|
33024
|
+
const impl = {
|
|
33025
|
+
getSettings: () => ({ ...effectiveSettings, output_url: buildProtocolUrl(effectiveSettings.protocol) }),
|
|
33026
|
+
reset: () => {
|
|
33027
|
+
effectiveSetSettings(savedSettings);
|
|
33028
|
+
},
|
|
33029
|
+
isDirty: () => JSON.stringify(effectiveSettings) !== JSON.stringify(savedSettings)
|
|
33030
|
+
};
|
|
33031
|
+
try {
|
|
33032
|
+
if (typeof ref === "function")
|
|
33033
|
+
ref(impl);
|
|
33034
|
+
else if ("current" in ref)
|
|
33035
|
+
ref.current = impl;
|
|
33036
|
+
} catch {
|
|
33037
|
+
}
|
|
33038
|
+
return () => {
|
|
33039
|
+
try {
|
|
33040
|
+
if (typeof ref === "function")
|
|
33041
|
+
ref(null);
|
|
33042
|
+
else if ("current" in ref)
|
|
33043
|
+
ref.current = null;
|
|
33044
|
+
} catch {
|
|
33045
|
+
}
|
|
33046
|
+
};
|
|
33047
|
+
}, [ref, effectiveSettings, savedSettings, effectiveSetSettings]);
|
|
33152
33048
|
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: [
|
|
33153
33049
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(VideoGroup_default, { expanded: expandedSections.video, onToggle: toggleSection, loading: isLoading ?? false, children: [
|
|
33154
33050
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { children: [
|
|
@@ -33495,7 +33391,7 @@ var DvB = (0, import_react74.forwardRef)(function DvB2({ settings, setSettings,
|
|
|
33495
33391
|
}
|
|
33496
33392
|
)
|
|
33497
33393
|
] });
|
|
33498
|
-
}
|
|
33394
|
+
};
|
|
33499
33395
|
var DvB_default = DvB;
|
|
33500
33396
|
|
|
33501
33397
|
// src/components/encoder/Livecast.tsx
|
|
@@ -33623,7 +33519,8 @@ var normalizeLivecastData = (data) => {
|
|
|
33623
33519
|
protocol: parsed
|
|
33624
33520
|
};
|
|
33625
33521
|
};
|
|
33626
|
-
var Livecast =
|
|
33522
|
+
var Livecast = function Livecast2(props) {
|
|
33523
|
+
const { settings, setSettings, encoderId, isLoading, setIsLoading, ref } = props;
|
|
33627
33524
|
const [expandedSections, setExpandedSections] = (0, import_react75.useState)({
|
|
33628
33525
|
video: true,
|
|
33629
33526
|
audio: false,
|
|
@@ -33679,16 +33576,33 @@ var Livecast = (0, import_react75.forwardRef)(function Livecast2({ settings, set
|
|
|
33679
33576
|
const next = { ...effectiveSettings, [key]: !effectiveSettings[key] };
|
|
33680
33577
|
effectiveSetSettings(next);
|
|
33681
33578
|
};
|
|
33682
|
-
(0, import_react75.
|
|
33683
|
-
|
|
33684
|
-
|
|
33685
|
-
|
|
33686
|
-
|
|
33687
|
-
|
|
33688
|
-
|
|
33689
|
-
|
|
33690
|
-
|
|
33691
|
-
|
|
33579
|
+
(0, import_react75.useEffect)(() => {
|
|
33580
|
+
if (!ref)
|
|
33581
|
+
return;
|
|
33582
|
+
const impl = {
|
|
33583
|
+
getSettings: () => ({ ...effectiveSettings, send_url: buildProtocolUrl2(effectiveSettings.protocol) }),
|
|
33584
|
+
reset: () => {
|
|
33585
|
+
effectiveSetSettings(savedSettings);
|
|
33586
|
+
},
|
|
33587
|
+
isDirty: () => JSON.stringify(effectiveSettings) !== JSON.stringify(savedSettings)
|
|
33588
|
+
};
|
|
33589
|
+
try {
|
|
33590
|
+
if (typeof ref === "function")
|
|
33591
|
+
ref(impl);
|
|
33592
|
+
else if ("current" in ref)
|
|
33593
|
+
ref.current = impl;
|
|
33594
|
+
} catch {
|
|
33595
|
+
}
|
|
33596
|
+
return () => {
|
|
33597
|
+
try {
|
|
33598
|
+
if (typeof ref === "function")
|
|
33599
|
+
ref(null);
|
|
33600
|
+
else if ("current" in ref)
|
|
33601
|
+
ref.current = null;
|
|
33602
|
+
} catch {
|
|
33603
|
+
}
|
|
33604
|
+
};
|
|
33605
|
+
}, [ref, effectiveSettings, savedSettings, effectiveSetSettings]);
|
|
33692
33606
|
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: [
|
|
33693
33607
|
/* @__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: [
|
|
33694
33608
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
@@ -33839,7 +33753,7 @@ var Livecast = (0, import_react75.forwardRef)(function Livecast2({ settings, set
|
|
|
33839
33753
|
}
|
|
33840
33754
|
)
|
|
33841
33755
|
] });
|
|
33842
|
-
}
|
|
33756
|
+
};
|
|
33843
33757
|
var Livecast_default = Livecast;
|
|
33844
33758
|
|
|
33845
33759
|
// src/components/encoder/ViewLog.tsx
|
|
@@ -34625,28 +34539,36 @@ var EditInPlaceField_default = EditInPlaceField;
|
|
|
34625
34539
|
var import_react80 = require("react");
|
|
34626
34540
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
34627
34541
|
var ThemeContext = (0, import_react80.createContext)(void 0);
|
|
34628
|
-
function ThemeProvider({ children }) {
|
|
34542
|
+
function ThemeProvider({ children, storage }) {
|
|
34543
|
+
const resolvedStorage = storage ?? (typeof window !== "undefined" ? window.localStorage : null);
|
|
34629
34544
|
const [theme, setTheme] = (0, import_react80.useState)(() => {
|
|
34630
|
-
|
|
34631
|
-
|
|
34632
|
-
|
|
34545
|
+
try {
|
|
34546
|
+
if (!resolvedStorage)
|
|
34547
|
+
return "light";
|
|
34548
|
+
const savedTheme = resolvedStorage.getItem("theme");
|
|
34549
|
+
const systemPreference = typeof window !== "undefined" && window.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
34550
|
+
return savedTheme ?? systemPreference;
|
|
34551
|
+
} catch {
|
|
34552
|
+
return "light";
|
|
34553
|
+
}
|
|
34633
34554
|
});
|
|
34634
34555
|
(0, import_react80.useEffect)(() => {
|
|
34635
|
-
|
|
34636
|
-
|
|
34637
|
-
root.classList.
|
|
34638
|
-
} else {
|
|
34639
|
-
root.classList.remove("dark");
|
|
34556
|
+
if (typeof document !== "undefined") {
|
|
34557
|
+
const root = document.documentElement;
|
|
34558
|
+
root.classList.toggle("dark", theme === "dark");
|
|
34640
34559
|
}
|
|
34641
|
-
|
|
34642
|
-
|
|
34560
|
+
try {
|
|
34561
|
+
resolvedStorage?.setItem("theme", theme);
|
|
34562
|
+
} catch {
|
|
34563
|
+
}
|
|
34564
|
+
}, [theme, resolvedStorage]);
|
|
34643
34565
|
const toggleTheme = () => {
|
|
34644
|
-
setTheme((
|
|
34566
|
+
setTheme((prev) => prev === "light" ? "dark" : "light");
|
|
34645
34567
|
};
|
|
34646
|
-
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ThemeContext
|
|
34568
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ThemeContext, { value: { theme, toggleTheme }, children });
|
|
34647
34569
|
}
|
|
34648
34570
|
function useTheme() {
|
|
34649
|
-
const context = (0, import_react80.
|
|
34571
|
+
const context = (0, import_react80.use)(ThemeContext);
|
|
34650
34572
|
if (context === void 0) {
|
|
34651
34573
|
throw new Error("useTheme must be used within a ThemeProvider");
|
|
34652
34574
|
}
|
|
@@ -39315,7 +39237,7 @@ var dir = instance.dir;
|
|
|
39315
39237
|
var init = instance.init;
|
|
39316
39238
|
var loadResources = instance.loadResources;
|
|
39317
39239
|
var reloadResources = instance.reloadResources;
|
|
39318
|
-
var
|
|
39240
|
+
var use4 = instance.use;
|
|
39319
39241
|
var changeLanguage = instance.changeLanguage;
|
|
39320
39242
|
var getFixedT = instance.getFixedT;
|
|
39321
39243
|
var t14 = instance.t;
|
|
@@ -40360,7 +40282,10 @@ var import_react104 = __toESM(require("react"), 1);
|
|
|
40360
40282
|
var import_react_query2 = require("@tanstack/react-query");
|
|
40361
40283
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
40362
40284
|
function SharedUiProvider({ children, client }) {
|
|
40363
|
-
const
|
|
40285
|
+
const ref = import_react104.default.useRef(null);
|
|
40286
|
+
if (!ref.current)
|
|
40287
|
+
ref.current = client ?? new import_react_query2.QueryClient();
|
|
40288
|
+
const internal = ref.current;
|
|
40364
40289
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react_query2.QueryClientProvider, { client: internal, children });
|
|
40365
40290
|
}
|
|
40366
40291
|
|
|
@@ -40603,48 +40528,13 @@ var ConfigWizard = ({ basePath = "./config-xcoder-wizard/php", onComplete }) =>
|
|
|
40603
40528
|
};
|
|
40604
40529
|
var Wizard_default = ConfigWizard;
|
|
40605
40530
|
|
|
40606
|
-
// src/components/
|
|
40531
|
+
// src/components/xcoder/Fflog.tsx
|
|
40607
40532
|
var import_react106 = require("react");
|
|
40608
40533
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
40609
|
-
function RemoteModule({ scope, url, module: module2, fallback }) {
|
|
40610
|
-
const [Component2, setComponent] = (0, import_react106.useState)(null);
|
|
40611
|
-
const [error2, setError] = (0, import_react106.useState)(null);
|
|
40612
|
-
const [loading, setLoading] = (0, import_react106.useState)(true);
|
|
40613
|
-
(0, import_react106.useEffect)(() => {
|
|
40614
|
-
setLoading(true);
|
|
40615
|
-
setError(null);
|
|
40616
|
-
loadRemoteModule({ scope, url, module: module2 }).then((mod) => {
|
|
40617
|
-
setComponent(() => mod);
|
|
40618
|
-
}).catch((err) => {
|
|
40619
|
-
console.error("Erro ao carregar m\xF3dulo:", err);
|
|
40620
|
-
setError(err.message);
|
|
40621
|
-
}).finally(() => {
|
|
40622
|
-
setLoading(false);
|
|
40623
|
-
});
|
|
40624
|
-
}, [scope, url, module2]);
|
|
40625
|
-
if (loading) {
|
|
40626
|
-
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" }) });
|
|
40627
|
-
}
|
|
40628
|
-
if (error2) {
|
|
40629
|
-
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: [
|
|
40630
|
-
/* @__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" }),
|
|
40631
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "text-red-600 dark:text-red-400", children: error2 }),
|
|
40632
|
-
/* @__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." })
|
|
40633
|
-
] });
|
|
40634
|
-
}
|
|
40635
|
-
if (!Component2) {
|
|
40636
|
-
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" }) });
|
|
40637
|
-
}
|
|
40638
|
-
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Component2, {});
|
|
40639
|
-
}
|
|
40640
|
-
|
|
40641
|
-
// src/components/xcoder/Fflog.tsx
|
|
40642
|
-
var import_react107 = require("react");
|
|
40643
|
-
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
40644
40534
|
var Fflog = ({ index: index3 }) => {
|
|
40645
|
-
const [message, setMessage] = (0,
|
|
40646
|
-
const [tooltip, setTooltip] = (0,
|
|
40647
|
-
(0,
|
|
40535
|
+
const [message, setMessage] = (0, import_react106.useState)("");
|
|
40536
|
+
const [tooltip, setTooltip] = (0, import_react106.useState)("Copy to Clipboard");
|
|
40537
|
+
(0, import_react106.useEffect)(() => {
|
|
40648
40538
|
const cleanupSocket = subscribeToWebsocket(buildWsUrl("/ws"), (data) => {
|
|
40649
40539
|
const aux = data?.logs[index3 - 1];
|
|
40650
40540
|
setMessage(aux.log);
|
|
@@ -40657,7 +40547,7 @@ var Fflog = ({ index: index3 }) => {
|
|
|
40657
40547
|
cleanupSocket();
|
|
40658
40548
|
};
|
|
40659
40549
|
}, []);
|
|
40660
|
-
return /* @__PURE__ */ (0,
|
|
40550
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
40661
40551
|
"div",
|
|
40662
40552
|
{
|
|
40663
40553
|
"data-tooltip-id": "tooltip",
|
|
@@ -40672,8 +40562,8 @@ var Fflog = ({ index: index3 }) => {
|
|
|
40672
40562
|
},
|
|
40673
40563
|
onMouseLeave: () => message == "" ? setTooltip("Copy to Clipboard") : "",
|
|
40674
40564
|
children: [
|
|
40675
|
-
/* @__PURE__ */ (0,
|
|
40676
|
-
/* @__PURE__ */ (0,
|
|
40565
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(M10, { id: "tooltip" }),
|
|
40566
|
+
/* @__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 })
|
|
40677
40567
|
]
|
|
40678
40568
|
}
|
|
40679
40569
|
);
|
|
@@ -40681,7 +40571,7 @@ var Fflog = ({ index: index3 }) => {
|
|
|
40681
40571
|
var Fflog_default = Fflog;
|
|
40682
40572
|
|
|
40683
40573
|
// src/components/xcoder/Metrics.tsx
|
|
40684
|
-
var
|
|
40574
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
40685
40575
|
var MetricBar = ({ label, value, suffix, color }) => {
|
|
40686
40576
|
const colorClasses = {
|
|
40687
40577
|
blue: "bg-blue-500",
|
|
@@ -40690,15 +40580,15 @@ var MetricBar = ({ label, value, suffix, color }) => {
|
|
|
40690
40580
|
cyan: "bg-cyan-500",
|
|
40691
40581
|
pink: "bg-pink-500"
|
|
40692
40582
|
};
|
|
40693
|
-
return /* @__PURE__ */ (0,
|
|
40694
|
-
/* @__PURE__ */ (0,
|
|
40695
|
-
/* @__PURE__ */ (0,
|
|
40696
|
-
/* @__PURE__ */ (0,
|
|
40583
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "space-y-1", children: [
|
|
40584
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex items-center justify-between text-sm", children: [
|
|
40585
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "text-gray-900 dark:text-slate-400", children: label }),
|
|
40586
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: "text-gray-900 dark:text-white font-mono", children: [
|
|
40697
40587
|
Math.round(value),
|
|
40698
40588
|
suffix
|
|
40699
40589
|
] })
|
|
40700
40590
|
] }),
|
|
40701
|
-
/* @__PURE__ */ (0,
|
|
40591
|
+
/* @__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)(
|
|
40702
40592
|
"div",
|
|
40703
40593
|
{
|
|
40704
40594
|
className: `h-full transition-all duration-300 ${colorClasses[color]}`,
|
|
@@ -40710,8 +40600,8 @@ var MetricBar = ({ label, value, suffix, color }) => {
|
|
|
40710
40600
|
var Metrics_default = MetricBar;
|
|
40711
40601
|
|
|
40712
40602
|
// src/components/xcoder/Panel.tsx
|
|
40713
|
-
var
|
|
40714
|
-
var
|
|
40603
|
+
var import_react107 = require("react");
|
|
40604
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
40715
40605
|
var convertServiceToOption = (serviceString) => {
|
|
40716
40606
|
const match = serviceString.match(/^([^@]+)@/);
|
|
40717
40607
|
if (!match) {
|
|
@@ -40725,12 +40615,12 @@ var convertServiceToOption = (serviceString) => {
|
|
|
40725
40615
|
return { label, value: rawValue };
|
|
40726
40616
|
};
|
|
40727
40617
|
var EncoderDecoderPanel = ({ index: index3 }) => {
|
|
40728
|
-
const [status, setStatus] = (0,
|
|
40729
|
-
const [modes, setModes] = (0,
|
|
40730
|
-
const [oldModes, setOldModes] = (0,
|
|
40731
|
-
const [open, setOpen] = (0,
|
|
40732
|
-
const [optionsList, setOptionsList] = (0,
|
|
40733
|
-
(0,
|
|
40618
|
+
const [status, setStatus] = (0, import_react107.useState)("idle");
|
|
40619
|
+
const [modes, setModes] = (0, import_react107.useState)([]);
|
|
40620
|
+
const [oldModes, setOldModes] = (0, import_react107.useState)(modes);
|
|
40621
|
+
const [open, setOpen] = (0, import_react107.useState)(false);
|
|
40622
|
+
const [optionsList, setOptionsList] = (0, import_react107.useState)([]);
|
|
40623
|
+
(0, import_react107.useEffect)(() => {
|
|
40734
40624
|
const cleanupSocket = subscribeToWebsocket(buildWsUrl("/"), (data) => {
|
|
40735
40625
|
setStatus(data?.services[`xcoder_${index3}`].status);
|
|
40736
40626
|
});
|
|
@@ -40764,52 +40654,52 @@ var EncoderDecoderPanel = ({ index: index3 }) => {
|
|
|
40764
40654
|
m: state ? "stop" : "start"
|
|
40765
40655
|
});
|
|
40766
40656
|
};
|
|
40767
|
-
return /* @__PURE__ */ (0,
|
|
40768
|
-
/* @__PURE__ */ (0,
|
|
40769
|
-
/* @__PURE__ */ (0,
|
|
40770
|
-
/* @__PURE__ */ (0,
|
|
40771
|
-
/* @__PURE__ */ (0,
|
|
40657
|
+
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: [
|
|
40658
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "px-6 py-3 border-b border-slate-800 flex items-center justify-between", children: [
|
|
40659
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
40660
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Radio, { className: "w-5 h-5 text-blue-500" }),
|
|
40661
|
+
/* @__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: [
|
|
40772
40662
|
"Xcoder BMD Video Interface (",
|
|
40773
40663
|
index3,
|
|
40774
40664
|
")"
|
|
40775
40665
|
] }) })
|
|
40776
40666
|
] }),
|
|
40777
|
-
/* @__PURE__ */ (0,
|
|
40778
|
-
/* @__PURE__ */ (0,
|
|
40667
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-center gap-4", children: [
|
|
40668
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
40779
40669
|
"button",
|
|
40780
40670
|
{
|
|
40781
40671
|
onClick: () => startStop(status == "running"),
|
|
40782
40672
|
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"}`,
|
|
40783
|
-
children: status == "running" ? /* @__PURE__ */ (0,
|
|
40784
|
-
/* @__PURE__ */ (0,
|
|
40673
|
+
children: status == "running" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
|
|
40674
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Pause, { className: "w-4 h-4" }),
|
|
40785
40675
|
"Stop"
|
|
40786
|
-
] }) : /* @__PURE__ */ (0,
|
|
40787
|
-
/* @__PURE__ */ (0,
|
|
40676
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
|
|
40677
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Play, { className: "w-4 h-4" }),
|
|
40788
40678
|
"Start"
|
|
40789
40679
|
] })
|
|
40790
40680
|
}
|
|
40791
40681
|
),
|
|
40792
|
-
/* @__PURE__ */ (0,
|
|
40793
|
-
/* @__PURE__ */ (0,
|
|
40794
|
-
/* @__PURE__ */ (0,
|
|
40682
|
+
/* @__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: [
|
|
40683
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: `w-2 h-2 rounded-full bg-white ${status == "running" ? "block" : "hidden"}` }),
|
|
40684
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "text-sm text-slate-100 font-mono font-bold", children: status == "running" ? "READY" : "STANDBY" })
|
|
40795
40685
|
] }),
|
|
40796
|
-
/* @__PURE__ */ (0,
|
|
40686
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
40797
40687
|
"button",
|
|
40798
40688
|
{
|
|
40799
40689
|
onClick: () => setOpen(true),
|
|
40800
40690
|
className: "p-2 rounded-md transition-colors",
|
|
40801
|
-
children: /* @__PURE__ */ (0,
|
|
40691
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Settings, { className: "w-5 h-5 text-slate-400 hover:text-blue-400" })
|
|
40802
40692
|
}
|
|
40803
40693
|
)
|
|
40804
40694
|
] })
|
|
40805
40695
|
] }),
|
|
40806
|
-
/* @__PURE__ */ (0,
|
|
40696
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
40807
40697
|
Modal_default,
|
|
40808
40698
|
{
|
|
40809
40699
|
open,
|
|
40810
40700
|
setOpen,
|
|
40811
40701
|
title: "Switching Operation Mode",
|
|
40812
|
-
element: /* @__PURE__ */ (0,
|
|
40702
|
+
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)(
|
|
40813
40703
|
SelectField_default,
|
|
40814
40704
|
{
|
|
40815
40705
|
label: "New Mode",
|
|
@@ -40830,15 +40720,15 @@ var EncoderDecoderPanel = ({ index: index3 }) => {
|
|
|
40830
40720
|
}
|
|
40831
40721
|
}
|
|
40832
40722
|
),
|
|
40833
|
-
/* @__PURE__ */ (0,
|
|
40723
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "p-6", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Preview_default, { index: index3, setVuPts: () => {
|
|
40834
40724
|
} }) })
|
|
40835
40725
|
] });
|
|
40836
40726
|
};
|
|
40837
40727
|
var Panel_default = EncoderDecoderPanel;
|
|
40838
40728
|
|
|
40839
40729
|
// src/components/xcoder/Preview.tsx
|
|
40840
|
-
var
|
|
40841
|
-
var
|
|
40730
|
+
var import_react108 = require("react");
|
|
40731
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
40842
40732
|
var Preview = ({
|
|
40843
40733
|
index: index3,
|
|
40844
40734
|
setVuPts,
|
|
@@ -40847,9 +40737,9 @@ var Preview = ({
|
|
|
40847
40737
|
showStreamControl = false,
|
|
40848
40738
|
orientation = "horizontal"
|
|
40849
40739
|
}) => {
|
|
40850
|
-
const logEndRef = (0,
|
|
40851
|
-
const [message, setMessage] = (0,
|
|
40852
|
-
(0,
|
|
40740
|
+
const logEndRef = (0, import_react108.useRef)(null);
|
|
40741
|
+
const [message, setMessage] = (0, import_react108.useState)([]);
|
|
40742
|
+
(0, import_react108.useEffect)(() => {
|
|
40853
40743
|
const cleanupSocket = subscribeToWebsocket(buildWsUrl("/"), (data) => {
|
|
40854
40744
|
const aux = data?.services[`xcoder_${index3}`];
|
|
40855
40745
|
setMessage(aux.decklinkEvents.split("\n"));
|
|
@@ -40858,22 +40748,22 @@ var Preview = ({
|
|
|
40858
40748
|
cleanupSocket();
|
|
40859
40749
|
};
|
|
40860
40750
|
}, []);
|
|
40861
|
-
(0,
|
|
40751
|
+
(0, import_react108.useEffect)(() => {
|
|
40862
40752
|
if (logEndRef.current) {
|
|
40863
40753
|
logEndRef.current.scrollTop = logEndRef.current.scrollHeight;
|
|
40864
40754
|
}
|
|
40865
40755
|
}, [message]);
|
|
40866
|
-
const [vuChannels, setVuChannels] = (0,
|
|
40756
|
+
const [vuChannels, setVuChannels] = (0, import_react108.useState)(
|
|
40867
40757
|
Array(8).fill({ left: 0, right: 0 })
|
|
40868
40758
|
);
|
|
40869
40759
|
const channelCount = 8;
|
|
40870
|
-
const vuBars = (0,
|
|
40871
|
-
return Array.from({ length: channelCount }, (_7, i14) => /* @__PURE__ */ (0,
|
|
40760
|
+
const vuBars = (0, import_react108.useMemo)(() => {
|
|
40761
|
+
return Array.from({ length: channelCount }, (_7, i14) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(VUMeter_default, { index: i14, volume: vuChannels }, `vu-bar-${i14}`));
|
|
40872
40762
|
}, [channelCount, vuChannels]);
|
|
40873
|
-
const playerRef = (0,
|
|
40874
|
-
const vuRef = (0,
|
|
40875
|
-
const [height, setHeight] = (0,
|
|
40876
|
-
(0,
|
|
40763
|
+
const playerRef = (0, import_react108.useRef)(null);
|
|
40764
|
+
const vuRef = (0, import_react108.useRef)(null);
|
|
40765
|
+
const [height, setHeight] = (0, import_react108.useState)("auto");
|
|
40766
|
+
(0, import_react108.useLayoutEffect)(() => {
|
|
40877
40767
|
const p8 = playerRef.current;
|
|
40878
40768
|
const v6 = vuRef.current;
|
|
40879
40769
|
if (p8 && p8 != null && v6 && v6 != null) {
|
|
@@ -40887,15 +40777,15 @@ var Preview = ({
|
|
|
40887
40777
|
}
|
|
40888
40778
|
;
|
|
40889
40779
|
}, []);
|
|
40890
|
-
const [isOpen, setIsOpen] = (0,
|
|
40891
|
-
const logData = message.map((log, i14) => /* @__PURE__ */ (0,
|
|
40892
|
-
return /* @__PURE__ */ (0,
|
|
40893
|
-
/* @__PURE__ */ (0,
|
|
40780
|
+
const [isOpen, setIsOpen] = (0, import_react108.useState)(false);
|
|
40781
|
+
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));
|
|
40782
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: `"w-full h-full" ${orientation === "horizontal" ? "" : "py-6"}`, children: [
|
|
40783
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
40894
40784
|
"div",
|
|
40895
40785
|
{
|
|
40896
40786
|
className: `grid gap-6 mb-5 ${orientation === "horizontal" ? "grid-cols-[1fr_300px] items-start" : "grid-cols-1"}`,
|
|
40897
40787
|
children: [
|
|
40898
|
-
/* @__PURE__ */ (0,
|
|
40788
|
+
/* @__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)(
|
|
40899
40789
|
VideoPlayer_default,
|
|
40900
40790
|
{
|
|
40901
40791
|
pgmIndex: index3,
|
|
@@ -40904,10 +40794,10 @@ var Preview = ({
|
|
|
40904
40794
|
setVuChannels
|
|
40905
40795
|
}
|
|
40906
40796
|
) }) }),
|
|
40907
|
-
/* @__PURE__ */ (0,
|
|
40908
|
-
/* @__PURE__ */ (0,
|
|
40909
|
-
showStreamControl && /* @__PURE__ */ (0,
|
|
40910
|
-
showDlog && /* @__PURE__ */ (0,
|
|
40797
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: `flex flex-col ${orientation === "horizontal" ? "h-full" : "h-[200px]"}`, children: [
|
|
40798
|
+
/* @__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 }) }),
|
|
40799
|
+
showStreamControl && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(StreamControl_default, { index: index3 }),
|
|
40800
|
+
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)(
|
|
40911
40801
|
"div",
|
|
40912
40802
|
{
|
|
40913
40803
|
ref: logEndRef,
|
|
@@ -40918,7 +40808,7 @@ var Preview = ({
|
|
|
40918
40808
|
style: { height },
|
|
40919
40809
|
onClick: () => setIsOpen(true),
|
|
40920
40810
|
children: [
|
|
40921
|
-
/* @__PURE__ */ (0,
|
|
40811
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(M10, { id: "tooltip" }),
|
|
40922
40812
|
logData
|
|
40923
40813
|
]
|
|
40924
40814
|
}
|
|
@@ -40927,15 +40817,15 @@ var Preview = ({
|
|
|
40927
40817
|
]
|
|
40928
40818
|
}
|
|
40929
40819
|
),
|
|
40930
|
-
showFflog && /* @__PURE__ */ (0,
|
|
40931
|
-
/* @__PURE__ */ (0,
|
|
40820
|
+
showFflog && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Fflog_default, { index: index3 }),
|
|
40821
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
40932
40822
|
Modal_default,
|
|
40933
40823
|
{
|
|
40934
40824
|
open: isOpen,
|
|
40935
40825
|
setOpen: () => setIsOpen(!isOpen),
|
|
40936
40826
|
title: "Log Message",
|
|
40937
|
-
element: /* @__PURE__ */ (0,
|
|
40938
|
-
icon: /* @__PURE__ */ (0,
|
|
40827
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "custom-scroll overflow-y-auto p-3 h-[300px]", children: logData }),
|
|
40828
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FileClock, { "aria-hidden": "true", className: "size-6 text-yellow-600" }),
|
|
40939
40829
|
positiveLabel: "Copy",
|
|
40940
40830
|
positiveCommand: () => {
|
|
40941
40831
|
navigator.clipboard.writeText(message.join("\n"));
|
|
@@ -40947,11 +40837,11 @@ var Preview = ({
|
|
|
40947
40837
|
var Preview_default = Preview;
|
|
40948
40838
|
|
|
40949
40839
|
// src/components/xcoder/StreamControl.tsx
|
|
40950
|
-
var
|
|
40951
|
-
var
|
|
40840
|
+
var import_react109 = require("react");
|
|
40841
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
40952
40842
|
var StreamControl = ({ index: index3 }) => {
|
|
40953
|
-
const [bufferValue, setBufferValue] = (0,
|
|
40954
|
-
const [syncValue, setSyncValue] = (0,
|
|
40843
|
+
const [bufferValue, setBufferValue] = (0, import_react109.useState)(0);
|
|
40844
|
+
const [syncValue, setSyncValue] = (0, import_react109.useState)(0);
|
|
40955
40845
|
const minBuffer = 0;
|
|
40956
40846
|
const maxBuffer = 100;
|
|
40957
40847
|
const minSync = -30;
|
|
@@ -40964,45 +40854,45 @@ var StreamControl = ({ index: index3 }) => {
|
|
|
40964
40854
|
true,
|
|
40965
40855
|
1e3
|
|
40966
40856
|
);
|
|
40967
|
-
return /* @__PURE__ */ (0,
|
|
40968
|
-
/* @__PURE__ */ (0,
|
|
40969
|
-
/* @__PURE__ */ (0,
|
|
40970
|
-
/* @__PURE__ */ (0,
|
|
40971
|
-
/* @__PURE__ */ (0,
|
|
40972
|
-
/* @__PURE__ */ (0,
|
|
40857
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "w-80 space-y-3", children: [
|
|
40858
|
+
/* @__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: [
|
|
40859
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "space-y-1", children: [
|
|
40860
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex gap-2", children: [
|
|
40861
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "font-medium", children: "Service Name:" }),
|
|
40862
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "truncate", children: data?.service_name ?? "\u2014" })
|
|
40973
40863
|
] }),
|
|
40974
|
-
/* @__PURE__ */ (0,
|
|
40975
|
-
/* @__PURE__ */ (0,
|
|
40976
|
-
/* @__PURE__ */ (0,
|
|
40864
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex gap-2", children: [
|
|
40865
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "font-medium", children: "Service Provider:" }),
|
|
40866
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "truncate", children: data?.service_provider ?? "\u2014" })
|
|
40977
40867
|
] })
|
|
40978
40868
|
] }),
|
|
40979
|
-
/* @__PURE__ */ (0,
|
|
40980
|
-
/* @__PURE__ */ (0,
|
|
40981
|
-
/* @__PURE__ */ (0,
|
|
40982
|
-
/* @__PURE__ */ (0,
|
|
40869
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "space-y-1.5 pt-2", children: [
|
|
40870
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
40871
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Video, { className: "w-4 h-4 text-sky-400" }),
|
|
40872
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { className: "truncate", children: [
|
|
40983
40873
|
"Video 0: ",
|
|
40984
40874
|
data?.input_streans[1].input_stream.type
|
|
40985
40875
|
] })
|
|
40986
40876
|
] }),
|
|
40987
|
-
/* @__PURE__ */ (0,
|
|
40988
|
-
/* @__PURE__ */ (0,
|
|
40989
|
-
/* @__PURE__ */ (0,
|
|
40877
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
40878
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Volume2, { className: "w-4 h-4 text-emerald-400" }),
|
|
40879
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { className: "truncate", children: [
|
|
40990
40880
|
"Audio 1: ",
|
|
40991
40881
|
data?.input_streans[0].input_stream.type
|
|
40992
40882
|
] })
|
|
40993
40883
|
] })
|
|
40994
40884
|
] })
|
|
40995
40885
|
] }) }),
|
|
40996
|
-
/* @__PURE__ */ (0,
|
|
40997
|
-
/* @__PURE__ */ (0,
|
|
40998
|
-
/* @__PURE__ */ (0,
|
|
40999
|
-
/* @__PURE__ */ (0,
|
|
41000
|
-
/* @__PURE__ */ (0,
|
|
40886
|
+
/* @__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: [
|
|
40887
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SliderField_default, { value: bufferValue, setValue: setBufferValue, label: "Fifo Size:", min: minBuffer, max: maxBuffer }),
|
|
40888
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SliderField_default, { value: syncValue, setValue: setSyncValue, label: "A/V Sync:", min: minSync, max: maxSync, content: ["<", ">"], step: 10 }),
|
|
40889
|
+
/* @__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: [
|
|
40890
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { children: [
|
|
41001
40891
|
"Buffer: ",
|
|
41002
40892
|
bufferValue,
|
|
41003
40893
|
" frames"
|
|
41004
40894
|
] }),
|
|
41005
|
-
/* @__PURE__ */ (0,
|
|
40895
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { children: [
|
|
41006
40896
|
"Sync: ",
|
|
41007
40897
|
syncValue > 0 ? "+" : "",
|
|
41008
40898
|
syncValue,
|
|
@@ -41015,8 +40905,8 @@ var StreamControl = ({ index: index3 }) => {
|
|
|
41015
40905
|
var StreamControl_default = StreamControl;
|
|
41016
40906
|
|
|
41017
40907
|
// src/components/xcoder/VideoPlayer.tsx
|
|
41018
|
-
var
|
|
41019
|
-
var
|
|
40908
|
+
var import_react110 = require("react");
|
|
40909
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
41020
40910
|
var import_meta2 = {};
|
|
41021
40911
|
var VideoPlayer = ({
|
|
41022
40912
|
pgmIndex,
|
|
@@ -41024,11 +40914,11 @@ var VideoPlayer = ({
|
|
|
41024
40914
|
setVuPts,
|
|
41025
40915
|
setVuChannels
|
|
41026
40916
|
}) => {
|
|
41027
|
-
const dummyCanvas = (0,
|
|
41028
|
-
const videoRef = (0,
|
|
41029
|
-
const prevRawChannelsRef = (0,
|
|
41030
|
-
const playerRef = (0,
|
|
41031
|
-
(0,
|
|
40917
|
+
const dummyCanvas = (0, import_react110.useMemo)(() => document.createElement("canvas"), []);
|
|
40918
|
+
const videoRef = (0, import_react110.useRef)(dummyCanvas);
|
|
40919
|
+
const prevRawChannelsRef = (0, import_react110.useRef)(null);
|
|
40920
|
+
const playerRef = (0, import_react110.useRef)(null);
|
|
40921
|
+
(0, import_react110.useEffect)(() => {
|
|
41032
40922
|
let cancelled = false;
|
|
41033
40923
|
if (!videoRef.current) {
|
|
41034
40924
|
console.warn("Video canvas not ready yet");
|
|
@@ -41149,7 +41039,7 @@ var VideoPlayer = ({
|
|
|
41149
41039
|
initPlayer();
|
|
41150
41040
|
}
|
|
41151
41041
|
}, [pgmIndex]);
|
|
41152
|
-
return /* @__PURE__ */ (0,
|
|
41042
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
41153
41043
|
"canvas",
|
|
41154
41044
|
{
|
|
41155
41045
|
ref: videoRef,
|
|
@@ -41160,21 +41050,21 @@ var VideoPlayer = ({
|
|
|
41160
41050
|
var VideoPlayer_default = VideoPlayer;
|
|
41161
41051
|
|
|
41162
41052
|
// src/components/xcoder/VUMeter.tsx
|
|
41163
|
-
var
|
|
41164
|
-
var
|
|
41053
|
+
var import_react111 = require("react");
|
|
41054
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
41165
41055
|
var VUBar = ({ index: index3, volume, width = "15px", displayMarks = false }) => {
|
|
41166
|
-
const [tickerTarget, setTickerTarget] = (0,
|
|
41167
|
-
const [tickerTransition, setTickerTransition] = (0,
|
|
41056
|
+
const [tickerTarget, setTickerTarget] = (0, import_react111.useState)({ left: 0, right: 0 });
|
|
41057
|
+
const [tickerTransition, setTickerTransition] = (0, import_react111.useState)({
|
|
41168
41058
|
left: 0,
|
|
41169
41059
|
right: 0
|
|
41170
41060
|
});
|
|
41171
|
-
const [resetVUTimeout, setResetVUTimeout] = (0,
|
|
41172
|
-
const tickerLeftRef = (0,
|
|
41173
|
-
const tickerRightRef = (0,
|
|
41174
|
-
const blockerLeftRef = (0,
|
|
41175
|
-
const blockerRightRef = (0,
|
|
41176
|
-
const fillerRef = (0,
|
|
41177
|
-
const calcVolume = (0,
|
|
41061
|
+
const [resetVUTimeout, setResetVUTimeout] = (0, import_react111.useState)(0);
|
|
41062
|
+
const tickerLeftRef = (0, import_react111.useRef)(null);
|
|
41063
|
+
const tickerRightRef = (0, import_react111.useRef)(null);
|
|
41064
|
+
const blockerLeftRef = (0, import_react111.useRef)(null);
|
|
41065
|
+
const blockerRightRef = (0, import_react111.useRef)(null);
|
|
41066
|
+
const fillerRef = (0, import_react111.useRef)(null);
|
|
41067
|
+
const calcVolume = (0, import_react111.useCallback)(() => {
|
|
41178
41068
|
try {
|
|
41179
41069
|
const fillerRect = fillerRef.current?.getBoundingClientRect();
|
|
41180
41070
|
const blockerLeftRect = blockerLeftRef.current?.getBoundingClientRect();
|
|
@@ -41223,7 +41113,7 @@ var VUBar = ({ index: index3, volume, width = "15px", displayMarks = false }) =>
|
|
|
41223
41113
|
} catch (e10) {
|
|
41224
41114
|
}
|
|
41225
41115
|
}, []);
|
|
41226
|
-
(0,
|
|
41116
|
+
(0, import_react111.useEffect)(() => {
|
|
41227
41117
|
calcVolume();
|
|
41228
41118
|
if (resetVUTimeout) {
|
|
41229
41119
|
clearTimeout(resetVUTimeout);
|
|
@@ -41238,9 +41128,9 @@ var VUBar = ({ index: index3, volume, width = "15px", displayMarks = false }) =>
|
|
|
41238
41128
|
const MIN_DB = -70;
|
|
41239
41129
|
const MAX_DB = 0;
|
|
41240
41130
|
const measures = [0, -10, -20, -30, -40, -50, -60, -70];
|
|
41241
|
-
return /* @__PURE__ */ (0,
|
|
41242
|
-
/* @__PURE__ */ (0,
|
|
41243
|
-
return /* @__PURE__ */ (0,
|
|
41131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex w-full h-full justify-center", children: [
|
|
41132
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: displayMarks ? "mt-[60px]" : "hidden", children: measures.map((db) => {
|
|
41133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
41244
41134
|
"div",
|
|
41245
41135
|
{
|
|
41246
41136
|
style: { marginBottom: `${(db - MIN_DB) / (MAX_DB - MIN_DB) * 100}px`, marginRight: "25px", textAlignLast: "center" },
|
|
@@ -41261,15 +41151,15 @@ var VUBar = ({ index: index3, volume, width = "15px", displayMarks = false }) =>
|
|
|
41261
41151
|
db
|
|
41262
41152
|
);
|
|
41263
41153
|
}) }),
|
|
41264
|
-
/* @__PURE__ */ (0,
|
|
41265
|
-
/* @__PURE__ */ (0,
|
|
41266
|
-
/* @__PURE__ */ (0,
|
|
41267
|
-
/* @__PURE__ */ (0,
|
|
41268
|
-
/* @__PURE__ */ (0,
|
|
41154
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: `h-full w-full text-xs text-center text-white`, style: { maxWidth: `${width}` }, children: [
|
|
41155
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex border border-gray-400 w-full h-[96%] rotate-180 scale-x-[-1]", children: [
|
|
41156
|
+
/* @__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: [
|
|
41157
|
+
/* @__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" } }),
|
|
41158
|
+
/* @__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` } })
|
|
41269
41159
|
] }),
|
|
41270
|
-
/* @__PURE__ */ (0,
|
|
41271
|
-
/* @__PURE__ */ (0,
|
|
41272
|
-
/* @__PURE__ */ (0,
|
|
41160
|
+
/* @__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: [
|
|
41161
|
+
/* @__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" } }),
|
|
41162
|
+
/* @__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` } })
|
|
41273
41163
|
] })
|
|
41274
41164
|
] }),
|
|
41275
41165
|
index3 + 1
|
|
@@ -41279,7 +41169,7 @@ var VUBar = ({ index: index3, volume, width = "15px", displayMarks = false }) =>
|
|
|
41279
41169
|
var VUMeter_default = VUBar;
|
|
41280
41170
|
|
|
41281
41171
|
// src/hooks/useSettings.ts
|
|
41282
|
-
var
|
|
41172
|
+
var import_react112 = require("react");
|
|
41283
41173
|
var import_react_query3 = require("@tanstack/react-query");
|
|
41284
41174
|
function useSettings(defaultSettings4, options) {
|
|
41285
41175
|
const {
|
|
@@ -41294,8 +41184,8 @@ function useSettings(defaultSettings4, options) {
|
|
|
41294
41184
|
refetchInterval
|
|
41295
41185
|
} = options;
|
|
41296
41186
|
const queryClient = (0, import_react_query3.useQueryClient)();
|
|
41297
|
-
const [settings, setSettings] = (0,
|
|
41298
|
-
const [savedSettings, setSavedSettings] = (0,
|
|
41187
|
+
const [settings, setSettings] = (0, import_react112.useState)(defaultSettings4);
|
|
41188
|
+
const [savedSettings, setSavedSettings] = (0, import_react112.useState)(defaultSettings4);
|
|
41299
41189
|
const {
|
|
41300
41190
|
data,
|
|
41301
41191
|
isLoading,
|
|
@@ -41310,7 +41200,7 @@ function useSettings(defaultSettings4, options) {
|
|
|
41310
41200
|
enabled,
|
|
41311
41201
|
refetchInterval
|
|
41312
41202
|
});
|
|
41313
|
-
(0,
|
|
41203
|
+
(0, import_react112.useEffect)(() => {
|
|
41314
41204
|
if (data) {
|
|
41315
41205
|
setSettings(data);
|
|
41316
41206
|
setSavedSettings(data);
|
|
@@ -41332,20 +41222,20 @@ function useSettings(defaultSettings4, options) {
|
|
|
41332
41222
|
queryClient.invalidateQueries({ queryKey });
|
|
41333
41223
|
}
|
|
41334
41224
|
});
|
|
41335
|
-
const isDirty = (0,
|
|
41225
|
+
const isDirty = (0, import_react112.useMemo)(
|
|
41336
41226
|
() => JSON.stringify(settings) !== JSON.stringify(savedSettings),
|
|
41337
41227
|
[settings, savedSettings]
|
|
41338
41228
|
);
|
|
41339
|
-
const updateField = (0,
|
|
41229
|
+
const updateField = (0, import_react112.useCallback)((key, value) => {
|
|
41340
41230
|
setSettings((prev) => ({ ...prev, [key]: value }));
|
|
41341
41231
|
}, []);
|
|
41342
|
-
const updateSettings = (0,
|
|
41232
|
+
const updateSettings = (0, import_react112.useCallback)((partial) => {
|
|
41343
41233
|
setSettings((prev) => ({ ...prev, ...partial }));
|
|
41344
41234
|
}, []);
|
|
41345
|
-
const discard = (0,
|
|
41235
|
+
const discard = (0, import_react112.useCallback)(() => {
|
|
41346
41236
|
setSettings(savedSettings);
|
|
41347
41237
|
}, [savedSettings]);
|
|
41348
|
-
const save = (0,
|
|
41238
|
+
const save = (0, import_react112.useCallback)(async () => {
|
|
41349
41239
|
const payload = toPayload(settings);
|
|
41350
41240
|
await saveMutation.mutateAsync(payload);
|
|
41351
41241
|
}, [settings, toPayload, saveMutation]);
|
|
@@ -41365,13 +41255,13 @@ function useSettings(defaultSettings4, options) {
|
|
|
41365
41255
|
}
|
|
41366
41256
|
|
|
41367
41257
|
// src/hooks/useAvailableSubservices.ts
|
|
41368
|
-
var
|
|
41258
|
+
var import_react113 = require("react");
|
|
41369
41259
|
function useAvailableSubservices(serviceKey, fallbackCount = 4) {
|
|
41370
|
-
const [options, setOptions] = (0,
|
|
41260
|
+
const [options, setOptions] = (0, import_react113.useState)(
|
|
41371
41261
|
Array.from({ length: fallbackCount }).map((_7, i14) => ({ label: `Channel ${i14 + 1}`, value: `${i14}` }))
|
|
41372
41262
|
);
|
|
41373
|
-
const [loading, setLoading] = (0,
|
|
41374
|
-
(0,
|
|
41263
|
+
const [loading, setLoading] = (0, import_react113.useState)(false);
|
|
41264
|
+
(0, import_react113.useEffect)(() => {
|
|
41375
41265
|
let mounted = true;
|
|
41376
41266
|
(async () => {
|
|
41377
41267
|
setLoading(true);
|