action_text-trix 2.1.15 → 2.1.16
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.
- checksums.yaml +4 -4
- data/app/assets/javascripts/trix.js +583 -504
- data/lib/action_text/trix/version.rb +1 -1
- metadata +3 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Trix 2.1.
|
|
2
|
+
Trix 2.1.16
|
|
3
3
|
Copyright © 2025 37signals, LLC
|
|
4
4
|
*/
|
|
5
5
|
(function (global, 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.
|
|
12
|
+
var version = "2.1.16";
|
|
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";
|
|
@@ -48,6 +48,7 @@ Copyright © 2025 37signals, LLC
|
|
|
48
48
|
concurrently: "^7.4.0",
|
|
49
49
|
eslint: "^7.32.0",
|
|
50
50
|
esm: "^3.2.25",
|
|
51
|
+
idiomorph: "^0.7.3",
|
|
51
52
|
karma: "6.4.1",
|
|
52
53
|
"karma-chrome-launcher": "3.2.0",
|
|
53
54
|
"karma-qunit": "^4.1.2",
|
|
@@ -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",
|
|
@@ -74,6 +75,7 @@ Copyright © 2025 37signals, LLC
|
|
|
74
75
|
lint: "eslint .",
|
|
75
76
|
pretest: "yarn run lint && yarn run build",
|
|
76
77
|
test: "karma start",
|
|
78
|
+
version: "yarn build && git add action_text-trix",
|
|
77
79
|
prerelease: "yarn version && yarn test",
|
|
78
80
|
"release-npm": "npm adduser && npm publish",
|
|
79
81
|
"release-ruby": "rake -C action_text-trix release",
|
|
@@ -85,6 +87,9 @@ Copyright © 2025 37signals, LLC
|
|
|
85
87
|
var dependencies = {
|
|
86
88
|
dompurify: "^3.2.5"
|
|
87
89
|
};
|
|
90
|
+
var engines = {
|
|
91
|
+
node: ">= 18"
|
|
92
|
+
};
|
|
88
93
|
var _package = {
|
|
89
94
|
name: name,
|
|
90
95
|
version: version,
|
|
@@ -102,7 +107,8 @@ Copyright © 2025 37signals, LLC
|
|
|
102
107
|
devDependencies: devDependencies,
|
|
103
108
|
resolutions: resolutions,
|
|
104
109
|
scripts: scripts,
|
|
105
|
-
dependencies: dependencies
|
|
110
|
+
dependencies: dependencies,
|
|
111
|
+
engines: engines
|
|
106
112
|
};
|
|
107
113
|
|
|
108
114
|
const attachmentSelector = "[data-trix-attachment]";
|
|
@@ -326,14 +332,12 @@ Copyright © 2025 37signals, LLC
|
|
|
326
332
|
options.times = 1;
|
|
327
333
|
return handleEvent(eventName, options);
|
|
328
334
|
};
|
|
329
|
-
const
|
|
335
|
+
const createEvent = function (eventName) {
|
|
330
336
|
let {
|
|
331
|
-
onElement,
|
|
332
337
|
bubbles,
|
|
333
338
|
cancelable,
|
|
334
339
|
attributes
|
|
335
340
|
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
336
|
-
const element = onElement != null ? onElement : html$2;
|
|
337
341
|
bubbles = bubbles !== false;
|
|
338
342
|
cancelable = cancelable !== false;
|
|
339
343
|
const event = document.createEvent("Events");
|
|
@@ -341,6 +345,21 @@ Copyright © 2025 37signals, LLC
|
|
|
341
345
|
if (attributes != null) {
|
|
342
346
|
extend.call(event, attributes);
|
|
343
347
|
}
|
|
348
|
+
return event;
|
|
349
|
+
};
|
|
350
|
+
const triggerEvent = function (eventName) {
|
|
351
|
+
let {
|
|
352
|
+
onElement,
|
|
353
|
+
bubbles,
|
|
354
|
+
cancelable,
|
|
355
|
+
attributes
|
|
356
|
+
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
357
|
+
const element = onElement != null ? onElement : html$2;
|
|
358
|
+
const event = createEvent(eventName, {
|
|
359
|
+
bubbles,
|
|
360
|
+
cancelable,
|
|
361
|
+
attributes
|
|
362
|
+
});
|
|
344
363
|
return element.dispatchEvent(event);
|
|
345
364
|
};
|
|
346
365
|
const elementMatchesSelector = function (element, selector) {
|
|
@@ -1745,7 +1764,7 @@ $\
|
|
|
1745
1764
|
}
|
|
1746
1765
|
}
|
|
1747
1766
|
|
|
1748
|
-
/*! @license DOMPurify 3.2.
|
|
1767
|
+
/*! @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
1768
|
|
|
1750
1769
|
const {
|
|
1751
1770
|
entries,
|
|
@@ -1774,12 +1793,18 @@ $\
|
|
|
1774
1793
|
};
|
|
1775
1794
|
}
|
|
1776
1795
|
if (!apply) {
|
|
1777
|
-
apply = function apply(
|
|
1778
|
-
|
|
1796
|
+
apply = function apply(func, thisArg) {
|
|
1797
|
+
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
1798
|
+
args[_key - 2] = arguments[_key];
|
|
1799
|
+
}
|
|
1800
|
+
return func.apply(thisArg, args);
|
|
1779
1801
|
};
|
|
1780
1802
|
}
|
|
1781
1803
|
if (!construct) {
|
|
1782
|
-
construct = function construct(Func
|
|
1804
|
+
construct = function construct(Func) {
|
|
1805
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
1806
|
+
args[_key2 - 1] = arguments[_key2];
|
|
1807
|
+
}
|
|
1783
1808
|
return new Func(...args);
|
|
1784
1809
|
};
|
|
1785
1810
|
}
|
|
@@ -1808,8 +1833,8 @@ $\
|
|
|
1808
1833
|
if (thisArg instanceof RegExp) {
|
|
1809
1834
|
thisArg.lastIndex = 0;
|
|
1810
1835
|
}
|
|
1811
|
-
for (var
|
|
1812
|
-
args[
|
|
1836
|
+
for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
|
|
1837
|
+
args[_key3 - 1] = arguments[_key3];
|
|
1813
1838
|
}
|
|
1814
1839
|
return apply(func, thisArg, args);
|
|
1815
1840
|
};
|
|
@@ -1820,12 +1845,12 @@ $\
|
|
|
1820
1845
|
* @param func - The constructor function to be wrapped and called.
|
|
1821
1846
|
* @returns A new function that constructs an instance of the given constructor function with the provided arguments.
|
|
1822
1847
|
*/
|
|
1823
|
-
function unconstruct(
|
|
1848
|
+
function unconstruct(Func) {
|
|
1824
1849
|
return function () {
|
|
1825
|
-
for (var
|
|
1826
|
-
args[
|
|
1850
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
1851
|
+
args[_key4] = arguments[_key4];
|
|
1827
1852
|
}
|
|
1828
|
-
return construct(
|
|
1853
|
+
return construct(Func, args);
|
|
1829
1854
|
};
|
|
1830
1855
|
}
|
|
1831
1856
|
/**
|
|
@@ -1923,8 +1948,8 @@ $\
|
|
|
1923
1948
|
}
|
|
1924
1949
|
return fallbackValue;
|
|
1925
1950
|
}
|
|
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']);
|
|
1951
|
+
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']);
|
|
1952
|
+
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
1953
|
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
1954
|
// List of SVG elements that are disallowed by default.
|
|
1930
1955
|
// We still need to know them so that we can do namespace
|
|
@@ -1936,7 +1961,7 @@ $\
|
|
|
1936
1961
|
// even those that we disallow by default.
|
|
1937
1962
|
const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);
|
|
1938
1963
|
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']);
|
|
1964
|
+
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
1965
|
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
1966
|
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
1967
|
const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
|
|
@@ -1947,13 +1972,11 @@ $\
|
|
|
1947
1972
|
const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm); // eslint-disable-line unicorn/better-regex
|
|
1948
1973
|
const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); // eslint-disable-line no-useless-escape
|
|
1949
1974
|
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
|
|
1975
|
+
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
1976
|
);
|
|
1952
|
-
|
|
1953
1977
|
const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
|
|
1954
1978
|
const ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex
|
|
1955
1979
|
);
|
|
1956
|
-
|
|
1957
1980
|
const DOCTYPE_NAME = seal(/^html$/i);
|
|
1958
1981
|
const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
1959
1982
|
var EXPRESSIONS = /*#__PURE__*/Object.freeze({
|
|
@@ -1988,7 +2011,6 @@ $\
|
|
|
1988
2011
|
documentFragment: 11,
|
|
1989
2012
|
notation: 12 // Deprecated
|
|
1990
2013
|
};
|
|
1991
|
-
|
|
1992
2014
|
const getGlobal = function getGlobal() {
|
|
1993
2015
|
return typeof window === 'undefined' ? null : window;
|
|
1994
2016
|
};
|
|
@@ -2046,7 +2068,7 @@ $\
|
|
|
2046
2068
|
function createDOMPurify() {
|
|
2047
2069
|
let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
|
|
2048
2070
|
const DOMPurify = root => createDOMPurify(root);
|
|
2049
|
-
DOMPurify.version = '3.2.
|
|
2071
|
+
DOMPurify.version = '3.2.7';
|
|
2050
2072
|
DOMPurify.removed = [];
|
|
2051
2073
|
if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
|
|
2052
2074
|
// Not running in a browser, provide a factory function
|
|
@@ -2285,8 +2307,8 @@ $\
|
|
|
2285
2307
|
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
2308
|
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
2309
|
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) : {};
|
|
2310
|
+
FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : clone({});
|
|
2311
|
+
FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : clone({});
|
|
2290
2312
|
USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false;
|
|
2291
2313
|
ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true
|
|
2292
2314
|
ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true
|
|
@@ -2651,7 +2673,7 @@ $\
|
|
|
2651
2673
|
allowedTags: ALLOWED_TAGS
|
|
2652
2674
|
});
|
|
2653
2675
|
/* Detect mXSS attempts abusing namespace confusion */
|
|
2654
|
-
if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w!]/g, currentNode.innerHTML) && regExpTest(/<[/\w!]/g, currentNode.textContent)) {
|
|
2676
|
+
if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w!]/g, currentNode.innerHTML) && regExpTest(/<[/\w!]/g, currentNode.textContent)) {
|
|
2655
2677
|
_forceRemove(currentNode);
|
|
2656
2678
|
return true;
|
|
2657
2679
|
}
|
|
@@ -2743,7 +2765,7 @@ $\
|
|
|
2743
2765
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
2744
2766
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
2745
2767
|
// 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)) ||
|
|
2768
|
+
_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
2769
|
// Alternative, second condition checks if it's an `is`-attribute, AND
|
|
2748
2770
|
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
2749
2771
|
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 +2825,8 @@ $\
|
|
|
2803
2825
|
value: attrValue
|
|
2804
2826
|
} = attr;
|
|
2805
2827
|
const lcName = transformCaseFunc(name);
|
|
2806
|
-
|
|
2828
|
+
const initValue = attrValue;
|
|
2829
|
+
let value = name === 'value' ? initValue : stringTrim(initValue);
|
|
2807
2830
|
/* Execute a hook if present */
|
|
2808
2831
|
hookEvent.attrName = lcName;
|
|
2809
2832
|
hookEvent.attrValue = value;
|
|
@@ -2821,7 +2844,12 @@ $\
|
|
|
2821
2844
|
value = SANITIZE_NAMED_PROPS_PREFIX + value;
|
|
2822
2845
|
}
|
|
2823
2846
|
/* Work around a security issue with comments inside attributes */
|
|
2824
|
-
if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) {
|
|
2847
|
+
if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title|textarea)/i, value)) {
|
|
2848
|
+
_removeAttribute(name, currentNode);
|
|
2849
|
+
continue;
|
|
2850
|
+
}
|
|
2851
|
+
/* Make sure we cannot easily use animated hrefs, even if animations are allowed */
|
|
2852
|
+
if (lcName === 'attributename' && stringMatch(value, 'href')) {
|
|
2825
2853
|
_removeAttribute(name, currentNode);
|
|
2826
2854
|
continue;
|
|
2827
2855
|
}
|
|
@@ -2829,10 +2857,9 @@ $\
|
|
|
2829
2857
|
if (hookEvent.forceKeepAttr) {
|
|
2830
2858
|
continue;
|
|
2831
2859
|
}
|
|
2832
|
-
/* Remove attribute */
|
|
2833
|
-
_removeAttribute(name, currentNode);
|
|
2834
2860
|
/* Did the hooks approve of the attribute? */
|
|
2835
2861
|
if (!hookEvent.keepAttr) {
|
|
2862
|
+
_removeAttribute(name, currentNode);
|
|
2836
2863
|
continue;
|
|
2837
2864
|
}
|
|
2838
2865
|
/* Work around a security issue in jQuery 3.0 */
|
|
@@ -2849,6 +2876,7 @@ $\
|
|
|
2849
2876
|
/* Is `value` valid for this attribute? */
|
|
2850
2877
|
const lcTag = transformCaseFunc(currentNode.nodeName);
|
|
2851
2878
|
if (!_isValidAttribute(lcTag, lcName, value)) {
|
|
2879
|
+
_removeAttribute(name, currentNode);
|
|
2852
2880
|
continue;
|
|
2853
2881
|
}
|
|
2854
2882
|
/* Handle attributes that require Trusted Types */
|
|
@@ -2869,19 +2897,23 @@ $\
|
|
|
2869
2897
|
}
|
|
2870
2898
|
}
|
|
2871
2899
|
/* Handle invalid data-* attribute set by try-catching it */
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2900
|
+
if (value !== initValue) {
|
|
2901
|
+
try {
|
|
2902
|
+
if (namespaceURI) {
|
|
2903
|
+
currentNode.setAttributeNS(namespaceURI, name, value);
|
|
2904
|
+
} else {
|
|
2905
|
+
/* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
|
|
2906
|
+
currentNode.setAttribute(name, value);
|
|
2907
|
+
}
|
|
2908
|
+
if (_isClobbered(currentNode)) {
|
|
2909
|
+
_forceRemove(currentNode);
|
|
2910
|
+
} else {
|
|
2911
|
+
arrayPop(DOMPurify.removed);
|
|
2912
|
+
}
|
|
2913
|
+
} catch (_) {
|
|
2914
|
+
_removeAttribute(name, currentNode);
|
|
2883
2915
|
}
|
|
2884
|
-
}
|
|
2916
|
+
}
|
|
2885
2917
|
}
|
|
2886
2918
|
/* Execute a hook if present */
|
|
2887
2919
|
_executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
|
|
@@ -3331,7 +3363,10 @@ $\
|
|
|
3331
3363
|
}
|
|
3332
3364
|
getHref() {
|
|
3333
3365
|
if (!htmlContainsTagName(this.attachment.getContent(), "a")) {
|
|
3334
|
-
|
|
3366
|
+
const href = this.attachment.getHref();
|
|
3367
|
+
if (href && purify.isValidAttribute("a", "href", href)) {
|
|
3368
|
+
return href;
|
|
3369
|
+
}
|
|
3335
3370
|
}
|
|
3336
3371
|
}
|
|
3337
3372
|
getCaptionConfig() {
|
|
@@ -3420,12 +3455,16 @@ $\
|
|
|
3420
3455
|
}
|
|
3421
3456
|
const width = this.attachment.getWidth();
|
|
3422
3457
|
const height = this.attachment.getHeight();
|
|
3458
|
+
const alt = this.attachment.getAttribute("alt");
|
|
3423
3459
|
if (width != null) {
|
|
3424
3460
|
image.width = width;
|
|
3425
3461
|
}
|
|
3426
3462
|
if (height != null) {
|
|
3427
3463
|
image.height = height;
|
|
3428
3464
|
}
|
|
3465
|
+
if (alt != null) {
|
|
3466
|
+
image.alt = alt;
|
|
3467
|
+
}
|
|
3429
3468
|
const storeKey = ["imageElement", this.attachment.id, image.src, image.width, image.height].join("/");
|
|
3430
3469
|
image.dataset.trixStoreKey = storeKey;
|
|
3431
3470
|
}
|
|
@@ -3719,11 +3758,21 @@ $\
|
|
|
3719
3758
|
return elementsHaveEqualHTML(this.shadowElement, this.element);
|
|
3720
3759
|
}
|
|
3721
3760
|
sync() {
|
|
3761
|
+
const render = (element, documentFragment) => {
|
|
3762
|
+
while (element.lastChild) {
|
|
3763
|
+
element.removeChild(element.lastChild);
|
|
3764
|
+
}
|
|
3765
|
+
element.appendChild(documentFragment);
|
|
3766
|
+
};
|
|
3767
|
+
const event = createEvent("trix-before-render", {
|
|
3768
|
+
cancelable: false,
|
|
3769
|
+
attributes: {
|
|
3770
|
+
render
|
|
3771
|
+
}
|
|
3772
|
+
});
|
|
3773
|
+
this.element.dispatchEvent(event);
|
|
3722
3774
|
const fragment = this.createDocumentFragmentForSync();
|
|
3723
|
-
|
|
3724
|
-
this.element.removeChild(this.element.lastChild);
|
|
3725
|
-
}
|
|
3726
|
-
this.element.appendChild(fragment);
|
|
3775
|
+
event.render(this.element, fragment);
|
|
3727
3776
|
return this.didSync();
|
|
3728
3777
|
}
|
|
3729
3778
|
|
|
@@ -3891,7 +3940,7 @@ $\
|
|
|
3891
3940
|
u,
|
|
3892
3941
|
f = {
|
|
3893
3942
|
kind: c,
|
|
3894
|
-
name: l ? "#" + t : t,
|
|
3943
|
+
name: l ? "#" + t : _toPropertyKey(t),
|
|
3895
3944
|
isStatic: n,
|
|
3896
3945
|
isPrivate: l
|
|
3897
3946
|
},
|
|
@@ -3929,10 +3978,7 @@ $\
|
|
|
3929
3978
|
if (1 === e) {
|
|
3930
3979
|
if ("object" !== a || null === t) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
3931
3980
|
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
|
-
}
|
|
3981
|
+
} else if ("function" !== a) throw new TypeError((0 === e ? "field" : 10 === e ? "class" : "method") + " decorators must return a function or void 0");
|
|
3936
3982
|
}
|
|
3937
3983
|
function old_getInit(e) {
|
|
3938
3984
|
var t;
|
|
@@ -3945,28 +3991,29 @@ $\
|
|
|
3945
3991
|
f,
|
|
3946
3992
|
p,
|
|
3947
3993
|
v,
|
|
3994
|
+
y,
|
|
3948
3995
|
h = a[0];
|
|
3949
|
-
if (n ?
|
|
3996
|
+
if (n ? (0 === o || 1 === o ? (c = {
|
|
3950
3997
|
get: a[3],
|
|
3951
3998
|
set: a[4]
|
|
3952
|
-
} : 3 === o ? {
|
|
3999
|
+
}, u = "get") : 3 === o ? (c = {
|
|
3953
4000
|
get: a[3]
|
|
3954
|
-
} : 4 === o ? {
|
|
4001
|
+
}, u = "get") : 4 === o ? (c = {
|
|
3955
4002
|
set: a[3]
|
|
3956
|
-
} : {
|
|
4003
|
+
}, u = "set") : c = {
|
|
3957
4004
|
value: a[3]
|
|
3958
|
-
} : 0 !== o && (c = Object.getOwnPropertyDescriptor(t, r)), 1 === o ?
|
|
4005
|
+
}, 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
4006
|
get: c.get,
|
|
3960
4007
|
set: c.set
|
|
3961
|
-
} : 2 === o ?
|
|
3962
|
-
get:
|
|
3963
|
-
set:
|
|
3964
|
-
}) :
|
|
4008
|
+
} : 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 = {
|
|
4009
|
+
get: v,
|
|
4010
|
+
set: y
|
|
4011
|
+
}) : f = p);else for (var m = h.length - 1; m >= 0; m--) {
|
|
3965
4012
|
var b;
|
|
3966
|
-
|
|
3967
|
-
get:
|
|
3968
|
-
set:
|
|
3969
|
-
}) :
|
|
4013
|
+
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 = {
|
|
4014
|
+
get: v,
|
|
4015
|
+
set: y
|
|
4016
|
+
}) : f = p, void 0 !== b && (void 0 === d ? d = b : "function" == typeof d ? d = [d, b] : d.push(b)));
|
|
3970
4017
|
}
|
|
3971
4018
|
if (0 === o || 1 === o) {
|
|
3972
4019
|
if (void 0 === d) d = function (e, t) {
|
|
@@ -3978,19 +4025,19 @@ $\
|
|
|
3978
4025
|
return a;
|
|
3979
4026
|
};
|
|
3980
4027
|
} else {
|
|
3981
|
-
var
|
|
4028
|
+
var _ = d;
|
|
3982
4029
|
d = function (e, t) {
|
|
3983
|
-
return
|
|
4030
|
+
return _.call(e, t);
|
|
3984
4031
|
};
|
|
3985
4032
|
}
|
|
3986
4033
|
e.push(d);
|
|
3987
4034
|
}
|
|
3988
|
-
0 !== o && (1 === o ? (c.get =
|
|
3989
|
-
return
|
|
4035
|
+
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) {
|
|
4036
|
+
return f.get.call(e, t);
|
|
3990
4037
|
}), e.push(function (e, t) {
|
|
3991
|
-
return
|
|
3992
|
-
})) : 2 === o ? e.push(
|
|
3993
|
-
return
|
|
4038
|
+
return f.set.call(e, t);
|
|
4039
|
+
})) : 2 === o ? e.push(f) : e.push(function (e, t) {
|
|
4040
|
+
return f.call(e, t);
|
|
3994
4041
|
}) : Object.defineProperty(t, r, c));
|
|
3995
4042
|
}
|
|
3996
4043
|
function old_applyMemberDecs(e, t, a, r, o) {
|
|
@@ -4001,16 +4048,16 @@ $\
|
|
|
4001
4048
|
f,
|
|
4002
4049
|
p,
|
|
4003
4050
|
v = d[1],
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
if (
|
|
4008
|
-
var
|
|
4009
|
-
|
|
4010
|
-
if (!0 ===
|
|
4011
|
-
!
|
|
4051
|
+
y = d[2],
|
|
4052
|
+
h = d.length > 3,
|
|
4053
|
+
m = v >= 5;
|
|
4054
|
+
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) {
|
|
4055
|
+
var b = m ? s : l,
|
|
4056
|
+
g = b.get(y) || 0;
|
|
4057
|
+
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);
|
|
4058
|
+
!g && v > 2 ? b.set(y, v) : b.set(y, !0);
|
|
4012
4059
|
}
|
|
4013
|
-
old_applyMemberDec(e, u, d,
|
|
4060
|
+
old_applyMemberDec(e, u, d, y, v, m, h, f, p);
|
|
4014
4061
|
}
|
|
4015
4062
|
}
|
|
4016
4063
|
old_pushInitializers(e, i), old_pushInitializers(e, n);
|
|
@@ -4054,8 +4101,8 @@ $\
|
|
|
4054
4101
|
function createAddInitializerMethod(e, t) {
|
|
4055
4102
|
return function (r) {
|
|
4056
4103
|
!function (e, t) {
|
|
4057
|
-
if (e.v) throw new Error("attempted to call
|
|
4058
|
-
}(t
|
|
4104
|
+
if (e.v) throw new Error("attempted to call addInitializer after decoration was finished");
|
|
4105
|
+
}(t), assertCallable(r, "An initializer"), e.push(r);
|
|
4059
4106
|
};
|
|
4060
4107
|
}
|
|
4061
4108
|
function memberDec(e, t, r, a, n, i, s, o) {
|
|
@@ -4119,10 +4166,7 @@ $\
|
|
|
4119
4166
|
if (1 === e) {
|
|
4120
4167
|
if ("object" !== r || null === t) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
4121
4168
|
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
|
-
}
|
|
4169
|
+
} else if ("function" !== r) throw new TypeError((0 === e ? "field" : 10 === e ? "class" : "method") + " decorators must return a function or void 0");
|
|
4126
4170
|
}
|
|
4127
4171
|
function applyMemberDec(e, t, r, a, n, i, s, o) {
|
|
4128
4172
|
var c,
|
|
@@ -4149,10 +4193,10 @@ $\
|
|
|
4149
4193
|
set: d
|
|
4150
4194
|
}) : u = f);else for (var v = h.length - 1; v >= 0; v--) {
|
|
4151
4195
|
var g;
|
|
4152
|
-
|
|
4196
|
+
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
4197
|
get: p,
|
|
4154
4198
|
set: d
|
|
4155
|
-
}) : u = f, void 0 !== g && (void 0 === l ? l = g : "function" == typeof l ? l = [l, g] : l.push(g));
|
|
4199
|
+
}) : u = f, void 0 !== g && (void 0 === l ? l = g : "function" == typeof l ? l = [l, g] : l.push(g)));
|
|
4156
4200
|
}
|
|
4157
4201
|
if (0 === n || 1 === n) {
|
|
4158
4202
|
if (void 0 === l) l = function (e, t) {
|
|
@@ -4239,11 +4283,11 @@ $\
|
|
|
4239
4283
|
function createAddInitializerMethod(e, t) {
|
|
4240
4284
|
return function (r) {
|
|
4241
4285
|
!function (e, t) {
|
|
4242
|
-
if (e.v) throw new Error("attempted to call
|
|
4243
|
-
}(t
|
|
4286
|
+
if (e.v) throw new Error("attempted to call addInitializer after decoration was finished");
|
|
4287
|
+
}(t), assertCallable(r, "An initializer"), e.push(r);
|
|
4244
4288
|
};
|
|
4245
4289
|
}
|
|
4246
|
-
function memberDec(e, t, r, n, a, i,
|
|
4290
|
+
function memberDec(e, t, r, n, a, i, o, s) {
|
|
4247
4291
|
var c;
|
|
4248
4292
|
switch (a) {
|
|
4249
4293
|
case 1:
|
|
@@ -4265,14 +4309,14 @@ $\
|
|
|
4265
4309
|
u,
|
|
4266
4310
|
f = {
|
|
4267
4311
|
kind: c,
|
|
4268
|
-
name:
|
|
4312
|
+
name: o ? "#" + t : _toPropertyKey(t),
|
|
4269
4313
|
static: i,
|
|
4270
|
-
private:
|
|
4314
|
+
private: o
|
|
4271
4315
|
},
|
|
4272
4316
|
p = {
|
|
4273
4317
|
v: !1
|
|
4274
4318
|
};
|
|
4275
|
-
0 !== a && (f.addInitializer = createAddInitializerMethod(n, p)), 0 === a ?
|
|
4319
|
+
0 !== a && (f.addInitializer = createAddInitializerMethod(n, p)), 0 === a ? o ? (l = r.get, u = r.set) : (l = function () {
|
|
4276
4320
|
return this[t];
|
|
4277
4321
|
}, u = function (e) {
|
|
4278
4322
|
this[t] = e;
|
|
@@ -4291,7 +4335,7 @@ $\
|
|
|
4291
4335
|
set: u
|
|
4292
4336
|
};
|
|
4293
4337
|
try {
|
|
4294
|
-
return e(
|
|
4338
|
+
return e(s, f);
|
|
4295
4339
|
} finally {
|
|
4296
4340
|
p.v = !0;
|
|
4297
4341
|
}
|
|
@@ -4304,69 +4348,67 @@ $\
|
|
|
4304
4348
|
if (1 === e) {
|
|
4305
4349
|
if ("object" !== r || null === t) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
4306
4350
|
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
|
-
}
|
|
4351
|
+
} else if ("function" !== r) throw new TypeError((0 === e ? "field" : 10 === e ? "class" : "method") + " decorators must return a function or void 0");
|
|
4311
4352
|
}
|
|
4312
|
-
function applyMemberDec(e, t, r, n, a, i,
|
|
4353
|
+
function applyMemberDec(e, t, r, n, a, i, o, s) {
|
|
4313
4354
|
var c,
|
|
4314
4355
|
l,
|
|
4315
4356
|
u,
|
|
4316
4357
|
f,
|
|
4317
4358
|
p,
|
|
4318
4359
|
d,
|
|
4319
|
-
h
|
|
4320
|
-
|
|
4360
|
+
h,
|
|
4361
|
+
v = r[0];
|
|
4362
|
+
if (o ? (0 === a || 1 === a ? (c = {
|
|
4321
4363
|
get: r[3],
|
|
4322
4364
|
set: r[4]
|
|
4323
|
-
} : 3 === a ? {
|
|
4365
|
+
}, u = "get") : 3 === a ? (c = {
|
|
4324
4366
|
get: r[3]
|
|
4325
|
-
} : 4 === a ? {
|
|
4367
|
+
}, u = "get") : 4 === a ? (c = {
|
|
4326
4368
|
set: r[3]
|
|
4327
|
-
} : {
|
|
4369
|
+
}, u = "set") : c = {
|
|
4328
4370
|
value: r[3]
|
|
4329
|
-
} : 0 !== a && (c = Object.getOwnPropertyDescriptor(t, n)), 1 === a ?
|
|
4371
|
+
}, 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
4372
|
get: c.get,
|
|
4331
4373
|
set: c.set
|
|
4332
|
-
} : 2 === a ?
|
|
4333
|
-
get:
|
|
4334
|
-
set:
|
|
4335
|
-
}) :
|
|
4336
|
-
var
|
|
4337
|
-
|
|
4338
|
-
get:
|
|
4339
|
-
set:
|
|
4340
|
-
}) :
|
|
4374
|
+
} : 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 = {
|
|
4375
|
+
get: d,
|
|
4376
|
+
set: h
|
|
4377
|
+
}) : f = p);else for (var g = v.length - 1; g >= 0; g--) {
|
|
4378
|
+
var y;
|
|
4379
|
+
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 = {
|
|
4380
|
+
get: d,
|
|
4381
|
+
set: h
|
|
4382
|
+
}) : f = p, void 0 !== y && (void 0 === l ? l = y : "function" == typeof l ? l = [l, y] : l.push(y)));
|
|
4341
4383
|
}
|
|
4342
4384
|
if (0 === a || 1 === a) {
|
|
4343
4385
|
if (void 0 === l) l = function (e, t) {
|
|
4344
4386
|
return t;
|
|
4345
4387
|
};else if ("function" != typeof l) {
|
|
4346
|
-
var
|
|
4388
|
+
var m = l;
|
|
4347
4389
|
l = function (e, t) {
|
|
4348
|
-
for (var r = t, n = 0; n <
|
|
4390
|
+
for (var r = t, n = 0; n < m.length; n++) r = m[n].call(e, r);
|
|
4349
4391
|
return r;
|
|
4350
4392
|
};
|
|
4351
4393
|
} else {
|
|
4352
|
-
var
|
|
4394
|
+
var b = l;
|
|
4353
4395
|
l = function (e, t) {
|
|
4354
|
-
return
|
|
4396
|
+
return b.call(e, t);
|
|
4355
4397
|
};
|
|
4356
4398
|
}
|
|
4357
4399
|
e.push(l);
|
|
4358
4400
|
}
|
|
4359
|
-
0 !== a && (1 === a ? (c.get =
|
|
4360
|
-
return
|
|
4401
|
+
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) {
|
|
4402
|
+
return f.get.call(e, t);
|
|
4361
4403
|
}), e.push(function (e, t) {
|
|
4362
|
-
return
|
|
4363
|
-
})) : 2 === a ? e.push(
|
|
4364
|
-
return
|
|
4404
|
+
return f.set.call(e, t);
|
|
4405
|
+
})) : 2 === a ? e.push(f) : e.push(function (e, t) {
|
|
4406
|
+
return f.call(e, t);
|
|
4365
4407
|
}) : Object.defineProperty(t, n, c));
|
|
4366
4408
|
}
|
|
4367
4409
|
function applyMemberDecs(e, t) {
|
|
4368
|
-
for (var r, n, a = [], i = new Map(),
|
|
4369
|
-
var c = t[
|
|
4410
|
+
for (var r, n, a = [], i = new Map(), o = new Map(), s = 0; s < t.length; s++) {
|
|
4411
|
+
var c = t[s];
|
|
4370
4412
|
if (Array.isArray(c)) {
|
|
4371
4413
|
var l,
|
|
4372
4414
|
u,
|
|
@@ -4374,8 +4416,8 @@ $\
|
|
|
4374
4416
|
p = c[2],
|
|
4375
4417
|
d = c.length > 3,
|
|
4376
4418
|
h = f >= 5;
|
|
4377
|
-
if (h ? (l = e, 0
|
|
4378
|
-
var v = h ?
|
|
4419
|
+
if (h ? (l = e, 0 != (f -= 5) && (u = n = n || [])) : (l = e.prototype, 0 !== f && (u = r = r || [])), 0 !== f && !d) {
|
|
4420
|
+
var v = h ? o : i,
|
|
4379
4421
|
g = v.get(p) || 0;
|
|
4380
4422
|
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
4423
|
!g && f > 2 ? v.set(p, f) : v.set(p, !0);
|
|
@@ -4398,19 +4440,19 @@ $\
|
|
|
4398
4440
|
return function (e, t) {
|
|
4399
4441
|
if (t.length > 0) {
|
|
4400
4442
|
for (var r = [], n = e, a = e.name, i = t.length - 1; i >= 0; i--) {
|
|
4401
|
-
var
|
|
4443
|
+
var o = {
|
|
4402
4444
|
v: !1
|
|
4403
4445
|
};
|
|
4404
4446
|
try {
|
|
4405
|
-
var
|
|
4447
|
+
var s = t[i](n, {
|
|
4406
4448
|
kind: "class",
|
|
4407
4449
|
name: a,
|
|
4408
|
-
addInitializer: createAddInitializerMethod(r,
|
|
4450
|
+
addInitializer: createAddInitializerMethod(r, o)
|
|
4409
4451
|
});
|
|
4410
4452
|
} finally {
|
|
4411
|
-
|
|
4453
|
+
o.v = !0;
|
|
4412
4454
|
}
|
|
4413
|
-
void 0 !==
|
|
4455
|
+
void 0 !== s && (assertValidReturnValue(10, s), n = s);
|
|
4414
4456
|
}
|
|
4415
4457
|
return [n, function () {
|
|
4416
4458
|
for (var e = 0; e < r.length; e++) r[e].call(n);
|
|
@@ -4428,8 +4470,8 @@ $\
|
|
|
4428
4470
|
function createAddInitializerMethod(e, t) {
|
|
4429
4471
|
return function (r) {
|
|
4430
4472
|
!function (e, t) {
|
|
4431
|
-
if (e.v) throw new Error("attempted to call
|
|
4432
|
-
}(t
|
|
4473
|
+
if (e.v) throw new Error("attempted to call addInitializer after decoration was finished");
|
|
4474
|
+
}(t), assertCallable(r, "An initializer"), e.push(r);
|
|
4433
4475
|
};
|
|
4434
4476
|
}
|
|
4435
4477
|
function assertInstanceIfPrivate(e, t) {
|
|
@@ -4457,7 +4499,7 @@ $\
|
|
|
4457
4499
|
f,
|
|
4458
4500
|
p = {
|
|
4459
4501
|
kind: u,
|
|
4460
|
-
name: s ? "#" + t : t,
|
|
4502
|
+
name: s ? "#" + t : _toPropertyKey(t),
|
|
4461
4503
|
static: i,
|
|
4462
4504
|
private: s
|
|
4463
4505
|
},
|
|
@@ -4512,10 +4554,7 @@ $\
|
|
|
4512
4554
|
if (1 === e) {
|
|
4513
4555
|
if ("object" !== r || null === t) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
4514
4556
|
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
|
-
}
|
|
4557
|
+
} else if ("function" !== r) throw new TypeError((0 === e ? "field" : 10 === e ? "class" : "method") + " decorators must return a function or void 0");
|
|
4519
4558
|
}
|
|
4520
4559
|
function curryThis2(e) {
|
|
4521
4560
|
return function (t) {
|
|
@@ -4530,54 +4569,55 @@ $\
|
|
|
4530
4569
|
d,
|
|
4531
4570
|
h,
|
|
4532
4571
|
v,
|
|
4572
|
+
y,
|
|
4533
4573
|
g = r[0];
|
|
4534
|
-
if (s ?
|
|
4535
|
-
get: (
|
|
4536
|
-
return
|
|
4574
|
+
if (s ? (0 === a || 1 === a ? (u = {
|
|
4575
|
+
get: (d = r[3], function () {
|
|
4576
|
+
return d(this);
|
|
4537
4577
|
}),
|
|
4538
4578
|
set: curryThis2(r[4])
|
|
4539
|
-
} : 3 === a ? {
|
|
4579
|
+
}, f = "get") : 3 === a ? (u = {
|
|
4540
4580
|
get: r[3]
|
|
4541
|
-
} : 4 === a ? {
|
|
4581
|
+
}, f = "get") : 4 === a ? (u = {
|
|
4542
4582
|
set: r[3]
|
|
4543
|
-
} : {
|
|
4583
|
+
}, f = "set") : u = {
|
|
4544
4584
|
value: r[3]
|
|
4545
|
-
} : 0 !== a && (u = Object.getOwnPropertyDescriptor(t, n)), 1 === a ?
|
|
4585
|
+
}, 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
4586
|
get: u.get,
|
|
4547
4587
|
set: u.set
|
|
4548
|
-
} : 2 === a ?
|
|
4549
|
-
get:
|
|
4550
|
-
set:
|
|
4551
|
-
}) :
|
|
4552
|
-
var
|
|
4553
|
-
|
|
4554
|
-
get:
|
|
4555
|
-
set:
|
|
4556
|
-
}) :
|
|
4588
|
+
} : 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 = {
|
|
4589
|
+
get: v,
|
|
4590
|
+
set: y
|
|
4591
|
+
}) : p = h);else for (var m = g.length - 1; m >= 0; m--) {
|
|
4592
|
+
var b;
|
|
4593
|
+
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 = {
|
|
4594
|
+
get: v,
|
|
4595
|
+
set: y
|
|
4596
|
+
}) : p = h, void 0 !== b && (void 0 === l ? l = b : "function" == typeof l ? l = [l, b] : l.push(b)));
|
|
4557
4597
|
}
|
|
4558
4598
|
if (0 === a || 1 === a) {
|
|
4559
4599
|
if (void 0 === l) l = function (e, t) {
|
|
4560
4600
|
return t;
|
|
4561
4601
|
};else if ("function" != typeof l) {
|
|
4562
|
-
var
|
|
4602
|
+
var I = l;
|
|
4563
4603
|
l = function (e, t) {
|
|
4564
|
-
for (var r = t, n = 0; n <
|
|
4604
|
+
for (var r = t, n = 0; n < I.length; n++) r = I[n].call(e, r);
|
|
4565
4605
|
return r;
|
|
4566
4606
|
};
|
|
4567
4607
|
} else {
|
|
4568
|
-
var
|
|
4608
|
+
var w = l;
|
|
4569
4609
|
l = function (e, t) {
|
|
4570
|
-
return
|
|
4610
|
+
return w.call(e, t);
|
|
4571
4611
|
};
|
|
4572
4612
|
}
|
|
4573
4613
|
e.push(l);
|
|
4574
4614
|
}
|
|
4575
|
-
0 !== a && (1 === a ? (u.get =
|
|
4576
|
-
return
|
|
4615
|
+
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) {
|
|
4616
|
+
return p.get.call(e, t);
|
|
4577
4617
|
}), e.push(function (e, t) {
|
|
4578
|
-
return
|
|
4579
|
-
})) : 2 === a ? e.push(
|
|
4580
|
-
return
|
|
4618
|
+
return p.set.call(e, t);
|
|
4619
|
+
})) : 2 === a ? e.push(p) : e.push(function (e, t) {
|
|
4620
|
+
return p.call(e, t);
|
|
4581
4621
|
}) : Object.defineProperty(t, n, u));
|
|
4582
4622
|
}
|
|
4583
4623
|
function applyMemberDecs(e, t, r) {
|
|
@@ -4589,17 +4629,17 @@ $\
|
|
|
4589
4629
|
d = l[1],
|
|
4590
4630
|
h = l[2],
|
|
4591
4631
|
v = l.length > 3,
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
if (
|
|
4632
|
+
y = d >= 5,
|
|
4633
|
+
g = r;
|
|
4634
|
+
if (y ? (f = e, 0 != (d -= 5) && (p = a = a || []), v && !i && (i = function (t) {
|
|
4595
4635
|
return _checkInRHS(t) === e;
|
|
4596
|
-
}),
|
|
4597
|
-
var m =
|
|
4636
|
+
}), g = i) : (f = e.prototype, 0 !== d && (p = n = n || [])), 0 !== d && !v) {
|
|
4637
|
+
var m = y ? c : o,
|
|
4598
4638
|
b = m.get(h) || 0;
|
|
4599
4639
|
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
4640
|
!b && d > 2 ? m.set(h, d) : m.set(h, !0);
|
|
4601
4641
|
}
|
|
4602
|
-
applyMemberDec(s, f, l, h, d,
|
|
4642
|
+
applyMemberDec(s, f, l, h, d, y, v, p, g);
|
|
4603
4643
|
}
|
|
4604
4644
|
}
|
|
4605
4645
|
return pushInitializers(s, n), pushInitializers(s, a), s;
|
|
@@ -4643,232 +4683,131 @@ $\
|
|
|
4643
4683
|
function _applyDecs2301(e, t, r, n) {
|
|
4644
4684
|
return (_applyDecs2301 = applyDecs2301Factory())(e, t, r, n);
|
|
4645
4685
|
}
|
|
4646
|
-
function
|
|
4647
|
-
|
|
4648
|
-
|
|
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
|
|
4686
|
+
function _applyDecs2305(e, t, r, n, o, a) {
|
|
4687
|
+
function i(e, t, r) {
|
|
4688
|
+
return function (n, o) {
|
|
4689
|
+
return r && r(n), e[t].call(n, o);
|
|
4683
4690
|
};
|
|
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
4691
|
}
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
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);
|
|
4692
|
+
function c(e, t) {
|
|
4693
|
+
for (var r = 0; r < e.length; r++) e[r].call(t);
|
|
4694
|
+
return t;
|
|
4794
4695
|
}
|
|
4795
|
-
|
|
4796
|
-
|
|
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);
|
|
4696
|
+
function s(e, t, r, n) {
|
|
4697
|
+
if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined"));
|
|
4831
4698
|
return e;
|
|
4832
|
-
}
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4699
|
+
}
|
|
4700
|
+
function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) {
|
|
4701
|
+
function m(e) {
|
|
4702
|
+
if (!h(e)) throw new TypeError("Attempted to access private element on non-instance");
|
|
4703
|
+
}
|
|
4704
|
+
var y,
|
|
4705
|
+
v = t[0],
|
|
4706
|
+
g = t[3],
|
|
4707
|
+
b = !u;
|
|
4708
|
+
if (!b) {
|
|
4709
|
+
r || Array.isArray(v) || (v = [v]);
|
|
4710
|
+
var w = {},
|
|
4711
|
+
S = [],
|
|
4712
|
+
A = 3 === o ? "get" : 4 === o || d ? "set" : "value";
|
|
4713
|
+
f ? (p || d ? w = {
|
|
4714
|
+
get: _setFunctionName(function () {
|
|
4715
|
+
return g(this);
|
|
4716
|
+
}, n, "get"),
|
|
4717
|
+
set: function (e) {
|
|
4718
|
+
t[4](this, e);
|
|
4719
|
+
}
|
|
4720
|
+
} : w[A] = g, p || _setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n));
|
|
4721
|
+
}
|
|
4722
|
+
for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) {
|
|
4723
|
+
var D = v[j],
|
|
4724
|
+
E = r ? v[j - 1] : void 0,
|
|
4725
|
+
I = {},
|
|
4726
|
+
O = {
|
|
4727
|
+
kind: ["field", "accessor", "method", "getter", "setter", "class"][o],
|
|
4728
|
+
name: n,
|
|
4729
|
+
metadata: a,
|
|
4730
|
+
addInitializer: function (e, t) {
|
|
4731
|
+
if (e.v) throw new Error("attempted to call addInitializer after decoration was finished");
|
|
4732
|
+
s(t, "An initializer", "be", !0), c.push(t);
|
|
4733
|
+
}.bind(null, I)
|
|
4734
|
+
};
|
|
4840
4735
|
try {
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4736
|
+
if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else {
|
|
4737
|
+
var k, F;
|
|
4738
|
+
O.static = l, O.private = f, f ? 2 === o ? k = function (e) {
|
|
4739
|
+
return m(e), w.value;
|
|
4740
|
+
} : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function (e) {
|
|
4741
|
+
return e[n];
|
|
4742
|
+
}, (o < 2 || 4 === o) && (F = function (e, t) {
|
|
4743
|
+
e[n] = t;
|
|
4744
|
+
}));
|
|
4745
|
+
var N = O.access = {
|
|
4746
|
+
has: f ? h.bind() : function (e) {
|
|
4747
|
+
return n in e;
|
|
4748
|
+
}
|
|
4749
|
+
};
|
|
4750
|
+
if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? {
|
|
4751
|
+
get: w.get,
|
|
4752
|
+
set: w.set
|
|
4753
|
+
} : w[A], O), d) {
|
|
4754
|
+
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");
|
|
4755
|
+
} else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P);
|
|
4756
|
+
}
|
|
4847
4757
|
} finally {
|
|
4848
|
-
|
|
4758
|
+
I.v = !0;
|
|
4849
4759
|
}
|
|
4850
|
-
void 0 !== u && (assertValidReturnValue(5, u), i = u);
|
|
4851
4760
|
}
|
|
4852
|
-
return
|
|
4853
|
-
for (var
|
|
4854
|
-
|
|
4761
|
+
return (p || d) && u.push(function (e, t) {
|
|
4762
|
+
for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t);
|
|
4763
|
+
return t;
|
|
4764
|
+
}), 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
4765
|
}
|
|
4856
|
-
|
|
4857
|
-
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
}
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4766
|
+
function u(e, t) {
|
|
4767
|
+
return Object.defineProperty(e, Symbol.metadata || Symbol.for("Symbol.metadata"), {
|
|
4768
|
+
configurable: !0,
|
|
4769
|
+
enumerable: !0,
|
|
4770
|
+
value: t
|
|
4771
|
+
});
|
|
4772
|
+
}
|
|
4773
|
+
if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
4774
|
+
var f = Object.create(null == l ? null : l),
|
|
4775
|
+
p = function (e, t, r, n) {
|
|
4776
|
+
var o,
|
|
4777
|
+
a,
|
|
4778
|
+
i = [],
|
|
4779
|
+
s = function (t) {
|
|
4780
|
+
return _checkInRHS(t) === e;
|
|
4781
|
+
},
|
|
4782
|
+
u = new Map();
|
|
4783
|
+
function l(e) {
|
|
4784
|
+
e && i.push(c.bind(null, e));
|
|
4785
|
+
}
|
|
4786
|
+
for (var f = 0; f < t.length; f++) {
|
|
4787
|
+
var p = t[f];
|
|
4788
|
+
if (Array.isArray(p)) {
|
|
4789
|
+
var d = p[1],
|
|
4790
|
+
h = p[2],
|
|
4791
|
+
m = p.length > 3,
|
|
4792
|
+
y = 16 & d,
|
|
4793
|
+
v = !!(8 & d),
|
|
4794
|
+
g = 0 == (d &= 7),
|
|
4795
|
+
b = h + "/" + v;
|
|
4796
|
+
if (!g && !m) {
|
|
4797
|
+
var w = u.get(b);
|
|
4798
|
+
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);
|
|
4799
|
+
u.set(b, !(d > 2) || d);
|
|
4800
|
+
}
|
|
4801
|
+
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);
|
|
4802
|
+
}
|
|
4803
|
+
}
|
|
4804
|
+
return l(o), l(a), i;
|
|
4805
|
+
}(e, t, o, f);
|
|
4806
|
+
return r.length || u(e, f), {
|
|
4807
|
+
e: p,
|
|
4870
4808
|
get c() {
|
|
4871
|
-
|
|
4809
|
+
var t = [];
|
|
4810
|
+
return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)];
|
|
4872
4811
|
}
|
|
4873
4812
|
};
|
|
4874
4813
|
}
|
|
@@ -4941,10 +4880,20 @@ $\
|
|
|
4941
4880
|
function _awaitAsyncGenerator(e) {
|
|
4942
4881
|
return new _OverloadYield(e, 0);
|
|
4943
4882
|
}
|
|
4883
|
+
function _callSuper(t, o, e) {
|
|
4884
|
+
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
|
4885
|
+
}
|
|
4944
4886
|
function _checkInRHS(e) {
|
|
4945
4887
|
if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== e ? typeof e : "null"));
|
|
4946
4888
|
return e;
|
|
4947
4889
|
}
|
|
4890
|
+
function _construct(t, e, r) {
|
|
4891
|
+
if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
|
|
4892
|
+
var o = [null];
|
|
4893
|
+
o.push.apply(o, e);
|
|
4894
|
+
var p = new (t.bind.apply(t, o))();
|
|
4895
|
+
return r && _setPrototypeOf(p, r.prototype), p;
|
|
4896
|
+
}
|
|
4948
4897
|
function _defineAccessor(e, r, n, t) {
|
|
4949
4898
|
var c = {
|
|
4950
4899
|
configurable: !0,
|
|
@@ -4954,7 +4903,7 @@ $\
|
|
|
4954
4903
|
}
|
|
4955
4904
|
function dispose_SuppressedError(r, e) {
|
|
4956
4905
|
return "undefined" != typeof SuppressedError ? dispose_SuppressedError = SuppressedError : (dispose_SuppressedError = function (r, e) {
|
|
4957
|
-
this.suppressed =
|
|
4906
|
+
this.suppressed = e, this.error = r, this.stack = new Error().stack;
|
|
4958
4907
|
}, dispose_SuppressedError.prototype = Object.create(Error.prototype, {
|
|
4959
4908
|
constructor: {
|
|
4960
4909
|
value: dispose_SuppressedError,
|
|
@@ -4975,7 +4924,7 @@ $\
|
|
|
4975
4924
|
if (s) throw e;
|
|
4976
4925
|
}
|
|
4977
4926
|
function err(r) {
|
|
4978
|
-
return e = s ? new dispose_SuppressedError(
|
|
4927
|
+
return e = s ? new dispose_SuppressedError(e, r) : r, s = !0, next();
|
|
4979
4928
|
}
|
|
4980
4929
|
return next();
|
|
4981
4930
|
}
|
|
@@ -5005,6 +4954,39 @@ $\
|
|
|
5005
4954
|
setPrototypeOf: constValue(!1)
|
|
5006
4955
|
});
|
|
5007
4956
|
}
|
|
4957
|
+
function _getRequireWildcardCache(e) {
|
|
4958
|
+
if ("function" != typeof WeakMap) return null;
|
|
4959
|
+
var r = new WeakMap(),
|
|
4960
|
+
t = new WeakMap();
|
|
4961
|
+
return (_getRequireWildcardCache = function (e) {
|
|
4962
|
+
return e ? t : r;
|
|
4963
|
+
})(e);
|
|
4964
|
+
}
|
|
4965
|
+
function _interopRequireWildcard(e, r) {
|
|
4966
|
+
if (!r && e && e.__esModule) return e;
|
|
4967
|
+
if (null === e || "object" != typeof e && "function" != typeof e) return {
|
|
4968
|
+
default: e
|
|
4969
|
+
};
|
|
4970
|
+
var t = _getRequireWildcardCache(r);
|
|
4971
|
+
if (t && t.has(e)) return t.get(e);
|
|
4972
|
+
var n = {
|
|
4973
|
+
__proto__: null
|
|
4974
|
+
},
|
|
4975
|
+
a = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
4976
|
+
for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) {
|
|
4977
|
+
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
|
|
4978
|
+
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
|
|
4979
|
+
}
|
|
4980
|
+
return n.default = e, t && t.set(e, n), n;
|
|
4981
|
+
}
|
|
4982
|
+
function _isNativeReflectConstruct() {
|
|
4983
|
+
try {
|
|
4984
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
4985
|
+
} catch (t) {}
|
|
4986
|
+
return (_isNativeReflectConstruct = function () {
|
|
4987
|
+
return !!t;
|
|
4988
|
+
})();
|
|
4989
|
+
}
|
|
5008
4990
|
function _iterableToArrayLimit(r, l) {
|
|
5009
4991
|
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
5010
4992
|
if (null != t) {
|
|
@@ -5385,6 +5367,30 @@ $\
|
|
|
5385
5367
|
}
|
|
5386
5368
|
}, e;
|
|
5387
5369
|
}
|
|
5370
|
+
function _setFunctionName(e, t, n) {
|
|
5371
|
+
"symbol" == typeof t && (t = (t = t.description) ? "[" + t + "]" : "");
|
|
5372
|
+
try {
|
|
5373
|
+
Object.defineProperty(e, "name", {
|
|
5374
|
+
configurable: !0,
|
|
5375
|
+
value: n ? n + " " + t : t
|
|
5376
|
+
});
|
|
5377
|
+
} catch (e) {}
|
|
5378
|
+
return e;
|
|
5379
|
+
}
|
|
5380
|
+
function _toPrimitive(t, r) {
|
|
5381
|
+
if ("object" != typeof t || !t) return t;
|
|
5382
|
+
var e = t[Symbol.toPrimitive];
|
|
5383
|
+
if (void 0 !== e) {
|
|
5384
|
+
var i = e.call(t, r || "default");
|
|
5385
|
+
if ("object" != typeof i) return i;
|
|
5386
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
5387
|
+
}
|
|
5388
|
+
return ("string" === r ? String : Number)(t);
|
|
5389
|
+
}
|
|
5390
|
+
function _toPropertyKey(t) {
|
|
5391
|
+
var i = _toPrimitive(t, "string");
|
|
5392
|
+
return "symbol" == typeof i ? i : String(i);
|
|
5393
|
+
}
|
|
5388
5394
|
function _typeof(o) {
|
|
5389
5395
|
"@babel/helpers - typeof";
|
|
5390
5396
|
|
|
@@ -5394,16 +5400,59 @@ $\
|
|
|
5394
5400
|
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
5395
5401
|
}, _typeof(o);
|
|
5396
5402
|
}
|
|
5397
|
-
function _using(o,
|
|
5398
|
-
if (null ==
|
|
5399
|
-
if (
|
|
5400
|
-
if (
|
|
5401
|
-
if (null == r && (r =
|
|
5403
|
+
function _using(o, n, e) {
|
|
5404
|
+
if (null == n) return n;
|
|
5405
|
+
if (Object(n) !== n) throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");
|
|
5406
|
+
if (e) var r = n[Symbol.asyncDispose || Symbol.for("Symbol.asyncDispose")];
|
|
5407
|
+
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
5408
|
return o.push({
|
|
5403
|
-
v:
|
|
5409
|
+
v: n,
|
|
5404
5410
|
d: r,
|
|
5405
|
-
a:
|
|
5406
|
-
}),
|
|
5411
|
+
a: e
|
|
5412
|
+
}), n;
|
|
5413
|
+
}
|
|
5414
|
+
function _usingCtx() {
|
|
5415
|
+
var r = "function" == typeof SuppressedError ? SuppressedError : function (r, n) {
|
|
5416
|
+
var e = new Error();
|
|
5417
|
+
return e.name = "SuppressedError", e.suppressed = n, e.error = r, e;
|
|
5418
|
+
},
|
|
5419
|
+
n = {},
|
|
5420
|
+
e = [];
|
|
5421
|
+
function using(r, n) {
|
|
5422
|
+
if (null != n) {
|
|
5423
|
+
if (Object(n) !== n) throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");
|
|
5424
|
+
if (r) var o = n[Symbol.asyncDispose || Symbol.for("Symbol.asyncDispose")];
|
|
5425
|
+
if (null == o && (o = n[Symbol.dispose || Symbol.for("Symbol.dispose")]), "function" != typeof o) throw new TypeError("Property [Symbol.dispose] is not a function.");
|
|
5426
|
+
e.push({
|
|
5427
|
+
v: n,
|
|
5428
|
+
d: o,
|
|
5429
|
+
a: r
|
|
5430
|
+
});
|
|
5431
|
+
}
|
|
5432
|
+
return n;
|
|
5433
|
+
}
|
|
5434
|
+
return {
|
|
5435
|
+
e: n,
|
|
5436
|
+
u: using.bind(null, !1),
|
|
5437
|
+
a: using.bind(null, !0),
|
|
5438
|
+
d: function () {
|
|
5439
|
+
var o = this.e;
|
|
5440
|
+
function next() {
|
|
5441
|
+
for (; r = e.pop();) try {
|
|
5442
|
+
var r,
|
|
5443
|
+
t = r.d.call(r.v);
|
|
5444
|
+
if (r.a) return Promise.resolve(t).then(next, err);
|
|
5445
|
+
} catch (r) {
|
|
5446
|
+
return err(r);
|
|
5447
|
+
}
|
|
5448
|
+
if (o !== n) throw o;
|
|
5449
|
+
}
|
|
5450
|
+
function err(e) {
|
|
5451
|
+
return o = o !== n ? new r(o, e) : e, next();
|
|
5452
|
+
}
|
|
5453
|
+
return next();
|
|
5454
|
+
}
|
|
5455
|
+
};
|
|
5407
5456
|
}
|
|
5408
5457
|
function _wrapRegExp() {
|
|
5409
5458
|
_wrapRegExp = function (e, r) {
|
|
@@ -5619,34 +5668,12 @@ $\
|
|
|
5619
5668
|
};
|
|
5620
5669
|
return _setPrototypeOf(o, p);
|
|
5621
5670
|
}
|
|
5622
|
-
function
|
|
5623
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
5624
|
-
if (Reflect.construct.sham) return false;
|
|
5625
|
-
if (typeof Proxy === "function") return true;
|
|
5671
|
+
function _isNativeFunction(fn) {
|
|
5626
5672
|
try {
|
|
5627
|
-
|
|
5628
|
-
return true;
|
|
5673
|
+
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
5629
5674
|
} catch (e) {
|
|
5630
|
-
return
|
|
5631
|
-
}
|
|
5632
|
-
}
|
|
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
|
-
};
|
|
5675
|
+
return typeof fn === "function";
|
|
5645
5676
|
}
|
|
5646
|
-
return _construct.apply(null, arguments);
|
|
5647
|
-
}
|
|
5648
|
-
function _isNativeFunction(fn) {
|
|
5649
|
-
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
5650
5677
|
}
|
|
5651
5678
|
function _wrapNativeSuper(Class) {
|
|
5652
5679
|
var _cache = typeof Map === "function" ? new Map() : undefined;
|
|
@@ -5686,45 +5713,6 @@ $\
|
|
|
5686
5713
|
default: obj
|
|
5687
5714
|
};
|
|
5688
5715
|
}
|
|
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
5716
|
function _newArrowCheck(innerThis, boundThis) {
|
|
5729
5717
|
if (innerThis !== boundThis) {
|
|
5730
5718
|
throw new TypeError("Cannot instantiate an arrow function");
|
|
@@ -6005,20 +5993,6 @@ $\
|
|
|
6005
5993
|
return it;
|
|
6006
5994
|
};
|
|
6007
5995
|
}
|
|
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
5996
|
function _initializerWarningHelper(descriptor, context) {
|
|
6023
5997
|
throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.');
|
|
6024
5998
|
}
|
|
@@ -6650,6 +6624,11 @@ $\
|
|
|
6650
6624
|
this.attributes = Hash.box(attributes);
|
|
6651
6625
|
this.didChangeAttributes();
|
|
6652
6626
|
}
|
|
6627
|
+
setAttribute(attribute, value) {
|
|
6628
|
+
this.setAttributes({
|
|
6629
|
+
[attribute]: value
|
|
6630
|
+
});
|
|
6631
|
+
}
|
|
6653
6632
|
getAttribute(attribute) {
|
|
6654
6633
|
return this.attributes.get(attribute);
|
|
6655
6634
|
}
|
|
@@ -8889,6 +8868,8 @@ $\
|
|
|
8889
8868
|
ManagedAttachment.proxyMethod("attachment.isPending");
|
|
8890
8869
|
ManagedAttachment.proxyMethod("attachment.isPreviewable");
|
|
8891
8870
|
ManagedAttachment.proxyMethod("attachment.getURL");
|
|
8871
|
+
ManagedAttachment.proxyMethod("attachment.getPreviewURL");
|
|
8872
|
+
ManagedAttachment.proxyMethod("attachment.setPreviewURL");
|
|
8892
8873
|
ManagedAttachment.proxyMethod("attachment.getHref");
|
|
8893
8874
|
ManagedAttachment.proxyMethod("attachment.getFilename");
|
|
8894
8875
|
ManagedAttachment.proxyMethod("attachment.getFilesize");
|
|
@@ -13282,6 +13263,22 @@ $\
|
|
|
13282
13263
|
this.innerHTML = toolbar.getDefaultHTML();
|
|
13283
13264
|
}
|
|
13284
13265
|
}
|
|
13266
|
+
|
|
13267
|
+
// Properties
|
|
13268
|
+
|
|
13269
|
+
get editorElements() {
|
|
13270
|
+
if (this.id) {
|
|
13271
|
+
var _this$ownerDocument;
|
|
13272
|
+
const nodeList = (_this$ownerDocument = this.ownerDocument) === null || _this$ownerDocument === void 0 ? void 0 : _this$ownerDocument.querySelectorAll("trix-editor[toolbar=\"".concat(this.id, "\"]"));
|
|
13273
|
+
return Array.from(nodeList);
|
|
13274
|
+
} else {
|
|
13275
|
+
return [];
|
|
13276
|
+
}
|
|
13277
|
+
}
|
|
13278
|
+
get editorElement() {
|
|
13279
|
+
const [editorElement] = this.editorElements;
|
|
13280
|
+
return editorElement;
|
|
13281
|
+
}
|
|
13285
13282
|
}
|
|
13286
13283
|
|
|
13287
13284
|
let id = 0;
|
|
@@ -13299,7 +13296,7 @@ $\
|
|
|
13299
13296
|
if (element.hasAttribute("contenteditable")) {
|
|
13300
13297
|
return;
|
|
13301
13298
|
}
|
|
13302
|
-
element.
|
|
13299
|
+
element.toggleAttribute("contenteditable", !element.disabled);
|
|
13303
13300
|
return handleEventOnce("focus", {
|
|
13304
13301
|
onElement: element,
|
|
13305
13302
|
withCallback() {
|
|
@@ -13380,27 +13377,42 @@ $\
|
|
|
13380
13377
|
}();
|
|
13381
13378
|
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
13379
|
var _internals = /*#__PURE__*/new WeakMap();
|
|
13380
|
+
var _formDisabled = /*#__PURE__*/new WeakMap();
|
|
13383
13381
|
var _validate = /*#__PURE__*/new WeakSet();
|
|
13384
13382
|
class ElementInternalsDelegate {
|
|
13385
13383
|
constructor(element) {
|
|
13386
13384
|
_classPrivateMethodInitSpec(this, _validate);
|
|
13385
|
+
_defineProperty(this, "value", "");
|
|
13387
13386
|
_classPrivateFieldInitSpec(this, _internals, {
|
|
13388
13387
|
writable: true,
|
|
13389
13388
|
value: void 0
|
|
13390
13389
|
});
|
|
13390
|
+
_classPrivateFieldInitSpec(this, _formDisabled, {
|
|
13391
|
+
writable: true,
|
|
13392
|
+
value: void 0
|
|
13393
|
+
});
|
|
13391
13394
|
this.element = element;
|
|
13392
13395
|
_classPrivateFieldSet(this, _internals, element.attachInternals());
|
|
13396
|
+
_classPrivateFieldSet(this, _formDisabled, false);
|
|
13393
13397
|
}
|
|
13394
13398
|
connectedCallback() {
|
|
13395
13399
|
_classPrivateMethodGet(this, _validate, _validate2).call(this);
|
|
13396
13400
|
}
|
|
13397
13401
|
disconnectedCallback() {}
|
|
13402
|
+
get form() {
|
|
13403
|
+
return _classPrivateFieldGet(this, _internals).form;
|
|
13404
|
+
}
|
|
13405
|
+
get name() {
|
|
13406
|
+
return this.element.getAttribute("name");
|
|
13407
|
+
}
|
|
13408
|
+
set name(value) {
|
|
13409
|
+
this.element.setAttribute("name", value);
|
|
13410
|
+
}
|
|
13398
13411
|
get labels() {
|
|
13399
13412
|
return _classPrivateFieldGet(this, _internals).labels;
|
|
13400
13413
|
}
|
|
13401
13414
|
get disabled() {
|
|
13402
|
-
|
|
13403
|
-
return (_this$element$inputEl = this.element.inputElement) === null || _this$element$inputEl === void 0 ? void 0 : _this$element$inputEl.disabled;
|
|
13415
|
+
return _classPrivateFieldGet(this, _formDisabled) || this.element.hasAttribute("disabled");
|
|
13404
13416
|
}
|
|
13405
13417
|
set disabled(value) {
|
|
13406
13418
|
this.element.toggleAttribute("disabled", value);
|
|
@@ -13421,8 +13433,13 @@ $\
|
|
|
13421
13433
|
get willValidate() {
|
|
13422
13434
|
return _classPrivateFieldGet(this, _internals).willValidate;
|
|
13423
13435
|
}
|
|
13436
|
+
formDisabledCallback(disabled) {
|
|
13437
|
+
_classPrivateFieldSet(this, _formDisabled, disabled);
|
|
13438
|
+
}
|
|
13424
13439
|
setFormValue(value) {
|
|
13440
|
+
this.value = value;
|
|
13425
13441
|
_classPrivateMethodGet(this, _validate, _validate2).call(this);
|
|
13442
|
+
_classPrivateFieldGet(this, _internals).setFormValue(this.element.disabled ? undefined : this.value);
|
|
13426
13443
|
}
|
|
13427
13444
|
checkValidity() {
|
|
13428
13445
|
return _classPrivateFieldGet(this, _internals).checkValidity();
|
|
@@ -13509,6 +13526,17 @@ $\
|
|
|
13509
13526
|
}
|
|
13510
13527
|
return labels;
|
|
13511
13528
|
}
|
|
13529
|
+
get form() {
|
|
13530
|
+
console.warn("This browser does not support the .form property for trix-editor elements.");
|
|
13531
|
+
return null;
|
|
13532
|
+
}
|
|
13533
|
+
get name() {
|
|
13534
|
+
console.warn("This browser does not support the .name property for trix-editor elements.");
|
|
13535
|
+
return null;
|
|
13536
|
+
}
|
|
13537
|
+
set name(value) {
|
|
13538
|
+
console.warn("This browser does not support the .name property for trix-editor elements.");
|
|
13539
|
+
}
|
|
13512
13540
|
get disabled() {
|
|
13513
13541
|
console.warn("This browser does not support the [disabled] attribute for trix-editor elements.");
|
|
13514
13542
|
return false;
|
|
@@ -13535,6 +13563,7 @@ $\
|
|
|
13535
13563
|
console.warn("This browser does not support the willValidate property for trix-editor elements.");
|
|
13536
13564
|
return false;
|
|
13537
13565
|
}
|
|
13566
|
+
formDisabledCallback(value) {}
|
|
13538
13567
|
setFormValue(value) {}
|
|
13539
13568
|
checkValidity() {
|
|
13540
13569
|
console.warn("This browser does not support checkValidity() for trix-editor elements.");
|
|
@@ -13556,6 +13585,7 @@ $\
|
|
|
13556
13585
|
writable: true,
|
|
13557
13586
|
value: void 0
|
|
13558
13587
|
});
|
|
13588
|
+
this.willCreateInput = true;
|
|
13559
13589
|
_classPrivateFieldSet(this, _delegate, this.constructor.formAssociated ? new ElementInternalsDelegate(this) : new LegacyDelegate(this));
|
|
13560
13590
|
}
|
|
13561
13591
|
|
|
@@ -13573,9 +13603,22 @@ $\
|
|
|
13573
13603
|
return _classPrivateFieldGet(this, _delegate).labels;
|
|
13574
13604
|
}
|
|
13575
13605
|
get disabled() {
|
|
13576
|
-
|
|
13606
|
+
const {
|
|
13607
|
+
inputElement
|
|
13608
|
+
} = this;
|
|
13609
|
+
if (inputElement) {
|
|
13610
|
+
return inputElement.disabled;
|
|
13611
|
+
} else {
|
|
13612
|
+
return _classPrivateFieldGet(this, _delegate).disabled;
|
|
13613
|
+
}
|
|
13577
13614
|
}
|
|
13578
13615
|
set disabled(value) {
|
|
13616
|
+
const {
|
|
13617
|
+
inputElement
|
|
13618
|
+
} = this;
|
|
13619
|
+
if (inputElement) {
|
|
13620
|
+
inputElement.disabled = value;
|
|
13621
|
+
}
|
|
13579
13622
|
_classPrivateFieldGet(this, _delegate).disabled = value;
|
|
13580
13623
|
}
|
|
13581
13624
|
get required() {
|
|
@@ -13613,22 +13656,19 @@ $\
|
|
|
13613
13656
|
}
|
|
13614
13657
|
}
|
|
13615
13658
|
get form() {
|
|
13616
|
-
|
|
13617
|
-
|
|
13659
|
+
const {
|
|
13660
|
+
inputElement
|
|
13661
|
+
} = this;
|
|
13662
|
+
if (inputElement) {
|
|
13663
|
+
return inputElement.form;
|
|
13664
|
+
} else {
|
|
13665
|
+
return _classPrivateFieldGet(this, _delegate).form;
|
|
13666
|
+
}
|
|
13618
13667
|
}
|
|
13619
13668
|
get inputElement() {
|
|
13620
13669
|
if (this.hasAttribute("input")) {
|
|
13621
13670
|
var _this$ownerDocument2;
|
|
13622
13671
|
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
13672
|
} else {
|
|
13633
13673
|
return undefined;
|
|
13634
13674
|
}
|
|
@@ -13638,12 +13678,34 @@ $\
|
|
|
13638
13678
|
return (_this$editorControlle = this.editorController) === null || _this$editorControlle === void 0 ? void 0 : _this$editorControlle.editor;
|
|
13639
13679
|
}
|
|
13640
13680
|
get name() {
|
|
13641
|
-
|
|
13642
|
-
|
|
13681
|
+
const {
|
|
13682
|
+
inputElement
|
|
13683
|
+
} = this;
|
|
13684
|
+
if (inputElement) {
|
|
13685
|
+
return inputElement.name;
|
|
13686
|
+
} else {
|
|
13687
|
+
return _classPrivateFieldGet(this, _delegate).name;
|
|
13688
|
+
}
|
|
13689
|
+
}
|
|
13690
|
+
set name(value) {
|
|
13691
|
+
const {
|
|
13692
|
+
inputElement
|
|
13693
|
+
} = this;
|
|
13694
|
+
if (inputElement) {
|
|
13695
|
+
inputElement.name = value;
|
|
13696
|
+
} else {
|
|
13697
|
+
_classPrivateFieldGet(this, _delegate).name = value;
|
|
13698
|
+
}
|
|
13643
13699
|
}
|
|
13644
13700
|
get value() {
|
|
13645
|
-
|
|
13646
|
-
|
|
13701
|
+
const {
|
|
13702
|
+
inputElement
|
|
13703
|
+
} = this;
|
|
13704
|
+
if (inputElement) {
|
|
13705
|
+
return inputElement.value;
|
|
13706
|
+
} else {
|
|
13707
|
+
return _classPrivateFieldGet(this, _delegate).value;
|
|
13708
|
+
}
|
|
13647
13709
|
}
|
|
13648
13710
|
set value(defaultValue) {
|
|
13649
13711
|
var _this$editor;
|
|
@@ -13670,10 +13732,13 @@ $\
|
|
|
13670
13732
|
}
|
|
13671
13733
|
}
|
|
13672
13734
|
setFormValue(value) {
|
|
13673
|
-
|
|
13674
|
-
|
|
13675
|
-
|
|
13735
|
+
const {
|
|
13736
|
+
inputElement
|
|
13737
|
+
} = this;
|
|
13738
|
+
if (inputElement) {
|
|
13739
|
+
inputElement.value = value;
|
|
13676
13740
|
}
|
|
13741
|
+
_classPrivateFieldGet(this, _delegate).setFormValue(value);
|
|
13677
13742
|
}
|
|
13678
13743
|
|
|
13679
13744
|
// Element lifecycle
|
|
@@ -13686,9 +13751,19 @@ $\
|
|
|
13686
13751
|
triggerEvent("trix-before-initialize", {
|
|
13687
13752
|
onElement: this
|
|
13688
13753
|
});
|
|
13754
|
+
this.defaultValue = this.inputElement ? this.inputElement.value : this.innerHTML;
|
|
13755
|
+
if (!this.hasAttribute("input") && this.parentNode && this.willCreateInput) {
|
|
13756
|
+
const inputId = "trix-input-".concat(this.trixId);
|
|
13757
|
+
this.setAttribute("input", inputId);
|
|
13758
|
+
const element = makeElement("input", {
|
|
13759
|
+
type: "hidden",
|
|
13760
|
+
id: inputId
|
|
13761
|
+
});
|
|
13762
|
+
this.parentNode.insertBefore(element, this.nextElementSibling);
|
|
13763
|
+
}
|
|
13689
13764
|
this.editorController = new EditorController({
|
|
13690
13765
|
editorElement: this,
|
|
13691
|
-
html: this.defaultValue
|
|
13766
|
+
html: this.defaultValue
|
|
13692
13767
|
});
|
|
13693
13768
|
requestAnimationFrame(() => triggerEvent("trix-initialize", {
|
|
13694
13769
|
onElement: this
|
|
@@ -13729,10 +13804,14 @@ $\
|
|
|
13729
13804
|
_classPrivateFieldGet(this, _delegate).setCustomValidity(validationMessage);
|
|
13730
13805
|
}
|
|
13731
13806
|
formDisabledCallback(disabled) {
|
|
13732
|
-
|
|
13733
|
-
|
|
13807
|
+
const {
|
|
13808
|
+
inputElement
|
|
13809
|
+
} = this;
|
|
13810
|
+
if (inputElement) {
|
|
13811
|
+
inputElement.disabled = disabled;
|
|
13734
13812
|
}
|
|
13735
13813
|
this.toggleAttribute("contenteditable", !disabled);
|
|
13814
|
+
_classPrivateFieldGet(this, _delegate).formDisabledCallback(disabled);
|
|
13736
13815
|
}
|
|
13737
13816
|
formResetCallback() {
|
|
13738
13817
|
this.reset();
|