@rslsp1/fa-app-tools 10.3.4 → 10.3.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/index.d.mts +25 -2
- package/dist/index.d.ts +25 -2
- package/dist/index.js +345 -83
- package/dist/index.mjs +643 -381
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -22,7 +22,7 @@ require('./chunk-FTLEDU6C.js');
|
|
|
22
22
|
require('./chunk-DDH2SGZM.js');
|
|
23
23
|
|
|
24
24
|
// package.json
|
|
25
|
-
var version = "10.3.
|
|
25
|
+
var version = "10.3.5";
|
|
26
26
|
|
|
27
27
|
// src/hooks/useOnClickOutside.ts
|
|
28
28
|
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
@@ -5465,7 +5465,7 @@ function ServerTab({ serverBaseUrl }) {
|
|
|
5465
5465
|
function FlowWorkspacePicker({
|
|
5466
5466
|
tagBase,
|
|
5467
5467
|
selectedUserId,
|
|
5468
|
-
message:
|
|
5468
|
+
message: message3,
|
|
5469
5469
|
onSelectUser,
|
|
5470
5470
|
onSelectContext
|
|
5471
5471
|
}) {
|
|
@@ -5489,7 +5489,7 @@ function FlowWorkspacePicker({
|
|
|
5489
5489
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "FineArt Flow" }),
|
|
5490
5490
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "small", { children: step === "user" ? "Benutzer w\xE4hlen" : `Kontext f\xFCr ${_nullishCoalesce(_optionalChain([selectedUser, 'optionalAccess', _153 => _153.username]), () => ( `User ${selectedUserId}`))}` })
|
|
5491
5491
|
] }),
|
|
5492
|
-
|
|
5492
|
+
message3 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "flow-workspace-picker__warning", children: message3 }),
|
|
5493
5493
|
step === "user" ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flow-workspace-picker__choices", "aria-label": "Benutzer w\xE4hlen", children: [
|
|
5494
5494
|
tagBase.users.map((user) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "button", { type: "button", onClick: () => chooseUser(user.id), children: [
|
|
5495
5495
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: user.username }),
|
|
@@ -5538,6 +5538,7 @@ var FLOW_BRIDGE_REQUEST_EVENT = "fine-art-flow-bridge:request:v1";
|
|
|
5538
5538
|
var FLOW_BRIDGE_RESPONSE_EVENT = "fine-art-flow-bridge:response:v1";
|
|
5539
5539
|
var FLOW_BRIDGE_HELLO_TIMEOUT_MS = 1500;
|
|
5540
5540
|
var FLOW_BRIDGE_REQUEST_TIMEOUT_MS = 15e3;
|
|
5541
|
+
var FLOW_BRIDGE_CONNECT_TIMEOUT_MS = 3e5;
|
|
5541
5542
|
function isRecord(value) {
|
|
5542
5543
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
5543
5544
|
}
|
|
@@ -5604,13 +5605,23 @@ function createFlowBridgeClient({
|
|
|
5604
5605
|
}
|
|
5605
5606
|
return { available: true, name: bridge.name, version: bridge.version, protocol: bridge.protocol, roundTripMs };
|
|
5606
5607
|
},
|
|
5607
|
-
async
|
|
5608
|
+
async connect(env, { timeoutMs = FLOW_BRIDGE_CONNECT_TIMEOUT_MS } = {}) {
|
|
5609
|
+
const started = clock();
|
|
5610
|
+
const reply = await exchange({ op: "connect", env }, timeoutMs);
|
|
5611
|
+
const waitedMs = Math.round(clock() - started);
|
|
5612
|
+
if (!reply) {
|
|
5613
|
+
return { ok: false, error: { code: "no-bridge", message: `Keine Freigabe innerhalb von ${Math.round(timeoutMs / 1e3)} s \u2014 Extension fehlt, Frame nicht freigegeben oder Popup nicht bestaetigt.` }, waitedMs };
|
|
5614
|
+
}
|
|
5615
|
+
if (reply.ok !== true || reply.env !== env || typeof reply.server !== "string") return { ok: false, error: readError(reply.error), waitedMs };
|
|
5616
|
+
return { ok: true, env, server: reply.server, waitedMs };
|
|
5617
|
+
},
|
|
5618
|
+
async request(request, { timeoutMs = requestTimeoutMs } = {}) {
|
|
5608
5619
|
const started = clock();
|
|
5609
5620
|
const tokenSuffix = "tokenSuffix" in request && request.tokenSuffix !== void 0 ? { tokenSuffix: request.tokenSuffix } : {};
|
|
5610
|
-
const reply = await exchange({ op: "request", target: request.target, method: request.method, path: request.path, ...tokenSuffix },
|
|
5621
|
+
const reply = await exchange({ op: "request", target: request.target, method: request.method, path: request.path, ...tokenSuffix }, timeoutMs);
|
|
5611
5622
|
const roundTripMs = Math.round(clock() - started);
|
|
5612
5623
|
if (!reply) {
|
|
5613
|
-
return { ok: false, transport: null, status: null, data: null, latencyMs: null, roundTripMs, error: noBridge(
|
|
5624
|
+
return { ok: false, transport: null, status: null, data: null, latencyMs: null, roundTripMs, error: noBridge(timeoutMs) };
|
|
5614
5625
|
}
|
|
5615
5626
|
const ok = reply.ok === true;
|
|
5616
5627
|
return {
|
|
@@ -5852,6 +5863,235 @@ var FlowBridgePanel = ({ appVersion, client, hfToken }) => {
|
|
|
5852
5863
|
] });
|
|
5853
5864
|
};
|
|
5854
5865
|
|
|
5866
|
+
// src/components/FlowFineArtApp.tsx
|
|
5867
|
+
|
|
5868
|
+
|
|
5869
|
+
// src/lib/flowAppLoader.ts
|
|
5870
|
+
var FLOW_APP_TARGETS = {
|
|
5871
|
+
dev: { bridgeTarget: "devMcp", backendUrl: "https://dev-app.art-by-rolands.de" },
|
|
5872
|
+
prod: { bridgeTarget: "prodMcp", backendUrl: "https://app.art-by-rolands.de" }
|
|
5873
|
+
};
|
|
5874
|
+
var FLOW_APP_FILES = ["react-runtime.js", "master.css", "app.js"];
|
|
5875
|
+
var FLOW_APP_REQUEST_TIMEOUT_MS = 75e3;
|
|
5876
|
+
var FLOW_APP_SCRIPT_TIMEOUT_MS = 15e3;
|
|
5877
|
+
var CSP_SETTLE_MS2 = 100;
|
|
5878
|
+
function isRecord3(value) {
|
|
5879
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
5880
|
+
}
|
|
5881
|
+
function readFlowAppFile(data, file) {
|
|
5882
|
+
if (!isRecord3(data)) return null;
|
|
5883
|
+
const { sha256, source } = data;
|
|
5884
|
+
if (data.file !== file) return null;
|
|
5885
|
+
if (typeof sha256 !== "string" || !/^[0-9a-f]{64}$/.test(sha256)) return null;
|
|
5886
|
+
if (typeof source !== "string" || source.length === 0) return null;
|
|
5887
|
+
return { file, sha256, source };
|
|
5888
|
+
}
|
|
5889
|
+
async function sha256Hex2(text) {
|
|
5890
|
+
if (!_optionalChain([globalThis, 'access', _182 => _182.crypto, 'optionalAccess', _183 => _183.subtle])) throw new Error("crypto.subtle ist in diesem Kontext nicht verfuegbar.");
|
|
5891
|
+
const digest = await globalThis.crypto.subtle.digest("SHA-256", new TextEncoder().encode(text));
|
|
5892
|
+
return [...new Uint8Array(digest)].map((byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
5893
|
+
}
|
|
5894
|
+
var message2 = (error) => error instanceof Error ? error.message : String(error);
|
|
5895
|
+
var wait2 = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
5896
|
+
async function runScriptBlob(source, doc, timeoutMs, step) {
|
|
5897
|
+
const onViolation = (event) => {
|
|
5898
|
+
const violation = event;
|
|
5899
|
+
step.cspViolations.push(`${violation.effectiveDirective || violation.violatedDirective}: ${violation.blockedURI || "unbekannt"}`);
|
|
5900
|
+
};
|
|
5901
|
+
doc.addEventListener("securitypolicyviolation", onViolation);
|
|
5902
|
+
let url = null;
|
|
5903
|
+
let script = null;
|
|
5904
|
+
try {
|
|
5905
|
+
url = URL.createObjectURL(new Blob([source], { type: "text/javascript" }));
|
|
5906
|
+
const element = doc.createElement("script");
|
|
5907
|
+
script = element;
|
|
5908
|
+
step.scriptEvent = await new Promise((resolve) => {
|
|
5909
|
+
const timer = setTimeout(() => resolve("timeout"), timeoutMs);
|
|
5910
|
+
element.addEventListener("load", () => {
|
|
5911
|
+
clearTimeout(timer);
|
|
5912
|
+
resolve("load");
|
|
5913
|
+
});
|
|
5914
|
+
element.addEventListener("error", () => {
|
|
5915
|
+
clearTimeout(timer);
|
|
5916
|
+
resolve("error");
|
|
5917
|
+
});
|
|
5918
|
+
element.src = url;
|
|
5919
|
+
(_nullishCoalesce(doc.head, () => ( doc.documentElement))).appendChild(element);
|
|
5920
|
+
});
|
|
5921
|
+
} catch (error) {
|
|
5922
|
+
step.error = `Skript nicht einfuegbar: ${message2(error)}`;
|
|
5923
|
+
}
|
|
5924
|
+
if (step.scriptEvent !== "load") await wait2(CSP_SETTLE_MS2);
|
|
5925
|
+
doc.removeEventListener("securitypolicyviolation", onViolation);
|
|
5926
|
+
_optionalChain([script, 'optionalAccess', _184 => _184.remove, 'call', _185 => _185()]);
|
|
5927
|
+
if (url) URL.revokeObjectURL(url);
|
|
5928
|
+
}
|
|
5929
|
+
function scriptFailure(step, expectation) {
|
|
5930
|
+
if (step.error) return step.error;
|
|
5931
|
+
if (step.scriptEvent === "load") return `script.onload, aber ${expectation} \u2014 Ausfuehrung nicht belegt.`;
|
|
5932
|
+
if (step.scriptEvent === "error") return "script.onerror \u2014 Skript nicht geladen oder blockiert.";
|
|
5933
|
+
return "Kein Skript-Ereignis innerhalb der Wartezeit.";
|
|
5934
|
+
}
|
|
5935
|
+
async function loadFlowApp({
|
|
5936
|
+
bridge,
|
|
5937
|
+
environment,
|
|
5938
|
+
tokenSuffix,
|
|
5939
|
+
win = window,
|
|
5940
|
+
doc = document,
|
|
5941
|
+
digest = sha256Hex2,
|
|
5942
|
+
scriptTimeoutMs = FLOW_APP_SCRIPT_TIMEOUT_MS,
|
|
5943
|
+
onStep
|
|
5944
|
+
}) {
|
|
5945
|
+
const target = FLOW_APP_TARGETS[environment];
|
|
5946
|
+
const globals = win;
|
|
5947
|
+
const steps = [];
|
|
5948
|
+
const report = () => _optionalChain([onStep, 'optionalCall', _186 => _186(steps.map((step) => ({ ...step, cspViolations: [...step.cspViolations] })))]);
|
|
5949
|
+
const fail3 = (step, error) => {
|
|
5950
|
+
step.error = error;
|
|
5951
|
+
report();
|
|
5952
|
+
return { ok: false, steps, error: `${step.file}: ${error}` };
|
|
5953
|
+
};
|
|
5954
|
+
let css = "";
|
|
5955
|
+
for (const file of FLOW_APP_FILES) {
|
|
5956
|
+
const step = { file, response: null, chars: null, hash: null, scriptEvent: null, cspViolations: [], error: null };
|
|
5957
|
+
steps.push(step);
|
|
5958
|
+
report();
|
|
5959
|
+
step.response = await bridge.request(
|
|
5960
|
+
{ target: target.bridgeTarget, method: "GET", path: `/flow-app/bundle/${file}`, tokenSuffix },
|
|
5961
|
+
{ timeoutMs: FLOW_APP_REQUEST_TIMEOUT_MS }
|
|
5962
|
+
);
|
|
5963
|
+
if (!step.response.ok) {
|
|
5964
|
+
const status = step.response.status !== null ? `HTTP ${step.response.status} \xB7 ` : "";
|
|
5965
|
+
return fail3(step, `${status}${_optionalChain([step, 'access', _187 => _187.response, 'access', _188 => _188.error, 'optionalAccess', _189 => _189.code])}: ${_optionalChain([step, 'access', _190 => _190.response, 'access', _191 => _191.error, 'optionalAccess', _192 => _192.message])}`);
|
|
5966
|
+
}
|
|
5967
|
+
const loaded = readFlowAppFile(step.response.data, file);
|
|
5968
|
+
if (!loaded) return fail3(step, "Antwort ohne gueltige Datei.");
|
|
5969
|
+
step.chars = loaded.source.length;
|
|
5970
|
+
try {
|
|
5971
|
+
step.hash = await digest(loaded.source) === loaded.sha256 ? "ok" : "mismatch";
|
|
5972
|
+
} catch (e21) {
|
|
5973
|
+
step.hash = "unavailable";
|
|
5974
|
+
}
|
|
5975
|
+
if (step.hash === "mismatch") return fail3(step, "SHA-256 des empfangenen Quelltexts weicht ab \u2014 nicht ausgefuehrt.");
|
|
5976
|
+
if (file === "master.css") {
|
|
5977
|
+
css = loaded.source;
|
|
5978
|
+
report();
|
|
5979
|
+
continue;
|
|
5980
|
+
}
|
|
5981
|
+
if (file === "app.js") delete globals.FineArtApp;
|
|
5982
|
+
await runScriptBlob(loaded.source, doc, scriptTimeoutMs, step);
|
|
5983
|
+
if (file === "react-runtime.js") {
|
|
5984
|
+
const ReactDOM = globals.ReactDOM;
|
|
5985
|
+
if (!isRecord3(globals.React) || typeof _optionalChain([ReactDOM, 'optionalAccess', _193 => _193.createRoot]) !== "function") {
|
|
5986
|
+
return fail3(step, scriptFailure(step, "window.React/window.ReactDOM.createRoot fehlen"));
|
|
5987
|
+
}
|
|
5988
|
+
} else if (typeof globals.FineArtApp !== "function") {
|
|
5989
|
+
return fail3(step, scriptFailure(step, "window.FineArtApp fehlt"));
|
|
5990
|
+
}
|
|
5991
|
+
report();
|
|
5992
|
+
}
|
|
5993
|
+
return {
|
|
5994
|
+
ok: true,
|
|
5995
|
+
steps,
|
|
5996
|
+
css,
|
|
5997
|
+
runtime: {
|
|
5998
|
+
React: globals.React,
|
|
5999
|
+
ReactDOM: globals.ReactDOM,
|
|
6000
|
+
FineArtApp: globals.FineArtApp
|
|
6001
|
+
},
|
|
6002
|
+
backendUrl: target.backendUrl
|
|
6003
|
+
};
|
|
6004
|
+
}
|
|
6005
|
+
|
|
6006
|
+
// src/components/FlowFineArtApp.tsx
|
|
6007
|
+
|
|
6008
|
+
var FLOW_APP_STYLE_ID = "fa-flow-app-master-css";
|
|
6009
|
+
var BAR_HEIGHT = 32;
|
|
6010
|
+
function stepText(step) {
|
|
6011
|
+
const parts = [step.file];
|
|
6012
|
+
if (step.response) {
|
|
6013
|
+
parts.push(step.response.status !== null ? `HTTP ${step.response.status}` : "kein HTTP-Status");
|
|
6014
|
+
parts.push(`${_nullishCoalesce(step.response.transport, () => ( "kein Transport"))} \xB7 ${step.response.roundTripMs} ms`);
|
|
6015
|
+
} else {
|
|
6016
|
+
parts.push("l\xE4dt\u2026");
|
|
6017
|
+
}
|
|
6018
|
+
if (step.chars !== null) parts.push(`${step.chars} Zeichen`);
|
|
6019
|
+
if (step.hash === "ok") parts.push("Hash gepr\xFCft");
|
|
6020
|
+
if (step.hash === "unavailable") parts.push("Hash nicht pr\xFCfbar");
|
|
6021
|
+
if (step.scriptEvent) parts.push(`Skript ${step.scriptEvent}`);
|
|
6022
|
+
if (step.cspViolations.length > 0) parts.push(`CSP: ${step.cspViolations.join("; ")}`);
|
|
6023
|
+
if (step.error) parts.push(`FEHLER: ${step.error}`);
|
|
6024
|
+
return parts.join(" \xB7 ");
|
|
6025
|
+
}
|
|
6026
|
+
var FlowFineArtApp = ({ environment, hfToken, appVersion, client, onClose }) => {
|
|
6027
|
+
const bridge = _react.useMemo.call(void 0, () => _nullishCoalesce(client, () => ( createFlowBridgeClient({ appVersion }))), [client, appVersion]);
|
|
6028
|
+
const [connection, setConnection] = _react.useState.call(void 0, null);
|
|
6029
|
+
const [steps, setSteps] = _react.useState.call(void 0, []);
|
|
6030
|
+
const [load, setLoad] = _react.useState.call(void 0, null);
|
|
6031
|
+
const [renderError, setRenderError] = _react.useState.call(void 0, null);
|
|
6032
|
+
const appRootRef = _react.useRef.call(void 0, null);
|
|
6033
|
+
const tokenSuffix = hfTokenSuffix(hfToken);
|
|
6034
|
+
const target = FLOW_APP_TARGETS[environment];
|
|
6035
|
+
_react.useEffect.call(void 0, () => {
|
|
6036
|
+
if (!tokenSuffix) return void 0;
|
|
6037
|
+
let active = true;
|
|
6038
|
+
void (async () => {
|
|
6039
|
+
const connected = bridge.connect ? await bridge.connect(environment) : { ok: false, error: { code: "no-bridge", message: "Bridge-Client ohne connect." }, waitedMs: 0 };
|
|
6040
|
+
if (!active) return;
|
|
6041
|
+
setConnection(connected);
|
|
6042
|
+
if (!connected.ok) return;
|
|
6043
|
+
const result = await loadFlowApp({ bridge, environment, tokenSuffix, onStep: (next) => {
|
|
6044
|
+
if (active) setSteps(next);
|
|
6045
|
+
} });
|
|
6046
|
+
if (active) setLoad(result);
|
|
6047
|
+
})();
|
|
6048
|
+
return () => {
|
|
6049
|
+
active = false;
|
|
6050
|
+
};
|
|
6051
|
+
}, [bridge, environment, tokenSuffix]);
|
|
6052
|
+
_react.useEffect.call(void 0, () => {
|
|
6053
|
+
const container = appRootRef.current;
|
|
6054
|
+
if (!_optionalChain([load, 'optionalAccess', _194 => _194.ok]) || !container) return void 0;
|
|
6055
|
+
const style = document.createElement("style");
|
|
6056
|
+
style.id = FLOW_APP_STYLE_ID;
|
|
6057
|
+
style.textContent = load.css;
|
|
6058
|
+
document.head.appendChild(style);
|
|
6059
|
+
let root = null;
|
|
6060
|
+
try {
|
|
6061
|
+
root = load.runtime.ReactDOM.createRoot(container);
|
|
6062
|
+
root.render(load.runtime.React.createElement(load.runtime.FineArtApp, {
|
|
6063
|
+
customTabs: [],
|
|
6064
|
+
apiKey: null,
|
|
6065
|
+
backendUrl: load.backendUrl,
|
|
6066
|
+
transport: "flow-bridge"
|
|
6067
|
+
}));
|
|
6068
|
+
} catch (error) {
|
|
6069
|
+
setRenderError(error instanceof Error ? error.message : String(error));
|
|
6070
|
+
}
|
|
6071
|
+
return () => {
|
|
6072
|
+
_optionalChain([root, 'optionalAccess', _195 => _195.unmount, 'call', _196 => _196()]);
|
|
6073
|
+
style.remove();
|
|
6074
|
+
};
|
|
6075
|
+
}, [load]);
|
|
6076
|
+
const failed = !tokenSuffix || connection !== null && !connection.ok || load !== null && !load.ok || renderError !== null;
|
|
6077
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "fixed inset-0 bg-[#0e0e0e] flex flex-col", "data-testid": "flow-fine-art-app", children: [
|
|
6078
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-3 px-3 text-[11px] font-mono text-white/60", style: { height: BAR_HEIGHT, borderBottom: "1px solid rgba(255,255,255,0.08)" }, children: [
|
|
6079
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { type: "button", onClick: onClose, className: "font-bold text-white/80", children: "\u2190 FlowFA" }),
|
|
6080
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: `Fine-Art App \xB7 ${environment.toUpperCase()} \xB7 ${target.backendUrl}` })
|
|
6081
|
+
] }),
|
|
6082
|
+
!_optionalChain([load, 'optionalAccess', _197 => _197.ok]) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-1 p-4 text-[11px] font-mono break-all", "data-testid": "flow-fine-art-app-steps", children: [
|
|
6083
|
+
!tokenSuffix && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { role: "alert", style: { color: "#f87171" }, children: "Kein HF-Token in FlowFA gesetzt \u2014 ohne ihn kein Zugang zum MCP-Host." }),
|
|
6084
|
+
tokenSuffix && !connection && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "data-testid": "flow-fine-art-app-connect", style: { color: "#fbbf24" }, children: `Freigabe n\xF6tig: Extension-Popup \u201EFine-Art Flow Bridge\u201C \xF6ffnen (Zahl am Symbol) \u2192 \u201EFreigeben\u201C f\xFCr ${environment.toUpperCase()} (${target.backendUrl}).` }),
|
|
6085
|
+
connection && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "data-testid": "flow-fine-art-app-connect", style: { color: connection.ok ? "rgba(255,255,255,0.6)" : "#f87171" }, children: connection.ok ? `Freigegeben f\xFCr dieses Dokument \xB7 ${connection.server} \xB7 nach ${connection.waitedMs} ms` : `Keine Freigabe \u2014 ${connection.error.code}: ${connection.error.message}` }),
|
|
6086
|
+
connection && !connection.ok && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { role: "alert", className: "font-bold", style: { color: "#f87171" }, children: "App nicht gestartet \u2014 ohne Freigabe erreicht sie ihren Server nicht." }),
|
|
6087
|
+
steps.map((step) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: { color: step.error ? "#f87171" : "rgba(255,255,255,0.6)" }, children: stepText(step) }, step.file)),
|
|
6088
|
+
load && !load.ok && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { role: "alert", className: "font-bold", style: { color: "#f87171" }, children: `App nicht gestartet \u2014 ${load.error}` })
|
|
6089
|
+
] }),
|
|
6090
|
+
renderError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { role: "alert", className: "p-4 text-[11px] font-mono", style: { color: "#f87171" }, children: `App nicht gerendert \u2014 ${renderError}` }),
|
|
6091
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ref: appRootRef, className: "flex-1 overflow-auto", style: { display: _optionalChain([load, 'optionalAccess', _198 => _198.ok]) && !failed ? "block" : "none" } })
|
|
6092
|
+
] });
|
|
6093
|
+
};
|
|
6094
|
+
|
|
5855
6095
|
// src/lib/flowBootstrapTarget.ts
|
|
5856
6096
|
var PROD_NAMESPACE = "app.art-by-rolands.de/";
|
|
5857
6097
|
var DEV_NAMESPACE = "dev-app.art-by-rolands.de/";
|
|
@@ -5902,6 +6142,10 @@ function resolveBootstrapTarget(input) {
|
|
|
5902
6142
|
environment: environmentForNamespace(namespace)
|
|
5903
6143
|
};
|
|
5904
6144
|
}
|
|
6145
|
+
function flowAppEnvironment(target, isDialogTarget, selectedNamespace) {
|
|
6146
|
+
if (isDialogTarget) return environmentForNamespace(normalizeSelectableNamespace(selectedNamespace));
|
|
6147
|
+
return target.ready ? target.environment : null;
|
|
6148
|
+
}
|
|
5905
6149
|
|
|
5906
6150
|
// src/components/AvatarArchitectApp.tsx
|
|
5907
6151
|
|
|
@@ -5919,16 +6163,17 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
5919
6163
|
const [layoutChoice, setLayoutChoice] = _react.useState.call(void 0, () => {
|
|
5920
6164
|
try {
|
|
5921
6165
|
return localStorage.getItem("aa-layout") || null;
|
|
5922
|
-
} catch (
|
|
6166
|
+
} catch (e22) {
|
|
5923
6167
|
return null;
|
|
5924
6168
|
}
|
|
5925
6169
|
});
|
|
5926
6170
|
const [hfToken, setHfToken] = _react.useState.call(void 0, initialHfToken || "");
|
|
6171
|
+
const [serverAppEnvironment, setServerAppEnvironment] = _react.useState.call(void 0, null);
|
|
5927
6172
|
const [hfTokenInput, setHfTokenInput] = _react.useState.call(void 0, initialHfToken || "");
|
|
5928
6173
|
const [hfNamespaceLocal, setHfNamespaceLocal] = _react.useState.call(void 0, () => {
|
|
5929
6174
|
try {
|
|
5930
6175
|
return normalizeSelectableNamespace(localStorage.getItem("aa-hf-namespace"));
|
|
5931
|
-
} catch (
|
|
6176
|
+
} catch (e23) {
|
|
5932
6177
|
return DEFAULT_NAMESPACE;
|
|
5933
6178
|
}
|
|
5934
6179
|
});
|
|
@@ -6031,7 +6276,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
6031
6276
|
const startApp = (choice) => {
|
|
6032
6277
|
try {
|
|
6033
6278
|
localStorage.setItem("aa-layout", choice);
|
|
6034
|
-
} catch (
|
|
6279
|
+
} catch (e24) {
|
|
6035
6280
|
}
|
|
6036
6281
|
setLayoutChoice(choice);
|
|
6037
6282
|
setTargetConfirmed(true);
|
|
@@ -6052,7 +6297,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
6052
6297
|
const loadThumbnailsForEntries = _react.useCallback.call(void 0, async (entries) => {
|
|
6053
6298
|
await loadThumbnailsSequentially(entries, {
|
|
6054
6299
|
inFlight: hfInFlightRef.current,
|
|
6055
|
-
isAlreadyLoaded: (entry) => !!_optionalChain([galleryItemsRef, 'access',
|
|
6300
|
+
isAlreadyLoaded: (entry) => !!_optionalChain([galleryItemsRef, 'access', _199 => _199.current, 'access', _200 => _200.find, 'call', _201 => _201((g) => g.id === entry.id), 'optionalAccess', _202 => _202.base64]),
|
|
6056
6301
|
isKnownMissing: (entry) => hfImageNotFoundRef.current.has(entry.id),
|
|
6057
6302
|
loadImage: (entry) => _chunkVSHSZEGVjs.hfLoadImageAsBase64.call(void 0, entry.id, hfToken, effectiveNamespace, entry.filename, void 0, entry.mimeType, entry.hasThumb),
|
|
6058
6303
|
onLoaded: (entry, b64) => {
|
|
@@ -6071,7 +6316,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
6071
6316
|
}, [hfToken, effectiveNamespace]);
|
|
6072
6317
|
_react.useEffect.call(void 0, () => {
|
|
6073
6318
|
if (!hfState) return;
|
|
6074
|
-
if (_optionalChain([hfState, 'access',
|
|
6319
|
+
if (_optionalChain([hfState, 'access', _203 => _203.tags, 'optionalAccess', _204 => _204.by_category])) setWorkspaceTags(hfState.tags);
|
|
6075
6320
|
const hfIds = new Set(hfState.metadata.map((m) => m.id));
|
|
6076
6321
|
const skeletons = hfState.metadata.map((m) => ({
|
|
6077
6322
|
id: m.id,
|
|
@@ -6117,7 +6362,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
6117
6362
|
try {
|
|
6118
6363
|
const v = parseInt(localStorage.getItem("aa-image-count") || "", 10);
|
|
6119
6364
|
return v >= 1 && v <= 8 ? v : 4;
|
|
6120
|
-
} catch (
|
|
6365
|
+
} catch (e25) {
|
|
6121
6366
|
return 4;
|
|
6122
6367
|
}
|
|
6123
6368
|
});
|
|
@@ -6126,7 +6371,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
6126
6371
|
setImageCount(n);
|
|
6127
6372
|
try {
|
|
6128
6373
|
localStorage.setItem("aa-image-count", String(n));
|
|
6129
|
-
} catch (
|
|
6374
|
+
} catch (e26) {
|
|
6130
6375
|
}
|
|
6131
6376
|
};
|
|
6132
6377
|
const imageCountOptions = [
|
|
@@ -6140,14 +6385,14 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
6140
6385
|
const [leftPanelWidth, setLeftPanelWidth] = _react.useState.call(void 0, () => {
|
|
6141
6386
|
try {
|
|
6142
6387
|
return parseInt(localStorage.getItem("aa-left-width") || "260", 10);
|
|
6143
|
-
} catch (
|
|
6388
|
+
} catch (e27) {
|
|
6144
6389
|
return 260;
|
|
6145
6390
|
}
|
|
6146
6391
|
});
|
|
6147
6392
|
const [rightPanelWidth, setRightPanelWidth] = _react.useState.call(void 0, () => {
|
|
6148
6393
|
try {
|
|
6149
6394
|
return parseInt(localStorage.getItem("aa-right-width") || "320", 10);
|
|
6150
|
-
} catch (
|
|
6395
|
+
} catch (e28) {
|
|
6151
6396
|
return 320;
|
|
6152
6397
|
}
|
|
6153
6398
|
});
|
|
@@ -6156,7 +6401,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
6156
6401
|
const [highContrast, setHighContrast] = _react.useState.call(void 0, () => {
|
|
6157
6402
|
try {
|
|
6158
6403
|
return localStorage.getItem("aa-contrast") === "high";
|
|
6159
|
-
} catch (
|
|
6404
|
+
} catch (e29) {
|
|
6160
6405
|
return false;
|
|
6161
6406
|
}
|
|
6162
6407
|
});
|
|
@@ -6169,14 +6414,14 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
6169
6414
|
const [zoomOffset, setZoomOffset] = _react.useState.call(void 0, { x: 0, y: 0 });
|
|
6170
6415
|
const { historyVisible, galleryVisible } = computePrefetchVisibility({
|
|
6171
6416
|
layoutChoice,
|
|
6172
|
-
appShellVisible: !showStart && !requireWorkspaceSelection && !(isFullscreen && !!_optionalChain([currentResult, 'optionalAccess',
|
|
6417
|
+
appShellVisible: !showStart && !requireWorkspaceSelection && !(isFullscreen && !!_optionalChain([currentResult, 'optionalAccess', _205 => _205.base64])),
|
|
6173
6418
|
mobileTab,
|
|
6174
6419
|
middlePanel,
|
|
6175
6420
|
activeTab,
|
|
6176
6421
|
isRightCollapsed
|
|
6177
6422
|
});
|
|
6178
6423
|
useThumbnailPrefetch({
|
|
6179
|
-
metadata: _optionalChain([hfState, 'optionalAccess',
|
|
6424
|
+
metadata: _optionalChain([hfState, 'optionalAccess', _206 => _206.metadata]),
|
|
6180
6425
|
historyVisible,
|
|
6181
6426
|
galleryVisible,
|
|
6182
6427
|
historyVisibleCount,
|
|
@@ -6232,12 +6477,12 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
6232
6477
|
setHighContrast(next);
|
|
6233
6478
|
try {
|
|
6234
6479
|
localStorage.setItem("aa-contrast", next ? "high" : "low");
|
|
6235
|
-
} catch (
|
|
6480
|
+
} catch (e30) {
|
|
6236
6481
|
}
|
|
6237
6482
|
};
|
|
6238
6483
|
const handleSelectReference = async () => {
|
|
6239
6484
|
const media = await onSelectMedia();
|
|
6240
|
-
if (!_optionalChain([media, 'optionalAccess',
|
|
6485
|
+
if (!_optionalChain([media, 'optionalAccess', _207 => _207.length])) return;
|
|
6241
6486
|
const first = media[0];
|
|
6242
6487
|
if (first.mediaId) {
|
|
6243
6488
|
setActiveReferenceId(first.mediaId);
|
|
@@ -6260,7 +6505,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
6260
6505
|
generateImage: onGenerateImage,
|
|
6261
6506
|
saveResult: async (item) => {
|
|
6262
6507
|
const frame = item.frames[0];
|
|
6263
|
-
if (_optionalChain([frame, 'optionalAccess',
|
|
6508
|
+
if (_optionalChain([frame, 'optionalAccess', _208 => _208.base64])) {
|
|
6264
6509
|
const gen = frameToGeneration(frame, item);
|
|
6265
6510
|
setGalleryItems((prev) => [gen, ...prev]);
|
|
6266
6511
|
setHistory((prev) => [gen, ...prev]);
|
|
@@ -6278,7 +6523,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
6278
6523
|
setLeftPanelWidth(w);
|
|
6279
6524
|
try {
|
|
6280
6525
|
localStorage.setItem("aa-left-width", String(w));
|
|
6281
|
-
} catch (
|
|
6526
|
+
} catch (e31) {
|
|
6282
6527
|
}
|
|
6283
6528
|
};
|
|
6284
6529
|
const onUp = () => {
|
|
@@ -6297,7 +6542,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
6297
6542
|
setRightPanelWidth(w);
|
|
6298
6543
|
try {
|
|
6299
6544
|
localStorage.setItem("aa-right-width", String(w));
|
|
6300
|
-
} catch (
|
|
6545
|
+
} catch (e32) {
|
|
6301
6546
|
}
|
|
6302
6547
|
};
|
|
6303
6548
|
const onUp = () => {
|
|
@@ -6328,7 +6573,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
6328
6573
|
setIsScanningImage(false);
|
|
6329
6574
|
}
|
|
6330
6575
|
};
|
|
6331
|
-
const currentIndex = _react.useMemo.call(void 0, () => history.findIndex((h) => h.id === _optionalChain([currentResult, 'optionalAccess',
|
|
6576
|
+
const currentIndex = _react.useMemo.call(void 0, () => history.findIndex((h) => h.id === _optionalChain([currentResult, 'optionalAccess', _209 => _209.id])), [history, currentResult]);
|
|
6332
6577
|
const goToPrev = _react.useCallback.call(void 0, () => {
|
|
6333
6578
|
if (currentIndex > 0) setCurrentResult(history[currentIndex - 1]);
|
|
6334
6579
|
}, [currentIndex, history]);
|
|
@@ -6342,7 +6587,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
6342
6587
|
_chunkVSHSZEGVjs.hfLoadImageAsBase64.call(void 0, g.id, hfToken, effectiveNamespace, g.filename, void 0, g.mimeType, false).then((b64) => {
|
|
6343
6588
|
if (!b64) return;
|
|
6344
6589
|
const full = `data:${g.mimeType || "image/jpeg"};base64,${b64}`;
|
|
6345
|
-
setCurrentResult((prev) => _optionalChain([prev, 'optionalAccess',
|
|
6590
|
+
setCurrentResult((prev) => _optionalChain([prev, 'optionalAccess', _210 => _210.id]) === g.id ? { ...prev, fullBase64: full } : prev);
|
|
6346
6591
|
setGalleryItems((prev) => prev.map((item) => item.id === g.id ? { ...item, fullBase64: full } : item));
|
|
6347
6592
|
}).catch(() => {
|
|
6348
6593
|
});
|
|
@@ -6358,13 +6603,13 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
6358
6603
|
}
|
|
6359
6604
|
}, [hfToken, effectiveNamespace, hfWriteEvent]);
|
|
6360
6605
|
const currentGroup = _react.useMemo.call(void 0, () => {
|
|
6361
|
-
if (!_optionalChain([currentResult, 'optionalAccess',
|
|
6606
|
+
if (!_optionalChain([currentResult, 'optionalAccess', _211 => _211.prompt])) return [];
|
|
6362
6607
|
const groups = groupByPrompt(galleryItems.filter((g) => g.status === "done" && !!g.base64));
|
|
6363
6608
|
const group = groups.find((gr) => gr.prompt === currentResult.prompt);
|
|
6364
6609
|
return group ? group.items : [];
|
|
6365
|
-
}, [galleryItems, _optionalChain([currentResult, 'optionalAccess',
|
|
6610
|
+
}, [galleryItems, _optionalChain([currentResult, 'optionalAccess', _212 => _212.prompt])]);
|
|
6366
6611
|
_react.useEffect.call(void 0, () => {
|
|
6367
|
-
if (!_optionalChain([currentResult, 'optionalAccess',
|
|
6612
|
+
if (!_optionalChain([currentResult, 'optionalAccess', _213 => _213.prompt]) || !hfToken || !effectiveNamespace || !hfState) return;
|
|
6368
6613
|
const siblings = galleryItemsRef.current.filter(
|
|
6369
6614
|
(g) => g.prompt === currentResult.prompt && !g.base64 && !hfImageNotFoundRef.current.has(g.id)
|
|
6370
6615
|
);
|
|
@@ -6382,12 +6627,12 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
6382
6627
|
const prefix = `data:${meta.mimeType || "image/jpeg"};base64,`;
|
|
6383
6628
|
setGalleryItems((prev) => prev.map((g) => g.id === sib.id && !g.base64 ? { ...g, base64: prefix + b64 } : g));
|
|
6384
6629
|
setHistory((prev) => prev.map((g) => g.id === sib.id && !g.base64 ? { ...g, base64: prefix + b64 } : g));
|
|
6385
|
-
} catch (
|
|
6630
|
+
} catch (e33) {
|
|
6386
6631
|
hfImageNotFoundRef.current.set(sib.id, Date.now());
|
|
6387
6632
|
}
|
|
6388
6633
|
}
|
|
6389
6634
|
})();
|
|
6390
|
-
}, [_optionalChain([currentResult, 'optionalAccess',
|
|
6635
|
+
}, [_optionalChain([currentResult, 'optionalAccess', _214 => _214.id]), _optionalChain([currentResult, 'optionalAccess', _215 => _215.prompt])]);
|
|
6391
6636
|
const hcStyle = highContrast ? { filter: "brightness(1.6) contrast(1.05)" } : void 0;
|
|
6392
6637
|
const runningBadge = activeGenerationsCount > 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
6393
6638
|
"div",
|
|
@@ -6468,7 +6713,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
6468
6713
|
const errorGen = { ...newGen, status: "error", error: { message: err.message || "Unbekannter Fehler", details: err.toString() } };
|
|
6469
6714
|
setHistory((prev) => prev.map((g) => g.id === genId ? errorGen : g));
|
|
6470
6715
|
setGalleryItems((prev) => prev.filter((g) => g.id !== genId));
|
|
6471
|
-
if (!options.silent || _optionalChain([currentResult, 'optionalAccess',
|
|
6716
|
+
if (!options.silent || _optionalChain([currentResult, 'optionalAccess', _216 => _216.id]) === genId) setCurrentResult(errorGen);
|
|
6472
6717
|
} finally {
|
|
6473
6718
|
setActiveGenerationsCount((prev) => Math.max(0, prev - 1));
|
|
6474
6719
|
}
|
|
@@ -6524,7 +6769,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
6524
6769
|
setActivePrompt(prompt);
|
|
6525
6770
|
setFocusedNodeId(nodeId);
|
|
6526
6771
|
if (autoGenerate) handleGenerateImage(prompt, void 0, nodeId);
|
|
6527
|
-
} catch (
|
|
6772
|
+
} catch (e34) {
|
|
6528
6773
|
setActivePrompt("Synthese-Fehler");
|
|
6529
6774
|
} finally {
|
|
6530
6775
|
setIsSynthesizing(false);
|
|
@@ -6597,14 +6842,14 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
6597
6842
|
const { prompt, feedback } = parsePromptResponse(raw);
|
|
6598
6843
|
setActivePrompt(prompt);
|
|
6599
6844
|
setPromptFeedback(feedback);
|
|
6600
|
-
} catch (
|
|
6845
|
+
} catch (e35) {
|
|
6601
6846
|
setActivePrompt("Synthese-Fehler");
|
|
6602
6847
|
} finally {
|
|
6603
6848
|
setIsPromptTabGenerating(false);
|
|
6604
6849
|
}
|
|
6605
6850
|
};
|
|
6606
6851
|
const handleDownloadSingle = async () => {
|
|
6607
|
-
if (!_optionalChain([currentResult, 'optionalAccess',
|
|
6852
|
+
if (!_optionalChain([currentResult, 'optionalAccess', _217 => _217.base64])) return;
|
|
6608
6853
|
try {
|
|
6609
6854
|
const downloadSrc = currentResult.fullBase64 || currentResult.base64;
|
|
6610
6855
|
const base64Data = downloadSrc.split(",")[1];
|
|
@@ -6620,9 +6865,9 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
6620
6865
|
const reader = new FileReader();
|
|
6621
6866
|
reader.onload = (ev) => {
|
|
6622
6867
|
try {
|
|
6623
|
-
const root = JSON.parse(_optionalChain([ev, 'access',
|
|
6868
|
+
const root = JSON.parse(_optionalChain([ev, 'access', _218 => _218.target, 'optionalAccess', _219 => _219.result]));
|
|
6624
6869
|
const rawTags = root.tags || root;
|
|
6625
|
-
if (!_optionalChain([rawTags, 'optionalAccess',
|
|
6870
|
+
if (!_optionalChain([rawTags, 'optionalAccess', _220 => _220.by_category])) return;
|
|
6626
6871
|
const filtered = {};
|
|
6627
6872
|
const EXCLUDED2 = ["pdf-export", "book.micro-edit-rules"];
|
|
6628
6873
|
Object.entries(rawTags.by_category).forEach(([cat, items]) => {
|
|
@@ -6639,7 +6884,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
6639
6884
|
};
|
|
6640
6885
|
const handleHfInitialSync = async (onProgress) => {
|
|
6641
6886
|
if (!hfToken || !effectiveNamespace) return;
|
|
6642
|
-
const existingIds = new Set((_optionalChain([hfState, 'optionalAccess',
|
|
6887
|
+
const existingIds = new Set((_optionalChain([hfState, 'optionalAccess', _221 => _221.metadata]) || []).map((m) => m.id));
|
|
6643
6888
|
const gens = galleryItems.filter((g) => g.base64 && g.status === "done" && !existingIds.has(g.id));
|
|
6644
6889
|
const total = gens.length;
|
|
6645
6890
|
onProgress(0, total);
|
|
@@ -6665,7 +6910,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
6665
6910
|
}
|
|
6666
6911
|
};
|
|
6667
6912
|
const mergeWorkspaceTags = (local, remote) => {
|
|
6668
|
-
if (!_optionalChain([remote, 'optionalAccess',
|
|
6913
|
+
if (!_optionalChain([remote, 'optionalAccess', _222 => _222.by_category])) return local;
|
|
6669
6914
|
const merged = {};
|
|
6670
6915
|
const allCategories = /* @__PURE__ */ new Set([...Object.keys(local.by_category), ...Object.keys(remote.by_category)]);
|
|
6671
6916
|
for (const cat of allCategories) {
|
|
@@ -6675,7 +6920,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
6675
6920
|
const localValues = new Set(localTags.map((t) => t.value));
|
|
6676
6921
|
const mergedLocal = localTags.map((t) => {
|
|
6677
6922
|
const remote2 = remoteMap.get(t.value);
|
|
6678
|
-
return _optionalChain([remote2, 'optionalAccess',
|
|
6923
|
+
return _optionalChain([remote2, 'optionalAccess', _223 => _223.is_deleted]) ? { ...t, is_deleted: true } : t;
|
|
6679
6924
|
});
|
|
6680
6925
|
const onlyInRemote = remoteTags.filter((t) => !localValues.has(t.value));
|
|
6681
6926
|
merged[cat] = [...mergedLocal, ...onlyInRemote];
|
|
@@ -6683,7 +6928,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
6683
6928
|
const all = Object.entries(merged).flatMap(([cat, tags]) => tags.map((t) => ({ ...t, category: cat })));
|
|
6684
6929
|
return { by_category: merged, all };
|
|
6685
6930
|
};
|
|
6686
|
-
if (isFullscreen && _optionalChain([currentResult, 'optionalAccess',
|
|
6931
|
+
if (isFullscreen && _optionalChain([currentResult, 'optionalAccess', _224 => _224.base64])) {
|
|
6687
6932
|
const fsRaw = currentResult.fullBase64 || currentResult.base64;
|
|
6688
6933
|
const fsBase64 = fsRaw.startsWith("data:") ? fsRaw : `data:image/png;base64,${fsRaw}`;
|
|
6689
6934
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
@@ -6734,7 +6979,11 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
6734
6979
|
}
|
|
6735
6980
|
);
|
|
6736
6981
|
}
|
|
6982
|
+
if (serverAppEnvironment) {
|
|
6983
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FlowFineArtApp, { environment: serverAppEnvironment, hfToken, appVersion: version, onClose: () => setServerAppEnvironment(null) });
|
|
6984
|
+
}
|
|
6737
6985
|
if (showStart) {
|
|
6986
|
+
const serverAppTarget = flowAppEnvironment(bootstrapTarget, isDialogTarget, hfNamespaceLocal);
|
|
6738
6987
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "fixed inset-0 bg-[#0e0e0e] flex flex-col items-center justify-center p-6", style: { gap: 28, ...hcStyle }, children: [
|
|
6739
6988
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center gap-1", children: [
|
|
6740
6989
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined text-white/15 text-[44px]", children: "palette" }),
|
|
@@ -6797,7 +7046,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
6797
7046
|
setHfNamespaceLocal(ns);
|
|
6798
7047
|
try {
|
|
6799
7048
|
localStorage.setItem("aa-hf-namespace", ns);
|
|
6800
|
-
} catch (
|
|
7049
|
+
} catch (e36) {
|
|
6801
7050
|
}
|
|
6802
7051
|
},
|
|
6803
7052
|
className: "px-3 py-1 rounded-lg text-[11px] font-bold transition-colors",
|
|
@@ -6834,6 +7083,19 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
6834
7083
|
layoutChoice === "mobile-desktop" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-white/20 text-[9px] text-center", children: "Mobil-Layout skaliert f\xFCr Desktop-Modus" }),
|
|
6835
7084
|
layoutChoice === "tablet-landscape" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-white/20 text-[9px] text-center", children: "2-Spalten-Layout f\xFCr Landscape-Tablet im Desktop-Mode" })
|
|
6836
7085
|
] }),
|
|
7086
|
+
serverAppTarget && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
7087
|
+
"button",
|
|
7088
|
+
{
|
|
7089
|
+
type: "button",
|
|
7090
|
+
onClick: () => setServerAppEnvironment(serverAppTarget),
|
|
7091
|
+
className: "flex items-center justify-center gap-2 w-full max-w-[280px] py-3 rounded-2xl border text-[11px] font-bold",
|
|
7092
|
+
style: { borderColor: "rgba(255,255,255,0.08)", color: "rgba(255,255,255,0.6)" },
|
|
7093
|
+
children: [
|
|
7094
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined text-[20px]", children: "web" }),
|
|
7095
|
+
`Fine-Art App (Server) \xB7 ${serverAppTarget.toUpperCase()}`
|
|
7096
|
+
]
|
|
7097
|
+
}
|
|
7098
|
+
),
|
|
6837
7099
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, FlowBridgePanel, { appVersion: version, hfToken })
|
|
6838
7100
|
] });
|
|
6839
7101
|
}
|
|
@@ -6898,7 +7160,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
6898
7160
|
}, children: [
|
|
6899
7161
|
mobileTab === "labs" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-col flex-1 min-h-0", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, LabsTab, { services: labServices, onResult: (item) => {
|
|
6900
7162
|
const frame = item.frames[0];
|
|
6901
|
-
if (_optionalChain([frame, 'optionalAccess',
|
|
7163
|
+
if (_optionalChain([frame, 'optionalAccess', _225 => _225.base64])) {
|
|
6902
7164
|
setCurrentResult(frameToGeneration(frame, item));
|
|
6903
7165
|
setMobileTab("stage");
|
|
6904
7166
|
}
|
|
@@ -6922,7 +7184,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
6922
7184
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, CompactDropdown, { value: selectedModel, onChange: setSelectedModel, options: [{ value: "\u{1F34C} Nano Banana Pro", label: "\u{1F34C} Nano Banana Pro" }, { value: "\u{1F34C} Nano Banana 2", label: "\u{1F34C} Nano Banana 2" }, { value: "Imagen 4", label: "Imagen 4" }] }),
|
|
6923
7185
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, CompactDropdown, { value: String(imageCount), displayValue: `${imageCount}\xD7`, onChange: updateImageCount, options: imageCountOptions }),
|
|
6924
7186
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex-1" }),
|
|
6925
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, TaskExecutor, { openTasks: _optionalChain([hfState, 'optionalAccess',
|
|
7187
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, TaskExecutor, { openTasks: _optionalChain([hfState, 'optionalAccess', _226 => _226.openTasks]) || {}, onExecute: handleExecuteTask, onTaskCompleted: handleTaskCompleted }),
|
|
6926
7188
|
runningBadge,
|
|
6927
7189
|
activeReferenceThumbnail ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-1 rounded-lg border border-white/20 bg-white/5 overflow-hidden mr-2", style: { height: 28 }, children: [
|
|
6928
7190
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: activeReferenceThumbnail, className: "h-full aspect-square object-cover" }),
|
|
@@ -6973,21 +7235,21 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
6973
7235
|
setTouchStartX(null);
|
|
6974
7236
|
},
|
|
6975
7237
|
children: [
|
|
6976
|
-
_optionalChain([currentResult, 'optionalAccess',
|
|
7238
|
+
_optionalChain([currentResult, 'optionalAccess', _227 => _227.status]) === "processing" && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center gap-3 opacity-40", children: [
|
|
6977
7239
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined text-[40px]", children: "hourglass_top" }),
|
|
6978
7240
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-[11px] uppercase font-bold tracking-widest", children: "Erstelle Bild..." })
|
|
6979
7241
|
] }),
|
|
6980
|
-
_optionalChain([currentResult, 'optionalAccess',
|
|
7242
|
+
_optionalChain([currentResult, 'optionalAccess', _228 => _228.status]) === "error" && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "p-6 text-center flex flex-col items-center gap-3", children: [
|
|
6981
7243
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined text-red-400 text-[36px]", children: "warning" }),
|
|
6982
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-white/50 text-[13px]", children: _optionalChain([currentResult, 'access',
|
|
7244
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-white/50 text-[13px]", children: _optionalChain([currentResult, 'access', _229 => _229.error, 'optionalAccess', _230 => _230.message]) }),
|
|
6983
7245
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { onClick: () => handleGenerateImage(currentResult.prompt), className: "px-4 py-2 rounded-lg border border-white/20 text-[13px] text-white/70 active:bg-white/10", children: "Erneut versuchen" })
|
|
6984
7246
|
] }),
|
|
6985
|
-
_optionalChain([currentResult, 'optionalAccess',
|
|
7247
|
+
_optionalChain([currentResult, 'optionalAccess', _231 => _231.status]) === "done" && currentResult.base64 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: currentResult.fullBase64 || currentResult.base64, className: "w-full h-full object-contain" }),
|
|
6986
7248
|
!currentResult && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center gap-2 opacity-10", children: [
|
|
6987
7249
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined text-[64px]", children: "palette" }),
|
|
6988
7250
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-[11px] font-bold uppercase tracking-[0.2em]", children: "Avatar Architect" })
|
|
6989
7251
|
] }),
|
|
6990
|
-
_optionalChain([currentResult, 'optionalAccess',
|
|
7252
|
+
_optionalChain([currentResult, 'optionalAccess', _232 => _232.status]) === "done" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { onClick: openFullscreen, className: "absolute top-2 right-2 w-8 h-8 flex items-center justify-center rounded-full bg-black/60 border border-white/10 z-10", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined text-[18px]", children: "fullscreen" }) }),
|
|
6991
7253
|
history.length > 1 && currentResult && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
6992
7254
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { onClick: goToPrev, disabled: currentIndex <= 0, className: "absolute left-2 top-1/2 -translate-y-1/2 w-10 h-10 flex items-center justify-center rounded-full bg-black/60 border border-white/10 disabled:opacity-0 transition-opacity", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined text-[22px]", children: "chevron_left" }) }),
|
|
6993
7255
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { onClick: goToNext, disabled: currentIndex >= history.length - 1, className: "absolute right-2 top-1/2 -translate-y-1/2 w-10 h-10 flex items-center justify-center rounded-full bg-black/60 border border-white/10 disabled:opacity-0 transition-opacity", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined text-[22px]", children: "chevron_right" }) }),
|
|
@@ -7000,7 +7262,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
7000
7262
|
]
|
|
7001
7263
|
}
|
|
7002
7264
|
),
|
|
7003
|
-
_optionalChain([currentResult, 'optionalAccess',
|
|
7265
|
+
_optionalChain([currentResult, 'optionalAccess', _233 => _233.status]) === "done" && currentGroup.length > 1 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mt-2 flex gap-1.5 overflow-x-auto pb-1", style: { scrollbarWidth: "none" }, children: currentGroup.map((item) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { position: "relative", flexShrink: 0 }, children: [
|
|
7004
7266
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7005
7267
|
"div",
|
|
7006
7268
|
{
|
|
@@ -7043,7 +7305,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
7043
7305
|
}
|
|
7044
7306
|
)
|
|
7045
7307
|
] }, item.id)) }),
|
|
7046
|
-
_optionalChain([currentResult, 'optionalAccess',
|
|
7308
|
+
_optionalChain([currentResult, 'optionalAccess', _234 => _234.status]) === "done" && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex gap-2 mt-3", children: [
|
|
7047
7309
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "button", { onClick: () => setActivePrompt(currentResult.prompt || ""), className: "flex-1 flex items-center justify-center gap-1.5 rounded-xl border border-white/10 bg-white/5 active:bg-white/10 transition-colors", style: { height: 44 }, children: [
|
|
7048
7310
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined text-[18px] text-white/60", children: "replay" }),
|
|
7049
7311
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-[12px] text-white/60", children: "Prompt" })
|
|
@@ -7065,14 +7327,14 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
7065
7327
|
hfToken && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { onClick: () => refreshHF(), disabled: isHfRefreshing, className: "w-12 flex items-center justify-center text-white/20 active:text-white transition-colors disabled:opacity-30", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `material-symbols-outlined text-[20px]${isHfRefreshing ? " animate-spin" : ""}`, children: "sync" }) })
|
|
7066
7328
|
] }),
|
|
7067
7329
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex-1 overflow-hidden relative", children: [
|
|
7068
|
-
activeTab === "history" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, HistoryPanel, { history, currentResultId: _optionalChain([currentResult, 'optionalAccess',
|
|
7330
|
+
activeTab === "history" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, HistoryPanel, { history, currentResultId: _optionalChain([currentResult, 'optionalAccess', _235 => _235.id]) || null, onSelect: handleGallerySelect, onDelete: (id) => setHistory((h) => h.filter((x) => x.id !== id)), visibleCount: historyVisibleCount, onLoadMore: () => setHistoryVisibleCount((c) => c + 20) }),
|
|
7069
7331
|
activeTab === "gallery" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7070
7332
|
MediaLibrary,
|
|
7071
7333
|
{
|
|
7072
7334
|
items: galleryItems,
|
|
7073
7335
|
onImport: async () => {
|
|
7074
7336
|
const media = await onSelectMedia();
|
|
7075
|
-
if (!_optionalChain([media, 'optionalAccess',
|
|
7337
|
+
if (!_optionalChain([media, 'optionalAccess', _236 => _236.length])) return;
|
|
7076
7338
|
setGalleryItems((prev) => [...media.map((m) => ({ id: crypto.randomUUID(), nodeId: "1", base64: `data:${m.mimeType};base64,${m.base64}`, mediaId: m.mediaId, prompt: m.name || "Importiert", timestamp: Date.now(), status: "done", tags: [], type: "import" })), ...prev]);
|
|
7077
7339
|
},
|
|
7078
7340
|
onDelete: (id) => setGalleryItems((g) => g.filter((x) => x.id !== id)),
|
|
@@ -7220,7 +7482,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
7220
7482
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, CompactDropdown, { value: selectedModel, onChange: setSelectedModel, options: [{ value: "\u{1F34C} Nano Banana Pro", label: "\u{1F34C} Nano Banana Pro" }, { value: "\u{1F34C} Nano Banana 2", label: "\u{1F34C} Nano Banana 2" }, { value: "Imagen 4", label: "Imagen 4" }] }),
|
|
7221
7483
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, CompactDropdown, { value: String(imageCount), displayValue: `${imageCount}\xD7`, onChange: updateImageCount, options: imageCountOptions }),
|
|
7222
7484
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: { flex: 1 } }),
|
|
7223
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, TaskExecutor, { openTasks: _optionalChain([hfState, 'optionalAccess',
|
|
7485
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, TaskExecutor, { openTasks: _optionalChain([hfState, 'optionalAccess', _237 => _237.openTasks]) || {}, onExecute: handleExecuteTask, onTaskCompleted: handleTaskCompleted }),
|
|
7224
7486
|
runningBadge,
|
|
7225
7487
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { onClick: toggleContrast, style: { color: "rgba(255,255,255,0.2)", background: "none", border: "none", cursor: "pointer", padding: 4, lineHeight: 0 }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined", style: { fontSize: 18 }, children: highContrast ? "light_mode" : "dark_mode" }) }),
|
|
7226
7488
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { onClick: () => setShowStart(true), style: { color: "rgba(255,255,255,0.2)", background: "none", border: "none", cursor: "pointer", padding: 4, lineHeight: 0 }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined", style: { fontSize: 18 }, children: "apps" }) })
|
|
@@ -7249,7 +7511,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
7249
7511
|
]
|
|
7250
7512
|
}
|
|
7251
7513
|
) }),
|
|
7252
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: { flex: 1, overflow: "hidden", position: "relative" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, HistoryPanel, { history, currentResultId: _optionalChain([currentResult, 'optionalAccess',
|
|
7514
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: { flex: 1, overflow: "hidden", position: "relative" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, HistoryPanel, { history, currentResultId: _optionalChain([currentResult, 'optionalAccess', _238 => _238.id]) || null, onSelect: handleGallerySelect, onDelete: (id) => setHistory((h) => h.filter((x) => x.id !== id)), visibleCount: historyVisibleCount, onLoadMore: () => setHistoryVisibleCount((c) => c + 20) }) })
|
|
7253
7515
|
] }),
|
|
7254
7516
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { flex: 1, height: tlH, display: "flex", flexDirection: "column", background: "#0b0b0b" }, children: [
|
|
7255
7517
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -7265,21 +7527,21 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
7265
7527
|
setTouchStartX(null);
|
|
7266
7528
|
},
|
|
7267
7529
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { height: "100%", width: "100%", borderRadius: 20, border: "1px solid rgba(255,255,255,0.05)", background: "rgba(0,0,0,0.4)", position: "relative", overflow: "hidden", display: "flex", alignItems: "center", justifyContent: "center" }, children: [
|
|
7268
|
-
_optionalChain([currentResult, 'optionalAccess',
|
|
7530
|
+
_optionalChain([currentResult, 'optionalAccess', _239 => _239.status]) === "processing" && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { display: "flex", flexDirection: "column", alignItems: "center", gap: 12, opacity: 0.4 }, children: [
|
|
7269
7531
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined", style: { fontSize: 36 }, children: "hourglass_top" }),
|
|
7270
7532
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: { fontSize: 10, color: "rgba(255,255,255,0.6)", textTransform: "uppercase", fontWeight: "bold", letterSpacing: "0.15em" }, children: "Erstelle Bild..." })
|
|
7271
7533
|
] }),
|
|
7272
|
-
_optionalChain([currentResult, 'optionalAccess',
|
|
7534
|
+
_optionalChain([currentResult, 'optionalAccess', _240 => _240.status]) === "error" && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { padding: 24, textAlign: "center", display: "flex", flexDirection: "column", alignItems: "center", gap: 12 }, children: [
|
|
7273
7535
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined", style: { fontSize: 32, color: "#f87171" }, children: "warning" }),
|
|
7274
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { style: { fontSize: 11, color: "rgba(255,255,255,0.5)", margin: 0 }, children: _optionalChain([currentResult, 'access',
|
|
7536
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { style: { fontSize: 11, color: "rgba(255,255,255,0.5)", margin: 0 }, children: _optionalChain([currentResult, 'access', _241 => _241.error, 'optionalAccess', _242 => _242.message]) }),
|
|
7275
7537
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { onClick: () => handleGenerateImage(currentResult.prompt), style: { padding: "8px 16px", borderRadius: 8, border: "1px solid rgba(255,255,255,0.2)", fontSize: 11, color: "rgba(255,255,255,0.7)", background: "none", cursor: "pointer", fontFamily: "inherit" }, children: "Erneut versuchen" })
|
|
7276
7538
|
] }),
|
|
7277
|
-
_optionalChain([currentResult, 'optionalAccess',
|
|
7539
|
+
_optionalChain([currentResult, 'optionalAccess', _243 => _243.status]) === "done" && currentResult.base64 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: currentResult.fullBase64 || currentResult.base64, style: { maxWidth: "100%", maxHeight: "100%", objectFit: "contain" } }),
|
|
7278
7540
|
!currentResult && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { display: "flex", flexDirection: "column", alignItems: "center", gap: 8, opacity: 0.1 }, children: [
|
|
7279
7541
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined", style: { fontSize: 64 }, children: "palette" }),
|
|
7280
7542
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: { fontSize: 11, fontWeight: "bold", textTransform: "uppercase", letterSpacing: "0.2em" }, children: "Avatar Architect" })
|
|
7281
7543
|
] }),
|
|
7282
|
-
_optionalChain([currentResult, 'optionalAccess',
|
|
7544
|
+
_optionalChain([currentResult, 'optionalAccess', _244 => _244.status]) === "done" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { onClick: openFullscreen, style: { position: "absolute", top: 8, right: 8, width: 32, height: 32, display: "flex", alignItems: "center", justifyContent: "center", borderRadius: "50%", background: "rgba(0,0,0,0.6)", border: "1px solid rgba(255,255,255,0.1)", cursor: "pointer", color: "#fff" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined", style: { fontSize: 18 }, children: "fullscreen" }) }),
|
|
7283
7545
|
history.length > 1 && currentResult && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
7284
7546
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { onClick: goToPrev, disabled: currentIndex <= 0, style: { position: "absolute", left: 8, top: "50%", transform: "translateY(-50%)", width: 36, height: 36, display: "flex", alignItems: "center", justifyContent: "center", borderRadius: "50%", background: "rgba(0,0,0,0.6)", border: "1px solid rgba(255,255,255,0.1)", cursor: "pointer", color: "#fff", opacity: currentIndex <= 0 ? 0 : 1, transition: "opacity 0.2s" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined", style: { fontSize: 20 }, children: "chevron_left" }) }),
|
|
7285
7547
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { onClick: goToNext, disabled: currentIndex >= history.length - 1, style: { position: "absolute", right: 8, top: "50%", transform: "translateY(-50%)", width: 36, height: 36, display: "flex", alignItems: "center", justifyContent: "center", borderRadius: "50%", background: "rgba(0,0,0,0.6)", border: "1px solid rgba(255,255,255,0.1)", cursor: "pointer", color: "#fff", opacity: currentIndex >= history.length - 1 ? 0 : 1, transition: "opacity 0.2s" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined", style: { fontSize: 20 }, children: "chevron_right" }) }),
|
|
@@ -7292,7 +7554,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
7292
7554
|
] })
|
|
7293
7555
|
}
|
|
7294
7556
|
),
|
|
7295
|
-
_optionalChain([currentResult, 'optionalAccess',
|
|
7557
|
+
_optionalChain([currentResult, 'optionalAccess', _245 => _245.status]) === "done" && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { padding: "0 16px 16px", display: "flex", gap: 8, flexShrink: 0 }, children: [
|
|
7296
7558
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "button", { onClick: () => setActivePrompt(currentResult.prompt || ""), style: { flex: 1, height: 40, display: "flex", alignItems: "center", justifyContent: "center", gap: 6, borderRadius: 10, border: "1px solid rgba(255,255,255,0.1)", background: "rgba(255,255,255,0.05)", color: "rgba(255,255,255,0.6)", fontSize: 11, cursor: "pointer", fontFamily: "inherit" }, children: [
|
|
7297
7559
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined", style: { fontSize: 16 }, children: "replay" }),
|
|
7298
7560
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Prompt" })
|
|
@@ -7414,7 +7676,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
7414
7676
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Ref" })
|
|
7415
7677
|
] }),
|
|
7416
7678
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { onClick: () => setIsPromptCollapsed(!isPromptCollapsed), className: "text-white/40 hover:text-white transition-colors", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined", children: isPromptCollapsed ? "expand_more" : "expand_less" }) }),
|
|
7417
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, TaskExecutor, { openTasks: _optionalChain([hfState, 'optionalAccess',
|
|
7679
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, TaskExecutor, { openTasks: _optionalChain([hfState, 'optionalAccess', _246 => _246.openTasks]) || {}, onExecute: handleExecuteTask, onTaskCompleted: handleTaskCompleted }),
|
|
7418
7680
|
runningBadge,
|
|
7419
7681
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, PillButton, { variant: "solid", icon: "bolt", disabled: !activePrompt.trim(), onClick: () => handleGenerateBatch(), children: "Generieren" })
|
|
7420
7682
|
] })
|
|
@@ -7426,7 +7688,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
7426
7688
|
] }) }),
|
|
7427
7689
|
middlePanel === "szenen" ? szenenPane : middlePanel === "labs" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, LabsTab, { services: labServices, onResult: (item) => {
|
|
7428
7690
|
const frame = item.frames[0];
|
|
7429
|
-
if (_optionalChain([frame, 'optionalAccess',
|
|
7691
|
+
if (_optionalChain([frame, 'optionalAccess', _247 => _247.base64])) setCurrentResult(frameToGeneration(frame, item));
|
|
7430
7692
|
} }) }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex-1 overflow-hidden flex flex-col", children: [
|
|
7431
7693
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex-1 p-6 overflow-hidden flex items-center justify-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "h-full w-full max-w-4xl aspect-square rounded-3xl border border-white/5 bg-black/40 relative overflow-hidden flex items-center justify-center group shadow-2xl", children: currentResult ? currentResult.status === "processing" ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center gap-4 opacity-40", children: [
|
|
7432
7694
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined text-[40px]", children: "hourglass_top" }),
|
|
@@ -7435,7 +7697,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
7435
7697
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-16 h-16 rounded-full bg-red-500/10 flex items-center justify-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined text-red-500 text-[32px]", children: "warning" }) }),
|
|
7436
7698
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-2", children: [
|
|
7437
7699
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-[11px] font-bold uppercase tracking-widest text-red-400", children: "Generierungsfehler" }),
|
|
7438
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-white/60 text-[12px] leading-relaxed", children: _optionalChain([currentResult, 'access',
|
|
7700
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-white/60 text-[12px] leading-relaxed", children: _optionalChain([currentResult, 'access', _248 => _248.error, 'optionalAccess', _249 => _249.message]) })
|
|
7439
7701
|
] }),
|
|
7440
7702
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, PillButton, { variant: "outline", icon: "refresh", onClick: () => handleGenerateImage(currentResult.prompt), children: "Erneut versuchen" })
|
|
7441
7703
|
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "h-full w-full relative flex items-center justify-center", children: [
|
|
@@ -7449,7 +7711,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
7449
7711
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined text-[100px]", children: "palette" }),
|
|
7450
7712
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-[12px] font-bold uppercase tracking-[0.2em]", children: "Avatar Architect" })
|
|
7451
7713
|
] }) }) }),
|
|
7452
|
-
_optionalChain([currentResult, 'optionalAccess',
|
|
7714
|
+
_optionalChain([currentResult, 'optionalAccess', _250 => _250.status]) === "done" && currentGroup.length > 1 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "px-6 pb-4 shrink-0 flex gap-2 overflow-x-auto", style: { scrollbarWidth: "none" }, children: currentGroup.map((item) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { position: "relative", flexShrink: 0 }, children: [
|
|
7453
7715
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7454
7716
|
"div",
|
|
7455
7717
|
{
|
|
@@ -7530,14 +7792,14 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
7530
7792
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined text-[40px] text-white/10 block mb-3", children: "label_off" }),
|
|
7531
7793
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-[11px] text-white/20", children: "Erst Workspace importieren um Tags zu verwalten." })
|
|
7532
7794
|
] }) }),
|
|
7533
|
-
activeTab === "history" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, HistoryPanel, { history, currentResultId: _optionalChain([currentResult, 'optionalAccess',
|
|
7795
|
+
activeTab === "history" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, HistoryPanel, { history, currentResultId: _optionalChain([currentResult, 'optionalAccess', _251 => _251.id]) || null, onSelect: handleGallerySelect, onDelete: (id) => setHistory((h) => h.filter((x) => x.id !== id)), visibleCount: historyVisibleCount, onLoadMore: () => setHistoryVisibleCount((c) => c + 20) }),
|
|
7534
7796
|
activeTab === "gallery" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7535
7797
|
MediaLibrary,
|
|
7536
7798
|
{
|
|
7537
7799
|
items: galleryItems,
|
|
7538
7800
|
onImport: async () => {
|
|
7539
7801
|
const media = await onSelectMedia();
|
|
7540
|
-
if (!_optionalChain([media, 'optionalAccess',
|
|
7802
|
+
if (!_optionalChain([media, 'optionalAccess', _252 => _252.length])) return;
|
|
7541
7803
|
setGalleryItems((prev) => [...media.map((m) => ({ id: crypto.randomUUID(), nodeId: "1", base64: `data:${m.mimeType};base64,${m.base64}`, mediaId: m.mediaId, prompt: m.name || "Importiert", timestamp: Date.now(), status: "done", tags: [], type: "import" })), ...prev]);
|
|
7542
7804
|
},
|
|
7543
7805
|
onDelete: (id) => setGalleryItems((g) => g.filter((x) => x.id !== id)),
|
|
@@ -7693,7 +7955,7 @@ function createFaStore({ contracts, descriptors, persistence, workspaceId }) {
|
|
|
7693
7955
|
};
|
|
7694
7956
|
};
|
|
7695
7957
|
const applyWriteResult = (sliceId, result, savedData, signal) => {
|
|
7696
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
7958
|
+
if (_optionalChain([signal, 'optionalAccess', _253 => _253.aborted])) {
|
|
7697
7959
|
patchMeta(sliceId, { saveState: "idle" });
|
|
7698
7960
|
return result;
|
|
7699
7961
|
}
|
|
@@ -7721,8 +7983,8 @@ function createFaStore({ contracts, descriptors, persistence, workspaceId }) {
|
|
|
7721
7983
|
const requestId = _nullishCoalesce(externalRequestId, () => ( nextRequestId()));
|
|
7722
7984
|
patchMeta(sliceId, { loadRequestId: requestId, saveState: "restoring" });
|
|
7723
7985
|
const result = await persistence.load(workspaceId, descriptor, _nullishCoalesce(signal, () => ( new AbortController().signal)));
|
|
7724
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
7725
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
7986
|
+
if (_optionalChain([signal, 'optionalAccess', _254 => _254.aborted]) || _optionalChain([get, 'call', _255 => _255(), 'access', _256 => _256.meta, 'access', _257 => _257[sliceId], 'optionalAccess', _258 => _258.loadRequestId]) !== requestId) {
|
|
7987
|
+
if (_optionalChain([signal, 'optionalAccess', _259 => _259.aborted]) && _optionalChain([get, 'call', _260 => _260(), 'access', _261 => _261.meta, 'access', _262 => _262[sliceId], 'optionalAccess', _263 => _263.loadRequestId]) === requestId) {
|
|
7726
7988
|
patchMeta(sliceId, { saveState: "idle", loadRequestId: null });
|
|
7727
7989
|
}
|
|
7728
7990
|
return result;
|
|
@@ -7757,7 +8019,7 @@ function createFaStore({ contracts, descriptors, persistence, workspaceId }) {
|
|
|
7757
8019
|
},
|
|
7758
8020
|
async resetSlice(sliceId, signal, options) {
|
|
7759
8021
|
const contract = requireContract(sliceId);
|
|
7760
|
-
if (get().meta[sliceId].dirty && !_optionalChain([options, 'optionalAccess',
|
|
8022
|
+
if (get().meta[sliceId].dirty && !_optionalChain([options, 'optionalAccess', _264 => _264.confirmed])) {
|
|
7761
8023
|
throw new Error(`Reset for slice ${sliceId} requires confirmation while unsaved changes exist`);
|
|
7762
8024
|
}
|
|
7763
8025
|
const defaultData = contract.createDefault();
|
|
@@ -7810,7 +8072,7 @@ function createInMemoryWorkspacePersistence(now = () => Date.now()) {
|
|
|
7810
8072
|
}
|
|
7811
8073
|
const saved = {
|
|
7812
8074
|
...clone(slice),
|
|
7813
|
-
revision: (_nullishCoalesce(_optionalChain([current, 'optionalAccess',
|
|
8075
|
+
revision: (_nullishCoalesce(_optionalChain([current, 'optionalAccess', _265 => _265.revision]), () => ( 0))) + 1,
|
|
7814
8076
|
updatedAt: now(),
|
|
7815
8077
|
...resetAt !== void 0 ? { resetAt } : {}
|
|
7816
8078
|
};
|
|
@@ -7891,7 +8153,7 @@ function createPersistenceCoordinator({
|
|
|
7891
8153
|
if (disposed) return;
|
|
7892
8154
|
const runtime = runtimeOf(sliceId);
|
|
7893
8155
|
const meta = store.getState().meta[sliceId];
|
|
7894
|
-
if (!_optionalChain([meta, 'optionalAccess',
|
|
8156
|
+
if (!_optionalChain([meta, 'optionalAccess', _266 => _266.dirty])) return;
|
|
7895
8157
|
if (meta.saveState === "restoring" || meta.saveState === "saving") {
|
|
7896
8158
|
runtime.pendingSave = true;
|
|
7897
8159
|
return;
|
|
@@ -7919,7 +8181,7 @@ function createPersistenceCoordinator({
|
|
|
7919
8181
|
return {
|
|
7920
8182
|
async load(sliceId) {
|
|
7921
8183
|
const runtime = runtimeOf(sliceId);
|
|
7922
|
-
_optionalChain([runtime, 'access',
|
|
8184
|
+
_optionalChain([runtime, 'access', _267 => _267.loadController, 'optionalAccess', _268 => _268.abort, 'call', _269 => _269()]);
|
|
7923
8185
|
runtime.loadController = new AbortController();
|
|
7924
8186
|
const controller = runtime.loadController;
|
|
7925
8187
|
try {
|
|
@@ -7947,8 +8209,8 @@ function createPersistenceCoordinator({
|
|
|
7947
8209
|
disposed = true;
|
|
7948
8210
|
for (const runtime of runtimes.values()) {
|
|
7949
8211
|
clearTimer(runtime);
|
|
7950
|
-
_optionalChain([runtime, 'access',
|
|
7951
|
-
_optionalChain([runtime, 'access',
|
|
8212
|
+
_optionalChain([runtime, 'access', _270 => _270.loadController, 'optionalAccess', _271 => _271.abort, 'call', _272 => _272()]);
|
|
8213
|
+
_optionalChain([runtime, 'access', _273 => _273.saveController, 'optionalAccess', _274 => _274.abort, 'call', _275 => _275()]);
|
|
7952
8214
|
runtime.pendingSave = false;
|
|
7953
8215
|
}
|
|
7954
8216
|
runtimes.clear();
|
|
@@ -8052,7 +8314,7 @@ function parseLegacyLibraryFilters(source, knownTagIds) {
|
|
|
8052
8314
|
return null;
|
|
8053
8315
|
}).filter((id) => id !== null && knownTagIds.has(id));
|
|
8054
8316
|
}
|
|
8055
|
-
} catch (
|
|
8317
|
+
} catch (e37) {
|
|
8056
8318
|
tagIds = [];
|
|
8057
8319
|
}
|
|
8058
8320
|
}
|
|
@@ -8063,7 +8325,7 @@ function parseLegacyLibraryFilters(source, knownTagIds) {
|
|
|
8063
8325
|
if (Array.isArray(parsed)) {
|
|
8064
8326
|
recentFilterTagIds = parsed.filter((entry) => typeof entry === "string" || typeof entry === "number").map((entry) => String(entry)).filter((id) => knownTagIds.has(id)).slice(0, 5);
|
|
8065
8327
|
}
|
|
8066
|
-
} catch (
|
|
8328
|
+
} catch (e38) {
|
|
8067
8329
|
recentFilterTagIds = [];
|
|
8068
8330
|
}
|
|
8069
8331
|
}
|
|
@@ -8102,9 +8364,9 @@ function hatNavigationsziele(zugehoerigkeit) {
|
|
|
8102
8364
|
var kennung = (wert) => typeof wert === "string" && wert.trim().length > 0;
|
|
8103
8365
|
var kurz = (id) => id.slice(0, 8);
|
|
8104
8366
|
function zugehoerigkeitOf(item) {
|
|
8105
|
-
const runId = _optionalChain([item, 'optionalAccess',
|
|
8367
|
+
const runId = _optionalChain([item, 'optionalAccess', _276 => _276.szenen, 'optionalAccess', _277 => _277.prompt_run_id]);
|
|
8106
8368
|
if (!kennung(runId)) return null;
|
|
8107
|
-
const links = _nullishCoalesce(_optionalChain([item, 'optionalAccess',
|
|
8369
|
+
const links = _nullishCoalesce(_optionalChain([item, 'optionalAccess', _278 => _278.szenen_links]), () => ( null));
|
|
8108
8370
|
if (!links || links.prompt_run_id !== runId) {
|
|
8109
8371
|
return {
|
|
8110
8372
|
run: null,
|
|
@@ -8135,15 +8397,15 @@ function zugehoerigkeitOf(item) {
|
|
|
8135
8397
|
return { run, scene, hinweis: null };
|
|
8136
8398
|
}
|
|
8137
8399
|
function zugehoerigkeitenOf(item) {
|
|
8138
|
-
const szenen = _optionalChain([item, 'optionalAccess',
|
|
8400
|
+
const szenen = _optionalChain([item, 'optionalAccess', _279 => _279.szenen]);
|
|
8139
8401
|
if (!szenen) return [];
|
|
8140
8402
|
const laeufe = [];
|
|
8141
8403
|
const merken = (id) => {
|
|
8142
8404
|
if (kennung(id) && !laeufe.includes(id)) laeufe.push(id);
|
|
8143
8405
|
};
|
|
8144
8406
|
merken(szenen.prompt_run_id);
|
|
8145
|
-
for (const run of _nullishCoalesce(szenen.runs, () => ( []))) merken(_optionalChain([run, 'optionalAccess',
|
|
8146
|
-
const linkFuer = (runId) => _nullishCoalesce((_nullishCoalesce(_optionalChain([item, 'optionalAccess',
|
|
8407
|
+
for (const run of _nullishCoalesce(szenen.runs, () => ( []))) merken(_optionalChain([run, 'optionalAccess', _280 => _280.prompt_run_id]));
|
|
8408
|
+
const linkFuer = (runId) => _nullishCoalesce((_nullishCoalesce(_optionalChain([item, 'optionalAccess', _281 => _281.szenen_run_links]), () => ( []))).find((l) => l.prompt_run_id === runId), () => ( (_optionalChain([item, 'optionalAccess', _282 => _282.szenen_links]) && item.szenen_links.prompt_run_id === runId ? item.szenen_links : null)));
|
|
8147
8409
|
const ergebnis = [];
|
|
8148
8410
|
for (const runId of laeufe) {
|
|
8149
8411
|
const z = zugehoerigkeitOf({ szenen: { prompt_run_id: runId }, szenen_links: linkFuer(runId) });
|
|
@@ -8289,7 +8551,7 @@ function parseLegacyRecentTags(raw) {
|
|
|
8289
8551
|
}
|
|
8290
8552
|
return null;
|
|
8291
8553
|
}).filter((entry) => entry !== null).slice(0, 10);
|
|
8292
|
-
} catch (
|
|
8554
|
+
} catch (e39) {
|
|
8293
8555
|
return [];
|
|
8294
8556
|
}
|
|
8295
8557
|
}
|