@lv-x-software-house/x_view 1.2.5-dev.26 → 1.2.5-dev.28

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.
Files changed (3) hide show
  1. package/dist/index.js +609 -128
  2. package/dist/index.mjs +637 -131
  3. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -308,13 +308,13 @@ function ContextMenu({
308
308
  });
309
309
  };
310
310
  const renderMainView = () => {
311
- var _a2, _b2, _c2, _d, _e;
311
+ var _a2, _b2, _c2, _d, _e, _f;
312
312
  const hasVersions = computedVersions.length > 0;
313
313
  const canCreateVersion = ability.can("create", "Versioning");
314
314
  const canReadVersion = ability.can("read", "Versioning");
315
315
  const shouldShowVersioningBtn = canCreateVersion || canReadVersion && hasVersions;
316
316
  const canStartQuest = isCurrentNodeQuest && (((_a2 = data.nodeData) == null ? void 0 : _a2.status) === "Backlog" || !((_b2 = data.nodeData) == null ? void 0 : _b2.status));
317
- const canFinishQuest = isCurrentNodeQuest && ((_c2 = data.nodeData) == null ? void 0 : _c2.assignee_id) === (currentUser == null ? void 0 : currentUser.id) && ((_d = data.nodeData) == null ? void 0 : _d.status) !== "Backlog";
317
+ const canFinishQuest = isCurrentNodeQuest && ((_c2 = data.nodeData) == null ? void 0 : _c2.assignee_id) === (currentUser == null ? void 0 : currentUser.id) && ((_d = data.nodeData) == null ? void 0 : _d.status) !== "Backlog" && ((_e = data.nodeData) == null ? void 0 : _e.status) !== "Done";
318
318
  return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2 px-2 pt-1 pb-2" }, /* @__PURE__ */ React.createElement("span", { className: "inline-flex h-2 w-2 rounded-full bg-indigo-400/80 shadow-[0_0_12px_1px_rgba(99,102,241,0.5)]" }), /* @__PURE__ */ React.createElement("p", { className: "text-[11px] uppercase tracking-wider text-slate-400" }, "A\xE7\xF5es R\xE1pidas")), /* @__PURE__ */ React.createElement("div", { className: "flex flex-col gap-1" }, canStartQuest && /* @__PURE__ */ React.createElement(
319
319
  "button",
320
320
  {
@@ -335,11 +335,11 @@ function ContextMenu({
335
335
  onClose();
336
336
  },
337
337
  className: baseButtonClass,
338
- title: "Finalizar esta quest"
338
+ title: "Finalizar esta etapa e avan\xE7ar"
339
339
  },
340
340
  /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }), /* @__PURE__ */ React.createElement("polyline", { points: "22 4 12 14.01 9 11.01" })),
341
- /* @__PURE__ */ React.createElement("span", null, "Finalizar Quest")
342
- ), (canStartQuest || canFinishQuest) && /* @__PURE__ */ React.createElement("div", { className: "my-1 h-px w-full bg-white/10" }), ability.can("create", "Connection") && /* @__PURE__ */ React.createElement("button", { onClick: () => onStartConnection == null ? void 0 : onStartConnection(data.nodeData), className: baseButtonClass, title: "Conectar" }, /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.72" }), /* @__PURE__ */ React.createElement("path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.72-1.72" })), /* @__PURE__ */ React.createElement("span", null, "Conectar")), ability.can("create", "Node") && !((_e = data.nodeData) == null ? void 0 : _e.is_quest) && /* @__PURE__ */ React.createElement("button", { onClick: () => onStartCreation == null ? void 0 : onStartCreation(data.nodeData), className: baseButtonClass, title: "Criar e Conectar" }, /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ React.createElement("line", { x1: "12", y1: "8", x2: "12", y2: "16" }), /* @__PURE__ */ React.createElement("line", { x1: "8", y1: "12", x2: "16", y2: "12" })), /* @__PURE__ */ React.createElement("span", null, "Criar e Conectar")), ability.can("create", "Ancestry") && /* @__PURE__ */ React.createElement("button", { onClick: () => onStartAncestryCreation == null ? void 0 : onStartAncestryCreation(data.nodeData), className: baseButtonClass, title: "Criar Ancestralidade" }, /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("path", { d: "M10 20.5c.5-.5.8-1.2.8-2s-.3-1.5-.8-2c-.5-.5-1.2-.8-2-.8s-1.5.3-2 .8c-.5.5-.8 1.2-.8 2s.3 1.5.8 2c.5.5 1.2-.8 2 .8s1.5-.3 2-.8c-.5-.5-.8-1.2-.8-2s.3-1.5.8-2c.5.5 1.2-.8 2 .8s1.5.3 2 .8Z" }), /* @__PURE__ */ React.createElement("path", { d: "M10 16v-3a2 2 0 0 1 2-2h4" }), /* @__PURE__ */ React.createElement("path", { d: "M14 3.5c.5.5.8 1.2.8 2s-.3 1.5-.8 2c-.5-.5-1.2-.8-2 .8s1.5.3-2-.8c-.5-.5-.8-1.2-.8-2s.3-1.5.8-2c.5.5 1.2-.8 2 .8s1.5.3 2 .8Z" }), /* @__PURE__ */ React.createElement("path", { d: "M14 8v3a2 2 0 0 0 2 2h4" })), /* @__PURE__ */ React.createElement("span", null, "Criar Ancestralidade")), shouldShowVersioningBtn && /* @__PURE__ */ React.createElement("button", { onClick: () => setMenuView("versioning"), className: baseButtonClass, title: hasVersions ? "Versionamento" : "Criar Versionamento" }, /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("line", { x1: "6", y1: "3", x2: "6", y2: "15" }), /* @__PURE__ */ React.createElement("circle", { cx: "18", cy: "6", r: "3" }), /* @__PURE__ */ React.createElement("circle", { cx: "6", cy: "18", r: "3" }), /* @__PURE__ */ React.createElement("path", { d: "M18 9a9 9 0 0 1-9 9" })), /* @__PURE__ */ React.createElement("span", null, hasVersions || !canCreateVersion ? "Versionamento" : "Criar Versionamento")), (connections.length > 0 || availableAncestries.length > 0) && ability.can("read", "Connection") && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: "my-1 h-px w-full bg-white/10" }), /* @__PURE__ */ React.createElement("button", { onClick: () => setMenuView("connections"), className: baseButtonClass, title: "Conex\xF5es" }, /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("path", { d: "M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2z" }), /* @__PURE__ */ React.createElement("path", { d: "M8 12h8" }), /* @__PURE__ */ React.createElement("path", { d: "M12 8v8" })), /* @__PURE__ */ React.createElement("span", null, "Conex\xF5es (", totalConnectionsCount, ")"))), /* @__PURE__ */ React.createElement("div", { className: "my-1 h-px w-full bg-white/10" }), /* @__PURE__ */ React.createElement("button", { onClick: () => {
341
+ /* @__PURE__ */ React.createElement("span", null, "Finalizar Etapa")
342
+ ), (canStartQuest || canFinishQuest) && /* @__PURE__ */ React.createElement("div", { className: "my-1 h-px w-full bg-white/10" }), ability.can("create", "Connection") && /* @__PURE__ */ React.createElement("button", { onClick: () => onStartConnection == null ? void 0 : onStartConnection(data.nodeData), className: baseButtonClass, title: "Conectar" }, /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.72" }), /* @__PURE__ */ React.createElement("path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.72-1.72" })), /* @__PURE__ */ React.createElement("span", null, "Conectar")), ability.can("create", "Node") && !((_f = data.nodeData) == null ? void 0 : _f.is_quest) && /* @__PURE__ */ React.createElement("button", { onClick: () => onStartCreation == null ? void 0 : onStartCreation(data.nodeData), className: baseButtonClass, title: "Criar e Conectar" }, /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ React.createElement("line", { x1: "12", y1: "8", x2: "12", y2: "16" }), /* @__PURE__ */ React.createElement("line", { x1: "8", y1: "12", x2: "16", y2: "12" })), /* @__PURE__ */ React.createElement("span", null, "Criar e Conectar")), ability.can("create", "Ancestry") && /* @__PURE__ */ React.createElement("button", { onClick: () => onStartAncestryCreation == null ? void 0 : onStartAncestryCreation(data.nodeData), className: baseButtonClass, title: "Criar Ancestralidade" }, /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("path", { d: "M10 20.5c.5-.5.8-1.2.8-2s-.3-1.5-.8-2c-.5-.5-1.2-.8-2-.8s-1.5.3-2 .8c-.5.5-.8 1.2-.8 2s.3 1.5.8 2c.5.5 1.2-.8 2 .8s1.5-.3 2-.8c-.5-.5-.8-1.2-.8-2s.3-1.5.8-2c.5.5 1.2-.8 2 .8s1.5.3 2 .8Z" }), /* @__PURE__ */ React.createElement("path", { d: "M10 16v-3a2 2 0 0 1 2-2h4" }), /* @__PURE__ */ React.createElement("path", { d: "M14 3.5c.5.5.8 1.2.8 2s-.3 1.5-.8 2c-.5-.5-1.2-.8-2 .8s1.5.3-2-.8c-.5-.5-.8-1.2-.8-2s.3-1.5.8-2c.5.5 1.2-.8 2 .8s1.5.3 2 .8Z" }), /* @__PURE__ */ React.createElement("path", { d: "M14 8v3a2 2 0 0 0 2 2h4" })), /* @__PURE__ */ React.createElement("span", null, "Criar Ancestralidade")), shouldShowVersioningBtn && /* @__PURE__ */ React.createElement("button", { onClick: () => setMenuView("versioning"), className: baseButtonClass, title: hasVersions ? "Versionamento" : "Criar Versionamento" }, /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("line", { x1: "6", y1: "3", x2: "6", y2: "15" }), /* @__PURE__ */ React.createElement("circle", { cx: "18", cy: "6", r: "3" }), /* @__PURE__ */ React.createElement("circle", { cx: "6", cy: "18", r: "3" }), /* @__PURE__ */ React.createElement("path", { d: "M18 9a9 9 0 0 1-9 9" })), /* @__PURE__ */ React.createElement("span", null, hasVersions || !canCreateVersion ? "Versionamento" : "Criar Versionamento")), (connections.length > 0 || availableAncestries.length > 0) && ability.can("read", "Connection") && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: "my-1 h-px w-full bg-white/10" }), /* @__PURE__ */ React.createElement("button", { onClick: () => setMenuView("connections"), className: baseButtonClass, title: "Conex\xF5es" }, /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("path", { d: "M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2z" }), /* @__PURE__ */ React.createElement("path", { d: "M8 12h8" }), /* @__PURE__ */ React.createElement("path", { d: "M12 8v8" })), /* @__PURE__ */ React.createElement("span", null, "Conex\xF5es (", totalConnectionsCount, ")"))), /* @__PURE__ */ React.createElement("div", { className: "my-1 h-px w-full bg-white/10" }), /* @__PURE__ */ React.createElement("button", { onClick: () => {
343
343
  onFocusNode == null ? void 0 : onFocusNode(data.nodeData);
344
344
  onClose();
345
345
  }, className: baseButtonClass, title: "Focar na c\xE2mera" }, /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ React.createElement("circle", { cx: "12", cy: "12", r: "3" })), /* @__PURE__ */ React.createElement("span", null, "Focar neste Node")), /* @__PURE__ */ React.createElement("button", { onClick: (e) => handleCopyLink(e, data.nodeData), className: baseButtonClass, title: "Copiar Link para Compartilhar" }, isLinkCopied ? /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "#4ade80", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("polyline", { points: "20 6 9 17 4 12" })) : /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.72" }), /* @__PURE__ */ React.createElement("path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.72-1.72" })), /* @__PURE__ */ React.createElement("span", { className: isLinkCopied ? "text-green-400" : "" }, isLinkCopied ? "Copiado!" : "Copiar Link")), ability.can("dismiss", "Node") && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("button", { onClick: () => onDismissNode == null ? void 0 : onDismissNode(data.nodeData), className: baseButtonClass, title: "Remover da visualiza\xE7\xE3o" }, /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("path", { d: "M9.88 9.88a3 3 0 1 0 4.24 4.24" }), /* @__PURE__ */ React.createElement("path", { d: "M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68" }), /* @__PURE__ */ React.createElement("path", { d: "M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61" }), /* @__PURE__ */ React.createElement("line", { x1: "2", y1: "2", x2: "22", y2: "22" })), /* @__PURE__ */ React.createElement("span", null, "Dismiss")), /* @__PURE__ */ React.createElement("button", { onClick: () => onDismissOtherNodes == null ? void 0 : onDismissOtherNodes(data.nodeData), className: baseButtonClass, title: "Remover outros da visualiza\xE7\xE3o" }, /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("circle", { cx: "12", cy: "12", r: "3" }), /* @__PURE__ */ React.createElement("path", { d: "M3 7V5a2 2 0 0 1 2-2h2" }), /* @__PURE__ */ React.createElement("path", { d: "M17 3h2a2 2 0 0 1 2 2v2" }), /* @__PURE__ */ React.createElement("path", { d: "M21 17v2a2 2 0 0 1-2 2h-2" }), /* @__PURE__ */ React.createElement("path", { d: "M7 21H5a2 2 0 0 1-2-2v-2" })), /* @__PURE__ */ React.createElement("span", null, "Dismiss other nodes"))), ability.can("delete", "Node") && /* @__PURE__ */ React.createElement("button", { onClick: () => setMenuView("deleteConfirmation"), className: deleteButtonClass, title: "Excluir Node" }, /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React.createElement("polyline", { points: "3 6 5 6 21 6" }), /* @__PURE__ */ React.createElement("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" }), /* @__PURE__ */ React.createElement("line", { x1: "10", y1: "11", x2: "10", y2: "17" }), /* @__PURE__ */ React.createElement("line", { x1: "14", y1: "11", x2: "14", y2: "17" })), /* @__PURE__ */ React.createElement("span", null, "Excluir Node"))));
@@ -2461,7 +2461,8 @@ var userActionHandlers = {
2461
2461
  nodes: sceneDataRef.current.nodes,
2462
2462
  links: sceneDataRef.current.links,
2463
2463
  quest_nodes: specificParentData.nodes,
2464
- quest_links: specificParentData.links
2464
+ quest_links: specificParentData.links,
2465
+ quest_counter: sceneDataRef.current.quest_counter || 1
2465
2466
  };
