@progress/telerik-angular-report-viewer 26.25.716 → 27.25.813

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
  var $ = require("jquery");
2
2
  /*
3
- * TelerikReporting v19.1.25.716 (https://www.telerik.com/products/reporting.aspx)
3
+ * TelerikReporting v19.2.25.813 (https://www.telerik.com/products/reporting.aspx)
4
4
  * Copyright 2025 Progress Software EAD. All rights reserved.
5
5
  *
6
6
  * Telerik Reporting commercial licenses may be obtained at
@@ -14,12 +14,1372 @@ var telerikReportViewer = (function (exports) {
14
14
 
15
15
  var dist = {exports: {}};
16
16
 
17
+ /*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */
18
+
19
+ var purify_cjs;
20
+ var hasRequiredPurify_cjs;
21
+
22
+ function requirePurify_cjs () {
23
+ if (hasRequiredPurify_cjs) return purify_cjs;
24
+ hasRequiredPurify_cjs = 1;
25
+
26
+ const {
27
+ entries,
28
+ setPrototypeOf,
29
+ isFrozen,
30
+ getPrototypeOf,
31
+ getOwnPropertyDescriptor
32
+ } = Object;
33
+ let {
34
+ freeze,
35
+ seal,
36
+ create
37
+ } = Object; // eslint-disable-line import/no-mutable-exports
38
+ let {
39
+ apply,
40
+ construct
41
+ } = typeof Reflect !== 'undefined' && Reflect;
42
+ if (!freeze) {
43
+ freeze = function freeze(x) {
44
+ return x;
45
+ };
46
+ }
47
+ if (!seal) {
48
+ seal = function seal(x) {
49
+ return x;
50
+ };
51
+ }
52
+ if (!apply) {
53
+ apply = function apply(fun, thisValue, args) {
54
+ return fun.apply(thisValue, args);
55
+ };
56
+ }
57
+ if (!construct) {
58
+ construct = function construct(Func, args) {
59
+ return new Func(...args);
60
+ };
61
+ }
62
+ const arrayForEach = unapply(Array.prototype.forEach);
63
+ const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
64
+ const arrayPop = unapply(Array.prototype.pop);
65
+ const arrayPush = unapply(Array.prototype.push);
66
+ const arraySplice = unapply(Array.prototype.splice);
67
+ const stringToLowerCase = unapply(String.prototype.toLowerCase);
68
+ const stringToString = unapply(String.prototype.toString);
69
+ const stringMatch = unapply(String.prototype.match);
70
+ const stringReplace = unapply(String.prototype.replace);
71
+ const stringIndexOf = unapply(String.prototype.indexOf);
72
+ const stringTrim = unapply(String.prototype.trim);
73
+ const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
74
+ const regExpTest = unapply(RegExp.prototype.test);
75
+ const typeErrorCreate = unconstruct(TypeError);
76
+ /**
77
+ * Creates a new function that calls the given function with a specified thisArg and arguments.
78
+ *
79
+ * @param func - The function to be wrapped and called.
80
+ * @returns A new function that calls the given function with a specified thisArg and arguments.
81
+ */
82
+ function unapply(func) {
83
+ return function (thisArg) {
84
+ if (thisArg instanceof RegExp) {
85
+ thisArg.lastIndex = 0;
86
+ }
87
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
88
+ args[_key - 1] = arguments[_key];
89
+ }
90
+ return apply(func, thisArg, args);
91
+ };
92
+ }
93
+ /**
94
+ * Creates a new function that constructs an instance of the given constructor function with the provided arguments.
95
+ *
96
+ * @param func - The constructor function to be wrapped and called.
97
+ * @returns A new function that constructs an instance of the given constructor function with the provided arguments.
98
+ */
99
+ function unconstruct(func) {
100
+ return function () {
101
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
102
+ args[_key2] = arguments[_key2];
103
+ }
104
+ return construct(func, args);
105
+ };
106
+ }
107
+ /**
108
+ * Add properties to a lookup table
109
+ *
110
+ * @param set - The set to which elements will be added.
111
+ * @param array - The array containing elements to be added to the set.
112
+ * @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.
113
+ * @returns The modified set with added elements.
114
+ */
115
+ function addToSet(set, array) {
116
+ let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;
117
+ if (setPrototypeOf) {
118
+ // Make 'in' and truthy checks like Boolean(set.constructor)
119
+ // independent of any properties defined on Object.prototype.
120
+ // Prevent prototype setters from intercepting set as a this value.
121
+ setPrototypeOf(set, null);
122
+ }
123
+ let l = array.length;
124
+ while (l--) {
125
+ let element = array[l];
126
+ if (typeof element === 'string') {
127
+ const lcElement = transformCaseFunc(element);
128
+ if (lcElement !== element) {
129
+ // Config presets (e.g. tags.js, attrs.js) are immutable.
130
+ if (!isFrozen(array)) {
131
+ array[l] = lcElement;
132
+ }
133
+ element = lcElement;
134
+ }
135
+ }
136
+ set[element] = true;
137
+ }
138
+ return set;
139
+ }
140
+ /**
141
+ * Clean up an array to harden against CSPP
142
+ *
143
+ * @param array - The array to be cleaned.
144
+ * @returns The cleaned version of the array
145
+ */
146
+ function cleanArray(array) {
147
+ for (let index = 0; index < array.length; index++) {
148
+ const isPropertyExist = objectHasOwnProperty(array, index);
149
+ if (!isPropertyExist) {
150
+ array[index] = null;
151
+ }
152
+ }
153
+ return array;
154
+ }
155
+ /**
156
+ * Shallow clone an object
157
+ *
158
+ * @param object - The object to be cloned.
159
+ * @returns A new object that copies the original.
160
+ */
161
+ function clone(object) {
162
+ const newObject = create(null);
163
+ for (const [property, value] of entries(object)) {
164
+ const isPropertyExist = objectHasOwnProperty(object, property);
165
+ if (isPropertyExist) {
166
+ if (Array.isArray(value)) {
167
+ newObject[property] = cleanArray(value);
168
+ } else if (value && typeof value === 'object' && value.constructor === Object) {
169
+ newObject[property] = clone(value);
170
+ } else {
171
+ newObject[property] = value;
172
+ }
173
+ }
174
+ }
175
+ return newObject;
176
+ }
177
+ /**
178
+ * This method automatically checks if the prop is function or getter and behaves accordingly.
179
+ *
180
+ * @param object - The object to look up the getter function in its prototype chain.
181
+ * @param prop - The property name for which to find the getter function.
182
+ * @returns The getter function found in the prototype chain or a fallback function.
183
+ */
184
+ function lookupGetter(object, prop) {
185
+ while (object !== null) {
186
+ const desc = getOwnPropertyDescriptor(object, prop);
187
+ if (desc) {
188
+ if (desc.get) {
189
+ return unapply(desc.get);
190
+ }
191
+ if (typeof desc.value === 'function') {
192
+ return unapply(desc.value);
193
+ }
194
+ }
195
+ object = getPrototypeOf(object);
196
+ }
197
+ function fallbackValue() {
198
+ return null;
199
+ }
200
+ return fallbackValue;
201
+ }
202
+
203
+ 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']);
204
+ 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']);
205
+ 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']);
206
+ // List of SVG elements that are disallowed by default.
207
+ // We still need to know them so that we can do namespace
208
+ // checks properly in case one wants to add them to
209
+ // allow-list.
210
+ const svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);
211
+ const mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']);
212
+ // Similarly to SVG, we want to know all MathML elements,
213
+ // even those that we disallow by default.
214
+ const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);
215
+ const text = freeze(['#text']);
216
+
217
+ 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']);
218
+ 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']);
219
+ 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']);
220
+ const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
221
+
222
+ // eslint-disable-next-line unicorn/better-regex
223
+ const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode
224
+ const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
225
+ const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm); // eslint-disable-line unicorn/better-regex
226
+ const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); // eslint-disable-line no-useless-escape
227
+ const ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
228
+ 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
229
+ );
230
+ const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
231
+ const ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex
232
+ );
233
+ const DOCTYPE_NAME = seal(/^html$/i);
234
+ const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
235
+
236
+ var EXPRESSIONS = /*#__PURE__*/Object.freeze({
237
+ __proto__: null,
238
+ ARIA_ATTR: ARIA_ATTR,
239
+ ATTR_WHITESPACE: ATTR_WHITESPACE,
240
+ CUSTOM_ELEMENT: CUSTOM_ELEMENT,
241
+ DATA_ATTR: DATA_ATTR,
242
+ DOCTYPE_NAME: DOCTYPE_NAME,
243
+ ERB_EXPR: ERB_EXPR,
244
+ IS_ALLOWED_URI: IS_ALLOWED_URI,
245
+ IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,
246
+ MUSTACHE_EXPR: MUSTACHE_EXPR,
247
+ TMPLIT_EXPR: TMPLIT_EXPR
248
+ });
249
+
250
+ /* eslint-disable @typescript-eslint/indent */
251
+ // https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
252
+ const NODE_TYPE = {
253
+ element: 1,
254
+ attribute: 2,
255
+ text: 3,
256
+ cdataSection: 4,
257
+ entityReference: 5,
258
+ // Deprecated
259
+ entityNode: 6,
260
+ // Deprecated
261
+ progressingInstruction: 7,
262
+ comment: 8,
263
+ document: 9,
264
+ documentType: 10,
265
+ documentFragment: 11,
266
+ notation: 12 // Deprecated
267
+ };
268
+ const getGlobal = function getGlobal() {
269
+ return typeof window === 'undefined' ? null : window;
270
+ };
271
+ /**
272
+ * Creates a no-op policy for internal use only.
273
+ * Don't export this function outside this module!
274
+ * @param trustedTypes The policy factory.
275
+ * @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).
276
+ * @return The policy created (or null, if Trusted Types
277
+ * are not supported or creating the policy failed).
278
+ */
279
+ const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {
280
+ if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {
281
+ return null;
282
+ }
283
+ // Allow the callers to control the unique policy name
284
+ // by adding a data-tt-policy-suffix to the script element with the DOMPurify.
285
+ // Policy creation with duplicate names throws in Trusted Types.
286
+ let suffix = null;
287
+ const ATTR_NAME = 'data-tt-policy-suffix';
288
+ if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {
289
+ suffix = purifyHostElement.getAttribute(ATTR_NAME);
290
+ }
291
+ const policyName = 'dompurify' + (suffix ? '#' + suffix : '');
292
+ try {
293
+ return trustedTypes.createPolicy(policyName, {
294
+ createHTML(html) {
295
+ return html;
296
+ },
297
+ createScriptURL(scriptUrl) {
298
+ return scriptUrl;
299
+ }
300
+ });
301
+ } catch (_) {
302
+ // Policy creation failed (most likely another DOMPurify script has
303
+ // already run). Skip creating the policy, as this will only cause errors
304
+ // if TT are enforced.
305
+ console.warn('TrustedTypes policy ' + policyName + ' could not be created.');
306
+ return null;
307
+ }
308
+ };
309
+ const _createHooksMap = function _createHooksMap() {
310
+ return {
311
+ afterSanitizeAttributes: [],
312
+ afterSanitizeElements: [],
313
+ afterSanitizeShadowDOM: [],
314
+ beforeSanitizeAttributes: [],
315
+ beforeSanitizeElements: [],
316
+ beforeSanitizeShadowDOM: [],
317
+ uponSanitizeAttribute: [],
318
+ uponSanitizeElement: [],
319
+ uponSanitizeShadowNode: []
320
+ };
321
+ };
322
+ function createDOMPurify() {
323
+ let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
324
+ const DOMPurify = root => createDOMPurify(root);
325
+ DOMPurify.version = '3.2.6';
326
+ DOMPurify.removed = [];
327
+ if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
328
+ // Not running in a browser, provide a factory function
329
+ // so that you can pass your own Window
330
+ DOMPurify.isSupported = false;
331
+ return DOMPurify;
332
+ }
333
+ let {
334
+ document
335
+ } = window;
336
+ const originalDocument = document;
337
+ const currentScript = originalDocument.currentScript;
338
+ const {
339
+ DocumentFragment,
340
+ HTMLTemplateElement,
341
+ Node,
342
+ Element,
343
+ NodeFilter,
344
+ NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,
345
+ HTMLFormElement,
346
+ DOMParser,
347
+ trustedTypes
348
+ } = window;
349
+ const ElementPrototype = Element.prototype;
350
+ const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');
351
+ const remove = lookupGetter(ElementPrototype, 'remove');
352
+ const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');
353
+ const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');
354
+ const getParentNode = lookupGetter(ElementPrototype, 'parentNode');
355
+ // As per issue #47, the web-components registry is inherited by a
356
+ // new document created via createHTMLDocument. As per the spec
357
+ // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)
358
+ // a new empty registry is used when creating a template contents owner
359
+ // document, so we use that as our parent document to ensure nothing
360
+ // is inherited.
361
+ if (typeof HTMLTemplateElement === 'function') {
362
+ const template = document.createElement('template');
363
+ if (template.content && template.content.ownerDocument) {
364
+ document = template.content.ownerDocument;
365
+ }
366
+ }
367
+ let trustedTypesPolicy;
368
+ let emptyHTML = '';
369
+ const {
370
+ implementation,
371
+ createNodeIterator,
372
+ createDocumentFragment,
373
+ getElementsByTagName
374
+ } = document;
375
+ const {
376
+ importNode
377
+ } = originalDocument;
378
+ let hooks = _createHooksMap();
379
+ /**
380
+ * Expose whether this browser supports running the full DOMPurify.
381
+ */
382
+ DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;
383
+ const {
384
+ MUSTACHE_EXPR,
385
+ ERB_EXPR,
386
+ TMPLIT_EXPR,
387
+ DATA_ATTR,
388
+ ARIA_ATTR,
389
+ IS_SCRIPT_OR_DATA,
390
+ ATTR_WHITESPACE,
391
+ CUSTOM_ELEMENT
392
+ } = EXPRESSIONS;
393
+ let {
394
+ IS_ALLOWED_URI: IS_ALLOWED_URI$1
395
+ } = EXPRESSIONS;
396
+ /**
397
+ * We consider the elements and attributes below to be safe. Ideally
398
+ * don't add any new ones but feel free to remove unwanted ones.
399
+ */
400
+ /* allowed element names */
401
+ let ALLOWED_TAGS = null;
402
+ const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);
403
+ /* Allowed attribute names */
404
+ let ALLOWED_ATTR = null;
405
+ const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);
406
+ /*
407
+ * Configure how DOMPurify should handle custom elements and their attributes as well as customized built-in elements.
408
+ * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)
409
+ * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)
410
+ * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.
411
+ */
412
+ let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {
413
+ tagNameCheck: {
414
+ writable: true,
415
+ configurable: false,
416
+ enumerable: true,
417
+ value: null
418
+ },
419
+ attributeNameCheck: {
420
+ writable: true,
421
+ configurable: false,
422
+ enumerable: true,
423
+ value: null
424
+ },
425
+ allowCustomizedBuiltInElements: {
426
+ writable: true,
427
+ configurable: false,
428
+ enumerable: true,
429
+ value: false
430
+ }
431
+ }));
432
+ /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */
433
+ let FORBID_TAGS = null;
434
+ /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */
435
+ let FORBID_ATTR = null;
436
+ /* Decide if ARIA attributes are okay */
437
+ let ALLOW_ARIA_ATTR = true;
438
+ /* Decide if custom data attributes are okay */
439
+ let ALLOW_DATA_ATTR = true;
440
+ /* Decide if unknown protocols are okay */
441
+ let ALLOW_UNKNOWN_PROTOCOLS = false;
442
+ /* Decide if self-closing tags in attributes are allowed.
443
+ * Usually removed due to a mXSS issue in jQuery 3.0 */
444
+ let ALLOW_SELF_CLOSE_IN_ATTR = true;
445
+ /* Output should be safe for common template engines.
446
+ * This means, DOMPurify removes data attributes, mustaches and ERB
447
+ */
448
+ let SAFE_FOR_TEMPLATES = false;
449
+ /* Output should be safe even for XML used within HTML and alike.
450
+ * This means, DOMPurify removes comments when containing risky content.
451
+ */
452
+ let SAFE_FOR_XML = true;
453
+ /* Decide if document with <html>... should be returned */
454
+ let WHOLE_DOCUMENT = false;
455
+ /* Track whether config is already set on this instance of DOMPurify. */
456
+ let SET_CONFIG = false;
457
+ /* Decide if all elements (e.g. style, script) must be children of
458
+ * document.body. By default, browsers might move them to document.head */
459
+ let FORCE_BODY = false;
460
+ /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html
461
+ * string (or a TrustedHTML object if Trusted Types are supported).
462
+ * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead
463
+ */
464
+ let RETURN_DOM = false;
465
+ /* Decide if a DOM `DocumentFragment` should be returned, instead of a html
466
+ * string (or a TrustedHTML object if Trusted Types are supported) */
467
+ let RETURN_DOM_FRAGMENT = false;
468
+ /* Try to return a Trusted Type object instead of a string, return a string in
469
+ * case Trusted Types are not supported */
470
+ let RETURN_TRUSTED_TYPE = false;
471
+ /* Output should be free from DOM clobbering attacks?
472
+ * This sanitizes markups named with colliding, clobberable built-in DOM APIs.
473
+ */
474
+ let SANITIZE_DOM = true;
475
+ /* Achieve full DOM Clobbering protection by isolating the namespace of named
476
+ * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.
477
+ *
478
+ * HTML/DOM spec rules that enable DOM Clobbering:
479
+ * - Named Access on Window (§7.3.3)
480
+ * - DOM Tree Accessors (§3.1.5)
481
+ * - Form Element Parent-Child Relations (§4.10.3)
482
+ * - Iframe srcdoc / Nested WindowProxies (§4.8.5)
483
+ * - HTMLCollection (§4.2.10.2)
484
+ *
485
+ * Namespace isolation is implemented by prefixing `id` and `name` attributes
486
+ * with a constant string, i.e., `user-content-`
487
+ */
488
+ let SANITIZE_NAMED_PROPS = false;
489
+ const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';
490
+ /* Keep element content when removing element? */
491
+ let KEEP_CONTENT = true;
492
+ /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead
493
+ * of importing it into a new Document and returning a sanitized copy */
494
+ let IN_PLACE = false;
495
+ /* Allow usage of profiles like html, svg and mathMl */
496
+ let USE_PROFILES = {};
497
+ /* Tags to ignore content of when KEEP_CONTENT is true */
498
+ let FORBID_CONTENTS = null;
499
+ const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);
500
+ /* Tags that are safe for data: URIs */
501
+ let DATA_URI_TAGS = null;
502
+ const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);
503
+ /* Attributes safe for values like "javascript:" */
504
+ let URI_SAFE_ATTRIBUTES = null;
505
+ const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);
506
+ const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
507
+ const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
508
+ const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
509
+ /* Document namespace */
510
+ let NAMESPACE = HTML_NAMESPACE;
511
+ let IS_EMPTY_INPUT = false;
512
+ /* Allowed XHTML+XML namespaces */
513
+ let ALLOWED_NAMESPACES = null;
514
+ const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
515
+ let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);
516
+ let HTML_INTEGRATION_POINTS = addToSet({}, ['annotation-xml']);
517
+ // Certain elements are allowed in both SVG and HTML
518
+ // namespace. We need to specify them explicitly
519
+ // so that they don't get erroneously deleted from
520
+ // HTML namespace.
521
+ const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);
522
+ /* Parsing of strict XHTML documents */
523
+ let PARSER_MEDIA_TYPE = null;
524
+ const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];
525
+ const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';
526
+ let transformCaseFunc = null;
527
+ /* Keep a reference to config to pass to hooks */
528
+ let CONFIG = null;
529
+ /* Ideally, do not touch anything below this line */
530
+ /* ______________________________________________ */
531
+ const formElement = document.createElement('form');
532
+ const isRegexOrFunction = function isRegexOrFunction(testValue) {
533
+ return testValue instanceof RegExp || testValue instanceof Function;
534
+ };
535
+ /**
536
+ * _parseConfig
537
+ *
538
+ * @param cfg optional config literal
539
+ */
540
+ // eslint-disable-next-line complexity
541
+ const _parseConfig = function _parseConfig() {
542
+ let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
543
+ if (CONFIG && CONFIG === cfg) {
544
+ return;
545
+ }
546
+ /* Shield configuration object from tampering */
547
+ if (!cfg || typeof cfg !== 'object') {
548
+ cfg = {};
549
+ }
550
+ /* Shield configuration object from prototype pollution */
551
+ cfg = clone(cfg);
552
+ PARSER_MEDIA_TYPE =
553
+ // eslint-disable-next-line unicorn/prefer-includes
554
+ SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
555
+ // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.
556
+ transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;
557
+ /* Set configuration parameters */
558
+ ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
559
+ ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
560
+ ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
561
+ 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;
562
+ 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;
563
+ FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
564
+ FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : clone({});
565
+ FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : clone({});
566
+ USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false;
567
+ ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true
568
+ ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true
569
+ ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false
570
+ ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true
571
+ SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false
572
+ SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true
573
+ WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false
574
+ RETURN_DOM = cfg.RETURN_DOM || false; // Default false
575
+ RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false
576
+ RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false
577
+ FORCE_BODY = cfg.FORCE_BODY || false; // Default false
578
+ SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true
579
+ SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false
580
+ KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true
581
+ IN_PLACE = cfg.IN_PLACE || false; // Default false
582
+ IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;
583
+ NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
584
+ MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS;
585
+ HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS;
586
+ CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};
587
+ if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {
588
+ CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
589
+ }
590
+ if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {
591
+ CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;
592
+ }
593
+ if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {
594
+ CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;
595
+ }
596
+ if (SAFE_FOR_TEMPLATES) {
597
+ ALLOW_DATA_ATTR = false;
598
+ }
599
+ if (RETURN_DOM_FRAGMENT) {
600
+ RETURN_DOM = true;
601
+ }
602
+ /* Parse profile info */
603
+ if (USE_PROFILES) {
604
+ ALLOWED_TAGS = addToSet({}, text);
605
+ ALLOWED_ATTR = [];
606
+ if (USE_PROFILES.html === true) {
607
+ addToSet(ALLOWED_TAGS, html$1);
608
+ addToSet(ALLOWED_ATTR, html);
609
+ }
610
+ if (USE_PROFILES.svg === true) {
611
+ addToSet(ALLOWED_TAGS, svg$1);
612
+ addToSet(ALLOWED_ATTR, svg);
613
+ addToSet(ALLOWED_ATTR, xml);
614
+ }
615
+ if (USE_PROFILES.svgFilters === true) {
616
+ addToSet(ALLOWED_TAGS, svgFilters);
617
+ addToSet(ALLOWED_ATTR, svg);
618
+ addToSet(ALLOWED_ATTR, xml);
619
+ }
620
+ if (USE_PROFILES.mathMl === true) {
621
+ addToSet(ALLOWED_TAGS, mathMl$1);
622
+ addToSet(ALLOWED_ATTR, mathMl);
623
+ addToSet(ALLOWED_ATTR, xml);
624
+ }
625
+ }
626
+ /* Merge configuration parameters */
627
+ if (cfg.ADD_TAGS) {
628
+ if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
629
+ ALLOWED_TAGS = clone(ALLOWED_TAGS);
630
+ }
631
+ addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
632
+ }
633
+ if (cfg.ADD_ATTR) {
634
+ if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
635
+ ALLOWED_ATTR = clone(ALLOWED_ATTR);
636
+ }
637
+ addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
638
+ }
639
+ if (cfg.ADD_URI_SAFE_ATTR) {
640
+ addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
641
+ }
642
+ if (cfg.FORBID_CONTENTS) {
643
+ if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
644
+ FORBID_CONTENTS = clone(FORBID_CONTENTS);
645
+ }
646
+ addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
647
+ }
648
+ /* Add #text in case KEEP_CONTENT is set to true */
649
+ if (KEEP_CONTENT) {
650
+ ALLOWED_TAGS['#text'] = true;
651
+ }
652
+ /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */
653
+ if (WHOLE_DOCUMENT) {
654
+ addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);
655
+ }
656
+ /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */
657
+ if (ALLOWED_TAGS.table) {
658
+ addToSet(ALLOWED_TAGS, ['tbody']);
659
+ delete FORBID_TAGS.tbody;
660
+ }
661
+ if (cfg.TRUSTED_TYPES_POLICY) {
662
+ if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {
663
+ throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
664
+ }
665
+ if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {
666
+ throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
667
+ }
668
+ // Overwrite existing TrustedTypes policy.
669
+ trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
670
+ // Sign local variables required by `sanitize`.
671
+ emptyHTML = trustedTypesPolicy.createHTML('');
672
+ } else {
673
+ // Uninitialized policy, attempt to initialize the internal dompurify policy.
674
+ if (trustedTypesPolicy === undefined) {
675
+ trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
676
+ }
677
+ // If creating the internal policy succeeded sign internal variables.
678
+ if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {
679
+ emptyHTML = trustedTypesPolicy.createHTML('');
680
+ }
681
+ }
682
+ // Prevent further manipulation of configuration.
683
+ // Not available in IE8, Safari 5, etc.
684
+ if (freeze) {
685
+ freeze(cfg);
686
+ }
687
+ CONFIG = cfg;
688
+ };
689
+ /* Keep track of all possible SVG and MathML tags
690
+ * so that we can perform the namespace checks
691
+ * correctly. */
692
+ const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
693
+ const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
694
+ /**
695
+ * @param element a DOM element whose namespace is being checked
696
+ * @returns Return false if the element has a
697
+ * namespace that a spec-compliant parser would never
698
+ * return. Return true otherwise.
699
+ */
700
+ const _checkValidNamespace = function _checkValidNamespace(element) {
701
+ let parent = getParentNode(element);
702
+ // In JSDOM, if we're inside shadow DOM, then parentNode
703
+ // can be null. We just simulate parent in this case.
704
+ if (!parent || !parent.tagName) {
705
+ parent = {
706
+ namespaceURI: NAMESPACE,
707
+ tagName: 'template'
708
+ };
709
+ }
710
+ const tagName = stringToLowerCase(element.tagName);
711
+ const parentTagName = stringToLowerCase(parent.tagName);
712
+ if (!ALLOWED_NAMESPACES[element.namespaceURI]) {
713
+ return false;
714
+ }
715
+ if (element.namespaceURI === SVG_NAMESPACE) {
716
+ // The only way to switch from HTML namespace to SVG
717
+ // is via <svg>. If it happens via any other tag, then
718
+ // it should be killed.
719
+ if (parent.namespaceURI === HTML_NAMESPACE) {
720
+ return tagName === 'svg';
721
+ }
722
+ // The only way to switch from MathML to SVG is via`
723
+ // svg if parent is either <annotation-xml> or MathML
724
+ // text integration points.
725
+ if (parent.namespaceURI === MATHML_NAMESPACE) {
726
+ return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
727
+ }
728
+ // We only allow elements that are defined in SVG
729
+ // spec. All others are disallowed in SVG namespace.
730
+ return Boolean(ALL_SVG_TAGS[tagName]);
731
+ }
732
+ if (element.namespaceURI === MATHML_NAMESPACE) {
733
+ // The only way to switch from HTML namespace to MathML
734
+ // is via <math>. If it happens via any other tag, then
735
+ // it should be killed.
736
+ if (parent.namespaceURI === HTML_NAMESPACE) {
737
+ return tagName === 'math';
738
+ }
739
+ // The only way to switch from SVG to MathML is via
740
+ // <math> and HTML integration points
741
+ if (parent.namespaceURI === SVG_NAMESPACE) {
742
+ return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
743
+ }
744
+ // We only allow elements that are defined in MathML
745
+ // spec. All others are disallowed in MathML namespace.
746
+ return Boolean(ALL_MATHML_TAGS[tagName]);
747
+ }
748
+ if (element.namespaceURI === HTML_NAMESPACE) {
749
+ // The only way to switch from SVG to HTML is via
750
+ // HTML integration points, and from MathML to HTML
751
+ // is via MathML text integration points
752
+ if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
753
+ return false;
754
+ }
755
+ if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
756
+ return false;
757
+ }
758
+ // We disallow tags that are specific for MathML
759
+ // or SVG and should never appear in HTML namespace
760
+ return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
761
+ }
762
+ // For XHTML and XML documents that support custom namespaces
763
+ if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {
764
+ return true;
765
+ }
766
+ // The code should never reach this place (this means
767
+ // that the element somehow got namespace that is not
768
+ // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).
769
+ // Return false just in case.
770
+ return false;
771
+ };
772
+ /**
773
+ * _forceRemove
774
+ *
775
+ * @param node a DOM node
776
+ */
777
+ const _forceRemove = function _forceRemove(node) {
778
+ arrayPush(DOMPurify.removed, {
779
+ element: node
780
+ });
781
+ try {
782
+ // eslint-disable-next-line unicorn/prefer-dom-node-remove
783
+ getParentNode(node).removeChild(node);
784
+ } catch (_) {
785
+ remove(node);
786
+ }
787
+ };
788
+ /**
789
+ * _removeAttribute
790
+ *
791
+ * @param name an Attribute name
792
+ * @param element a DOM node
793
+ */
794
+ const _removeAttribute = function _removeAttribute(name, element) {
795
+ try {
796
+ arrayPush(DOMPurify.removed, {
797
+ attribute: element.getAttributeNode(name),
798
+ from: element
799
+ });
800
+ } catch (_) {
801
+ arrayPush(DOMPurify.removed, {
802
+ attribute: null,
803
+ from: element
804
+ });
805
+ }
806
+ element.removeAttribute(name);
807
+ // We void attribute values for unremovable "is" attributes
808
+ if (name === 'is') {
809
+ if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
810
+ try {
811
+ _forceRemove(element);
812
+ } catch (_) {}
813
+ } else {
814
+ try {
815
+ element.setAttribute(name, '');
816
+ } catch (_) {}
817
+ }
818
+ }
819
+ };
820
+ /**
821
+ * _initDocument
822
+ *
823
+ * @param dirty - a string of dirty markup
824
+ * @return a DOM, filled with the dirty markup
825
+ */
826
+ const _initDocument = function _initDocument(dirty) {
827
+ /* Create a HTML document */
828
+ let doc = null;
829
+ let leadingWhitespace = null;
830
+ if (FORCE_BODY) {
831
+ dirty = '<remove></remove>' + dirty;
832
+ } else {
833
+ /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */
834
+ const matches = stringMatch(dirty, /^[\r\n\t ]+/);
835
+ leadingWhitespace = matches && matches[0];
836
+ }
837
+ if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {
838
+ // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)
839
+ dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + '</body></html>';
840
+ }
841
+ const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
842
+ /*
843
+ * Use the DOMParser API by default, fallback later if needs be
844
+ * DOMParser not work for svg when has multiple root element.
845
+ */
846
+ if (NAMESPACE === HTML_NAMESPACE) {
847
+ try {
848
+ doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
849
+ } catch (_) {}
850
+ }
851
+ /* Use createHTMLDocument in case DOMParser is not available */
852
+ if (!doc || !doc.documentElement) {
853
+ doc = implementation.createDocument(NAMESPACE, 'template', null);
854
+ try {
855
+ doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
856
+ } catch (_) {
857
+ // Syntax error if dirtyPayload is invalid xml
858
+ }
859
+ }
860
+ const body = doc.body || doc.documentElement;
861
+ if (dirty && leadingWhitespace) {
862
+ body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
863
+ }
864
+ /* Work on whole document or just its body */
865
+ if (NAMESPACE === HTML_NAMESPACE) {
866
+ return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];
867
+ }
868
+ return WHOLE_DOCUMENT ? doc.documentElement : body;
869
+ };
870
+ /**
871
+ * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
872
+ *
873
+ * @param root The root element or node to start traversing on.
874
+ * @return The created NodeIterator
875
+ */
876
+ const _createNodeIterator = function _createNodeIterator(root) {
877
+ return createNodeIterator.call(root.ownerDocument || root, root,
878
+ // eslint-disable-next-line no-bitwise
879
+ NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
880
+ };
881
+ /**
882
+ * _isClobbered
883
+ *
884
+ * @param element element to check for clobbering attacks
885
+ * @return true if clobbered, false if safe
886
+ */
887
+ const _isClobbered = function _isClobbered(element) {
888
+ return element instanceof HTMLFormElement && (typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function');
889
+ };
890
+ /**
891
+ * Checks whether the given object is a DOM node.
892
+ *
893
+ * @param value object to check whether it's a DOM node
894
+ * @return true is object is a DOM node
895
+ */
896
+ const _isNode = function _isNode(value) {
897
+ return typeof Node === 'function' && value instanceof Node;
898
+ };
899
+ function _executeHooks(hooks, currentNode, data) {
900
+ arrayForEach(hooks, hook => {
901
+ hook.call(DOMPurify, currentNode, data, CONFIG);
902
+ });
903
+ }
904
+ /**
905
+ * _sanitizeElements
906
+ *
907
+ * @protect nodeName
908
+ * @protect textContent
909
+ * @protect removeChild
910
+ * @param currentNode to check for permission to exist
911
+ * @return true if node was killed, false if left alive
912
+ */
913
+ const _sanitizeElements = function _sanitizeElements(currentNode) {
914
+ let content = null;
915
+ /* Execute a hook if present */
916
+ _executeHooks(hooks.beforeSanitizeElements, currentNode, null);
917
+ /* Check if element is clobbered or can clobber */
918
+ if (_isClobbered(currentNode)) {
919
+ _forceRemove(currentNode);
920
+ return true;
921
+ }
922
+ /* Now let's check the element's type and name */
923
+ const tagName = transformCaseFunc(currentNode.nodeName);
924
+ /* Execute a hook if present */
925
+ _executeHooks(hooks.uponSanitizeElement, currentNode, {
926
+ tagName,
927
+ allowedTags: ALLOWED_TAGS
928
+ });
929
+ /* Detect mXSS attempts abusing namespace confusion */
930
+ if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w!]/g, currentNode.innerHTML) && regExpTest(/<[/\w!]/g, currentNode.textContent)) {
931
+ _forceRemove(currentNode);
932
+ return true;
933
+ }
934
+ /* Remove any occurrence of processing instructions */
935
+ if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {
936
+ _forceRemove(currentNode);
937
+ return true;
938
+ }
939
+ /* Remove any kind of possibly harmful comments */
940
+ if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) {
941
+ _forceRemove(currentNode);
942
+ return true;
943
+ }
944
+ /* Remove element if anything forbids its presence */
945
+ if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
946
+ /* Check if we have a custom element to handle */
947
+ if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
948
+ if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
949
+ return false;
950
+ }
951
+ if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {
952
+ return false;
953
+ }
954
+ }
955
+ /* Keep content except for bad-listed elements */
956
+ if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
957
+ const parentNode = getParentNode(currentNode) || currentNode.parentNode;
958
+ const childNodes = getChildNodes(currentNode) || currentNode.childNodes;
959
+ if (childNodes && parentNode) {
960
+ const childCount = childNodes.length;
961
+ for (let i = childCount - 1; i >= 0; --i) {
962
+ const childClone = cloneNode(childNodes[i], true);
963
+ childClone.__removalCount = (currentNode.__removalCount || 0) + 1;
964
+ parentNode.insertBefore(childClone, getNextSibling(currentNode));
965
+ }
966
+ }
967
+ }
968
+ _forceRemove(currentNode);
969
+ return true;
970
+ }
971
+ /* Check whether element has a valid namespace */
972
+ if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {
973
+ _forceRemove(currentNode);
974
+ return true;
975
+ }
976
+ /* Make sure that older browsers don't get fallback-tag mXSS */
977
+ if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) {
978
+ _forceRemove(currentNode);
979
+ return true;
980
+ }
981
+ /* Sanitize element content to be template-safe */
982
+ if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
983
+ /* Get the element's text content */
984
+ content = currentNode.textContent;
985
+ arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
986
+ content = stringReplace(content, expr, ' ');
987
+ });
988
+ if (currentNode.textContent !== content) {
989
+ arrayPush(DOMPurify.removed, {
990
+ element: currentNode.cloneNode()
991
+ });
992
+ currentNode.textContent = content;
993
+ }
994
+ }
995
+ /* Execute a hook if present */
996
+ _executeHooks(hooks.afterSanitizeElements, currentNode, null);
997
+ return false;
998
+ };
999
+ /**
1000
+ * _isValidAttribute
1001
+ *
1002
+ * @param lcTag Lowercase tag name of containing element.
1003
+ * @param lcName Lowercase attribute name.
1004
+ * @param value Attribute value.
1005
+ * @return Returns true if `value` is valid, otherwise false.
1006
+ */
1007
+ // eslint-disable-next-line complexity
1008
+ const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
1009
+ /* Make sure attribute cannot clobber */
1010
+ if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {
1011
+ return false;
1012
+ }
1013
+ /* Allow valid data-* attributes: At least one character after "-"
1014
+ (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
1015
+ XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
1016
+ We don't need to check the value; it's always URI safe. */
1017
+ if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
1018
+ if (
1019
+ // First condition does a very basic check if a) it's basically a valid custom element tagname AND
1020
+ // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
1021
+ // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
1022
+ _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)) ||
1023
+ // Alternative, second condition checks if it's an `is`-attribute, AND
1024
+ // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
1025
+ 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 {
1026
+ return false;
1027
+ }
1028
+ /* Check value is safe. First, is attr inert? If so, is safe */
1029
+ } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) {
1030
+ return false;
1031
+ } else ;
1032
+ return true;
1033
+ };
1034
+ /**
1035
+ * _isBasicCustomElement
1036
+ * checks if at least one dash is included in tagName, and it's not the first char
1037
+ * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name
1038
+ *
1039
+ * @param tagName name of the tag of the node to sanitize
1040
+ * @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.
1041
+ */
1042
+ const _isBasicCustomElement = function _isBasicCustomElement(tagName) {
1043
+ return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);
1044
+ };
1045
+ /**
1046
+ * _sanitizeAttributes
1047
+ *
1048
+ * @protect attributes
1049
+ * @protect nodeName
1050
+ * @protect removeAttribute
1051
+ * @protect setAttribute
1052
+ *
1053
+ * @param currentNode to sanitize
1054
+ */
1055
+ const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
1056
+ /* Execute a hook if present */
1057
+ _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
1058
+ const {
1059
+ attributes
1060
+ } = currentNode;
1061
+ /* Check if we have attributes; if not we might have a text node */
1062
+ if (!attributes || _isClobbered(currentNode)) {
1063
+ return;
1064
+ }
1065
+ const hookEvent = {
1066
+ attrName: '',
1067
+ attrValue: '',
1068
+ keepAttr: true,
1069
+ allowedAttributes: ALLOWED_ATTR,
1070
+ forceKeepAttr: undefined
1071
+ };
1072
+ let l = attributes.length;
1073
+ /* Go backwards over all attributes; safely remove bad ones */
1074
+ while (l--) {
1075
+ const attr = attributes[l];
1076
+ const {
1077
+ name,
1078
+ namespaceURI,
1079
+ value: attrValue
1080
+ } = attr;
1081
+ const lcName = transformCaseFunc(name);
1082
+ const initValue = attrValue;
1083
+ let value = name === 'value' ? initValue : stringTrim(initValue);
1084
+ /* Execute a hook if present */
1085
+ hookEvent.attrName = lcName;
1086
+ hookEvent.attrValue = value;
1087
+ hookEvent.keepAttr = true;
1088
+ hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set
1089
+ _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);
1090
+ value = hookEvent.attrValue;
1091
+ /* Full DOM Clobbering protection via namespace isolation,
1092
+ * Prefix id and name attributes with `user-content-`
1093
+ */
1094
+ if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {
1095
+ // Remove the attribute with this value
1096
+ _removeAttribute(name, currentNode);
1097
+ // Prefix the value and later re-create the attribute with the sanitized value
1098
+ value = SANITIZE_NAMED_PROPS_PREFIX + value;
1099
+ }
1100
+ /* Work around a security issue with comments inside attributes */
1101
+ if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) {
1102
+ _removeAttribute(name, currentNode);
1103
+ continue;
1104
+ }
1105
+ /* Did the hooks approve of the attribute? */
1106
+ if (hookEvent.forceKeepAttr) {
1107
+ continue;
1108
+ }
1109
+ /* Did the hooks approve of the attribute? */
1110
+ if (!hookEvent.keepAttr) {
1111
+ _removeAttribute(name, currentNode);
1112
+ continue;
1113
+ }
1114
+ /* Work around a security issue in jQuery 3.0 */
1115
+ if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) {
1116
+ _removeAttribute(name, currentNode);
1117
+ continue;
1118
+ }
1119
+ /* Sanitize attribute content to be template-safe */
1120
+ if (SAFE_FOR_TEMPLATES) {
1121
+ arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
1122
+ value = stringReplace(value, expr, ' ');
1123
+ });
1124
+ }
1125
+ /* Is `value` valid for this attribute? */
1126
+ const lcTag = transformCaseFunc(currentNode.nodeName);
1127
+ if (!_isValidAttribute(lcTag, lcName, value)) {
1128
+ _removeAttribute(name, currentNode);
1129
+ continue;
1130
+ }
1131
+ /* Handle attributes that require Trusted Types */
1132
+ if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {
1133
+ if (namespaceURI) ; else {
1134
+ switch (trustedTypes.getAttributeType(lcTag, lcName)) {
1135
+ case 'TrustedHTML':
1136
+ {
1137
+ value = trustedTypesPolicy.createHTML(value);
1138
+ break;
1139
+ }
1140
+ case 'TrustedScriptURL':
1141
+ {
1142
+ value = trustedTypesPolicy.createScriptURL(value);
1143
+ break;
1144
+ }
1145
+ }
1146
+ }
1147
+ }
1148
+ /* Handle invalid data-* attribute set by try-catching it */
1149
+ if (value !== initValue) {
1150
+ try {
1151
+ if (namespaceURI) {
1152
+ currentNode.setAttributeNS(namespaceURI, name, value);
1153
+ } else {
1154
+ /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
1155
+ currentNode.setAttribute(name, value);
1156
+ }
1157
+ if (_isClobbered(currentNode)) {
1158
+ _forceRemove(currentNode);
1159
+ } else {
1160
+ arrayPop(DOMPurify.removed);
1161
+ }
1162
+ } catch (_) {
1163
+ _removeAttribute(name, currentNode);
1164
+ }
1165
+ }
1166
+ }
1167
+ /* Execute a hook if present */
1168
+ _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
1169
+ };
1170
+ /**
1171
+ * _sanitizeShadowDOM
1172
+ *
1173
+ * @param fragment to iterate over recursively
1174
+ */
1175
+ const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {
1176
+ let shadowNode = null;
1177
+ const shadowIterator = _createNodeIterator(fragment);
1178
+ /* Execute a hook if present */
1179
+ _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);
1180
+ while (shadowNode = shadowIterator.nextNode()) {
1181
+ /* Execute a hook if present */
1182
+ _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
1183
+ /* Sanitize tags and elements */
1184
+ _sanitizeElements(shadowNode);
1185
+ /* Check attributes next */
1186
+ _sanitizeAttributes(shadowNode);
1187
+ /* Deep shadow DOM detected */
1188
+ if (shadowNode.content instanceof DocumentFragment) {
1189
+ _sanitizeShadowDOM(shadowNode.content);
1190
+ }
1191
+ }
1192
+ /* Execute a hook if present */
1193
+ _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
1194
+ };
1195
+ // eslint-disable-next-line complexity
1196
+ DOMPurify.sanitize = function (dirty) {
1197
+ let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1198
+ let body = null;
1199
+ let importedNode = null;
1200
+ let currentNode = null;
1201
+ let returnNode = null;
1202
+ /* Make sure we have a string to sanitize.
1203
+ DO NOT return early, as this will return the wrong type if
1204
+ the user has requested a DOM object rather than a string */
1205
+ IS_EMPTY_INPUT = !dirty;
1206
+ if (IS_EMPTY_INPUT) {
1207
+ dirty = '<!-->';
1208
+ }
1209
+ /* Stringify, in case dirty is an object */
1210
+ if (typeof dirty !== 'string' && !_isNode(dirty)) {
1211
+ if (typeof dirty.toString === 'function') {
1212
+ dirty = dirty.toString();
1213
+ if (typeof dirty !== 'string') {
1214
+ throw typeErrorCreate('dirty is not a string, aborting');
1215
+ }
1216
+ } else {
1217
+ throw typeErrorCreate('toString is not a function');
1218
+ }
1219
+ }
1220
+ /* Return dirty HTML if DOMPurify cannot run */
1221
+ if (!DOMPurify.isSupported) {
1222
+ return dirty;
1223
+ }
1224
+ /* Assign config vars */
1225
+ if (!SET_CONFIG) {
1226
+ _parseConfig(cfg);
1227
+ }
1228
+ /* Clean up removed elements */
1229
+ DOMPurify.removed = [];
1230
+ /* Check if dirty is correctly typed for IN_PLACE */
1231
+ if (typeof dirty === 'string') {
1232
+ IN_PLACE = false;
1233
+ }
1234
+ if (IN_PLACE) {
1235
+ /* Do some early pre-sanitization to avoid unsafe root nodes */
1236
+ if (dirty.nodeName) {
1237
+ const tagName = transformCaseFunc(dirty.nodeName);
1238
+ if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
1239
+ throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');
1240
+ }
1241
+ }
1242
+ } else if (dirty instanceof Node) {
1243
+ /* If dirty is a DOM element, append to an empty document to avoid
1244
+ elements being stripped by the parser */
1245
+ body = _initDocument('<!---->');
1246
+ importedNode = body.ownerDocument.importNode(dirty, true);
1247
+ if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === 'BODY') {
1248
+ /* Node is already a body, use as is */
1249
+ body = importedNode;
1250
+ } else if (importedNode.nodeName === 'HTML') {
1251
+ body = importedNode;
1252
+ } else {
1253
+ // eslint-disable-next-line unicorn/prefer-dom-node-append
1254
+ body.appendChild(importedNode);
1255
+ }
1256
+ } else {
1257
+ /* Exit directly if we have nothing to do */
1258
+ if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&
1259
+ // eslint-disable-next-line unicorn/prefer-includes
1260
+ dirty.indexOf('<') === -1) {
1261
+ return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
1262
+ }
1263
+ /* Initialize the document to work on */
1264
+ body = _initDocument(dirty);
1265
+ /* Check we have a DOM node from the data */
1266
+ if (!body) {
1267
+ return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';
1268
+ }
1269
+ }
1270
+ /* Remove first element node (ours) if FORCE_BODY is set */
1271
+ if (body && FORCE_BODY) {
1272
+ _forceRemove(body.firstChild);
1273
+ }
1274
+ /* Get node iterator */
1275
+ const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);
1276
+ /* Now start iterating over the created document */
1277
+ while (currentNode = nodeIterator.nextNode()) {
1278
+ /* Sanitize tags and elements */
1279
+ _sanitizeElements(currentNode);
1280
+ /* Check attributes next */
1281
+ _sanitizeAttributes(currentNode);
1282
+ /* Shadow DOM detected, sanitize it */
1283
+ if (currentNode.content instanceof DocumentFragment) {
1284
+ _sanitizeShadowDOM(currentNode.content);
1285
+ }
1286
+ }
1287
+ /* If we sanitized `dirty` in-place, return it. */
1288
+ if (IN_PLACE) {
1289
+ return dirty;
1290
+ }
1291
+ /* Return sanitized string or DOM */
1292
+ if (RETURN_DOM) {
1293
+ if (RETURN_DOM_FRAGMENT) {
1294
+ returnNode = createDocumentFragment.call(body.ownerDocument);
1295
+ while (body.firstChild) {
1296
+ // eslint-disable-next-line unicorn/prefer-dom-node-append
1297
+ returnNode.appendChild(body.firstChild);
1298
+ }
1299
+ } else {
1300
+ returnNode = body;
1301
+ }
1302
+ if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {
1303
+ /*
1304
+ AdoptNode() is not used because internal state is not reset
1305
+ (e.g. the past names map of a HTMLFormElement), this is safe
1306
+ in theory but we would rather not risk another attack vector.
1307
+ The state that is cloned by importNode() is explicitly defined
1308
+ by the specs.
1309
+ */
1310
+ returnNode = importNode.call(originalDocument, returnNode, true);
1311
+ }
1312
+ return returnNode;
1313
+ }
1314
+ let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
1315
+ /* Serialize doctype if allowed */
1316
+ if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
1317
+ serializedHTML = '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\n' + serializedHTML;
1318
+ }
1319
+ /* Sanitize final string template-safe */
1320
+ if (SAFE_FOR_TEMPLATES) {
1321
+ arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
1322
+ serializedHTML = stringReplace(serializedHTML, expr, ' ');
1323
+ });
1324
+ }
1325
+ return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
1326
+ };
1327
+ DOMPurify.setConfig = function () {
1328
+ let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1329
+ _parseConfig(cfg);
1330
+ SET_CONFIG = true;
1331
+ };
1332
+ DOMPurify.clearConfig = function () {
1333
+ CONFIG = null;
1334
+ SET_CONFIG = false;
1335
+ };
1336
+ DOMPurify.isValidAttribute = function (tag, attr, value) {
1337
+ /* Initialize shared config vars if necessary. */
1338
+ if (!CONFIG) {
1339
+ _parseConfig({});
1340
+ }
1341
+ const lcTag = transformCaseFunc(tag);
1342
+ const lcName = transformCaseFunc(attr);
1343
+ return _isValidAttribute(lcTag, lcName, value);
1344
+ };
1345
+ DOMPurify.addHook = function (entryPoint, hookFunction) {
1346
+ if (typeof hookFunction !== 'function') {
1347
+ return;
1348
+ }
1349
+ arrayPush(hooks[entryPoint], hookFunction);
1350
+ };
1351
+ DOMPurify.removeHook = function (entryPoint, hookFunction) {
1352
+ if (hookFunction !== undefined) {
1353
+ const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
1354
+ return index === -1 ? undefined : arraySplice(hooks[entryPoint], index, 1)[0];
1355
+ }
1356
+ return arrayPop(hooks[entryPoint]);
1357
+ };
1358
+ DOMPurify.removeHooks = function (entryPoint) {
1359
+ hooks[entryPoint] = [];
1360
+ };
1361
+ DOMPurify.removeAllHooks = function () {
1362
+ hooks = _createHooksMap();
1363
+ };
1364
+ return DOMPurify;
1365
+ }
1366
+ var purify = createDOMPurify();
1367
+
1368
+ purify_cjs = purify;
1369
+
1370
+ return purify_cjs;
1371
+ }
1372
+
17
1373
  dist.exports;
