rollbar 2.25.0 → 2.25.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- !function(r){var e={};function o(n){if(e[n])return e[n].exports;var t=e[n]={i:n,l:!1,exports:{}};return r[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=r,o.c=e,o.d=function(r,e,n){o.o(r,e)||Object.defineProperty(r,e,{enumerable:!0,get:n})},o.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},o.t=function(r,e){if(1&e&&(r=o(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var t in r)o.d(n,t,function(e){return r[e]}.bind(null,t));return n},o.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return o.d(e,"a",e),e},o.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)},o.p="",o(o.s=0)}([function(r,e,o){"use strict";var n=o(1),t=o(5);_rollbarConfig=_rollbarConfig||{},_rollbarConfig.rollbarJsUrl=_rollbarConfig.rollbarJsUrl||"https://cdn.rollbar.com/rollbarjs/refs/tags/v2.25.0/rollbar.min.js",_rollbarConfig.async=void 0===_rollbarConfig.async||_rollbarConfig.async;var a=n.setupShim(window,_rollbarConfig),l=t(_rollbarConfig);window.rollbar=n.Rollbar,a.loadFull(window,document,!_rollbarConfig.async,_rollbarConfig,l)},function(r,e,o){"use strict";var n=o(2),t=o(3);function a(r){return function(){try{return r.apply(this,arguments)}catch(r){try{console.error("[Rollbar]: Internal error",r)}catch(r){}}}}var l=0;function i(r,e){this.options=r,this._rollbarOldOnError=null;var o=l++;this.shimId=function(){return o},"undefined"!=typeof window&&window._rollbarShims&&(window._rollbarShims[o]={handler:e,messages:[]})}var s=o(4),d=function(r,e){return new i(r,e)},c=function(r){return new s(d,r)};function u(r){return a((function(){var e=this,o=Array.prototype.slice.call(arguments,0),n={shim:e,method:r,args:o,ts:new Date};window._rollbarShims[this.shimId()].messages.push(n)}))}i.prototype.loadFull=function(r,e,o,n,t){var l=!1,i=e.createElement("script"),s=e.getElementsByTagName("script")[0],d=s.parentNode;i.crossOrigin="",i.src=n.rollbarJsUrl,o||(i.async=!0),i.onload=i.onreadystatechange=a((function(){if(!(l||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState)){i.onload=i.onreadystatechange=null;try{d.removeChild(i)}catch(r){}l=!0,function(){var e;if(void 0===r._rollbarDidLoad){e=new Error("rollbar.js did not load");for(var o,n,a,l,i=0;o=r._rollbarShims[i++];)for(o=o.messages||[];n=o.shift();)for(a=n.args||[],i=0;i<a.length;++i)if("function"==typeof(l=a[i])){l(e);break}}"function"==typeof t&&t(e)}()}})),d.insertBefore(i,s)},i.prototype.wrap=function(r,e,o){try{var n;if(n="function"==typeof e?e:function(){return e||{}},"function"!=typeof r)return r;if(r._isWrap)return r;if(!r._rollbar_wrapped&&(r._rollbar_wrapped=function(){o&&"function"==typeof o&&o.apply(this,arguments);try{return r.apply(this,arguments)}catch(o){var e=o;throw e&&("string"==typeof e&&(e=new String(e)),e._rollbarContext=n()||{},e._rollbarContext._wrappedSource=r.toString(),window._rollbarWrappedError=e),e}},r._rollbar_wrapped._isWrap=!0,r.hasOwnProperty))for(var t in r)r.hasOwnProperty(t)&&(r._rollbar_wrapped[t]=r[t]);return r._rollbar_wrapped}catch(e){return r}};for(var p="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleAnonymousErrors,handleUnhandledRejection,captureEvent,captureDomContentLoaded,captureLoad".split(","),f=0;f<p.length;++f)i.prototype[p[f]]=u(p[f]);r.exports={setupShim:function(r,e){if(r){var o=e.globalAlias||"Rollbar";if("object"==typeof r[o])return r[o];r._rollbarShims={},r._rollbarWrappedError=null;var l=new c(e);return a((function(){e.captureUncaught&&(l._rollbarOldOnError=r.onerror,n.captureUncaughtExceptions(r,l,!0),e.wrapGlobalEventHandlers&&t(r,l,!0)),e.captureUnhandledRejections&&n.captureUnhandledRejections(r,l,!0);var a=e.autoInstrument;return!1!==e.enabled&&(void 0===a||!0===a||"object"==typeof a&&a.network)&&r.addEventListener&&(r.addEventListener("load",l.captureLoad.bind(l)),r.addEventListener("DOMContentLoaded",l.captureDomContentLoaded.bind(l))),r[o]=l,l}))()}},Rollbar:c}},function(r,e,o){"use strict";function n(r,e,o,n){r._rollbarWrappedError&&(n[4]||(n[4]=r._rollbarWrappedError),n[5]||(n[5]=r._rollbarWrappedError._rollbarContext),r._rollbarWrappedError=null);var t=e.handleUncaughtException.apply(e,n);o&&o.apply(r,n),"anonymous"===t&&(e.anonymousErrorsPending+=1)}r.exports={captureUncaughtExceptions:function(r,e,o){if(r){var t;if("function"==typeof e._rollbarOldOnError)t=e._rollbarOldOnError;else if(r.onerror){for(t=r.onerror;t._rollbarOldOnError;)t=t._rollbarOldOnError;e._rollbarOldOnError=t}e.handleAnonymousErrors();var a=function(){var o=Array.prototype.slice.call(arguments,0);n(r,e,t,o)};o&&(a._rollbarOldOnError=t),r.onerror=a}},captureUnhandledRejections:function(r,e,o){if(r){"function"==typeof r._rollbarURH&&r._rollbarURH.belongsToShim&&r.removeEventListener("unhandledrejection",r._rollbarURH);var n=function(r){var o,n,t;try{o=r.reason}catch(r){o=void 0}try{n=r.promise}catch(r){n="[unhandledrejection] error getting `promise` from event"}try{t=r.detail,!o&&t&&(o=t.reason,n=t.promise)}catch(r){}o||(o="[unhandledrejection] error getting `reason` from event"),e&&e.handleUnhandledRejection&&e.handleUnhandledRejection(o,n)};n.belongsToShim=o,r._rollbarURH=n,r.addEventListener("unhandledrejection",n)}}}},function(r,e,o){"use strict";function n(r,e,o){if(e.hasOwnProperty&&e.hasOwnProperty("addEventListener")){for(var n=e.addEventListener;n._rollbarOldAdd&&n.belongsToShim;)n=n._rollbarOldAdd;var t=function(e,o,t){n.call(this,e,r.wrap(o),t)};t._rollbarOldAdd=n,t.belongsToShim=o,e.addEventListener=t;for(var a=e.removeEventListener;a._rollbarOldRemove&&a.belongsToShim;)a=a._rollbarOldRemove;var l=function(r,e,o){a.call(this,r,e&&e._rollbar_wrapped||e,o)};l._rollbarOldRemove=a,l.belongsToShim=o,e.removeEventListener=l}}r.exports=function(r,e,o){if(r){var t,a,l="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(",");for(t=0;t<l.length;++t)r[a=l[t]]&&r[a].prototype&&n(e,r[a].prototype,o)}}},function(r,e,o){"use strict";function n(r,e){this.impl=r(e,this),this.options=e,function(r){for(var e=function(r){return function(){var e=Array.prototype.slice.call(arguments,0);if(this.impl[r])return this.impl[r].apply(this.impl,e)}},o="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleAnonymousErrors,handleUnhandledRejection,_createItem,wrap,loadFull,shimId,captureEvent,captureDomContentLoaded,captureLoad".split(","),n=0;n<o.length;n++)r[o[n]]=e(o[n])}(n.prototype)}n.prototype._swapAndProcessMessages=function(r,e){var o,n,t;for(this.impl=r(this.options);o=e.shift();)n=o.method,t=o.args,this[n]&&"function"==typeof this[n]&&("captureDomContentLoaded"===n||"captureLoad"===n?this[n].apply(this,[t[0],o.ts]):this[n].apply(this,t));return this},r.exports=n},function(r,e,o){"use strict";r.exports=function(r){return function(e){if(!e&&!window._rollbarInitialized){for(var o,n,t=(r=r||{}).globalAlias||"Rollbar",a=window.rollbar,l=function(r){return new a(r)},i=0;o=window._rollbarShims[i++];)n||(n=o.handler),o.handler._swapAndProcessMessages(l,o.messages);window[t]=n,window._rollbarInitialized=!0}}}}]);
1
+ !function(r){var e={};function o(n){if(e[n])return e[n].exports;var t=e[n]={i:n,l:!1,exports:{}};return r[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=r,o.c=e,o.d=function(r,e,n){o.o(r,e)||Object.defineProperty(r,e,{enumerable:!0,get:n})},o.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},o.t=function(r,e){if(1&e&&(r=o(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var t in r)o.d(n,t,function(e){return r[e]}.bind(null,t));return n},o.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return o.d(e,"a",e),e},o.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)},o.p="",o(o.s=0)}([function(r,e,o){"use strict";var n=o(1),t=o(5);_rollbarConfig=_rollbarConfig||{},_rollbarConfig.rollbarJsUrl=_rollbarConfig.rollbarJsUrl||"https://cdn.rollbar.com/rollbarjs/refs/tags/v2.25.2/rollbar.min.js",_rollbarConfig.async=void 0===_rollbarConfig.async||_rollbarConfig.async;var a=n.setupShim(window,_rollbarConfig),l=t(_rollbarConfig);window.rollbar=n.Rollbar,a.loadFull(window,document,!_rollbarConfig.async,_rollbarConfig,l)},function(r,e,o){"use strict";var n=o(2),t=o(3);function a(r){return function(){try{return r.apply(this,arguments)}catch(r){try{console.error("[Rollbar]: Internal error",r)}catch(r){}}}}var l=0;function i(r,e){this.options=r,this._rollbarOldOnError=null;var o=l++;this.shimId=function(){return o},"undefined"!=typeof window&&window._rollbarShims&&(window._rollbarShims[o]={handler:e,messages:[]})}var s=o(4),d=function(r,e){return new i(r,e)},c=function(r){return new s(d,r)};function u(r){return a((function(){var e=this,o=Array.prototype.slice.call(arguments,0),n={shim:e,method:r,args:o,ts:new Date};window._rollbarShims[this.shimId()].messages.push(n)}))}i.prototype.loadFull=function(r,e,o,n,t){var l=!1,i=e.createElement("script"),s=e.getElementsByTagName("script")[0],d=s.parentNode;i.crossOrigin="",i.src=n.rollbarJsUrl,o||(i.async=!0),i.onload=i.onreadystatechange=a((function(){if(!(l||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState)){i.onload=i.onreadystatechange=null;try{d.removeChild(i)}catch(r){}l=!0,function(){var e;if(void 0===r._rollbarDidLoad){e=new Error("rollbar.js did not load");for(var o,n,a,l,i=0;o=r._rollbarShims[i++];)for(o=o.messages||[];n=o.shift();)for(a=n.args||[],i=0;i<a.length;++i)if("function"==typeof(l=a[i])){l(e);break}}"function"==typeof t&&t(e)}()}})),d.insertBefore(i,s)},i.prototype.wrap=function(r,e,o){try{var n;if(n="function"==typeof e?e:function(){return e||{}},"function"!=typeof r)return r;if(r._isWrap)return r;if(!r._rollbar_wrapped&&(r._rollbar_wrapped=function(){o&&"function"==typeof o&&o.apply(this,arguments);try{return r.apply(this,arguments)}catch(o){var e=o;throw e&&("string"==typeof e&&(e=new String(e)),e._rollbarContext=n()||{},e._rollbarContext._wrappedSource=r.toString(),window._rollbarWrappedError=e),e}},r._rollbar_wrapped._isWrap=!0,r.hasOwnProperty))for(var t in r)r.hasOwnProperty(t)&&(r._rollbar_wrapped[t]=r[t]);return r._rollbar_wrapped}catch(e){return r}};for(var p="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleAnonymousErrors,handleUnhandledRejection,captureEvent,captureDomContentLoaded,captureLoad".split(","),f=0;f<p.length;++f)i.prototype[p[f]]=u(p[f]);r.exports={setupShim:function(r,e){if(r){var o=e.globalAlias||"Rollbar";if("object"==typeof r[o])return r[o];r._rollbarShims={},r._rollbarWrappedError=null;var l=new c(e);return a((function(){e.captureUncaught&&(l._rollbarOldOnError=r.onerror,n.captureUncaughtExceptions(r,l,!0),e.wrapGlobalEventHandlers&&t(r,l,!0)),e.captureUnhandledRejections&&n.captureUnhandledRejections(r,l,!0);var a=e.autoInstrument;return!1!==e.enabled&&(void 0===a||!0===a||function(r){return!("object"!=typeof r||void 0!==r.page&&!r.page)}(a))&&r.addEventListener&&(r.addEventListener("load",l.captureLoad.bind(l)),r.addEventListener("DOMContentLoaded",l.captureDomContentLoaded.bind(l))),r[o]=l,l}))()}},Rollbar:c}},function(r,e,o){"use strict";function n(r,e,o,n){r._rollbarWrappedError&&(n[4]||(n[4]=r._rollbarWrappedError),n[5]||(n[5]=r._rollbarWrappedError._rollbarContext),r._rollbarWrappedError=null);var t=e.handleUncaughtException.apply(e,n);o&&o.apply(r,n),"anonymous"===t&&(e.anonymousErrorsPending+=1)}r.exports={captureUncaughtExceptions:function(r,e,o){if(r){var t;if("function"==typeof e._rollbarOldOnError)t=e._rollbarOldOnError;else if(r.onerror){for(t=r.onerror;t._rollbarOldOnError;)t=t._rollbarOldOnError;e._rollbarOldOnError=t}e.handleAnonymousErrors();var a=function(){var o=Array.prototype.slice.call(arguments,0);n(r,e,t,o)};o&&(a._rollbarOldOnError=t),r.onerror=a}},captureUnhandledRejections:function(r,e,o){if(r){"function"==typeof r._rollbarURH&&r._rollbarURH.belongsToShim&&r.removeEventListener("unhandledrejection",r._rollbarURH);var n=function(r){var o,n,t;try{o=r.reason}catch(r){o=void 0}try{n=r.promise}catch(r){n="[unhandledrejection] error getting `promise` from event"}try{t=r.detail,!o&&t&&(o=t.reason,n=t.promise)}catch(r){}o||(o="[unhandledrejection] error getting `reason` from event"),e&&e.handleUnhandledRejection&&e.handleUnhandledRejection(o,n)};n.belongsToShim=o,r._rollbarURH=n,r.addEventListener("unhandledrejection",n)}}}},function(r,e,o){"use strict";function n(r,e,o){if(e.hasOwnProperty&&e.hasOwnProperty("addEventListener")){for(var n=e.addEventListener;n._rollbarOldAdd&&n.belongsToShim;)n=n._rollbarOldAdd;var t=function(e,o,t){n.call(this,e,r.wrap(o),t)};t._rollbarOldAdd=n,t.belongsToShim=o,e.addEventListener=t;for(var a=e.removeEventListener;a._rollbarOldRemove&&a.belongsToShim;)a=a._rollbarOldRemove;var l=function(r,e,o){a.call(this,r,e&&e._rollbar_wrapped||e,o)};l._rollbarOldRemove=a,l.belongsToShim=o,e.removeEventListener=l}}r.exports=function(r,e,o){if(r){var t,a,l="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(",");for(t=0;t<l.length;++t)r[a=l[t]]&&r[a].prototype&&n(e,r[a].prototype,o)}}},function(r,e,o){"use strict";function n(r,e){this.impl=r(e,this),this.options=e,function(r){for(var e=function(r){return function(){var e=Array.prototype.slice.call(arguments,0);if(this.impl[r])return this.impl[r].apply(this.impl,e)}},o="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleAnonymousErrors,handleUnhandledRejection,_createItem,wrap,loadFull,shimId,captureEvent,captureDomContentLoaded,captureLoad".split(","),n=0;n<o.length;n++)r[o[n]]=e(o[n])}(n.prototype)}n.prototype._swapAndProcessMessages=function(r,e){var o,n,t;for(this.impl=r(this.options);o=e.shift();)n=o.method,t=o.args,this[n]&&"function"==typeof this[n]&&("captureDomContentLoaded"===n||"captureLoad"===n?this[n].apply(this,[t[0],o.ts]):this[n].apply(this,t));return this},r.exports=n},function(r,e,o){"use strict";r.exports=function(r){return function(e){if(!e&&!window._rollbarInitialized){for(var o,n,t=(r=r||{}).globalAlias||"Rollbar",a=window.rollbar,l=function(r){return new a(r)},i=0;o=window._rollbarShims[i++];)n||(n=o.handler),o.handler._swapAndProcessMessages(l,o.messages);window[t]=n,window._rollbarInitialized=!0}}}}]);
@@ -1366,10 +1366,10 @@ module.exports = rollbar;
1366
1366
  var Rollbar = __webpack_require__(9);
1367
1367
  var telemeter = __webpack_require__(29);
1368
1368
  var instrumenter = __webpack_require__(30);
1369
- var polyfillJSON = __webpack_require__(32);
1370
- var wrapGlobals = __webpack_require__(34);
1369
+ var polyfillJSON = __webpack_require__(33);
1370
+ var wrapGlobals = __webpack_require__(35);
1371
1371
  var scrub = __webpack_require__(4);
1372
- var truncation = __webpack_require__(35);
1372
+ var truncation = __webpack_require__(36);
1373
1373
 
1374
1374
  Rollbar.setComponents({
1375
1375
  telemeter: telemeter,
@@ -2914,7 +2914,12 @@ function Api(options, transport, urllib, truncation, jsonBackup) {
2914
2914
  Api.prototype.postItem = function(data, callback) {
2915
2915
  var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');
2916
2916
  var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);
2917
- this.transport.post(this.accessToken, transportOptions, payload, callback);
2917
+ var self = this;
2918
+
2919
+ // ensure the network request is scheduled after the current tick.
2920
+ setTimeout(function() {
2921
+ self.transport.post(self.accessToken, transportOptions, payload, callback);
2922
+ }, 0);
2918
2923
  };
2919
2924
 
2920
2925
  /**
@@ -3599,20 +3604,25 @@ function addBaseInfo(item, options, callback) {
3599
3604
 
3600
3605
  function addRequestInfo(window) {
3601
3606
  return function(item, options, callback) {
3602
- if (!window || !window.location) {
3603
- return callback(null, item);
3607
+ var requestInfo = {};
3608
+
3609
+ if (window && window.location) {
3610
+ requestInfo.url = window.location.href;
3611
+ requestInfo.query_string = window.location.search;
3604
3612
  }
3613
+
3605
3614
  var remoteString = '$remote_ip';
3606
3615
  if (!options.captureIp) {
3607
3616
  remoteString = null;
3608
3617
  } else if (options.captureIp !== true) {
3609
3618
  remoteString += '_anonymize';
3610
3619
  }
3611
- _.set(item, 'data.request', {
3612
- url: window.location.href,
3613
- query_string: window.location.search,
3614
- user_ip: remoteString
3615
- });
3620
+ if (remoteString) requestInfo.user_ip = remoteString;
3621
+
3622
+ if (Object.keys(requestInfo).length > 0) {
3623
+ _.set(item, 'data.request', requestInfo);
3624
+ }
3625
+
3616
3626
  callback(null, item);
3617
3627
  };
3618
3628
  }
@@ -4596,7 +4606,7 @@ module.exports = {
4596
4606
 
4597
4607
 
4598
4608
  module.exports = {
4599
- version: '2.25.0',
4609
+ version: '2.25.2',
4600
4610
  endpoint: 'api.rollbar.com/api/1/item/',
4601
4611
  logLevel: 'debug',
4602
4612
  reportLevel: 'debug',
@@ -4868,9 +4878,10 @@ module.exports = Telemeter;
4868
4878
 
4869
4879
 
4870
4880
  var _ = __webpack_require__(0);
4881
+ var headers = __webpack_require__(31);
4871
4882
  var scrub = __webpack_require__(4);
4872
4883
  var urlparser = __webpack_require__(2);
4873
- var domUtil = __webpack_require__(31);
4884
+ var domUtil = __webpack_require__(32);
4874
4885
 
4875
4886
  var defaults = {
4876
4887
  network: true,
@@ -5231,7 +5242,7 @@ Instrumenter.prototype.instrumentNetwork = function() {
5231
5242
  if (args[1] && args[1].headers) {
5232
5243
  // Argument may be a Headers object, or plain object. Ensure here that
5233
5244
  // we are working with a Headers object with case-insensitive keys.
5234
- var reqHeaders = new Headers(args[1].headers);
5245
+ var reqHeaders = headers(args[1].headers);
5235
5246
 
5236
5247
  metadata.request_content_type = reqHeaders.get('Content-Type');
5237
5248
 
@@ -5644,6 +5655,109 @@ module.exports = Instrumenter;
5644
5655
  "use strict";
5645
5656
 
5646
5657
 
5658
+ /*
5659
+ * headers - Detect when fetch Headers are undefined and use a partial polyfill.
5660
+ *
5661
+ * A full polyfill is not used in order to keep package size as small as possible.
5662
+ * Since this is only used internally and is not added to the window object,
5663
+ * the full interface doesn't need to be supported.
5664
+ *
5665
+ * This implementation is modified from whatwg-fetch:
5666
+ * https://github.com/github/fetch
5667
+ */
5668
+ function headers(headers) {
5669
+ if (typeof Headers === 'undefined') {
5670
+ return new FetchHeaders(headers);
5671
+ }
5672
+
5673
+ return new Headers(headers);
5674
+ }
5675
+
5676
+ function normalizeName(name) {
5677
+ if (typeof name !== 'string') {
5678
+ name = String(name)
5679
+ }
5680
+ return name.toLowerCase()
5681
+ }
5682
+
5683
+ function normalizeValue(value) {
5684
+ if (typeof value !== 'string') {
5685
+ value = String(value)
5686
+ }
5687
+ return value
5688
+ }
5689
+
5690
+ function iteratorFor(items) {
5691
+ var iterator = {
5692
+ next: function() {
5693
+ var value = items.shift()
5694
+ return {done: value === undefined, value: value}
5695
+ }
5696
+ }
5697
+
5698
+ return iterator
5699
+ }
5700
+
5701
+ function FetchHeaders(headers) {
5702
+ this.map = {}
5703
+
5704
+ if (headers instanceof FetchHeaders) {
5705
+ headers.forEach(function(value, name) {
5706
+ this.append(name, value)
5707
+ }, this)
5708
+ } else if (Array.isArray(headers)) {
5709
+ headers.forEach(function(header) {
5710
+ this.append(header[0], header[1])
5711
+ }, this)
5712
+ } else if (headers) {
5713
+ Object.getOwnPropertyNames(headers).forEach(function(name) {
5714
+ this.append(name, headers[name])
5715
+ }, this)
5716
+ }
5717
+ }
5718
+
5719
+ FetchHeaders.prototype.append = function(name, value) {
5720
+ name = normalizeName(name)
5721
+ value = normalizeValue(value)
5722
+ var oldValue = this.map[name]
5723
+ this.map[name] = oldValue ? oldValue + ', ' + value : value
5724
+ }
5725
+
5726
+ FetchHeaders.prototype.get = function(name) {
5727
+ name = normalizeName(name)
5728
+ return this.has(name) ? this.map[name] : null
5729
+ }
5730
+
5731
+ FetchHeaders.prototype.has = function(name) {
5732
+ return this.map.hasOwnProperty(normalizeName(name))
5733
+ }
5734
+
5735
+ FetchHeaders.prototype.forEach = function(callback, thisArg) {
5736
+ for (var name in this.map) {
5737
+ if (this.map.hasOwnProperty(name)) {
5738
+ callback.call(thisArg, this.map[name], name, this)
5739
+ }
5740
+ }
5741
+ }
5742
+
5743
+ FetchHeaders.prototype.entries = function() {
5744
+ var items = []
5745
+ this.forEach(function(value, name) {
5746
+ items.push([name, value])
5747
+ })
5748
+ return iteratorFor(items)
5749
+ }
5750
+
5751
+ module.exports = headers;
5752
+
5753
+
5754
+ /***/ }),
5755
+ /* 32 */
5756
+ /***/ (function(module, exports, __webpack_require__) {
5757
+
5758
+ "use strict";
5759
+
5760
+
5647
5761
  function getElementType(e) {
5648
5762
  return (e.getAttribute('type') || '').toLowerCase();
5649
5763
  }
@@ -5777,19 +5891,19 @@ module.exports = {
5777
5891
 
5778
5892
 
5779
5893
  /***/ }),
5780
- /* 32 */
5894
+ /* 33 */
5781
5895
  /***/ (function(module, exports, __webpack_require__) {
5782
5896
 
5783
5897
  "use strict";
5784
5898
 
5785
5899
 
5786
- var polyfillJSON = __webpack_require__(33);
5900
+ var polyfillJSON = __webpack_require__(34);
5787
5901
 
5788
5902
  module.exports = polyfillJSON;
5789
5903
 
5790
5904
 
5791
5905
  /***/ }),
5792
- /* 33 */
5906
+ /* 34 */
5793
5907
  /***/ (function(module, exports) {
5794
5908
 
5795
5909
  // json3.js
@@ -6558,7 +6672,7 @@ module.exports = setupCustomJSON;
6558
6672
 
6559
6673
 
6560
6674
  /***/ }),
6561
- /* 34 */
6675
+ /* 35 */
6562
6676
  /***/ (function(module, exports, __webpack_require__) {
6563
6677
 
6564
6678
  "use strict";
@@ -6608,7 +6722,7 @@ module.exports = wrapGlobals;
6608
6722
 
6609
6723
 
6610
6724
  /***/ }),
6611
- /* 35 */
6725
+ /* 36 */
6612
6726
  /***/ (function(module, exports, __webpack_require__) {
6613
6727
 
6614
6728
  "use strict";