rhua-chatgpt-web 1.1.5 → 1.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/{api_chain-EzupCauA.js → api_chain-8rLd0TuD.js} +2 -2
  2. package/dist/{api_chain-CQbpemiQ.cjs → api_chain-DBmoQA_7.cjs} +1 -1
  3. package/dist/{combine_docs_chain-CYSCkppE.js → combine_docs_chain-BH4-g2GW.js} +2 -2
  4. package/dist/{combine_docs_chain-BRxg6UtZ.cjs → combine_docs_chain-DfTwsFo0.cjs} +1 -1
  5. package/dist/{few_shot-q_TnpUqa.js → few_shot-DJCpSBvt.js} +1 -1
  6. package/dist/{few_shot-DfTvwnAe.cjs → few_shot-DQaRrbJw.cjs} +1 -1
  7. package/dist/{index-Z4SoiuPK.js → index-BAXNGSXw.js} +1 -1
  8. package/dist/{index-CJL6IhdJ.js → index-BDxCvrgc.js} +1 -1
  9. package/dist/{index-xlf6-zoR.cjs → index-BQO11CzB.cjs} +1 -1
  10. package/dist/index-B_x2i-jO.js +4 -0
  11. package/dist/{index-DAVe9cfb.js → index-BaQU1IvP.js} +320 -33
  12. package/dist/index-C8LQxWL1.js +4 -0
  13. package/dist/{index-gSOuomS5.js → index-CD6GBfkZ.js} +1 -1
  14. package/dist/{index-BnjwO3Bw.cjs → index-CFln1NC2.cjs} +1 -1
  15. package/dist/{index-DWYbc6d-.cjs → index-CUnp2vsA.cjs} +1 -1
  16. package/dist/{index-DXTOnzOs.js → index-CXpHNR4F.js} +1 -1
  17. package/dist/index-CYDd-qnF.js +4 -0
  18. package/dist/{index-DXa2ayFF.cjs → index-CvCPvUjj.cjs} +1 -1
  19. package/dist/{index-KdW7xIM8.cjs → index-DFYcGKuT.cjs} +31 -31
  20. package/dist/index-DH4SzrZB.js +4 -0
  21. package/dist/{index-DZFTEz-j.cjs → index-DRg4CNkS.cjs} +1 -1
  22. package/dist/{index-BfavGjvq.js → index-Dy-SzFud.js} +2 -2
  23. package/dist/{index-D__lg2sO.cjs → index-FAGD8ZFV.cjs} +1 -1
  24. package/dist/{index-BI4EdlAm.js → index-GSRYlXZ2.js} +1 -1
  25. package/dist/{index-Chp1R4-v.cjs → index-PQbFNXZe.cjs} +1 -1
  26. package/dist/{index-CtXnaw8Y.cjs → index-VviEQjAE.cjs} +1 -1
  27. package/dist/{index-CgCXN3R6.js → index-Wbrx5M_5.js} +2 -2
  28. package/dist/{index-ybRvvKbH.cjs → index-faFDPW0m.cjs} +1 -1
  29. package/dist/{index-DT9dJ8WJ.cjs → index-jiGOdiuu.cjs} +1 -1
  30. package/dist/{index-DEbJFy6H.cjs → index-xDEsnKsG.cjs} +1 -1
  31. package/dist/index.cjs.js +1 -1
  32. package/dist/{index.es-CC8FXRVt.cjs → index.es-DUhQYmQQ.cjs} +3 -3
  33. package/dist/{index.es-BV1sWnV8.js → index.es-Ofj7pWXh.js} +60 -59
  34. package/dist/index.esm.js +6 -5
  35. package/dist/{llm_chain-zANp5jfK.js → llm_chain-D_TCnPCU.js} +1 -1
  36. package/dist/{llm_chain-Bv5-BS50.cjs → llm_chain-uxhdn-1W.cjs} +1 -1
  37. package/dist/{sequential_chain-Bw8lqqn7.js → sequential_chain-BIzQ7CWb.js} +1 -1
  38. package/dist/{sequential_chain-_P-m2t1s.cjs → sequential_chain-CMYssdOR.cjs} +1 -1
  39. package/dist/style.css +1 -1
  40. package/dist/{vector_db_qa-CSVVrc_O.cjs → vector_db_qa-Bf6oOghB.cjs} +1 -1
  41. package/dist/{vector_db_qa-CIJfQI3s.js → vector_db_qa-DnXdDGBx.js} +3 -3
  42. package/package.json +135 -135
  43. package/dist/index-BcSVqRCu.js +0 -4
  44. package/dist/index-CjhpPaDq.js +0 -4
  45. package/dist/index-CvsV56bR.js +0 -4
  46. package/dist/index-DP9UqkZn.js +0 -4
@@ -1022,10 +1022,10 @@ const convertDifyAppToAgent = (difyApp) => {
1022
1022
  hidden: difyApp.hidden !== void 0 ? difyApp.hidden : false
1023
1023
  };
1024
1024
  };
