@commercetools/nimbus 0.0.0-canary-20250916130207 → 0.0.0-canary-20250918091239

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 (78) hide show
  1. package/dist/chunks/icon-BHx0r3NL.cjs.js +2 -0
  2. package/dist/chunks/icon-BHx0r3NL.cjs.js.map +1 -0
  3. package/dist/chunks/icon-DHu0zrOb.es.js +14 -0
  4. package/dist/chunks/icon-DHu0zrOb.es.js.map +1 -0
  5. package/dist/chunks/icon.recipe-ClxbhW0Q.cjs.js +2 -0
  6. package/dist/chunks/icon.recipe-ClxbhW0Q.cjs.js.map +1 -0
  7. package/dist/chunks/icon.recipe-DjkjodUn.es.js +24 -0
  8. package/dist/chunks/icon.recipe-DjkjodUn.es.js.map +1 -0
  9. package/dist/chunks/inline-svg-DTleUhZq.es.js +21 -0
  10. package/dist/chunks/inline-svg-DTleUhZq.es.js.map +1 -0
  11. package/dist/chunks/inline-svg-DbvmiSw9.cjs.js +2 -0
  12. package/dist/chunks/inline-svg-DbvmiSw9.cjs.js.map +1 -0
  13. package/dist/chunks/{menu-bzi7WVh0.cjs.js → menu-CQYhHGbS.cjs.js} +2 -2
  14. package/dist/chunks/{menu-bzi7WVh0.cjs.js.map → menu-CQYhHGbS.cjs.js.map} +1 -1
  15. package/dist/chunks/{menu-DZVU5Z-r.es.js → menu-DnbrSKhK.es.js} +2 -2
  16. package/dist/chunks/{menu-DZVU5Z-r.es.js.map → menu-DnbrSKhK.es.js.map} +1 -1
  17. package/dist/chunks/rich-text-input-BbCjT_Nf.es.js +7916 -0
  18. package/dist/chunks/rich-text-input-BbCjT_Nf.es.js.map +1 -0
  19. package/dist/chunks/rich-text-input-BwrGY2EU.cjs.js +24 -0
  20. package/dist/chunks/rich-text-input-BwrGY2EU.cjs.js.map +1 -0
  21. package/dist/chunks/{split-button-BR8DktKd.es.js → split-button-ClVaxLZ7.es.js} +3 -3
  22. package/dist/chunks/{split-button-BR8DktKd.es.js.map → split-button-ClVaxLZ7.es.js.map} +1 -1
  23. package/dist/chunks/{split-button-1uPesHKO.cjs.js → split-button-D-3pT-LA.cjs.js} +2 -2
  24. package/dist/chunks/{split-button-1uPesHKO.cjs.js.map → split-button-D-3pT-LA.cjs.js.map} +1 -1
  25. package/dist/chunks/use-inline-svg-C2ko8Bcq.cjs.js +2 -0
  26. package/dist/chunks/use-inline-svg-C2ko8Bcq.cjs.js.map +1 -0
  27. package/dist/chunks/use-inline-svg-Cua0623E.es.js +47 -0
  28. package/dist/chunks/use-inline-svg-Cua0623E.es.js.map +1 -0
  29. package/dist/components/components.cjs +1 -1
  30. package/dist/components/components.es.js +79 -77
  31. package/dist/components/components.es.js.map +1 -1
  32. package/dist/components/constants.cjs +1 -1
  33. package/dist/components/constants.cjs.map +1 -1
  34. package/dist/components/constants.es.js +13 -122
  35. package/dist/components/constants.es.js.map +1 -1
  36. package/dist/components/hooks.cjs +1 -1
  37. package/dist/components/hooks.es.js +2 -5
  38. package/dist/components/icon.cjs +1 -1
  39. package/dist/components/icon.es.js +1 -1
  40. package/dist/components/inline-svg.cjs +2 -0
  41. package/dist/components/inline-svg.cjs.map +1 -0
  42. package/dist/components/inline-svg.es.js +5 -0
  43. package/dist/components/inline-svg.es.js.map +1 -0
  44. package/dist/components/rich-text-input.cjs +1 -1
  45. package/dist/components/rich-text-input.es.js +1 -1
  46. package/dist/components/split-button.cjs +1 -1
  47. package/dist/components/split-button.es.js +1 -1
  48. package/dist/components/utils.cjs +2 -1
  49. package/dist/components/utils.cjs.map +1 -1
  50. package/dist/components/utils.es.js +543 -65
  51. package/dist/components/utils.es.js.map +1 -1
  52. package/dist/components.d.ts +34 -0
  53. package/dist/constants.d.ts +4 -113
  54. package/dist/hooks.d.ts +7 -46
  55. package/dist/index.cjs +1 -1
  56. package/dist/index.cjs.map +1 -1
  57. package/dist/index.d.ts +41 -45
  58. package/dist/index.es.js +121 -119
  59. package/dist/index.es.js.map +1 -1
  60. package/dist/inline-svg.d.ts +139 -0
  61. package/dist/utils.d.ts +28 -148
  62. package/package.json +6 -5
  63. package/dist/chunks/icon-BoRbJStV.es.js +0 -31
  64. package/dist/chunks/icon-BoRbJStV.es.js.map +0 -1
  65. package/dist/chunks/icon-Cny8ZtnX.cjs.js +0 -2
  66. package/dist/chunks/icon-Cny8ZtnX.cjs.js.map +0 -1
  67. package/dist/chunks/rich-text-input-B3s6cy-T.cjs.js +0 -2
  68. package/dist/chunks/rich-text-input-B3s6cy-T.cjs.js.map +0 -1
  69. package/dist/chunks/rich-text-input-D4cP13Oo.es.js +0 -691
  70. package/dist/chunks/rich-text-input-D4cP13Oo.es.js.map +0 -1
  71. package/dist/chunks/slate-helpers-BwRHJO4o.es.js +0 -6919
  72. package/dist/chunks/slate-helpers-BwRHJO4o.es.js.map +0 -1
  73. package/dist/chunks/slate-helpers-CMAwCMk0.cjs.js +0 -24
  74. package/dist/chunks/slate-helpers-CMAwCMk0.cjs.js.map +0 -1
  75. package/dist/chunks/use-formatting-state-Denpy3Zo.cjs.js +0 -2
  76. package/dist/chunks/use-formatting-state-Denpy3Zo.cjs.js.map +0 -1
  77. package/dist/chunks/use-formatting-state-RJvSR-Zg.es.js +0 -247
  78. package/dist/chunks/use-formatting-state-RJvSR-Zg.es.js.map +0 -1