2466
2467
  } else {
2467
2468
  filenameToSave = `x_view_dbs/${ownerId}/${parentFileId}`;
@@ -2658,7 +2659,8 @@ var userActionHandlers = {
2658
2659
  nodes: sceneDataRef.current.nodes,
2659
2660
  links: sceneDataRef.current.links,
2660
2661
  quest_nodes: originalData.nodes,
2661
- quest_links: originalData.links
2662
+ quest_links: originalData.links,
2663
+ quest_counter: sceneDataRef.current.quest_counter || 1
2662
2664
  };
2663
2665
  } else {
2664
2666
  filenameToSave = `x_view_dbs/${ownerId}/${parentFileId}`;
@@ -2723,7 +2725,8 @@ var userActionHandlers = {
2723
2725
  nodes: newVisualNodes,
2724
2726
  links: newVisualLinks,
2725
2727
  quest_nodes: specificParentData.nodes,
2726
- quest_links: specificParentData.links
2728
+ quest_links: specificParentData.links,
2729
+ quest_counter: sceneDataRef.current.quest_counter || 1
2727
2730
  };
2728
2731
  } else {
2729
2732
  filenameToSave = `x_view_dbs/${ownerId}/${parentFileId}`;
@@ -2784,7 +2787,8 @@ var userActionHandlers = {
2784
2787
  nodes: sceneDataRef.current.nodes,
2785
2788
  links: sceneDataRef.current.links,
2786
2789
  quest_nodes: specificParentData.nodes,
2787
- quest_links: specificParentData.links
2790
+ quest_links: specificParentData.links,
2791
+ quest_counter: sceneDataRef.current.quest_counter || 1
2788
2792
  };
2789
2793
  await context.actions.save_view_data(context.sceneSaveUrl, viewFilePayload);
2790
2794
  } else {
@@ -2831,7 +2835,8 @@ var userActionHandlers = {
2831
2835
  nodes: sceneDataRef.current.nodes,
2832
2836
  links: sceneDataRef.current.links,
2833
2837
  quest_nodes: specificParentData.nodes,
2834
- quest_links: specificParentData.links
2838
+ quest_links: specificParentData.links,
2839
+ quest_counter: sceneDataRef.current.quest_counter || 1
2835
2840
  };
2836
2841
  await context.actions.save_view_data(context.sceneSaveUrl, viewFilePayload);
2837
2842
  } else {
@@ -7781,7 +7786,15 @@ function ColorPicker({ color, onChange, disabled }) {
7781
7786
  }
7782
7787
 
7783
7788
  // src/components/InSceneCreationForm.jsx
7784
- import { FiPlus as FiPlus3, FiMaximize2, FiX as FiX3, FiCheck as FiCheck7, FiEdit2 as FiEdit24, FiSun, FiChevronDown as FiChevronDown4 } from "react-icons/fi";
7789
+ import {
7790
+ FiPlus as FiPlus3,
7791
+ FiMaximize2,
7792
+ FiX as FiX3,
7793
+ FiCheck as FiCheck7,
7794
+ FiEdit2 as FiEdit24,
7795
+ FiSun,
7796
+ FiChevronDown as FiChevronDown4
7797
+ } from "react-icons/fi";
7785
7798
  function InSceneCreationForm({
7786
7799
  onSave,
7787
7800
  onCancel,
@@ -7818,7 +7831,9 @@ function InSceneCreationForm({
7818
7831
  const [isDescriptionModalOpen, setIsDescriptionModalOpen] = useState14(false);
7819
7832
  const [useImageAsTexture, setUseImageAsTexture] = useState14(false);
7820
7833
  const [selectedImageUrl, setSelectedImageUrl] = useState14(null);
7821
- const [targetDatasetId, setTargetDatasetId] = useState14(sourceNodeDatasetId || "");
7834
+ const [targetDatasetId, setTargetDatasetId] = useState14(
7835
+ sourceNodeDatasetId || ""
7836
+ );
7822
7837
  const [isDatasetDropdownOpen, setIsDatasetDropdownOpen] = useState14(false);
7823
7838
  const datasetDropdownRef = useRef10(null);
7824
7839
  useEffect13(() => {
@@ -7838,7 +7853,9 @@ function InSceneCreationForm({
7838
7853
  };
7839
7854
  }, [isDatasetDropdownOpen]);
7840
7855
  const propsEndRef = useRef10(null);
7841
- const hasImages = customProps.some((p) => p.type === "images" && Array.isArray(p.value) && p.value.length > 0 && p.value.some((img) => img.value));
7856
+ const hasImages = customProps.some(
7857
+ (p) => p.type === "images" && Array.isArray(p.value) && p.value.length > 0 && p.value.some((img) => img.value)
7858
+ );
7842
7859
  useEffect13(() => {
7843
7860
  if (!hasImages && useImageAsTexture) {
7844
7861
  setUseImageAsTexture(false);
@@ -7848,7 +7865,9 @@ function InSceneCreationForm({
7848
7865
  }, [hasImages, useImageAsTexture, onImageChange]);
7849
7866
  useEffect13(() => {
7850
7867
  let result = [];
7851
- const validExistingTypes = existingTypes.filter((t) => t && typeof t === "string" && t.trim() !== "");
7868
+ const validExistingTypes = existingTypes.filter(
7869
+ (t) => t && typeof t === "string" && t.trim() !== ""
7870
+ );
7852
7871
  if (typeInput.trim() === "") {
7853
7872
  result = validExistingTypes.filter((t) => !types.includes(t));
7854
7873
  } else {
@@ -7857,13 +7876,20 @@ function InSceneCreationForm({
7857
7876
  const lowercasedInput = typeInput.toLowerCase();
7858
7877
  result = validExistingTypes.filter((t) => {
7859
7878
  if (!t) {
7860
- console.warn("InSceneCreationForm: Tipo encontrado como undefined/null durante filtragem");
7879
+ console.warn(
7880
+ "InSceneCreationForm: Tipo encontrado como undefined/null durante filtragem"
7881
+ );
7861
7882
  return false;
7862
7883
  }
7863
7884
  return t.toLowerCase().includes(lowercasedInput) && !types.includes(t);
7864
7885
  });
7865
7886
  } catch (err) {
7866
- console.error("InSceneCreationForm: Erro ao filtrar tipos:", err, "typeInput:", typeInput);
7887
+ console.error(
7888
+ "InSceneCreationForm: Erro ao filtrar tipos:",
7889
+ err,
7890
+ "typeInput:",
7891
+ typeInput
7892
+ );
7867
7893
  }
7868
7894
  }
7869
7895
  if (sourceTypes) {
@@ -7893,7 +7919,10 @@ function InSceneCreationForm({
7893
7919
  setCustomProps([...customProps, newProp]);
7894
7920
  setTimeout(() => {
7895
7921
  var _a2;
7896
- (_a2 = propsEndRef.current) == null ? void 0 : _a2.scrollIntoView({ behavior: "smooth", block: "center" });
7922
+ (_a2 = propsEndRef.current) == null ? void 0 : _a2.scrollIntoView({
7923
+ behavior: "smooth",
7924
+ block: "center"
7925
+ });
7897
7926
  }, 100);
7898
7927
  };
7899
7928
  const handleRemoveProp = (index) => setCustomProps(customProps.filter((_, i) => i !== index));
@@ -8002,15 +8031,23 @@ function InSceneCreationForm({
8002
8031
  },
8003
8032
  /* @__PURE__ */ React13.createElement("div", { className: "h-[2px] bg-gradient-to-r from-indigo-400/0 via-indigo-400/70 to-indigo-400/0" }),
8004
8033
  /* @__PURE__ */ React13.createElement("div", { className: "px-6 pt-5 pb-3" }, /* @__PURE__ */ React13.createElement("div", { className: "flex items-center gap-2 mb-1" }, /* @__PURE__ */ React13.createElement("span", { className: "inline-flex h-2.5 w-2.5 rounded-full bg-indigo-400/80 shadow-[0_0_18px_2px_rgba(99,102,241,0.55)]" }), /* @__PURE__ */ React13.createElement("p", { className: "text-xs/relaxed text-slate-300" }, "Criar & Conectar")), /* @__PURE__ */ React13.createElement("h2", { className: "text-xl sm:text-2xl font-semibold tracking-tight" }, "Novo Node")),
8005
- /* @__PURE__ */ React13.createElement("form", { onSubmit: handleSubmit, className: "flex flex-col max-h-[68vh]" }, /* @__PURE__ */ React13.createElement("div", { className: "px-6 pb-28 overflow-y-auto overscroll-contain space-y-4 custom-scrollbar" }, /* @__PURE__ */ React13.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React13.createElement("label", { className: "text-xs text-slate-300" }, "Tipo(s) do Node"), /* @__PURE__ */ React13.createElement("div", { className: "relative w-full bg-slate-800/70 p-1.5 min-h-[42px] flex flex-wrap gap-1.5 rounded-lg border border-white/10 focus-within:ring-2 focus-within:ring-indigo-400/60 transition-all" }, types.map((t, index) => /* @__PURE__ */ React13.createElement("span", { key: index, className: "flex items-center gap-1 bg-indigo-500/30 text-indigo-100 px-1.5 py-0.5 rounded-md text-xs font-medium border border-indigo-500/20" }, t, /* @__PURE__ */ React13.createElement(
8006
- "button",
8034
+ /* @__PURE__ */ React13.createElement("form", { onSubmit: handleSubmit, className: "flex flex-col max-h-[68vh]" }, /* @__PURE__ */ React13.createElement("div", { className: "px-6 pb-28 overflow-y-auto overscroll-contain space-y-4 custom-scrollbar" }, /* @__PURE__ */ React13.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React13.createElement("label", { className: "text-xs text-slate-300" }, "Tipo(s) do Node"), /* @__PURE__ */ React13.createElement("div", { className: "relative w-full bg-slate-800/70 p-1.5 min-h-[42px] flex flex-wrap gap-1.5 rounded-lg border border-white/10 focus-within:ring-2 focus-within:ring-indigo-400/60 transition-all" }, types.map((t, index) => /* @__PURE__ */ React13.createElement(
8035
+ "span",
8007
8036
  {
8008
- type: "button",
8009
- onClick: () => handleRemoveType(index),
8010
- className: "hover:text-white transition-colors"
8037
+ key: index,
8038
+ className: "flex items-center gap-1 bg-indigo-500/30 text-indigo-100 px-1.5 py-0.5 rounded-md text-xs font-medium border border-indigo-500/20"
8011
8039
  },
8012
- /* @__PURE__ */ React13.createElement(FiX3, { size: 12 })
8013
- ))), /* @__PURE__ */ React13.createElement(
8040
+ t,
8041
+ /* @__PURE__ */ React13.createElement(
8042
+ "button",
8043
+ {
8044
+ type: "button",
8045
+ onClick: () => handleRemoveType(index),
8046
+ className: "hover:text-white transition-colors"
8047
+ },
8048
+ /* @__PURE__ */ React13.createElement(FiX3, { size: 12 })
8049
+ )
8050
+ )), /* @__PURE__ */ React13.createElement(
8014
8051
  "input",
8015
8052
  {
8016
8053
  type: "text",
@@ -8043,7 +8080,17 @@ function InSceneCreationForm({
8043
8080
  }
8044
8081
  },
8045
8082
  suggestedType
8046
- ))))), /* @__PURE__ */ React13.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React13.createElement("label", { className: "text-xs text-slate-300" }, "Nome do Node"), /* @__PURE__ */ React13.createElement("input", { required: true, type: "text", placeholder: "Ex.: Cliente XPTO", value: name, onChange: handleNameInputChange, className: "w-full bg-slate-800/70 p-2.5 text-sm rounded-lg border border-white/10 focus:outline-none focus:ring-2 focus:ring-indigo-400/60" })), viewType === "view" && availableDatasets.length > 0 && /* @__PURE__ */ React13.createElement("div", { className: "space-y-1.5 relative", ref: datasetDropdownRef }, /* @__PURE__ */ React13.createElement("label", { className: "text-xs text-slate-300" }, "Criar Node no Dataset:"), /* @__PURE__ */ React13.createElement(
8083
+ ))))), /* @__PURE__ */ React13.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React13.createElement("label", { className: "text-xs text-slate-300" }, "Nome do Node"), /* @__PURE__ */ React13.createElement(
8084
+ "input",
8085
+ {
8086
+ required: true,
8087
+ type: "text",
8088
+ placeholder: "Ex.: Cliente XPTO",
8089
+ value: name,
8090
+ onChange: handleNameInputChange,
8091
+ className: "w-full bg-slate-800/70 p-2.5 text-sm rounded-lg border border-white/10 focus:outline-none focus:ring-2 focus:ring-indigo-400/60"
8092
+ }
8093
+ )), viewType === "view" && availableDatasets.length > 0 && /* @__PURE__ */ React13.createElement("div", { className: "space-y-1.5 relative", ref: datasetDropdownRef }, /* @__PURE__ */ React13.createElement("label", { className: "text-xs text-slate-300" }, "Criar Node no Dataset:"), /* @__PURE__ */ React13.createElement(
8047
8094
  "button",
8048
8095
  {
8049
8096
  type: "button",
@@ -8051,7 +8098,12 @@ function InSceneCreationForm({
8051
8098
  className: "w-full flex items-center justify-between bg-slate-800/70 p-2.5 text-sm rounded-lg border border-white/10 focus:outline-none focus:ring-2 focus:ring-indigo-400/60 hover:bg-slate-700/70 transition-colors text-slate-200 text-left"
8052
8099
  },
8053
8100
  /* @__PURE__ */ React13.createElement("span", { className: "truncate pr-2" }, selectedDatasetName),
8054
- /* @__PURE__ */ React13.createElement(FiChevronDown4, { className: `flex-shrink-0 text-slate-400 transition-transform ${isDatasetDropdownOpen ? "rotate-180" : ""}` })
8101
+ /* @__PURE__ */ React13.createElement(
8102
+ FiChevronDown4,
8103
+ {
8104
+ className: `flex-shrink-0 text-slate-400 transition-transform ${isDatasetDropdownOpen ? "rotate-180" : ""}`
8105
+ }
8106
+ )
8055
8107
  ), isDatasetDropdownOpen && /* @__PURE__ */ React13.createElement("ul", { className: "custom-scrollbar absolute top-[66px] left-0 z-20 w-full max-h-48 overflow-y-auto rounded-lg bg-slate-800 border border-white/10 shadow-xl py-1" }, availableDatasets.map((ds) => /* @__PURE__ */ React13.createElement(
8056
8108
  "li",
8057
8109
  {
@@ -8063,7 +8115,7 @@ function InSceneCreationForm({
8063
8115
  className: `px-3 py-2 text-sm cursor-pointer transition-colors ${targetDatasetId === ds.id ? "bg-indigo-600/40 text-indigo-200 font-medium" : "text-slate-300 hover:bg-white/5"}`
8064
8116
  },
8065
8117
  ds.name
8066
- )))), /* @__PURE__ */ React13.createElement("div", { className: "space-y-1.5 relative" }, /* @__PURE__ */ React13.createElement("label", { className: "text-xs text-slate-300" }, "Descri\xE7\xE3o (Opcional)"), /* @__PURE__ */ React13.createElement("div", { className: "relative group min-h-[80px] bg-slate-800/70 p-2.5 rounded-lg border border-white/10 hover:border-white/20 transition-colors" }, /* @__PURE__ */ React13.createElement(
8118
+ )))), /* @__PURE__ */ React13.createElement("div", { className: "space-y-1.5 relative" }, /* @__PURE__ */ React13.createElement("label", { className: "text-xs text-slate-300" }, "Descri\xE7\xE3o"), /* @__PURE__ */ React13.createElement("div", { className: "relative group min-h-[80px] bg-slate-800/70 p-2.5 rounded-lg border border-white/10 hover:border-white/20 transition-colors" }, /* @__PURE__ */ React13.createElement(
8067
8119
  DescriptionDisplay,
8068
8120
  {
8069
8121
  description,
@@ -8100,10 +8152,28 @@ function InSceneCreationForm({
8100
8152
  onClick: () => handleSizeChange(s),
8101
8153
  className: "flex items-center gap-2 group cursor-pointer focus:outline-none"
8102
8154
  },
8103
- /* @__PURE__ */ React13.createElement("div", { className: `w-4 h-4 rounded-[4px] border flex items-center justify-center transition-all duration-200 ${isSelected ? "bg-indigo-500 border-indigo-500 shadow-[0_0_10px_rgba(99,102,241,0.4)]" : "border-slate-600 bg-transparent group-hover:border-slate-500"}` }, isSelected && /* @__PURE__ */ React13.createElement(FiCheck7, { size: 12, className: "text-white" })),
8104
- /* @__PURE__ */ React13.createElement("span", { className: `text-sm capitalize transition-colors ${isSelected ? "text-white font-medium" : "text-slate-400 group-hover:text-slate-300"}` }, s)
8155
+ /* @__PURE__ */ React13.createElement(
8156
+ "div",
8157
+ {
8158
+ className: `w-4 h-4 rounded-[4px] border flex items-center justify-center transition-all duration-200 ${isSelected ? "bg-indigo-500 border-indigo-500 shadow-[0_0_10px_rgba(99,102,241,0.4)]" : "border-slate-600 bg-transparent group-hover:border-slate-500"}`
8159
+ },
8160
+ isSelected && /* @__PURE__ */ React13.createElement(FiCheck7, { size: 12, className: "text-white" })
8161
+ ),
8162
+ /* @__PURE__ */ React13.createElement(
8163
+ "span",
8164
+ {
8165
+ className: `text-sm capitalize transition-colors ${isSelected ? "text-white font-medium" : "text-slate-400 group-hover:text-slate-300"}`
8166
+ },
8167
+ s
8168
+ )
8105
8169
  );
8106
- }))), /* @__PURE__ */ React13.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React13.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React13.createElement("label", { className: "text-xs text-slate-300" }, "Cor e Brilho"), hasImages && /* @__PURE__ */ React13.createElement("label", { className: "flex items-center gap-2 cursor-pointer group" }, /* @__PURE__ */ React13.createElement("div", { className: `w-4 h-4 rounded border flex items-center justify-center transition-colors ${useImageAsTexture ? "bg-indigo-500 border-indigo-500" : "border-slate-500 bg-transparent"}` }, useImageAsTexture && /* @__PURE__ */ React13.createElement(FiCheck7, { size: 12, className: "text-white" })), /* @__PURE__ */ React13.createElement(
8170
+ }))), /* @__PURE__ */ React13.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React13.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React13.createElement("label", { className: "text-xs text-slate-300" }, "Cor e Brilho"), hasImages && /* @__PURE__ */ React13.createElement("label", { className: "flex items-center gap-2 cursor-pointer group" }, /* @__PURE__ */ React13.createElement(
8171
+ "div",
8172
+ {
8173
+ className: `w-4 h-4 rounded border flex items-center justify-center transition-colors ${useImageAsTexture ? "bg-indigo-500 border-indigo-500" : "border-slate-500 bg-transparent"}`
8174
+ },
8175
+ useImageAsTexture && /* @__PURE__ */ React13.createElement(FiCheck7, { size: 12, className: "text-white" })
8176
+ ), /* @__PURE__ */ React13.createElement(
8107
8177
  "input",
8108
8178
  {
8109
8179
  type: "checkbox",
@@ -8111,7 +8181,13 @@ function InSceneCreationForm({
8111
8181
  onChange: handleToggleImageMode,
8112
8182
  className: "hidden"
8113
8183
  }
8114
- ), /* @__PURE__ */ React13.createElement("span", { className: `text-xs ${useImageAsTexture ? "text-indigo-300" : "text-slate-400 group-hover:text-slate-300"}` }, "Usar imagem para representar o node"))), /* @__PURE__ */ React13.createElement(
8184
+ ), /* @__PURE__ */ React13.createElement(
8185
+ "span",
8186
+ {
8187
+ className: `text-xs ${useImageAsTexture ? "text-indigo-300" : "text-slate-400 group-hover:text-slate-300"}`
8188
+ },
8189
+ "Usar imagem para representar o node"
8190
+ ))), /* @__PURE__ */ React13.createElement(
8115
8191
  ColorPicker,
8116
8192
  {
8117
8193
  color,
@@ -8130,7 +8206,22 @@ function InSceneCreationForm({
8130
8206
  className: "w-full h-1.5 bg-slate-700 rounded-lg appearance-none cursor-pointer accent-indigo-500 hover:accent-indigo-400",
8131
8207
  title: `Intensidade do brilho: ${intensity}`
8132
8208
  }
8133
- ), /* @__PURE__ */ React13.createElement("span", { className: "text-xs text-slate-400 w-6 text-right" }, intensity)), /* @__PURE__ */ React13.createElement("span", { className: `text-xs block mt-1 transition-opacity ${useImageAsTexture ? "opacity-40" : "text-slate-400"}` }, useImageAsTexture ? "Cor da borda (definida pela imagem)" : "Selecione a cor e ajuste o brilho.")), /* @__PURE__ */ React13.createElement("div", { className: "pt-2" }, /* @__PURE__ */ React13.createElement("div", { className: "flex items-center justify-between mb-2" }, /* @__PURE__ */ React13.createElement("h3", { className: "text-sm font-medium" }, "Propriedades Adicionais"), /* @__PURE__ */ React13.createElement("button", { type: "button", onClick: handleAddProp, className: "flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded-md bg-slate-800/70 hover:bg-slate-700/70 border border-white/10 transition-colors" }, /* @__PURE__ */ React13.createElement(FiPlus3, { size: 14 }), " Adicionar")), /* @__PURE__ */ React13.createElement("div", { className: "flex flex-col gap-3" }, customProps.map((prop, index) => /* @__PURE__ */ React13.createElement(
8209
+ ), /* @__PURE__ */ React13.createElement("span", { className: "text-xs text-slate-400 w-6 text-right" }, intensity)), /* @__PURE__ */ React13.createElement(
8210
+ "span",
8211
+ {
8212
+ className: `text-xs block mt-1 transition-opacity ${useImageAsTexture ? "opacity-40" : "text-slate-400"}`
8213
+ },
8214
+ useImageAsTexture ? "Cor da borda (definida pela imagem)" : "Selecione a cor e ajuste o brilho."
8215
+ )), /* @__PURE__ */ React13.createElement("div", { className: "pt-2" }, /* @__PURE__ */ React13.createElement("div", { className: "flex items-center justify-between mb-2" }, /* @__PURE__ */ React13.createElement("h3", { className: "text-sm font-medium" }, "Propriedades Adicionais"), /* @__PURE__ */ React13.createElement(
8216
+ "button",
8217
+ {
8218
+ type: "button",
8219
+ onClick: handleAddProp,
8220
+ className: "flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded-md bg-slate-800/70 hover:bg-slate-700/70 border border-white/10 transition-colors"
8221
+ },
8222
+ /* @__PURE__ */ React13.createElement(FiPlus3, { size: 14 }),
8223
+ " Adicionar"
8224
+ )), /* @__PURE__ */ React13.createElement("div", { className: "flex flex-col gap-3" }, customProps.map((prop, index) => /* @__PURE__ */ React13.createElement(
8134
8225
  CustomPropertyDisplay,
8135
8226
  {
8136
8227
  key: prop.id,
@@ -8138,13 +8229,30 @@ function InSceneCreationForm({
8138
8229
  onUpdate: (updatedProp) => handleUpdateProp(index, updatedProp),
8139
8230
  onRemove: () => handleRemoveProp(index),
8140
8231
  onOpenImageViewer,
8141
- unavailableTypes: currentUsedTypes.filter((t) => t !== prop.type),
8232
+ unavailableTypes: currentUsedTypes.filter(
8233
+ (t) => t !== prop.type
8234
+ ),
8142
8235
  isTextureMode: useImageAsTexture,
8143
8236
  selectedImageUrl,
8144
8237
  onSelectTexture: handleSelectTexture,
8145
8238
  onUploadFile
8146
8239
  }
8147
- )), /* @__PURE__ */ React13.createElement("div", { ref: propsEndRef })))), /* @__PURE__ */ React13.createElement("div", { className: "sticky bottom-0 z-10 bg-gradient-to-t from-slate-950/80 via-slate-950/50 to-transparent px-6 py-4 border-t border-white/10 flex justify-end gap-3" }, /* @__PURE__ */ React13.createElement("button", { type: "button", onClick: onCancel, className: "px-4 py-2 rounded-lg border border-white/15 bg-transparent hover:bg-white/5 transition-colors text-sm" }, "Cancelar"), /* @__PURE__ */ React13.createElement("button", { type: "submit", className: "px-4 py-2 rounded-lg bg-gradient-to-tr from-indigo-600 to-indigo-400 hover:from-indigo-500 hover:to-indigo-300 transition-colors font-semibold text-sm shadow-[0_8px_24px_rgba(99,102,241,0.35)]" }, "Salvar")))
8240
+ )), /* @__PURE__ */ React13.createElement("div", { ref: propsEndRef })))), /* @__PURE__ */ React13.createElement("div", { className: "sticky bottom-0 z-10 bg-gradient-to-t from-slate-950/80 via-slate-950/50 to-transparent px-6 py-4 border-t border-white/10 flex justify-end gap-3" }, /* @__PURE__ */ React13.createElement(
8241
+ "button",
8242
+ {
8243
+ type: "button",
8244
+ onClick: onCancel,
8245
+ className: "px-4 py-2 rounded-lg border border-white/15 bg-transparent hover:bg-white/5 transition-colors text-sm"
8246
+ },
8247
+ "Cancelar"
8248
+ ), /* @__PURE__ */ React13.createElement(
8249
+ "button",
8250
+ {
8251
+ type: "submit",
8252
+ className: "px-4 py-2 rounded-lg bg-gradient-to-tr from-indigo-600 to-indigo-400 hover:from-indigo-500 hover:to-indigo-300 transition-colors font-semibold text-sm shadow-[0_8px_24px_rgba(99,102,241,0.35)]"
8253
+ },
8254
+ "Salvar"
8255
+ )))
8148
8256
  ), isDescriptionModalOpen && /* @__PURE__ */ React13.createElement(
8149
8257
  DescriptionEditModal,
8150
8258
  {
@@ -8184,12 +8292,22 @@ function InSceneVersionForm({
8184
8292
  const [name, setName] = useState15("");
8185
8293
  const [size, setSize] = useState15("medium");
8186
8294
  const [description, setDescription] = useState15("");
8187
- const [customProps, setCustomProps] = useState15([{ id: v4_default(), key: "Date", type: "date", value: { type: "Data", value: "" }, isEditing: true }]);
8295
+ const [customProps, setCustomProps] = useState15([
8296
+ {
8297
+ id: v4_default(),
8298
+ key: "Date",
8299
+ type: "date",
8300
+ value: { type: "Data", value: "" },
8301
+ isEditing: true
8302
+ }
8303
+ ]);
8188
8304
  const [isDescriptionModalOpen, setIsDescriptionModalOpen] = useState15(false);
8189
8305
  const propsEndRef = useRef11(null);
8190
8306
  const [useImageAsTexture, setUseImageAsTexture] = useState15(false);
8191
8307
  const [selectedImageUrl, setSelectedImageUrl] = useState15(null);
8192
- const hasImages = customProps.some((p) => p.type === "images" && Array.isArray(p.value) && p.value.length > 0 && p.value.some((img) => img.value));
8308
+ const hasImages = customProps.some(
8309
+ (p) => p.type === "images" && Array.isArray(p.value) && p.value.length > 0 && p.value.some((img) => img.value)
8310
+ );
8193
8311
  useEffect14(() => {
8194
8312
  if (!hasImages && useImageAsTexture) {
8195
8313
  setUseImageAsTexture(false);
@@ -8206,7 +8324,10 @@ function InSceneVersionForm({
8206
8324
  setCustomProps([...customProps, newProp]);
8207
8325
  setTimeout(() => {
8208
8326
  var _a;
8209
- (_a = propsEndRef.current) == null ? void 0 : _a.scrollIntoView({ behavior: "smooth", block: "center" });
8327
+ (_a = propsEndRef.current) == null ? void 0 : _a.scrollIntoView({
8328
+ behavior: "smooth",
8329
+ block: "center"
8330
+ });
8210
8331
  }, 100);
8211
8332
  };
8212
8333
  const handleRemoveProp = (index) => {
@@ -8250,7 +8371,9 @@ function InSceneVersionForm({
8250
8371
  alert("O campo 'Nome' \xE9 obrigat\xF3rio.");
8251
8372
  return;
8252
8373
  }
8253
- const hasDate = customProps.some((prop) => prop.key === "Date" && !prop.isEditing);
8374
+ const hasDate = customProps.some(
8375
+ (prop) => prop.key === "Date" && !prop.isEditing
8376
+ );
8254
8377
  if (!hasDate) {
8255
8378
  alert("A propriedade 'Date' \xE9 obrigat\xF3ria.");
8256
8379
  return;
@@ -8301,7 +8424,25 @@ function InSceneVersionForm({
8301
8424
  },
8302
8425
  /* @__PURE__ */ React14.createElement("div", { className: "h-[2px] bg-gradient-to-r from-indigo-400/0 via-indigo-400/70 to-indigo-400/0" }),
8303
8426
  /* @__PURE__ */ React14.createElement("div", { className: "px-6 pt-5 pb-3" }, /* @__PURE__ */ React14.createElement("div", { className: "flex items-center gap-2 mb-1" }, /* @__PURE__ */ React14.createElement("span", { className: "inline-flex h-2.5 w-2.5 rounded-full bg-indigo-400/80 shadow-[0_0_18px_2px_rgba(99,102,241,0.55)]" }), /* @__PURE__ */ React14.createElement("p", { className: "text-xs/relaxed text-slate-300" }, "Criar Versionamento")), /* @__PURE__ */ React14.createElement("h2", { className: "text-xl sm:text-2xl font-semibold tracking-tight" }, "Nova Vers\xE3o")),
8304
- /* @__PURE__ */ React14.createElement("form", { onSubmit: handleSubmit, className: "flex flex-col max-h-[68vh]" }, /* @__PURE__ */ React14.createElement("div", { className: "px-6 pb-28 overflow-y-auto overscroll-contain space-y-4 custom-scrollbar" }, /* @__PURE__ */ React14.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React14.createElement("label", { className: "text-xs text-slate-300" }, "Tipo do Node (Fixo)"), /* @__PURE__ */ React14.createElement("input", { type: "text", value: displayType, disabled: true, className: "w-full bg-slate-800/70 p-2.5 text-sm rounded-lg border border-white/10 text-slate-400 cursor-not-allowed" })), /* @__PURE__ */ React14.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React14.createElement("label", { className: "text-xs text-slate-300" }, "Nome do Node"), /* @__PURE__ */ React14.createElement("input", { required: true, type: "text", placeholder: "Ex.: Vers\xE3o 2.0", value: name, onChange: handleNameInputChange, className: "w-full bg-slate-800/70 p-2.5 text-sm rounded-lg border border-white/10 focus:outline-none focus:ring-2 focus:ring-indigo-400/60" })), /* @__PURE__ */ React14.createElement("div", { className: "space-y-1.5 relative" }, /* @__PURE__ */ React14.createElement("label", { className: "text-xs text-slate-300" }, "Descri\xE7\xE3o (Opcional)"), /* @__PURE__ */ React14.createElement("div", { className: "relative group min-h-[80px] bg-slate-800/70 p-2.5 rounded-lg border border-white/10 hover:border-white/20 transition-colors" }, /* @__PURE__ */ React14.createElement(
8427
+ /* @__PURE__ */ React14.createElement("form", { onSubmit: handleSubmit, className: "flex flex-col max-h-[68vh]" }, /* @__PURE__ */ React14.createElement("div", { className: "px-6 pb-28 overflow-y-auto overscroll-contain space-y-4 custom-scrollbar" }, /* @__PURE__ */ React14.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React14.createElement("label", { className: "text-xs text-slate-300" }, "Tipo do Node (Fixo)"), /* @__PURE__ */ React14.createElement(
8428
+ "input",
8429
+ {
8430
+ type: "text",
8431
+ value: displayType,
8432
+ disabled: true,
8433
+ className: "w-full bg-slate-800/70 p-2.5 text-sm rounded-lg border border-white/10 text-slate-400 cursor-not-allowed"
8434
+ }
8435
+ )), /* @__PURE__ */ React14.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React14.createElement("label", { className: "text-xs text-slate-300" }, "Nome do Node"), /* @__PURE__ */ React14.createElement(
8436
+ "input",
8437
+ {
8438
+ required: true,
8439
+ type: "text",
8440
+ placeholder: "Ex.: Vers\xE3o 2.0",
8441
+ value: name,
8442
+ onChange: handleNameInputChange,
8443
+ className: "w-full bg-slate-800/70 p-2.5 text-sm rounded-lg border border-white/10 focus:outline-none focus:ring-2 focus:ring-indigo-400/60"
8444
+ }
8445
+ )), /* @__PURE__ */ React14.createElement("div", { className: "space-y-1.5 relative" }, /* @__PURE__ */ React14.createElement("label", { className: "text-xs text-slate-300" }, "Descri\xE7\xE3o"), /* @__PURE__ */ React14.createElement("div", { className: "relative group min-h-[80px] bg-slate-800/70 p-2.5 rounded-lg border border-white/10 hover:border-white/20 transition-colors" }, /* @__PURE__ */ React14.createElement(
8305
8446
  DescriptionDisplay,
8306
8447
  {
8307
8448
  description,
@@ -8338,10 +8479,28 @@ function InSceneVersionForm({
8338
8479
  onClick: () => handleSizeChange(s),
8339
8480
  className: "flex items-center gap-2 group cursor-pointer focus:outline-none"
8340
8481
  },
8341
- /* @__PURE__ */ React14.createElement("div", { className: `w-4 h-4 rounded-[4px] border flex items-center justify-center transition-all duration-200 ${isSelected ? "bg-indigo-500 border-indigo-500 shadow-[0_0_10px_rgba(99,102,241,0.4)]" : "border-slate-600 bg-transparent group-hover:border-slate-500"}` }, isSelected && /* @__PURE__ */ React14.createElement(FiCheck8, { size: 12, className: "text-white" })),
8342
- /* @__PURE__ */ React14.createElement("span", { className: `text-sm capitalize transition-colors ${isSelected ? "text-white font-medium" : "text-slate-400 group-hover:text-slate-300"}` }, s)
8482
+ /* @__PURE__ */ React14.createElement(
8483
+ "div",
8484
+ {
8485
+ className: `w-4 h-4 rounded-[4px] border flex items-center justify-center transition-all duration-200 ${isSelected ? "bg-indigo-500 border-indigo-500 shadow-[0_0_10px_rgba(99,102,241,0.4)]" : "border-slate-600 bg-transparent group-hover:border-slate-500"}`
8486
+ },
8487
+ isSelected && /* @__PURE__ */ React14.createElement(FiCheck8, { size: 12, className: "text-white" })
8488
+ ),
8489
+ /* @__PURE__ */ React14.createElement(
8490
+ "span",
8491
+ {
8492
+ className: `text-sm capitalize transition-colors ${isSelected ? "text-white font-medium" : "text-slate-400 group-hover:text-slate-300"}`
8493
+ },
8494
+ s
8495
+ )
8343
8496
  );
8344
- }))), /* @__PURE__ */ React14.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React14.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React14.createElement("label", { className: "text-xs text-slate-300" }, "Cor do Node (Fixa)"), hasImages && /* @__PURE__ */ React14.createElement("label", { className: "flex items-center gap-2 cursor-pointer group" }, /* @__PURE__ */ React14.createElement("div", { className: `w-4 h-4 rounded border flex items-center justify-center transition-colors ${useImageAsTexture ? "bg-indigo-500 border-indigo-500" : "border-slate-500 bg-transparent"}` }, useImageAsTexture && /* @__PURE__ */ React14.createElement(FiCheck8, { size: 12, className: "text-white" })), /* @__PURE__ */ React14.createElement(
8497
+ }))), /* @__PURE__ */ React14.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React14.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React14.createElement("label", { className: "text-xs text-slate-300" }, "Cor do Node (Fixa)"), hasImages && /* @__PURE__ */ React14.createElement("label", { className: "flex items-center gap-2 cursor-pointer group" }, /* @__PURE__ */ React14.createElement(
8498
+ "div",
8499
+ {
8500
+ className: `w-4 h-4 rounded border flex items-center justify-center transition-colors ${useImageAsTexture ? "bg-indigo-500 border-indigo-500" : "border-slate-500 bg-transparent"}`
8501
+ },
8502
+ useImageAsTexture && /* @__PURE__ */ React14.createElement(FiCheck8, { size: 12, className: "text-white" })
8503
+ ), /* @__PURE__ */ React14.createElement(
8345
8504
  "input",
8346
8505
  {
8347
8506
  type: "checkbox",
@@ -8349,7 +8508,35 @@ function InSceneVersionForm({
8349
8508
  onChange: handleToggleImageMode,
8350
8509
  className: "hidden"
8351
8510
  }
8352
- ), /* @__PURE__ */ React14.createElement("span", { className: `text-xs ${useImageAsTexture ? "text-indigo-300" : "text-slate-400 group-hover:text-slate-300"}` }, "Usar imagem"))), /* @__PURE__ */ React14.createElement("div", { className: `flex items-center gap-3 bg-slate-900/60 p-2.5 rounded-lg border border-white/10 transition-opacity duration-200 ${useImageAsTexture ? "opacity-40 pointer-events-none grayscale" : "opacity-100"}` }, /* @__PURE__ */ React14.createElement("div", { className: "h-8 w-12 rounded-md border border-white/10", style: { backgroundColor: fixedColor } }), /* @__PURE__ */ React14.createElement("span", { className: "text-xs text-slate-300" }, useImageAsTexture ? "Cor definida pela imagem." : "Cor herdada do node original."))), /* @__PURE__ */ React14.createElement("div", { className: "pt-2" }, /* @__PURE__ */ React14.createElement("div", { className: "flex items-center justify-between mb-2" }, /* @__PURE__ */ React14.createElement("h3", { className: "text-sm font-medium" }, "Propriedades Adicionais (*Date obrigat\xF3rio)"), /* @__PURE__ */ React14.createElement("button", { type: "button", onClick: handleAddProp, className: "flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded-md bg-slate-800/70 hover:bg-slate-700/70 border border-white/10 transition-colors" }, /* @__PURE__ */ React14.createElement(FiPlus4, { size: 14 }), " Adicionar")), /* @__PURE__ */ React14.createElement("div", { className: "flex flex-col gap-3" }, customProps.map((prop, index) => /* @__PURE__ */ React14.createElement(
8511
+ ), /* @__PURE__ */ React14.createElement(
8512
+ "span",
8513
+ {
8514
+ className: `text-xs ${useImageAsTexture ? "text-indigo-300" : "text-slate-400 group-hover:text-slate-300"}`
8515
+ },
8516
+ "Usar imagem"
8517
+ ))), /* @__PURE__ */ React14.createElement(
8518
+ "div",
8519
+ {
8520
+ className: `flex items-center gap-3 bg-slate-900/60 p-2.5 rounded-lg border border-white/10 transition-opacity duration-200 ${useImageAsTexture ? "opacity-40 pointer-events-none grayscale" : "opacity-100"}`
8521
+ },
8522
+ /* @__PURE__ */ React14.createElement(
8523
+ "div",
8524
+ {
8525
+ className: "h-8 w-12 rounded-md border border-white/10",
8526
+ style: { backgroundColor: fixedColor }
8527
+ }
8528
+ ),
8529
+ /* @__PURE__ */ React14.createElement("span", { className: "text-xs text-slate-300" }, useImageAsTexture ? "Cor definida pela imagem." : "Cor herdada do node original.")
8530
+ )), /* @__PURE__ */ React14.createElement("div", { className: "pt-2" }, /* @__PURE__ */ React14.createElement("div", { className: "flex items-center justify-between mb-2" }, /* @__PURE__ */ React14.createElement("h3", { className: "text-sm font-medium" }, "Propriedades Adicionais (*Date obrigat\xF3rio)"), /* @__PURE__ */ React14.createElement(
8531
+ "button",
8532
+ {
8533
+ type: "button",
8534
+ onClick: handleAddProp,
8535
+ className: "flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded-md bg-slate-800/70 hover:bg-slate-700/70 border border-white/10 transition-colors"
8536
+ },
8537
+ /* @__PURE__ */ React14.createElement(FiPlus4, { size: 14 }),
8538
+ " Adicionar"
8539
+ )), /* @__PURE__ */ React14.createElement("div", { className: "flex flex-col gap-3" }, customProps.map((prop, index) => /* @__PURE__ */ React14.createElement(
8353
8540
  CustomPropertyDisplay,
8354
8541
  {
8355
8542
  key: prop.id,
@@ -8357,13 +8544,30 @@ function InSceneVersionForm({
8357
8544
  onUpdate: (updatedProp) => handleUpdateProp(index, updatedProp),
8358
8545
  onRemove: () => handleRemoveProp(index),
8359
8546
  onOpenImageViewer,
8360
- unavailableTypes: currentUsedTypes.filter((t) => t !== prop.type),
8547
+ unavailableTypes: currentUsedTypes.filter(
8548
+ (t) => t !== prop.type
8549
+ ),
8361
8550
  isTextureMode: useImageAsTexture,
8362
8551
  selectedImageUrl,
8363
8552
  onSelectTexture: handleSelectTexture,
8364
8553
  onUploadFile
8365
8554
  }
8366
- )), /* @__PURE__ */ React14.createElement("div", { ref: propsEndRef })))), /* @__PURE__ */ React14.createElement("div", { className: "sticky bottom-0 z-10 bg-gradient-to-t from-slate-950/80 via-slate-950/50 to-transparent px-6 py-4 border-t border-white/10 flex justify-end gap-3" }, /* @__PURE__ */ React14.createElement("button", { type: "button", onClick: onCancel, className: "px-4 py-2 rounded-lg border border-white/15 bg-transparent hover:bg-white/5 transition-colors text-sm" }, "Cancelar"), /* @__PURE__ */ React14.createElement("button", { type: "submit", className: "px-4 py-2 rounded-lg bg-gradient-to-tr from-indigo-600 to-indigo-400 hover:from-indigo-500 hover:to-indigo-300 transition-colors font-semibold text-sm shadow-[0_8px_24px_rgba(99,102,241,0.35)]" }, "Salvar")))
8555
+ )), /* @__PURE__ */ React14.createElement("div", { ref: propsEndRef })))), /* @__PURE__ */ React14.createElement("div", { className: "sticky bottom-0 z-10 bg-gradient-to-t from-slate-950/80 via-slate-950/50 to-transparent px-6 py-4 border-t border-white/10 flex justify-end gap-3" }, /* @__PURE__ */ React14.createElement(
8556
+ "button",
8557
+ {
8558
+ type: "button",
8559
+ onClick: onCancel,
8560
+ className: "px-4 py-2 rounded-lg border border-white/15 bg-transparent hover:bg-white/5 transition-colors text-sm"
8561
+ },
8562
+ "Cancelar"
8563
+ ), /* @__PURE__ */ React14.createElement(
8564
+ "button",
8565
+ {
8566
+ type: "submit",
8567
+ className: "px-4 py-2 rounded-lg bg-gradient-to-tr from-indigo-600 to-indigo-400 hover:from-indigo-500 hover:to-indigo-300 transition-colors font-semibold text-sm shadow-[0_8px_24px_rgba(99,102,241,0.35)]"
8568
+ },
8569
+ "Salvar"
8570
+ )))
8367
8571
  ), isDescriptionModalOpen && /* @__PURE__ */ React14.createElement(
8368
8572
  DescriptionEditModal,
8369
8573
  {
@@ -8383,11 +8587,28 @@ function InSceneVersionForm({
8383
8587
 
8384
8588
  // src/components/InSceneQuestForm.jsx
8385
8589
  import React16, { useState as useState17, useRef as useRef12 } from "react";
8386
- import { FiPlus as FiPlus6, FiCheck as FiCheck9, FiEdit2 as FiEdit26, FiTarget, FiX as FiX5, FiChevronDown as FiChevronDown6, FiUser as FiUser2, FiSearch as FiSearch5 } from "react-icons/fi";
8590
+ import {
8591
+ FiPlus as FiPlus6,
8592
+ FiCheck as FiCheck9,
8593
+ FiEdit2 as FiEdit26,
8594
+ FiTarget,
8595
+ FiX as FiX5,
8596
+ FiChevronDown as FiChevronDown6,
8597
+ FiUser as FiUser2,
8598
+ FiSearch as FiSearch5
8599
+ } from "react-icons/fi";
8387
8600
 
8388
8601
  // src/components/QuestReviewStackEditor.jsx
8389
8602
  import React15, { useState as useState16 } from "react";
8390
- import { FiPlus as FiPlus5, FiX as FiX4, FiUser, FiSearch as FiSearch4, FiChevronUp, FiChevronDown as FiChevronDown5, FiAlertCircle } from "react-icons/fi";
8603
+ import {
8604
+ FiPlus as FiPlus5,
8605
+ FiX as FiX4,
8606
+ FiUser,
8607
+ FiSearch as FiSearch4,
8608
+ FiChevronUp,
8609
+ FiChevronDown as FiChevronDown5,
8610
+ FiStar
8611
+ } from "react-icons/fi";
8391
8612
  function QuestReviewStackEditor({
8392
8613
  reviewStack = [],
8393
8614
  onChange,
@@ -8397,7 +8618,10 @@ function QuestReviewStackEditor({
8397
8618
  const [isAdding, setIsAdding] = useState16(false);
8398
8619
  const [searchQuery, setSearchQuery] = useState16("");
8399
8620
  const handleAddReviewer = (userId) => {
8400
- const newStack = [...reviewStack, { userId, status: "pending", mandatory: false }];
8621
+ const newStack = [
8622
+ ...reviewStack,
8623
+ { userId, status: "pending", mandatory: true }
8624
+ ];
8401
8625
  onChange(newStack);
8402
8626
  setIsAdding(false);
8403
8627
  setSearchQuery("");
@@ -8408,21 +8632,27 @@ function QuestReviewStackEditor({
8408
8632
  };
8409
8633
  const handleToggleMandatory = (index) => {
8410
8634
  const newStack = [...reviewStack];
8411
- newStack[index] = { ...newStack[index], mandatory: !newStack[index].mandatory };
8635
+ newStack[index] = {
8636
+ ...newStack[index],
8637
+ mandatory: !newStack[index].mandatory
8638
+ };
8412
8639
  onChange(newStack);
8413
8640
  };
8414
8641
  const handleMove = (index, direction) => {
8415
8642
  const newStack = [...reviewStack];
8416
8643
  const targetIndex = index + direction;
8417
8644
  if (targetIndex < 0 || targetIndex >= newStack.length) return;
8418
- [newStack[index], newStack[targetIndex]] = [newStack[targetIndex], newStack[index]];
8645
+ [newStack[index], newStack[targetIndex]] = [
8646
+ newStack[targetIndex],
8647
+ newStack[index]
8648
+ ];
8419
8649
  onChange(newStack);
8420
8650
  };
8421
8651
  const filteredMembers = viewMembers.filter((m) => {
8422
8652
  const search = searchQuery.toLowerCase();
8423
8653
  return (m.name || "").toLowerCase().includes(search) || (m.email || "").toLowerCase().includes(search);
8424
8654
  });
8425
- return /* @__PURE__ */ React15.createElement("div", { className: "space-y-3" }, /* @__PURE__ */ React15.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React15.createElement("label", { className: "text-xs text-slate-300 font-medium uppercase tracking-wider" }, "Review Stack (Sequential)"), !readOnly && !isAdding && /* @__PURE__ */ React15.createElement(
8655
+ return /* @__PURE__ */ React15.createElement("div", { className: "space-y-3" }, /* @__PURE__ */ React15.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React15.createElement("label", { className: "text-xs text-slate-300 font-medium uppercase tracking-wider" }, "Review Stack"), !readOnly && !isAdding && /* @__PURE__ */ React15.createElement(
8426
8656
  "button",
8427
8657
  {
8428
8658
  type: "button",
@@ -8431,7 +8661,13 @@ function QuestReviewStackEditor({
8431
8661
  },
8432
8662
  /* @__PURE__ */ React15.createElement(FiPlus5, { size: 10 }),
8433
8663
  " Adicionar Camada"
8434
- )), isAdding && /* @__PURE__ */ React15.createElement("div", { className: "bg-slate-900/50 border border-sky-500/30 rounded-lg p-2 space-y-2 animate-in fade-in slide-in-from-top-1 duration-200" }, /* @__PURE__ */ React15.createElement("div", { className: "relative" }, /* @__PURE__ */ React15.createElement(FiSearch4, { className: "absolute left-2 top-1/2 -translate-y-1/2 text-slate-500", size: 12 }), /* @__PURE__ */ React15.createElement(
8664
+ )), isAdding && /* @__PURE__ */ React15.createElement("div", { className: "bg-slate-900/50 border border-sky-500/30 rounded-lg p-2 space-y-2 animate-in fade-in slide-in-from-top-1 duration-200" }, /* @__PURE__ */ React15.createElement("div", { className: "relative" }, /* @__PURE__ */ React15.createElement(
8665
+ FiSearch4,
8666
+ {
8667
+ className: "absolute left-2 top-1/2 -translate-y-1/2 text-slate-500",
8668
+ size: 12
8669
+ }
8670
+ ), /* @__PURE__ */ React15.createElement(
8435
8671
  "input",
8436
8672
  {
8437
8673
  autoFocus: true,
@@ -8441,7 +8677,14 @@ function QuestReviewStackEditor({
8441
8677
  onChange: (e) => setSearchQuery(e.target.value),
8442
8678
  className: "w-full bg-slate-800 border border-white/10 rounded p-1.5 pl-7 text-xs focus:outline-none focus:ring-1 focus:ring-sky-400"
8443
8679
  }
8444
- ), /* @__PURE__ */ React15.createElement("button", { onClick: () => setIsAdding(false), className: "absolute right-2 top-1/2 -translate-y-1/2 text-slate-500 hover:text-white" }, /* @__PURE__ */ React15.createElement(FiX4, { size: 14 }))), /* @__PURE__ */ React15.createElement("ul", { className: "max-h-32 overflow-y-auto custom-scrollbar space-y-1" }, filteredMembers.map((m) => /* @__PURE__ */ React15.createElement(
8680
+ ), /* @__PURE__ */ React15.createElement(
8681
+ "button",
8682
+ {
8683
+ onClick: () => setIsAdding(false),
8684
+ className: "absolute right-2 top-1/2 -translate-y-1/2 text-slate-500 hover:text-white"
8685
+ },
8686
+ /* @__PURE__ */ React15.createElement(FiX4, { size: 14 })
8687
+ )), /* @__PURE__ */ React15.createElement("ul", { className: "max-h-32 overflow-y-auto custom-scrollbar space-y-1" }, filteredMembers.map((m) => /* @__PURE__ */ React15.createElement(
8445
8688
  "li",
8446
8689
  {
8447
8690
  key: m.id,
@@ -8459,8 +8702,32 @@ function QuestReviewStackEditor({
8459
8702
  key: index,
8460
8703
  className: `group relative flex items-center gap-3 p-2 rounded-lg border ${isCompleted ? "bg-green-500/5 border-green-500/20" : "bg-white/5 border-white/10"} hover:border-white/20 transition-all`
8461
8704
  },
8462
- /* @__PURE__ */ React15.createElement("div", { className: "flex flex-col items-center gap-0.5 text-slate-500" }, /* @__PURE__ */ React15.createElement("span", { className: "text-[10px] font-bold opacity-50" }, index + 1), !readOnly && /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement("button", { type: "button", onClick: () => handleMove(index, -1), disabled: index === 0, className: "hover:text-sky-400 disabled:opacity-20" }, /* @__PURE__ */ React15.createElement(FiChevronUp, { size: 12 })), /* @__PURE__ */ React15.createElement("button", { type: "button", onClick: () => handleMove(index, 1), disabled: index === reviewStack.length - 1, className: "hover:text-sky-400 disabled:opacity-20" }, /* @__PURE__ */ React15.createElement(FiChevronDown5, { size: 12 })))),
8463
- /* @__PURE__ */ React15.createElement("div", { className: "flex-1 min-w-0" }, /* @__PURE__ */ React15.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React15.createElement("span", { className: `truncate text-sm font-medium ${isCompleted ? "text-green-300" : "text-slate-200"}` }, (member == null ? void 0 : member.name) || (member == null ? void 0 : member.email) || "Unknown User"), item.mandatory && /* @__PURE__ */ React15.createElement("span", { className: "flex-shrink-0 px-1.5 py-0.5 rounded-full bg-amber-500/20 text-amber-300 text-[8px] font-bold uppercase tracking-tighter border border-amber-500/30" }, "Obrigat\xF3rio")), /* @__PURE__ */ React15.createElement("p", { className: "text-[10px] text-slate-500 flex items-center gap-1" }, isCompleted ? "\u2713 Review Conclu\xEDda" : "\u23F3 Pendente")),
8705
+ /* @__PURE__ */ React15.createElement("div", { className: "flex flex-col items-center gap-0.5 text-slate-500" }, /* @__PURE__ */ React15.createElement("span", { className: "text-[10px] font-bold opacity-50" }, index + 1), !readOnly && /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(
8706
+ "button",
8707
+ {
8708
+ type: "button",
8709
+ onClick: () => handleMove(index, -1),
8710
+ disabled: index === 0,
8711
+ className: "hover:text-sky-400 disabled:opacity-20"
8712
+ },
8713
+ /* @__PURE__ */ React15.createElement(FiChevronUp, { size: 12 })
8714
+ ), /* @__PURE__ */ React15.createElement(
8715
+ "button",
8716
+ {
8717
+ type: "button",
8718
+ onClick: () => handleMove(index, 1),
8719
+ disabled: index === reviewStack.length - 1,
8720
+ className: "hover:text-sky-400 disabled:opacity-20"
8721
+ },
8722
+ /* @__PURE__ */ React15.createElement(FiChevronDown5, { size: 12 })
8723
+ ))),
8724
+ /* @__PURE__ */ React15.createElement("div", { className: "flex-1 min-w-0" }, /* @__PURE__ */ React15.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React15.createElement(
8725
+ "span",
8726
+ {
8727
+ className: `truncate text-sm font-medium ${isCompleted ? "text-green-300" : "text-slate-200"}`
8728
+ },
8729
+ (member == null ? void 0 : member.name) || (member == null ? void 0 : member.email) || "Unknown User"
8730
+ ), item.mandatory && /* @__PURE__ */ React15.createElement("span", { className: "flex-shrink-0 px-1.5 py-0.5 rounded-full bg-amber-500/20 text-amber-300 text-[8px] font-bold uppercase tracking-tighter border border-amber-500/30" }, "Obrigat\xF3rio")), /* @__PURE__ */ React15.createElement("p", { className: "text-[10px] text-slate-500 flex items-center gap-1" }, isCompleted ? "\u2713 Review Conclu\xEDda" : "\u23F3 Pendente")),
8464
8731
  !readOnly && /* @__PURE__ */ React15.createElement("div", { className: "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity" }, /* @__PURE__ */ React15.createElement(
8465
8732
  "button",
8466
8733
  {
@@ -8469,7 +8736,7 @@ function QuestReviewStackEditor({
8469
8736
  title: item.mandatory ? "Remover obrigatoriedade" : "Tornar obrigat\xF3rio",
8470
8737
  className: `p-1.5 rounded hover:bg-white/10 transition-colors ${item.mandatory ? "text-amber-400" : "text-slate-500"}`
8471
8738
  },
8472
- /* @__PURE__ */ React15.createElement(FiAlertCircle, { size: 14 })
8739
+ /* @__PURE__ */ React15.createElement(FiStar, { size: 14 })
8473
8740
  ), /* @__PURE__ */ React15.createElement(
8474
8741
  "button",
8475
8742
  {
@@ -8493,10 +8760,10 @@ function QuestReviewStackEditor({
8493
8760
 
8494
8761
  // src/components/InSceneQuestForm.jsx
8495
8762
  var QUEST_STATUS_COLORS2 = {
8496
- "Backlog": "#64748b",
8763
+ Backlog: "#64748b",
8497
8764
  "In Progress": "#eab308",
8498
- "Review": "#a855f7",
8499
- "Done": "#22c55e"
8765
+ Review: "#a855f7",
8766
+ Done: "#22c55e"
8500
8767
  };
8501
8768
  function InSceneQuestForm({
8502
8769
  onSave,
@@ -8540,7 +8807,10 @@ function InSceneQuestForm({
8540
8807
  setCustomProps([...customProps, newProp]);
8541
8808
  setTimeout(() => {
8542
8809
  var _a2;
8543
- (_a2 = propsEndRef.current) == null ? void 0 : _a2.scrollIntoView({ behavior: "smooth", block: "center" });
8810
+ (_a2 = propsEndRef.current) == null ? void 0 : _a2.scrollIntoView({
8811
+ behavior: "smooth",
8812
+ block: "center"
8813
+ });
8544
8814
  }, 100);
8545
8815
  };
8546
8816
  const handleRemoveProp = (index) => setCustomProps(customProps.filter((_, i) => i !== index));
@@ -8579,12 +8849,14 @@ function InSceneQuestForm({
8579
8849
  customProps.filter((prop) => prop.key.trim() && !prop.isEditing)
8580
8850
  );
8581
8851
  const processedSections = processDescriptionForSave(description, []);
8582
- const initialTimeline = [{
8583
- type: "quest_created",
8584
- timestamp: Date.now(),
8585
- actorId: ((_a2 = session == null ? void 0 : session.user) == null ? void 0 : _a2.id) || "unknown",
8586
- description: `Quest criada por ${((_b2 = session == null ? void 0 : session.user) == null ? void 0 : _b2.name) || "usu\xE1rio"}.`
8587
- }];
8852
+ const initialTimeline = [
8853
+ {
8854
+ type: "quest_created",
8855
+ timestamp: Date.now(),
8856
+ actorId: ((_a2 = session == null ? void 0 : session.user) == null ? void 0 : _a2.id) || "unknown",
8857
+ description: `Quest criada por ${((_b2 = session == null ? void 0 : session.user) == null ? void 0 : _b2.name) || "usu\xE1rio"}.`
8858
+ }
8859
+ ];
8588
8860
  if (assigneeId) {
8589
8861
  initialTimeline.push({
8590
8862
  type: "assignee_changed",
@@ -8630,7 +8902,15 @@ function InSceneQuestForm({
8630
8902
  onContextMenu: swallow,
8631
8903
  onDoubleClick: swallow
8632
8904
  },
8633
- /* @__PURE__ */ React16.createElement("div", { className: "h-[2px]", style: { background: `linear-gradient(to right, transparent, ${QUEST_STATUS_COLORS2[status]}, transparent)` } }),
8905
+ /* @__PURE__ */ React16.createElement(
8906
+ "div",
8907
+ {
8908
+ className: "h-[2px]",
8909
+ style: {
8910
+ background: `linear-gradient(to right, transparent, ${QUEST_STATUS_COLORS2[status]}, transparent)`
8911
+ }
8912
+ }
8913
+ ),
8634
8914
  /* @__PURE__ */ React16.createElement("div", { className: "px-6 pt-5 pb-3 flex items-start justify-between gap-4" }, /* @__PURE__ */ React16.createElement("div", null, /* @__PURE__ */ React16.createElement("div", { className: "flex items-center gap-2 mb-1" }, /* @__PURE__ */ React16.createElement(FiTarget, { className: "text-sky-400", size: 14 }), /* @__PURE__ */ React16.createElement("p", { className: "text-xs/relaxed text-slate-300" }, "Nova quest")), /* @__PURE__ */ React16.createElement("h2", { className: "text-xl sm:text-2xl font-semibold tracking-tight" }, "Criar Quest")), /* @__PURE__ */ React16.createElement(
8635
8915
  "button",
8636
8916
  {
@@ -8655,16 +8935,40 @@ function InSceneQuestForm({
8655
8935
  },
8656
8936
  className: "w-full bg-slate-800/70 p-2.5 text-sm rounded-lg border border-white/10 focus:outline-none focus:ring-2 focus:ring-indigo-400/60"
8657
8937
  }
8658
- ), /* @__PURE__ */ React16.createElement("div", { className: "pt-1 flex items-center gap-1.5" }, /* @__PURE__ */ React16.createElement("span", { className: "text-[10px] uppercase font-bold text-slate-500 tracking-wider" }), /* @__PURE__ */ React16.createElement("p", { className: "text-xs text-indigo-300 font-medium truncate", title: standardizedName }, standardizedName))), /* @__PURE__ */ React16.createElement("div", { className: "space-y-1.5 relative mt-2" }, /* @__PURE__ */ React16.createElement("label", { className: "text-xs text-slate-300 font-medium uppercase tracking-wider" }, "Status da Quest"), /* @__PURE__ */ React16.createElement("div", { className: "relative" }, /* @__PURE__ */ React16.createElement(
8938
+ ), /* @__PURE__ */ React16.createElement("div", { className: "pt-1 flex items-center gap-1.5" }, /* @__PURE__ */ React16.createElement("span", { className: "text-[10px] uppercase font-bold text-slate-500 tracking-wider" }), /* @__PURE__ */ React16.createElement(
8939
+ "p",
8940
+ {
8941
+ className: "text-xs text-indigo-300 font-medium truncate",
8942
+ title: standardizedName
8943
+ },
8944
+ standardizedName
8945
+ ))), /* @__PURE__ */ React16.createElement("div", { className: "space-y-1.5 relative mt-2" }, /* @__PURE__ */ React16.createElement("label", { className: "text-xs text-slate-300 font-medium uppercase tracking-wider" }, "Status da Quest"), /* @__PURE__ */ React16.createElement("div", { className: "relative" }, /* @__PURE__ */ React16.createElement(
8659
8946
  "button",
8660
8947
  {
8661
8948
  type: "button",
8662
8949
  onClick: () => setIsStatusDropdownOpen(!isStatusDropdownOpen),
8663
8950
  className: "w-full bg-slate-800/70 p-2.5 text-sm rounded-lg border border-white/10 hover:border-white/20 focus:outline-none focus:ring-2 focus:ring-indigo-400/60 transition-colors flex items-center justify-between"
8664
8951
  },
8665
- /* @__PURE__ */ React16.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React16.createElement("span", { className: "w-3 h-3 rounded-full shadow-[0_0_8px_rgba(0,0,0,0.5)]", style: { backgroundColor: QUEST_STATUS_COLORS2[status] } }), /* @__PURE__ */ React16.createElement("span", { className: "text-slate-200 font-medium" }, status)),
8666
- /* @__PURE__ */ React16.createElement(FiChevronDown6, { className: `text-slate-400 transition-transform duration-200 ${isStatusDropdownOpen ? "rotate-180" : ""}` })
8667
- ), isStatusDropdownOpen && /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement("div", { className: "fixed inset-0 z-40", onClick: () => setIsStatusDropdownOpen(false) }), /* @__PURE__ */ React16.createElement("ul", { className: "absolute top-full left-0 mt-1.5 w-full bg-slate-800 border border-white/10 rounded-lg shadow-[0_8px_30px_rgba(0,0,0,0.5)] z-50 overflow-hidden" }, Object.keys(QUEST_STATUS_COLORS2).map((s) => /* @__PURE__ */ React16.createElement(
8952
+ /* @__PURE__ */ React16.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React16.createElement(
8953
+ "span",
8954
+ {
8955
+ className: "w-3 h-3 rounded-full shadow-[0_0_8px_rgba(0,0,0,0.5)]",
8956
+ style: { backgroundColor: QUEST_STATUS_COLORS2[status] }
8957
+ }
8958
+ ), /* @__PURE__ */ React16.createElement("span", { className: "text-slate-200 font-medium" }, status)),
8959
+ /* @__PURE__ */ React16.createElement(
8960
+ FiChevronDown6,
8961
+ {
8962
+ className: `text-slate-400 transition-transform duration-200 ${isStatusDropdownOpen ? "rotate-180" : ""}`
8963
+ }
8964
+ )
8965
+ ), isStatusDropdownOpen && /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(
8966
+ "div",
8967
+ {
8968
+ className: "fixed inset-0 z-40",
8969
+ onClick: () => setIsStatusDropdownOpen(false)
8970
+ }
8971
+ ), /* @__PURE__ */ React16.createElement("ul", { className: "absolute top-full left-0 mt-1.5 w-full bg-slate-800 border border-white/10 rounded-lg shadow-[0_8px_30px_rgba(0,0,0,0.5)] z-50 overflow-hidden" }, Object.keys(QUEST_STATUS_COLORS2).map((s) => /* @__PURE__ */ React16.createElement(
8668
8972
  "li",
8669
8973
  {
8670
8974
  key: s,
@@ -8675,7 +8979,13 @@ function InSceneQuestForm({
8675
8979
  },
8676
8980
  className: `px-3 py-2.5 text-sm cursor-pointer transition-colors flex items-center gap-2 ${status === s ? "bg-indigo-500/20 text-white" : "text-slate-300 hover:bg-white/5 hover:text-white"}`
8677
8981
  },
8678
- /* @__PURE__ */ React16.createElement("span", { className: "w-3 h-3 rounded-full", style: { backgroundColor: QUEST_STATUS_COLORS2[s] } }),
8982
+ /* @__PURE__ */ React16.createElement(
8983
+ "span",
8984
+ {
8985
+ className: "w-3 h-3 rounded-full",
8986
+ style: { backgroundColor: QUEST_STATUS_COLORS2[s] }
8987
+ }
8988
+ ),
8679
8989
  s
8680
8990
  )))))), /* @__PURE__ */ React16.createElement("div", { className: "space-y-1.5 relative mt-2" }, /* @__PURE__ */ React16.createElement("label", { className: "text-xs text-slate-300 font-medium uppercase tracking-wider" }, "Assignee (Respons\xE1vel)"), /* @__PURE__ */ React16.createElement("div", { className: "relative" }, /* @__PURE__ */ React16.createElement(
8681
8991
  "button",
@@ -8685,11 +8995,22 @@ function InSceneQuestForm({
8685
8995
  className: "w-full bg-slate-800/70 p-2.5 text-sm rounded-lg border border-white/10 hover:border-white/20 focus:outline-none focus:ring-2 focus:ring-indigo-400/60 transition-colors flex items-center justify-between"
8686
8996
  },
8687
8997
  /* @__PURE__ */ React16.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React16.createElement(FiUser2, { className: "text-slate-400", size: 14 }), /* @__PURE__ */ React16.createElement("span", { className: "text-slate-200 font-medium" }, ((_a = viewMembers.find((m) => m.id === assigneeId)) == null ? void 0 : _a.name) || ((_b = viewMembers.find((m) => m.id === assigneeId)) == null ? void 0 : _b.email) || "Nenhum")),
8688
- /* @__PURE__ */ React16.createElement(FiChevronDown6, { className: `text-slate-400 transition-transform duration-200 ${isAssigneeDropdownOpen ? "rotate-180" : ""}` })
8689
- ), isAssigneeDropdownOpen && /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement("div", { className: "fixed inset-0 z-40", onClick: () => {
8690
- setIsAssigneeDropdownOpen(false);
8691
- setAssigneeSearchQuery("");
8692
- } }), /* @__PURE__ */ React16.createElement("div", { className: "absolute top-full left-0 mt-1.5 w-full bg-slate-900 border border-white/10 rounded-lg shadow-[0_8px_30px_rgba(0,0,0,0.5)] z-50 overflow-hidden flex flex-col" }, /* @__PURE__ */ React16.createElement("div", { className: "p-2 border-b border-white/5 bg-white/5 flex items-center gap-2" }, /* @__PURE__ */ React16.createElement(FiSearch5, { className: "text-slate-500", size: 14 }), /* @__PURE__ */ React16.createElement(
8998
+ /* @__PURE__ */ React16.createElement(
8999
+ FiChevronDown6,
9000
+ {
9001
+ className: `text-slate-400 transition-transform duration-200 ${isAssigneeDropdownOpen ? "rotate-180" : ""}`
9002
+ }
9003
+ )
9004
+ ), isAssigneeDropdownOpen && /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(
9005
+ "div",
9006
+ {
9007
+ className: "fixed inset-0 z-40",
9008
+ onClick: () => {
9009
+ setIsAssigneeDropdownOpen(false);
9010
+ setAssigneeSearchQuery("");
9011
+ }
9012
+ }
9013
+ ), /* @__PURE__ */ React16.createElement("div", { className: "absolute top-full left-0 mt-1.5 w-full bg-slate-900 border border-white/10 rounded-lg shadow-[0_8px_30px_rgba(0,0,0,0.5)] z-50 overflow-hidden flex flex-col" }, /* @__PURE__ */ React16.createElement("div", { className: "p-2 border-b border-white/5 bg-white/5 flex items-center gap-2" }, /* @__PURE__ */ React16.createElement(FiSearch5, { className: "text-slate-500", size: 14 }), /* @__PURE__ */ React16.createElement(
8693
9014
  "input",
8694
9015
  {
8695
9016
  type: "text",
@@ -8736,20 +9057,7 @@ function InSceneQuestForm({
8736
9057
  onChange: setReviewStack,
8737
9058
  viewMembers
8738
9059
  }
8739
- )), /* @__PURE__ */ React16.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React16.createElement("label", { className: "text-xs text-slate-300 font-medium uppercase tracking-wider" }, "Tipos Adicionais"), /* @__PURE__ */ React16.createElement("div", { className: "relative w-full bg-slate-800/70 p-1.5 min-h-[42px] flex flex-wrap gap-1.5 rounded-lg border border-white/10 focus-within:ring-2 focus-within:ring-indigo-400/60 transition-all" }, types.map((t, index) => /* @__PURE__ */ React16.createElement("span", { key: index, className: `flex items-center gap-1 px-1.5 py-0.5 rounded-md text-xs font-medium border ${t === "quest" ? "bg-sky-500/20 text-sky-200 border-sky-500/30" : "bg-indigo-500/30 text-indigo-100 border-indigo-500/20"}` }, t, t !== "quest" && /* @__PURE__ */ React16.createElement("button", { type: "button", onClick: () => handleRemoveType(index), className: "hover:text-white transition-colors" }, /* @__PURE__ */ React16.createElement(FiX5, { size: 12 })))), /* @__PURE__ */ React16.createElement(
8740
- "input",
8741
- {
8742
- type: "text",
8743
- value: typeInput,
8744
- onChange: (e) => setTypeInput(e.target.value),
8745
- onKeyDown: handleTypeInputKeyDown,
8746
- onBlur: () => {
8747
- if (typeInput.trim()) handleAddType(typeInput);
8748
- },
8749
- className: "flex-1 bg-transparent text-sm min-w-[80px] focus:outline-none text-slate-200",
8750
- autoComplete: "off"
8751
- }
8752
- ))), /* @__PURE__ */ React16.createElement("div", { className: "space-y-1.5 relative" }, /* @__PURE__ */ React16.createElement("label", { className: "text-xs text-slate-300 font-medium uppercase tracking-wider" }, "Descri\xE7\xE3o (Opcional)"), /* @__PURE__ */ React16.createElement("div", { className: "relative group min-h-[80px] bg-slate-800/70 p-2.5 rounded-lg border border-white/10 hover:border-white/20 transition-colors" }, /* @__PURE__ */ React16.createElement(
9060
+ )), /* @__PURE__ */ React16.createElement("div", { className: "space-y-1.5 relative mt-2" }, /* @__PURE__ */ React16.createElement("label", { className: "text-xs text-slate-300 font-medium uppercase tracking-wider" }, "Descri\xE7\xE3o"), /* @__PURE__ */ React16.createElement("div", { className: "relative group min-h-[80px] bg-slate-800/70 p-2.5 rounded-lg border border-white/10 hover:border-white/20 transition-colors" }, /* @__PURE__ */ React16.createElement(
8753
9061
  DescriptionDisplay,
8754
9062
  {
8755
9063
  description,
@@ -8759,20 +9067,31 @@ function InSceneQuestForm({
8759
9067
  onMentionClick,
8760
9068
  onSaveDescription: (newDesc) => setDescription(newDesc)
8761
9069
  }
8762
- ), /* @__PURE__ */ React16.createElement("div", { className: "absolute top-0 right-0 flex bg-slate-900/50 rounded-bl-lg backdrop-blur-sm opacity-0 group-hover:opacity-100 transition-opacity overflow-hidden border-b border-l border-white/5" }, /* @__PURE__ */ React16.createElement("button", { type: "button", onClick: () => setIsDescriptionModalOpen(true), className: "p-2 text-slate-400 hover:text-white hover:bg-white/10 transition-colors" }, /* @__PURE__ */ React16.createElement(FiEdit26, { size: 14 }))), !description && /* @__PURE__ */ React16.createElement("div", { onClick: () => setIsDescriptionModalOpen(true), className: "absolute inset-0 flex items-center justify-center text-xs text-slate-500 cursor-text" }, "Adicionar descri\xE7\xE3o..."))), /* @__PURE__ */ React16.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React16.createElement("label", { className: "text-xs text-slate-300 font-medium uppercase tracking-wider" }, "Tamanho no Node (Size)"), /* @__PURE__ */ React16.createElement("div", { className: "flex items-center gap-5" }, ["small", "medium", "large"].map((s) => /* @__PURE__ */ React16.createElement(
9070
+ ), /* @__PURE__ */ React16.createElement("div", { className: "absolute top-0 right-0 flex bg-slate-900/50 rounded-bl-lg backdrop-blur-sm opacity-0 group-hover:opacity-100 transition-opacity overflow-hidden border-b border-l border-white/5" }, /* @__PURE__ */ React16.createElement(
8763
9071
  "button",
8764
9072
  {
8765
- key: s,
8766
9073
  type: "button",
8767
- onClick: () => {
8768
- setSize(s);
8769
- onSizeChange == null ? void 0 : onSizeChange(s);
8770
- },
8771
- className: "flex items-center gap-2 group cursor-pointer focus:outline-none"
9074
+ onClick: () => setIsDescriptionModalOpen(true),
9075
+ className: "p-2 text-slate-400 hover:text-white hover:bg-white/10 transition-colors"
8772
9076
  },
8773
- /* @__PURE__ */ React16.createElement("div", { className: `w-4 h-4 rounded-[4px] border flex items-center justify-center transition-all duration-200 ${size === s ? "bg-indigo-500 border-indigo-500" : "border-slate-600 bg-transparent group-hover:border-slate-500"}` }, size === s && /* @__PURE__ */ React16.createElement(FiCheck9, { size: 12, className: "text-white" })),
8774
- /* @__PURE__ */ React16.createElement("span", { className: `text-sm capitalize transition-colors ${size === s ? "text-white font-medium" : "text-slate-400 group-hover:text-slate-300"}` }, s)
8775
- )))), /* @__PURE__ */ React16.createElement("div", { className: "pt-2" }, /* @__PURE__ */ React16.createElement("div", { className: "flex items-center justify-between mb-2" }, /* @__PURE__ */ React16.createElement("h3", { className: "text-xs text-slate-400 font-medium uppercase tracking-wider" }, "Propriedades Adicionais"), /* @__PURE__ */ React16.createElement("button", { type: "button", onClick: handleAddProp, className: "flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded-md bg-slate-800/70 hover:bg-slate-700/70 border border-white/10 transition-colors" }, /* @__PURE__ */ React16.createElement(FiPlus6, { size: 14 }), " Adicionar")), /* @__PURE__ */ React16.createElement("div", { className: "flex flex-col gap-3" }, customProps.map((prop, index) => /* @__PURE__ */ React16.createElement(
9077
+ /* @__PURE__ */ React16.createElement(FiEdit26, { size: 14 })
9078
+ )), !description && /* @__PURE__ */ React16.createElement(
9079
+ "div",
9080
+ {
9081
+ onClick: () => setIsDescriptionModalOpen(true),
9082
+ className: "absolute inset-0 flex items-center justify-center text-xs text-slate-500 cursor-text"
9083
+ },
9084
+ "Adicionar descri\xE7\xE3o..."
9085
+ ))), /* @__PURE__ */ React16.createElement("div", { className: "pt-2" }, /* @__PURE__ */ React16.createElement("div", { className: "flex items-center justify-between mb-2" }, /* @__PURE__ */ React16.createElement("h3", { className: "text-xs text-slate-400 font-medium uppercase tracking-wider" }, "Propriedades Adicionais"), /* @__PURE__ */ React16.createElement(
9086
+ "button",
9087
+ {
9088
+ type: "button",
9089
+ onClick: handleAddProp,
9090
+ className: "flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded-md bg-slate-800/70 hover:bg-slate-700/70 border border-white/10 transition-colors"
9091
+ },
9092
+ /* @__PURE__ */ React16.createElement(FiPlus6, { size: 14 }),
9093
+ " Adicionar"
9094
+ )), /* @__PURE__ */ React16.createElement("div", { className: "flex flex-col gap-3" }, customProps.map((prop, index) => /* @__PURE__ */ React16.createElement(
8776
9095
  CustomPropertyDisplay,
8777
9096
  {
8778
9097
  key: prop.id,
@@ -8780,10 +9099,81 @@ function InSceneQuestForm({
8780
9099
  onUpdate: (updatedProp) => handleUpdateProp(index, updatedProp),
8781
9100
  onRemove: () => handleRemoveProp(index),
8782
9101
  onOpenImageViewer,
8783
- unavailableTypes: currentUsedTypes.filter((t) => t !== prop.type),
9102
+ unavailableTypes: currentUsedTypes.filter(
9103
+ (t) => t !== prop.type
9104
+ ),
8784
9105
  onUploadFile
8785
9106
  }
8786
- )), /* @__PURE__ */ React16.createElement("div", { ref: propsEndRef })))), /* @__PURE__ */ React16.createElement("div", { className: "sticky bottom-0 z-10 bg-gradient-to-t from-slate-950/80 via-slate-950/50 to-transparent px-6 py-4 border-t border-white/10 flex justify-end gap-3" }, /* @__PURE__ */ React16.createElement("button", { type: "button", onClick: onCancel, className: "px-4 py-2 rounded-lg border border-white/15 bg-transparent hover:bg-white/5 transition-colors text-sm" }, "Cancelar"), /* @__PURE__ */ React16.createElement("button", { type: "submit", className: "px-4 py-2 rounded-lg bg-gradient-to-tr from-indigo-600 to-indigo-400 hover:from-indigo-500 hover:to-indigo-300 transition-colors font-semibold text-sm shadow-[0_8px_24px_rgba(99,102,241,0.35)]" }, "Salvar Quest")))
9107
+ )), /* @__PURE__ */ React16.createElement("div", { ref: propsEndRef }))), /* @__PURE__ */ React16.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React16.createElement("label", { className: "text-xs text-slate-300 font-medium uppercase tracking-wider" }, "Tamanho no Node (Size)"), /* @__PURE__ */ React16.createElement("div", { className: "flex items-center gap-5" }, ["small", "medium", "large"].map((s) => /* @__PURE__ */ React16.createElement(
9108
+ "button",
9109
+ {
9110
+ key: s,
9111
+ type: "button",
9112
+ onClick: () => {
9113
+ setSize(s);
9114
+ onSizeChange == null ? void 0 : onSizeChange(s);
9115
+ },
9116
+ className: "flex items-center gap-2 group cursor-pointer focus:outline-none"
9117
+ },
9118
+ /* @__PURE__ */ React16.createElement(
9119
+ "div",
9120
+ {
9121
+ className: `w-4 h-4 rounded-[4px] border flex items-center justify-center transition-all duration-200 ${size === s ? "bg-indigo-500 border-indigo-500" : "border-slate-600 bg-transparent group-hover:border-slate-500"}`
9122
+ },
9123
+ size === s && /* @__PURE__ */ React16.createElement(FiCheck9, { size: 12, className: "text-white" })
9124
+ ),
9125
+ /* @__PURE__ */ React16.createElement(
9126
+ "span",
9127
+ {
9128
+ className: `text-sm capitalize transition-colors ${size === s ? "text-white font-medium" : "text-slate-400 group-hover:text-slate-300"}`
9129
+ },
9130
+ s
9131
+ )
9132
+ )))), /* @__PURE__ */ React16.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React16.createElement("label", { className: "text-xs text-slate-300 font-medium uppercase tracking-wider" }, "Tipos Adicionais"), /* @__PURE__ */ React16.createElement("div", { className: "relative w-full bg-slate-800/70 p-1.5 min-h-[42px] flex flex-wrap gap-1.5 rounded-lg border border-white/10 focus-within:ring-2 focus-within:ring-indigo-400/60 transition-all" }, types.map((t, index) => /* @__PURE__ */ React16.createElement(
9133
+ "span",
9134
+ {
9135
+ key: index,
9136
+ className: `flex items-center gap-1 px-1.5 py-0.5 rounded-md text-xs font-medium border ${t === "quest" ? "bg-sky-500/20 text-sky-200 border-sky-500/30" : "bg-indigo-500/30 text-indigo-100 border-indigo-500/20"}`
9137
+ },
9138
+ t,
9139
+ t !== "quest" && /* @__PURE__ */ React16.createElement(
9140
+ "button",
9141
+ {
9142
+ type: "button",
9143
+ onClick: () => handleRemoveType(index),
9144
+ className: "hover:text-white transition-colors"
9145
+ },
9146
+ /* @__PURE__ */ React16.createElement(FiX5, { size: 12 })
9147
+ )
9148
+ )), /* @__PURE__ */ React16.createElement(
9149
+ "input",
9150
+ {
9151
+ type: "text",
9152
+ value: typeInput,
9153
+ onChange: (e) => setTypeInput(e.target.value),
9154
+ onKeyDown: handleTypeInputKeyDown,
9155
+ onBlur: () => {
9156
+ if (typeInput.trim()) handleAddType(typeInput);
9157
+ },
9158
+ className: "flex-1 bg-transparent text-sm min-w-[80px] focus:outline-none text-slate-200",
9159
+ autoComplete: "off"
9160
+ }
9161
+ )))), /* @__PURE__ */ React16.createElement("div", { className: "sticky bottom-0 z-10 bg-gradient-to-t from-slate-950/80 via-slate-950/50 to-transparent px-6 py-4 border-t border-white/10 flex justify-end gap-3" }, /* @__PURE__ */ React16.createElement(
9162
+ "button",
9163
+ {
9164
+ type: "button",
9165
+ onClick: onCancel,
9166
+ className: "px-4 py-2 rounded-lg border border-white/15 bg-transparent hover:bg-white/5 transition-colors text-sm"
9167
+ },
9168
+ "Cancelar"
9169
+ ), /* @__PURE__ */ React16.createElement(
9170
+ "button",
9171
+ {
9172
+ type: "submit",
9173
+ className: "px-4 py-2 rounded-lg bg-gradient-to-tr from-indigo-600 to-indigo-400 hover:from-indigo-500 hover:to-indigo-300 transition-colors font-semibold text-sm shadow-[0_8px_24px_rgba(99,102,241,0.35)]"
9174
+ },
9175
+ "Salvar Quest"
9176
+ )))
8787
9177
  ), isDescriptionModalOpen && /* @__PURE__ */ React16.createElement(
8788
9178
  DescriptionEditModal,
8789
9179
  {
@@ -9339,7 +9729,8 @@ function QuestDetailsPanel({
9339
9729
  onUploadFile,
9340
9730
  userRole,
9341
9731
  currentDatasetName,
9342
- viewMembers = []
9732
+ viewMembers = [],
9733
+ currentUser
9343
9734
  }) {
9344
9735
  var _a;
9345
9736
  const initialRawTitle = (node == null ? void 0 : node.raw_title) || (((_a = node == null ? void 0 : node.name) == null ? void 0 : _a.includes(" - \xBB ")) ? node.name.split(" - \xBB ")[1] : node == null ? void 0 : node.name) || "";
@@ -9439,8 +9830,7 @@ function QuestDetailsPanel({
9439
9830
  });
9440
9831
  };
9441
9832
  const swallow = (e) => e.stopPropagation();
9442
- const handleNameChange = (e) => {
9443
- const val = e.target.value;
9833
+ const handleNameChange = (val) => {
9444
9834
  setRawTitle(val);
9445
9835
  const newStandardName = questPrefix ? `${questPrefix} - \xBB ${val || "Sem t\xEDtulo"}` : val;
9446
9836
  onNameChange == null ? void 0 : onNameChange(node.id, newStandardName, val);
@@ -9451,6 +9841,51 @@ function QuestDetailsPanel({
9451
9841
  onSizeChange == null ? void 0 : onSizeChange(node.id, newSize);
9452
9842
  setHasUnsavedChanges(true);
9453
9843
  };
9844
+ const handleReturnToOperation = async () => {
9845
+ if (isSaving) return;
9846
+ setIsSaving(true);
9847
+ const actorId = (currentUser == null ? void 0 : currentUser.id) || "unknown";
9848
+ const actorName = (currentUser == null ? void 0 : currentUser.name) || "Revisor";
9849
+ const targetMember = viewMembers.find((m) => String(m.id) === String(assigneeId));
9850
+ const targetName = (targetMember == null ? void 0 : targetMember.name) || "executor";
9851
+ const newEvent = {
9852
+ type: "review_returned",
9853
+ timestamp: Date.now(),
9854
+ actorId,
9855
+ description: `Review finalizada com retorno para opera\xE7\xE3o por ${actorName}. Novo respons\xE1vel: ${targetName}.`
9856
+ };
9857
+ const updatedTimeline = [...timeline, newEvent];
9858
+ const updatedStatus = "In Progress";
9859
+ const updatedColor = "#eab308";
9860
+ const nodeToSave = {
9861
+ ...node,
9862
+ name: standardizedName,
9863
+ raw_title: rawTitle,
9864
+ description,
9865
+ status: updatedStatus,
9866
+ color: updatedColor,
9867
+ assignee_id: assigneeId,
9868
+ reviewStack,
9869
+ timeline: updatedTimeline,
9870
+ size,
9871
+ types: types.includes("quest") ? types : [...types, "quest"],
9872
+ intensity: intensity || 0,
9873
+ useImageAsTexture: node.useImageAsTexture || false,
9874
+ textureImageUrl: node.textureImageUrl || null
9875
+ };
9876
+ try {
9877
+ await onSave(nodeToSave, false);
9878
+ setTimeline(updatedTimeline);
9879
+ setStatus(updatedStatus);
9880
+ onDataUpdate(nodeToSave);
9881
+ setHasUnsavedChanges(false);
9882
+ } catch (error) {
9883
+ console.error("Erro ao retornar para opera\xE7\xE3o:", error);
9884
+ alert("Erro ao realizar o retorno para opera\xE7\xE3o.");
9885
+ } finally {
9886
+ setIsSaving(false);
9887
+ }
9888
+ };
9454
9889
  const handleStatusChange = (newStatus) => {
9455
9890
  setStatus(newStatus);
9456
9891
  const newColor = QUEST_STATUS_COLORS3[newStatus];
@@ -9622,7 +10057,7 @@ function QuestDetailsPanel({
9622
10057
  {
9623
10058
  type: "text",
9624
10059
  value: rawTitle,
9625
- onChange: handleNameChange,
10060
+ onChange: (e) => handleNameChange(e.target.value),
9626
10061
  readOnly: !canEdit,
9627
10062
  className: `w-full bg-slate-800/70 p-2.5 text-sm rounded-lg border border-white/10 focus:outline-none ${canEdit ? "focus:ring-2 focus:ring-indigo-400/60" : "cursor-default text-slate-400"}`
9628
10063
  }
@@ -9739,7 +10174,24 @@ function QuestDetailsPanel({
9739
10174
  viewMembers,
9740
10175
  readOnly: !canEdit
9741
10176
  }
9742
- )), /* @__PURE__ */ React18.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React18.createElement("label", { className: "text-xs text-slate-300" }, "Tipos Adicionais"), /* @__PURE__ */ React18.createElement("div", { className: `relative w-full bg-slate-800/70 p-1.5 min-h-[42px] flex flex-wrap gap-1.5 rounded-lg border border-white/10 ${canEdit ? "focus-within:ring-2 focus-within:ring-indigo-400/60" : ""} transition-all` }, types.map((t, index) => /* @__PURE__ */ React18.createElement("span", { key: index, className: `flex items-center gap-1 px-1.5 py-0.5 rounded-md text-xs font-medium border ${t === "quest" ? "bg-sky-500/20 text-sky-200 border-sky-500/30" : "bg-indigo-500/30 text-indigo-100 border-indigo-500/20"}` }, t, canEdit && t !== "quest" && /* @__PURE__ */ React18.createElement("button", { type: "button", onClick: () => handleRemoveType(index), className: "hover:text-white transition-colors" }, /* @__PURE__ */ React18.createElement(FiX7, { size: 12 })))), canEdit && /* @__PURE__ */ React18.createElement(
10177
+ )), status === "Review" && canEdit && /* @__PURE__ */ React18.createElement("div", { className: "pt-2" }, /* @__PURE__ */ React18.createElement("div", { className: "bg-slate-900/40 rounded-xl p-4 border border-white/5 space-y-3" }, /* @__PURE__ */ React18.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React18.createElement("h3", { className: "text-[11px] uppercase font-bold text-slate-500 tracking-wider" }, "A\xE7\xF5es de Review"), /* @__PURE__ */ React18.createElement("span", { className: "px-2 py-0.5 rounded-full bg-purple-500/10 text-purple-300 text-[10px] font-medium border border-purple-500/20" }, "Em Revis\xE3o")), /* @__PURE__ */ React18.createElement("p", { className: "text-xs text-slate-400 leading-relaxed" }, "Se algo precisar de ajuste, selecione o respons\xE1vel acima e clique para retornar o ciclo para opera\xE7\xE3o."), /* @__PURE__ */ React18.createElement(
10178
+ "button",
10179
+ {
10180
+ type: "button",
10181
+ onClick: handleReturnToOperation,
10182
+ disabled: isSaving,
10183
+ className: "w-full h-10 flex items-center justify-center gap-2 rounded-lg bg-slate-800 hover:bg-slate-700 text-slate-200 text-xs font-semibold border border-white/10 transition-all hover:border-white/20 active:scale-[0.98] disabled:opacity-50 disabled:cursor-wait"
10184
+ },
10185
+ /* @__PURE__ */ React18.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React18.createElement("path", { d: "M12 19V5M5 12l7 7 7-7" })),
10186
+ "Retornar para Opera\xE7\xE3o"
10187
+ ))), /* @__PURE__ */ React18.createElement("div", { className: "space-y-1.5 relative" }, /* @__PURE__ */ React18.createElement("label", { className: "text-xs text-slate-300" }, "Descri\xE7\xE3o"), /* @__PURE__ */ React18.createElement("div", { className: "relative group min-h-[60px] bg-slate-800/40 rounded-lg border border-white/10 hover:border-white/20 transition-colors" }, /* @__PURE__ */ React18.createElement(DescriptionDisplay, { description, savedSections: existingSections, availableNodes, availableAncestries, onOpenReference, onMentionClick, onImageClick: handleImageClickFromText, onSaveDescription: handleSaveDescriptionInline }), /* @__PURE__ */ React18.createElement("div", { className: "absolute top-0 right-0 flex bg-slate-900/50 rounded-bl-lg backdrop-blur-sm opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity overflow-hidden border-b border-l border-white/5" }, /* @__PURE__ */ React18.createElement("button", { type: "button", onClick: () => setIsReadMode(true), className: `p-2 text-slate-400 hover:text-white hover:bg-white/10 transition-colors ${canEdit ? "border-r border-white/5" : ""}`, title: "Modo de Leitura" }, /* @__PURE__ */ React18.createElement(FiBookOpen4, { size: 14 })), canEdit && /* @__PURE__ */ React18.createElement("button", { type: "button", onClick: () => setIsDescriptionModalOpen(true), className: "p-2 text-slate-400 hover:text-white hover:bg-white/10 transition-colors", title: "Editar descri\xE7\xE3o (Modo de Escrita)" }, /* @__PURE__ */ React18.createElement(FiEdit28, { size: 14 }))), canEdit && !description && /* @__PURE__ */ React18.createElement("div", { onClick: () => setIsDescriptionModalOpen(true), className: "absolute inset-0 flex items-center justify-center text-xs text-slate-500 cursor-text" }, "Adicionar descri\xE7\xE3o..."))), /* @__PURE__ */ React18.createElement("div", { className: "pt-2" }, /* @__PURE__ */ React18.createElement("div", { className: "flex items-center justify-between mb-2" }, /* @__PURE__ */ React18.createElement("h3", { className: "text-sm font-medium" }, "Propriedades Adicionais"), canEdit && /* @__PURE__ */ React18.createElement("button", { type: "button", onClick: handleAddProp, className: "flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded-md bg-slate-800/70 hover:bg-slate-700/70 border border-white/10 transition-colors" }, /* @__PURE__ */ React18.createElement(FiPlus8, { size: 14 }), " Adicionar")), /* @__PURE__ */ React18.createElement("div", { className: "flex flex-col gap-3" }, customProps.map((prop, idx) => /* @__PURE__ */ React18.createElement(CustomPropertyDisplay, { key: prop.id, prop, onUpdate: canEdit ? (updatedProp) => handleUpdateProp(idx, updatedProp) : void 0, onRemove: canEdit ? () => handleRemoveProp(idx) : void 0, onOpenImageViewer, unavailableTypes: currentUsedTypes.filter((t) => t !== prop.type), isTextureMode: false, onUploadFile: canEdit ? onUploadFile : void 0, readOnly: !canEdit })), /* @__PURE__ */ React18.createElement("div", { ref: propsEndRef }))), timeline && timeline.length > 0 && /* @__PURE__ */ React18.createElement("div", { className: "pt-4 pb-2 border-t border-white/10 mt-4" }, /* @__PURE__ */ React18.createElement("h3", { className: "text-xs text-slate-400 font-medium uppercase tracking-wider mb-3" }, "Timeline & Hist\xF3rico"), /* @__PURE__ */ React18.createElement("div", { className: "relative border-l border-white/10 ml-2.5 space-y-4" }, timeline.slice().sort((a, b) => a.timestamp - b.timestamp).map((event, idx) => {
10188
+ const dateObj = new Date(event.timestamp);
10189
+ const dateString = dateObj.toLocaleDateString("pt-BR", { day: "2-digit", month: "short", hour: "2-digit", minute: "2-digit" });
10190
+ return /* @__PURE__ */ React18.createElement("div", { key: idx, className: "relative pl-4 flex flex-col gap-0.5" }, /* @__PURE__ */ React18.createElement("div", { className: "absolute left-[-4.5px] top-1.5 w-2 h-2 rounded-full bg-slate-400/50 border-[1.5px] border-slate-900" }), /* @__PURE__ */ React18.createElement("p", { className: "text-[11px] text-slate-300" }, event.description), /* @__PURE__ */ React18.createElement("span", { className: "text-[9px] text-slate-500 font-mono tracking-tighter" }, dateString));
10191
+ }))), /* @__PURE__ */ React18.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React18.createElement("label", { className: "text-xs text-slate-300" }, "Tamanho no Node (Size)"), /* @__PURE__ */ React18.createElement("div", { className: "flex items-center gap-5" }, ["small", "medium", "large"].map((s) => {
10192
+ const isSelected = size === s;
10193
+ return /* @__PURE__ */ React18.createElement("button", { key: s, type: "button", onClick: () => canEdit && handleSizeChange(s), className: `flex items-center gap-2 group focus:outline-none ${canEdit ? "cursor-pointer" : "cursor-default opacity-80"}` }, /* @__PURE__ */ React18.createElement("div", { className: `w-4 h-4 rounded-[4px] border flex items-center justify-center transition-all duration-200 ${isSelected ? "bg-indigo-500 border-indigo-500 shadow-[0_0_10px_rgba(99,102,241,0.4)]" : "border-slate-600 bg-transparent " + (canEdit ? "group-hover:border-slate-500" : "")}` }, isSelected && /* @__PURE__ */ React18.createElement(FiCheck11, { size: 12, className: "text-white" })), /* @__PURE__ */ React18.createElement("span", { className: `text-sm capitalize transition-colors ${isSelected ? "text-white font-medium" : "text-slate-400 " + (canEdit ? "group-hover:text-slate-300" : "")}` }, s));
10194
+ }))), /* @__PURE__ */ React18.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React18.createElement("label", { className: "text-xs text-slate-300" }, "Tipos Adicionais"), /* @__PURE__ */ React18.createElement("div", { className: `relative w-full bg-slate-800/70 p-1.5 min-h-[42px] flex flex-wrap gap-1.5 rounded-lg border border-white/10 ${canEdit ? "focus-within:ring-2 focus-within:ring-indigo-400/60" : ""} transition-all` }, types.map((t, index) => /* @__PURE__ */ React18.createElement("span", { key: index, className: `flex items-center gap-1 px-1.5 py-0.5 rounded-md text-xs font-medium border ${t === "quest" ? "bg-sky-500/20 text-sky-200 border-sky-500/30" : "bg-indigo-500/30 text-indigo-100 border-indigo-500/20"}` }, t, canEdit && t !== "quest" && /* @__PURE__ */ React18.createElement("button", { type: "button", onClick: () => handleRemoveType(index), className: "hover:text-white transition-colors" }, /* @__PURE__ */ React18.createElement(FiX7, { size: 12 })))), canEdit && /* @__PURE__ */ React18.createElement(
9743
10195
  "input",
9744
10196
  {
9745
10197
  type: "text",
@@ -9763,14 +10215,7 @@ function QuestDetailsPanel({
9763
10215
  ), canEdit && showTypeSuggestions && filteredTypes.length > 0 && /* @__PURE__ */ React18.createElement("ul", { className: "custom-scrollbar absolute top-full left-0 z-10 w-full mt-1 max-h-40 overflow-y-auto rounded-lg bg-slate-800 border border-white/10 shadow-lg" }, filteredTypes.map((suggestedType, index) => /* @__PURE__ */ React18.createElement("li", { key: index, className: "px-3 py-2 text-sm text-slate-200 cursor-pointer hover:bg-indigo-600/50", onMouseDown: (e) => {
9764
10216
  e.preventDefault();
9765
10217
  handleAddType(suggestedType);
9766
- } }, suggestedType))))), /* @__PURE__ */ React18.createElement("div", { className: "space-y-1.5 relative" }, /* @__PURE__ */ React18.createElement("label", { className: "text-xs text-slate-300" }, "Descri\xE7\xE3o"), /* @__PURE__ */ React18.createElement("div", { className: "relative group min-h-[60px] bg-slate-800/40 rounded-lg border border-white/10 hover:border-white/20 transition-colors" }, /* @__PURE__ */ React18.createElement(DescriptionDisplay, { description, savedSections: existingSections, availableNodes, availableAncestries, onOpenReference, onMentionClick, onImageClick: handleImageClickFromText, onSaveDescription: handleSaveDescriptionInline }), /* @__PURE__ */ React18.createElement("div", { className: "absolute top-0 right-0 flex bg-slate-900/50 rounded-bl-lg backdrop-blur-sm opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity overflow-hidden border-b border-l border-white/5" }, /* @__PURE__ */ React18.createElement("button", { type: "button", onClick: () => setIsReadMode(true), className: `p-2 text-slate-400 hover:text-white hover:bg-white/10 transition-colors ${canEdit ? "border-r border-white/5" : ""}`, title: "Modo de Leitura" }, /* @__PURE__ */ React18.createElement(FiBookOpen4, { size: 14 })), canEdit && /* @__PURE__ */ React18.createElement("button", { type: "button", onClick: () => setIsDescriptionModalOpen(true), className: "p-2 text-slate-400 hover:text-white hover:bg-white/10 transition-colors", title: "Editar descri\xE7\xE3o (Modo de Escrita)" }, /* @__PURE__ */ React18.createElement(FiEdit28, { size: 14 }))), canEdit && !description && /* @__PURE__ */ React18.createElement("div", { onClick: () => setIsDescriptionModalOpen(true), className: "absolute inset-0 flex items-center justify-center text-xs text-slate-500 cursor-text" }, "Adicionar descri\xE7\xE3o..."))), /* @__PURE__ */ React18.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React18.createElement("label", { className: "text-xs text-slate-300" }, "Tamanho no Node (Size)"), /* @__PURE__ */ React18.createElement("div", { className: "flex items-center gap-5" }, ["small", "medium", "large"].map((s) => {
9767
- const isSelected = size === s;
9768
- return /* @__PURE__ */ React18.createElement("button", { key: s, type: "button", onClick: () => canEdit && handleSizeChange(s), className: `flex items-center gap-2 group focus:outline-none ${canEdit ? "cursor-pointer" : "cursor-default opacity-80"}` }, /* @__PURE__ */ React18.createElement("div", { className: `w-4 h-4 rounded-[4px] border flex items-center justify-center transition-all duration-200 ${isSelected ? "bg-indigo-500 border-indigo-500 shadow-[0_0_10px_rgba(99,102,241,0.4)]" : "border-slate-600 bg-transparent " + (canEdit ? "group-hover:border-slate-500" : "")}` }, isSelected && /* @__PURE__ */ React18.createElement(FiCheck11, { size: 12, className: "text-white" })), /* @__PURE__ */ React18.createElement("span", { className: `text-sm capitalize transition-colors ${isSelected ? "text-white font-medium" : "text-slate-400 " + (canEdit ? "group-hover:text-slate-300" : "")}` }, s));
9769
- }))), /* @__PURE__ */ React18.createElement("div", { className: "pt-2" }, /* @__PURE__ */ React18.createElement("div", { className: "flex items-center justify-between mb-2" }, /* @__PURE__ */ React18.createElement("h3", { className: "text-sm font-medium" }, "Propriedades Adicionais"), canEdit && /* @__PURE__ */ React18.createElement("button", { type: "button", onClick: handleAddProp, className: "flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded-md bg-slate-800/70 hover:bg-slate-700/70 border border-white/10 transition-colors" }, /* @__PURE__ */ React18.createElement(FiPlus8, { size: 14 }), " Adicionar")), /* @__PURE__ */ React18.createElement("div", { className: "flex flex-col gap-3" }, customProps.map((prop, idx) => /* @__PURE__ */ React18.createElement(CustomPropertyDisplay, { key: prop.id, prop, onUpdate: canEdit ? (updatedProp) => handleUpdateProp(idx, updatedProp) : void 0, onRemove: canEdit ? () => handleRemoveProp(idx) : void 0, onOpenImageViewer, unavailableTypes: currentUsedTypes.filter((t) => t !== prop.type), isTextureMode: false, onUploadFile: canEdit ? onUploadFile : void 0, readOnly: !canEdit })), /* @__PURE__ */ React18.createElement("div", { ref: propsEndRef }))), timeline && timeline.length > 0 && /* @__PURE__ */ React18.createElement("div", { className: "pt-4 pb-2 border-t border-white/10 mt-4" }, /* @__PURE__ */ React18.createElement("h3", { className: "text-xs text-slate-400 font-medium uppercase tracking-wider mb-3" }, "Timeline & Hist\xF3rico"), /* @__PURE__ */ React18.createElement("div", { className: "relative border-l border-white/10 ml-2.5 space-y-4" }, timeline.slice().sort((a, b) => a.timestamp - b.timestamp).map((event, idx) => {
9770
- const dateObj = new Date(event.timestamp);
9771
- const dateString = dateObj.toLocaleDateString("pt-BR", { day: "2-digit", month: "short", hour: "2-digit", minute: "2-digit" });
9772
- return /* @__PURE__ */ React18.createElement("div", { key: idx, className: "relative pl-4 flex flex-col gap-0.5" }, /* @__PURE__ */ React18.createElement("div", { className: "absolute left-[-4.5px] top-1.5 w-2 h-2 rounded-full bg-slate-400/50 border-[1.5px] border-slate-900" }), /* @__PURE__ */ React18.createElement("p", { className: "text-[11px] text-slate-300" }, event.description), /* @__PURE__ */ React18.createElement("span", { className: "text-[9px] text-slate-500 font-mono tracking-tighter" }, dateString));
9773
- }))), currentDatasetName && /* @__PURE__ */ React18.createElement("div", { className: "pt-3 mt-4 border-t border-white/10 flex items-center justify-end gap-2 text-xs text-slate-400" }, /* @__PURE__ */ React18.createElement("span", { className: "truncate text-right" }, /* @__PURE__ */ React18.createElement("span", { className: "text-slate-200 font-medium" }, currentDatasetName)))), /* @__PURE__ */ React18.createElement("div", { className: "sticky bottom-0 z-10 bg-gradient-to-t from-slate-950/80 via-slate-950/50 to-transparent px-6 py-4 border-t border-white/10 flex justify-end gap-3" }, /* @__PURE__ */ React18.createElement("button", { onClick: handleCancel, disabled: isSaving, className: "px-4 py-2 rounded-lg border border-white/15 bg-transparent hover:bg-white/5 transition-colors text-sm disabled:opacity-50" }, canEdit ? "Cancelar" : "Fechar"), canEdit && /* @__PURE__ */ React18.createElement("button", { onClick: () => handleSave(false), disabled: isSaving, className: `px-4 py-2 rounded-lg transition-all font-semibold text-sm shadow-[0_8px_24px_rgba(99,102,241,0.35)] flex items-center gap-2 ${isSaving ? "bg-slate-700 text-slate-300 cursor-wait" : "bg-gradient-to-tr from-indigo-600 to-indigo-400 hover:from-indigo-500 hover:to-indigo-300 text-white"}` }, isSaving && /* @__PURE__ */ React18.createElement(FiLoader3, { className: "animate-spin" }), isSaving ? "Salvando..." : "Salvar Quest")))
10218
+ } }, suggestedType))))), currentDatasetName && /* @__PURE__ */ React18.createElement("div", { className: "pt-3 mt-4 border-t border-white/10 flex items-center justify-end gap-2 text-xs text-slate-400" }, /* @__PURE__ */ React18.createElement("span", { className: "truncate text-right" }, /* @__PURE__ */ React18.createElement("span", { className: "text-slate-200 font-medium" }, currentDatasetName)))), /* @__PURE__ */ React18.createElement("div", { className: "sticky bottom-0 z-10 bg-gradient-to-t from-slate-950/80 via-slate-950/50 to-transparent px-6 py-4 border-t border-white/10 flex justify-end gap-3" }, /* @__PURE__ */ React18.createElement("button", { onClick: handleCancel, disabled: isSaving, className: "px-4 py-2 rounded-lg border border-white/15 bg-transparent hover:bg-white/5 transition-colors text-sm disabled:opacity-50" }, canEdit ? "Cancelar" : "Fechar"), canEdit && /* @__PURE__ */ React18.createElement("button", { onClick: () => handleSave(false), disabled: isSaving, className: `px-4 py-2 rounded-lg transition-all font-semibold text-sm shadow-[0_8px_24px_rgba(99,102,241,0.35)] flex items-center gap-2 ${isSaving ? "bg-slate-700 text-slate-300 cursor-wait" : "bg-gradient-to-tr from-indigo-600 to-indigo-400 hover:from-indigo-500 hover:to-indigo-300 text-white"}` }, isSaving && /* @__PURE__ */ React18.createElement(FiLoader3, { className: "animate-spin" }), isSaving ? "Salvando..." : "Salvar Quest")))
9774
10219
  ), isDescriptionModalOpen && canEdit && /* @__PURE__ */ React18.createElement(
9775
10220
  DescriptionEditModal,
9776
10221
  {
@@ -9884,8 +10329,12 @@ function RelationshipDetailsPanel({
9884
10329
  }) {
9885
10330
  const [name, setName] = useState21((link == null ? void 0 : link.name) ?? "");
9886
10331
  const [description, setDescription] = useState21((link == null ? void 0 : link.description) ?? "");
9887
- const [customProps, setCustomProps] = useState21(() => extractCustomPropsFromNode(link || {}));
9888
- const [existingSections, setExistingSections] = useState21((link == null ? void 0 : link.description_sections) || []);
10332
+ const [customProps, setCustomProps] = useState21(
10333
+ () => extractCustomPropsFromNode(link || {})
10334
+ );
10335
+ const [existingSections, setExistingSections] = useState21(
10336
+ (link == null ? void 0 : link.description_sections) || []
10337
+ );
9889
10338
  const [sourceLabel, setSourceLabel] = useState21((link == null ? void 0 : link.source_label) ?? "");
9890
10339
  const [targetLabel, setTargetLabel] = useState21((link == null ? void 0 : link.target_label) ?? "");
9891
10340
  const [isDescriptionModalOpen, setIsDescriptionModalOpen] = useState21(false);
@@ -9914,7 +10363,10 @@ function RelationshipDetailsPanel({
9914
10363
  setHasUnsavedChanges(true);
9915
10364
  setTimeout(() => {
9916
10365
  var _a;
9917
- (_a = propsEndRef.current) == null ? void 0 : _a.scrollIntoView({ behavior: "smooth", block: "center" });
10366
+ (_a = propsEndRef.current) == null ? void 0 : _a.scrollIntoView({
10367
+ behavior: "smooth",
10368
+ block: "center"
10369
+ });
9918
10370
  }, 100);
9919
10371
  };
9920
10372
  const handleSave = async (keepOpen = false, overrides = {}) => {
@@ -9931,8 +10383,13 @@ function RelationshipDetailsPanel({
9931
10383
  }
9932
10384
  setIsSaving(true);
9933
10385
  try {
9934
- const extrasObj = toObjectFromCustomProps(currentCustomProps.filter((p) => !p.isEditing));
9935
- const processedSections = processDescriptionForSave(currentDescription, currentExistingSections);
10386
+ const extrasObj = toObjectFromCustomProps(
10387
+ currentCustomProps.filter((p) => !p.isEditing)
10388
+ );
10389
+ const processedSections = processDescriptionForSave(
10390
+ currentDescription,
10391
+ currentExistingSections
10392
+ );
9936
10393
  const dataToSave = {
9937
10394
  id: link.id,
9938
10395
  source: link.source,
@@ -9944,8 +10401,10 @@ function RelationshipDetailsPanel({
9944
10401
  isCurved: link.isCurved,
9945
10402
  curveOffset: link.curveOffset
9946
10403
  };
9947
- if (currentSourceLabel.trim()) dataToSave.source_label = currentSourceLabel.trim();
9948
- if (currentTargetLabel.trim()) dataToSave.target_label = currentTargetLabel.trim();
10404
+ if (currentSourceLabel.trim())
10405
+ dataToSave.source_label = currentSourceLabel.trim();
10406
+ if (currentTargetLabel.trim())
10407
+ dataToSave.target_label = currentTargetLabel.trim();
9949
10408
  await onSave(dataToSave, keepOpen);
9950
10409
  onDataUpdate(dataToSave);
9951
10410
  setHasUnsavedChanges(false);
@@ -10024,7 +10483,16 @@ function RelationshipDetailsPanel({
10024
10483
  onImageClick: handleImageClickFromText,
10025
10484
  onSaveDescription: handleSaveDescriptionInline
10026
10485
  }
10027
- ) : /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement("div", { className: "h-[2px] bg-gradient-to-r from-teal-400/0 via-teal-400/70 to-teal-400/0" }), /* @__PURE__ */ React20.createElement("div", { className: "px-6 pt-5 pb-3 flex items-start justify-between gap-4" }, /* @__PURE__ */ React20.createElement("div", { className: "min-w-0" }, /* @__PURE__ */ React20.createElement("div", { className: "flex items-center gap-2 mb-1" }, /* @__PURE__ */ React20.createElement("span", { className: "inline-flex h-2.5 w-2.5 rounded-full bg-teal-400/80 shadow-[0_0_18px_2px_rgba(45,212,191,0.55)]" }), /* @__PURE__ */ React20.createElement("p", { className: "text-xs/relaxed text-slate-300" }, "Detalhes da Rela\xE7\xE3o")), /* @__PURE__ */ React20.createElement("h2", { className: "text-xl sm:text-2xl font-semibold tracking-tight" }, name || "Rela\xE7\xE3o")), /* @__PURE__ */ React20.createElement("button", { onClick: onClose, disabled: isSaving, className: "w-9 h-9 flex-shrink-0 grid place-content-center rounded-lg border border-white/15 bg-transparent hover:bg-white/5 transition-colors text-xl disabled:opacity-50", title: "Fechar" }, "\xD7")), /* @__PURE__ */ React20.createElement("div", { className: "px-6 pb-28 overflow-y-auto overscroll-contain space-y-4 max-h-[68vh] custom-scrollbar" }, /* @__PURE__ */ React20.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React20.createElement("label", { className: "text-xs text-slate-300" }, "Nome da Rela\xE7\xE3o (Opcional)"), /* @__PURE__ */ React20.createElement(
10486
+ ) : /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement("div", { className: "h-[2px] bg-gradient-to-r from-teal-400/0 via-teal-400/70 to-teal-400/0" }), /* @__PURE__ */ React20.createElement("div", { className: "px-6 pt-5 pb-3 flex items-start justify-between gap-4" }, /* @__PURE__ */ React20.createElement("div", { className: "min-w-0" }, /* @__PURE__ */ React20.createElement("div", { className: "flex items-center gap-2 mb-1" }, /* @__PURE__ */ React20.createElement("span", { className: "inline-flex h-2.5 w-2.5 rounded-full bg-teal-400/80 shadow-[0_0_18px_2px_rgba(45,212,191,0.55)]" }), /* @__PURE__ */ React20.createElement("p", { className: "text-xs/relaxed text-slate-300" }, "Detalhes da Rela\xE7\xE3o")), /* @__PURE__ */ React20.createElement("h2", { className: "text-xl sm:text-2xl font-semibold tracking-tight" }, name || "Rela\xE7\xE3o")), /* @__PURE__ */ React20.createElement(
10487
+ "button",
10488
+ {
10489
+ onClick: onClose,
10490
+ disabled: isSaving,
10491
+ className: "w-9 h-9 flex-shrink-0 grid place-content-center rounded-lg border border-white/15 bg-transparent hover:bg-white/5 transition-colors text-xl disabled:opacity-50",
10492
+ title: "Fechar"
10493
+ },
10494
+ "\xD7"
10495
+ )), /* @__PURE__ */ React20.createElement("div", { className: "px-6 pb-28 overflow-y-auto overscroll-contain space-y-4 max-h-[68vh] custom-scrollbar" }, /* @__PURE__ */ React20.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React20.createElement("label", { className: "text-xs text-slate-300" }, "Nome da Rela\xE7\xE3o"), /* @__PURE__ */ React20.createElement(
10028
10496
  "input",
10029
10497
  {
10030
10498
  type: "text",
@@ -10039,7 +10507,23 @@ function RelationshipDetailsPanel({
10039
10507
  ${!canEdit ? "opacity-50 cursor-not-allowed" : ""}
10040
10508
  `
10041
10509
  }
10042
- )), /* @__PURE__ */ React20.createElement("div", { className: "rounded-xl border border-white/8 bg-slate-800/30 p-3 space-y-3" }, /* @__PURE__ */ React20.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React20.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "text-violet-400 flex-shrink-0" }, /* @__PURE__ */ React20.createElement("path", { d: "M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z" }), /* @__PURE__ */ React20.createElement("line", { x1: "7", y1: "7", x2: "7.01", y2: "7" })), /* @__PURE__ */ React20.createElement("p", { className: "text-xs font-medium text-violet-300/80 uppercase tracking-wider" }, "Labels de Agrupamento")), /* @__PURE__ */ React20.createElement("p", { className: "text-[11px] text-slate-400 leading-relaxed" }, "Labels agrupam conex\xF5es no menu de Conex\xF5es. Cada lado da conex\xE3o pode ter sua pr\xF3pria label."), /* @__PURE__ */ React20.createElement("div", { className: "grid grid-cols-2 gap-2" }, /* @__PURE__ */ React20.createElement("div", { className: "space-y-1" }, /* @__PURE__ */ React20.createElement("label", { className: "text-[11px] text-slate-400" }, "Label do Source"), /* @__PURE__ */ React20.createElement(
10510
+ )), /* @__PURE__ */ React20.createElement("div", { className: "rounded-xl border border-white/8 bg-slate-800/30 p-3 space-y-3" }, /* @__PURE__ */ React20.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React20.createElement(
10511
+ "svg",
10512
+ {
10513
+ xmlns: "http://www.w3.org/2000/svg",
10514
+ width: "13",
10515
+ height: "13",
10516
+ viewBox: "0 0 24 24",
10517
+ fill: "none",
10518
+ stroke: "currentColor",
10519
+ strokeWidth: "2",
10520
+ strokeLinecap: "round",
10521
+ strokeLinejoin: "round",
10522
+ className: "text-violet-400 flex-shrink-0"
10523
+ },
10524
+ /* @__PURE__ */ React20.createElement("path", { d: "M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z" }),
10525
+ /* @__PURE__ */ React20.createElement("line", { x1: "7", y1: "7", x2: "7.01", y2: "7" })
10526
+ ), /* @__PURE__ */ React20.createElement("p", { className: "text-xs font-medium text-violet-300/80 uppercase tracking-wider" }, "Labels de Agrupamento")), /* @__PURE__ */ React20.createElement("p", { className: "text-[11px] text-slate-400 leading-relaxed" }, "Labels agrupam conex\xF5es no menu de Conex\xF5es. Cada lado da conex\xE3o pode ter sua pr\xF3pria label."), /* @__PURE__ */ React20.createElement("div", { className: "grid grid-cols-2 gap-2" }, /* @__PURE__ */ React20.createElement("div", { className: "space-y-1" }, /* @__PURE__ */ React20.createElement("label", { className: "text-[11px] text-slate-400" }, "Label do Source"), /* @__PURE__ */ React20.createElement(
10043
10527
  "input",
10044
10528
  {
10045
10529
  type: "text",
@@ -10106,7 +10590,16 @@ function RelationshipDetailsPanel({
10106
10590
  className: "absolute inset-0 flex items-center justify-center text-xs text-slate-500 cursor-text"
10107
10591
  },
10108
10592
  "Adicionar descri\xE7\xE3o..."
10109
- ))), /* @__PURE__ */ React20.createElement("div", { className: "pt-2" }, /* @__PURE__ */ React20.createElement("div", { className: "flex items-center justify-between mb-2" }, /* @__PURE__ */ React20.createElement("h3", { className: "text-sm font-medium" }, "Propriedades Adicionais"), canEdit && /* @__PURE__ */ React20.createElement("button", { type: "button", onClick: handleAddProp, className: "flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded-md bg-slate-800/70 hover:bg-slate-700/70 border border-white/10 transition-colors" }, /* @__PURE__ */ React20.createElement(FiPlus9, { size: 14 }), " Adicionar")), /* @__PURE__ */ React20.createElement("div", { className: "flex flex-col gap-3" }, customProps.map((prop, idx) => /* @__PURE__ */ React20.createElement(
10593
+ ))), /* @__PURE__ */ React20.createElement("div", { className: "pt-2" }, /* @__PURE__ */ React20.createElement("div", { className: "flex items-center justify-between mb-2" }, /* @__PURE__ */ React20.createElement("h3", { className: "text-sm font-medium" }, "Propriedades Adicionais"), canEdit && /* @__PURE__ */ React20.createElement(
10594
+ "button",
10595
+ {
10596
+ type: "button",
10597
+ onClick: handleAddProp,
10598
+ className: "flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded-md bg-slate-800/70 hover:bg-slate-700/70 border border-white/10 transition-colors"
10599
+ },
10600
+ /* @__PURE__ */ React20.createElement(FiPlus9, { size: 14 }),
10601
+ " Adicionar"
10602
+ )), /* @__PURE__ */ React20.createElement("div", { className: "flex flex-col gap-3" }, customProps.map((prop, idx) => /* @__PURE__ */ React20.createElement(
10110
10603
  CustomPropertyDisplay,
10111
10604
  {
10112
10605
  key: prop.id,
@@ -10114,11 +10607,21 @@ function RelationshipDetailsPanel({
10114
10607
  onUpdate: (updatedProp) => handleUpdateProp(idx, updatedProp),
10115
10608
  onRemove: () => handleRemoveProp(idx),
10116
10609
  onOpenImageViewer,
10117
- unavailableTypes: currentUsedTypes.filter((t) => t !== prop.type),
10610
+ unavailableTypes: currentUsedTypes.filter(
10611
+ (t) => t !== prop.type
10612
+ ),
10118
10613
  onUploadFile,
10119
10614
  disabled: !canEdit
10120
10615
  }
10121
- )), /* @__PURE__ */ React20.createElement("div", { ref: propsEndRef })))), /* @__PURE__ */ React20.createElement("div", { className: "sticky bottom-0 z-10 bg-gradient-to-t from-slate-950/80 via-slate-950/50 to-transparent px-6 py-4 border-t border-white/10 flex justify-end gap-3" }, /* @__PURE__ */ React20.createElement("button", { onClick: onClose, disabled: isSaving, className: "px-4 py-2 rounded-lg border border-white/15 bg-transparent hover:bg-white/5 transition-colors text-sm disabled:opacity-50" }, canEdit ? "Cancelar" : "Fechar"), canEdit && /* @__PURE__ */ React20.createElement(
10616
+ )), /* @__PURE__ */ React20.createElement("div", { ref: propsEndRef })))), /* @__PURE__ */ React20.createElement("div", { className: "sticky bottom-0 z-10 bg-gradient-to-t from-slate-950/80 via-slate-950/50 to-transparent px-6 py-4 border-t border-white/10 flex justify-end gap-3" }, /* @__PURE__ */ React20.createElement(
10617
+ "button",
10618
+ {
10619
+ onClick: onClose,
10620
+ disabled: isSaving,
10621
+ className: "px-4 py-2 rounded-lg border border-white/15 bg-transparent hover:bg-white/5 transition-colors text-sm disabled:opacity-50"
10622
+ },
10623
+ canEdit ? "Cancelar" : "Fechar"
10624
+ ), canEdit && /* @__PURE__ */ React20.createElement(
10122
10625
  "button",
10123
10626
  {
10124
10627
  onClick: () => handleSave(false),
@@ -13479,7 +13982,8 @@ function XViewScene({
13479
13982
  nodes: sceneDataRef2.current.nodes,
13480
13983
  links: sceneDataRef2.current.links,
13481
13984
  quest_nodes: specificParentData.nodes,
13482
- quest_links: specificParentData.links
13985
+ quest_links: specificParentData.links,
13986
+ quest_counter: sceneDataRef2.current.quest_counter || 1
13483
13987
  };
13484
13988
  await context.actions.save_view_data(sceneSaveUrl2, viewFilePayload);
13485
13989
  } else {
@@ -15087,7 +15591,8 @@ function XViewScene({
15087
15591
  nodes: currentNodes,
15088
15592
  links: currentLinks,
15089
15593
  quest_nodes: isView ? ((_b2 = parentDataRef.current[sceneConfigId]) == null ? void 0 : _b2.nodes) || [] : sceneDataRef.current.quest_nodes || [],
15090
- quest_links: isView ? ((_c2 = parentDataRef.current[sceneConfigId]) == null ? void 0 : _c2.links) || [] : sceneDataRef.current.quest_links || []
15594
+ quest_links: isView ? ((_c2 = parentDataRef.current[sceneConfigId]) == null ? void 0 : _c2.links) || [] : sceneDataRef.current.quest_links || [],
15595
+ quest_counter: sceneDataRef.current.quest_counter || 1
15091
15596
  };
15092
15597
  try {
15093
15598
  await save_view_data(sceneSaveUrl, sceneFileData);
@@ -15637,7 +16142,8 @@ function XViewScene({
15637
16142
  onUploadFile: upload_file_action,
15638
16143
  userRole: userPermissionRole,
15639
16144
  currentDatasetName: detailsNodeDatasetInfo == null ? void 0 : detailsNodeDatasetInfo.datasetName,
15640
- viewMembers
16145
+ viewMembers,
16146
+ currentUser: session == null ? void 0 : session.user
15641
16147
  }
15642
16148
  ),
15643
16149
  detailsNode && !detailsNode.is_quest && /* @__PURE__ */ React26.createElement(