action_text-trix 2.1.15 → 2.1.17

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,6 +1,6 @@
1
1
  /*
2
- Trix 2.1.15
3
- Copyright © 2025 37signals, LLC
2
+ Trix 2.1.17
3
+ Copyright © 2026 37signals, LLC
4
4
  */
5
5
  (function (global, factory) {
6
6
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -9,7 +9,7 @@ Copyright © 2025 37signals, LLC
9
9
  })(this, (function () { 'use strict';
10
10
 
11
11
  var name = "trix";
12
- var version = "2.1.15";
12
+ var version = "2.1.17";
13
13
  var description = "A rich text editor for everyday writing";
14
14
  var main = "dist/trix.umd.min.js";
15
15
  var module = "dist/trix.esm.min.js";
@@ -43,21 +43,22 @@ Copyright © 2025 37signals, LLC
43
43
  "@rollup/plugin-json": "^4.1.0",
44
44
  "@rollup/plugin-node-resolve": "^13.3.0",
45
45
  "@web/dev-server": "^0.1.34",
46
+ "@web/test-runner": "^0.20.2",
47
+ "@web/test-runner-playwright": "^0.11.1",
48
+ "@web/test-runner-webdriver": "^0.9.0",
46
49
  "babel-eslint": "^10.1.0",
47
50
  chokidar: "^4.0.2",
48
51
  concurrently: "^7.4.0",
49
52
  eslint: "^7.32.0",
50
53
  esm: "^3.2.25",
51
- karma: "6.4.1",
52
- "karma-chrome-launcher": "3.2.0",
53
- "karma-qunit": "^4.1.2",
54
- "karma-sauce-launcher": "^4.3.6",
54
+ idiomorph: "^0.7.3",
55
55
  qunit: "2.19.1",
56
56
  rangy: "^1.3.0",
57
57
  rollup: "^2.56.3",
58
58
  "rollup-plugin-includepaths": "^0.2.4",
59
59
  "rollup-plugin-terser": "^7.0.2",
60
60
  sass: "^1.83.0",
61
+ "source-map": "^0.7.6",
61
62
  svgo: "^2.8.0",
62
63
  webdriverio: "^7.19.5"
63
64
  };
@@ -65,7 +66,7 @@ Copyright © 2025 37signals, LLC
65
66
  webdriverio: "^7.19.5"
66
67
  };
67
68
  var scripts = {
68
- "build-css": "bin/sass-build assets/trix.scss dist/trix.css",
69
+ "build-css": "bin/sass-build assets/trix.scss dist/trix.css action_text-trix/app/assets/stylesheets/trix.css",
69
70
  "build-js": "rollup -c",
70
71
  "build-assets": "cp -f assets/*.html dist/",
71
72
  "build-ruby": "rake -C action_text-trix sync",
@@ -73,7 +74,9 @@ Copyright © 2025 37signals, LLC
73
74
  watch: "rollup -c -w",
74
75
  lint: "eslint .",
75
76
  pretest: "yarn run lint && yarn run build",
76
- test: "karma start",
77
+ test: "web-test-runner",
78
+ "test:watch": "web-test-runner --watch",
79
+ version: "yarn build && git add action_text-trix",
77
80
  prerelease: "yarn version && yarn test",
78
81
  "release-npm": "npm adduser && npm publish",
79
82
  "release-ruby": "rake -C action_text-trix release",
@@ -85,6 +88,9 @@ Copyright © 2025 37signals, LLC
85
88
  var dependencies = {
86
89
  dompurify: "^3.2.5"
87
90
  };
91
+ var engines = {
92
+ node: ">= 18"
93
+ };
88
94
  var _package = {
89
95
  name: name,
90
96
  version: version,
@@ -102,7 +108,8 @@ Copyright © 2025 37signals, LLC
102
108
  devDependencies: devDependencies,
103
109
  resolutions: resolutions,
104
110
  scripts: scripts,
105
- dependencies: dependencies
111
+ dependencies: dependencies,
112
+ engines: engines
106
113
  };
107
114
 
108
115
  const attachmentSelector = "[data-trix-attachment]";
@@ -326,14 +333,12 @@ Copyright © 2025 37signals, LLC
326
333
  options.times = 1;
327
334
  return handleEvent(eventName, options);
328
335
  };
329
- const triggerEvent = function (eventName) {
336
+ const createEvent = function (eventName) {
330
337
  let {
331
- onElement,
332
338
  bubbles,
333
339
  cancelable,
334
340
  attributes
335
341
  } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
336
- const element = onElement != null ? onElement : html$2;
337
342
  bubbles = bubbles !== false;
338
343
  cancelable = cancelable !== false;
339
344
  const event = document.createEvent("Events");
@@ -341,6 +346,21 @@ Copyright © 2025 37signals, LLC
341
346
  if (attributes != null) {
342
347
  extend.call(event, attributes);
343
348
  }
349
+ return event;
350
+ };
351
+ const triggerEvent = function (eventName) {
352
+ let {
353
+ onElement,
354
+ bubbles,
355
+ cancelable,
356
+ attributes
357
+ } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
358
+ const element = onElement != null ? onElement : html$2;
359
+ const event = createEvent(eventName, {
360
+ bubbles,
361
+ cancelable,
362
+ attributes
363
+ });
344
364
  return element.dispatchEvent(event);
345
365
  };
346
366
  const elementMatchesSelector = function (element, selector) {
@@ -1745,7 +1765,7 @@ $\
1745
1765
  }
1746
1766
  }
1747
1767
 
1748
- /*! @license DOMPurify 3.2.5 | (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.5/LICENSE */
1768
+ /*! @license DOMPurify 3.2.7 | (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.7/LICENSE */
1749
1769
 
1750
1770
  const {
1751
1771
  entries,
@@ -1774,12 +1794,18 @@ $\
1774
1794
  };
1775
1795
  }
1776
1796
  if (!apply) {
1777
- apply = function apply(fun, thisValue, args) {
1778
- return fun.apply(thisValue, args);
1797
+ apply = function apply(func, thisArg) {
1798
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
1799
+ args[_key - 2] = arguments[_key];
1800
+ }
1801
+ return func.apply(thisArg, args);
1779
1802
  };
1780
1803
  }
1781
1804
  if (!construct) {
1782
- construct = function construct(Func, args) {
1805
+ construct = function construct(Func) {
1806
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
1807
+ args[_key2 - 1] = arguments[_key2];
1808
+ }
1783
1809
  return new Func(...args);
1784
1810
  };
1785
1811
  }
@@ -1808,8 +1834,8 @@ $\
1808
1834
  if (thisArg instanceof RegExp) {
1809
1835
  thisArg.lastIndex = 0;
1810
1836
  }
1811
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1812
- args[_key - 1] = arguments[_key];
1837
+ for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
1838
+ args[_key3 - 1] = arguments[_key3];
1813
1839
  }
1814
1840
  return apply(func, thisArg, args);
1815
1841
  };
@@ -1820,12 +1846,12 @@ $\
1820
1846
  * @param func - The constructor function to be wrapped and called.
1821
1847
  * @returns A new function that constructs an instance of the given constructor function with the provided arguments.
1822
1848
  */
1823
- function unconstruct(func) {
1849
+ function unconstruct(Func) {
1824
1850
  return function () {
1825
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
1826
- args[_key2] = arguments[_key2];
1851
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
1852
+ args[_key4] = arguments[_key4];
1827
1853
  }
1828
- return construct(func, args);
1854
+ return construct(Func, args);
1829
1855
  };
1830
1856
  }
1831
1857
  /**
@@ -1923,8 +1949,8 @@ $\
1923
1949
  }
1924
1950
  return fallbackValue;
1925
1951
  }
1926
- const html$1 = freeze(['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']);
1927
- const svg$1 = freeze(['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']);
1952
+ const html$1 = freeze(['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', 'search', 'section', 'select', 'shadow', 'slot', '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']);
1953
+ const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'enterkeyhint', 'exportparts', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'inputmode', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'part', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'slot', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);
1928
1954
  const svgFilters = freeze(['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']);
1929
1955
  // List of SVG elements that are disallowed by default.
1930
1956
  // We still need to know them so that we can do namespace
@@ -1936,7 +1962,7 @@ $\
1936
1962
  // even those that we disallow by default.
1937
1963
  const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);
1938
1964
  const text = freeze(['#text']);
1939
- const html = freeze(['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']);
1965
+ const html = freeze(['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', 'exportparts', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inert', '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', 'part', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'slot', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']);
1940
1966
  const svg = freeze(['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']);
1941
1967
  const mathMl = freeze(['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']);
1942
1968
  const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
@@ -1947,13 +1973,11 @@ $\
1947
1973
  const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm); // eslint-disable-line unicorn/better-regex
1948
1974
  const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); // eslint-disable-line no-useless-escape
1949
1975
  const ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
1950
- const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape
1976
+ const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape
1951
1977
  );
1952
-
1953
1978
  const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
1954
1979
  const ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex
1955
1980
  );
1956
-
1957
1981
  const DOCTYPE_NAME = seal(/^html$/i);
1958
1982
  const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
1959
1983
  var EXPRESSIONS = /*#__PURE__*/Object.freeze({
@@ -1988,7 +2012,6 @@ $\
1988
2012
  documentFragment: 11,
1989
2013
  notation: 12 // Deprecated
1990
2014
  };
1991
-
1992
2015
  const getGlobal = function getGlobal() {
1993
2016
  return typeof window === 'undefined' ? null : window;
1994
2017
  };
@@ -2046,7 +2069,7 @@ $\
2046
2069
  function createDOMPurify() {
2047
2070
  let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
2048
2071
  const DOMPurify = root => createDOMPurify(root);
2049
- DOMPurify.version = '3.2.5';
2072
+ DOMPurify.version = '3.2.7';
2050
2073
  DOMPurify.removed = [];
2051
2074
  if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
2052
2075
  // Not running in a browser, provide a factory function
@@ -2285,8 +2308,8 @@ $\
2285
2308
  URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES;
2286
2309
  DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS;
2287
2310
  FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
2288
- FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};
2289
- FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};
2311
+ FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : clone({});
2312
+ FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : clone({});
2290
2313
  USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false;
2291
2314
  ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true
2292
2315
  ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true
@@ -2651,7 +2674,7 @@ $\
2651
2674
  allowedTags: ALLOWED_TAGS
2652
2675
  });
2653
2676
  /* Detect mXSS attempts abusing namespace confusion */
2654
- if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w!]/g, currentNode.innerHTML) && regExpTest(/<[/\w!]/g, currentNode.textContent)) {
2677
+ if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w!]/g, currentNode.innerHTML) && regExpTest(/<[/\w!]/g, currentNode.textContent)) {
2655
2678
  _forceRemove(currentNode);
2656
2679
  return true;
2657
2680
  }
@@ -2743,7 +2766,7 @@ $\
2743
2766
  // First condition does a very basic check if a) it's basically a valid custom element tagname AND