18
1374
  (function(module, exports) {
19
1375
  !function(e, t) {
20
- t(exports) ;
21
- }(commonjsGlobal, function(e) {
22
- function t(e2, t2, i2, n2) {
1376
+ t(exports, requirePurify_cjs()) ;
1377
+ }(commonjsGlobal, function(e, t) {
1378
+ function i(e2) {
1379
+ return e2 && "object" == typeof e2 && "default" in e2 ? e2 : { default: e2 };
1380
+ }
1381
+ var n = i(t);
1382
+ function r(e2, t2, i2, n2) {
23
1383
  return new (i2 || (i2 = Promise))(function(r2, s2) {
24
1384
  function o2(e3) {
25
1385
  try {
@@ -44,37 +1404,37 @@ var telerikReportViewer = (function (exports) {
44
1404
  l2((n2 = n2.apply(e2, t2 || [])).next());
45
1405
  });
46
1406
  }
47
- class i {
1407
+ class s {
48
1408
  constructor() {
49
1409
  this.BasePath = "", this.ImmediatePrint = false, this.ContentOnly = false, this.UseSVG = false, this.enableSearch = false, this.enableAccessibility = false, this.contentTabIndex = 0;
50
1410
  }
51
1411
  }
52
- class n {
1412
+ class o {
53
1413
  constructor() {
54
1414
  this.from = "", this.to = "", this.cc = "", this.subject = "", this.format = "", this.body = "";
55
1415
  }
56
1416
  }
57
- class r {
1417
+ class a {
58
1418
  constructor(e2, t2) {
59
1419
  this.cancel = false, this.element = e2, this.action = t2;
60
1420
  }
61
1421
  }
62
- class s {
1422
+ class l {
63
1423
  constructor(e2, t2) {
64
1424
  this.id = "", this.type = "", this.id = e2, this.type = t2;
65
1425
  }
66
1426
  }
67
- class o {
1427
+ class h {
68
1428
  constructor(e2, t2) {
69
1429
  this.isCancelled = false, this.format = "", this.deviceInfo = e2, this.format = t2;
70
1430
  }
71
1431
  }
72
- class a {
1432
+ class c {
73
1433
  constructor(e2, t2, i2) {
74
1434
  this.handled = false, this.url = e2, this.format = t2, this.windowOpenTarget = i2;
75
1435
  }
76
1436
  }
77
- class l {
1437
+ class d {
78
1438
  constructor(e2, t2) {
79
1439
  this._responseText = e2, this._error = t2;
80
1440
  try {
@@ -92,15 +1452,19 @@ var telerikReportViewer = (function (exports) {
92
1452
  get error() {
93
1453
  return this._error;
94
1454
  }
1455
+ get exceptionMessage() {
1456
+ var e2, t2;
1457
+ return (null === (e2 = this.responseJSON) || void 0 === e2 ? void 0 : e2.exceptionMessage) || (null === (t2 = this.responseJSON) || void 0 === t2 ? void 0 : t2.ExceptionMessage);
1458
+ }
95
1459
  }
96
- function h(e2, t2 = false, i2 = false) {
1460
+ function u(e2, t2 = false, i2 = false) {
97
1461
  let n2 = { Accept: "application/json, text/javascript, */*; q=0.01" };
98
1462
  return t2 && (n2["Content-Type"] = i2 ? "application/x-www-form-urlencoded; charset=UTF-8" : "application/json; charset=UTF-8"), e2 && (n2.authorization = "Bearer " + e2), n2;
99
1463
  }
100
- function c(e2) {
101
- return t(this, void 0, void 0, function* () {
1464
+ function p(e2) {
1465
+ return r(this, void 0, void 0, function* () {
102
1466
  if (!e2.ok) {
103
- let t2 = yield e2.text(), i2 = new l(t2, e2.statusText);
1467
+ let t2 = yield e2.text(), i2 = new d(t2, e2.statusText);
104
1468
  return Promise.reject(i2);
105
1469
  }
106
1470
  if (204 == e2.status)
@@ -108,23 +1472,23 @@ var telerikReportViewer = (function (exports) {
108
1472
  return (e2.headers.get("content-type") || "").includes("application/json") ? e2.json() : e2.text();
109
1473
  });
110
1474
  }
111
- function d(e2, t2 = {}, i2 = "", n2 = false) {
112
- return fetch(e2, { method: "POST", headers: h(i2, true, n2), body: n2 ? t2 : JSON.stringify(t2) }).then(c);
1475
+ function g(e2, t2 = {}, i2 = "", n2 = false) {
1476
+ return fetch(e2, { method: "POST", headers: u(i2, true, n2), body: n2 ? t2 : JSON.stringify(t2) }).then(p);
113
1477
  }
114
- function u() {
1478
+ function m() {
115
1479
  }
116
- function p() {
117
- p.init.call(this);
1480
+ function f() {
1481
+ f.init.call(this);
118
1482
  }
119
- function g(e2) {
120
- return void 0 === e2._maxListeners ? p.defaultMaxListeners : e2._maxListeners;
1483
+ function v(e2) {
1484
+ return void 0 === e2._maxListeners ? f.defaultMaxListeners : e2._maxListeners;
121
1485
  }
122
- function m(e2, t2, i2, n2) {
1486
+ function P(e2, t2, i2, n2) {
123
1487
  var r2, s2, o2, a2;
124
1488
  if ("function" != typeof i2)
125
1489
  throw new TypeError('"listener" argument must be a function');
126
- if ((s2 = e2._events) ? (s2.newListener && (e2.emit("newListener", t2, i2.listener ? i2.listener : i2), s2 = e2._events), o2 = s2[t2]) : (s2 = e2._events = new u(), e2._eventsCount = 0), o2) {
127
- if ("function" == typeof o2 ? o2 = s2[t2] = n2 ? [i2, o2] : [o2, i2] : n2 ? o2.unshift(i2) : o2.push(i2), !o2.warned && (r2 = g(e2)) && r2 > 0 && o2.length > r2) {
1490
+ if ((s2 = e2._events) ? (s2.newListener && (e2.emit("newListener", t2, i2.listener ? i2.listener : i2), s2 = e2._events), o2 = s2[t2]) : (s2 = e2._events = new m(), e2._eventsCount = 0), o2) {
1491
+ if ("function" == typeof o2 ? o2 = s2[t2] = n2 ? [i2, o2] : [o2, i2] : n2 ? o2.unshift(i2) : o2.push(i2), !o2.warned && (r2 = v(e2)) && r2 > 0 && o2.length > r2) {
128
1492
  o2.warned = true;
129
1493
  var l2 = new Error("Possible EventEmitter memory leak detected. " + o2.length + " " + t2 + " listeners added. Use emitter.setMaxListeners() to increase limit");
130
1494
  l2.name = "MaxListenersExceededWarning", l2.emitter = e2, l2.type = t2, l2.count = o2.length, a2 = l2, "function" == typeof console.warn ? console.warn(a2) : console.log(a2);
@@ -133,14 +1497,14 @@ var telerikReportViewer = (function (exports) {
133
1497
  o2 = s2[t2] = i2, ++e2._eventsCount;
134
1498
  return e2;
135
1499
  }
136
- function f(e2, t2, i2) {
1500
+ function y(e2, t2, i2) {
137
1501
  var n2 = false;
138
1502
  function r2() {
139
1503
  e2.removeListener(t2, r2), n2 || (n2 = true, i2.apply(e2, arguments));
140
1504
  }
141
1505
  return r2.listener = i2, r2;
142
1506
  }
143
- function v(e2) {
1507
+ function I(e2) {
144
1508
  var t2 = this._events;
145
1509
  if (t2) {
146
1510
  var i2 = t2[e2];
@@ -151,20 +1515,20 @@ var telerikReportViewer = (function (exports) {
151
1515
  }
152
1516
  return 0;
153
1517
  }
154
- function P(e2, t2) {
1518
+ function C(e2, t2) {
155
1519
  for (var i2 = new Array(t2); t2--; )
156
1520
  i2[t2] = e2[t2];
157
1521
  return i2;
158
1522
  }
159
- u.prototype = /* @__PURE__ */ Object.create(null), p.EventEmitter = p, p.usingDomains = false, p.prototype.domain = void 0, p.prototype._events = void 0, p.prototype._maxListeners = void 0, p.defaultMaxListeners = 10, p.init = function() {
160
- this.domain = null, p.usingDomains && (void 0).active, this._events && this._events !== Object.getPrototypeOf(this)._events || (this._events = new u(), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
161
- }, p.prototype.setMaxListeners = function(e2) {
1523
+ m.prototype = /* @__PURE__ */ Object.create(null), f.EventEmitter = f, f.usingDomains = false, f.prototype.domain = void 0, f.prototype._events = void 0, f.prototype._maxListeners = void 0, f.defaultMaxListeners = 10, f.init = function() {
1524
+ this.domain = null, f.usingDomains && (void 0).active, this._events && this._events !== Object.getPrototypeOf(this)._events || (this._events = new m(), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
1525
+ }, f.prototype.setMaxListeners = function(e2) {
162
1526
  if ("number" != typeof e2 || e2 < 0 || isNaN(e2))
163
1527
  throw new TypeError('"n" argument must be a positive number');
164
1528
  return this._maxListeners = e2, this;
165
- }, p.prototype.getMaxListeners = function() {
166
- return g(this);
167
- }, p.prototype.emit = function(e2) {
1529
+ }, f.prototype.getMaxListeners = function() {
1530
+ return v(this);
1531
+ }, f.prototype.emit = function(e2) {
168
1532
  var t2, i2, n2, r2, s2, o2, a2, l2 = "error" === e2;
169
1533
  if (o2 = this._events)
170
1534
  l2 = l2 && null == o2.error;
@@ -188,7 +1552,7 @@ var telerikReportViewer = (function (exports) {
188
1552
  if (t3)
189
1553
  e3.call(i3);
190
1554
  else
191
- for (var n3 = e3.length, r3 = P(e3, n3), s3 = 0; s3 < n3; ++s3)
1555
+ for (var n3 = e3.length, r3 = C(e3, n3), s3 = 0; s3 < n3; ++s3)
192
1556
  r3[s3].call(i3);
193
1557
  }(i2, c2, this);
194
1558
  break;
@@ -197,7 +1561,7 @@ var telerikReportViewer = (function (exports) {
197
1561
  if (t3)
198
1562
  e3.call(i3, n3);
199
1563
  else
200
- for (var r3 = e3.length, s3 = P(e3, r3), o3 = 0; o3 < r3; ++o3)
1564
+ for (var r3 = e3.length, s3 = C(e3, r3), o3 = 0; o3 < r3; ++o3)
201
1565
  s3[o3].call(i3, n3);
202
1566
  }(i2, c2, this, arguments[1]);
203
1567
  break;
@@ -206,7 +1570,7 @@ var telerikReportViewer = (function (exports) {
206
1570
  if (t3)
207
1571
  e3.call(i3, n3, r3);
208
1572
  else
209
- for (var s3 = e3.length, o3 = P(e3, s3), a3 = 0; a3 < s3; ++a3)
1573
+ for (var s3 = e3.length, o3 = C(e3, s3), a3 = 0; a3 < s3; ++a3)
210
1574
  o3[a3].call(i3, n3, r3);
211
1575
  }(i2, c2, this, arguments[1], arguments[2]);
212
1576
  break;
@@ -215,7 +1579,7 @@ var telerikReportViewer = (function (exports) {
215
1579
  if (t3)
216
1580
  e3.call(i3, n3, r3, s3);
217
1581
  else
218
- for (var o3 = e3.length, a3 = P(e3, o3), l3 = 0; l3 < o3; ++l3)
1582
+ for (var o3 = e3.length, a3 = C(e3, o3), l3 = 0; l3 < o3; ++l3)
219
1583
  a3[l3].call(i3, n3, r3, s3);
220
1584
  }(i2, c2, this, arguments[1], arguments[2], arguments[3]);
221
1585
  break;
@@ -226,24 +1590,24 @@ var telerikReportViewer = (function (exports) {
226
1590
  if (t3)
227
1591
  e3.apply(i3, n3);
228
1592
  else
229
- for (var r3 = e3.length, s3 = P(e3, r3), o3 = 0; o3 < r3; ++o3)
1593
+ for (var r3 = e3.length, s3 = C(e3, r3), o3 = 0; o3 < r3; ++o3)
230
1594
  s3[o3].apply(i3, n3);
231
1595
  }(i2, c2, this, r2);
232
1596
  }
233
1597
  return true;
234
- }, p.prototype.addListener = function(e2, t2) {
235
- return m(this, e2, t2, false);
236
- }, p.prototype.on = p.prototype.addListener, p.prototype.prependListener = function(e2, t2) {
237
- return m(this, e2, t2, true);
238
- }, p.prototype.once = function(e2, t2) {
1598
+ }, f.prototype.addListener = function(e2, t2) {
1599
+ return P(this, e2, t2, false);
1600
+ }, f.prototype.on = f.prototype.addListener, f.prototype.prependListener = function(e2, t2) {
1601
+ return P(this, e2, t2, true);
1602
+ }, f.prototype.once = function(e2, t2) {
239
1603
  if ("function" != typeof t2)
240
1604
  throw new TypeError('"listener" argument must be a function');
241
- return this.on(e2, f(this, e2, t2)), this;
242
- }, p.prototype.prependOnceListener = function(e2, t2) {
1605
+ return this.on(e2, y(this, e2, t2)), this;
1606
+ }, f.prototype.prependOnceListener = function(e2, t2) {
243
1607
  if ("function" != typeof t2)
244
1608
  throw new TypeError('"listener" argument must be a function');
245
- return this.prependListener(e2, f(this, e2, t2)), this;
246
- }, p.prototype.removeListener = function(e2, t2) {
1609
+ return this.prependListener(e2, y(this, e2, t2)), this;
1610
+ }, f.prototype.removeListener = function(e2, t2) {
247
1611
  var i2, n2, r2, s2, o2;
248
1612
  if ("function" != typeof t2)
249
1613
  throw new TypeError('"listener" argument must be a function');
@@ -252,7 +1616,7 @@ var telerikReportViewer = (function (exports) {
252
1616
  if (!(i2 = n2[e2]))
253
1617
  return this;
254
1618
  if (i2 === t2 || i2.listener && i2.listener === t2)
255
- 0 == --this._eventsCount ? this._events = new u() : (delete n2[e2], n2.removeListener && this.emit("removeListener", e2, i2.listener || t2));
1619
+ 0 == --this._eventsCount ? this._events = new m() : (delete n2[e2], n2.removeListener && this.emit("removeListener", e2, i2.listener || t2));
256
1620
  else if ("function" != typeof i2) {
257
1621
  for (r2 = -1, s2 = i2.length; s2-- > 0; )
258
1622
  if (i2[s2] === t2 || i2[s2].listener && i2[s2].listener === t2) {
@@ -263,7 +1627,7 @@ var telerikReportViewer = (function (exports) {
263
1627
  return this;
264
1628
  if (1 === i2.length) {
265
1629
  if (i2[0] = void 0, 0 == --this._eventsCount)
266
- return this._events = new u(), this;
1630
+ return this._events = new m(), this;
267
1631
  delete n2[e2];
268
1632
  } else
269
1633
  !function(e3, t3) {
@@ -274,18 +1638,18 @@ var telerikReportViewer = (function (exports) {
274
1638
  n2.removeListener && this.emit("removeListener", e2, o2 || t2);
275
1639
  }
276
1640
  return this;
277
- }, p.prototype.off = function(e2, t2) {
1641
+ }, f.prototype.off = function(e2, t2) {
278
1642
  return this.removeListener(e2, t2);
279
- }, p.prototype.removeAllListeners = function(e2) {
1643
+ }, f.prototype.removeAllListeners = function(e2) {
280
1644
  var t2, i2;
281
1645
  if (!(i2 = this._events))
282
1646
  return this;
283
1647
  if (!i2.removeListener)
284
- return 0 === arguments.length ? (this._events = new u(), this._eventsCount = 0) : i2[e2] && (0 == --this._eventsCount ? this._events = new u() : delete i2[e2]), this;
1648
+ return 0 === arguments.length ? (this._events = new m(), this._eventsCount = 0) : i2[e2] && (0 == --this._eventsCount ? this._events = new m() : delete i2[e2]), this;
285
1649
  if (0 === arguments.length) {
286
1650
  for (var n2, r2 = Object.keys(i2), s2 = 0; s2 < r2.length; ++s2)
287
1651
  "removeListener" !== (n2 = r2[s2]) && this.removeAllListeners(n2);
288
- return this.removeAllListeners("removeListener"), this._events = new u(), this._eventsCount = 0, this;
1652
+ return this.removeAllListeners("removeListener"), this._events = new m(), this._eventsCount = 0, this;
289
1653
  }
290
1654
  if ("function" == typeof (t2 = i2[e2]))
291
1655
  this.removeListener(e2, t2);
@@ -294,34 +1658,34 @@ var telerikReportViewer = (function (exports) {
294
1658
  this.removeListener(e2, t2[t2.length - 1]);
295
1659
  } while (t2[0]);
296
1660
  return this;
297
- }, p.prototype.listeners = function(e2) {
1661
+ }, f.prototype.listeners = function(e2) {
298
1662
  var t2, i2 = this._events;
299
1663
  return i2 && (t2 = i2[e2]) ? "function" == typeof t2 ? [t2.listener || t2] : function(e3) {
300
1664
  for (var t3 = new Array(e3.length), i3 = 0; i3 < t3.length; ++i3)
301
1665
  t3[i3] = e3[i3].listener || e3[i3];
302
1666
  return t3;
303
1667
  }(t2) : [];
304
- }, p.listenerCount = function(e2, t2) {
305
- return "function" == typeof e2.listenerCount ? e2.listenerCount(t2) : v.call(e2, t2);
306
- }, p.prototype.listenerCount = v, p.prototype.eventNames = function() {
1668
+ }, f.listenerCount = function(e2, t2) {
1669
+ return "function" == typeof e2.listenerCount ? e2.listenerCount(t2) : I.call(e2, t2);
1670
+ }, f.prototype.listenerCount = I, f.prototype.eventNames = function() {
307
1671
  return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : [];
308
1672
  };
309
- const y = "function" == typeof Symbol ? Symbol.for("--[[await-event-emitter]]--") : "--[[await-event-emitter]]--";
310
- function C(e2) {
1673
+ const S = "function" == typeof Symbol ? Symbol.for("--[[await-event-emitter]]--") : "--[[await-event-emitter]]--";
1674
+ function b(e2) {
311
1675
  if ("string" != typeof e2 && "symbol" != typeof e2)
312
1676
  throw new TypeError("type is not type of string or symbol!");
313
1677
  }
314
- function I(e2) {
1678
+ function w(e2) {
315
1679
  if ("function" != typeof e2)
316
1680
  throw new TypeError("fn is not type of Function!");
317
1681
  }
318
- function S(e2) {
319
- return { [y]: "always", fn: e2 };
1682
+ function R(e2) {
1683
+ return { [S]: "always", fn: e2 };
320
1684
  }
321
- function b(e2) {
322
- return { [y]: "once", fn: e2 };
1685
+ function E(e2) {
1686
+ return { [S]: "once", fn: e2 };
323
1687
  }
324
- class w {
1688
+ class T {
325
1689
  constructor() {
326
1690
  this._events = {};
327
1691
  }
@@ -329,25 +1693,25 @@ var telerikReportViewer = (function (exports) {
329
1693
  return this.on(e2, t2);
330
1694
  }
331
1695
  on(e2, t2) {
332
- return C(e2), I(t2), this._events[e2] = this._events[e2] || [], this._events[e2].push(S(t2)), this;
1696
+ return b(e2), w(t2), this._events[e2] = this._events[e2] || [], this._events[e2].push(R(t2)), this;
333
1697
  }
334
1698
  prependListener(e2, t2) {
335
1699
  return this.prepend(e2, t2);
336
1700
  }
337
1701
  prepend(e2, t2) {
338
- return C(e2), I(t2), this._events[e2] = this._events[e2] || [], this._events[e2].unshift(S(t2)), this;
1702
+ return b(e2), w(t2), this._events[e2] = this._events[e2] || [], this._events[e2].unshift(R(t2)), this;
339
1703
  }
340
1704
  prependOnceListener(e2, t2) {
341
1705
  return this.prependOnce(e2, t2);
342
1706
  }
343
1707
  prependOnce(e2, t2) {
344
- return C(e2), I(t2), this._events[e2] = this._events[e2] || [], this._events[e2].unshift(b(t2)), this;
1708
+ return b(e2), w(t2), this._events[e2] = this._events[e2] || [], this._events[e2].unshift(E(t2)), this;
345
1709
  }
346
1710
  listeners(e2) {
347
1711
  return (this._events[e2] || []).map((e3) => e3.fn);
348
1712
  }
349
1713
  once(e2, t2) {
350
- return C(e2), I(t2), this._events[e2] = this._events[e2] || [], this._events[e2].push(b(t2)), this;
1714
+ return b(e2), w(t2), this._events[e2] = this._events[e2] || [], this._events[e2].push(E(t2)), this;
351
1715
  }
352
1716
  removeAllListeners() {
353
1717
  this._events = {};
@@ -356,7 +1720,7 @@ var telerikReportViewer = (function (exports) {
356
1720
  return this.removeListener(e2, t2);
357
1721
  }
358
1722
  removeListener(e2, t2) {
359
- C(e2);
1723
+ b(e2);
360
1724
  const i2 = this.listeners(e2);
361
1725
  if ("function" == typeof t2) {
362
1726
  let n2 = -1, r2 = false;
@@ -366,14 +1730,14 @@ var telerikReportViewer = (function (exports) {
366
1730
  }
367
1731
  return delete this._events[e2];
368
1732
  }
369
- emit(e2, ...i2) {
370
- return t(this, void 0, void 0, function* () {
371
- C(e2);
372
- const t2 = this.listeners(e2), n2 = [];
373
- if (t2 && t2.length) {
374
- for (let r2 = 0; r2 < t2.length; r2++) {
375
- const s2 = t2[r2], o2 = s2.apply(this, i2);
376
- o2 instanceof Promise && (yield o2), this._events[e2] && this._events[e2][r2] && "once" === this._events[e2][r2][y] && n2.push(s2);
1733
+ emit(e2, ...t2) {
1734
+ return r(this, void 0, void 0, function* () {
1735
+ b(e2);
1736
+ const i2 = this.listeners(e2), n2 = [];
1737
+ if (i2 && i2.length) {
1738
+ for (let r2 = 0; r2 < i2.length; r2++) {
1739
+ const s2 = i2[r2], o2 = s2.apply(this, t2);
1740
+ o2 instanceof Promise && (yield o2), this._events[e2] && this._events[e2][r2] && "once" === this._events[e2][r2][S] && n2.push(s2);
377
1741
  }
378
1742
  return n2.forEach((t3) => this.removeListener(e2, t3)), true;
379
1743
  }
@@ -381,21 +1745,21 @@ var telerikReportViewer = (function (exports) {
381
1745
  });
382
1746
  }
383
1747
  emitSync(e2, ...t2) {
384
- C(e2);
1748
+ b(e2);
385
1749
  const i2 = this.listeners(e2), n2 = [];
386
1750
  if (i2 && i2.length) {
387
1751
  for (let r2 = 0; r2 < i2.length; r2++) {
388
1752
  const s2 = i2[r2];
389
- s2.apply(this, t2), this._events[e2] && this._events[e2][r2] && "once" === this._events[e2][r2][y] && n2.push(s2);
1753
+ s2.apply(this, t2), this._events[e2] && this._events[e2][r2] && "once" === this._events[e2][r2][S] && n2.push(s2);
390
1754
  }
391
1755
  return n2.forEach((t3) => this.removeListener(e2, t3)), true;
392
1756
  }
393
1757
  return false;
394
1758
  }
395
1759
  }
396
- class R {
1760
+ class A {
397
1761
  constructor() {
398
- this.eventEmitter = new p(), this.awaitEventEmitter = new w();
1762
+ this.eventEmitter = new f(), this.awaitEventEmitter = new T();
399
1763
  }
400
1764
  on(e2, t2) {
401
1765
  return this.eventEmitter.on(e2, t2), this;
@@ -406,13 +1770,13 @@ var telerikReportViewer = (function (exports) {
406
1770
  onAsync(e2, t2) {
407
1771
  return this.awaitEventEmitter.on(e2, t2), this;
408
1772
  }
409
- emitAsync(e2, ...i2) {
410
- return t(this, void 0, void 0, function* () {
411
- yield this.awaitEventEmitter.emit(e2, ...i2);
1773
+ emitAsync(e2, ...t2) {
1774
+ return r(this, void 0, void 0, function* () {
1775
+ yield this.awaitEventEmitter.emit(e2, ...t2);
412
1776
  });
413
1777
  }
414
1778
  }
415
- class E {
1779
+ class M {
416
1780
  hasPdfPlugin() {
417
1781
  let e2 = ["AcroPDF.PDF.1", "PDF.PdfCtrl.6", "PDF.PdfCtrl.5"];
418
1782
  for (let t2 of e2)
@@ -425,7 +1789,7 @@ var telerikReportViewer = (function (exports) {
425
1789
  return false;
426
1790
  }
427
1791
  }
428
- class T {
1792
+ class L {
429
1793
  hasPdfPlugin() {
430
1794
  let e2 = /Firefox[/\s](\d+\.\d+)/.exec(navigator.userAgent);
431
1795
  if (null !== e2 && e2.length > 1) {
@@ -440,7 +1804,7 @@ var telerikReportViewer = (function (exports) {
440
1804
  return false;
441
1805
  }
442
1806
  }
443
- class A {
1807
+ class x {
444
1808
  constructor(e2) {
445
1809
  this.defaultPlugin = e2;
446
1810
  }
@@ -451,22 +1815,22 @@ var telerikReportViewer = (function (exports) {
451
1815
  return false;
452
1816
  }
453
1817
  }
454
- class M {
1818
+ class D {
455
1819
  hasPdfPlugin() {
456
1820
  return false;
457
1821
  }
458
1822
  }
459
- function L() {
1823
+ function N() {
460
1824
  return window.navigator && window.navigator.msSaveOrOpenBlob;
461
1825
  }
462
- class x {
1826
+ class k {
463
1827
  constructor() {
464
1828
  this.hasPdfPlugin = false, this.iframe = null, this.hasPdfPlugin = function() {
465
1829
  if (window.navigator) {
466
1830
  let e2 = window.navigator.userAgent.toLowerCase();
467
- return e2.indexOf("msie") > -1 || e2.indexOf("mozilla") > -1 && e2.indexOf("trident") > -1 ? new E() : e2.indexOf("firefox") > -1 ? new T() : e2.indexOf("edg/") > -1 ? new A("Microsoft Edge PDF Plugin") : e2.indexOf("chrome") > -1 ? new A("Chrome PDF Viewer") : e2.indexOf("safari") > -1 ? new A("WebKit built-in PDF") : new M();
1831
+ return e2.indexOf("msie") > -1 || e2.indexOf("mozilla") > -1 && e2.indexOf("trident") > -1 ? new M() : e2.indexOf("firefox") > -1 ? new L() : e2.indexOf("edg/") > -1 ? new x("Microsoft Edge PDF Plugin") : e2.indexOf("chrome") > -1 ? new x("Chrome PDF Viewer") : e2.indexOf("safari") > -1 ? new x("WebKit built-in PDF") : new D();
468
1832
  }
469
- return new M();
1833
+ return new D();
470
1834
  }().hasPdfPlugin(), this.isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
471
1835
  }
472
1836
  destroy() {
@@ -484,13 +1848,13 @@ var telerikReportViewer = (function (exports) {
484
1848
  }), function(e3) {
485
1849
  let t3 = window.location, i3 = document.createElement("a");
486
1850
  return i3.setAttribute("href", e3), "" == i3.host && (i3.href = i3.href), t3.hostname === i3.hostname && t3.protocol === i3.protocol && t3.port === i3.port;
487
- }(e2) && L())
1851
+ }(e2) && N())
488
1852
  return this.iframe.src = e2, void document.body.appendChild(this.iframe);
489
1853
  let i2 = new XMLHttpRequest(), n2 = this;
490
1854
  i2.open("GET", e2, true), i2.responseType = "arraybuffer", i2.onload = function() {
491
1855
  if (200 === this.status) {
492
1856
  let e3 = new Blob([this.response], { type: "application/pdf" });
493
- L() ? window.navigator.msSaveOrOpenBlob(e3) : (t2 = (window.URL || window.webkitURL).createObjectURL(e3), null != n2.iframe && (n2.iframe.src = t2, document.body.appendChild(n2.iframe)));
1857
+ N() ? window.navigator.msSaveOrOpenBlob(e3) : (t2 = (window.URL || window.webkitURL).createObjectURL(e3), null != n2.iframe && (n2.iframe.src = t2, document.body.appendChild(n2.iframe)));
494
1858
  } else
495
1859
  console.log("Could not retrieve remote PDF document.");
496
1860
  }, i2.send();
@@ -505,10 +1869,10 @@ var telerikReportViewer = (function (exports) {
505
1869
  return this.hasPdfPlugin;
506
1870
  }
507
1871
  }
508
- function N(e2) {
1872
+ function F(e2) {
509
1873
  return 1e3 * e2;
510
1874
  }
511
- class D {
1875
+ class O {
512
1876
  constructor(e2, t2, i2) {
513
1877
  if (this.pingMilliseconds = 0, !e2)
514
1878
  throw "Error";
@@ -517,7 +1881,7 @@ var telerikReportViewer = (function (exports) {
517
1881
  initSessionTimeout(e2) {
518
1882
  if (!isFinite(e2))
519
1883
  throw "sessionTimeoutSeconds must be finite";
520
- this.pingMilliseconds = e2 <= 120 ? N(e2) / 2 : N(e2 - 60);
1884
+ this.pingMilliseconds = e2 <= 120 ? F(e2) / 2 : F(e2 - 60);
521
1885
  }
522
1886
  start() {
523
1887
  this.pingMilliseconds <= 0 || (this.interval = setInterval(() => {
@@ -528,33 +1892,33 @@ var telerikReportViewer = (function (exports) {
528
1892
  this.interval && (clearInterval(this.interval), this.interval = null);
529
1893
  }
530
1894
  }
531
- var k, F, O, V, z;
532
- function _(e2, t2 = "", i2 = "") {
1895
+ var V, z, _, $, U;
1896
+ function H(e2, t2 = "", i2 = "") {
533
1897
  let n2 = document.createElement(e2);
534
- return t2 && (n2.id = t2), $(n2, i2), n2;
1898
+ return t2 && (n2.id = t2), B(n2, i2), n2;
535
1899
  }
536
- function $(e2, t2) {
1900
+ function B(e2, t2) {
537
1901
  if ("" === t2 || !e2)
538
1902
  return;
539
1903
  let i2 = t2.trim().split(" ");
540
1904
  i2 = i2.filter((e3) => "" !== e3.trim()), e2.classList.add(...i2);
541
1905
  }
542
- function U(e2, t2) {
1906
+ function q(e2, t2) {
543
1907
  if ("" === t2 || !e2)
544
1908
  return;
545
1909
  let i2 = t2.trim().split(" ");
546
1910
  i2 = i2.filter((e3) => "" !== e3.trim()), e2.classList.remove(...i2);
547
1911
  }
548
- function H(e2, t2) {
1912
+ function W(e2, t2) {
549
1913
  return e2.classList.contains(t2);
550
1914
  }
551
- function B(e2) {
1915
+ function j(e2) {
552
1916
  return e2.offsetParent;
553
1917
  }
554
- function q(e2) {
1918
+ function G(e2) {
555
1919
  return parseInt(e2, 10) || 0;
556
1920
  }
557
- function W(e2, t2, i2, n2 = 0, r2 = 0) {
1921
+ function J(e2, t2, i2, n2 = 0, r2 = 0) {
558
1922
  let s2 = `${n2 = n2 || 0} ${r2 = r2 || 0}`;
559
1923
  !function(e3, t3) {
560
1924
  e3.style.setProperty("transform", t3), e3.style.setProperty("-moz-transform", t3), e3.style.setProperty("-ms-transform", t3), e3.style.setProperty("-webkit-transform", t3), e3.style.setProperty("-o-transform", t3);
@@ -562,11 +1926,11 @@ var telerikReportViewer = (function (exports) {
562
1926
  e3.style.setProperty("transform-origin", t3), e3.style.setProperty("-moz-transform-origin", t3), e3.style.setProperty("-ms-transform-origin", t3), e3.style.setProperty("-webkit-transform-origin", t3), e3.style.setProperty("-o-transform-origin", t3);
563
1927
  }(e2, s2);
564
1928
  }
565
- function j(e2) {
566
- let t2 = _("div");
1929
+ function Z(e2) {
1930
+ let t2 = H("div");
567
1931
  return t2.textContent = e2, t2.innerHTML;
568
1932
  }
569
- function J(e2) {
1933
+ function K(e2) {
570
1934
  if (e2 && e2.length < 6) {
571
1935
  let t3 = 1, i2 = e2.split("");
572
1936
  for ("#" !== i2[0] && (t3 = 0); t3 < i2.length; t3++)
@@ -576,16 +1940,16 @@ var telerikReportViewer = (function (exports) {
576
1940
  let t2 = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e2);
577
1941
  return t2 ? parseInt(t2[1], 16) + ", " + parseInt(t2[2], 16) + ", " + parseInt(t2[3], 16) : null;
578
1942
  }
579
- function G(e2) {
1943
+ function X(e2) {
580
1944
  return !!e2 && e2.indexOf(",") > -1;
581
1945
  }
582
- function Z(e2) {
1946
+ function Q(e2) {
583
1947
  if ("transparent" === e2.toLowerCase())
584
1948
  return 0;
585
- if (!G(e2))
1949
+ if (!X(e2))
586
1950
  return 1;
587
1951
  if (-1 !== e2.indexOf("#")) {
588
- let t3 = J(e2);
1952
+ let t3 = K(e2);
589
1953
  if (null === t3)
590
1954
  return 1;
591
1955
  e2 = t3;
@@ -595,34 +1959,34 @@ var telerikReportViewer = (function (exports) {
595
1959
  });
596
1960
  return 4 === t2.length ? parseFloat((parseFloat(t2[3].replace(/[()]/g, "")) / 255).toFixed(2)) : 1;
597
1961
  }
598
- function K(e2, t2) {
599
- let i2 = _("div");
1962
+ function Y(e2, t2) {
1963
+ let i2 = H("div");
600
1964
  for (i2.innerHTML = t2; i2.childNodes.length; )
601
1965
  e2.appendChild(i2.childNodes[0]);
602
1966
  }
603
- function X(e2, t2) {
604
- let i2 = _("div");
1967
+ function ee(e2, t2) {
1968
+ let i2 = H("div");
605
1969
  for (i2.innerHTML = t2; i2.childNodes.length; )
606
1970
  e2.prepend(i2.childNodes[i2.childNodes.length - 1]);
607
1971
  }
608
- function Q(e2, t2) {
1972
+ function te(e2, t2) {
609
1973
  return null === e2 ? null : e2.querySelector(t2);
610
1974
  }
611
- function Y(e2, t2) {
1975
+ function ie(e2, t2) {
612
1976
  var i2;
613
1977
  return e2 && e2.attributes && (null === (i2 = e2.attributes[t2]) || void 0 === i2 ? void 0 : i2.value) || "";
614
1978
  }
615
- function ee(e2) {
1979
+ function ne(e2) {
616
1980
  let t2 = e2.parentElement;
617
- return t2 ? t2.clientHeight != t2.scrollHeight ? t2 : ee(t2) : null;
1981
+ return t2 ? t2.clientHeight != t2.scrollHeight ? t2 : ne(t2) : null;
618
1982
  }
619
- function te(e2, t2 = 300) {
1983
+ function re(e2, t2 = 300) {
620
1984
  let i2;
621
1985
  return function(...n2) {
622
1986
  clearTimeout(i2), i2 = setTimeout(() => e2.apply(this, n2), t2);
623
1987
  };
624
1988
  }
625
- function ie(e2, t2) {
1989
+ function se(e2, t2) {
626
1990
  let i2 = null;
627
1991
  return function(n2, ...r2) {
628
1992
  i2 || (i2 = setTimeout(function() {
@@ -630,24 +1994,24 @@ var telerikReportViewer = (function (exports) {
630
1994
  }, t2));
631
1995
  };
632
1996
  }
633
- function ne(e2, t2) {
1997
+ function oe(e2, t2) {
634
1998
  return !!e2.responseJSON && e2.responseJSON.exceptionType === t2;
635
1999
  }
636
- function re(e2) {
637
- return ne(e2, "Telerik.Reporting.Services.Engine.InvalidClientException");
2000
+ function ae(e2) {
2001
+ return oe(e2, "Telerik.Reporting.Services.Engine.InvalidClientException");
638
2002
  }
639
- function se(e2) {
640
- return ne(e2, "Telerik.Reporting.Services.Engine.InvalidParameterException");
2003
+ function le(e2) {
2004
+ return oe(e2, "Telerik.Reporting.Services.Engine.InvalidParameterException");
641
2005
  }
642
- function oe(e2) {
2006
+ function he(e2) {
643
2007
  return !!e2 && "internalservererror" === e2.split(" ").join("").toLowerCase();
644
2008
  }
645
- function ae(e2, ...t2) {
2009
+ function ce(e2, ...t2) {
646
2010
  return e2.replace(/{(\d+)}/g, (e3, i2) => t2[i2] || "");
647
2011
  }
648
- function le(e2, t2) {
2012
+ function de(e2, t2) {
649
2013
  let i2, n2;
650
- if (he(e2))
2014
+ if (ue(e2))
651
2015
  for (i2 = e2.length, n2 = 0; n2 < i2 && false !== t2.call(e2[n2], n2, e2[n2]); n2++)
652
2016
  ;
653
2017
  else
@@ -656,55 +2020,55 @@ var telerikReportViewer = (function (exports) {
656
2020
  break;
657
2021
  return e2;
658
2022
  }
659
- function he(e2) {
2023
+ function ue(e2) {
660
2024
  if (Array.isArray(e2))
661
2025
  return true;
662
2026
  return "number" == typeof (!!e2 && "length" in e2 && e2.length);
663
2027
  }
664
- function ce(e2) {
2028
+ function pe(e2) {
665
2029
  return /^(\-|\+)?([0-9]+)$/.test(e2) ? Number(e2) : NaN;
666
2030
  }
667
- function de(e2) {
2031
+ function ge(e2) {
668
2032
  return /^(\-|\+)?([0-9]+(\.[0-9]+)?)$/.test(e2) ? Number(e2) : NaN;
669
2033
  }
670
- function ue(e2) {
2034
+ function me(e2) {
671
2035
  return e2 instanceof Date ? e2 : (/Z|[\+\-]\d\d:?\d\d/i.test(e2) || (e2 += "Z"), new Date(e2));
672
2036
  }
673
- e.PageMode = void 0, (k = e.PageMode || (e.PageMode = {}))[k.ContinuousScroll = 0] = "ContinuousScroll", k[k.SinglePage = 1] = "SinglePage", e.PrintMode = void 0, (F = e.PrintMode || (e.PrintMode = {}))[F.AutoSelect = 0] = "AutoSelect", F[F.ForcePDFPlugin = 1] = "ForcePDFPlugin", F[F.ForcePDFFile = 2] = "ForcePDFFile", e.ScaleMode = void 0, (O = e.ScaleMode || (e.ScaleMode = {}))[O.FitPageWidth = 0] = "FitPageWidth", O[O.FitPage = 1] = "FitPage", O[O.Specific = 2] = "Specific", e.ServiceType = void 0, (V = e.ServiceType || (e.ServiceType = {}))[V.REST = 0] = "REST", V[V.ReportServer = 1] = "ReportServer", e.ViewMode = void 0, (z = e.ViewMode || (e.ViewMode = {}))[z.Interactive = 0] = "Interactive", z[z.PrintPreview = 1] = "PrintPreview";
674
- class pe {
2037
+ e.PageMode = void 0, (V = e.PageMode || (e.PageMode = {}))[V.ContinuousScroll = 0] = "ContinuousScroll", V[V.SinglePage = 1] = "SinglePage", e.PrintMode = void 0, (z = e.PrintMode || (e.PrintMode = {}))[z.AutoSelect = 0] = "AutoSelect", z[z.ForcePDFPlugin = 1] = "ForcePDFPlugin", z[z.ForcePDFFile = 2] = "ForcePDFFile", e.ScaleMode = void 0, (_ = e.ScaleMode || (e.ScaleMode = {}))[_.FitPageWidth = 0] = "FitPageWidth", _[_.FitPage = 1] = "FitPage", _[_.Specific = 2] = "Specific", e.ServiceType = void 0, ($ = e.ServiceType || (e.ServiceType = {}))[$.REST = 0] = "REST", $[$.ReportServer = 1] = "ReportServer", e.ViewMode = void 0, (U = e.ViewMode || (e.ViewMode = {}))[U.Interactive = 0] = "Interactive", U[U.PrintPreview = 1] = "PrintPreview";
2038
+ class fe {
675
2039
  constructor(e2) {
676
2040
  this.handled = false, this.deviceInfo = e2;
677
2041
  }
678
2042
  }
679
- class ge {
2043
+ class ve {
680
2044
  constructor(e2) {
681
2045
  this.handled = false, this.url = e2;
682
2046
  }
683
2047
  }
684
- class me {
2048
+ class Pe {
685
2049
  constructor(e2, t2) {
686
2050
  this.handled = false, this.deviceInfo = e2, this.format = t2;
687
2051
  }
688
2052
  }
689
- class fe {
2053
+ class ye {
690
2054
  constructor(e2, t2) {
691
2055
  this.handled = false, this.deviceInfo = e2, this.format = t2;
692
2056
  }
693
2057
  }
694
- class ve extends n {
2058
+ class Ie extends o {
695
2059
  constructor(e2, t2, i2) {
696
2060
  super(), this.handled = false, this.body = e2.body, this.cc = e2.cc, this.format = e2.format, this.from = e2.from, this.subject = e2.subject, this.to = e2.to, this.deviceInfo = t2, this.url = i2;
697
2061
  }
698
2062
  }
699
- const Pe = "System.Int64", ye = "System.Double", Ce = "System.String", Ie = "System.DateTime", Se = "System.Boolean";
700
- var be = function() {
2063
+ const Ce = "System.Int64", Se = "System.Double", be = "System.String", we = "System.DateTime", Re = "System.Boolean";
2064
+ var Ee = function() {
701
2065
  var e2 = {};
702
2066
  function t2(e3, t3, i3, n2) {
703
2067
  var r2 = [].concat(t3).map(function(t4) {
704
2068
  return function(e4, t5, i4) {
705
2069
  if (e4.availableValues) {
706
2070
  var n3 = false;
707
- if (le(e4.availableValues, function(e5, r3) {
2071
+ if (de(e4.availableValues, function(e5, r3) {
708
2072
  return !(n3 = i4(t5, r3.value));
709
2073
  }), !n3) {
710
2074
  if (e4.allowNull && !t5)
@@ -728,7 +2092,7 @@ var telerikReportViewer = (function (exports) {
728
2092
  function i2(e3, t3) {
729
2093
  return e3.allowNull && -1 != [null, "", void 0].indexOf(t3);
730
2094
  }
731
- return e2[Ce] = { validate: function(e3, i3) {
2095
+ return e2[be] = { validate: function(e3, i3) {
732
2096
  return t2(e3, i3, function(t3) {
733
2097
  if (!t3) {
734
2098
  if (e3.allowNull)
@@ -741,9 +2105,9 @@ var telerikReportViewer = (function (exports) {
741
2105
  }, function(e4, t3) {
742
2106
  return e4 == t3;
743
2107
  });
744
- } }, e2[ye] = { validate: function(e3, n2) {
2108
+ } }, e2[Se] = { validate: function(e3, n2) {
745
2109
  return t2(e3, n2, function(t3) {
746
- var n3 = de(t3);
2110
+ var n3 = ge(t3);
747
2111
  if (isNaN(n3)) {
748
2112
  if (i2(e3, t3))
749
2113
  return null;
@@ -751,11 +2115,11 @@ var telerikReportViewer = (function (exports) {
751
2115
  }
752
2116
  return n3;
753
2117
  }, function(e4, t3) {
754
- return de(e4) == de(t3);
2118
+ return ge(e4) == ge(t3);
755
2119
  });
756
- } }, e2[Pe] = { validate: function(e3, n2) {
2120
+ } }, e2[Ce] = { validate: function(e3, n2) {
757
2121
  return t2(e3, n2, function(t3) {
758
- var n3 = ce(t3);
2122
+ var n3 = pe(t3);
759
2123
  if (isNaN(n3)) {
760
2124
  if (i2(e3, t3))
761
2125
  return null;
@@ -763,19 +2127,19 @@ var telerikReportViewer = (function (exports) {
763
2127
  }
764
2128
  return n3;
765
2129
  }, function(e4, t3) {
766
- return ce(e4) == de(t3);
2130
+ return pe(e4) == ge(t3);
767
2131
  });
768
- } }, e2[Ie] = { validate: function(e3, i3) {
2132
+ } }, e2[we] = { validate: function(e3, i3) {
769
2133
  return t2(e3, i3, function(t3) {
770
2134
  if (e3.allowNull && (null === t3 || "" === t3 || void 0 === t3))
771
2135
  return null;
772
2136
  if (!isNaN(Date.parse(t3)))
773
- return e3.availableValues ? t3 : ue(t3);
2137
+ return e3.availableValues ? t3 : me(t3);
774
2138
  throw "Please input a valid date.";
775
2139
  }, function(e4, t3) {
776
- return e4 = ue(e4), t3 = ue(t3), e4.getTime() == t3.getTime();
2140
+ return e4 = me(e4), t3 = me(t3), e4.getTime() == t3.getTime();
777
2141
  });
778
- } }, e2[Se] = { validate: function(e3, n2) {
2142
+ } }, e2[Re] = { validate: function(e3, n2) {
779
2143
  return t2(e3, n2, function(t3) {
780
2144
  if (-1 != ["true", "false"].indexOf(String(t3).toLowerCase()))
781
2145
  return Boolean(t3);
@@ -788,11 +2152,11 @@ var telerikReportViewer = (function (exports) {
788
2152
  } }, { validate: function(t3, i3) {
789
2153
  var n2 = e2[t3.type];
790
2154
  if (!n2)
791
- throw ae("Cannot validate parameter of type {type}.", t3);
2155
+ throw ce("Cannot validate parameter of type {type}.", t3);
792
2156
  return n2.validate(t3, i3);
793
2157
  } };
794
2158
  }();
795
- function we(e2, t2, i2) {
2159
+ function Te(e2, t2, i2) {
796
2160
  try {
797
2161
  const n2 = e2.availableValues.find((e3) => e3.value === t2);
798
2162
  if (!n2)
@@ -802,23 +2166,23 @@ var telerikReportViewer = (function (exports) {
802
2166
  return;
803
2167
  }
804
2168
  }
805
- function Re(e2, t2, i2) {
2169
+ function Ae(e2, t2, i2) {
806
2170
  const n2 = [];
807
2171
  for (let r2 in t2)
808
- n2.push(we(e2, t2[r2], i2));
2172
+ n2.push(Te(e2, t2[r2], i2));
809
2173
  return n2;
810
2174
  }
811
- class Ee {
2175
+ class Me {
812
2176
  constructor(e2 = "", t2 = {}) {
813
2177
  this.report = e2, this.parameters = t2;
814
2178
  }
815
2179
  }
816
- class Te {
2180
+ class Le {
817
2181
  constructor(e2, t2, i2, n2 = null) {
818
2182
  this.element = e2, this.text = t2, this.title = i2, this.eventArgs = n2;
819
2183
  }
820
2184
  }
821
- class Ae extends R {
2185
+ class xe extends A {
822
2186
  constructor(e2) {
823
2187
  super(), this.resizeObserver = null, this.element = e2, this.initResizeObserver();
824
2188
  }
@@ -826,7 +2190,7 @@ var telerikReportViewer = (function (exports) {
826
2190
  this.destroyResizeObserver();
827
2191
  }
828
2192
  initResizeObserver() {
829
- this.debounceResize = te(this.onResize.bind(this), 50), this.resizeObserver = new ResizeObserver(this.debounceResize), this.resizeObserver.observe(this.element);
2193
+ this.debounceResize = re(this.onResize.bind(this), 50), this.resizeObserver = new ResizeObserver(this.debounceResize), this.resizeObserver.observe(this.element);
830
2194
  }
831
2195
  destroyResizeObserver() {
832
2196
  this.resizeObserver && this.resizeObserver.unobserve(this.element), this.resizeObserver = this.debounceResize = null;
@@ -835,8 +2199,8 @@ var telerikReportViewer = (function (exports) {
835
2199
  e2[0].target === this.element && this.emit("resize");
836
2200
  }
837
2201
  }
838
- const Me = '<div class="trv-report-page trv-skeleton-page trv-skeleton-{0}" style="{1}" data-page="{0}"><div class="trv-skeleton-wrapper" style="{2}"></div></div>';
839
- class Le {
2202
+ const De = '<div class="trv-report-page trv-skeleton-page trv-skeleton-{0}" style="{1}" data-page="{0}"><div class="trv-skeleton-wrapper" style="{2}"></div></div>';
2203
+ class Ne {
840
2204
  constructor(t2, i2, n2) {
841
2205
  this.enabled = false, this.viewMode = e.ViewMode.Interactive, this.scrollInProgress = false, this.additionalTopOffset = 130, this.onClickHandler = null, this.debounceScroll = null, this.throttleScroll = null, this.oldScrollTopPosition = 0, this.lastLoadedPage = null, this.placeholder = t2, this.pageContainer = t2.querySelector(".trv-page-container"), this.pageWrapper = t2.querySelector(".trv-page-wrapper"), this.contentArea = i2, this.controller = n2, this.controller.getPageMode() === e.PageMode.ContinuousScroll && this.enable(), this.controller.on("loadedReportChange", this.disable.bind(this)).on("viewModeChanged", this.disable.bind(this)).on("scaleChanged", this.onScaleChanged.bind(this)).on("interactiveActionExecuting", this.onInteractiveActionExecuting.bind(this)).on("pageLoaded", this.onPageLoaded.bind(this));
842
2206
  }
@@ -858,10 +2222,10 @@ var telerikReportViewer = (function (exports) {
858
2222
  return this.enabled;
859
2223
  }
860
2224
  enable() {
861
- this.enabled = true, $(this.placeholder, "scrollable"), this.initEvents();
2225
+ this.enabled = true, B(this.placeholder, "scrollable"), this.initEvents();
862
2226
  }
863
2227
  disable() {
864
- this.enabled && (this.lastLoadedPage = null, this.pageWrapper.innerHTML = "", this.enabled = false, U(this.placeholder, "scrollable"), this.unbind());
2228
+ this.enabled && (this.lastLoadedPage = null, this.pageWrapper.innerHTML = "", this.enabled = false, q(this.placeholder, "scrollable"), this.unbind());
865
2229
  }
866
2230
  renderPage(e2) {
867
2231
  let t2 = this.controller.getViewMode(), i2 = this.findPageElement(e2.pageNumber);
@@ -876,7 +2240,7 @@ var telerikReportViewer = (function (exports) {
876
2240
  this.enabled && this.currentPageNumber() > 0 && this.keepCurrentPageInToView();
877
2241
  }
878
2242
  setCurrentPage(e2) {
879
- e2 !== this.currentPageNumber() && this.controller.setCurrentPageNumber(e2), this.controller.getPageCount() > 1 && (U(this.findElement(".k-state-default"), "k-state-default"), $(this.findPageElement(e2), "k-state-default")), this.loadNextPreviousPage(e2);
2243
+ e2 !== this.currentPageNumber() && this.controller.setCurrentPageNumber(e2), this.controller.getPageCount() > 1 && (q(this.findElement(".k-state-default"), "k-state-default"), B(this.findPageElement(e2), "k-state-default")), this.loadNextPreviousPage(e2);
880
2244
  }
881
2245
  updatePageArea(e2) {
882
2246
  var t2;
@@ -901,18 +2265,18 @@ var telerikReportViewer = (function (exports) {
901
2265
  return this.controller.getCurrentPageNumber();
902
2266
  }
903
2267
  isSkeletonScreen(e2, t2) {
904
- return !(!e2 && !(e2 = this.findPageElement(t2))) && H(e2, "trv-skeleton-" + t2);
2268
+ return !(!e2 && !(e2 = this.findPageElement(t2))) && W(e2, "trv-skeleton-" + t2);
905
2269
  }
906
2270
  addSkeletonScreen(e2, t2) {
907
- let i2 = e2 + (t2 ? 1 : -1), n2 = this.findPageElement(i2), r2 = Y(n2, "style"), s2 = Y(null == n2 ? void 0 : n2.querySelector("sheet"), "style"), o2 = ae(Me, e2, r2, s2);
908
- t2 ? X(this.pageWrapper, o2) : K(this.pageWrapper, o2);
2271
+ let i2 = e2 + (t2 ? 1 : -1), n2 = this.findPageElement(i2), r2 = ie(n2, "style"), s2 = ie(null == n2 ? void 0 : n2.querySelector("sheet"), "style"), o2 = ce(De, e2, r2, s2);
2272
+ t2 ? ee(this.pageWrapper, o2) : Y(this.pageWrapper, o2);
909
2273
  }
910
2274
  generateSkeletonScreens(e2) {
911
2275
  var t2;
912
- let i2 = "", n2 = this.findPageElement(1), r2 = Y(n2, "style"), s2 = Y(null == n2 ? void 0 : n2.querySelector("sheet"), "style"), o2 = null === (t2 = this.findLastElement(".trv-report-page")) || void 0 === t2 ? void 0 : t2.dataset.page, a2 = o2 ? parseInt(o2) + 1 : 1;
2276
+ let i2 = "", n2 = this.findPageElement(1), r2 = ie(n2, "style"), s2 = ie(null == n2 ? void 0 : n2.querySelector("sheet"), "style"), o2 = null === (t2 = this.findLastElement(".trv-report-page")) || void 0 === t2 ? void 0 : t2.dataset.page, a2 = o2 ? parseInt(o2) + 1 : 1;
913
2277
  for (; a2 < e2; a2++)
914
- i2 += ae(Me, a2, r2, s2);
915
- K(this.pageWrapper, i2);
2278
+ i2 += ce(De, a2, r2, s2);
2279
+ Y(this.pageWrapper, i2);
916
2280
  }
917
2281
  loadMorePages() {
918
2282
  var e2;
@@ -963,10 +2327,10 @@ var telerikReportViewer = (function (exports) {
963
2327
  }
964
2328
  }
965
2329
  initEvents() {
966
- this.onClickHandler = this.clickPage.bind(this), this.debounceScroll = te(() => {
2330
+ this.onClickHandler = this.clickPage.bind(this), this.debounceScroll = re(() => {
967
2331
  let e2 = this.placeholder.querySelectorAll(".trv-report-page"), t2 = Math.round(this.pageContainer.scrollTop + this.pageContainer.offsetHeight);
968
2332
  !this.scrollInProgress && e2.length && this.oldScrollTopPosition !== t2 && this.advanceCurrentPage(Array.from(e2));
969
- }, 250), this.throttleScroll = ie(() => {
2333
+ }, 250), this.throttleScroll = se(() => {
970
2334
  let e2 = this.placeholder.querySelectorAll(".trv-report-page"), t2 = Math.round(this.pageContainer.scrollTop + this.pageContainer.offsetHeight);
971
2335
  this.scrollInProgress || this.oldScrollTopPosition === t2 || (this.oldScrollTopPosition > t2 ? this.scrollUp(Array.from(e2)) : this.scrollDown(Array.from(e2), t2)), this.oldScrollTopPosition = t2;
972
2336
  }, 250), this.pageContainer.addEventListener("click", this.onClickHandler), this.pageContainer.addEventListener("scroll", this.debounceScroll), this.pageContainer.addEventListener("scroll", this.throttleScroll);
@@ -1061,7 +2425,7 @@ var telerikReportViewer = (function (exports) {
1061
2425
  return i2 && i2.length ? i2[i2.length - 1] : null;
1062
2426
  }
1063
2427
  }
1064
- class xe {
2428
+ class ke {
1065
2429
  constructor() {
1066
2430
  this.scaleFactor = 0, this.placeholder = null, this.scrollableContainer = null, this.itemsInitialState = {}, this.xFrozenAreasBounds = {}, this.yFrozenAreasBounds = {}, this.freezeMaxZIndex = {}, this.freezeBGColor = {}, this.currentlyFrozenContainer = { vertical: {}, horizontal: {} }, this.zIndex = 1;
1067
2431
  }
@@ -1069,7 +2433,7 @@ var telerikReportViewer = (function (exports) {
1069
2433
  this.reset(e2), this.attachToScrollEvent();
1070
2434
  }
1071
2435
  reset(e2) {
1072
- this.placeholder = e2, this.scrollableContainer = Q(e2, ".trv-page-container"), this.itemsInitialState = {}, this.xFrozenAreasBounds = {}, this.yFrozenAreasBounds = {}, this.currentlyFrozenContainer = { vertical: {}, horizontal: {} };
2436
+ this.placeholder = e2, this.scrollableContainer = te(e2, ".trv-page-container"), this.itemsInitialState = {}, this.xFrozenAreasBounds = {}, this.yFrozenAreasBounds = {}, this.currentlyFrozenContainer = { vertical: {}, horizontal: {} };
1073
2437
  }
1074
2438
  setScaleFactor(e2) {
1075
2439
  this.scaleFactor = e2;
@@ -1092,7 +2456,7 @@ var telerikReportViewer = (function (exports) {
1092
2456
  saveFreezeItemsInitialState(e2) {
1093
2457
  var t2, i2, n2;
1094
2458
  let r2 = null === (t2 = this.placeholder) || void 0 === t2 ? void 0 : t2.querySelectorAll("[data-sticky-direction][data-sticky-id='" + e2 + "']"), s2 = null === (i2 = this.placeholder) || void 0 === i2 ? void 0 : i2.querySelectorAll("[data-reporting-action][data-sticky-id='" + e2 + "']"), o2 = null, a2 = null, l2 = null, h2 = null;
1095
- this.itemsInitialState[e2] = {}, this.freezeBGColor[e2] = (null === (n2 = Q(this.placeholder, "[data-id='" + e2 + "']")) || void 0 === n2 ? void 0 : n2.dataset.stickyBgColor) || "", r2.forEach((t3) => {
2459
+ this.itemsInitialState[e2] = {}, this.freezeBGColor[e2] = (null === (n2 = te(this.placeholder, "[data-id='" + e2 + "']")) || void 0 === n2 ? void 0 : n2.dataset.stickyBgColor) || "", r2.forEach((t3) => {
1096
2460
  var i3;
1097
2461
  let n3 = t3.dataset.stickyDirection, r3 = (null === (i3 = t3.dataset.id) || void 0 === i3 ? void 0 : i3.toString()) || "", s3 = t3.offsetLeft / this.scaleFactor, c2 = t3.offsetLeft + t3.offsetWidth * this.scaleFactor, d2 = t3.offsetTop / this.scaleFactor, u2 = t3.offsetTop + t3.offsetHeight * this.scaleFactor, p2 = (e3, t4) => null === e3 || t4 < e3 ? t4 : e3, g2 = (e3, t4) => null === e3 || t4 > e3 ? t4 : e3;
1098
2462
  switch (n3) {
@@ -1114,7 +2478,7 @@ var telerikReportViewer = (function (exports) {
1114
2478
  }
1115
2479
  updateFreezeItemsOnScroll(e2, t2, i2) {
1116
2480
  var n2, r2;
1117
- let s2 = Q(this.placeholder, "div[data-id='" + e2 + "']");
2481
+ let s2 = te(this.placeholder, "div[data-id='" + e2 + "']");
1118
2482
  if (!s2)
1119
2483
  return;
1120
2484
  let o2 = null === (n2 = this.placeholder) || void 0 === n2 ? void 0 : n2.querySelectorAll("[data-sticky-direction*='Horizontal'][data-sticky-id='" + e2 + "']"), a2 = null === (r2 = this.placeholder) || void 0 === r2 ? void 0 : r2.querySelectorAll("[data-sticky-direction*='Vertical'][data-sticky-id='" + e2 + "']");
@@ -1139,7 +2503,7 @@ var telerikReportViewer = (function (exports) {
1139
2503
  "IMG" !== e2.tagName && (t2 && this.isFrozen(r2) && !i2 ? e2.style.backgroundColor = this.freezeBGColor[r2] : e2.style.backgroundColor = n2 ? this.freezeBGColor[r2] : "initial");
1140
2504
  }
1141
2505
  hasSetBgColor(e2) {
1142
- return Z(e2) > 0;
2506
+ return Q(e2) > 0;
1143
2507
  }
1144
2508
  isFrozen(e2) {
1145
2509
  return this.currentlyFrozenContainer.horizontal[e2] || this.currentlyFrozenContainer.vertical[e2];
@@ -1159,21 +2523,21 @@ var telerikReportViewer = (function (exports) {
1159
2523
  return e2.top > t2.scrollTop - n2 && e2.top < t2.scrollTop + n2 + i2.height;
1160
2524
  }
1161
2525
  }
1162
- const Ne = /{(\w+?)}/g, De = "trv-initial-image-styles";
1163
- function ke(e2, t2) {
2526
+ const Fe = /{(\w+?)}/g, Oe = "trv-initial-image-styles";
2527
+ function Ve(e2, t2) {
1164
2528
  let i2 = Array.isArray(t2);
1165
- return e2 ? e2.replace(Ne, function(e3, n2) {
2529
+ return e2 ? e2.replace(Fe, function(e3, n2) {
1166
2530
  return t2[i2 ? parseInt(n2) : n2];
1167
2531
  }) : "";
1168
2532
  }
1169
- const Fe = "trv-search-dialog-shaded-result", Oe = "trv-search-dialog-highlighted-result";
2533
+ const ze = "trv-search-dialog-shaded-result", _e = "trv-search-dialog-highlighted-result";
1170
2534
  e.BookmarkNode = class {
1171
2535
  constructor() {
1172
2536
  this.id = "", this.text = "", this.page = 0, this.items = null;
1173
2537
  }
1174
2538
  }, e.ContentArea = class {
1175
2539
  constructor(e2, t2, i2, n2 = {}) {
1176
- this.actions = [], this.pendingElement = null, this.documentReady = true, this.reportPageIsLoaded = false, this.navigateToPageOnDocReady = 0, this.navigateToElementOnDocReady = null, this.onClickHandler = null, this.onMouseEnterHandler = null, this.onMouseLeaveHandler = null, this.isNewReportSource = false, this.uiFreezeCoordinator = null, this.initialPageAreaImageUrl = "", this.showPageAreaImage = false, this.placeholder = e2.querySelector(".trv-pages-pane, .trv-pages-area"), this.pageContainer = e2.querySelector(".trv-page-container"), this.pageWrapper = e2.querySelector(".trv-page-wrapper"), this.parametersContainer = e2.querySelector(".trv-parameters-area"), this.notification = e2.querySelector(".trv-notification, .trv-error-pane"), this.scrollManager = new Le(this.placeholder, this, t2), this.resizeService = new Ae(this.pageContainer), this.resizeService.on("resize", this.onResize.bind(this)), this.controller = t2, this.controller.on("pageReady", this.onPageReady.bind(this)).on("navigateToPage", this.navigateToPage.bind(this)).on("serverActionStarted", this.onServerActionStarted.bind(this)).on("reportSourceChanged", this.onReportSourceChanged.bind(this)).on("scaleChanged", this.updatePageDimensions.bind(this)).on("scaleModeChanged", this.updatePageDimensions.bind(this)).on("printStarted", this.onPrintStarted.bind(this)).on("printDocumentReady", this.onPrintDocumentReady.bind(this)).on("exportStarted", this.onExportStarted.bind(this)).on("exportDocumentReady", this.onExportDocumentReady.bind(this)).onAsync("beforeLoadReport", this.onBeforeLoadReport.bind(this)).on("beginLoadReport", this.onBeginLoadReport.bind(this)).on("reportLoadProgress", this.onReportLoadProgress.bind(this)).onAsync("reportLoadComplete", this.onReportLoadComplete.bind(this)).onAsync("reportAutoRunOff", this.onReportAutoRunOff.bind(this)).on("renderingStopped", this.onRenderingStopped.bind(this)).on("missingOrInvalidParameters", this.onMissingOrInvalidParameters.bind(this)).on("noReport", this.onNoReport.bind(this)).on("error", this.onError.bind(this)), this.messages = i2, this.enableAccessibility = n2.enableAccessibility || false, this.initialPageAreaImageUrl = n2.initialPageAreaImageUrl || "";
2540
+ this.actions = [], this.pendingElement = null, this.documentReady = true, this.reportPageIsLoaded = false, this.navigateToPageOnDocReady = 0, this.navigateToElementOnDocReady = null, this.onClickHandler = null, this.onMouseEnterHandler = null, this.onMouseLeaveHandler = null, this.isNewReportSource = false, this.uiFreezeCoordinator = null, this.initialPageAreaImageUrl = "", this.showPageAreaImage = false, this.placeholder = e2.querySelector(".trv-pages-pane, .trv-pages-area"), this.pageContainer = e2.querySelector(".trv-page-container"), this.pageWrapper = e2.querySelector(".trv-page-wrapper"), this.parametersContainer = e2.querySelector(".trv-parameters-area"), this.notification = e2.querySelector(".trv-notification, .trv-error-pane"), this.scrollManager = new Ne(this.placeholder, this, t2), this.resizeService = new xe(this.pageContainer), this.resizeService.on("resize", this.onResize.bind(this)), this.controller = t2, this.controller.on("pageReady", this.onPageReady.bind(this)).on("navigateToPage", this.navigateToPage.bind(this)).on("serverActionStarted", this.onServerActionStarted.bind(this)).on("reportSourceChanged", this.onReportSourceChanged.bind(this)).on("scaleChanged", this.updatePageDimensions.bind(this)).on("scaleModeChanged", this.updatePageDimensions.bind(this)).on("printStarted", this.onPrintStarted.bind(this)).on("printDocumentReady", this.onPrintDocumentReady.bind(this)).on("exportStarted", this.onExportStarted.bind(this)).on("exportDocumentReady", this.onExportDocumentReady.bind(this)).onAsync("beforeLoadReport", this.onBeforeLoadReport.bind(this)).on("beginLoadReport", this.onBeginLoadReport.bind(this)).on("reportLoadProgress", this.onReportLoadProgress.bind(this)).onAsync("reportLoadComplete", this.onReportLoadComplete.bind(this)).onAsync("reportAutoRunOff", this.onReportAutoRunOff.bind(this)).on("renderingStopped", this.onRenderingStopped.bind(this)).on("missingOrInvalidParameters", this.onMissingOrInvalidParameters.bind(this)).on("noReport", this.onNoReport.bind(this)).on("error", this.onError.bind(this)), this.messages = i2, this.enableAccessibility = n2.enableAccessibility || false, this.initialPageAreaImageUrl = n2.initialPageAreaImageUrl || "";
1177
2541
  }
1178
2542
  destroy() {
1179
2543
  this.resizeService && this.resizeService.destroy();
@@ -1200,10 +2564,10 @@ var telerikReportViewer = (function (exports) {
1200
2564
  this.documentReady = true, this.invalidateCurrentlyLoadedPage();
1201
2565
  }
1202
2566
  onReportLoadProgress(e2) {
1203
- this.navigateWhenPageAvailable(this.navigateToPageOnDocReady, e2.pageCount), this.showNotification(ke(this.messages.ReportViewer_LoadingReportPagesInProgress, [e2.pageCount]));
2567
+ this.navigateWhenPageAvailable(this.navigateToPageOnDocReady, e2.pageCount), this.showNotification(Ve(this.messages.ReportViewer_LoadingReportPagesInProgress, [e2.pageCount]));
1204
2568
  }
1205
2569
  onReportLoadComplete(t2) {
1206
- 0 === t2.pageCount ? (this.clearPage(), this.showNotification(this.messages.ReportViewer_NoPageToDisplay)) : (this.navigateOnLoadComplete(this.navigateToPageOnDocReady, t2.pageCount), this.showNotification(ke(this.messages.ReportViewer_LoadedReportPagesComplete, [t2.pageCount])), this.showNotificationTimeoutId = window.setTimeout(this.hideNotification.bind(this), 2e3), this.disableParametersArea(false), this.enableInteractivity()), t2.containsFrozenContent && null === this.uiFreezeCoordinator && (this.uiFreezeCoordinator = new xe(), this.controller.getViewMode() === e.ViewMode.Interactive && this.uiFreezeCoordinator.init(this.placeholder));
2570
+ 0 === t2.pageCount ? (this.clearPage(), this.showNotification(this.messages.ReportViewer_NoPageToDisplay)) : (this.navigateOnLoadComplete(this.navigateToPageOnDocReady, t2.pageCount), this.showNotification(Ve(this.messages.ReportViewer_LoadedReportPagesComplete, [t2.pageCount])), this.showNotificationTimeoutId = window.setTimeout(this.hideNotification.bind(this), 2e3), this.disableParametersArea(false), this.enableInteractivity()), t2.containsFrozenContent && null === this.uiFreezeCoordinator && (this.uiFreezeCoordinator = new ke(), this.controller.getViewMode() === e.ViewMode.Interactive && this.uiFreezeCoordinator.init(this.placeholder));
1207
2571
  }
1208
2572
  onReportAutoRunOff() {
1209
2573
  this.disableParametersArea(false), this.showNotification(this.messages.ReportViewer_AutoRunDisabled || "Please validate the report parameter values and press Preview to generate the report.");
@@ -1297,14 +2661,14 @@ var telerikReportViewer = (function (exports) {
1297
2661
  }
1298
2662
  let e3 = 0, i3 = 0;
1299
2663
  for (; n2 && n2 !== this.pageContainer; ) {
1300
- if (H(n2, "trv-page-wrapper")) {
2664
+ if (W(n2, "trv-page-wrapper")) {
1301
2665
  let t3 = n2.dataset.pageScale;
1302
2666
  if ("string" == typeof t3) {
1303
2667
  let n3 = parseFloat(t3);
1304
2668
  e3 *= n3, i3 *= n3;
1305
2669
  }
1306
2670
  }
1307
- e3 += n2.offsetTop, i3 += n2.offsetLeft, n2 = B(n2);
2671
+ e3 += n2.offsetTop, i3 += n2.offsetLeft, n2 = j(n2);
1308
2672
  }
1309
2673
  this.scrollManager.getEnabled() && t2 ? this.scrollManager.navigateToElement(e3, t2) : (this.pageContainer.scrollTop = e3, this.pageContainer.scrollLeft = i3);
1310
2674
  } else
@@ -1318,7 +2682,7 @@ var telerikReportViewer = (function (exports) {
1318
2682
  return !isNaN(t2) && t2 > -1 ? e2 : this.findNextFocusableElement(e2.nextElementSibling);
1319
2683
  }
1320
2684
  disablePagesArea(e2) {
1321
- e2 ? $(this.placeholder, "trv-loading") : U(this.placeholder, "trv-loading");
2685
+ e2 ? B(this.placeholder, "trv-loading") : q(this.placeholder, "trv-loading");
1322
2686
  }
1323
2687
  disableParametersArea(e2) {
1324
2688
  var t2, i2;
@@ -1330,11 +2694,11 @@ var telerikReportViewer = (function (exports) {
1330
2694
  showNotification(e2 = "", t2 = "info") {
1331
2695
  this.notification.dataset.type = t2 || "info";
1332
2696
  let i2 = this.notification.querySelector(".k-notification-content, .trv-error-message"), n2 = null == e2 ? void 0 : e2.split(/\r?\n/);
1333
- i2.innerHTML = n2 && n2.length ? `${n2.join("<br>")}` : "Notification message not found.", $(this.notification, `k-notification-${t2}`), U(this.notification, "k-hidden");
2697
+ i2.innerHTML = n2 && n2.length ? `${n2.join("<br>")}` : "Notification message not found.", B(this.notification, `k-notification-${t2}`), q(this.notification, "k-hidden");
1334
2698
  }
1335
2699
  hideNotification() {
1336
2700
  let e2 = String(this.notification.dataset.type);
1337
- delete this.notification.dataset.type, U(this.notification, `k-notification-${e2}`), $(this.notification, "k-hidden");
2701
+ delete this.notification.dataset.type, q(this.notification, `k-notification-${e2}`), B(this.notification, "k-hidden");
1338
2702
  }
1339
2703
  pageNo(e2) {
1340
2704
  var t2;
@@ -1353,10 +2717,13 @@ var telerikReportViewer = (function (exports) {
1353
2717
  let o2 = s2.querySelector("div.sheet"), a2 = s2.querySelector("div.trv-skeleton-wrapper");
1354
2718
  if (o2 = o2 || a2, !o2)
1355
2719
  return;
1356
- let l2 = 0, h2 = 0, c2 = getComputedStyle(s2), d2 = getComputedStyle(t2), u2 = q(d2.marginLeft) + q(c2.borderLeftWidth) + q(c2.paddingLeft), p2 = q(d2.marginRight) + q(c2.borderRightWidth) + q(c2.paddingRight), g2 = q(d2.marginTop) + q(c2.borderTopWidth) + q(c2.paddingTop), m2 = q(d2.marginBottom) + q(c2.borderBottomWidth) + q(c2.paddingBottom);
1357
- l2 = o2.offsetWidth, h2 = o2.offsetHeight;
2720
+ let l2 = 0, h2 = 0, c2 = getComputedStyle(s2), d2 = getComputedStyle(t2), u2 = G(d2.marginLeft) + G(c2.borderLeftWidth) + G(c2.paddingLeft), p2 = G(d2.marginRight) + G(c2.borderRightWidth) + G(c2.paddingRight), g2 = G(d2.marginTop) + G(c2.borderTopWidth) + G(c2.paddingTop), m2 = G(d2.marginBottom) + G(c2.borderBottomWidth) + G(c2.paddingBottom);
2721
+ if (l2 = o2.offsetWidth, h2 = o2.offsetHeight, 0 === l2) {
2722
+ const e2 = getComputedStyle(o2);
2723
+ l2 = parseInt(e2.width), h2 = parseInt(e2.height);
2724
+ }
1358
2725
  let f2 = h2 > l2 && n2 === e.ScaleMode.FitPageWidth ? 20 : 0, v2 = (this.pageContainer.clientWidth - f2 - u2 - p2) / l2, P2 = (this.pageContainer.clientHeight - 1 - g2 - m2) / h2;
1359
- n2 === e.ScaleMode.FitPageWidth ? r2 = v2 : r2 && n2 !== e.ScaleMode.FitPage || (r2 = Math.min(v2, P2)), null !== this.uiFreezeCoordinator && this.uiFreezeCoordinator.setScaleFactor(r2), t2.dataset.pageScale = r2.toString(), s2.dataset.pageScale = r2.toString(), a2 || W(o2, r2, r2), s2.style.height = r2 * h2 + "px", s2.style.width = r2 * l2 + "px";
2726
+ n2 === e.ScaleMode.FitPageWidth ? r2 = v2 : r2 && n2 !== e.ScaleMode.FitPage || (r2 = Math.min(v2, P2)), null !== this.uiFreezeCoordinator && this.uiFreezeCoordinator.setScaleFactor(r2), t2.dataset.pageScale = r2.toString(), s2.dataset.pageScale = r2.toString(), a2 || J(o2, r2, r2), s2.style.height = r2 * h2 + "px", s2.style.width = r2 * l2 + "px";
1360
2727
  }
1361
2728
  enableInteractivity() {
1362
2729
  this.onClickHandler = this.onClick.bind(this), this.onMouseEnterHandler = this.onMouseEnter.bind(this), this.onMouseLeaveHandler = this.onMouseLeave.bind(this), this.pageContainer.addEventListener("click", this.onClickHandler), this.pageContainer.addEventListener("mouseenter", this.onMouseEnterHandler, true), this.pageContainer.addEventListener("mouseleave", this.onMouseLeaveHandler, true);
@@ -1378,25 +2745,25 @@ var telerikReportViewer = (function (exports) {
1378
2745
  }
1379
2746
  onInteractiveItemClick(e2, t2) {
1380
2747
  var i2;
1381
- let n2 = (null === (i2 = e2.dataset.reportingAction) || void 0 === i2 ? void 0 : i2.toString()) || "", s2 = this.getAction(n2);
1382
- s2 && (this.navigateToPageOnDocReady = this.getNavigateToPageOnDocReady(t2, s2.Type), this.controller.executeReportAction(new r(e2, s2))), t2.stopPropagation();
2748
+ let n2 = (null === (i2 = e2.dataset.reportingAction) || void 0 === i2 ? void 0 : i2.toString()) || "", r2 = this.getAction(n2);
2749
+ r2 && (this.navigateToPageOnDocReady = this.getNavigateToPageOnDocReady(t2, r2.Type), this.controller.executeReportAction(new a(e2, r2))), t2.stopPropagation();
1383
2750
  }
1384
2751
  onInteractiveItemEnter(e2) {
1385
2752
  var t2;
1386
2753
  let i2 = (null === (t2 = e2.dataset.reportingAction) || void 0 === t2 ? void 0 : t2.toString()) || "", n2 = this.getAction(i2);
1387
- n2 && this.controller.reportActionEnter(new r(e2, n2));
2754
+ n2 && this.controller.reportActionEnter(new a(e2, n2));
1388
2755
  }
1389
2756
  onInteractiveItemLeave(e2) {
1390
2757
  var t2;
1391
2758
  let i2 = (null === (t2 = e2.dataset.reportingAction) || void 0 === t2 ? void 0 : t2.toString()) || "", n2 = this.getAction(i2);
1392
- n2 && this.controller.reportActionLeave(new r(e2, n2));
2759
+ n2 && this.controller.reportActionLeave(new a(e2, n2));
1393
2760
  }
1394
2761
  onToolTipItemEnter(e2, t2) {
1395
2762
  let i2 = e2.dataset.tooltipTitle, n2 = e2.dataset.tooltipText;
1396
- (i2 || n2) && this.controller.reportTooltipOpening(new Te(e2, n2 || "", i2 || "", t2));
2763
+ (i2 || n2) && this.controller.reportTooltipOpening(new Le(e2, n2 || "", i2 || "", t2));
1397
2764
  }
1398
2765
  onToolTipItemLeave(e2) {
1399
- this.controller.reportTooltipClosing(new Te(e2, "", "", null));
2766
+ this.controller.reportTooltipClosing(new Le(e2, "", "", null));
1400
2767
  }
1401
2768
  getNavigateToPageOnDocReady(e2, t2) {
1402
2769
  var i2;
@@ -1414,7 +2781,7 @@ var telerikReportViewer = (function (exports) {
1414
2781
  var t2;
1415
2782
  let i2 = "trv-" + this.controller.getClientId() + "-styles";
1416
2783
  null === (t2 = document.getElementById(i2)) || void 0 === t2 || t2.remove();
1417
- let n2 = _("style", i2);
2784
+ let n2 = H("style", i2);
1418
2785
  n2.innerHTML = e2.pageStyles, document.head.appendChild(n2);
1419
2786
  }
1420
2787
  setPageContent(e2) {
@@ -1426,26 +2793,26 @@ var telerikReportViewer = (function (exports) {
1426
2793
  this.actions && this.actions.length ? this.actions = this.actions.concat(t2.pageActions) : this.actions = t2.pageActions, this.applyPlaceholderViewModeClass(), this.setPageDimensions(e2, t2.pageNumber);
1427
2794
  }
1428
2795
  renderPageElement(e2) {
1429
- let t2 = _("div");
2796
+ let t2 = H("div");
1430
2797
  t2.innerHTML = e2.pageContent;
1431
2798
  let i2 = t2.querySelector("div.sheet");
1432
2799
  i2.style.margin = "0";
1433
- let n2 = _("div", "", "trv-report-page");
1434
- return n2.dataset.page = e2.pageNumber.toString(), n2.append(i2), n2.append(_("div", "", "k-overlay trv-overlay trv-page-overlay")), n2;
2800
+ let n2 = H("div", "", "trv-report-page");
2801
+ return n2.dataset.page = e2.pageNumber.toString(), n2.append(i2), n2.append(H("div", "", "k-overlay trv-overlay trv-page-overlay")), n2;
1435
2802
  }
1436
2803
  applyPlaceholderViewModeClass() {
1437
- this.controller.getViewMode() === e.ViewMode.Interactive ? (U(this.placeholder, "printpreview"), $(this.placeholder, "interactive")) : (U(this.placeholder, "interactive"), $(this.placeholder, "printpreview"));
2804
+ this.controller.getViewMode() === e.ViewMode.Interactive ? (q(this.placeholder, "printpreview"), B(this.placeholder, "interactive")) : (q(this.placeholder, "interactive"), B(this.placeholder, "printpreview"));
1438
2805
  }
1439
2806
  setPageAreaImage() {
1440
2807
  this.clearPageAreaImage();
1441
- let e2 = _("style", De);
1442
- e2.innerHTML = ke('.trv-page-container {background: #ffffff url("{0}") no-repeat center 50px}', [this.initialPageAreaImageUrl]), document.head.appendChild(e2), this.showPageAreaImage = true;
2808
+ let e2 = H("style", Oe);
2809
+ e2.innerHTML = Ve('.trv-page-container {background: #ffffff url("{0}") no-repeat center 50px}', [this.initialPageAreaImageUrl]), document.head.appendChild(e2), this.showPageAreaImage = true;
1443
2810
  }
1444
2811
  clearPageAreaImage() {
1445
2812
  var e2;
1446
- null === (e2 = document.getElementById(De)) || void 0 === e2 || e2.remove();
2813
+ null === (e2 = document.getElementById(Oe)) || void 0 === e2 || e2.remove();
1447
2814
  }
1448
- }, e.DeviceInfo = i, e.DocumentInfo = class {
2815
+ }, e.DeviceInfo = s, e.DocumentInfo = class {
1449
2816
  constructor() {
1450
2817
  this.documentReady = false, this.documentMapAvailable = false, this.containsFrozenContent = false, this.pageCount = 0, this.documentMapNodes = [], this.bookmarkNodes = [], this.renderingExtensions = [], this.autoRunEnabled = true;
1451
2818
  }
@@ -1453,19 +2820,19 @@ var telerikReportViewer = (function (exports) {
1453
2820
  constructor() {
1454
2821
  this.id = "", this.isExpanded = false, this.label = "", this.text = "", this.page = 0, this.items = [];
1455
2822
  }
1456
- }, e.EmailInfo = n, e.ExportDocumentReadyEventArgs = a, e.ExportStartEventArgs = o, e.KeepClientAliveSentinel = D, e.PageAction = class {
2823
+ }, e.EmailInfo = o, e.ExportDocumentReadyEventArgs = c, e.ExportStartEventArgs = h, e.KeepClientAliveSentinel = O, e.PageAction = class {
1457
2824
  constructor() {
1458
2825
  this.Id = "", this.ReportItemName = "", this.Type = "", this.Value = {};
1459
2826
  }
1460
- }, e.PageActionEventArgs = r, e.PageInfo = class {
2827
+ }, e.PageActionEventArgs = a, e.PageInfo = class {
1461
2828
  constructor() {
1462
2829
  this.pageNumber = 0, this.pageReady = false, this.pageStyles = "", this.pageContent = "", this.pageActions = [];
1463
2830
  }
1464
- }, e.PageTargetElement = s, e.ParameterInfo = class {
2831
+ }, e.PageTargetElement = l, e.ParameterInfo = class {
1465
2832
  constructor() {
1466
2833
  this.name = "", this.type = "", this.text = "", this.multivalue = false, this.allowNull = false, this.allowBlank = false, this.isVisible = false, this.autoRefresh = false, this.hasChildParameters = false, this.childParameters = [], this.availableValues = [], this.value = "", this.id = "", this.label = "";
1467
2834
  }
1468
- }, e.ParameterValidators = be, e.ParameterValue = class {
2835
+ }, e.ParameterValidators = Ee, e.ParameterValue = class {
1469
2836
  constructor() {
1470
2837
  this.name = "", this.value = null;
1471
2838
  }
@@ -1473,9 +2840,9 @@ var telerikReportViewer = (function (exports) {
1473
2840
  constructor() {
1474
2841
  this.name = "", this.localizedName = "";
1475
2842
  }
1476
- }, e.ReportController = class extends R {
2843
+ }, e.ReportController = class extends A {
1477
2844
  constructor(e2, t2) {
1478
- super(), this.configurationInfo = null, this.keepClientAliveSentinel = null, this.registerClientPromise = null, this.registerInstancePromise = null, this.documentFormatsPromise = null, this.clientId = "", this.reportInstanceId = "", this.documentId = "", this.threadId = "", this.parameterValues = {}, this.bookmarkNodes = [], this.renderingExtensions = null, this.pageCount = 0, this.currentPageNumber = 0, this.clientHasExpired = false, this.cancelLoad = false, this.searchInitiated = false, this.aiPromptInitiated = false, this.contentTabIndex = 0, this.respectAutoRun = true, this.processedParameterValues = {}, this.options = t2, t2.reportSource && this.setParameters(t2.reportSource.parameters), this.printManager = new x(), this.serviceClient = e2, t2.authenticationToken && this.serviceClient.setAccessToken(t2.authenticationToken);
2845
+ super(), this.configurationInfo = null, this.keepClientAliveSentinel = null, this.registerClientPromise = null, this.registerInstancePromise = null, this.documentFormatsPromise = null, this.clientId = "", this.reportInstanceId = "", this.documentId = "", this.threadId = "", this.parameterValues = {}, this.bookmarkNodes = [], this.renderingExtensions = null, this.pageCount = 0, this.currentPageNumber = 0, this.clientHasExpired = false, this.cancelLoad = false, this.searchInitiated = false, this.aiPromptInitiated = false, this.contentTabIndex = 0, this.respectAutoRun = true, this.processedParameterValues = {}, this.options = t2, t2.reportSource && this.setParameters(t2.reportSource.parameters), this.printManager = new k(), this.serviceClient = e2, t2.authenticationToken && this.serviceClient.setAccessToken(t2.authenticationToken);
1479
2846
  }
1480
2847
  get autoRunEnabled() {
1481
2848
  var e2 = !this.parameterValues || !("trv_AutoRun" in this.parameterValues) || this.parameterValues.trv_AutoRun;
@@ -1518,7 +2885,7 @@ var telerikReportViewer = (function (exports) {
1518
2885
  let n2 = {}, r2 = [], s2 = false;
1519
2886
  for (let t3 of e2)
1520
2887
  try {
1521
- let e3 = be.validate(t3, t3.value);
2888
+ let e3 = Ee.validate(t3, t3.value);
1522
2889
  n2[t3.id] = e3;
1523
2890
  } catch (e3) {
1524
2891
  s2 = true, r2.push(t3);
@@ -1528,7 +2895,7 @@ var telerikReportViewer = (function (exports) {
1528
2895
  hasInvalidParameter(e2) {
1529
2896
  for (const t2 of e2)
1530
2897
  try {
1531
- be.validate(t2, t2.value);
2898
+ Ee.validate(t2, t2.value);
1532
2899
  } catch (e3) {
1533
2900
  return true;
1534
2901
  }
@@ -1560,7 +2927,7 @@ var telerikReportViewer = (function (exports) {
1560
2927
  }
1561
2928
  getReportSource() {
1562
2929
  var e2;
1563
- return new Ee(null === (e2 = this.options.reportSource) || void 0 === e2 ? void 0 : e2.report, this.parameterValues);
2930
+ return new Me(null === (e2 = this.options.reportSource) || void 0 === e2 ? void 0 : e2.report, this.parameterValues);
1564
2931
  }
1565
2932
  setReportSource(e2) {
1566
2933
  this.options.reportSource = e2, this.setParameters(this.options.reportSource.parameters), this.emit("reportSourceChanged", e2);
@@ -1622,7 +2989,7 @@ var telerikReportViewer = (function (exports) {
1622
2989
  let e3 = t2.Value, i2 = this.fixDataContractJsonSerializer(e3.ParameterValues);
1623
2990
  this.respectAutoRun = true, this.emit("navigateToReport", { Report: e3.Report, Parameters: i2 });
1624
2991
  } else if ("navigateToBookmark" === t2.Type) {
1625
- let e3 = this.getPageForBookmark(this.bookmarkNodes, t2.Value), i2 = new s(t2.Value, "bookmark");
2992
+ let e3 = this.getPageForBookmark(this.bookmarkNodes, t2.Value), i2 = new l(t2.Value, "bookmark");
1626
2993
  this.navigateToPage(e3, i2);
1627
2994
  } else if ("sorting" === t2.Type)
1628
2995
  this.execServerAction(t2.Id);
@@ -1648,40 +3015,40 @@ var telerikReportViewer = (function (exports) {
1648
3015
  this.emit("toolTipClosing", e2);
1649
3016
  }
1650
3017
  printReport() {
1651
- return t(this, void 0, void 0, function* () {
3018
+ return r(this, void 0, void 0, function* () {
1652
3019
  let e2 = this.createDeviceInfo();
1653
3020
  e2.ImmediatePrint = true;
1654
- let t2 = new pe(e2);
3021
+ let t2 = new fe(e2);
1655
3022
  this.emit("printStarted", t2), t2.handled || (this.setUIState("PrintInProgress", true), this.exportAsync("PDF", e2).then((e3) => {
1656
3023
  let t3 = this.serviceClient.getDocumentUrl(this.clientId, this.reportInstanceId, e3);
1657
3024
  t3 += `?${"response-content-disposition=" + (this.getCanUsePlugin() ? "inline" : "attachment")}`;
1658
- let i2 = new ge(t3);
3025
+ let i2 = new ve(t3);
1659
3026
  this.emit("printDocumentReady", i2), this.setUIState("PrintInProgress", false), i2.handled || this.printManager.print(t3);
1660
3027
  }));
1661
3028
  });
1662
3029
  }
1663
3030
  exportReport(e2) {
1664
- return t(this, void 0, void 0, function* () {
1665
- let i2 = this.createDeviceInfo(), n2 = new o(i2, e2);
1666
- if (yield this.emitAsync("exportStart", n2), !n2.isCancelled) {
1667
- let r2 = new me(i2, e2);
1668
- if (this.emit("exportStarted", r2), r2.handled)
3031
+ return r(this, void 0, void 0, function* () {
3032
+ let t2 = this.createDeviceInfo(), i2 = new h(t2, e2);
3033
+ if (yield this.emitAsync("exportStart", i2), !i2.isCancelled) {
3034
+ let n2 = new Pe(t2, e2);
3035
+ if (this.emit("exportStarted", n2), n2.handled)
1669
3036
  return;
1670
- this.setUIState("ExportInProgress", true), this.exportAsync(e2, n2.deviceInfo).then((i3) => t(this, void 0, void 0, function* () {
1671
- let t2 = this.serviceClient.getDocumentUrl(this.clientId, this.reportInstanceId, i3);
1672
- t2 += "?response-content-disposition=attachment";
1673
- let n3 = new a(t2, e2, "_self");
1674
- yield this.emitAsync("exportEnd", n3), this.emit("exportDocumentReady", n3), this.setUIState("ExportInProgress", false), n3.handled || window.open(t2, n3.windowOpenTarget);
3037
+ this.setUIState("ExportInProgress", true), this.exportAsync(e2, i2.deviceInfo).then((t3) => r(this, void 0, void 0, function* () {
3038
+ let i3 = this.serviceClient.getDocumentUrl(this.clientId, this.reportInstanceId, t3);
3039
+ i3 += "?response-content-disposition=attachment";
3040
+ let n3 = new c(i3, e2, "_self");
3041
+ yield this.emitAsync("exportEnd", n3), this.emit("exportDocumentReady", n3), this.setUIState("ExportInProgress", false), n3.handled || window.open(i3, n3.windowOpenTarget);
1675
3042
  }));
1676
3043
  }
1677
3044
  });
1678
3045
  }
1679
3046
  sendReport(e2) {
1680
- let t2 = this.createDeviceInfo(), i2 = new fe(t2, e2.format);
3047
+ let t2 = this.createDeviceInfo(), i2 = new ye(t2, e2.format);
1681
3048
  this.emit("sendEmailStarted", i2), i2.handled || this.exportAsync(e2.format, t2).then((i3) => {
1682
3049
  let n2 = this.serviceClient.getDocumentUrl(this.clientId, this.reportInstanceId, i3);
1683
3050
  n2 += "?response-content-disposition=attachment";
1684
- let r2 = new ve(e2, t2, n2);
3051
+ let r2 = new Ie(e2, t2, n2);
1685
3052
  this.emit("sendEmailDocumentReady", r2), r2.handled || this.sendDocumentAsync(i3, e2);
1686
3053
  });
1687
3054
  }
@@ -1689,19 +3056,24 @@ var telerikReportViewer = (function (exports) {
1689
3056
  return this.serviceClient.getSearchResults(this.clientId, this.reportInstanceId, this.documentId, e2).catch(this.handleSearchRequestError.bind(this)).then((e3) => e3 || []);
1690
3057
  }
1691
3058
  createAIThread() {
1692
- return this.serviceClient.createAIThread(this.clientId, this.reportInstanceId, this.getReport(), this.parameterValues).catch((e2) => this.raiseError(e2._responseJSON.exceptionMessage, false)).then((e2) => (this.threadId = (null == e2 ? void 0 : e2.threadId) || "", e2));
3059
+ return this.serviceClient.createAIThread(this.clientId, this.reportInstanceId, this.getReport(), this.parameterValues).catch((e2) => this.raiseError(e2.exceptionMessage, false)).then((e2) => {
3060
+ if (this.threadId = (null == e2 ? void 0 : e2.threadId) || "", e2.consentMessage && (e2.consentMessage = n.default.sanitize(e2.consentMessage, { USE_PROFILES: { html: true } }), n.default.removed && n.default.removed.length > 0 && console.warn("The AI-Powered Insights consent message was sanitized as it contained potentially malicious HTML elements or attributes.")), e2.predefinedPrompts)
3061
+ for (let t2 = 0; t2 < e2.predefinedPrompts.length; t2++)
3062
+ e2.predefinedPrompts[t2] = n.default.sanitize(e2.predefinedPrompts[t2], { USE_PROFILES: { html: true } }), n.default.removed && n.default.removed.length > 0 && console.warn("An AI-Powered Insights predefined prompt was sanitized as it contained potentially malicious HTML elements or attributes.");
3063
+ return e2;
3064
+ });
1693
3065
  }
1694
3066
  getAIResponse(e2) {
1695
3067
  return this.serviceClient.getAIResponse(this.clientId, this.reportInstanceId, this.documentId, this.threadId, e2).then((e3) => e3 || "");
1696
3068
  }
1697
- exportAsync(e2, i2) {
1698
- return this.initializeClient().then(this.registerInstance.bind(this)).then(() => this.registerDocumentAsync(e2, i2, false, this.documentId)).then((e3) => t(this, void 0, void 0, function* () {
3069
+ exportAsync(e2, t2) {
3070
+ return this.initializeClient().then(this.registerInstance.bind(this)).then(() => this.registerDocumentAsync(e2, t2, false, this.documentId)).then((e3) => r(this, void 0, void 0, function* () {
1699
3071
  return yield this.getDocumentInfo(false, e3).catch((e4) => this.raiseError(e4)), e3;
1700
3072
  }));
1701
3073
  }
1702
3074
  sendDocumentAsync(e2, t2) {
1703
3075
  return this.serviceClient.sendDocument(this.clientId, this.reportInstanceId, e2, t2).catch((e3) => {
1704
- this.handleRequestError(e3, ae(this.options.messages.ReportViewer_ErrorSendingDocument, j(this.getReport())));
3076
+ this.handleRequestError(e3, ce(this.options.messages.ReportViewer_ErrorSendingDocument, Z(this.getReport())));
1705
3077
  });
1706
3078
  }
1707
3079
  loadParameters(e2 = void 0) {
@@ -1714,7 +3086,7 @@ var telerikReportViewer = (function (exports) {
1714
3086
  }
1715
3087
  initializeAndStartSentinel() {
1716
3088
  this.options.keepClientAlive && this.clientId && this.serviceClient.getClientsSessionTimeoutSeconds().then((e2) => {
1717
- this.keepClientAliveSentinel = new D(this.serviceClient, this.clientId, e2), this.keepClientAliveSentinel.start();
3089
+ this.keepClientAliveSentinel = new O(this.serviceClient, this.clientId, e2), this.keepClientAliveSentinel.start();
1718
3090
  });
1719
3091
  }
1720
3092
  stopSentinel() {
@@ -1739,29 +3111,29 @@ var telerikReportViewer = (function (exports) {
1739
3111
  this.pageCount = 0, this.currentPageNumber = 0;
1740
3112
  }
1741
3113
  handleSearchRequestError(e2) {
1742
- if (!ne(e2, "System.ArgumentException"))
3114
+ if (!oe(e2, "System.ArgumentException"))
1743
3115
  throw this.handleRequestError(e2, "", true), null;
1744
3116
  this.throwPromiseError(e2);
1745
3117
  }
1746
3118
  throwPromiseError(e2) {
1747
- throw e2.responseJSON && e2.responseJSON.exceptionMessage ? e2.responseJSON.exceptionMessage : this.options.messages.ReportViewer_PromisesChainStopError;
3119
+ throw e2.exceptionMessage ? e2.exceptionMessage : this.options.messages.ReportViewer_PromisesChainStopError;
1748
3120
  }
1749
3121
  handleRequestError(e2, t2 = "", i2 = false) {
1750
- re(e2) && this.onClientExpired();
1751
- let n2 = oe(e2.error) ? "" : e2.error, r2 = this.formatRequestError(e2, n2, t2);
3122
+ ae(e2) && this.onClientExpired();
3123
+ let n2 = he(e2.error) ? "" : e2.error, r2 = this.formatRequestError(e2, n2, t2);
1752
3124
  this.raiseError(r2), i2 || this.throwPromiseError(e2);
1753
3125
  }
1754
3126
  formatRequestError(e2, t2, i2) {
1755
3127
  let n2 = e2.responseJSON, r2 = "";
1756
3128
  if (n2) {
1757
- if (se(e2))
3129
+ if (le(e2))
1758
3130
  return this.options.messages.ReportViewer_MissingOrInvalidParameter;
1759
- r2 = j(n2.message);
1760
- let t3 = j(n2.exceptionMessage || n2.error_description);
3131
+ r2 = Z(n2.message);
3132
+ let t3 = Z(n2.exceptionMessage || n2.ExceptionMessage || n2.error_description);
1761
3133
  t3 && (r2 ? r2 += " " + t3 : r2 = t3);
1762
3134
  } else
1763
- r2 = j(e2.responseText);
1764
- return (i2 || t2) && (r2 && (r2 = " " + r2), r2 = j(i2 || t2) + r2), re(e2) && (r2 += "<br />" + this.options.messages.ReportViewer_ClientExpired), r2;
3135
+ r2 = Z(e2.responseText);
3136
+ return (i2 || t2) && (r2 && (r2 = " " + r2), r2 = Z(i2 || t2) + r2), ae(e2) && (r2 += "<br />" + this.options.messages.ReportViewer_ClientExpired), r2;
1765
3137
  }
1766
3138
  raiseError(e2, t2 = true) {
1767
3139
  this.emit("error", e2, t2);
@@ -1771,17 +3143,17 @@ var telerikReportViewer = (function (exports) {
1771
3143
  }
1772
3144
  initializeClient() {
1773
3145
  return this.registerClientPromise || (this.registerClientPromise = this.serviceClient.registerClient().catch((e2) => {
1774
- const t2 = ae(this.options.messages.ReportViewer_ErrorServiceUrl, [this.serviceClient.getServiceUrl()]);
3146
+ const t2 = ce(this.options.messages.ReportViewer_ErrorServiceUrl, [this.serviceClient.getServiceUrl()]);
1775
3147
  this.handleRequestError(e2, t2);
1776
3148
  }).then(this.setClientId.bind(this)).catch(this.clearClientId.bind(this))), this.registerClientPromise;
1777
3149
  }
1778
3150
  registerInstance() {
1779
3151
  return this.registerInstancePromise || (this.registerInstancePromise = this.serviceClient.createReportInstance(this.clientId, this.getReport(), this.parameterValues).then(this.setReportInstanceId.bind(this)).catch(this.clearReportInstanceId.bind(this))), this.registerInstancePromise;
1780
3152
  }
1781
- registerDocumentAsync(e2, i2, n2, r2 = "", s2 = "") {
1782
- return t(this, void 0, void 0, function* () {
1783
- return (yield this.serviceClient.createReportDocument(this.clientId, this.reportInstanceId, e2, i2, !n2, r2, s2).catch((t2) => {
1784
- this.handleRequestError(t2, ae(this.options.messages.ReportViewer_ErrorCreatingReportDocument, j(this.getReport()), j(e2)));
3153
+ registerDocumentAsync(e2, t2, i2, n2 = "", s2 = "") {
3154
+ return r(this, void 0, void 0, function* () {
3155
+ return (yield this.serviceClient.createReportDocument(this.clientId, this.reportInstanceId, e2, t2, !i2, n2, s2).catch((t3) => {
3156
+ this.handleRequestError(t3, ce(this.options.messages.ReportViewer_ErrorCreatingReportDocument, Z(this.getReport()), Z(e2)));
1785
3157
  })) || "";
1786
3158
  });
1787
3159
  }
@@ -1803,10 +3175,10 @@ var telerikReportViewer = (function (exports) {
1803
3175
  return e2.ContentOnly = true, e2.UseSVG = true, e2;
1804
3176
  }
1805
3177
  createDeviceInfo() {
1806
- let e2 = new i();
3178
+ let e2 = new s();
1807
3179
  this.options.enableAccessibility && (e2.enableAccessibility = true, e2.contentTabIndex = this.getContentTabIndex());
1808
- let t2 = this.getSearchInitiated(), n2 = this.options.searchMetadataOnDemand;
1809
- return e2.enableSearch = !n2 || t2, e2;
3180
+ let t2 = this.getSearchInitiated(), i2 = this.options.searchMetadataOnDemand;
3181
+ return e2.enableSearch = !i2 || t2, e2;
1810
3182
  }
1811
3183
  getParameters(e2) {
1812
3184
  return this.serviceClient.getParameters(this.clientId, this.getReport(), e2 || this.parameterValues).catch((e3) => {
@@ -1817,7 +3189,7 @@ var telerikReportViewer = (function (exports) {
1817
3189
  const e2 = {}, t2 = this.getProcessedParameterValues();
1818
3190
  for (let i2 in t2) {
1819
3191
  const n2 = t2[i2], r2 = this.parameterValues[i2];
1820
- n2 && n2.availableValues ? n2.multivalue ? e2[i2] = Re(n2, r2, i2) : e2[i2] = we(n2, r2, i2) : e2[i2] = r2;
3192
+ n2 && n2.availableValues ? n2.multivalue ? e2[i2] = Ae(n2, r2, i2) : e2[i2] = Te(n2, r2, i2) : e2[i2] = r2;
1821
3193
  }
1822
3194
  return e2;
1823
3195
  }
@@ -1827,13 +3199,13 @@ var telerikReportViewer = (function (exports) {
1827
3199
  getProcessedParameterValues() {
1828
3200
  return this.processedParameterValues;
1829
3201
  }
1830
- getDocumentInfo(i2, n2) {
1831
- return i2 && this.emit("beginLoadReport"), new Promise((r2, s2) => {
1832
- let o2 = () => t(this, void 0, void 0, function* () {
1833
- this.cancelLoad ? s2(this.options.messages.ReportViewer_RenderingCancelled) : (yield this.registerInstancePromise, this.serviceClient.getDocumentInfo(this.clientId, this.reportInstanceId, n2).then((t2) => {
1834
- t2 && t2.documentReady ? r2(t2) : (i2 && (this.getPageMode() === e.PageMode.ContinuousScroll && t2.pageCount > this.pageCount && this.emit("pageLoaded"), this.pageCount = t2.pageCount, this.emit("reportLoadProgress", t2)), window.setTimeout(o2, 500));
3202
+ getDocumentInfo(t2, i2) {
3203
+ return t2 && this.emit("beginLoadReport"), new Promise((n2, s2) => {
3204
+ let o2 = () => r(this, void 0, void 0, function* () {
3205
+ this.cancelLoad ? s2(this.options.messages.ReportViewer_RenderingCancelled) : (yield this.registerInstancePromise, this.serviceClient.getDocumentInfo(this.clientId, this.reportInstanceId, i2).then((i3) => {
3206
+ i3 && i3.documentReady ? n2(i3) : (t2 && (this.getPageMode() === e.PageMode.ContinuousScroll && i3.pageCount > this.pageCount && this.emit("pageLoaded"), this.pageCount = i3.pageCount, this.emit("reportLoadProgress", i3)), window.setTimeout(o2, 500));
1835
3207
  }).catch((e2) => {
1836
- "InvalidDocumentException" !== e2.responseJSON.exceptionType ? this.handleRequestError(e2, "", true) : console.warn("getDocumentInfo failed or was canceled by the user: " + e2.responseJSON.exceptionMessage);
3208
+ "InvalidDocumentException" !== e2.responseJSON.exceptionType ? this.handleRequestError(e2, "", true) : console.warn("getDocumentInfo failed or was canceled by the user: " + e2.exceptionMessage);
1837
3209
  }));
1838
3210
  });
1839
3211
  o2();
@@ -1922,8 +3294,9 @@ ${e3.text} (${e3.id})`;
1922
3294
  setConfigurationInfo(e2) {
1923
3295
  this.configurationInfo = e2;
1924
3296
  }
1925
- getAiConfigurationOptions() {
1926
- return this.configurationInfo.options.find((e2) => "ai-insights" === e2.name);
3297
+ isAiInsightsEnabled() {
3298
+ var e2, t2;
3299
+ return null !== (t2 = null === (e2 = this.configurationInfo.options.find((e3) => "ai-insights" === e3.name)) || void 0 === e2 ? void 0 : e2.isAvailable) && void 0 !== t2 && t2;
1927
3300
  }
1928
3301
  shouldShowLicenseBanner() {
1929
3302
  var e2;
@@ -1954,13 +3327,13 @@ ${e3.text} (${e3.id})`;
1954
3327
  constructor(e2, t2, i2) {
1955
3328
  this.url = e2, this.username = t2, this.password = i2;
1956
3329
  }
1957
- }, e.ReportSourceOptions = Ee, e.RequestError = l, e.SearchInfo = class {
3330
+ }, e.ReportSourceOptions = Me, e.RequestError = d, e.SearchInfo = class {
1958
3331
  constructor() {
1959
3332
  this.searchToken = "", this.matchCase = false, this.matchWholeWord = false, this.useRegularExpressions = false;
1960
3333
  }
1961
- }, e.SearchManager = class extends R {
3334
+ }, e.SearchManager = class extends A {
1962
3335
  constructor(e2, t2) {
1963
- super(), this.searchResults = [], this.pendingHighlightItem = null, this.highlightedElements = [], this.currentHighlightedElement = null, this.isActive = false, this.controller = t2, this.pageContainer = Q(e2, ".trv-page-container"), this.controller.on("applySearchColors", this.applySearchColors.bind(this)).on("pageReady", this.applySearchColors.bind(this));
3336
+ super(), this.searchResults = [], this.pendingHighlightItem = null, this.highlightedElements = [], this.currentHighlightedElement = null, this.isActive = false, this.controller = t2, this.pageContainer = te(e2, ".trv-page-container"), this.controller.on("applySearchColors", this.applySearchColors.bind(this)).on("pageReady", this.applySearchColors.bind(this));
1964
3337
  }
1965
3338
  search(e2) {
1966
3339
  this.isActive = true, this.clearColoredItems(), this.searchResults = [], e2.searchToken && "" !== e2.searchToken ? this.controller.getSearchResults(e2).then(this.onSearchComplete.bind(this)) : this.onSearchComplete([]);
@@ -1969,15 +3342,15 @@ ${e3.text} (${e3.id})`;
1969
3342
  this.isActive = false, this.clearColoredItems(), this.searchResults = [];
1970
3343
  }
1971
3344
  highlightSearchItem(t2) {
1972
- t2 && (this.currentHighlightedElement && (U(this.currentHighlightedElement, Oe), $(this.currentHighlightedElement, Fe)), t2.page === this.controller.getCurrentPageNumber() ? this.highlightItem(t2) : this.controller.getPageMode() === e.PageMode.SinglePage ? this.clearColoredItems() : this.highlightItem(t2), this.pendingHighlightItem = t2, this.navigateToPage(t2));
3345
+ t2 && (this.currentHighlightedElement && (q(this.currentHighlightedElement, _e), B(this.currentHighlightedElement, ze)), t2.page === this.controller.getCurrentPageNumber() ? this.highlightItem(t2) : this.controller.getPageMode() === e.PageMode.SinglePage ? this.clearColoredItems() : this.highlightItem(t2), this.pendingHighlightItem = t2, this.navigateToPage(t2));
1973
3346
  }
1974
3347
  navigateToPage(e2) {
1975
- this.controller.navigateToPage(e2.page, new s(e2.id, "search"));
3348
+ this.controller.navigateToPage(e2.page, new l(e2.id, "search"));
1976
3349
  }
1977
3350
  colorPageElements(e2) {
1978
3351
  e2 && 0 !== e2.length && (e2.forEach((e3) => {
1979
- let t2 = Q(this.pageContainer, "[data-search-id=" + e3.id + "]");
1980
- t2 && ($(t2, Fe), this.highlightedElements.push(t2));
3352
+ let t2 = te(this.pageContainer, "[data-search-id=" + e3.id + "]");
3353
+ t2 && (B(t2, ze), this.highlightedElements.push(t2));
1981
3354
  }), this.highlightItem(this.pendingHighlightItem));
1982
3355
  }
1983
3356
  highlightItem(e2) {
@@ -1985,13 +3358,13 @@ ${e3.text} (${e3.id})`;
1985
3358
  let t2 = this.highlightedElements.find(function(t3) {
1986
3359
  return t3.dataset.searchId === e2.id;
1987
3360
  });
1988
- t2 && (this.currentHighlightedElement = t2, U(t2, Fe), $(t2, Oe));
3361
+ t2 && (this.currentHighlightedElement = t2, q(t2, ze), B(t2, _e));
1989
3362
  }
1990
3363
  }
1991
3364
  clearColoredItems() {
1992
3365
  this.highlightedElements && this.highlightedElements.length > 0 && this.highlightedElements.forEach((e2) => {
1993
- U(e2, Fe);
1994
- }), this.currentHighlightedElement && U(this.currentHighlightedElement, Oe), this.highlightedElements = [], this.currentHighlightedElement = null;
3366
+ q(e2, ze);
3367
+ }), this.currentHighlightedElement && q(this.currentHighlightedElement, _e), this.highlightedElements = [], this.currentHighlightedElement = null;
1995
3368
  }
1996
3369
  applySearchColors() {
1997
3370
  this.isActive && this.colorPageElements(this.searchResults);
@@ -2014,19 +3387,19 @@ ${e3.text} (${e3.id})`;
2014
3387
  authenticatedGet(e2) {
2015
3388
  return this.login().then(function(t2) {
2016
3389
  return function(e3, t3) {
2017
- return fetch(e3, { headers: h(t3) }).then(c);
3390
+ return fetch(e3, { headers: u(t3) }).then(p);
2018
3391
  }(e2, t2);
2019
3392
  });
2020
3393
  }
2021
3394
  authenticatedPost(e2, t2) {
2022
3395
  return this.login().then(function(i2) {
2023
- return d(e2, t2, i2);
3396
+ return g(e2, t2, i2);
2024
3397
  });
2025
3398
  }
2026
3399
  authenticatedDelete(e2) {
2027
3400
  return this.login().then(function(t2) {
2028
3401
  return function(e3, t3) {
2029
- return fetch(e3, { method: "DELETE", headers: h(t3) }).then(c);
3402
+ return fetch(e3, { method: "DELETE", headers: u(t3) }).then(p);
2030
3403
  }(e2, t2);
2031
3404
  });
2032
3405
  }
@@ -2037,7 +3410,7 @@ ${e3.text} (${e3.id})`;
2037
3410
  let e2 = this.options.loginInfo;
2038
3411
  if (e2 && e2.url && (e2.username || e2.password)) {
2039
3412
  let t2 = `grant_type=password&username=${encodeURIComponent((null == e2 ? void 0 : e2.username) || "")}&password=${encodeURIComponent((null == e2 ? void 0 : e2.password) || "")}`;
2040
- return d(e2.url, t2, "", true).then((e3) => e3.access_token);
3413
+ return g(e2.url, t2, "", true).then((e3) => e3.access_token);
2041
3414
  }
2042
3415
  return Promise.resolve("");
2043
3416
  }
@@ -2127,15 +3500,15 @@ ${e3.text} (${e3.id})`;
2127
3500
  constructor(e2, t2 = null) {
2128
3501
  this.serviceUrl = "", this.serviceUrl = e2.replace(/\/+$/, ""), this.loginInfo = t2;
2129
3502
  }
2130
- }, e.addClass = $, e.appendHtml = K, e.createElement = _, e.debounce = te, e.each = le, e.escapeHtml = j, e.findElement = Q, e.getColorAlphaValue = Z, e.getElementAttributeValue = Y, e.getElementScrollParent = ee, e.getOffsetParent = B, e.hasClass = H, e.isArray = he, e.isExceptionOfType = ne, e.isInternalServerError = oe, e.isInvalidClientException = re, e.isInvalidParameterException = se, e.isRgbColor = G, e.keepElementInView = function(e2) {
3503
+ }, e.addClass = B, e.appendHtml = Y, e.createElement = H, e.debounce = re, e.each = de, e.escapeHtml = Z, e.findElement = te, e.getColorAlphaValue = Q, e.getElementAttributeValue = ie, e.getElementScrollParent = ne, e.getOffsetParent = j, e.hasClass = W, e.isArray = ue, e.isExceptionOfType = oe, e.isInternalServerError = he, e.isInvalidClientException = ae, e.isInvalidParameterException = le, e.isRgbColor = X, e.keepElementInView = function(e2) {
2131
3504
  if (!e2)
2132
3505
  return;
2133
- let t2 = ee(e2);
3506
+ let t2 = ne(e2);
2134
3507
  if (!t2)
2135
3508
  return;
2136
3509
  let i2 = e2.offsetTop, n2 = i2 + e2.offsetHeight, r2 = t2.scrollTop + t2.offsetHeight;
2137
3510
  i2 < t2.scrollTop ? t2.scrollTop = i2 : n2 > r2 && (t2.scrollTop += n2 - r2);
2138
- }, e.parseToLocalDate = ue, e.prependHtml = X, e.removeClass = U, e.reportSourcesAreEqual = function(e2) {
3511
+ }, e.parseToLocalDate = me, e.prependHtml = ee, e.removeClass = q, e.reportSourcesAreEqual = function(e2) {
2139
3512
  const t2 = e2.firstReportSource, i2 = e2.secondReportSource;
2140
3513
  if (t2 && i2 && t2.report === i2.report) {
2141
3514
  let e3 = "";
@@ -2144,7 +3517,7 @@ ${e3.text} (${e3.id})`;
2144
3517
  return i2.parameters && (n2 = JSON.stringify(i2.parameters)), e3 === n2;
2145
3518
  }
2146
3519
  return false;
2147
- }, e.scaleElement = W, e.stringFormat = ae, e.throttle = ie, e.toPixel = q, e.toRgbColor = J, e.tryParseFloat = de, e.tryParseInt = ce, Object.defineProperty(e, "__esModule", { value: true });
3520
+ }, e.scaleElement = J, e.stringFormat = ce, e.throttle = se, e.toPixel = G, e.toRgbColor = K, e.tryParseFloat = ge, e.tryParseInt = pe, Object.defineProperty(e, "__esModule", { value: true });
2148
3521
  });
2149
3522
  })(dist, dist.exports);
2150
3523
  var distExports = dist.exports;
@@ -2179,13 +3552,6 @@ ${e3.text} (${e3.id})`;
2179
3552
  return false;
2180
3553
  };
2181
3554
  }
2182
- function toXhrErrorData(xhr, status, error) {
2183
- return {
2184
- xhr,
2185
- status,
2186
- error
2187
- };
2188
- }
2189
3555
  function rectangle(left, top, width, height) {
2190
3556
  return {
2191
3557
  left,
@@ -2338,13 +3704,6 @@ ${e3.text} (${e3.id})`;
2338
3704
  }
2339
3705
  return parseJSON(xhr.responseText);
2340
3706
  }
2341
- function loadScript(url) {
2342
- var ajaxOptions = {
2343
- dataType: "script",
2344
- cache: true
2345
- };
2346
- return $ajax(url, ajaxOptions);
2347
- }
2348
3707
  function filterUniqueLastOccurrence(array) {
2349
3708
  function onlyLastUnique(value, index, self) {
2350
3709
  return self.lastIndexOf(value) === index;
@@ -2394,15 +3753,6 @@ ${e3.text} (${e3.id})`;
2394
3753
  var alpha = colorComponents.length === 4 ? parseFloat((parseFloat(colorComponents[3].replace(/[()]/g, "")) / 255).toFixed(2)) : 1;
2395
3754
  return alpha;
2396
3755
  }
2397
- function $ajax(url, ajaxSettings) {
2398
- return new Promise(function(resolve, reject) {
2399
- $.ajax(url, ajaxSettings).done(function(data) {
2400
- return resolve(data);
2401
- }).fail(function(xhr, status, error) {
2402
- reject(toXhrErrorData(xhr, status, error));
2403
- });
2404
- });
2405
- }
2406
3756
 
2407
3757
  const utils = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
2408
3758
  __proto__: null,
@@ -2424,13 +3774,11 @@ ${e3.text} (${e3.id})`;
2424
3774
  exceptionTypeNamesMatch,
2425
3775
  parseJSON,
2426
3776
  getExceptionInstance,
2427
- loadScript,
2428
3777
  filterUniqueLastOccurrence,
2429
3778
  logError,
2430
3779
  toRgbColor,
2431
3780
  isRgbColor,
2432
3781
  getColorAlphaValue,
2433
- $ajax,
2434
3782
  tryParseInt: distExports.tryParseInt,
2435
3783
  tryParseFloat: distExports.tryParseFloat,
2436
3784
  parseToLocalDate: distExports.parseToLocalDate,
@@ -3282,9 +4630,12 @@ ${e3.text} (${e3.id})`;
3282
4630
  sendEmailValidationSingleEmail: "The field accepts a single email address only",
3283
4631
  sendEmailValidationFormatRequired: "Format field is required",
3284
4632
  errorSendingDocument: "Error sending report document (Report = '{0}').",
3285
- aiPromptConsentDialogTitle: "Before you start with AI",
3286
- aiPromptConsentAgreeLabel: "Consent",
3287
- aiPromptConsentRejectLabel: "Cancel"
4633
+ aiPromptDialogConsentTitle: "Before you start with AI",
4634
+ aiPromptDialogConsentAccept: "Consent",
4635
+ aiPromptDialogConsentReject: "Cancel",
4636
+ aiPromptDialogTextAreaPlaceholder: "Enter your prompt",
4637
+ aiPromptDialogNoPredefinedAndCustomPromptsPlaceholder: "Custom prompts are disabled and there are no predefined prompts configured. Please allow custom prompts or add predefined prompts to use the AI feature.",
4638
+ aiPromptDialogNoCustomPromptsPlaceholder: "Custom prompts are disabled, please select one of the predefined suggestions below"
3288
4639
  };
3289
4640
  window.telerikReportViewer ||= {};
3290
4641
  window.telerikReportViewer.sr ||= sr$1;
@@ -4763,9 +6114,9 @@ ${e3.text} (${e3.id})`;
4763
6114
  }
4764
6115
  showDocumentMap(show) {
4765
6116
  var splitter = $("#" + this.options.viewerSelector + "-document-map-splitter").getKendoSplitter();
4766
- var sibling = this.$element.next();
6117
+ var sibling = this.$element.next(".k-splitbar");
4767
6118
  if (this.options.documentMapAreaPosition === DocumentMapAreaPositions.RIGHT) {
4768
- sibling = this.$element.prev();
6119
+ sibling = this.$element.prev(".k-splitbar");
4769
6120
  }
4770
6121
  if (splitter) {
4771
6122
  (this.documentMapNecessary ? $.fn.removeClass : $.fn.addClass).call(sibling, "k-hidden");
@@ -5369,9 +6720,9 @@ ${e3.text} (${e3.id})`;
5369
6720
  if (!splitter) {
5370
6721
  return;
5371
6722
  }
5372
- var sibling = this.$element.prev();
6723
+ var sibling = this.$element.prev(".k-splitbar");
5373
6724
  if (this.options.parametersAreaPosition === ParametersAreaPositions.TOP || this.options.parametersAreaPosition === ParametersAreaPositions.LEFT) {
5374
- sibling = this.$element.next();
6725
+ sibling = this.$element.next(".k-splitbar");
5375
6726
  }
5376
6727
  (this.parametersAreaNecessary ? $.fn.removeClass : $.fn.addClass).call(sibling, "k-hidden");
5377
6728
  splitter.toggle(".trv-parameters-area", show);
@@ -5388,8 +6739,10 @@ ${e3.text} (${e3.id})`;
5388
6739
  _attachEvents() {
5389
6740
  this.controller.on("reloadParameters", (controllerLoadParametersPromise) => {
5390
6741
  this.showError();
5391
- kendo.destroy(this._parametersWrapper);
5392
- this._parametersWrapper.innerHTML = "";
6742
+ if (this._parametersWrapper) {
6743
+ kendo.destroy(this._parametersWrapper);
6744
+ this._parametersWrapper.innerHTML = "";
6745
+ }
5393
6746
  this.acceptParameters(controllerLoadParametersPromise, this.onLoadParametersSuccess.bind(this));
5394
6747
  }).onAsync("beforeLoadReport", async () => {
5395
6748
  this.loadingCount = 0;
@@ -6923,7 +8276,7 @@ ${e3.text} (${e3.id})`;
6923
8276
  }
6924
8277
  createToolbarItem(elementData) {
6925
8278
  const cmdName = (elementData.dataset?.command || "").replace("telerik_ReportViewer_", "");
6926
- if (cmdName === "toggleAiPromptDialog" && !this._options.controller.getAiConfigurationOptions()?.isAvailable) {
8279
+ if (cmdName === "toggleAiPromptDialog" && !this._options.controller.isAiInsightsEnabled()) {
6927
8280
  return;
6928
8281
  }
6929
8282
  const id = elementData.id;
@@ -7097,9 +8450,9 @@ ${e3.text} (${e3.id})`;
7097
8450
  this.pagesAreaContainer = this.reportViewerWrapper.find('[data-id="trv-pages-area"]');
7098
8451
  this.aiPromptDialogInitialized = false;
7099
8452
  this.aiPromptInitialized = false;
7100
- const aiConfigurationOptions = this.controller.getAiConfigurationOptions();
7101
- this.requireConsent = aiConfigurationOptions.requireConsent;
7102
- this.allowCustomPrompts = aiConfigurationOptions.allowCustomPrompts;
8453
+ this.requireConsent = false;
8454
+ this.allowCustomPrompts = true;
8455
+ this.predefinedPrompts = [];
7103
8456
  this.init();
7104
8457
  }
7105
8458
  init() {
@@ -7107,10 +8460,8 @@ ${e3.text} (${e3.id})`;
7107
8460
  return;
7108
8461
  }
7109
8462
  replaceStringResources(this.$element);
7110
- if (this.requireConsent) {
7111
- this._initAiConsentDialog();
7112
- this._attachAiConsentDialogCommands();
7113
- }
8463
+ this._initAiConsentDialog();
8464
+ this._attachAiConsentDialogCommands();
7114
8465
  this._initAiPromptDialog();
7115
8466
  this._attachEvents();
7116
8467
  this.aiPromptDialogInitialized = true;
@@ -7143,7 +8494,10 @@ ${e3.text} (${e3.id})`;
7143
8494
  this.kendoAiConsentDialog.close();
7144
8495
  this.controller.saveToSessionStorage("trvAiConsent", "true");
7145
8496
  this.controller.setAiPromptInitiated(true);
7146
- this.open();
8497
+ if (this.kendoAiPromptDialog) {
8498
+ this._initAiPrompt(this.predefinedPrompts);
8499
+ this.kendoAiPromptDialog.open();
8500
+ }
7147
8501
  })
7148
8502
  };
7149
8503
  Binder.attachCommands(this.kendoAiConsentDialog.element.find(".trv-ai-consent-actions"), optionsCommandSet, this.viewerOptions);
@@ -7155,7 +8509,7 @@ ${e3.text} (${e3.id})`;
7155
8509
  return;
7156
8510
  }
7157
8511
  this.kendoAiConsentDialog = new kendo.ui.Window(aiConsentDialogElement, {
7158
- title: "Before you start with AI",
8512
+ title: stringResources["aiPromptDialogConsentTitle"] || "",
7159
8513
  width: 500,
7160
8514
  minWidth: 400,
7161
8515
  minHeight: 106,
@@ -7257,14 +8611,14 @@ ${e3.text} (${e3.id})`;
7257
8611
  if (this.allowCustomPrompts) {
7258
8612
  return;
7259
8613
  }
7260
- let aiPromptTextAreaPlaceholder = "Enter your prompt";
8614
+ let aiPromptTextAreaPlaceholder = stringResources["aiPromptDialogTextAreaPlaceholder"];
7261
8615
  const aiPromptTextArea = this.kendoAiPrompt.element.find(".k-prompt-content .k-prompt-view textarea");
7262
8616
  if (!hasPromptSuggestions) {
7263
8617
  const aiPromptGenerateButton = this.kendoAiPrompt.element.find(".k-prompt-footer .k-actions");
7264
8618
  aiPromptGenerateButton && aiPromptGenerateButton.addClass("k-disabled");
7265
- aiPromptTextAreaPlaceholder = "Custom prompts are disabled and there are no predefined prompts configured. Please allow custom prompts or add predefined prompts to use the AI feature.";
8619
+ aiPromptTextAreaPlaceholder = stringResources["aiPromptDialogNoPredefinedAndCustomPromptsPlaceholder"] || "";
7266
8620
  } else {
7267
- aiPromptTextAreaPlaceholder = "Custom prompts are disabled, please select one of the predefined suggestions below";
8621
+ aiPromptTextAreaPlaceholder = stringResources["aiPromptDialogNoCustomPromptsPlaceholder"] || "";
7268
8622
  }
7269
8623
  aiPromptTextArea && aiPromptTextArea.attr("placeholder", aiPromptTextAreaPlaceholder) && aiPromptTextArea.addClass("k-disabled");
7270
8624
  }
@@ -7316,17 +8670,20 @@ ${e3.text} (${e3.id})`;
7316
8670
  }
7317
8671
  }
7318
8672
  open() {
7319
- if (this.kendoAiConsentDialog && this.requireConsent && this.controller.loadFromSessionStorage("trvAiConsent") !== "true") {
7320
- this.kendoAiConsentDialog.open();
7321
- return;
7322
- }
7323
- if (this.kendoAiPromptDialog) {
7324
- this.controller.createAIThread().then((data) => {
8673
+ this.controller.createAIThread().then((data) => {
8674
+ this.predefinedPrompts = data?.predefinedPrompts;
8675
+ this.allowCustomPrompts = data?.allowCustomPrompts;
8676
+ if (this.kendoAiConsentDialog && data.requireConsent && this.controller.loadFromSessionStorage("trvAiConsent") !== "true") {
8677
+ $(".trv-ai-consent-content").html(data?.consentMessage);
8678
+ this.kendoAiConsentDialog.open();
8679
+ return;
8680
+ }
8681
+ if (this.kendoAiPromptDialog) {
7325
8682
  this.controller.setAiPromptInitiated(true);
7326
- this._initAiPrompt(data?.predefinedPrompts);
8683
+ this._initAiPrompt(this.predefinedPrompts);
7327
8684
  this.kendoAiPromptDialog.open();
7328
- });
7329
- }
8685
+ }
8686
+ });
7330
8687
  }
7331
8688
  close() {
7332
8689
  this.controller.setAiPromptInitiated(false);
@@ -7424,7 +8781,8 @@ ${e3.text} (${e3.id})`;
7424
8781
  searchMetadataOnDemand: false,
7425
8782
  initialPageAreaImageUrl: null,
7426
8783
  keepClientAlive: true,
7427
- webDesignerPreview: false
8784
+ webDesignerPreview: false,
8785
+ serverPreview: false
7428
8786
  };
7429
8787
  }
7430
8788
  function ReportViewer(dom, options) {
@@ -7453,7 +8811,7 @@ ${e3.text} (${e3.id})`;
7453
8811
  if (!validateOptions(options)) {
7454
8812
  return;
7455
8813
  }
7456
- var version = "19.1.25.716";
8814
+ var version = "19.2.25.813";
7457
8815
  options = $.extend({}, getDefaultOptions(svcApiUrl, version), options);
7458
8816
  settings = new ReportViewerSettings(
7459
8817
  persistanceKey,
@@ -7468,7 +8826,8 @@ ${e3.text} (${e3.id})`;
7468
8826
  parametersAreaPosition: options.parametersAreaPosition,
7469
8827
  documentMapAreaPosition: options.documentMapAreaPosition,
7470
8828
  keepClientAlive: options.keepClientAlive,
7471
- webDesignerPreview: options.webDesignerPreview
8829
+ webDesignerPreview: options.webDesignerPreview,
8830
+ serverPreview: options.serverPreview
7472
8831
  }
7473
8832
  );
7474
8833
  notificationService = new NotificationService();
@@ -7946,7 +9305,7 @@ ${e3.text} (${e3.id})`;
7946
9305
  function start() {
7947
9306
  var pendingRefresh = false;
7948
9307
  init();
7949
- if (!options.webDesignerPreview) {
9308
+ if (!(options.webDesignerPreview || options.serverPreview)) {
7950
9309
  if (controller.shouldShowLicenseBanner()) {
7951
9310
  $(".trv-content-wrapper")?.prepend('<span class="trv-license-banner"></span>');
7952
9311
  const licenseBanner = $(".trv-license-banner").kendoNotification({
@@ -8116,13 +9475,21 @@ ${e3.text} (${e3.id})`;
8116
9475
  return Promise.resolve();
8117
9476
  }
8118
9477
  var kendoUrl = rTrim(svcApiUrl, "\\/") + "/resources/js/telerikReportViewer.kendo-" + version2 + ".min.js/";
8119
- return loadScript(kendoUrl).catch((errorData) => {
9478
+ return fetch(kendoUrl).then((response) => {
9479
+ if (!response.ok) {
9480
+ return Promise.reject({ error: "Failed to fetch data - status code " + response.status });
9481
+ }
9482
+ return response.text();
9483
+ }).then((kendoScript) => {
9484
+ const scriptElement = document.createElement("script");
9485
+ scriptElement.textContent = kendoScript;
9486
+ document.head.appendChild(scriptElement);
9487
+ }).catch((errorData) => {
8120
9488
  logError("Kendo could not be loaded automatically. Make sure 'options.serviceUrl' / 'options.reportServer.url' is correct and accessible. The error is: " + errorData.error);
8121
9489
  });
8122
9490
  }
8123
9491
  function main(version2) {
8124
9492
  ensureKendo(version2).then(() => {
8125
- }).then(() => {
8126
9493
  viewer.authenticationToken(options.authenticationToken);
8127
9494
  controller.getServiceConfiguration().catch((ex) => {
8128
9495
  var errorOutput = isApplicationExceptionInstance(ex) ? ex.exceptionMessage : stringFormat(stringResources.errorServiceUrl, [escapeHtml(svcApiUrl)]);
@@ -8158,6 +9525,15 @@ ${e3.text} (${e3.id})`;
8158
9525
  }
8159
9526
  return viewer;
8160
9527
  }
9528
+ function ReportViewerServiceClient(serviceClientOptions) {
9529
+ return new distExports.ServiceClient(serviceClientOptions);
9530
+ }
9531
+ function ReportViewerController(controllerOptions) {
9532
+ return new distExports.ReportController(controllerOptions?.serviceClient, controllerOptions?.settings);
9533
+ }
9534
+ function ReportViewerNotificationService() {
9535
+ return new NotificationService();
9536
+ }
8161
9537
  var pluginName = "telerik_ReportViewer";
8162
9538
  $.fn[pluginName] = function(options) {
8163
9539
  if (this.selector && !options.selector) {
@@ -8235,6 +9611,9 @@ ${e3.text} (${e3.id})`;
8235
9611
  exports.PerspectiveManager = PerspectiveManager;
8236
9612
  exports.PrintModes = PrintModes;
8237
9613
  exports.ReportViewer = ReportViewer;
9614
+ exports.ReportViewerController = ReportViewerController;
9615
+ exports.ReportViewerNotificationService = ReportViewerNotificationService;
9616
+ exports.ReportViewerServiceClient = ReportViewerServiceClient;
8238
9617
  exports.ReportViewerSettings = ReportViewerSettings;
8239
9618
  exports.ScaleModes = ScaleModes;
8240
9619
  exports.TouchBehavior = TouchBehavior;