@plumile/ui 0.1.150 → 0.1.151

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.
@@ -1,4 +1,5 @@
1
1
  /* empty css */
2
+ /* empty css */
2
3
  /* empty css */
3
4
  //#region src/atomic/atoms/error_message/errorMessage.css.ts
4
5
  var e = "_13gu5w50 txvbqb1bij txvbqb9j txvbqbryk";
@@ -1,4 +1,5 @@
1
1
  /* empty css */
2
+ /* empty css */
2
3
  /* empty css */
3
4
  import { createRuntimeFn as e } from "@vanilla-extract/recipes/createRuntimeFn";
4
5
  //#region src/atomic/atoms/input/input.css.ts
@@ -1,6 +1,4 @@
1
1
  /* empty css */
2
- /* empty css */
3
- /* empty css */
4
2
  /* empty css */
5
3
  import { createRuntimeFn as e } from "@vanilla-extract/recipes/createRuntimeFn";
6
4
  //#region src/atomic/atoms/textarea/textarea.css.ts
@@ -1,4 +1,5 @@
1
1
  /* empty css */
2
+ /* empty css */
2
3
  /* empty css */
3
4
  //#region src/atomic/molecules/markdown/components/MarkdownArticleContainer.css.ts
4
5
  var e = "_7ez1431 _7ez1430 txvbqbfpn txvbqbh4x txvbqbheb";
@@ -1,5 +1,4 @@
1
1
  /* empty css */
2
- /* empty css */
3
2
  /* empty css */
4
3
  //#region src/atomic/molecules/markdown/components/MarkdownSubscript.css.ts
5
4
  var e = "_1x14aer1 _1x14aer0 txvbqb96 txvbqb80";
@@ -17,17 +17,17 @@ var f = /* @__PURE__ */ e(l(), 1), p = {}.hasOwnProperty, m = /* @__PURE__ */ ne
17
17
  "thead",
18
18
  "tfoot",
19
19
  "tr"
20
- ]), _ = new Set(["td", "th"]), v = "https://github.com/syntax-tree/hast-util-to-jsx-runtime";
21
- function y(e, t) {
20
+ ]), _ = new Set(["td", "th"]);
21
+ function v(e, t) {
22
22
  if (!t || t.Fragment === void 0) throw TypeError("Expected `Fragment` in options");
23
23
  let n = t.filePath || void 0, r;
24
24
  if (t.development) {
25
25
  if (typeof t.jsxDEV != "function") throw TypeError("Expected `jsxDEV` in options when `development: true`");
26
- r = A(n, t.jsxDEV);
26
+ r = k(n, t.jsxDEV);
27
27
  } else {
28
28
  if (typeof t.jsx != "function") throw TypeError("Expected `jsx` in production options");
29
29
  if (typeof t.jsxs != "function") throw TypeError("Expected `jsxs` in production options");
30
- r = k(n, t.jsx, t.jsxs);
30
+ r = O(n, t.jsx, t.jsxs);
31
31
  }
32
32
  let i = {
33
33
  Fragment: t.Fragment,
@@ -43,66 +43,66 @@ function y(e, t) {
43
43
  schema: t.space === "svg" ? s : o,
44
44
  stylePropertyNameCase: t.stylePropertyNameCase || "dom",
45
45
  tableCellAlignToStyle: t.tableCellAlignToStyle !== !1
46
- }, a = b(i, e, void 0);
46
+ }, a = y(i, e, void 0);
47
47
  return a && typeof a != "string" ? a : i.create(e, i.Fragment, { children: a || void 0 }, void 0);
48
48
  }
49
+ function y(e, t, n) {
50
+ if (t.type === "element") return b(e, t, n);
51
+ if (t.type === "mdxFlowExpression" || t.type === "mdxTextExpression") return x(e, t);
52
+ if (t.type === "mdxJsxFlowElement" || t.type === "mdxJsxTextElement") return C(e, t, n);
53
+ if (t.type === "mdxjsEsm") return S(e, t);
54
+ if (t.type === "root") return w(e, t, n);
55
+ if (t.type === "text") return T(e, t);
56
+ }
49
57
  function b(e, t, n) {
50
- if (t.type === "element") return x(e, t, n);
51
- if (t.type === "mdxFlowExpression" || t.type === "mdxTextExpression") return S(e, t);
52
- if (t.type === "mdxJsxFlowElement" || t.type === "mdxJsxTextElement") return w(e, t, n);
53
- if (t.type === "mdxjsEsm") return C(e, t);
54
- if (t.type === "root") return T(e, t, n);
55
- if (t.type === "text") return E(e, t);
56
- }
57
- function x(e, t, n) {
58
58
  let i = e.schema, a = i;
59
59
  t.tagName.toLowerCase() === "svg" && i.space === "html" && (a = s, e.schema = a), e.ancestors.push(t);
60
- let o = I(e, t.tagName, !1), c = j(e, t), l = N(e, t);
60
+ let o = F(e, t.tagName, !1), c = A(e, t), l = M(e, t);
61
61
  return g.has(t.tagName) && (l = l.filter(function(e) {
62
62
  return typeof e == "string" ? !r(e) : !0;
63
- })), D(e, c, o, t), O(c, l), e.ancestors.pop(), e.schema = i, e.create(t, o, c, n);
63
+ })), E(e, c, o, t), D(c, l), e.ancestors.pop(), e.schema = i, e.create(t, o, c, n);
64
64
  }