2744
2767
  // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
2745
2768
  // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
2746
- _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) ||
2769
+ _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName, lcTag)) ||
2747
2770
  // Alternative, second condition checks if it's an `is`-attribute, AND
2748
2771
  // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
2749
2772
  lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ;else {
@@ -2803,7 +2826,8 @@ $\
2803
2826
  value: attrValue
2804
2827
  } = attr;
2805
2828
  const lcName = transformCaseFunc(name);
2806
- let value = name === 'value' ? attrValue : stringTrim(attrValue);
2829
+ const initValue = attrValue;
2830
+ let value = name === 'value' ? initValue : stringTrim(initValue);
2807
2831
  /* Execute a hook if present */
2808
2832
  hookEvent.attrName = lcName;
2809
2833
  hookEvent.attrValue = value;
@@ -2821,7 +2845,12 @@ $\
2821
2845
  value = SANITIZE_NAMED_PROPS_PREFIX + value;
2822
2846
  }
2823
2847
  /* Work around a security issue with comments inside attributes */
2824
- if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) {
2848
+ if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title|textarea)/i, value)) {
2849
+ _removeAttribute(name, currentNode);
2850
+ continue;
2851
+ }
2852
+ /* Make sure we cannot easily use animated hrefs, even if animations are allowed */
2853
+ if (lcName === 'attributename' && stringMatch(value, 'href')) {
2825
2854
  _removeAttribute(name, currentNode);
2826
2855
  continue;
2827
2856
  }
@@ -2829,10 +2858,9 @@ $\
2829
2858
  if (hookEvent.forceKeepAttr) {
2830
2859
  continue;
2831
2860
  }
2832
- /* Remove attribute */
2833
- _removeAttribute(name, currentNode);
2834
2861
  /* Did the hooks approve of the attribute? */
2835
2862
  if (!hookEvent.keepAttr) {
2863
+ _removeAttribute(name, currentNode);
2836
2864
  continue;
2837
2865
  }
2838
2866
  /* Work around a security issue in jQuery 3.0 */
@@ -2849,6 +2877,7 @@ $\
2849
2877
  /* Is `value` valid for this attribute? */
2850
2878
  const lcTag = transformCaseFunc(currentNode.nodeName);
2851
2879
  if (!_isValidAttribute(lcTag, lcName, value)) {
2880
+ _removeAttribute(name, currentNode);
2852
2881
  continue;
2853
2882
  }
2854
2883
  /* Handle attributes that require Trusted Types */
@@ -2869,19 +2898,23 @@ $\
2869
2898
  }
2870
2899
  }
2871
2900
  /* Handle invalid data-* attribute set by try-catching it */
2872
- try {
2873
- if (namespaceURI) {
2874
- currentNode.setAttributeNS(namespaceURI, name, value);
2875
- } else {
2876
- /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
2877
- currentNode.setAttribute(name, value);
2878
- }
2879
- if (_isClobbered(currentNode)) {
2880
- _forceRemove(currentNode);
2881
- } else {
2882
- arrayPop(DOMPurify.removed);
2901
+ if (value !== initValue) {
2902
+ try {
2903
+ if (namespaceURI) {
2904
+ currentNode.setAttributeNS(namespaceURI, name, value);
2905
+ } else {
2906
+ /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
2907
+ currentNode.setAttribute(name, value);
2908
+ }
2909
+ if (_isClobbered(currentNode)) {
2910
+ _forceRemove(currentNode);
2911
+ } else {
2912
+ arrayPop(DOMPurify.removed);
2913
+ }
2914
+ } catch (_) {
2915
+ _removeAttribute(name, currentNode);
2883
2916
  }
2884
- } catch (_) {}
2917
+ }
2885
2918
  }
2886
2919
  /* Execute a hook if present */
2887
2920
  _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
@@ -3085,6 +3118,10 @@ $\
3085
3118
  var purify = createDOMPurify();
3086
3119
 
3087
3120
  purify.addHook("uponSanitizeAttribute", function (node, data) {
3121
+ if (data.attrName === "data-trix-serialized-attributes") {
3122
+ data.keepAttr = false;
3123
+ return;
3124
+ }
3088
3125
  const allowedAttributePattern = /^data-trix-/;
3089
3126
  if (allowedAttributePattern.test(data.attrName)) {
3090
3127
  data.forceKeepAttr = true;
@@ -3331,7 +3368,10 @@ $\
3331
3368
  }
3332
3369
  getHref() {
3333
3370
  if (!htmlContainsTagName(this.attachment.getContent(), "a")) {
3334
- return this.attachment.getHref();
3371
+ const href = this.attachment.getHref();
3372
+ if (href && purify.isValidAttribute("a", "href", href)) {
3373
+ return href;
3374
+ }
3335
3375
  }
3336
3376
  }
3337
3377
  getCaptionConfig() {
@@ -3420,12 +3460,16 @@ $\
3420
3460
  }
3421
3461
  const width = this.attachment.getWidth();
3422
3462
  const height = this.attachment.getHeight();
3463
+ const alt = this.attachment.getAttribute("alt");
3423
3464
  if (width != null) {
3424
3465
  image.width = width;
3425
3466
  }
3426
3467
  if (height != null) {
3427
3468
  image.height = height;
3428
3469
  }
3470
+ if (alt != null) {
3471
+ image.alt = alt;
3472
+ }
3429
3473
  const storeKey = ["imageElement", this.attachment.id, image.src, image.width, image.height].join("/");
3430
3474
  image.dataset.trixStoreKey = storeKey;
3431
3475
  }
@@ -3719,11 +3763,21 @@ $\
3719
3763
  return elementsHaveEqualHTML(this.shadowElement, this.element);
3720
3764
  }
3721
3765
  sync() {
3766
+ const render = (element, documentFragment) => {
3767
+ while (element.lastChild) {
3768
+ element.removeChild(element.lastChild);
3769
+ }
3770
+ element.appendChild(documentFragment);
3771
+ };
3772
+ const event = createEvent("trix-before-render", {
3773
+ cancelable: false,
3774
+ attributes: {
3775
+ render
3776
+ }
3777
+ });
3778
+ this.element.dispatchEvent(event);
3722
3779
  const fragment = this.createDocumentFragmentForSync();
3723
- while (this.element.lastChild) {
3724
- this.element.removeChild(this.element.lastChild);
3725
- }
3726
- this.element.appendChild(fragment);
3780
+ event.render(this.element, fragment);
3727
3781
  return this.didSync();
3728
3782
  }
3729
3783
 
@@ -3891,7 +3945,7 @@ $\
3891
3945
  u,
3892
3946
  f = {
3893
3947
  kind: c,
3894
- name: l ? "#" + t : t,
3948
+ name: l ? "#" + t : _toPropertyKey(t),
3895
3949
  isStatic: n,
3896
3950
  isPrivate: l
3897
3951
  },
@@ -3929,10 +3983,7 @@ $\
3929
3983
  if (1 === e) {
3930
3984
  if ("object" !== a || null === t) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
3931
3985
  void 0 !== t.get && old_assertCallable(t.get, "accessor.get"), void 0 !== t.set && old_assertCallable(t.set, "accessor.set"), void 0 !== t.init && old_assertCallable(t.init, "accessor.init"), void 0 !== t.initializer && old_assertCallable(t.initializer, "accessor.initializer");
3932
- } else if ("function" !== a) {
3933
- var r;
3934
- throw r = 0 === e ? "field" : 10 === e ? "class" : "method", new TypeError(r + " decorators must return a function or void 0");
3935
- }
3986
+ } else if ("function" !== a) throw new TypeError((0 === e ? "field" : 10 === e ? "class" : "method") + " decorators must return a function or void 0");
3936
3987
  }
