Skip to content
Snippets Groups Projects
onDeleteAccount.js 7.96 MiB
Newer Older
  • Learn to ignore specific revisions
  • build-token's avatar
    build-token committed
    230001 230002 230003 230004 230005 230006 230007 230008 230009 230010 230011 230012 230013 230014 230015 230016 230017 230018 230019 230020 230021 230022 230023 230024 230025 230026 230027 230028 230029 230030 230031 230032 230033 230034 230035 230036 230037 230038 230039 230040 230041 230042 230043 230044 230045 230046 230047 230048 230049 230050 230051 230052 230053 230054 230055 230056 230057 230058 230059 230060 230061 230062 230063 230064 230065 230066 230067 230068 230069 230070 230071 230072 230073 230074 230075 230076 230077 230078 230079 230080 230081 230082 230083 230084 230085 230086 230087 230088 230089 230090 230091 230092 230093 230094 230095 230096 230097 230098 230099 230100 230101 230102 230103 230104 230105 230106 230107 230108 230109 230110 230111 230112 230113 230114 230115 230116 230117 230118 230119 230120 230121 230122 230123 230124 230125 230126 230127 230128 230129 230130 230131 230132 230133 230134 230135 230136 230137 230138 230139 230140 230141 230142 230143 230144 230145 230146 230147 230148 230149 230150 230151 230152 230153 230154 230155 230156 230157 230158 230159 230160 230161 230162 230163 230164 230165 230166 230167 230168 230169 230170 230171 230172 230173 230174 230175 230176 230177 230178 230179 230180 230181 230182 230183 230184 230185 230186 230187 230188 230189 230190 230191 230192 230193 230194 230195 230196 230197 230198 230199 230200 230201 230202 230203 230204 230205 230206 230207 230208 230209 230210 230211 230212 230213 230214 230215 230216 230217 230218 230219 230220 230221 230222 230223 230224 230225 230226 230227 230228 230229 230230 230231 230232 230233 230234 230235 230236 230237 230238 230239 230240 230241 230242 230243 230244 230245 230246 230247 230248 230249 230250 230251 230252 230253 230254 230255 230256 230257 230258 230259 230260 230261 230262 230263 230264 230265 230266 230267 230268 230269 230270 230271 230272 230273 230274 230275 230276 230277 230278 230279 230280 230281 230282 230283 230284 230285 230286 230287 230288 230289 230290 230291 230292 230293 230294 230295 230296 230297 230298 230299 230300 230301 230302 230303 230304 230305 230306 230307 230308 230309 230310 230311 230312 230313 230314 230315 230316 230317 230318 230319 230320 230321 230322 230323 230324 230325 230326 230327 230328 230329 230330 230331 230332 230333 230334 230335 230336 230337 230338 230339 230340 230341 230342 230343 230344 230345 230346 230347 230348 230349 230350 230351 230352 230353 230354 230355 230356 230357 230358 230359 230360 230361 230362 230363 230364 230365 230366 230367 230368 230369 230370 230371 230372 230373 230374 230375 230376 230377 230378 230379 230380 230381 230382 230383 230384 230385 230386 230387 230388 230389 230390 230391 230392 230393 230394 230395 230396 230397 230398 230399 230400 230401 230402 230403 230404 230405 230406 230407 230408 230409 230410 230411 230412 230413 230414 230415 230416 230417 230418 230419 230420 230421 230422 230423 230424 230425 230426 230427 230428 230429 230430 230431 230432 230433 230434 230435 230436 230437 230438 230439 230440 230441 230442 230443 230444 230445 230446 230447 230448 230449 230450 230451 230452 230453 230454 230455 230456 230457 230458 230459 230460 230461 230462 230463 230464 230465 230466 230467 230468 230469 230470 230471 230472 230473 230474 230475 230476 230477 230478 230479 230480 230481 230482 230483 230484 230485 230486 230487 230488 230489 230490 230491 230492 230493 230494 230495 230496 230497 230498 230499 230500 230501 230502 230503 230504 230505 230506 230507 230508 230509 230510 230511 230512 230513 230514 230515 230516 230517 230518 230519 230520 230521 230522 230523 230524 230525 230526 230527 230528 230529 230530 230531 230532 230533 230534 230535 230536 230537 230538 230539 230540 230541 230542 230543 230544 230545 230546 230547 230548 230549 230550 230551 230552 230553 230554 230555 230556 230557 230558 230559 230560 230561 230562 230563 230564 230565 230566 230567 230568 230569 230570 230571 230572 230573 230574 230575 230576 230577 230578 230579 230580 230581 230582 230583 230584 230585 230586 230587 230588 230589 230590 230591 230592 230593 230594 230595 230596 230597 230598 230599 230600 230601 230602 230603 230604 230605 230606 230607 230608 230609 230610 230611 230612 230613 230614 230615 230616 230617 230618 230619 230620 230621 230622 230623 230624 230625 230626 230627 230628 230629 230630 230631 230632 230633 230634 230635 230636 230637 230638 230639 230640 230641 230642 230643 230644 230645 230646 230647 230648 230649 230650 230651 230652 230653 230654 230655 230656 230657 230658 230659 230660 230661 230662 230663 230664 230665 230666 230667 230668 230669 230670 230671 230672 230673 230674 230675 230676 230677 230678 230679 230680 230681 230682 230683 230684 230685 230686 230687 230688 230689 230690 230691 230692 230693 230694 230695 230696 230697 230698 230699
     *
     * @param wrapped the wrapper function
     * @param original the original function that gets wrapped
     */
    function markFunctionWrapped(wrapped, original) {
      const proto = original.prototype || {};
      wrapped.prototype = original.prototype = proto;
      addNonEnumerableProperty(wrapped, '__sentry_original__', original);
    }
    
    /**
     * This extracts the original function if available.  See
     * `markFunctionWrapped` for more information.
     *
     * @param func the function to unwrap
     * @returns the unwrapped version of the function if available.
     */
    function getOriginalFunction(func) {
      return func.__sentry_original__;
    }
    
    /**
     * Encodes given object into url-friendly format
     *
     * @param object An object that contains serializable values
     * @returns string Encoded
     */
    function urlEncode(object) {
      return Object.keys(object)
        .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(object[key])}`)
        .join('&');
    }
    
    /**
     * Transforms any `Error` or `Event` into a plain object with all of their enumerable properties, and some of their
     * non-enumerable properties attached.
     *
     * @param value Initial source that we have to transform in order for it to be usable by the serializer
     * @returns An Event or Error turned into an object - or the value argurment itself, when value is neither an Event nor
     *  an Error.
     */
    function convertToPlainObject(
      value,
    )
    
     {
      if ((0,_is_js__WEBPACK_IMPORTED_MODULE_0__.isError)(value)) {
        return {
          message: value.message,
          name: value.name,
          stack: value.stack,
          ...getOwnProperties(value),
        };
      } else if ((0,_is_js__WEBPACK_IMPORTED_MODULE_0__.isEvent)(value)) {
        const newObj
    
     = {
          type: value.type,
          target: serializeEventTarget(value.target),
          currentTarget: serializeEventTarget(value.currentTarget),
          ...getOwnProperties(value),
        };
    
        if (typeof CustomEvent !== 'undefined' && (0,_is_js__WEBPACK_IMPORTED_MODULE_0__.isInstanceOf)(value, CustomEvent)) {
          newObj.detail = value.detail;
        }
    
        return newObj;
      } else {
        return value;
      }
    }
    
    /** Creates a string representation of the target of an `Event` object */
    function serializeEventTarget(target) {
      try {
        return (0,_is_js__WEBPACK_IMPORTED_MODULE_0__.isElement)(target) ? (0,_browser_js__WEBPACK_IMPORTED_MODULE_1__.htmlTreeAsString)(target) : Object.prototype.toString.call(target);
      } catch (_oO) {
        return '<unknown>';
      }
    }
    
    /** Filters out all but an object's own properties */
    function getOwnProperties(obj) {
      if (typeof obj === 'object' && obj !== null) {
        const extractedProps = {};
        for (const property in obj) {
          if (Object.prototype.hasOwnProperty.call(obj, property)) {
            extractedProps[property] = (obj )[property];
          }
        }
        return extractedProps;
      } else {
        return {};
      }
    }
    
    /**
     * Given any captured exception, extract its keys and create a sorted
     * and truncated list that will be used inside the event message.
     * eg. `Non-error exception captured with keys: foo, bar, baz`
     */
    function extractExceptionKeysForMessage(exception, maxLength = 40) {
      const keys = Object.keys(convertToPlainObject(exception));
      keys.sort();
    
      if (!keys.length) {
        return '[object has no keys]';
      }
    
      if (keys[0].length >= maxLength) {
        return (0,_string_js__WEBPACK_IMPORTED_MODULE_2__.truncate)(keys[0], maxLength);
      }
    
      for (let includedKeys = keys.length; includedKeys > 0; includedKeys--) {
        const serialized = keys.slice(0, includedKeys).join(', ');
        if (serialized.length > maxLength) {
          continue;
        }
        if (includedKeys === keys.length) {
          return serialized;
        }
        return (0,_string_js__WEBPACK_IMPORTED_MODULE_2__.truncate)(serialized, maxLength);
      }
    
      return '';
    }
    
    /**
     * Given any object, return a new object having removed all fields whose value was `undefined`.
     * Works recursively on objects and arrays.
     *
     * Attention: This function keeps circular references in the returned object.
     */
    function dropUndefinedKeys(inputValue) {
      // This map keeps track of what already visited nodes map to.
      // Our Set - based memoBuilder doesn't work here because we want to the output object to have the same circular
      // references as the input object.
      const memoizationMap = new Map();
    
      // This function just proxies `_dropUndefinedKeys` to keep the `memoBuilder` out of this function's API
      return _dropUndefinedKeys(inputValue, memoizationMap);
    }
    
    function _dropUndefinedKeys(inputValue, memoizationMap) {
      if ((0,_is_js__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(inputValue)) {
        // If this node has already been visited due to a circular reference, return the object it was mapped to in the new object
        const memoVal = memoizationMap.get(inputValue);
        if (memoVal !== undefined) {
          return memoVal ;
        }
    
        const returnValue = {};
        // Store the mapping of this value in case we visit it again, in case of circular data
        memoizationMap.set(inputValue, returnValue);
    
        for (const key of Object.keys(inputValue)) {
          if (typeof inputValue[key] !== 'undefined') {
            returnValue[key] = _dropUndefinedKeys(inputValue[key], memoizationMap);
          }
        }
    
        return returnValue ;
      }
    
      if (Array.isArray(inputValue)) {
        // If this node has already been visited due to a circular reference, return the array it was mapped to in the new object
        const memoVal = memoizationMap.get(inputValue);
        if (memoVal !== undefined) {
          return memoVal ;
        }
    
        const returnValue = [];
        // Store the mapping of this value in case we visit it again, in case of circular data
        memoizationMap.set(inputValue, returnValue);
    
        inputValue.forEach((item) => {
          returnValue.push(_dropUndefinedKeys(item, memoizationMap));
        });
    
        return returnValue ;
      }
    
      return inputValue;
    }
    
    /**
     * Ensure that something is an object.
     *
     * Turns `undefined` and `null` into `String`s and all other primitives into instances of their respective wrapper
     * classes (String, Boolean, Number, etc.). Acts as the identity function on non-primitives.
     *
     * @param wat The subject of the objectification
     * @returns A version of `wat` which can safely be used with `Object` class methods
     */
    function objectify(wat) {
      let objectified;
      switch (true) {
        case wat === undefined || wat === null:
          objectified = new String(wat);
          break;
    
        // Though symbols and bigints do have wrapper classes (`Symbol` and `BigInt`, respectively), for whatever reason
        // those classes don't have constructors which can be used with the `new` keyword. We therefore need to cast each as
        // an object in order to wrap it.
        case typeof wat === 'symbol' || typeof wat === 'bigint':
          objectified = Object(wat);
          break;
    
        // this will catch the remaining primitives: `String`, `Number`, and `Boolean`
        case (0,_is_js__WEBPACK_IMPORTED_MODULE_0__.isPrimitive)(wat):
          // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
          objectified = new (wat ).constructor(wat);
          break;
    
        // by process of elimination, at this point we know that `wat` must already be an object
        default:
          objectified = wat;
          break;
      }
      return objectified;
    }
    
    
    //# sourceMappingURL=object.js.map
    
    
    /***/ }),
    /* 1613 */
    /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
    
    "use strict";
    __webpack_require__.r(__webpack_exports__);
    /* harmony export */ __webpack_require__.d(__webpack_exports__, {
    /* harmony export */   "getDomElement": () => (/* binding */ getDomElement),
    /* harmony export */   "getLocationHref": () => (/* binding */ getLocationHref),
    /* harmony export */   "htmlTreeAsString": () => (/* binding */ htmlTreeAsString)
    /* harmony export */ });
    /* harmony import */ var _is_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1611);
    /* harmony import */ var _worldwide_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1606);
    
    
    
    // eslint-disable-next-line deprecation/deprecation
    const WINDOW = (0,_worldwide_js__WEBPACK_IMPORTED_MODULE_0__.getGlobalObject)();
    
    /**
     * Given a child DOM element, returns a query-selector statement describing that
     * and its ancestors
     * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]
     * @returns generated DOM path
     */
    function htmlTreeAsString(elem, keyAttrs) {
    
      // try/catch both:
      // - accessing event.target (see getsentry/raven-js#838, #768)
      // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly
      // - can throw an exception in some circumstances.
      try {
        let currentElem = elem ;
        const MAX_TRAVERSE_HEIGHT = 5;
        const MAX_OUTPUT_LEN = 80;
        const out = [];
        let height = 0;
        let len = 0;
        const separator = ' > ';
        const sepLength = separator.length;
        let nextStr;
    
        while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) {
          nextStr = _htmlElementAsString(currentElem, keyAttrs);
          // bail out if
          // - nextStr is the 'html' element
          // - the length of the string that would be created exceeds MAX_OUTPUT_LEN
          //   (ignore this limit if we are on the first iteration)
          if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN)) {
            break;
          }
    
          out.push(nextStr);
    
          len += nextStr.length;
          currentElem = currentElem.parentNode;
        }
    
        return out.reverse().join(separator);
      } catch (_oO) {
        return '<unknown>';
      }
    }
    
    /**
     * Returns a simple, query-selector representation of a DOM element
     * e.g. [HTMLElement] => input#foo.btn[name=baz]
     * @returns generated DOM path
     */
    function _htmlElementAsString(el, keyAttrs) {
      const elem = el
    
    ;
    
      const out = [];
      let className;
      let classes;
      let key;
      let attr;
      let i;
    
      if (!elem || !elem.tagName) {
        return '';
      }
    
      out.push(elem.tagName.toLowerCase());
    
      // Pairs of attribute keys defined in `serializeAttribute` and their values on element.
      const keyAttrPairs =
        keyAttrs && keyAttrs.length
          ? keyAttrs.filter(keyAttr => elem.getAttribute(keyAttr)).map(keyAttr => [keyAttr, elem.getAttribute(keyAttr)])
          : null;
    
      if (keyAttrPairs && keyAttrPairs.length) {
        keyAttrPairs.forEach(keyAttrPair => {
          out.push(`[${keyAttrPair[0]}="${keyAttrPair[1]}"]`);
        });
      } else {
        if (elem.id) {
          out.push(`#${elem.id}`);
        }
    
        // eslint-disable-next-line prefer-const
        className = elem.className;
        if (className && (0,_is_js__WEBPACK_IMPORTED_MODULE_1__.isString)(className)) {
          classes = className.split(/\s+/);
          for (i = 0; i < classes.length; i++) {
            out.push(`.${classes[i]}`);
          }
        }
      }
      const allowedAttrs = ['type', 'name', 'title', 'alt'];
      for (i = 0; i < allowedAttrs.length; i++) {
        key = allowedAttrs[i];
        attr = elem.getAttribute(key);
        if (attr) {
          out.push(`[${key}="${attr}"]`);
        }
      }
      return out.join('');
    }
    
    /**
     * A safe form of location.href
     */
    function getLocationHref() {
      try {
        return WINDOW.document.location.href;
      } catch (oO) {
        return '';
      }
    }
    
    /**
     * Gets a DOM element by using document.querySelector.
     *
     * This wrapper will first check for the existance of the function before
     * actually calling it so that we don't have to take care of this check,
     * every time we want to access the DOM.
     *
     * Reason: DOM/querySelector is not available in all environments.
     *
     * We have to cast to any because utils can be consumed by a variety of environments,
     * and we don't want to break TS users. If you know what element will be selected by
     * `document.querySelector`, specify it as part of the generic call. For example,
     * `const element = getDomElement<Element>('selector');`
     *
     * @param selector the selector string passed on to document.querySelector
     */
    // eslint-disable-next-line @typescript-eslint/no-explicit-any
    function getDomElement(selector) {
      if (WINDOW.document && WINDOW.document.querySelector) {
        return WINDOW.document.querySelector(selector) ;
      }
      return null;
    }
    
    
    //# sourceMappingURL=browser.js.map
    
    
    /***/ }),
    /* 1614 */
    /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
    
    "use strict";
    __webpack_require__.r(__webpack_exports__);
    /* harmony export */ __webpack_require__.d(__webpack_exports__, {
    /* harmony export */   "SyncPromise": () => (/* binding */ SyncPromise),
    /* harmony export */   "rejectedSyncPromise": () => (/* binding */ rejectedSyncPromise),
    /* harmony export */   "resolvedSyncPromise": () => (/* binding */ resolvedSyncPromise)
    /* harmony export */ });
    /* harmony import */ var _is_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1611);
    
    
    /* eslint-disable @typescript-eslint/explicit-function-return-type */
    
    /** SyncPromise internal states */
    var States; (function (States) {
      /** Pending */
      const PENDING = 0; States[States["PENDING"] = PENDING] = "PENDING";
      /** Resolved / OK */
      const RESOLVED = 1; States[States["RESOLVED"] = RESOLVED] = "RESOLVED";
      /** Rejected / Error */
      const REJECTED = 2; States[States["REJECTED"] = REJECTED] = "REJECTED";
    })(States || (States = {}));
    
    // Overloads so we can call resolvedSyncPromise without arguments and generic argument
    
    /**
     * Creates a resolved sync promise.
     *
     * @param value the value to resolve the promise with
     * @returns the resolved sync promise
     */
    function resolvedSyncPromise(value) {
      return new SyncPromise(resolve => {
        resolve(value);
      });
    }
    
    /**
     * Creates a rejected sync promise.
     *
     * @param value the value to reject the promise with
     * @returns the rejected sync promise
     */
    function rejectedSyncPromise(reason) {
      return new SyncPromise((_, reject) => {
        reject(reason);
      });
    }
    
    /**
     * Thenable class that behaves like a Promise and follows it's interface
     * but is not async internally
     */
    class SyncPromise {
       __init() {this._state = States.PENDING;}
       __init2() {this._handlers = [];}
    
       constructor(
        executor,
      ) {;SyncPromise.prototype.__init.call(this);SyncPromise.prototype.__init2.call(this);SyncPromise.prototype.__init3.call(this);SyncPromise.prototype.__init4.call(this);SyncPromise.prototype.__init5.call(this);SyncPromise.prototype.__init6.call(this);
        try {
          executor(this._resolve, this._reject);
        } catch (e) {
          this._reject(e);
        }
      }
    
      /** JSDoc */
       then(
        onfulfilled,
        onrejected,
      ) {
        return new SyncPromise((resolve, reject) => {
          this._handlers.push([
            false,
            result => {
              if (!onfulfilled) {
                // TODO: ¯\_(ツ)_/¯
                // TODO: FIXME
                resolve(result );
              } else {
                try {
                  resolve(onfulfilled(result));
                } catch (e) {
                  reject(e);
                }
              }
            },
            reason => {
              if (!onrejected) {
                reject(reason);
              } else {
                try {
                  resolve(onrejected(reason));
                } catch (e) {
                  reject(e);
                }
              }
            },
          ]);
          this._executeHandlers();
        });
      }
    
      /** JSDoc */
       catch(
        onrejected,
      ) {
        return this.then(val => val, onrejected);
      }
    
      /** JSDoc */
       finally(onfinally) {
        return new SyncPromise((resolve, reject) => {
          let val;
          let isRejected;
    
          return this.then(
            value => {
              isRejected = false;
              val = value;
              if (onfinally) {
                onfinally();
              }
            },
            reason => {
              isRejected = true;
              val = reason;
              if (onfinally) {
                onfinally();
              }
            },
          ).then(() => {
            if (isRejected) {
              reject(val);
              return;
            }
    
            resolve(val );
          });
        });
      }
    
      /** JSDoc */
        __init3() {this._resolve = (value) => {
        this._setResult(States.RESOLVED, value);
      };}
    
      /** JSDoc */
        __init4() {this._reject = (reason) => {
        this._setResult(States.REJECTED, reason);
      };}
    
      /** JSDoc */
        __init5() {this._setResult = (state, value) => {
        if (this._state !== States.PENDING) {
          return;
        }
    
        if ((0,_is_js__WEBPACK_IMPORTED_MODULE_0__.isThenable)(value)) {
          void (value ).then(this._resolve, this._reject);
          return;
        }
    
        this._state = state;
        this._value = value;
    
        this._executeHandlers();
      };}
    
      /** JSDoc */
        __init6() {this._executeHandlers = () => {
        if (this._state === States.PENDING) {
          return;
        }
    
        const cachedHandlers = this._handlers.slice();
        this._handlers = [];
    
        cachedHandlers.forEach(handler => {
          if (handler[0]) {
            return;
          }
    
          if (this._state === States.RESOLVED) {
            // eslint-disable-next-line @typescript-eslint/no-floating-promises
            handler[1](this._value );
          }
    
          if (this._state === States.REJECTED) {
            handler[2](this._value);
          }
    
          handler[0] = true;
        });
      };}
    }
    
    
    //# sourceMappingURL=syncpromise.js.map
    
    
    /***/ }),
    /* 1615 */
    /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
    
    "use strict";
    __webpack_require__.r(__webpack_exports__);
    /* harmony export */ __webpack_require__.d(__webpack_exports__, {
    /* harmony export */   "CONSOLE_LEVELS": () => (/* binding */ CONSOLE_LEVELS),
    /* harmony export */   "consoleSandbox": () => (/* binding */ consoleSandbox),
    /* harmony export */   "logger": () => (/* binding */ logger)
    /* harmony export */ });
    /* harmony import */ var _worldwide_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1606);
    
    
    /** Prefix for logging strings */
    const PREFIX = 'Sentry Logger ';
    
    const CONSOLE_LEVELS = ['debug', 'info', 'warn', 'error', 'log', 'assert', 'trace'] ;
    
    /**
     * Temporarily disable sentry console instrumentations.
     *
     * @param callback The function to run against the original `console` messages
     * @returns The results of the callback
     */
    function consoleSandbox(callback) {
      if (!('console' in _worldwide_js__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ)) {
        return callback();
      }
    
      const originalConsole = _worldwide_js__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ.console ;
      const wrappedLevels = {};
    
      // Restore all wrapped console methods
      CONSOLE_LEVELS.forEach(level => {
        // TODO(v7): Remove this check as it's only needed for Node 6
        const originalWrappedFunc =
          originalConsole[level] && (originalConsole[level] ).__sentry_original__;
        if (level in originalConsole && originalWrappedFunc) {
          wrappedLevels[level] = originalConsole[level] ;
          originalConsole[level] = originalWrappedFunc ;
        }
      });
    
      try {
        return callback();
      } finally {
        // Revert restoration to wrapped state
        Object.keys(wrappedLevels).forEach(level => {
          originalConsole[level] = wrappedLevels[level ];
        });
      }
    }
    
    function makeLogger() {
      let enabled = false;
      const logger = {
        enable: () => {
          enabled = true;
        },
        disable: () => {
          enabled = false;
        },
      };
    
      if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
        CONSOLE_LEVELS.forEach(name => {
          // eslint-disable-next-line @typescript-eslint/no-explicit-any
          logger[name] = (...args) => {
            if (enabled) {
              consoleSandbox(() => {
                _worldwide_js__WEBPACK_IMPORTED_MODULE_0__.GLOBAL_OBJ.console[name](`${PREFIX}[${name}]:`, ...args);
              });
            }
          };
        });
      } else {
        CONSOLE_LEVELS.forEach(name => {
          logger[name] = () => undefined;
        });
      }
    
      return logger ;
    }
    
    // Ensure we only have a single logger instance, even if multiple versions of @sentry/utils are being used
    let logger;
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      logger = (0,_worldwide_js__WEBPACK_IMPORTED_MODULE_0__.getGlobalSingleton)('logger', makeLogger);
    } else {
      logger = makeLogger();
    }
    
    
    //# sourceMappingURL=logger.js.map
    
    
    /***/ }),
    /* 1616 */
    /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
    
    "use strict";
    __webpack_require__.r(__webpack_exports__);
    /* harmony export */ __webpack_require__.d(__webpack_exports__, {
    /* harmony export */   "SDK_VERSION": () => (/* binding */ SDK_VERSION)
    /* harmony export */ });
    
    build-token's avatar
    build-token committed
    const SDK_VERSION = '7.23.0';
    
    build-token's avatar
    build-token committed
    230701 230702 230703 230704 230705 230706 230707 230708 230709 230710 230711 230712 230713 230714 230715 230716 230717 230718 230719 230720 230721 230722 230723 230724 230725 230726 230727 230728 230729 230730 230731 230732 230733 230734 230735 230736 230737 230738 230739 230740 230741 230742 230743 230744 230745 230746 230747 230748 230749 230750 230751 230752 230753 230754 230755 230756 230757 230758 230759 230760 230761 230762 230763 230764 230765 230766 230767 230768 230769 230770 230771 230772 230773 230774 230775 230776 230777 230778 230779 230780 230781 230782 230783 230784 230785 230786 230787 230788 230789 230790 230791 230792 230793 230794 230795 230796 230797 230798 230799 230800 230801 230802 230803 230804 230805 230806 230807 230808 230809 230810 230811 230812 230813 230814 230815 230816 230817 230818 230819 230820 230821 230822 230823 230824 230825 230826 230827 230828 230829 230830 230831 230832 230833 230834 230835 230836 230837 230838 230839 230840 230841 230842 230843 230844 230845 230846 230847 230848 230849 230850 230851 230852 230853 230854 230855 230856 230857 230858 230859 230860 230861 230862 230863 230864 230865 230866 230867 230868 230869 230870 230871 230872 230873 230874 230875 230876 230877 230878 230879 230880 230881 230882 230883 230884 230885 230886 230887 230888 230889 230890 230891 230892 230893 230894 230895 230896 230897 230898 230899 230900 230901 230902 230903 230904 230905 230906 230907 230908 230909 230910 230911 230912 230913 230914 230915 230916 230917 230918 230919 230920 230921 230922 230923 230924 230925 230926 230927 230928 230929 230930 230931 230932 230933 230934 230935 230936 230937 230938 230939 230940 230941 230942 230943 230944 230945 230946 230947 230948 230949 230950 230951 230952 230953 230954 230955 230956 230957 230958 230959 230960 230961 230962 230963 230964 230965 230966 230967 230968 230969 230970 230971 230972 230973 230974 230975 230976 230977 230978 230979 230980 230981 230982 230983 230984 230985 230986 230987 230988 230989 230990 230991 230992 230993 230994 230995 230996 230997 230998 230999 231000
    
    
    //# sourceMappingURL=version.js.map
    
    
    /***/ }),
    /* 1617 */
    /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
    
    "use strict";
    __webpack_require__.r(__webpack_exports__);
    /* harmony export */ __webpack_require__.d(__webpack_exports__, {
    /* harmony export */   "addBreadcrumb": () => (/* binding */ addBreadcrumb),
    /* harmony export */   "captureEvent": () => (/* binding */ captureEvent),
    /* harmony export */   "captureException": () => (/* binding */ captureException),
    /* harmony export */   "captureMessage": () => (/* binding */ captureMessage),
    /* harmony export */   "configureScope": () => (/* binding */ configureScope),
    /* harmony export */   "setContext": () => (/* binding */ setContext),
    /* harmony export */   "setExtra": () => (/* binding */ setExtra),
    /* harmony export */   "setExtras": () => (/* binding */ setExtras),
    /* harmony export */   "setTag": () => (/* binding */ setTag),
    /* harmony export */   "setTags": () => (/* binding */ setTags),
    /* harmony export */   "setUser": () => (/* binding */ setUser),
    /* harmony export */   "startTransaction": () => (/* binding */ startTransaction),
    /* harmony export */   "withScope": () => (/* binding */ withScope)
    /* harmony export */ });
    /* harmony import */ var _hub_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1602);
    
    
    // Note: All functions in this file are typed with a return value of `ReturnType<Hub[HUB_FUNCTION]>`,
    // where HUB_FUNCTION is some method on the Hub class.
    //
    // This is done to make sure the top level SDK methods stay in sync with the hub methods.
    // Although every method here has an explicit return type, some of them (that map to void returns) do not
    // contain `return` keywords. This is done to save on bundle size, as `return` is not minifiable.
    
    /**
     * Captures an exception event and sends it to Sentry.
     *
     * @param exception An exception-like object.
     * @param captureContext Additional scope data to apply to exception event.
     * @returns The generated eventId.
     */
    // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
    function captureException(exception, captureContext) {
      return (0,_hub_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentHub)().captureException(exception, { captureContext });
    }
    
    /**
     * Captures a message event and sends it to Sentry.
     *
     * @param message The message to send to Sentry.
     * @param Severity Define the level of the message.
     * @returns The generated eventId.
     */
    function captureMessage(
      message,
      // eslint-disable-next-line deprecation/deprecation
      captureContext,
    ) {
      // This is necessary to provide explicit scopes upgrade, without changing the original
      // arity of the `captureMessage(message, level)` method.
      const level = typeof captureContext === 'string' ? captureContext : undefined;
      const context = typeof captureContext !== 'string' ? { captureContext } : undefined;
      return (0,_hub_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentHub)().captureMessage(message, level, context);
    }
    
    /**
     * Captures a manually created event and sends it to Sentry.
     *
     * @param event The event to send to Sentry.
     * @returns The generated eventId.
     */
    function captureEvent(event, hint) {
      return (0,_hub_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentHub)().captureEvent(event, hint);
    }
    
    /**
     * Callback to set context information onto the scope.
     * @param callback Callback function that receives Scope.
     */
    function configureScope(callback) {
      (0,_hub_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentHub)().configureScope(callback);
    }
    
    /**
     * Records a new breadcrumb which will be attached to future events.
     *
     * Breadcrumbs will be added to subsequent events to provide more context on
     * user's actions prior to an error or crash.
     *
     * @param breadcrumb The breadcrumb to record.
     */
    function addBreadcrumb(breadcrumb) {
      (0,_hub_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentHub)().addBreadcrumb(breadcrumb);
    }
    
    /**
     * Sets context data with the given name.
     * @param name of the context
     * @param context Any kind of data. This data will be normalized.
     */
    // eslint-disable-next-line @typescript-eslint/no-explicit-any
    function setContext(name, context) {
      (0,_hub_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentHub)().setContext(name, context);
    }
    
    /**
     * Set an object that will be merged sent as extra data with the event.
     * @param extras Extras object to merge into current context.
     */
    function setExtras(extras) {
      (0,_hub_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentHub)().setExtras(extras);
    }
    
    /**
     * Set key:value that will be sent as extra data with the event.
     * @param key String of extra
     * @param extra Any kind of data. This data will be normalized.
     */
    function setExtra(key, extra) {
      (0,_hub_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentHub)().setExtra(key, extra);
    }
    
    /**
     * Set an object that will be merged sent as tags data with the event.
     * @param tags Tags context object to merge into current context.
     */
    function setTags(tags) {
      (0,_hub_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentHub)().setTags(tags);
    }
    
    /**
     * Set key:value that will be sent as tags data with the event.
     *
     * Can also be used to unset a tag, by passing `undefined`.
     *
     * @param key String key of tag
     * @param value Value of tag
     */
    function setTag(key, value) {
      (0,_hub_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentHub)().setTag(key, value);
    }
    
    /**
     * Updates user context information for future events.
     *
     * @param user User context object to be set in the current context. Pass `null` to unset the user.
     */
    function setUser(user) {
      (0,_hub_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentHub)().setUser(user);
    }
    
    /**
     * Creates a new scope with and executes the given operation within.
     * The scope is automatically removed once the operation
     * finishes or throws.
     *
     * This is essentially a convenience function for:
     *
     *     pushScope();
     *     callback();
     *     popScope();
     *
     * @param callback that will be enclosed into push/popScope.
     */
    function withScope(callback) {
      (0,_hub_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentHub)().withScope(callback);
    }
    
    /**
     * Starts a new `Transaction` and returns it. This is the entry point to manual tracing instrumentation.
     *
     * A tree structure can be built by adding child spans to the transaction, and child spans to other spans. To start a
     * new child span within the transaction or any span, call the respective `.startChild()` method.
     *
     * Every child span must be finished before the transaction is finished, otherwise the unfinished spans are discarded.
     *
     * The transaction must be finished with a call to its `.finish()` method, at which point the transaction with all its
     * finished child spans will be sent to Sentry.
     *
     * NOTE: This function should only be used for *manual* instrumentation. Auto-instrumentation should call
     * `startTransaction` directly on the hub.
     *
     * @param context Properties of the new `Transaction`.
     * @param customSamplingContext Information given to the transaction sampling function (along with context-dependent
     * default values). See {@link Options.tracesSampler}.
     *
     * @returns The transaction which was just started
     */
    function startTransaction(
      context,
      customSamplingContext,
    ) {
      return (0,_hub_js__WEBPACK_IMPORTED_MODULE_0__.getCurrentHub)().startTransaction({ ...context }, customSamplingContext);
    }
    
    
    //# sourceMappingURL=exports.js.map
    
    
    /***/ }),
    /* 1618 */
    /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
    
    "use strict";
    __webpack_require__.r(__webpack_exports__);
    /* harmony export */ __webpack_require__.d(__webpack_exports__, {
    /* harmony export */   "DEFAULT_TRANSPORT_BUFFER_SIZE": () => (/* binding */ DEFAULT_TRANSPORT_BUFFER_SIZE),
    /* harmony export */   "createTransport": () => (/* binding */ createTransport)
    /* harmony export */ });
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1619);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1621);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1626);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1614);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1615);
    /* harmony import */ var _sentry_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1620);
    
    
    const DEFAULT_TRANSPORT_BUFFER_SIZE = 30;
    
    /**
     * Creates an instance of a Sentry `Transport`
     *
     * @param options
     * @param makeRequest
     */
    function createTransport(
      options,
      makeRequest,
      buffer = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_0__.makePromiseBuffer)(options.bufferSize || DEFAULT_TRANSPORT_BUFFER_SIZE),
    ) {
      let rateLimits = {};
    
      const flush = (timeout) => buffer.drain(timeout);
    
      function send(envelope) {
        const filteredEnvelopeItems = [];
    
        // Drop rate limited items from envelope
        (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.forEachEnvelopeItem)(envelope, (item, type) => {
          const envelopeItemDataCategory = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.envelopeItemTypeToDataCategory)(type);
          if ((0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__.isRateLimited)(rateLimits, envelopeItemDataCategory)) {
            const event = getEventForEnvelopeItem(item, type);
            options.recordDroppedEvent('ratelimit_backoff', envelopeItemDataCategory, event);
          } else {
            filteredEnvelopeItems.push(item);
          }
        });
    
        // Skip sending if envelope is empty after filtering out rate limited events
        if (filteredEnvelopeItems.length === 0) {
          return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__.resolvedSyncPromise)();
        }
    
        // eslint-disable-next-line @typescript-eslint/no-explicit-any
        const filteredEnvelope = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.createEnvelope)(envelope[0], filteredEnvelopeItems );
    
        // Creates client report for each item in an envelope
        const recordEnvelopeLoss = (reason) => {
          (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.forEachEnvelopeItem)(filteredEnvelope, (item, type) => {
            const event = getEventForEnvelopeItem(item, type);
            options.recordDroppedEvent(reason, (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.envelopeItemTypeToDataCategory)(type), event);
          });
        };
    
        const requestTask = () =>
          makeRequest({ body: (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_1__.serializeEnvelope)(filteredEnvelope, options.textEncoder) }).then(
            response => {
              // We don't want to throw on NOK responses, but we want to at least log them
              if (response.statusCode !== undefined && (response.statusCode < 200 || response.statusCode >= 300)) {
                (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_4__.logger.warn(`Sentry responded with status code ${response.statusCode} to sent event.`);
              }
    
              rateLimits = (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_2__.updateRateLimits)(rateLimits, response);
            },
            error => {
              (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_4__.logger.error('Failed while sending event:', error);
              recordEnvelopeLoss('network_error');
            },
          );
    
        return buffer.add(requestTask).then(
          result => result,
          error => {
            if (error instanceof _sentry_utils__WEBPACK_IMPORTED_MODULE_5__.SentryError) {
              (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && _sentry_utils__WEBPACK_IMPORTED_MODULE_4__.logger.error('Skipped sending event because buffer is full.');
              recordEnvelopeLoss('queue_overflow');
              return (0,_sentry_utils__WEBPACK_IMPORTED_MODULE_3__.resolvedSyncPromise)();
            } else {
              throw error;
            }
          },
        );
      }
    
      return {
        send,
        flush,
      };