@@ -1,76 +1,554 @@
1
- import { f as u, E as i, T as a } from "../chunks/slate-helpers-BwRHJO4o.es.js";
2
- import { g as v, L as M, S as k, c as L, e as w, a as H, i as B, r as N, t as V, d as b, b as A, v as F, w as I } from "../chunks/slate-helpers-BwRHJO4o.es.js";
3
- import { textStyles as r } from "./constants.es.js";
4
- const s = (e) => a.isText(e) && e.text.trim() !== "", o = (e) => e.children.some(
5
- (t) => s(t) || i.isElement(t) && o(t)
6
- ), d = (e) => {
7
- if (!e || e.trim() === "")
8
- return !0;
9
- try {
10
- return !u(e).some((n) => i.isElement(n) ? o(n) : a.isText(n) ? s(n) : !1);
11
- } catch (t) {
12
- return console.warn("Failed to check if rich text is empty:", t), !0;
13
- }
14
- };
15
- function l(e) {
16
- return r.find((t) => t.id === e);
1
+ import { DEFAULT_FORBIDDEN_TAGS as Bt } from "./constants.es.js";
2
+ /*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */
3
+ const {
4
+ entries: Tt,
5
+ setPrototypeOf: rt,
6
+ isFrozen: Yt,
7
+ getPrototypeOf: Xt,
8
+ getOwnPropertyDescriptor: jt
9
+ } = Object;
10
+ let {
11
+ freeze: S,
12
+ seal: y,
13
+ create: _t
14
+ } = Object, {
15
+ apply: we,
16
+ construct: xe
17
+ } = typeof Reflect < "u" && Reflect;
18
+ S || (S = function(n) {
19
+ return n;
20
+ });
21
+ y || (y = function(n) {
22
+ return n;
23
+ });
24
+ we || (we = function(n, l, r) {
25
+ return n.apply(l, r);
26
+ });
27
+ xe || (xe = function(n, l) {
28
+ return new n(...l);
29
+ });
30
+ const le = /* @__PURE__ */ R(Array.prototype.forEach), Vt = /* @__PURE__ */ R(Array.prototype.lastIndexOf), st = /* @__PURE__ */ R(Array.prototype.pop), $ = /* @__PURE__ */ R(Array.prototype.push), $t = /* @__PURE__ */ R(Array.prototype.splice), fe = /* @__PURE__ */ R(String.prototype.toLowerCase), be = /* @__PURE__ */ R(String.prototype.toString), lt = /* @__PURE__ */ R(String.prototype.match), q = /* @__PURE__ */ R(String.prototype.replace), qt = /* @__PURE__ */ R(String.prototype.indexOf), Kt = /* @__PURE__ */ R(String.prototype.trim), D = /* @__PURE__ */ R(Object.prototype.hasOwnProperty), h = /* @__PURE__ */ R(RegExp.prototype.test), K = /* @__PURE__ */ Zt(TypeError);
31
+ function R(a) {
32
+ return function(n) {
33
+ n instanceof RegExp && (n.lastIndex = 0);
34
+ for (var l = arguments.length, r = new Array(l > 1 ? l - 1 : 0), m = 1; m < l; m++)
35
+ r[m - 1] = arguments[m];
36
+ return we(a, n, r);
37
+ };
17
38
  }
18
- function m(e) {
19
- return l(e)?.label || e;
39
+ function Zt(a) {
40
+ return function() {
41
+ for (var n = arguments.length, l = new Array(n), r = 0; r < n; r++)
42
+ l[r] = arguments[r];
43
+ return xe(a, l);
44
+ };
20
45
  }
21
- function p() {
22
- return r.map((e) => e.id);
23
- }
24
- function h(e) {
25
- return r.some((t) => t.id === e);
46
+ function s(a, n) {
47
+ let l = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : fe;
48
+ rt && rt(a, null);
49
+ let r = n.length;
50
+ for (; r--; ) {
51
+ let m = n[r];
52
+ if (typeof m == "string") {
53
+ const L = l(m);
54
+ L !== m && (Yt(n) || (n[r] = L), m = L);
55
+ }
56
+ a[m] = !0;
57
+ }
58
+ return a;
26
59
  }
27
- function y(e) {
28
- return l(e)?.props || null;
60
+ function Jt(a) {
61
+ for (let n = 0; n < a.length; n++)
62
+ D(a, n) || (a[n] = null);
63
+ return a;
29
64
  }
30
- function c(e) {
31
- return e.startsWith("heading-");
65
+ function C(a) {
66
+ const n = _t(null);
67
+ for (const [l, r] of Tt(a))
68
+ D(a, l) && (Array.isArray(r) ? n[l] = Jt(r) : r && typeof r == "object" && r.constructor === Object ? n[l] = C(r) : n[l] = r);
69
+ return n;
32
70
  }
33
- function x(e) {
34
- return c(e) && {
35
- "heading-one": 1,
36
- "heading-two": 2,
37
- "heading-three": 3,
38
- "heading-four": 4,
39
- "heading-five": 5
40
- }[e] || null;
71
+ function Z(a, n) {
72
+ for (; a !== null; ) {
73
+ const r = jt(a, n);
74
+ if (r) {
75
+ if (r.get)
76
+ return R(r.get);
77
+ if (typeof r.value == "function")
78
+ return R(r.value);
79
+ }
80
+ a = Xt(a);
81
+ }
82
+ function l() {
83
+ return null;
84
+ }
85
+ return l;
41
86
  }
42
- function T(e) {
87
+ const ct = /* @__PURE__ */ S(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), Ie = /* @__PURE__ */ S(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Ne = /* @__PURE__ */ S(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), Qt = /* @__PURE__ */ S(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), Me = /* @__PURE__ */ S(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), en = /* @__PURE__ */ S(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), ft = /* @__PURE__ */ S(["#text"]), ut = /* @__PURE__ */ S(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), Ce = /* @__PURE__ */ S(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), mt = /* @__PURE__ */ S(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), ce = /* @__PURE__ */ S(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), tn = /* @__PURE__ */ y(/\{\{[\w\W]*|[\w\W]*\}\}/gm), nn = /* @__PURE__ */ y(/<%[\w\W]*|[\w\W]*%>/gm), on = /* @__PURE__ */ y(/\$\{[\w\W]*/gm), an = /* @__PURE__ */ y(/^data-[\-\w.\u00B7-\uFFFF]+$/), rn = /* @__PURE__ */ y(/^aria-[\-\w]+$/), Et = /* @__PURE__ */ y(
88
+ /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
89
+ // eslint-disable-line no-useless-escape
90
+ ), sn = /* @__PURE__ */ y(/^(?:\w+script|data):/i), ln = /* @__PURE__ */ y(
91
+ /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
92
+ // eslint-disable-line no-control-regex
93
+ ), gt = /* @__PURE__ */ y(/^html$/i), cn = /* @__PURE__ */ y(/^[a-z][.\w]*(-[.\w]+)+$/i);
94
+ var pt = /* @__PURE__ */ Object.freeze({
95
+ __proto__: null,
96
+ ARIA_ATTR: rn,
97
+ ATTR_WHITESPACE: ln,
98
+ CUSTOM_ELEMENT: cn,
99
+ DATA_ATTR: an,
100
+ DOCTYPE_NAME: gt,
101
+ ERB_EXPR: nn,
102
+ IS_ALLOWED_URI: Et,
103
+ IS_SCRIPT_OR_DATA: sn,
104
+ MUSTACHE_EXPR: tn,
105
+ TMPLIT_EXPR: on
106
+ });
107
+ const J = {
108
+ element: 1,
109
+ text: 3,
110
+ // Deprecated
111
+ progressingInstruction: 7,
112
+ comment: 8,
113
+ document: 9
114
+ }, fn = function() {
115
+ return typeof window > "u" ? null : window;
116
+ }, un = function(n, l) {
117
+ if (typeof n != "object" || typeof n.createPolicy != "function")
118
+ return null;
119
+ let r = null;
120
+ const m = "data-tt-policy-suffix";
121
+ l && l.hasAttribute(m) && (r = l.getAttribute(m));
122
+ const L = "dompurify" + (r ? "#" + r : "");
123
+ try {
124
+ return n.createPolicy(L, {
125
+ createHTML(w) {
126
+ return w;
127
+ },
128
+ createScriptURL(w) {
129
+ return w;
130
+ }
131
+ });
132
+ } catch {
133
+ return console.warn("TrustedTypes policy " + L + " could not be created."), null;
134
+ }
135
+ }, dt = function() {
43
136
  return {
44
- 1: "heading-one",
45
- 2: "heading-two",
46
- 3: "heading-three",
47
- 4: "heading-four",
48
- 5: "heading-five"
49
- }[e] || null;
137
+ afterSanitizeAttributes: [],
138
+ afterSanitizeElements: [],
139
+ afterSanitizeShadowDOM: [],
140
+ beforeSanitizeAttributes: [],
141
+ beforeSanitizeElements: [],
142
+ beforeSanitizeShadowDOM: [],
143
+ uponSanitizeAttribute: [],
144
+ uponSanitizeElement: [],
145
+ uponSanitizeShadowNode: []
146
+ };
147
+ };
148
+ function At() {
149
+ let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : fn();
150
+ const n = (i) => At(i);
151
+ if (n.version = "3.2.6", n.removed = [], !a || !a.document || a.document.nodeType !== J.document || !a.Element)
152
+ return n.isSupported = !1, n;
153
+ let {
154
+ document: l
155
+ } = a;
156
+ const r = l, m = r.currentScript, {
157
+ DocumentFragment: L,
158
+ HTMLTemplateElement: w,
159
+ Node: ue,
160
+ Element: Pe,
161
+ NodeFilter: G,
162
+ NamedNodeMap: ht = a.NamedNodeMap || a.MozNamedAttrMap,
163
+ HTMLFormElement: St,
164
+ DOMParser: Rt,
165
+ trustedTypes: Q
166
+ } = a, W = Pe.prototype, Ot = Z(W, "cloneNode"), yt = Z(W, "remove"), Lt = Z(W, "nextSibling"), Dt = Z(W, "childNodes"), ee = Z(W, "parentNode");
167
+ if (typeof w == "function") {
168
+ const i = l.createElement("template");
169
+ i.content && i.content.ownerDocument && (l = i.content.ownerDocument);
170
+ }
171
+ let g, B = "";
172
+ const {
173
+ implementation: me,
174
+ createNodeIterator: bt,
175
+ createDocumentFragment: It,
176
+ getElementsByTagName: Nt
177
+ } = l, {
178
+ importNode: Mt
179
+ } = r;
180
+ let A = dt();
181
+ n.isSupported = typeof Tt == "function" && typeof ee == "function" && me && me.createHTMLDocument !== void 0;
182
+ const {
183
+ MUSTACHE_EXPR: pe,
184
+ ERB_EXPR: de,
185
+ TMPLIT_EXPR: Te,
186
+ DATA_ATTR: Ct,
187
+ ARIA_ATTR: wt,
188
+ IS_SCRIPT_OR_DATA: xt,
189
+ ATTR_WHITESPACE: ve,
190
+ CUSTOM_ELEMENT: Pt
191
+ } = pt;
192
+ let {
193
+ IS_ALLOWED_URI: ke
194
+ } = pt, p = null;
195
+ const Ue = s({}, [...ct, ...Ie, ...Ne, ...Me, ...ft]);
196
+ let T = null;
197
+ const Fe = s({}, [...ut, ...Ce, ...mt, ...ce]);
198
+ let f = Object.seal(_t(null, {
199
+ tagNameCheck: {
200
+ writable: !0,
201
+ configurable: !1,
202
+ enumerable: !0,
203
+ value: null
204
+ },
205
+ attributeNameCheck: {
206
+ writable: !0,
207
+ configurable: !1,
208
+ enumerable: !0,
209
+ value: null
210
+ },
211
+ allowCustomizedBuiltInElements: {
212
+ writable: !0,
213
+ configurable: !1,
214
+ enumerable: !0,
215
+ value: !1
216
+ }
217
+ })), Y = null, _e = null, He = !0, Ee = !0, ze = !1, Ge = !0, P = !1, te = !0, x = !1, ge = !1, Ae = !1, v = !1, ne = !1, oe = !1, We = !0, Be = !1;
218
+ const vt = "user-content-";
219
+ let he = !0, X = !1, k = {}, U = null;
220
+ const Ye = s({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
221
+ let Xe = null;
222
+ const je = s({}, ["audio", "video", "img", "source", "image", "track"]);
223
+ let Se = null;
224
+ const Ve = s({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), ie = "http://www.w3.org/1998/Math/MathML", ae = "http://www.w3.org/2000/svg", I = "http://www.w3.org/1999/xhtml";
225
+ let F = I, Re = !1, Oe = null;
226
+ const kt = s({}, [ie, ae, I], be);
227
+ let re = s({}, ["mi", "mo", "mn", "ms", "mtext"]), se = s({}, ["annotation-xml"]);
228
+ const Ut = s({}, ["title", "style", "font", "a", "script"]);
229
+ let j = null;
230
+ const Ft = ["application/xhtml+xml", "text/html"], Ht = "text/html";
231
+ let d = null, H = null;
232
+ const zt = l.createElement("form"), $e = function(e) {
233
+ return e instanceof RegExp || e instanceof Function;
234
+ }, ye = function() {
235
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
236
+ if (!(H && H === e)) {
237
+ if ((!e || typeof e != "object") && (e = {}), e = C(e), j = // eslint-disable-next-line unicorn/prefer-includes
238
+ Ft.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? Ht : e.PARSER_MEDIA_TYPE, d = j === "application/xhtml+xml" ? be : fe, p = D(e, "ALLOWED_TAGS") ? s({}, e.ALLOWED_TAGS, d) : Ue, T = D(e, "ALLOWED_ATTR") ? s({}, e.ALLOWED_ATTR, d) : Fe, Oe = D(e, "ALLOWED_NAMESPACES") ? s({}, e.ALLOWED_NAMESPACES, be) : kt, Se = D(e, "ADD_URI_SAFE_ATTR") ? s(C(Ve), e.ADD_URI_SAFE_ATTR, d) : Ve, Xe = D(e, "ADD_DATA_URI_TAGS") ? s(C(je), e.ADD_DATA_URI_TAGS, d) : je, U = D(e, "FORBID_CONTENTS") ? s({}, e.FORBID_CONTENTS, d) : Ye, Y = D(e, "FORBID_TAGS") ? s({}, e.FORBID_TAGS, d) : C({}), _e = D(e, "FORBID_ATTR") ? s({}, e.FORBID_ATTR, d) : C({}), k = D(e, "USE_PROFILES") ? e.USE_PROFILES : !1, He = e.ALLOW_ARIA_ATTR !== !1, Ee = e.ALLOW_DATA_ATTR !== !1, ze = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Ge = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, P = e.SAFE_FOR_TEMPLATES || !1, te = e.SAFE_FOR_XML !== !1, x = e.WHOLE_DOCUMENT || !1, v = e.RETURN_DOM || !1, ne = e.RETURN_DOM_FRAGMENT || !1, oe = e.RETURN_TRUSTED_TYPE || !1, Ae = e.FORCE_BODY || !1, We = e.SANITIZE_DOM !== !1, Be = e.SANITIZE_NAMED_PROPS || !1, he = e.KEEP_CONTENT !== !1, X = e.IN_PLACE || !1, ke = e.ALLOWED_URI_REGEXP || Et, F = e.NAMESPACE || I, re = e.MATHML_TEXT_INTEGRATION_POINTS || re, se = e.HTML_INTEGRATION_POINTS || se, f = e.CUSTOM_ELEMENT_HANDLING || {}, e.CUSTOM_ELEMENT_HANDLING && $e(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (f.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e.CUSTOM_ELEMENT_HANDLING && $e(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (f.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (f.allowCustomizedBuiltInElements = e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), P && (Ee = !1), ne && (v = !0), k && (p = s({}, ft), T = [], k.html === !0 && (s(p, ct), s(T, ut)), k.svg === !0 && (s(p, Ie), s(T, Ce), s(T, ce)), k.svgFilters === !0 && (s(p, Ne), s(T, Ce), s(T, ce)), k.mathMl === !0 && (s(p, Me), s(T, mt), s(T, ce))), e.ADD_TAGS && (p === Ue && (p = C(p)), s(p, e.ADD_TAGS, d)), e.ADD_ATTR && (T === Fe && (T = C(T)), s(T, e.ADD_ATTR, d)), e.ADD_URI_SAFE_ATTR && s(Se, e.ADD_URI_SAFE_ATTR, d), e.FORBID_CONTENTS && (U === Ye && (U = C(U)), s(U, e.FORBID_CONTENTS, d)), he && (p["#text"] = !0), x && s(p, ["html", "head", "body"]), p.table && (s(p, ["tbody"]), delete Y.tbody), e.TRUSTED_TYPES_POLICY) {
239
+ if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function")
240
+ throw K('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
241
+ if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function")
242
+ throw K('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
243
+ g = e.TRUSTED_TYPES_POLICY, B = g.createHTML("");
244
+ } else
245
+ g === void 0 && (g = un(Q, m)), g !== null && typeof B == "string" && (B = g.createHTML(""));
246
+ S && S(e), H = e;
247
+ }
248
+ }, qe = s({}, [...Ie, ...Ne, ...Qt]), Ke = s({}, [...Me, ...en]), Gt = function(e) {
249
+ let t = ee(e);
250
+ (!t || !t.tagName) && (t = {
251
+ namespaceURI: F,
252
+ tagName: "template"
253
+ });
254
+ const o = fe(e.tagName), c = fe(t.tagName);
255
+ return Oe[e.namespaceURI] ? e.namespaceURI === ae ? t.namespaceURI === I ? o === "svg" : t.namespaceURI === ie ? o === "svg" && (c === "annotation-xml" || re[c]) : !!qe[o] : e.namespaceURI === ie ? t.namespaceURI === I ? o === "math" : t.namespaceURI === ae ? o === "math" && se[c] : !!Ke[o] : e.namespaceURI === I ? t.namespaceURI === ae && !se[c] || t.namespaceURI === ie && !re[c] ? !1 : !Ke[o] && (Ut[o] || !qe[o]) : !!(j === "application/xhtml+xml" && Oe[e.namespaceURI]) : !1;
256
+ }, b = function(e) {
257
+ $(n.removed, {
258
+ element: e
259
+ });
260
+ try {
261
+ ee(e).removeChild(e);
262
+ } catch {
263
+ yt(e);
264
+ }
265
+ }, z = function(e, t) {
266
+ try {
267
+ $(n.removed, {
268
+ attribute: t.getAttributeNode(e),
269
+ from: t
270
+ });
271
+ } catch {
272
+ $(n.removed, {
273
+ attribute: null,
274
+ from: t
275
+ });
276
+ }
277
+ if (t.removeAttribute(e), e === "is")
278
+ if (v || ne)
279
+ try {
280
+ b(t);
281
+ } catch {
282
+ }
283
+ else
284
+ try {
285
+ t.setAttribute(e, "");
286
+ } catch {
287
+ }
288
+ }, Ze = function(e) {
289
+ let t = null, o = null;
290
+ if (Ae)
291
+ e = "<remove></remove>" + e;
292
+ else {
293
+ const u = lt(e, /^[\r\n\t ]+/);
294
+ o = u && u[0];
295
+ }
296
+ j === "application/xhtml+xml" && F === I && (e = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
297
+ const c = g ? g.createHTML(e) : e;
298
+ if (F === I)
299
+ try {
300
+ t = new Rt().parseFromString(c, j);
301
+ } catch {
302
+ }
303
+ if (!t || !t.documentElement) {
304
+ t = me.createDocument(F, "template", null);
305
+ try {
306
+ t.documentElement.innerHTML = Re ? B : c;
307
+ } catch {
308
+ }
309
+ }
310
+ const _ = t.body || t.documentElement;
311
+ return e && o && _.insertBefore(l.createTextNode(o), _.childNodes[0] || null), F === I ? Nt.call(t, x ? "html" : "body")[0] : x ? t.documentElement : _;
312
+ }, Je = function(e) {
313
+ return bt.call(
314
+ e.ownerDocument || e,
315
+ e,
316
+ // eslint-disable-next-line no-bitwise
317
+ G.SHOW_ELEMENT | G.SHOW_COMMENT | G.SHOW_TEXT | G.SHOW_PROCESSING_INSTRUCTION | G.SHOW_CDATA_SECTION,
318
+ null
319
+ );
320
+ }, Le = function(e) {
321
+ return e instanceof St && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof ht) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
322
+ }, Qe = function(e) {
323
+ return typeof ue == "function" && e instanceof ue;
324
+ };
325
+ function N(i, e, t) {
326
+ le(i, (o) => {
327
+ o.call(n, e, t, H);
328
+ });
329
+ }
330
+ const et = function(e) {
331
+ let t = null;
332
+ if (N(A.beforeSanitizeElements, e, null), Le(e))
333
+ return b(e), !0;
334
+ const o = d(e.nodeName);
335
+ if (N(A.uponSanitizeElement, e, {
336
+ tagName: o,
337
+ allowedTags: p
338
+ }), te && e.hasChildNodes() && !Qe(e.firstElementChild) && h(/<[/\w!]/g, e.innerHTML) && h(/<[/\w!]/g, e.textContent) || e.nodeType === J.progressingInstruction || te && e.nodeType === J.comment && h(/<[/\w]/g, e.data))
339
+ return b(e), !0;
340
+ if (!p[o] || Y[o]) {
341
+ if (!Y[o] && nt(o) && (f.tagNameCheck instanceof RegExp && h(f.tagNameCheck, o) || f.tagNameCheck instanceof Function && f.tagNameCheck(o)))
342
+ return !1;
343
+ if (he && !U[o]) {
344
+ const c = ee(e) || e.parentNode, _ = Dt(e) || e.childNodes;
345
+ if (_ && c) {
346
+ const u = _.length;
347
+ for (let O = u - 1; O >= 0; --O) {
348
+ const M = Ot(_[O], !0);
349
+ M.__removalCount = (e.__removalCount || 0) + 1, c.insertBefore(M, Lt(e));
350
+ }
351
+ }
352
+ }
353
+ return b(e), !0;
354
+ }
355
+ return e instanceof Pe && !Gt(e) || (o === "noscript" || o === "noembed" || o === "noframes") && h(/<\/no(script|embed|frames)/i, e.innerHTML) ? (b(e), !0) : (P && e.nodeType === J.text && (t = e.textContent, le([pe, de, Te], (c) => {
356
+ t = q(t, c, " ");
357
+ }), e.textContent !== t && ($(n.removed, {
358
+ element: e.cloneNode()
359
+ }), e.textContent = t)), N(A.afterSanitizeElements, e, null), !1);
360
+ }, tt = function(e, t, o) {
361
+ if (We && (t === "id" || t === "name") && (o in l || o in zt))
362
+ return !1;
363
+ if (!(Ee && !_e[t] && h(Ct, t))) {
364
+ if (!(He && h(wt, t))) {
365
+ if (!T[t] || _e[t]) {
366
+ if (
367
+ // First condition does a very basic check if a) it's basically a valid custom element tagname AND
368
+ // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
369
+ // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
370
+ !(nt(e) && (f.tagNameCheck instanceof RegExp && h(f.tagNameCheck, e) || f.tagNameCheck instanceof Function && f.tagNameCheck(e)) && (f.attributeNameCheck instanceof RegExp && h(f.attributeNameCheck, t) || f.attributeNameCheck instanceof Function && f.attributeNameCheck(t)) || // Alternative, second condition checks if it's an `is`-attribute, AND
371
+ // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
372
+ t === "is" && f.allowCustomizedBuiltInElements && (f.tagNameCheck instanceof RegExp && h(f.tagNameCheck, o) || f.tagNameCheck instanceof Function && f.tagNameCheck(o)))
373
+ ) return !1;
374
+ } else if (!Se[t]) {
375
+ if (!h(ke, q(o, ve, ""))) {
376
+ if (!((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && qt(o, "data:") === 0 && Xe[e])) {
377
+ if (!(ze && !h(xt, q(o, ve, "")))) {
378
+ if (o)
379
+ return !1;
380
+ }
381
+ }
382
+ }
383
+ }
384
+ }
385
+ }
386
+ return !0;
387
+ }, nt = function(e) {
388
+ return e !== "annotation-xml" && lt(e, Pt);
389
+ }, ot = function(e) {
390
+ N(A.beforeSanitizeAttributes, e, null);
391
+ const {
392
+ attributes: t
393
+ } = e;
394
+ if (!t || Le(e))
395
+ return;
396
+ const o = {
397
+ attrName: "",
398
+ attrValue: "",
399
+ keepAttr: !0,
400
+ allowedAttributes: T,
401
+ forceKeepAttr: void 0
402
+ };
403
+ let c = t.length;
404
+ for (; c--; ) {
405
+ const _ = t[c], {
406
+ name: u,
407
+ namespaceURI: O,
408
+ value: M
409
+ } = _, V = d(u), De = M;
410
+ let E = u === "value" ? De : Kt(De);
411
+ if (o.attrName = V, o.attrValue = E, o.keepAttr = !0, o.forceKeepAttr = void 0, N(A.uponSanitizeAttribute, e, o), E = o.attrValue, Be && (V === "id" || V === "name") && (z(u, e), E = vt + E), te && h(/((--!?|])>)|<\/(style|title)/i, E)) {
412
+ z(u, e);
413
+ continue;
414
+ }
415
+ if (o.forceKeepAttr)
416
+ continue;
417
+ if (!o.keepAttr) {
418
+ z(u, e);
419
+ continue;
420
+ }
421
+ if (!Ge && h(/\/>/i, E)) {
422
+ z(u, e);
423
+ continue;
424
+ }
425
+ P && le([pe, de, Te], (at) => {
426
+ E = q(E, at, " ");
427
+ });
428
+ const it = d(e.nodeName);
429
+ if (!tt(it, V, E)) {
430
+ z(u, e);
431
+ continue;
432
+ }
433
+ if (g && typeof Q == "object" && typeof Q.getAttributeType == "function" && !O)
434
+ switch (Q.getAttributeType(it, V)) {
435
+ case "TrustedHTML": {
436
+ E = g.createHTML(E);
437
+ break;
438
+ }
439
+ case "TrustedScriptURL": {
440
+ E = g.createScriptURL(E);
441
+ break;
442
+ }
443
+ }
444
+ if (E !== De)
445
+ try {
446
+ O ? e.setAttributeNS(O, u, E) : e.setAttribute(u, E), Le(e) ? b(e) : st(n.removed);
447
+ } catch {
448
+ z(u, e);
449
+ }
450
+ }
451
+ N(A.afterSanitizeAttributes, e, null);
452
+ }, Wt = function i(e) {
453
+ let t = null;
454
+ const o = Je(e);
455
+ for (N(A.beforeSanitizeShadowDOM, e, null); t = o.nextNode(); )
456
+ N(A.uponSanitizeShadowNode, t, null), et(t), ot(t), t.content instanceof L && i(t.content);
457
+ N(A.afterSanitizeShadowDOM, e, null);
458
+ };
459
+ return n.sanitize = function(i) {
460
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = null, o = null, c = null, _ = null;
461
+ if (Re = !i, Re && (i = "<!-->"), typeof i != "string" && !Qe(i))
462
+ if (typeof i.toString == "function") {
463
+ if (i = i.toString(), typeof i != "string")
464
+ throw K("dirty is not a string, aborting");
465
+ } else
466
+ throw K("toString is not a function");
467
+ if (!n.isSupported)
468
+ return i;
469
+ if (ge || ye(e), n.removed = [], typeof i == "string" && (X = !1), X) {
470
+ if (i.nodeName) {
471
+ const M = d(i.nodeName);
472
+ if (!p[M] || Y[M])
473
+ throw K("root node is forbidden and cannot be sanitized in-place");
474
+ }
475
+ } else if (i instanceof ue)
476
+ t = Ze("<!---->"), o = t.ownerDocument.importNode(i, !0), o.nodeType === J.element && o.nodeName === "BODY" || o.nodeName === "HTML" ? t = o : t.appendChild(o);
477
+ else {
478
+ if (!v && !P && !x && // eslint-disable-next-line unicorn/prefer-includes
479
+ i.indexOf("<") === -1)
480
+ return g && oe ? g.createHTML(i) : i;
481
+ if (t = Ze(i), !t)
482
+ return v ? null : oe ? B : "";
483
+ }
484
+ t && Ae && b(t.firstChild);
485
+ const u = Je(X ? i : t);
486
+ for (; c = u.nextNode(); )
487
+ et(c), ot(c), c.content instanceof L && Wt(c.content);
488
+ if (X)
489
+ return i;
490
+ if (v) {
491
+ if (ne)
492
+ for (_ = It.call(t.ownerDocument); t.firstChild; )
493
+ _.appendChild(t.firstChild);
494
+ else
495
+ _ = t;
496
+ return (T.shadowroot || T.shadowrootmode) && (_ = Mt.call(r, _, !0)), _;
497
+ }
498
+ let O = x ? t.outerHTML : t.innerHTML;
499
+ return x && p["!doctype"] && t.ownerDocument && t.ownerDocument.doctype && t.ownerDocument.doctype.name && h(gt, t.ownerDocument.doctype.name) && (O = "<!DOCTYPE " + t.ownerDocument.doctype.name + `>
500
+ ` + O), P && le([pe, de, Te], (M) => {
501
+ O = q(O, M, " ");
502
+ }), g && oe ? g.createHTML(O) : O;
503
+ }, n.setConfig = function() {
504
+ let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
505
+ ye(i), ge = !0;
506
+ }, n.clearConfig = function() {
507
+ H = null, ge = !1;
508
+ }, n.isValidAttribute = function(i, e, t) {
509
+ H || ye({});
510
+ const o = d(i), c = d(e);
511
+ return tt(o, c, t);
512
+ }, n.addHook = function(i, e) {
513
+ typeof e == "function" && $(A[i], e);
514
+ }, n.removeHook = function(i, e) {
515
+ if (e !== void 0) {
516
+ const t = Vt(A[i], e);
517
+ return t === -1 ? void 0 : $t(A[i], t, 1)[0];
518
+ }
519
+ return st(A[i]);
520
+ }, n.removeHooks = function(i) {
521
+ A[i] = [];
522
+ }, n.removeAllHooks = function() {
523
+ A = dt();
524
+ }, n;
525
+ }
526
+ var mn = /* @__PURE__ */ At();
527
+ function Tn(a, n = {}) {
528
+ const {
529
+ allowStyles: l = !1,
530
+ forbiddenAttributes: r = [],
531
+ forbiddenTags: m = []
532
+ } = n;
533
+ if (!a || typeof a != "string")
534
+ return null;
535
+ if (!pn())
536
+ return a;
537
+ const L = [...Bt, ...m], w = [
538
+ ...l ? [] : ["style"],
539
+ ...r
540
+ ];
541
+ return mn.sanitize(a, {
542
+ USE_PROFILES: { svg: !0, svgFilters: !0 },
543
+ FORBID_TAGS: L,
544
+ FORBID_ATTR: w
545
+ });
546
+ }
547
+ function pn() {
548
+ return !!(typeof window < "u" && window.document && window.document.createElement);
50
549
  }
51
550
  export {
52
- v as Element,
53
- M as Leaf,
54
- k as Softbreaker,
55
- L as createEmptyValue,
56
- T as createHeadingBlockType,
57
- w as focusEditor,
58
- u as fromHTML,
59
- x as getHeadingLevel,
60
- l as getTextStyleById,
61
- p as getTextStyleIds,
62
- m as getTextStyleLabel,
63
- y as getTextStyleProps,
64
- H as isBlockActive,
65
- d as isEmpty,
66
- c as isHeadingType,
67
- B as isMarkActive,
68
- h as isValidTextStyle,
69
- N as resetEditor,
70
- V as toHTML,
71
- b as toggleBlock,
72
- A as toggleMark,
73
- F as validSlateStateAdapter,
74
- I as withLinks
551
+ pn as canUseDOM,
552
+ Tn as sanitizeSvg
75
553
  };
76
554
  //# sourceMappingURL=utils.es.js.map