3937
3988
  function old_getInit(e) {
3938
3989
  var t;
@@ -3945,28 +3996,29 @@ $\
3945
3996
  f,
3946
3997
  p,
3947
3998
  v,
3999
+ y,
3948
4000
  h = a[0];
3949
- if (n ? c = 0 === o || 1 === o ? {
4001
+ if (n ? (0 === o || 1 === o ? (c = {
3950
4002
  get: a[3],
3951
4003
  set: a[4]
3952
- } : 3 === o ? {
4004
+ }, u = "get") : 3 === o ? (c = {
3953
4005
  get: a[3]
3954
- } : 4 === o ? {
4006
+ }, u = "get") : 4 === o ? (c = {
3955
4007
  set: a[3]
3956
- } : {
4008
+ }, u = "set") : c = {
3957
4009
  value: a[3]
3958
- } : 0 !== o && (c = Object.getOwnPropertyDescriptor(t, r)), 1 === o ? u = {
4010
+ }, 0 !== o && (1 === o && _setFunctionName(a[4], "#" + r, "set"), _setFunctionName(a[3], "#" + r, u))) : 0 !== o && (c = Object.getOwnPropertyDescriptor(t, r)), 1 === o ? f = {
3959
4011
  get: c.get,
3960
4012
  set: c.set
3961
- } : 2 === o ? u = c.value : 3 === o ? u = c.get : 4 === o && (u = c.set), "function" == typeof h) void 0 !== (f = old_memberDec(h, r, c, l, s, o, i, n, u)) && (old_assertValidReturnValue(o, f), 0 === o ? d = f : 1 === o ? (d = old_getInit(f), p = f.get || u.get, v = f.set || u.set, u = {
3962
- get: p,
3963
- set: v
3964
- }) : u = f);else for (var y = h.length - 1; y >= 0; y--) {
4013
+ } : 2 === o ? f = c.value : 3 === o ? f = c.get : 4 === o && (f = c.set), "function" == typeof h) void 0 !== (p = old_memberDec(h, r, c, l, s, o, i, n, f)) && (old_assertValidReturnValue(o, p), 0 === o ? d = p : 1 === o ? (d = old_getInit(p), v = p.get || f.get, y = p.set || f.set, f = {
4014
+ get: v,
4015
+ set: y
4016
+ }) : f = p);else for (var m = h.length - 1; m >= 0; m--) {
3965
4017
  var b;
3966
- if (void 0 !== (f = old_memberDec(h[y], r, c, l, s, o, i, n, u))) old_assertValidReturnValue(o, f), 0 === o ? b = f : 1 === o ? (b = old_getInit(f), p = f.get || u.get, v = f.set || u.set, u = {
3967
- get: p,
3968
- set: v
3969
- }) : u = f, void 0 !== b && (void 0 === d ? d = b : "function" == typeof d ? d = [d, b] : d.push(b));
4018
+ void 0 !== (p = old_memberDec(h[m], r, c, l, s, o, i, n, f)) && (old_assertValidReturnValue(o, p), 0 === o ? b = p : 1 === o ? (b = old_getInit(p), v = p.get || f.get, y = p.set || f.set, f = {
4019
+ get: v,
4020
+ set: y
4021
+ }) : f = p, void 0 !== b && (void 0 === d ? d = b : "function" == typeof d ? d = [d, b] : d.push(b)));
3970
4022
  }
3971
4023
  if (0 === o || 1 === o) {
3972
4024
  if (void 0 === d) d = function (e, t) {
@@ -3978,19 +4030,19 @@ $\
3978
4030
  return a;
3979
4031
  };
3980
4032
  } else {
3981
- var m = d;
4033
+ var _ = d;
3982
4034
  d = function (e, t) {
3983
- return m.call(e, t);
4035
+ return _.call(e, t);
3984
4036
  };
3985
4037
  }
3986
4038
  e.push(d);
3987
4039
  }
3988
- 0 !== o && (1 === o ? (c.get = u.get, c.set = u.set) : 2 === o ? c.value = u : 3 === o ? c.get = u : 4 === o && (c.set = u), n ? 1 === o ? (e.push(function (e, t) {
3989
- return u.get.call(e, t);
4040
+ 0 !== o && (1 === o ? (c.get = f.get, c.set = f.set) : 2 === o ? c.value = f : 3 === o ? c.get = f : 4 === o && (c.set = f), n ? 1 === o ? (e.push(function (e, t) {
4041
+ return f.get.call(e, t);
3990
4042
  }), e.push(function (e, t) {
3991
- return u.set.call(e, t);
3992
- })) : 2 === o ? e.push(u) : e.push(function (e, t) {
3993
- return u.call(e, t);
4043
+ return f.set.call(e, t);
4044
+ })) : 2 === o ? e.push(f) : e.push(function (e, t) {
4045
+ return f.call(e, t);
3994
4046
  }) : Object.defineProperty(t, r, c));
3995
4047
  }
3996
4048
  function old_applyMemberDecs(e, t, a, r, o) {
@@ -4001,16 +4053,16 @@ $\
4001
4053
  f,
4002
4054
  p,
4003
4055
  v = d[1],
4004
- h = d[2],
4005
- y = d.length > 3,
4006
- b = v >= 5;
4007
- if (b ? (u = t, f = r, 0 !== (v -= 5) && (p = n = n || [])) : (u = t.prototype, f = a, 0 !== v && (p = i = i || [])), 0 !== v && !y) {
4008
- var g = b ? s : l,
4009
- m = g.get(h) || 0;
4010
- if (!0 === m || 3 === m && 4 !== v || 4 === m && 3 !== v) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h);
4011
- !m && v > 2 ? g.set(h, v) : g.set(h, !0);
4056
+ y = d[2],
4057
+ h = d.length > 3,
4058
+ m = v >= 5;
4059
+ if (m ? (u = t, f = r, 0 != (v -= 5) && (p = n = n || [])) : (u = t.prototype, f = a, 0 !== v && (p = i = i || [])), 0 !== v && !h) {
4060
+ var b = m ? s : l,
4061
+ g = b.get(y) || 0;
4062
+ if (!0 === g || 3 === g && 4 !== v || 4 === g && 3 !== v) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + y);
4063
+ !g && v > 2 ? b.set(y, v) : b.set(y, !0);
4012
4064
  }
4013
- old_applyMemberDec(e, u, d, h, v, b, y, f, p);
4065
+ old_applyMemberDec(e, u, d, y, v, m, h, f, p);
4014
4066
  }
4015
4067
  }
4016
4068
  old_pushInitializers(e, i), old_pushInitializers(e, n);
@@ -4054,8 +4106,8 @@ $\
4054
4106
  function createAddInitializerMethod(e, t) {
4055
4107
  return function (r) {
4056
4108
  !function (e, t) {
4057
- if (e.v) throw new Error("attempted to call " + t + " after decoration was finished");
4058
- }(t, "addInitializer"), assertCallable(r, "An initializer"), e.push(r);
4109
+ if (e.v) throw new Error("attempted to call addInitializer after decoration was finished");
4110
+ }(t), assertCallable(r, "An initializer"), e.push(r);
4059
4111
  };
4060
4112
  }
4061
4113
  function memberDec(e, t, r, a, n, i, s, o) {
@@ -4119,10 +4171,7 @@ $\
4119
4171
  if (1 === e) {
4120
4172
  if ("object" !== r || null === t) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
4121
4173
  void 0 !== t.get && assertCallable(t.get, "accessor.get"), void 0 !== t.set && assertCallable(t.set, "accessor.set"), void 0 !== t.init && assertCallable(t.init, "accessor.init");
4122
- } else if ("function" !== r) {
4123
- var a;
4124
- throw a = 0 === e ? "field" : 10 === e ? "class" : "method", new TypeError(a + " decorators must return a function or void 0");
4125
- }
4174
+ } else if ("function" !== r) throw new TypeError((0 === e ? "field" : 10 === e ? "class" : "method") + " decorators must return a function or void 0");
4126
4175
  }
4127
4176
  function applyMemberDec(e, t, r, a, n, i, s, o) {
4128
4177
  var c,
@@ -4149,10 +4198,10 @@ $\
4149
4198
  set: d
4150
4199
  }) : u = f);else for (var v = h.length - 1; v >= 0; v--) {
4151
4200
  var g;
4152
- if (void 0 !== (f = memberDec(h[v], a, c, o, n, i, s, u))) assertValidReturnValue(n, f), 0 === n ? g = f : 1 === n ? (g = f.init, p = f.get || u.get, d = f.set || u.set, u = {
4201
+ void 0 !== (f = memberDec(h[v], a, c, o, n, i, s, u)) && (assertValidReturnValue(n, f), 0 === n ? g = f : 1 === n ? (g = f.init, p = f.get || u.get, d = f.set || u.set, u = {
4153
4202
  get: p,
4154
4203
  set: d
4155
- }) : u = f, void 0 !== g && (void 0 === l ? l = g : "function" == typeof l ? l = [l, g] : l.push(g));
4204
+ }) : u = f, void 0 !== g && (void 0 === l ? l = g : "function" == typeof l ? l = [l, g] : l.push(g)));
4156
4205
  }
