1(function webpackUniversalModuleDefinition(root, factory) { 2 if(typeof exports === 'object' && typeof module === 'object') 3 module.exports = factory(); 4 else if(typeof define === 'function' && define.amd) 5 define([], factory); 6 else if(typeof exports === 'object') 7 exports["TelerikBlazorReportViewer"] = factory(); 8 else 9 root["TelerikBlazorReportViewer"] = factory(); 10})(self, () => { 11return /******/ (() => { // webpackBootstrap 12/******/ var __webpack_modules__ = ({ 13 14/***/ "../../../../node_modules/.pnpm/[email protected]/node_modules/dompurify/dist/purify.cjs.js" 15/*!************************************************************************************************!*\ 16 !*** ../../../../node_modules/.pnpm/[email protected]/node_modules/dompurify/dist/purify.cjs.js ***! 17 \************************************************************************************************/ 18(module) { 19 20"use strict"; 21/*! @license DOMPurify 3.4.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.2/LICENSE */ 22
vendor: 7,711 bytes, lines 23-275
23 24 25const { 26 entries, 27 setPrototypeOf, 28 isFrozen, 29 getPrototypeOf, 30 getOwnPropertyDescriptor 31} = Object; 32let { 33 freeze, 34 seal, 35 create 36} = Object; // eslint-disable-line import/no-mutable-exports 37let { 38 apply, 39 construct 40} = typeof Reflect !== 'undefined' && Reflect; 41if (!freeze) { 42 freeze = function freeze(x) { 43 return x; 44 }; 45} 46if (!seal) { 47 seal = function seal(x) { 48 return x; 49 }; 50} 51if (!apply) { 52 apply = function apply(func, thisArg) { 53 for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { 54 args[_key - 2] = arguments[_key]; 55 } 56 return func.apply(thisArg, args); 57 }; 58} 59if (!construct) { 60 construct = function construct(Func) { 61 for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { 62 args[_key2 - 1] = arguments[_key2]; 63 } 64 return new Func(...args); 65 }; 66} 67const arrayForEach = unapply(Array.prototype.forEach); 68const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf); 69const arrayPop = unapply(Array.prototype.pop); 70const arrayPush = unapply(Array.prototype.push); 71const arraySplice = unapply(Array.prototype.splice); 72const arrayIsArray = Array.isArray; 73const stringToLowerCase = unapply(String.prototype.toLowerCase); 74const stringToString = unapply(String.prototype.toString); 75const stringMatch = unapply(String.prototype.match); 76const stringReplace = unapply(String.prototype.replace); 77const stringIndexOf = unapply(String.prototype.indexOf); 78const stringTrim = unapply(String.prototype.trim); 79const numberToString = unapply(Number.prototype.toString); 80const booleanToString = unapply(Boolean.prototype.toString); 81const bigintToString = typeof BigInt === 'undefined' ? null : unapply(BigInt.prototype.toString); 82const symbolToString = typeof Symbol === 'undefined' ? null : unapply(Symbol.prototype.toString); 83const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty); 84const objectToString = unapply(Object.prototype.toString); 85const regExpTest = unapply(RegExp.prototype.test); 86const typeErrorCreate = unconstruct(TypeError); 87/** 88 * Creates a new function that calls the given function with a specified thisArg and arguments. 89 * 90 * @param func - The function to be wrapped and called. 91 * @returns A new function that calls the given function with a specified thisArg and arguments. 92 */ 93function unapply(func) { 94 return function (thisArg) { 95 if (thisArg instanceof RegExp) { 96 thisArg.lastIndex = 0; 97 } 98 for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { 99 args[_key3 - 1] = arguments[_key3]; 100 } 101 return apply(func, thisArg, args); 102 }; 103} 104/** 105 * Creates a new function that constructs an instance of the given constructor function with the provided arguments. 106 * 107 * @param func - The constructor function to be wrapped and called. 108 * @returns A new function that constructs an instance of the given constructor function with the provided arguments. 109 */ 110function unconstruct(Func) { 111 return function () { 112 for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { 113 args[_key4] = arguments[_key4]; 114 } 115 return construct(Func, args); 116 }; 117} 118/** 119 * Add properties to a lookup table 120 * 121 * @param set - The set to which elements will be added. 122 * @param array - The array containing elements to be added to the set. 123 * @param transformCaseFunc - An optional function to transform the case of each element before adding to the set. 124 * @returns The modified set with added elements. 125 */ 126function addToSet(set, array) { 127 let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase; 128 if (setPrototypeOf) { 129 // Make 'in' and truthy checks like Boolean(set.constructor) 130 // independent of any properties defined on Object.prototype. 131 // Prevent prototype setters from intercepting set as a this value. 132 setPrototypeOf(set, null); 133 } 134 if (!arrayIsArray(array)) { 135 return set; 136 } 137 let l = array.length; 138 while (l--) { 139 let element = array[l]; 140 if (typeof element === 'string') { 141 const lcElement = transformCaseFunc(element); 142 if (lcElement !== element) { 143 // Config presets (e.g. tags.js, attrs.js) are immutable. 144 if (!isFrozen(array)) { 145 array[l] = lcElement; 146 } 147 element = lcElement; 148 } 149 } 150 set[element] = true; 151 } 152 return set; 153} 154/** 155 * Clean up an array to harden against CSPP 156 * 157 * @param array - The array to be cleaned. 158 * @returns The cleaned version of the array 159 */ 160function cleanArray(array) { 161 for (let index = 0; index < array.length; index++) { 162 const isPropertyExist = objectHasOwnProperty(array, index); 163 if (!isPropertyExist) { 164 array[index] = null; 165 } 166 } 167 return array; 168} 169/** 170 * Shallow clone an object 171 * 172 * @param object - The object to be cloned. 173 * @returns A new object that copies the original. 174 */ 175function clone(object) { 176 const newObject = create(null); 177 for (const [property, value] of entries(object)) { 178 const isPropertyExist = objectHasOwnProperty(object, property); 179 if (isPropertyExist) { 180 if (arrayIsArray(value)) { 181 newObject[property] = cleanArray(value); 182 } else if (value && typeof value === 'object' && value.constructor === Object) { 183 newObject[property] = clone(value); 184 } else { 185 newObject[property] = value; 186 } 187 } 188 } 189 return newObject; 190} 191/** 192 * Convert non-node values into strings without depending on direct property access. 193 * 194 * @param value - The value to stringify. 195 * @returns A string representation of the provided value. 196 */ 197function stringifyValue(value) { 198 switch (typeof value) { 199 case 'string': 200 { 201 return value; 202 } 203 case 'number': 204 { 205 return numberToString(value); 206 } 207 case 'boolean': 208 { 209 return booleanToString(value); 210 } 211 case 'bigint': 212 { 213 return bigintToString ? bigintToString(value) : '0'; 214 } 215 case 'symbol': 216 { 217 return symbolToString ? symbolToString(value) : 'Symbol()'; 218 } 219 case 'undefined': 220 { 221 return objectToString(value); 222 } 223 case 'function': 224 case 'object': 225 { 226 if (value === null) { 227 return objectToString(value); 228 } 229 const valueAsRecord = value; 230 const valueToString = lookupGetter(valueAsRecord, 'toString'); 231 if (typeof valueToString === 'function') { 232 const stringified = valueToString(valueAsRecord); 233 return typeof stringified === 'string' ? stringified : objectToString(stringified); 234 } 235 return objectToString(value); 236 } 237 default: 238 { 239 return objectToString(value); 240 } 241 } 242} 243/** 244 * This method automatically checks if the prop is function or getter and behaves accordingly. 245 * 246 * @param object - The object to look up the getter function in its prototype chain. 247 * @param prop - The property name for which to find the getter function. 248 * @returns The getter function found in the prototype chain or a fallback function. 249 */ 250function lookupGetter(object, prop) { 251 while (object !== null) { 252 const desc = getOwnPropertyDescriptor(object, prop); 253 if (desc) { 254 if (desc.get) { 255 return unapply(desc.get); 256 } 257 if (typeof desc.value === 'function') { 258 return unapply(desc.value); 259 } 260 } 261 object = getPrototypeOf(object); 262 } 263 function fallbackValue() { 264 return null; 265 } 266 return fallbackValue; 267} 268function isRegex(value) { 269 try { 270 regExpTest(value, ''); 271 return true; 272 } catch (_unused) { 273 return false; 274 } 275}
276 277const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'search', 'section', 'select', 'shadow', 'slot', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']); 278const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'enterkeyhint', 'exportparts', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'inputmode', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'part', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']); 279const 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']); 280// List of SVG elements that are disallowed by default. 281// We still need to know them so that we can do namespace 282// checks properly in case one wants to add them to 283// allow-list. 284const 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']); 285const 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']); 286// Similarly to SVG, we want to know all MathML elements, 287// even those that we disallow by default. 288const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']); 289const text = freeze(['#text']); 290 291const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'exportparts', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inert', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'part', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'slot', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns']); 292const 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', 'mask-type', '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', '
vendor: 4,592 bytes, lines 292-390
292y1', 'y2', 'z', 'zoomandpan']); 293const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnalign', 'columnlines', 'columnspacing', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lquote', 'lspace', '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']); 294const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']); 295 296// eslint-disable-next-line unicorn/better-regex 297const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode 298const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm); 299const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm); // eslint-disable-line unicorn/better-regex 300const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); // eslint-disable-line no-useless-escape 301const ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape 302const 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 303); 304const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i); 305const ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex 306); 307const DOCTYPE_NAME = seal(/^html$/i); 308const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i); 309 310var EXPRESSIONS = /*#__PURE__*/Object.freeze({ 311 __proto__: null, 312 ARIA_ATTR: ARIA_ATTR, 313 ATTR_WHITESPACE: ATTR_WHITESPACE, 314 CUSTOM_ELEMENT: CUSTOM_ELEMENT, 315 DATA_ATTR: DATA_ATTR, 316 DOCTYPE_NAME: DOCTYPE_NAME, 317 ERB_EXPR: ERB_EXPR, 318 IS_ALLOWED_URI: IS_ALLOWED_URI, 319 IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA, 320 MUSTACHE_EXPR: MUSTACHE_EXPR, 321 TMPLIT_EXPR: TMPLIT_EXPR 322}); 323 324/* eslint-disable @typescript-eslint/indent */ 325// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType 326const NODE_TYPE = { 327 element: 1, 328 text: 3, 329 // Deprecated 330 progressingInstruction: 7, 331 comment: 8, 332 document: 9}; 333const getGlobal = function getGlobal() { 334 return typeof window === 'undefined' ? null : window; 335}; 336/** 337 * Creates a no-op policy for internal use only. 338 * Don't export this function outside this module! 339 * @param trustedTypes The policy factory. 340 * @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix). 341 * @return The policy created (or null, if Trusted Types 342 * are not supported or creating the policy failed). 343 */ 344const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) { 345 if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') { 346 return null; 347 } 348 // Allow the callers to control the unique policy name 349 // by adding a data-tt-policy-suffix to the script element with the DOMPurify. 350 // Policy creation with duplicate names throws in Trusted Types. 351 let suffix = null; 352 const ATTR_NAME = 'data-tt-policy-suffix'; 353 if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) { 354 suffix = purifyHostElement.getAttribute(ATTR_NAME); 355 } 356 const policyName = 'dompurify' + (suffix ? '#' + suffix : ''); 357 try { 358 return trustedTypes.createPolicy(policyName, { 359 createHTML(html) { 360 return html; 361 }, 362 createScriptURL(scriptUrl) { 363 return scriptUrl; 364 } 365 }); 366 } catch (_) { 367 // Policy creation failed (most likely another DOMPurify script has 368 // already run). Skip creating the policy, as this will only cause errors 369 // if TT are enforced. 370 console.warn('TrustedTypes policy ' + policyName + ' could not be created.'); 371 return null; 372 } 373}; 374const _createHooksMap = function _createHooksMap() { 375 return { 376 afterSanitizeAttributes: [], 377 afterSanitizeElements: [], 378 afterSanitizeShadowDOM: [], 379 beforeSanitizeAttributes: [], 380 beforeSanitizeElements: [], 381 beforeSanitizeShadowDOM: [], 382 uponSanitizeAttribute: [], 383 uponSanitizeElement: [], 384 uponSanitizeShadowNode: [] 385 }; 386}; 387function createDOMPurify() { 388 let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal(); 389 const DOMPurify = root => createDOMPurify(root); 390 DOMPurify.version = '3.4.2
vendor: 9,872 bytes, lines 390-621
390'; 391 DOMPurify.removed = []; 392 if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) { 393 // Not running in a browser, provide a factory function 394 // so that you can pass your own Window 395 DOMPurify.isSupported = false; 396 return DOMPurify; 397 } 398 let { 399 document 400 } = window; 401 const originalDocument = document; 402 const currentScript = originalDocument.currentScript; 403 const { 404 DocumentFragment, 405 HTMLTemplateElement, 406 Node, 407 Element, 408 NodeFilter, 409 NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap, 410 HTMLFormElement, 411 DOMParser, 412 trustedTypes 413 } = window; 414 const ElementPrototype = Element.prototype; 415 const cloneNode = lookupGetter(ElementPrototype, 'cloneNode'); 416 const remove = lookupGetter(ElementPrototype, 'remove'); 417 const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling'); 418 const getChildNodes = lookupGetter(ElementPrototype, 'childNodes'); 419 const getParentNode = lookupGetter(ElementPrototype, 'parentNode'); 420 // As per issue #47, the web-components registry is inherited by a 421 // new document created via createHTMLDocument. As per the spec 422 // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries) 423 // a new empty registry is used when creating a template contents owner 424 // document, so we use that as our parent document to ensure nothing 425 // is inherited. 426 if (typeof HTMLTemplateElement === 'function') { 427 const template = document.createElement('template'); 428 if (template.content && template.content.ownerDocument) { 429 document = template.content.ownerDocument; 430 } 431 } 432 let trustedTypesPolicy; 433 let emptyHTML = ''; 434 const { 435 implementation, 436 createNodeIterator, 437 createDocumentFragment, 438 getElementsByTagName 439 } = document; 440 const { 441 importNode 442 } = originalDocument; 443 let hooks = _createHooksMap(); 444 /** 445 * Expose whether this browser supports running the full DOMPurify. 446 */ 447 DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined; 448 const { 449 MUSTACHE_EXPR, 450 ERB_EXPR, 451 TMPLIT_EXPR, 452 DATA_ATTR, 453 ARIA_ATTR, 454 IS_SCRIPT_OR_DATA, 455 ATTR_WHITESPACE, 456 CUSTOM_ELEMENT 457 } = EXPRESSIONS; 458 let { 459 IS_ALLOWED_URI: IS_ALLOWED_URI$1 460 } = EXPRESSIONS; 461 /** 462 * We consider the elements and attributes below to be safe. Ideally 463 * don't add any new ones but feel free to remove unwanted ones. 464 */ 465 /* allowed element names */ 466 let ALLOWED_TAGS = null; 467 const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]); 468 /* Allowed attribute names */ 469 let ALLOWED_ATTR = null; 470 const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]); 471 /* 472 * Configure how DOMPurify should handle custom elements and their attributes as well as customized built-in elements. 473 * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements) 474 * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list) 475 * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`. 476 */ 477 let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, { 478 tagNameCheck: { 479 writable: true, 480 configurable: false, 481 enumerable: true, 482 value: null 483 }, 484 attributeNameCheck: { 485 writable: true, 486 configurable: false, 487 enumerable: true, 488 value: null 489 }, 490 allowCustomizedBuiltInElements: { 491 writable: true, 492 configurable: false, 493 enumerable: true, 494 value: false 495 } 496 })); 497 /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */ 498 let FORBID_TAGS = null; 499 /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */ 500 let FORBID_ATTR = null; 501 /* Config object to store ADD_TAGS/ADD_ATTR functions (when used as functions) */ 502 const EXTRA_ELEMENT_HANDLING = Object.seal(create(null, { 503 tagCheck: { 504 writable: true, 505 configurable: false, 506 enumerable: true, 507 value: null 508 }, 509 attributeCheck: { 510 writable: true, 511 configurable: false, 512 enumerable: true, 513 value: null 514 } 515 })); 516 /* Decide if ARIA attributes are okay */ 517 let ALLOW_ARIA_ATTR = true; 518 /* Decide if custom data attributes are okay */ 519 let ALLOW_DATA_ATTR = true; 520 /* Decide if unknown protocols are okay */ 521 let ALLOW_UNKNOWN_PROTOCOLS = false; 522 /* Decide if self-closing tags in attributes are allowed. 523 * Usually removed due to a mXSS issue in jQuery 3.0 */ 524 let ALLOW_SELF_CLOSE_IN_ATTR = true; 525 /* Output should be safe for common template engines. 526 * This means, DOMPurify removes data attributes, mustaches and ERB 527 */ 528 let SAFE_FOR_TEMPLATES = false; 529 /* Output should be safe even for XML used within HTML and alike. 530 * This means, DOMPurify removes comments when containing risky content. 531 */ 532 let SAFE_FOR_XML = true; 533 /* Decide if document with <html>... should be returned */ 534 let WHOLE_DOCUMENT = false; 535 /* Track whether config is already set on this instance of DOMPurify. */ 536 let SET_CONFIG = false; 537 /* Decide if all elements (e.g. style, script) must be children of 538 * document.body. By default, browsers might move them to document.head */ 539 let FORCE_BODY = false; 540 /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html 541 * string (or a TrustedHTML object if Trusted Types are supported). 542 * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead 543 */ 544 let RETURN_DOM = false; 545 /* Decide if a DOM `DocumentFragment` should be returned, instead of a html 546 * string (or a TrustedHTML object if Trusted Types are supported) */ 547 let RETURN_DOM_FRAGMENT = false; 548 /* Try to return a Trusted Type object instead of a string, return a string in 549 * case Trusted Types are not supported */ 550 let RETURN_TRUSTED_TYPE = false; 551 /* Output should be free from DOM clobbering attacks? 552 * This sanitizes markups named with colliding, clobberable built-in DOM APIs. 553 */ 554 let SANITIZE_DOM = true; 555 /* Achieve full DOM Clobbering protection by isolating the namespace of named 556 * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules. 557 * 558 * HTML/DOM spec rules that enable DOM Clobbering: 559 * - Named Access on Window (§7.3.3) 560 * - DOM Tree Accessors (§3.1.5) 561 * - Form Element Parent-Child Relations (§4.10.3) 562 * - Iframe srcdoc / Nested WindowProxies (§4.8.5) 563 * - HTMLCollection (§4.2.10.2) 564 * 565 * Namespace isolation is implemented by prefixing `id` and `name` attributes 566 * with a constant string, i.e., `user-content-` 567 */ 568 let SANITIZE_NAMED_PROPS = false; 569 const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-'; 570 /* Keep element content when removing element? */ 571 let KEEP_CONTENT = true; 572 /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead 573 * of importing it into a new Document and returning a sanitized copy */ 574 let IN_PLACE = false; 575 /* Allow usage of profiles like html, svg and mathMl */ 576 let USE_PROFILES = {}; 577 /* Tags to ignore content of when KEEP_CONTENT is true */ 578 let FORBID_CONTENTS = null; 579 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']); 580 /* Tags that are safe for data: URIs */ 581 let DATA_URI_TAGS = null; 582 const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']); 583 /* Attributes safe for values like "javascript:" */ 584 let URI_SAFE_ATTRIBUTES = null; 585 const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']); 586 const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML'; 587 const SVG_NAMESPACE = 'http://www.w3.org/2000/svg'; 588 const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml'; 589 /* Document namespace */ 590 let NAMESPACE = HTML_NAMESPACE; 591 let IS_EMPTY_INPUT = false; 592 /* Allowed XHTML+XML namespaces */ 593 let ALLOWED_NAMESPACES = null; 594 const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString); 595 let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']); 596 let HTML_INTEGRATION_POINTS = addToSet({}, ['annotation-xml']); 597 // Certain elements are allowed in both SVG and HTML 598 // namespace. We need to specify them explicitly 599 // so that they don't get erroneously deleted from 600 // HTML namespace. 601 const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']); 602 /* Parsing of strict XHTML documents */ 603 let PARSER_MEDIA_TYPE = null; 604 const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html']; 605 const DEFAULT_PARSER_MEDIA_TYPE = 'text/html'; 606 let transformCaseFunc = null; 607 /* Keep a reference to config to pass to hooks */ 608 let CONFIG = null; 609 /* Ideally, do not touch anything below this line */ 610 /* ______________________________________________ */ 611 const formElement = document.createElement('form'); 612 const isRegexOrFunction = function isRegexOrFunction(testValue) { 613 return testValue instanceof RegExp || testValue instanceof Function; 614 }; 615 /** 616 * _parseConfig 617 * 618 * @param cfg optional config literal 619 */ 620 // eslint-disable-next-line complexity 621 const _parseConfig = function _parseConfig() {
vendor: 10,885 bytes, lines 622-812
622 let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 623 if (CONFIG && CONFIG === cfg) { 624 return; 625 } 626 /* Shield configuration object from tampering */ 627 if (!cfg || typeof cfg !== 'object') { 628 cfg = {}; 629 } 630 /* Shield configuration object from prototype pollution */ 631 cfg = clone(cfg); 632 PARSER_MEDIA_TYPE = 633 // eslint-disable-next-line unicorn/prefer-includes 634 SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE; 635 // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is. 636 transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase; 637 /* Set configuration parameters */ 638 ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') && arrayIsArray(cfg.ALLOWED_TAGS) ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS; 639 ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') && arrayIsArray(cfg.ALLOWED_ATTR) ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR; 640 ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') && arrayIsArray(cfg.ALLOWED_NAMESPACES) ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES; 641 URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') && arrayIsArray(cfg.ADD_URI_SAFE_ATTR) ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES; 642 DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') && arrayIsArray(cfg.ADD_DATA_URI_TAGS) ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS; 643 FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') && arrayIsArray(cfg.FORBID_CONTENTS) ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS; 644 FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') && arrayIsArray(cfg.FORBID_TAGS) ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : clone({}); 645 FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') && arrayIsArray(cfg.FORBID_ATTR) ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : clone({}); 646 USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES && typeof cfg.USE_PROFILES === 'object' ? clone(cfg.USE_PROFILES) : cfg.USE_PROFILES : false; 647 ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true 648 ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true 649 ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false 650 ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true 651 SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false 652 SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true 653 WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false 654 RETURN_DOM = cfg.RETURN_DOM || false; // Default false 655 RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false 656 RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false 657 FORCE_BODY = cfg.FORCE_BODY || false; // Default false 658 SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true 659 SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false 660 KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true 661 IN_PLACE = cfg.IN_PLACE || false; // Default false 662 IS_ALLOWED_URI$1 = isRegex(cfg.ALLOWED_URI_REGEXP) ? cfg.ALLOWED_URI_REGEXP : IS_ALLOWED_URI; // Default regexp 663 NAMESPACE = typeof cfg.NAMESPACE === 'string' ? cfg.NAMESPACE : HTML_NAMESPACE; // Default HTML namespace 664 MATHML_TEXT_INTEGRATION_POINTS = objectHasOwnProperty(cfg, 'MATHML_TEXT_INTEGRATION_POINTS') && cfg.MATHML_TEXT_INTEGRATION_POINTS && typeof cfg.MATHML_TEXT_INTEGRATION_POINTS === 'object' ? clone(cfg.MATHML_TEXT_INTEGRATION_POINTS) : addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']); // Default built-in map 665 HTML_INTEGRATION_POINTS = objectHasOwnProperty(cfg, 'HTML_INTEGRATION_POINTS') && cfg.HTML_INTEGRATION_POINTS && typeof cfg.HTML_INTEGRATION_POINTS === 'object' ? clone(cfg.HTML_INTEGRATION_POINTS) : addToSet({}, ['annotation-xml']); // Default built-in map 666 const customElementHandling = objectHasOwnProperty(cfg, 'CUSTOM_ELEMENT_HANDLING') && cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING === 'object' ? clone(cfg.CUSTOM_ELEMENT_HANDLING) : create(null); 667 CUSTOM_ELEMENT_HANDLING = create(null); 668 if (objectHasOwnProperty(customElementHandling, 'tagNameCheck') && isRegexOrFunction(customElementHandling.tagNameCheck)) { 669 CUSTOM_ELEMENT_HANDLING.tagNameCheck = customElementHandling.tagNameCheck; // Default undefined 670 } 671 if (objectHasOwnProperty(customElementHandling, 'attributeNameCheck') && isRegexOrFunction(customElementHandling.attributeNameCheck)) { 672 CUSTOM_ELEMENT_HANDLING.attributeNameCheck = customElementHandling.attributeNameCheck; // Default undefined 673 } 674 if (objectHasOwnProperty(customElementHandling, 'allowCustomizedBuiltInElements') && typeof customElementHandling.allowCustomizedBuiltInElements === 'boolean') { 675 CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = customElementHandling.allowCustomizedBuiltInElements; // Default undefined 676 } 677 if (SAFE_FOR_TEMPLATES) { 678 ALLOW_DATA_ATTR = false; 679 } 680 if (RETURN_DOM_FRAGMENT) { 681 RETURN_DOM = true; 682 } 683 /* Parse profile info */ 684 if (USE_PROFILES) { 685 ALLOWED_TAGS = addToSet({}, text); 686 ALLOWED_ATTR = create(null); 687 if (USE_PROFILES.html === true) { 688 addToSet(ALLOWED_TAGS, html$1); 689 addToSet(ALLOWED_ATTR, html); 690 } 691 if (USE_PROFILES.svg === true) { 692 addToSet(ALLOWED_TAGS, svg$1); 693 addToSet(ALLOWED_ATTR, svg); 694 addToSet(ALLOWED_ATTR, xml); 695 } 696 if (USE_PROFILES.svgFilters === true) { 697 addToSet(ALLOWED_TAGS, svgFilters); 698 addToSet(ALLOWED_ATTR, svg); 699 addToSet(ALLOWED_ATTR, xml); 700 } 701 if (USE_PROFILES.mathMl === true) { 702 addToSet(ALLOWED_TAGS, mathMl$1); 703 addToSet(ALLOWED_ATTR, mathMl); 704 addToSet(ALLOWED_ATTR, xml); 705 } 706 } 707 /* Always reset function-based ADD_TAGS / ADD_ATTR checks to prevent 708 * leaking across calls when switching from function to array config */ 709 EXTRA_ELEMENT_HANDLING.tagCheck = null; 710 EXTRA_ELEMENT_HANDLING.attributeCheck = null; 711 /* Merge configuration parameters */ 712 if (objectHasOwnProperty(cfg, 'ADD_TAGS')) { 713 if (typeof cfg.ADD_TAGS === 'function') { 714 EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS; 715 } else if (arrayIsArray(cfg.ADD_TAGS)) { 716 if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) { 717 ALLOWED_TAGS = clone(ALLOWED_TAGS); 718 } 719 addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc); 720 } 721 } 722 if (objectHasOwnProperty(cfg, 'ADD_ATTR')) { 723 if (typeof cfg.ADD_ATTR === 'function') { 724 EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR; 725 } else if (arrayIsArray(cfg.ADD_ATTR)) { 726 if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) { 727 ALLOWED_ATTR = clone(ALLOWED_ATTR); 728 } 729 addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc); 730 } 731 } 732 if (objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') && arrayIsArray(cfg.ADD_URI_SAFE_ATTR)) { 733 addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc); 734 } 735 if (objectHasOwnProperty(cfg, 'FORBID_CONTENTS') && arrayIsArray(cfg.FORBID_CONTENTS)) { 736 if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) { 737 FORBID_CONTENTS = clone(FORBID_CONTENTS); 738 } 739 addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc); 740 } 741 if (objectHasOwnProperty(cfg, 'ADD_FORBID_CONTENTS') && arrayIsArray(cfg.ADD_FORBID_CONTENTS)) { 742 if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) { 743 FORBID_CONTENTS = clone(FORBID_CONTENTS); 744 } 745 addToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc); 746 } 747 /* Add #text in case KEEP_CONTENT is set to true */ 748 if (KEEP_CONTENT) { 749 ALLOWED_TAGS['#text'] = true; 750 } 751 /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */ 752 if (WHOLE_DOCUMENT) { 753 addToSet(ALLOWED_TAGS, ['html', 'head', 'body']); 754 } 755 /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */ 756 if (ALLOWED_TAGS.table) { 757 addToSet(ALLOWED_TAGS, ['tbody']); 758 delete FORBID_TAGS.tbody; 759 } 760 if (cfg.TRUSTED_TYPES_POLICY) { 761 if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') { 762 throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.'); 763 } 764 if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') { 765 throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.'); 766 } 767 // Overwrite existing TrustedTypes policy. 768 trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY; 769 // Sign local variables required by `sanitize`. 770 emptyHTML = trustedTypesPolicy.createHTML(''); 771 } else { 772 // Uninitialized policy, attempt to initialize the internal dompurify policy. 773 if (trustedTypesPolicy === undefined) { 774 trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript); 775 } 776 // If creating the internal policy succeeded sign internal variables. 777 if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') { 778 emptyHTML = trustedTypesPolicy.createHTML(''); 779 } 780 } 781 // Prevent further manipulation of configuration. 782 // Not available in IE8, Safari 5, etc. 783 if (freeze) { 784 freeze(cfg); 785 } 786 CONFIG = cfg; 787 }; 788 /* Keep track of all possible SVG and MathML tags 789 * so that we can perform the namespace checks 790 * correctly. */ 791 const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]); 792 const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]); 793 /** 794 * @param element a DOM element whose namespace is being checked 795 * @returns Return false if the element has a 796 * namespace that a spec-compliant parser would never 797 * return. Return true otherwise. 798 */ 799 const _checkValidNamespace = function _checkValidNamespace(element) { 800 let parent = getParentNode(element); 801 // In JSDOM, if we're inside shadow DOM, then parentNode 802 // can be null. We just simulate parent in this case. 803 if (!parent || !parent.tagName) { 804 parent = { 805 namespaceURI: NAMESPACE, 806 tagName: 'template' 807 }; 808 } 809 const tagName = stringToLowerCase(element.tagName); 810 const parentTagName = stringToLowerCase(parent.tagName); 811 if (!ALLOWED_NAMESPACES[element.namespaceURI]) { 812 return false;
vendor: 5,216 bytes, lines 813-952
813 } 814 if (element.namespaceURI === SVG_NAMESPACE) { 815 // The only way to switch from HTML namespace to SVG 816 // is via <svg>. If it happens via any other tag, then 817 // it should be killed. 818 if (parent.namespaceURI === HTML_NAMESPACE) { 819 return tagName === 'svg'; 820 } 821 // The only way to switch from MathML to SVG is via` 822 // svg if parent is either <annotation-xml> or MathML 823 // text integration points. 824 if (parent.namespaceURI === MATHML_NAMESPACE) { 825 return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]); 826 } 827 // We only allow elements that are defined in SVG 828 // spec. All others are disallowed in SVG namespace. 829 return Boolean(ALL_SVG_TAGS[tagName]); 830 } 831 if (element.namespaceURI === MATHML_NAMESPACE) { 832 // The only way to switch from HTML namespace to MathML 833 // is via <math>. If it happens via any other tag, then 834 // it should be killed. 835 if (parent.namespaceURI === HTML_NAMESPACE) { 836 return tagName === 'math'; 837 } 838 // The only way to switch from SVG to MathML is via 839 // <math> and HTML integration points 840 if (parent.namespaceURI === SVG_NAMESPACE) { 841 return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName]; 842 } 843 // We only allow elements that are defined in MathML 844 // spec. All others are disallowed in MathML namespace. 845 return Boolean(ALL_MATHML_TAGS[tagName]); 846 } 847 if (element.namespaceURI === HTML_NAMESPACE) { 848 // The only way to switch from SVG to HTML is via 849 // HTML integration points, and from MathML to HTML 850 // is via MathML text integration points 851 if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) { 852 return false; 853 } 854 if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) { 855 return false; 856 } 857 // We disallow tags that are specific for MathML 858 // or SVG and should never appear in HTML namespace 859 return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]); 860 } 861 // For XHTML and XML documents that support custom namespaces 862 if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) { 863 return true; 864 } 865 // The code should never reach this place (this means 866 // that the element somehow got namespace that is not 867 // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES). 868 // Return false just in case. 869 return false; 870 }; 871 /** 872 * _forceRemove 873 * 874 * @param node a DOM node 875 */ 876 const _forceRemove = function _forceRemove(node) { 877 arrayPush(DOMPurify.removed, { 878 element: node 879 }); 880 try { 881 // eslint-disable-next-line unicorn/prefer-dom-node-remove 882 getParentNode(node).removeChild(node); 883 } catch (_) { 884 remove(node); 885 } 886 }; 887 /** 888 * _removeAttribute 889 * 890 * @param name an Attribute name 891 * @param element a DOM node 892 */ 893 const _removeAttribute = function _removeAttribute(name, element) { 894 try { 895 arrayPush(DOMPurify.removed, { 896 attribute: element.getAttributeNode(name), 897 from: element 898 }); 899 } catch (_) { 900 arrayPush(DOMPurify.removed, { 901 attribute: null, 902 from: element 903 }); 904 } 905 element.removeAttribute(name); 906 // We void attribute values for unremovable "is" attributes 907 if (name === 'is') { 908 if (RETURN_DOM || RETURN_DOM_FRAGMENT) { 909 try { 910 _forceRemove(element); 911 } catch (_) {} 912 } else { 913 try { 914 element.setAttribute(name, ''); 915 } catch (_) {} 916 } 917 } 918 }; 919 /** 920 * _initDocument 921 * 922 * @param dirty - a string of dirty markup 923 * @return a DOM, filled with the dirty markup 924 */ 925 const _initDocument = function _initDocument(dirty) { 926 /* Create a HTML document */ 927 let doc = null; 928 let leadingWhitespace = null; 929 if (FORCE_BODY) { 930 dirty = '<remove></remove>' + dirty; 931 } else { 932 /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */ 933 const matches = stringMatch(dirty, /^[\r\n\t ]+/); 934 leadingWhitespace = matches && matches[0]; 935 } 936 if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) { 937 // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict) 938 dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + '</body></html>'; 939 } 940 const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty; 941 /* 942 * Use the DOMParser API by default, fallback later if needs be 943 * DOMParser not work for svg when has multiple root element. 944 */ 945 if (NAMESPACE === HTML_NAMESPACE) { 946 try { 947 doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE); 948 } catch (_) {} 949 } 950 /* Use createHTMLDocument in case DOMParser is not available */ 951 if (!doc || !doc.documentElement) { 952 doc = implementation.createDocument(NAMESPACE, 'template', null);
vendor: 5,270 bytes, lines 953-1067
953 try { 954 doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload; 955 } catch (_) { 956 // Syntax error if dirtyPayload is invalid xml 957 } 958 } 959 const body = doc.body || doc.documentElement; 960 if (dirty && leadingWhitespace) { 961 body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null); 962 } 963 /* Work on whole document or just its body */ 964 if (NAMESPACE === HTML_NAMESPACE) { 965 return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0]; 966 } 967 return WHOLE_DOCUMENT ? doc.documentElement : body; 968 }; 969 /** 970 * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. 971 * 972 * @param root The root element or node to start traversing on. 973 * @return The created NodeIterator 974 */ 975 const _createNodeIterator = function _createNodeIterator(root) { 976 return createNodeIterator.call(root.ownerDocument || root, root, 977 // eslint-disable-next-line no-bitwise 978 NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null); 979 }; 980 /** 981 * _isClobbered 982 * 983 * @param element element to check for clobbering attacks 984 * @return true if clobbered, false if safe 985 */ 986 const _isClobbered = function _isClobbered(element) { 987 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'); 988 }; 989 /** 990 * Checks whether the given object is a DOM node. 991 * 992 * @param value object to check whether it's a DOM node 993 * @return true is object is a DOM node 994 */ 995 const _isNode = function _isNode(value) { 996 return typeof Node === 'function' && value instanceof Node; 997 }; 998 function _executeHooks(hooks, currentNode, data) { 999 arrayForEach(hooks, hook => { 1000 hook.call(DOMPurify, currentNode, data, CONFIG); 1001 }); 1002 } 1003 /** 1004 * _sanitizeElements 1005 * 1006 * @protect nodeName 1007 * @protect textContent 1008 * @protect removeChild 1009 * @param currentNode to check for permission to exist 1010 * @return true if node was killed, false if left alive 1011 */ 1012 const _sanitizeElements = function _sanitizeElements(currentNode) { 1013 let content = null; 1014 /* Execute a hook if present */ 1015 _executeHooks(hooks.beforeSanitizeElements, currentNode, null); 1016 /* Check if element is clobbered or can clobber */ 1017 if (_isClobbered(currentNode)) { 1018 _forceRemove(currentNode); 1019 return true; 1020 } 1021 /* Now let's check the element's type and name */ 1022 const tagName = transformCaseFunc(currentNode.nodeName); 1023 /* Execute a hook if present */ 1024 _executeHooks(hooks.uponSanitizeElement, currentNode, { 1025 tagName, 1026 allowedTags: ALLOWED_TAGS 1027 }); 1028 /* Detect mXSS attempts abusing namespace confusion */ 1029 if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w!]/g, currentNode.innerHTML) && regExpTest(/<[/\w!]/g, currentNode.textContent)) { 1030 _forceRemove(currentNode); 1031 return true; 1032 } 1033 /* Remove risky CSS construction leading to mXSS */ 1034 if (SAFE_FOR_XML && currentNode.namespaceURI === HTML_NAMESPACE && tagName === 'style' && _isNode(currentNode.firstElementChild)) { 1035 _forceRemove(currentNode); 1036 return true; 1037 } 1038 /* Remove any occurrence of processing instructions */ 1039 if (currentNode.nodeType === NODE_TYPE.progressingInstruction) { 1040 _forceRemove(currentNode); 1041 return true; 1042 } 1043 /* Remove any kind of possibly harmful comments */ 1044 if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) { 1045 _forceRemove(currentNode); 1046 return true; 1047 } 1048 /* Remove element if anything forbids its presence */ 1049 if (FORBID_TAGS[tagName] || !(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && !ALLOWED_TAGS[tagName]) { 1050 /* Check if we have a custom element to handle */ 1051 if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) { 1052 if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) { 1053 return false; 1054 } 1055 if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) { 1056 return false; 1057 } 1058 } 1059 /* Keep content except for bad-listed elements */ 1060 if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) { 1061 const parentNode = getParentNode(currentNode) || currentNode.parentNode; 1062 const childNodes = getChildNodes(currentNode) || currentNode.childNodes; 1063 if (childNodes && parentNode) { 1064 const childCount = childNodes.length; 1065 for (let i = childCount - 1; i >= 0; --i) { 1066 const childClone = cloneNode(childNodes[i], true); 1067
vendor: 7,801 bytes, lines 1067-1213
1067parentNode.insertBefore(childClone, getNextSibling(currentNode)); 1068 } 1069 } 1070 } 1071 _forceRemove(currentNode); 1072 return true; 1073 } 1074 /* Check whether element has a valid namespace */ 1075 if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) { 1076 _forceRemove(currentNode); 1077 return true; 1078 } 1079 /* Make sure that older browsers don't get fallback-tag mXSS */ 1080 if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) { 1081 _forceRemove(currentNode); 1082 return true; 1083 } 1084 /* Sanitize element content to be template-safe */ 1085 if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) { 1086 /* Get the element's text content */ 1087 content = currentNode.textContent; 1088 arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => { 1089 content = stringReplace(content, expr, ' '); 1090 }); 1091 if (currentNode.textContent !== content) { 1092 arrayPush(DOMPurify.removed, { 1093 element: currentNode.cloneNode() 1094 }); 1095 currentNode.textContent = content; 1096 } 1097 } 1098 /* Execute a hook if present */ 1099 _executeHooks(hooks.afterSanitizeElements, currentNode, null); 1100 return false; 1101 }; 1102 /** 1103 * _isValidAttribute 1104 * 1105 * @param lcTag Lowercase tag name of containing element. 1106 * @param lcName Lowercase attribute name. 1107 * @param value Attribute value. 1108 * @return Returns true if `value` is valid, otherwise false. 1109 */ 1110 // eslint-disable-next-line complexity 1111 const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) { 1112 /* FORBID_ATTR must always win, even if ADD_ATTR predicate would allow it */ 1113 if (FORBID_ATTR[lcName]) { 1114 return false; 1115 } 1116 /* Make sure attribute cannot clobber */ 1117 if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) { 1118 return false; 1119 } 1120 const nameIsPermitted = ALLOWED_ATTR[lcName] || EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag); 1121 /* Allow valid data-* attributes: At least one character after "-" 1122 (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes) 1123 XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804) 1124 We don't need to check the value; it's always URI safe. */ 1125 if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!nameIsPermitted || FORBID_ATTR[lcName]) { 1126 if ( 1127 // First condition does a very basic check if a) it's basically a valid custom element tagname AND 1128 // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck 1129 // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck 1130 _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName, lcTag)) || 1131 // Alternative, second condition checks if it's an `is`-attribute, AND 1132 // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck 1133 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 { 1134 return false; 1135 } 1136 /* Check value is safe. First, is attr inert? If so, is safe */ 1137 } 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) { 1138 return false; 1139 } else ; 1140 return true; 1141 }; 1142 /* Names the HTML spec reserves from valid-custom-element-name; these must 1143 * never be treated as basic custom elements even when a permissive 1144 * CUSTOM_ELEMENT_HANDLING.tagNameCheck is configured. */ 1145 const RESERVED_CUSTOM_ELEMENT_NAMES = addToSet({}, ['annotation-xml', 'color-profile', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'missing-glyph']); 1146 /** 1147 * _isBasicCustomElement 1148 * checks if at least one dash is included in tagName, and it's not the first char 1149 * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name 1150 * 1151 * @param tagName name of the tag of the node to sanitize 1152 * @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false. 1153 */ 1154 const _isBasicCustomElement = function _isBasicCustomElement(tagName) { 1155 return !RESERVED_CUSTOM_ELEMENT_NAMES[stringToLowerCase(tagName)] && regExpTest(CUSTOM_ELEMENT, tagName); 1156 }; 1157 /** 1158 * _sanitizeAttributes 1159 * 1160 * @protect attributes 1161 * @protect nodeName 1162 * @protect removeAttribute 1163 * @protect setAttribute 1164 * 1165 * @param currentNode to sanitize 1166 */ 1167 const _sanitizeAttributes = function _sanitizeAttributes(currentNode) { 1168 /* Execute a hook if present */ 1169 _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null); 1170 const { 1171 attributes 1172 } = currentNode; 1173 /* Check if we have attributes; if not we might have a text node */ 1174 if (!attributes || _isClobbered(currentNode)) { 1175 return; 1176 } 1177 const hookEvent = { 1178 attrName: '', 1179 attrValue: '', 1180 keepAttr: true, 1181 allowedAttributes: ALLOWED_ATTR, 1182 forceKeepAttr: undefined 1183 }; 1184 let l = attributes.length; 1185 /* Go backwards over all attributes; safely remove bad ones */ 1186 while (l--) { 1187 const attr = attributes[l]; 1188 const { 1189 name, 1190 namespaceURI, 1191 value: attrValue 1192 } = attr; 1193 const lcName = transformCaseFunc(name); 1194 const initValue = attrValue; 1195 let value = name === 'value' ? initValue : stringTrim(initValue); 1196 /* Execute a hook if present */ 1197 hookEvent.attrName = lcName; 1198 hookEvent.attrValue = value; 1199 hookEvent.keepAttr = true; 1200 hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set 1201 _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent); 1202 value = hookEvent.attrValue; 1203 /* Full DOM Clobbering protection via namespace isolation, 1204 * Prefix id and name attributes with `user-content-` 1205 */ 1206 if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name') && stringIndexOf(value, SANITIZE_NAMED_PROPS_PREFIX) !== 0) { 1207 // Remove the attribute with this value 1208 _removeAttribute(name, currentNode); 1209 // Prefix the value and later re-create the attribute with the sanitized value 1210 value = SANITIZE_NAMED_PROPS_PREFIX + value; 1211 } 1212 // Else: already prefixed, leave the attribute alone — the prefix is 1213 // itself the clobbering protection, and re-applying it is incorrect.
vendor: 3,814 bytes, lines 1213-1315
1213 1214 /* Work around a security issue with comments inside attributes */ 1215 if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, value)) { 1216 _removeAttribute(name, currentNode); 1217 continue; 1218 } 1219 /* Make sure we cannot easily use animated hrefs, even if animations are allowed */ 1220 if (lcName === 'attributename' && stringMatch(value, 'href')) { 1221 _removeAttribute(name, currentNode); 1222 continue; 1223 } 1224 /* Did the hooks approve of the attribute? */ 1225 if (hookEvent.forceKeepAttr) { 1226 continue; 1227 } 1228 /* Did the hooks approve of the attribute? */ 1229 if (!hookEvent.keepAttr) { 1230 _removeAttribute(name, currentNode); 1231 continue; 1232 } 1233 /* Work around a security issue in jQuery 3.0 */ 1234 if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) { 1235 _removeAttribute(name, currentNode); 1236 continue; 1237 } 1238 /* Sanitize attribute content to be template-safe */ 1239 if (SAFE_FOR_TEMPLATES) { 1240 arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => { 1241 value = stringReplace(value, expr, ' '); 1242 }); 1243 } 1244 /* Is `value` valid for this attribute? */ 1245 const lcTag = transformCaseFunc(currentNode.nodeName); 1246 if (!_isValidAttribute(lcTag, lcName, value)) { 1247 _removeAttribute(name, currentNode); 1248 continue; 1249 } 1250 /* Handle attributes that require Trusted Types */ 1251 if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') { 1252 if (namespaceURI) ; else { 1253 switch (trustedTypes.getAttributeType(lcTag, lcName)) { 1254 case 'TrustedHTML': 1255 { 1256 value = trustedTypesPolicy.createHTML(value); 1257 break; 1258 } 1259 case 'TrustedScriptURL': 1260 { 1261 value = trustedTypesPolicy.createScriptURL(value); 1262 break; 1263 } 1264 } 1265 } 1266 } 1267 /* Handle invalid data-* attribute set by try-catching it */ 1268 if (value !== initValue) { 1269 try { 1270 if (namespaceURI) { 1271 currentNode.setAttributeNS(namespaceURI, name, value); 1272 } else { 1273 /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */ 1274 currentNode.setAttribute(name, value); 1275 } 1276 if (_isClobbered(currentNode)) { 1277 _forceRemove(currentNode); 1278 } else { 1279 arrayPop(DOMPurify.removed); 1280 } 1281 } catch (_) { 1282 _removeAttribute(name, currentNode); 1283 } 1284 } 1285 } 1286 /* Execute a hook if present */ 1287 _executeHooks(hooks.afterSanitizeAttributes, currentNode, null); 1288 }; 1289 /** 1290 * _sanitizeShadowDOM 1291 * 1292 * @param fragment to iterate over recursively 1293 */ 1294 const _sanitizeShadowDOM2 = function _sanitizeShadowDOM(fragment) { 1295 let shadowNode = null; 1296 const shadowIterator = _createNodeIterator(fragment); 1297 /* Execute a hook if present */ 1298 _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null); 1299 while (shadowNode = shadowIterator.nextNode()) { 1300 /* Execute a hook if present */ 1301 _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null); 1302 /* Sanitize tags and elements */ 1303 _sanitizeElements(shadowNode); 1304 /* Check attributes next */ 1305 _sanitizeAttributes(shadowNode); 1306 /* Deep shadow DOM detected */ 1307 if (shadowNode.content instanceof DocumentFragment) { 1308 _sanitizeShadowDOM2(shadowNode.content); 1309 } 1310 } 1311 /* Execute a hook if present */ 1312 _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null); 1313 }; 1314 // eslint-disable-next-line complexity 1315 DOMPurify.sanitize = function (dirty) {
vendor: 2,008 bytes, lines 1316-1368
1316 let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 1317 let body = null; 1318 let importedNode = null; 1319 let currentNode = null; 1320 let returnNode = null; 1321 /* Make sure we have a string to sanitize. 1322 DO NOT return early, as this will return the wrong type if 1323 the user has requested a DOM object rather than a string */ 1324 IS_EMPTY_INPUT = !dirty; 1325 if (IS_EMPTY_INPUT) { 1326 dirty = '<!-->'; 1327 } 1328 /* Stringify, in case dirty is an object */ 1329 if (typeof dirty !== 'string' && !_isNode(dirty)) { 1330 dirty = stringifyValue(dirty); 1331 if (typeof dirty !== 'string') { 1332 throw typeErrorCreate('dirty is not a string, aborting'); 1333 } 1334 } 1335 /* Return dirty HTML if DOMPurify cannot run */ 1336 if (!DOMPurify.isSupported) { 1337 return dirty; 1338 } 1339 /* Assign config vars */ 1340 if (!SET_CONFIG) { 1341 _parseConfig(cfg); 1342 } 1343 /* Clean up removed elements */ 1344 DOMPurify.removed = []; 1345 /* Check if dirty is correctly typed for IN_PLACE */ 1346 if (typeof dirty === 'string') { 1347 IN_PLACE = false; 1348 } 1349 if (IN_PLACE) { 1350 /* Do some early pre-sanitization to avoid unsafe root nodes */ 1351 const nn = dirty.nodeName; 1352 if (typeof nn === 'string') { 1353 const tagName = transformCaseFunc(nn); 1354 if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) { 1355 throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place'); 1356 } 1357 } 1358 } else if (dirty instanceof Node) { 1359 /* If dirty is a DOM element, append to an empty document to avoid 1360 elements being stripped by the parser */ 1361 body = _initDocument('<!---->'); 1362 importedNode = body.ownerDocument.importNode(dirty, true); 1363 if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === 'BODY') { 1364 /* Node is already a body, use as is */ 1365 body = importedNode; 1366 } else if (importedNode.nodeName === 'HTML') { 1367 body = importedNode; 1368 } else {
vendor: 1,921 bytes, lines 1369-1419
1369 // eslint-disable-next-line unicorn/prefer-dom-node-append 1370 body.appendChild(importedNode); 1371 } 1372 } else { 1373 /* Exit directly if we have nothing to do */ 1374 if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && 1375 // eslint-disable-next-line unicorn/prefer-includes 1376 dirty.indexOf('<') === -1) { 1377 return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty; 1378 } 1379 /* Initialize the document to work on */ 1380 body = _initDocument(dirty); 1381 /* Check we have a DOM node from the data */ 1382 if (!body) { 1383 return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : ''; 1384 } 1385 } 1386 /* Remove first element node (ours) if FORCE_BODY is set */ 1387 if (body && FORCE_BODY) { 1388 _forceRemove(body.firstChild); 1389 } 1390 /* Get node iterator */ 1391 const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body); 1392 /* Now start iterating over the created document */ 1393 while (currentNode = nodeIterator.nextNode()) { 1394 /* Sanitize tags and elements */ 1395 _sanitizeElements(currentNode); 1396 /* Check attributes next */ 1397 _sanitizeAttributes(currentNode); 1398 /* Shadow DOM detected, sanitize it */ 1399 if (currentNode.content instanceof DocumentFragment) { 1400 _sanitizeShadowDOM2(currentNode.content); 1401 } 1402 } 1403 /* If we sanitized `dirty` in-place, return it. */ 1404 if (IN_PLACE) { 1405 return dirty; 1406 } 1407 /* Return sanitized string or DOM */ 1408 if (RETURN_DOM) { 1409 if (SAFE_FOR_TEMPLATES) { 1410 body.normalize(); 1411 let html = body.innerHTML; 1412 arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => { 1413 html = stringReplace(html, expr, ' '); 1414 }); 1415 body.innerHTML = html; 1416 } 1417 if (RETURN_DOM_FRAGMENT) { 1418 returnNode = createDocumentFragment.call(body.ownerDocument); 1419 while (body.firstChild) {
vendor: 2,737 bytes, lines 1420-1491
1420 // eslint-disable-next-line unicorn/prefer-dom-node-append 1421 returnNode.appendChild(body.firstChild); 1422 } 1423 } else { 1424 returnNode = body; 1425 } 1426 if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) { 1427 /* 1428 AdoptNode() is not used because internal state is not reset 1429 (e.g. the past names map of a HTMLFormElement), this is safe 1430 in theory but we would rather not risk another attack vector. 1431 The state that is cloned by importNode() is explicitly defined 1432 by the specs. 1433 */ 1434 returnNode = importNode.call(originalDocument, returnNode, true); 1435 } 1436 return returnNode; 1437 } 1438 let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML; 1439 /* Serialize doctype if allowed */ 1440 if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) { 1441 serializedHTML = '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\n' + serializedHTML; 1442 } 1443 /* Sanitize final string template-safe */ 1444 if (SAFE_FOR_TEMPLATES) { 1445 arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => { 1446 serializedHTML = stringReplace(serializedHTML, expr, ' '); 1447 }); 1448 } 1449 return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML; 1450 }; 1451 DOMPurify.setConfig = function () { 1452 let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 1453 _parseConfig(cfg); 1454 SET_CONFIG = true; 1455 }; 1456 DOMPurify.clearConfig = function () { 1457 CONFIG = null; 1458 SET_CONFIG = false; 1459 }; 1460 DOMPurify.isValidAttribute = function (tag, attr, value) { 1461 /* Initialize shared config vars if necessary. */ 1462 if (!CONFIG) { 1463 _parseConfig({}); 1464 } 1465 const lcTag = transformCaseFunc(tag); 1466 const lcName = transformCaseFunc(attr); 1467 return _isValidAttribute(lcTag, lcName, value); 1468 }; 1469 DOMPurify.addHook = function (entryPoint, hookFunction) { 1470 if (typeof hookFunction !== 'function') { 1471 return; 1472 } 1473 arrayPush(hooks[entryPoint], hookFunction); 1474 }; 1475 DOMPurify.removeHook = function (entryPoint, hookFunction) { 1476 if (hookFunction !== undefined) { 1477 const index = arrayLastIndexOf(hooks[entryPoint], hookFunction); 1478 return index === -1 ? undefined : arraySplice(hooks[entryPoint], index, 1)[0]; 1479 } 1480 return arrayPop(hooks[entryPoint]); 1481 }; 1482 DOMPurify.removeHooks = function (entryPoint) { 1483 hooks[entryPoint] = []; 1484 }; 1485 DOMPurify.removeAllHooks = function () { 1486 hooks = _createHooksMap(); 1487 }; 1488 return DOMPurify; 1489} 1490var purify = createDOMPurify(); 1491
1492module.exports = purify; 1493//# sourceMappingURL=purify.cjs.js.map 1494 1495 1496/***/ }, 1497 1498/***/ "./js/src/BlazorReportViewer.ts" 1499/*!**************************************!*\ 1500 !*** ./js/src/BlazorReportViewer.ts ***! 1501 \**************************************/ 1502(__unused_webpack_module, exports, __webpack_require__) { 1503 1504"use strict"; 1505 1506var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 1507 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 1508 return new (P || (P = Promise))(function (resolve, reject) { 1509 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 1510 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 1511 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 1512 step((generator = generator.apply(thisArg, _arguments || [])).next()); 1513 }); 1514}; 1515Object.defineProperty(exports, "__esModule", ({ value: true })); 1516exports.BlazorReportViewer = exports.BlazorReportViewerCallbacksOptions = exports.BlazorReportViewerOptions = exports.BlazorReportSourceEventsOptions = void 0; 1517const telerik_common_report_viewer_1 = __webpack_require__(/*! @progress/telerik-common-report-viewer */ "../common-viewer/dist/index.js"); 1518let blazorLicenseInfo = null; 1519// Suppress the Blazor banner but save its info, so we can show our own banner with it 1520// Do not move inside a class as it has to execute before the Blazor event is triggered 1521const onKendoLicensingMessage = (e) => { 1522 const customEvent = e; 1523 blazorLicenseInfo = customEvent === null || customEvent === void 0 ? void 0 : customEvent.detail; 1524 e.preventDefault(); 1525 // Self-remove after first capture — we only need one message and the listener is no longer needed 1526 document.documentElement.removeEventListener('kendoLicensingMessage', onKendoLicensingMessage); 1527}; 1528if (typeof document !== 'undefined') { 1529 document.documentElement.addEventListener('kendoLicensingMessage', onKendoLicensingMessage); 1530} 1531class BlazorReportSourceEventsOptions { 1532 constructor() { 1533 // Internal events — consumed by the Blazor viewer's own components 1534 // (toolbar, parameters area, content area, search dialog, etc.) 1535 // Some also fire public [Parameter] EventCallback on ReportViewer.razor.cs (noted below). 1536 this.beforeLoadReport = ''; // also fires OnRenderingBegin 1537 this.beginLoadReport = ''; 1538 this.loadedReportChange = ''; 1539 this.reportLoadProgress = ''; 1540 this.reportLoadComplete = ''; // also fires OnRenderingEnd 1541 this.reportAutoRunOff = ''; 1542 this.renderingStopped = ''; 1543 this.error = ''; 1544 this.parametersLoaded = ''; 1545 this.beforePrint = ''; 1546 this.currentPageChanged = ''; 1547 this.navigateToReport = ''; 1548 this.searchComplete = ''; 1549 this.reportVersionMismatch = ''; 1550 // Public events — exposed only as [Parameter] EventCallback on ReportViewer.razor.cs 1551 this.printStarted = ''; 1552 this.printDocumentReady = ''; 1553 this.sendEmailStarted = ''; 1554 this.sendEmailDocumentReady = ''; 1555 this.exportStarted = ''; 1556 this.exportDocumentReady = ''; 1557 this.pageReady = ''; 1558 this.interactiveActionExecuting = ''; 1559 this.interactiveActionEnter = ''; 1560 this.interactiveActionLeave = ''; 1561 this.tooltipOpening = ''; 1562 this.onError = ''; 1563 } 1564} 1565exports.BlazorReportSourceEventsOptions = BlazorReportSourceEventsOptions; 1566class BlazorReportViewerOptions { 1567 constructor() { 1568 this.authenticationToken = ''; 1569 this.nonce = ''; 1570 this.keepClientAlive = true; 1571 this.serviceUrl = ''; 1572 this.printMode = telerik_common_report_viewer_1.PrintMode.AutoSelect; 1573 this.pageMode = telerik_common_report_viewer_1.PageMode.ContinuousScroll; 1574 this.viewMode = telerik_common_report_viewer_1.ViewMode.Interactive; 1575 this.scaleMode = telerik_common_report_viewer_1.ScaleMode.FitPageWidth; 1576 this.scale = 1; 1577 this.reportSource = new telerik_common_report_viewer_1.ReportSourceOptions(); 1578 this.events = new BlazorReportSourceEventsOptions(); 1579 this.callbacks = new BlazorReportViewerCallbacksOptions(); 1580 this.reportServer = null; 1581 this.serviceType = telerik_common_report_viewer_1.ServiceType.REST; 1582 this.contentTabIndex = 1000; 1583 this.enableAccessibility = false;
1584 this.messages = {}; 1585 } 1586} 1587exports.BlazorReportViewerOptions = BlazorReportViewerOptions; 1588class BlazorReportViewerCallbacksOptions { 1589 constructor() { 1590 this.getPersonalAccessToken = ''; 1591 } 1592} 1593exports.BlazorReportViewerCallbacksOptions = BlazorReportViewerCallbacksOptions; 1594class BlazorReportViewer { 1595 constructor(element, options) { 1596 this.element = element; 1597 this.options = options; 1598 const getPersonalAccessToken = this.options.callbacks.getPersonalAccessToken; 1599 if (getPersonalAccessToken) { 1600 var reportServerSettings = this.options.reportServer; 1601 reportServerSettings.getPersonalAccessToken = () => this.invokeComponentMethodAsync(getPersonalAccessToken, {}); 1602 } 1603 this.serviceClient = new telerik_common_report_viewer_1.ServiceClient(this.options); 1604 this.controller = new telerik_common_report_viewer_1.ReportController(this.serviceClient, this.getControllerOptions()); 1605 this.contentArea = new telerik_common_report_viewer_1.ContentArea(this.element, this.controller, this.options.messages); 1606 this.searchManager = new telerik_common_report_viewer_1.SearchManager(this.element, this.controller); 1607 this.controller 1608 .on('reportVersionMismatch', (version) => { 1609 this.invokeComponentMethodAsync(this.options.events.reportVersionMismatch, version); 1610 }) 1611 .onAsync('beforeLoadReport', ({ deviceInfo }) => __awaiter(this, void 0, void 0, function* () { 1612 const serverArgs = yield this.invokeComponentMethodAsync(this.options.events.beforeLoadReport, deviceInfo); 1613 Object.assign(deviceInfo, serverArgs); 1614 })) 1615 .on('beginLoadReport', () => { 1616 this.invokeComponentMethodAsync(this.options.events.beginLoadReport, null); 1617 }) 1618 .on('loadedReportChange', () => { 1619 this.invokeComponentMethodAsync(this.options.events.loadedReportChange, null); 1620 }) 1621 .on('reportLoadProgress', (info) => { 1622 this.invokeComponentMethodAsync(this.options.events.reportLoadProgress, info); 1623 }) 1624 .onAsync('reportLoadComplete', (info) => __awaiter(this, void 0, void 0, function* () { 1625 const serverArgs = yield this.invokeComponentMethodAsync(this.options.events.reportLoadComplete, info); 1626 Object.assign(info, serverArgs); 1627 })) 1628 .onAsync('reportAutoRunOff', () => __awaiter(this, void 0, void 0, function* () { 1629 yield this.invokeComponentMethodAsync(this.options.events.reportAutoRunOff, null); 1630 })) 1631 .on('renderingStopped', () => { 1632 this.invokeComponentMethodAsync(this.options.events.renderingStopped, null); 1633 }) 1634 .on('error', (message) => { 1635 this.invokeComponentMethodAsync(this.options.events.error, message); 1636 this.invokeComponentMethodAsync(this.options.events.onError, { message }); 1637 }) 1638 .on('parametersLoaded', (parameters) => { 1639 this.invokeComponentMethodAsync(this.options.events.parametersLoaded, parameters); 1640 }) 1641 // .onAsync('beforePrint', async () => { 1642 // // Raise awaitable server event 1643 // await this.invokeComponentMethodAsync(this.options.events.beforePrint, args); 1644 // }) 1645 .on('currentPageChanged', (args) => { 1646 this.invokeComponentMethodAsync(this.options.events.currentPageChanged, args); 1647 }) 1648 .on('navigateToReport', (report) => { 1649 this.invokeComponentMethodAsync(this.options.events.navigateToReport, report); 1650 }) 1651 .onAsync('printStarted', (args) => __awaiter(this, void 0, void 0, function* () { 1652 const serverArgs = yield this.invokeComponentMethodAsync(this.options.events.printStarted, args); 1653 Object.assign(args, serverArgs); 1654 })) 1655 .onAsync('printDocumentReady', (args) => __awaiter(this, void 0, void 0, function* () { 1656 const serverArgs = yield this.invokeComponentMethodAsync(this.options.events.printDocumentReady, args); 1657 Object.assign(args, serverArgs); 1658 })) 1659 .onAsync('sendEmailStarted', (args) => __awaiter(this, void 0, void 0, function* () { 1660 const serverArgs = yield this.invokeComponentMethodAsync(this.options.events.sendEmailStarted, args); 1661 Object.assign(args, serverArgs); 1662 })) 1663 .onAsync('sendEmailDocumentReady', (args) => __awaiter(this, void 0, void 0, function* () { 1664 const serverArgs = yield this.invokeComponentMethodAsync(this.options.events.sendEmailDocumentReady, args); 1665 Object.assign(args, serverArgs); 1666 })) 1667 .onAsync('exportStarted', (args) => __awaiter(this, void 0, void 0, function* () { 1668 const serverArgs = yield this.invokeComponentMethodAsync(this.options.events.exportStarted, args); 1669 Object.assign(args, serverArgs); 1670 })) 1671 .onAsync('exportDocumentReady', (args) => __awaiter(this, void 0, void 0, function* () { 1672 const serverArgs = yield this.invokeComponentMethodAsync(this.options.events.exportDocumentReady, args); 1673 Object.assign(args, serverArgs); 1674 })) 1675 .on('pageReady', (args) => { 1676 this.invokeComponentMethodAsync(this.options.events.pageReady, args); 1677 }) 1678 .onAsync('interactiveActionExecuting', (args) => __awaiter(this, void 0, void 0, function* () { 1679 const serverArgs = yield this.invokeComponentMethodAsync(this.options.events.interactiveActionExecuting, { action: args.action, cancel: args.cancel }); 1680 Object.assign(args, serverArgs); 1681 })) 1682 .on('interactiveActionEnter', (args) => { 1683 this.invokeComponentMethodAsync(this.options.events.interactiveActionEnter, { action: args.action, cancel: args.cancel }); 1684 }) 1685 .on('interactiveActionLeave', (args) => { 1686 this.invokeComponentMethodAsync(this.options.events.interactiveActionLeave, { action: args.action, cancel: args.cancel }); 1687 }) 1688 .onAsync('toolTipOpening', (args) => __awaiter(this, void 0, void 0, function* () { 1689 const serverArgs = yield this.invokeComponentMethodAsync(this.options.events.tooltipOpening, { text: args.text, title: args.title }); 1690 Object.assign(args, serverArgs); 1691 // Update DOM data attributes so the TelerikTooltip Blazor component 1692 // (which reads from data-tooltip-title/data-tooltip-text) picks up 1693 // any modifications made in the C# event handler. 1694 if (args.element) { 1695 args.element.dataset['tooltipTitle'] = args.title; 1696 args.element.dataset['tooltipText'] = args.text; 1697 } 1698 })); 1699 this.searchManager.on('searchComplete', (results) => { 1700 let totalCount = results.length; 1701 if (totalCount > 250) { 1702 // eslint-disable-next-line no-param-reassign 1703 results = results.slice(0, 250); 1704 } 1705 this.invokeComponentMethodAsync(this.options.events.searchComplete, { 1706 results: results, 1707 totalCount: totalCount 1708 }); 1709 }); 1710 this.setAuthenticationToken(this.options.authenticationToken); 1711 this.controller.init(); 1712 } 1713 destroy() { 1714 if (this.controller) { 1715 this.controller.destroy(); 1716 } 1717 if (this.contentArea) { 1718 this.contentArea.destroy(); 1719 } 1720 } 1721 getControllerOptions() { 1722 return new telerik_common_report_viewer_1.ReportControllerOptions(this.options.keepClientAlive, this.options.authenticationToken, this.options.nonce, this.options.reportSource, this.options.printMode, this.options.pageMode, this.options.viewMode, this.options.scaleMode, this.options.scale, this.options.messages); 1723 } 1724 setAuthenticationToken(token) { 1725 if (token) { 1726 this.controller.setAuthenticationToken(token); 1727 } 1728 } 1729 invokeComponentMethodAsync(methodName, args) { 1730 return __awaiter(this, void 0, void 0, function* () { 1731 const dotNetInstance = this.options.dotNetInstance; 1732 if (dotNetInstance && dotNetInstance.invokeMethodAsync && methodName) { 1733 return dotNetInstance.invokeMethodAsync(methodName, args); 1734 } 1735 }); 1736 } 1737 setOptions(options) { 1738 this.options = options; 1739 this.controller.setOptions(this.getControllerOptions()); 1740 this.refreshReport(); 1741 } 1742 applyHistory(reportSource, page, reportDocumentId) { 1743 this.controller.setReportSource(reportSource); 1744 this.controller.refreshReport(false /* ignoreCache */, reportDocumentId, true /* alwaysRespectAutoRun */); 1745 this.controller.navigateToPage(page, undefined); 1746 } 1747 refreshReport(skipRefresh = false) { 1748 this.controller.refreshReport(true /* ignoreCache */, '', false /* alwaysRespectAutoRun */, skipRefresh); 1749 } 1750 sendReport(mailArgs) { 1751 this.controller.sendReport(mailArgs); 1752 } 1753 printReport() { 1754 this.controller.printReport(); 1755 } 1756 exportReport(format) { 1757 this.controller.exportReport(format); 1758 } 1759 navigateToPage(page, target) { 1760 this.controller.navigateToPage(page, target); 1761 } 1762 applyParameter(parameter, allParametersValid) { 1763 this.controller.setParameter(parameter.id, parameter.value); 1764 if (!parameter.autoRefresh || !this.controller.autoRunEnabled) { 1765 this.controller.handleParametersNotification(allParametersValid); 1766 return; 1767 } 1768 this.controller.previewReport(); 1769 } 1770 applyParameters(parameters) { 1771 this.controller.setParameters(parameters); 1772 this.controller.previewReport(); 1773 } 1774 reloadParameters(parameters, currentParamAutoRefresh) { 1775 this.controller.setParameters(parameters); 1776 // Refresh the report only if the changed parameter has autoRefresh
1777 this.refreshReport(!currentParamAutoRefresh /* skipRefresh */); 1778 } 1779 setScale(scale) { 1780 this.options.scale = scale; 1781 this.controller.setScale(scale); 1782 } 1783 setScaleMode(scaleMode) { 1784 this.options.scaleMode = scaleMode; 1785 this.controller.setScaleMode(scaleMode); 1786 } 1787 setViewMode(viewMode) { 1788 this.options.viewMode = viewMode; 1789 this.controller.setViewMode(viewMode); 1790 this.controller.refreshReportCore(false, this.controller.getReportDocumentId()); 1791 } 1792 stopRendering() { 1793 this.controller.stopRendering(); 1794 } 1795 search(searchInfo) { 1796 this.searchManager.search(searchInfo); 1797 } 1798 searchResultClick(searchResult, elementId) { 1799 this.searchManager.highlightSearchItem(searchResult); 1800 (0, telerik_common_report_viewer_1.keepElementInView)(document.getElementById(elementId)); 1801 } 1802 createAIThread() { 1803 return this.controller.createAIThread(); 1804 } 1805 getAIResponse(prompt) { 1806 return this.controller.getAIResponse(prompt); 1807 } 1808 closeSearch() { 1809 this.searchManager.closeSearch(); 1810 } 1811 hasInvalidParameter(parameters) { 1812 return this.controller.hasInvalidParameter(parameters); 1813 } 1814 autoRunEnabled() { 1815 return this.controller.autoRunEnabled; 1816 } 1817 getServiceConfiguration() { 1818 return this.controller.getServiceConfiguration(); 1819 } 1820 setConfigurationInfo(configurationInfo) { 1821 this.controller.setConfigurationInfo(configurationInfo); 1822 } 1823 saveToSessionStorage(key, value) { 1824 this.controller.saveToSessionStorage(key, value); 1825 } 1826 loadFromSessionStorage(key) { 1827 return this.controller.loadFromSessionStorage(key); 1828 } 1829 removeFromSessionStorage(key) { 1830 this.controller.removeFromSessionStorage(key); 1831 } 1832 clearSessionStorage() { 1833 this.controller.clearSessionStorage(); 1834 } 1835 //blazor utility functions 1836 addClassToElementReference(element, className) { 1837 element === null || element === void 0 ? void 0 : element.classList.add(className); 1838 } 1839 getBlazorLicenseInfo() { 1840 if (!blazorLicenseInfo || !blazorLicenseInfo.message) { 1841 return null; 1842 } 1843 return { 1844 type: 0, 1845 isValid: false, 1846 message: blazorLicenseInfo.message.notificationMessage, 1847 title: blazorLicenseInfo.message.notificationTitle 1848 }; 1849 } 1850} 1851exports.BlazorReportViewer = BlazorReportViewer; 1852 1853 1854/***/ }, 1855 1856/***/ "./js/src/Utils.ts" 1857/*!*************************!*\ 1858 !*** ./js/src/Utils.ts ***! 1859 \*************************/ 1860(__unused_webpack_module, exports, __webpack_require__) { 1861 1862"use strict"; 1863 1864Object.defineProperty(exports, "__esModule", ({ value: true })); 1865exports.destroyComponent = exports.invokeComponentMethod = exports.initBlazorReportViewer = void 0; 1866const BlazorReportViewer_1 = __webpack_require__(/*! ./BlazorReportViewer */ "./js/src/BlazorReportViewer.ts"); 1867function getElementByDataId(dataId, parentElement = null) { 1868 return (parentElement || document).querySelector(`[data-id="${dataId}"]`); 1869} 1870function isFunction(fn) { 1871 return typeof fn === 'function'; 1872} 1873function initBlazorReportViewer(id, options) { 1874 initComponent(BlazorReportViewer_1.BlazorReportViewer, id, options); 1875} 1876exports.initBlazorReportViewer = initBlazorReportViewer; 1877function invokeComponentMethod(methodName, id, args) { 1878 const instance = getComponentInstance(id); 1879 if (instance && isFunction(instance[methodName])) { 1880 return instance[methodName](...args); 1881 } 1882} 1883exports.invokeComponentMethod = invokeComponentMethod; 1884function destroyComponent(id) {
1885 let component = getComponentInstance(id); 1886 if (component && component.destroy) { 1887 component.destroy(); 1888 component = null; 1889 } 1890 removeComponentInstance(id); 1891} 1892exports.destroyComponent = destroyComponent; 1893function initComponent(componentType, dataId, options) { 1894 const element = getElementByDataId(dataId); 1895 const component = getComponentInstance(dataId); 1896 if (!component) { 1897 const instance = new componentType(element, options); 1898 setComponentInstance(dataId, instance); 1899 } 1900} 1901function getComponentInstance(id) { 1902 let instances = getInstances(); 1903 return instances[id]; 1904} 1905function setComponentInstance(id, component) { 1906 let instances = getInstances(); 1907 instances[id] = component; 1908} 1909function removeComponentInstance(id) { 1910 let instances = window.TelerikBlazorReportViewer._instances || {}; 1911 delete instances[id]; 1912} 1913const getInstances = () => { 1914 window.TelerikBlazorReportViewer._instances = window.TelerikBlazorReportViewer._instances || {}; 1915 return window.TelerikBlazorReportViewer._instances; 1916}; 1917 1918 1919/***/ }, 1920 1921/***/ "./js/src/index.ts" 1922/*!*************************!*\ 1923 !*** ./js/src/index.ts ***! 1924 \*************************/ 1925(__unused_webpack_module, exports, __webpack_require__) { 1926 1927"use strict"; 1928 1929var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { 1930 if (k2 === undefined) k2 = k; 1931 var desc = Object.getOwnPropertyDescriptor(m, k); 1932 if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { 1933 desc = { enumerable: true, get: function() { return m[k]; } }; 1934 } 1935 Object.defineProperty(o, k2, desc); 1936}) : (function(o, m, k, k2) { 1937 if (k2 === undefined) k2 = k; 1938 o[k2] = m[k]; 1939})); 1940var __exportStar = (this && this.__exportStar) || function(m, exports) { 1941 for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); 1942}; 1943Object.defineProperty(exports, "__esModule", ({ value: true })); 1944__exportStar(__webpack_require__(/*! ./Utils */ "./js/src/Utils.ts"), exports); 1945 1946 1947/***/ }, 1948 1949/***/ "../common-viewer/dist/index.js" 1950/*!**************************************!*\ 1951 !*** ../common-viewer/dist/index.js ***! 1952 \**************************************/ 1953(__unused_webpack_module, exports, __webpack_require__) { 1954 1955!function(e,t){ true?t(exports,__webpack_require__(/*! dompurify */ "../../../../node_modules/.pnpm/[email protected]/node_modules/dompurify/dist/purify.cjs.js")):0}(this,function(e,t){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n,r=i(t);function s(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;class o{constructor(){this.BasePath="",this.ImmediatePrint=!1,this.ContentOnly=!1,this.UseSVG=!1,this.enableSearch=!1,this.enableAccessibility=!1,this.contentTabIndex=0}}class a{constructor(){this.from="",this.to="",this.cc="",this.subject="",this.format="",this.body=""}}class l{constructor(e,t){this.cancel=!1,this.element=e,this.action=t}}class h{constructor(e,t){this.id="",this.type="",this.id=e,this.type=t}}class c{constructor(e,t){this.isCancelled=!1,this.format="",this.deviceInfo=e,this.format=t}}class d{constructor(e,t){this.handled=!1,this.deviceInfo=e,this.format=t}}class u{constructor(e,t,i){this.handled=!1,this.url=e,this.format=t,this.windowOpenTarget=i}}class p{constructor(e){this.handled=!1,this.deviceInfo=e}}class g{constructor(e){this.handled=!1,this.url=e}}class f{constructor(e,t){this.handled=!1,this.deviceInfo=e,this.format=t}}class m extends a{constructor(e,t,i){super(),this.handled=!1,this.body=e.body,this.cc=e.cc,this.format=e.format,this.from=e.from,this.subject=e.subject,this.to=e.to,this.deviceInfo=t,this.url=i}}class v{constructor(e,t){this.page=e,this.reportDocumentId=t}}class P{constructor(e,t,i,n=null){this.element=e,this.text=t,this.title=i,this.eventArgs=n}}class C{constructor(e,t){this._responseText=e,this._error=t;try{this._responseJSON=JSON.parse(e)}catch(e){this._responseJSON=null}}get responseText(){return this._responseText}get responseJSON(){return this._responseJSON}get error(){return this._error}get exceptionMessage(){var e,t;return(null===(e=this.responseJSON)||void 0===e?void 0:e.exceptionMessage)||(null===(t=this.responseJSON)||void 0===t?void 0:t.ExceptionMessage)}}function y(e,t=!1,i=!1){let n={Accept:"application/json, text/javascript, */*; q=0.01"};return t&&(n["Content-Type"]=i?"application/x-www-form-urlencoded; charset=UTF-8":"application/json; charset=UTF-8"),e&&(n.authorization="Bearer "+e),n}function S(e){return s(this,void 0,void 0,function*(){if(!e.ok){let t=yield e.text(),i=new C(t,e.statusText);return Promise.reject(i)}if(204==e.status)return Promise.resolve();return(e.headers.get("content-type")||"").includes("application/json")?e.json():e.text()})}function I(e,t={},i="",n=!1){return fetch(e,{method:"POST",headers:y(i,!0,n),body:n?t:JSON.stringify(t)}).then(S)}class b{authenticatePromise(){return Promise.resolve("")}}class w{constructor(e){this.connectionConfig=e}authenticatePromise(){var e,t;if(this.connectionConfig&&this.connectionConfig.tokenUrl&&(this.connectionConfig.username||this.connectionConfig.password)){let i=`grant_type=password&username=${encodeURIComponent((null===(e=this.connectionConfig)||void 0===e?void 0:e.username)||"")}&password=${encodeURIComponent((null===(t=this.connectionConfig)||void 0===t?void 0:t.password)||"")}`;return I(this.connectionConfig.tokenUrl,i,"",!0).then(e=>
vendor: 5,423 bytes, line 1955
1955(e.expiresAt=Date.now()+1e3*e.expiresIn,e))}return Promise.reject("Failed to connect to Report Server with user credentials. Are you missing the reportServer.url, reportServer.username or reportServer.password values?")}}class L{constructor(e){this.connectionConfig=e}authenticatePromise(e,t){return e?I(this.connectionConfig.refreshTokenUrl,{RefreshToken:t}).then(e=>(e.expiresAt=Date.now()+1e3*e.expiresIn,e)):this.connectionConfig&&this.connectionConfig.personalTokenUrl&&this.connectionConfig.getPersonalAccessToken?this.connectionConfig.getPersonalAccessToken().then(e=>I(this.connectionConfig.personalTokenUrl,e).then(e=>(e.expiresAt=Date.now()+1e3*e.expiresIn,e))):Promise.reject("Failed to connect to Report Server with personal access token. Are you missing the reportServer.url or reportServer.getPersonalAccessToken values?")}}e.AuthType=void 0,(n=e.AuthType||(e.AuthType={}))[n.None=0]="None",n[n.Basic=1]="Basic",n[n.PersonalToken=2]="PersonalToken";class T{constructor(e){this.baseUrl=null==e?void 0:e.replace(/\/$/,"")}}class R extends T{constructor(t){super(t),this.authType=e.AuthType.None,this.serviceUrl=this.baseUrl}}class A extends T{constructor(t){super(t),this.authType=e.AuthType.None,this.serviceUrl=this.baseUrl+"/api/reports"}}class E extends A{constructor(t,i,n){super(t),this.authType=e.AuthType.Basic,this.username=i,this.password=n,this.tokenUrl=this.baseUrl+"/Token"}}class M extends A{constructor(t,i){super(t),this.authType=e.AuthType.PersonalToken,this.getPersonalAccessToken=i,this.personalTokenUrl=this.baseUrl+"/PersonalToken",this.refreshTokenUrl=this.baseUrl+"/refresh"}}function k(){}function x(){x.init.call(this)}function N(e){return void 0===e._maxListeners?x.defaultMaxListeners:e._maxListeners}function D(e,t,i,n){var r,s,o,a;if("function"!=typeof i)throw new TypeError('"listener" argument must be a function');if((s=e._events)?(s.newListener&&(e.emit("newListener",t,i.listener?i.listener:i),s=e._events),o=s[t]):(s=e._events=new k,e._eventsCount=0),o){if("function"==typeof o?o=s[t]=n?[i,o]:[o,i]:n?o.unshift(i):o.push(i),!o.warned&&(r=N(e))&&r>0&&o.length>r){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=o.length,a=l,"function"==typeof console.warn?console.warn(a):console.log(a)}}else o=s[t]=i,++e._eventsCount;return e}function V(e,t,i){var n=!1;function r(){e.removeListener(t,r),n||(n=!0,i.apply(e,arguments))}return r.listener=i,r}function F(e){var t=this._events;if(t){var i=t[e];if("function"==typeof i)return 1;if(i)return i.length}return 0}function O(e,t){for(var i=new Array(t);t--;)i[t]=e[t];return i}k.prototype=Object.create(null),x.EventEmitter=x,x.usingDomains=!1,x.prototype.domain=void 0,x.prototype._events=void 0,x.prototype._maxListeners=void 0,x.defaultMaxListeners=10,x.init=function(){this.domain=null,x.usingDomains&&(void 0).active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new k,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},x.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},x.prototype.getMaxListeners=function(){return N(this)},x.prototype.emit=function(e){var t,i,n,r,s,o,a,l="error"===e;if(o=this._events)l=l&&null==o.error;else if(!l)return!1;if(a=this.domain,l){if(t=arguments[1],!a){if(t instanceof Error)throw t;var h=new Error('Uncaught, unspecified "error" event. ('+t+")");throw h.context=t,h}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=a,t.domainThrown=!1,a.emit("error",t),!1}if(!(i=o[e]))return!1;var c="function"==typeof i;switch(n=arguments.length){case 1:!function(e,t,i){if(t)e.call(i);else for(var n=e.length,r=O(e,n),s=0;s<n;++s)r[s].call(i)}(i,c,this);break;case 2:!function(e,t,i,n){if(t)e.call(i,n);else for(var r=e.length,s=O(e,r),o=0;o<r;++o)s[o].call(i,n)}(i,c,this,arguments[1]);break;case 3:!function(e,t,i,n,r){if(t)e.call(i,n,r);else for(var s=e.length,o=O(e,s),a=0;a<s;++a)o[a].call(i,n,r)}(i,c,this,arguments[1],arguments[2]);break;case 4:!function(e,t,i,n,r,s){if(t)e.call(i,n,r,s);else for(var o=e.length,a=O(e,o),l=0;l<o;++l)a[l].call(i,n,r,s)}(i,c,this,arguments[1],arguments[2],arguments[3]);break;default:for(r=new Array(n-1),s=1;s<n;s++)r[s-1]=arguments[s];!function(e,t,i,n){if(t)e.apply(i,n);else for(var r=e.length,s=O(e,r),o=0;o<r;++o)s[o].apply(i,n)}(i,c,this,r)}return!0},x.prototype.addListener=function(e,t){return D(this,e,t,!1)},x.prototype.on=x.prototype.addListener,x.prototype.prependListener=function(e,t){return D(this,e,t,!0)},x.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,V(this,e,t)),this},x.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,V(this,e,t)),this},x.prototype.removeListener=function(e,t){var i,n,r,s,o;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(n=this._events))return this;if(!(i=n[e]))return this;if(i===t||i.listener&&i.listener===t)0===--this._eventsCount?this._events=new k:(delete n[e],n.removeListener&&this.emit
1955("removeListener",e,i.listener||t));else if("function"!=typeof i){for(r=-1,s=i.length;s-- >0;)if(i[s]===t||i[s].listener&&i[s].listener===t){o=i[s].listener,r=s;break}if(r<0)return this;if(1===i.length){if(i[0]=void 0,0===--this._eventsCount)return this._events=new k,this;delete n[e]}else!function(e,t){for(var i=t,n=i+1,r=e.length;n<r;i+=1,n+=1)e[i]=e[n];e.pop()}(i,r);n.removeListener&&this.emit("removeListener",e,o||t)}return this},x.prototype.off=function(e,t){return this.removeListener(e,t)},x.prototype.removeAllListeners=function(e){var t,i;if(!(i=this._events))return this;if(!i.removeListener)return 0===arguments.length?(this._events=new k,this._eventsCount=0):i[e]&&(0===--this._eventsCount?this._events=new k:delete i[e]),this;if(0===arguments.length){for(var n,r=Object.keys(i),s=0;s<r.length;++s)"removeListener"!==(n=r[s])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=new k,this._eventsCount=0,this}if("function"==typeof(t=i[e]))this.removeListener(e,t);else if(t)do{this.removeListener(e,t[t.length-1])}while(t[0]);return this},x.prototype.listeners=function(e){var t,i=this._events;return i&&(t=i[e])?"function"==typeof t?[t.listener||t]:function(e){for(var t=new Array(e.length),i=0;i<t.length;++i)t[i]=e[i].listener||e[i];return t} 1956/*! 1957 * await-event-emitter - v2.0.2 - 25/5/2023 1958 * https://github.com/imcuttle/node-await-event-emitter/tree/master 1959 * 1960 * Copyright (c) imcuttle <[email protected]> 1961 * Licensed under the MIT license. 1962 * https://github.com/imcuttle/node-await-event-emitter/blob/master/License 1963 */(t):[]},x.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):F.call(e,t)},x.prototype.listenerCount=F,x.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};const z="function"==typeof Symbol?Symbol.for("--[[await-event-emitter]]--"):"--[[await-event-emitter]]--";function _(e){if("string"!=typeof e&&"symbol"!=typeof e)throw new TypeError("type is not type of string or symbol!")}function H(e){if("function"!=typeof e)throw new TypeError("fn is not type of Function!")}function U(e){return{[z]:"always",fn:e}}function $(e){return{[z]:"once",fn:e}}class B{constructor(){this._events={}}addListener(e,t){return this.on(e,t)}on(e,t){return _(e),H(t),this._events[e]=this._events[e]||[],this._events[e].push(U(t)),this}prependListener(e,t){return this.prepend(e,t)}prepend(e,t){return _(e),H(t),this._events[e]=this._events[e]||[],this._events[e].unshift(U(t)),this}prependOnceListener(e,t){return this.prependOnce(e,t)}prependOnce(e,t){return _(e),H(t),this._events[e]=this._events[e]||[],this._events[e].unshift($(t)),this}listeners(e){return(this._events[e]||[]).map(e=>e.fn)}once(e,t){return _(e),H(t),this._events[e]=this._events[e]||[],this._events[e].push($(t)),this}removeAllListeners(){this._events={}}off(e,t){return this.removeListener(e,t)}removeListener(e,t){_(e);const i=this.listeners(e);if("function"==typeof t){let n=-1,r=!1;for(;(n=i.indexOf(t))>=0;)i.splice(n,1),this._events[e].splice(n,1),r=!0;return r}return delete this._events[e]}emit(e,...t){return s(this,void 0,void 0,function*(){_(e);const i=this.listeners(e),n=[];if(i&&i.length){for(let r=0;r<i.length;r++){const s=i[r],o=s.apply(this,t);o instanceof Promise&&(yield o),this._events[e]&&this._events[e][r]&&"once"===this._events[e][r][z]&&n.push(s)}return n.forEach(t=>this.removeListener(e,t)),!0}return!1})}emitSync(e,...t){_(e);const i=this.listeners(e),n=[];if(i&&i.length){for(let r=0;r<i.length;r++){const s=i[r];s.apply(this,t),this._events[e]&&this._events[e][r]&&"once"===this._events[e][r][z]&&n.push(s)}return n.forEach(t=>this.removeListener(e,t)),!0}return!1}}class q{constructor(){this.eventEmitter=new x,this.awaitEventEmitter=new B}on(e,t){return this.eventEmitter.on(e,t),this}emit(e,...t){this.eventEmitter.emit(e,...t)}onAsync(e,t){return this.awaitEventEmitter.on(e,t),this}emitAsync(e,...t){return s(this,void 0,void 0,function*(){yield this.awaitEventEmitter.emit(e,...t)})}}class W{hasPdfPlugin(){let e=/Firefox[/\s](\d+\.\d+)/.exec(navigator.userAgent);if(null!==e&&e.length>1){if(parseFloat(e[1])>=19)return!1}let t=navigator.mimeTypes["application/pdf"],i=null!==t?t.enabledPlugin:null;if(i){let e=i.description;return-1!==e.indexOf("Adobe")&&(-1===e.indexOf("Version")||parseFloat(e.split("Version")[1])>=6)}return!1}}class Z{constructor(e){this.defaultPlugin=e}hasPdfPlugin(){for(let e of navigator.plugins)if(e.name===this.defaultPlugin||"Adobe Acrobat"===e.name)return!0;return!1}}class j{hasPdfPlugin(){return!1}}class G{constructor(){this.hasPdfPlugin=!1,this.iframe=null,this.hasPdfPlugin=this.detectPdfSupport(),this.isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}detectPdfSupport(){return"boolean"==typeof navigator.pdfViewerEnabled?navigator.pdfViewerEnabled:function(){if(window.navigator){let e=window.navigator.userAgent.toLowerCase();return e.indexOf("firefox")>-1?new W:e.indexOf("edg/")>-1?new Z("Microsoft Edge PDF Plugin"):e.indexOf("chrome")>-1?new Z("Chrome PDF Viewer"):e.indexOf("safari")>-1?new Z("WebKit built-in PDF"):new j}return new j}().hasPdfPlugin()}destroy(){this.iframe=null}printDesktop(e,t){if(!this.hasPdfPlugin)return console.warn("Direct printing is not supported in this browser. The PDF document will be downloaded instead."),void this.printViaDownload(e,t);let i=null;this.iframe||(this.iframe=document.createElement("iframe"),this.iframe.style.display="none",this.iframe.onload=()=>{var e,t;try{null===(t=null===(e=this.iframe)||void 0===e?void 0:e.contentDocument)||void 0===t||t.execCommand("print",!0)}finally{i&&URL.revokeObjectURL(i)}});let n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200===n.status?(i=URL.createObjectURL(new Blob([n.response],{type:"application/pdf"})),null!=this.iframe&&(this.iframe.src=i,document.body.appendChild(this.iframe))):console.log("Could not retrieve remote PDF document.")},n.send()}printViaDownload(e,t){let i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=()=>
1963{if(200===i.status){let e=URL.createObjectURL(new Blob([i.response],{type:"application/pdf"})),n=document.createElement("a");n.href=e,n.download=`${t}.pdf`,n.click(),URL.revokeObjectURL(e)}else console.log("Could not retrieve PDF document for printing.")},i.send()}printMobile(e){window.open(e,"_self")}print(e,t){this.isMobile?this.printMobile(e):this.printDesktop(e,t)}getDirectPrintState(){return this.hasPdfPlugin}}function J(e){return 1e3*e}class K{constructor(e,t,i){if(this.pingMilliseconds=0,!e)throw"Error";this.serviceClient=e,this.clientID=t,this.initSessionTimeout(i)}initSessionTimeout(e){if(!isFinite(e))throw"sessionTimeoutSeconds must be finite";this.pingMilliseconds=e<=120?J(e)/2:J(e-60)}start(){this.pingMilliseconds<=0||(this.interval=setInterval(()=>{this.serviceClient.keepClientAlive(this.clientID)},this.pingMilliseconds))}stop(){this.interval&&(clearInterval(this.interval),this.interval=null)}}var X,Y,Q,ee,te;function ie(e,t="",i=""){let n=document.createElement(e);return t&&(n.id=t),ne(n,i),n}function ne(e,t){if(""===t||!e)return;let i=t.trim().split(" ");i=i.filter(e=>""!==e.trim()),e.classList.add(...i)}function re(e,t){if(""===t||!e)return;let i=t.trim().split(" ");i=i.filter(e=>""!==e.trim()),e.classList.remove(...i)}function se(e,t){return e.classList.contains(t)}function oe(e){return e.offsetParent}function ae(e){return parseInt(e,10)||0}function le(e,t,i,n=0,r=0){let s=`${n=n||0} ${r=r||0}`;!function(e,t){e.style.setProperty("transform",t),e.style.setProperty("-moz-transform",t),e.style.setProperty("-ms-transform",t),e.style.setProperty("-webkit-transform",t),e.style.setProperty("-o-transform",t)}(e,`scale(${t=t||1}, ${i=i||1})`),function(e,t){e.style.setProperty("transform-origin",t),e.style.setProperty("-moz-transform-origin",t),e.style.setProperty("-ms-transform-origin",t),e.style.setProperty("-webkit-transform-origin",t),e.style.setProperty("-o-transform-origin",t)}(e,s)}function he(e){let t=ie("div");return t.textContent=e,t.innerHTML}function ce(e){if(e&&e.length<6){let t=1,i=e.split("");for("#"!==i[0]&&(t=0);t<i.length;t++)i[t]=i[t]+i[t];e=i.join("")}let t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?parseInt(t[1],16)+", "+parseInt(t[2],16)+", "+parseInt(t[3],16):null}function de(e){return!!e&&e.indexOf(",")>-1}function ue(e){if("transparent"===e.toLowerCase())return 0;if(!de(e))return 1;if(-1!==e.indexOf("#")){let t=ce(e);if(null===t)return 1;e=t}let t=e.split(",").map(function(e){return e.trim()});return 4===t.length?parseFloat((parseFloat(t[3].replace(/[()]/g,""))/255).toFixed(2)):1}function pe(e,t){let i=ie("div");for(i.innerHTML=t;i.childNodes.length;)e.appendChild(i.childNodes[0])}function ge(e,t){let i=ie("div");for(i.innerHTML=t;i.childNodes.length;)e.prepend(i.childNodes[i.childNodes.length-1])}function fe(e,t){return e?e.querySelector(t):null}function me(e){let t=e.parentElement;return t?t.clientHeight!=t.scrollHeight?t:me(t):null}function ve(e,t=300){let i;return function(...n){clearTimeout(i),i=setTimeout(()=>e.apply(this,n),t)}}function Pe(e,t){let i=null;return function(n,...r){i||(i=setTimeout(function(){e.apply(n,r),i=null},t))}}function Ce(e,t){return!!e.responseJSON&&e.responseJSON.exceptionType===t}function ye(e){return Ce(e,"Telerik.Reporting.Services.Engine.InvalidClientException")}function Se(e){return Ce(e,"Telerik.Reporting.Services.Engine.InvalidParameterException")}function Ie(e){return!!e&&"internalservererror"===e.split(" ").join("").toLowerCase()}function be(e,...t){return e.replace(/{(\d+)}/g,(e,i)=>t[i]||"")}function we(e,t){let i,n;if(Le(e))for(i=e.length,n=0;n<i&&!1!==t.call(e[n],n,e[n]);n++);else for(n in e)if(!1===t.call(e[n],n,e[n]))break;return e}function Le(e){if(Array.isArray(e))return!0;return"number"==typeof(!!e&&"length"in e&&e.length)}function Te(e){return/^(\-|\+)?([0-9]+)$/.test(e)?Number(e):NaN}function Re(e){return/^(\-|\+)?([0-9]+(\.[0-9]+)?)$/.test(e)?Number(e):NaN}function Ae(e){return e instanceof Date?e:(/Z|[\+\-]\d\d:?\d\d/i.test(e)||(e+="Z"),new Date(e))}e.PageMode=void 0,(X=e.PageMode||(e.PageMode={}))[X.ContinuousScroll=0]="ContinuousScroll",X[X.SinglePage=1]="SinglePage",e.PrintMode=void 0,(Y=e.PrintMode||(e.PrintMode={}))[Y.AutoSelect=0]="AutoSelect",Y[Y.ForcePDFPlugin=1]="ForcePDFPlugin",Y[Y.ForcePDFFile=2]="ForcePDFFile",e.ScaleMode=void 0,(Q=e.ScaleMode||(e.ScaleMode={}))[Q.FitPageWidth=0]="FitPageWidth",Q[Q.FitPage=1]="FitPage",Q[Q.Specific=2]="Specific",e.ServiceType=void 0,(ee=e.ServiceType||(e.ServiceType={}))[ee.REST=0]="REST",ee[ee.ReportServer=1]="ReportServer",e.ViewMode=void 0,(te=e.ViewMode||(e.ViewMode={}))[te.Interactive=0]="Interactive",te[te.PrintPreview=1]="PrintPreview";
1963const Ee="System.Int64",Me="System.Double",ke="System.String",xe="System.DateTime",Ne="System.Boolean";var De=function(){var e={};function t(e,t,i,n){var r=[].concat(t).map(function(t){return function(e,t,i){if(e.availableValues){var n=!1;if(we(e.availableValues,function(e,r){return!(n=i(t,r.value))}),!n){if(e.allowNull&&!t)return t;throw"Please input a valid value."}}return t}(e,i(t),n)});if(e.multivalue){if(null==t||0==t.length){if(e.allowNull)return t;throw"Please input a valid value."}return r}return r[0]}function i(e,t){return e.allowNull&&-1!=[null,"",void 0].indexOf(t)}return e[ke]={validate:function(e,i){return t(e,i,function(t){if(!t){if(e.allowNull)return null;if(e.allowBlank)return"";throw"Parameter value cannot be empty."}return t},function(e,t){return e==t})}},e[Me]={validate:function(e,n){return t(e,n,function(t){var n=Re(t);if(isNaN(n)){if(i(e,t))return null;throw"Parameter value cannot be empty."}return n},function(e,t){return Re(e)==Re(t)})}},e[Ee]={validate:function(e,n){return t(e,n,function(t){var n=Te(t);if(isNaN(n)){if(i(e,t))return null;throw"Parameter value cannot be empty."}return n},function(e,t){return Te(e)==Re(t)})}},e[xe]={validate:function(e,i){return t(e,i,function(t){if(e.allowNull&&(null===t||""===t||void 0===t))return null;if(!isNaN(Date.parse(t)))return e.availableValues?t:Ae(t);throw"Please input a valid date."},function(e,t){return e=Ae(e),t=Ae(t),e.getTime()==t.getTime()})}},e[Ne]={validate:function(e,n){return t(e,n,function(t){if(-1!=["true","false"].indexOf(String(t).toLowerCase()))return Boolean(t);if(i(e,t))return null;throw"Parameter value cannot be empty."},function(e,t){return Boolean(e)==Boolean(t)})}},{validate:function(t,i){var n=e[t.type];if(!n)throw be("Cannot validate parameter of type {type}.",t);return n.validate(t,i)}}}();function Ve(e,t,i){try{const n=e.availableValues.find(e=>e.value===t);if(!n){if(e.allowNull&&null===t)return{valueMember:null,displayMember:null};throw new Error(`The available values of parameter ${i} do not contain Value property that equals ${t}`)}return{valueMember:t,displayMember:n.name}}catch(e){return}}function Fe(e,t,i){const n=[];for(let r in t)n.push(Ve(e,t[r],i));return n}class Oe{constructor(e="",t={}){this.report=e,this.parameters=t}}class ze extends q{constructor(e){super(),this.resizeObserver=null,this.element=e,this.initResizeObserver()}destroy(){this.destroyResizeObserver()}initResizeObserver(){this.debounceResize=ve(this.onResize.bind(this),50),this.resizeObserver=new ResizeObserver(this.debounceResize),this.resizeObserver.observe(this.element)}destroyResizeObserver(){this.resizeObserver&&this.resizeObserver.unobserve(this.element),this.resizeObserver=this.debounceResize=null}onResize(e){e[0].target===this.element&&this.emit("resize")}}const _e='<div class="trv-report-page trv-skeleton-page trv-skeleton-{0}" data-page="{0}"><div class="trv-skeleton-wrapper"></div></div>';class He{constructor(t,i,n){this.enabled=!1,this.viewMode=e.ViewMode.Interactive,this.scrollInProgress=!1,this.additionalTopOffset=130,this.onClickHandler=null,this.debounceScroll=null,this.throttleScroll=null,this.oldScrollTopPosition=0,this.lastLoadedPage=null,this.placeholder=t,this.pageContainer=t.querySelector(".trv-page-container"),this.pageWrapper=t.querySelector(".trv-page-wrapper"),this.contentArea=i,this.controller=n,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))}onPageLoaded(){this.currentPageNumber()>0&&!this.scrollInProgress&&setTimeout(()=>{this.loadMorePages()},100)}onScaleChanged(){this.enabled&&setTimeout(()=>{this.loadMorePages(),this.keepCurrentPageInToView()},100)}onInteractiveActionExecuting(e){const t=e.action.Type;!this.enabled||"sorting"!==t&&"toggleVisibility"!==t||this.disable()}getEnabled(){return this.enabled}enable(){this.enabled=!0,ne(this.placeholder,"scrollable"),this.initEvents()}disable(){this.enabled&&(this.lastLoadedPage=null,this.pageWrapper.innerHTML="",this.enabled=!1,re(this.placeholder,"scrollable"),this.unbind())}renderPage(e){let t=this.controller.getViewMode(),i=this.findPageElement(e.pageNumber);this.enabled?(t===this.viewMode&&i?this.navigateToPage(e,i):this.updatePageArea(e),this.viewMode=this.controller.getViewMode()):(this.enable(),t===this.viewMode&&i?(this.render(e,!0),this.pageContainer.scrollTop=3,this.setCurrentPage(e.pageNumber)):this.updatePageArea(e),this.viewMode=this.controller.getViewMode(),this.loadMorePages())}navigateToElement(e,t){this.scrollInProgress=!0,this.isSkeletonScreen(null,t)?this.getAndRenderPage(t).then(()=>{this.scrollToPage(e,t)}):this.scrollToPage(e,t)}updatePageDimensionsReady(){this.enabled&&this.currentPageNumber()>0&&this.keepCurrentPageInToView()}setCurrentPage(e){e!==this.currentPageNumber()&&this.controller.setCurrentPageNumber(e),this.controller.getPageCount()>1&&(re(this.findElement(".k-state-default"),"k-state-default"),ne(this.findPageElement(e),"k-state-default")),this.loadNextPreviousPage(e)}updatePageArea(e){var t;let i=0,n=e.pageNumber;this.scrollInProgress=!0,n>1&&this.generateSkeletonScreens(n),this.render(e,!1),this.setCurrentPage(e.pageNumber),i=n>1&&(null===(t=this.findPageElement(n))||void 0===t?void 0:t.offsetTop)||0,this.animateScroll(i,0,()=>{this.scrollInProgress=!1})}navigateToPage(e,t){this.scrollInProgress=!0;let i=t.offsetTop,n=e.pageNumber;this.isSkeletonScreen(t,n)?this.getAndRenderPage(n).then(()=>{this.scrollToPage(i,n)}):(this.updatePageContent(e,t),this.scrollToPage(i,n))}updatePageContent(e,t){this.contentArea.updatePageStyle(e);let i=this.contentArea.renderPageElement(e);t.after(i),t.remove(),this.contentArea.setScrollablePage(i,e),this.controller.applySearchColors()}currentPageNumber(){return this.controller.getCurrentPageNumber()}isSkeletonScreen(e,t){return!(!e&&!(e=this.findPageElement(t)))&&se(e,"trv-skeleton-"+t)}addSkeletonScreen(e,t){let i=be(_e,e);t?ge(this.pageWrapper,i):pe(this.pageWrapper,i)}generateSkeletonScreens(e){var t;let i="",n=null===(t=this.findLastElement(".trv-report-page"))||void 0===t?void 0:t.dataset.page,r=n?parseInt(n)+1:1;for(;r<e;r++)i+=be(_e,r);pe(this.pageWrapper,i)}loadMorePages(){var e;let t=this.controller.getPageCount(),i=this.pageContainer.offsetHeight>this.pageWrapper.offsetHeight;if(t>1)if(i){this.scrollInProgress=!0;let i=null===(e=this.findLastElement(".trv-report-page"))||void 0===e?void 0:e.dataset.page,n=i?parseInt(i)+1:1;n<=t&&this.getAndRenderPage(n).then(()=>{this.loadMorePages(),this.scrollInProgress=!1})}else this.loadVisiblePages(),this.scrollInProgress=!1}loadVisiblePages(){this.placeholder.querySelectorAll(".trv-report-page").forEach(e
1963=>{let t=e,i=parseInt(t.dataset.page||"");this.scrolledInToView(t)&&this.isSkeletonScreen(t,i)&&this.getAndRenderPage(i)})}scrolledInToView(e){if(!e)return!1;let t=e.getBoundingClientRect(),i=e.closest(".trv-pages-pane");if(!i)return!1;let n=i.getBoundingClientRect(),r=n.top,s=n.bottom,o=t.top,a=t.bottom,l=this.additionalTopOffset+r;return o>0&&o<s||a<s&&a>l}render(e,t){let i=e.pageNumber,n=this.findPageElement(i);if(!t&&n&&!this.isSkeletonScreen(n,i))return;(null==this.lastLoadedPage||this.lastLoadedPage.pageNumber<e.pageNumber)&&(this.lastLoadedPage=e),this.contentArea.updatePageStyle(this.lastLoadedPage);let r=this.contentArea.renderPageElement(e);t&&(this.pageWrapper.innerHTML=""),this.pageWrapper.dataset.pageNumber=i.toString();let s=this.findElement(".trv-skeleton-"+i);s?(s.after(r),s.remove()):this.pageWrapper.append(r),this.contentArea.setScrollablePage(r,e),this.controller.applySearchColors()}loadNextPreviousPage(e){if(e<this.controller.getPageCount()){let t=e+1,i=this.findPageElement(t);i&&this.isSkeletonScreen(i,t)&&this.getAndRenderPage(t)}if(e>1){let t=e-1,i=this.findPageElement(t);i&&this.isSkeletonScreen(i,t)}}initEvents(){this.onClickHandler=this.clickPage.bind(this),this.debounceScroll=ve(()=>{let e=this.placeholder.querySelectorAll(".trv-report-page"),t=Math.round(this.pageContainer.scrollTop+this.pageContainer.offsetHeight);!this.scrollInProgress&&e.length&&this.oldScrollTopPosition!==t&&this.advanceCurrentPage(Array.from(e))},250),this.throttleScroll=Pe(()=>{let e=this.placeholder.querySelectorAll(".trv-report-page"),t=Math.round(this.pageContainer.scrollTop+this.pageContainer.offsetHeight);this.scrollInProgress||this.oldScrollTopPosition===t||(this.oldScrollTopPosition>t?this.scrollUp(Array.from(e)):this.scrollDown(Array.from(e),t)),this.oldScrollTopPosition=t},250),this.pageContainer.addEventListener("click",this.onClickHandler),this.pageContainer.addEventListener("scroll",this.debounceScroll),this.pageContainer.addEventListener("scroll",this.throttleScroll)}unbind(){this.pageContainer.removeEventListener("click",this.onClickHandler),this.pageContainer.removeEventListener("scroll",this.debounceScroll),this.pageContainer.removeEventListener("scroll",this.throttleScroll)}clickPage(e){var t;let i=null===(t=e.target)||void 0===t?void 0:t.closest(".trv-report-page");if(!i)return;let n=this.currentPageNumber(),r=parseInt(i.dataset.page||"");n!==r&&(this.isSkeletonScreen(i,r)?this.getAndRenderPage(r).then(e=>{this.setCurrentPage(e.pageNumber)}):this.setCurrentPage(r))}advanceCurrentPage(e){let t=this.findNewCurrentPage(e);if(t){let e=parseInt(t.dataset.page||"-1"),i=this.currentPageNumber(),n=this.scrolledInToView(this.findPageElement(i));i===e||n||(this.isSkeletonScreen(t,e)?this.getAndRenderPage(e).then(e=>{this.setCurrentPage(e.pageNumber)}):this.setCurrentPage(e))}else console.log("Page not found - ",t)}findNewCurrentPage(e){let t=Math.floor(e.length/2),i=this.findPageInViewPort(t,e);return 1===e.length?e[0]:0===i?e[t]:i<0&&e.length>1?this.findNewCurrentPage(e.splice(t,Number.MAX_VALUE)):i>0&&e.length>1?this.findNewCurrentPage(e.splice(0,t)):null}findPageInViewPort(e,t){let i=t[e],n=i.getBoundingClientRect(),r=i.closest(".trv-pages-pane");if(!r)return-1;let s=r.getBoundingClientRect().top,o=n.top,a=n.bottom,l=this.additionalTopOffset+s;return o<=l&&l<a?0:a<l?-1:1}scrollDown(e,t){if(t>=this.pageContainer.scrollHeight-5){let t=parseInt(e[e.length-1].dataset.page||"")+1;this.currentPageNumber()<t&&t<=this.controller.getPageCount()&&(this.addSkeletonScreen(t,!1),this.getAndRenderPage(t))}else this.advanceCurrentPage(e),this.loadVisiblePages()}scrollUp(e){if(0===this.pageContainer.scrollTop){let t=parseInt(e[0].dataset.page||"")-1;this.currentPageNumber()>t&&t>=1&&(this.addSkeletonScreen(t,!0),this.getAndRenderPage(t).then(()=>{this.pageContainer.scrollTop=3}))}else this.advanceCurrentPage(e),this.loadVisiblePages()}keepCurrentPageInToView(){let e=this.findPageElement(this.currentPageNumber());if(!e)return;let t=e.offsetTop,i=e.offsetHeight,n=this.pageContainer.offsetHeight;if(this.scrollInProgress=!0,i<n){t-=(n-i)/2}this.animateScroll(t,0,()=>{setTimeout(()=>{this.scrollInProgress=!1},100)})}getAndRenderPage(e){return this.controller.getPageData(e).then(e=>(this.render(e,!1),e))}scrollToPage(e,t){this.animateScroll(e,500,()=>{setTimeout(()=>{this.setCurrentPage(t),this.scrollInProgress=!1})})}animateScroll(e,t,i){this.pageContainer.scrollTop=e,i.call(this)}findPageElement(e){return this.findElement('[data-page="'+e+'"]')}findElement(e){var t;return null===(t=this.placeholder)||void 0===t?void 0:t.querySelector(e)}findLastElement(e){var t;let i=null===(t=this.placeholder)||void 0===t?void 0:t.querySelectorAll(e);return i&&i.length?i[i.length-1]:null}}
1963class Ue{constructor(){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}init(e){this.reset(e),this.attachToScrollEvent()}reset(e){this.placeholder=e,this.scrollableContainer=fe(e,".trv-page-container"),this.itemsInitialState={},this.xFrozenAreasBounds={},this.yFrozenAreasBounds={},this.currentlyFrozenContainer={vertical:{},horizontal:{}}}setScaleFactor(e){this.scaleFactor=e}attachToScrollEvent(){var e;null===(e=this.scrollableContainer)||void 0===e||e.addEventListener("scroll",()=>{if(this.scrollableContainer){let e=this.scrollableContainer.querySelectorAll("div[data-sticky-id]");if(e.length){const t=new Set(Array.from(e).map(e=>e.dataset.stickyId||""));let i=this.scrollableContainer.scrollTop,n=this.scrollableContainer.scrollLeft;t.forEach(e=>{this.itemsInitialState[e]||this.saveFreezeItemsInitialState(e),this.updateFreezeItemsOnScroll(e,i,n)})}}})}saveFreezeItemsInitialState(e){var t,i,n;let r=null===(t=this.placeholder)||void 0===t?void 0:t.querySelectorAll("[data-sticky-direction][data-sticky-id='"+e+"']"),s=null===(i=this.placeholder)||void 0===i?void 0:i.querySelectorAll("[data-reporting-action][data-sticky-id='"+e+"']"),o=null,a=null,l=null,h=null;this.itemsInitialState[e]={},this.freezeBGColor[e]=(null===(n=fe(this.placeholder,"[data-id='"+e+"']"))||void 0===n?void 0:n.dataset.stickyBgColor)||"",r.forEach(t=>{var i;let n=t.dataset.stickyDirection,r=(null===(i=t.dataset.id)||void 0===i?void 0:i.toString())||"",s=t.offsetLeft/this.scaleFactor,c=t.offsetLeft+t.offsetWidth*this.scaleFactor,d=t.offsetTop/this.scaleFactor,u=t.offsetTop+t.offsetHeight*this.scaleFactor,p=(e,t)=>null===e||t<e?t:e,g=(e,t)=>null===e||t>e?t:e;switch(n){case"Vertical":a=p(a,d),h=g(h,u);break;case"Horizontal":o=p(o,s),l=g(l,c)}this._saveFreezeItemInitialState(e,t,r)}),this.freezeMaxZIndex[e]=(null==s?void 0:s.length)?parseInt(getComputedStyle(s[0]).zIndex):this.zIndex,this.yFrozenAreasBounds[e]=(h||0)-(a||0),this.xFrozenAreasBounds[e]=(l||0)-(o||0)}_saveFreezeItemInitialState(e,t,i){const n=getComputedStyle(t);let r=this.hasSetBgColor(n.backgroundColor),s=n.zIndex;"auto"!==s&&(s=parseFloat(s));let o={top:t.offsetTop,left:t.offsetLeft,zIndex:s,hasBgColor:r};this.itemsInitialState[e][i]=o}updateFreezeItemsOnScroll(e,t,i){var n,r;let s=fe(this.placeholder,"div[data-id='"+e+"']");if(!s)return;let o=null===(n=this.placeholder)||void 0===n?void 0:n.querySelectorAll("[data-sticky-direction*='Horizontal'][data-sticky-id='"+e+"']"),a=null===(r=this.placeholder)||void 0===r?void 0:r.querySelectorAll("[data-sticky-direction*='Vertical'][data-sticky-id='"+e+"']");if(this.isInScrollVisibleArea(s)){let n=s.closest(".trv-report-page"),r=getComputedStyle(n),l=parseFloat(r.marginLeft),h=parseFloat(r.paddingTop),c=parseFloat(r.paddingLeft),d=parseFloat(r.borderTopWidth),u=parseFloat(r.borderLeftWidth),p=o.length>0,g=a.length>0,f=s.offsetTop+((null==n?void 0:n.offsetTop)||0)+l+h+d,m=s.offsetLeft+((null==n?void 0:n.offsetLeft)||0)+c+u,v=t-f,P=i-m;g&&v>0?t<=s.offsetHeight*this.scaleFactor+f-this.yFrozenAreasBounds[e]&&(this.currentlyFrozenContainer.vertical[e]=!0,this.updateUIElementsPosition(a,"top",v/this.scaleFactor,e)):this.currentlyFrozenContainer.vertical[e]&&(delete this.currentlyFrozenContainer.vertical[e],this.updateUIElementsPosition(a,"top",-1,e)),p&&P>0?i<=s.offsetWidth*this.scaleFactor+m-this.xFrozenAreasBounds[e]&&(this.currentlyFrozenContainer.horizontal[e]=!0,this.updateUIElementsPosition(o,"left",P/this.scaleFactor,e)):this.currentlyFrozenContainer.horizontal[e]&&(delete this.currentlyFrozenContainer.horizontal[e],this.updateUIElementsPosition(o,"left",-1,e))}else(this.currentlyFrozenContainer.horizontal[e]||this.currentlyFrozenContainer.vertical[e])&&this.resetToDefaultPosition(e,o,a)}resetToDefaultPosition(e,t,i){this.updateUIElementsPosition(i,"top",-1,e),this.updateUIElementsPosition(t,"left",-1,e),delete this.currentlyFrozenContainer.horizontal[e],delete this.currentlyFrozenContainer.vertical[e]}
1963updateUIElementsPosition(e,t,i,n){e.forEach(e=>{let r=(e.dataset.stickyDirection||"").indexOf(",")>0,s=e.dataset.id||"",o=this.itemsInitialState[n][s],a="top"==t?o.top:o.left,l=o.zIndex,h=o.hasBgColor,c=1,d=this.freezeMaxZIndex[n]?this.freezeMaxZIndex[n]:c;c=r?"auto"!==l?l:d+2:"auto"!==l?l+1:d;let u={zIndex:c};i>=0?a+=i:u.zIndex=l,h||this.applyBgColorOnScroll(e,r,h,i>=0,n),u[t]=a+"px",Object.assign(e.style,u)})}applyBgColorOnScroll(e,t,i,n,r){"IMG"!==e.tagName&&(t&&this.isFrozen(r)&&!i?e.style.backgroundColor=this.freezeBGColor[r]:e.style.backgroundColor=n?this.freezeBGColor[r]:"initial")}hasSetBgColor(e){return ue(e)>0}isFrozen(e){return this.currentlyFrozenContainer.horizontal[e]||this.currentlyFrozenContainer.vertical[e]}isInScrollVisibleArea(e){if(!this.scrollableContainer)return!1;const t=e.getBoundingClientRect(),i=this.scrollableContainer.getBoundingClientRect();return this.isVisibleVertically(t,this.scrollableContainer,i)&&this.isVisibleHorizontally(t,this.scrollableContainer,i)}isVisibleVertically(e,t,i){let n=e.width;return e.left>t.scrollLeft-n&&e.left<t.scrollLeft+n+i.width}isVisibleHorizontally(e,t,i){let n=e.height;return e.top>t.scrollTop-n&&e.top<t.scrollTop+n+i.height}}const $e=/{(\w+?)}/g,Be="trv-initial-image-styles";function qe(e,t){let i=Array.isArray(t);return e?e.replace($e,function(e,n){return t[i?parseInt(n):n]}):""}const We="trv-search-dialog-shaded-result",Ze="trv-search-dialog-highlighted-result";e.BasicAuth=w,e.BookmarkNode=class{constructor(){this.id="",this.text="",this.page=0,this.items=null}},e.ConnectionConfig=T,e.ConnectionConfigNoAuth=R,e.ConnectionConfigServerCredentials=E,e.ConnectionConfigServerNoAuth=A,e.ConnectionConfigServerToken=M,e.ContentArea=class{constructor(e,t,i,n={}){this.actions=[],this.pendingElement=null,this.documentReady=!0,this.reportPageIsLoaded=!1,this.navigateToPageOnDocReady=0,this.navigateToElementOnDocReady=null,this.onClickHandler=null,this.onMouseEnterHandler=null,this.onMouseLeaveHandler=null,this.isNewReportSource=!1,this.uiFreezeCoordinator=null,this.initialPageAreaImageUrl="",this.showPageAreaImage=!1,this.placeholder=e.querySelector(".trv-pages-pane, .trv-pages-area"),this.pageContainer=e.querySelector(".trv-page-container"),this.pageWrapper=e.querySelector(".trv-page-wrapper"),this.parametersContainer=e.querySelector(".trv-parameters-area"),this.notification=e.querySelector(".trv-notification, .trv-error-pane"),this.scrollManager=new He(this.placeholder,this,t),this.resizeService=new ze(this.pageContainer),this.resizeService.on("resize",this.onResize.bind(this)),this.controller=t,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("printDocumentReady",this.onPrintDocumentReady.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)).on("showNotification",this.onShowNotification.bind(this)),this.messages=i,this.enableAccessibility=n.enableAccessibility||!1,this.initialPageAreaImageUrl=n.initialPageAreaImageUrl||""}destroy(){this.resizeService&&this.resizeService.destroy()}onResize(){this.shouldAutosizePage()&&this.updatePageDimensions()}onPageReady(t){this.controller.getPageMode()===e.PageMode.SinglePage?(this.scrollManager.getEnabled()&&this.scrollManager.disable(),this.setPageContent(t)):this.scrollManager.renderPage(t),this.navigateToElement(this.pendingElement,t.pageNumber),this.reportPageIsLoaded||(this.reportPageIsLoaded=!0),this.showPageAreaImage&&this.clearPageAreaImage(),this.controller.getViewMode()===e.ViewMode.Interactive&&null!==this.uiFreezeCoordinator&&this.uiFreezeCoordinator.init(this.placeholder),this.disablePagesArea(!1)}onServerActionStarted(){this.disablePagesArea(!0),this.disableParametersArea(!0),this.showNotification(this.messages.ReportViewer_LoadingReport)}onReportSourceChanged(){this.isNewReportSource=!0,this.navigateToPageOnDocReady=0,this.navigateToElementOnDocReady=null,this.documentReady=!1}onNoReport(){this.disablePagesArea(!1),this.disableParametersArea(!1),this.clearPage(),this.showNotification(this.messages.ReportViewer_NoReport)}onBeforeLoadReport(){this.documentReady=!1,this.navigateToPageOnDocReady||(this.navigateToPageOnDocReady=1),this.clearPendingTimeoutIds(),this.clear(),this.disablePagesArea(!0),this.disableParametersArea(!0),this.showNotification(this.messages.ReportViewer_LoadingReport)}onBeginLoadReport(){this.documentReady=!0,this.invalidateCurrentlyLoadedPage()}onReportLoadProgress(e){this.navigateWhenPageAvailable(this.navigateToPageOnDocReady,e.pageCount),this.showNotification(qe(this.messages.ReportViewer_LoadingReportPagesInProgress,[e.pageCount]))}onReportLoadComplete(t){0===t.pageCount?(this.clearPage(),this.showNotification(this.messages.ReportViewer_NoPageToDisplay)):(this.navigateOnLoadComplete(this.navigateToPageOnDocReady,t.page
1963Count),this.showNotification(qe(this.messages.ReportViewer_LoadedReportPagesComplete,[t.pageCount])),this.showNotificationTimeoutId=window.setTimeout(this.hideNotification.bind(this),2e3),this.disableParametersArea(!1),this.enableInteractivity()),t.containsFrozenContent&&null===this.uiFreezeCoordinator&&(this.uiFreezeCoordinator=new Ue,this.controller.getViewMode()===e.ViewMode.Interactive&&this.uiFreezeCoordinator.init(this.placeholder))}onReportAutoRunOff(){this.disableParametersArea(!1),this.showNotification(this.messages.ReportViewer_AutoRunDisabled||"Please validate the report parameter values and press Preview to generate the report.")}onRenderingStopped(){this.clear(!0),this.disableParametersArea(!1),this.showError(this.messages.ReportViewer_RenderingCancelled)}onMissingOrInvalidParameters(){this.initialPageAreaImageUrl&&!this.reportPageIsLoaded&&(this.clearPage(),this.setPageAreaImage())}onShowNotification(e){this.showNotification(e)}onError(e,t=!0){t&&(this.disablePagesArea(!1),this.disableParametersArea(!1),this.clearPage()),this.showError(e)}clearPendingTimeoutIds(){this.showNotificationTimeoutId&&window.clearTimeout(this.showNotificationTimeoutId)}invalidateCurrentlyLoadedPage(){let e=this.findPage(this.navigateToPageOnDocReady);e&&this.setPageNo(e,-1)}navigateWhenPageAvailable(e,t){e&&e<=t&&this.navigateToPage(e,this.navigateToElementOnDocReady)}navigateOnLoadComplete(e,t){e&&(e=Math.min(e,t),this.navigateToPage(e,this.navigateToElementOnDocReady))}clearPage(){this.clear(this.isNewReportSource),this.isNewReportSource=!1}shouldAutosizePage(){let t=this.controller.getScaleMode();return t===e.ScaleMode.FitPage||t===e.ScaleMode.FitPageWidth}onPrintDocumentReady(){this.hideNotification()}onExportDocumentReady(){this.hideNotification()}updatePageDimensions(){let e=this.pageContainer.querySelectorAll(".trv-report-page");for(let t of Array.from(e)){let e=t,i=parseInt(e.dataset.page||"");this.setPageDimensions(e,i)}this.scrollManager.updatePageDimensionsReady()}clear(e=!1){this.disableInteractivity(),this.pendingElement=null,e&&(this.pageWrapper.innerHTML=""),this.hideNotification()}findPage(t){let i=this.pageContainer.querySelectorAll(".trv-report-page");if(this.controller.getPageMode()===e.PageMode.SinglePage)for(let e of Array.from(i)){let i=e;if(this.pageNo(i)===t)return i}else for(let e of Array.from(i)){let i=e;if(parseInt((null==i?void 0:i.dataset.page)||"-1")===t)return i}return null}navigateToPage(e,t){this.documentReady?this.navigateToPageCore(e,t):this.navigateToPageOnDocumentReady(e,t)}navigateToPageOnDocumentReady(e,t){this.navigateToPageOnDocReady=e,this.navigateToElementOnDocReady=t}navigateToPageCore(e,t){let i=this.findPage(e);i?(t&&this.navigateToElement(t,e),this.scrollManager.getEnabled()&&!t&&this.scrollManager.navigateToElement(i.offsetTop,e)):(this.pendingElement=t,this.beginLoadPage(e))}navigateToElement(e,t=0){var i;if(e){let n=this.pageContainer.querySelector(`[data-${e.type}-id='${e.id}']`);if(n){if(this.enableAccessibility){let e=this.findNextFocusableElement(n);e&&e.focus()}let e=0,i=0;for(;n&&n!==this.pageContainer;){if(se(n,"trv-page-wrapper")){let t=n.dataset.pageScale;if("string"==typeof t){let n=parseFloat(t);e*=n,i*=n}}e+=n.offsetTop,i+=n.offsetLeft,n=oe(n)}this.scrollManager.getEnabled()&&t?this.scrollManager.navigateToElement(e,t):(this.pageContainer.scrollTop=e,this.pageContainer.scrollLeft=i)}else this.scrollManager.getEnabled()&&t&&this.scrollManager.navigateToElement((null===(i=this.placeholder)||void 0===i?void 0:i.querySelector('[data-page="'+t+'"]')).offsetTop,t)}}findNextFocusableElement(e){if(!e)return null;let t=e.tabIndex;return!isNaN(t)&&t>-1?e:this.findNextFocusableElement(e.nextElementSibling)}disablePagesArea(e){e?ne(this.placeholder,"trv-loading"):re(this.placeholder,"trv-loading")}disableParametersArea(e){var t,i;e?null===(t=this.parametersContainer)||void 0===t||t.setAttribute("disabled",""):null===(i=this.parametersContainer)||void 0===i||i.removeAttribute("disabled")}showError(e=""){this.showNotification(e,"error")}showNotification(e="",t="info"){let i=this.notification.dataset.type;i&&re(this.notification,`k-notification-${i}`),this.notification.dataset.type=t;let n=this.notification.querySelector(".k-notification-content, .trv-error-message"),r=null==e?void 0:e.split(/\r?\n/);n.innerHTML=r&&r.length?`${r.join("<br>")}`:"Notification message not found.",ne(this.notification,`k-notification-${t}`),re(this.notification,"k-hidden")}hideNotification(){let e=String(this.notification.dataset.type);delete this.notification.dataset.type,re(this.notification,`k-notification-${e}`),ne(this.notification,"k-hidden")}pageNo(e){var t;return parseInt((null===(t=e.parentElement)||void 0===t?void 0:t.dataset.pageNumber)||"0")}setPageNo(e,t){e.parentElement&&(e.parentElement.dataset.pageNumber=t.toString())}beginLoadPage(e){this.disablePagesArea(!0),window.setTimeout(this.controller.getReportPage.bind(this.controller,e),1),this.navigateToPageOnDocReady=0}setPageDimensions(t,i=0){let n=i?t:t.querySelector("div.trv-report-page");if(!n)return;let r,s=n.querySelector("div.sheet"),o=n.querySelector("div.trv-skeleton-wrapper");if(s=s||o,!s)return;if(n.dataset.box)r=JSON.parse(n.dataset.box);else{let e=getComputedStyle(n),i=getComputedStyle(t);r={padLeft:ae(i.marginLeft)+ae(e.borderLeftWidth)+ae(e.paddingLeft),padRight:ae(i.marginRight)+ae(e.borderRightWidth)+ae(e.paddingRight),padTop:ae(i.marginTop)+ae(e.borderTopWidth)+ae(e.paddingTop),padBottom:ae(i.marginBottom)+ae(e.borderBottomWidth)+ae(e.paddingBottom)},n.dataset.box=JSON.stringify(r)}let a=s.offsetWidth,l=s.offsetHeight;if(0===a){const e=getComputedStyle(s);a=parseInt(e.width),l=parseInt(e.height)}const h=this.controller.getScaleMode(),c=l>a&&h===e.ScaleMode.FitPageWidth?20:0,d=(this.pageContainer.clientWidth-c-r.padLeft-r.padRight)/a,u=(this.pageContainer.clientHeight-1-r.padTop-r.padBottom)/l;let p=this.controller.getScale();h===e.ScaleMode.FitPageWidth?p=d:p&&h!==e.ScaleMode.FitPage||(p=Math.min(d,u)),null!==this.uiFreezeCoordinator&&this.uiFreezeCoordinator.setScaleFactor(p),t.dataset.pageScale=p.toString(),n.dataset.pageScale=p.toString(),o||le(s,p,p),n.style.height=p*l+"px",n.style.width=p*a+"px",this.controller.setScale(p,!0)}enableInteractivity(){this.disableInteractivity(),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,!0),this.pageContainer.addEventListener("mouseleave",this.onMouseLeaveHandler,!0)}disableInteractivity(){this.onClickHandler&&(this.pageContainer.removeEventListener("click",this.onClickHandler),this.onClickHandler=null),this.onMouseEnterHandler&&(this.pageContainer.removeEventListener("mouseenter",this.onMouseEnterHandler,!0),this.onMouseEnterHandler=null),this.onMouseLeaveHandler&&(this.pageContainer.removeEventListener("mouseleave",this.onMouseLeaveHandler,!0),this.onMouseLeaveHandler=null)}onClick(e){let t=e.target.closest("[data-reporting-action]");
1963t&&this.onInteractiveItemClick(t,e)}onMouseEnter(e){let t=e.target,i=t.dataset;i.reportingAction&&this.onInteractiveItemEnter(t),(i.tooltipTitle||i.tooltipText)&&this.onToolTipItemEnter(t,e)}onMouseLeave(e){let t=e.target,i=t.dataset;i.reportingAction&&this.onInteractiveItemLeave(t),(i.tooltipTitle||i.tooltipText)&&this.onToolTipItemLeave(t)}onInteractiveItemClick(e,t){var i;let n=(null===(i=e.dataset.reportingAction)||void 0===i?void 0:i.toString())||"",r=this.getAction(n);r&&(this.navigateToPageOnDocReady=this.getNavigateToPageOnDocReady(t,r.Type),this.controller.executeReportAction(new l(e,r))),t.stopPropagation()}onInteractiveItemEnter(e){var t;let i=(null===(t=e.dataset.reportingAction)||void 0===t?void 0:t.toString())||"",n=this.getAction(i);n&&this.controller.reportActionEnter(new l(e,n))}onInteractiveItemLeave(e){var t;let i=(null===(t=e.dataset.reportingAction)||void 0===t?void 0:t.toString())||"",n=this.getAction(i);n&&this.controller.reportActionLeave(new l(e,n))}onToolTipItemEnter(e,t){let i=e.dataset.tooltipTitle,n=e.dataset.tooltipText;(i||n)&&this.controller.reportTooltipOpening(new P(e,n||"",i||"",t))}onToolTipItemLeave(e){this.controller.reportTooltipClosing(new P(e,"","",null))}getNavigateToPageOnDocReady(e,t){var i;return!this.scrollManager.getEnabled()||"sorting"!==t&&"toggleVisibility"!==t?this.controller.getCurrentPageNumber():(null===(i=e.target.closest(".trv-report-page"))||void 0===i?void 0:i.dataset.page)||this.controller.getCurrentPageNumber()}getAction(e){if(this.actions){let t=this.actions.find(t=>t.Id===e);if(t)return t}return null}updatePageStyle(e){var t;let i="trv-"+this.controller.getClientId()+"-styles";null===(t=document.getElementById(i))||void 0===t||t.remove();let n=ie("style",i);this.applyNonce(n),n.innerHTML=e.pageStyles,document.head.appendChild(n)}setPageContent(e){this.actions=e.pageActions,this.updatePageStyle(e);let t=this.renderPageElement(e);this.pageWrapper.dataset.pageNumber=e.pageNumber.toString(),this.pageWrapper.innerHTML="",this.pageWrapper.append(t),this.controller.setCurrentPageNumber(e.pageNumber),this.controller.applySearchColors(),this.applyPlaceholderViewModeClass(),this.setPageDimensions(this.pageWrapper),this.pageContainer.scrollTop=0,this.pageContainer.scrollLeft=0}setScrollablePage(e,t){this.actions&&this.actions.length?this.actions=this.actions.concat(t.pageActions):this.actions=t.pageActions,this.applyPlaceholderViewModeClass(),this.setPageDimensions(e,t.pageNumber)}renderPageElement(e){let t=ie("div");t.innerHTML=e.pageContent;let i=t.querySelector("div.sheet");i.style.margin="0";let n=ie("div","","trv-report-page");return n.dataset.page=e.pageNumber.toString(),n.append(i),n.append(ie("div","","k-overlay trv-overlay trv-page-overlay")),n}applyPlaceholderViewModeClass(){this.controller.getViewMode()===e.ViewMode.Interactive?(re(this.placeholder,"printpreview"),ne(this.placeholder,"interactive")):(re(this.placeholder,"interactive"),ne(this.placeholder,"printpreview"))}applyNonce(e){const t=this.controller.getNonce();t&&e.setAttribute("nonce",t)}setPageAreaImage(){this.clearPageAreaImage();let e=ie("style",Be);this.applyNonce(e),e.innerHTML=qe('.trv-page-container {background: #ffffff url("{0}") no-repeat center 50px}',[this.initialPageAreaImageUrl]),document.head.appendChild(e),this.showPageAreaImage=!0}clearPageAreaImage(){var e;null===(e=document.getElementById(Be))||void 0===e||e.remove()}},e.CurrentPageChangedEventArgs=v,e.DeviceInfo=o,e.DocumentInfo=class{constructor(){this.documentReady=!1,this.documentMapAvailable=!1,this.containsFrozenContent=!1,this.pageCount=0,this.documentMapNodes=[],this.bookmarkNodes=[],this.renderingExtensions=[],this.autoRunEnabled=!0}},e.DocumentMapNode=class{constructor(){this.id="",this.isExpanded=!1,this.label="",this.text="",this.page=0,this.items=[]}},e.EmailInfo=a,e.ExportDocumentReadyEventArgs=u,e.ExportStartEventArgs=c,e.ExportStartedEventArgs=d,e.KeepClientAliveSentinel=K,e.NoAuth=b,e.PageAction=class{constructor(){this.Id="",this.ReportItemName="",this.Type="",this.Value={}}},e.PageActionEventArgs=l,e.PageInfo=class{constructor(){this.pageNumber=0,this.pageReady=!1,this.pageStyles="",this.pageContent="",this.pageActions=[]}},e.PageTargetElement=h,e.ParameterInfo=class{constructor(){this.name="",this.type="",this.text="",this.multivalue=!1,this.allowNull=!1,this.allowBlank=!1,this.isVisible=!1,this.autoRefresh=!1,this.hasChildParameters=!1,this.childParameters=[],this.availableValues=[],this.value="",this.id="",this.label=""}}
1963,e.ParameterValidators=De,e.ParameterValue=class{constructor(){this.name="",this.value=null}},e.PersonalTokenAuth=L,e.PrintDocumentReadyEventArgs=g,e.PrintStartedEventArgs=p,e.RenderingExtension=class{constructor(){this.name="",this.localizedName=""}},e.ReportController=class extends q{constructor(e,t){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=!1,this.cancelLoad=!1,this.searchInitiated=!1,this.aiPromptInitiated=!1,this.contentTabIndex=0,this.respectAutoRun=!0,this.processedParameterValues={},this.options=t,t.reportSource&&this.setParameters(t.reportSource.parameters),this.printManager=new G,this.serviceClient=e,t.authenticationToken&&this.serviceClient.setAccessToken(t.authenticationToken)}get autoRunEnabled(){var e=!this.parameterValues||!("trv_AutoRun"in this.parameterValues)||this.parameterValues.trv_AutoRun;return!this.respectAutoRun||e}destroy(){this.printManager&&this.printManager.destroy()}setOptions(e){this.clearReportState(),this.clearClientId(),this.options=e,this.options.reportSource&&this.setParameters(this.options.reportSource.parameters)}setAuthenticationToken(e){this.serviceClient.setAccessToken(e)}getNonce(){return this.options.nonce}init(){this.refreshReport(!0,"")}getServiceVersion(){return this.serviceClient.getServiceVersion()}getServiceConfiguration(){return this.serviceClient.getServiceConfiguration()}stopRendering(){this.serviceClient.deleteReportDocument(this.clientId,this.reportInstanceId,this.documentId).catch(e=>{this.handleRequestError(e)}).then(()=>{this.cancelLoad=!0,this.resetPageNumbers(),this.emit("renderingStopped")})}refreshReport(e,t,i=!1,n=!1){if(n||this.emit("loadedReportChange"),this.cancelLoad=!1,this.respectAutoRun=i||this.respectAutoRun,this.clientHasExpired&&(this.clientHasExpired=!1,this.clearClientId()),""==this.getReport())return void this.emit("noReport");let r=this.loadParameters();r.then(i=>{this.emit("parametersLoaded",i);this.processParameters(i)||n||(this.autoRunEnabled?this.refreshReportCore(e,t):this.emitAsync("reportAutoRunOff"))}),this.emit("reloadParameters",r)}processParameters(e){let t={},i=[],n=!1;for(let r of e)try{let e=De.validate(r,r.value);t[r.id]=e}catch(e){n=!0,i.push(r)}return n?this.missingOrInvalidParameters(i):this.setParameters(t),n}allParametersAutoRefresh(e){if(!e||!e.length)return!0;return Array.from(e).every(e=>!e.isVisible||e.autoRefresh)}allParametersValidForAutoRefresh(e,t){let i=!0;for(let n=e.length-1;i&&n>=0;n--){let r=e[n];i=r.id in t&&(Boolean(r.autoRefresh)||!r.isVisible)}return i}hasInvalidParameter(e){for(const t of e)try{De.validate(t,t.value)}catch(e){return!0}return!1}refreshReportCore(e,t="",i=""){this.loadReport(e,t,i)}navigateToPage(e,t){this.emit("navigateToPage",e,t)}getReportDocumentId(){return this.documentId}setReportDocumentId(e){this.documentId=e}getReportPage(e){this.getPage(e).then(this.onPageReady.bind(this))}getPageData(e){return this.getPage(e)}setParameters(e){this.parameterValues=e}setParameter(e,t){this.parameterValues[e]=t}getReportSource(){var e;return new Oe(null===(e=this.options.reportSource)||void 0===e?void 0:e.report,this.parameterValues)}setReportSource(e){this.options.reportSource=e,this.setParameters(this.options.reportSource.parameters),this.emit("reportSourceChanged",e)}previewReport(){this.emit("loadedReportChange"),this.respectAutoRun=!1,this.refreshReportCore(!1)}getClientId(){return this.clientId}getScale(){return this.options.scale}setScale(e,t=!1){e!==this.options.scale&&(this.options.scale=e,t||this.emit("scaleChanged",e))}getScaleMode(){return this.options.scaleMode}setScaleMode(e){e!==this.options.scaleMode&&(this.options.scaleMode=e,this.emit("scaleModeChanged",e))}getViewMode(){return this.options.viewMode}setViewMode(e){this.options.viewMode!==e&&(this.options.viewMode=e,this.options.reportSource&&this.emit
1963("viewModeChanged",e))}getPageMode(){return this.options.pageMode}setPageMode(e){this.options.pageMode!==e&&(this.options.pageMode=e,this.options.reportSource&&this.emit("pageModeChanged",e))}getPrintMode(){return this.options.printMode}setPrintMode(e){this.options.printMode!==e&&(this.options.printMode=e,this.emit("printModeChanged",e))}getCurrentPageNumber(){return this.currentPageNumber}setCurrentPageNumber(e){this.currentPageNumber!==e&&(this.currentPageNumber=e,this.emit("currentPageChanged",new v(e,this.documentId)))}getPageCount(){return this.pageCount}applySearchColors(){this.emit("applySearchColors")}executeReportAction(e){let t=e.action;window.setTimeout(()=>s(this,void 0,void 0,function*(){try{yield this.emitAsync("interactiveActionExecuting",e),this.emit("interactiveActionExecuting",e)}catch(e){return void this.raiseError(e instanceof Error?e.message:String(e))}if(!e.cancel)if("navigateToReport"===t.Type){this.emit("serverActionStarted");let e=t.Value,i=this.fixDataContractJsonSerializer(e.ParameterValues);this.respectAutoRun=!0,this.emit("navigateToReport",new Oe(e.Report,i))}else if("navigateToBookmark"===t.Type){let e=this.getPageForBookmark(this.bookmarkNodes,t.Value),i=new h(t.Value,"bookmark");this.navigateToPage(e,i)}else if("sorting"===t.Type)this.execServerAction(t.Id);else if("toggleVisibility"===t.Type)this.execServerAction(t.Id);else if("navigateToUrl"===t.Type){let e=t.Value;window.open(e.Url,e.Target)}else t.Type}),0)}reportActionEnter(e){this.emit("interactiveActionEnter",e)}reportActionLeave(e){this.emit("interactiveActionLeave",e)}reportTooltipOpening(e){return s(this,void 0,void 0,function*(){try{yield this.emitAsync("toolTipOpening",e),this.emit("toolTipOpening",e)}catch(e){this.raiseError(e instanceof Error?e.message:String(e))}})}reportTooltipClosing(e){this.emit("toolTipClosing",e)}printReport(){return s(this,void 0,void 0,function*(){let e=this.createDeviceInfo();e.ImmediatePrint=!0;let t=new p(e);yield this.emitAsync("printStarted",t),this.emit("printStarted",t),t.handled||(this.showNotification(this.options.messages.ReportViewer_PreparingPrint),this.setUIState("PrintInProgress",!0),this.exportAsync("PDF",t.deviceInfo).then(e=>s(this,void 0,void 0,function*(){let t=this.serviceClient.getDocumentUrl(this.clientId,this.reportInstanceId,e);t+=`?${"response-content-disposition="+(this.getCanUsePlugin()?"inline":"attachment")}`;let i=new g(t);yield this.emitAsync("printDocumentReady",i),this.emit("printDocumentReady",i),this.setUIState("PrintInProgress",!1),i.handled||this.printManager.print(t,this.getReportFileName())})))})}exportReport(e){return s(this,void 0,void 0,function*(){let t=this.createDeviceInfo(),i=new c(t,e);if(yield this.emitAsync("exportStart",i),!i.isCancelled){let t=new d(i.deviceInfo,i.format);if(yield this.emitAsync("exportStarted",t),this.emit("exportStarted",t),t.handled)return;this.showNotification(this.options.messages.ReportViewer_PreparingDownload),this.setUIState("ExportInProgress",!0),this.exportAsync(t.format,t.deviceInfo).then(t=>s(this,void 0,void 0,function*(){let i=this.serviceClient.getDocumentUrl(this.clientId,this.reportInstanceId,t);i+="?response-content-disposition=attachment";let n=new u(i,e,"_self");yield this.emitAsync("exportEnd",n),yield this.emitAsync("exportDocumentReady",n),this.emit("exportDocumentReady",n),this.setUIState("ExportInProgress",!1),n.handled||window.open(i,n.windowOpenTarget)}))}})}sendReport(e){return s(this,void 0,void 0,function*(){let t=this.createDeviceInfo(),i=new f(t,e.format);yield this.emitAsync("sendEmailStarted",i),this.emit("sendEmailStarted",i),i.handled||this.exportAsync(e.format,i.deviceInfo).then(t=>s(this,void 0,void 0,function*(){let n=this.serviceClient.getDocumentUrl(this.clientId,this.reportInstanceId,t);n+="?response-content-disposition=attachment";let r=new m(e,i.deviceInfo,n);yield this.emitAsync("sendEmailDocumentReady",r),this.emit("sendEmailDocumentReady",r),r.handled||this.sendDocumentAsync(t,r)}))})}getSearchResults(e){return this.serviceClient.getSearchResults(this.clientId,this.reportInstanceId,this.documentId,e).catch(this.handleSearchRequestError.bind(this)).then(e=>e||[])}createAIThread(){return this.serviceClient.createAIThread(this.clientId,this.reportInstanceId,this.getReport(),this.parameterValues).catch(e=>this.raiseError(e.exceptionMessage,!1)).then(e=>{if(this.threadId=(null==e?void 0:e.threadId)||"",e.consentMessage&&(e.consentMessage=r.default.sanitize(e.consentMessage,{USE_PROFILES:{html:!0}}),r.default.removed&&r.default.removed.length>0&&console.warn("The AI-Powered Insights consent message was sanitized as it contained potentially malicious HTML elements or attributes.")),e.predefinedPrompts)for(let t=0;t<e.predefinedPrompts.length;t++)e.predefinedPrompts[t]=r.default.sanitize(e.predefinedPrompts[t],{USE_PROFILES:{html:!0}}),r.default.removed&&r.default.removed.length>0&&console.warn("An AI-Powered Insights predefined prompt was sanitized as it contained potentially malicious HTML elements or attributes.");return e})}getAIResponse(e){return this.serviceClient.getAIResponse(this.clientId,this.reportInstanceId,this.documentId,this.threadId,e).then(e=>e||"")}exportAsync(e,t){return this.initializeClient().then(this.registerInstance.bind(this)).then(()=>this.registerDocumentAsync(e,t,!1,this.documentId)).then(e=>s(this,void 0,void 0,function*(){return yield this.getDocumentInfo(!1,e).cat
1963ch(e=>this.raiseError(e)),e}))}sendDocumentAsync(e,t){return this.serviceClient.sendDocument(this.clientId,this.reportInstanceId,e,t).catch(e=>{this.handleRequestError(e,be(this.options.messages.ReportViewer_ErrorSendingDocument,he(this.getReport())))})}loadParameters(e=void 0){return this.initializeClient().then(this.getParameters.bind(this,e))}loadReport(e,t,i){this.clearReportState();const n=this.getFormat(),r=this.createPreviewDeviceInfo();this.emitAsync("beforeLoadReport",{deviceInfo:r}).then(()=>this.initializeClient()).then(this.registerInstance.bind(this)).then(()=>this.registerDocumentAsync(n,r,e,t,i)).then(e=>(this.documentId=e,this.getDocumentInfo(!0,this.documentId))).then(this.onReportLoadComplete.bind(this)).catch(e=>this.raiseError(e))}initializeAndStartSentinel(){this.options.keepClientAlive&&this.clientId&&this.serviceClient.getClientsSessionTimeoutSeconds().then(e=>{this.keepClientAliveSentinel=new K(this.serviceClient,this.clientId,e),this.keepClientAliveSentinel.start()})}stopSentinel(){null!=this.keepClientAliveSentinel&&this.keepClientAliveSentinel.stop()}setClientId(e){this.clientId=e||"",this.stopSentinel(),this.emit("clientIdChanged",this.clientId),this.initializeAndStartSentinel()}clearClientId(){this.clientId="",this.registerClientPromise=null,this.stopSentinel(),this.keepClientAliveSentinel=null,this.emit("clientIdChanged",this.clientId)}setReportInstanceId(e){this.reportInstanceId=e}clearReportInstanceId(){this.reportInstanceId="",this.registerInstancePromise=null}clearReportState(){this.cancelLoad=!1,this.documentId="",this.resetPageNumbers(),this.clearReportInstanceId()}resetPageNumbers(){this.pageCount=0,this.currentPageNumber=0}handleSearchRequestError(e){if(!Ce(e,"System.ArgumentException"))throw this.handleRequestError(e,"",!0),null;this.throwPromiseError(e)}throwPromiseError(e){throw e.exceptionMessage?e.exceptionMessage:this.options.messages.ReportViewer_PromisesChainStopError}handleRequestError(e,t="",i=!1){ye(e)&&this.onClientExpired();let n=Ie(e.error)?"":e.error,r=this.formatRequestError(e,n,t);this.raiseError(r),i||this.throwPromiseError(e)}formatRequestError(e,t,i){let n=e.responseJSON,r="";if(n){if(401==n.status||403==n.status)return this.options.messages.ReportViewer_ErrorUnauthorizedOrForbidden||"You don't have permission to access this report document.";if(Se(e))return this.options.messages.ReportViewer_MissingOrInvalidParameter;r=he(n.message);let t=he(n.exceptionMessage||n.ExceptionMessage||n.error_description);t&&(r?r+=" "+t:r=t)}else r=he(e.responseText);return(i||t)&&(r&&(r=" "+r),r=he(i||t)+r),ye(e)&&(r+="<br />"+this.options.messages.ReportViewer_ClientExpired),r}raiseError(e,t=!0){this.emit("error",e,t)}showNotification(e){this.emit("showNotification",e)}onClientExpired(){this.clientHasExpired=!0,this.emit("clientExpired")}initializeClient(){return this.registerClientPromise||(this.registerClientPromise=this.serviceClient.registerClient().catch(e=>{const t=be(this.options.messages.ReportViewer_ErrorServiceUrl,[this.serviceClient.getServiceUrl()]);this.handleRequestError(e,t)}).then(this.setClientId.bind(this)).catch(this.clearClientId.bind(this))),this.registerClientPromise}registerInstance(){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}registerDocumentAsync(e,t,i){return s(this,arguments,void 0,function*(e,t,i,n="",r=""){return(yield this.serviceClient.createReportDocument(this.clientId,this.reportInstanceId,e,t,!i,n,r).catch(t=>{this.handleRequestError(t,be(this.options.messages.ReportViewer_ErrorCreatingReportDocument,he(this.getReport()),he(e)))}))||""})}getFormat(){return this.options.viewMode===e.ViewMode.PrintPreview?"HTML5":"HTML5Interactive"}getCanUsePlugin(){switch(this.options.printMode){case e.PrintMode.ForcePDFFile:return!1;case e.PrintMode.ForcePDFPlugin:return!0;default:return this.printManager.getDirectPrintState()}}getReportFileName(){var e,t,i,n;const r=(null!==(i=(null!==(t=null===(e=this.options.reportSource)||void 0===e?void 0:e.report)&&void 0!==t?t:"").split(",")[0].trim().split(/[/\\]/).pop())&&void 0!==i?i:"").replace(/\.(trdp|trdx|trl)$/i,"");return(r.includes(".")&&null!==(n=r.split(".").pop())&&void 0!==n?n:r)||"report"}createPreviewDeviceInfo(){let e=this.createDeviceInfo();return e.ContentOnly=!0,e.UseSVG=!0,e}createDeviceInfo(){let e=new o;this.options.enableAccessibility&&(e.enableAccessibility=!0,e.contentTabIndex=this.getContentTabIndex());let t=this.getSearchInitiated(),i=this.options.searchMetadataOnDemand;return e.enableSearch=!i||t,e}getParameters(e){return this.serviceClient.getParameters(this.clientId,this.getReport(),e||this.parameterValues).catch(e=>{this.handleRequestError(e,this.options.messages.ReportViewer_UnableToGetReportParameters)})}getReportParameters(){if(!this.parameterValues)return{};const e={},t=this.getProcessedParameterValues();for(let i in t){const n=t[i],r=this.parameterValues[i];n&&n.availableValues?n.multivalue?e[i]=Fe(n,r,i):e[i]=Ve(n,r,i):e[i]=r}return e}setProcessedParameterValues(e){this.processedParameterValues=e}getProcessedParameterValues(){return this.processedParameterValues}
1963getDocumentInfo(t,i){return t&&this.emit("beginLoadReport"),new Promise((n,r)=>{let o=()=>s(this,void 0,void 0,function*(){this.cancelLoad?r(this.options.messages.ReportViewer_RenderingCancelled):(yield this.registerInstancePromise,this.serviceClient.getDocumentInfo(this.clientId,this.reportInstanceId,i).then(i=>{i&&i.documentReady?n(i):(t&&(this.getPageMode()===e.PageMode.ContinuousScroll&&i.pageCount>this.pageCount&&this.emit("pageLoaded"),this.pageCount=i.pageCount,this.emit("reportLoadProgress",i)),window.setTimeout(o,500))}).catch(e=>{"InvalidDocumentException"!==e.responseJSON.exceptionType?this.handleRequestError(e,"",!0):console.warn("getDocumentInfo failed or was canceled by the user: "+e.exceptionMessage)}))});o()})}getPage(e){return new Promise(t=>{let i=()=>{this.serviceClient.getPage(this.clientId,this.reportInstanceId,this.documentId,e).then(e=>{e.pageReady?t(e):window.setTimeout(i,500)}).catch(e=>this.handleRequestError(e))};i()})}getPageForBookmark(e,t){if(e)for(let i=0,n=e.length;i<n;i++){let n=e[i];if(n.id===t)return n.page;let r=this.getPageForBookmark(n.items,t);if(r)return r}return 0}fixDataContractJsonSerializer(e){let t={};return Array.isArray(e)&&e.forEach(function(e){t[e.Key]=e.Value}),t}execServerAction(e){this.emit("serverActionStarted"),this.refreshReportCore(!1,this.documentId,e)}onReportLoadComplete(e){this.bookmarkNodes=e.bookmarkNodes,this.pageCount=e.pageCount,this.renderingExtensions=e.renderingExtensions,this.emitAsync("reportLoadComplete",e)}onPageReady(e){this.emit("pageReady",e)}getReport(){var e;return(null===(e=this.options.reportSource)||void 0===e?void 0:e.report)||""}getDocumentFormats(){return this.renderingExtensions?Promise.resolve(this.renderingExtensions):(this.documentFormatsPromise||(this.documentFormatsPromise=this.serviceClient.getDocumentFormats().catch(e=>{this.handleRequestError(e)})),this.documentFormatsPromise)}setUIState(e,t){this.emit("setUIState",{operationName:e,inProgress:t})}missingOrInvalidParameters(e){let t=this.options.messages.ReportViewer_MissingOrInvalidParameter;null==e||e.forEach(e=>{t+=`\r\n${e.text} (${e.id})`}),this.raiseError(t),this.emit("missingOrInvalidParameters")}handleParametersNotification(e){e?this.showNotification(this.options.messages.ReportViewer_TryReportPreview||"The report may now be previewed."):this.missingOrInvalidParameters(null)}setSearchInitiated(e){this.searchInitiated=e}getSearchInitiated(){return this.searchInitiated}setAiPromptInitiated(e){this.aiPromptInitiated=e}getAiPromptInitiated(){return this.aiPromptInitiated}setContentTabIndex(e){this.contentTabIndex=e}getContentTabIndex(){return this.contentTabIndex}disposeSentinel(){this.stopSentinel(),this.keepClientAliveSentinel=null}getConfigurationInfo(){return this.configurationInfo}setConfigurationInfo(e){this.configurationInfo=e}isAiInsightsEnabled(){var e,t;return null!==(t=null===(e=this.configurationInfo.options.find(e=>"ai-insights"===e.name))||void 0===e?void 0:e.isAvailable)&&void 0!==t&&t}shouldShowLicenseBanner(){var e;const t=null===(e=this.configurationInfo)||void 0===e?void 0:e.license;return!(null==t?void 0:t.isValid)&&"true"!==this.loadFromSessionStorage("hideBanner")}shouldShowLicenseOverlay(){var e,t;return!(null===(t=null===(e=this.configurationInfo)||void 0===e?void 0:e.license)||void 0===t?void 0:t.isValid)}getBannerIconFromId(e){switch(e){case 0:default:return'<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M22.702 2.1821C24.3149 2.51082 25.8077 3.27291 27.0199 4.38645C28.2321 5.49999 29.1179 6.92286 29.582 8.5021C30.012 9.9501 30.076 11.4821 29.768 12.9621C29.3228 14.9898 28.2025 16.8063 26.5904 18.1143C24.9783 19.4223 22.9699 20.1443 20.894 20.1621C20.018 20.1621 19.146 20.0361 18.308 19.7821L16.708 21.6581L15.95 22.0081H14V25.0081L13 26.0081H10V29.0081L9 30.0081H3L2 29.0081V24.3941L2.292 23.6881L12.24 13.7401C11.9577 12.8308 11.8226 11.8821 11.84 10.9301C11.8582 9.59817 12.1701 8.28666 12.7533 7.08907C13.3365 5.89147 14.1767 4.83728 15.214 4.00164C16.2514 3.166 17.4603 2.56949 18.7546 2.25464C20.0489 1.93978 21.3967 1.91633 22.702 2.1821ZM25.338 16.5821C26.5944 15.5647 27.4681 14.1509 27.816 12.5721L27.824 12.5821C28.0718 11.4277 28.0272 10.2297 27.6943 9.09691C27.3614 7.96412 26.7507 6.93248 25.9177 6.09572C25.0847 5.25896 24.0558 4.64361 22.9246 4.30557C21.7933 3.96753 20.5955 3.91753 19.44 4.1601C17.8816 4.506 16.4837 5.36334 15.4688 6.59561C14.454 7.82789 13.8806 9.36426 13.84 10.9601C13.82 11.8721 13.98 12.7761 14.318 13.6201L14.098 14.7061L4 24.8081V28.0081H8V25.0081L9 24.0081H12V21.0081L13 20.0081H15.49L17.242 17.9761L18.364 17.6961C19.1728 18.0121 20.0337 18.1736 20.902 18.1721C22.5181 18.1597 24.082 17.5991 25.338 16.5821ZM23.662 11.1181C23.8197 10.9002 23.9318 10.6527 23.9916 10.3905C24.0515 10.
19631283 24.0578 9.85665 24.0103 9.59192C23.9627 9.32718 23.8622 9.07476 23.7148 8.84975C23.5675 8.62474 23.3762 8.43177 23.1526 8.28238C22.9289 8.133 22.6774 8.03026 22.4131 7.98033C22.1488 7.93039 21.8771 7.93428 21.6144 7.99176C21.3516 8.04925 21.1031 8.15914 20.8838 8.31487C20.6645 8.4706 20.4789 8.66896 20.338 8.8981C20.067 9.33887 19.9774 9.86752 20.088 10.373C20.1985 10.8784 20.5007 11.3214 20.931 11.6087C21.3613 11.8961 21.8862 12.0055 22.3954 11.914C22.9047 11.8226 23.3587 11.5373 23.662 11.1181Z"\n fill="black"\n />\n <path\n d="M23.1299 16.0186L31.1387 31.0273L31.0068 31.25H14.9932L14.8604 31.0273L22.8955 16.0186H23.1299Z"\n fill="#FFC000"\n stroke="black"\n strokeWidth="1.5"\n />\n <rect x="22.25" y="21.2686" width="1.5" height="5" rx="0.75" fill="black" />\n <path\n d="M24 28.2686C24 27.7163 23.5523 27.2686 23 27.2686C22.4479 27.2687 22 27.7164 22 28.2686C22 28.8207 22.4479 29.2684 23 29.2686C23.5523 29.2686 24 28.8208 24 28.2686Z"\n fill="black"\n />\n </svg>';case 1:return'<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M18.5631 11.7812H10.4369L14.5 21.2619L18.5631 11.7812ZM18.5631 9.96875H10.4369L12.3788 5.4375H16.6212L18.5631 9.96875ZM20.5351 11.7812L17.2221 19.5116L23.9861 11.7812H20.5351ZM20.5351 9.96875L18.5931 5.4375H20.8437L24.2422 9.96875H20.5351ZM8.46492 9.96875L10.4069 5.4375H8.15625L4.75781 9.96875H8.46492ZM11.7779 19.5116L8.46492 11.7812H5.01386L11.7779 19.5116ZM27.1875 10.875L14.5 25.375L1.8125 10.875L7.25 3.625H21.75L27.1875 10.875Z"\n fill="black"\n />\n <path\n d="M23.0996 15.7998L31.0811 30.7578L30.9785 30.9316H15.0215L14.918 30.7578L22.9258 15.7998H23.0996Z"\n fill="#FFC000"\n stroke="black"\n strokeWidth="1.6"\n />\n <rect x="22.25" y="21" width="1.5" height="5" rx="0.75" fill="black" />\n <path\n d="M24 28C24 27.4477 23.5523 27 23 27C22.4479 27.0002 22 27.4478 22 28C22 28.5522 22.4479 28.9998 23 29C23.5523 29 24 28.5523 24 28Z"\n fill="black"\n />\n </svg>';case 2:return'<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path\n d="M27.8295 9.38659C28.8049 12.1653 28.7404 15.1391 27.774 17.7996C26.8014 20.4767 24.9215 22.8356 22.2691 24.367C19.7765 25.8061 16.9908 26.2908 14.3393 25.9323C11.6293 25.5682 9.06228 24.3215 7.08577 22.3155L8.23679 21.1826C9.95578 22.9294 12.1925 24.0142 14.5527 24.333C16.8583 24.6438 19.2821 24.2206 21.457 22.965C23.7719 21.6284 25.4118 19.5739 26.2565 17.2495C27.0643 15.0253 27.1474 12.5486 26.3976 10.2107L24.951 11.0459L25.5942 7.15112L29.2888 8.54145L27.8284 9.38462L27.8295 9.38659Z"\n fill="black"\n />\n <path\n fillRule="evenodd"\n clipRule="evenodd"\n d="M16.3594 8.08301C17.1842 8.16959 17.8382 8.41741 18.3281 8.8252C18.8135 9.2331 19.1263 9.78023 19.2607 10.4639L17.2939 10.6875C17.1732 10.1497 16.8607 9.78518 16.3594 9.59375V12.2617C17.6035 12.5557 18.4514 12.9408 18.9004 13.4102C19.3516 13.8819 19.5771 14.4863 19.5771 15.2246C19.5771 16.0494 19.2949 16.7425 18.7275 17.3076C18.1601 17.8728 17.3712 18.2233 16.3594 18.3623V19.6387H15.2334V18.3779C14.3448 18.2822 13.6246 17.9934 13.0664 17.5059C12.5081 17.0182 12.155 16.3275 12 15.4365L14.0127 15.2266C14.0947 15.5912 14.2497 15.9036 14.4775 16.168C14.7053 16.4321 14.9555 16.6218 15.2334 16.7402V13.8799C14.2264 13.6247 13.4906 13.2395 13.0234 12.7246C12.554 12.2073 12.3164 11.5801 12.3164 10.8418C12.3165 10.0946 12.5834 9.46575 13.1143 8.95996C13.6452 8.45184 14.3516 8.16053 15.2334 8.08301V7C15.6731 7 15.9197 7 16.3594 7V8.08301ZM16.3574 16.8535H16.3594C16.7467 16.7783 17.0661 16.6149 17.3076 16.3643C17.5537 16.1113 17.6738 15.8147 17.6738 15.4707C17.6738 15.1677 17.5715 14.9033 17.3643 14.6846C17.1615 14.4636 16.8267 14.2943 16.3574 14.1758V16.8535ZM15.2334 9.56836C14.9304 9.66408 14.6911 9.82132 14.5156 10.04C14.3379 10.2588 14.252 10.5004 14.252 10.7646C14.252 11.0062 14.3314 11.2301 14.4932 11.4375C14.655 11.6424 14.9038 11.8113 15.2363 11.9365V9.56836H15.2334Z"\n fill="black"\n />\n <path\n d="M2.71127 18.5075L4.18352 17.6575C3.21672 14.9028 3.27173 11.9581 4.21167 9.31563C5.17535 6.60942 7.06671 4.22018 9.74281 2.67513C12.0972 1.31581 14.709 0.807832 17.2232 1.05612C19.8041 1.3106 22.2798 2.36266 24.2693 4.10853L23.7361 4.71636L23.2029 5.32418C23.1532 5.27918 23.1016 5.23531 23.0511 5.19342C21.3484 3.75295 19.2504 2.88549 17.0678 2.66937C14.8802 2.45355 12.6065 2.89529 10.5561 4.07914C8.2194 5.42821 6.56974 7.50687 5.7328 9.85834C4.94555 12.068 4.87307 14.5175 5.61235 16.8326L6.69304 16.2087L6.98491 16.4014L6.40585 19.8979L2.71127 18.5075Z"\n fill="black"\n />\n <path\n d="M23.0996 15.7998L31.0811 30.7578L30.9785 30.9316H15.0215L14.918 30.7578L22.9258 15.7998H23.0996Z"\n fill="#FFC000"\n stroke="black"\n strokeWidth="1.6"\n />\n <rect x="22.25" y="21" width="1.5" height="5" rx="0.75" fill="black" />\n <path\n d="M24 28C24 27.4477 23.5523 27 23 27C22.4479 27.0002 22 27.4478 22 28C22 28.5522 22.4479 28.9998 23 29C23.5523 29 24 28.5523 24 28Z"\n fill="black"\n />\n </svg>';case 3:return'<svg width="38" height="38" viewBox="0 0 38 38" fill="none" xmlns="http://www.w3.org/2000/svg">\n <g clipPath="url(#clip0_1_5398)">\n <path\n d="M24.9056 7.60146L34.4998 10.1722L31.9299 19.7659L13.7653 30.2532L6.7419 18.0883L24.9056 7.60146Z"\n stroke="black"\n strokeWidth="1.75"\n />\n <path\n d="M13.0913 19.7635L15.4762 23.8942L14.6279 24.384L12.2431 20.2533L13.0913 19.7635ZM14.3623 19.0297L14.7473 19.6964L11.3769 21.6423L10.992 20.9756L14.3623 19.0297ZM14.8475 18.7496L16.388 17.8602C16.7038 17.6778 17.0025 17.5684 17.2841 17.532C17.5675 17.4944 17.8242 17.5328 18.0542 17.6472C18.2841 17.7616 18.4772 17.954 18.6333 18.2244C18.7611 18.4457 18.833 18.6576 18.8491 18.8602C18.866 19.0598 18.8369 19.2518 18.7619 19.4364C18.6876 19.6179 18.5778 19.7923 18.4322 19.9596L18.2446 20.257L16.9055 21.0301L16.5166 20.3695L17.5124 19.7946C17.6618 19.7083 17.7704 19.6103 17.8381 19.5006C17.9059 19.3909 17.9371 19.2745 17.9317 19.1516C17.9281 19.0275 17.8903 18.9031 17.8183 18.7782C17.7418 18.6458 17.6512 18.5456 17.5463 18.4775C17.4415 18.4095 17.3242 18.3788 17.1944 18.3857C17.0647 18.3925 16.9242 18.4395 16.7729 18.5269L16.0835 18.9249L18.0834 22.3889L17.2323 22.8803L14.8475 18.7496ZM19.5417 21.547L17.5367 20.2496L18.4328 19.7247L20.4294 20.9815L20.4523 21.0212L19.5417 21.547ZM19.4746 16.0781L21.8595 20.2088L21.0112 20.6986L18.6264 16.5679L19.4746 16.0781ZM22.4103 15.3251L23.2638 19.398L22.3588 19.9205L21.5088 14.9037L22.0847 14.5712L22.4103 15.3251ZM25.3207 18.2105L22.2174 15.4365L21.7187 14.7825L22.3003 14.4467L26.2285 17.6864L25.3207 18.2105ZM24.3818 16.7023L24.7668 17.369L22.5851 18.6286L22.2002 17.9
1963619L24.3818 16.7023ZM28.8837 15.2683L29.267 15.9321L27.1874 17.1327L26.8041 16.4689L28.8837 15.2683ZM25.0778 12.8432L27.4626 16.9739L26.6115 17.4652L24.2267 13.3345L25.0778 12.8432Z"\n fill="black"\n />\n <circle cx="30.1049" cy="12.7084" r="1.12128" transform="rotate(15 30.1049 12.7084)" fill="black" />\n </g>\n <path\n d="M27.6201 19.7998L35.6016 34.7578L35.499 34.9316H19.542L19.4385 34.7578L27.4463 19.7998H27.6201Z"\n fill="#FFC000"\n stroke="black"\n strokeWidth="1.6"\n />\n <rect x="26.7705" y="25" width="1.5" height="5" rx="0.75" fill="black" />\n <path\n d="M28.5205 32C28.5205 31.4477 28.0728 31 27.5205 31C26.9684 31.0002 26.5205 31.4478 26.5205 32C26.5205 32.5522 26.9684 32.9998 27.5205 33C28.0728 33 28.5205 32.5523 28.5205 32Z"\n fill="black"\n />\n <defs>\n <clipPath id="clip0_1_5398">\n <rect width="30" height="31.1538" fill="white" transform="translate(8.06323) rotate(15)" />\n </clipPath>\n </defs>\n </svg>'}}saveToSessionStorage(e,t){sessionStorage.setItem(e,t)}loadFromSessionStorage(e){return sessionStorage.getItem(e)}removeFromSessionStorage(e){sessionStorage.removeItem(e)}clearSessionStorage(){sessionStorage.clear()}},e.ReportControllerOptions=class{constructor(e,t,i,n,r,s,o,a,l,h,c=!1,d=!1){this.keepClientAlive=!1,this.keepClientAlive=e,this.authenticationToken=t,this.nonce=i,this.reportSource=n,this.printMode=r,this.pageMode=s,this.viewMode=o,this.scaleMode=a,this.scale=l,this.messages=h,this.enableAccessibility=c,this.searchMetadataOnDemand=d}},e.ReportServerSettings=class{constructor(e,t,i){this.url=e,this.username=t,this.password=i}},e.ReportServerTokenSettings=class{constructor(e,t){this.url=e,this.getPersonalAccessToken=t}},e.ReportSourceOptions=Oe,e.RequestError=C,e.SearchInfo=class{constructor(){this.searchToken="",this.matchCase=!1,this.matchWholeWord=!1,this.useRegularExpressions=!1}},e.SearchManager=class extends q{constructor(e,t){super(),this.searchResults=[],this.pendingHighlightItem=null,this.highlightedElements=[],this.currentHighlightedElement=null,this.isActive=!1,this.controller=t,this.pageContainer=fe(e,".trv-page-container"),this.controller.on("applySearchColors",this.applySearchColors.bind(this)).on("pageReady",this.applySearchColors.bind(this))}search(e){this.isActive=!0,this.clearColoredItems(),this.searchResults=[],e.searchToken&&""!==e.searchToken?this.controller.getSearchResults(e).then(this.onSearchComplete.bind(this)):this.onSearchComplete([])}closeSearch(){this.isActive=!1,this.clearColoredItems(),this.searchResults=[]}highlightSearchItem(t){t&&(this.currentHighlightedElement&&(re(this.currentHighlightedElement,Ze),ne(this.currentHighlightedElement,We)),t.page===this.controller.getCurrentPageNumber()?this.highlightItem(t):this.controller.getPageMode()===e.PageMode.SinglePage?this.clearColoredItems():this.highlightItem(t),this.pendingHighlightItem=t,this.navigateToPage(t))}navigateToPage(e){this.controller.navigateToPage(e.page,new h(e.id,"search"))}colorPageElements(e){e&&0!==e.length&&(e.forEach(e=>{let t=fe(this.pageContainer,"[data-search-id="+e.id+"]");t&&(ne(t,We),this.highlightedElements.push(t))}),this.highlightItem(this.pendingHighlightItem))}highlightItem(e){if(e){let t=this.highlightedElements.find(function(t){return t.dataset.searchId===e.id});t&&(this.currentHighlightedElement=t,re(t,We),ne(t,Ze))}}clearColoredItems(){this.highlightedElements&&this.highlightedElements.length>0&&this.highlightedElements.forEach(e=>{re(e,We)}),this.currentHighlightedElement&&re(this.currentHighlightedElement,Ze),this.highlightedElements=[],this.currentHighlightedElement=null}applySearchColors(){this.isActive&&this.colorPageElements(this.searchResults)}onSearchComplete(e){this.searchResults=e,this.emit("searchComplete",e),this.colorPageElements(e)}},e.SearchResult=class{constructor(){this.description="",this.id="",this.page=0}},e.SendEmailDocumentReadyEventArgs=m,e.SendEmailStartedEventArgs=f,e.ServiceClient=class{constructor(e){this.connectionConfig=this.getConnectionConfig(e),this.authStrategy=this.getAuthStrategy(this.connectionConfig)}getConnectionConfig(e){return e.reportServer&&e.reportServer.url&&e.reportServer.username&&e.reportServer.password?new E(e.reportServer.url,e.reportServer.username,e.reportServer.password):e.reportServer&&e.reportServer.url&&e.reportServer.getPersonalAccessToken?new M(e.reportServer.url,e.reportServer.getPersonalAccessToken):e.reportServer&&e.reportServer.url?new A(e.reportServer.url):e.serverPreview&&e.serverShareToken?new M("",()=>Promise.resolve(e.serverShareToken)):new R(e.serviceUrl)}getAuthStrategy(t){switch(t.authType){case e.AuthType.None:return new b;case e.AuthType.Basic:return new w(t);case e.AuthType.PersonalToken:return new L(t);default:return new b}}validateClientID(e){if(!e)throw"Invalid ClientId"}authenticatedGet(e){return this.login().then(t=>(null==t?void 0:t.expiresAt)<Date.now()?(this.loginPromise=this.authStrategy.authenticatePromise(!0,t.refreshToken),this.authenticatedGet(e)):function(e,t){return fetch(e,{headers:y(t)}).then(S)}(e,t.access_token||t.accessToken))}authenticatedPost(e,t){return this.login().then(i=>(null==i?void 0:i.expiresAt)<Date.now()?(this.loginPromise=this.authStrategy.authenticatePromise(!0,i.refreshToken),this.authenticatedPost(e,t)):I(e,t,i.access_token||i.accessToken))}authenticatedDelete(e){return this.login().then(t=>t.expiresAt<Date.now()?(this.loginPromise=this.authStrategy.authenticatePromise(!0,t.refreshToken),this.authenticatedDelete(e)):function(e,t){return fetch(e,{method:"DELETE",headers:y(t)}).then(S)}(e,t.access_token||t.accessToken))}login(){return this.loginPromise||(this.loginPromise=this.authStrategy.authenticatePromise(!1,null)),this.loginPromise}get(e){return fetch(e).then(e=>e.text())}setAccessToken(e){this.loginPromise=Promise.resolve({accessToken:e})}registerClient(){return this.authenticatedPost(`${this.connectionConfig.serviceUrl}/clients`,{timeStamp:Date.now()}).then(e=>e.clientId)}unregisterClient(e){return this.validateClientID(e),this.authenticatedDelete(`${this.connectionConfig.serviceUrl}/clients/${e}`)}getParameters(e,t,i){return this.validateClientID(e),this.authenticatedPost(`${this.connectionConfig.serviceUrl}/clients/${e}/parameters`,{report:t,parameterValues:i||{}}).then(e=>e)}createReportInstance(e,t,i){return this.validateClientID(e),this.authenticatedPost(`${this.connectionConfig.serviceUrl}/clients/${e}/instances`,{report:t,parameterValues:i}).then(e=>e.instanceId)}deleteReportInstance(e,t){return this.validateClientID(e),this.authenticatedDelete(`${this.connectionConfig.serviceUrl}/clients/${e}/instances/${t}`)}createReportDocument(e,t,i,n,r,s,o){return this.validateClientID(e),n.BasePath=this.connectionConfig.serviceUrl,this.authenticatedPost(`${this.connectionConfig.serviceUrl}/clients/${e}/instances/${t}/documents`,{format:i,deviceInfo:n,useCache:r,baseDocumentID:s,actionID:o}).then(e=>e.documentId)}sendDocument(e,t,i,n){return this.validateClientID(e),this.authenticatedPost(`${this.connectionConfig.serviceUrl}/clients/${e}/instances/${t}/documents/${i}/send`,n)}deleteReportDocument(e,t,i){return this.validateClientID(e),this.authenticatedDelete(`${this.connectionConfig.serviceUrl}/clients/${e}/instances/${t}/documents/${i}`)}getDocumentUrl(e,t,i){return`${this.connectionConfig.serviceUrl}/clients/${e}/instances/${t}/documents/${i}`}getDocumentInfo(e,t,i){return this.validateClientID(e),this.authenticatedGet(`${this.connectionConfig.serviceUrl}/clients/${e}/instances/${t}/documents/${i}/info`).then(e=>e)}getPage(e,t,i,n){return this.validateClientID(e),this.authenticatedGet(`${this.connectionConfig.serviceUrl}/clients/${e}/instances/${t}/documents/${i}/pages/${n}`).then(e=>{let t=e;return t.pageActions=JSON.parse(e.pageActions),t})}getDocumentFormats(){return this.authenticatedGet(`${this.connectionConfig.serviceUrl}/formats`).then(e=>e||[])}getServiceVersion(){return this.authenticatedGet(`${this.connectionConfig.serviceUrl}/version`).then(e=>e.toString())}getServiceConfiguration(){return this.authenticatedGet(`${this.connectionConfig.serviceUrl}/configuration`).then(e=>e)}getResource(e,t,i,n){return this.validateClientID(e),this.authenticatedGet(`${this.connectionConfig.serviceUrl}/clients/${e}/instances/${t}/documents/${i}/resources/${n}`)}getSearchResults(e,t,i,n){return this.validateClientID(e),this.authenticatedPost(`${this.connectionConfig.serviceUrl}/clients/${e}/instances/${t}/documents/${i}/search`,n).then(function(e){return e||[]})}createAIThread(e,t,i,n){return this.validateClientID(e),this.authenticatedPost(`${this.connectionConfig.serviceUrl}/clients/${e}/instances/${t}/ai`,{report:i,parameterValues:n}).then(e=>e)}getAIResponse(e,t,i,n,r){return this.validateClientID(e),this.authenticatedPost(`${this.connectionConfig.serviceUrl}/clients/${e}/instances/${t}/documents/${i}/ai/${n}/query`,{query:r}).then(function(e){return e||""})}getServiceUrl(){return this.connectionConfig.serviceUrl}keepClientAlive(e){return this.authenticatedPost(`${this.connectionConfig.serviceUrl}/clients/keepAlive/${e}`,{})}getClientsSessionTimeoutSeconds(){return this.authenticatedGet(`${this.connectionConfig.serviceUrl}/clients/sessionTimeout`).then(function(e){return e.clientSessionTimeout})}},e.TooltipEventArgs=P,e.addClass=ne,e.appendHtml=pe,e.createElement=ie,e.debounce=ve,e.each=we,e.escapeHtml=he,e.findElement=fe,e.getColorAlphaValue=ue,e.getElementAttributeValue=function(e,t){var i;return e&&e.attributes&&(null===(i=e.attributes[t])||void 0===i?void 0:i.value)||""},e.getElementScrollParent=me,e.getOffsetParent=oe,e.hasClass=se,e.isArray=Le,e.isExceptionOfType=Ce,e.isInternalServerError=Ie,e.isInvalidClientException=ye,e.isInvalidParameterException=Se,e.isRgbColor=de,e.keepElementInView=function(e){if(!e)return;let t=me(e);
1963if(!t)return;let i=e.offsetTop,n=i+e.offsetHeight,r=t.scrollTop+t.offsetHeight;i<t.scrollTop?t.scrollTop=i:n>r&&(t.scrollTop+=n-r)},e.parseToLocalDate=Ae,e.prependHtml=ge,e.removeClass=re,e.reportSourcesAreEqual=function(e){const t=e.firstReportSource,i=e.secondReportSource;if(t&&i&&t.report===i.report){let e="";t.parameters&&(e=JSON.stringify(t.parameters));let n="";return i.parameters&&(n=JSON.stringify(i.parameters)),e===n}return!1},e.scaleElement=le,e.stringFormat=be,e.throttle=Pe,e.toPixel=ae,e.toRgbColor=ce,e.tryParseFloat=Re,e.tryParseInt=Te,Object.defineProperty(e,"__esModule",{value:!0})}); 1964//# sourceMappingURL=index.js.map 1965 1966 1967/***/ } 1968 1969/******/ }); 1970/************************************************************************/ 1971/******/ // The module cache 1972/******/ var __webpack_module_cache__ = {}; 1973/******/ 1974/******/ // The require function 1975/******/ function __webpack_require__(moduleId) { 1976/******/ // Check if module is in cache 1977/******/ var cachedModule = __webpack_module_cache__[moduleId]; 1978/******/ if (cachedModule !== undefined) { 1979/******/ return cachedModule.exports; 1980/******/ } 1981/******/ // Check if module exists (development only) 1982/******/ if (__webpack_modules__[moduleId] === undefined) { 1983/******/ var e = new Error("Cannot find module '" + moduleId + "'"); 1984/******/ e.code = 'MODULE_NOT_FOUND'; 1985/******/ throw e; 1986/******/ } 1987/******/ // Create a new module (and put it into the cache) 1988/******/ var module = __webpack_module_cache__[moduleId] = { 1989/******/ // no module.id needed 1990/******/ // no module.loaded needed 1991/******/ exports: {} 1992/******/ }; 1993/******/ 1994/******/ // Execute the module function 1995/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); 1996/******/ 1997/******/ // Return the exports of the module 1998/******/ return module.exports; 1999/******/ } 2000/******/ 2001/************************************************************************/ 2002/******/ 2003/******/ // startup 2004/******/ // Load entry module and return exports 2005/******/ // This entry module is referenced by other modules so it can't be inlined 2006/******/ var __webpack_exports__ = __webpack_require__("./js/src/index.ts"); 2007/******/ 2008/******/ return __webpack_exports__; 2009/******/ })() 2010; 2011}); 2012//# sourceMappingURL=reporting-blazor-viewer.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.