@sourcegraph/cody-web 0.32.0 → 0.32.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.
Files changed (54) hide show
  1. package/LICENSE +201 -0
  2. package/dist/{agent.worker-CDpvFRkI.mjs → agent.worker-CKzz1GcO.mjs} +46 -159
  3. package/dist/agent.worker.js +2 -2
  4. package/dist/demo/App.d.ts +4 -0
  5. package/dist/demo/App.d.ts.map +1 -0
  6. package/dist/demo/index.d.ts +2 -0
  7. package/dist/demo/index.d.ts.map +1 -0
  8. package/dist/{git-log-ltF6h_Tk.mjs → git-log-bbWyul1E.mjs} +1 -1
  9. package/dist/{index-D6x43_Eb.mjs → index-zVNzRGEc.mjs} +2 -2
  10. package/dist/index.js +1005 -861
  11. package/dist/lib/agent/agent.client.d.ts +19 -0
  12. package/dist/lib/agent/agent.client.d.ts.map +1 -0
  13. package/dist/lib/agent/agent.worker.d.ts +2 -0
  14. package/dist/lib/agent/agent.worker.d.ts.map +1 -0
  15. package/dist/lib/agent/index-db-storage.d.ts +15 -0
  16. package/dist/lib/agent/index-db-storage.d.ts.map +1 -0
  17. package/dist/lib/agent/shims/child_process.d.ts +5 -0
  18. package/dist/lib/agent/shims/child_process.d.ts.map +1 -0
  19. package/dist/lib/agent/shims/env-paths.d.ts +2 -0
  20. package/dist/lib/agent/shims/env-paths.d.ts.map +1 -0
  21. package/dist/lib/agent/shims/fs-extra.d.ts +3 -0
  22. package/dist/lib/agent/shims/fs-extra.d.ts.map +1 -0
  23. package/dist/lib/agent/shims/fs.d.ts +9 -0
  24. package/dist/lib/agent/shims/fs.d.ts.map +1 -0
  25. package/dist/lib/agent/shims/fs__promises.d.ts +11 -0
  26. package/dist/lib/agent/shims/fs__promises.d.ts.map +1 -0
  27. package/dist/lib/agent/shims/inline-completion-item-provider.d.ts +3 -0
  28. package/dist/lib/agent/shims/inline-completion-item-provider.d.ts.map +1 -0
  29. package/dist/lib/agent/shims/open.d.ts +3 -0
  30. package/dist/lib/agent/shims/open.d.ts.map +1 -0
  31. package/dist/lib/agent/shims/os.d.ts +10 -0
  32. package/dist/lib/agent/shims/os.d.ts.map +1 -0
  33. package/dist/lib/agent/shims/stream.d.ts +9 -0
  34. package/dist/lib/agent/shims/stream.d.ts.map +1 -0
  35. package/dist/lib/agent/shims/worker_threads.d.ts +3 -0
  36. package/dist/lib/agent/shims/worker_threads.d.ts.map +1 -0
  37. package/dist/lib/agent/shims/zlib.d.ts +7 -0
  38. package/dist/lib/agent/shims/zlib.d.ts.map +1 -0
  39. package/dist/lib/components/CodyPromptTemplate.d.ts +25 -0
  40. package/dist/lib/components/CodyPromptTemplate.d.ts.map +1 -0
  41. package/dist/lib/components/CodyWebChat.d.ts +69 -0
  42. package/dist/lib/components/CodyWebChat.d.ts.map +1 -0
  43. package/dist/lib/components/skeleton/ChatSkeleton.d.ts +12 -0
  44. package/dist/lib/components/skeleton/ChatSkeleton.d.ts.map +1 -0
  45. package/dist/lib/components/use-cody-agent.d.ts +20 -0
  46. package/dist/lib/components/use-cody-agent.d.ts.map +1 -0
  47. package/dist/lib/index.d.ts +6 -0
  48. package/dist/lib/index.d.ts.map +1 -0
  49. package/dist/lib/types.d.ts +28 -0
  50. package/dist/lib/types.d.ts.map +1 -0
  51. package/dist/tsconfig.tsbuildinfo +1 -0
  52. package/dist/{util-PivrZJhX.mjs → util-B-IYnWCp.mjs} +1 -1
  53. package/dist/{vscode-shim-Coc7PRnS.mjs → vscode-shim-BmcAncjv.mjs} +93 -105
  54. package/package.json +17 -15
package/dist/index.js CHANGED
@@ -2,8 +2,8 @@ var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
4
  import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
5
- import { i as getDefaultExportFromCjs, L as Ls, k as ke$1, j as ks, F as Fi$1, _ as _s, m as ds, n as bs, o as ii$1, q as qe$1, y as ys, x as xi$1, K as K$2, J as J$2, r as R$3, u as ws, B as B$2, v as g$5, z as h$4, A as _i, S as Ss, E as Br, G as ln, H as bi$1, I as vn, M as xn, N as Nn, O as mn, Q as li$1, V as M$4, W as Ds, X as n$1, Y as ns, Z as le$2, $ as c$3, a0 as t$2, a1 as oe$2, a2 as z$1, a3 as yi$1, a4 as W$2, a5 as Ue$1, a6 as I$2, a7 as Se$2, a8 as O$2, a9 as F$1, aa as Ni$1, ab as ee$1, ac as we$2, ad as b$2, ae as T$3, af as s$2, ag as o$4, ah as w$3, ai as i$2, aj as k$3, ak as D$5, al as p$8, am as m$8, an as S$4, ao as v$4, ap as P$2, aq as E$6, ar as Wi$1, as as L$3, at as d$2, au as a$3, av as l$2, aw as f$2, ax as u$6, ay as r$5, az as RULES_PROVIDER_URI, aA as WEB_PROVIDER_URI, aB as REMOTE_DIRECTORY_PROVIDER_URI, aC as REMOTE_FILE_PROVIDER_URI, aD as REMOTE_REPOSITORY_PROVIDER_URI, aE as SYMBOL_CONTEXT_MENTION_PROVIDER, aF as FILE_CONTEXT_MENTION_PROVIDER, aG as displayPathBasename, aH as displayPath, aI as displayLineRange, aJ as displayPathDirname, aK as IGNORED_FILE_WARNING_LABEL, aL as LARGE_FILE_WARNING_LABEL, aM as xe$2, aN as Ei$1, aO as V$2, aP as Es, aQ as U$2, aR as e, aS as Ns, aT as displayPathWithLines, C as ContextItemSource, aU as URI, aV as is$2, aW as object, aX as literal, aY as string$2, aZ as gs, a_ as serializeContextItem, a$ as CONTEXT_ITEM_MENTION_NODE_TYPE, b0 as contextItemMentionNodeDisplayText, b1 as an, b2 as qr, b3 as _$2, b4 as TEMPLATE_INPUT_NODE_TYPE, b5 as N$2, b6 as parseMentionQuery, b7 as FILE_RANGE_TOOLTIP_LABEL, b8 as NO_SYMBOL_MATCHES_HELP_LABEL, b9 as createExtensionAPI, ba as createMessageAPIForWebview, bb as Observable, bc as debounce, bd as memoizeLastValue, be as toSerializedPromptEditorValue$1, bf as ri$1, bg as isEqual, bh as scanForMentionTriggerInUserTextInput, bi as fs, bj as Ts, bk as ps, bl as getMentionOperations, bm as forceHydration, bn as hydrateAfterPostMessage, bo as isDotCom, bp as isAuthError, bq as isAvailabilityError, br as isSourcegraphToken, bs as trace, bt as context$1, bu as SpanStatusCode, bv as FeatureFlag, h as commonjsGlobal, bw as svg, bx as html$2, by as whitespace, bz as find, bA as stringify, bB as stringify$1, bC as ccount, bD as isCodyProUser, bE as CodyIDE, bF as CodyTaskState, bG as cryptoJsExports, bH as LRUCache, bI as isError, bJ as RateLimitError, bK as upperFirst, bL as lodashExports, bM as createContextItem, bN as isDefined, bO as isCodeSearchContextItem, bP as reformatBotMessageForChat, bQ as isAbortErrorOrSocketHangUp, bR as ModelTag, bS as DeepCodyAgentID, bT as serializedPromptEditorStateFromChatMessage, bU as contextItemsFromPromptEditorValue, bV as filterContextItemsFromPromptEditorValue, bW as CustomCommandType, bX as View, bY as isCodyProModel, bZ as ToolCodyModelName, b_ as getRelativeChatPeriod, b$ as isMacOS, c0 as firstResultFromOperation, c1 as ENTERPRISE_STARTER_LEARN_MORE_URL, c2 as CODY_PRO_SUBSCRIPTION_URL, c3 as ACCOUNT_USAGE_URL, c4 as ENTERPRISE_STARTER_PRICING_URL, c5 as textContentFromSerializedLexicalNode, c6 as firstValueFrom, c7 as skipPendingOperation, c8 as FAST_CHAT_INPUT_TOKEN_BUDGET, c9 as webviewOpenURIForContextItem, ca as pluralize$1, cb as deserializeContextItem, cc as serializedPromptEditorStateFromText, cd as S2_URL, ce as browser, cf as CodyAutoSuggestionMode, cg as isErrorLike, ch as PromptString, ci as setDisplayPathEnvInfo, U as Uri } from "./vscode-shim-Coc7PRnS.mjs";
6
- import { ck, cj } from "./vscode-shim-Coc7PRnS.mjs";
5
+ import { i as getDefaultExportFromCjs, L as Ls, k as ke$1, j as ks, F as Fi$1, _ as _s, m as ds, n as bs, o as ii$1, q as qe$1, y as ys, x as xi$1, K as K$2, J as J$2, r as R$3, u as ws, B as B$2, v as g$5, z as h$4, A as _i, S as Ss, E as Br, G as ln, H as bi$1, I as vn, M as xn, N as Nn, O as mn, Q as li$1, V as M$4, W as Ds, X as n$1, Y as ns, Z as le$2, $ as c$3, a0 as t$2, a1 as oe$2, a2 as z$1, a3 as yi$1, a4 as W$2, a5 as Ue$1, a6 as I$2, a7 as Se$2, a8 as O$2, a9 as F$1, aa as Ni$1, ab as ee$1, ac as we$2, ad as b$2, ae as T$3, af as s$2, ag as o$4, ah as w$3, ai as i$2, aj as k$3, ak as D$5, al as p$8, am as m$8, an as S$4, ao as v$4, ap as P$2, aq as E$6, ar as Wi$1, as as L$3, at as d$2, au as a$3, av as l$2, aw as f$2, ax as u$6, ay as r$5, az as RULES_PROVIDER_URI, aA as WEB_PROVIDER_URI, aB as REMOTE_DIRECTORY_PROVIDER_URI, aC as REMOTE_FILE_PROVIDER_URI, aD as REMOTE_REPOSITORY_PROVIDER_URI, aE as SYMBOL_CONTEXT_MENTION_PROVIDER, aF as FILE_CONTEXT_MENTION_PROVIDER, aG as displayPathBasename, aH as displayPath, aI as displayLineRange, aJ as displayPathDirname, aK as IGNORED_FILE_WARNING_LABEL, aL as LARGE_FILE_WARNING_LABEL, aM as xe$2, aN as Ei$1, aO as V$2, aP as Es, aQ as U$2, aR as e, aS as Ns, aT as displayPathWithLines, C as ContextItemSource, aU as URI, aV as is$2, aW as object, aX as literal, aY as string$2, aZ as gs, a_ as serializeContextItem, a$ as CONTEXT_ITEM_MENTION_NODE_TYPE, b0 as contextItemMentionNodeDisplayText, b1 as an, b2 as qr, b3 as _$2, b4 as TEMPLATE_INPUT_NODE_TYPE, b5 as N$2, b6 as parseMentionQuery, b7 as FILE_RANGE_TOOLTIP_LABEL, b8 as NO_SYMBOL_MATCHES_HELP_LABEL, b9 as createExtensionAPI, ba as createMessageAPIForWebview, bb as Observable, bc as debounce, bd as memoizeLastValue, be as toSerializedPromptEditorValue$1, bf as ri$1, bg as isEqual, bh as scanForMentionTriggerInUserTextInput, bi as fs, bj as Ts, bk as ps, bl as getMentionOperations, bm as forceHydration, bn as hydrateAfterPostMessage, bo as isDotCom, bp as isAuthError, bq as isAvailabilityError, br as isSourcegraphToken, bs as trace, bt as context$1, bu as SpanStatusCode, bv as FeatureFlag, h as commonjsGlobal, bw as svg, bx as html$2, by as whitespace, bz as find, bA as stringify, bB as stringify$1, bC as ccount, bD as isCodyProUser, bE as CodyIDE, bF as CodyTaskState, bG as cryptoJsExports, bH as LRUCache, bI as isError, bJ as RateLimitError, bK as upperFirst, bL as lodashExports, bM as createContextItem, bN as isDefined, bO as isCodeSearchContextItem, bP as reformatBotMessageForChat, bQ as isAbortErrorOrSocketHangUp, bR as ModelTag, bS as DeepCodyAgentID, bT as serializedPromptEditorStateFromChatMessage, bU as contextItemsFromPromptEditorValue, bV as filterContextItemsFromPromptEditorValue, bW as CustomCommandType, bX as View, bY as isCodyProModel, bZ as ToolCodyModelName, b_ as getRelativeChatPeriod, b$ as isMacOS, c0 as firstResultFromOperation, c1 as ENTERPRISE_STARTER_LEARN_MORE_URL, c2 as CODY_PRO_SUBSCRIPTION_URL, c3 as ACCOUNT_USAGE_URL, c4 as ENTERPRISE_STARTER_PRICING_URL, c5 as textContentFromSerializedLexicalNode, c6 as firstValueFrom, c7 as skipPendingOperation, c8 as FAST_CHAT_INPUT_TOKEN_BUDGET, c9 as webviewOpenURIForContextItem, ca as pluralize$1, cb as deserializeContextItem, cc as serializedPromptEditorStateFromText, cd as S2_URL, ce as browser, cf as CodyAutoSuggestionMode, cg as isErrorLike, ch as PromptString, ci as setDisplayPathEnvInfo, U as Uri } from "./vscode-shim-BmcAncjv.mjs";
6
+ import { ck, cj } from "./vscode-shim-BmcAncjv.mjs";
7
7
  import * as React$2 from "react";
8
8
  import React__default, { createContext, useContext, useMemo as useMemo$1, useLayoutEffect as useLayoutEffect$1, useEffect as useEffect$2, forwardRef, useState as useState$1, useCallback, useRef as useRef$1, Suspense, createElement, memo as memo$1, useImperativeHandle, Fragment as Fragment$2, Children, isValidElement, cloneElement, useReducer } from "react";
9
9
  var classnames = { exports: {} };