4157
4206
  if (0 === n || 1 === n) {
4158
4207
  if (void 0 === l) l = function (e, t) {
@@ -4239,11 +4288,11 @@ $\
4239
4288
  function createAddInitializerMethod(e, t) {
4240
4289
  return function (r) {
4241
4290
  !function (e, t) {
4242
- if (e.v) throw new Error("attempted to call " + t + " after decoration was finished");
4243
- }(t, "addInitializer"), assertCallable(r, "An initializer"), e.push(r);
4291
+ if (e.v) throw new Error("attempted to call addInitializer after decoration was finished");
4292
+ }(t), assertCallable(r, "An initializer"), e.push(r);
4244
4293
  };
4245
4294
  }
4246
- function memberDec(e, t, r, n, a, i, s, o) {
4295
+ function memberDec(e, t, r, n, a, i, o, s) {
4247
4296
  var c;
4248
4297
  switch (a) {
4249
4298
  case 1:
@@ -4265,14 +4314,14 @@ $\
4265
4314
  u,
4266
4315
  f = {
4267
4316
  kind: c,
4268
- name: s ? "#" + t : t,
4317
+ name: o ? "#" + t : _toPropertyKey(t),
4269
4318
  static: i,
4270
- private: s
4319
+ private: o
4271
4320
  },
4272
4321
  p = {
4273
4322
  v: !1
4274
4323
  };
4275
- 0 !== a && (f.addInitializer = createAddInitializerMethod(n, p)), 0 === a ? s ? (l = r.get, u = r.set) : (l = function () {
4324
+ 0 !== a && (f.addInitializer = createAddInitializerMethod(n, p)), 0 === a ? o ? (l = r.get, u = r.set) : (l = function () {
4276
4325
  return this[t];
4277
4326
  }, u = function (e) {
4278
4327
  this[t] = e;
@@ -4291,7 +4340,7 @@ $\
4291
4340
  set: u
4292
4341
  };
4293
4342
  try {
4294
- return e(o, f);
4343
+ return e(s, f);
4295
4344
  } finally {
4296
4345
  p.v = !0;
4297
4346
  }
@@ -4304,69 +4353,67 @@ $\
4304
4353
  if (1 === e) {
4305
4354
  if ("object" !== r || null === t) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
4306
4355
  void 0 !== t.get && assertCallable(t.get, "accessor.get"), void 0 !== t.set && assertCallable(t.set, "accessor.set"), void 0 !== t.init && assertCallable(t.init, "accessor.init");
4307
- } else if ("function" !== r) {
4308
- var n;
4309
- throw n = 0 === e ? "field" : 10 === e ? "class" : "method", new TypeError(n + " decorators must return a function or void 0");
4310
- }
4356
+ } else if ("function" !== r) throw new TypeError((0 === e ? "field" : 10 === e ? "class" : "method") + " decorators must return a function or void 0");
4311
4357
  }
4312
- function applyMemberDec(e, t, r, n, a, i, s, o) {
4358
+ function applyMemberDec(e, t, r, n, a, i, o, s) {
4313
4359
  var c,
4314
4360
  l,
4315
4361
  u,
4316
4362
  f,
4317
4363
  p,
4318
4364
  d,
4319
- h = r[0];
4320
- if (s ? c = 0 === a || 1 === a ? {
4365
+ h,
4366
+ v = r[0];
4367
+ if (o ? (0 === a || 1 === a ? (c = {
4321
4368
  get: r[3],
4322
4369
  set: r[4]
4323
- } : 3 === a ? {
4370
+ }, u = "get") : 3 === a ? (c = {
4324
4371
  get: r[3]
4325
- } : 4 === a ? {
4372
+ }, u = "get") : 4 === a ? (c = {
4326
4373
  set: r[3]
4327
- } : {
4374
+ }, u = "set") : c = {
4328
4375
  value: r[3]
4329
- } : 0 !== a && (c = Object.getOwnPropertyDescriptor(t, n)), 1 === a ? u = {
4376
+ }, 0 !== a && (1 === a && _setFunctionName(r[4], "#" + n, "set"), _setFunctionName(r[3], "#" + n, u))) : 0 !== a && (c = Object.getOwnPropertyDescriptor(t, n)), 1 === a ? f = {
4330
4377
  get: c.get,
4331
4378
  set: c.set
4332
- } : 2 === a ? u = c.value : 3 === a ? u = c.get : 4 === a && (u = c.set), "function" == typeof h) void 0 !== (f = memberDec(h, n, c, o, a, i, s, u)) && (assertValidReturnValue(a, f), 0 === a ? l = f : 1 === a ? (l = f.init, p = f.get || u.get, d = f.set || u.set, u = {
4333
- get: p,
4334
- set: d
4335
- }) : u = f);else for (var v = h.length - 1; v >= 0; v--) {
4336
- var g;
4337
- if (void 0 !== (f = memberDec(h[v], n, c, o, a, i, s, u))) assertValidReturnValue(a, f), 0 === a ? g = f : 1 === a ? (g = f.init, p = f.get || u.get, d = f.set || u.set, u = {
4338
- get: p,
4339
- set: d
4340
- }) : u = f, void 0 !== g && (void 0 === l ? l = g : "function" == typeof l ? l = [l, g] : l.push(g));
4379
+ } : 2 === a ? f = c.value : 3 === a ? f = c.get : 4 === a && (f = c.set), "function" == typeof v) void 0 !== (p = memberDec(v, n, c, s, a, i, o, f)) && (assertValidReturnValue(a, p), 0 === a ? l = p : 1 === a ? (l = p.init, d = p.get || f.get, h = p.set || f.set, f = {
4380
+ get: d,
4381
+ set: h
4382
+ }) : f = p);else for (var g = v.length - 1; g >= 0; g--) {
4383
+ var y;
4384
+ void 0 !== (p = memberDec(v[g], n, c, s, a, i, o, f)) && (assertValidReturnValue(a, p), 0 === a ? y = p : 1 === a ? (y = p.init, d = p.get || f.get, h = p.set || f.set, f = {
4385
+ get: d,
4386
+ set: h
4387
+ }) : f = p, void 0 !== y && (void 0 === l ? l = y : "function" == typeof l ? l = [l, y] : l.push(y)));
4341
4388
  }
4342
4389
  if (0 === a || 1 === a) {
4343
4390
  if (void 0 === l) l = function (e, t) {
4344
4391
  return t;
4345
4392
  };else if ("function" != typeof l) {
4346
- var y = l;
4393
+ var m = l;
4347
4394
  l = function (e, t) {
4348
- for (var r = t, n = 0; n < y.length; n++) r = y[n].call(e, r);
4395
+ for (var r = t, n = 0; n < m.length; n++) r = m[n].call(e, r);
4349
4396
  return r;
4350
4397
  };
4351
4398
  } else {
4352
- var m = l;
4399
+ var b = l;
4353
4400
  l = function (e, t) {
4354
- return m.call(e, t);
4401
+ return b.call(e, t);
4355
4402
  };
4356
4403
  }
4357
4404
  e.push(l);
4358
4405
  }
4359
- 0 !== a && (1 === a ? (c.get = u.get, c.set = u.set) : 2 === a ? c.value = u : 3 === a ? c.get = u : 4 === a && (c.set = u), s ? 1 === a ? (e.push(function (e, t) {
4360
- return u.get.call(e, t);
4406
+ 0 !== a && (1 === a ? (c.get = f.get, c.set = f.set) : 2 === a ? c.value = f : 3 === a ? c.get = f : 4 === a && (c.set = f), o ? 1 === a ? (e.push(function (e, t) {
4407
+ return f.get.call(e, t);
4361
4408
  }), e.push(function (e, t) {
4362
- return u.set.call(e, t);
4363
- })) : 2 === a ? e.push(u) : e.push(function (e, t) {
4364
- return u.call(e, t);
4409
+ return f.set.call(e, t);
4410
+ })) : 2 === a ? e.push(f) : e.push(function (e, t) {
4411
+ return f.call(e, t);
4365
4412
  }) : Object.defineProperty(t, n, c));
4366
4413
  }
4367
4414
  function applyMemberDecs(e, t) {
4368
- for (var r, n, a = [], i = new Map(), s = new Map(), o = 0; o < t.length; o++) {
4369
- var c = t[o];
4415
+ for (var r, n, a = [], i = new Map(), o = new Map(), s = 0; s < t.length; s++) {
4416
+ var c = t[s];
4370
4417
  if (Array.isArray(c)) {
4371
4418
  var l,
4372
4419
  u,
@@ -4374,8 +4421,8 @@ $\
4374
4421
  p = c[2],
4375
4422
  d = c.length > 3,
4376
4423
  h = f >= 5;
4377
- if (h ? (l = e, 0 !== (f -= 5) && (u = n = n || [])) : (l = e.prototype, 0 !== f && (u = r = r || [])), 0 !== f && !d) {
4378
- var v = h ? s : i,
4424
+ if (h ? (l = e, 0 != (f -= 5) && (u = n = n || [])) : (l = e.prototype, 0 !== f && (u = r = r || [])), 0 !== f && !d) {
4425
+ var v = h ? o : i,
4379
4426
  g = v.get(p) || 0;
4380
4427
  if (!0 === g || 3 === g && 4 !== f || 4 === g && 3 !== f) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + p);
4381
4428
  !g && f > 2 ? v.set(p, f) : v.set(p, !0);
@@ -4398,19 +4445,19 @@ $\
4398
4445
  return function (e, t) {
4399
4446
  if (t.length > 0) {
4400
4447
  for (var r = [], n = e, a = e.name, i = t.length - 1; i >= 0; i--) {
4401
- var s = {
4448
+ var o = {
4402
4449
  v: !1
4403
4450
  };
4404
4451
  try {
4405
- var o = t[i](n, {
4452
+ var s = t[i](n, {
4406
4453
  kind: "class",
4407
4454
  name: a,
4408
- addInitializer: createAddInitializerMethod(r, s)
4455
+ addInitializer: createAddInitializerMethod(r, o)
4409
4456
  });
4410
4457
  } finally {
4411
- s.v = !0;
4458
+ o.v = !0;
4412
4459
  }
4413
- void 0 !== o && (assertValidReturnValue(10, o), n = o);
4460
+ void 0 !== s && (assertValidReturnValue(10, s), n = s);
4414
4461
  }
4415
4462
  return [n, function () {
4416
4463
  for (var e = 0; e < r.length; e++) r[e].call(n);
@@ -4428,8 +4475,8 @@ $\
4428
4475
  function createAddInitializerMethod(e, t) {
4429
4476
  return function (r) {
4430
4477
  !function (e, t) {
4431
- if (e.v) throw new Error("attempted to call " + t + " after decoration was finished");
4432
- }(t, "addInitializer"), assertCallable(r, "An initializer"), e.push(r);
4478
+ if (e.v) throw new Error("attempted to call addInitializer after decoration was finished");
4479
+ }(t), assertCallable(r, "An initializer"), e.push(r);
4433
4480
  };
4434
4481
  }
4435
4482
  function assertInstanceIfPrivate(e, t) {
@@ -4457,7 +4504,7 @@ $\
4457
4504
  f,
4458
4505
  p = {
4459
4506
  kind: u,
4460
- name: s ? "#" + t : t,
4507
+ name: s ? "#" + t : _toPropertyKey(t),
4461
4508
  static: i,
4462
4509
  private: s
4463
4510
  },
@@ -4512,10 +4559,7 @@ $\
4512
4559
  if (1 === e) {
4513
4560
  if ("object" !== r || null === t) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
4514
4561
  void 0 !== t.get && assertCallable(t.get, "accessor.get"), void 0 !== t.set && assertCallable(t.set, "accessor.set"), void 0 !== t.init && assertCallable(t.init, "accessor.init");
4515
- } else if ("function" !== r) {
4516
- var n;
4517
- throw n = 0 === e ? "field" : 10 === e ? "class" : "method", new TypeError(n + " decorators must return a function or void 0");
4518
- }
4562
+ } else if ("function" !== r) throw new TypeError((0 === e ? "field" : 10 === e ? "class" : "method") + " decorators must return a function or void 0");
4519
4563
  }
4520
4564
  function curryThis2(e) {
4521
4565
  return function (t) {
@@ -4530,54 +4574,55 @@ $\
4530
4574
  d,
4531
4575
  h,
4532
4576
  v,
4577
+ y,
4533
4578
  g = r[0];
4534
- if (s ? u = 0 === a || 1 === a ? {
4535
- get: (p = r[3], function () {
4536
- return p(this);
4579
+ if (s ? (0 === a || 1 === a ? (u = {
4580
+ get: (d = r[3], function () {
4581
+ return d(this);
4537
4582
  }),
4538
4583
  set: curryThis2(r[4])
4539
- } : 3 === a ? {
4584
+ }, f = "get") : 3 === a ? (u = {
4540
4585
  get: r[3]
4541
- } : 4 === a ? {
4586
+ }, f = "get") : 4 === a ? (u = {
4542
4587
  set: r[3]
4543
- } : {
4588
+ }, f = "set") : u = {
4544
4589
  value: r[3]
4545
- } : 0 !== a && (u = Object.getOwnPropertyDescriptor(t, n)), 1 === a ? f = {
4590
+ }, 0 !== a && (1 === a && _setFunctionName(u.set, "#" + n, "set"), _setFunctionName(u[f || "value"], "#" + n, f))) : 0 !== a && (u = Object.getOwnPropertyDescriptor(t, n)), 1 === a ? p = {
4546
4591
  get: u.get,
4547
4592
  set: u.set
4548
- } : 2 === a ? f = u.value : 3 === a ? f = u.get : 4 === a && (f = u.set), "function" == typeof g) void 0 !== (d = memberDec(g, n, u, o, a, i, s, f, c)) && (assertValidReturnValue(a, d), 0 === a ? l = d : 1 === a ? (l = d.init, h = d.get || f.get, v = d.set || f.set, f = {
4549
- get: h,
4550
- set: v
4551
- }) : f = d);else for (var y = g.length - 1; y >= 0; y--) {
4552
- var m;
4553
- if (void 0 !== (d = memberDec(g[y], n, u, o, a, i, s, f, c))) assertValidReturnValue(a, d), 0 === a ? m = d : 1 === a ? (m = d.init, h = d.get || f.get, v = d.set || f.set, f = {
4554
- get: h,
4555
- set: v
4556
- }) : f = d, void 0 !== m && (void 0 === l ? l = m : "function" == typeof l ? l = [l, m] : l.push(m));
4593
+ } : 2 === a ? p = u.value : 3 === a ? p = u.get : 4 === a && (p = u.set), "function" == typeof g) void 0 !== (h = memberDec(g, n, u, o, a, i, s, p, c)) && (assertValidReturnValue(a, h), 0 === a ? l = h : 1 === a ? (l = h.init, v = h.get || p.get, y = h.set || p.set, p = {
4594
+ get: v,
4595
+ set: y
4596
+ }) : p = h);else for (var m = g.length - 1; m >= 0; m--) {
4597
+ var b;
4598
+ void 0 !== (h = memberDec(g[m], n, u, o, a, i, s, p, c)) && (assertValidReturnValue(a, h), 0 === a ? b = h : 1 === a ? (b = h.init, v = h.get || p.get, y = h.set || p.set, p = {
4599
+ get: v,
4600
+ set: y
4601
+ }) : p = h, void 0 !== b && (void 0 === l ? l = b : "function" == typeof l ? l = [l, b] : l.push(b)));
4557
4602
  }
4558
4603
  if (0 === a || 1 === a) {
4559
4604
  if (void 0 === l) l = function (e, t) {
4560
4605
  return t;
4561
4606
  };else if ("function" != typeof l) {
4562
- var b = l;
4607
+ var I = l;
4563
4608
  l = function (e, t) {
4564
- for (var r = t, n = 0; n < b.length; n++) r = b[n].call(e, r);
4609
+ for (var r = t, n = 0; n < I.length; n++) r = I[n].call(e, r);
4565
4610
  return r;
4566
4611
  };
4567
4612
  } else {
4568
- var I = l;
4613
+ var w = l;
4569
4614
  l = function (e, t) {
4570
- return I.call(e, t);
4615
+ return w.call(e, t);
4571
4616
  };
4572
4617
  }
4573
4618
  e.push(l);
4574
4619
  }
4575
- 0 !== a && (1 === a ? (u.get = f.get, u.set = f.set) : 2 === a ? u.value = f : 3 === a ? u.get = f : 4 === a && (u.set = f), s ? 1 === a ? (e.push(function (e, t) {
4576
- return f.get.call(e, t);
4620
+ 0 !== a && (1 === a ? (u.get = p.get, u.set = p.set) : 2 === a ? u.value = p : 3 === a ? u.get = p : 4 === a && (u.set = p), s ? 1 === a ? (e.push(function (e, t) {
4621
+ return p.get.call(e, t);
4577
4622
  }), e.push(function (e, t) {
4578
- return f.set.call(e, t);
4579
- })) : 2 === a ? e.push(f) : e.push(function (e, t) {
4580
- return f.call(e, t);
4623
+ return p.set.call(e, t);
4624
+ })) : 2 === a ? e.push(p) : e.push(function (e, t) {
4625
+ return p.call(e, t);
4581
4626
  }) : Object.defineProperty(t, n, u));
4582
4627
  }
4583
4628
  function applyMemberDecs(e, t, r) {
@@ -4589,17 +4634,17 @@ $\
4589
4634
  d = l[1],
4590
4635
  h = l[2],
4591
4636
  v = l.length > 3,
4592
- g = d >= 5,
4593
- y = r;
4594
- if (g ? (f = e, 0 !== (d -= 5) && (p = a = a || []), v && !i && (i = function (t) {
4637
+ y = d >= 5,
4638
+ g = r;
4639
+ if (y ? (f = e, 0 != (d -= 5) && (p = a = a || []), v && !i && (i = function (t) {
4595
4640
  return _checkInRHS(t) === e;
4596
- }), y = i) : (f = e.prototype, 0 !== d && (p = n = n || [])), 0 !== d && !v) {
4597
- var m = g ? c : o,
4641
+ }), g = i) : (f = e.prototype, 0 !== d && (p = n = n || [])), 0 !== d && !v) {
4642
+ var m = y ? c : o,
4598
4643
  b = m.get(h) || 0;
4599
4644
  if (!0 === b || 3 === b && 4 !== d || 4 === b && 3 !== d) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h);
4600
4645
  !b && d > 2 ? m.set(h, d) : m.set(h, !0);
4601
4646
  }
4602
- applyMemberDec(s, f, l, h, d, g, v, p, y);
4647
+ applyMemberDec(s, f, l, h, d, y, v, p, g);
4603
4648
  }
4604
4649
  }
4605
4650
  return pushInitializers(s, n), pushInitializers(s, a), s;
@@ -4643,232 +4688,131 @@ $\
4643
4688
  function _applyDecs2301(e, t, r, n) {
4644
4689
  return (_applyDecs2301 = applyDecs2301Factory())(e, t, r, n);
4645
4690
  }
4646
- function createAddInitializerMethod(e, t) {
4647
- return function (r) {
4648
- assertNotFinished(t, "addInitializer"), assertCallable(r, "An initializer"), e.push(r);
4649
- };
4650
- }
4651
- function assertInstanceIfPrivate(e, t) {
4652
- if (!e(t)) throw new TypeError("Attempted to access private element on non-instance");
4653
- }
4654
- function memberDec(e, t, r, a, n, i, s, o, c, l, u) {
4655
- var f;
4656
- switch (i) {
4657
- case 1:
4658
- f = "accessor";
4659
- break;
4660
- case 2:
4661
- f = "method";
4662
- break;
4663
- case 3:
4664
- f = "getter";
4665
- break;
4666
- case 4:
4667
- f = "setter";
4668
- break;
4669
- default:
4670
- f = "field";
4671
- }
4672
- var d,
4673
- p,
4674
- h = {
4675
- kind: f,
4676
- name: o ? "#" + r : r,
4677
- static: s,
4678
- private: o,
4679
- metadata: u
4680
- },
4681
- v = {
4682
- v: !1
4691
+ function _applyDecs2305(e, t, r, n, o, a) {
4692
+ function i(e, t, r) {
4693
+ return function (n, o) {
4694
+ return r && r(n), e[t].call(n, o);
4683
4695
  };
4684
- if (0 !== i && (h.addInitializer = createAddInitializerMethod(n, v)), o || 0 !== i && 2 !== i) {
4685
- if (2 === i) d = function (e) {
4686
- return assertInstanceIfPrivate(l, e), a.value;
4687
- };else {
4688
- var y = 0 === i || 1 === i;
4689
- (y || 3 === i) && (d = o ? function (e) {
4690
- return assertInstanceIfPrivate(l, e), a.get.call(e);
4691
- } : function (e) {
4692
- return a.get.call(e);
4693
- }), (y || 4 === i) && (p = o ? function (e, t) {
4694
- assertInstanceIfPrivate(l, e), a.set.call(e, t);
4695
- } : function (e, t) {
4696
- a.set.call(e, t);
4697
- });
4698
- }
4699
- } else d = function (e) {
4700
- return e[r];
4701
- }, 0 === i && (p = function (e, t) {
4702
- e[r] = t;
4703
- });
4704
- var m = o ? l.bind() : function (e) {
4705
- return r in e;
4706
- };
4707
- h.access = d && p ? {
4708
- get: d,
4709
- set: p,
4710
- has: m
4711
- } : d ? {
4712
- get: d,
4713
- has: m
4714
- } : {
4715
- set: p,
4716
- has: m
4717
- };
4718
- try {
4719
- return e.call(t, c, h);
4720
- } finally {
4721
- v.v = !0;
4722
4696
  }
4723
- }
4724
- function assertNotFinished(e, t) {
4725
- if (e.v) throw new Error("attempted to call " + t + " after decoration was finished");
4726
- }
4727
- function assertCallable(e, t) {
4728
- if ("function" != typeof e) throw new TypeError(t + " must be a function");
4729
- }
4730
- function assertValidReturnValue(e, t) {
4731
- var r = typeof t;
4732
- if (1 === e) {
4733
- if ("object" !== r || null === t) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
4734
- void 0 !== t.get && assertCallable(t.get, "accessor.get"), void 0 !== t.set && assertCallable(t.set, "accessor.set"), void 0 !== t.init && assertCallable(t.init, "accessor.init");
4735
- } else if ("function" !== r) {
4736
- var a;
4737
- throw a = 0 === e ? "field" : 5 === e ? "class" : "method", new TypeError(a + " decorators must return a function or void 0");
4738
- }
4739
- }
4740
- function curryThis1(e) {
4741
- return function () {
4742
- return e(this);
4743
- };
4744
- }
4745
- function curryThis2(e) {
4746
- return function (t) {
4747
- e(this, t);
4748
- };
4749
- }
4750
- function applyMemberDec(e, t, r, a, n, i, s, o, c, l, u) {
4751
- var f,
4752
- d,
4753
- p,
4754
- h,
4755
- v,
4756
- y,
4757
- m = r[0];
4758
- a || Array.isArray(m) || (m = [m]), o ? f = 0 === i || 1 === i ? {
4759
- get: curryThis1(r[3]),
4760
- set: curryThis2(r[4])
4761
- } : 3 === i ? {
4762
- get: r[3]
4763
- } : 4 === i ? {
4764
- set: r[3]
4765
- } : {
4766
- value: r[3]
4767
- } : 0 !== i && (f = Object.getOwnPropertyDescriptor(t, n)), 1 === i ? p = {
4768
- get: f.get,
4769
- set: f.set
4770
- } : 2 === i ? p = f.value : 3 === i ? p = f.get : 4 === i && (p = f.set);
4771
- for (var g = a ? 2 : 1, b = m.length - 1; b >= 0; b -= g) {
4772
- var I;
4773
- if (void 0 !== (h = memberDec(m[b], a ? m[b - 1] : void 0, n, f, c, i, s, o, p, l, u))) assertValidReturnValue(i, h), 0 === i ? I = h : 1 === i ? (I = h.init, v = h.get || p.get, y = h.set || p.set, p = {
4774
- get: v,
4775
- set: y
4776
- }) : p = h, void 0 !== I && (void 0 === d ? d = I : "function" == typeof d ? d = [d, I] : d.push(I));
4777
- }
4778
- if (0 === i || 1 === i) {
4779
- if (void 0 === d) d = function (e, t) {
4780
- return t;
4781
- };else if ("function" != typeof d) {
4782
- var w = d;
4783
- d = function (e, t) {
4784
- for (var r = t, a = w.length - 1; a >= 0; a--) r = w[a].call(e, r);
4785
- return r;
4786
- };
4787
- } else {
4788
- var M = d;
4789
- d = function (e, t) {
4790
- return M.call(e, t);
4791
- };
4792
- }
4793
- e.push(d);
4697
+ function c(e, t) {
4698
+ for (var r = 0; r < e.length; r++) e[r].call(t);
4699
+ return t;
4794
4700
  }
4795
- 0 !== i && (1 === i ? (f.get = p.get, f.set = p.set) : 2 === i ? f.value = p : 3 === i ? f.get = p : 4 === i && (f.set = p), o ? 1 === i ? (e.push(function (e, t) {
4796
- return p.get.call(e, t);
4797
- }), e.push(function (e, t) {
4798
- return p.set.call(e, t);
4799
- })) : 2 === i ? e.push(p) : e.push(function (e, t) {
4800
- return p.call(e, t);
4801
- }) : Object.defineProperty(t, n, f));
4802
- }
4803
- function applyMemberDecs(e, t, r, a) {
4804
- for (var n, i, s, o = [], c = new Map(), l = new Map(), u = 0; u < t.length; u++) {
4805
- var f = t[u];
4806
- if (Array.isArray(f)) {
4807
- var d,
4808
- p,
4809
- h = f[1],
4810
- v = f[2],
4811
- y = f.length > 3,
4812
- m = 16 & h,
4813
- g = !!(8 & h),
4814
- b = r;
4815
- if (h &= 7, g ? (d = e, 0 !== h && (p = i = i || []), y && !s && (s = function (t) {
4816
- return _checkInRHS(t) === e;
4817
- }), b = s) : (d = e.prototype, 0 !== h && (p = n = n || [])), 0 !== h && !y) {
4818
- var I = g ? l : c,
4819
- w = I.get(v) || 0;
4820
- if (!0 === w || 3 === w && 4 !== h || 4 === w && 3 !== h) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + v);
4821
- I.set(v, !(!w && h > 2) || h);
4822
- }
4823
- applyMemberDec(o, d, f, m, v, h, g, y, p, b, a);
4824
- }
4825
- }
4826
- return pushInitializers(o, n), pushInitializers(o, i), o;
4827
- }
4828
- function pushInitializers(e, t) {
4829
- t && e.push(function (e) {
4830
- for (var r = 0; r < t.length; r++) t[r].call(e);
4701
+ function s(e, t, r, n) {
4702
+ if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined"));
4831
4703
  return e;
4832
- });
4833
- }
4834
- function applyClassDecs(e, t, r, a) {
4835
- if (t.length) {
4836
- for (var n = [], i = e, s = e.name, o = r ? 2 : 1, c = t.length - 1; c >= 0; c -= o) {
4837
- var l = {
4838
- v: !1
4839
- };
4704
+ }
4705
+ function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) {
4706
+ function m(e) {
4707
+ if (!h(e)) throw new TypeError("Attempted to access private element on non-instance");
4708
+ }
4709
+ var y,
4710
+ v = t[0],
4711
+ g = t[3],
4712
+ b = !u;
4713
+ if (!b) {
4714
+ r || Array.isArray(v) || (v = [v]);
4715
+ var w = {},
4716
+ S = [],
4717
+ A = 3 === o ? "get" : 4 === o || d ? "set" : "value";
4718
+ f ? (p || d ? w = {
4719
+ get: _setFunctionName(function () {
4720
+ return g(this);
4721
+ }, n, "get"),
4722
+ set: function (e) {
4723
+ t[4](this, e);
4724
+ }
4725
+ } : w[A] = g, p || _setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n));
4726
+ }
4727
+ for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) {
4728
+ var D = v[j],
4729
+ E = r ? v[j - 1] : void 0,
4730
+ I = {},
4731
+ O = {
4732
+ kind: ["field", "accessor", "method", "getter", "setter", "class"][o],
4733
+ name: n,
4734
+ metadata: a,
4735
+ addInitializer: function (e, t) {
4736
+ if (e.v) throw new Error("attempted to call addInitializer after decoration was finished");
4737
+ s(t, "An initializer", "be", !0), c.push(t);
4738
+ }.bind(null, I)
4739
+ };
4840
4740
  try {
4841
- var u = t[c].call(r ? t[c - 1] : void 0, i, {
4842
- kind: "class",
4843
- name: s,
4844
- addInitializer: createAddInitializerMethod(n, l),
4845
- metadata: a
4846
- });
4741
+ if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else {
4742
+ var k, F;
4743
+ O.static = l, O.private = f, f ? 2 === o ? k = function (e) {
4744
+ return m(e), w.value;
4745
+ } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function (e) {
4746
+ return e[n];
4747
+ }, (o < 2 || 4 === o) && (F = function (e, t) {
4748
+ e[n] = t;
4749
+ }));
4750
+ var N = O.access = {
4751
+ has: f ? h.bind() : function (e) {
4752
+ return n in e;
4753
+ }
4754
+ };
4755
+ if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? {
4756
+ get: w.get,
4757
+ set: w.set
4758
+ } : w[A], O), d) {
4759
+ if ("object" == typeof P && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && S.push(y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
4760
+ } else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P);
4761
+ }
4847
4762
  } finally {
4848
- l.v = !0;
4763
+ I.v = !0;
4849
4764
  }
4850
- void 0 !== u && (assertValidReturnValue(5, u), i = u);
4851
4765
  }
4852
- return [defineMetadata(i, a), function () {
4853
- for (var e = 0; e < n.length; e++) n[e].call(i);
4854
- }];
4766
+ return (p || d) && u.push(function (e, t) {
4767
+ for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t);
4768
+ return t;
4769
+ }), p || b || (f ? d ? u.push(i(w, "get"), i(w, "set")) : u.push(2 === o ? w[A] : i.call.bind(w[A])) : Object.defineProperty(e, n, w)), P;
4855
4770
  }
4856
- }
4857
- function defineMetadata(e, t) {
4858
- return Object.defineProperty(e, Symbol.metadata || Symbol.for("Symbol.metadata"), {
4859
- configurable: !0,
4860
- enumerable: !0,
4861
- value: t
4862
- });
4863
- }
4864
- function _applyDecs2305(e, t, r, a, n, i) {
4865
- if (arguments.length >= 6) var s = i[Symbol.metadata || Symbol.for("Symbol.metadata")];
4866
- var o = Object.create(void 0 === s ? null : s),
4867
- c = applyMemberDecs(e, t, n, o);
4868
- return r.length || defineMetadata(e, o), {
4869
- e: c,
4771
+ function u(e, t) {
4772
+ return Object.defineProperty(e, Symbol.metadata || Symbol.for("Symbol.metadata"), {
4773
+ configurable: !0,
4774
+ enumerable: !0,
4775
+ value: t
4776
+ });
4777
+ }
4778
+ if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol.for("Symbol.metadata")];
4779
+ var f = Object.create(null == l ? null : l),
4780
+ p = function (e, t, r, n) {
4781
+ var o,
4782
+ a,
4783
+ i = [],
4784
+ s = function (t) {
4785
+ return _checkInRHS(t) === e;
4786
+ },
4787
+ u = new Map();
4788
+ function l(e) {
4789
+ e && i.push(c.bind(null, e));
4790
+ }
4791
+ for (var f = 0; f < t.length; f++) {
4792
+ var p = t[f];
4793
+ if (Array.isArray(p)) {
4794
+ var d = p[1],
4795
+ h = p[2],
4796
+ m = p.length > 3,
4797
+ y = 16 & d,
4798
+ v = !!(8 & d),
4799
+ g = 0 == (d &= 7),
4800
+ b = h + "/" + v;
4801
+ if (!g && !m) {
4802
+ var w = u.get(b);
4803
+ if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h);
4804
+ u.set(b, !(d > 2) || d);
4805
+ }
4806
+ applyDec(v ? e : e.prototype, p, y, m ? "#" + h : _toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r);
4807
+ }
4808
+ }
4809
+ return l(o), l(a), i;
4810
+ }(e, t, o, f);
4811
+ return r.length || u(e, f), {
4812
+ e: p,
4870
4813
  get c() {
4871
- return applyClassDecs(e, r, a, o);
4814
+ var t = [];
4815
+ return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)];
4872
4816
  }
4873
4817
  };
4874
4818
  }
@@ -4941,10 +4885,20 @@ $\
4941
4885
  function _awaitAsyncGenerator(e) {
4942
4886
  return new _OverloadYield(e, 0);
4943
4887
  }
4888
+ function _callSuper(t, o, e) {
4889
+ return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
4890
+ }
4944
4891
  function _checkInRHS(e) {
4945
4892
  if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== e ? typeof e : "null"));
4946
4893
  return e;
4947
4894
  }
4895
+ function _construct(t, e, r) {
4896
+ if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
4897
+ var o = [null];
4898
+ o.push.apply(o, e);
4899
+ var p = new (t.bind.apply(t, o))();
4900
+ return r && _setPrototypeOf(p, r.prototype), p;
4901
+ }
4948
4902
  function _defineAccessor(e, r, n, t) {
4949
4903
  var c = {
4950
4904
  configurable: !0,
@@ -4954,7 +4908,7 @@ $\
4954
4908
  }
4955
4909
  function dispose_SuppressedError(r, e) {
4956
4910
  return "undefined" != typeof SuppressedError ? dispose_SuppressedError = SuppressedError : (dispose_SuppressedError = function (r, e) {
4957
- this.suppressed = r, this.error = e, this.stack = new Error().stack;
4911
+ this.suppressed = e, this.error = r, this.stack = new Error().stack;
4958
4912
  }, dispose_SuppressedError.prototype = Object.create(Error.prototype, {
4959
4913
  constructor: {
4960
4914
  value: dispose_SuppressedError,
@@ -4975,7 +4929,7 @@ $\
4975
4929
  if (s) throw e;
4976
4930
  }
4977
4931
  function err(r) {
4978
- return e = s ? new dispose_SuppressedError(r, e) : r, s = !0, next();
4932
+ return e = s ? new dispose_SuppressedError(e, r) : r, s = !0, next();
4979
4933
  }
4980
4934
  return next();
4981
4935
  }
@@ -5005,6 +4959,39 @@ $\
5005
4959
  setPrototypeOf: constValue(!1)
5006
4960
  });
5007
4961
  }
4962
+ function _getRequireWildcardCache(e) {
4963
+ if ("function" != typeof WeakMap) return null;
4964
+ var r = new WeakMap(),
4965
+ t = new WeakMap();
4966
+ return (_getRequireWildcardCache = function (e) {
4967
+ return e ? t : r;
4968
+ })(e);
4969
+ }
4970
+ function _interopRequireWildcard(e, r) {
4971
+ if (!r && e && e.__esModule) return e;
4972
+ if (null === e || "object" != typeof e && "function" != typeof e) return {
4973
+ default: e
4974
+ };
4975
+ var t = _getRequireWildcardCache(r);
4976
+ if (t && t.has(e)) return t.get(e);
4977
+ var n = {
4978
+ __proto__: null
4979
+ },
4980
+ a = Object.defineProperty && Object.getOwnPropertyDescriptor;
4981
+ for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) {
4982
+ var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
4983
+ i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
4984
+ }
4985
+ return n.default = e, t && t.set(e, n), n;
4986
+ }
4987
+ function _isNativeReflectConstruct() {
4988
+ try {
4989
+ var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
4990
+ } catch (t) {}
4991
+ return (_isNativeReflectConstruct = function () {
4992
+ return !!t;
4993
+ })();
4994
+ }
5008
4995
  function _iterableToArrayLimit(r, l) {
5009
4996
  var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
5010
4997
  if (null != t) {
@@ -5385,6 +5372,30 @@ $\
5385
5372
  }
5386
5373
  }, e;
5387
5374
  }
5375
+ function _setFunctionName(e, t, n) {
5376
+ "symbol" == typeof t && (t = (t = t.description) ? "[" + t + "]" : "");
5377
+ try {
5378
+ Object.defineProperty(e, "name", {
5379
+ configurable: !0,
5380
+ value: n ? n + " " + t : t
5381
+ });
5382
+ } catch (e) {}
5383
+ return e;
5384
+ }
5385
+ function _toPrimitive(t, r) {
5386
+ if ("object" != typeof t || !t) return t;
5387
+ var e = t[Symbol.toPrimitive];
5388
+ if (void 0 !== e) {
5389
+ var i = e.call(t, r || "default");
5390
+ if ("object" != typeof i) return i;
5391
+ throw new TypeError("@@toPrimitive must return a primitive value.");
5392
+ }
5393
+ return ("string" === r ? String : Number)(t);
5394
+ }
5395
+ function _toPropertyKey(t) {
5396
+ var i = _toPrimitive(t, "string");
5397
+ return "symbol" == typeof i ? i : String(i);
5398
+ }
5388
5399
  function _typeof(o) {
5389
5400
  "@babel/helpers - typeof";
5390
5401
 
@@ -5394,16 +5405,59 @@ $\
5394
5405
  return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
5395
5406
  }, _typeof(o);
5396
5407
  }
5397
- function _using(o, e, n) {
5398
- if (null == e) return e;
5399
- if ("object" != typeof e) throw new TypeError("using declarations can only be used with objects, null, or undefined.");
5400
- if (n) var r = e[Symbol.asyncDispose || Symbol.for("Symbol.asyncDispose")];
5401
- if (null == r && (r = e[Symbol.dispose || Symbol.for("Symbol.dispose")]), "function" != typeof r) throw new TypeError("Property [Symbol.dispose] is not a function.");
5408
+ function _using(o, n, e) {
5409
+ if (null == n) return n;
5410
+ if (Object(n) !== n) throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");
5411
+ if (e) var r = n[Symbol.asyncDispose || Symbol.for("Symbol.asyncDispose")];
5412
+ if (null == r && (r = n[Symbol.dispose || Symbol.for("Symbol.dispose")]), "function" != typeof r) throw new TypeError("Property [Symbol.dispose] is not a function.");
5402
5413
  return o.push({
5403
- v: e,
5414
+ v: n,
5404
5415
  d: r,
5405
- a: n
5406
- }), e;
5416
+ a: e
5417
+ }), n;
5418
+ }
5419
+ function _usingCtx() {
5420
+ var r = "function" == typeof SuppressedError ? SuppressedError : function (r, n) {
5421
+ var e = new Error();
5422
+ return e.name = "SuppressedError", e.suppressed = n, e.error = r, e;
5423
+ },
5424
+ n = {},
5425
+ e = [];
5426
+ function using(r, n) {
5427
+ if (null != n) {
5428
+ if (Object(n) !== n) throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");
5429
+ if (r) var o = n[Symbol.asyncDispose || Symbol.for("Symbol.asyncDispose")];
5430
+ if (null == o && (o = n[Symbol.dispose || Symbol.for("Symbol.dispose")]), "function" != typeof o) throw new TypeError("Property [Symbol.dispose] is not a function.");
5431
+ e.push({
5432
+ v: n,
5433
+ d: o,
5434
+ a: r
5435
+ });
5436
+ }
5437
+ return n;
5438
+ }
5439
+ return {
5440
+ e: n,
5441
+ u: using.bind(null, !1),
5442
+ a: using.bind(null, !0),
5443
+ d: function () {
5444
+ var o = this.e;
5445
+ function next() {
5446
+ for (; r = e.pop();) try {
5447
+ var r,
5448
+ t = r.d.call(r.v);
5449
+ if (r.a) return Promise.resolve(t).then(next, err);
5450
+ } catch (r) {
5451
+ return err(r);
5452
+ }
5453
+ if (o !== n) throw o;
5454
+ }
5455
+ function err(e) {
5456
+ return o = o !== n ? new r(o, e) : e, next();
5457
+ }
5458
+ return next();
5459
+ }
5460
+ };
5407
5461
  }
5408
5462
  function _wrapRegExp() {
5409
5463
  _wrapRegExp = function (e, r) {
@@ -5619,35 +5673,13 @@ $\
5619
5673
  };
5620
5674
  return _setPrototypeOf(o, p);
5621
5675
  }
5622
- function _isNativeReflectConstruct() {
5623
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
5624
- if (Reflect.construct.sham) return false;
5625
- if (typeof Proxy === "function") return true;
5676
+ function _isNativeFunction(fn) {
5626
5677
  try {
5627
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
5628
- return true;
5678
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
5629
5679
  } catch (e) {
5630
- return false;
5680
+ return typeof fn === "function";
5631
5681
  }
5632
5682
  }
5633
- function _construct(Parent, args, Class) {
5634
- if (_isNativeReflectConstruct()) {
5635
- _construct = Reflect.construct.bind();
5636
- } else {
5637
- _construct = function _construct(Parent, args, Class) {
5638
- var a = [null];
5639
- a.push.apply(a, args);
5640
- var Constructor = Function.bind.apply(Parent, a);
5641
- var instance = new Constructor();
5642
- if (Class) _setPrototypeOf(instance, Class.prototype);
5643
- return instance;
5644
- };
5645
- }
5646
- return _construct.apply(null, arguments);
5647
- }
5648
- function _isNativeFunction(fn) {
5649
- return Function.toString.call(fn).indexOf("[native code]") !== -1;
5650
- }
5651
5683
  function _wrapNativeSuper(Class) {
5652
5684
  var _cache = typeof Map === "function" ? new Map() : undefined;
5653
5685
  _wrapNativeSuper = function _wrapNativeSuper(Class) {
@@ -5686,45 +5718,6 @@ $\
5686
5718
  default: obj
5687
5719
  };
5688
5720
  }
5689
- function _getRequireWildcardCache(nodeInterop) {
5690
- if (typeof WeakMap !== "function") return null;
5691
- var cacheBabelInterop = new WeakMap();
5692
- var cacheNodeInterop = new WeakMap();
5693
- return (_getRequireWildcardCache = function (nodeInterop) {
5694
- return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
5695
- })(nodeInterop);
5696
- }
5697
- function _interopRequireWildcard(obj, nodeInterop) {
5698
- if (!nodeInterop && obj && obj.__esModule) {
5699
- return obj;
5700
- }
5701
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
5702
- return {
5703
- default: obj
5704
- };
5705
- }
5706
- var cache = _getRequireWildcardCache(nodeInterop);
5707
- if (cache && cache.has(obj)) {
5708
- return cache.get(obj);
5709
- }
5710
- var newObj = {};
5711
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
5712
- for (var key in obj) {
5713
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
5714
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
5715
- if (desc && (desc.get || desc.set)) {
5716
- Object.defineProperty(newObj, key, desc);
5717
- } else {
5718
- newObj[key] = obj[key];
5719
- }
5720
- }
5721
- }
5722
- newObj.default = obj;
5723
- if (cache) {
5724
- cache.set(obj, newObj);
5725
- }
5726
- return newObj;
5727
- }
5728
5721
  function _newArrowCheck(innerThis, boundThis) {
5729
5722
  if (innerThis !== boundThis) {
5730
5723
  throw new TypeError("Cannot instantiate an arrow function");
@@ -6005,20 +5998,6 @@ $\
6005
5998
  return it;
6006
5999
  };
6007
6000
  }
6008
- function _toPrimitive(input, hint) {
6009
- if (typeof input !== "object" || input === null) return input;
6010
- var prim = input[Symbol.toPrimitive];
6011
- if (prim !== undefined) {
6012
- var res = prim.call(input, hint || "default");
6013
- if (typeof res !== "object") return res;
6014
- throw new TypeError("@@toPrimitive must return a primitive value.");
6015
- }
6016
- return (hint === "string" ? String : Number)(input);
6017
- }
6018
- function _toPropertyKey(arg) {
6019
- var key = _toPrimitive(arg, "string");
6020
- return typeof key === "symbol" ? key : String(key);
6021
- }
6022
6001
  function _initializerWarningHelper(descriptor, context) {
6023
6002
  throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.');
6024
6003
  }
@@ -6650,6 +6629,11 @@ $\
6650
6629
  this.attributes = Hash.box(attributes);
6651
6630
  this.didChangeAttributes();
6652
6631
  }
6632
+ setAttribute(attribute, value) {
6633
+ this.setAttributes({
6634
+ [attribute]: value
6635
+ });
6636
+ }
6653
6637
  getAttribute(attribute) {
6654
6638
  return this.attributes.get(attribute);
6655
6639
  }
@@ -8889,6 +8873,8 @@ $\
8889
8873
  ManagedAttachment.proxyMethod("attachment.isPending");
8890
8874
  ManagedAttachment.proxyMethod("attachment.isPreviewable");
8891
8875
  ManagedAttachment.proxyMethod("attachment.getURL");
8876
+ ManagedAttachment.proxyMethod("attachment.getPreviewURL");
8877
+ ManagedAttachment.proxyMethod("attachment.setPreviewURL");
8892
8878
  ManagedAttachment.proxyMethod("attachment.getHref");
8893
8879
  ManagedAttachment.proxyMethod("attachment.getFilename");
8894
8880
  ManagedAttachment.proxyMethod("attachment.getFilesize");
@@ -10062,6 +10048,15 @@ $\
10062
10048
  } else {
10063
10049
  if (node.parentNode === container) {
10064
10050
  if (childIndex++ === offset) {
10051
+ if (!strict && nodeIsBlockStart(node, {
10052
+ strict
10053
+ })) {
10054
+ if (foundBlock) {
10055
+ location.index++;
10056
+ }
10057
+ location.offset = 0;
10058
+ foundBlock = true;
10059
+ }
10065
10060
  break;
10066
10061
  }
10067
10062
  } else if (!elementContainsNode(container, node)) {
@@ -13282,6 +13277,22 @@ $\
13282
13277
  this.innerHTML = toolbar.getDefaultHTML();
13283
13278
  }
13284
13279
  }
13280
+
13281
+ // Properties
13282
+
13283
+ get editorElements() {
13284
+ if (this.id) {
13285
+ var _this$ownerDocument;
13286
+ const nodeList = (_this$ownerDocument = this.ownerDocument) === null || _this$ownerDocument === void 0 ? void 0 : _this$ownerDocument.querySelectorAll("trix-editor[toolbar=\"".concat(this.id, "\"]"));
13287
+ return Array.from(nodeList);
13288
+ } else {
13289
+ return [];
13290
+ }
13291
+ }
13292
+ get editorElement() {
13293
+ const [editorElement] = this.editorElements;
13294
+ return editorElement;
13295
+ }
13285
13296
  }
13286
13297
 
13287
13298
  let id = 0;
@@ -13299,7 +13310,7 @@ $\
13299
13310
  if (element.hasAttribute("contenteditable")) {
13300
13311
  return;
13301
13312
  }
13302
- element.setAttribute("contenteditable", "");
13313
+ element.toggleAttribute("contenteditable", !element.disabled);
13303
13314
  return handleEventOnce("focus", {
13304
13315
  onElement: element,
13305
13316
  withCallback() {
@@ -13380,27 +13391,42 @@ $\
13380
13391
  }();
13381
13392
  installDefaultCSSForTagName("trix-editor", "%t {\n display: block;\n}\n\n%t:empty::before {\n content: attr(placeholder);\n color: graytext;\n cursor: text;\n pointer-events: none;\n white-space: pre-line;\n}\n\n%t a[contenteditable=false] {\n cursor: text;\n}\n\n%t img {\n max-width: 100%;\n height: auto;\n}\n\n%t ".concat(attachmentSelector, " figcaption textarea {\n resize: none;\n}\n\n%t ").concat(attachmentSelector, " figcaption textarea.trix-autoresize-clone {\n position: absolute;\n left: -9999px;\n max-height: 0px;\n}\n\n%t ").concat(attachmentSelector, " figcaption[data-trix-placeholder]:empty::before {\n content: attr(data-trix-placeholder);\n color: graytext;\n}\n\n%t [data-trix-cursor-target] {\n display: ").concat(cursorTargetStyles.display, " !important;\n width: ").concat(cursorTargetStyles.width, " !important;\n padding: 0 !important;\n margin: 0 !important;\n border: none !important;\n}\n\n%t [data-trix-cursor-target=left] {\n vertical-align: top !important;\n margin-left: -1px !important;\n}\n\n%t [data-trix-cursor-target=right] {\n vertical-align: bottom !important;\n margin-right: -1px !important;\n}"));
13382
13393
  var _internals = /*#__PURE__*/new WeakMap();
13394
+ var _formDisabled = /*#__PURE__*/new WeakMap();
13383
13395
  var _validate = /*#__PURE__*/new WeakSet();
13384
13396
  class ElementInternalsDelegate {
13385
13397
  constructor(element) {
13386
13398
  _classPrivateMethodInitSpec(this, _validate);
13399
+ _defineProperty(this, "value", "");
13387
13400
  _classPrivateFieldInitSpec(this, _internals, {
13388
13401
  writable: true,
13389
13402
  value: void 0
13390
13403
  });
13404
+ _classPrivateFieldInitSpec(this, _formDisabled, {
13405
+ writable: true,
13406
+ value: void 0
13407
+ });
13391
13408
  this.element = element;
13392
13409
  _classPrivateFieldSet(this, _internals, element.attachInternals());
13410
+ _classPrivateFieldSet(this, _formDisabled, false);
13393
13411
  }
13394
13412
  connectedCallback() {
13395
13413
  _classPrivateMethodGet(this, _validate, _validate2).call(this);
13396
13414
  }
13397
13415
  disconnectedCallback() {}
13416
+ get form() {
13417
+ return _classPrivateFieldGet(this, _internals).form;
13418
+ }
13419
+ get name() {
13420
+ return this.element.getAttribute("name");
13421
+ }
13422
+ set name(value) {
13423
+ this.element.setAttribute("name", value);
13424
+ }
13398
13425
  get labels() {
13399
13426
  return _classPrivateFieldGet(this, _internals).labels;
13400
13427
  }
13401
13428
  get disabled() {
13402
- var _this$element$inputEl;
13403
- return (_this$element$inputEl = this.element.inputElement) === null || _this$element$inputEl === void 0 ? void 0 : _this$element$inputEl.disabled;
13429
+ return _classPrivateFieldGet(this, _formDisabled) || this.element.hasAttribute("disabled");
13404
13430
  }
13405
13431
  set disabled(value) {
13406
13432
  this.element.toggleAttribute("disabled", value);
@@ -13421,8 +13447,13 @@ $\
13421
13447
  get willValidate() {
13422
13448
  return _classPrivateFieldGet(this, _internals).willValidate;
13423
13449
  }
13450
+ formDisabledCallback(disabled) {
13451
+ _classPrivateFieldSet(this, _formDisabled, disabled);
13452
+ }
13424
13453
  setFormValue(value) {
13454
+ this.value = value;
13425
13455
  _classPrivateMethodGet(this, _validate, _validate2).call(this);
13456
+ _classPrivateFieldGet(this, _internals).setFormValue(this.element.disabled ? undefined : this.value);
13426
13457
  }
13427
13458
  checkValidity() {
13428
13459
  return _classPrivateFieldGet(this, _internals).checkValidity();
@@ -13509,6 +13540,17 @@ $\
13509
13540
  }
13510
13541
  return labels;
13511
13542
  }
13543
+ get form() {
13544
+ console.warn("This browser does not support the .form property for trix-editor elements.");
13545
+ return null;
13546
+ }
13547
+ get name() {
13548
+ console.warn("This browser does not support the .name property for trix-editor elements.");
13549
+ return null;
13550
+ }
13551
+ set name(value) {
13552
+ console.warn("This browser does not support the .name property for trix-editor elements.");
13553
+ }
13512
13554
  get disabled() {
13513
13555
  console.warn("This browser does not support the [disabled] attribute for trix-editor elements.");
13514
13556
  return false;
@@ -13535,6 +13577,7 @@ $\
13535
13577
  console.warn("This browser does not support the willValidate property for trix-editor elements.");
13536
13578
  return false;
13537
13579
  }
13580
+ formDisabledCallback(value) {}
13538
13581
  setFormValue(value) {}
13539
13582
  checkValidity() {
13540
13583
  console.warn("This browser does not support checkValidity() for trix-editor elements.");
@@ -13556,6 +13599,7 @@ $\
13556
13599
  writable: true,
13557
13600
  value: void 0
13558
13601
  });
13602
+ this.willCreateInput = true;
13559
13603
  _classPrivateFieldSet(this, _delegate, this.constructor.formAssociated ? new ElementInternalsDelegate(this) : new LegacyDelegate(this));
13560
13604
  }
13561
13605
 
@@ -13573,9 +13617,22 @@ $\
13573
13617
  return _classPrivateFieldGet(this, _delegate).labels;
13574
13618
  }
13575
13619
  get disabled() {
13576
- return _classPrivateFieldGet(this, _delegate).disabled;
13620
+ const {
13621
+ inputElement
13622
+ } = this;
13623
+ if (inputElement) {
13624
+ return inputElement.disabled;
13625
+ } else {
13626
+ return _classPrivateFieldGet(this, _delegate).disabled;
13627
+ }
13577
13628
  }
13578
13629
  set disabled(value) {
13630
+ const {
13631
+ inputElement
13632
+ } = this;
13633
+ if (inputElement) {
13634
+ inputElement.disabled = value;
13635
+ }
13579
13636
  _classPrivateFieldGet(this, _delegate).disabled = value;
13580
13637
  }
13581
13638
  get required() {
@@ -13613,22 +13670,19 @@ $\
13613
13670
  }
13614
13671
  }
13615
13672
  get form() {
13616
- var _this$inputElement;
13617
- return (_this$inputElement = this.inputElement) === null || _this$inputElement === void 0 ? void 0 : _this$inputElement.form;
13673
+ const {
13674
+ inputElement
13675
+ } = this;
13676
+ if (inputElement) {
13677
+ return inputElement.form;
13678
+ } else {
13679
+ return _classPrivateFieldGet(this, _delegate).form;
13680
+ }
13618
13681
  }
13619
13682
  get inputElement() {
13620
13683
  if (this.hasAttribute("input")) {
13621
13684
  var _this$ownerDocument2;
13622
13685
  return (_this$ownerDocument2 = this.ownerDocument) === null || _this$ownerDocument2 === void 0 ? void 0 : _this$ownerDocument2.getElementById(this.getAttribute("input"));
13623
- } else if (this.parentNode) {
13624
- const inputId = "trix-input-".concat(this.trixId);
13625
- this.setAttribute("input", inputId);
13626
- const element = makeElement("input", {
13627
- type: "hidden",
13628
- id: inputId
13629
- });
13630
- this.parentNode.insertBefore(element, this.nextElementSibling);
13631
- return element;
13632
13686
  } else {
13633
13687
  return undefined;
13634
13688
  }
@@ -13638,12 +13692,34 @@ $\
13638
13692
  return (_this$editorControlle = this.editorController) === null || _this$editorControlle === void 0 ? void 0 : _this$editorControlle.editor;
13639
13693
  }
13640
13694
  get name() {
13641
- var _this$inputElement2;
13642
- return (_this$inputElement2 = this.inputElement) === null || _this$inputElement2 === void 0 ? void 0 : _this$inputElement2.name;
13695
+ const {
13696
+ inputElement
13697
+ } = this;
13698
+ if (inputElement) {
13699
+ return inputElement.name;
13700
+ } else {
13701
+ return _classPrivateFieldGet(this, _delegate).name;
13702
+ }
13703
+ }
13704
+ set name(value) {
13705
+ const {
13706
+ inputElement
13707
+ } = this;
13708
+ if (inputElement) {
13709
+ inputElement.name = value;
13710
+ } else {
13711
+ _classPrivateFieldGet(this, _delegate).name = value;
13712
+ }
13643
13713
  }
13644
13714
  get value() {
13645
- var _this$inputElement3;
13646
- return (_this$inputElement3 = this.inputElement) === null || _this$inputElement3 === void 0 ? void 0 : _this$inputElement3.value;
13715
+ const {
13716
+ inputElement
13717
+ } = this;
13718
+ if (inputElement) {
13719
+ return inputElement.value;
13720
+ } else {
13721
+ return _classPrivateFieldGet(this, _delegate).value;
13722
+ }
13647
13723
  }
13648
13724
  set value(defaultValue) {
13649
13725
  var _this$editor;
@@ -13670,10 +13746,13 @@ $\
13670
13746
  }
13671
13747
  }
13672
13748
  setFormValue(value) {
13673
- if (this.inputElement) {
13674
- this.inputElement.value = value;
13675
- _classPrivateFieldGet(this, _delegate).setFormValue(value);
13749
+ const {
13750
+ inputElement
13751
+ } = this;
13752
+ if (inputElement) {
13753
+ inputElement.value = value;
13676
13754
  }
13755
+ _classPrivateFieldGet(this, _delegate).setFormValue(value);
13677
13756
  }
13678
13757
 
13679
13758
  // Element lifecycle
@@ -13686,9 +13765,19 @@ $\
13686
13765
  triggerEvent("trix-before-initialize", {
13687
13766
  onElement: this
13688
13767
  });
13768
+ this.defaultValue = this.inputElement ? this.inputElement.value : this.innerHTML;
13769
+ if (!this.hasAttribute("input") && this.parentNode && this.willCreateInput) {
13770
+ const inputId = "trix-input-".concat(this.trixId);
13771
+ this.setAttribute("input", inputId);
13772
+ const element = makeElement("input", {
13773
+ type: "hidden",
13774
+ id: inputId
13775
+ });
13776
+ this.parentNode.insertBefore(element, this.nextElementSibling);
13777
+ }
13689
13778
  this.editorController = new EditorController({
13690
13779
  editorElement: this,
13691
- html: this.defaultValue = this.value
13780
+ html: this.defaultValue
13692
13781
  });
13693
13782
  requestAnimationFrame(() => triggerEvent("trix-initialize", {
13694
13783
  onElement: this
@@ -13729,10 +13818,14 @@ $\
13729
13818
  _classPrivateFieldGet(this, _delegate).setCustomValidity(validationMessage);
13730
13819
  }
13731
13820
  formDisabledCallback(disabled) {
13732
- if (this.inputElement) {
13733
- this.inputElement.disabled = disabled;
13821
+ const {
13822
+ inputElement
13823
+ } = this;
13824
+ if (inputElement) {
13825
+ inputElement.disabled = disabled;
13734
13826
  }
13735
13827
  this.toggleAttribute("contenteditable", !disabled);
13828
+ _classPrivateFieldGet(this, _delegate).formDisabledCallback(disabled);
13736
13829
  }
13737
13830
  formResetCallback() {
13738
13831
  this.reset();