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