/ rollbar.js
rollbar.js
  1  var isDev = /dev\./.test(window.location.hostname);
  2  var _rollbarConfig = {
  3    accessToken: 'ec3e07829d324a29abf6c83472a9740d',
  4    captureUncaught: true,
  5    captureUnhandledRejections: true,
  6    enabled: isDev,
  7    hostSafeList: ['dev.phanpy.social', 'phanpy.social'],
  8    payload: {
  9      environment: isDev ? 'development' : 'production',
 10    },
 11  };
 12  
 13  // Rollbar Snippet
 14  !(function (r) {
 15    var e = {};
 16    function o(n) {
 17      if (e[n]) return e[n].exports;
 18      var t = (e[n] = { i: n, l: !1, exports: {} });
 19      return r[n].call(t.exports, t, t.exports, o), (t.l = !0), t.exports;
 20    }
 21    (o.m = r),
 22      (o.c = e),
 23      (o.d = function (r, e, n) {
 24        o.o(r, e) || Object.defineProperty(r, e, { enumerable: !0, get: n });
 25      }),
 26      (o.r = function (r) {
 27        'undefined' != typeof Symbol &&
 28          Symbol.toStringTag &&
 29          Object.defineProperty(r, Symbol.toStringTag, { value: 'Module' }),
 30          Object.defineProperty(r, '__esModule', { value: !0 });
 31      }),
 32      (o.t = function (r, e) {
 33        if ((1 & e && (r = o(r)), 8 & e)) return r;
 34        if (4 & e && 'object' == typeof r && r && r.__esModule) return r;
 35        var n = Object.create(null);
 36        if (
 37          (o.r(n),
 38          Object.defineProperty(n, 'default', { enumerable: !0, value: r }),
 39          2 & e && 'string' != typeof r)
 40        )
 41          for (var t in r)
 42            o.d(
 43              n,
 44              t,
 45              function (e) {
 46                return r[e];
 47              }.bind(null, t),
 48            );
 49        return n;
 50      }),
 51      (o.n = function (r) {
 52        var e =
 53          r && r.__esModule
 54            ? function () {
 55                return r.default;
 56              }
 57            : function () {
 58                return r;
 59              };
 60        return o.d(e, 'a', e), e;
 61      }),
 62      (o.o = function (r, e) {
 63        return Object.prototype.hasOwnProperty.call(r, e);
 64      }),
 65      (o.p = ''),
 66      o((o.s = 0));
 67  })([
 68    function (r, e, o) {
 69      'use strict';
 70      var n = o(1),
 71        t = o(5);
 72      (_rollbarConfig = _rollbarConfig || {}),
 73        (_rollbarConfig.rollbarJsUrl =
 74          _rollbarConfig.rollbarJsUrl ||
 75          'https://cdn.rollbar.com/rollbarjs/refs/tags/v2.26.0/rollbar.min.js'),
 76        (_rollbarConfig.async =
 77          void 0 === _rollbarConfig.async || _rollbarConfig.async);
 78      var a = n.setupShim(window, _rollbarConfig),
 79        l = t(_rollbarConfig);
 80      (window.rollbar = n.Rollbar),
 81        a.loadFull(window, document, !_rollbarConfig.async, _rollbarConfig, l);
 82    },
 83    function (r, e, o) {
 84      'use strict';
 85      var n = o(2),
 86        t = o(3);
 87      function a(r) {
 88        return function () {
 89          try {
 90            return r.apply(this, arguments);
 91          } catch (r) {
 92            try {
 93              console.error('[Rollbar]: Internal error', r);
 94            } catch (r) {}
 95          }
 96        };
 97      }
 98      var l = 0;
 99      function i(r, e) {
100        (this.options = r), (this._rollbarOldOnError = null);
101        var o = l++;
102        (this.shimId = function () {
103          return o;
104        }),
105          'undefined' != typeof window &&
106            window._rollbarShims &&
107            (window._rollbarShims[o] = { handler: e, messages: [] });
108      }
109      var s = o(4),
110        d = function (r, e) {
111          return new i(r, e);
112        },
113        c = function (r) {
114          return new s(d, r);
115        };
116      function u(r) {
117        return a(function () {
118          var e = this,
119            o = Array.prototype.slice.call(arguments, 0),
120            n = { shim: e, method: r, args: o, ts: new Date() };
121          window._rollbarShims[this.shimId()].messages.push(n);
122        });
123      }
124      (i.prototype.loadFull = function (r, e, o, n, t) {
125        var l = !1,
126          i = e.createElement('script'),
127          s = e.getElementsByTagName('script')[0],
128          d = s.parentNode;
129        (i.crossOrigin = ''),
130          (i.src = n.rollbarJsUrl),
131          o || (i.async = !0),
132          (i.onload = i.onreadystatechange =
133            a(function () {
134              if (
135                !(
136                  l ||
137                  (this.readyState &&
138                    'loaded' !== this.readyState &&
139                    'complete' !== this.readyState)
140                )
141              ) {
142                i.onload = i.onreadystatechange = null;
143                try {
144                  d.removeChild(i);
145                } catch (r) {}
146                (l = !0),
147                  (function () {
148                    var e;
149                    if (void 0 === r._rollbarDidLoad) {
150                      e = new Error('rollbar.js did not load');
151                      for (var o, n, a, l, i = 0; (o = r._rollbarShims[i++]); )
152                        for (o = o.messages || []; (n = o.shift()); )
153                          for (a = n.args || [], i = 0; i < a.length; ++i)
154                            if ('function' == typeof (l = a[i])) {
155                              l(e);
156                              break;
157                            }
158                    }
159                    'function' == typeof t && t(e);
160                  })();
161              }
162            })),
163          d.insertBefore(i, s);
164      }),
165        (i.prototype.wrap = function (r, e, o) {
166          try {
167            var n;
168            if (
169              ((n =
170                'function' == typeof e
171                  ? e
172                  : function () {
173                      return e || {};
174                    }),
175              'function' != typeof r)
176            )
177              return r;
178            if (r._isWrap) return r;
179            if (
180              !r._rollbar_wrapped &&
181              ((r._rollbar_wrapped = function () {
182                o && 'function' == typeof o && o.apply(this, arguments);
183                try {
184                  return r.apply(this, arguments);
185                } catch (o) {
186                  var e = o;
187                  throw (
188                    (e &&
189                      ('string' == typeof e && (e = new String(e)),
190                      (e._rollbarContext = n() || {}),
191                      (e._rollbarContext._wrappedSource = r.toString()),
192                      (window._rollbarWrappedError = e)),
193                    e)
194                  );
195                }
196              }),
197              (r._rollbar_wrapped._isWrap = !0),
198              r.hasOwnProperty)
199            )
200              for (var t in r)
201                r.hasOwnProperty(t) && (r._rollbar_wrapped[t] = r[t]);
202            return r._rollbar_wrapped;
203          } catch (e) {
204            return r;
205          }
206        });
207      for (
208        var p =
209            'log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleAnonymousErrors,handleUnhandledRejection,captureEvent,captureDomContentLoaded,captureLoad'.split(
210              ',',
211            ),
212          f = 0;
213        f < p.length;
214        ++f
215      )
216        i.prototype[p[f]] = u(p[f]);
217      r.exports = {
218        setupShim: function (r, e) {
219          if (r) {
220            var o = e.globalAlias || 'Rollbar';
221            if ('object' == typeof r[o]) return r[o];
222            (r._rollbarShims = {}), (r._rollbarWrappedError = null);
223            var l = new c(e);
224            return a(function () {
225              e.captureUncaught &&
226                ((l._rollbarOldOnError = r.onerror),
227                n.captureUncaughtExceptions(r, l, !0),
228                e.wrapGlobalEventHandlers && t(r, l, !0)),
229                e.captureUnhandledRejections &&
230                  n.captureUnhandledRejections(r, l, !0);
231              var a = e.autoInstrument;
232              return (
233                !1 !== e.enabled &&
234                  (void 0 === a ||
235                    !0 === a ||
236                    (function (r) {
237                      return !(
238                        'object' != typeof r ||
239                        (void 0 !== r.page && !r.page)
240                      );
241                    })(a)) &&
242                  r.addEventListener &&
243                  (r.addEventListener('load', l.captureLoad.bind(l)),
244                  r.addEventListener(
245                    'DOMContentLoaded',
246                    l.captureDomContentLoaded.bind(l),
247                  )),
248                (r[o] = l),
249                l
250              );
251            })();
252          }
253        },
254        Rollbar: c,
255      };
256    },
257    function (r, e, o) {
258      'use strict';
259      function n(r, e, o, n) {
260        r._rollbarWrappedError &&
261          (n[4] || (n[4] = r._rollbarWrappedError),
262          n[5] || (n[5] = r._rollbarWrappedError._rollbarContext),
263          (r._rollbarWrappedError = null));
264        var t = e.handleUncaughtException.apply(e, n);
265        o && o.apply(r, n), 'anonymous' === t && (e.anonymousErrorsPending += 1);
266      }
267      r.exports = {
268        captureUncaughtExceptions: function (r, e, o) {
269          if (r) {
270            var t;
271            if ('function' == typeof e._rollbarOldOnError)
272              t = e._rollbarOldOnError;
273            else if (r.onerror) {
274              for (t = r.onerror; t._rollbarOldOnError; )
275                t = t._rollbarOldOnError;
276              e._rollbarOldOnError = t;
277            }
278            e.handleAnonymousErrors();
279            var a = function () {
280              var o = Array.prototype.slice.call(arguments, 0);
281              n(r, e, t, o);
282            };
283            o && (a._rollbarOldOnError = t), (r.onerror = a);
284          }
285        },
286        captureUnhandledRejections: function (r, e, o) {
287          if (r) {
288            'function' == typeof r._rollbarURH &&
289              r._rollbarURH.belongsToShim &&
290              r.removeEventListener('unhandledrejection', r._rollbarURH);
291            var n = function (r) {
292              var o, n, t;
293              try {
294                o = r.reason;
295              } catch (r) {
296                o = void 0;
297              }
298              try {
299                n = r.promise;
300              } catch (r) {
301                n = '[unhandledrejection] error getting `promise` from event';
302              }
303              try {
304                (t = r.detail), !o && t && ((o = t.reason), (n = t.promise));
305              } catch (r) {}
306              o || (o = '[unhandledrejection] error getting `reason` from event'),
307                e &&
308                  e.handleUnhandledRejection &&
309                  e.handleUnhandledRejection(o, n);
310            };
311            (n.belongsToShim = o),
312              (r._rollbarURH = n),
313              r.addEventListener('unhandledrejection', n);
314          }
315        },
316      };
317    },
318    function (r, e, o) {
319      'use strict';
320      function n(r, e, o) {
321        if (e.hasOwnProperty && e.hasOwnProperty('addEventListener')) {
322          for (var n = e.addEventListener; n._rollbarOldAdd && n.belongsToShim; )
323            n = n._rollbarOldAdd;
324          var t = function (e, o, t) {
325            n.call(this, e, r.wrap(o), t);
326          };
327          (t._rollbarOldAdd = n), (t.belongsToShim = o), (e.addEventListener = t);
328          for (
329            var a = e.removeEventListener;
330            a._rollbarOldRemove && a.belongsToShim;
331  
332          )
333            a = a._rollbarOldRemove;
334          var l = function (r, e, o) {
335            a.call(this, r, (e && e._rollbar_wrapped) || e, o);
336          };
337          (l._rollbarOldRemove = a),
338            (l.belongsToShim = o),
339            (e.removeEventListener = l);
340        }
341      }
342      r.exports = function (r, e, o) {
343        if (r) {
344          var t,
345            a,
346            l =
347              'EventTarget,Window,Node,ApplicationCache,AudioTrackList,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload'.split(
348                ',',
349              );
350          for (t = 0; t < l.length; ++t)
351            r[(a = l[t])] && r[a].prototype && n(e, r[a].prototype, o);
352        }
353      };
354    },
355    function (r, e, o) {
356      'use strict';
357      function n(r, e) {
358        (this.impl = r(e, this)),
359          (this.options = e),
360          (function (r) {
361            for (
362              var e = function (r) {
363                  return function () {
364                    var e = Array.prototype.slice.call(arguments, 0);
365                    if (this.impl[r]) return this.impl[r].apply(this.impl, e);
366                  };
367                },
368                o =
369                  'log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleAnonymousErrors,handleUnhandledRejection,_createItem,wrap,loadFull,shimId,captureEvent,captureDomContentLoaded,captureLoad'.split(
370                    ',',
371                  ),
372                n = 0;
373              n < o.length;
374              n++
375            )
376              r[o[n]] = e(o[n]);
377          })(n.prototype);
378      }
379      (n.prototype._swapAndProcessMessages = function (r, e) {
380        var o, n, t;
381        for (this.impl = r(this.options); (o = e.shift()); )
382          (n = o.method),
383            (t = o.args),
384            this[n] &&
385              'function' == typeof this[n] &&
386              ('captureDomContentLoaded' === n || 'captureLoad' === n
387                ? this[n].apply(this, [t[0], o.ts])
388                : this[n].apply(this, t));
389        return this;
390      }),
391        (r.exports = n);
392    },
393    function (r, e, o) {
394      'use strict';
395      r.exports = function (r) {
396        return function (e) {
397          if (!e && !window._rollbarInitialized) {
398            for (
399              var o,
400                n,
401                t = (r = r || {}).globalAlias || 'Rollbar',
402                a = window.rollbar,
403                l = function (r) {
404                  return new a(r);
405                },
406                i = 0;
407              (o = window._rollbarShims[i++]);
408  
409            )
410              n || (n = o.handler),
411                o.handler._swapAndProcessMessages(l, o.messages);
412            (window[t] = n), (window._rollbarInitialized = !0);
413          }
414        };
415      };
416    },
417  ]);
418  // End Rollbar Snippet