@@ -27046,7 +27046,7 @@ function isOverflowElement(element2) {
27046
27046
  function isTableElement(element2) {
27047
27047
  return ["table", "td", "th"].includes(getNodeName(element2));
27048
27048
  }
27049
- function isTopLayer(element2) {
27049
+ function isTopLayer$1(element2) {
27050
27050
  return [":popover-open", ":modal"].some((selector) => {
27051
27051
  try {
27052
27052
  return element2.matches(selector);
@@ -27058,14 +27058,14 @@ function isTopLayer(element2) {
27058
27058
  function isContainingBlock(elementOrCss) {
27059
27059
  const webkit2 = isWebKit();
27060
27060
  const css2 = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
27061
- return ["transform", "translate", "scale", "rotate", "perspective"].some((value) => css2[value] ? css2[value] !== "none" : false) || (css2.containerType ? css2.containerType !== "normal" : false) || !webkit2 && (css2.backdropFilter ? css2.backdropFilter !== "none" : false) || !webkit2 && (css2.filter ? css2.filter !== "none" : false) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((value) => (css2.willChange || "").includes(value)) || ["paint", "layout", "strict", "content"].some((value) => (css2.contain || "").includes(value));
27061
+ return css2.transform !== "none" || css2.perspective !== "none" || (css2.containerType ? css2.containerType !== "normal" : false) || !webkit2 && (css2.backdropFilter ? css2.backdropFilter !== "none" : false) || !webkit2 && (css2.filter ? css2.filter !== "none" : false) || ["transform", "perspective", "filter"].some((value) => (css2.willChange || "").includes(value)) || ["paint", "layout", "strict", "content"].some((value) => (css2.contain || "").includes(value));
27062
27062
  }
27063
27063
  function getContainingBlock(element2) {
27064
27064
  let currentNode = getParentNode(element2);
27065
27065
  while (isHTMLElement$1(currentNode) && !isLastTraversableNode(currentNode)) {
27066
27066
  if (isContainingBlock(currentNode)) {
27067
27067
  return currentNode;
27068
- } else if (isTopLayer(currentNode)) {
27068
+ } else if (isTopLayer$1(currentNode)) {
27069
27069
  return null;
27070
27070
  }
27071
27071
  currentNode = getParentNode(currentNode);
@@ -27513,7 +27513,7 @@ async function detectOverflow(state, options) {
27513
27513
  right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
27514
27514
  };
27515
27515
  }
27516
- const arrow$3 = (options) => ({
27516
+ const arrow$2 = (options) => ({
27517
27517
  name: "arrow",
27518
27518
  options,
27519
27519
  async fn(state) {
@@ -27671,7 +27671,7 @@ const autoPlacement$2 = function(options) {
27671
27671
  }
27672
27672
  };
27673
27673
  };
27674
- const flip$2 = function(options) {
27674
+ const flip$1 = function(options) {
27675
27675
  if (options === void 0) {
27676
27676
  options = {};
27677
27677
  }
@@ -27701,12 +27701,10 @@ const flip$2 = function(options) {
27701
27701
  return {};
27702
27702
  }
27703
27703
  const side = getSide(placement);
27704
- const initialSideAxis = getSideAxis(initialPlacement);
27705
27704
  const isBasePlacement = getSide(initialPlacement) === initialPlacement;
27706
27705
  const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
27707
27706
  const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
27708
- const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
27709
- if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
27707
+ if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== "none") {
27710
27708
  fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
27711
27709
  }
27712
27710
  const placements2 = [initialPlacement, ...fallbackPlacements];
@@ -27743,16 +27741,8 @@ const flip$2 = function(options) {
27743
27741
  if (!resetPlacement) {
27744
27742
  switch (fallbackStrategy) {
27745
27743
  case "bestFit": {
27746
- var _overflowsData$filter2;
27747
- const placement2 = (_overflowsData$filter2 = overflowsData.filter((d2) => {
27748
- if (hasFallbackAxisSideDirection) {
27749
- const currentSideAxis = getSideAxis(d2.placement);
27750
- return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal
27751
- // reading directions favoring greater width.
27752
- currentSideAxis === "y";
27753
- }
27754
- return true;
27755
- }).map((d2) => [d2.placement, d2.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a2, b2) => a2[1] - b2[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
27744
+ var _overflowsData$map$so;
27745
+ const placement2 = (_overflowsData$map$so = overflowsData.map((d2) => [d2.placement, d2.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a2, b2) => a2[1] - b2[1])[0]) == null ? void 0 : _overflowsData$map$so[0];
27756
27746
  if (placement2) {
27757
27747
  resetPlacement = placement2;
27758
27748
  }
@@ -27786,7 +27776,7 @@ function getSideOffsets(overflow, rect) {
27786
27776
  function isAnySideFullyClipped(overflow) {
27787
27777
  return sides.some((side) => overflow[side] >= 0);
27788
27778
  }
27789
- const hide$2 = function(options) {
27779
+ const hide$1 = function(options) {
27790
27780
  if (options === void 0) {
27791
27781
  options = {};
27792
27782
  }
@@ -27857,9 +27847,10 @@ async function convertValueToCoords(state, options) {
27857
27847
  crossAxis: 0,
27858
27848
  alignmentAxis: null
27859
27849
  } : {
27860
- mainAxis: rawValue.mainAxis || 0,
27861
- crossAxis: rawValue.crossAxis || 0,
27862
- alignmentAxis: rawValue.alignmentAxis
27850
+ mainAxis: 0,
27851
+ crossAxis: 0,
27852
+ alignmentAxis: null,
27853
+ ...rawValue
27863
27854
  };
27864
27855
  if (alignment && typeof alignmentAxis === "number") {
27865
27856
  crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
@@ -27964,17 +27955,13 @@ const shift$2 = function(options) {
27964
27955
  ...limitedCoords,
27965
27956
  data: {
27966
27957
  x: limitedCoords.x - x2,
27967
- y: limitedCoords.y - y2,
27968
- enabled: {
27969
- [mainAxis]: checkMainAxis,
27970
- [crossAxis]: checkCrossAxis
27971
- }
27958
+ y: limitedCoords.y - y2
27972
27959
  }
27973
27960
  };
27974
27961
  }
27975
27962
  };
27976
27963
  };
27977
- const limitShift$2 = function(options) {
27964
+ const limitShift$1 = function(options) {
27978
27965
  if (options === void 0) {
27979
27966
  options = {};
27980
27967
  }
@@ -28047,7 +28034,6 @@ const size$2 = function(options) {
28047
28034
  name: "size",
28048
28035
  options,
28049
28036
  async fn(state) {
28050
- var _state$middlewareData, _state$middlewareData2;
28051
28037
  const {
28052
28038
  placement,
28053
28039
  rects,
@@ -28076,18 +28062,17 @@ const size$2 = function(options) {
28076
28062
  widthSide = side;
28077
28063
  heightSide = alignment === "end" ? "top" : "bottom";
28078
28064
  }
28079
- const maximumClippingHeight = height - overflow.top - overflow.bottom;
28080
- const maximumClippingWidth = width - overflow.left - overflow.right;
28081
- const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
28082
- const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
28065
+ const overflowAvailableHeight = height - overflow[heightSide];
28066
+ const overflowAvailableWidth = width - overflow[widthSide];
28083
28067
  const noShift = !state.middlewareData.shift;
28084
28068
  let availableHeight = overflowAvailableHeight;
28085
28069
  let availableWidth = overflowAvailableWidth;
28086
- if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {
28087
- availableWidth = maximumClippingWidth;
28088
- }
28089
- if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {
28090
- availableHeight = maximumClippingHeight;
28070
+ if (isYAxis) {
28071
+ const maximumClippingWidth = width - overflow.left - overflow.right;
28072
+ availableWidth = alignment || noShift ? min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;
28073
+ } else {
28074
+ const maximumClippingHeight = height - overflow.top - overflow.bottom;
28075
+ availableHeight = alignment || noShift ? min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;
28091
28076
  }
28092
28077
  if (noShift && !alignment) {
28093
28078
  const xMin = max(overflow.left, 0);
@@ -28210,7 +28195,7 @@ function getBoundingClientRect(element2, includeScale, isFixedStrategy, offsetPa
28210
28195
  const win = getWindow(domElement);
28211
28196
  const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
28212
28197
  let currentWin = win;
28213
- let currentIFrame = getFrameElement(currentWin);
28198
+ let currentIFrame = currentWin.frameElement;
28214
28199
  while (currentIFrame && offsetParent && offsetWin !== currentWin) {
28215
28200
  const iframeScale = getScale(currentIFrame);
28216
28201
  const iframeRect = currentIFrame.getBoundingClientRect();
@@ -28224,7 +28209,7 @@ function getBoundingClientRect(element2, includeScale, isFixedStrategy, offsetPa
28224
28209
  x2 += left;
28225
28210
  y2 += top;
28226
28211
  currentWin = getWindow(currentIFrame);
28227
- currentIFrame = getFrameElement(currentWin);
28212
+ currentIFrame = currentWin.frameElement;
28228
28213
  }
28229
28214
  }
28230
28215
  return rectToClientRect({
@@ -28234,27 +28219,15 @@ function getBoundingClientRect(element2, includeScale, isFixedStrategy, offsetPa
28234
28219
  y: y2
28235
28220
  });
28236
28221
  }
28237
- function getWindowScrollBarX(element2, rect) {
28238
- const leftScroll = getNodeScroll(element2).scrollLeft;
28239
- if (!rect) {
28240
- return getBoundingClientRect(getDocumentElement(element2)).left + leftScroll;
28241
- }
28242
- return rect.left + leftScroll;
28243
- }
28244
- function getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {
28245
- if (ignoreScrollbarX === void 0) {
28246
- ignoreScrollbarX = false;
28247
- }
28248
- const htmlRect = documentElement.getBoundingClientRect();
28249
- const x2 = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 : (
28250
- // RTL <body> scrollbar.
28251
- getWindowScrollBarX(documentElement, htmlRect)
28252
- ));
28253
- const y2 = htmlRect.top + scroll.scrollTop;
28254
- return {
28255
- x: x2,
28256
- y: y2
28257
- };
28222
+ const topLayerSelectors = [":popover-open", ":modal"];
28223
+ function isTopLayer(floating) {
28224
+ return topLayerSelectors.some((selector) => {
28225
+ try {
28226
+ return floating.matches(selector);
28227
+ } catch (e2) {
28228
+ return false;
28229
+ }
28230
+ });
28258
28231
  }
28259
28232
  function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
28260
28233
  let {
@@ -28287,17 +28260,19 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
28287
28260
  offsets.y = offsetRect.y + offsetParent.clientTop;
28288
28261
  }
28289
28262
  }
28290
- const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);
28291
28263
  return {
28292
28264
  width: rect.width * scale.x,
28293
28265
  height: rect.height * scale.y,
28294
- x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
28295
- y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
28266
+ x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
28267
+ y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
28296
28268
  };
28297
28269
  }
28298
28270
  function getClientRects(element2) {
28299
28271
  return Array.from(element2.getClientRects());
28300
28272
  }
28273
+ function getWindowScrollBarX(element2) {
28274
+ return getBoundingClientRect(getDocumentElement(element2)).left + getNodeScroll(element2).scrollLeft;
28275
+ }
28301
28276
  function getDocumentRect(element2) {
28302
28277
  const html2 = getDocumentElement(element2);
28303
28278
  const scroll = getNodeScroll(element2);
@@ -28367,10 +28342,9 @@ function getClientRectFromClippingAncestor(element2, clippingAncestor, strategy)
28367
28342
  } else {
28368
28343
  const visualOffsets = getVisualOffsets(element2);
28369
28344
  rect = {
28345
+ ...clippingAncestor,
28370
28346
  x: clippingAncestor.x - visualOffsets.x,
28371
- y: clippingAncestor.y - visualOffsets.y,
28372
- width: clippingAncestor.width,
28373
- height: clippingAncestor.height
28347
+ y: clippingAncestor.y - visualOffsets.y
28374
28348
  };
28375
28349
  }
28376
28350
  return rectToClientRect(rect);
@@ -28415,7 +28389,7 @@ function getClippingRect(_ref) {
28415
28389
  rootBoundary,
28416
28390
  strategy
28417
28391
  } = _ref;
28418
- const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element2) ? [] : getClippingElementAncestors(element2, this._c) : [].concat(boundary);
28392
+ const elementClippingAncestors = boundary === "clippingAncestors" ? getClippingElementAncestors(element2, this._c) : [].concat(boundary);
28419
28393
  const clippingAncestors = [...elementClippingAncestors, rootBoundary];
28420
28394
  const firstClippingAncestor = clippingAncestors[0];
28421
28395
  const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
@@ -28465,9 +28439,8 @@ function getRectRelativeToOffsetParent(element2, offsetParent, strategy) {
28465
28439
  offsets.x = getWindowScrollBarX(documentElement);
28466
28440
  }
28467
28441
  }
28468
- const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
28469
- const x2 = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
28470
- const y2 = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
28442
+ const x2 = rect.left + scroll.scrollLeft - offsets.x;
28443
+ const y2 = rect.top + scroll.scrollTop - offsets.y;
28471
28444
  return {
28472
28445
  x: x2,
28473
28446
  y: y2,
@@ -28475,9 +28448,6 @@ function getRectRelativeToOffsetParent(element2, offsetParent, strategy) {
28475
28448
  height: rect.height
28476
28449
  };
28477
28450
  }
28478
- function isStaticPositioned(element2) {
28479
- return getComputedStyle$1(element2).position === "static";
28480
- }
28481
28451
  function getTrueOffsetParent(element2, polyfill) {
28482
28452
  if (!isHTMLElement$1(element2) || getComputedStyle$1(element2).position === "fixed") {
28483
28453
  return null;
@@ -28485,35 +28455,21 @@ function getTrueOffsetParent(element2, polyfill) {
28485
28455
  if (polyfill) {
28486
28456
  return polyfill(element2);
28487
28457
  }
28488
- let rawOffsetParent = element2.offsetParent;
28489
- if (getDocumentElement(element2) === rawOffsetParent) {
28490
- rawOffsetParent = rawOffsetParent.ownerDocument.body;
28491
- }
28492
- return rawOffsetParent;
28458
+ return element2.offsetParent;
28493
28459
  }
28494
28460
  function getOffsetParent(element2, polyfill) {
28495
- const win = getWindow(element2);
28496
- if (isTopLayer(element2)) {
28497
- return win;
28498
- }
28499
- if (!isHTMLElement$1(element2)) {
28500
- let svgOffsetParent = getParentNode(element2);
28501
- while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
28502
- if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
28503
- return svgOffsetParent;
28504
- }
28505
- svgOffsetParent = getParentNode(svgOffsetParent);
28506
- }
28507
- return win;
28461
+ const window2 = getWindow(element2);
28462
+ if (!isHTMLElement$1(element2) || isTopLayer(element2)) {
28463
+ return window2;
28508
28464
  }
28509
28465
  let offsetParent = getTrueOffsetParent(element2, polyfill);
28510
- while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
28466
+ while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === "static") {
28511
28467
  offsetParent = getTrueOffsetParent(offsetParent, polyfill);
28512
28468
  }
28513
- if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
28514
- return win;
28469
+ if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle$1(offsetParent).position === "static" && !isContainingBlock(offsetParent))) {
28470
+ return window2;
28515
28471
  }
28516
- return offsetParent || getContainingBlock(element2) || win;
28472
+ return offsetParent || getContainingBlock(element2) || window2;
28517
28473
  }
28518
28474
  const getElementRects = async function(data) {
28519
28475
  const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
@@ -28544,9 +28500,6 @@ const platform = {
28544
28500
  isElement,
28545
28501
  isRTL
28546
28502
  };
28547
- function rectsAreEqual(a2, b2) {
28548
- return a2.x === b2.x && a2.y === b2.y && a2.width === b2.width && a2.height === b2.height;
28549
- }
28550
28503
  function observeMove(element2, onMove) {
28551
28504
  let io = null;
28552
28505
  let timeoutId;
@@ -28565,13 +28518,12 @@ function observeMove(element2, onMove) {
28565
28518
  threshold = 1;
28566
28519
  }
28567
28520
  cleanup();
28568
- const elementRectForRootMargin = element2.getBoundingClientRect();
28569
28521
  const {
28570
28522
  left,
28571
28523
  top,
28572
28524
  width,
28573
28525
  height
28574
- } = elementRectForRootMargin;
28526
+ } = element2.getBoundingClientRect();
28575
28527
  if (!skip) {
28576
28528
  onMove();
28577
28529
  }
@@ -28602,9 +28554,6 @@ function observeMove(element2, onMove) {
28602
28554
  refresh(false, ratio);
28603
28555
  }
28604
28556
  }
28605
- if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element2.getBoundingClientRect())) {
28606
- refresh();
28607
- }
28608
28557
  isFirstUpdate = false;
28609
28558
  }
28610
28559
  try {
@@ -28668,7 +28617,7 @@ function autoUpdate(reference, floating, update2, options) {
28668
28617
  }
28669
28618
  function frameLoop() {
28670
28619
  const nextRefRect = getBoundingClientRect(reference);
28671
- if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
28620
+ if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
28672
28621
  update2();
28673
28622
  }
28674
28623
  prevRefRect = nextRefRect;
@@ -28692,11 +28641,11 @@ function autoUpdate(reference, floating, update2, options) {
28692
28641
  const offset$1 = offset$2;
28693
28642
  const autoPlacement$1 = autoPlacement$2;
28694
28643
  const shift$1 = shift$2;
28695
- const flip$1 = flip$2;
28644
+ const flip = flip$1;
28696
28645
  const size$1 = size$2;
28697
- const hide$1 = hide$2;
28698
- const arrow$2 = arrow$3;
28699
- const limitShift$1 = limitShift$2;
28646
+ const hide = hide$1;
28647
+ const arrow$1 = arrow$2;
28648
+ const limitShift = limitShift$1;
28700
28649
  const computePosition = (reference, floating, options) => {
28701
28650
  const cache2 = /* @__PURE__ */ new Map();
28702
28651
  const mergedOptions = {
@@ -28712,8 +28661,8 @@ const computePosition = (reference, floating, options) => {
28712
28661
  platform: platformWithCache
28713
28662
  });
28714
28663
  };
28715
- var index$3 = typeof document !== "undefined" ? useLayoutEffect$1 : useEffect$2;
28716
- function deepEqual(a2, b2) {
28664
+ var index$4 = typeof document !== "undefined" ? useLayoutEffect$1 : useEffect$2;
28665
+ function deepEqual$1(a2, b2) {
28717
28666
  if (a2 === b2) {
28718
28667
  return true;
28719
28668
  }
@@ -28731,7 +28680,7 @@ function deepEqual(a2, b2) {
28731
28680
  length = a2.length;
28732
28681
  if (length !== b2.length) return false;
28733
28682
  for (i = length; i-- !== 0; ) {
28734
- if (!deepEqual(a2[i], b2[i])) {
28683
+ if (!deepEqual$1(a2[i], b2[i])) {
28735
28684
  return false;
28736
28685
  }
28737
28686
  }
@@ -28752,7 +28701,7 @@ function deepEqual(a2, b2) {
28752
28701
  if (key === "_owner" && a2.$$typeof) {
28753
28702
  continue;
28754
28703
  }
28755
- if (!deepEqual(a2[key], b2[key])) {
28704
+ if (!deepEqual$1(a2[key], b2[key])) {
28756
28705
  return false;
28757
28706
  }
28758
28707
  }
@@ -28760,25 +28709,25 @@ function deepEqual(a2, b2) {
28760
28709
  }
28761
28710
  return a2 !== a2 && b2 !== b2;
28762
28711
  }
28763
- function getDPR(element2) {
28712
+ function getDPR$1(element2) {
28764
28713
  if (typeof window === "undefined") {
28765
28714
  return 1;
28766
28715
  }
28767
28716
  const win = element2.ownerDocument.defaultView || window;
28768
28717
  return win.devicePixelRatio || 1;
28769
28718
  }
28770
- function roundByDPR(element2, value) {
28771
- const dpr = getDPR(element2);
28719
+ function roundByDPR$1(element2, value) {
28720
+ const dpr = getDPR$1(element2);
28772
28721
  return Math.round(value * dpr) / dpr;
28773
28722
  }
28774
- function useLatestRef$1(value) {
28723
+ function useLatestRef$2(value) {
28775
28724
  const ref = React$2.useRef(value);
28776
- index$3(() => {
28725
+ index$4(() => {
28777
28726
  ref.current = value;
28778
28727
  });
28779
28728
  return ref;
28780
28729
  }
28781
- function useFloating$1(options) {
28730
+ function useFloating$2(options) {
28782
28731
  if (options === void 0) {
28783
28732
  options = {};
28784
28733
  }
@@ -28804,7 +28753,7 @@ function useFloating$1(options) {
28804
28753
  isPositioned: false
28805
28754
  });
28806
28755
  const [latestMiddleware, setLatestMiddleware] = React$2.useState(middleware);
28807
- if (!deepEqual(latestMiddleware, middleware)) {
28756
+ if (!deepEqual$1(latestMiddleware, middleware)) {
28808
28757
  setLatestMiddleware(middleware);
28809
28758
  }
28810
28759
  const [_reference, _setReference] = React$2.useState(null);
@@ -28827,9 +28776,9 @@ function useFloating$1(options) {
28827
28776
  const floatingRef = React$2.useRef(null);
28828
28777
  const dataRef = React$2.useRef(data);
28829
28778
  const hasWhileElementsMounted = whileElementsMounted != null;
28830
- const whileElementsMountedRef = useLatestRef$1(whileElementsMounted);
28831
- const platformRef = useLatestRef$1(platform2);
28832
- const openRef = useLatestRef$1(open);
28779
+ const whileElementsMountedRef = useLatestRef$2(whileElementsMounted);
28780
+ const platformRef = useLatestRef$2(platform2);
28781
+ const openRef = useLatestRef$2(open);
28833
28782
  const update2 = React$2.useCallback(() => {
28834
28783
  if (!referenceRef.current || !floatingRef.current) {
28835
28784
  return;
@@ -28851,7 +28800,7 @@ function useFloating$1(options) {
28851
28800
  // setting it to `true` when `open === false` (must be specified).
28852
28801
  isPositioned: openRef.current !== false
28853
28802
  };
28854
- if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
28803
+ if (isMountedRef.current && !deepEqual$1(dataRef.current, fullData)) {
28855
28804
  dataRef.current = fullData;
28856
28805
  reactDomExports.flushSync(() => {
28857
28806
  setData(fullData);
@@ -28859,7 +28808,7 @@ function useFloating$1(options) {
28859
28808
  }
28860
28809
  });
28861
28810
  }, [latestMiddleware, placement, strategy, platformRef, openRef]);
28862
- index$3(() => {
28811
+ index$4(() => {
28863
28812
  if (open === false && dataRef.current.isPositioned) {
28864
28813
  dataRef.current.isPositioned = false;
28865
28814
  setData((data2) => ({
@@ -28869,13 +28818,13 @@ function useFloating$1(options) {
28869
28818
  }
28870
28819
  }, [open]);
28871
28820
  const isMountedRef = React$2.useRef(false);
28872
- index$3(() => {
28821
+ index$4(() => {
28873
28822
  isMountedRef.current = true;
28874
28823
  return () => {
28875
28824
  isMountedRef.current = false;
28876
28825
  };
28877
28826
  }, []);
28878
- index$3(() => {
28827
+ index$4(() => {
28879
28828
  if (referenceEl) referenceRef.current = referenceEl;
28880
28829
  if (floatingEl) floatingRef.current = floatingEl;
28881
28830
  if (referenceEl && floatingEl) {
@@ -28904,13 +28853,13 @@ function useFloating$1(options) {
28904
28853
  if (!elements.floating) {
28905
28854
  return initialStyles;
28906
28855
  }
28907
- const x2 = roundByDPR(elements.floating, data.x);
28908
- const y2 = roundByDPR(elements.floating, data.y);
28856
+ const x2 = roundByDPR$1(elements.floating, data.x);
28857
+ const y2 = roundByDPR$1(elements.floating, data.y);
28909
28858
  if (transform2) {
28910
28859
  return {
28911
28860
  ...initialStyles,
28912
28861
  transform: "translate(" + x2 + "px, " + y2 + "px)",
28913
- ...getDPR(elements.floating) >= 1.5 && {
28862
+ ...getDPR$1(elements.floating) >= 1.5 && {
28914
28863
  willChange: "transform"
28915
28864
  }
28916
28865
  };
@@ -28929,37 +28878,6 @@ function useFloating$1(options) {
28929
28878
  floatingStyles
28930
28879
  }), [data, update2, refs, elements, floatingStyles]);
28931
28880
  }
28932
- const arrow$1 = (options) => {
28933
- function isRef(value) {
28934
- return {}.hasOwnProperty.call(value, "current");
28935
- }
28936
- return {
28937
- name: "arrow",
28938
- options,
28939
- fn(state) {
28940
- const {
28941
- element: element2,
28942
- padding
28943
- } = typeof options === "function" ? options(state) : options;
28944
- if (element2 && isRef(element2)) {
28945
- if (element2.current != null) {
28946
- return arrow$2({
28947
- element: element2.current,
28948
- padding
28949
- }).fn(state);
28950
- }
28951
- return {};
28952
- }
28953
- if (element2) {
28954
- return arrow$2({
28955
- element: element2,
28956
- padding
28957
- }).fn(state);
28958
- }
28959
- return {};
28960
- }
28961
- };
28962
- };
28963
28881
  const offset = (options, deps) => ({
28964
28882
  ...offset$1(options),
28965
28883
  options: [options, deps]
@@ -28968,14 +28886,6 @@ const shift = (options, deps) => ({
28968
28886
  ...shift$1(options),
28969
28887
  options: [options, deps]
28970
28888
  });
28971
- const limitShift = (options, deps) => ({
28972
- ...limitShift$1(options),
28973
- options: [options, deps]
28974
- });
28975
- const flip = (options, deps) => ({
28976
- ...flip$1(options),
28977
- options: [options, deps]
28978
- });
28979
28889
  const size = (options, deps) => ({
28980
28890
  ...size$1(options),
28981
28891
  options: [options, deps]
@@ -28984,14 +28894,6 @@ const autoPlacement = (options, deps) => ({
28984
28894
  ...autoPlacement$1(options),
28985
28895
  options: [options, deps]
28986
28896
  });
28987
- const hide = (options, deps) => ({
28988
- ...hide$1(options),
28989
- options: [options, deps]
28990
- });
28991
- const arrow = (options, deps) => ({
28992
- ...arrow$1(options),
28993
- options: [options, deps]
28994
- });
28995
28897
  const SafeReact = {
28996
28898
  ...React$2
28997
28899
  };
@@ -29010,7 +28912,7 @@ function useEffectEvent(callback) {
29010
28912
  return ref.current == null ? void 0 : ref.current(...args);
29011
28913
  }, []);
29012
28914
  }
29013
- var index$2 = typeof document !== "undefined" ? useLayoutEffect$1 : useEffect$2;
28915
+ var index$3 = typeof document !== "undefined" ? useLayoutEffect$1 : useEffect$2;
29014
28916
  let serverHandoffComplete = false;
29015
28917
  let count$1 = 0;
29016
28918
  const genId = () => (
@@ -29020,7 +28922,7 @@ const genId = () => (
29020
28922
  );
29021
28923
  function useFloatingId() {
29022
28924
  const [id2, setId] = React$2.useState(() => serverHandoffComplete ? genId() : void 0);
29023
- index$2(() => {
28925
+ index$3(() => {
29024
28926
  if (id2 == null) {
29025
28927
  setId(genId());
29026
28928
  }
@@ -29058,9 +28960,9 @@ const useFloatingTree = () => React$2.useContext(FloatingTreeContext);
29058
28960
  function createAttribute(name2) {
29059
28961
  return "data-floating-ui-" + name2;
29060
28962
  }
29061
- function useLatestRef(value) {
28963
+ function useLatestRef$1(value) {
29062
28964
  const ref = useRef$1(value);
29063
- index$2(() => {
28965
+ index$3(() => {
29064
28966
  ref.current = value;
29065
28967
  });
29066
28968
  return ref;
@@ -29096,9 +28998,9 @@ function useHover(context2, props) {
29096
28998
  } = props;
29097
28999
  const tree = useFloatingTree();
29098
29000
  const parentId = useFloatingParentNodeId();
29099
- const handleCloseRef = useLatestRef(handleClose);
29100
- const delayRef = useLatestRef(delay);
29101
- const openRef = useLatestRef(open);
29001
+ const handleCloseRef = useLatestRef$1(handleClose);
29002
+ const delayRef = useLatestRef$1(delay);
29003
+ const openRef = useLatestRef$1(open);
29102
29004
  const pointerTypeRef = React$2.useRef();
29103
29005
  const timeoutRef = React$2.useRef(-1);
29104
29006
  const handlerRef = React$2.useRef();
@@ -29268,7 +29170,7 @@ function useHover(context2, props) {
29268
29170
  };
29269
29171
  }
29270
29172
  }, [elements, enabled, context2, mouseOnly, restMs, move, closeWithDelay, cleanupMouseMoveHandler, clearPointerEvents, onOpenChange, open, openRef, tree, delayRef, handleCloseRef, dataRef, isClickLikeOpenEvent]);
29271
- index$2(() => {
29173
+ index$3(() => {
29272
29174
  var _handleCloseRef$curre;
29273
29175
  if (!enabled) return;
29274
29176
  if (open && (_handleCloseRef$curre = handleCloseRef.current) != null && _handleCloseRef$curre.__options.blockPointerEvents && isHoverOpen()) {
@@ -29294,7 +29196,7 @@ function useHover(context2, props) {
29294
29196
  }
29295
29197
  }
29296
29198
  }, [enabled, open, parentId, elements, tree, handleCloseRef, isHoverOpen]);
29297
- index$2(() => {
29199
+ index$3(() => {
29298
29200
  if (!open) {
29299
29201
  pointerTypeRef.current = void 0;
29300
29202
  restTimeoutPendingRef.current = false;
@@ -29679,7 +29581,7 @@ function useFloatingRootContext(options) {
29679
29581
  refs
29680
29582
  }), [open, onOpenChange, elements, events, floatingId, refs]);
29681
29583
  }
29682
- function useFloating(options) {
29584
+ function useFloating$1(options) {
29683
29585
  if (options === void 0) {
29684
29586
  options = {};
29685
29587
  }
@@ -29702,12 +29604,12 @@ function useFloating(options) {
29702
29604
  const domReference = optionDomReference || _domReference;
29703
29605
  const domReferenceRef = React$2.useRef(null);
29704
29606
  const tree = useFloatingTree();
29705
- index$2(() => {
29607
+ index$3(() => {
29706
29608
  if (domReference) {
29707
29609
  domReferenceRef.current = domReference;
29708
29610
  }
29709
29611
  }, [domReference]);
29710
- const position2 = useFloating$1({
29612
+ const position2 = useFloating$2({
29711
29613
  ...options,
29712
29614
  elements: {
29713
29615
  ...computedElements,
@@ -29753,7 +29655,7 @@ function useFloating(options) {
29753
29655
  elements,
29754
29656
  nodeId
29755
29657
  }), [position2, refs, elements, nodeId, rootContext]);
29756
- index$2(() => {
29658
+ index$3(() => {
29757
29659
  rootContext.dataRef.current.floatingContext = context2;
29758
29660
  const node2 = tree == null ? void 0 : tree.nodesRef.current.find((node22) => node22.id === nodeId);
29759
29661
  if (node2) {
@@ -29869,7 +29771,7 @@ const MentionsMenu = ({
29869
29771
  renderItem
29870
29772
  }) => {
29871
29773
  const container2 = useRef$1(null);
29872
- const { refs, floatingStyles, update: update2 } = useFloating({
29774
+ const { refs, floatingStyles, update: update2 } = useFloating$1({
29873
29775
  open: true,
29874
29776
  placement: "bottom-start",
29875
29777
  whileElementsMounted: autoUpdate,
@@ -29967,7 +29869,7 @@ const MentionsMenu = ({
29967
29869
  const headerClass = "!tw-p-0 !tw-border-b-0 !tw-p-3 !tw-text-md !tw-leading-[1.2] !tw-h-[30px] tw-opacity-50";
29968
29870
  const menuClass = "tw-overflow-hidden tw-overflow-y-auto tw-rounded-md tw-bg-popover tw-text-popover-foreground";
29969
29871
  const itemClass = "w-relative tw-cursor-pointer tw-select-none tw-items-center tw-py-3 tw-px-2 tw-text-md tw-outline-none aria-selected:tw-bg-accent aria-selected:tw-text-accent-foreground hover:tw-bg-accent hover:tw-text-accent-foreground data-[disabled=true]:tw-pointer-events-none data-[disabled=true]:tw-opacity-50 !tw-p-3 !tw-text-md !tw-leading-[1.2] !tw-min-h-[30px] !tw-rounded-none";
29970
- var index$1 = useLayoutEffect$1;
29872
+ var index$2 = useLayoutEffect$1;
29971
29873
  var withSelector = { exports: {} };
29972
29874
  var withSelector_production = {};
29973
29875
  var shim$2 = { exports: {} };
@@ -30135,7 +30037,7 @@ function useIdleActorRef(logic, ...[options]) {
30135
30037
  setCurrent([logic.config, newActorRef]);
30136
30038
  actorRef = newActorRef;
30137
30039
  }
30138
- index$1(() => {
30040
+ index$2(() => {
30139
30041
  actorRef.logic.implementations = logic.implementations;
30140
30042
  });
30141
30043
  return actorRef;
@@ -30219,7 +30121,7 @@ const MentionChip = (props) => {
30219
30121
  const [isOpen, setIsOpen] = useState$1(false);
30220
30122
  const tooltip = tooltipForContextItem(props.item);
30221
30123
  const enableTooltip = !!tooltip;
30222
- const { refs, floatingStyles, context: context2 } = useFloating({
30124
+ const { refs, floatingStyles, context: context2 } = useFloating$1({
30223
30125
  open: isOpen,
30224
30126
  onOpenChange: setIsOpen,
30225
30127
  strategy: "fixed",
@@ -30857,14 +30759,19 @@ function useClientActionListener(props, listener) {
30857
30759
  });
30858
30760
  }, [clientActionListeners, listener, isActive]);
30859
30761
  }
30860
- function _extends() {
30861
- return _extends = Object.assign ? Object.assign.bind() : function(n2) {
30862
- for (var e2 = 1; e2 < arguments.length; e2++) {
30863
- var t2 = arguments[e2];
30864
- for (var r2 in t2) ({}).hasOwnProperty.call(t2, r2) && (n2[r2] = t2[r2]);
30762
+ function _extends$1() {
30763
+ _extends$1 = Object.assign ? Object.assign.bind() : function(target) {
30764
+ for (var i = 1; i < arguments.length; i++) {
30765
+ var source2 = arguments[i];
30766
+ for (var key in source2) {
30767
+ if (Object.prototype.hasOwnProperty.call(source2, key)) {
30768
+ target[key] = source2[key];
30769
+ }
30770
+ }
30865
30771
  }
30866
- return n2;
30867
- }, _extends.apply(null, arguments);
30772
+ return target;
30773
+ };
30774
+ return _extends$1.apply(this, arguments);
30868
30775
  }
30869
30776
  function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
30870
30777
  return function handleEvent(event) {
@@ -30999,6 +30906,15 @@ function $c512c27ab02ef895$var$composeContextScopes(...scopes) {
30999
30906
  createScope1.scopeName = baseScope.scopeName;
31000
30907
  return createScope1;
31001
30908
  }
30909
+ function _extends() {
30910
+ return _extends = Object.assign ? Object.assign.bind() : function(n2) {
30911
+ for (var e2 = 1; e2 < arguments.length; e2++) {
30912
+ var t2 = arguments[e2];
30913
+ for (var r2 in t2) ({}).hasOwnProperty.call(t2, r2) && (n2[r2] = t2[r2]);
30914
+ }
30915
+ return n2;
30916
+ }, _extends.apply(null, arguments);
30917
+ }
31002
30918
  const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
31003
30919
  const { children: children2, ...slotProps } = props;
31004
30920
  const childrenArray = Children.toArray(children2);
@@ -31338,6 +31254,249 @@ function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
31338
31254
  ]);
31339
31255
  return deterministicId || (id2 ? `radix-${id2}` : "");
31340
31256
  }
31257
+ const arrow = (options) => {
31258
+ function isRef(value) {
31259
+ return {}.hasOwnProperty.call(value, "current");
31260
+ }
31261
+ return {
31262
+ name: "arrow",
31263
+ options,
31264
+ fn(state) {
31265
+ const {
31266
+ element: element2,
31267
+ padding
31268
+ } = typeof options === "function" ? options(state) : options;
31269
+ if (element2 && isRef(element2)) {
31270
+ if (element2.current != null) {
31271
+ return arrow$1({
31272
+ element: element2.current,
31273
+ padding
31274
+ }).fn(state);
31275
+ }
31276
+ return {};
31277
+ }
31278
+ if (element2) {
31279
+ return arrow$1({
31280
+ element: element2,
31281
+ padding
31282
+ }).fn(state);
31283
+ }
31284
+ return {};
31285
+ }
31286
+ };
31287
+ };
31288
+ var index$1 = typeof document !== "undefined" ? useLayoutEffect$1 : useEffect$2;
31289
+ function deepEqual(a2, b2) {
31290
+ if (a2 === b2) {
31291
+ return true;
31292
+ }
31293
+ if (typeof a2 !== typeof b2) {
31294
+ return false;
31295
+ }
31296
+ if (typeof a2 === "function" && a2.toString() === b2.toString()) {
31297
+ return true;
31298
+ }
31299
+ let length;
31300
+ let i;
31301
+ let keys2;
31302
+ if (a2 && b2 && typeof a2 === "object") {
31303
+ if (Array.isArray(a2)) {
31304
+ length = a2.length;
31305
+ if (length !== b2.length) return false;
31306
+ for (i = length; i-- !== 0; ) {
31307
+ if (!deepEqual(a2[i], b2[i])) {
31308
+ return false;
31309
+ }
31310
+ }
31311
+ return true;
31312
+ }
31313
+ keys2 = Object.keys(a2);
31314
+ length = keys2.length;
31315
+ if (length !== Object.keys(b2).length) {
31316
+ return false;
31317
+ }
31318
+ for (i = length; i-- !== 0; ) {
31319
+ if (!{}.hasOwnProperty.call(b2, keys2[i])) {
31320
+ return false;
31321
+ }
31322
+ }
31323
+ for (i = length; i-- !== 0; ) {
31324
+ const key = keys2[i];
31325
+ if (key === "_owner" && a2.$$typeof) {
31326
+ continue;
31327
+ }
31328
+ if (!deepEqual(a2[key], b2[key])) {
31329
+ return false;
31330
+ }
31331
+ }
31332
+ return true;
31333
+ }
31334
+ return a2 !== a2 && b2 !== b2;
31335
+ }
31336
+ function getDPR(element2) {
31337
+ if (typeof window === "undefined") {
31338
+ return 1;
31339
+ }
31340
+ const win = element2.ownerDocument.defaultView || window;
31341
+ return win.devicePixelRatio || 1;
31342
+ }
31343
+ function roundByDPR(element2, value) {
31344
+ const dpr = getDPR(element2);
31345
+ return Math.round(value * dpr) / dpr;
31346
+ }
31347
+ function useLatestRef(value) {
31348
+ const ref = React$2.useRef(value);
31349
+ index$1(() => {
31350
+ ref.current = value;
31351
+ });
31352
+ return ref;
31353
+ }
31354
+ function useFloating(options) {
31355
+ if (options === void 0) {
31356
+ options = {};
31357
+ }
31358
+ const {
31359
+ placement = "bottom",
31360
+ strategy = "absolute",
31361
+ middleware = [],
31362
+ platform: platform2,
31363
+ elements: {
31364
+ reference: externalReference,
31365
+ floating: externalFloating
31366
+ } = {},
31367
+ transform: transform2 = true,
31368
+ whileElementsMounted,
31369
+ open
31370
+ } = options;
31371
+ const [data, setData] = React$2.useState({
31372
+ x: 0,
31373
+ y: 0,
31374
+ strategy,
31375
+ placement,
31376
+ middlewareData: {},
31377
+ isPositioned: false
31378
+ });
31379
+ const [latestMiddleware, setLatestMiddleware] = React$2.useState(middleware);
31380
+ if (!deepEqual(latestMiddleware, middleware)) {
31381
+ setLatestMiddleware(middleware);
31382
+ }
31383
+ const [_reference, _setReference] = React$2.useState(null);
31384
+ const [_floating, _setFloating] = React$2.useState(null);
31385
+ const setReference = React$2.useCallback((node2) => {
31386
+ if (node2 !== referenceRef.current) {
31387
+ referenceRef.current = node2;
31388
+ _setReference(node2);
31389
+ }
31390
+ }, []);
31391
+ const setFloating = React$2.useCallback((node2) => {
31392
+ if (node2 !== floatingRef.current) {
31393
+ floatingRef.current = node2;
31394
+ _setFloating(node2);
31395
+ }
31396
+ }, []);
31397
+ const referenceEl = externalReference || _reference;
31398
+ const floatingEl = externalFloating || _floating;
31399
+ const referenceRef = React$2.useRef(null);
31400
+ const floatingRef = React$2.useRef(null);
31401
+ const dataRef = React$2.useRef(data);
31402
+ const hasWhileElementsMounted = whileElementsMounted != null;
31403
+ const whileElementsMountedRef = useLatestRef(whileElementsMounted);
31404
+ const platformRef = useLatestRef(platform2);
31405
+ const update2 = React$2.useCallback(() => {
31406
+ if (!referenceRef.current || !floatingRef.current) {
31407
+ return;
31408
+ }
31409
+ const config = {
31410
+ placement,
31411
+ strategy,
31412
+ middleware: latestMiddleware
31413
+ };
31414
+ if (platformRef.current) {
31415
+ config.platform = platformRef.current;
31416
+ }
31417
+ computePosition(referenceRef.current, floatingRef.current, config).then((data2) => {
31418
+ const fullData = {
31419
+ ...data2,
31420
+ isPositioned: true
31421
+ };
31422
+ if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
31423
+ dataRef.current = fullData;
31424
+ reactDomExports.flushSync(() => {
31425
+ setData(fullData);
31426
+ });
31427
+ }
31428
+ });
31429
+ }, [latestMiddleware, placement, strategy, platformRef]);
31430
+ index$1(() => {
31431
+ if (open === false && dataRef.current.isPositioned) {
31432
+ dataRef.current.isPositioned = false;
31433
+ setData((data2) => ({
31434
+ ...data2,
31435
+ isPositioned: false
31436
+ }));
31437
+ }
31438
+ }, [open]);
31439
+ const isMountedRef = React$2.useRef(false);
31440
+ index$1(() => {
31441
+ isMountedRef.current = true;
31442
+ return () => {
31443
+ isMountedRef.current = false;
31444
+ };
31445
+ }, []);
31446
+ index$1(() => {
31447
+ if (referenceEl) referenceRef.current = referenceEl;
31448
+ if (floatingEl) floatingRef.current = floatingEl;
31449
+ if (referenceEl && floatingEl) {
31450
+ if (whileElementsMountedRef.current) {
31451
+ return whileElementsMountedRef.current(referenceEl, floatingEl, update2);
31452
+ }
31453
+ update2();
31454
+ }
31455
+ }, [referenceEl, floatingEl, update2, whileElementsMountedRef, hasWhileElementsMounted]);
31456
+ const refs = React$2.useMemo(() => ({
31457
+ reference: referenceRef,
31458
+ floating: floatingRef,
31459
+ setReference,
31460
+ setFloating
31461
+ }), [setReference, setFloating]);
31462
+ const elements = React$2.useMemo(() => ({
31463
+ reference: referenceEl,
31464
+ floating: floatingEl
31465
+ }), [referenceEl, floatingEl]);
31466
+ const floatingStyles = React$2.useMemo(() => {
31467
+ const initialStyles = {
31468
+ position: strategy,
31469
+ left: 0,
31470
+ top: 0
31471
+ };
31472
+ if (!elements.floating) {
31473
+ return initialStyles;
31474
+ }
31475
+ const x2 = roundByDPR(elements.floating, data.x);
31476
+ const y2 = roundByDPR(elements.floating, data.y);
31477
+ if (transform2) {
31478
+ return {
31479
+ ...initialStyles,
31480
+ transform: "translate(" + x2 + "px, " + y2 + "px)",
31481
+ ...getDPR(elements.floating) >= 1.5 && {
31482
+ willChange: "transform"
31483
+ }
31484
+ };
31485
+ }
31486
+ return {
31487
+ position: strategy,
31488
+ left: x2,
31489
+ top: y2
31490
+ };
31491
+ }, [strategy, transform2, elements.floating, data.x, data.y]);
31492
+ return React$2.useMemo(() => ({
31493
+ ...data,
31494
+ update: update2,
31495
+ refs,
31496
+ elements,
31497
+ floatingStyles
31498
+ }), [data, update2, refs, elements, floatingStyles]);
31499
+ }
31341
31500
  const $7e8f5cd07187803e$export$21b07c8f274aebd5 = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
31342
31501
  const { children: children2, width = 10, height = 5, ...arrowProps } = props;
31343
31502
  return /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.svg, _extends({}, arrowProps, {
@@ -31448,7 +31607,7 @@ const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc = /* @__PURE__ */ forwardRef((pro
31448
31607
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
31449
31608
  altBoundary: hasExplicitBoundaries
31450
31609
  };
31451
- const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating$1({
31610
+ const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({
31452
31611
  // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
31453
31612
  strategy: "fixed",
31454
31613
  placement: desiredPlacement,
@@ -31462,11 +31621,11 @@ const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc = /* @__PURE__ */ forwardRef((pro
31462
31621
  reference: context2.anchor
31463
31622
  },
31464
31623
  middleware: [
31465
- offset({
31624
+ offset$1({
31466
31625
  mainAxis: sideOffset + arrowHeight,
31467
31626
  alignmentAxis: alignOffset
31468
31627
  }),
31469
- avoidCollisions && shift({
31628
+ avoidCollisions && shift$1({
31470
31629
  mainAxis: true,
31471
31630
  crossAxis: false,
31472
31631
  limiter: sticky === "partial" ? limitShift() : void 0,
@@ -31475,7 +31634,7 @@ const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc = /* @__PURE__ */ forwardRef((pro
31475
31634
  avoidCollisions && flip({
31476
31635
  ...detectOverflowOptions
31477
31636
  }),
31478
- size({
31637
+ size$1({
31479
31638
  ...detectOverflowOptions,
31480
31639
  apply: ({ elements, rects, availableWidth, availableHeight }) => {
31481
31640
  const { width: anchorWidth, height: anchorHeight } = rects.reference;
@@ -31976,9 +32135,9 @@ const $a093c7e1ec25a057$export$8c610744efcf8a1d = /* @__PURE__ */ forwardRef((pr
31976
32135
  }, [
31977
32136
  handlePointerUp
31978
32137
  ]);
31979
- return /* @__PURE__ */ createElement($cf1ac5d9fe0e8206$export$b688253958b8dfe7, _extends({
32138
+ return /* @__PURE__ */ createElement($cf1ac5d9fe0e8206$export$b688253958b8dfe7, _extends$1({
31980
32139
  asChild: true
31981
- }, popperScope), /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
32140
+ }, popperScope), /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends$1({
31982
32141
  // We purposefully avoid adding `type=button` here because tooltip triggers are also
31983
32142
  // commonly anchors and the anchor `type` attribute signifies MIME type.
31984
32143
  "aria-describedby": context2.open ? context2.contentId : void 0,
@@ -32033,11 +32192,11 @@ const $a093c7e1ec25a057$export$e9003e2be37ec060 = /* @__PURE__ */ forwardRef((pr
32033
32192
  const context2 = $a093c7e1ec25a057$var$useTooltipContext($a093c7e1ec25a057$var$CONTENT_NAME, props.__scopeTooltip);
32034
32193
  return /* @__PURE__ */ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
32035
32194
  present: forceMount || context2.open
32036
- }, context2.disableHoverableContent ? /* @__PURE__ */ createElement($a093c7e1ec25a057$var$TooltipContentImpl, _extends({
32195
+ }, context2.disableHoverableContent ? /* @__PURE__ */ createElement($a093c7e1ec25a057$var$TooltipContentImpl, _extends$1({
32037
32196
  side
32038
32197
  }, contentProps, {
32039
32198
  ref: forwardedRef
32040
- })) : /* @__PURE__ */ createElement($a093c7e1ec25a057$var$TooltipContentHoverable, _extends({
32199
+ })) : /* @__PURE__ */ createElement($a093c7e1ec25a057$var$TooltipContentHoverable, _extends$1({
32041
32200
  side
32042
32201
  }, contentProps, {
32043
32202
  ref: forwardedRef
@@ -32124,7 +32283,7 @@ const $a093c7e1ec25a057$var$TooltipContentHoverable = /* @__PURE__ */ forwardRef
32124
32283
  onClose,
32125
32284
  handleRemoveGraceArea
32126
32285
  ]);
32127
- return /* @__PURE__ */ createElement($a093c7e1ec25a057$var$TooltipContentImpl, _extends({}, props, {
32286
+ return /* @__PURE__ */ createElement($a093c7e1ec25a057$var$TooltipContentImpl, _extends$1({}, props, {
32128
32287
  ref: composedRefs
32129
32288
  }));
32130
32289
  });
@@ -32166,7 +32325,7 @@ const $a093c7e1ec25a057$var$TooltipContentImpl = /* @__PURE__ */ forwardRef((pro
32166
32325
  onPointerDownOutside,
32167
32326
  onFocusOutside: (event) => event.preventDefault(),
32168
32327
  onDismiss: onClose
32169
- }, /* @__PURE__ */ createElement($cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2, _extends({
32328
+ }, /* @__PURE__ */ createElement($cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2, _extends$1({
32170
32329
  "data-state": context2.stateAttribute
32171
32330
  }, popperScope, contentProps, {
32172
32331
  ref: forwardedRef,
@@ -35989,7 +36148,7 @@ const $5d3850c4d0b4e6c7$export$bd1d06c79be19e17 = /* @__PURE__ */ forwardRef((pr
35989
36148
  const context2 = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$OVERLAY_NAME, props.__scopeDialog);
35990
36149
  return context2.modal ? /* @__PURE__ */ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
35991
36150
  present: forceMount || context2.open
35992
- }, /* @__PURE__ */ createElement($5d3850c4d0b4e6c7$var$DialogOverlayImpl, _extends({}, overlayProps, {
36151
+ }, /* @__PURE__ */ createElement($5d3850c4d0b4e6c7$var$DialogOverlayImpl, _extends$1({}, overlayProps, {
35993
36152
  ref: forwardedRef
35994
36153
  }))) : null;
35995
36154
  });
@@ -36005,7 +36164,7 @@ const $5d3850c4d0b4e6c7$var$DialogOverlayImpl = /* @__PURE__ */ forwardRef((prop
36005
36164
  shards: [
36006
36165
  context2.contentRef
36007
36166
  ]
36008
- }, /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
36167
+ }, /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$1({
36009
36168
  "data-state": $5d3850c4d0b4e6c7$var$getState(context2.open)
36010
36169
  }, overlayProps, {
36011
36170
  ref: forwardedRef,
@@ -36023,9 +36182,9 @@ const $5d3850c4d0b4e6c7$export$b6d9565de1e068cf = /* @__PURE__ */ forwardRef((pr
36023
36182
  const context2 = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
36024
36183
  return /* @__PURE__ */ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
36025
36184
  present: forceMount || context2.open
36026
- }, context2.modal ? /* @__PURE__ */ createElement($5d3850c4d0b4e6c7$var$DialogContentModal, _extends({}, contentProps, {
36185
+ }, context2.modal ? /* @__PURE__ */ createElement($5d3850c4d0b4e6c7$var$DialogContentModal, _extends$1({}, contentProps, {
36027
36186
  ref: forwardedRef
36028
- })) : /* @__PURE__ */ createElement($5d3850c4d0b4e6c7$var$DialogContentNonModal, _extends({}, contentProps, {
36187
+ })) : /* @__PURE__ */ createElement($5d3850c4d0b4e6c7$var$DialogContentNonModal, _extends$1({}, contentProps, {
36029
36188
  ref: forwardedRef
36030
36189
  })));
36031
36190
  });
@@ -36040,7 +36199,7 @@ const $5d3850c4d0b4e6c7$var$DialogContentModal = /* @__PURE__ */ forwardRef((pro
36040
36199
  const content2 = contentRef.current;
36041
36200
  if (content2) return hideOthers(content2);
36042
36201
  }, []);
36043
- return /* @__PURE__ */ createElement($5d3850c4d0b4e6c7$var$DialogContentImpl, _extends({}, props, {
36202
+ return /* @__PURE__ */ createElement($5d3850c4d0b4e6c7$var$DialogContentImpl, _extends$1({}, props, {
36044
36203
  ref: composedRefs,
36045
36204
  trapFocus: context2.open,
36046
36205
  disableOutsidePointerEvents: true,
@@ -36065,7 +36224,7 @@ const $5d3850c4d0b4e6c7$var$DialogContentNonModal = /* @__PURE__ */ forwardRef((
36065
36224
  const context2 = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
36066
36225
  const hasInteractedOutsideRef = useRef$1(false);
36067
36226
  const hasPointerDownOutsideRef = useRef$1(false);
36068
- return /* @__PURE__ */ createElement($5d3850c4d0b4e6c7$var$DialogContentImpl, _extends({}, props, {
36227
+ return /* @__PURE__ */ createElement($5d3850c4d0b4e6c7$var$DialogContentImpl, _extends$1({}, props, {
36069
36228
  ref: forwardedRef,
36070
36229
  trapFocus: false,
36071
36230
  disableOutsidePointerEvents: false,
@@ -36106,7 +36265,7 @@ const $5d3850c4d0b4e6c7$var$DialogContentImpl = /* @__PURE__ */ forwardRef((prop
36106
36265
  trapped: trapFocus,
36107
36266
  onMountAutoFocus: onOpenAutoFocus,
36108
36267
  onUnmountAutoFocus: onCloseAutoFocus
36109
- }, /* @__PURE__ */ createElement($5cb92bef7577960e$export$177fb62ff3ec1f22, _extends({
36268
+ }, /* @__PURE__ */ createElement($5cb92bef7577960e$export$177fb62ff3ec1f22, _extends$1({
36110
36269
  role: "dialog",
36111
36270
  id: context2.contentId,
36112
36271
  "aria-describedby": context2.descriptionId,
@@ -36121,7 +36280,7 @@ const $5d3850c4d0b4e6c7$var$TITLE_NAME = "DialogTitle";
36121
36280
  const $5d3850c4d0b4e6c7$export$16f7638e4a34b909 = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
36122
36281
  const { __scopeDialog, ...titleProps } = props;
36123
36282
  const context2 = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$TITLE_NAME, __scopeDialog);
36124
- return /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.h2, _extends({
36283
+ return /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.h2, _extends$1({
36125
36284
  id: context2.titleId
36126
36285
  }, titleProps, {
36127
36286
  ref: forwardedRef
@@ -36134,7 +36293,7 @@ const $5d3850c4d0b4e6c7$var$DESCRIPTION_NAME = "DialogDescription";
36134
36293
  const $5d3850c4d0b4e6c7$export$94e94c2ec2c954d5 = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
36135
36294
  const { __scopeDialog, ...descriptionProps } = props;
36136
36295
  const context2 = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$DESCRIPTION_NAME, __scopeDialog);
36137
- return /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.p, _extends({
36296
+ return /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.p, _extends$1({
36138
36297
  id: context2.descriptionId
36139
36298
  }, descriptionProps, {
36140
36299
  ref: forwardedRef
@@ -36147,7 +36306,7 @@ const $5d3850c4d0b4e6c7$var$CLOSE_NAME = "DialogClose";
36147
36306
  const $5d3850c4d0b4e6c7$export$fba2fb7cd781b7ac = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
36148
36307
  const { __scopeDialog, ...closeProps } = props;
36149
36308
  const context2 = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CLOSE_NAME, __scopeDialog);
36150
- return /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
36309
+ return /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends$1({
36151
36310
  type: "button"
36152
36311
  }, closeProps, {
36153
36312
  ref: forwardedRef,
@@ -37829,7 +37988,6 @@ var __importDefault = commonjsGlobal && commonjsGlobal.__importDefault || functi
37829
37988
  return mod && mod.__esModule ? mod : { "default": mod };
37830
37989
  };
37831
37990
  Object.defineProperty(cjs, "__esModule", { value: true });
37832
- var _default = cjs.default = StyleToObject;
37833
37991
  var inline_style_parser_1 = __importDefault(inlineStyleParser);
37834
37992
  function StyleToObject(style, iterator) {
37835
37993
  var styleObject = null;
@@ -37852,6 +38010,7 @@ function StyleToObject(style, iterator) {
37852
38010
  });
37853
38011
  return styleObject;
37854
38012
  }
38013
+ var _default = cjs.default = StyleToObject;
37855
38014
  const styleToObject = _default.default || _default;
37856
38015
  const pointEnd = point$2("end");
37857
38016
  const pointStart = point$2("start");
@@ -38377,7 +38536,7 @@ function findComponentFromName(state, name$1, allowExpression) {
38377
38536
  }
38378
38537
  if (result2.type === "Literal") {
38379
38538
  const name2 = (
38380
- /** @type {string | number} */
38539
+ /** @type {keyof JSX.IntrinsicElements} */
38381
38540
  result2.value
38382
38541
  );
38383
38542
  return own$6.call(state.components, name2) ? state.components[name2] : name2;
@@ -38669,7 +38828,11 @@ const content$2 = {
38669
38828
  tokenize: initializeContent
38670
38829
  };
38671
38830
  function initializeContent(effects) {
38672
- const contentStart = effects.attempt(this.parser.constructs.contentInitial, afterContentStartConstruct, paragraphInitial);
38831
+ const contentStart = effects.attempt(
38832
+ this.parser.constructs.contentInitial,
38833
+ afterContentStartConstruct,
38834
+ paragraphInitial
38835
+ );
38673
38836
  let previous2;
38674
38837
  return contentStart;
38675
38838
  function afterContentStartConstruct(code2) {
@@ -38731,7 +38894,11 @@ function initializeDocument(effects) {
38731
38894
  if (continued < stack.length) {
38732
38895
  const item2 = stack[continued];
38733
38896
  self2.containerState = item2[1];
38734
- return effects.attempt(item2[0].continuation, documentContinue, checkNewContainers)(code2);
38897
+ return effects.attempt(
38898
+ item2[0].continuation,
38899
+ documentContinue,
38900
+ checkNewContainers
38901
+ )(code2);
38735
38902
  }
38736
38903
  return checkNewContainers(code2);
38737
38904
  }
@@ -38754,12 +38921,15 @@ function initializeDocument(effects) {
38754
38921
  exitContainers(continued);
38755
38922
  let index2 = indexBeforeExits;
38756
38923
  while (index2 < self2.events.length) {
38757
- self2.events[index2][1].end = {
38758
- ...point2
38759
- };
38924
+ self2.events[index2][1].end = Object.assign({}, point2);
38760
38925
  index2++;
38761
38926
  }
38762
- splice(self2.events, indexBeforeFlow + 1, 0, self2.events.slice(indexBeforeExits));
38927
+ splice(
38928
+ self2.events,
38929
+ indexBeforeFlow + 1,
38930
+ 0,
38931
+ self2.events.slice(indexBeforeExits)
38932
+ );
38763
38933
  self2.events.length = index2;
38764
38934
  return checkNewContainers(code2);
38765
38935
  }
@@ -38773,10 +38943,16 @@ function initializeDocument(effects) {
38773
38943
  if (childFlow.currentConstruct && childFlow.currentConstruct.concrete) {
38774
38944
  return flowStart(code2);
38775
38945
  }
38776
- self2.interrupt = Boolean(childFlow.currentConstruct && !childFlow._gfmTableDynamicInterruptHack);
38946
+ self2.interrupt = Boolean(
38947
+ childFlow.currentConstruct && !childFlow._gfmTableDynamicInterruptHack
38948
+ );
38777
38949
  }
38778
38950
  self2.containerState = {};
38779
- return effects.check(containerConstruct, thereIsANewContainer, thereIsNoNewContainer)(code2);
38951
+ return effects.check(
38952
+ containerConstruct,
38953
+ thereIsANewContainer,
38954
+ thereIsNoNewContainer
38955
+ )(code2);
38780
38956
  }
38781
38957
  function thereIsANewContainer(code2) {
38782
38958
  if (childFlow) closeFlow();
@@ -38790,7 +38966,11 @@ function initializeDocument(effects) {
38790
38966
  }
38791
38967
  function documentContinued(code2) {
38792
38968
  self2.containerState = {};
38793
- return effects.attempt(containerConstruct, containerContinue, flowStart)(code2);
38969
+ return effects.attempt(
38970
+ containerConstruct,
38971
+ containerContinue,
38972
+ flowStart
38973
+ )(code2);
38794
38974
  }
38795
38975
  function containerContinue(code2) {
38796
38976
  continued++;
@@ -38806,9 +38986,9 @@ function initializeDocument(effects) {
38806
38986
  }
38807
38987
  childFlow = childFlow || self2.parser.flow(self2.now());
38808
38988
  effects.enter("chunkFlow", {
38809
- _tokenizer: childFlow,
38810
38989
  contentType: "flow",
38811
- previous: childToken
38990
+ previous: childToken,
38991
+ _tokenizer: childFlow
38812
38992
  });
38813
38993
  return flowContinue(code2);
38814
38994
  }
@@ -38829,9 +39009,9 @@ function initializeDocument(effects) {
38829
39009
  effects.consume(code2);
38830
39010
  return flowContinue;
38831
39011
  }
38832
- function writeToChild(token, endOfFile) {
39012
+ function writeToChild(token, eof) {
38833
39013
  const stream = self2.sliceStream(token);
38834
- if (endOfFile) stream.push(null);
39014
+ if (eof) stream.push(null);
38835
39015
  token.previous = childToken;
38836
39016
  if (childToken) childToken.next = token;
38837
39017
  childToken = token;
@@ -38865,12 +39045,15 @@ function initializeDocument(effects) {
38865
39045
  exitContainers(continued);
38866
39046
  index2 = indexBeforeExits;
38867
39047
  while (index2 < self2.events.length) {
38868
- self2.events[index2][1].end = {
38869
- ...point2
38870
- };
39048
+ self2.events[index2][1].end = Object.assign({}, point2);
38871
39049
  index2++;
38872
39050
  }
38873
- splice(self2.events, indexBeforeFlow + 1, 0, self2.events.slice(indexBeforeExits));
39051
+ splice(
39052
+ self2.events,
39053
+ indexBeforeFlow + 1,
39054
+ 0,
39055
+ self2.events.slice(indexBeforeExits)
39056
+ );
38874
39057
  self2.events.length = index2;
38875
39058
  }
38876
39059
  }
@@ -38891,7 +39074,12 @@ function initializeDocument(effects) {
38891
39074
  }
38892
39075
  }
38893
39076
  function tokenizeContainer(effects, ok2, nok) {
38894
- return factorySpace(effects, effects.attempt(this.parser.constructs.document, ok2, nok), "linePrefix", this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4);
39077
+ return factorySpace(
39078
+ effects,
39079
+ effects.attempt(this.parser.constructs.document, ok2, nok),
39080
+ "linePrefix",
39081
+ this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
39082
+ );
38895
39083
  }
38896
39084
  function classifyCharacter(code2) {
38897
39085
  if (code2 === null || markdownLineEndingOrSpace(code2) || unicodeWhitespace(code2)) {
@@ -38915,8 +39103,8 @@ function resolveAll(constructs2, events, context2) {
38915
39103
  }
38916
39104
  const attention = {
38917
39105
  name: "attention",
38918
- resolveAll: resolveAllAttention,
38919
- tokenize: tokenizeAttention
39106
+ tokenize: tokenizeAttention,
39107
+ resolveAll: resolveAllAttention
38920
39108
  };
38921
39109
  function resolveAllAttention(events, context2) {
38922
39110
  let index2 = -1;
@@ -38938,52 +39126,32 @@ function resolveAllAttention(events, context2) {
38938
39126
  continue;
38939
39127
  }
38940
39128
  use = events[open][1].end.offset - events[open][1].start.offset > 1 && events[index2][1].end.offset - events[index2][1].start.offset > 1 ? 2 : 1;
38941
- const start = {
38942
- ...events[open][1].end
38943
- };
38944
- const end = {
38945
- ...events[index2][1].start
38946
- };
39129
+ const start = Object.assign({}, events[open][1].end);
39130
+ const end = Object.assign({}, events[index2][1].start);
38947
39131
  movePoint(start, -use);
38948
39132
  movePoint(end, use);
38949
39133
  openingSequence = {
38950
39134
  type: use > 1 ? "strongSequence" : "emphasisSequence",
38951
39135
  start,
38952
- end: {
38953
- ...events[open][1].end
38954
- }
39136
+ end: Object.assign({}, events[open][1].end)
38955
39137
  };
38956
39138
  closingSequence = {
38957
39139
  type: use > 1 ? "strongSequence" : "emphasisSequence",
38958
- start: {
38959
- ...events[index2][1].start
38960
- },
39140
+ start: Object.assign({}, events[index2][1].start),
38961
39141
  end
38962
39142
  };
38963
39143
  text2 = {
38964
39144
  type: use > 1 ? "strongText" : "emphasisText",
38965
- start: {
38966
- ...events[open][1].end
38967
- },
38968
- end: {
38969
- ...events[index2][1].start
38970
- }
39145
+ start: Object.assign({}, events[open][1].end),
39146
+ end: Object.assign({}, events[index2][1].start)
38971
39147
  };
38972
39148
  group = {
38973
39149
  type: use > 1 ? "strong" : "emphasis",
38974
- start: {
38975
- ...openingSequence.start
38976
- },
38977
- end: {
38978
- ...closingSequence.end
38979
- }
38980
- };
38981
- events[open][1].end = {
38982
- ...openingSequence.start
38983
- };
38984
- events[index2][1].start = {
38985
- ...closingSequence.end
39150
+ start: Object.assign({}, openingSequence.start),
39151
+ end: Object.assign({}, closingSequence.end)
38986
39152
  };
39153
+ events[open][1].end = Object.assign({}, openingSequence.start);
39154
+ events[index2][1].start = Object.assign({}, closingSequence.end);
38987
39155
  nextEvents = [];
38988
39156
  if (events[open][1].end.offset - events[open][1].start.offset) {
38989
39157
  nextEvents = push(nextEvents, [["enter", events[open][1], context2], ["exit", events[open][1], context2]]);
@@ -39142,8 +39310,8 @@ function tokenizeAutolink(effects, ok2, nok) {
39142
39310
  }
39143
39311
  }
39144
39312
  const blankLine = {
39145
- partial: true,
39146
- tokenize: tokenizeBlankLine
39313
+ tokenize: tokenizeBlankLine,
39314
+ partial: true
39147
39315
  };
39148
39316
  function tokenizeBlankLine(effects, ok2, nok) {
39149
39317
  return start;
@@ -39155,12 +39323,12 @@ function tokenizeBlankLine(effects, ok2, nok) {
39155
39323
  }
39156
39324
  }
39157
39325
  const blockQuote = {
39326
+ name: "blockQuote",
39327
+ tokenize: tokenizeBlockQuoteStart,
39158
39328
  continuation: {
39159
39329
  tokenize: tokenizeBlockQuoteContinuation
39160
39330
  },
39161
- exit: exit$1,
39162
- name: "blockQuote",
39163
- tokenize: tokenizeBlockQuoteStart
39331
+ exit: exit$1
39164
39332
  };
39165
39333
  function tokenizeBlockQuoteStart(effects, ok2, nok) {
39166
39334
  const self2 = this;
@@ -39298,19 +39466,19 @@ function tokenizeCharacterReference(effects, ok2, nok) {
39298
39466
  }
39299
39467
  }
39300
39468
  const nonLazyContinuation = {
39301
- partial: true,
39302
- tokenize: tokenizeNonLazyContinuation
39469
+ tokenize: tokenizeNonLazyContinuation,
39470
+ partial: true
39303
39471
  };
39304
39472
  const codeFenced = {
39305
- concrete: true,
39306
39473
  name: "codeFenced",
39307
- tokenize: tokenizeCodeFenced
39474
+ tokenize: tokenizeCodeFenced,
39475
+ concrete: true
39308
39476
  };
39309
39477
  function tokenizeCodeFenced(effects, ok2, nok) {
39310
39478
  const self2 = this;
39311
39479
  const closeStart = {
39312
- partial: true,
39313
- tokenize: tokenizeCloseStart
39480
+ tokenize: tokenizeCloseStart,
39481
+ partial: true
39314
39482
  };
39315
39483
  let initialPrefix = 0;
39316
39484
  let sizeOpen = 0;
@@ -39483,8 +39651,8 @@ const codeIndented = {
39483
39651
  tokenize: tokenizeCodeIndented
39484
39652
  };
39485
39653
  const furtherStart = {
39486
- partial: true,
39487
- tokenize: tokenizeFurtherStart
39654
+ tokenize: tokenizeFurtherStart,
39655
+ partial: true
39488
39656
  };
39489
39657
  function tokenizeCodeIndented(effects, ok2, nok) {
39490
39658
  const self2 = this;
@@ -39542,9 +39710,9 @@ function tokenizeFurtherStart(effects, ok2, nok) {
39542
39710
  }
39543
39711
  const codeText = {
39544
39712
  name: "codeText",
39545
- previous: previous$1,
39713
+ tokenize: tokenizeCodeText,
39546
39714
  resolve: resolveCodeText,
39547
- tokenize: tokenizeCodeText
39715
+ previous: previous$1
39548
39716
  };
39549
39717
  function resolveCodeText(events) {
39550
39718
  let tailExitIndex = events.length - 4;
@@ -39896,15 +40064,12 @@ function subtokenize(eventsArray) {
39896
40064
  otherEvent[1].type = "lineEnding";
39897
40065
  lineIndex = otherIndex;
39898
40066
  }
39899
- } else if (otherEvent[1].type === "linePrefix") ;
39900
- else {
40067
+ } else {
39901
40068
  break;
39902
40069
  }
39903
40070
  }
39904
40071
  if (lineIndex) {
39905
- event[1].end = {
39906
- ...events.get(lineIndex)[1].start
39907
- };
40072
+ event[1].end = Object.assign({}, events.get(lineIndex)[1].start);
39908
40073
  parameters = events.slice(lineIndex, index2);
39909
40074
  parameters.unshift(event);
39910
40075
  events.splice(lineIndex, index2 - lineIndex + 1, parameters);
@@ -39989,12 +40154,12 @@ function subcontent(events, eventIndex) {
39989
40154
  return gaps;
39990
40155
  }
39991
40156
  const content$1 = {
39992
- resolve: resolveContent,
39993
- tokenize: tokenizeContent
40157
+ tokenize: tokenizeContent,
40158
+ resolve: resolveContent
39994
40159
  };
39995
40160
  const continuationConstruct = {
39996
- partial: true,
39997
- tokenize: tokenizeContinuation
40161
+ tokenize: tokenizeContinuation,
40162
+ partial: true
39998
40163
  };
39999
40164
  function resolveContent(events) {
40000
40165
  subtokenize(events);
@@ -40278,7 +40443,11 @@ function factoryWhitespace(effects, ok2) {
40278
40443
  return start;
40279
40444
  }
40280
40445
  if (markdownSpace(code2)) {
40281
- return factorySpace(effects, start, seen ? "linePrefix" : "lineSuffix")(code2);
40446
+ return factorySpace(
40447
+ effects,
40448
+ start,
40449
+ seen ? "linePrefix" : "lineSuffix"
40450
+ )(code2);
40282
40451
  }
40283
40452
  return ok2(code2);
40284
40453
  }
@@ -40288,8 +40457,8 @@ const definition$1 = {
40288
40457
  tokenize: tokenizeDefinition
40289
40458
  };
40290
40459
  const titleBefore = {
40291
- partial: true,
40292
- tokenize: tokenizeTitleBefore
40460
+ tokenize: tokenizeTitleBefore,
40461
+ partial: true
40293
40462
  };
40294
40463
  function tokenizeDefinition(effects, ok2, nok) {
40295
40464
  const self2 = this;
@@ -40388,8 +40557,8 @@ function tokenizeHardBreakEscape(effects, ok2, nok) {
40388
40557
  }
40389
40558
  const headingAtx = {
40390
40559
  name: "headingAtx",
40391
- resolve: resolveHeadingAtx,
40392
- tokenize: tokenizeHeadingAtx
40560
+ tokenize: tokenizeHeadingAtx,
40561
+ resolve: resolveHeadingAtx
40393
40562
  };
40394
40563
  function resolveHeadingAtx(events, context2) {
40395
40564
  let contentEnd = events.length - 2;
@@ -40541,18 +40710,18 @@ const htmlBlockNames = [
40541
40710
  ];
40542
40711
  const htmlRawNames = ["pre", "script", "style", "textarea"];
40543
40712
  const htmlFlow = {
40544
- concrete: true,
40545
40713
  name: "htmlFlow",
40714
+ tokenize: tokenizeHtmlFlow,
40546
40715
  resolveTo: resolveToHtmlFlow,
40547
- tokenize: tokenizeHtmlFlow
40716
+ concrete: true
40548
40717
  };
40549
40718
  const blankLineBefore = {
40550
- partial: true,
40551
- tokenize: tokenizeBlankLineBefore
40719
+ tokenize: tokenizeBlankLineBefore,
40720
+ partial: true
40552
40721
  };
40553
40722
  const nonLazyContinuationStart = {
40554
- partial: true,
40555
- tokenize: tokenizeNonLazyContinuationStart
40723
+ tokenize: tokenizeNonLazyContinuationStart,
40724
+ partial: true
40556
40725
  };
40557
40726
  function resolveToHtmlFlow(events) {
40558
40727
  let index2 = events.length;
@@ -41223,9 +41392,9 @@ function tokenizeHtmlText(effects, ok2, nok) {
41223
41392
  }
41224
41393
  const labelEnd = {
41225
41394
  name: "labelEnd",
41226
- resolveAll: resolveAllLabelEnd,
41395
+ tokenize: tokenizeLabelEnd,
41227
41396
  resolveTo: resolveToLabelEnd,
41228
- tokenize: tokenizeLabelEnd
41397
+ resolveAll: resolveAllLabelEnd
41229
41398
  };
41230
41399
  const resourceConstruct = {
41231
41400
  tokenize: tokenizeResource
@@ -41238,19 +41407,14 @@ const referenceCollapsedConstruct = {
41238
41407
  };
41239
41408
  function resolveAllLabelEnd(events) {
41240
41409
  let index2 = -1;
41241
- const newEvents = [];
41242
41410
  while (++index2 < events.length) {
41243
41411
  const token = events[index2][1];
41244
- newEvents.push(events[index2]);
41245
41412
  if (token.type === "labelImage" || token.type === "labelLink" || token.type === "labelEnd") {
41246
- const offset2 = token.type === "labelImage" ? 4 : 2;
41413
+ events.splice(index2 + 1, token.type === "labelImage" ? 4 : 2);
41247
41414
  token.type = "data";
41248
- index2 += offset2;
41415
+ index2++;
41249
41416
  }
41250
41417
  }
41251
- if (events.length !== newEvents.length) {
41252
- splice(events, 0, events.length, newEvents);
41253
- }
41254
41418
  return events;
41255
41419
  }
41256
41420
  function resolveToLabelEnd(events, context2) {
@@ -41283,30 +41447,18 @@ function resolveToLabelEnd(events, context2) {
41283
41447
  }
41284
41448
  const group = {
41285
41449
  type: events[open][1].type === "labelLink" ? "link" : "image",
41286
- start: {
41287
- ...events[open][1].start
41288
- },
41289
- end: {
41290
- ...events[events.length - 1][1].end
41291
- }
41450
+ start: Object.assign({}, events[open][1].start),
41451
+ end: Object.assign({}, events[events.length - 1][1].end)
41292
41452
  };
41293
41453
  const label = {
41294
41454
  type: "label",
41295
- start: {
41296
- ...events[open][1].start
41297
- },
41298
- end: {
41299
- ...events[close2][1].end
41300
- }
41455
+ start: Object.assign({}, events[open][1].start),
41456
+ end: Object.assign({}, events[close2][1].end)
41301
41457
  };
41302
41458
  const text2 = {
41303
41459
  type: "labelText",
41304
- start: {
41305
- ...events[open + offset2 + 2][1].end
41306
- },
41307
- end: {
41308
- ...events[close2 - 2][1].start
41309
- }
41460
+ start: Object.assign({}, events[open + offset2 + 2][1].end),
41461
+ end: Object.assign({}, events[close2 - 2][1].start)
41310
41462
  };
41311
41463
  media = [["enter", group, context2], ["enter", label, context2]];
41312
41464
  media = push(media, events.slice(open + 1, open + offset2 + 3));
@@ -41447,8 +41599,8 @@ function tokenizeReferenceCollapsed(effects, ok2, nok) {
41447
41599
  }
41448
41600
  const labelStartImage = {
41449
41601
  name: "labelStartImage",
41450
- resolveAll: labelEnd.resolveAll,
41451
- tokenize: tokenizeLabelStartImage
41602
+ tokenize: tokenizeLabelStartImage,
41603
+ resolveAll: labelEnd.resolveAll
41452
41604
  };
41453
41605
  function tokenizeLabelStartImage(effects, ok2, nok) {
41454
41606
  const self2 = this;
@@ -41476,8 +41628,8 @@ function tokenizeLabelStartImage(effects, ok2, nok) {
41476
41628
  }
41477
41629
  const labelStartLink = {
41478
41630
  name: "labelStartLink",
41479
- resolveAll: labelEnd.resolveAll,
41480
- tokenize: tokenizeLabelStartLink
41631
+ tokenize: tokenizeLabelStartLink,
41632
+ resolveAll: labelEnd.resolveAll
41481
41633
  };
41482
41634
  function tokenizeLabelStartLink(effects, ok2, nok) {
41483
41635
  const self2 = this;
@@ -41545,20 +41697,20 @@ function tokenizeThematicBreak(effects, ok2, nok) {
41545
41697
  }
41546
41698
  }
41547
41699
  const list$3 = {
41700
+ name: "list",
41701
+ tokenize: tokenizeListStart,
41548
41702
  continuation: {
41549
41703
  tokenize: tokenizeListContinuation
41550
41704
  },
41551
- exit: tokenizeListEnd,
41552
- name: "list",
41553
- tokenize: tokenizeListStart
41705
+ exit: tokenizeListEnd
41554
41706
  };
41555
41707
  const listItemPrefixWhitespaceConstruct = {
41556
- partial: true,
41557
- tokenize: tokenizeListItemPrefixWhitespace
41708
+ tokenize: tokenizeListItemPrefixWhitespace,
41709
+ partial: true
41558
41710
  };
41559
41711
  const indentConstruct = {
41560
- partial: true,
41561
- tokenize: tokenizeIndent$1
41712
+ tokenize: tokenizeIndent$1,
41713
+ partial: true
41562
41714
  };
41563
41715
  function tokenizeListStart(effects, ok2, nok) {
41564
41716
  const self2 = this;
@@ -41674,8 +41826,8 @@ function tokenizeListItemPrefixWhitespace(effects, ok2, nok) {
41674
41826
  }
41675
41827
  const setextUnderline = {
41676
41828
  name: "setextUnderline",
41677
- resolveTo: resolveToSetextUnderline,
41678
- tokenize: tokenizeSetextUnderline
41829
+ tokenize: tokenizeSetextUnderline,
41830
+ resolveTo: resolveToSetextUnderline
41679
41831
  };
41680
41832
  function resolveToSetextUnderline(events, context2) {
41681
41833
  let index2 = events.length;
@@ -41702,20 +41854,14 @@ function resolveToSetextUnderline(events, context2) {
41702
41854
  }
41703
41855
  const heading2 = {
41704
41856
  type: "setextHeading",
41705
- start: {
41706
- ...events[text2][1].start
41707
- },
41708
- end: {
41709
- ...events[events.length - 1][1].end
41710
- }
41857
+ start: Object.assign({}, events[text2][1].start),
41858
+ end: Object.assign({}, events[events.length - 1][1].end)
41711
41859
  };
41712
41860
  events[text2][1].type = "setextHeadingText";
41713
41861
  if (definition2) {
41714
41862
  events.splice(text2, 0, ["enter", heading2, context2]);
41715
41863
  events.splice(definition2 + 1, 0, ["exit", events[content2][1], context2]);
41716
- events[content2][1].end = {
41717
- ...events[definition2][1].end
41718
- };
41864
+ events[content2][1].end = Object.assign({}, events[definition2][1].end);
41719
41865
  } else {
41720
41866
  events[content2][1] = heading2;
41721
41867
  }
@@ -41772,7 +41918,19 @@ function initializeFlow(effects) {
41772
41918
  blankLine,
41773
41919
  atBlankEnding,
41774
41920
  // Try to parse initial flow (essentially, only code).
41775
- effects.attempt(this.parser.constructs.flowInitial, afterConstruct, factorySpace(effects, effects.attempt(this.parser.constructs.flow, afterConstruct, effects.attempt(content$1, afterConstruct)), "linePrefix"))
41921
+ effects.attempt(
41922
+ this.parser.constructs.flowInitial,
41923
+ afterConstruct,
41924
+ factorySpace(
41925
+ effects,
41926
+ effects.attempt(
41927
+ this.parser.constructs.flow,
41928
+ afterConstruct,
41929
+ effects.attempt(content$1, afterConstruct)
41930
+ ),
41931
+ "linePrefix"
41932
+ )
41933
+ )
41776
41934
  );
41777
41935
  return initial;
41778
41936
  function atBlankEnding(code2) {
@@ -41805,8 +41963,10 @@ const string$1 = initializeFactory("string");
41805
41963
  const text$5 = initializeFactory("text");
41806
41964
  function initializeFactory(field) {
41807
41965
  return {
41808
- resolveAll: createResolver(field === "text" ? resolveAllLineSuffixes : void 0),
41809
- tokenize: initializeText
41966
+ tokenize: initializeText,
41967
+ resolveAll: createResolver(
41968
+ field === "text" ? resolveAllLineSuffixes : void 0
41969
+ )
41810
41970
  };
41811
41971
  function initializeText(effects) {
41812
41972
  const self2 = this;
@@ -41907,23 +42067,24 @@ function resolveAllLineSuffixes(events, context2) {
41907
42067
  const token = {
41908
42068
  type: eventIndex === events.length || tabs2 || size2 < 2 ? "lineSuffix" : "hardBreakTrailing",
41909
42069
  start: {
41910
- _bufferIndex: index2 ? bufferIndex : data.start._bufferIndex + bufferIndex,
41911
- _index: data.start._index + index2,
41912
42070
  line: data.end.line,
41913
42071
  column: data.end.column - size2,
41914
- offset: data.end.offset - size2
42072
+ offset: data.end.offset - size2,
42073
+ _index: data.start._index + index2,
42074
+ _bufferIndex: index2 ? bufferIndex : data.start._bufferIndex + bufferIndex
41915
42075
  },
41916
- end: {
41917
- ...data.end
41918
- }
41919
- };
41920
- data.end = {
41921
- ...token.start
42076
+ end: Object.assign({}, data.end)
41922
42077
  };
42078
+ data.end = Object.assign({}, token.start);
41923
42079
  if (data.start.offset === data.end.offset) {
41924
42080
  Object.assign(data, token);
41925
42081
  } else {
41926
- events.splice(eventIndex, 0, ["enter", token, context2], ["exit", token, context2]);
42082
+ events.splice(
42083
+ eventIndex,
42084
+ 0,
42085
+ ["enter", token, context2],
42086
+ ["exit", token, context2]
42087
+ );
41927
42088
  eventIndex += 2;
41928
42089
  }
41929
42090
  }
@@ -41932,111 +42093,42 @@ function resolveAllLineSuffixes(events, context2) {
41932
42093
  }
41933
42094
  return events;
41934
42095
  }
41935
- const document$1 = {
41936
- [42]: list$3,
41937
- [43]: list$3,
41938
- [45]: list$3,
41939
- [48]: list$3,
41940
- [49]: list$3,
41941
- [50]: list$3,
41942
- [51]: list$3,
41943
- [52]: list$3,
41944
- [53]: list$3,
41945
- [54]: list$3,
41946
- [55]: list$3,
41947
- [56]: list$3,
41948
- [57]: list$3,
41949
- [62]: blockQuote
41950
- };
41951
- const contentInitial = {
41952
- [91]: definition$1
41953
- };
41954
- const flowInitial = {
41955
- [-2]: codeIndented,
41956
- [-1]: codeIndented,
41957
- [32]: codeIndented
41958
- };
41959
- const flow = {
41960
- [35]: headingAtx,
41961
- [42]: thematicBreak$2,
41962
- [45]: [setextUnderline, thematicBreak$2],
41963
- [60]: htmlFlow,
41964
- [61]: setextUnderline,
41965
- [95]: thematicBreak$2,
41966
- [96]: codeFenced,
41967
- [126]: codeFenced
41968
- };
41969
- const string = {
41970
- [38]: characterReference,
41971
- [92]: characterEscape
41972
- };
41973
- const text$4 = {
41974
- [-5]: lineEnding,
41975
- [-4]: lineEnding,
41976
- [-3]: lineEnding,
41977
- [33]: labelStartImage,
41978
- [38]: characterReference,
41979
- [42]: attention,
41980
- [60]: [autolink, htmlText],
41981
- [91]: labelStartLink,
41982
- [92]: [hardBreakEscape, characterEscape],
41983
- [93]: labelEnd,
41984
- [95]: attention,
41985
- [96]: codeText
41986
- };
41987
- const insideSpan = {
41988
- null: [attention, resolver]
41989
- };
41990
- const attentionMarkers = {
41991
- null: [42, 95]
41992
- };
41993
- const disable = {
41994
- null: []
41995
- };
41996
- const defaultConstructs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
41997
- __proto__: null,
41998
- attentionMarkers,
41999
- contentInitial,
42000
- disable,
42001
- document: document$1,
42002
- flow,
42003
- flowInitial,
42004
- insideSpan,
42005
- string,
42006
- text: text$4
42007
- }, Symbol.toStringTag, { value: "Module" }));
42008
42096
  function createTokenizer(parser, initialize, from2) {
42009
- let point2 = {
42010
- _bufferIndex: -1,
42011
- _index: 0,
42012
- line: from2 && from2.line || 1,
42013
- column: from2 && from2.column || 1,
42014
- offset: from2 && from2.offset || 0
42015
- };
42097
+ let point2 = Object.assign(
42098
+ from2 ? Object.assign({}, from2) : {
42099
+ line: 1,
42100
+ column: 1,
42101
+ offset: 0
42102
+ },
42103
+ {
42104
+ _index: 0,
42105
+ _bufferIndex: -1
42106
+ }
42107
+ );
42016
42108
  const columnStart = {};
42017
42109
  const resolveAllConstructs = [];
42018
42110
  let chunks = [];
42019
42111
  let stack = [];
42020
42112
  const effects = {
42021
- attempt: constructFactory(onsuccessfulconstruct),
42022
- check: constructFactory(onsuccessfulcheck),
42023
42113
  consume,
42024
42114
  enter,
42025
42115
  exit: exit2,
42116
+ attempt: constructFactory(onsuccessfulconstruct),
42117
+ check: constructFactory(onsuccessfulcheck),
42026
42118
  interrupt: constructFactory(onsuccessfulcheck, {
42027
42119
  interrupt: true
42028
42120
  })
42029
42121
  };
42030
42122
  const context2 = {
42123
+ previous: null,
42031
42124
  code: null,
42032
42125
  containerState: {},
42033
- defineSkip,
42034
42126
  events: [],
42035
- now,
42036
42127
  parser,
42037
- previous: null,
42038
- sliceSerialize,
42039
42128
  sliceStream,
42129
+ sliceSerialize,
42130
+ now,
42131
+ defineSkip,
42040
42132
  write
42041
42133
  };
42042
42134
  let state = initialize.tokenize.call(context2, effects);
@@ -42061,19 +42153,13 @@ function createTokenizer(parser, initialize, from2) {
42061
42153
  return sliceChunks(chunks, token);
42062
42154
  }
42063
42155
  function now() {
42064
- const {
42065
- _bufferIndex,
42066
- _index,
42067
- line: line2,
42068
- column,
42069
- offset: offset2
42070
- } = point2;
42156
+ const { line: line2, column, offset: offset2, _index, _bufferIndex } = point2;
42071
42157
  return {
42072
- _bufferIndex,
42073
- _index,
42074
42158
  line: line2,
42075
42159
  column,
42076
- offset: offset2
42160
+ offset: offset2,
42161
+ _index,
42162
+ _bufferIndex
42077
42163
  };
42078
42164
  }
42079
42165
  function defineSkip(value) {
@@ -42114,10 +42200,7 @@ function createTokenizer(parser, initialize, from2) {
42114
42200
  point2._index++;
42115
42201
  } else {
42116
42202
  point2._bufferIndex++;
42117
- if (point2._bufferIndex === // Points w/ non-negative `_bufferIndex` reference
42118
- // strings.
42119
- /** @type {string} */
42120
- chunks[point2._index].length) {
42203
+ if (point2._bufferIndex === chunks[point2._index].length) {
42121
42204
  point2._bufferIndex = -1;
42122
42205
  point2._index++;
42123
42206
  }
@@ -42151,25 +42234,19 @@ function createTokenizer(parser, initialize, from2) {
42151
42234
  let constructIndex;
42152
42235
  let currentConstruct;
42153
42236
  let info;
42154
- return Array.isArray(constructs2) ? (
42155
- /* c8 ignore next 1 */
42156
- handleListOfConstructs(constructs2)
42157
- ) : "tokenize" in constructs2 ? (
42158
- // Looks like a construct.
42159
- handleListOfConstructs([
42160
- /** @type {Construct} */
42161
- constructs2
42162
- ])
42237
+ return Array.isArray(constructs2) ? handleListOfConstructs(constructs2) : "tokenize" in constructs2 ? (
42238
+ // @ts-expect-error Looks like a construct.
42239
+ handleListOfConstructs([constructs2])
42163
42240
  ) : handleMapOfConstructs(constructs2);
42164
42241
  function handleMapOfConstructs(map3) {
42165
42242
  return start;
42166
42243
  function start(code2) {
42167
- const left = code2 !== null && map3[code2];
42244
+ const def = code2 !== null && map3[code2];
42168
42245
  const all2 = code2 !== null && map3.null;
42169
42246
  const list2 = [
42170
42247
  // To do: add more extension tests.
42171
42248
  /* c8 ignore next 2 */
42172
- ...Array.isArray(left) ? left : left ? [left] : [],
42249
+ ...Array.isArray(def) ? def : def ? [def] : [],
42173
42250
  ...Array.isArray(all2) ? all2 : all2 ? [all2] : []
42174
42251
  ];
42175
42252
  return handleListOfConstructs(list2)(code2);
@@ -42223,7 +42300,12 @@ function createTokenizer(parser, initialize, from2) {
42223
42300
  resolveAllConstructs.push(construct);
42224
42301
  }
42225
42302
  if (construct.resolve) {
42226
- splice(context2.events, from3, context2.events.length - from3, construct.resolve(context2.events.slice(from3), context2));
42303
+ splice(
42304
+ context2.events,
42305
+ from3,
42306
+ context2.events.length - from3,
42307
+ construct.resolve(context2.events.slice(from3), context2)
42308
+ );
42227
42309
  }
42228
42310
  if (construct.resolveTo) {
42229
42311
  context2.events = construct.resolveTo(context2.events, context2);
@@ -42236,8 +42318,8 @@ function createTokenizer(parser, initialize, from2) {
42236
42318
  const startEventsIndex = context2.events.length;
42237
42319
  const startStack = Array.from(stack);
42238
42320
  return {
42239
- from: startEventsIndex,
42240
- restore
42321
+ restore,
42322
+ from: startEventsIndex
42241
42323
  };
42242
42324
  function restore() {
42243
42325
  point2 = startPoint;
@@ -42288,37 +42370,111 @@ function serializeChunks(chunks, expandTabs) {
42288
42370
  let value;
42289
42371
  if (typeof chunk2 === "string") {
42290
42372
  value = chunk2;
42291
- } else switch (chunk2) {
42292
- case -5: {
42293
- value = "\r";
42294
- break;
42295
- }
42296
- case -4: {
42297
- value = "\n";
42298
- break;
42299
- }
42300
- case -3: {
42301
- value = "\r\n";
42302
- break;
42303
- }
42304
- case -2: {
42305
- value = expandTabs ? " " : " ";
42306
- break;
42307
- }
42308
- case -1: {
42309
- if (!expandTabs && atTab) continue;
42310
- value = " ";
42311
- break;
42312
- }
42313
- default: {
42314
- value = String.fromCharCode(chunk2);
42373
+ } else
42374
+ switch (chunk2) {
42375
+ case -5: {
42376
+ value = "\r";
42377
+ break;
42378
+ }
42379
+ case -4: {
42380
+ value = "\n";
42381
+ break;
42382
+ }
42383
+ case -3: {
42384
+ value = "\r\n";
42385
+ break;
42386
+ }
42387
+ case -2: {
42388
+ value = expandTabs ? " " : " ";
42389
+ break;
42390
+ }
42391
+ case -1: {
42392
+ if (!expandTabs && atTab) continue;
42393
+ value = " ";
42394
+ break;
42395
+ }
42396
+ default: {
42397
+ value = String.fromCharCode(chunk2);
42398
+ }
42315
42399
  }
42316
- }
42317
42400
  atTab = chunk2 === -2;
42318
42401
  result2.push(value);
42319
42402
  }
42320
42403
  return result2.join("");
42321
42404
  }
42405
+ const document$1 = {
42406
+ [42]: list$3,
42407
+ [43]: list$3,
42408
+ [45]: list$3,
42409
+ [48]: list$3,
42410
+ [49]: list$3,
42411
+ [50]: list$3,
42412
+ [51]: list$3,
42413
+ [52]: list$3,
42414
+ [53]: list$3,
42415
+ [54]: list$3,
42416
+ [55]: list$3,
42417
+ [56]: list$3,
42418
+ [57]: list$3,
42419
+ [62]: blockQuote
42420
+ };
42421
+ const contentInitial = {
42422
+ [91]: definition$1
42423
+ };
42424
+ const flowInitial = {
42425
+ [-2]: codeIndented,
42426
+ [-1]: codeIndented,
42427
+ [32]: codeIndented
42428
+ };
42429
+ const flow = {
42430
+ [35]: headingAtx,
42431
+ [42]: thematicBreak$2,
42432
+ [45]: [setextUnderline, thematicBreak$2],
42433
+ [60]: htmlFlow,
42434
+ [61]: setextUnderline,
42435
+ [95]: thematicBreak$2,
42436
+ [96]: codeFenced,
42437
+ [126]: codeFenced
42438
+ };
42439
+ const string = {
42440
+ [38]: characterReference,
42441
+ [92]: characterEscape
42442
+ };
42443
+ const text$4 = {
42444
+ [-5]: lineEnding,
42445
+ [-4]: lineEnding,
42446
+ [-3]: lineEnding,
42447
+ [33]: labelStartImage,
42448
+ [38]: characterReference,
42449
+ [42]: attention,
42450
+ [60]: [autolink, htmlText],
42451
+ [91]: labelStartLink,
42452
+ [92]: [hardBreakEscape, characterEscape],
42453
+ [93]: labelEnd,
42454
+ [95]: attention,
42455
+ [96]: codeText
42456
+ };
42457
+ const insideSpan = {
42458
+ null: [attention, resolver]
42459
+ };
42460
+ const attentionMarkers = {
42461
+ null: [42, 95]
42462
+ };
42463
+ const disable = {
42464
+ null: []
42465
+ };
42466
+ const defaultConstructs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
42467
+ __proto__: null,
42468
+ attentionMarkers,
42469
+ contentInitial,
42470
+ disable,
42471
+ document: document$1,
42472
+ flow,
42473
+ flowInitial,
42474
+ insideSpan,
42475
+ string,
42476
+ text: text$4
42477
+ }, Symbol.toStringTag, { value: "Module" }));
42322
42478
  function parse(options) {
42323
42479
  const settings = options || {};
42324
42480
  const constructs2 = (
@@ -42326,12 +42482,12 @@ function parse(options) {
42326
42482
  combineExtensions([defaultConstructs, ...settings.extensions || []])
42327
42483
  );
42328
42484
  const parser = {
42485
+ defined: [],
42486
+ lazy: {},
42329
42487
  constructs: constructs2,
42330
42488
  content: create2(content$2),
42331
- defined: [],
42332
42489
  document: create2(document$2),
42333
42490
  flow: create2(flow$1),
42334
- lazy: {},
42335
42491
  string: create2(string$1),
42336
42492
  text: create2(text$5)
42337
42493
  };
@@ -42447,7 +42603,11 @@ function fromMarkdown(value, encoding, options) {
42447
42603
  options = encoding;
42448
42604
  encoding = void 0;
42449
42605
  }
42450
- return compiler(options)(postprocess(parse(options).document().write(preprocess()(value, encoding, true))));
42606
+ return compiler(options)(
42607
+ postprocess(
42608
+ parse(options).document().write(preprocess()(value, encoding, true))
42609
+ )
42610
+ );
42451
42611
  }
42452
42612
  function compiler(options) {
42453
42613
  const config = {
@@ -42507,7 +42667,6 @@ function compiler(options) {
42507
42667
  characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker,
42508
42668
  characterReferenceMarkerNumeric: onexitcharacterreferencemarker,
42509
42669
  characterReferenceValue: onexitcharacterreferencevalue,
42510
- characterReference: onexitcharacterreference,
42511
42670
  codeFenced: closer(onexitcodefenced),
42512
42671
  codeFencedFence: onexitcodefencedfence,
42513
42672
  codeFencedFenceInfo: onexitcodefencedfenceinfo,
@@ -42582,9 +42741,15 @@ function compiler(options) {
42582
42741
  while (++index2 < events.length) {
42583
42742
  const handler = config[events[index2][0]];
42584
42743
  if (own$5.call(handler, events[index2][1].type)) {
42585
- handler[events[index2][1].type].call(Object.assign({
42586
- sliceSerialize: events[index2][2].sliceSerialize
42587
- }, context2), events[index2][1]);
42744
+ handler[events[index2][1].type].call(
42745
+ Object.assign(
42746
+ {
42747
+ sliceSerialize: events[index2][2].sliceSerialize
42748
+ },
42749
+ context2
42750
+ ),
42751
+ events[index2][1]
42752
+ );
42588
42753
  }
42589
42754
  }
42590
42755
  if (context2.tokenStack.length > 0) {
@@ -42593,16 +42758,20 @@ function compiler(options) {
42593
42758
  handler.call(context2, void 0, tail[0]);
42594
42759
  }
42595
42760
  tree.position = {
42596
- start: point(events.length > 0 ? events[0][1].start : {
42597
- line: 1,
42598
- column: 1,
42599
- offset: 0
42600
- }),
42601
- end: point(events.length > 0 ? events[events.length - 2][1].end : {
42602
- line: 1,
42603
- column: 1,
42604
- offset: 0
42605
- })
42761
+ start: point(
42762
+ events.length > 0 ? events[0][1].start : {
42763
+ line: 1,
42764
+ column: 1,
42765
+ offset: 0
42766
+ }
42767
+ ),
42768
+ end: point(
42769
+ events.length > 0 ? events[events.length - 2][1].end : {
42770
+ line: 1,
42771
+ column: 1,
42772
+ offset: 0
42773
+ }
42774
+ )
42606
42775
  };
42607
42776
  index2 = -1;
42608
42777
  while (++index2 < config.transforms.length) {
@@ -42674,7 +42843,10 @@ function compiler(options) {
42674
42843
  if (firstBlankLineIndex && (!lineIndex || firstBlankLineIndex < lineIndex)) {
42675
42844
  listItem22._spread = true;
42676
42845
  }
42677
- listItem22.end = Object.assign({}, lineIndex ? events[lineIndex][1].start : event[1].end);
42846
+ listItem22.end = Object.assign(
42847
+ {},
42848
+ lineIndex ? events[lineIndex][1].start : event[1].end
42849
+ );
42678
42850
  events.splice(lineIndex || index2, 0, ["exit", listItem22, event[2]]);
42679
42851
  index2++;
42680
42852
  length++;
@@ -42717,7 +42889,7 @@ function compiler(options) {
42717
42889
  const siblings = parent.children;
42718
42890
  siblings.push(node2);
42719
42891
  this.stack.push(node2);
42720
- this.tokenStack.push([token, errorHandler || void 0]);
42892
+ this.tokenStack.push([token, errorHandler]);
42721
42893
  node2.position = {
42722
42894
  start: point(token.start),
42723
42895
  // @ts-expect-error: `end` will be patched later.
@@ -42735,10 +42907,12 @@ function compiler(options) {
42735
42907
  const node2 = this.stack.pop();
42736
42908
  const open = this.tokenStack.pop();
42737
42909
  if (!open) {
42738
- throw new Error("Cannot close `" + token.type + "` (" + stringifyPosition({
42739
- start: token.start,
42740
- end: token.end
42741
- }) + "): it’s not open");
42910
+ throw new Error(
42911
+ "Cannot close `" + token.type + "` (" + stringifyPosition({
42912
+ start: token.start,
42913
+ end: token.end
42914
+ }) + "): it’s not open"
42915
+ );
42742
42916
  } else if (open[0].type !== token.type) {
42743
42917
  if (onExitError) {
42744
42918
  onExitError.call(this, token, open[0]);
@@ -42792,7 +42966,9 @@ function compiler(options) {
42792
42966
  const label = this.resume();
42793
42967
  const node2 = this.stack[this.stack.length - 1];
42794
42968
  node2.label = label;
42795
- node2.identifier = normalizeIdentifier(this.sliceSerialize(token)).toLowerCase();
42969
+ node2.identifier = normalizeIdentifier(
42970
+ this.sliceSerialize(token)
42971
+ ).toLowerCase();
42796
42972
  }
42797
42973
  function onexitdefinitiontitlestring() {
42798
42974
  const data2 = this.resume();
@@ -42938,7 +43114,9 @@ function compiler(options) {
42938
43114
  const label = this.resume();
42939
43115
  const node2 = this.stack[this.stack.length - 1];
42940
43116
  node2.label = label;
42941
- node2.identifier = normalizeIdentifier(this.sliceSerialize(token)).toLowerCase();
43117
+ node2.identifier = normalizeIdentifier(
43118
+ this.sliceSerialize(token)
43119
+ ).toLowerCase();
42942
43120
  this.data.referenceType = "full";
42943
43121
  }
42944
43122
  function onexitcharacterreferencemarker(token) {
@@ -42949,17 +43127,17 @@ function compiler(options) {
42949
43127
  const type = this.data.characterReferenceType;
42950
43128
  let value;
42951
43129
  if (type) {
42952
- value = decodeNumericCharacterReference(data2, type === "characterReferenceMarkerNumeric" ? 10 : 16);
43130
+ value = decodeNumericCharacterReference(
43131
+ data2,
43132
+ type === "characterReferenceMarkerNumeric" ? 10 : 16
43133
+ );
42953
43134
  this.data.characterReferenceType = void 0;
42954
43135
  } else {
42955
43136
  const result2 = decodeNamedCharacterReference(data2);
42956
43137
  value = result2;
42957
43138
  }
42958
- const tail = this.stack[this.stack.length - 1];
42959
- tail.value += value;
42960
- }
42961
- function onexitcharacterreference(token) {
42962
43139
  const tail = this.stack.pop();
43140
+ tail.value += value;
42963
43141
  tail.position.end = point(token.end);
42964
43142
  }
42965
43143
  function onexitautolinkprotocol(token) {
@@ -43134,18 +43312,22 @@ function extension(combined, extension2) {
43134
43312
  }
43135
43313
  function defaultOnError(left, right) {
43136
43314
  if (left) {
43137
- throw new Error("Cannot close `" + left.type + "` (" + stringifyPosition({
43138
- start: left.start,
43139
- end: left.end
43140
- }) + "): a different token (`" + right.type + "`, " + stringifyPosition({
43141
- start: right.start,
43142
- end: right.end
43143
- }) + ") is open");
43315
+ throw new Error(
43316
+ "Cannot close `" + left.type + "` (" + stringifyPosition({
43317
+ start: left.start,
43318
+ end: left.end
43319
+ }) + "): a different token (`" + right.type + "`, " + stringifyPosition({
43320
+ start: right.start,
43321
+ end: right.end
43322
+ }) + ") is open"
43323
+ );
43144
43324
  } else {
43145
- throw new Error("Cannot close document, a token (`" + right.type + "`, " + stringifyPosition({
43146
- start: right.start,
43147
- end: right.end
43148
- }) + ") is still open");
43325
+ throw new Error(
43326
+ "Cannot close document, a token (`" + right.type + "`, " + stringifyPosition({
43327
+ start: right.start,
43328
+ end: right.end
43329
+ }) + ") is still open"
43330
+ );
43149
43331
  }
43150
43332
  }
43151
43333
  function remarkParse(options) {
@@ -43302,13 +43484,13 @@ function revert(state, node2) {
43302
43484
  }
43303
43485
  function imageReference$1(state, node2) {
43304
43486
  const id2 = String(node2.identifier).toUpperCase();
43305
- const definition2 = state.definitionById.get(id2);
43306
- if (!definition2) {
43487
+ const def = state.definitionById.get(id2);
43488
+ if (!def) {
43307
43489
  return revert(state, node2);
43308
43490
  }
43309
- const properties2 = { src: normalizeUri(definition2.url || ""), alt: node2.alt };
43310
- if (definition2.title !== null && definition2.title !== void 0) {
43311
- properties2.title = definition2.title;
43491
+ const properties2 = { src: normalizeUri(def.url || ""), alt: node2.alt };
43492
+ if (def.title !== null && def.title !== void 0) {
43493
+ properties2.title = def.title;
43312
43494
  }
43313
43495
  const result2 = { type: "element", tagName: "img", properties: properties2, children: [] };
43314
43496
  state.patch(node2, result2);
@@ -43340,13 +43522,13 @@ function inlineCode$1(state, node2) {
43340
43522
  }
43341
43523
  function linkReference$1(state, node2) {
43342
43524
  const id2 = String(node2.identifier).toUpperCase();
43343
- const definition2 = state.definitionById.get(id2);
43344
- if (!definition2) {
43525
+ const def = state.definitionById.get(id2);
43526
+ if (!def) {
43345
43527
  return revert(state, node2);
43346
43528
  }
43347
- const properties2 = { href: normalizeUri(definition2.url || "") };
43348
- if (definition2.title !== null && definition2.title !== void 0) {
43349
- properties2.title = definition2.title;
43529
+ const properties2 = { href: normalizeUri(def.url || "") };
43530
+ if (def.title !== null && def.title !== void 0) {
43531
+ properties2.title = def.title;
43350
43532
  }
43351
43533
  const result2 = {
43352
43534
  type: "element",
@@ -43706,12 +43888,6 @@ const deserializer = ($2, _2) => {
43706
43888
  return as(BigInt(value), index2);
43707
43889
  case "BigInt":
43708
43890
  return as(Object(BigInt(value)), index2);
43709
- case "ArrayBuffer":
43710
- return as(new Uint8Array(value).buffer, value);
43711
- case "DataView": {
43712
- const { buffer } = new Uint8Array(value);
43713
- return as(new DataView(buffer), value);
43714
- }
43715
43891
  }
43716
43892
  return as(new env[type](value), index2);
43717
43893
  };
@@ -43739,8 +43915,6 @@ const typeOf = (value) => {
43739
43915
  return [MAP, EMPTY];
43740
43916
  case "Set":
43741
43917
  return [SET, EMPTY];
43742
- case "DataView":
43743
- return [ARRAY, asString];
43744
43918
  }
43745
43919
  if (asString.includes("Array"))
43746
43920
  return [ARRAY, asString];
@@ -43779,15 +43953,8 @@ const serializer = (strict, json2, $2, _2) => {
43779
43953
  return as([TYPE, entry], value);
43780
43954
  }
43781
43955
  case ARRAY: {
43782
- if (type) {
43783
- let spread = value;
43784
- if (type === "DataView") {
43785
- spread = new Uint8Array(value.buffer);
43786
- } else if (type === "ArrayBuffer") {
43787
- spread = new Uint8Array(value);
43788
- }
43789
- return as([type, [...spread]], value);
43790
- }
43956
+ if (type)
43957
+ return as([type, [...value]], value);
43791
43958
  const arr = [];
43792
43959
  const index2 = as([TYPE, arr], value);
43793
43960
  for (const entry of value)
@@ -43880,14 +44047,12 @@ function footer$1(state) {
43880
44047
  const listItems = [];
43881
44048
  let referenceIndex = -1;
43882
44049
  while (++referenceIndex < state.footnoteOrder.length) {
43883
- const definition2 = state.footnoteById.get(
43884
- state.footnoteOrder[referenceIndex]
43885
- );
43886
- if (!definition2) {
44050
+ const def = state.footnoteById.get(state.footnoteOrder[referenceIndex]);
44051
+ if (!def) {
43887
44052
  continue;
43888
44053
  }
43889
- const content2 = state.all(definition2);
43890
- const id2 = String(definition2.identifier).toUpperCase();
44054
+ const content2 = state.all(def);
44055
+ const id2 = String(def.identifier).toUpperCase();
43891
44056
  const safeId = normalizeUri(id2.toLowerCase());
43892
44057
  let rereferenceIndex = 0;
43893
44058
  const backReferences = [];
@@ -43930,7 +44095,7 @@ function footer$1(state) {
43930
44095
  properties: { id: clobberPrefix + "fn-" + safeId },
43931
44096
  children: state.wrap(content2, true)
43932
44097
  };
43933
- state.patch(definition2, listItem2);
44098
+ state.patch(def, listItem2);
43934
44099
  listItems.push(listItem2);
43935
44100
  }
43936
44101
  if (listItems.length === 0) {
@@ -44312,7 +44477,7 @@ function remarkRehype(destination, options) {
44312
44477
  return function(tree, file) {
44313
44478
  return (
44314
44479
  /** @type {HastRoot} */
44315
- toHast(tree, { file, ...destination || options })
44480
+ toHast(tree, { file, ...options || destination })
44316
44481
  );
44317
44482
  };
44318
44483
  }
@@ -44495,9 +44660,9 @@ function wrap(middleware, callback) {
44495
44660
  done(null, value);
44496
44661
  }
44497
44662
  }
44498
- const minpath = { basename: basename$1, dirname: dirname$1, extname, join, sep: "/" };
44499
- function basename$1(path2, extname2) {
44500
- if (extname2 !== void 0 && typeof extname2 !== "string") {
44663
+ const path$2 = { basename: basename$1, dirname: dirname$1, extname, join, sep: "/" };
44664
+ function basename$1(path2, ext) {
44665
+ if (ext !== void 0 && typeof ext !== "string") {
44501
44666
  throw new TypeError('"ext" argument must be a string');
44502
44667
  }
44503
44668
  assertPath$1(path2);
@@ -44505,7 +44670,7 @@ function basename$1(path2, extname2) {
44505
44670
  let end = -1;
44506
44671
  let index2 = path2.length;
44507
44672
  let seenNonSlash;
44508
- if (extname2 === void 0 || extname2.length === 0 || extname2.length > path2.length) {
44673
+ if (ext === void 0 || ext.length === 0 || ext.length > path2.length) {
44509
44674
  while (index2--) {
44510
44675
  if (path2.codePointAt(index2) === 47) {
44511
44676
  if (seenNonSlash) {
@@ -44519,11 +44684,11 @@ function basename$1(path2, extname2) {
44519
44684
  }
44520
44685
  return end < 0 ? "" : path2.slice(start, end);
44521
44686
  }
44522
- if (extname2 === path2) {
44687
+ if (ext === path2) {
44523
44688
  return "";
44524
44689
  }
44525
44690
  let firstNonSlashEnd = -1;
44526
- let extnameIndex = extname2.length - 1;
44691
+ let extIndex = ext.length - 1;
44527
44692
  while (index2--) {
44528
44693
  if (path2.codePointAt(index2) === 47) {
44529
44694
  if (seenNonSlash) {
@@ -44535,13 +44700,13 @@ function basename$1(path2, extname2) {
44535
44700
  seenNonSlash = true;
44536
44701
  firstNonSlashEnd = index2 + 1;
44537
44702
  }
44538
- if (extnameIndex > -1) {
44539
- if (path2.codePointAt(index2) === extname2.codePointAt(extnameIndex--)) {
44540
- if (extnameIndex < 0) {
44703
+ if (extIndex > -1) {
44704
+ if (path2.codePointAt(index2) === ext.codePointAt(extIndex--)) {
44705
+ if (extIndex < 0) {
44541
44706
  end = index2;
44542
44707
  }
44543
44708
  } else {
44544
- extnameIndex = -1;
44709
+ extIndex = -1;
44545
44710
  end = firstNonSlashEnd;
44546
44711
  }
44547
44712
  }
@@ -44706,7 +44871,7 @@ function assertPath$1(path2) {
44706
44871
  );
44707
44872
  }
44708
44873
  }
44709
- const minproc = { cwd };
44874
+ const proc = { cwd };
44710
44875
  function cwd() {
44711
44876
  return "/";
44712
44877
  }
@@ -44802,7 +44967,7 @@ class VFile {
44802
44967
  } else {
44803
44968
  options = value;
44804
44969
  }
44805
- this.cwd = "cwd" in options ? "" : minproc.cwd();
44970
+ this.cwd = proc.cwd();
44806
44971
  this.data = {};
44807
44972
  this.history = [];
44808
44973
  this.messages = [];
@@ -44812,15 +44977,15 @@ class VFile {
44812
44977
  this.stored;
44813
44978
  let index2 = -1;
44814
44979
  while (++index2 < order.length) {
44815
- const field2 = order[index2];
44816
- if (field2 in options && options[field2] !== void 0 && options[field2] !== null) {
44817
- this[field2] = field2 === "history" ? [...options[field2]] : options[field2];
44980
+ const prop2 = order[index2];
44981
+ if (prop2 in options && options[prop2] !== void 0 && options[prop2] !== null) {
44982
+ this[prop2] = prop2 === "history" ? [...options[prop2]] : options[prop2];
44818
44983
  }
44819
44984
  }
44820
- let field;
44821
- for (field in options) {
44822
- if (!order.includes(field)) {
44823
- this[field] = options[field];
44985
+ let prop;
44986
+ for (prop in options) {
44987
+ if (!order.includes(prop)) {
44988
+ this[prop] = options[prop];
44824
44989
  }
44825
44990
  }
44826
44991
  }
@@ -44831,7 +44996,7 @@ class VFile {
44831
44996
  * Basename.
44832
44997
  */
44833
44998
  get basename() {
44834
- return typeof this.path === "string" ? minpath.basename(this.path) : void 0;
44999
+ return typeof this.path === "string" ? path$2.basename(this.path) : void 0;
44835
45000
  }
44836
45001
  /**
44837
45002
  * Set basename (including extname) (`'index.min.js'`).
@@ -44848,7 +45013,7 @@ class VFile {
44848
45013
  set basename(basename2) {
44849
45014
  assertNonEmpty(basename2, "basename");
44850
45015
  assertPart(basename2, "basename");
44851
- this.path = minpath.join(this.dirname || "", basename2);
45016
+ this.path = path$2.join(this.dirname || "", basename2);
44852
45017
  }
44853
45018
  /**
44854
45019
  * Get the parent path (example: `'~'`).
@@ -44857,7 +45022,7 @@ class VFile {
44857
45022
  * Dirname.
44858
45023
  */
44859
45024
  get dirname() {
44860
- return typeof this.path === "string" ? minpath.dirname(this.path) : void 0;
45025
+ return typeof this.path === "string" ? path$2.dirname(this.path) : void 0;
44861
45026
  }
44862
45027
  /**
44863
45028
  * Set the parent path (example: `'~'`).
@@ -44871,7 +45036,7 @@ class VFile {
44871
45036
  */
44872
45037
  set dirname(dirname2) {
44873
45038
  assertPath(this.basename, "dirname");
44874
- this.path = minpath.join(dirname2 || "", this.basename);
45039
+ this.path = path$2.join(dirname2 || "", this.basename);
44875
45040
  }
44876
45041
  /**
44877
45042
  * Get the extname (including dot) (example: `'.js'`).
@@ -44880,7 +45045,7 @@ class VFile {
44880
45045
  * Extname.
44881
45046
  */
44882
45047
  get extname() {
44883
- return typeof this.path === "string" ? minpath.extname(this.path) : void 0;
45048
+ return typeof this.path === "string" ? path$2.extname(this.path) : void 0;
44884
45049
  }
44885
45050
  /**
44886
45051
  * Set the extname (including dot) (example: `'.js'`).
@@ -44905,7 +45070,7 @@ class VFile {
44905
45070
  throw new Error("`extname` cannot contain multiple dots");
44906
45071
  }
44907
45072
  }
44908
- this.path = minpath.join(this.dirname, this.stem + (extname2 || ""));
45073
+ this.path = path$2.join(this.dirname, this.stem + (extname2 || ""));
44909
45074
  }
44910
45075
  /**
44911
45076
  * Get the full path (example: `'~/index.min.js'`).
@@ -44944,7 +45109,7 @@ class VFile {
44944
45109
  * Stem.
44945
45110
  */
44946
45111
  get stem() {
44947
- return typeof this.path === "string" ? minpath.basename(this.path, this.extname) : void 0;
45112
+ return typeof this.path === "string" ? path$2.basename(this.path, this.extname) : void 0;
44948
45113
  }
44949
45114
  /**
44950
45115
  * Set the stem (basename w/o extname) (example: `'index.min'`).
@@ -44961,7 +45126,7 @@ class VFile {
44961
45126
  set stem(stem) {
44962
45127
  assertNonEmpty(stem, "stem");
44963
45128
  assertPart(stem, "stem");
44964
- this.path = minpath.join(this.dirname || "", stem + (this.extname || ""));
45129
+ this.path = path$2.join(this.dirname || "", stem + (this.extname || ""));
44965
45130
  }
44966
45131
  // Normal prototypal methods.
44967
45132
  /**
@@ -45190,9 +45355,9 @@ class VFile {
45190
45355
  }
45191
45356
  }
45192
45357
  function assertPart(part, name2) {
45193
- if (part && part.includes(minpath.sep)) {
45358
+ if (part && part.includes(path$2.sep)) {
45194
45359
  throw new Error(
45195
- "`" + name2 + "` cannot be a path: did not expect `" + minpath.sep + "`"
45360
+ "`" + name2 + "` cannot be a path: did not expect `" + path$2.sep + "`"
45196
45361
  );
45197
45362
  }
45198
45363
  }
@@ -60929,7 +61094,7 @@ const defaultSchema = {
60929
61094
  };
60930
61095
  const own = {}.hasOwnProperty;
60931
61096
  function sanitize(node2, options) {
60932
- let result2 = { type: "root", children: [] };
61097
+ let ctx = { type: "root", children: [] };
60933
61098
  const state = {
60934
61099
  schema: options ? { ...defaultSchema, ...options } : defaultSchema,
60935
61100
  stack: []
@@ -60938,15 +61103,15 @@ function sanitize(node2, options) {
60938
61103
  if (replace2) {
60939
61104
  if (Array.isArray(replace2)) {
60940
61105
  if (replace2.length === 1) {
60941
- result2 = replace2[0];
61106
+ ctx = replace2[0];
60942
61107
  } else {
60943
- result2.children = replace2;
61108
+ ctx.children = replace2;
60944
61109
  }
60945
61110
  } else {
60946
- result2 = replace2;
61111
+ ctx = replace2;
60947
61112
  }
60948
61113
  }
60949
- return result2;
61114
+ return ctx;
60950
61115
  }
60951
61116
  function transform(state, node2) {
60952
61117
  if (node2 && typeof node2 === "object") {
@@ -60998,7 +61163,7 @@ function element(state, unsafe) {
60998
61163
  /** @type {Array<ElementContent>} */
60999
61164
  children(state, unsafe.children)
61000
61165
  );
61001
- const properties_ = properties(state, unsafe.properties);
61166
+ const props = properties(state, unsafe.properties);
61002
61167
  state.stack.pop();
61003
61168
  let safeElement = false;
61004
61169
  if (name2 && name2 !== "*" && (!state.schema.tagNames || state.schema.tagNames.includes(name2))) {
@@ -61020,7 +61185,7 @@ function element(state, unsafe) {
61020
61185
  const node2 = {
61021
61186
  type: "element",
61022
61187
  tagName: name2,
61023
- properties: properties_,
61188
+ properties: props,
61024
61189
  children: content2
61025
61190
  };
61026
61191
  patch(node2, unsafe);
@@ -61068,15 +61233,15 @@ function properties(state, properties2) {
61068
61233
  const required = state.schema.required;
61069
61234
  const specific = attributes && own.call(attributes, tagName) ? attributes[tagName] : void 0;
61070
61235
  const defaults = attributes && own.call(attributes, "*") ? attributes["*"] : void 0;
61071
- const properties_ = (
61236
+ const props = (
61072
61237
  /** @type {Readonly<Record<string, Readonly<unknown>>>} */
61073
61238
  properties2 && typeof properties2 === "object" ? properties2 : {}
61074
61239
  );
61075
61240
  const result2 = {};
61076
61241
  let key;
61077
- for (key in properties_) {
61078
- if (own.call(properties_, key)) {
61079
- const unsafe = properties_[key];
61242
+ for (key in props) {
61243
+ if (own.call(props, key)) {
61244
+ const unsafe = props[key];
61080
61245
  let safe = propertyValue(
61081
61246
  state,
61082
61247
  findDefinition(specific, key),
@@ -61381,7 +61546,7 @@ function transformGfmAutolinkLiterals(tree) {
61381
61546
  tree,
61382
61547
  [
61383
61548
  [/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi, findUrl],
61384
- [new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)", "gu"), findEmail]
61549
+ [/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g, findEmail]
61385
61550
  ],
61386
61551
  { ignore: ["link", "linkReference"] }
61387
61552
  );
@@ -61454,18 +61619,31 @@ function splitUrl(url) {
61454
61619
  }
61455
61620
  function previous(match, email) {
61456
61621
  const code2 = match.input.charCodeAt(match.index - 1);
61457
- return (match.index === 0 || unicodeWhitespace(code2) || unicodePunctuation(code2)) && // If it’s an email, the previous character should not be a slash.
61458
- (!email || code2 !== 47);
61622
+ return (match.index === 0 || unicodeWhitespace(code2) || unicodePunctuation(code2)) && (!email || code2 !== 47);
61459
61623
  }
61460
61624
  footnoteReference.peek = footnoteReferencePeek;
61461
- function enterFootnoteCallString() {
61462
- this.buffer();
61463
- }
61464
- function enterFootnoteCall(token) {
61465
- this.enter({ type: "footnoteReference", identifier: "", label: "" }, token);
61625
+ function gfmFootnoteFromMarkdown() {
61626
+ return {
61627
+ enter: {
61628
+ gfmFootnoteDefinition: enterFootnoteDefinition,
61629
+ gfmFootnoteDefinitionLabelString: enterFootnoteDefinitionLabelString,
61630
+ gfmFootnoteCall: enterFootnoteCall,
61631
+ gfmFootnoteCallString: enterFootnoteCallString
61632
+ },
61633
+ exit: {
61634
+ gfmFootnoteDefinition: exitFootnoteDefinition,
61635
+ gfmFootnoteDefinitionLabelString: exitFootnoteDefinitionLabelString,
61636
+ gfmFootnoteCall: exitFootnoteCall,
61637
+ gfmFootnoteCallString: exitFootnoteCallString
61638
+ }
61639
+ };
61466
61640
  }
61467
- function enterFootnoteDefinitionLabelString() {
61468
- this.buffer();
61641
+ function gfmFootnoteToMarkdown() {
61642
+ return {
61643
+ // This is on by default already.
61644
+ unsafe: [{ character: "[", inConstruct: ["phrasing", "label", "reference"] }],
61645
+ handlers: { footnoteDefinition, footnoteReference }
61646
+ };
61469
61647
  }
61470
61648
  function enterFootnoteDefinition(token) {
61471
61649
  this.enter(
@@ -61473,99 +61651,86 @@ function enterFootnoteDefinition(token) {
61473
61651
  token
61474
61652
  );
61475
61653
  }
61476
- function exitFootnoteCallString(token) {
61654
+ function enterFootnoteDefinitionLabelString() {
61655
+ this.buffer();
61656
+ }
61657
+ function exitFootnoteDefinitionLabelString(token) {
61477
61658
  const label = this.resume();
61478
61659
  const node2 = this.stack[this.stack.length - 1];
61479
- ok$2(node2.type === "footnoteReference");
61660
+ ok$2(node2.type === "footnoteDefinition");
61661
+ node2.label = label;
61480
61662
  node2.identifier = normalizeIdentifier(
61481
61663
  this.sliceSerialize(token)
61482
61664
  ).toLowerCase();
61483
- node2.label = label;
61484
61665
  }
61485
- function exitFootnoteCall(token) {
61666
+ function exitFootnoteDefinition(token) {
61486
61667
  this.exit(token);
61487
61668
  }
61488
- function exitFootnoteDefinitionLabelString(token) {
61669
+ function enterFootnoteCall(token) {
61670
+ this.enter({ type: "footnoteReference", identifier: "", label: "" }, token);
61671
+ }
61672
+ function enterFootnoteCallString() {
61673
+ this.buffer();
61674
+ }
61675
+ function exitFootnoteCallString(token) {
61489
61676
  const label = this.resume();
61490
61677
  const node2 = this.stack[this.stack.length - 1];
61491
- ok$2(node2.type === "footnoteDefinition");
61678
+ ok$2(node2.type === "footnoteReference");
61679
+ node2.label = label;
61492
61680
  node2.identifier = normalizeIdentifier(
61493
61681
  this.sliceSerialize(token)
61494
61682
  ).toLowerCase();
61495
- node2.label = label;
61496
61683
  }
61497
- function exitFootnoteDefinition(token) {
61684
+ function exitFootnoteCall(token) {
61498
61685
  this.exit(token);
61499
61686
  }
61500
- function footnoteReferencePeek() {
61501
- return "[";
61502
- }
61503
61687
  function footnoteReference(node2, _2, state, info) {
61504
61688
  const tracker = state.createTracker(info);
61505
61689
  let value = tracker.move("[^");
61506
61690
  const exit2 = state.enter("footnoteReference");
61507
61691
  const subexit = state.enter("reference");
61508
61692
  value += tracker.move(
61509
- state.safe(state.associationId(node2), { after: "]", before: value })
61693
+ state.safe(state.associationId(node2), {
61694
+ ...tracker.current(),
61695
+ before: value,
61696
+ after: "]"
61697
+ })
61510
61698
  );
61511
61699
  subexit();
61512
61700
  exit2();
61513
61701
  value += tracker.move("]");
61514
61702
  return value;
61515
61703
  }
61516
- function gfmFootnoteFromMarkdown() {
61517
- return {
61518
- enter: {
61519
- gfmFootnoteCallString: enterFootnoteCallString,
61520
- gfmFootnoteCall: enterFootnoteCall,
61521
- gfmFootnoteDefinitionLabelString: enterFootnoteDefinitionLabelString,
61522
- gfmFootnoteDefinition: enterFootnoteDefinition
61523
- },
61524
- exit: {
61525
- gfmFootnoteCallString: exitFootnoteCallString,
61526
- gfmFootnoteCall: exitFootnoteCall,
61527
- gfmFootnoteDefinitionLabelString: exitFootnoteDefinitionLabelString,
61528
- gfmFootnoteDefinition: exitFootnoteDefinition
61529
- }
61530
- };
61531
- }
61532
- function gfmFootnoteToMarkdown(options) {
61533
- let firstLineBlank = false;
61534
- if (options && options.firstLineBlank) {
61535
- firstLineBlank = true;
61536
- }
61537
- return {
61538
- handlers: { footnoteDefinition, footnoteReference },
61539
- // This is on by default already.
61540
- unsafe: [{ character: "[", inConstruct: ["label", "phrasing", "reference"] }]
61541
- };
61542
- function footnoteDefinition(node2, _2, state, info) {
61543
- const tracker = state.createTracker(info);
61544
- let value = tracker.move("[^");
61545
- const exit2 = state.enter("footnoteDefinition");
61546
- const subexit = state.enter("label");
61547
- value += tracker.move(
61548
- state.safe(state.associationId(node2), { before: value, after: "]" })
61549
- );
61550
- subexit();
61551
- value += tracker.move("]:");
61552
- if (node2.children && node2.children.length > 0) {
61553
- tracker.shift(4);
61554
- value += tracker.move(
61555
- (firstLineBlank ? "\n" : " ") + state.indentLines(
61556
- state.containerFlow(node2, tracker.current()),
61557
- firstLineBlank ? mapAll : mapExceptFirst
61558
- )
61559
- );
61560
- }
61561
- exit2();
61562
- return value;
61563
- }
61704
+ function footnoteReferencePeek() {
61705
+ return "[";
61564
61706
  }
61565
- function mapExceptFirst(line2, index2, blank) {
61566
- return index2 === 0 ? line2 : mapAll(line2, index2, blank);
61707
+ function footnoteDefinition(node2, _2, state, info) {
61708
+ const tracker = state.createTracker(info);
61709
+ let value = tracker.move("[^");
61710
+ const exit2 = state.enter("footnoteDefinition");
61711
+ const subexit = state.enter("label");
61712
+ value += tracker.move(
61713
+ state.safe(state.associationId(node2), {
61714
+ ...tracker.current(),
61715
+ before: value,
61716
+ after: "]"
61717
+ })
61718
+ );
61719
+ subexit();
61720
+ value += tracker.move(
61721
+ "]:" + (node2.children && node2.children.length > 0 ? " " : "")
61722
+ );
61723
+ tracker.shift(4);
61724
+ value += tracker.move(
61725
+ state.indentLines(state.containerFlow(node2, tracker.current()), map$2)
61726
+ );
61727
+ exit2();
61728
+ return value;
61567
61729
  }
61568
- function mapAll(line2, index2, blank) {
61730
+ function map$2(line2, index2, blank) {
61731
+ if (index2 === 0) {
61732
+ return line2;
61733
+ }
61569
61734
  return (blank ? "" : " ") + line2;
61570
61735
  }
61571
61736
  const constructsWithoutStrikethrough = [
@@ -61618,13 +61783,9 @@ function handleDelete(node2, _2, state, info) {
61618
61783
  function peekDelete() {
61619
61784
  return "~";
61620
61785
  }
61621
- function defaultStringLength(value) {
61622
- return value.length;
61623
- }
61624
- function markdownTable(table2, options) {
61625
- const settings = options || {};
61626
- const align = (settings.align || []).concat();
61627
- const stringLength = settings.stringLength || defaultStringLength;
61786
+ function markdownTable(table2, options = {}) {
61787
+ const align = (options.align || []).concat();
61788
+ const stringLength = options.stringLength || defaultStringLength;
61628
61789
  const alignments2 = [];
61629
61790
  const cellMatrix = [];
61630
61791
  const sizeMatrix = [];
@@ -61640,7 +61801,7 @@ function markdownTable(table2, options) {
61640
61801
  }
61641
61802
  while (++columnIndex2 < table2[rowIndex].length) {
61642
61803
  const cell2 = serialize(table2[rowIndex][columnIndex2]);
61643
- if (settings.alignDelimiters !== false) {
61804
+ if (options.alignDelimiters !== false) {
61644
61805
  const size2 = stringLength(cell2);
61645
61806
  sizes2[columnIndex2] = size2;
61646
61807
  if (longestCellByColumn[columnIndex2] === void 0 || size2 > longestCellByColumn[columnIndex2]) {
@@ -61678,12 +61839,12 @@ function markdownTable(table2, options) {
61678
61839
  } else if (code2 === 114) {
61679
61840
  after = ":";
61680
61841
  }
61681
- let size2 = settings.alignDelimiters === false ? 1 : Math.max(
61842
+ let size2 = options.alignDelimiters === false ? 1 : Math.max(
61682
61843
  1,
61683
61844
  longestCellByColumn[columnIndex] - before.length - after.length
61684
61845
  );
61685
61846
  const cell2 = before + "-".repeat(size2) + after;
61686
- if (settings.alignDelimiters !== false) {
61847
+ if (options.alignDelimiters !== false) {
61687
61848
  size2 = before.length + size2 + after.length;
61688
61849
  if (size2 > longestCellByColumn[columnIndex]) {
61689
61850
  longestCellByColumn[columnIndex] = size2;
@@ -61705,7 +61866,7 @@ function markdownTable(table2, options) {
61705
61866
  const cell2 = row3[columnIndex] || "";
61706
61867
  let before = "";
61707
61868
  let after = "";
61708
- if (settings.alignDelimiters !== false) {
61869
+ if (options.alignDelimiters !== false) {
61709
61870
  const size2 = longestCellByColumn[columnIndex] - (sizes2[columnIndex] || 0);
61710
61871
  const code2 = alignments2[columnIndex];
61711
61872
  if (code2 === 114) {
@@ -61722,30 +61883,30 @@ function markdownTable(table2, options) {
61722
61883
  after = " ".repeat(size2);
61723
61884
  }
61724
61885
  }
61725
- if (settings.delimiterStart !== false && !columnIndex) {
61886
+ if (options.delimiterStart !== false && !columnIndex) {
61726
61887
  line2.push("|");
61727
61888
  }
61728
- if (settings.padding !== false && // Don’t add the opening space if we’re not aligning and the cell is
61889
+ if (options.padding !== false && // Don’t add the opening space if we’re not aligning and the cell is
61729
61890
  // empty: there will be a closing space.
61730
- !(settings.alignDelimiters === false && cell2 === "") && (settings.delimiterStart !== false || columnIndex)) {
61891
+ !(options.alignDelimiters === false && cell2 === "") && (options.delimiterStart !== false || columnIndex)) {
61731
61892
  line2.push(" ");
61732
61893
  }
61733
- if (settings.alignDelimiters !== false) {
61894
+ if (options.alignDelimiters !== false) {
61734
61895
  line2.push(before);
61735
61896
  }
61736
61897
  line2.push(cell2);
61737
- if (settings.alignDelimiters !== false) {
61898
+ if (options.alignDelimiters !== false) {
61738
61899
  line2.push(after);
61739
61900
  }
61740
- if (settings.padding !== false) {
61901
+ if (options.padding !== false) {
61741
61902
  line2.push(" ");
61742
61903
  }
61743
- if (settings.delimiterEnd !== false || columnIndex !== mostCellsPerRow - 1) {
61904
+ if (options.delimiterEnd !== false || columnIndex !== mostCellsPerRow - 1) {
61744
61905
  line2.push("|");
61745
61906
  }
61746
61907
  }
61747
61908
  lines.push(
61748
- settings.delimiterEnd === false ? line2.join("").replace(/ +$/, "") : line2.join("")
61909
+ options.delimiterEnd === false ? line2.join("").replace(/ +$/, "") : line2.join("")
61749
61910
  );
61750
61911
  }
61751
61912
  return lines.join("\n");
@@ -61753,6 +61914,9 @@ function markdownTable(table2, options) {
61753
61914
  function serialize(value) {
61754
61915
  return value === null || value === void 0 ? "" : String(value);
61755
61916
  }
61917
+ function defaultStringLength(value) {
61918
+ return value.length;
61919
+ }
61756
61920
  function toAlignment(value) {
61757
61921
  const code2 = typeof value === "string" ? value.codePointAt(0) : 0;
61758
61922
  return code2 === 67 || code2 === 99 ? 99 : code2 === 76 || code2 === 108 ? 108 : code2 === 82 || code2 === 114 ? 114 : 0;
@@ -61960,83 +62124,22 @@ function checkEmphasis(state) {
61960
62124
  }
61961
62125
  return marker;
61962
62126
  }
61963
- function encodeCharacterReference(code2) {
61964
- return "&#x" + code2.toString(16).toUpperCase() + ";";
61965
- }
61966
- function encodeInfo(outside, inside, marker) {
61967
- const outsideKind = classifyCharacter(outside);
61968
- const insideKind = classifyCharacter(inside);
61969
- if (outsideKind === void 0) {
61970
- return insideKind === void 0 ? (
61971
- // Letter inside:
61972
- // we have to encode *both* letters for `_` as it is looser.
61973
- // it already forms for `*` (and GFMs `~`).
61974
- marker === "_" ? { inside: true, outside: true } : { inside: false, outside: false }
61975
- ) : insideKind === 1 ? (
61976
- // Whitespace inside: encode both (letter, whitespace).
61977
- { inside: true, outside: true }
61978
- ) : (
61979
- // Punctuation inside: encode outer (letter)
61980
- { inside: false, outside: true }
61981
- );
61982
- }
61983
- if (outsideKind === 1) {
61984
- return insideKind === void 0 ? (
61985
- // Letter inside: already forms.
61986
- { inside: false, outside: false }
61987
- ) : insideKind === 1 ? (
61988
- // Whitespace inside: encode both (whitespace).
61989
- { inside: true, outside: true }
61990
- ) : (
61991
- // Punctuation inside: already forms.
61992
- { inside: false, outside: false }
61993
- );
61994
- }
61995
- return insideKind === void 0 ? (
61996
- // Letter inside: already forms.
61997
- { inside: false, outside: false }
61998
- ) : insideKind === 1 ? (
61999
- // Whitespace inside: encode inner (whitespace).
62000
- { inside: true, outside: false }
62001
- ) : (
62002
- // Punctuation inside: already forms.
62003
- { inside: false, outside: false }
62004
- );
62005
- }
62006
62127
  emphasis.peek = emphasisPeek;
62007
62128
  function emphasis(node2, _2, state, info) {
62008
62129
  const marker = checkEmphasis(state);
62009
62130
  const exit2 = state.enter("emphasis");
62010
62131
  const tracker = state.createTracker(info);
62011
- const before = tracker.move(marker);
62012
- let between = tracker.move(
62132
+ let value = tracker.move(marker);
62133
+ value += tracker.move(
62013
62134
  state.containerPhrasing(node2, {
62135
+ before: value,
62014
62136
  after: marker,
62015
- before,
62016
62137
  ...tracker.current()
62017
62138
  })
62018
62139
  );
62019
- const betweenHead = between.charCodeAt(0);
62020
- const open = encodeInfo(
62021
- info.before.charCodeAt(info.before.length - 1),
62022
- betweenHead,
62023
- marker
62024
- );
62025
- if (open.inside) {
62026
- between = encodeCharacterReference(betweenHead) + between.slice(1);
62027
- }
62028
- const betweenTail = between.charCodeAt(between.length - 1);
62029
- const close2 = encodeInfo(info.after.charCodeAt(0), betweenTail, marker);
62030
- if (close2.inside) {
62031
- between = between.slice(0, -1) + encodeCharacterReference(betweenTail);
62032
- }
62033
- const after = tracker.move(marker);
62140
+ value += tracker.move(marker);
62034
62141
  exit2();
62035
- state.attentionEncodeSurroundingInfo = {
62036
- after: close2.outside,
62037
- before: open.outside
62038
- };
62039
- return before + between + after;
62142
+ return value;
62040
62143
  }
62041
62144
  function emphasisPeek(_2, _1, state) {
62042
62145
  return state.options.emphasis || "*";
@@ -62083,7 +62186,7 @@ function heading$1(node2, _2, state, info) {
62083
62186
  ...tracker.current()
62084
62187
  });
62085
62188
  if (/^[\t ]/.test(value)) {
62086
- value = encodeCharacterReference(value.charCodeAt(0)) + value.slice(1);
62189
+ value = "&#x" + value.charCodeAt(0).toString(16).toUpperCase() + ";" + value.slice(1);
62087
62190
  }
62088
62191
  value = value ? sequence + " " + value : sequence;
62089
62192
  if (state.options.closeAtx) {
@@ -62506,8 +62609,8 @@ function root$5(node2, _2, state, info) {
62506
62609
  const hasPhrasing = node2.children.some(function(d2) {
62507
62610
  return phrasing(d2);
62508
62611
  });
62509
- const container2 = hasPhrasing ? state.containerPhrasing : state.containerFlow;
62510
- return container2.call(state, node2, info);
62612
+ const fn = hasPhrasing ? state.containerPhrasing : state.containerFlow;
62613
+ return fn.call(state, node2, info);
62511
62614
  }
62512
62615
  function checkStrong(state) {
62513
62616
  const marker = state.options.strong || "*";
@@ -62523,35 +62626,17 @@ function strong(node2, _2, state, info) {
62523
62626
  const marker = checkStrong(state);
62524
62627
  const exit2 = state.enter("strong");
62525
62628
  const tracker = state.createTracker(info);
62526
- const before = tracker.move(marker + marker);
62527
- let between = tracker.move(
62629
+ let value = tracker.move(marker + marker);
62630
+ value += tracker.move(
62528
62631
  state.containerPhrasing(node2, {
62632
+ before: value,
62529
62633
  after: marker,
62530
- before,
62531
62634
  ...tracker.current()
62532
62635
  })
62533
62636
  );
62534
- const betweenHead = between.charCodeAt(0);
62535
- const open = encodeInfo(
62536
- info.before.charCodeAt(info.before.length - 1),
62537
- betweenHead,
62538
- marker
62539
- );
62540
- if (open.inside) {
62541
- between = encodeCharacterReference(betweenHead) + between.slice(1);
62542
- }
62543
- const betweenTail = between.charCodeAt(between.length - 1);
62544
- const close2 = encodeInfo(info.after.charCodeAt(0), betweenTail, marker);
62545
- if (close2.inside) {
62546
- between = between.slice(0, -1) + encodeCharacterReference(betweenTail);
62547
- }
62548
- const after = tracker.move(marker + marker);
62637
+ value += tracker.move(marker + marker);
62549
62638
  exit2();
62550
- state.attentionEncodeSurroundingInfo = {
62551
- after: close2.outside,
62552
- before: open.outside
62553
- };
62554
- return before + between + after;
62639
+ return value;
62555
62640
  }
62556
62641
  function strongPeek(_2, _1, state) {
62557
62642
  return state.options.strong || "*";
@@ -62828,7 +62913,7 @@ function gfmToMarkdown(options) {
62828
62913
  return {
62829
62914
  extensions: [
62830
62915
  gfmAutolinkLiteralToMarkdown(),
62831
- gfmFootnoteToMarkdown(options),
62916
+ gfmFootnoteToMarkdown(),
62832
62917
  gfmStrikethroughToMarkdown(),
62833
62918
  gfmTableToMarkdown(options),
62834
62919
  gfmTaskListItemToMarkdown()
@@ -62856,17 +62941,14 @@ const emailDomainDotTrail = {
62856
62941
  partial: true
62857
62942
  };
62858
62943
  const wwwAutolink = {
62859
- name: "wwwAutolink",
62860
62944
  tokenize: tokenizeWwwAutolink,
62861
62945
  previous: previousWww
62862
62946
  };
62863
62947
  const protocolAutolink = {
62864
- name: "protocolAutolink",
62865
62948
  tokenize: tokenizeProtocolAutolink,
62866
62949
  previous: previousProtocol
62867
62950
  };
62868
62951
  const emailAutolink = {
62869
- name: "emailAutolink",
62870
62952
  tokenize: tokenizeEmailAutolink,
62871
62953
  previous: previousEmail
62872
62954
  };
@@ -62917,7 +62999,11 @@ function tokenizeEmailAutolink(effects, ok2, nok) {
62917
62999
  }
62918
63000
  function emailDomain(code2) {
62919
63001
  if (code2 === 46) {
62920
- return effects.check(emailDomainDotTrail, emailDomainAfter, emailDomainDot)(code2);
63002
+ return effects.check(
63003
+ emailDomainDotTrail,
63004
+ emailDomainAfter,
63005
+ emailDomainDot
63006
+ )(code2);
62921
63007
  }
62922
63008
  if (code2 === 45 || code2 === 95 || asciiAlphanumeric(code2)) {
62923
63009
  data = true;
@@ -62949,7 +63035,11 @@ function tokenizeWwwAutolink(effects, ok2, nok) {
62949
63035
  }
62950
63036
  effects.enter("literalAutolink");
62951
63037
  effects.enter("literalAutolinkWww");
62952
- return effects.check(wwwPrefix, effects.attempt(domain, effects.attempt(path$1, wwwAfter), nok), nok)(code2);
63038
+ return effects.check(
63039
+ wwwPrefix,
63040
+ effects.attempt(domain, effects.attempt(path$1, wwwAfter), nok),
63041
+ nok
63042
+ )(code2);
62953
63043
  }
62954
63044
  function wwwAfter(code2) {
62955
63045
  effects.exit("literalAutolinkWww");
@@ -63098,7 +63188,7 @@ function tokenizeTrail(effects, ok2, nok) {
63098
63188
  }
63099
63189
  if (code2 === 38) {
63100
63190
  effects.consume(code2);
63101
- return trailCharacterReferenceStart;
63191
+ return trailCharRefStart;
63102
63192
  }
63103
63193
  if (code2 === 93) {
63104
63194
  effects.consume(code2);
@@ -63119,17 +63209,17 @@ function tokenizeTrail(effects, ok2, nok) {
63119
63209
  }
63120
63210
  return trail2(code2);
63121
63211
  }
63122
- function trailCharacterReferenceStart(code2) {
63123
- return asciiAlpha(code2) ? trailCharacterReferenceInside(code2) : nok(code2);
63212
+ function trailCharRefStart(code2) {
63213
+ return asciiAlpha(code2) ? trailCharRefInside(code2) : nok(code2);
63124
63214
  }
63125
- function trailCharacterReferenceInside(code2) {
63215
+ function trailCharRefInside(code2) {
63126
63216
  if (code2 === 59) {
63127
63217
  effects.consume(code2);
63128
63218
  return trail2;
63129
63219
  }
63130
63220
  if (asciiAlpha(code2)) {
63131
63221
  effects.consume(code2);
63132
- return trailCharacterReferenceInside;
63222
+ return trailCharRefInside;
63133
63223
  }
63134
63224
  return nok(code2);
63135
63225
  }
@@ -63183,7 +63273,6 @@ function gfmFootnote() {
63183
63273
  return {
63184
63274
  document: {
63185
63275
  [91]: {
63186
- name: "gfmFootnoteDefinition",
63187
63276
  tokenize: tokenizeDefinitionStart,
63188
63277
  continuation: {
63189
63278
  tokenize: tokenizeDefinitionContinuation
@@ -63193,11 +63282,9 @@ function gfmFootnote() {
63193
63282
  },
63194
63283
  text: {
63195
63284
  [91]: {
63196
- name: "gfmFootnoteCall",
63197
63285
  tokenize: tokenizeGfmFootnoteCall
63198
63286
  },
63199
63287
  [93]: {
63200
- name: "gfmPotentialFootnoteCall",
63201
63288
  add: "after",
63202
63289
  tokenize: tokenizePotentialGfmFootnoteCall,
63203
63290
  resolveTo: resolveToPotentialGfmFootnoteCall
@@ -63225,10 +63312,12 @@ function tokenizePotentialGfmFootnoteCall(effects, ok2, nok) {
63225
63312
  if (!labelStart || !labelStart._balanced) {
63226
63313
  return nok(code2);
63227
63314
  }
63228
- const id2 = normalizeIdentifier(self2.sliceSerialize({
63229
- start: labelStart.end,
63230
- end: self2.now()
63231
- }));
63315
+ const id2 = normalizeIdentifier(
63316
+ self2.sliceSerialize({
63317
+ start: labelStart.end,
63318
+ end: self2.now()
63319
+ })
63320
+ );
63232
63321
  if (id2.codePointAt(0) !== 94 || !defined.includes(id2.slice(1))) {
63233
63322
  return nok(code2);
63234
63323
  }
@@ -63425,7 +63514,11 @@ function tokenizeDefinitionStart(effects, ok2, nok) {
63425
63514
  if (!defined.includes(identifier2)) {
63426
63515
  defined.push(identifier2);
63427
63516
  }
63428
- return factorySpace(effects, whitespaceAfter, "gfmFootnoteDefinitionWhitespace");
63517
+ return factorySpace(
63518
+ effects,
63519
+ whitespaceAfter,
63520
+ "gfmFootnoteDefinitionWhitespace"
63521
+ );
63429
63522
  }
63430
63523
  return nok(code2);
63431
63524
  }
@@ -63441,7 +63534,12 @@ function gfmFootnoteDefinitionEnd(effects) {
63441
63534
  }
63442
63535
  function tokenizeIndent(effects, ok2, nok) {
63443
63536
  const self2 = this;
63444
- return factorySpace(effects, afterPrefix, "gfmFootnoteDefinitionIndent", 4 + 1);
63537
+ return factorySpace(
63538
+ effects,
63539
+ afterPrefix,
63540
+ "gfmFootnoteDefinitionIndent",
63541
+ 4 + 1
63542
+ );
63445
63543
  function afterPrefix(code2) {
63446
63544
  const tail = self2.events[self2.events.length - 1];
63447
63545
  return tail && tail[1].type === "gfmFootnoteDefinitionIndent" && tail[2].sliceSerialize(tail[1], true).length === 4 ? ok2(code2) : nok(code2);
@@ -63451,7 +63549,6 @@ function gfmStrikethrough(options) {
63451
63549
  const options_ = options || {};
63452
63550
  let single = options_.singleTilde;
63453
63551
  const tokenizer = {
63454
- name: "strikethrough",
63455
63552
  tokenize: tokenizeStrikethrough,
63456
63553
  resolveAll: resolveAllStrikethrough
63457
63554
  };
@@ -63489,12 +63586,27 @@ function gfmStrikethrough(options) {
63489
63586
  start: Object.assign({}, events[open][1].end),
63490
63587
  end: Object.assign({}, events[index2][1].start)
63491
63588
  };
63492
- const nextEvents = [["enter", strikethrough2, context2], ["enter", events[open][1], context2], ["exit", events[open][1], context2], ["enter", text2, context2]];
63589
+ const nextEvents = [
63590
+ ["enter", strikethrough2, context2],
63591
+ ["enter", events[open][1], context2],
63592
+ ["exit", events[open][1], context2],
63593
+ ["enter", text2, context2]
63594
+ ];
63493
63595
  const insideSpan2 = context2.parser.constructs.insideSpan.null;
63494
63596
  if (insideSpan2) {
63495
- splice(nextEvents, nextEvents.length, 0, resolveAll(insideSpan2, events.slice(open + 1, index2), context2));
63597
+ splice(
63598
+ nextEvents,
63599
+ nextEvents.length,
63600
+ 0,
63601
+ resolveAll(insideSpan2, events.slice(open + 1, index2), context2)
63602
+ );
63496
63603
  }
63497
- splice(nextEvents, nextEvents.length, 0, [["exit", text2, context2], ["enter", events[index2][1], context2], ["exit", events[index2][1], context2], ["exit", strikethrough2, context2]]);
63604
+ splice(nextEvents, nextEvents.length, 0, [
63605
+ ["exit", text2, context2],
63606
+ ["enter", events[index2][1], context2],
63607
+ ["exit", events[index2][1], context2],
63608
+ ["exit", strikethrough2, context2]
63609
+ ]);
63498
63610
  splice(events, open - 1, index2 - open + 3, nextEvents);
63499
63611
  index2 = open + nextEvents.length - 2;
63500
63612
  break;
@@ -63555,7 +63667,7 @@ class EditMap {
63555
63667
  * @returns {undefined}
63556
63668
  */
63557
63669
  add(index2, remove, add) {
63558
- addImplementation(this, index2, remove, add);
63670
+ addImpl(this, index2, remove, add);
63559
63671
  }
63560
63672
  // To do: add this when moving to `micromark`.
63561
63673
  // /**
@@ -63567,7 +63679,7 @@ class EditMap {
63567
63679
  // * @returns {undefined}
63568
63680
  // */
63569
63681
  // addBefore(index, remove, add) {
63570
- // addImplementation(this, index, remove, add, true)
63682
+ // addImpl(this, index, remove, add, true)
63571
63683
  // }
63572
63684
  /**
63573
63685
  * Done, change the events.
@@ -63586,22 +63698,23 @@ class EditMap {
63586
63698
  const vecs = [];
63587
63699
  while (index2 > 0) {
63588
63700
  index2 -= 1;
63589
- vecs.push(events.slice(this.map[index2][0] + this.map[index2][1]), this.map[index2][2]);
63701
+ vecs.push(
63702
+ events.slice(this.map[index2][0] + this.map[index2][1]),
63703
+ this.map[index2][2]
63704
+ );
63590
63705
  events.length = this.map[index2][0];
63591
63706
  }
63592
- vecs.push(events.slice());
63707
+ vecs.push([...events]);
63593
63708
  events.length = 0;
63594
63709
  let slice2 = vecs.pop();
63595
63710
  while (slice2) {
63596
- for (const element2 of slice2) {
63597
- events.push(element2);
63598
- }
63711
+ events.push(...slice2);
63599
63712
  slice2 = vecs.pop();
63600
63713
  }
63601
63714
  this.map.length = 0;
63602
63715
  }
63603
63716
  }
63604
- function addImplementation(editMap, at2, remove, add) {
63717
+ function addImpl(editMap, at2, remove, add) {
63605
63718
  let index2 = 0;
63606
63719
  if (remove === 0 && add.length === 0) {
63607
63720
  return;
@@ -63624,7 +63737,9 @@ function gfmTableAlign(events, index2) {
63624
63737
  if (inDelimiterRow) {
63625
63738
  if (event[0] === "enter") {
63626
63739
  if (event[1].type === "tableContent") {
63627
- align.push(events[index2 + 1][1].type === "tableDelimiterMarker" ? "left" : "none");
63740
+ align.push(
63741
+ events[index2 + 1][1].type === "tableDelimiterMarker" ? "left" : "none"
63742
+ );
63628
63743
  }
63629
63744
  } else if (event[1].type === "tableContent") {
63630
63745
  if (events[index2 - 1][1].type === "tableDelimiterMarker") {
@@ -63645,7 +63760,6 @@ function gfmTable() {
63645
63760
  return {
63646
63761
  flow: {
63647
63762
  null: {
63648
- name: "table",
63649
63763
  tokenize: tokenizeTable,
63650
63764
  resolveAll: resolveTable
63651
63765
  }
@@ -63663,7 +63777,8 @@ function tokenizeTable(effects, ok2, nok) {
63663
63777
  while (index2 > -1) {
63664
63778
  const type = self2.events[index2][1].type;
63665
63779
  if (type === "lineEnding" || // Note: markdown-rs uses `whitespace` instead of `linePrefix`
63666
- type === "linePrefix") index2--;
63780
+ type === "linePrefix")
63781
+ index2--;
63667
63782
  else break;
63668
63783
  }
63669
63784
  const tail = index2 > -1 ? self2.events[index2][1].type : null;
@@ -63743,7 +63858,12 @@ function tokenizeTable(effects, ok2, nok) {
63743
63858
  effects.enter("tableDelimiterRow");
63744
63859
  seen = false;
63745
63860
  if (markdownSpace(code2)) {
63746
- return factorySpace(effects, headDelimiterBefore, "linePrefix", self2.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(code2);
63861
+ return factorySpace(
63862
+ effects,
63863
+ headDelimiterBefore,
63864
+ "linePrefix",
63865
+ self2.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4
63866
+ )(code2);
63747
63867
  }
63748
63868
  return headDelimiterBefore(code2);
63749
63869
  }
@@ -63918,7 +64038,14 @@ function resolveTable(events, context2) {
63918
64038
  if (cell2[2] === 0) {
63919
64039
  if (lastCell[1] !== 0) {
63920
64040
  cell2[0] = cell2[1];
63921
- currentCell = flushCell(map3, context2, lastCell, rowKind, void 0, currentCell);
64041
+ currentCell = flushCell(
64042
+ map3,
64043
+ context2,
64044
+ lastCell,
64045
+ rowKind,
64046
+ void 0,
64047
+ currentCell
64048
+ );
63922
64049
  lastCell = [0, 0, 0, 0];
63923
64050
  }
63924
64051
  cell2[2] = index2;
@@ -63929,7 +64056,14 @@ function resolveTable(events, context2) {
63929
64056
  } else {
63930
64057
  if (lastCell[1] !== 0) {
63931
64058
  cell2[0] = cell2[1];
63932
- currentCell = flushCell(map3, context2, lastCell, rowKind, void 0, currentCell);
64059
+ currentCell = flushCell(
64060
+ map3,
64061
+ context2,
64062
+ lastCell,
64063
+ rowKind,
64064
+ void 0,
64065
+ currentCell
64066
+ );
63933
64067
  }
63934
64068
  lastCell = cell2;
63935
64069
  cell2 = [lastCell[1], index2, 0, 0];
@@ -63942,7 +64076,14 @@ function resolveTable(events, context2) {
63942
64076
  lastTableEnd = index2;
63943
64077
  if (lastCell[1] !== 0) {
63944
64078
  cell2[0] = cell2[1];
63945
- currentCell = flushCell(map3, context2, lastCell, rowKind, index2, currentCell);
64079
+ currentCell = flushCell(
64080
+ map3,
64081
+ context2,
64082
+ lastCell,
64083
+ rowKind,
64084
+ index2,
64085
+ currentCell
64086
+ );
63946
64087
  } else if (cell2[1] !== 0) {
63947
64088
  currentCell = flushCell(map3, context2, cell2, rowKind, index2, currentCell);
63948
64089
  }
@@ -64026,7 +64167,6 @@ function getPoint(events, index2) {
64026
64167
  return event[1][side];
64027
64168
  }
64028
64169
  const tasklistCheck = {
64029
- name: "tasklistCheck",
64030
64170
  tokenize: tokenizeTasklistCheck
64031
64171
  };
64032
64172
  function gfmTaskListItem() {
@@ -64084,9 +64224,13 @@ function tokenizeTasklistCheck(effects, ok2, nok) {
64084
64224
  return ok2(code2);
64085
64225
  }
64086
64226
  if (markdownSpace(code2)) {
64087
- return effects.check({
64088
- tokenize: spaceThenNonSpace
64089
- }, ok2, nok)(code2);
64227
+ return effects.check(
64228
+ {
64229
+ tokenize: spaceThenNonSpace
64230
+ },
64231
+ ok2,
64232
+ nok
64233
+ )(code2);
64090
64234
  }
64091
64235
  return nok(code2);
64092
64236
  }
@@ -70924,7 +71068,7 @@ const $cb5cc270b50c6fcd$export$7dacb05d26466c3 = /* @__PURE__ */ forwardRef((pro
70924
71068
  const context2 = $cb5cc270b50c6fcd$var$usePopoverContext($cb5cc270b50c6fcd$var$TRIGGER_NAME, __scopePopover);
70925
71069
  const popperScope = $cb5cc270b50c6fcd$var$usePopperScope(__scopePopover);
70926
71070
  const composedTriggerRef = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context2.triggerRef);
70927
- const trigger = /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
71071
+ const trigger = /* @__PURE__ */ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends$1({
70928
71072
  type: "button",
70929
71073
  "aria-haspopup": "dialog",
70930
71074
  "aria-expanded": context2.open,
@@ -70934,7 +71078,7 @@ const $cb5cc270b50c6fcd$export$7dacb05d26466c3 = /* @__PURE__ */ forwardRef((pro
70934
71078
  ref: composedTriggerRef,
70935
71079
  onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, context2.onOpenToggle)
70936
71080
  }));
70937
- return context2.hasCustomAnchor ? trigger : /* @__PURE__ */ createElement($cf1ac5d9fe0e8206$export$b688253958b8dfe7, _extends({
71081
+ return context2.hasCustomAnchor ? trigger : /* @__PURE__ */ createElement($cf1ac5d9fe0e8206$export$b688253958b8dfe7, _extends$1({
70938
71082
  asChild: true
70939
71083
  }, popperScope), trigger);
70940
71084
  });
@@ -70962,9 +71106,9 @@ const $cb5cc270b50c6fcd$export$d7e1f420b25549ff = /* @__PURE__ */ forwardRef((pr
70962
71106
  const context2 = $cb5cc270b50c6fcd$var$usePopoverContext($cb5cc270b50c6fcd$var$CONTENT_NAME, props.__scopePopover);
70963
71107
  return /* @__PURE__ */ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
70964
71108
  present: forceMount || context2.open
70965
- }, context2.modal ? /* @__PURE__ */ createElement($cb5cc270b50c6fcd$var$PopoverContentModal, _extends({}, contentProps, {
71109
+ }, context2.modal ? /* @__PURE__ */ createElement($cb5cc270b50c6fcd$var$PopoverContentModal, _extends$1({}, contentProps, {
70966
71110
  ref: forwardedRef
70967
- })) : /* @__PURE__ */ createElement($cb5cc270b50c6fcd$var$PopoverContentNonModal, _extends({}, contentProps, {
71111
+ })) : /* @__PURE__ */ createElement($cb5cc270b50c6fcd$var$PopoverContentNonModal, _extends$1({}, contentProps, {
70968
71112
  ref: forwardedRef
70969
71113
  })));
70970
71114
  });
@@ -70980,7 +71124,7 @@ const $cb5cc270b50c6fcd$var$PopoverContentModal = /* @__PURE__ */ forwardRef((pr
70980
71124
  return /* @__PURE__ */ createElement(ReactRemoveScroll, {
70981
71125
  as: $5e63c961fc1ce211$export$8c6ed5c666ac1360,
70982
71126
  allowPinchZoom: true
70983
- }, /* @__PURE__ */ createElement($cb5cc270b50c6fcd$var$PopoverContentImpl, _extends({}, props, {
71127
+ }, /* @__PURE__ */ createElement($cb5cc270b50c6fcd$var$PopoverContentImpl, _extends$1({}, props, {
70984
71128
  ref: composedRefs,
70985
71129
  trapFocus: context2.open,
70986
71130
  disableOutsidePointerEvents: true,
@@ -71010,7 +71154,7 @@ const $cb5cc270b50c6fcd$var$PopoverContentNonModal = /* @__PURE__ */ forwardRef(
71010
71154
  const context2 = $cb5cc270b50c6fcd$var$usePopoverContext($cb5cc270b50c6fcd$var$CONTENT_NAME, props.__scopePopover);
71011
71155
  const hasInteractedOutsideRef = useRef$1(false);
71012
71156
  const hasPointerDownOutsideRef = useRef$1(false);
71013
- return /* @__PURE__ */ createElement($cb5cc270b50c6fcd$var$PopoverContentImpl, _extends({}, props, {
71157
+ return /* @__PURE__ */ createElement($cb5cc270b50c6fcd$var$PopoverContentImpl, _extends$1({}, props, {
71014
71158
  ref: forwardedRef,
71015
71159
  trapFocus: false,
71016
71160
  disableOutsidePointerEvents: false,
@@ -71058,7 +71202,7 @@ const $cb5cc270b50c6fcd$var$PopoverContentImpl = /* @__PURE__ */ forwardRef((pro
71058
71202
  onPointerDownOutside,
71059
71203
  onFocusOutside,
71060
71204
  onDismiss: () => context2.onOpenChange(false)
71061
- }, /* @__PURE__ */ createElement($cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2, _extends({
71205
+ }, /* @__PURE__ */ createElement($cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2, _extends$1({
71062
71206
  "data-state": $cb5cc270b50c6fcd$var$getState(context2.open),
71063
71207
  role: "dialog",
71064
71208
  id: context2.contentId