@ixo/editor 2.15.0 → 2.16.1

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.
@@ -69,7 +69,7 @@ var BlocknoteContext = createContext({
69
69
  throw new Error("BlocknoteContext not initialized");
70
70
  }
71
71
  });
72
- var BlocknoteProvider = ({ children, editor, handlers, blockRequirements, editable, visualizationRenderer, getDynamicListData, dynamicListPanelRenderer }) => {
72
+ var BlocknoteProvider = ({ children, editor, handlers, blockRequirements, editable, visualizationRenderer, getDynamicListData, dynamicListPanelRenderer, domainCardRenderer }) => {
73
73
  const [sharedProposals, setSharedProposals] = useState({});
74
74
  const sharedProposalsRef = useRef2({});
75
75
  const [activeDrawerId, setActiveDrawerId] = useState(null);
@@ -165,7 +165,8 @@ var BlocknoteProvider = ({ children, editor, handlers, blockRequirements, editab
165
165
  closeDrawer,
166
166
  visualizationRenderer,
167
167
  getDynamicListData,
168
- dynamicListPanelRenderer
168
+ dynamicListPanelRenderer,
169
+ domainCardRenderer
169
170
  }
170
171
  },
171
172
  children
@@ -1333,7 +1334,8 @@ import {
1333
1334
  IconChecklist,
1334
1335
  IconThumbUp,
1335
1336
  IconBell,
1336
- IconFeather
1337
+ IconFeather,
1338
+ IconDotsCircleHorizontal
1337
1339
  } from "@tabler/icons-react";
1338
1340
  var ICON_MAP = {
1339
1341
  "square-check": IconSquareCheck,
@@ -1345,7 +1347,8 @@ var ICON_MAP = {
1345
1347
  bell: IconBell,
1346
1348
  plus: IconPlus,
1347
1349
  "dollar-sign": IconUserDollar,
1348
- feather: IconFeather
1350
+ feather: IconFeather,
1351
+ "dots-circle": IconDotsCircleHorizontal
1349
1352
  };
1350
1353
  var getIcon = (fallback = "square-check", key, color = "white", size = 26, stroke = 1.5) => {
1351
1354
  const validKey = key in ICON_MAP ? key : fallback;
@@ -16741,14 +16744,27 @@ var DomainCreatorSignTemplateView = ({ editor, block }) => {
16741
16744
  };
16742
16745
 
16743
16746
  // src/mantine/blocks/domainCreatorSign/flow/FlowView.tsx
16744
- import React185, { useCallback as useCallback47, useMemo as useMemo56, useEffect as useEffect47 } from "react";
16745
- import { ActionIcon as ActionIcon27, Badge as Badge28, Button as Button33, Group as Group59, Stack as Stack122, Text as Text96, Tooltip as Tooltip18 } from "@mantine/core";
16746
- import { IconChevronRight as IconChevronRight8, IconTestPipe, IconTrash as IconTrash5 } from "@tabler/icons-react";
16747
+ import React185, { useCallback as useCallback47, useMemo as useMemo56, useEffect as useEffect47, useState as useState65 } from "react";
16748
+ import { ActionIcon as ActionIcon27, Badge as Badge28, Group as Group59, Stack as Stack122, Text as Text96, Tooltip as Tooltip18 } from "@mantine/core";
16749
+ import { IconChevronRight as IconChevronRight8 } from "@tabler/icons-react";
16747
16750
 
16748
16751
  // src/mantine/blocks/domainCreatorSign/flow/SignPanel.tsx
16749
16752
  import React184, { useCallback as useCallback46, useState as useState64 } from "react";
16750
16753
  import { Alert as Alert24, Button as Button32, CloseButton as CloseButton13, Group as Group58, Loader as Loader24, Stack as Stack121, Text as Text95, Title as Title16 } from "@mantine/core";
16751
16754
  import { IconAlertCircle as IconAlertCircle11, IconCheck as IconCheck5, IconSignature } from "@tabler/icons-react";
16755
+ function getDomainCardDataFromViewer(editor) {
16756
+ const allBlocks = editor.document;
16757
+ for (const docBlock of allBlocks) {
16758
+ if (docBlock.type === "domainCardViewer") {
16759
+ try {
16760
+ return JSON.parse(docBlock.props.domainCardData || "{}");
16761
+ } catch {
16762
+ return null;
16763
+ }
16764
+ }
16765
+ }
16766
+ return null;
16767
+ }
16752
16768
  var SignPanel = ({ editor, block, onComplete, onError }) => {
16753
16769
  const { closePanel } = usePanelStore();
16754
16770
  const { handlers } = useBlocknoteContext();
@@ -16756,12 +16772,8 @@ var SignPanel = ({ editor, block, onComplete, onError }) => {
16756
16772
  const [error, setError] = useState64(block.props.errorMessage || null);
16757
16773
  const [createdEntityDid, setCreatedEntityDid] = useState64(block.props.entityDid || null);
16758
16774
  const getDomainCardData = useCallback46(() => {
16759
- try {
16760
- return JSON.parse(block.props.domainCardData || "{}");
16761
- } catch {
16762
- return null;
16763
- }
16764
- }, [block.props.domainCardData]);
16775
+ return getDomainCardDataFromViewer(editor);
16776
+ }, [editor]);
16765
16777
  const processSignAndCreate = useCallback46(async () => {
16766
16778
  if (!handlers) {
16767
16779
  throw new Error("Handlers not available");
@@ -16895,14 +16907,18 @@ var SignPanel = ({ editor, block, onComplete, onError }) => {
16895
16907
 
16896
16908
  // src/mantine/blocks/domainCreatorSign/flow/FlowView.tsx
16897
16909
  var DOMAIN_CREATOR_SIGN_FLOW_PANEL_ID = "domain-creator-sign-flow-panel";
16898
- var IS_DEV = false;
16899
- var DUMMY_DOMAIN_CARD_DATA = {
16900
- type: ["ixo:dao"],
16901
- name: "Test Domain",
16902
- description: "A test domain created for development purposes.",
16903
- keywords: ["test", "development", "demo"],
16904
- url: "https://example.com"
16905
- };
16910
+ function getDomainCardViewerData(editor) {
16911
+ const allBlocks = editor.document;
16912
+ for (const docBlock of allBlocks) {
16913
+ if (docBlock.type === "domainCardViewer") {
16914
+ return {
16915
+ domainCardData: docBlock.props.domainCardData || "{}",
16916
+ isApproved: docBlock.props.status === "approved"
16917
+ };
16918
+ }
16919
+ }
16920
+ return { domainCardData: "{}", isApproved: false };
16921
+ }
16906
16922
  function isDomainCardDataReady(domainCardData) {
16907
16923
  if (!domainCardData || domainCardData === "{}") return false;
16908
16924
  try {
@@ -16914,8 +16930,22 @@ function isDomainCardDataReady(domainCardData) {
16914
16930
  }
16915
16931
  var DomainCreatorSignFlowView = ({ editor, block }) => {
16916
16932
  const status = block.props.status || "pending";
16917
- const domainCardData = block.props.domainCardData || "{}";
16918
- const isDataReady = isDomainCardDataReady(domainCardData);
16933
+ const [viewerData, setViewerData] = useState65(() => getDomainCardViewerData(editor));
16934
+ useEffect47(() => {
16935
+ const updateViewerData = () => {
16936
+ const newData = getDomainCardViewerData(editor);
16937
+ setViewerData((prev) => {
16938
+ if (prev.domainCardData !== newData.domainCardData || prev.isApproved !== newData.isApproved) {
16939
+ return newData;
16940
+ }
16941
+ return prev;
16942
+ });
16943
+ };
16944
+ updateViewerData();
16945
+ return editor.onChange(updateViewerData);
16946
+ }, [editor]);
16947
+ const { domainCardData, isApproved: isViewerApproved } = viewerData;
16948
+ const isDataReady = isDomainCardDataReady(domainCardData) && isViewerApproved;
16919
16949
  useEffect47(() => {
16920
16950
  if (status === "pending" && isDataReady) {
16921
16951
  editor.updateBlock(block, {
@@ -16924,6 +16954,13 @@ var DomainCreatorSignFlowView = ({ editor, block }) => {
16924
16954
  status: "ready"
16925
16955
  }
16926
16956
  });
16957
+ } else if (status === "ready" && !isDataReady) {
16958
+ editor.updateBlock(block, {
16959
+ props: {
16960
+ ...block.props,
16961
+ status: "pending"
16962
+ }
16963
+ });
16927
16964
  }
16928
16965
  }, [isDataReady, status, editor, block]);
16929
16966
  const handleComplete = useCallback47(
@@ -16977,76 +17014,643 @@ var DomainCreatorSignFlowView = ({ editor, block }) => {
16977
17014
  };
16978
17015
  const badgeProps = getBadgeProps();
16979
17016
  const isClickable = isDataReady || status === "completed" || status === "error";
16980
- const handlePrefillDummyData = useCallback47(
17017
+ const getDescriptionText = () => {
17018
+ switch (status) {
17019
+ case "completed":
17020
+ return `Entity created: ${block.props.entityDid}`;
17021
+ case "error":
17022
+ return block.props.errorMessage || "An error occurred";
17023
+ case "ready":
17024
+ return "Click to sign and create the domain";
17025
+ default:
17026
+ return "Waiting for domain data to be approved";
17027
+ }
17028
+ };
17029
+ return /* @__PURE__ */ React185.createElement(BaseContainer, { onClick: isClickable ? handleOpen : void 0, style: { opacity: isClickable ? 1 : 0.7, cursor: isClickable ? "pointer" : "not-allowed" } }, /* @__PURE__ */ React185.createElement(Group59, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React185.createElement(Group59, { wrap: "nowrap", align: "center", style: { flex: 1 } }, getIcon("feather", block.props.icon), /* @__PURE__ */ React185.createElement(Stack122, { gap: 4, style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React185.createElement(Group59, { gap: "xs", align: "center" }, /* @__PURE__ */ React185.createElement(Text96, { fw: 600, size: "sm" }, block.props.title || "Sign to Create"), /* @__PURE__ */ React185.createElement(Badge28, { size: "xs", variant: "filled", color: badgeProps.color, styles: { root: { backgroundColor: `var(--mantine-color-${badgeProps.color}-6)`, color: "white" } } }, badgeProps.text)), /* @__PURE__ */ React185.createElement(Text96, { size: "xs", c: "dimmed", lineClamp: 2 }, getDescriptionText()))), isClickable && /* @__PURE__ */ React185.createElement(Tooltip18, { label: status === "completed" ? "View details" : "Sign & Create", withArrow: true }, /* @__PURE__ */ React185.createElement(ActionIcon27, { variant: "subtle", color: "blue" }, /* @__PURE__ */ React185.createElement(IconChevronRight8, { size: 18 })))));
17030
+ };
17031
+
17032
+ // src/mantine/blocks/domainCreatorSign/DomainCreatorSignBlock.tsx
17033
+ function DomainCreatorSignBlock({ editor, block }) {
17034
+ const { docType } = useBlocknoteContext();
17035
+ if (docType === "template") {
17036
+ return /* @__PURE__ */ React186.createElement(DomainCreatorSignTemplateView, { editor, block });
17037
+ }
17038
+ return /* @__PURE__ */ React186.createElement(DomainCreatorSignFlowView, { editor, block });
17039
+ }
17040
+
17041
+ // src/mantine/blocks/domainCreatorSign/DomainCreatorSignBlockSpec.tsx
17042
+ var DomainCreatorSignBlockSpec = createReactBlockSpec16(
17043
+ {
17044
+ type: "domainCreatorSign",
17045
+ propSchema: {
17046
+ title: { default: "" },
17047
+ description: { default: "" },
17048
+ icon: { default: "feather" },
17049
+ // Entity type from protocol selector or oracle
17050
+ entityType: { default: "" },
17051
+ // Status: pending | ready | signing | uploading | creating | completed | error
17052
+ // NOTE: This block reads domainCardData from the domainCardViewer block
17053
+ status: { default: "pending" },
17054
+ // Created entity DID (after success)
17055
+ entityDid: { default: "" },
17056
+ // Transaction hash (after success)
17057
+ transactionHash: { default: "" },
17058
+ // Error message if failed
17059
+ errorMessage: { default: "" }
17060
+ },
17061
+ content: "none"
17062
+ },
17063
+ {
17064
+ render: (props) => {
17065
+ const ixoProps = props;
17066
+ return /* @__PURE__ */ React187.createElement(DomainCreatorSignBlock, { ...ixoProps });
17067
+ }
17068
+ }
17069
+ );
17070
+
17071
+ // src/mantine/blocks/domainCardViewer/DomainCardViewerBlockSpec.tsx
17072
+ import React194 from "react";
17073
+ import { createReactBlockSpec as createReactBlockSpec17 } from "@blocknote/react";
17074
+
17075
+ // src/mantine/blocks/domainCardViewer/DomainCardViewerBlock.tsx
17076
+ import React193 from "react";
17077
+
17078
+ // src/mantine/blocks/domainCardViewer/template/TemplateView.tsx
17079
+ import React190, { useMemo as useMemo57 } from "react";
17080
+ import { Badge as Badge29, Group as Group60, Stack as Stack123, Text as Text97 } from "@mantine/core";
17081
+
17082
+ // src/mantine/blocks/domainCardViewer/template/TemplateConfig.tsx
17083
+ import React189, { useCallback as useCallback48 } from "react";
17084
+ import { Paper as Paper19, CloseButton as CloseButton14, Title as Title17 } from "@mantine/core";
17085
+
17086
+ // src/mantine/blocks/domainCardViewer/template/GeneralTab.tsx
17087
+ import React188, { useEffect as useEffect48, useState as useState66 } from "react";
17088
+ var GeneralTab13 = ({ title, description, icon, onTitleChange, onDescriptionChange, onIconChange }) => {
17089
+ const [localTitle, setLocalTitle] = useState66(title || "");
17090
+ const [localDescription, setLocalDescription] = useState66(description || "");
17091
+ const [localIcon, setLocalIcon] = useState66(icon || "dots-circle");
17092
+ useEffect48(() => setLocalTitle(title || ""), [title]);
17093
+ useEffect48(() => setLocalDescription(description || ""), [description]);
17094
+ useEffect48(() => setLocalIcon(icon || "dots-circle"), [icon]);
17095
+ return /* @__PURE__ */ React188.createElement(BaseSection, null, /* @__PURE__ */ React188.createElement(
17096
+ BaseTextInput,
17097
+ {
17098
+ label: "Title",
17099
+ placeholder: "e.g. Domain Card Preview",
17100
+ value: localTitle,
17101
+ onChange: (event) => {
17102
+ const newValue = event.currentTarget.value;
17103
+ setLocalTitle(newValue);
17104
+ onTitleChange(newValue);
17105
+ }
17106
+ }
17107
+ ), /* @__PURE__ */ React188.createElement(
17108
+ BaseTextArea,
17109
+ {
17110
+ label: "Description",
17111
+ placeholder: "Short description shown on the block",
17112
+ minRows: 2,
17113
+ value: localDescription,
17114
+ onChange: (event) => {
17115
+ const newValue = event.currentTarget.value;
17116
+ setLocalDescription(newValue);
17117
+ onDescriptionChange(newValue);
17118
+ }
17119
+ }
17120
+ ), /* @__PURE__ */ React188.createElement(
17121
+ BaseTextInput,
17122
+ {
17123
+ label: "Icon",
17124
+ description: "Use a supported icon key (e.g. id-badge, file-text, eye)",
17125
+ placeholder: "id-badge",
17126
+ value: localIcon,
17127
+ onChange: (event) => {
17128
+ const newValue = event.currentTarget.value;
17129
+ setLocalIcon(newValue);
17130
+ onIconChange(newValue);
17131
+ }
17132
+ }
17133
+ ));
17134
+ };
17135
+
17136
+ // src/mantine/blocks/domainCardViewer/template/TemplateConfig.tsx
17137
+ var TemplateConfig13 = ({ editor, block }) => {
17138
+ const { closePanel } = usePanelStore();
17139
+ const updateProp = useCallback48(
17140
+ (key, value) => {
17141
+ editor.updateBlock(block, {
17142
+ props: {
17143
+ ...block.props,
17144
+ [key]: value
17145
+ }
17146
+ });
17147
+ },
17148
+ [editor, block]
17149
+ );
17150
+ return /* @__PURE__ */ React189.createElement(
17151
+ Paper19,
17152
+ {
17153
+ p: "md",
17154
+ shadow: "sm",
17155
+ style: {
17156
+ height: "100%",
17157
+ display: "flex",
17158
+ flexDirection: "column"
17159
+ }
17160
+ },
17161
+ /* @__PURE__ */ React189.createElement(
17162
+ "div",
17163
+ {
17164
+ style: {
17165
+ display: "flex",
17166
+ justifyContent: "space-between",
17167
+ alignItems: "center",
17168
+ marginBottom: "1rem"
17169
+ }
17170
+ },
17171
+ /* @__PURE__ */ React189.createElement(Title17, { order: 5 }, "Domain Card Settings"),
17172
+ /* @__PURE__ */ React189.createElement(CloseButton14, { onClick: closePanel })
17173
+ ),
17174
+ /* @__PURE__ */ React189.createElement(
17175
+ ReusablePanel,
17176
+ {
17177
+ extraTabs: [
17178
+ {
17179
+ label: "General",
17180
+ value: "general",
17181
+ content: /* @__PURE__ */ React189.createElement(
17182
+ GeneralTab13,
17183
+ {
17184
+ title: block.props.title || "",
17185
+ description: block.props.description || "",
17186
+ icon: block.props.icon || "dots-circle",
17187
+ onTitleChange: (value) => updateProp("title", value),
17188
+ onDescriptionChange: (value) => updateProp("description", value),
17189
+ onIconChange: (value) => updateProp("icon", value)
17190
+ }
17191
+ )
17192
+ }
17193
+ ],
17194
+ context: { editor, block }
17195
+ }
17196
+ )
17197
+ );
17198
+ };
17199
+
17200
+ // src/mantine/blocks/domainCardViewer/template/TemplateView.tsx
17201
+ var DOMAIN_CARD_VIEWER_TEMPLATE_PANEL_ID = "domain-card-viewer-template-panel";
17202
+ var DomainCardViewerTemplateView = ({ editor, block }) => {
17203
+ const panelId = `${DOMAIN_CARD_VIEWER_TEMPLATE_PANEL_ID}-${block.id}`;
17204
+ const panelContent = useMemo57(() => /* @__PURE__ */ React190.createElement(TemplateConfig13, { editor, block }), [editor, block]);
17205
+ const { open } = usePanel(panelId, panelContent);
17206
+ return /* @__PURE__ */ React190.createElement(BaseContainer, { onClick: open }, /* @__PURE__ */ React190.createElement(Badge29, { size: "xs", variant: "light", color: "gray", style: { position: "absolute", top: 8, right: 8 } }, "Template"), /* @__PURE__ */ React190.createElement(Group60, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React190.createElement(Group60, { wrap: "nowrap", align: "center" }, getIcon("dots-circle", block.props.icon), /* @__PURE__ */ React190.createElement(Stack123, { gap: "xs", style: { flex: 1 } }, /* @__PURE__ */ React190.createElement(Text97, { fw: 500, size: "sm" }, block.props.title || "Domain Card"), /* @__PURE__ */ React190.createElement(Text97, { size: "xs", c: "dimmed" }, block.props.description || "Preview domain card generated by AI")))));
17207
+ };
17208
+
17209
+ // src/mantine/blocks/domainCardViewer/flow/FlowView.tsx
17210
+ import React192, { useMemo as useMemo59, useCallback as useCallback49, useEffect as useEffect49 } from "react";
17211
+ import { ActionIcon as ActionIcon28, Badge as Badge30, Button as Button34, Group as Group61, Stack as Stack125, Text as Text99, Tooltip as Tooltip19 } from "@mantine/core";
17212
+ import { IconChevronRight as IconChevronRight9, IconLoader, IconTestPipe, IconTrash as IconTrash5 } from "@tabler/icons-react";
17213
+
17214
+ // src/mantine/blocks/domainCardViewer/flow/ViewerPanel.tsx
17215
+ import React191, { useMemo as useMemo58 } from "react";
17216
+ import { Paper as Paper20, CloseButton as CloseButton15, Title as Title18, Stack as Stack124, Text as Text98, Loader as Loader25, Alert as Alert25, Button as Button33, Box as Box34, ScrollArea as ScrollArea6, Code as Code6 } from "@mantine/core";
17217
+ import { IconAlertCircle as IconAlertCircle12, IconCheck as IconCheck6, IconSparkles as IconSparkles3 } from "@tabler/icons-react";
17218
+ function parsePreviewData(jsonString) {
17219
+ if (!jsonString || jsonString === "{}") return null;
17220
+ try {
17221
+ return JSON.parse(jsonString);
17222
+ } catch {
17223
+ return null;
17224
+ }
17225
+ }
17226
+ var JsonViewer = ({ data }) => {
17227
+ return /* @__PURE__ */ React191.createElement(ScrollArea6, { h: "100%", offsetScrollbars: true }, /* @__PURE__ */ React191.createElement(Stack124, { gap: "md" }, data.name && /* @__PURE__ */ React191.createElement(Box34, null, /* @__PURE__ */ React191.createElement(Text98, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600 }, "Name"), /* @__PURE__ */ React191.createElement(Text98, { size: "lg", fw: 600 }, data.name)), data.summary && /* @__PURE__ */ React191.createElement(Box34, null, /* @__PURE__ */ React191.createElement(Text98, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600 }, "Summary"), /* @__PURE__ */ React191.createElement(Text98, { size: "sm" }, data.summary)), data.description && /* @__PURE__ */ React191.createElement(Box34, null, /* @__PURE__ */ React191.createElement(Text98, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600 }, "Description"), /* @__PURE__ */ React191.createElement(Text98, { size: "sm" }, data.description)), data.entity_type && data.entity_type.length > 0 && /* @__PURE__ */ React191.createElement(Box34, null, /* @__PURE__ */ React191.createElement(Text98, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600 }, "Type"), /* @__PURE__ */ React191.createElement(Text98, { size: "sm" }, data.entity_type.join(", "))), data.keywords && data.keywords.length > 0 && /* @__PURE__ */ React191.createElement(Box34, null, /* @__PURE__ */ React191.createElement(Text98, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600 }, "Keywords"), /* @__PURE__ */ React191.createElement(Text98, { size: "sm" }, data.keywords.join(", "))), data.faq && data.faq.length > 0 && /* @__PURE__ */ React191.createElement(Box34, null, /* @__PURE__ */ React191.createElement(Text98, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600, mb: "xs" }, "FAQ"), /* @__PURE__ */ React191.createElement(Stack124, { gap: "sm" }, data.faq.map((item, index) => /* @__PURE__ */ React191.createElement(Box34, { key: index, p: "sm", style: { borderRadius: 8, backgroundColor: "var(--mantine-color-dark-6)" } }, /* @__PURE__ */ React191.createElement(Text98, { size: "sm", fw: 500, mb: 4 }, item.question), /* @__PURE__ */ React191.createElement(Text98, { size: "xs", c: "dimmed" }, item.answer))))), /* @__PURE__ */ React191.createElement(Box34, null, /* @__PURE__ */ React191.createElement(Text98, { size: "xs", c: "dimmed", tt: "uppercase", fw: 600, mb: "xs" }, "Raw Data"), /* @__PURE__ */ React191.createElement(Code6, { block: true, style: { fontSize: 11, maxHeight: 200, overflow: "auto" } }, JSON.stringify(data, null, 2)))));
17228
+ };
17229
+ var ViewerPanel = ({ block, onApprove }) => {
17230
+ const { closePanel } = usePanelStore();
17231
+ const { domainCardRenderer } = useBlocknoteContext();
17232
+ const status = block.props.status || "pending";
17233
+ const loadingMessage = block.props.loadingMessage || "Agents is generating your domain data...";
17234
+ const errorMessage = block.props.errorMessage || "An error occurred while generating the domain data.";
17235
+ const domainPreviewData = useMemo58(() => parsePreviewData(block.props.domainPreviewData || "{}"), [block.props.domainPreviewData]);
17236
+ const isLoading = status === "loading";
17237
+ const isError = status === "error";
17238
+ const isReady = status === "ready";
17239
+ const isApproved = status === "approved";
17240
+ const hasData = domainPreviewData !== null;
17241
+ return /* @__PURE__ */ React191.createElement(
17242
+ Paper20,
17243
+ {
17244
+ p: "md",
17245
+ shadow: "sm",
17246
+ style: {
17247
+ height: "100%",
17248
+ display: "flex",
17249
+ flexDirection: "column"
17250
+ }
17251
+ },
17252
+ /* @__PURE__ */ React191.createElement(
17253
+ "div",
17254
+ {
17255
+ style: {
17256
+ display: "flex",
17257
+ justifyContent: "space-between",
17258
+ alignItems: "center",
17259
+ marginBottom: "1rem",
17260
+ flexShrink: 0
17261
+ }
17262
+ },
17263
+ /* @__PURE__ */ React191.createElement(Title18, { order: 5 }, block.props.title || "Domain Card"),
17264
+ /* @__PURE__ */ React191.createElement(CloseButton15, { onClick: closePanel })
17265
+ ),
17266
+ /* @__PURE__ */ React191.createElement(Box34, { style: { flex: 1, overflow: "hidden", display: "flex", flexDirection: "column" } }, isLoading && /* @__PURE__ */ React191.createElement(Stack124, { align: "center", justify: "center", style: { flex: 1 }, gap: "md" }, /* @__PURE__ */ React191.createElement(Loader25, { size: "lg", color: "blue" }), /* @__PURE__ */ React191.createElement(Stack124, { align: "center", gap: "xs" }, /* @__PURE__ */ React191.createElement(IconSparkles3, { size: 24, color: "var(--mantine-color-blue-5)" }), /* @__PURE__ */ React191.createElement(Text98, { size: "sm", c: "dimmed", ta: "center" }, loadingMessage))), isError && /* @__PURE__ */ React191.createElement(Stack124, { style: { flex: 1 }, gap: "md" }, /* @__PURE__ */ React191.createElement(Alert25, { icon: /* @__PURE__ */ React191.createElement(IconAlertCircle12, { size: 16 }), title: "Error", color: "red", variant: "light" }, errorMessage), /* @__PURE__ */ React191.createElement(Text98, { size: "sm", c: "dimmed", ta: "center" }, "Please ask the oracle to try again.")), (isReady || isApproved) && hasData && /* @__PURE__ */ React191.createElement(Box34, { style: { flex: 1, overflow: "hidden" } }, domainCardRenderer ? (
17267
+ // Use custom renderer from web app
17268
+ /* @__PURE__ */ React191.createElement(ScrollArea6, { h: "100%", offsetScrollbars: true }, domainCardRenderer(domainPreviewData))
17269
+ ) : (
17270
+ // Fallback to JSON viewer
17271
+ /* @__PURE__ */ React191.createElement(JsonViewer, { data: domainPreviewData })
17272
+ )), !isLoading && !isError && !hasData && /* @__PURE__ */ React191.createElement(Stack124, { align: "center", justify: "center", style: { flex: 1 }, gap: "md" }, /* @__PURE__ */ React191.createElement(Text98, { size: "sm", c: "dimmed", ta: "center" }, "No domain data available yet."))),
17273
+ isReady && hasData && /* @__PURE__ */ React191.createElement(
17274
+ Box34,
17275
+ {
17276
+ pt: "md",
17277
+ mt: "md",
17278
+ style: {
17279
+ borderTop: "1px solid var(--mantine-color-dark-4)",
17280
+ flexShrink: 0
17281
+ }
17282
+ },
17283
+ /* @__PURE__ */ React191.createElement(Text98, { size: "xs", c: "dimmed", ta: "center", mb: "0" }, "This shows the domain details to see if the narrative aligns with what the domain is about."),
17284
+ /* @__PURE__ */ React191.createElement(Text98, { size: "xs", c: "dimmed", ta: "center", mb: "md" }, "If you'd like changes, ask the oracle to make changes for you."),
17285
+ /* @__PURE__ */ React191.createElement(Button33, { fullWidth: true, color: "teal", leftSection: /* @__PURE__ */ React191.createElement(IconCheck6, { size: 16 }), onClick: onApprove }, "Approve")
17286
+ ),
17287
+ isApproved && /* @__PURE__ */ React191.createElement(
17288
+ Box34,
17289
+ {
17290
+ pt: "md",
17291
+ mt: "md",
17292
+ style: {
17293
+ borderTop: "1px solid var(--mantine-color-dark-4)",
17294
+ flexShrink: 0
17295
+ }
17296
+ },
17297
+ /* @__PURE__ */ React191.createElement(Alert25, { icon: /* @__PURE__ */ React191.createElement(IconCheck6, { size: 16 }), color: "green", variant: "light" }, "Domain data approved. You can proceed to sign and create the domain.")
17298
+ )
17299
+ );
17300
+ };
17301
+
17302
+ // src/data/domainCard.ts
17303
+ var dummyDomainCardData = {
17304
+ id: "6fcb075108d95d7418a1336e81b07fd5b4bc28b6edf96f1d75a34bfaa40b146e",
17305
+ issuer: "did:ixo:issuer:blueventures",
17306
+ credential_type: ["VerifiableCredential", "ixo:DomainCard"],
17307
+ valid_from: "2025-01-15T08:00:00.000Z",
17308
+ schema_id: "https://github.com/ixofoundation/docs",
17309
+ entity_type: ["schema:Organization", "schema:NGO"],
17310
+ name: "Blue Ventures",
17311
+ alternate_names: ["Blue Ventures Conservation"],
17312
+ description: "Blue Ventures is an award-winning marine conservation organization supporting community-led management of coastal ecosystems across Madagascar, East Africa, Southeast Asia, and the Caribbean. Their work focuses on blue carbon restoration, sustainable fisheries, locally managed marine areas (LMMAs), and strengthening coastal community resilience through science-based conservation practices.",
17313
+ keywords: [
17314
+ "Marine Conservation",
17315
+ "Blue Carbon",
17316
+ "Mangrove Restoration",
17317
+ "Seagrass Conservation",
17318
+ "Sustainable Fisheries",
17319
+ "Biodiversity Protection",
17320
+ "Climate Resilience",
17321
+ "Community-Led Conservation",
17322
+ "LMMAs",
17323
+ "Coastal Livelihoods"
17324
+ ],
17325
+ categories: ["ixo:project"],
17326
+ knows_about: [
17327
+ "community-based conservation models",
17328
+ "blue carbon ecosystems",
17329
+ "mangrove reforestation",
17330
+ "seagrass mapping",
17331
+ "marine protected area development",
17332
+ "sustainable small-scale fisheries"
17333
+ ],
17334
+ url: "https://blueventures.org/",
17335
+ same_as: [
17336
+ "https://twitter.com/blueventures",
17337
+ "https://github.com/blueventures",
17338
+ "https://linkedin.com/company/blue-ventures",
17339
+ "https://facebook.com/blueventuresorg",
17340
+ "https://instagram.com/blueventures"
17341
+ ],
17342
+ logo_url: {
17343
+ url: "https://blueventures.org/wp-content/uploads/2023/08/BlueVentures_logo.png",
17344
+ alt: "The page returned a 404 Not Found error, indicating the requested resource could not be located. The server is running nginx, which is a web server software."
17345
+ },
17346
+ image_urls: [
17347
+ {
17348
+ url: "https://blueventures.org/wp-content/uploads/2024/01/bluecarbon_seascape.jpg",
17349
+ alt: "The page returned a 404 Not Found error, indicating the requested resource could not be located. The server is running nginx, which is a web server software.",
17350
+ type: "schema:ImageObject"
17351
+ }
17352
+ ],
17353
+ contact: {
17354
+ email: "info@blueventures.org",
17355
+ website: "https://blueventures.org/",
17356
+ location: "22-26 Station Road, Bristol, England, BS1 4RQ, GB",
17357
+ socialLinks: []
17358
+ },
17359
+ location: "22-26 Station Road, Bristol, England, BS1 4RQ, GB",
17360
+ coordinates: {
17361
+ type: "Point",
17362
+ coordinates: [-2.674898, 51.487256]
17363
+ },
17364
+ address: "22-26 Station Road, Bristol, England, BS1 4RQ, GB",
17365
+ area_served: "Global Coastal Regions",
17366
+ relationships: {
17367
+ memberOf: ["The Blue Carbon Initiative"],
17368
+ partners: ["WWF", "The Nature Conservancy", "IUCN Mangrove Specialist Group"],
17369
+ funders: ["UK Aid / FCDO"]
17370
+ },
17371
+ additional_properties: {
17372
+ attributes: [
17373
+ {
17374
+ "@type": "schema:PropertyValue",
17375
+ "@id": "urn:ixo:attr:projects",
17376
+ name: "Active Conservation Sites",
17377
+ value: "40+"
17378
+ },
17379
+ {
17380
+ "@type": "schema:PropertyValue",
17381
+ "@id": "urn:ixo:attr:focus",
17382
+ name: "Core Focus Areas",
17383
+ value: "Blue carbon, fisheries, biodiversity"
17384
+ }
17385
+ ],
17386
+ content_hashes: {
17387
+ "https://blueventures.org/": "1765daf4a048e042bc651e13d6ed88d7f70f576c1b16ac4bc00cd42e78a9fcb0"
17388
+ },
17389
+ content_summaries: {
17390
+ "https://blueventures.org/": "The content highlights Blue Ventures' community-centered approach to marine conservation, emphasizing the critical role of coastal communities in sustaining fisheries and protecting ocean ecosystems. The organization works across 11 countries\u2014including Madagascar, Timor-Leste, Indonesia, and Belize\u2014supporting Locally Managed Marine Areas (LMMAs), community-led fisheries management, and the recognition of traditional governance systems like Tara Bandu. Key strategies include empowering local institutions, promoting data-driven decision-making, strengthening co-management partnerships, and advocating for small-scale fishers' rights. Blue Ventures also addresses social challenges by integrating healthcare access and supporting women-led initiatives. With a vision of 'Thriving Communities. Thriving Oceans,' the organization aims to scale locally led conservation to combat climate change, overfishing, and industrial exploitation, ensuring long-term resilience for both people and nature."
17391
+ },
17392
+ last_fetch_date: "2025-12-11T16:32:33.260Z"
17393
+ },
17394
+ faq: [
17395
+ {
17396
+ question: "What is Marine Conservation Partnerships and what problem does it solve?",
17397
+ answer: "Marine Conservation Partnerships is a service offering that enables NGOs, governments, and coastal communities to implement community-led marine conservation models\u2014primarily Locally Managed Marine Areas (LMMAs)\u2014to address threats to coastal ecosystems. It combines governance frameworks, science-based monitoring, and livelihoods support to deliver measurable conservation and community benefits."
17398
+ },
17399
+ {
17400
+ question: "How does Marine Conservation Partnerships work technically?",
17401
+ answer: "It works by designing and deploying locally led governance structures (LMMA frameworks), conducting science-driven monitoring (ecological surveys, standardized catch surveys), and enabling community-led patrols and fishery closures. The program also integrates mangrove blue carbon initiatives and drone-assisted seagrass mapping to track ecosystem change."
17402
+ },
17403
+ {
17404
+ question: "What can you do with Marine Conservation Partnerships?",
17405
+ answer: "You can establish LMMA networks, implement seasonal or spatial fishery closures, develop mangrove blue carbon projects, and leverage open-access research to inform policy. The offering supports capacity building, governance design, and community-driven stewardship with data-backed decision making."
17406
+ },
17407
+ {
17408
+ question: "Who uses Marine Conservation Partnerships?",
17409
+ answer: "NGOs and governments seeking community-based conservation models, researchers studying blue carbon and tropical fisheries, and funders supporting high-impact coastal restoration programs use Marine Conservation Partnerships. Communities actively participate in planning, monitoring, and stewardship."
17410
+ },
17411
+ {
17412
+ question: "What outcomes does Marine Conservation Partnerships aim to achieve?",
17413
+ answer: "The program targets verified ecological gains such as mangrove restoration and biomass accumulation, improved fisheries performance, and biodiversity rebound, supported by science-based monitoring and governance metrics. These outcomes are designed to be scalable across regions and inform broader conservation strategies."
17414
+ }
17415
+ ],
17416
+ summary: "Blue Ventures is a marine conservation NGO advancing community-led coastal stewardship across Madagascar, East Africa, Southeast Asia, and the Caribbean, focusing on blue carbon restoration, mangroves, seagrass meadows, and sustainable small-scale fisheries. Through Marine Conservation Partnerships, it enables NGOs, governments, and coastal communities to design Locally Managed Marine Areas (LMMAs), conduct science-based monitoring, and implement mangrove blue carbon initiatives and drone-assisted seagrass mapping. The organization differentiates itself by pioneering the LMMA model in Madagascar and integrating ecological science with livelihoods and conservation financing within a network that includes the Blue Carbon Initiative, WWF, The Nature Conservancy, and IUCN Mangrove Specialist Group, funded by UK Aid / FCDO.",
17417
+ overview: "### Mission & Technical Foundation\nBlue Ventures is a globally recognized marine conservation NGO focused on community-led management of coastal ecosystems. Its mission centers on empowering coastal communities to design, govern, and sustain their own marine management systems, with primary ecosystems including mangroves, coral reefs, seagrass meadows, and small-scale fisheries. The organization operates across Madagascar, East Africa, Southeast Asia, and the Caribbean, and maintains a science-driven program portfolio that integrates ecological surveys, fisheries data, and socioeconomic research to deliver measurable conservation and livelihood outcomes. The core technical approach combines governance design, field monitoring, and community-based stewardship to translate science into locally governed restoration and management.\n\n### Ecosystem & Capabilities\nBlue Ventures positions itself within a collaborative ecosystem that includes the Blue Carbon Initiative, Global Mangrove Alliance, WWF, IUCN, and The Nature Conservancy. Its flagship offering, Marine Conservation Partnerships, enables NGOs, governments, and coastal communities to implement Locally Managed Marine Areas (LMMAs), integrating governance frameworks, science-based monitoring, and livelihoods support to achieve scalable, community-first conservation. Key capabilities include LMMA design and governance, drone-assisted seagrass mapping, standardized catch surveys for fisheries monitoring, mangrove blue carbon initiatives, and community patrols with seasonal or spatial fishery closures. The organization also produces open-access research used by global conservation networks and pursues partnerships that expand mangrove restoration and blue carbon across regions. Notable collaborations include the Blue Carbon Initiative, Global Mangrove Alliance, and partnerships with WWF, IUCN, and TNC, with UK Aid / FCDO as a principal funder. Upcoming engagement includes the Global Mangrove Alliance \u2013 Annual Gathering 2025 in Dar es Salaam, reflecting a commitment to scale and knowledge exchange across Africa, Southeast Asia, and the Caribbean.",
17418
+ events: ["81382424481d6291b3caaaf6bb1d16eef568fe24a96fd2c1a3fddec9b368f165"],
17419
+ agents: [],
17420
+ indexed_at: "2025-12-11T16:32:33.260Z",
17421
+ updated_at: "2025-12-11T16:32:33.260Z",
17422
+ research_profile: {
17423
+ type: "ixo:ResearchProfile",
17424
+ "ixo:seedQueries": ["Blue Ventures blue carbon community conservation", "mangrove restoration Madagascar community management"],
17425
+ citation: [
17426
+ {
17427
+ type: "schema:CreativeWork",
17428
+ name: "Blue Carbon Ecosystems in Madagascar",
17429
+ url: "https://blueventures.org/blue-carbon/",
17430
+ publisher: "Blue Ventures",
17431
+ datePublished: "2023-11-14"
17432
+ }
17433
+ ],
17434
+ dateModified: "2025-01-15"
17435
+ }
17436
+ };
17437
+ var dummyCredentialSubject = {
17438
+ id: "did:ixo:entity:pending",
17439
+ type: ["ixo:dao"],
17440
+ name: "Blue Ventures",
17441
+ description: "Blue Ventures is an award-winning marine conservation organization supporting community-led management of coastal ecosystems across Madagascar, East Africa, Southeast Asia, and the Caribbean.",
17442
+ url: "https://blueventures.org/",
17443
+ sameAs: ["https://twitter.com/blueventures", "https://linkedin.com/company/blue-ventures", "https://facebook.com/blueventuresorg"],
17444
+ logo: {
17445
+ type: "schema:ImageObject",
17446
+ id: "https://blueventures.org/wp-content/uploads/2023/08/BlueVentures_logo.png",
17447
+ contentUrl: "https://blueventures.org/wp-content/uploads/2023/08/BlueVentures_logo.png"
17448
+ },
17449
+ image: [
17450
+ {
17451
+ type: "schema:ImageObject",
17452
+ id: "https://blueventures.org/wp-content/uploads/2024/01/bluecarbon_seascape.jpg",
17453
+ contentUrl: "https://blueventures.org/wp-content/uploads/2024/01/bluecarbon_seascape.jpg"
17454
+ }
17455
+ ],
17456
+ keywords: ["Marine Conservation", "Blue Carbon", "Mangrove Restoration", "Sustainable Fisheries", "Community-Led Conservation"],
17457
+ knowsAbout: ["community-based conservation models", "blue carbon ecosystems", "mangrove reforestation", "marine protected area development"],
17458
+ address: {
17459
+ type: "schema:PostalAddress",
17460
+ streetAddress: "22-26 Station Road",
17461
+ addressLocality: "Bristol",
17462
+ addressRegion: "England",
17463
+ postalCode: "BS1 4RQ",
17464
+ addressCountry: "GB"
17465
+ },
17466
+ areaServed: {
17467
+ type: "schema:AdministrativeArea",
17468
+ name: "Global Coastal Regions"
17469
+ },
17470
+ contactPoint: [
17471
+ {
17472
+ type: "schema:ContactPoint",
17473
+ contactType: "general",
17474
+ email: "info@blueventures.org"
17475
+ }
17476
+ ],
17477
+ relationships: {
17478
+ memberOf: [
17479
+ { type: "schema:Organization", name: "The Blue Carbon Initiative" },
17480
+ { type: "schema:Organization", name: "Global Mangrove Alliance" }
17481
+ ],
17482
+ "prov:wasAssociatedWith": [
17483
+ { type: "schema:Organization", name: "WWF", url: "https://wwf.org" },
17484
+ { type: "schema:Organization", name: "The Nature Conservancy" }
17485
+ ],
17486
+ funding: [
17487
+ {
17488
+ type: "schema:MonetaryGrant",
17489
+ funder: { type: "schema:Organization", name: "UK Aid / FCDO" }
17490
+ }
17491
+ ]
17492
+ },
17493
+ researchProfile: {
17494
+ type: "ixo:ResearchProfile",
17495
+ "ixo:seedQueries": ["Blue Ventures blue carbon community conservation"],
17496
+ citation: [
17497
+ {
17498
+ type: "schema:CreativeWork",
17499
+ name: "Blue Carbon Ecosystems in Madagascar",
17500
+ url: "https://blueventures.org/blue-carbon/",
17501
+ publisher: "Blue Ventures",
17502
+ datePublished: "2023-11-14"
17503
+ }
17504
+ ],
17505
+ dateModified: "2025-01-15"
17506
+ }
17507
+ };
17508
+
17509
+ // src/mantine/blocks/domainCardViewer/flow/FlowView.tsx
17510
+ var DOMAIN_CARD_VIEWER_FLOW_PANEL_ID = "domain-card-viewer-flow-panel";
17511
+ var IS_DEV = false;
17512
+ function isPreviewDataReady(domainPreviewData) {
17513
+ if (!domainPreviewData || domainPreviewData === "{}") return false;
17514
+ try {
17515
+ const parsed = JSON.parse(domainPreviewData);
17516
+ return Boolean(parsed && typeof parsed === "object" && parsed.name);
17517
+ } catch {
17518
+ return false;
17519
+ }
17520
+ }
17521
+ var DomainCardViewerFlowView = ({ editor, block }) => {
17522
+ const status = block.props.status || "pending";
17523
+ const domainPreviewData = block.props.domainPreviewData || "{}";
17524
+ const isDataReady = isPreviewDataReady(domainPreviewData);
17525
+ console.log("block.props", block.props);
17526
+ useEffect49(() => {
17527
+ if (status === "pending" && isDataReady) {
17528
+ editor.updateBlock(block, {
17529
+ props: {
17530
+ ...block.props,
17531
+ status: "ready"
17532
+ }
17533
+ });
17534
+ }
17535
+ }, [isDataReady, status, editor, block]);
17536
+ const handleApprove = useCallback49(() => {
17537
+ editor.updateBlock(block, {
17538
+ props: {
17539
+ ...block.props,
17540
+ status: "approved"
17541
+ }
17542
+ });
17543
+ }, [editor, block]);
17544
+ const panelId = `${DOMAIN_CARD_VIEWER_FLOW_PANEL_ID}-${block.id}`;
17545
+ const panelContent = useMemo59(() => /* @__PURE__ */ React192.createElement(ViewerPanel, { editor, block, onApprove: handleApprove }), [editor, block, handleApprove]);
17546
+ const { open } = usePanel(panelId, panelContent);
17547
+ const handleInjectDummyData = useCallback49(
17548
+ (e) => {
17549
+ e.stopPropagation();
17550
+ editor.updateBlock(block, {
17551
+ props: {
17552
+ ...block.props,
17553
+ domainPreviewData: JSON.stringify(dummyDomainCardData),
17554
+ domainCardData: JSON.stringify(dummyCredentialSubject),
17555
+ status: "ready",
17556
+ loadingMessage: "",
17557
+ errorMessage: ""
17558
+ }
17559
+ });
17560
+ },
17561
+ [editor, block]
17562
+ );
17563
+ const handleSetLoading = useCallback49(
16981
17564
  (e) => {
16982
17565
  e.stopPropagation();
16983
17566
  editor.updateBlock(block, {
16984
17567
  props: {
16985
17568
  ...block.props,
16986
- domainCardData: JSON.stringify(DUMMY_DOMAIN_CARD_DATA),
16987
- entityType: "dao"
17569
+ status: "loading",
17570
+ loadingMessage: "Agents are analyzing your domain information..."
16988
17571
  }
16989
17572
  });
16990
17573
  },
16991
17574
  [editor, block]
16992
17575
  );
16993
- const handleClearDummyData = useCallback47(
17576
+ const handleClearData = useCallback49(
16994
17577
  (e) => {
16995
17578
  e.stopPropagation();
16996
17579
  editor.updateBlock(block, {
16997
17580
  props: {
16998
17581
  ...block.props,
17582
+ domainPreviewData: "{}",
16999
17583
  domainCardData: "{}",
17000
- entityType: "",
17001
- status: "pending"
17584
+ status: "pending",
17585
+ loadingMessage: "",
17586
+ errorMessage: ""
17002
17587
  }
17003
17588
  });
17004
17589
  },
17005
17590
  [editor, block]
17006
17591
  );
17592
+ const getBadgeProps = () => {
17593
+ switch (status) {
17594
+ case "approved":
17595
+ return { color: "green", text: "Approved" };
17596
+ case "error":
17597
+ return { color: "red", text: "Error" };
17598
+ case "loading":
17599
+ return { color: "blue", text: "Generating..." };
17600
+ case "ready":
17601
+ return { color: "teal", text: "Ready to Review" };
17602
+ default:
17603
+ return { color: "gray", text: "Waiting" };
17604
+ }
17605
+ };
17606
+ const badgeProps = getBadgeProps();
17007
17607
  const getDescriptionText = () => {
17008
17608
  switch (status) {
17009
- case "completed":
17010
- return `Entity created: ${block.props.entityDid}`;
17609
+ case "approved":
17610
+ return "Domain data approved";
17011
17611
  case "error":
17012
17612
  return block.props.errorMessage || "An error occurred";
17613
+ case "loading":
17614
+ return block.props.loadingMessage || "Agents are generating domain data...";
17013
17615
  case "ready":
17014
- return "Click to sign and create the domain";
17616
+ return "Click to review and approve";
17015
17617
  default:
17016
- return "Waiting for domain card data to be filled";
17618
+ return "Waiting for agents to generate domain data";
17017
17619
  }
17018
17620
  };
17019
- return /* @__PURE__ */ React185.createElement(BaseContainer, { onClick: isClickable ? handleOpen : void 0, style: { opacity: isClickable ? 1 : 0.7, cursor: isClickable ? "pointer" : "not-allowed" } }, /* @__PURE__ */ React185.createElement(Group59, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React185.createElement(Group59, { wrap: "nowrap", align: "center", style: { flex: 1 } }, getIcon("feather", block.props.icon), /* @__PURE__ */ React185.createElement(Stack122, { gap: 4, style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React185.createElement(Group59, { gap: "xs", align: "center" }, /* @__PURE__ */ React185.createElement(Text96, { fw: 600, size: "sm" }, block.props.title || "Sign to Create"), /* @__PURE__ */ React185.createElement(Badge28, { size: "xs", variant: "filled", color: badgeProps.color, styles: { root: { backgroundColor: `var(--mantine-color-${badgeProps.color}-6)`, color: "white" } } }, badgeProps.text)), /* @__PURE__ */ React185.createElement(Text96, { size: "xs", c: "dimmed", lineClamp: 2 }, getDescriptionText()))), IS_DEV && status === "pending" && !isDataReady && /* @__PURE__ */ React185.createElement(Button33, { size: "compact-xs", variant: "light", color: "orange", leftSection: /* @__PURE__ */ React185.createElement(IconTestPipe, { size: 14 }), onClick: handlePrefillDummyData }, "Test Data"), IS_DEV && isDataReady && /* @__PURE__ */ React185.createElement(Button33, { size: "compact-xs", variant: "light", color: "orange", leftSection: /* @__PURE__ */ React185.createElement(IconTrash5, { size: 14 }), onClick: handleClearDummyData }, "Clear Data"), isClickable && /* @__PURE__ */ React185.createElement(Tooltip18, { label: status === "completed" ? "View details" : "Sign & Create", withArrow: true }, /* @__PURE__ */ React185.createElement(ActionIcon27, { variant: "subtle", color: "blue" }, /* @__PURE__ */ React185.createElement(IconChevronRight8, { size: 18 })))));
17621
+ const canOpenPanel = status !== "pending";
17622
+ return /* @__PURE__ */ React192.createElement(BaseContainer, { onClick: canOpenPanel ? open : void 0, style: { opacity: canOpenPanel ? 1 : 0.7, cursor: canOpenPanel ? "pointer" : "not-allowed" } }, /* @__PURE__ */ React192.createElement(Group61, { wrap: "nowrap", justify: "space-between", align: "center" }, /* @__PURE__ */ React192.createElement(Group61, { wrap: "nowrap", align: "center", style: { flex: 1 } }, getIcon("dots-circle", block.props.icon), /* @__PURE__ */ React192.createElement(Stack125, { gap: 4, style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React192.createElement(Group61, { gap: "xs", align: "center" }, /* @__PURE__ */ React192.createElement(Text99, { fw: 600, size: "sm" }, block.props.title || "Domain Card"), /* @__PURE__ */ React192.createElement(Badge30, { size: "xs", variant: "filled", color: badgeProps.color, styles: { root: { backgroundColor: `var(--mantine-color-${badgeProps.color}-6)`, color: "white" } } }, badgeProps.text)), /* @__PURE__ */ React192.createElement(Text99, { size: "xs", c: "dimmed", lineClamp: 2 }, getDescriptionText()))), IS_DEV && status === "pending" && /* @__PURE__ */ React192.createElement(React192.Fragment, null, /* @__PURE__ */ React192.createElement(Button34, { size: "compact-xs", variant: "light", color: "orange", leftSection: /* @__PURE__ */ React192.createElement(IconTestPipe, { size: 14 }), onClick: handleInjectDummyData }, "Test Data"), /* @__PURE__ */ React192.createElement(Button34, { size: "compact-xs", variant: "light", color: "blue", leftSection: /* @__PURE__ */ React192.createElement(IconLoader, { size: 14 }), onClick: handleSetLoading }, "Loading")), IS_DEV && (status === "ready" || status === "approved" || status === "loading") && /* @__PURE__ */ React192.createElement(Button34, { size: "compact-xs", variant: "light", color: "orange", leftSection: /* @__PURE__ */ React192.createElement(IconTrash5, { size: 14 }), onClick: handleClearData }, "Clear"), canOpenPanel && /* @__PURE__ */ React192.createElement(Tooltip19, { label: status === "approved" ? "View domain data" : "Review domain data", withArrow: true }, /* @__PURE__ */ React192.createElement(ActionIcon28, { variant: "subtle", color: "blue" }, /* @__PURE__ */ React192.createElement(IconChevronRight9, { size: 18 })))));
17020
17623
  };
17021
17624
 
17022
- // src/mantine/blocks/domainCreatorSign/DomainCreatorSignBlock.tsx
17023
- function DomainCreatorSignBlock({ editor, block }) {
17625
+ // src/mantine/blocks/domainCardViewer/DomainCardViewerBlock.tsx
17626
+ function DomainCardViewerBlock({ editor, block }) {
17024
17627
  const { docType } = useBlocknoteContext();
17025
17628
  if (docType === "template") {
17026
- return /* @__PURE__ */ React186.createElement(DomainCreatorSignTemplateView, { editor, block });
17629
+ return /* @__PURE__ */ React193.createElement(DomainCardViewerTemplateView, { editor, block });
17027
17630
  }
17028
- return /* @__PURE__ */ React186.createElement(DomainCreatorSignFlowView, { editor, block });
17631
+ return /* @__PURE__ */ React193.createElement(DomainCardViewerFlowView, { editor, block });
17029
17632
  }
17030
17633
 
17031
- // src/mantine/blocks/domainCreatorSign/DomainCreatorSignBlockSpec.tsx
17032
- var DomainCreatorSignBlockSpec = createReactBlockSpec16(
17634
+ // src/mantine/blocks/domainCardViewer/DomainCardViewerBlockSpec.tsx
17635
+ var DomainCardViewerBlockSpec = createReactBlockSpec17(
17033
17636
  {
17034
- type: "domainCreatorSign",
17637
+ type: "domainCardViewer",
17035
17638
  propSchema: {
17036
17639
  title: { default: "" },
17037
17640
  description: { default: "" },
17038
- icon: { default: "file-text" },
17039
- // JSON string of credential subject data (oracle fills this)
17641
+ icon: { default: "dots-circle" },
17642
+ // Preview data for UI display (JSON string, injected by oracle)
17643
+ // Uses DomainCardResponse format with faq, summary, logo_url, etc.
17644
+ domainPreviewData: { default: "{}" },
17645
+ // Credential subject data for signing (JSON string, injected by oracle)
17646
+ // Uses DomainCardCredentialSubject format for W3C VC
17040
17647
  domainCardData: { default: "{}" },
17041
- // Entity type from protocol selector or oracle
17042
- entityType: { default: "" },
17043
- // Status: pending | ready | signing | uploading | creating | completed | error
17648
+ // Status tracking for oracle workflow
17044
17649
  status: { default: "pending" },
17045
- // Created entity DID (after success)
17046
- entityDid: { default: "" },
17047
- // Transaction hash (after success)
17048
- transactionHash: { default: "" },
17049
- // Error message if failed
17650
+ // 'pending' | 'loading' | 'ready' | 'approved' | 'error'
17651
+ // Loading message from oracle
17652
+ loadingMessage: { default: "" },
17653
+ // Error message if something goes wrong
17050
17654
  errorMessage: { default: "" }
17051
17655
  },
17052
17656
  content: "none"
@@ -17054,7 +17658,7 @@ var DomainCreatorSignBlockSpec = createReactBlockSpec16(
17054
17658
  {
17055
17659
  render: (props) => {
17056
17660
  const ixoProps = props;
17057
- return /* @__PURE__ */ React187.createElement(DomainCreatorSignBlock, { ...ixoProps });
17661
+ return /* @__PURE__ */ React194.createElement(DomainCardViewerBlock, { ...ixoProps });
17058
17662
  }
17059
17663
  }
17060
17664
  );
@@ -17230,10 +17834,10 @@ blockRegistry.register({
17230
17834
  });
17231
17835
 
17232
17836
  // src/mantine/blocks/hooks/useBlockDependencies.ts
17233
- import { useMemo as useMemo57, useEffect as useEffect48, useState as useState65, useCallback as useCallback48 } from "react";
17837
+ import { useMemo as useMemo60, useEffect as useEffect50, useState as useState67, useCallback as useCallback50 } from "react";
17234
17838
 
17235
17839
  // src/mantine/blocks/hooks/useDependsOn.ts
17236
- import { useMemo as useMemo58 } from "react";
17840
+ import { useMemo as useMemo61 } from "react";
17237
17841
 
17238
17842
  // src/mantine/blocks/index.ts
17239
17843
  var blockSpecs = {
@@ -17252,7 +17856,8 @@ var blockSpecs = {
17252
17856
  dynamicList: DynamicListBlockSpec,
17253
17857
  protocolSelector: ProtocolSelectorBlockSpec,
17254
17858
  form: FormBlockSpec,
17255
- domainCreatorSign: DomainCreatorSignBlockSpec
17859
+ domainCreatorSign: DomainCreatorSignBlockSpec,
17860
+ domainCardViewer: DomainCardViewerBlockSpec
17256
17861
  };
17257
17862
  var getExtraSlashMenuItems = (editor) => {
17258
17863
  const slashMenuList = [
@@ -17585,7 +18190,6 @@ var getExtraSlashMenuItems = (editor) => {
17585
18190
  title: "",
17586
18191
  description: "",
17587
18192
  icon: "feather",
17588
- domainCardData: "{}",
17589
18193
  entityType: "",
17590
18194
  status: "pending",
17591
18195
  entityDid: "",
@@ -17601,6 +18205,33 @@ var getExtraSlashMenuItems = (editor) => {
17601
18205
  aliases: ["domain-sign"],
17602
18206
  group: "Domains",
17603
18207
  subtext: "Sign domain card and create entity on-chain"
18208
+ },
18209
+ {
18210
+ title: "Domain Card",
18211
+ onItemClick: () => {
18212
+ editor.insertBlocks(
18213
+ [
18214
+ {
18215
+ type: "domainCardViewer",
18216
+ props: {
18217
+ title: "",
18218
+ description: "",
18219
+ icon: "dots-circle",
18220
+ domainPreviewData: "{}",
18221
+ domainCardData: "{}",
18222
+ status: "pending",
18223
+ loadingMessage: "",
18224
+ errorMessage: ""
18225
+ }
18226
+ }
18227
+ ],
18228
+ editor.getTextCursorPosition().block,
18229
+ "after"
18230
+ );
18231
+ },
18232
+ aliases: ["domain-card", "domain-viewer", "card-preview"],
18233
+ group: "Domains",
18234
+ subtext: "Preview domain card before signing"
17604
18235
  }
17605
18236
  ];
17606
18237
  const yRoot = editor?._yRoot;
@@ -17681,15 +18312,15 @@ import { useCreateBlockNote as useCreateBlockNote2 } from "@blocknote/react";
17681
18312
  import { BlockNoteSchema as BlockNoteSchema2, defaultBlockSpecs as defaultBlockSpecs2, defaultInlineContentSpecs as defaultInlineContentSpecs2, defaultStyleSpecs as defaultStyleSpecs2 } from "@blocknote/core";
17682
18313
 
17683
18314
  // src/core/hooks/useMatrixProvider.ts
17684
- import { useEffect as useEffect49, useState as useState66, useRef as useRef11, useCallback as useCallback49, useMemo as useMemo59 } from "react";
18315
+ import { useEffect as useEffect51, useState as useState68, useRef as useRef11, useCallback as useCallback51, useMemo as useMemo62 } from "react";
17685
18316
  import { MatrixProvider } from "@ixo/matrix-crdt";
17686
18317
  function useMatrixProvider({ matrixClient, roomId, yDoc }) {
17687
- const [matrixProvider, setProvider] = useState66(null);
17688
- const [status, setStatus] = useState66("disconnected");
18318
+ const [matrixProvider, setProvider] = useState68(null);
18319
+ const [status, setStatus] = useState68("disconnected");
17689
18320
  const isMountedRef = useRef11(true);
17690
18321
  const providerRef = useRef11(null);
17691
18322
  const retryTimeoutRef = useRef11(null);
17692
- const providerOptions = useMemo59(
18323
+ const providerOptions = useMemo62(
17693
18324
  () => ({
17694
18325
  translator: {
17695
18326
  updateEventType: "matrix-crdt.doc_update",
@@ -17702,22 +18333,22 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
17702
18333
  }),
17703
18334
  []
17704
18335
  );
17705
- const handleDocumentAvailable = useCallback49(() => {
18336
+ const handleDocumentAvailable = useCallback51(() => {
17706
18337
  if (isMountedRef.current) {
17707
18338
  setStatus("connected");
17708
18339
  }
17709
18340
  }, []);
17710
- const handleDocumentUnavailable = useCallback49(() => {
18341
+ const handleDocumentUnavailable = useCallback51(() => {
17711
18342
  if (isMountedRef.current) {
17712
18343
  setStatus("failed");
17713
18344
  }
17714
18345
  }, []);
17715
- const handleCanWriteChanged = useCallback49(() => {
18346
+ const handleCanWriteChanged = useCallback51(() => {
17716
18347
  if (isMountedRef.current && providerRef.current) {
17717
18348
  setStatus(providerRef.current.canWrite ? "connected" : "failed");
17718
18349
  }
17719
18350
  }, []);
17720
- const initProvider = useCallback49(async () => {
18351
+ const initProvider = useCallback51(async () => {
17721
18352
  if (!isMountedRef.current) return;
17722
18353
  if (retryTimeoutRef.current) {
17723
18354
  clearTimeout(retryTimeoutRef.current);
@@ -17750,7 +18381,7 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
17750
18381
  }
17751
18382
  }
17752
18383
  }, [matrixClient, providerOptions, handleDocumentAvailable, handleDocumentUnavailable, handleCanWriteChanged]);
17753
- useEffect49(() => {
18384
+ useEffect51(() => {
17754
18385
  isMountedRef.current = true;
17755
18386
  initProvider();
17756
18387
  return () => {
@@ -17767,7 +18398,7 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
17767
18398
  setStatus("disconnected");
17768
18399
  };
17769
18400
  }, [initProvider]);
17770
- useEffect49(() => {
18401
+ useEffect51(() => {
17771
18402
  return () => {
17772
18403
  isMountedRef.current = false;
17773
18404
  };
@@ -17776,17 +18407,17 @@ function useMatrixProvider({ matrixClient, roomId, yDoc }) {
17776
18407
  }
17777
18408
 
17778
18409
  // src/mantine/hooks/useCollaborativeYDoc.ts
17779
- import { useMemo as useMemo60 } from "react";
18410
+ import { useMemo as useMemo63 } from "react";
17780
18411
  import * as Y from "yjs";
17781
18412
  function useCollaborativeYDoc(_options) {
17782
- return useMemo60(() => {
18413
+ return useMemo63(() => {
17783
18414
  const doc = new Y.Doc();
17784
18415
  return doc;
17785
18416
  }, []);
17786
18417
  }
17787
18418
 
17788
18419
  // src/mantine/hooks/useCollaborativeIxoEditor.ts
17789
- import { useMemo as useMemo61, useEffect as useEffect50 } from "react";
18420
+ import { useMemo as useMemo64, useEffect as useEffect52 } from "react";
17790
18421
 
17791
18422
  // src/core/lib/matrixMetadata.ts
17792
18423
  var COVER_IMAGE_EVENT_TYPE = "ixo.page.cover_image";
@@ -17955,7 +18586,7 @@ function useCreateCollaborativeIxoEditor(options) {
17955
18586
  matrixClient,
17956
18587
  permissions = { write: false }
17957
18588
  } = options || {};
17958
- const memoizedUser = useMemo61(
18589
+ const memoizedUser = useMemo64(
17959
18590
  () => ({
17960
18591
  id: user?.id || "",
17961
18592
  name: user?.name || "",
@@ -17970,13 +18601,13 @@ function useCreateCollaborativeIxoEditor(options) {
17970
18601
  matrixClient,
17971
18602
  roomId: options.roomId
17972
18603
  });
17973
- const metadataManager = useMemo61(() => new MatrixMetadataManager(matrixClient, options.roomId), [matrixClient, options.roomId]);
17974
- useEffect50(() => {
18604
+ const metadataManager = useMemo64(() => new MatrixMetadataManager(matrixClient, options.roomId), [matrixClient, options.roomId]);
18605
+ useEffect52(() => {
17975
18606
  return () => {
17976
18607
  metadataManager.dispose();
17977
18608
  };
17978
18609
  }, [metadataManager]);
17979
- const defaultUploadFile = useMemo61(
18610
+ const defaultUploadFile = useMemo64(
17980
18611
  () => uploadFile || (async (file) => {
17981
18612
  return new Promise((resolve, reject) => {
17982
18613
  const reader = new FileReader();
@@ -17990,7 +18621,7 @@ function useCreateCollaborativeIxoEditor(options) {
17990
18621
  }),
17991
18622
  [uploadFile]
17992
18623
  );
17993
- const schema = useMemo61(
18624
+ const schema = useMemo64(
17994
18625
  () => BlockNoteSchema2.create({
17995
18626
  blockSpecs: {
17996
18627
  ...defaultBlockSpecs2,
@@ -18005,13 +18636,13 @@ function useCreateCollaborativeIxoEditor(options) {
18005
18636
  }),
18006
18637
  []
18007
18638
  );
18008
- const root = useMemo61(() => yDoc.getMap("root"), [yDoc]);
18009
- const documentFragment = useMemo61(() => yDoc.getXmlFragment("document"), [yDoc]);
18010
- const flowArray = useMemo61(() => yDoc.getArray("flow"), [yDoc]);
18011
- const runtimeMap = useMemo61(() => yDoc.getMap("runtime"), [yDoc]);
18012
- const delegationsMap = useMemo61(() => yDoc.getMap("delegations"), [yDoc]);
18013
- const userFragment = useMemo61(() => yDoc.getMap(memoizedUser.id), [yDoc, memoizedUser.id]);
18014
- const collaborationConfig = useMemo61(
18639
+ const root = useMemo64(() => yDoc.getMap("root"), [yDoc]);
18640
+ const documentFragment = useMemo64(() => yDoc.getXmlFragment("document"), [yDoc]);
18641
+ const flowArray = useMemo64(() => yDoc.getArray("flow"), [yDoc]);
18642
+ const runtimeMap = useMemo64(() => yDoc.getMap("runtime"), [yDoc]);
18643
+ const delegationsMap = useMemo64(() => yDoc.getMap("delegations"), [yDoc]);
18644
+ const userFragment = useMemo64(() => yDoc.getMap(memoizedUser.id), [yDoc, memoizedUser.id]);
18645
+ const collaborationConfig = useMemo64(
18015
18646
  () => ({
18016
18647
  provider: matrixProvider,
18017
18648
  fragment: documentFragment,
@@ -18023,7 +18654,7 @@ function useCreateCollaborativeIxoEditor(options) {
18023
18654
  }),
18024
18655
  [matrixProvider, documentFragment, memoizedUser.name, memoizedUser.color]
18025
18656
  );
18026
- const ixoConfig = useMemo61(
18657
+ const ixoConfig = useMemo64(
18027
18658
  () => ({
18028
18659
  theme,
18029
18660
  editable,
@@ -18042,7 +18673,7 @@ function useCreateCollaborativeIxoEditor(options) {
18042
18673
  uploadFile: defaultUploadFile,
18043
18674
  collaboration: collaborationConfig
18044
18675
  });
18045
- const titleText = useMemo61(() => yDoc.getText("title"), [yDoc]);
18676
+ const titleText = useMemo64(() => yDoc.getText("title"), [yDoc]);
18046
18677
  let ixoEditor;
18047
18678
  if (editor) {
18048
18679
  ixoEditor = editor;
@@ -18192,12 +18823,12 @@ function useCreateCollaborativeIxoEditor(options) {
18192
18823
  return void 0;
18193
18824
  };
18194
18825
  }
18195
- useEffect50(() => {
18826
+ useEffect52(() => {
18196
18827
  if (ixoEditor) {
18197
18828
  ixoEditor.isEditable = editable;
18198
18829
  }
18199
18830
  }, [ixoEditor, editable]);
18200
- useEffect50(() => {
18831
+ useEffect52(() => {
18201
18832
  if (connectionStatus !== "connected") {
18202
18833
  return;
18203
18834
  }
@@ -18230,8 +18861,8 @@ function useCreateCollaborativeIxoEditor(options) {
18230
18861
  }
18231
18862
 
18232
18863
  // src/mantine/components/CoverImage.tsx
18233
- import React189, { useState as useState67, useRef as useRef12, useEffect as useEffect51 } from "react";
18234
- import { Box as Box34, Group as Group60 } from "@mantine/core";
18864
+ import React196, { useState as useState69, useRef as useRef12, useEffect as useEffect53 } from "react";
18865
+ import { Box as Box35, Group as Group62 } from "@mantine/core";
18235
18866
 
18236
18867
  // src/core/lib/imageTransform.ts
18237
18868
  var CLOUDFLARE_CDN_BASE = "https://www.ixo.earth/cdn-cgi/image";
@@ -18364,11 +18995,11 @@ function transformIconImage(sourceUrl, size = "default", customOptions) {
18364
18995
  }
18365
18996
 
18366
18997
  // src/mantine/components/Base/CoverImageButton.tsx
18367
- import React188 from "react";
18368
- import { Button as Button34 } from "@mantine/core";
18998
+ import React195 from "react";
18999
+ import { Button as Button35 } from "@mantine/core";
18369
19000
  function CoverImageButton({ isActive = false, children, onClick, style }) {
18370
- return /* @__PURE__ */ React188.createElement(
18371
- Button34,
19001
+ return /* @__PURE__ */ React195.createElement(
19002
+ Button35,
18372
19003
  {
18373
19004
  onClick,
18374
19005
  variant: "filled",
@@ -18390,13 +19021,13 @@ function CoverImageButton({ isActive = false, children, onClick, style }) {
18390
19021
  // src/mantine/components/CoverImage.tsx
18391
19022
  function CoverImage({ coverImageUrl, logoUrl }) {
18392
19023
  const { editor, handlers, editable } = useBlocknoteContext();
18393
- const [isHovering, setIsHovering] = useState67(false);
18394
- const [isRepositioning, setIsRepositioning] = useState67(false);
18395
- const [coverPosition, setCoverPosition] = useState67(50);
19024
+ const [isHovering, setIsHovering] = useState69(false);
19025
+ const [isRepositioning, setIsRepositioning] = useState69(false);
19026
+ const [coverPosition, setCoverPosition] = useState69(50);
18396
19027
  const coverFileInputRef = useRef12(null);
18397
19028
  const logoFileInputRef = useRef12(null);
18398
- const [metadata, setMetadata] = useState67(() => editor?.getPageMetadata?.() || null);
18399
- useEffect51(() => {
19029
+ const [metadata, setMetadata] = useState69(() => editor?.getPageMetadata?.() || null);
19030
+ useEffect53(() => {
18400
19031
  if (!editor?._metadataManager) {
18401
19032
  return;
18402
19033
  }
@@ -18487,8 +19118,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
18487
19118
  return null;
18488
19119
  }
18489
19120
  if (!hasCover) {
18490
- return /* @__PURE__ */ React189.createElement(
18491
- Box34,
19121
+ return /* @__PURE__ */ React196.createElement(
19122
+ Box35,
18492
19123
  {
18493
19124
  style: {
18494
19125
  position: "relative",
@@ -18500,8 +19131,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
18500
19131
  onMouseEnter: () => editable && setIsHovering(true),
18501
19132
  onMouseLeave: () => editable && setIsHovering(false)
18502
19133
  },
18503
- /* @__PURE__ */ React189.createElement("div", { style: { maxWidth: "900px", margin: "0 auto", position: "relative", height: "100%" } }, /* @__PURE__ */ React189.createElement("input", { ref: coverFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "cover") }), /* @__PURE__ */ React189.createElement("input", { ref: logoFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "logo") }), editable && isHovering && !logoSrc && /* @__PURE__ */ React189.createElement(
18504
- Group60,
19134
+ /* @__PURE__ */ React196.createElement("div", { style: { maxWidth: "900px", margin: "0 auto", position: "relative", height: "100%" } }, /* @__PURE__ */ React196.createElement("input", { ref: coverFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "cover") }), /* @__PURE__ */ React196.createElement("input", { ref: logoFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "logo") }), editable && isHovering && !logoSrc && /* @__PURE__ */ React196.createElement(
19135
+ Group62,
18505
19136
  {
18506
19137
  gap: "xs",
18507
19138
  style: {
@@ -18511,10 +19142,10 @@ function CoverImage({ coverImageUrl, logoUrl }) {
18511
19142
  zIndex: 10
18512
19143
  }
18513
19144
  },
18514
- /* @__PURE__ */ React189.createElement(CoverImageButton, { onClick: handleAddLogo }, "Add icon"),
18515
- /* @__PURE__ */ React189.createElement(CoverImageButton, { onClick: handleAddCover }, "Add cover")
18516
- ), logoSrc && /* @__PURE__ */ React189.createElement(
18517
- Box34,
19145
+ /* @__PURE__ */ React196.createElement(CoverImageButton, { onClick: handleAddLogo }, "Add icon"),
19146
+ /* @__PURE__ */ React196.createElement(CoverImageButton, { onClick: handleAddCover }, "Add cover")
19147
+ ), logoSrc && /* @__PURE__ */ React196.createElement(
19148
+ Box35,
18518
19149
  {
18519
19150
  style: {
18520
19151
  position: "relative",
@@ -18527,7 +19158,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
18527
19158
  zIndex: 11
18528
19159
  }
18529
19160
  },
18530
- /* @__PURE__ */ React189.createElement(
19161
+ /* @__PURE__ */ React196.createElement(
18531
19162
  "img",
18532
19163
  {
18533
19164
  src: logoSrc,
@@ -18541,7 +19172,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
18541
19172
  }
18542
19173
  }
18543
19174
  ),
18544
- editable && isHovering && /* @__PURE__ */ React189.createElement(
19175
+ editable && isHovering && /* @__PURE__ */ React196.createElement(
18545
19176
  "div",
18546
19177
  {
18547
19178
  style: {
@@ -18556,15 +19187,15 @@ function CoverImage({ coverImageUrl, logoUrl }) {
18556
19187
  alignItems: "center"
18557
19188
  }
18558
19189
  },
18559
- /* @__PURE__ */ React189.createElement(CoverImageButton, { onClick: handleChangeLogo }, "Change"),
18560
- /* @__PURE__ */ React189.createElement(CoverImageButton, { onClick: handleRemoveLogo }, "Remove"),
18561
- /* @__PURE__ */ React189.createElement(CoverImageButton, { onClick: handleAddCover }, "Add cover")
19190
+ /* @__PURE__ */ React196.createElement(CoverImageButton, { onClick: handleChangeLogo }, "Change"),
19191
+ /* @__PURE__ */ React196.createElement(CoverImageButton, { onClick: handleRemoveLogo }, "Remove"),
19192
+ /* @__PURE__ */ React196.createElement(CoverImageButton, { onClick: handleAddCover }, "Add cover")
18562
19193
  )
18563
19194
  ))
18564
19195
  );
18565
19196
  }
18566
- return /* @__PURE__ */ React189.createElement(
18567
- Box34,
19197
+ return /* @__PURE__ */ React196.createElement(
19198
+ Box35,
18568
19199
  {
18569
19200
  style: {
18570
19201
  position: "relative",
@@ -18584,7 +19215,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
18584
19215
  onMouseMove: handleMouseMove,
18585
19216
  onClick: () => isRepositioning && setIsRepositioning(false)
18586
19217
  },
18587
- /* @__PURE__ */ React189.createElement(
19218
+ /* @__PURE__ */ React196.createElement(
18588
19219
  "img",
18589
19220
  {
18590
19221
  src: coverUrl,
@@ -18602,8 +19233,8 @@ function CoverImage({ coverImageUrl, logoUrl }) {
18602
19233
  }
18603
19234
  }
18604
19235
  ),
18605
- editable && isHovering && /* @__PURE__ */ React189.createElement(
18606
- Group60,
19236
+ editable && isHovering && /* @__PURE__ */ React196.createElement(
19237
+ Group62,
18607
19238
  {
18608
19239
  gap: "xs",
18609
19240
  style: {
@@ -18613,12 +19244,12 @@ function CoverImage({ coverImageUrl, logoUrl }) {
18613
19244
  zIndex: 10
18614
19245
  }
18615
19246
  },
18616
- /* @__PURE__ */ React189.createElement(CoverImageButton, { onClick: handleChangeCover }, "Change cover"),
18617
- /* @__PURE__ */ React189.createElement(CoverImageButton, { onClick: handleReposition, isActive: isRepositioning }, isRepositioning ? "Done" : "Reposition"),
18618
- /* @__PURE__ */ React189.createElement(CoverImageButton, { onClick: handleRemoveCover }, "Remove")
19247
+ /* @__PURE__ */ React196.createElement(CoverImageButton, { onClick: handleChangeCover }, "Change cover"),
19248
+ /* @__PURE__ */ React196.createElement(CoverImageButton, { onClick: handleReposition, isActive: isRepositioning }, isRepositioning ? "Done" : "Reposition"),
19249
+ /* @__PURE__ */ React196.createElement(CoverImageButton, { onClick: handleRemoveCover }, "Remove")
18619
19250
  ),
18620
- /* @__PURE__ */ React189.createElement("div", { style: { maxWidth: "900px", margin: "0 auto", position: "absolute", bottom: 0, left: -40, right: 0, height: "70px" } }, /* @__PURE__ */ React189.createElement(
18621
- Box34,
19251
+ /* @__PURE__ */ React196.createElement("div", { style: { maxWidth: "900px", margin: "0 auto", position: "absolute", bottom: 0, left: -40, right: 0, height: "70px" } }, /* @__PURE__ */ React196.createElement(
19252
+ Box35,
18622
19253
  {
18623
19254
  style: {
18624
19255
  position: "absolute",
@@ -18629,7 +19260,7 @@ function CoverImage({ coverImageUrl, logoUrl }) {
18629
19260
  zIndex: 11
18630
19261
  }
18631
19262
  },
18632
- logoSrc && /* @__PURE__ */ React189.createElement(
19263
+ logoSrc && /* @__PURE__ */ React196.createElement(
18633
19264
  "img",
18634
19265
  {
18635
19266
  src: logoSrc,
@@ -18643,10 +19274,10 @@ function CoverImage({ coverImageUrl, logoUrl }) {
18643
19274
  }
18644
19275
  }
18645
19276
  ),
18646
- editable && isHovering && /* @__PURE__ */ React189.createElement(React189.Fragment, null, logoSrc ? (
19277
+ editable && isHovering && /* @__PURE__ */ React196.createElement(React196.Fragment, null, logoSrc ? (
18647
19278
  // Logo exists: Show Change/Remove buttons when hovering on cover
18648
- /* @__PURE__ */ React189.createElement(
18649
- Group60,
19279
+ /* @__PURE__ */ React196.createElement(
19280
+ Group62,
18650
19281
  {
18651
19282
  gap: "xs",
18652
19283
  style: {
@@ -18656,12 +19287,12 @@ function CoverImage({ coverImageUrl, logoUrl }) {
18656
19287
  zIndex: 12
18657
19288
  }
18658
19289
  },
18659
- /* @__PURE__ */ React189.createElement(CoverImageButton, { onClick: handleChangeLogo }, "Change"),
18660
- /* @__PURE__ */ React189.createElement(CoverImageButton, { onClick: handleRemoveLogo }, "Remove")
19290
+ /* @__PURE__ */ React196.createElement(CoverImageButton, { onClick: handleChangeLogo }, "Change"),
19291
+ /* @__PURE__ */ React196.createElement(CoverImageButton, { onClick: handleRemoveLogo }, "Remove")
18661
19292
  )
18662
19293
  ) : (
18663
19294
  // No logo: Show "Add icon" button when hovering anywhere on cover
18664
- /* @__PURE__ */ React189.createElement(
19295
+ /* @__PURE__ */ React196.createElement(
18665
19296
  CoverImageButton,
18666
19297
  {
18667
19298
  onClick: handleAddLogo,
@@ -18677,13 +19308,13 @@ function CoverImage({ coverImageUrl, logoUrl }) {
18677
19308
  )
18678
19309
  ))
18679
19310
  )),
18680
- /* @__PURE__ */ React189.createElement("input", { ref: coverFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "cover") }),
18681
- /* @__PURE__ */ React189.createElement("input", { ref: logoFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "logo") })
19311
+ /* @__PURE__ */ React196.createElement("input", { ref: coverFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "cover") }),
19312
+ /* @__PURE__ */ React196.createElement("input", { ref: logoFileInputRef, type: "file", accept: "image/*", style: { display: "none" }, onChange: (e) => handleFileSelect(e, "logo") })
18682
19313
  );
18683
19314
  }
18684
19315
 
18685
19316
  // src/mantine/components/PageHeader.tsx
18686
- import React190, { useState as useState68, useRef as useRef13, useEffect as useEffect52 } from "react";
19317
+ import React197, { useState as useState70, useRef as useRef13, useEffect as useEffect54 } from "react";
18687
19318
  function PageHeader({
18688
19319
  title = "New page",
18689
19320
  icon,
@@ -18694,9 +19325,9 @@ function PageHeader({
18694
19325
  isFavorited = false,
18695
19326
  menuItems = []
18696
19327
  }) {
18697
- const [isMenuOpen, setIsMenuOpen] = useState68(false);
19328
+ const [isMenuOpen, setIsMenuOpen] = useState70(false);
18698
19329
  const menuRef = useRef13(null);
18699
- useEffect52(() => {
19330
+ useEffect54(() => {
18700
19331
  function handleClickOutside(event) {
18701
19332
  if (menuRef.current && !menuRef.current.contains(event.target)) {
18702
19333
  setIsMenuOpen(false);
@@ -18715,14 +19346,14 @@ function PageHeader({
18715
19346
  setIsMenuOpen(false);
18716
19347
  }
18717
19348
  };
18718
- return /* @__PURE__ */ React190.createElement("div", { style: styles.container }, /* @__PURE__ */ React190.createElement("div", { style: styles.leftSection }, /* @__PURE__ */ React190.createElement("span", { style: styles.icon }, icon || "\u{1F4C4}"), /* @__PURE__ */ React190.createElement("span", { style: styles.title }, title), isPrivate && /* @__PURE__ */ React190.createElement("button", { style: styles.privacyBadge }, /* @__PURE__ */ React190.createElement("span", { style: styles.lockIcon }, "\u{1F512}"), /* @__PURE__ */ React190.createElement("span", null, "Private"), /* @__PURE__ */ React190.createElement("span", { style: styles.chevron }, "\u25BE"))), /* @__PURE__ */ React190.createElement("div", { style: styles.rightSection }, lastEdited && /* @__PURE__ */ React190.createElement("span", { style: styles.editedText }, lastEdited), onShare && /* @__PURE__ */ React190.createElement("button", { style: styles.shareButton, onClick: onShare }, "Share"), onFavorite && /* @__PURE__ */ React190.createElement("button", { style: styles.iconButton, onClick: onFavorite }, isFavorited ? "\u2605" : "\u2606"), menuItems.length > 0 && /* @__PURE__ */ React190.createElement("div", { style: styles.menuContainer, ref: menuRef }, /* @__PURE__ */ React190.createElement(
19349
+ return /* @__PURE__ */ React197.createElement("div", { style: styles.container }, /* @__PURE__ */ React197.createElement("div", { style: styles.leftSection }, /* @__PURE__ */ React197.createElement("span", { style: styles.icon }, icon || "\u{1F4C4}"), /* @__PURE__ */ React197.createElement("span", { style: styles.title }, title), isPrivate && /* @__PURE__ */ React197.createElement("button", { style: styles.privacyBadge }, /* @__PURE__ */ React197.createElement("span", { style: styles.lockIcon }, "\u{1F512}"), /* @__PURE__ */ React197.createElement("span", null, "Private"), /* @__PURE__ */ React197.createElement("span", { style: styles.chevron }, "\u25BE"))), /* @__PURE__ */ React197.createElement("div", { style: styles.rightSection }, lastEdited && /* @__PURE__ */ React197.createElement("span", { style: styles.editedText }, lastEdited), onShare && /* @__PURE__ */ React197.createElement("button", { style: styles.shareButton, onClick: onShare }, "Share"), onFavorite && /* @__PURE__ */ React197.createElement("button", { style: styles.iconButton, onClick: onFavorite }, isFavorited ? "\u2605" : "\u2606"), menuItems.length > 0 && /* @__PURE__ */ React197.createElement("div", { style: styles.menuContainer, ref: menuRef }, /* @__PURE__ */ React197.createElement(
18719
19350
  "button",
18720
19351
  {
18721
19352
  style: styles.menuButton,
18722
19353
  onClick: () => setIsMenuOpen(!isMenuOpen),
18723
19354
  "aria-label": "Menu"
18724
19355
  },
18725
- /* @__PURE__ */ React190.createElement(
19356
+ /* @__PURE__ */ React197.createElement(
18726
19357
  "svg",
18727
19358
  {
18728
19359
  width: "16",
@@ -18730,11 +19361,11 @@ function PageHeader({
18730
19361
  viewBox: "0 0 16 16",
18731
19362
  fill: "currentColor"
18732
19363
  },
18733
- /* @__PURE__ */ React190.createElement("circle", { cx: "3", cy: "8", r: "1.5" }),
18734
- /* @__PURE__ */ React190.createElement("circle", { cx: "8", cy: "8", r: "1.5" }),
18735
- /* @__PURE__ */ React190.createElement("circle", { cx: "13", cy: "8", r: "1.5" })
19364
+ /* @__PURE__ */ React197.createElement("circle", { cx: "3", cy: "8", r: "1.5" }),
19365
+ /* @__PURE__ */ React197.createElement("circle", { cx: "8", cy: "8", r: "1.5" }),
19366
+ /* @__PURE__ */ React197.createElement("circle", { cx: "13", cy: "8", r: "1.5" })
18736
19367
  )
18737
- ), isMenuOpen && /* @__PURE__ */ React190.createElement("div", { style: styles.dropdown }, menuItems.map((item, index) => /* @__PURE__ */ React190.createElement(React190.Fragment, { key: index }, item.divider && index > 0 && /* @__PURE__ */ React190.createElement("div", { style: styles.divider }), /* @__PURE__ */ React190.createElement(
19368
+ ), isMenuOpen && /* @__PURE__ */ React197.createElement("div", { style: styles.dropdown }, menuItems.map((item, index) => /* @__PURE__ */ React197.createElement(React197.Fragment, { key: index }, item.divider && index > 0 && /* @__PURE__ */ React197.createElement("div", { style: styles.divider }), /* @__PURE__ */ React197.createElement(
18738
19369
  "button",
18739
19370
  {
18740
19371
  style: {
@@ -18744,8 +19375,8 @@ function PageHeader({
18744
19375
  onClick: () => handleMenuItemClick(item),
18745
19376
  disabled: item.disabled
18746
19377
  },
18747
- item.icon && /* @__PURE__ */ React190.createElement("span", { style: styles.menuItemIcon }, item.icon),
18748
- /* @__PURE__ */ React190.createElement("span", null, item.label)
19378
+ item.icon && /* @__PURE__ */ React197.createElement("span", { style: styles.menuItemIcon }, item.icon),
19379
+ /* @__PURE__ */ React197.createElement("span", null, item.label)
18749
19380
  )))))));
18750
19381
  }
18751
19382
  var styles = {
@@ -18876,8 +19507,8 @@ var styles = {
18876
19507
  };
18877
19508
 
18878
19509
  // src/mantine/components/ExternalDropZone.tsx
18879
- import React191, { useCallback as useCallback50, useEffect as useEffect53, useRef as useRef14, useState as useState69 } from "react";
18880
- import { Box as Box35 } from "@mantine/core";
19510
+ import React198, { useCallback as useCallback52, useEffect as useEffect55, useRef as useRef14, useState as useState71 } from "react";
19511
+ import { Box as Box36 } from "@mantine/core";
18881
19512
  var SCROLL_ZONE_SIZE = 80;
18882
19513
  var SCROLL_SPEED = 12;
18883
19514
  var ExternalDropZone = ({
@@ -18890,19 +19521,19 @@ var ExternalDropZone = ({
18890
19521
  children
18891
19522
  }) => {
18892
19523
  const containerRef = useRef14(null);
18893
- const [isValidDrag, setIsValidDrag] = useState69(false);
18894
- const [isHoveringInPlacementMode, setIsHoveringInPlacementMode] = useState69(false);
18895
- const [indicatorStyle, setIndicatorStyle] = useState69({});
19524
+ const [isValidDrag, setIsValidDrag] = useState71(false);
19525
+ const [isHoveringInPlacementMode, setIsHoveringInPlacementMode] = useState71(false);
19526
+ const [indicatorStyle, setIndicatorStyle] = useState71({});
18896
19527
  const dropPositionRef = useRef14(null);
18897
19528
  const scrollAnimationRef = useRef14(null);
18898
19529
  const scrollDirectionRef = useRef14(null);
18899
19530
  const scrollContainerRef = useRef14(null);
18900
- const getBlockElements = useCallback50(() => {
19531
+ const getBlockElements = useCallback52(() => {
18901
19532
  if (!containerRef.current) return [];
18902
19533
  const blocks = containerRef.current.querySelectorAll('[data-node-type="blockContainer"]');
18903
19534
  return Array.from(blocks);
18904
19535
  }, []);
18905
- const getScrollContainer = useCallback50(() => {
19536
+ const getScrollContainer = useCallback52(() => {
18906
19537
  if (scrollContainerRef.current) return scrollContainerRef.current;
18907
19538
  let element = containerRef.current;
18908
19539
  while (element) {
@@ -18917,7 +19548,7 @@ var ExternalDropZone = ({
18917
19548
  scrollContainerRef.current = window;
18918
19549
  return window;
18919
19550
  }, []);
18920
- const performScroll = useCallback50(() => {
19551
+ const performScroll = useCallback52(() => {
18921
19552
  const container = getScrollContainer();
18922
19553
  const direction = scrollDirectionRef.current;
18923
19554
  if (!direction) {
@@ -18932,7 +19563,7 @@ var ExternalDropZone = ({
18932
19563
  }
18933
19564
  scrollAnimationRef.current = requestAnimationFrame(performScroll);
18934
19565
  }, [getScrollContainer]);
18935
- const startAutoScroll = useCallback50(
19566
+ const startAutoScroll = useCallback52(
18936
19567
  (direction) => {
18937
19568
  if (scrollDirectionRef.current === direction) return;
18938
19569
  scrollDirectionRef.current = direction;
@@ -18942,14 +19573,14 @@ var ExternalDropZone = ({
18942
19573
  },
18943
19574
  [performScroll]
18944
19575
  );
18945
- const stopAutoScroll = useCallback50(() => {
19576
+ const stopAutoScroll = useCallback52(() => {
18946
19577
  scrollDirectionRef.current = null;
18947
19578
  if (scrollAnimationRef.current) {
18948
19579
  cancelAnimationFrame(scrollAnimationRef.current);
18949
19580
  scrollAnimationRef.current = null;
18950
19581
  }
18951
19582
  }, []);
18952
- const checkAutoScroll = useCallback50(
19583
+ const checkAutoScroll = useCallback52(
18953
19584
  (clientY) => {
18954
19585
  const container = getScrollContainer();
18955
19586
  let containerTop;
@@ -18972,7 +19603,7 @@ var ExternalDropZone = ({
18972
19603
  },
18973
19604
  [getScrollContainer, startAutoScroll, stopAutoScroll]
18974
19605
  );
18975
- const findDropPosition = useCallback50(
19606
+ const findDropPosition = useCallback52(
18976
19607
  (clientY) => {
18977
19608
  const blocks = getBlockElements();
18978
19609
  if (blocks.length === 0 || !editor?.document) return null;
@@ -19005,7 +19636,7 @@ var ExternalDropZone = ({
19005
19636
  },
19006
19637
  [getBlockElements, editor]
19007
19638
  );
19008
- const handleDragOver = useCallback50(
19639
+ const handleDragOver = useCallback52(
19009
19640
  (e) => {
19010
19641
  if (!e.dataTransfer.types.includes(acceptedType)) return;
19011
19642
  e.preventDefault();
@@ -19028,7 +19659,7 @@ var ExternalDropZone = ({
19028
19659
  },
19029
19660
  [acceptedType, findDropPosition, checkAutoScroll]
19030
19661
  );
19031
- const handleDragLeave = useCallback50(
19662
+ const handleDragLeave = useCallback52(
19032
19663
  (e) => {
19033
19664
  if (containerRef.current && !containerRef.current.contains(e.relatedTarget)) {
19034
19665
  setIsValidDrag(false);
@@ -19038,7 +19669,7 @@ var ExternalDropZone = ({
19038
19669
  },
19039
19670
  [stopAutoScroll]
19040
19671
  );
19041
- const handleDrop = useCallback50(
19672
+ const handleDrop = useCallback52(
19042
19673
  (e) => {
19043
19674
  e.preventDefault();
19044
19675
  e.stopPropagation();
@@ -19052,7 +19683,7 @@ var ExternalDropZone = ({
19052
19683
  },
19053
19684
  [onDrop, stopAutoScroll]
19054
19685
  );
19055
- useEffect53(() => {
19686
+ useEffect55(() => {
19056
19687
  const handleGlobalDragEnd = () => {
19057
19688
  setIsValidDrag(false);
19058
19689
  dropPositionRef.current = null;
@@ -19061,7 +19692,7 @@ var ExternalDropZone = ({
19061
19692
  window.addEventListener("dragend", handleGlobalDragEnd);
19062
19693
  return () => window.removeEventListener("dragend", handleGlobalDragEnd);
19063
19694
  }, [stopAutoScroll]);
19064
- const handleOverlayMouseMove = useCallback50(
19695
+ const handleOverlayMouseMove = useCallback52(
19065
19696
  (e) => {
19066
19697
  setIsHoveringInPlacementMode(true);
19067
19698
  checkAutoScroll(e.clientY);
@@ -19080,12 +19711,12 @@ var ExternalDropZone = ({
19080
19711
  },
19081
19712
  [findDropPosition, checkAutoScroll]
19082
19713
  );
19083
- const handleOverlayMouseLeave = useCallback50(() => {
19714
+ const handleOverlayMouseLeave = useCallback52(() => {
19084
19715
  setIsHoveringInPlacementMode(false);
19085
19716
  dropPositionRef.current = null;
19086
19717
  stopAutoScroll();
19087
19718
  }, [stopAutoScroll]);
19088
- const handleOverlayClick = useCallback50(
19719
+ const handleOverlayClick = useCallback52(
19089
19720
  (e) => {
19090
19721
  e.preventDefault();
19091
19722
  e.stopPropagation();
@@ -19099,7 +19730,7 @@ var ExternalDropZone = ({
19099
19730
  },
19100
19731
  [onDrop, stopAutoScroll]
19101
19732
  );
19102
- const handleOverlayWheel = useCallback50(
19733
+ const handleOverlayWheel = useCallback52(
19103
19734
  (e) => {
19104
19735
  const container = getScrollContainer();
19105
19736
  if (container === window) {
@@ -19110,7 +19741,7 @@ var ExternalDropZone = ({
19110
19741
  },
19111
19742
  [getScrollContainer]
19112
19743
  );
19113
- useEffect53(() => {
19744
+ useEffect55(() => {
19114
19745
  if (!isPlacementMode) return;
19115
19746
  const handleKeyDown = (e) => {
19116
19747
  if (e.key === "Escape") {
@@ -19133,13 +19764,13 @@ var ExternalDropZone = ({
19133
19764
  document.removeEventListener("click", handleGlobalClick, true);
19134
19765
  };
19135
19766
  }, [isPlacementMode, onPlacementCancel]);
19136
- useEffect53(() => {
19767
+ useEffect55(() => {
19137
19768
  if (!isPlacementMode) {
19138
19769
  setIsHoveringInPlacementMode(false);
19139
19770
  dropPositionRef.current = null;
19140
19771
  }
19141
19772
  }, [isPlacementMode]);
19142
- useEffect53(() => {
19773
+ useEffect55(() => {
19143
19774
  const isActive = isValidDrag || isPlacementMode && isHoveringInPlacementMode;
19144
19775
  if (isActive) {
19145
19776
  document.body.classList.add("external-artifact-drag-active");
@@ -19150,19 +19781,19 @@ var ExternalDropZone = ({
19150
19781
  document.body.classList.remove("external-artifact-drag-active");
19151
19782
  };
19152
19783
  }, [isValidDrag, isPlacementMode, isHoveringInPlacementMode]);
19153
- useEffect53(() => {
19784
+ useEffect55(() => {
19154
19785
  return () => {
19155
19786
  if (scrollAnimationRef.current) {
19156
19787
  cancelAnimationFrame(scrollAnimationRef.current);
19157
19788
  }
19158
19789
  };
19159
19790
  }, []);
19160
- const indicatorWithPosition = dropIndicator && React191.isValidElement(dropIndicator) ? React191.cloneElement(dropIndicator, {
19791
+ const indicatorWithPosition = dropIndicator && React198.isValidElement(dropIndicator) ? React198.cloneElement(dropIndicator, {
19161
19792
  indicatorTop: typeof indicatorStyle.top === "number" ? indicatorStyle.top : void 0
19162
19793
  }) : dropIndicator;
19163
19794
  const shouldShowIndicator = isValidDrag || isPlacementMode && isHoveringInPlacementMode;
19164
- return /* @__PURE__ */ React191.createElement(
19165
- Box35,
19795
+ return /* @__PURE__ */ React198.createElement(
19796
+ Box36,
19166
19797
  {
19167
19798
  ref: containerRef,
19168
19799
  style: {
@@ -19177,8 +19808,8 @@ var ExternalDropZone = ({
19177
19808
  "data-placement-mode": isPlacementMode ? "true" : void 0
19178
19809
  },
19179
19810
  children,
19180
- isPlacementMode && /* @__PURE__ */ React191.createElement(
19181
- Box35,
19811
+ isPlacementMode && /* @__PURE__ */ React198.createElement(
19812
+ Box36,
19182
19813
  {
19183
19814
  style: {
19184
19815
  position: "absolute",
@@ -19197,20 +19828,20 @@ var ExternalDropZone = ({
19197
19828
  onWheel: handleOverlayWheel
19198
19829
  }
19199
19830
  ),
19200
- shouldShowIndicator && indicatorWithPosition && /* @__PURE__ */ React191.createElement(Box35, { style: { ...indicatorStyle, background: "none", border: "none", boxShadow: "none" } }, indicatorWithPosition)
19831
+ shouldShowIndicator && indicatorWithPosition && /* @__PURE__ */ React198.createElement(Box36, { style: { ...indicatorStyle, background: "none", border: "none", boxShadow: "none" } }, indicatorWithPosition)
19201
19832
  );
19202
19833
  };
19203
19834
 
19204
19835
  // src/mantine/IxoEditor.tsx
19205
- import React193 from "react";
19836
+ import React200 from "react";
19206
19837
  import { getDefaultReactSlashMenuItems, SuggestionMenuController } from "@blocknote/react";
19207
19838
  import { BlockNoteView } from "@blocknote/mantine";
19208
19839
  import { filterSuggestionItems } from "@blocknote/core";
19209
19840
  import { MantineProvider } from "@mantine/core";
19210
19841
 
19211
19842
  // src/mantine/components/PanelContent.tsx
19212
- import React192 from "react";
19213
- import { Box as Box36 } from "@mantine/core";
19843
+ import React199 from "react";
19844
+ import { Box as Box37 } from "@mantine/core";
19214
19845
  var panelStyles = {
19215
19846
  light: {
19216
19847
  backgroundColor: "#ffffff",
@@ -19239,8 +19870,8 @@ function PanelContent({ theme }) {
19239
19870
  const { activePanel, registeredPanels } = usePanelStore();
19240
19871
  const isOpen = activePanel !== null;
19241
19872
  const content = activePanel ? registeredPanels.get(activePanel) : null;
19242
- return /* @__PURE__ */ React192.createElement(
19243
- Box36,
19873
+ return /* @__PURE__ */ React199.createElement(
19874
+ Box37,
19244
19875
  {
19245
19876
  pos: "sticky",
19246
19877
  right: 0,
@@ -19280,7 +19911,7 @@ function IxoEditorContent({
19280
19911
  }) {
19281
19912
  const { activePanel } = usePanelStore();
19282
19913
  const isPanelOpen = activePanel !== null;
19283
- const editorContent = /* @__PURE__ */ React193.createElement(
19914
+ const editorContent = /* @__PURE__ */ React200.createElement(
19284
19915
  BlockNoteView,
19285
19916
  {
19286
19917
  editor,
@@ -19295,7 +19926,7 @@ function IxoEditorContent({
19295
19926
  onChange,
19296
19927
  onSelectionChange
19297
19928
  },
19298
- config.slashMenu && /* @__PURE__ */ React193.createElement(
19929
+ config.slashMenu && /* @__PURE__ */ React200.createElement(
19299
19930
  SuggestionMenuController,
19300
19931
  {
19301
19932
  triggerCharacter: "/",
@@ -19308,7 +19939,7 @@ function IxoEditorContent({
19308
19939
  ),
19309
19940
  children
19310
19941
  );
19311
- return /* @__PURE__ */ React193.createElement("div", { style: { display: "flex", height: "100%", width: "100%", gap: 0 } }, /* @__PURE__ */ React193.createElement(
19942
+ return /* @__PURE__ */ React200.createElement("div", { style: { display: "flex", height: "100%", width: "100%", gap: 0 } }, /* @__PURE__ */ React200.createElement(
19312
19943
  "div",
19313
19944
  {
19314
19945
  className: `ixo-editor ixo-editor--theme-${config.theme} ${className}`,
@@ -19317,9 +19948,9 @@ function IxoEditorContent({
19317
19948
  transition: "width 0.2s ease"
19318
19949
  }
19319
19950
  },
19320
- selfNav && /* @__PURE__ */ React193.createElement(PageHeader, { ...pageHeaderProps }),
19321
- /* @__PURE__ */ React193.createElement(CoverImage, { coverImageUrl, logoUrl }),
19322
- (onExternalDrop || isPlacementMode) && isEditable ? /* @__PURE__ */ React193.createElement(
19951
+ selfNav && /* @__PURE__ */ React200.createElement(PageHeader, { ...pageHeaderProps }),
19952
+ /* @__PURE__ */ React200.createElement(CoverImage, { coverImageUrl, logoUrl }),
19953
+ (onExternalDrop || isPlacementMode) && isEditable ? /* @__PURE__ */ React200.createElement(
19323
19954
  ExternalDropZone,
19324
19955
  {
19325
19956
  editor,
@@ -19332,7 +19963,7 @@ function IxoEditorContent({
19332
19963
  },
19333
19964
  editorContent
19334
19965
  ) : editorContent
19335
- ), isPanelVisible && /* @__PURE__ */ React193.createElement(PanelContent, { theme: config.theme }));
19966
+ ), isPanelVisible && /* @__PURE__ */ React200.createElement(PanelContent, { theme: config.theme }));
19336
19967
  }
19337
19968
  function IxoEditor({
19338
19969
  editor,
@@ -19352,6 +19983,7 @@ function IxoEditor({
19352
19983
  visualizationRenderer,
19353
19984
  getDynamicListData,
19354
19985
  dynamicListPanelRenderer,
19986
+ domainCardRenderer,
19355
19987
  onExternalDrop,
19356
19988
  externalDropType,
19357
19989
  dropIndicator,
@@ -19371,7 +20003,7 @@ function IxoEditor({
19371
20003
  tableHandles: true
19372
20004
  };
19373
20005
  const isEditable = editable;
19374
- const editorContent = /* @__PURE__ */ React193.createElement(
20006
+ const editorContent = /* @__PURE__ */ React200.createElement(
19375
20007
  BlocknoteProvider,
19376
20008
  {
19377
20009
  editor,
@@ -19380,9 +20012,10 @@ function IxoEditor({
19380
20012
  editable: isEditable,
19381
20013
  visualizationRenderer,
19382
20014
  getDynamicListData,
19383
- dynamicListPanelRenderer
20015
+ dynamicListPanelRenderer,
20016
+ domainCardRenderer
19384
20017
  },
19385
- /* @__PURE__ */ React193.createElement(
20018
+ /* @__PURE__ */ React200.createElement(
19386
20019
  IxoEditorContent,
19387
20020
  {
19388
20021
  isPanelVisible,
@@ -19406,15 +20039,15 @@ function IxoEditor({
19406
20039
  )
19407
20040
  );
19408
20041
  if (mantineTheme) {
19409
- return /* @__PURE__ */ React193.createElement(MantineProvider, { theme: mantineTheme }, editorContent);
20042
+ return /* @__PURE__ */ React200.createElement(MantineProvider, { theme: mantineTheme }, editorContent);
19410
20043
  }
19411
20044
  return editorContent;
19412
20045
  }
19413
20046
 
19414
20047
  // src/mantine/components/EntitySigningSetup.tsx
19415
- import React194, { useState as useState70 } from "react";
19416
- import { Modal as Modal3, Stack as Stack123, Text as Text97, TextInput as TextInput6, Button as Button35, Alert as Alert25, Group as Group61 } from "@mantine/core";
19417
- import { IconAlertCircle as IconAlertCircle12, IconCheck as IconCheck6, IconKey as IconKey2 } from "@tabler/icons-react";
20048
+ import React201, { useState as useState72 } from "react";
20049
+ import { Modal as Modal3, Stack as Stack126, Text as Text100, TextInput as TextInput6, Button as Button36, Alert as Alert26, Group as Group63 } from "@mantine/core";
20050
+ import { IconAlertCircle as IconAlertCircle13, IconCheck as IconCheck7, IconKey as IconKey2 } from "@tabler/icons-react";
19418
20051
  var EntitySigningSetup = ({
19419
20052
  opened,
19420
20053
  onClose,
@@ -19422,11 +20055,11 @@ var EntitySigningSetup = ({
19422
20055
  entityName,
19423
20056
  onSetup
19424
20057
  }) => {
19425
- const [pin, setPin] = useState70("");
19426
- const [confirmPin, setConfirmPin] = useState70("");
19427
- const [loading, setLoading] = useState70(false);
19428
- const [error, setError] = useState70(null);
19429
- const [success, setSuccess] = useState70(false);
20058
+ const [pin, setPin] = useState72("");
20059
+ const [confirmPin, setConfirmPin] = useState72("");
20060
+ const [loading, setLoading] = useState72(false);
20061
+ const [error, setError] = useState72(null);
20062
+ const [success, setSuccess] = useState72(false);
19430
20063
  const handleSetup = async () => {
19431
20064
  if (pin.length < 4) {
19432
20065
  setError("PIN must be at least 4 characters");
@@ -19466,15 +20099,15 @@ var EntitySigningSetup = ({
19466
20099
  setSuccess(false);
19467
20100
  }
19468
20101
  };
19469
- return /* @__PURE__ */ React194.createElement(
20102
+ return /* @__PURE__ */ React201.createElement(
19470
20103
  Modal3,
19471
20104
  {
19472
20105
  opened,
19473
20106
  onClose: handleClose,
19474
- title: /* @__PURE__ */ React194.createElement(Group61, { gap: "xs" }, /* @__PURE__ */ React194.createElement(IconKey2, { size: 20 }), /* @__PURE__ */ React194.createElement(Text97, { fw: 600 }, "Entity Signing Setup")),
20107
+ title: /* @__PURE__ */ React201.createElement(Group63, { gap: "xs" }, /* @__PURE__ */ React201.createElement(IconKey2, { size: 20 }), /* @__PURE__ */ React201.createElement(Text100, { fw: 600 }, "Entity Signing Setup")),
19475
20108
  size: "md"
19476
20109
  },
19477
- /* @__PURE__ */ React194.createElement(Stack123, { gap: "md" }, success ? /* @__PURE__ */ React194.createElement(Alert25, { color: "green", icon: /* @__PURE__ */ React194.createElement(IconCheck6, { size: 16 }) }, "Entity signing key set up successfully!") : /* @__PURE__ */ React194.createElement(React194.Fragment, null, /* @__PURE__ */ React194.createElement(Text97, { size: "sm", c: "dimmed" }, "Flow authorization requires a signing key for", " ", /* @__PURE__ */ React194.createElement(Text97, { span: true, fw: 500 }, entityName || entityDid), "."), /* @__PURE__ */ React194.createElement(Alert25, { color: "blue", variant: "light" }, /* @__PURE__ */ React194.createElement(Text97, { size: "sm" }, "This is a ", /* @__PURE__ */ React194.createElement("strong", null, "one-time setup"), " that allows flows to grant permissions without requiring wallet signatures for each delegation.")), /* @__PURE__ */ React194.createElement(Stack123, { gap: "xs" }, /* @__PURE__ */ React194.createElement(Text97, { size: "sm", fw: 500 }, "What happens:"), /* @__PURE__ */ React194.createElement(Text97, { size: "sm", c: "dimmed" }, "1. A new signing key is generated"), /* @__PURE__ */ React194.createElement(Text97, { size: "sm", c: "dimmed" }, "2. Key is registered on the entity's DID document (requires wallet)"), /* @__PURE__ */ React194.createElement(Text97, { size: "sm", c: "dimmed" }, "3. Key is stored encrypted in the entity's Matrix room")), /* @__PURE__ */ React194.createElement(
20110
+ /* @__PURE__ */ React201.createElement(Stack126, { gap: "md" }, success ? /* @__PURE__ */ React201.createElement(Alert26, { color: "green", icon: /* @__PURE__ */ React201.createElement(IconCheck7, { size: 16 }) }, "Entity signing key set up successfully!") : /* @__PURE__ */ React201.createElement(React201.Fragment, null, /* @__PURE__ */ React201.createElement(Text100, { size: "sm", c: "dimmed" }, "Flow authorization requires a signing key for", " ", /* @__PURE__ */ React201.createElement(Text100, { span: true, fw: 500 }, entityName || entityDid), "."), /* @__PURE__ */ React201.createElement(Alert26, { color: "blue", variant: "light" }, /* @__PURE__ */ React201.createElement(Text100, { size: "sm" }, "This is a ", /* @__PURE__ */ React201.createElement("strong", null, "one-time setup"), " that allows flows to grant permissions without requiring wallet signatures for each delegation.")), /* @__PURE__ */ React201.createElement(Stack126, { gap: "xs" }, /* @__PURE__ */ React201.createElement(Text100, { size: "sm", fw: 500 }, "What happens:"), /* @__PURE__ */ React201.createElement(Text100, { size: "sm", c: "dimmed" }, "1. A new signing key is generated"), /* @__PURE__ */ React201.createElement(Text100, { size: "sm", c: "dimmed" }, "2. Key is registered on the entity's DID document (requires wallet)"), /* @__PURE__ */ React201.createElement(Text100, { size: "sm", c: "dimmed" }, "3. Key is stored encrypted in the entity's Matrix room")), /* @__PURE__ */ React201.createElement(
19478
20111
  TextInput6,
19479
20112
  {
19480
20113
  label: "Enter PIN to encrypt signing key",
@@ -19485,7 +20118,7 @@ var EntitySigningSetup = ({
19485
20118
  onChange: (e) => setPin(e.currentTarget.value),
19486
20119
  disabled: loading
19487
20120
  }
19488
- ), /* @__PURE__ */ React194.createElement(
20121
+ ), /* @__PURE__ */ React201.createElement(
19489
20122
  TextInput6,
19490
20123
  {
19491
20124
  label: "Confirm PIN",
@@ -19495,12 +20128,12 @@ var EntitySigningSetup = ({
19495
20128
  onChange: (e) => setConfirmPin(e.currentTarget.value),
19496
20129
  disabled: loading
19497
20130
  }
19498
- ), error && /* @__PURE__ */ React194.createElement(Alert25, { color: "red", icon: /* @__PURE__ */ React194.createElement(IconAlertCircle12, { size: 16 }) }, error), /* @__PURE__ */ React194.createElement(Group61, { justify: "flex-end", mt: "md" }, /* @__PURE__ */ React194.createElement(Button35, { variant: "subtle", onClick: handleClose, disabled: loading }, "Cancel"), /* @__PURE__ */ React194.createElement(
19499
- Button35,
20131
+ ), error && /* @__PURE__ */ React201.createElement(Alert26, { color: "red", icon: /* @__PURE__ */ React201.createElement(IconAlertCircle13, { size: 16 }) }, error), /* @__PURE__ */ React201.createElement(Group63, { justify: "flex-end", mt: "md" }, /* @__PURE__ */ React201.createElement(Button36, { variant: "subtle", onClick: handleClose, disabled: loading }, "Cancel"), /* @__PURE__ */ React201.createElement(
20132
+ Button36,
19500
20133
  {
19501
20134
  onClick: handleSetup,
19502
20135
  loading,
19503
- leftSection: /* @__PURE__ */ React194.createElement(IconKey2, { size: 16 })
20136
+ leftSection: /* @__PURE__ */ React201.createElement(IconKey2, { size: 16 })
19504
20137
  },
19505
20138
  "Setup Entity Signing"
19506
20139
  ))))
@@ -19508,8 +20141,8 @@ var EntitySigningSetup = ({
19508
20141
  };
19509
20142
 
19510
20143
  // src/mantine/components/FlowPermissionsPanel.tsx
19511
- import React195, { useState as useState71, useEffect as useEffect54, useMemo as useMemo62 } from "react";
19512
- import { Stack as Stack124, Text as Text98, Paper as Paper19, Group as Group62, Badge as Badge29, Button as Button36, ActionIcon as ActionIcon28, Loader as Loader25, Alert as Alert26, Divider as Divider12 } from "@mantine/core";
20144
+ import React202, { useState as useState73, useEffect as useEffect56, useMemo as useMemo65 } from "react";
20145
+ import { Stack as Stack127, Text as Text101, Paper as Paper21, Group as Group64, Badge as Badge31, Button as Button37, ActionIcon as ActionIcon29, Loader as Loader26, Alert as Alert27, Divider as Divider12 } from "@mantine/core";
19513
20146
  import { IconPlus as IconPlus5, IconTrash as IconTrash6, IconShieldCheck as IconShieldCheck2, IconUser as IconUser4, IconRobot as IconRobot3, IconBuilding } from "@tabler/icons-react";
19514
20147
  var FlowPermissionsPanel = ({
19515
20148
  editor,
@@ -19519,11 +20152,11 @@ var FlowPermissionsPanel = ({
19519
20152
  onRevokePermission,
19520
20153
  getUserDisplayName
19521
20154
  }) => {
19522
- const [delegations, setDelegations] = useState71([]);
19523
- const [loading, setLoading] = useState71(true);
19524
- const [revoking, setRevoking] = useState71(null);
19525
- const rootCapability = useMemo62(() => editor.getRootCapability?.(), [editor]);
19526
- useEffect54(() => {
20155
+ const [delegations, setDelegations] = useState73([]);
20156
+ const [loading, setLoading] = useState73(true);
20157
+ const [revoking, setRevoking] = useState73(null);
20158
+ const rootCapability = useMemo65(() => editor.getRootCapability?.(), [editor]);
20159
+ useEffect56(() => {
19527
20160
  const loadDelegations = async () => {
19528
20161
  setLoading(true);
19529
20162
  const allDelegations = editor.getAllDelegations?.() || [];
@@ -19562,11 +20195,11 @@ var FlowPermissionsPanel = ({
19562
20195
  const getIcon2 = (type) => {
19563
20196
  switch (type) {
19564
20197
  case "oracle":
19565
- return /* @__PURE__ */ React195.createElement(IconRobot3, { size: 16 });
20198
+ return /* @__PURE__ */ React202.createElement(IconRobot3, { size: 16 });
19566
20199
  case "entity":
19567
- return /* @__PURE__ */ React195.createElement(IconBuilding, { size: 16 });
20200
+ return /* @__PURE__ */ React202.createElement(IconBuilding, { size: 16 });
19568
20201
  default:
19569
- return /* @__PURE__ */ React195.createElement(IconUser4, { size: 16 });
20202
+ return /* @__PURE__ */ React202.createElement(IconUser4, { size: 16 });
19570
20203
  }
19571
20204
  };
19572
20205
  const formatCapabilities = (caps) => {
@@ -19585,8 +20218,8 @@ var FlowPermissionsPanel = ({
19585
20218
  if (date < /* @__PURE__ */ new Date()) return "Expired";
19586
20219
  return date.toLocaleDateString();
19587
20220
  };
19588
- return /* @__PURE__ */ React195.createElement(Stack124, { gap: "md" }, /* @__PURE__ */ React195.createElement(Stack124, { gap: "xs" }, /* @__PURE__ */ React195.createElement(Text98, { fw: 600, size: "sm" }, "Root Authority"), /* @__PURE__ */ React195.createElement(Paper19, { p: "sm", withBorder: true }, /* @__PURE__ */ React195.createElement(Group62, { gap: "xs" }, /* @__PURE__ */ React195.createElement(IconShieldCheck2, { size: 20, color: "var(--mantine-color-green-6)" }), /* @__PURE__ */ React195.createElement(Stack124, { gap: 2, style: { flex: 1 } }, /* @__PURE__ */ React195.createElement(Text98, { size: "sm", fw: 500 }, entityName || entityDid), /* @__PURE__ */ React195.createElement(Text98, { size: "xs", c: "dimmed" }, rootCapability ? `Granted: ${new Date(rootCapability.issuedAt).toLocaleDateString()}` : "Root capability not set up")), /* @__PURE__ */ React195.createElement(Badge29, { color: "green", variant: "light" }, "Entity")))), /* @__PURE__ */ React195.createElement(Divider12, { label: "Delegated Permissions", labelPosition: "center" }), loading ? /* @__PURE__ */ React195.createElement(Group62, { justify: "center", py: "xl" }, /* @__PURE__ */ React195.createElement(Loader25, { size: "sm" })) : delegations.length === 0 ? /* @__PURE__ */ React195.createElement(Alert26, { color: "gray", variant: "light" }, /* @__PURE__ */ React195.createElement(Text98, { size: "sm" }, "No permissions have been granted yet.")) : /* @__PURE__ */ React195.createElement(Stack124, { gap: "xs" }, delegations.map(({ capability, displayName, type }) => /* @__PURE__ */ React195.createElement(Paper19, { key: capability.id, p: "sm", withBorder: true }, /* @__PURE__ */ React195.createElement(Group62, { justify: "space-between" }, /* @__PURE__ */ React195.createElement(Group62, { gap: "xs" }, getIcon2(type), /* @__PURE__ */ React195.createElement(Stack124, { gap: 2 }, /* @__PURE__ */ React195.createElement(Text98, { size: "sm", fw: 500 }, displayName), /* @__PURE__ */ React195.createElement(Text98, { size: "xs", c: "dimmed" }, formatCapabilities(capability.capabilities)), /* @__PURE__ */ React195.createElement(Group62, { gap: "xs" }, /* @__PURE__ */ React195.createElement(Text98, { size: "xs", c: "dimmed" }, "Expires: ", formatExpiration(capability.expiration)), /* @__PURE__ */ React195.createElement(Text98, { size: "xs", c: "dimmed" }, "\u2022"), /* @__PURE__ */ React195.createElement(Text98, { size: "xs", c: "dimmed" }, "Granted by: ", capability.issuer === entityDid ? "Entity" : capability.issuer.slice(-8))))), /* @__PURE__ */ React195.createElement(
19589
- ActionIcon28,
20221
+ return /* @__PURE__ */ React202.createElement(Stack127, { gap: "md" }, /* @__PURE__ */ React202.createElement(Stack127, { gap: "xs" }, /* @__PURE__ */ React202.createElement(Text101, { fw: 600, size: "sm" }, "Root Authority"), /* @__PURE__ */ React202.createElement(Paper21, { p: "sm", withBorder: true }, /* @__PURE__ */ React202.createElement(Group64, { gap: "xs" }, /* @__PURE__ */ React202.createElement(IconShieldCheck2, { size: 20, color: "var(--mantine-color-green-6)" }), /* @__PURE__ */ React202.createElement(Stack127, { gap: 2, style: { flex: 1 } }, /* @__PURE__ */ React202.createElement(Text101, { size: "sm", fw: 500 }, entityName || entityDid), /* @__PURE__ */ React202.createElement(Text101, { size: "xs", c: "dimmed" }, rootCapability ? `Granted: ${new Date(rootCapability.issuedAt).toLocaleDateString()}` : "Root capability not set up")), /* @__PURE__ */ React202.createElement(Badge31, { color: "green", variant: "light" }, "Entity")))), /* @__PURE__ */ React202.createElement(Divider12, { label: "Delegated Permissions", labelPosition: "center" }), loading ? /* @__PURE__ */ React202.createElement(Group64, { justify: "center", py: "xl" }, /* @__PURE__ */ React202.createElement(Loader26, { size: "sm" })) : delegations.length === 0 ? /* @__PURE__ */ React202.createElement(Alert27, { color: "gray", variant: "light" }, /* @__PURE__ */ React202.createElement(Text101, { size: "sm" }, "No permissions have been granted yet.")) : /* @__PURE__ */ React202.createElement(Stack127, { gap: "xs" }, delegations.map(({ capability, displayName, type }) => /* @__PURE__ */ React202.createElement(Paper21, { key: capability.id, p: "sm", withBorder: true }, /* @__PURE__ */ React202.createElement(Group64, { justify: "space-between" }, /* @__PURE__ */ React202.createElement(Group64, { gap: "xs" }, getIcon2(type), /* @__PURE__ */ React202.createElement(Stack127, { gap: 2 }, /* @__PURE__ */ React202.createElement(Text101, { size: "sm", fw: 500 }, displayName), /* @__PURE__ */ React202.createElement(Text101, { size: "xs", c: "dimmed" }, formatCapabilities(capability.capabilities)), /* @__PURE__ */ React202.createElement(Group64, { gap: "xs" }, /* @__PURE__ */ React202.createElement(Text101, { size: "xs", c: "dimmed" }, "Expires: ", formatExpiration(capability.expiration)), /* @__PURE__ */ React202.createElement(Text101, { size: "xs", c: "dimmed" }, "\u2022"), /* @__PURE__ */ React202.createElement(Text101, { size: "xs", c: "dimmed" }, "Granted by: ", capability.issuer === entityDid ? "Entity" : capability.issuer.slice(-8))))), /* @__PURE__ */ React202.createElement(
20222
+ ActionIcon29,
19590
20223
  {
19591
20224
  color: "red",
19592
20225
  variant: "subtle",
@@ -19594,11 +20227,11 @@ var FlowPermissionsPanel = ({
19594
20227
  loading: revoking === capability.id,
19595
20228
  disabled: !!revoking
19596
20229
  },
19597
- /* @__PURE__ */ React195.createElement(IconTrash6, { size: 16 })
19598
- ))))), /* @__PURE__ */ React195.createElement(
19599
- Button36,
20230
+ /* @__PURE__ */ React202.createElement(IconTrash6, { size: 16 })
20231
+ ))))), /* @__PURE__ */ React202.createElement(
20232
+ Button37,
19600
20233
  {
19601
- leftSection: /* @__PURE__ */ React195.createElement(IconPlus5, { size: 16 }),
20234
+ leftSection: /* @__PURE__ */ React202.createElement(IconPlus5, { size: 16 }),
19602
20235
  variant: "light",
19603
20236
  onClick: onGrantPermission
19604
20237
  },
@@ -19607,21 +20240,21 @@ var FlowPermissionsPanel = ({
19607
20240
  };
19608
20241
 
19609
20242
  // src/mantine/components/GrantPermissionModal.tsx
19610
- import React196, { useState as useState72, useCallback as useCallback51 } from "react";
20243
+ import React203, { useState as useState74, useCallback as useCallback53 } from "react";
19611
20244
  import {
19612
20245
  Modal as Modal4,
19613
- Stack as Stack125,
19614
- Text as Text99,
20246
+ Stack as Stack128,
20247
+ Text as Text102,
19615
20248
  TextInput as TextInput7,
19616
- Button as Button37,
19617
- Group as Group63,
20249
+ Button as Button38,
20250
+ Group as Group65,
19618
20251
  Radio as Radio6,
19619
20252
  Checkbox as Checkbox12,
19620
- Alert as Alert27,
19621
- Paper as Paper20,
19622
- Loader as Loader26,
19623
- Badge as Badge30,
19624
- ActionIcon as ActionIcon29,
20253
+ Alert as Alert28,
20254
+ Paper as Paper22,
20255
+ Loader as Loader27,
20256
+ Badge as Badge32,
20257
+ ActionIcon as ActionIcon30,
19625
20258
  Divider as Divider13,
19626
20259
  NumberInput as NumberInput3
19627
20260
  } from "@mantine/core";
@@ -19639,21 +20272,21 @@ var GrantPermissionModal = ({
19639
20272
  const singleBlockMode = !!targetBlockId || blocks.length === 1;
19640
20273
  const fixedBlockId = targetBlockId || (blocks.length === 1 ? blocks[0].id : null);
19641
20274
  const fixedBlock = fixedBlockId ? blocks.find((b) => b.id === fixedBlockId) || blocks[0] : null;
19642
- const [recipientType, setRecipientType] = useState72("user");
19643
- const [searchQuery, setSearchQuery] = useState72("");
19644
- const [searchResults, setSearchResults] = useState72([]);
19645
- const [searching, setSearching] = useState72(false);
19646
- const [selectedRecipient, setSelectedRecipient] = useState72(null);
19647
- const [manualDid, setManualDid] = useState72("");
19648
- const [scopeType, setScopeType] = useState72("full");
19649
- const [selectedBlocks, setSelectedBlocks] = useState72([]);
19650
- const [expirationEnabled, setExpirationEnabled] = useState72(false);
19651
- const [expirationDays, setExpirationDays] = useState72(30);
19652
- const [canDelegate, setCanDelegate] = useState72(false);
19653
- const [pin, setPin] = useState72("");
19654
- const [loading, setLoading] = useState72(false);
19655
- const [error, setError] = useState72(null);
19656
- const handleSearch = useCallback51(async () => {
20275
+ const [recipientType, setRecipientType] = useState74("user");
20276
+ const [searchQuery, setSearchQuery] = useState74("");
20277
+ const [searchResults, setSearchResults] = useState74([]);
20278
+ const [searching, setSearching] = useState74(false);
20279
+ const [selectedRecipient, setSelectedRecipient] = useState74(null);
20280
+ const [manualDid, setManualDid] = useState74("");
20281
+ const [scopeType, setScopeType] = useState74("full");
20282
+ const [selectedBlocks, setSelectedBlocks] = useState74([]);
20283
+ const [expirationEnabled, setExpirationEnabled] = useState74(false);
20284
+ const [expirationDays, setExpirationDays] = useState74(30);
20285
+ const [canDelegate, setCanDelegate] = useState74(false);
20286
+ const [pin, setPin] = useState74("");
20287
+ const [loading, setLoading] = useState74(false);
20288
+ const [error, setError] = useState74(null);
20289
+ const handleSearch = useCallback53(async () => {
19657
20290
  if (searchQuery.length < 2) return;
19658
20291
  setSearching(true);
19659
20292
  try {
@@ -19740,30 +20373,30 @@ var GrantPermissionModal = ({
19740
20373
  resetForm();
19741
20374
  }
19742
20375
  };
19743
- return /* @__PURE__ */ React196.createElement(
20376
+ return /* @__PURE__ */ React203.createElement(
19744
20377
  Modal4,
19745
20378
  {
19746
20379
  opened,
19747
20380
  onClose: handleClose,
19748
- title: /* @__PURE__ */ React196.createElement(Group63, { gap: "xs" }, /* @__PURE__ */ React196.createElement(IconShieldPlus3, { size: 20 }), /* @__PURE__ */ React196.createElement(Text99, { fw: 600 }, "Grant Permission")),
20381
+ title: /* @__PURE__ */ React203.createElement(Group65, { gap: "xs" }, /* @__PURE__ */ React203.createElement(IconShieldPlus3, { size: 20 }), /* @__PURE__ */ React203.createElement(Text102, { fw: 600 }, "Grant Permission")),
19749
20382
  size: "lg"
19750
20383
  },
19751
- /* @__PURE__ */ React196.createElement(Stack125, { gap: "md" }, /* @__PURE__ */ React196.createElement(Stack125, { gap: "xs" }, /* @__PURE__ */ React196.createElement(Text99, { size: "sm", fw: 500 }, "Recipient Type"), /* @__PURE__ */ React196.createElement(Radio6.Group, { value: recipientType, onChange: (v) => {
20384
+ /* @__PURE__ */ React203.createElement(Stack128, { gap: "md" }, /* @__PURE__ */ React203.createElement(Stack128, { gap: "xs" }, /* @__PURE__ */ React203.createElement(Text102, { size: "sm", fw: 500 }, "Recipient Type"), /* @__PURE__ */ React203.createElement(Radio6.Group, { value: recipientType, onChange: (v) => {
19752
20385
  setRecipientType(v);
19753
20386
  setSelectedRecipient(null);
19754
20387
  setSearchResults([]);
19755
- } }, /* @__PURE__ */ React196.createElement(Group63, null, /* @__PURE__ */ React196.createElement(Radio6, { value: "user", label: "User" }), /* @__PURE__ */ React196.createElement(Radio6, { value: "oracle", label: "Oracle" }), /* @__PURE__ */ React196.createElement(Radio6, { value: "manual", label: "Enter DID" })))), recipientType !== "manual" ? /* @__PURE__ */ React196.createElement(Stack125, { gap: "xs" }, /* @__PURE__ */ React196.createElement(
20388
+ } }, /* @__PURE__ */ React203.createElement(Group65, null, /* @__PURE__ */ React203.createElement(Radio6, { value: "user", label: "User" }), /* @__PURE__ */ React203.createElement(Radio6, { value: "oracle", label: "Oracle" }), /* @__PURE__ */ React203.createElement(Radio6, { value: "manual", label: "Enter DID" })))), recipientType !== "manual" ? /* @__PURE__ */ React203.createElement(Stack128, { gap: "xs" }, /* @__PURE__ */ React203.createElement(
19756
20389
  TextInput7,
19757
20390
  {
19758
20391
  placeholder: recipientType === "oracle" ? "Search oracles..." : "Search users...",
19759
- leftSection: /* @__PURE__ */ React196.createElement(IconSearch5, { size: 16 }),
19760
- rightSection: searching ? /* @__PURE__ */ React196.createElement(Loader26, { size: 14 }) : null,
20392
+ leftSection: /* @__PURE__ */ React203.createElement(IconSearch5, { size: 16 }),
20393
+ rightSection: searching ? /* @__PURE__ */ React203.createElement(Loader27, { size: 14 }) : null,
19761
20394
  value: searchQuery,
19762
20395
  onChange: (e) => setSearchQuery(e.currentTarget.value),
19763
20396
  onKeyDown: (e) => e.key === "Enter" && handleSearch()
19764
20397
  }
19765
- ), selectedRecipient ? /* @__PURE__ */ React196.createElement(Paper20, { p: "sm", withBorder: true }, /* @__PURE__ */ React196.createElement(Group63, { justify: "space-between" }, /* @__PURE__ */ React196.createElement(Group63, { gap: "xs" }, recipientType === "oracle" ? /* @__PURE__ */ React196.createElement(IconRobot4, { size: 16 }) : /* @__PURE__ */ React196.createElement(IconUser5, { size: 16 }), /* @__PURE__ */ React196.createElement(Text99, { size: "sm" }, selectedRecipient.displayName), /* @__PURE__ */ React196.createElement(Badge30, { size: "xs", variant: "light" }, selectedRecipient.did.slice(-12))), /* @__PURE__ */ React196.createElement(ActionIcon29, { size: "sm", variant: "subtle", onClick: () => setSelectedRecipient(null) }, /* @__PURE__ */ React196.createElement(IconX8, { size: 14 })))) : searchResults.length > 0 ? /* @__PURE__ */ React196.createElement(Paper20, { p: "xs", withBorder: true, style: { maxHeight: 150, overflow: "auto" } }, /* @__PURE__ */ React196.createElement(Stack125, { gap: 4 }, searchResults.map((result) => /* @__PURE__ */ React196.createElement(
19766
- Button37,
20398
+ ), selectedRecipient ? /* @__PURE__ */ React203.createElement(Paper22, { p: "sm", withBorder: true }, /* @__PURE__ */ React203.createElement(Group65, { justify: "space-between" }, /* @__PURE__ */ React203.createElement(Group65, { gap: "xs" }, recipientType === "oracle" ? /* @__PURE__ */ React203.createElement(IconRobot4, { size: 16 }) : /* @__PURE__ */ React203.createElement(IconUser5, { size: 16 }), /* @__PURE__ */ React203.createElement(Text102, { size: "sm" }, selectedRecipient.displayName), /* @__PURE__ */ React203.createElement(Badge32, { size: "xs", variant: "light" }, selectedRecipient.did.slice(-12))), /* @__PURE__ */ React203.createElement(ActionIcon30, { size: "sm", variant: "subtle", onClick: () => setSelectedRecipient(null) }, /* @__PURE__ */ React203.createElement(IconX8, { size: 14 })))) : searchResults.length > 0 ? /* @__PURE__ */ React203.createElement(Paper22, { p: "xs", withBorder: true, style: { maxHeight: 150, overflow: "auto" } }, /* @__PURE__ */ React203.createElement(Stack128, { gap: 4 }, searchResults.map((result) => /* @__PURE__ */ React203.createElement(
20399
+ Button38,
19767
20400
  {
19768
20401
  key: result.did,
19769
20402
  variant: "subtle",
@@ -19772,7 +20405,7 @@ var GrantPermissionModal = ({
19772
20405
  onClick: () => setSelectedRecipient(result)
19773
20406
  },
19774
20407
  result.displayName
19775
- )))) : null) : /* @__PURE__ */ React196.createElement(
20408
+ )))) : null) : /* @__PURE__ */ React203.createElement(
19776
20409
  TextInput7,
19777
20410
  {
19778
20411
  label: "Recipient DID",
@@ -19780,12 +20413,12 @@ var GrantPermissionModal = ({
19780
20413
  value: manualDid,
19781
20414
  onChange: (e) => setManualDid(e.currentTarget.value)
19782
20415
  }
19783
- ), /* @__PURE__ */ React196.createElement(Divider13, null), /* @__PURE__ */ React196.createElement(Stack125, { gap: "xs" }, /* @__PURE__ */ React196.createElement(Text99, { size: "sm", fw: 500 }, "Permission Scope"), singleBlockMode && fixedBlock ? (
20416
+ ), /* @__PURE__ */ React203.createElement(Divider13, null), /* @__PURE__ */ React203.createElement(Stack128, { gap: "xs" }, /* @__PURE__ */ React203.createElement(Text102, { size: "sm", fw: 500 }, "Permission Scope"), singleBlockMode && fixedBlock ? (
19784
20417
  // Single block mode: show fixed block info
19785
- /* @__PURE__ */ React196.createElement(Paper20, { p: "sm", withBorder: true }, /* @__PURE__ */ React196.createElement(Group63, { gap: "xs" }, /* @__PURE__ */ React196.createElement(Badge30, { variant: "light", color: "blue" }, fixedBlock.type), /* @__PURE__ */ React196.createElement(Text99, { size: "sm" }, fixedBlock.name || `Block ${fixedBlock.id.slice(-8)}`)), /* @__PURE__ */ React196.createElement(Text99, { size: "xs", c: "dimmed", mt: "xs" }, "Permission will be granted to execute this specific block."))
20418
+ /* @__PURE__ */ React203.createElement(Paper22, { p: "sm", withBorder: true }, /* @__PURE__ */ React203.createElement(Group65, { gap: "xs" }, /* @__PURE__ */ React203.createElement(Badge32, { variant: "light", color: "blue" }, fixedBlock.type), /* @__PURE__ */ React203.createElement(Text102, { size: "sm" }, fixedBlock.name || `Block ${fixedBlock.id.slice(-8)}`)), /* @__PURE__ */ React203.createElement(Text102, { size: "xs", c: "dimmed", mt: "xs" }, "Permission will be granted to execute this specific block."))
19786
20419
  ) : (
19787
20420
  // Multi-block mode: show scope selection
19788
- /* @__PURE__ */ React196.createElement(React196.Fragment, null, /* @__PURE__ */ React196.createElement(Radio6.Group, { value: scopeType, onChange: (v) => setScopeType(v) }, /* @__PURE__ */ React196.createElement(Stack125, { gap: "xs" }, /* @__PURE__ */ React196.createElement(Radio6, { value: "full", label: "Full flow access (can execute any block)" }), /* @__PURE__ */ React196.createElement(Radio6, { value: "blocks", label: "Specific blocks only" }))), scopeType === "blocks" && /* @__PURE__ */ React196.createElement(Paper20, { p: "sm", withBorder: true, style: { maxHeight: 150, overflow: "auto" } }, /* @__PURE__ */ React196.createElement(Stack125, { gap: "xs" }, blocks.map((block) => /* @__PURE__ */ React196.createElement(
20421
+ /* @__PURE__ */ React203.createElement(React203.Fragment, null, /* @__PURE__ */ React203.createElement(Radio6.Group, { value: scopeType, onChange: (v) => setScopeType(v) }, /* @__PURE__ */ React203.createElement(Stack128, { gap: "xs" }, /* @__PURE__ */ React203.createElement(Radio6, { value: "full", label: "Full flow access (can execute any block)" }), /* @__PURE__ */ React203.createElement(Radio6, { value: "blocks", label: "Specific blocks only" }))), scopeType === "blocks" && /* @__PURE__ */ React203.createElement(Paper22, { p: "sm", withBorder: true, style: { maxHeight: 150, overflow: "auto" } }, /* @__PURE__ */ React203.createElement(Stack128, { gap: "xs" }, blocks.map((block) => /* @__PURE__ */ React203.createElement(
19789
20422
  Checkbox12,
19790
20423
  {
19791
20424
  key: block.id,
@@ -19800,14 +20433,14 @@ var GrantPermissionModal = ({
19800
20433
  }
19801
20434
  }
19802
20435
  )))))
19803
- )), /* @__PURE__ */ React196.createElement(Divider13, null), /* @__PURE__ */ React196.createElement(Stack125, { gap: "xs" }, /* @__PURE__ */ React196.createElement(
20436
+ )), /* @__PURE__ */ React203.createElement(Divider13, null), /* @__PURE__ */ React203.createElement(Stack128, { gap: "xs" }, /* @__PURE__ */ React203.createElement(
19804
20437
  Checkbox12,
19805
20438
  {
19806
20439
  label: "Set expiration",
19807
20440
  checked: expirationEnabled,
19808
20441
  onChange: (e) => setExpirationEnabled(e.currentTarget.checked)
19809
20442
  }
19810
- ), expirationEnabled && /* @__PURE__ */ React196.createElement(
20443
+ ), expirationEnabled && /* @__PURE__ */ React203.createElement(
19811
20444
  NumberInput3,
19812
20445
  {
19813
20446
  label: "Expires in (days)",
@@ -19817,7 +20450,7 @@ var GrantPermissionModal = ({
19817
20450
  min: 1,
19818
20451
  max: 365
19819
20452
  }
19820
- )), /* @__PURE__ */ React196.createElement(
20453
+ )), /* @__PURE__ */ React203.createElement(
19821
20454
  Checkbox12,
19822
20455
  {
19823
20456
  label: "Recipient can grant permissions to others",
@@ -19825,7 +20458,7 @@ var GrantPermissionModal = ({
19825
20458
  checked: canDelegate,
19826
20459
  onChange: (e) => setCanDelegate(e.currentTarget.checked)
19827
20460
  }
19828
- ), /* @__PURE__ */ React196.createElement(Divider13, null), /* @__PURE__ */ React196.createElement(
20461
+ ), /* @__PURE__ */ React203.createElement(Divider13, null), /* @__PURE__ */ React203.createElement(
19829
20462
  TextInput7,
19830
20463
  {
19831
20464
  label: "Enter your PIN to sign this delegation",
@@ -19834,7 +20467,7 @@ var GrantPermissionModal = ({
19834
20467
  value: pin,
19835
20468
  onChange: (e) => setPin(e.currentTarget.value)
19836
20469
  }
19837
- ), error && /* @__PURE__ */ React196.createElement(Alert27, { color: "red" }, error), /* @__PURE__ */ React196.createElement(Group63, { justify: "flex-end" }, /* @__PURE__ */ React196.createElement(Button37, { variant: "subtle", onClick: handleClose, disabled: loading }, "Cancel"), /* @__PURE__ */ React196.createElement(Button37, { onClick: handleGrant, loading }, "Grant Permission")))
20470
+ ), error && /* @__PURE__ */ React203.createElement(Alert28, { color: "red" }, error), /* @__PURE__ */ React203.createElement(Group65, { justify: "flex-end" }, /* @__PURE__ */ React203.createElement(Button38, { variant: "subtle", onClick: handleClose, disabled: loading }, "Cancel"), /* @__PURE__ */ React203.createElement(Button38, { onClick: handleGrant, loading }, "Grant Permission")))
19838
20471
  );
19839
20472
  };
19840
20473
 
@@ -19940,4 +20573,4 @@ export {
19940
20573
  ixoGraphQLClient,
19941
20574
  getEntity
19942
20575
  };
19943
- //# sourceMappingURL=chunk-ER7KTMUM.mjs.map
20576
+ //# sourceMappingURL=chunk-52ED245Y.mjs.map