1025
- const getAgentList = async (type = "app") => {
1025
+ const getAgentList = async (type = "app", userInfo) => {
1026
1026
  let preApi = location.hostname === "localhost" ? "http://111.6.44.42:30001" : location.origin;
1027
1027
  let baseApi = `${preApi}/prod-api/system/apps/list?pageNum=1&pageSize=100&type=${type}`;
1028
- let token = "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0XzIiLCJsb2dpbl91c2VyX2tleSI6IjRkYmNhYzc2LTQ4N2EtNDJjYS04YjUyLTgzNmQ3NTQ1NzJhMyJ9.4vtng26H0bVcdWivNLCdBThrPwFOJjbjzA9h9qsiaifX1CBM0ndz6pDVLIFWtOr0HnfmQS0Rk4EQZRk1h8MB7A";
1028
+ let token = "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0XzIiLCJsb2dpbl91c2VyX2tleSI6ImE3NzgxNDRjLTE5NmEtNDE5Mi1hMjRkLTMwOTJkMWZjYzY1ZCJ9.-24nst7nCELljdhb6axY2LQk-4jpSjTTE5Eu07K_1q-K8xZbLUjkt5ujZvLnGbAIkUX0Ao60PviS54wb8ck2Ag";
1029
1029
  try {
1030
1030
  const cacheData = localStorage.getItem("agentWebCache");
1031
1031
  console.log("cacheData", cacheData);
@@ -1068,7 +1068,8 @@ const getAgentList = async (type = "app") => {
1068
1068
  if (result.rows && Array.isArray(result.rows)) {
1069
1069
  const difyApps = result.rows;
1070
1070
  const agents = difyApps.map(convertDifyAppToAgent);
1071
- const visibleAgents = agents.filter((agent) => !agent.hidden);
1071
+ const isAdmin = (userInfo == null ? void 0 : userInfo.admin) === true;
1072
+ const visibleAgents = isAdmin ? agents : agents.filter((agent) => !agent.hidden);
1072
1073
  const sortedAgents = visibleAgents.sort((a, b) => {
1073
1074
  const sortA = a.sort !== void 0 ? a.sort : Number.MAX_SAFE_INTEGER;
1074
1075
  const sortB = b.sort !== void 0 ? b.sort : Number.MAX_SAFE_INTEGER;
@@ -1084,6 +1085,66 @@ const getAgentList = async (type = "app") => {
1084
1085
  return [];
1085
1086
  }
1086
1087
  };
1088
+ const getUserInfo = async () => {
1089
+ let preApi = location.hostname === "localhost" ? "http://111.6.44.42:30001" : location.origin;
1090
+ let baseApi = `${preApi}/prod-api/getInfo`;
1091
+ let token = "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0XzIiLCJsb2dpbl91c2VyX2tleSI6ImE3NzgxNDRjLTE5NmEtNDE5Mi1hMjRkLTMwOTJkMWZjYzY1ZCJ9.-24nst7nCELljdhb6axY2LQk-4jpSjTTE5Eu07K_1q-K8xZbLUjkt5ujZvLnGbAIkUX0Ao60PviS54wb8ck2Ag";
1092
+ try {
1093
+ const cacheData = localStorage.getItem("agentWebCache");
1094
+ if (cacheData) {
1095
+ const parsed = JSON.parse(cacheData);
1096
+ if (parsed.baseApi) {
1097
+ try {
1098
+ const url = new URL(parsed.baseApi);
1099
+ baseApi = `${url.origin}/prod-api/getInfo`;
1100
+ } catch (urlError) {
1101
+ console.warn("URL解析失败,使用字符串替换方式:", urlError);
1102
+ const urlStr = parsed.baseApi;
1103
+ const baseUrlMatch = urlStr.match(/^(https?:\/\/[^\/]+)/);
1104
+ if (baseUrlMatch) {
1105
+ baseApi = `${baseUrlMatch[1]}/prod-api/getInfo`;
1106
+ } else {
1107
+ baseApi = `${preApi}/prod-api/getInfo`;
1108
+ }
1109
+ }
1110
+ } else {
1111
+ baseApi = `${preApi}/prod-api/getInfo`;
1112
+ }
1113
+ token = parsed.token || token;
1114
+ }
1115
+ } catch (error) {
1116
+ console.warn("读取缓存数据失败,使用默认配置:", error);
1117
+ }
1118
+ try {
1119
+ const response = await fetch(`${baseApi}`, {
1120
+ method: "GET",
1121
+ headers: {
1122
+ Authorization: `Bearer ${token}`
1123
+ }
1124
+ });
1125
+ if (!response.ok) {
1126
+ throw new Error(`HTTP error! status: ${response.status}`);
1127
+ }
1128
+ const result = await response.json();
1129
+ if (result.code === 200 && result.user) {
1130
+ return result.user;
1131
+ }
1132
+ if (result.code === 200 && result.data) {
1133
+ return result.data;
1134
+ }
1135
+ if (result.user) {
1136
+ return result.user;
1137
+ }
1138
+ if (result.nickname || result.avatar || result.nickName) {
1139
+ return result;
1140
+ }
1141
+ console.warn("API返回数据格式异常:", result);
1142
+ return null;
1143
+ } catch (error) {
1144
+ console.error("获取用户信息失败:", error);
1145
+ return null;
1146
+ }
1147
+ };
1087
1148
  const robotIcon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAACpElEQVR4AeyXTW4aMRTH/way6qZRS6SuOnxJXdIbTI7QE4ScIGRfFSN1H3KC0BP0CNATtMtKFTBdpSqpYNNNw/D6rHaAAZsZY2hSBWue/PX83o83jJ+dwT0ve0DXF/RwIvhCjrxi88dZqXlz4nHbNXLR+q1EsCyH9VtMBoKmLRC1Mwg7Ffm9GjlxqZ0BVeQIuFiEECAvhLhaHNu07Qw4wcTTORdAtfB29Fw3ZzPmDMjRGpscDl4ffjXNpR13Bvwijz6xsy5L7OHX3ooNbNhxBlR+Q+ReAdRWbSUkIPsyf67arrIVwEAejkOEzQim38jP2tHYpnUioNouyvLaT5Issn4EkaQbzSvb0RpTnTFNVOSoWpI3gynER0KukyRY2FaSdKN5ZbvIPrw1G7sRcIrwPf+vtFsItlh4F/CymBj3TC3gn9DTzuEWfqdv2jO1gATxeGHxnTa1gHdKtOR8D7gUEOuudQQJFJDI1JXwVx6k8NiFEDUL/ZhJK0ACBVP8fNlvPLlU0pNHBbbWZdE+xOmvJ/PHvcbTd31ec4DwmBWNhwueW3msAIXIyEAWxnEr4jLen/em+BWb+yyfBQTMcjZSFCtAnT0BWgKea4nco9G897clYNSHptgBEtWWbRDEyfJY1BfhZEVfkFgZi/R1tR0g4HPuvKrwfcOT1x7naj7zUQ3QmQYEQRblt7rSL8uhX5LDDn9YHiyKLSD4ldZUks8iN2BnZ0m+BLIXSp8AhsPsxIOUxRowpd2tqe0BXUP5f0aQPwSrvco1SuvWayN4i4M0OXadXas5TomB6Q6tBVS3NE7u0sqLi7IQxvSnBVS+OLnz1ZFOCdQiTvq7kjADf9011QioIPm00u7Lo3OW011J8Cb/QfkyyVpA06J/Ob4HdI32vY/gbwAAAP//PSPUHgAAAAZJREFUAwBWgG1gJNBUIgAAAABJRU5ErkJggg==";
1088
1149
  const WorkspaceApp = styled.div`
1089
1150
  height: calc(100vh - 80px);
@@ -1672,15 +1733,21 @@ const AiList = ({
1672
1733
  // 传递隐藏字段
1673
1734
  };
1674
1735
  };
1675
- const loadUserInfo = useCallback(() => {
1736
+ const loadUserInfo = useCallback(async () => {
1676
1737
  try {
1738
+ const userInfoFromApi = await getUserInfo();
1739
+ if (userInfoFromApi) {
1740
+ setUserInfo(userInfoFromApi);
1741
+ return;
1742
+ }
1677
1743
  const cacheData = localStorage.getItem("agentWebCache");
1678
1744
  if (cacheData) {
1679
1745
  const parsed = JSON.parse(cacheData);
1680
1746
  if (parsed.user) {
1681
1747
  setUserInfo({
1682
- nickname: parsed.user.nickname || "匿名用户",
1683
- avatar: parsed.user.avatar || ""
1748
+ nickname: parsed.user.nickname || parsed.user.nickName || "匿名用户",
1749
+ avatar: parsed.user.avatar || "",
1750
+ admin: parsed.user.admin || false
1684
1751
  });
1685
1752
  }
1686
1753
  }
@@ -1719,7 +1786,7 @@ const AiList = ({
1719
1786
  try {
1720
1787
  setLoading(true);
1721
1788
  let allCards = [];
1722
- const agents = await getAgentList(activeFilter);
1789
+ const agents = await getAgentList(activeFilter, userInfo);
1723
1790
  const transformedCards = agents.map(transformAgentToCard);
1724
1791
  transformedCards.forEach((card) => {
1725
1792
  card.type = activeFilter;
@@ -1734,7 +1801,7 @@ const AiList = ({
1734
1801
  }
1735
1802
  };
1736
1803
  loadAgents();
1737
- }, [activeFilter]);
1804
+ }, [activeFilter, userInfo]);
1738
1805
  const cards = propCards.length > 0 ? propCards : agentCards;
1739
1806
  useMemo(() => {
1740
1807
  const allTags = cards.flatMap((card) => card.tags);
@@ -1742,7 +1809,10 @@ const AiList = ({
1742
1809
  }, [cards]);
1743
1810
  const filteredCards = useMemo(() => {
1744
1811
  let result = cards;
1745
- result = result.filter((card) => !card.hidden);
1812
+ const isAdmin = (userInfo == null ? void 0 : userInfo.admin) === true;
1813
+ if (!isAdmin) {
1814
+ result = result.filter((card) => !card.hidden);
1815
+ }
1746
1816
  result = result.sort((a, b) => {
1747
1817
  const sortA = a.sort !== void 0 ? a.sort : Number.MAX_SAFE_INTEGER;
1748
1818
  const sortB = b.sort !== void 0 ? b.sort : Number.MAX_SAFE_INTEGER;
@@ -1760,7 +1830,7 @@ const AiList = ({
1760
1830
  );
1761
1831
  }
1762
1832
  return result;
1763
- }, [cards, activeFilter, selectedTag, showMyCreations, searchQuery]);
1833
+ }, [cards, activeFilter, selectedTag, showMyCreations, searchQuery, userInfo]);
1764
1834
  const clearSearch = () => {
1765
1835
  setSearchQuery("");
1766
1836
  };
@@ -43951,6 +44021,7 @@ function CommentIndex({
43951
44021
  const [fileUploadEnabled, setFileUploadEnabled] = useState(false);
43952
44022
  const [isFileUploading, setIsFileUploading] = useState(false);
43953
44023
  const [isThink, setIsThink] = useState(true);
44024
+ const [userInfo, setUserInfo] = useState(null);
43954
44025
  const [agentList, setAgentList] = useState([]);
43955
44026
  const [selectedAgentId, setSelectedAgentId] = useState("");
43956
44027
  const [pendingAgentFromList, setPendingAgentFromList] = useState(null);
@@ -44303,15 +44374,19 @@ function CommentIndex({
44303
44374
  });
44304
44375
  const loadAgents = async () => {
44305
44376
  try {
44377
+ const currentUserInfo = await getUserInfo();
44378
+ if (currentUserInfo) {
44379
+ setUserInfo(currentUserInfo);
44380
+ }
44306
44381
  let agentPromises = [];
44307
44382
  if (appTypeOptions && appTypeOptions.length > 0) {
44308
44383
  agentPromises = appTypeOptions.map(
44309
- (option) => getAgentList(option.dictValue)
44384
+ (option) => getAgentList(option.dictValue, currentUserInfo)
44310
44385
  );
44311
44386
  } else {
44312
44387
  agentPromises = [
44313
- getAgentList("app"),
44314
- getAgentList("tools")
44388
+ getAgentList("app", currentUserInfo),
44389
+ getAgentList("tools", currentUserInfo)
44315
44390
  ];
44316
44391
  }
44317
44392
  const agentResults = await Promise.all(agentPromises);
@@ -46264,12 +46339,12 @@ function CommentIndex({
46264
46339
  let agentPromises = [];
46265
46340
  if (appTypeOptions && appTypeOptions.length > 0) {
46266
46341
  agentPromises = appTypeOptions.map(
46267
- (option) => getAgentList(option.dictValue)
46342
+ (option) => getAgentList(option.dictValue, userInfo)
46268
46343
  );
46269
46344
  } else {
46270
46345
  agentPromises = [
46271
- getAgentList("app"),
46272
- getAgentList("tools")
46346
+ getAgentList("app", userInfo),
46347
+ getAgentList("tools", userInfo)
46273
46348
  ];
46274
46349
  }
46275
46350
  const agentResults = await Promise.all(agentPromises);
@@ -46854,7 +46929,7 @@ const BlockEdit = ({
46854
46929
  const initVueEditor = async () => {
46855
46930
  if (editorRef.current) {
46856
46931
  try {
46857
- const BlockNoteEditorModule = await import("./index.es-BV1sWnV8.js");
46932
+ const BlockNoteEditorModule = await import("./index.es-Ofj7pWXh.js");
46858
46933
  const BlockNoteEditor = BlockNoteEditorModule.BlockNoteEditor;
46859
46934
  const theme = {
46860
46935
  colors: {
@@ -47781,7 +47856,7 @@ const style = {
47781
47856
  backgroundColor: "transparent",
47782
47857
  color: "#333"
47783
47858
  };
47784
- const AiBlockEdit = ({
47859
+ const AiBlockEdit$1 = ({
47785
47860
  getSetBlockContent,
47786
47861
  baseUrl,
47787
47862
  token,
@@ -47818,7 +47893,7 @@ const AiBlockEdit = ({
47818
47893
  const initVueEditor = async () => {
47819
47894
  if (editorRef.current) {
47820
47895
  try {
47821
- const BlockNoteEditorModule = await import("./index.es-BV1sWnV8.js");
47896
+ const BlockNoteEditorModule = await import("./index.es-Ofj7pWXh.js");
47822
47897
  const BlockNoteEditor = BlockNoteEditorModule.BlockNoteEditor;
47823
47898
  const theme = {
47824
47899
  colors: {
@@ -48548,6 +48623,217 @@ const AiBlockEdit = ({
48548
48623
  }
48549
48624
  );
48550
48625
  };
48626
+ const AiBlockEdit = ({
48627
+ getSetBlockContent,
48628
+ baseUrl,
48629
+ token,
48630
+ onBack,
48631
+ onRegenerate
48632
+ }) => {
48633
+ useNavigate();
48634
+ const [searchParams] = useSearchParams();
48635
+ const editorRef = useRef(null);
48636
+ const editorVmRef = useRef(null);
48637
+ const contentChangeHandlerRef = useRef(
48638
+ null
48639
+ );
48640
+ const hasPastedRef = useRef(false);
48641
+ const [outlineTree, setOutlineTree] = useState([]);
48642
+ const [exporting, setExporting] = useState(false);
48643
+ useRef(false);
48644
+ const [editorReady, setEditorReady] = useState(false);
48645
+ const [historyVisible, setHistoryVisible] = useState(false);
48646
+ const [historyList, setHistoryList] = useState([]);
48647
+ const [historyLoading, setHistoryLoading] = useState(false);
48648
+ const [historyHasMore, setHistoryHasMore] = useState(true);
48649
+ const [currentConversationId, setCurrentConversationId] = useState("");
48650
+ useEffect(() => {
48651
+ if (baseUrl == null ? void 0 : baseUrl.conversationId) {
48652
+ setCurrentConversationId(baseUrl == null ? void 0 : baseUrl.conversationId);
48653
+ }
48654
+ if (baseUrl == null ? void 0 : baseUrl.userId) {
48655
+ getHistoryFromIndexedDB();
48656
+ }
48657
+ }, [baseUrl]);
48658
+ useEffect(() => {
48659
+ const initVueEditor = async () => {
48660
+ if (editorRef.current) {
48661
+ try {
48662
+ const BlockNoteEditorModule = await import("./index.es-Ofj7pWXh.js");
48663
+ const BlockNoteEditor = BlockNoteEditorModule.BlockNoteEditor;
48664
+ const theme = {
48665
+ colors: {
48666
+ editor: {
48667
+ text: "#333",
48668
+ background: "transparent"
48669
+ }
48670
+ }
48671
+ };
48672
+ console.log("BlockNoteEditor:", BlockNoteEditor);
48673
+ if (BlockNoteEditor && typeof BlockNoteEditor === "object") {
48674
+ const { createApp } = await import("./vue.runtime.esm-bundler-uPvnzsTN.js");
48675
+ console.log("Creating Vue app with BlockNoteEditor component");
48676
+ const onContentChange = (payload) => {
48677
+ console.log("内容变化了", payload);
48678
+ const treeData2 = parseBlockNoteOutline(payload);
48679
+ console.log("大纲内容", treeData2);
48680
+ setOutlineTree(treeData2);
48681
+ };
48682
+ const onHandleAiAssistant = (text2, type) => {
48683
+ console.log("处理AI助手", text2, type);
48684
+ };
48685
+ const app = createApp(BlockNoteEditor, {
48686
+ theme,
48687
+ onContentChange,
48688
+ onHandleAiAssistant,
48689
+ hiddenAiAssistant: true
48690
+ // placeholder: "开始编辑...",
48691
+ });
48692
+ console.log("Mounting Vue app to:", editorRef.current);
48693
+ const vm = app.mount(editorRef.current);
48694
+ editorVmRef.current = vm;
48695
+ setEditorReady(true);
48696
+ if (!hasPastedRef.current) {
48697
+ hasPastedRef.current = true;
48698
+ setTimeout(() => {
48699
+ var _a2;
48700
+ try {
48701
+ const anyVm = editorVmRef.current;
48702
+ const exposed = ((_a2 = anyVm == null ? void 0 : anyVm.$) == null ? void 0 : _a2.exposed) ?? (anyVm == null ? void 0 : anyVm.exposed) ?? anyVm;
48703
+ const paste = (baseUrl == null ? void 0 : baseUrl.contentType) && (baseUrl == null ? void 0 : baseUrl.contentType) === "blocknote" ? exposed == null ? void 0 : exposed.setContent : exposed == null ? void 0 : exposed.pasteMarkdown;
48704
+ if (typeof paste === "function") {
48705
+ if ((baseUrl == null ? void 0 : baseUrl.contentType) && (baseUrl == null ? void 0 : baseUrl.contentType) === "blocknote") {
48706
+ paste(JSON.parse(baseUrl.content));
48707
+ } else {
48708
+ paste(baseUrl.content, true);
48709
+ }
48710
+ }
48711
+ } catch (e) {
48712
+ console.warn("初始化 pasteMarkdown 失败:", e);
48713
+ }
48714
+ }, 300);
48715
+ }
48716
+ } else {
48717
+ console.log("BlockNoteEditor is not a valid Vue component");
48718
+ if (editorRef.current) {
48719
+ editorRef.current.innerHTML = `
48720
+ <div style="padding: 20px; text-align: center; color: #666; background: #f0f0f0; border: 1px solid #ccc; border-radius: 4px;">
48721
+ <h3>BlockNote编辑器</h3>
48722
+ <p>编辑器组件类型: ${typeof BlockNoteEditor}</p>
48723
+ <p>主题: ${JSON.stringify(theme)}</p>
48724
+ </div>
48725
+ `;
48726
+ }
48727
+ }
48728
+ } catch (error) {
48729
+ console.error("Failed to load Vue editor:", error);
48730
+ if (editorRef.current) {
48731
+ editorRef.current.innerHTML = '<div style="padding: 20px; text-align: center; color: #666; background: #fff3cd; border: 1px solid #ffeaa7; border-radius: 4px;">编辑器加载失败,请检查控制台错误信息</div>';
48732
+ }
48733
+ }
48734
+ }
48735
+ };
48736
+ initVueEditor();
48737
+ return () => {
48738
+ contentChangeHandlerRef.current = null;
48739
+ editorVmRef.current = void 0;
48740
+ setEditorReady(false);
48741
+ };
48742
+ }, []);
48743
+ const parseBlockNoteOutline = (content2) => {
48744
+ if (!Array.isArray(content2) || content2.length === 0) return [];
48745
+ const treeData2 = [];
48746
+ const stack = [];
48747
+ content2.forEach((block, index2) => {
48748
+ var _a2, _b;
48749
+ if (!block || typeof block !== "object") return;
48750
+ if (block.type === "heading" && ((_a2 = block.props) == null ? void 0 : _a2.level)) {
48751
+ const level = block.props.level;
48752
+ const title = extractTextFromContent(block.content);
48753
+ const key = `outline-${index2}`;
48754
+ const blockId = block.id || `block-${index2}`;
48755
+ const titleSlug = title ? title.replace(/[^\u4e00-\u9fa5a-zA-Z0-9]/g, "-").toLowerCase() : `heading-${index2}`;
48756
+ const node2 = {
48757
+ label: title,
48758
+ key,
48759
+ value: key,
48760
+ blockId,
48761
+ // 保存 BlockNote 的块ID
48762
+ titleSlug,
48763
+ // 保存标题的slug版本
48764
+ children: [],
48765
+ level,
48766
+ // 保存标题级别
48767
+ agentId: ((_b = block.props) == null ? void 0 : _b.agentId) || null
48768
+ // 保存 agentId
48769
+ };
48770
+ while (stack.length > 0 && stack[stack.length - 1].level >= level) {
48771
+ stack.pop();
48772
+ }
48773
+ if (stack.length === 0) {
48774
+ treeData2.push(node2);
48775
+ stack.push({ ...node2, level });
48776
+ } else {
48777
+ const parent = stack[stack.length - 1];
48778
+ if (parent.children) {
48779
+ parent.children.push(node2);
48780
+ }
48781
+ stack.push({ ...node2, level });
48782
+ }
48783
+ }
48784
+ });
48785
+ return treeData2;
48786
+ };
48787
+ const extractTextFromContent = (content2) => {
48788
+ if (!Array.isArray(content2)) return "";
48789
+ let text2 = "";
48790
+ content2.forEach((item) => {
48791
+ if (item && typeof item === "object") {
48792
+ if (item.type === "text") {
48793
+ text2 += item.text || "";
48794
+ } else if (item.type === "link" && item.content) {
48795
+ text2 += extractTextFromContent(item.content);
48796
+ } else if (item.content) {
48797
+ text2 += extractTextFromContent(item.content);
48798
+ }
48799
+ }
48800
+ });
48801
+ return text2;
48802
+ };
48803
+ const setBlockContent = (content2, type) => {
48804
+ var _a2;
48805
+ try {
48806
+ const anyVm = editorVmRef.current;
48807
+ const exposed = ((_a2 = anyVm == null ? void 0 : anyVm.$) == null ? void 0 : _a2.exposed) ?? (anyVm == null ? void 0 : anyVm.exposed) ?? anyVm;
48808
+ const paste = type === "blocknote" ? exposed == null ? void 0 : exposed.setContent : exposed == null ? void 0 : exposed.pasteMarkdown;
48809
+ if (typeof paste === "function") {
48810
+ if (type === "blocknote") {
48811
+ paste(JSON.parse(content2));
48812
+ } else {
48813
+ paste(content2, true);
48814
+ }
48815
+ }
48816
+ } catch (err) {
48817
+ console.error("设置块内容失败:", err);
48818
+ Toast.error("设置块内容失败,请重试或查看控制台日志");
48819
+ }
48820
+ };
48821
+ useEffect(() => {
48822
+ if (getSetBlockContent) {
48823
+ getSetBlockContent(setBlockContent);
48824
+ }
48825
+ }, [getSetBlockContent]);
48826
+ const getHistoryFromIndexedDB = async () => {
48827
+ const userId = (baseUrl == null ? void 0 : baseUrl.userId) || "";
48828
+ if (!userId) {
48829
+ Toast.error("获取用户ID失败");
48830
+ return;
48831
+ }
48832
+ const historyList2 = await getWritingsByUserId(userId);
48833
+ setHistoryList(historyList2);
48834
+ };
48835
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "block-edit-contanier", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "block-edit-right-content", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: editorRef, className: "vue-editor-container" }) }) });
48836
+ };
48551
48837
  class BaseAgent extends Serializable {
48552
48838
  get returnValues() {
48553
48839
  return ["output"];
@@ -48867,7 +49153,7 @@ class BasePromptTemplate extends Runnable {
48867
49153
  return PromptTemplate2.deserialize({ ...data, _type: "prompt" });
48868
49154
  }
48869
49155
  case "few_shot": {
48870
- const { FewShotPromptTemplate } = await import("./few_shot-q_TnpUqa.js");
49156
+ const { FewShotPromptTemplate } = await import("./few_shot-DJCpSBvt.js");
48871
49157
  return FewShotPromptTemplate.deserialize(data);
48872
49158
  }
48873
49159
  default:
@@ -50439,35 +50725,35 @@ class BaseChain extends BaseLangChain {
50439
50725
  static async deserialize(data, values = {}) {
50440
50726
  switch (data._type) {
50441
50727
  case "llm_chain": {
50442
- const { LLMChain } = await import("./llm_chain-zANp5jfK.js");
50728
+ const { LLMChain } = await import("./llm_chain-D_TCnPCU.js");
50443
50729
  return LLMChain.deserialize(data);
50444
50730
  }
50445
50731
  case "sequential_chain": {
50446
- const { SequentialChain } = await import("./sequential_chain-Bw8lqqn7.js");
50732
+ const { SequentialChain } = await import("./sequential_chain-BIzQ7CWb.js");
50447
50733
  return SequentialChain.deserialize(data);
50448
50734
  }
50449
50735
  case "simple_sequential_chain": {
50450
- const { SimpleSequentialChain } = await import("./sequential_chain-Bw8lqqn7.js");
50736
+ const { SimpleSequentialChain } = await import("./sequential_chain-BIzQ7CWb.js");
50451
50737
  return SimpleSequentialChain.deserialize(data);
50452
50738
  }
50453
50739
  case "stuff_documents_chain": {
50454
- const { StuffDocumentsChain } = await import("./combine_docs_chain-CYSCkppE.js");
50740
+ const { StuffDocumentsChain } = await import("./combine_docs_chain-BH4-g2GW.js");
50455
50741
  return StuffDocumentsChain.deserialize(data);
50456
50742
  }
50457
50743
  case "map_reduce_documents_chain": {
50458
- const { MapReduceDocumentsChain } = await import("./combine_docs_chain-CYSCkppE.js");
50744
+ const { MapReduceDocumentsChain } = await import("./combine_docs_chain-BH4-g2GW.js");
50459
50745
  return MapReduceDocumentsChain.deserialize(data);
50460
50746
  }
50461
50747
  case "refine_documents_chain": {
50462
- const { RefineDocumentsChain } = await import("./combine_docs_chain-CYSCkppE.js");
50748
+ const { RefineDocumentsChain } = await import("./combine_docs_chain-BH4-g2GW.js");
50463
50749
  return RefineDocumentsChain.deserialize(data);
50464
50750
  }
50465
50751
  case "vector_db_qa": {
50466
- const { VectorDBQAChain } = await import("./vector_db_qa-CIJfQI3s.js");
50752
+ const { VectorDBQAChain } = await import("./vector_db_qa-DnXdDGBx.js");
50467
50753
  return VectorDBQAChain.deserialize(data, values);
50468
50754
  }
50469
50755
  case "api_chain": {
50470
- const { APIChain } = await import("./api_chain-EzupCauA.js");
50756
+ const { APIChain } = await import("./api_chain-8rLd0TuD.js");
50471
50757
  return APIChain.deserialize(data);
50472
50758
  }
50473
50759
  default:
@@ -51370,11 +51656,12 @@ export {
51370
51656
  getDefaultExportFromCjs as Z,
51371
51657
  jsxRuntimeExports as _,
51372
51658
  remarkParse as a,
51373
- AiBlockEdit as a0,
51374
- LocalForageService as a1,
51375
- MessageUtil as a2,
51376
- PluginExecutor as a3,
51377
- CommonUtil as a4,
51659
+ AiBlockEdit$1 as a0,
51660
+ AiBlockEdit as a1,
51661
+ LocalForageService as a2,
51662
+ MessageUtil as a3,
51663
+ PluginExecutor as a4,
51664
+ CommonUtil as a5,
51378
51665
  defaultFootnoteBackLabel as b,
51379
51666
  remarkRehype as c,
51380
51667
  defaultFootnoteBackContent as d,
@@ -0,0 +1,4 @@
1
+ import { a } from "./index-BaQU1IvP.js";
2
+ export {
3
+ a as default
4
+ };
@@ -1,5 +1,5 @@
1
1
  import { z as zwitch } from "./index-BEZf1ZPW.js";
2
- import { q as formatCodeAsIndented, s as formatHeadingAsSetext, t as decodeString, x as encodeCharacterReference, y as patternInScope, z as handle } from "./index-DAVe9cfb.js";
2
+ import { q as formatCodeAsIndented, s as formatHeadingAsSetext, t as decodeString, x as encodeCharacterReference, y as patternInScope, z as handle } from "./index-BaQU1IvP.js";
3
3
  const own = {}.hasOwnProperty;
4
4
  function configure(base, extension) {
5
5
  let index = -1;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-KdW7xIM8.cjs");exports.unified=e.unified;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DFYcGKuT.cjs");exports.unified=e.unified;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-2yo2kUGy.cjs"),t=require("./index-KdW7xIM8.cjs"),n={}.hasOwnProperty;function r(e,t){let o,i=-1;if(t.extensions)for(;++i<t.extensions.length;)r(e,t.extensions[i]);for(o in t)if(n.call(t,o))switch(o){case"extensions":break;case"unsafe":case"join":c(e[o],t[o]);break;case"handlers":a(e[o],t[o]);break;default:e.options[o]=t[o]}return e}function c(e,t){t&&e.push(...t)}function a(e,t){t&&Object.assign(e,t)}const o=[function(e,n,r,c){if("code"===n.type&&t.formatCodeAsIndented(n,c)&&("list"===e.type||e.type===n.type&&t.formatCodeAsIndented(e,c)))return!1;if("spread"in r&&"boolean"==typeof r.spread){if("paragraph"===e.type&&(e.type===n.type||"definition"===n.type||"heading"===n.type&&t.formatHeadingAsSetext(n,c)))return;return r.spread?1:0}}];const i=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],s=[{character:"\t",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"\t",before:"[\\r\\n]",inConstruct:"phrasing"},{character:"\t",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:"\n",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:i},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:"(?:[\r\n]|$)"},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:i},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:"(?:[ \t\r\n*])"},{character:"*",inConstruct:"phrasing",notInConstruct:i},{atBreak:!0,character:"+",after:"(?:[ \t\r\n])"},{atBreak:!0,character:"-",after:"(?:[ \t\r\n-])"},{atBreak:!0,before:"\\d+",character:".",after:"(?:[ \t\r\n]|$)"},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:i},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:i},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:i},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:i},{atBreak:!0,character:"~"}];function h(e){return e.label||!e.identifier?e.label||"":t.decodeString(e.identifier)}function u(e){if(!e._compiled){const t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((t?"("+t+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}function f(e,t,n,r){let c=r.join.length;for(;c--;){const a=r.join[c](e,t,n,r);if(!0===a||1===a)break;if("number"==typeof a)return"\n".repeat(1+a);if(!1===a)return"\n\n\x3c!----\x3e\n\n"}return"\n\n"}const l=/\r?\n|\r/g;function d(e,t){const n=[];let r,c=0,a=0;for(;r=l.exec(e);)o(e.slice(c,r.index)),n.push(r[0]),c=r.index+r[0].length,a++;return o(e.slice(c)),n.join("");function o(e){n.push(t(e,a,!e))}}function p(e,t){return e-t}function g(e,t){const n=/\\(?=[!-/:-@[-`{-~])/g,r=[],c=[],a=e+t;let o,i=-1,s=0;for(;o=n.exec(a);)r.push(o.index);for(;++i<r.length;)s!==r[i]&&c.push(e.slice(s,r[i])),c.push("\\"),s=r[i];return c.push(e.slice(s)),c.join("")}function C(e){const t=e||{},n=t.now||{};let r=t.lineShift||0,c=n.line||1,a=n.column||1;return{move:function(e){const t=e||"",n=t.split(/\r?\n|\r/g),o=n[n.length-1];return c+=n.length-1,a=1===n.length?a+o.length:1+o.length+r,t},current:function(){return{now:{line:c,column:a},lineShift:r}},shift:function(e){r+=e}}}function b(n,c){const a=c||{},i={associationId:h,containerPhrasing:y,containerFlow:v,createTracker:C,compilePattern:u,enter:function(e){return i.stack.push(e),function(){i.stack.pop()}},handlers:{...t.handle},handle:void 0,indentLines:d,indexStack:[],join:[...o],options:{},safe:m,stack:[],unsafe:[...s]};r(i,a),i.options.tightDefinitions&&i.join.push(A),i.handle=e.zwitch("type",{invalid:k,unknown:x,handlers:i.handlers});let f=i.handle(n,void 0,i,{before:"\n",after:"\n",now:{line:1,column:1},lineShift:0});return f&&10!==f.charCodeAt(f.length-1)&&13!==f.charCodeAt(f.length-1)&&(f+="\n"),f}function k(e){throw new Error("Cannot handle value `"+e+"`, expected node")}function x(e){throw new Error("Cannot handle unknown node `"+e.type+"`")}function A(e,t){if("definition"===e.type&&e.type===t.type)return 0}function y(e,n){return function(e,n,r){const c=n.indexStack,a=e.children||[],o=[];let i,s=-1,h=r.before;c.push(-1);let u=n.createTracker(r);for(;++s<a.length;){const f=a[s];let l;if(c[c.length-1]=s,s+1<a.length){let t=n.handle.handlers[a[s+1].type];t&&t.peek&&(t=t.peek),l=t?t(a[s+1],e,n,{before:"",after:"",...u.current()}).charAt(0):""}else l=r.after;o.length>0&&("\r"===h||"\n"===h)&&"html"===f.type&&(o[o.length-1]=o[o.length-1].replace(/(\r?\n|\r)$/," "),h=" ",u=n.createTracker(r),u.move(o.join("")));let d=n.handle(f,e,n,{...u.current(),after:l,before:h});i&&i===d.slice(0,1)&&(d=t.encodeCharacterReference(i.charCodeAt(0))+d.slice(1));const p=n.attentionEncodeSurroundingInfo;n.attentionEncodeSurroundingInfo=void 0,i=void 0,p&&(o.length>0&&p.before&&h===o[o.length-1].slice(-1)&&(o[o.length-1]=o[o.length-1].slice(0,-1)+t.encodeCharacterReference(h.charCodeAt(0))),p.after&&(i=l)),u.move(d),o.push(d),h=d.slice(-1)}return c.pop(),o.join("")}(e,this,n)}function v(e,t){return function(e,t,n){const r=t.indexStack,c=e.children||[],a=t.createTracker(n),o=[];let i=-1;for(r.push(-1);++i<c.length;){const n=c[i];r[r.length-1]=i,o.push(a.move(t.handle(n,e,t,{before:"\n",after:"\n",...a.current()}))),"list"!==n.type&&(t.bulletLastUsed=void 0),i<c.length-1&&o.push(a.move(f(n,c[i+1],e,t)))}return r.pop(),o.join("")}(e,this,t)}function m(e,n){return function(e,n,r){const c=(r.before||"")+(n||"")+(r.after||""),a=[],o=[],i={};let s=-1;for(;++s<e.unsafe.length;){const n=e.unsafe[s];if(!t.patternInScope(e.stack,n))continue;const r=e.compilePattern(n);let o;for(;o=r.exec(c);){const e="before"in n||Boolean(n.atBreak),t="after"in n,r=o.index+(e?o[1].length:0);a.includes(r)?(i[r].before&&!e&&(i[r].before=!1),i[r].after&&!t&&(i[r].after=!1)):(a.push(r),i[r]={before:e,after:t})}}a.sort(p);let h=r.before?r.before.length:0;const u=c.length-(r.after?r.after.length:0);for(s=-1;++s<a.length;){const e=a[s];e<h||e>=u||e+1<u&&a[s+1]===e+1&&i[e].after&&!i[e+1].before&&!i[e+1].after||a[s-1]===e-1&&i[e].before&&!i[e-1].before&&!i[e-1].after||(h!==e&&o.push(g(c.slice(h,e),"\\")),h=e,!/[!-/:-@[-`{-~]/.test(c.charAt(e))||r.encode&&r.encode.includes(c.charAt(e))?(o.push(t.encodeCharacterReference(c.charCodeAt(e))),h++):o.push("\\"))}return o.push(g(c.slice(h,u),r.after)),o.join("")}(this,e,n)}exports.default=function(e){const t=this;t.compiler=function(n){return b(n,{...t.data("settings"),...e,extensions:t.data("toMarkdownExtensions")||[]})}};
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-2yo2kUGy.cjs"),t=require("./index-DFYcGKuT.cjs"),n={}.hasOwnProperty;function r(e,t){let o,i=-1;if(t.extensions)for(;++i<t.extensions.length;)r(e,t.extensions[i]);for(o in t)if(n.call(t,o))switch(o){case"extensions":break;case"unsafe":case"join":c(e[o],t[o]);break;case"handlers":a(e[o],t[o]);break;default:e.options[o]=t[o]}return e}function c(e,t){t&&e.push(...t)}function a(e,t){t&&Object.assign(e,t)}const o=[function(e,n,r,c){if("code"===n.type&&t.formatCodeAsIndented(n,c)&&("list"===e.type||e.type===n.type&&t.formatCodeAsIndented(e,c)))return!1;if("spread"in r&&"boolean"==typeof r.spread){if("paragraph"===e.type&&(e.type===n.type||"definition"===n.type||"heading"===n.type&&t.formatHeadingAsSetext(n,c)))return;return r.spread?1:0}}];const i=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],s=[{character:"\t",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"\t",before:"[\\r\\n]",inConstruct:"phrasing"},{character:"\t",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:"\n",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:i},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:"(?:[\r\n]|$)"},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:i},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:"(?:[ \t\r\n*])"},{character:"*",inConstruct:"phrasing",notInConstruct:i},{atBreak:!0,character:"+",after:"(?:[ \t\r\n])"},{atBreak:!0,character:"-",after:"(?:[ \t\r\n-])"},{atBreak:!0,before:"\\d+",character:".",after:"(?:[ \t\r\n]|$)"},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:i},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:i},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:i},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:i},{atBreak:!0,character:"~"}];function h(e){return e.label||!e.identifier?e.label||"":t.decodeString(e.identifier)}function u(e){if(!e._compiled){const t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((t?"("+t+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}function f(e,t,n,r){let c=r.join.length;for(;c--;){const a=r.join[c](e,t,n,r);if(!0===a||1===a)break;if("number"==typeof a)return"\n".repeat(1+a);if(!1===a)return"\n\n\x3c!----\x3e\n\n"}return"\n\n"}const l=/\r?\n|\r/g;function d(e,t){const n=[];let r,c=0,a=0;for(;r=l.exec(e);)o(e.slice(c,r.index)),n.push(r[0]),c=r.index+r[0].length,a++;return o(e.slice(c)),n.join("");function o(e){n.push(t(e,a,!e))}}function p(e,t){return e-t}function g(e,t){const n=/\\(?=[!-/:-@[-`{-~])/g,r=[],c=[],a=e+t;let o,i=-1,s=0;for(;o=n.exec(a);)r.push(o.index);for(;++i<r.length;)s!==r[i]&&c.push(e.slice(s,r[i])),c.push("\\"),s=r[i];return c.push(e.slice(s)),c.join("")}function C(e){const t=e||{},n=t.now||{};let r=t.lineShift||0,c=n.line||1,a=n.column||1;return{move:function(e){const t=e||"",n=t.split(/\r?\n|\r/g),o=n[n.length-1];return c+=n.length-1,a=1===n.length?a+o.length:1+o.length+r,t},current:function(){return{now:{line:c,column:a},lineShift:r}},shift:function(e){r+=e}}}function b(n,c){const a=c||{},i={associationId:h,containerPhrasing:y,containerFlow:v,createTracker:C,compilePattern:u,enter:function(e){return i.stack.push(e),function(){i.stack.pop()}},handlers:{...t.handle},handle:void 0,indentLines:d,indexStack:[],join:[...o],options:{},safe:m,stack:[],unsafe:[...s]};r(i,a),i.options.tightDefinitions&&i.join.push(A),i.handle=e.zwitch("type",{invalid:k,unknown:x,handlers:i.handlers});let f=i.handle(n,void 0,i,{before:"\n",after:"\n",now:{line:1,column:1},lineShift:0});return f&&10!==f.charCodeAt(f.length-1)&&13!==f.charCodeAt(f.length-1)&&(f+="\n"),f}function k(e){throw new Error("Cannot handle value `"+e+"`, expected node")}function x(e){throw new Error("Cannot handle unknown node `"+e.type+"`")}function A(e,t){if("definition"===e.type&&e.type===t.type)return 0}function y(e,n){return function(e,n,r){const c=n.indexStack,a=e.children||[],o=[];let i,s=-1,h=r.before;c.push(-1);let u=n.createTracker(r);for(;++s<a.length;){const f=a[s];let l;if(c[c.length-1]=s,s+1<a.length){let t=n.handle.handlers[a[s+1].type];t&&t.peek&&(t=t.peek),l=t?t(a[s+1],e,n,{before:"",after:"",...u.current()}).charAt(0):""}else l=r.after;o.length>0&&("\r"===h||"\n"===h)&&"html"===f.type&&(o[o.length-1]=o[o.length-1].replace(/(\r?\n|\r)$/," "),h=" ",u=n.createTracker(r),u.move(o.join("")));let d=n.handle(f,e,n,{...u.current(),after:l,before:h});i&&i===d.slice(0,1)&&(d=t.encodeCharacterReference(i.charCodeAt(0))+d.slice(1));const p=n.attentionEncodeSurroundingInfo;n.attentionEncodeSurroundingInfo=void 0,i=void 0,p&&(o.length>0&&p.before&&h===o[o.length-1].slice(-1)&&(o[o.length-1]=o[o.length-1].slice(0,-1)+t.encodeCharacterReference(h.charCodeAt(0))),p.after&&(i=l)),u.move(d),o.push(d),h=d.slice(-1)}return c.pop(),o.join("")}(e,this,n)}function v(e,t){return function(e,t,n){const r=t.indexStack,c=e.children||[],a=t.createTracker(n),o=[];let i=-1;for(r.push(-1);++i<c.length;){const n=c[i];r[r.length-1]=i,o.push(a.move(t.handle(n,e,t,{before:"\n",after:"\n",...a.current()}))),"list"!==n.type&&(t.bulletLastUsed=void 0),i<c.length-1&&o.push(a.move(f(n,c[i+1],e,t)))}return r.pop(),o.join("")}(e,this,t)}function m(e,n){return function(e,n,r){const c=(r.before||"")+(n||"")+(r.after||""),a=[],o=[],i={};let s=-1;for(;++s<e.unsafe.length;){const n=e.unsafe[s];if(!t.patternInScope(e.stack,n))continue;const r=e.compilePattern(n);let o;for(;o=r.exec(c);){const e="before"in n||Boolean(n.atBreak),t="after"in n,r=o.index+(e?o[1].length:0);a.includes(r)?(i[r].before&&!e&&(i[r].before=!1),i[r].after&&!t&&(i[r].after=!1)):(a.push(r),i[r]={before:e,after:t})}}a.sort(p);let h=r.before?r.before.length:0;const u=c.length-(r.after?r.after.length:0);for(s=-1;++s<a.length;){const e=a[s];e<h||e>=u||e+1<u&&a[s+1]===e+1&&i[e].after&&!i[e+1].before&&!i[e+1].after||a[s-1]===e-1&&i[e].before&&!i[e-1].before&&!i[e-1].after||(h!==e&&o.push(g(c.slice(h,e),"\\")),h=e,!/[!-/:-@[-`{-~]/.test(c.charAt(e))||r.encode&&r.encode.includes(c.charAt(e))?(o.push(t.encodeCharacterReference(c.charCodeAt(e))),h++):o.push("\\"))}return o.push(g(c.slice(h,u),r.after)),o.join("")}(this,e,n)}exports.default=function(e){const t=this;t.compiler=function(n){return b(n,{...t.data("settings"),...e,extensions:t.data("toMarkdownExtensions")||[]})}};
@@ -1,4 +1,4 @@
1
- import { n as convertElement, o as convert, p as isElement, w as whitespace } from "./index-DAVe9cfb.js";
1
+ import { n as convertElement, o as convert, p as isElement, w as whitespace } from "./index-BaQU1IvP.js";
2
2
  const embedded = convertElement(
3
3
  /**
4
4
  * @param element
@@ -0,0 +1,4 @@
1
+ import { f } from "./index-BaQU1IvP.js";
2
+ export {
3
+ f as fromDom
4
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-KdW7xIM8.cjs");exports.default=e.remarkGfm;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DFYcGKuT.cjs");exports.default=e.remarkGfm;