65
- function S(e, t) {
65
+ function x(e, t) {
66
66
  if (t.data && t.data.estree && e.evaluater) {
67
67
  let n = t.data.estree.body[0];
68
68
  return n.type, e.evaluater.evaluateExpression(n.expression);
69
69
  }
70
- L(e, t.position);
70
+ I(e, t.position);
71
71
  }
72
- function C(e, t) {
72
+ function S(e, t) {
73
73
  if (t.data && t.data.estree && e.evaluater) return e.evaluater.evaluateProgram(t.data.estree);
74
- L(e, t.position);
74
+ I(e, t.position);
75
75
  }
76
- function w(e, t, n) {
76
+ function C(e, t, n) {
77
77
  let r = e.schema, i = r;
78
78
  t.name === "svg" && r.space === "html" && (i = s, e.schema = i), e.ancestors.push(t);
79
- let a = t.name === null ? e.Fragment : I(e, t.name, !0), o = M(e, t), c = N(e, t);
80
- return D(e, o, a, t), O(o, c), e.ancestors.pop(), e.schema = r, e.create(t, a, o, n);
79
+ let a = t.name === null ? e.Fragment : F(e, t.name, !0), o = j(e, t), c = M(e, t);
80
+ return E(e, o, a, t), D(o, c), e.ancestors.pop(), e.schema = r, e.create(t, a, o, n);
81
81
  }
82
- function T(e, t, n) {
82
+ function w(e, t, n) {
83
83
  let r = {};
84
- return O(r, N(e, t)), e.create(t, e.Fragment, r, n);
84
+ return D(r, M(e, t)), e.create(t, e.Fragment, r, n);
85
85
  }
86
- function E(e, t) {
86
+ function T(e, t) {
87
87
  return t.value;
88
88
  }
89
- function D(e, t, n, r) {
89
+ function E(e, t, n, r) {
90
90
  typeof n != "string" && n !== e.Fragment && e.passNode && (t.node = r);
91
91
  }
92
- function O(e, t) {
92
+ function D(e, t) {
93
93
  if (t.length > 0) {
94
94
  let n = t.length > 1 ? t : t[0];
95
95
  n && (e.children = n);
96
96
  }
97
97
  }
98
- function k(e, t, n) {
98
+ function O(e, t, n) {
99
99
  return r;
100
100
  function r(e, r, i, a) {
101
101
  let o = Array.isArray(i.children) ? n : t;
102
102
  return a ? o(r, i, a) : o(r, i);
103
103
  }
104
104
  }
105
- function A(e, t) {
105
+ function k(e, t) {
106
106
  return n;
107
107
  function n(n, r, i, a) {
108
108
  let o = Array.isArray(i.children), s = u(n);
@@ -113,10 +113,10 @@ function A(e, t) {
113
113
  }, void 0);
114
114
  }
115
115
  }
116
- function j(e, t) {
116
+ function A(e, t) {
117
117
  let n = {}, r, i;
118
118
  for (i in t.properties) if (i !== "children" && p.call(t.properties, i)) {
119
- let a = P(e, i, t.properties[i]);
119
+ let a = N(e, i, t.properties[i]);
120
120
  if (a) {
121
121
  let [i, o] = a;
122
122
  e.tableCellAlignToStyle && i === "align" && typeof o == "string" && _.has(t.tagName) ? r = o : n[i] = o;
@@ -128,7 +128,7 @@ function j(e, t) {
128
128
  }
129
129
  return n;
130
130
  }
131
- function M(e, t) {
131
+ function j(e, t) {
132
132
  let n = {};
133
133
  for (let r of t.attributes) if (r.type === "mdxJsxExpressionAttribute") if (r.data && r.data.estree && e.evaluater) {
134
134
  let t = r.data.estree.body[0];
@@ -137,19 +137,19 @@ function M(e, t) {
137
137
  i.type;
138
138
  let a = i.properties[0];
139
139
  a.type, Object.assign(n, e.evaluater.evaluateExpression(a.argument));
140
- } else L(e, t.position);
140
+ } else I(e, t.position);
141
141
  else {
142
142
  let i = r.name, a;
143
143
  if (r.value && typeof r.value == "object") if (r.value.data && r.value.data.estree && e.evaluater) {
144
144
  let t = r.value.data.estree.body[0];
145
145
  t.type, a = e.evaluater.evaluateExpression(t.expression);
146
- } else L(e, t.position);
146
+ } else I(e, t.position);
147
147
  else a = r.value === null ? !0 : r.value;
148
148
  n[i] = a;
149
149
  }
150
150
  return n;
151
151
  }
152
- function N(e, t) {
152
+ function M(e, t) {
153
153
  let n = [], r = -1, i = e.passKeys ? /* @__PURE__ */ new Map() : m;
154
154
  for (; ++r < t.children.length;) {
155
155
  let a = t.children[r], o;
@@ -160,22 +160,22 @@ function N(e, t) {
160
160
  o = e + "-" + t, i.set(e, t + 1);
161
161
  }
162
162
  }
163
- let s = b(e, a, o);
163
+ let s = y(e, a, o);
164
164
  s !== void 0 && n.push(s);
165
165
  }
166
166
  return n;
167
167
  }
168
- function P(e, n, r) {
168
+ function N(e, n, r) {
169
169
  let o = a(e.schema, n);
170
170
  if (!(r == null || typeof r == "number" && Number.isNaN(r))) {
171
171
  if (Array.isArray(r) && (r = o.commaSeparated ? t(r) : c(r)), o.property === "style") {
172
- let t = typeof r == "object" ? r : F(e, String(r));
173
- return e.stylePropertyNameCase === "css" && (t = R(t)), ["style", t];
172
+ let t = typeof r == "object" ? r : P(e, String(r));
173
+ return e.stylePropertyNameCase === "css" && (t = L(t)), ["style", t];
174
174
  }
175
175
  return [e.elementAttributeNameCase === "react" && o.space ? i[o.property] || o.property : o.attribute, r];
176
176
  }
177
177
  }
178
- function F(e, t) {
178
+ function P(e, t) {
179
179
  try {
180
180
  return (0, f.default)(t, { reactCompat: !0 });
181
181
  } catch (t) {
@@ -186,10 +186,10 @@ function F(e, t) {
186
186
  ruleId: "style",
187
187
  source: "hast-util-to-jsx-runtime"
188
188
  });
189
- throw r.file = e.filePath || void 0, r.url = v + "#cannot-parse-style-attribute", r;
189
+ throw r.file = e.filePath || void 0, r.url = "https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-parse-style-attribute", r;
190
190
  }
191
191
  }
192
- function I(e, t, r) {
192
+ function F(e, t, r) {
193
193
  let i;
194
194
  if (!r) i = {
195
195
  type: "Literal",
@@ -226,30 +226,30 @@ function I(e, t, r) {
226
226
  return p.call(e.components, t) ? e.components[t] : t;
227
227
  }
228
228
  if (e.evaluater) return e.evaluater.evaluateExpression(i);
229
- L(e);
229
+ I(e);
230
230
  }
231
- function L(e, t) {
231
+ function I(e, t) {
232
232
  let n = new d("Cannot handle MDX estrees without `createEvaluater`", {
233
233
  ancestors: e.ancestors,
234
234
  place: t,
235
235
  ruleId: "mdx-estree",
236
236
  source: "hast-util-to-jsx-runtime"
237
237
  });
238
- throw n.file = e.filePath || void 0, n.url = v + "#cannot-handle-mdx-estrees-without-createevaluater", n;
238
+ throw n.file = e.filePath || void 0, n.url = "https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-handle-mdx-estrees-without-createevaluater", n;
239
239
  }
240
- function R(e) {
240
+ function L(e) {
241
241
  let t = {}, n;
242
- for (n in e) p.call(e, n) && (t[z(n)] = e[n]);
242
+ for (n in e) p.call(e, n) && (t[R(n)] = e[n]);
243
243
  return t;
244
244
  }
245
- function z(e) {
246
- let t = e.replace(h, B);
245
+ function R(e) {
246
+ let t = e.replace(h, z);
247
247
  return t.slice(0, 3) === "ms-" && (t = "-" + t), t;
248
248
  }
249
- function B(e) {
249
+ function z(e) {
250
250
  return "-" + e.toLowerCase();
251
251
  }
252
252
  //#endregion
253
- export { y as toJsxRuntime };
253
+ export { v as toJsxRuntime };
254
254
 
255
255
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["commas","spaces","name","isIdentifierName"],"sources":["../../../../../../../node_modules/hast-util-to-jsx-runtime/lib/index.js"],"sourcesContent":["/**\n * @import {Identifier, Literal, MemberExpression} from 'estree'\n * @import {Jsx, JsxDev, Options, Props} from 'hast-util-to-jsx-runtime'\n * @import {Element, Nodes, Parents, Root, Text} from 'hast'\n * @import {MdxFlowExpressionHast, MdxTextExpressionHast} from 'mdast-util-mdx-expression'\n * @import {MdxJsxFlowElementHast, MdxJsxTextElementHast} from 'mdast-util-mdx-jsx'\n * @import {MdxjsEsmHast} from 'mdast-util-mdxjs-esm'\n * @import {Position} from 'unist'\n * @import {Child, Create, Field, JsxElement, State, Style} from './types.js'\n */\n\nimport {stringify as commas} from 'comma-separated-tokens'\nimport {ok as assert} from 'devlop'\nimport {name as isIdentifierName} from 'estree-util-is-identifier-name'\nimport {whitespace} from 'hast-util-whitespace'\nimport {find, hastToReact, html, svg} from 'property-information'\nimport {stringify as spaces} from 'space-separated-tokens'\nimport styleToJs from 'style-to-js'\nimport {pointStart} from 'unist-util-position'\nimport {VFileMessage} from 'vfile-message'\n\n// To do: next major: `Object.hasOwn`.\nconst own = {}.hasOwnProperty\n\n/** @type {Map<string, number>} */\nconst emptyMap = new Map()\n\nconst cap = /[A-Z]/g\n\n// `react-dom` triggers a warning for *any* white space in tables.\n// To follow GFM, `mdast-util-to-hast` injects line endings between elements.\n// Other tools might do so too, but they don’t do here, so we remove all of\n// that.\n\n// See: <https://github.com/facebook/react/pull/7081>.\n// See: <https://github.com/facebook/react/pull/7515>.\n// See: <https://github.com/remarkjs/remark-react/issues/64>.\n// See: <https://github.com/rehypejs/rehype-react/pull/29>.\n// See: <https://github.com/rehypejs/rehype-react/pull/32>.\n// See: <https://github.com/rehypejs/rehype-react/pull/45>.\nconst tableElements = new Set(['table', 'tbody', 'thead', 'tfoot', 'tr'])\n\nconst tableCellElement = new Set(['td', 'th'])\n\nconst docs = 'https://github.com/syntax-tree/hast-util-to-jsx-runtime'\n\n/**\n * Transform a hast tree to preact, react, solid, svelte, vue, etc.,\n * with an automatic JSX runtime.\n *\n * @param {Nodes} tree\n * Tree to transform.\n * @param {Options} options\n * Configuration (required).\n * @returns {JsxElement}\n * JSX element.\n */\n\nexport function toJsxRuntime(tree, options) {\n if (!options || options.Fragment === undefined) {\n throw new TypeError('Expected `Fragment` in options')\n }\n\n const filePath = options.filePath || undefined\n /** @type {Create} */\n let create\n\n if (options.development) {\n if (typeof options.jsxDEV !== 'function') {\n throw new TypeError(\n 'Expected `jsxDEV` in options when `development: true`'\n )\n }\n\n create = developmentCreate(filePath, options.jsxDEV)\n } else {\n if (typeof options.jsx !== 'function') {\n throw new TypeError('Expected `jsx` in production options')\n }\n\n if (typeof options.jsxs !== 'function') {\n throw new TypeError('Expected `jsxs` in production options')\n }\n\n create = productionCreate(filePath, options.jsx, options.jsxs)\n }\n\n /** @type {State} */\n const state = {\n Fragment: options.Fragment,\n ancestors: [],\n components: options.components || {},\n create,\n elementAttributeNameCase: options.elementAttributeNameCase || 'react',\n evaluater: options.createEvaluater ? options.createEvaluater() : undefined,\n filePath,\n ignoreInvalidStyle: options.ignoreInvalidStyle || false,\n passKeys: options.passKeys !== false,\n passNode: options.passNode || false,\n schema: options.space === 'svg' ? svg : html,\n stylePropertyNameCase: options.stylePropertyNameCase || 'dom',\n tableCellAlignToStyle: options.tableCellAlignToStyle !== false\n }\n\n const result = one(state, tree, undefined)\n\n // JSX element.\n if (result && typeof result !== 'string') {\n return result\n }\n\n // Text node or something that turned into nothing.\n return state.create(\n tree,\n state.Fragment,\n {children: result || undefined},\n undefined\n )\n}\n\n/**\n * Transform a node.\n *\n * @param {State} state\n * Info passed around.\n * @param {Nodes} node\n * Current node.\n * @param {string | undefined} key\n * Key.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction one(state, node, key) {\n if (node.type === 'element') {\n return element(state, node, key)\n }\n\n if (node.type === 'mdxFlowExpression' || node.type === 'mdxTextExpression') {\n return mdxExpression(state, node)\n }\n\n if (node.type === 'mdxJsxFlowElement' || node.type === 'mdxJsxTextElement') {\n return mdxJsxElement(state, node, key)\n }\n\n if (node.type === 'mdxjsEsm') {\n return mdxEsm(state, node)\n }\n\n if (node.type === 'root') {\n return root(state, node, key)\n }\n\n if (node.type === 'text') {\n return text(state, node)\n }\n}\n\n/**\n * Handle element.\n *\n * @param {State} state\n * Info passed around.\n * @param {Element} node\n * Current node.\n * @param {string | undefined} key\n * Key.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction element(state, node, key) {\n const parentSchema = state.schema\n let schema = parentSchema\n\n if (node.tagName.toLowerCase() === 'svg' && parentSchema.space === 'html') {\n schema = svg\n state.schema = schema\n }\n\n state.ancestors.push(node)\n\n const type = findComponentFromName(state, node.tagName, false)\n const props = createElementProps(state, node)\n let children = createChildren(state, node)\n\n if (tableElements.has(node.tagName)) {\n children = children.filter(function (child) {\n return typeof child === 'string' ? !whitespace(child) : true\n })\n }\n\n addNode(state, props, type, node)\n addChildren(props, children)\n\n // Restore.\n state.ancestors.pop()\n state.schema = parentSchema\n\n return state.create(node, type, props, key)\n}\n\n/**\n * Handle MDX expression.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdxFlowExpressionHast | MdxTextExpressionHast} node\n * Current node.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction mdxExpression(state, node) {\n if (node.data && node.data.estree && state.evaluater) {\n const program = node.data.estree\n const expression = program.body[0]\n assert(expression.type === 'ExpressionStatement')\n\n // Assume result is a child.\n return /** @type {Child | undefined} */ (\n state.evaluater.evaluateExpression(expression.expression)\n )\n }\n\n crashEstree(state, node.position)\n}\n\n/**\n * Handle MDX ESM.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdxjsEsmHast} node\n * Current node.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction mdxEsm(state, node) {\n if (node.data && node.data.estree && state.evaluater) {\n // Assume result is a child.\n return /** @type {Child | undefined} */ (\n state.evaluater.evaluateProgram(node.data.estree)\n )\n }\n\n crashEstree(state, node.position)\n}\n\n/**\n * Handle MDX JSX.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdxJsxFlowElementHast | MdxJsxTextElementHast} node\n * Current node.\n * @param {string | undefined} key\n * Key.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction mdxJsxElement(state, node, key) {\n const parentSchema = state.schema\n let schema = parentSchema\n\n if (node.name === 'svg' && parentSchema.space === 'html') {\n schema = svg\n state.schema = schema\n }\n\n state.ancestors.push(node)\n\n const type =\n node.name === null\n ? state.Fragment\n : findComponentFromName(state, node.name, true)\n const props = createJsxElementProps(state, node)\n const children = createChildren(state, node)\n\n addNode(state, props, type, node)\n addChildren(props, children)\n\n // Restore.\n state.ancestors.pop()\n state.schema = parentSchema\n\n return state.create(node, type, props, key)\n}\n\n/**\n * Handle root.\n *\n * @param {State} state\n * Info passed around.\n * @param {Root} node\n * Current node.\n * @param {string | undefined} key\n * Key.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction root(state, node, key) {\n /** @type {Props} */\n const props = {}\n\n addChildren(props, createChildren(state, node))\n\n return state.create(node, state.Fragment, props, key)\n}\n\n/**\n * Handle text.\n *\n * @param {State} _\n * Info passed around.\n * @param {Text} node\n * Current node.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction text(_, node) {\n return node.value\n}\n\n/**\n * Add `node` to props.\n *\n * @param {State} state\n * Info passed around.\n * @param {Props} props\n * Props.\n * @param {unknown} type\n * Type.\n * @param {Element | MdxJsxFlowElementHast | MdxJsxTextElementHast} node\n * Node.\n * @returns {undefined}\n * Nothing.\n */\nfunction addNode(state, props, type, node) {\n // If this is swapped out for a component:\n if (typeof type !== 'string' && type !== state.Fragment && state.passNode) {\n props.node = node\n }\n}\n\n/**\n * Add children to props.\n *\n * @param {Props} props\n * Props.\n * @param {Array<Child>} children\n * Children.\n * @returns {undefined}\n * Nothing.\n */\nfunction addChildren(props, children) {\n if (children.length > 0) {\n const value = children.length > 1 ? children : children[0]\n\n if (value) {\n props.children = value\n }\n }\n}\n\n/**\n * @param {string | undefined} _\n * Path to file.\n * @param {Jsx} jsx\n * Dynamic.\n * @param {Jsx} jsxs\n * Static.\n * @returns {Create}\n * Create a production element.\n */\nfunction productionCreate(_, jsx, jsxs) {\n return create\n /** @type {Create} */\n function create(_, type, props, key) {\n // Only an array when there are 2 or more children.\n const isStaticChildren = Array.isArray(props.children)\n const fn = isStaticChildren ? jsxs : jsx\n return key ? fn(type, props, key) : fn(type, props)\n }\n}\n\n/**\n * @param {string | undefined} filePath\n * Path to file.\n * @param {JsxDev} jsxDEV\n * Development.\n * @returns {Create}\n * Create a development element.\n */\nfunction developmentCreate(filePath, jsxDEV) {\n return create\n /** @type {Create} */\n function create(node, type, props, key) {\n // Only an array when there are 2 or more children.\n const isStaticChildren = Array.isArray(props.children)\n const point = pointStart(node)\n return jsxDEV(\n type,\n props,\n key,\n isStaticChildren,\n {\n columnNumber: point ? point.column - 1 : undefined,\n fileName: filePath,\n lineNumber: point ? point.line : undefined\n },\n undefined\n )\n }\n}\n\n/**\n * Create props from an element.\n *\n * @param {State} state\n * Info passed around.\n * @param {Element} node\n * Current element.\n * @returns {Props}\n * Props.\n */\nfunction createElementProps(state, node) {\n /** @type {Props} */\n const props = {}\n /** @type {string | undefined} */\n let alignValue\n /** @type {string} */\n let prop\n\n for (prop in node.properties) {\n if (prop !== 'children' && own.call(node.properties, prop)) {\n const result = createProperty(state, prop, node.properties[prop])\n\n if (result) {\n const [key, value] = result\n\n if (\n state.tableCellAlignToStyle &&\n key === 'align' &&\n typeof value === 'string' &&\n tableCellElement.has(node.tagName)\n ) {\n alignValue = value\n } else {\n props[key] = value\n }\n }\n }\n }\n\n if (alignValue) {\n // Assume style is an object.\n const style = /** @type {Style} */ (props.style || (props.style = {}))\n style[state.stylePropertyNameCase === 'css' ? 'text-align' : 'textAlign'] =\n alignValue\n }\n\n return props\n}\n\n/**\n * Create props from a JSX element.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdxJsxFlowElementHast | MdxJsxTextElementHast} node\n * Current JSX element.\n * @returns {Props}\n * Props.\n */\nfunction createJsxElementProps(state, node) {\n /** @type {Props} */\n const props = {}\n\n for (const attribute of node.attributes) {\n if (attribute.type === 'mdxJsxExpressionAttribute') {\n if (attribute.data && attribute.data.estree && state.evaluater) {\n const program = attribute.data.estree\n const expression = program.body[0]\n assert(expression.type === 'ExpressionStatement')\n const objectExpression = expression.expression\n assert(objectExpression.type === 'ObjectExpression')\n const property = objectExpression.properties[0]\n assert(property.type === 'SpreadElement')\n\n Object.assign(\n props,\n state.evaluater.evaluateExpression(property.argument)\n )\n } else {\n crashEstree(state, node.position)\n }\n } else {\n // For JSX, the author is responsible of passing in the correct values.\n const name = attribute.name\n /** @type {unknown} */\n let value\n\n if (attribute.value && typeof attribute.value === 'object') {\n if (\n attribute.value.data &&\n attribute.value.data.estree &&\n state.evaluater\n ) {\n const program = attribute.value.data.estree\n const expression = program.body[0]\n assert(expression.type === 'ExpressionStatement')\n value = state.evaluater.evaluateExpression(expression.expression)\n } else {\n crashEstree(state, node.position)\n }\n } else {\n value = attribute.value === null ? true : attribute.value\n }\n\n // Assume a prop.\n props[name] = /** @type {Props[keyof Props]} */ (value)\n }\n }\n\n return props\n}\n\n/**\n * Create children.\n *\n * @param {State} state\n * Info passed around.\n * @param {Parents} node\n * Current element.\n * @returns {Array<Child>}\n * Children.\n */\nfunction createChildren(state, node) {\n /** @type {Array<Child>} */\n const children = []\n let index = -1\n /** @type {Map<string, number>} */\n // Note: test this when Solid doesn’t want to merge my upcoming PR.\n /* c8 ignore next */\n const countsByName = state.passKeys ? new Map() : emptyMap\n\n while (++index < node.children.length) {\n const child = node.children[index]\n /** @type {string | undefined} */\n let key\n\n if (state.passKeys) {\n const name =\n child.type === 'element'\n ? child.tagName\n : child.type === 'mdxJsxFlowElement' ||\n child.type === 'mdxJsxTextElement'\n ? child.name\n : undefined\n\n if (name) {\n const count = countsByName.get(name) || 0\n key = name + '-' + count\n countsByName.set(name, count + 1)\n }\n }\n\n const result = one(state, child, key)\n if (result !== undefined) children.push(result)\n }\n\n return children\n}\n\n/**\n * Handle a property.\n *\n * @param {State} state\n * Info passed around.\n * @param {string} prop\n * Key.\n * @param {Array<number | string> | boolean | number | string | null | undefined} value\n * hast property value.\n * @returns {Field | undefined}\n * Field for runtime, optional.\n */\nfunction createProperty(state, prop, value) {\n const info = find(state.schema, prop)\n\n // Ignore nullish and `NaN` values.\n if (\n value === null ||\n value === undefined ||\n (typeof value === 'number' && Number.isNaN(value))\n ) {\n return\n }\n\n if (Array.isArray(value)) {\n // Accept `array`.\n // Most props are space-separated.\n value = info.commaSeparated ? commas(value) : spaces(value)\n }\n\n // React only accepts `style` as object.\n if (info.property === 'style') {\n let styleObject =\n typeof value === 'object' ? value : parseStyle(state, String(value))\n\n if (state.stylePropertyNameCase === 'css') {\n styleObject = transformStylesToCssCasing(styleObject)\n }\n\n return ['style', styleObject]\n }\n\n return [\n state.elementAttributeNameCase === 'react' && info.space\n ? hastToReact[info.property] || info.property\n : info.attribute,\n value\n ]\n}\n\n/**\n * Parse a CSS declaration to an object.\n *\n * @param {State} state\n * Info passed around.\n * @param {string} value\n * CSS declarations.\n * @returns {Style}\n * Properties.\n * @throws\n * Throws `VFileMessage` when CSS cannot be parsed.\n */\nfunction parseStyle(state, value) {\n try {\n return styleToJs(value, {reactCompat: true})\n } catch (error) {\n if (state.ignoreInvalidStyle) {\n return {}\n }\n\n const cause = /** @type {Error} */ (error)\n const message = new VFileMessage('Cannot parse `style` attribute', {\n ancestors: state.ancestors,\n cause,\n ruleId: 'style',\n source: 'hast-util-to-jsx-runtime'\n })\n message.file = state.filePath || undefined\n message.url = docs + '#cannot-parse-style-attribute'\n\n throw message\n }\n}\n\n/**\n * Create a JSX name from a string.\n *\n * @param {State} state\n * To do.\n * @param {string} name\n * Name.\n * @param {boolean} allowExpression\n * Allow member expressions and identifiers.\n * @returns {unknown}\n * To do.\n */\nfunction findComponentFromName(state, name, allowExpression) {\n /** @type {Identifier | Literal | MemberExpression} */\n let result\n\n if (!allowExpression) {\n result = {type: 'Literal', value: name}\n } else if (name.includes('.')) {\n const identifiers = name.split('.')\n let index = -1\n /** @type {Identifier | Literal | MemberExpression | undefined} */\n let node\n\n while (++index < identifiers.length) {\n /** @type {Identifier | Literal} */\n const prop = isIdentifierName(identifiers[index])\n ? {type: 'Identifier', name: identifiers[index]}\n : {type: 'Literal', value: identifiers[index]}\n node = node\n ? {\n type: 'MemberExpression',\n object: node,\n property: prop,\n computed: Boolean(index && prop.type === 'Literal'),\n optional: false\n }\n : prop\n }\n\n assert(node, 'always a result')\n result = node\n } else {\n result =\n isIdentifierName(name) && !/^[a-z]/.test(name)\n ? {type: 'Identifier', name}\n : {type: 'Literal', value: name}\n }\n\n // Only literals can be passed in `components` currently.\n // No identifiers / member expressions.\n if (result.type === 'Literal') {\n const name = /** @type {string | number} */ (result.value)\n return own.call(state.components, name) ? state.components[name] : name\n }\n\n // Assume component.\n if (state.evaluater) {\n return state.evaluater.evaluateExpression(result)\n }\n\n crashEstree(state)\n}\n\n/**\n * @param {State} state\n * @param {Position | undefined} [place]\n * @returns {never}\n */\nfunction crashEstree(state, place) {\n const message = new VFileMessage(\n 'Cannot handle MDX estrees without `createEvaluater`',\n {\n ancestors: state.ancestors,\n place,\n ruleId: 'mdx-estree',\n source: 'hast-util-to-jsx-runtime'\n }\n )\n message.file = state.filePath || undefined\n message.url = docs + '#cannot-handle-mdx-estrees-without-createevaluater'\n\n throw message\n}\n\n/**\n * Transform a DOM casing style object to a CSS casing style object.\n *\n * @param {Style} domCasing\n * @returns {Style}\n */\nfunction transformStylesToCssCasing(domCasing) {\n /** @type {Style} */\n const cssCasing = {}\n /** @type {string} */\n let from\n\n for (from in domCasing) {\n if (own.call(domCasing, from)) {\n cssCasing[transformStyleToCssCasing(from)] = domCasing[from]\n }\n }\n\n return cssCasing\n}\n\n/**\n * Transform a DOM casing style field to a CSS casing style field.\n *\n * @param {string} from\n * @returns {string}\n */\nfunction transformStyleToCssCasing(from) {\n let to = from.replace(cap, toDash)\n // Handle `ms-xxx` -> `-ms-xxx`.\n if (to.slice(0, 3) === 'ms-') to = '-' + to\n return to\n}\n\n/**\n * Make `$0` dash cased.\n *\n * @param {string} $0\n * Capitalized ASCII leter.\n * @returns {string}\n * Dash and lower letter.\n */\nfunction toDash($0) {\n return '-' + $0.toLowerCase()\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;mCAsBM,IAAM,CAAC,EAAE,gBAGT,oBAAW,IAAI,IAAI,GAEnB,IAAM,UAaN,IAAgB,IAAI,IAAI;CAAC;CAAS;CAAS;CAAS;CAAS;AAAI,CAAC,GAElE,IAAmB,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,GAEvC,IAAO;AAcb,SAAgB,EAAa,GAAM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K,EAAM,YAAY,CAAI,IAAI,EAAM,WAAW,KAAQ;CACrE;CAGA,IAAI,EAAM,WACR,OAAO,EAAM,UAAU,mBAAmB,CAAM;CAGlD,EAAY,CAAK;AACnB;AAOA,SAAS,EAAY,GAAO,GAAO;CACjC,IAAM,IAAU,IAAI,EAClB,uDACA;EACE,WAAW,EAAM;EACjB;EACA,QAAQ;EACR,QAAQ;CACV,CACF;CAIA,MAHA,EAAQ,OAAO,EAAM,YAAY,KAAA,GACjC,EAAQ,MAAM,IAAO,sDAEf;AACR;AAQA,SAAS,EAA2B,GAAW;CAE7C,IAAM,IAAY,CAAC,GAEf;CAEJ,KAAK,KAAQ,GACX,AAAI,EAAI,KAAK,GAAW,CAAI,MAC1B,EAAU,EAA0B,CAAI,KAAK,EAAU;CAI3D,OAAO;AACT;AAQA,SAAS,EAA0B,GAAM;CACvC,IAAI,IAAK,EAAK,QAAQ,GAAK,CAAM;CAGjC,OADI,EAAG,MAAM,GAAG,CAAC,MAAM,UAAO,IAAK,MAAM,IAClC;AACT;AAUA,SAAS,EAAO,GAAI;CAClB,OAAO,MAAM,EAAG,YAAY;AAC9B"}
1
+ {"version":3,"file":"index.js","names":["commas","spaces","name","isIdentifierName"],"sources":["../../../../../../../node_modules/hast-util-to-jsx-runtime/lib/index.js"],"sourcesContent":["/**\n * @import {Identifier, Literal, MemberExpression} from 'estree'\n * @import {Jsx, JsxDev, Options, Props} from 'hast-util-to-jsx-runtime'\n * @import {Element, Nodes, Parents, Root, Text} from 'hast'\n * @import {MdxFlowExpressionHast, MdxTextExpressionHast} from 'mdast-util-mdx-expression'\n * @import {MdxJsxFlowElementHast, MdxJsxTextElementHast} from 'mdast-util-mdx-jsx'\n * @import {MdxjsEsmHast} from 'mdast-util-mdxjs-esm'\n * @import {Position} from 'unist'\n * @import {Child, Create, Field, JsxElement, State, Style} from './types.js'\n */\n\nimport {stringify as commas} from 'comma-separated-tokens'\nimport {ok as assert} from 'devlop'\nimport {name as isIdentifierName} from 'estree-util-is-identifier-name'\nimport {whitespace} from 'hast-util-whitespace'\nimport {find, hastToReact, html, svg} from 'property-information'\nimport {stringify as spaces} from 'space-separated-tokens'\nimport styleToJs from 'style-to-js'\nimport {pointStart} from 'unist-util-position'\nimport {VFileMessage} from 'vfile-message'\n\n// To do: next major: `Object.hasOwn`.\nconst own = {}.hasOwnProperty\n\n/** @type {Map<string, number>} */\nconst emptyMap = new Map()\n\nconst cap = /[A-Z]/g\n\n// `react-dom` triggers a warning for *any* white space in tables.\n// To follow GFM, `mdast-util-to-hast` injects line endings between elements.\n// Other tools might do so too, but they don’t do here, so we remove all of\n// that.\n\n// See: <https://github.com/facebook/react/pull/7081>.\n// See: <https://github.com/facebook/react/pull/7515>.\n// See: <https://github.com/remarkjs/remark-react/issues/64>.\n// See: <https://github.com/rehypejs/rehype-react/pull/29>.\n// See: <https://github.com/rehypejs/rehype-react/pull/32>.\n// See: <https://github.com/rehypejs/rehype-react/pull/45>.\nconst tableElements = new Set(['table', 'tbody', 'thead', 'tfoot', 'tr'])\n\nconst tableCellElement = new Set(['td', 'th'])\n\nconst docs = 'https://github.com/syntax-tree/hast-util-to-jsx-runtime'\n\n/**\n * Transform a hast tree to preact, react, solid, svelte, vue, etc.,\n * with an automatic JSX runtime.\n *\n * @param {Nodes} tree\n * Tree to transform.\n * @param {Options} options\n * Configuration (required).\n * @returns {JsxElement}\n * JSX element.\n */\n\nexport function toJsxRuntime(tree, options) {\n if (!options || options.Fragment === undefined) {\n throw new TypeError('Expected `Fragment` in options')\n }\n\n const filePath = options.filePath || undefined\n /** @type {Create} */\n let create\n\n if (options.development) {\n if (typeof options.jsxDEV !== 'function') {\n throw new TypeError(\n 'Expected `jsxDEV` in options when `development: true`'\n )\n }\n\n create = developmentCreate(filePath, options.jsxDEV)\n } else {\n if (typeof options.jsx !== 'function') {\n throw new TypeError('Expected `jsx` in production options')\n }\n\n if (typeof options.jsxs !== 'function') {\n throw new TypeError('Expected `jsxs` in production options')\n }\n\n create = productionCreate(filePath, options.jsx, options.jsxs)\n }\n\n /** @type {State} */\n const state = {\n Fragment: options.Fragment,\n ancestors: [],\n components: options.components || {},\n create,\n elementAttributeNameCase: options.elementAttributeNameCase || 'react',\n evaluater: options.createEvaluater ? options.createEvaluater() : undefined,\n filePath,\n ignoreInvalidStyle: options.ignoreInvalidStyle || false,\n passKeys: options.passKeys !== false,\n passNode: options.passNode || false,\n schema: options.space === 'svg' ? svg : html,\n stylePropertyNameCase: options.stylePropertyNameCase || 'dom',\n tableCellAlignToStyle: options.tableCellAlignToStyle !== false\n }\n\n const result = one(state, tree, undefined)\n\n // JSX element.\n if (result && typeof result !== 'string') {\n return result\n }\n\n // Text node or something that turned into nothing.\n return state.create(\n tree,\n state.Fragment,\n {children: result || undefined},\n undefined\n )\n}\n\n/**\n * Transform a node.\n *\n * @param {State} state\n * Info passed around.\n * @param {Nodes} node\n * Current node.\n * @param {string | undefined} key\n * Key.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction one(state, node, key) {\n if (node.type === 'element') {\n return element(state, node, key)\n }\n\n if (node.type === 'mdxFlowExpression' || node.type === 'mdxTextExpression') {\n return mdxExpression(state, node)\n }\n\n if (node.type === 'mdxJsxFlowElement' || node.type === 'mdxJsxTextElement') {\n return mdxJsxElement(state, node, key)\n }\n\n if (node.type === 'mdxjsEsm') {\n return mdxEsm(state, node)\n }\n\n if (node.type === 'root') {\n return root(state, node, key)\n }\n\n if (node.type === 'text') {\n return text(state, node)\n }\n}\n\n/**\n * Handle element.\n *\n * @param {State} state\n * Info passed around.\n * @param {Element} node\n * Current node.\n * @param {string | undefined} key\n * Key.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction element(state, node, key) {\n const parentSchema = state.schema\n let schema = parentSchema\n\n if (node.tagName.toLowerCase() === 'svg' && parentSchema.space === 'html') {\n schema = svg\n state.schema = schema\n }\n\n state.ancestors.push(node)\n\n const type = findComponentFromName(state, node.tagName, false)\n const props = createElementProps(state, node)\n let children = createChildren(state, node)\n\n if (tableElements.has(node.tagName)) {\n children = children.filter(function (child) {\n return typeof child === 'string' ? !whitespace(child) : true\n })\n }\n\n addNode(state, props, type, node)\n addChildren(props, children)\n\n // Restore.\n state.ancestors.pop()\n state.schema = parentSchema\n\n return state.create(node, type, props, key)\n}\n\n/**\n * Handle MDX expression.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdxFlowExpressionHast | MdxTextExpressionHast} node\n * Current node.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction mdxExpression(state, node) {\n if (node.data && node.data.estree && state.evaluater) {\n const program = node.data.estree\n const expression = program.body[0]\n assert(expression.type === 'ExpressionStatement')\n\n // Assume result is a child.\n return /** @type {Child | undefined} */ (\n state.evaluater.evaluateExpression(expression.expression)\n )\n }\n\n crashEstree(state, node.position)\n}\n\n/**\n * Handle MDX ESM.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdxjsEsmHast} node\n * Current node.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction mdxEsm(state, node) {\n if (node.data && node.data.estree && state.evaluater) {\n // Assume result is a child.\n return /** @type {Child | undefined} */ (\n state.evaluater.evaluateProgram(node.data.estree)\n )\n }\n\n crashEstree(state, node.position)\n}\n\n/**\n * Handle MDX JSX.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdxJsxFlowElementHast | MdxJsxTextElementHast} node\n * Current node.\n * @param {string | undefined} key\n * Key.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction mdxJsxElement(state, node, key) {\n const parentSchema = state.schema\n let schema = parentSchema\n\n if (node.name === 'svg' && parentSchema.space === 'html') {\n schema = svg\n state.schema = schema\n }\n\n state.ancestors.push(node)\n\n const type =\n node.name === null\n ? state.Fragment\n : findComponentFromName(state, node.name, true)\n const props = createJsxElementProps(state, node)\n const children = createChildren(state, node)\n\n addNode(state, props, type, node)\n addChildren(props, children)\n\n // Restore.\n state.ancestors.pop()\n state.schema = parentSchema\n\n return state.create(node, type, props, key)\n}\n\n/**\n * Handle root.\n *\n * @param {State} state\n * Info passed around.\n * @param {Root} node\n * Current node.\n * @param {string | undefined} key\n * Key.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction root(state, node, key) {\n /** @type {Props} */\n const props = {}\n\n addChildren(props, createChildren(state, node))\n\n return state.create(node, state.Fragment, props, key)\n}\n\n/**\n * Handle text.\n *\n * @param {State} _\n * Info passed around.\n * @param {Text} node\n * Current node.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction text(_, node) {\n return node.value\n}\n\n/**\n * Add `node` to props.\n *\n * @param {State} state\n * Info passed around.\n * @param {Props} props\n * Props.\n * @param {unknown} type\n * Type.\n * @param {Element | MdxJsxFlowElementHast | MdxJsxTextElementHast} node\n * Node.\n * @returns {undefined}\n * Nothing.\n */\nfunction addNode(state, props, type, node) {\n // If this is swapped out for a component:\n if (typeof type !== 'string' && type !== state.Fragment && state.passNode) {\n props.node = node\n }\n}\n\n/**\n * Add children to props.\n *\n * @param {Props} props\n * Props.\n * @param {Array<Child>} children\n * Children.\n * @returns {undefined}\n * Nothing.\n */\nfunction addChildren(props, children) {\n if (children.length > 0) {\n const value = children.length > 1 ? children : children[0]\n\n if (value) {\n props.children = value\n }\n }\n}\n\n/**\n * @param {string | undefined} _\n * Path to file.\n * @param {Jsx} jsx\n * Dynamic.\n * @param {Jsx} jsxs\n * Static.\n * @returns {Create}\n * Create a production element.\n */\nfunction productionCreate(_, jsx, jsxs) {\n return create\n /** @type {Create} */\n function create(_, type, props, key) {\n // Only an array when there are 2 or more children.\n const isStaticChildren = Array.isArray(props.children)\n const fn = isStaticChildren ? jsxs : jsx\n return key ? fn(type, props, key) : fn(type, props)\n }\n}\n\n/**\n * @param {string | undefined} filePath\n * Path to file.\n * @param {JsxDev} jsxDEV\n * Development.\n * @returns {Create}\n * Create a development element.\n */\nfunction developmentCreate(filePath, jsxDEV) {\n return create\n /** @type {Create} */\n function create(node, type, props, key) {\n // Only an array when there are 2 or more children.\n const isStaticChildren = Array.isArray(props.children)\n const point = pointStart(node)\n return jsxDEV(\n type,\n props,\n key,\n isStaticChildren,\n {\n columnNumber: point ? point.column - 1 : undefined,\n fileName: filePath,\n lineNumber: point ? point.line : undefined\n },\n undefined\n )\n }\n}\n\n/**\n * Create props from an element.\n *\n * @param {State} state\n * Info passed around.\n * @param {Element} node\n * Current element.\n * @returns {Props}\n * Props.\n */\nfunction createElementProps(state, node) {\n /** @type {Props} */\n const props = {}\n /** @type {string | undefined} */\n let alignValue\n /** @type {string} */\n let prop\n\n for (prop in node.properties) {\n if (prop !== 'children' && own.call(node.properties, prop)) {\n const result = createProperty(state, prop, node.properties[prop])\n\n if (result) {\n const [key, value] = result\n\n if (\n state.tableCellAlignToStyle &&\n key === 'align' &&\n typeof value === 'string' &&\n tableCellElement.has(node.tagName)\n ) {\n alignValue = value\n } else {\n props[key] = value\n }\n }\n }\n }\n\n if (alignValue) {\n // Assume style is an object.\n const style = /** @type {Style} */ (props.style || (props.style = {}))\n style[state.stylePropertyNameCase === 'css' ? 'text-align' : 'textAlign'] =\n alignValue\n }\n\n return props\n}\n\n/**\n * Create props from a JSX element.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdxJsxFlowElementHast | MdxJsxTextElementHast} node\n * Current JSX element.\n * @returns {Props}\n * Props.\n */\nfunction createJsxElementProps(state, node) {\n /** @type {Props} */\n const props = {}\n\n for (const attribute of node.attributes) {\n if (attribute.type === 'mdxJsxExpressionAttribute') {\n if (attribute.data && attribute.data.estree && state.evaluater) {\n const program = attribute.data.estree\n const expression = program.body[0]\n assert(expression.type === 'ExpressionStatement')\n const objectExpression = expression.expression\n assert(objectExpression.type === 'ObjectExpression')\n const property = objectExpression.properties[0]\n assert(property.type === 'SpreadElement')\n\n Object.assign(\n props,\n state.evaluater.evaluateExpression(property.argument)\n )\n } else {\n crashEstree(state, node.position)\n }\n } else {\n // For JSX, the author is responsible of passing in the correct values.\n const name = attribute.name\n /** @type {unknown} */\n let value\n\n if (attribute.value && typeof attribute.value === 'object') {\n if (\n attribute.value.data &&\n attribute.value.data.estree &&\n state.evaluater\n ) {\n const program = attribute.value.data.estree\n const expression = program.body[0]\n assert(expression.type === 'ExpressionStatement')\n value = state.evaluater.evaluateExpression(expression.expression)\n } else {\n crashEstree(state, node.position)\n }\n } else {\n value = attribute.value === null ? true : attribute.value\n }\n\n // Assume a prop.\n props[name] = /** @type {Props[keyof Props]} */ (value)\n }\n }\n\n return props\n}\n\n/**\n * Create children.\n *\n * @param {State} state\n * Info passed around.\n * @param {Parents} node\n * Current element.\n * @returns {Array<Child>}\n * Children.\n */\nfunction createChildren(state, node) {\n /** @type {Array<Child>} */\n const children = []\n let index = -1\n /** @type {Map<string, number>} */\n // Note: test this when Solid doesn’t want to merge my upcoming PR.\n /* c8 ignore next */\n const countsByName = state.passKeys ? new Map() : emptyMap\n\n while (++index < node.children.length) {\n const child = node.children[index]\n /** @type {string | undefined} */\n let key\n\n if (state.passKeys) {\n const name =\n child.type === 'element'\n ? child.tagName\n : child.type === 'mdxJsxFlowElement' ||\n child.type === 'mdxJsxTextElement'\n ? child.name\n : undefined\n\n if (name) {\n const count = countsByName.get(name) || 0\n key = name + '-' + count\n countsByName.set(name, count + 1)\n }\n }\n\n const result = one(state, child, key)\n if (result !== undefined) children.push(result)\n }\n\n return children\n}\n\n/**\n * Handle a property.\n *\n * @param {State} state\n * Info passed around.\n * @param {string} prop\n * Key.\n * @param {Array<number | string> | boolean | number | string | null | undefined} value\n * hast property value.\n * @returns {Field | undefined}\n * Field for runtime, optional.\n */\nfunction createProperty(state, prop, value) {\n const info = find(state.schema, prop)\n\n // Ignore nullish and `NaN` values.\n if (\n value === null ||\n value === undefined ||\n (typeof value === 'number' && Number.isNaN(value))\n ) {\n return\n }\n\n if (Array.isArray(value)) {\n // Accept `array`.\n // Most props are space-separated.\n value = info.commaSeparated ? commas(value) : spaces(value)\n }\n\n // React only accepts `style` as object.\n if (info.property === 'style') {\n let styleObject =\n typeof value === 'object' ? value : parseStyle(state, String(value))\n\n if (state.stylePropertyNameCase === 'css') {\n styleObject = transformStylesToCssCasing(styleObject)\n }\n\n return ['style', styleObject]\n }\n\n return [\n state.elementAttributeNameCase === 'react' && info.space\n ? hastToReact[info.property] || info.property\n : info.attribute,\n value\n ]\n}\n\n/**\n * Parse a CSS declaration to an object.\n *\n * @param {State} state\n * Info passed around.\n * @param {string} value\n * CSS declarations.\n * @returns {Style}\n * Properties.\n * @throws\n * Throws `VFileMessage` when CSS cannot be parsed.\n */\nfunction parseStyle(state, value) {\n try {\n return styleToJs(value, {reactCompat: true})\n } catch (error) {\n if (state.ignoreInvalidStyle) {\n return {}\n }\n\n const cause = /** @type {Error} */ (error)\n const message = new VFileMessage('Cannot parse `style` attribute', {\n ancestors: state.ancestors,\n cause,\n ruleId: 'style',\n source: 'hast-util-to-jsx-runtime'\n })\n message.file = state.filePath || undefined\n message.url = docs + '#cannot-parse-style-attribute'\n\n throw message\n }\n}\n\n/**\n * Create a JSX name from a string.\n *\n * @param {State} state\n * To do.\n * @param {string} name\n * Name.\n * @param {boolean} allowExpression\n * Allow member expressions and identifiers.\n * @returns {unknown}\n * To do.\n */\nfunction findComponentFromName(state, name, allowExpression) {\n /** @type {Identifier | Literal | MemberExpression} */\n let result\n\n if (!allowExpression) {\n result = {type: 'Literal', value: name}\n } else if (name.includes('.')) {\n const identifiers = name.split('.')\n let index = -1\n /** @type {Identifier | Literal | MemberExpression | undefined} */\n let node\n\n while (++index < identifiers.length) {\n /** @type {Identifier | Literal} */\n const prop = isIdentifierName(identifiers[index])\n ? {type: 'Identifier', name: identifiers[index]}\n : {type: 'Literal', value: identifiers[index]}\n node = node\n ? {\n type: 'MemberExpression',\n object: node,\n property: prop,\n computed: Boolean(index && prop.type === 'Literal'),\n optional: false\n }\n : prop\n }\n\n assert(node, 'always a result')\n result = node\n } else {\n result =\n isIdentifierName(name) && !/^[a-z]/.test(name)\n ? {type: 'Identifier', name}\n : {type: 'Literal', value: name}\n }\n\n // Only literals can be passed in `components` currently.\n // No identifiers / member expressions.\n if (result.type === 'Literal') {\n const name = /** @type {string | number} */ (result.value)\n return own.call(state.components, name) ? state.components[name] : name\n }\n\n // Assume component.\n if (state.evaluater) {\n return state.evaluater.evaluateExpression(result)\n }\n\n crashEstree(state)\n}\n\n/**\n * @param {State} state\n * @param {Position | undefined} [place]\n * @returns {never}\n */\nfunction crashEstree(state, place) {\n const message = new VFileMessage(\n 'Cannot handle MDX estrees without `createEvaluater`',\n {\n ancestors: state.ancestors,\n place,\n ruleId: 'mdx-estree',\n source: 'hast-util-to-jsx-runtime'\n }\n )\n message.file = state.filePath || undefined\n message.url = docs + '#cannot-handle-mdx-estrees-without-createevaluater'\n\n throw message\n}\n\n/**\n * Transform a DOM casing style object to a CSS casing style object.\n *\n * @param {Style} domCasing\n * @returns {Style}\n */\nfunction transformStylesToCssCasing(domCasing) {\n /** @type {Style} */\n const cssCasing = {}\n /** @type {string} */\n let from\n\n for (from in domCasing) {\n if (own.call(domCasing, from)) {\n cssCasing[transformStyleToCssCasing(from)] = domCasing[from]\n }\n }\n\n return cssCasing\n}\n\n/**\n * Transform a DOM casing style field to a CSS casing style field.\n *\n * @param {string} from\n * @returns {string}\n */\nfunction transformStyleToCssCasing(from) {\n let to = from.replace(cap, toDash)\n // Handle `ms-xxx` -> `-ms-xxx`.\n if (to.slice(0, 3) === 'ms-') to = '-' + to\n return to\n}\n\n/**\n * Make `$0` dash cased.\n *\n * @param {string} $0\n * Capitalized ASCII leter.\n * @returns {string}\n * Dash and lower letter.\n */\nfunction toDash($0) {\n return '-' + $0.toLowerCase()\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;mCAsBM,IAAM,CAAC,EAAE,gBAGT,oBAAW,IAAI,IAAI,GAEnB,IAAM,UAaN,IAAgB,IAAI,IAAI;CAAC;CAAS;CAAS;CAAS;CAAS;AAAI,CAAC,GAElE,IAAmB,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC;AAgB7C,SAAgB,EAAa,GAAM,GAAS;CAC1C,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AAI,EAAM,WAAW,KAAQ;CACrE;CAGA,IAAI,EAAM,WACR,OAAO,EAAM,UAAU,mBAAmB,CAAM;CAGlD,EAAY,CAAK;AACnB;AAOA,SAAS,EAAY,GAAO,GAAO;CACjC,IAAM,IAAU,IAAI,EAClB,uDACA;EACE,WAAW,EAAM;EACjB;EACA,QAAQ;EACR,QAAQ;CACV,CACF;CAIA,MAHA,EAAQ,OAAO,EAAM,YAAY,KAAA,GACjC,EAAQ,MAAM,6GAER;AACR;AAQA,SAAS,EAA2B,GAAW;CAE7C,IAAM,IAAY,CAAC,GAEf;CAEJ,KAAK,KAAQ,GACX,AAAI,EAAI,KAAK,GAAW,CAAI,MAC1B,EAAU,EAA0B,CAAI,KAAK,EAAU;CAI3D,OAAO;AACT;AAQA,SAAS,EAA0B,GAAM;CACvC,IAAI,IAAK,EAAK,QAAQ,GAAK,CAAM;CAGjC,OADI,EAAG,MAAM,GAAG,CAAC,MAAM,UAAO,IAAK,MAAM,IAClC;AACT;AAUA,SAAS,EAAO,GAAI;CAClB,OAAO,MAAM,EAAG,YAAY;AAC9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"pieDiagram-4H26LBE5.js","names":["d3pie","getConfig","arc","scaleOrdinal"],"sources":["../../../../../../../../../node_modules/mermaid/dist/chunks/mermaid.core/pieDiagram-4H26LBE5.mjs"],"sourcesContent":["import {\n selectSvgElement\n} from \"./chunk-WU5MYG2G.mjs\";\nimport {\n populateCommonDb\n} from \"./chunk-4BX2VUAB.mjs\";\nimport {\n cleanAndMerge,\n parseFontSize\n} from \"./chunk-5ZQYHXKU.mjs\";\nimport {\n clear,\n configureSvgSize,\n defaultConfig_default,\n getAccDescription,\n getAccTitle,\n getConfig2 as getConfig,\n getDiagramTitle,\n setAccDescription,\n setAccTitle,\n setDiagramTitle\n} from \"./chunk-CSCIHK7Q.mjs\";\nimport {\n __name,\n log\n} from \"./chunk-AGHRB4JF.mjs\";\n\n// src/diagrams/pie/pieParser.ts\nimport { parse } from \"@mermaid-js/parser\";\n\n// src/diagrams/pie/pieDb.ts\nvar DEFAULT_PIE_CONFIG = defaultConfig_default.pie;\nvar DEFAULT_PIE_DB = {\n sections: /* @__PURE__ */ new Map(),\n showData: false,\n config: DEFAULT_PIE_CONFIG\n};\nvar sections = DEFAULT_PIE_DB.sections;\nvar showData = DEFAULT_PIE_DB.showData;\nvar config = structuredClone(DEFAULT_PIE_CONFIG);\nvar getConfig2 = /* @__PURE__ */ __name(() => structuredClone(config), \"getConfig\");\nvar clear2 = /* @__PURE__ */ __name(() => {\n sections = /* @__PURE__ */ new Map();\n showData = DEFAULT_PIE_DB.showData;\n clear();\n}, \"clear\");\nvar addSection = /* @__PURE__ */ __name(({ label, value }) => {\n if (value < 0) {\n throw new Error(\n `\"${label}\" has invalid value: ${value}. Negative values are not allowed in pie charts. All slice values must be >= 0.`\n );\n }\n if (!sections.has(label)) {\n sections.set(label, value);\n log.debug(`added new section: ${label}, with value: ${value}`);\n }\n}, \"addSection\");\nvar getSections = /* @__PURE__ */ __name(() => sections, \"getSections\");\nvar setShowData = /* @__PURE__ */ __name((toggle) => {\n showData = toggle;\n}, \"setShowData\");\nvar getShowData = /* @__PURE__ */ __name(() => showData, \"getShowData\");\nvar db = {\n getConfig: getConfig2,\n clear: clear2,\n setDiagramTitle,\n getDiagramTitle,\n setAccTitle,\n getAccTitle,\n setAccDescription,\n getAccDescription,\n addSection,\n getSections,\n setShowData,\n getShowData\n};\n\n// src/diagrams/pie/pieParser.ts\nvar populateDb = /* @__PURE__ */ __name((ast, db2) => {\n populateCommonDb(ast, db2);\n db2.setShowData(ast.showData);\n ast.sections.map(db2.addSection);\n}, \"populateDb\");\nvar parser = {\n parse: /* @__PURE__ */ __name(async (input) => {\n const ast = await parse(\"pie\", input);\n log.debug(ast);\n populateDb(ast, db);\n }, \"parse\")\n};\n\n// src/diagrams/pie/pieStyles.ts\nvar getStyles = /* @__PURE__ */ __name((options) => `\n .pieCircle{\n stroke: ${options.pieStrokeColor};\n stroke-width : ${options.pieStrokeWidth};\n opacity : ${options.pieOpacity};\n }\n .pieOuterCircle{\n stroke: ${options.pieOuterStrokeColor};\n stroke-width: ${options.pieOuterStrokeWidth};\n fill: none;\n }\n .pieTitleText {\n text-anchor: middle;\n font-size: ${options.pieTitleTextSize};\n fill: ${options.pieTitleTextColor};\n font-family: ${options.fontFamily};\n }\n .slice {\n font-family: ${options.fontFamily};\n fill: ${options.pieSectionTextColor};\n font-size:${options.pieSectionTextSize};\n // fill: white;\n }\n .legend text {\n fill: ${options.pieLegendTextColor};\n font-family: ${options.fontFamily};\n font-size: ${options.pieLegendTextSize};\n }\n`, \"getStyles\");\nvar pieStyles_default = getStyles;\n\n// src/diagrams/pie/pieRenderer.ts\nimport { arc, pie as d3pie, scaleOrdinal } from \"d3\";\nvar createPieArcs = /* @__PURE__ */ __name((sections2) => {\n const sum = [...sections2.values()].reduce((acc, val) => acc + val, 0);\n const pieData = [...sections2.entries()].map(([label, value]) => ({ label, value })).filter((d) => d.value / sum * 100 >= 1);\n const pie = d3pie().value((d) => d.value).sort(null);\n return pie(pieData);\n}, \"createPieArcs\");\nvar draw = /* @__PURE__ */ __name((text, id, _version, diagObj) => {\n log.debug(\"rendering pie chart\\n\" + text);\n const db2 = diagObj.db;\n const globalConfig = getConfig();\n const pieConfig = cleanAndMerge(db2.getConfig(), globalConfig.pie);\n const MARGIN = 40;\n const LEGEND_RECT_SIZE = 18;\n const LEGEND_SPACING = 4;\n const height = 450;\n const pieWidth = height;\n const svg = selectSvgElement(id);\n const group = svg.append(\"g\");\n group.attr(\"transform\", \"translate(\" + pieWidth / 2 + \",\" + height / 2 + \")\");\n const { themeVariables } = globalConfig;\n let [outerStrokeWidth] = parseFontSize(themeVariables.pieOuterStrokeWidth);\n outerStrokeWidth ??= 2;\n const textPosition = pieConfig.textPosition;\n const radius = Math.min(pieWidth, height) / 2 - MARGIN;\n const arcGenerator = arc().innerRadius(0).outerRadius(radius);\n const labelArcGenerator = arc().innerRadius(radius * textPosition).outerRadius(radius * textPosition);\n group.append(\"circle\").attr(\"cx\", 0).attr(\"cy\", 0).attr(\"r\", radius + outerStrokeWidth / 2).attr(\"class\", \"pieOuterCircle\");\n const sections2 = db2.getSections();\n const arcs = createPieArcs(sections2);\n const myGeneratedColors = [\n themeVariables.pie1,\n themeVariables.pie2,\n themeVariables.pie3,\n themeVariables.pie4,\n themeVariables.pie5,\n themeVariables.pie6,\n themeVariables.pie7,\n themeVariables.pie8,\n themeVariables.pie9,\n themeVariables.pie10,\n themeVariables.pie11,\n themeVariables.pie12\n ];\n let sum = 0;\n sections2.forEach((section) => {\n sum += section;\n });\n const filteredArcs = arcs.filter((datum) => (datum.data.value / sum * 100).toFixed(0) !== \"0\");\n const color = scaleOrdinal(myGeneratedColors).domain([\n ...sections2.keys()\n ]);\n group.selectAll(\"mySlices\").data(filteredArcs).enter().append(\"path\").attr(\"d\", arcGenerator).attr(\"fill\", (datum) => {\n return color(datum.data.label);\n }).attr(\"class\", \"pieCircle\");\n group.selectAll(\"mySlices\").data(filteredArcs).enter().append(\"text\").text((datum) => {\n return (datum.data.value / sum * 100).toFixed(0) + \"%\";\n }).attr(\"transform\", (datum) => {\n return \"translate(\" + labelArcGenerator.centroid(datum) + \")\";\n }).style(\"text-anchor\", \"middle\").attr(\"class\", \"slice\");\n const titleText = group.append(\"text\").text(db2.getDiagramTitle()).attr(\"x\", 0).attr(\"y\", -(height - 50) / 2).attr(\"class\", \"pieTitleText\");\n const allSectionData = [...sections2.entries()].map(([label, value]) => ({\n label,\n value\n }));\n const legend = group.selectAll(\".legend\").data(allSectionData).enter().append(\"g\").attr(\"class\", \"legend\").attr(\"transform\", (_datum, index) => {\n const height2 = LEGEND_RECT_SIZE + LEGEND_SPACING;\n const offset = height2 * allSectionData.length / 2;\n const horizontal = 12 * LEGEND_RECT_SIZE;\n const vertical = index * height2 - offset;\n return \"translate(\" + horizontal + \",\" + vertical + \")\";\n });\n legend.append(\"rect\").attr(\"width\", LEGEND_RECT_SIZE).attr(\"height\", LEGEND_RECT_SIZE).style(\"fill\", (d) => color(d.label)).style(\"stroke\", (d) => color(d.label));\n legend.append(\"text\").attr(\"x\", LEGEND_RECT_SIZE + LEGEND_SPACING).attr(\"y\", LEGEND_RECT_SIZE - LEGEND_SPACING).text((d) => {\n if (db2.getShowData()) {\n return `${d.label} [${d.value}]`;\n }\n return d.label;\n });\n const longestTextWidth = Math.max(\n ...legend.selectAll(\"text\").nodes().map((node) => node?.getBoundingClientRect().width ?? 0)\n );\n const chartAndLegendWidth = pieWidth + MARGIN + LEGEND_RECT_SIZE + LEGEND_SPACING + longestTextWidth;\n const titleWidth = titleText.node()?.getBoundingClientRect().width ?? 0;\n const titleLeft = pieWidth / 2 - titleWidth / 2;\n const titleRight = pieWidth / 2 + titleWidth / 2;\n const viewBoxX = Math.min(0, titleLeft);\n const viewBoxRight = Math.max(chartAndLegendWidth, titleRight);\n const totalWidth = viewBoxRight - viewBoxX;\n svg.attr(\"viewBox\", `${viewBoxX} 0 ${totalWidth} ${height}`);\n configureSvgSize(svg, height, totalWidth, pieConfig.useMaxWidth);\n}, \"draw\");\nvar renderer = { draw };\n\n// src/diagrams/pie/pieDiagram.ts\nvar diagram = {\n parser,\n db,\n renderer,\n styles: pieStyles_default\n};\nexport {\n diagram\n};\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;AA+BA,IAAI,IAAqB,EAAsB,KAC3C,IAAiB;CACnB,0BAA0B,IAAI,IAAI;CAClC,UAAU;CACV,QAAQ;AACV,GACI,IAAW,EAAe,UAC1B,IAAW,EAAe,UAC1B,IAAS,gBAAgB,CAAkB,GAuB3C,IAAK;CACP,WAvB+B,wBAAa,gBAAgB,CAAM,GAAG,WAuBjD;CACpB,OAvB2B,wBAAa;EAGxC,AAFA,oBAA2B,IAAI,IAAI,GACnC,IAAW,EAAe,UAC1B,EAAM;CACR,GAAG,OAmBW;CACZ;CACA;CACA;CACA;CACA;CACA;CACA,YAzB+B,mBAAQ,EAAE,UAAO,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AM,KAEzB,EAAE,KACV;EAID,IAAM,IAAsB,MAHH,KAAK,IAC5B,GAAG,EAAO,UAAU,MAAM,EAAE,MAAM,EAAE,KAAK,MAAS,GAAM,sBAAsB,EAAE,SAAS,CAAC,CAER,GAC9E,IAAa,EAAU,KAAK,GAAG,sBAAsB,EAAE,SAAS,GAChE,IAAY,MAAW,IAAI,IAAa,GACxC,IAAa,MAAW,IAAI,IAAa,GACzC,IAAW,KAAK,IAAI,GAAG,CAAS,GAEhC,IADe,KAAK,IAAI,GAAqB,CACrB,IAAI;EAElC,AADA,EAAI,KAAK,WAAW,GAAG,EAAS,KAAK,EAAW,KAAW,GAC3D,EAAiB,GAAK,KAAQ,GAAY,EAAU,WAAW;CACjE,GAAG,MACiB,EAMX;CACP,QAAQ;AACV"}
1
+ {"version":3,"file":"pieDiagram-4H26LBE5.js","names":["d3pie","getConfig","arc","scaleOrdinal"],"sources":["../../../../../../../../../node_modules/mermaid/dist/chunks/mermaid.core/pieDiagram-4H26LBE5.mjs"],"sourcesContent":["import {\n selectSvgElement\n} from \"./chunk-WU5MYG2G.mjs\";\nimport {\n populateCommonDb\n} from \"./chunk-4BX2VUAB.mjs\";\nimport {\n cleanAndMerge,\n parseFontSize\n} from \"./chunk-5ZQYHXKU.mjs\";\nimport {\n clear,\n configureSvgSize,\n defaultConfig_default,\n getAccDescription,\n getAccTitle,\n getConfig2 as getConfig,\n getDiagramTitle,\n setAccDescription,\n setAccTitle,\n setDiagramTitle\n} from \"./chunk-CSCIHK7Q.mjs\";\nimport {\n __name,\n log\n} from \"./chunk-AGHRB4JF.mjs\";\n\n// src/diagrams/pie/pieParser.ts\nimport { parse } from \"@mermaid-js/parser\";\n\n// src/diagrams/pie/pieDb.ts\nvar DEFAULT_PIE_CONFIG = defaultConfig_default.pie;\nvar DEFAULT_PIE_DB = {\n sections: /* @__PURE__ */ new Map(),\n showData: false,\n config: DEFAULT_PIE_CONFIG\n};\nvar sections = DEFAULT_PIE_DB.sections;\nvar showData = DEFAULT_PIE_DB.showData;\nvar config = structuredClone(DEFAULT_PIE_CONFIG);\nvar getConfig2 = /* @__PURE__ */ __name(() => structuredClone(config), \"getConfig\");\nvar clear2 = /* @__PURE__ */ __name(() => {\n sections = /* @__PURE__ */ new Map();\n showData = DEFAULT_PIE_DB.showData;\n clear();\n}, \"clear\");\nvar addSection = /* @__PURE__ */ __name(({ label, value }) => {\n if (value < 0) {\n throw new Error(\n `\"${label}\" has invalid value: ${value}. Negative values are not allowed in pie charts. All slice values must be >= 0.`\n );\n }\n if (!sections.has(label)) {\n sections.set(label, value);\n log.debug(`added new section: ${label}, with value: ${value}`);\n }\n}, \"addSection\");\nvar getSections = /* @__PURE__ */ __name(() => sections, \"getSections\");\nvar setShowData = /* @__PURE__ */ __name((toggle) => {\n showData = toggle;\n}, \"setShowData\");\nvar getShowData = /* @__PURE__ */ __name(() => showData, \"getShowData\");\nvar db = {\n getConfig: getConfig2,\n clear: clear2,\n setDiagramTitle,\n getDiagramTitle,\n setAccTitle,\n getAccTitle,\n setAccDescription,\n getAccDescription,\n addSection,\n getSections,\n setShowData,\n getShowData\n};\n\n// src/diagrams/pie/pieParser.ts\nvar populateDb = /* @__PURE__ */ __name((ast, db2) => {\n populateCommonDb(ast, db2);\n db2.setShowData(ast.showData);\n ast.sections.map(db2.addSection);\n}, \"populateDb\");\nvar parser = {\n parse: /* @__PURE__ */ __name(async (input) => {\n const ast = await parse(\"pie\", input);\n log.debug(ast);\n populateDb(ast, db);\n }, \"parse\")\n};\n\n// src/diagrams/pie/pieStyles.ts\nvar getStyles = /* @__PURE__ */ __name((options) => `\n .pieCircle{\n stroke: ${options.pieStrokeColor};\n stroke-width : ${options.pieStrokeWidth};\n opacity : ${options.pieOpacity};\n }\n .pieOuterCircle{\n stroke: ${options.pieOuterStrokeColor};\n stroke-width: ${options.pieOuterStrokeWidth};\n fill: none;\n }\n .pieTitleText {\n text-anchor: middle;\n font-size: ${options.pieTitleTextSize};\n fill: ${options.pieTitleTextColor};\n font-family: ${options.fontFamily};\n }\n .slice {\n font-family: ${options.fontFamily};\n fill: ${options.pieSectionTextColor};\n font-size:${options.pieSectionTextSize};\n // fill: white;\n }\n .legend text {\n fill: ${options.pieLegendTextColor};\n font-family: ${options.fontFamily};\n font-size: ${options.pieLegendTextSize};\n }\n`, \"getStyles\");\nvar pieStyles_default = getStyles;\n\n// src/diagrams/pie/pieRenderer.ts\nimport { arc, pie as d3pie, scaleOrdinal } from \"d3\";\nvar createPieArcs = /* @__PURE__ */ __name((sections2) => {\n const sum = [...sections2.values()].reduce((acc, val) => acc + val, 0);\n const pieData = [...sections2.entries()].map(([label, value]) => ({ label, value })).filter((d) => d.value / sum * 100 >= 1);\n const pie = d3pie().value((d) => d.value).sort(null);\n return pie(pieData);\n}, \"createPieArcs\");\nvar draw = /* @__PURE__ */ __name((text, id, _version, diagObj) => {\n log.debug(\"rendering pie chart\\n\" + text);\n const db2 = diagObj.db;\n const globalConfig = getConfig();\n const pieConfig = cleanAndMerge(db2.getConfig(), globalConfig.pie);\n const MARGIN = 40;\n const LEGEND_RECT_SIZE = 18;\n const LEGEND_SPACING = 4;\n const height = 450;\n const pieWidth = height;\n const svg = selectSvgElement(id);\n const group = svg.append(\"g\");\n group.attr(\"transform\", \"translate(\" + pieWidth / 2 + \",\" + height / 2 + \")\");\n const { themeVariables } = globalConfig;\n let [outerStrokeWidth] = parseFontSize(themeVariables.pieOuterStrokeWidth);\n outerStrokeWidth ??= 2;\n const textPosition = pieConfig.textPosition;\n const radius = Math.min(pieWidth, height) / 2 - MARGIN;\n const arcGenerator = arc().innerRadius(0).outerRadius(radius);\n const labelArcGenerator = arc().innerRadius(radius * textPosition).outerRadius(radius * textPosition);\n group.append(\"circle\").attr(\"cx\", 0).attr(\"cy\", 0).attr(\"r\", radius + outerStrokeWidth / 2).attr(\"class\", \"pieOuterCircle\");\n const sections2 = db2.getSections();\n const arcs = createPieArcs(sections2);\n const myGeneratedColors = [\n themeVariables.pie1,\n themeVariables.pie2,\n themeVariables.pie3,\n themeVariables.pie4,\n themeVariables.pie5,\n themeVariables.pie6,\n themeVariables.pie7,\n themeVariables.pie8,\n themeVariables.pie9,\n themeVariables.pie10,\n themeVariables.pie11,\n themeVariables.pie12\n ];\n let sum = 0;\n sections2.forEach((section) => {\n sum += section;\n });\n const filteredArcs = arcs.filter((datum) => (datum.data.value / sum * 100).toFixed(0) !== \"0\");\n const color = scaleOrdinal(myGeneratedColors).domain([\n ...sections2.keys()\n ]);\n group.selectAll(\"mySlices\").data(filteredArcs).enter().append(\"path\").attr(\"d\", arcGenerator).attr(\"fill\", (datum) => {\n return color(datum.data.label);\n }).attr(\"class\", \"pieCircle\");\n group.selectAll(\"mySlices\").data(filteredArcs).enter().append(\"text\").text((datum) => {\n return (datum.data.value / sum * 100).toFixed(0) + \"%\";\n }).attr(\"transform\", (datum) => {\n return \"translate(\" + labelArcGenerator.centroid(datum) + \")\";\n }).style(\"text-anchor\", \"middle\").attr(\"class\", \"slice\");\n const titleText = group.append(\"text\").text(db2.getDiagramTitle()).attr(\"x\", 0).attr(\"y\", -(height - 50) / 2).attr(\"class\", \"pieTitleText\");\n const allSectionData = [...sections2.entries()].map(([label, value]) => ({\n label,\n value\n }));\n const legend = group.selectAll(\".legend\").data(allSectionData).enter().append(\"g\").attr(\"class\", \"legend\").attr(\"transform\", (_datum, index) => {\n const height2 = LEGEND_RECT_SIZE + LEGEND_SPACING;\n const offset = height2 * allSectionData.length / 2;\n const horizontal = 12 * LEGEND_RECT_SIZE;\n const vertical = index * height2 - offset;\n return \"translate(\" + horizontal + \",\" + vertical + \")\";\n });\n legend.append(\"rect\").attr(\"width\", LEGEND_RECT_SIZE).attr(\"height\", LEGEND_RECT_SIZE).style(\"fill\", (d) => color(d.label)).style(\"stroke\", (d) => color(d.label));\n legend.append(\"text\").attr(\"x\", LEGEND_RECT_SIZE + LEGEND_SPACING).attr(\"y\", LEGEND_RECT_SIZE - LEGEND_SPACING).text((d) => {\n if (db2.getShowData()) {\n return `${d.label} [${d.value}]`;\n }\n return d.label;\n });\n const longestTextWidth = Math.max(\n ...legend.selectAll(\"text\").nodes().map((node) => node?.getBoundingClientRect().width ?? 0)\n );\n const chartAndLegendWidth = pieWidth + MARGIN + LEGEND_RECT_SIZE + LEGEND_SPACING + longestTextWidth;\n const titleWidth = titleText.node()?.getBoundingClientRect().width ?? 0;\n const titleLeft = pieWidth / 2 - titleWidth / 2;\n const titleRight = pieWidth / 2 + titleWidth / 2;\n const viewBoxX = Math.min(0, titleLeft);\n const viewBoxRight = Math.max(chartAndLegendWidth, titleRight);\n const totalWidth = viewBoxRight - viewBoxX;\n svg.attr(\"viewBox\", `${viewBoxX} 0 ${totalWidth} ${height}`);\n configureSvgSize(svg, height, totalWidth, pieConfig.useMaxWidth);\n}, \"draw\");\nvar renderer = { draw };\n\n// src/diagrams/pie/pieDiagram.ts\nvar diagram = {\n parser,\n db,\n renderer,\n styles: pieStyles_default\n};\nexport {\n diagram\n};\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;AA+BA,IAAI,IAAqB,EAAsB,KAC3C,IAAiB;CACnB,0BAA0B,IAAI,IAAI;CAClC,UAAU;CACV,QAAQ;AACV,GACI,IAAW,EAAe,UAC1B,IAAW,EAAe,UAC1B,IAAS,gBAAgB,CAAkB,GAuB3C,IAAK;CACP,WAvB+B,wBAAa,gBAAgB,CAAM,GAAG,WAuBjD;CACpB,OAvB2B,wBAAa;EAGxC,AAFA,oBAA2B,IAAI,IAAI,GACnC,IAAW,EAAe,UAC1B,EAAM;CACR,GAAG,OAmBW;CACZ;CACA;CACA;CACA;CACA;CACA;CACA,YAzB+B,mBAAQ,EAAE,UAAO,eAAY;EAC5D,IAAI,IAAQ,GACV,MAAU,MACR,IAAI,EAAM,uBAAuB,EAAM,gFACzC;EAEF,AAAK,EAAS,IAAI,CAAK,MACrB,EAAS,IAAI,GAAO,CAAK,GACzB,EAAI,MAAM,sBAAsB,EAAM,gBAAgB,GAAO;CAEjE,GAAG,YAeQ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,GAChE,IAAY,MAAW,IAAI,IAAa,GACxC,IAAa,MAAW,IAAI,IAAa,GACzC,IAAW,KAAK,IAAI,GAAG,CAAS,GAEhC,IADe,KAAK,IAAI,GAAqB,CACrB,IAAI;EAElC,AADA,EAAI,KAAK,WAAW,GAAG,EAAS,KAAK,EAAW,KAAW,GAC3D,EAAiB,GAAK,KAAQ,GAAY,EAAU,WAAW;CACjE,GAAG,MACiB,EAMX;CACP,QAAQ;AACV"}
@@ -3595,32 +3595,32 @@ var F = P, I = {
3595
3595
  let s = p(o.text) ? await oe(i, o) : G(i, o), c = Math.round(s.map((e) => (e._groups || e)[0][0].getBBox().height).reduce((e, t) => e + t));
3596
3596
  a.attr("height", c + 2 * Z.noteMargin), t.height += c + 2 * Z.noteMargin, Q.bumpVerticalPos(c + 2 * Z.noteMargin), t.stopy = t.starty + c + 2 * Z.noteMargin, t.stopx = t.startx + r.width, Q.insert(t.startx, t.starty, t.stopx, t.stopy), Q.models.addNote(t);
3597
3597
  }, "drawNote"), Ne = /* @__PURE__ */ e(function(t, n, r, i, a, o, s) {
3598
- let c = i.db.getActors(), l = c.get(n.from), u = c.get(n.to), d = r.sequenceVisible, f = l.x + l.width / 2, p = u.x + u.width / 2, m = f <= p, h = tt(n, i), g = t.append("g"), _ = 16.5, v = /* @__PURE__ */ e((e, t) => {
3599
- let n = e ? _ : -_;
3598
+ let c = i.db.getActors(), l = c.get(n.from), u = c.get(n.to), d = r.sequenceVisible, f = l.x + l.width / 2, p = u.x + u.width / 2, m = f <= p, h = tt(n, i), g = t.append("g"), _ = /* @__PURE__ */ e((e, t) => {
3599
+ let n = e ? 16.5 : -16.5;
3600
3600
  return t ? -n : n;
3601
- }, "getCircleOffset"), y = /* @__PURE__ */ e((e) => {
3601
+ }, "getCircleOffset"), v = /* @__PURE__ */ e((e) => {
3602
3602
  g.append("circle").attr("cx", e).attr("cy", s).attr("r", 5).attr("width", 10).attr("height", 10);
3603
- }, "drawCircle"), { CENTRAL_CONNECTION: b, CENTRAL_CONNECTION_REVERSE: x, CENTRAL_CONNECTION_DUAL: S } = i.db.LINETYPE;
3603
+ }, "drawCircle"), { CENTRAL_CONNECTION: y, CENTRAL_CONNECTION_REVERSE: b, CENTRAL_CONNECTION_DUAL: x } = i.db.LINETYPE;
3604
3604
  if (d) switch (n.centralConnection) {
3605
+ case y:
3606
+ h && (p += _(m, !0));
3607
+ break;
3605
3608
  case b:
3606
- h && (p += v(m, !0));
3609
+ h || (f += _(m, !1));
3607
3610
  break;
3608
3611
  case x:
3609
- h || (f += v(m, !1));
3610
- break;
3611
- case S:
3612
- h ? p += v(m, !0) : f += v(m, !1);
3612
+ h ? p += _(m, !0) : f += _(m, !1);
3613
3613
  break;
3614
3614
  }
3615
3615
  switch (n.centralConnection) {
3616
+ case y:
3617
+ v(p);
3618
+ break;
3616
3619
  case b:
3617
- y(p);
3620
+ v(f);
3618
3621
  break;
3619
3622
  case x:
3620
- y(f);
3621
- break;
3622
- case S:
3623
- y(f), y(p);
3623
+ v(f), v(p);
3624
3624
  break;
3625
3625
  }
3626
3626
  }, "drawCentralConnection"), Pe = /* @__PURE__ */ e((e) => ({