@micromag/viewer-build 0.2.349 → 0.2.352

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.
Files changed (60) hide show
  1. package/build/asset-manifest.json +44 -46
  2. package/build/index.html +1 -1
  3. package/build/static/css/main.84dd7324.chunk.css +2 -0
  4. package/build/static/css/main.84dd7324.chunk.css.map +1 -0
  5. package/build/static/js/{0.f79b9ef3.chunk.js → 0.e9d808b4.chunk.js} +2 -2
  6. package/build/static/js/{0.f79b9ef3.chunk.js.map → 0.e9d808b4.chunk.js.map} +1 -1
  7. package/build/static/js/{1.dc8210ea.chunk.js → 1.10b11229.chunk.js} +2 -2
  8. package/build/static/js/{1.dc8210ea.chunk.js.map → 1.10b11229.chunk.js.map} +1 -1
  9. package/build/static/js/{12.6fa9cc23.chunk.js → 10.5043cd3c.chunk.js} +2 -2
  10. package/build/static/js/{12.6fa9cc23.chunk.js.map → 10.5043cd3c.chunk.js.map} +1 -1
  11. package/build/static/js/{13.f18a2ee1.chunk.js → 11.505258e4.chunk.js} +2 -2
  12. package/build/static/js/{13.f18a2ee1.chunk.js.map → 11.505258e4.chunk.js.map} +1 -1
  13. package/build/static/js/{14.06caff0d.chunk.js → 12.db5d747d.chunk.js} +2 -2
  14. package/build/static/js/{14.06caff0d.chunk.js.map → 12.db5d747d.chunk.js.map} +1 -1
  15. package/build/static/js/{15.c10bab99.chunk.js → 13.eee02164.chunk.js} +2 -2
  16. package/build/static/js/{15.c10bab99.chunk.js.map → 13.eee02164.chunk.js.map} +1 -1
  17. package/build/static/js/{16.362ba203.chunk.js → 14.545de4b8.chunk.js} +2 -2
  18. package/build/static/js/{16.362ba203.chunk.js.map → 14.545de4b8.chunk.js.map} +1 -1
  19. package/build/static/js/15.bac0802a.chunk.js +2 -0
  20. package/build/static/js/15.bac0802a.chunk.js.map +1 -0
  21. package/build/static/js/{17.a3771ccd.chunk.js → 16.04903139.chunk.js} +2 -2
  22. package/build/static/js/{17.a3771ccd.chunk.js.map → 16.04903139.chunk.js.map} +1 -1
  23. package/build/static/js/17.ce3338f7.chunk.js +2 -0
  24. package/build/static/js/{18.d3cd761e.chunk.js.map → 17.ce3338f7.chunk.js.map} +1 -1
  25. package/build/static/js/{2.0b2dbffa.chunk.js → 2.1c01c038.chunk.js} +2 -2
  26. package/build/static/js/{2.0b2dbffa.chunk.js.map → 2.1c01c038.chunk.js.map} +1 -1
  27. package/build/static/js/5.b1de04f7.chunk.js +3 -0
  28. package/build/static/js/{5.35e5a74b.chunk.js.LICENSE.txt → 5.b1de04f7.chunk.js.LICENSE.txt} +0 -7
  29. package/build/static/js/5.b1de04f7.chunk.js.map +1 -0
  30. package/build/static/js/{6.07a76264.chunk.js → 6.cd3776b3.chunk.js} +3 -3
  31. package/build/static/js/{6.07a76264.chunk.js.LICENSE.txt → 6.cd3776b3.chunk.js.LICENSE.txt} +0 -0
  32. package/build/static/js/{6.07a76264.chunk.js.map → 6.cd3776b3.chunk.js.map} +1 -1
  33. package/build/static/js/{9.a413d252.chunk.js → 7.fbca3b10.chunk.js} +2 -2
  34. package/build/static/js/{9.a413d252.chunk.js.map → 7.fbca3b10.chunk.js.map} +1 -1
  35. package/build/static/js/8.33d32e6f.chunk.js +2 -0
  36. package/build/static/js/8.33d32e6f.chunk.js.map +1 -0
  37. package/build/static/js/9.294af4b0.chunk.js +2 -0
  38. package/build/static/js/9.294af4b0.chunk.js.map +1 -0
  39. package/build/static/js/main.ac6010b6.chunk.js +2 -0
  40. package/build/static/js/main.ac6010b6.chunk.js.map +1 -0
  41. package/build/static/js/runtime-main.7e86a7b4.js +2 -0
  42. package/build/static/js/runtime-main.7e86a7b4.js.map +1 -0
  43. package/package.json +7 -7
  44. package/build/static/css/main.143562a2.chunk.css +0 -2
  45. package/build/static/css/main.143562a2.chunk.css.map +0 -1
  46. package/build/static/js/10.ab3fb08c.chunk.js +0 -2
  47. package/build/static/js/10.ab3fb08c.chunk.js.map +0 -1
  48. package/build/static/js/11.bb0e7bef.chunk.js +0 -2
  49. package/build/static/js/11.bb0e7bef.chunk.js.map +0 -1
  50. package/build/static/js/18.d3cd761e.chunk.js +0 -2
  51. package/build/static/js/5.35e5a74b.chunk.js +0 -3
  52. package/build/static/js/5.35e5a74b.chunk.js.map +0 -1
  53. package/build/static/js/7.57910475.chunk.js +0 -2
  54. package/build/static/js/7.57910475.chunk.js.map +0 -1
  55. package/build/static/js/8.f6bad856.chunk.js +0 -2
  56. package/build/static/js/8.f6bad856.chunk.js.map +0 -1
  57. package/build/static/js/main.1947d720.chunk.js +0 -2
  58. package/build/static/js/main.1947d720.chunk.js.map +0 -1
  59. package/build/static/js/runtime-main.e1c8234d.js +0 -2
  60. package/build/static/js/runtime-main.e1c8234d.js.map +0 -1
@@ -1,2 +1,2 @@
1
- (this["webpackJsonp@micromag/viewer-build"]=this["webpackJsonp@micromag/viewer-build"]||[]).push([[0],{532:function(t,e,n){"use strict";var o=n(545),r=n(592),s=n(595),i=n(596);t.exports={RequestClient:o,Provider:r,SearchProvider:s,Socket:i}},536:function(t,e){function n(t){var e="function"===typeof Map?new Map:void 0;return n=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!==typeof t)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return o(t,arguments,i(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),s(r,t)},n(t)}function o(t,e,n){return o=r()?Reflect.construct:function(t,e,n){var o=[null];o.push.apply(o,e);var r=new(Function.bind.apply(t,o));return n&&s(r,n.prototype),r},o.apply(null,arguments)}function r(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function s(t,e){return s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},s(t,e)}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}var a=function(t){var e,n;function o(e,n){var o;return void 0===n&&(n=null),(o=t.call(this,"This looks like a network error, the endpoint might be blocked by an internet provider or a firewall.\n\nSource error: ["+e+"]")||this).isNetworkError=!0,o.request=n,o}return n=t,(e=o).prototype=Object.create(n.prototype),e.prototype.constructor=e,s(e,n),o}(n(Error));t.exports=a},544:function(t,e,n){"use strict";(function(e){var o=n(589),r=n(590),s=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,i=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,a=/^[a-zA-Z]:/,u=new RegExp("^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+");function c(t){return(t||"").toString().replace(u,"")}var p=[["#","hash"],["?","query"],function(t,e){return f(e.protocol)?t.replace(/\\/g,"/"):t},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],l={hash:1,query:1};function h(t){var n,o=("undefined"!==typeof window?window:"undefined"!==typeof e?e:"undefined"!==typeof self?self:{}).location||{},r={},i=typeof(t=t||o);if("blob:"===t.protocol)r=new m(unescape(t.pathname),{});else if("string"===i)for(n in r=new m(t,{}),l)delete r[n];else if("object"===i){for(n in t)n in l||(r[n]=t[n]);void 0===r.slashes&&(r.slashes=s.test(t.href))}return r}function f(t){return"file:"===t||"ftp:"===t||"http:"===t||"https:"===t||"ws:"===t||"wss:"===t}function d(t,e){t=c(t),e=e||{};var n,o=i.exec(t),r=o[1]?o[1].toLowerCase():"",s=!!o[2],a=!!o[3],u=0;return s?a?(n=o[2]+o[3]+o[4],u=o[2].length+o[3].length):(n=o[2]+o[4],u=o[2].length):a?(n=o[3]+o[4],u=o[3].length):n=o[4],"file:"===r?u>=2&&(n=n.slice(2)):f(r)?n=o[4]:r?s&&(n=n.slice(2)):u>=2&&f(e.protocol)&&(n=o[4]),{protocol:r,slashes:s||f(r),slashesCount:u,rest:n}}function m(t,e,n){if(t=c(t),!(this instanceof m))return new m(t,e,n);var s,i,u,l,g,y,v=p.slice(),w=typeof e,b=this,O=0;for("object"!==w&&"string"!==w&&(n=e,e=null),n&&"function"!==typeof n&&(n=r.parse),s=!(i=d(t||"",e=h(e))).protocol&&!i.slashes,b.slashes=i.slashes||s&&e.slashes,b.protocol=i.protocol||e.protocol||"",t=i.rest,("file:"===i.protocol&&(2!==i.slashesCount||a.test(t))||!i.slashes&&(i.protocol||i.slashesCount<2||!f(b.protocol)))&&(v[3]=[/(.*)/,"pathname"]);O<v.length;O++)"function"!==typeof(l=v[O])?(u=l[0],y=l[1],u!==u?b[y]=t:"string"===typeof u?~(g=t.indexOf(u))&&("number"===typeof l[2]?(b[y]=t.slice(0,g),t=t.slice(g+l[2])):(b[y]=t.slice(g),t=t.slice(0,g))):(g=u.exec(t))&&(b[y]=g[1],t=t.slice(0,g.index)),b[y]=b[y]||s&&l[3]&&e[y]||"",l[4]&&(b[y]=b[y].toLowerCase())):t=l(t,b);n&&(b.query=n(b.query)),s&&e.slashes&&"/"!==b.pathname.charAt(0)&&(""!==b.pathname||""!==e.pathname)&&(b.pathname=function(t,e){if(""===t)return e;for(var n=(e||"/").split("/").slice(0,-1).concat(t.split("/")),o=n.length,r=n[o-1],s=!1,i=0;o--;)"."===n[o]?n.splice(o,1):".."===n[o]?(n.splice(o,1),i++):i&&(0===o&&(s=!0),n.splice(o,1),i--);return s&&n.unshift(""),"."!==r&&".."!==r||n.push(""),n.join("/")}(b.pathname,e.pathname)),"/"!==b.pathname.charAt(0)&&f(b.protocol)&&(b.pathname="/"+b.pathname),o(b.port,b.protocol)||(b.host=b.hostname,b.port=""),b.username=b.password="",b.auth&&(l=b.auth.split(":"),b.username=l[0]||"",b.password=l[1]||""),b.origin="file:"!==b.protocol&&f(b.protocol)&&b.host?b.protocol+"//"+b.host:"null",b.href=b.toString()}m.prototype={set:function(t,e,n){var s=this;switch(t){case"query":"string"===typeof e&&e.length&&(e=(n||r.parse)(e)),s[t]=e;break;case"port":s[t]=e,o(e,s.protocol)?e&&(s.host=s.hostname+":"+e):(s.host=s.hostname,s[t]="");break;case"hostname":s[t]=e,s.port&&(e+=":"+s.port),s.host=e;break;case"host":s[t]=e,/:\d+$/.test(e)?(e=e.split(":"),s.port=e.pop(),s.hostname=e.join(":")):(s.hostname=e,s.port="");break;case"protocol":s.protocol=e.toLowerCase(),s.slashes=!n;break;case"pathname":case"hash":if(e){var i="pathname"===t?"/":"#";s[t]=e.charAt(0)!==i?i+e:e}else s[t]=e;break;default:s[t]=e}for(var a=0;a<p.length;a++){var u=p[a];u[4]&&(s[u[1]]=s[u[1]].toLowerCase())}return s.origin="file:"!==s.protocol&&f(s.protocol)&&s.host?s.protocol+"//"+s.host:"null",s.href=s.toString(),s},toString:function(t){t&&"function"===typeof t||(t=r.stringify);var e,n=this,o=n.protocol;o&&":"!==o.charAt(o.length-1)&&(o+=":");var s=o+(n.slashes||f(n.protocol)?"//":"");return n.username&&(s+=n.username,n.password&&(s+=":"+n.password),s+="@"),s+=n.host+n.pathname,(e="object"===typeof n.query?t(n.query):n.query)&&(s+="?"!==e.charAt(0)?"?"+e:e),n.hash&&(s+=n.hash),s}},m.extractProtocol=d,m.location=h,m.trimLeft=c,m.qs=r,t.exports=m}).call(this,n(59))},545:function(t,e,n){"use strict";var o,r;function s(){return s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},s.apply(this,arguments)}function i(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var a=n(591),u=n(546);t.exports=(r=o=function(){function t(t,e){this.uppy=t,this.opts=e,this.onReceiveResponse=this.onReceiveResponse.bind(this),this.allowedHeaders=["accept","content-type","uppy-auth-token"],this.preflightDone=!1}var e,n,o,r=t.prototype;return r.headers=function(){var t=this.opts.companionHeaders||this.opts.serverHeaders||{};return Promise.resolve(s({},this.defaultHeaders,t))},r._getPostResponseFunc=function(t){var e=this;return function(n){return t?n:e.onReceiveResponse(n)}},r.onReceiveResponse=function(t){var e,n=this.uppy.getState().companion||{},o=this.opts.companionUrl,r=t.headers;r.has("i-am")&&r.get("i-am")!==n[o]&&this.uppy.setState({companion:s({},n,(e={},e[o]=r.get("i-am"),e))});return t},r._getUrl=function(t){return/^(https?:|)\/\//.test(t)?t:this.hostname+"/"+t},r._json=function(t){if(401===t.status)throw new a;if(t.status<200||t.status>300){var e="Failed request with status: "+t.status+". "+t.statusText;return t.json().then((function(t){throw e=t.message?e+" message: "+t.message:e,e=t.requestId?e+" request-Id: "+t.requestId:e,new Error(e)})).catch((function(){throw new Error(e)}))}return t.json()},r.preflight=function(t){var e=this;return this.preflightDone?Promise.resolve(this.allowedHeaders.slice()):fetch(this._getUrl(t),{method:"OPTIONS"}).then((function(t){return t.headers.has("access-control-allow-headers")&&(e.allowedHeaders=t.headers.get("access-control-allow-headers").split(",").map((function(t){return t.trim().toLowerCase()}))),e.preflightDone=!0,e.allowedHeaders.slice()})).catch((function(t){return e.uppy.log("[CompanionClient] unable to make preflight request "+t,"warning"),e.preflightDone=!0,e.allowedHeaders.slice()}))},r.preflightAndHeaders=function(t){var e=this;return Promise.all([this.preflight(t),this.headers()]).then((function(t){var n=t[0],o=t[1];return Object.keys(o).forEach((function(t){-1===n.indexOf(t.toLowerCase())&&(e.uppy.log("[CompanionClient] excluding unallowed header "+t),delete o[t])})),o}))},r.get=function(t,e){var n=this;return this.preflightAndHeaders(t).then((function(e){return u(n._getUrl(t),{method:"get",headers:e,credentials:n.opts.companionCookiesRule||"same-origin"})})).then(this._getPostResponseFunc(e)).then((function(t){return n._json(t)})).catch((function(e){return e.isAuthError||(e.message="Could not get "+n._getUrl(t)+". "+e.message),Promise.reject(e)}))},r.post=function(t,e,n){var o=this;return this.preflightAndHeaders(t).then((function(n){return u(o._getUrl(t),{method:"post",headers:n,credentials:o.opts.companionCookiesRule||"same-origin",body:JSON.stringify(e)})})).then(this._getPostResponseFunc(n)).then((function(t){return o._json(t)})).catch((function(e){return e.isAuthError||(e.message="Could not post "+o._getUrl(t)+". "+e.message),Promise.reject(e)}))},r.delete=function(t,e,n){var o=this;return this.preflightAndHeaders(t).then((function(n){return u(o.hostname+"/"+t,{method:"delete",headers:n,credentials:o.opts.companionCookiesRule||"same-origin",body:e?JSON.stringify(e):null})})).then(this._getPostResponseFunc(n)).then((function(t){return o._json(t)})).catch((function(e){return e.isAuthError||(e.message="Could not delete "+o._getUrl(t)+". "+e.message),Promise.reject(e)}))},e=t,(n=[{key:"hostname",get:function(){var t=this.uppy.getState().companion,e=this.opts.companionUrl;return(t&&t[e]?t[e]:e).replace(/\/$/,"")}},{key:"defaultHeaders",get:function(){return{Accept:"application/json","Content-Type":"application/json","Uppy-Versions":"@uppy/companion-client="+t.VERSION}}}])&&i(e.prototype,n),o&&i(e,o),t}(),o.VERSION="1.10.2",r)},546:function(t,e,n){var o=n(536);t.exports=function(){return fetch.apply(void 0,arguments).catch((function(t){throw"AbortError"===t.name?t:new o(t)}))}},589:function(t,e,n){"use strict";t.exports=function(t,e){if(e=e.split(":")[0],!(t=+t))return!1;switch(e){case"http":case"ws":return 80!==t;case"https":case"wss":return 443!==t;case"ftp":return 21!==t;case"gopher":return 70!==t;case"file":return!1}return 0!==t}},590:function(t,e,n){"use strict";var o=Object.prototype.hasOwnProperty;function r(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(e){return null}}function s(t){try{return encodeURIComponent(t)}catch(e){return null}}e.stringify=function(t,e){e=e||"";var n,r,i=[];for(r in"string"!==typeof e&&(e="?"),t)if(o.call(t,r)){if((n=t[r])||null!==n&&undefined!==n&&!isNaN(n)||(n=""),r=s(r),n=s(n),null===r||null===n)continue;i.push(r+"="+n)}return i.length?e+i.join("&"):""},e.parse=function(t){for(var e,n=/([^=?#&]+)=?([^&]*)/g,o={};e=n.exec(t);){var s=r(e[1]),i=r(e[2]);null===s||null===i||s in o||(o[s]=i)}return o}},591:function(t,e,n){"use strict";function o(t){var e="function"===typeof Map?new Map:void 0;return o=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!==typeof t)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof e){if(e.has(t))return e.get(t);e.set(t,o)}function o(){return r(t,arguments,a(this).constructor)}return o.prototype=Object.create(t.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),i(o,t)},o(t)}function r(t,e,n){return r=s()?Reflect.construct:function(t,e,n){var o=[null];o.push.apply(o,e);var r=new(Function.bind.apply(t,o));return n&&i(r,n.prototype),r},r.apply(null,arguments)}function s(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function i(t,e){return i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},i(t,e)}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}var u=function(t){var e,n;function o(){var e;return(e=t.call(this,"Authorization required")||this).name="AuthError",e.isAuthError=!0,e}return n=t,(e=o).prototype=Object.create(n.prototype),e.prototype.constructor=e,i(e,n),o}(o(Error));t.exports=u},592:function(t,e,n){"use strict";function o(){return o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},o.apply(this,arguments)}function r(t,e){return r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(t,e)}var s=n(593),i=n(544),a=n(545),u=n(594);t.exports=function(t){var e,n;function a(e,n){var o;return(o=t.call(this,e,n)||this).provider=n.provider,o.id=o.provider,o.name=o.opts.name||o.id.split("-").map((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})).join(" "),o.pluginId=o.opts.pluginId,o.tokenKey="companion-"+o.pluginId+"-auth-token",o.companionKeysParams=o.opts.companionKeysParams,o.preAuthToken=null,o}n=t,(e=a).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n);var c=a.prototype;return c.headers=function(){var e=this;return Promise.all([t.prototype.headers.call(this),this.getAuthToken()]).then((function(t){var n=t[0],r=t[1],s={};return r&&(s["uppy-auth-token"]=r),e.companionKeysParams&&(s["uppy-credentials-params"]=btoa(JSON.stringify({params:e.companionKeysParams}))),o({},n,s)}))},c.onReceiveResponse=function(e){e=t.prototype.onReceiveResponse.call(this,e);var n=this.uppy.getPlugin(this.pluginId),o=n.getPluginState().authenticated?401!==e.status:e.status<400;return n.setPluginState({authenticated:o}),e},c.setAuthToken=function(t){return this.uppy.getPlugin(this.pluginId).storage.setItem(this.tokenKey,t)},c.getAuthToken=function(){return this.uppy.getPlugin(this.pluginId).storage.getItem(this.tokenKey)},c.authUrl=function(t){void 0===t&&(t={}),this.preAuthToken&&(t.uppyPreAuthToken=this.preAuthToken);var e=s(t);return e=e?"?"+e:e,this.hostname+"/"+this.id+"/connect"+e},c.fileUrl=function(t){return this.hostname+"/"+this.id+"/get/"+t},c.fetchPreAuthToken=function(){var t=this;return this.companionKeysParams?this.post(this.id+"/preauth/",{params:this.companionKeysParams}).then((function(e){t.preAuthToken=e.token})).catch((function(e){t.uppy.log("[CompanionClient] unable to fetch preAuthToken "+e,"warning")})):Promise.resolve()},c.list=function(t){return this.get(this.id+"/list/"+(t||""))},c.logout=function(){var t=this;return this.get(this.id+"/logout").then((function(e){return Promise.all([e,t.uppy.getPlugin(t.pluginId).storage.removeItem(t.tokenKey)])})).then((function(t){return t[0]}))},a.initPlugin=function(t,e,n){if(t.type="acquirer",t.files=[],n&&(t.opts=o({},n,e)),e.serverUrl||e.serverPattern)throw new Error("`serverUrl` and `serverPattern` have been renamed to `companionUrl` and `companionAllowedHosts` respectively in the 0.30.5 release. Please consult the docs (for example, https://uppy.io/docs/instagram/ for the Instagram plugin) and use the updated options.`");if(e.companionAllowedHosts){var r=e.companionAllowedHosts;if("string"!==typeof r&&!Array.isArray(r)&&!(r instanceof RegExp))throw new TypeError(t.id+': the option "companionAllowedHosts" must be one of string, Array, RegExp');t.opts.companionAllowedHosts=r}else/^(?!https?:\/\/).*$/i.test(e.companionUrl)?t.opts.companionAllowedHosts="https://"+e.companionUrl.replace(/^\/\//,""):t.opts.companionAllowedHosts=new i(e.companionUrl).origin;t.storage=t.opts.storage||u},a}(a)},593:function(t,e){var n=Object.prototype.hasOwnProperty;t.exports=function t(e,o){var r=[];for(var s in e)if(n.call(e,s)){var i,a=e[s],u=encodeURIComponent(s);i="object"===typeof a?t(a,o?o+"["+u+"]":u):(o?o+"["+u+"]":u)+"="+encodeURIComponent(a),r.push(i)}return r.join("&")}},594:function(t,e,n){"use strict";t.exports.setItem=function(t,e){return new Promise((function(n){localStorage.setItem(t,e),n()}))},t.exports.getItem=function(t){return Promise.resolve(localStorage.getItem(t))},t.exports.removeItem=function(t){return new Promise((function(e){localStorage.removeItem(t),e()}))}},595:function(t,e,n){"use strict";function o(t,e){return o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},o(t,e)}var r=n(545);t.exports=function(t){var e,n;function r(e,n){var o;return(o=t.call(this,e,n)||this).provider=n.provider,o.id=o.provider,o.name=o.opts.name||o.id.split("-").map((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})).join(" "),o.pluginId=o.opts.pluginId,o}n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,o(e,n);var s=r.prototype;return s.fileUrl=function(t){return this.hostname+"/search/"+this.id+"/get/"+t},s.search=function(t,e){return e=e?"&"+e:"",this.get("search/"+this.id+"/list?q="+encodeURIComponent(t)+e)},r}(r)},596:function(t,e,n){var o=n(288);t.exports=function(){function t(t){this.opts=t,this._queued=[],this.isOpen=!1,this.emitter=o(),this._handleMessage=this._handleMessage.bind(this),this.close=this.close.bind(this),this.emit=this.emit.bind(this),this.on=this.on.bind(this),this.once=this.once.bind(this),this.send=this.send.bind(this),t&&!1===t.autoOpen||this.open()}var e=t.prototype;return e.open=function(){var t=this;this.socket=new WebSocket(this.opts.target),this.socket.onopen=function(e){for(t.isOpen=!0;t._queued.length>0&&t.isOpen;){var n=t._queued[0];t.send(n.action,n.payload),t._queued=t._queued.slice(1)}},this.socket.onclose=function(e){t.isOpen=!1},this.socket.onmessage=this._handleMessage},e.close=function(){this.socket&&this.socket.close()},e.send=function(t,e){this.isOpen?this.socket.send(JSON.stringify({action:t,payload:e})):this._queued.push({action:t,payload:e})},e.on=function(t,e){this.emitter.on(t,e)},e.emit=function(t,e){this.emitter.emit(t,e)},e.once=function(t,e){this.emitter.once(t,e)},e._handleMessage=function(t){try{var e=JSON.parse(t.data);this.emit(e.action,e.payload)}catch(n){console.log(n)}},t}()}}]);
2
- //# sourceMappingURL=0.f79b9ef3.chunk.js.map
1
+ (this["webpackJsonp@micromag/viewer-build"]=this["webpackJsonp@micromag/viewer-build"]||[]).push([[0],{432:function(t,e,n){"use strict";var o=n(441),r=n(479),s=n(482),i=n(483);t.exports={RequestClient:o,Provider:r,SearchProvider:s,Socket:i}},434:function(t,e){function n(t){var e="function"===typeof Map?new Map:void 0;return n=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!==typeof t)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return o(t,arguments,i(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),s(r,t)},n(t)}function o(t,e,n){return o=r()?Reflect.construct:function(t,e,n){var o=[null];o.push.apply(o,e);var r=new(Function.bind.apply(t,o));return n&&s(r,n.prototype),r},o.apply(null,arguments)}function r(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function s(t,e){return s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},s(t,e)}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}var a=function(t){var e,n;function o(e,n){var o;return void 0===n&&(n=null),(o=t.call(this,"This looks like a network error, the endpoint might be blocked by an internet provider or a firewall.\n\nSource error: ["+e+"]")||this).isNetworkError=!0,o.request=n,o}return n=t,(e=o).prototype=Object.create(n.prototype),e.prototype.constructor=e,s(e,n),o}(n(Error));t.exports=a},440:function(t,e,n){"use strict";(function(e){var o=n(476),r=n(477),s=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,i=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,a=/^[a-zA-Z]:/,u=new RegExp("^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+");function c(t){return(t||"").toString().replace(u,"")}var p=[["#","hash"],["?","query"],function(t,e){return f(e.protocol)?t.replace(/\\/g,"/"):t},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],l={hash:1,query:1};function h(t){var n,o=("undefined"!==typeof window?window:"undefined"!==typeof e?e:"undefined"!==typeof self?self:{}).location||{},r={},i=typeof(t=t||o);if("blob:"===t.protocol)r=new m(unescape(t.pathname),{});else if("string"===i)for(n in r=new m(t,{}),l)delete r[n];else if("object"===i){for(n in t)n in l||(r[n]=t[n]);void 0===r.slashes&&(r.slashes=s.test(t.href))}return r}function f(t){return"file:"===t||"ftp:"===t||"http:"===t||"https:"===t||"ws:"===t||"wss:"===t}function d(t,e){t=c(t),e=e||{};var n,o=i.exec(t),r=o[1]?o[1].toLowerCase():"",s=!!o[2],a=!!o[3],u=0;return s?a?(n=o[2]+o[3]+o[4],u=o[2].length+o[3].length):(n=o[2]+o[4],u=o[2].length):a?(n=o[3]+o[4],u=o[3].length):n=o[4],"file:"===r?u>=2&&(n=n.slice(2)):f(r)?n=o[4]:r?s&&(n=n.slice(2)):u>=2&&f(e.protocol)&&(n=o[4]),{protocol:r,slashes:s||f(r),slashesCount:u,rest:n}}function m(t,e,n){if(t=c(t),!(this instanceof m))return new m(t,e,n);var s,i,u,l,g,y,v=p.slice(),w=typeof e,b=this,O=0;for("object"!==w&&"string"!==w&&(n=e,e=null),n&&"function"!==typeof n&&(n=r.parse),s=!(i=d(t||"",e=h(e))).protocol&&!i.slashes,b.slashes=i.slashes||s&&e.slashes,b.protocol=i.protocol||e.protocol||"",t=i.rest,("file:"===i.protocol&&(2!==i.slashesCount||a.test(t))||!i.slashes&&(i.protocol||i.slashesCount<2||!f(b.protocol)))&&(v[3]=[/(.*)/,"pathname"]);O<v.length;O++)"function"!==typeof(l=v[O])?(u=l[0],y=l[1],u!==u?b[y]=t:"string"===typeof u?~(g=t.indexOf(u))&&("number"===typeof l[2]?(b[y]=t.slice(0,g),t=t.slice(g+l[2])):(b[y]=t.slice(g),t=t.slice(0,g))):(g=u.exec(t))&&(b[y]=g[1],t=t.slice(0,g.index)),b[y]=b[y]||s&&l[3]&&e[y]||"",l[4]&&(b[y]=b[y].toLowerCase())):t=l(t,b);n&&(b.query=n(b.query)),s&&e.slashes&&"/"!==b.pathname.charAt(0)&&(""!==b.pathname||""!==e.pathname)&&(b.pathname=function(t,e){if(""===t)return e;for(var n=(e||"/").split("/").slice(0,-1).concat(t.split("/")),o=n.length,r=n[o-1],s=!1,i=0;o--;)"."===n[o]?n.splice(o,1):".."===n[o]?(n.splice(o,1),i++):i&&(0===o&&(s=!0),n.splice(o,1),i--);return s&&n.unshift(""),"."!==r&&".."!==r||n.push(""),n.join("/")}(b.pathname,e.pathname)),"/"!==b.pathname.charAt(0)&&f(b.protocol)&&(b.pathname="/"+b.pathname),o(b.port,b.protocol)||(b.host=b.hostname,b.port=""),b.username=b.password="",b.auth&&(l=b.auth.split(":"),b.username=l[0]||"",b.password=l[1]||""),b.origin="file:"!==b.protocol&&f(b.protocol)&&b.host?b.protocol+"//"+b.host:"null",b.href=b.toString()}m.prototype={set:function(t,e,n){var s=this;switch(t){case"query":"string"===typeof e&&e.length&&(e=(n||r.parse)(e)),s[t]=e;break;case"port":s[t]=e,o(e,s.protocol)?e&&(s.host=s.hostname+":"+e):(s.host=s.hostname,s[t]="");break;case"hostname":s[t]=e,s.port&&(e+=":"+s.port),s.host=e;break;case"host":s[t]=e,/:\d+$/.test(e)?(e=e.split(":"),s.port=e.pop(),s.hostname=e.join(":")):(s.hostname=e,s.port="");break;case"protocol":s.protocol=e.toLowerCase(),s.slashes=!n;break;case"pathname":case"hash":if(e){var i="pathname"===t?"/":"#";s[t]=e.charAt(0)!==i?i+e:e}else s[t]=e;break;default:s[t]=e}for(var a=0;a<p.length;a++){var u=p[a];u[4]&&(s[u[1]]=s[u[1]].toLowerCase())}return s.origin="file:"!==s.protocol&&f(s.protocol)&&s.host?s.protocol+"//"+s.host:"null",s.href=s.toString(),s},toString:function(t){t&&"function"===typeof t||(t=r.stringify);var e,n=this,o=n.protocol;o&&":"!==o.charAt(o.length-1)&&(o+=":");var s=o+(n.slashes||f(n.protocol)?"//":"");return n.username&&(s+=n.username,n.password&&(s+=":"+n.password),s+="@"),s+=n.host+n.pathname,(e="object"===typeof n.query?t(n.query):n.query)&&(s+="?"!==e.charAt(0)?"?"+e:e),n.hash&&(s+=n.hash),s}},m.extractProtocol=d,m.location=h,m.trimLeft=c,m.qs=r,t.exports=m}).call(this,n(45))},441:function(t,e,n){"use strict";var o,r;function s(){return s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},s.apply(this,arguments)}function i(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var a=n(478),u=n(442);t.exports=(r=o=function(){function t(t,e){this.uppy=t,this.opts=e,this.onReceiveResponse=this.onReceiveResponse.bind(this),this.allowedHeaders=["accept","content-type","uppy-auth-token"],this.preflightDone=!1}var e,n,o,r=t.prototype;return r.headers=function(){var t=this.opts.companionHeaders||this.opts.serverHeaders||{};return Promise.resolve(s({},this.defaultHeaders,t))},r._getPostResponseFunc=function(t){var e=this;return function(n){return t?n:e.onReceiveResponse(n)}},r.onReceiveResponse=function(t){var e,n=this.uppy.getState().companion||{},o=this.opts.companionUrl,r=t.headers;r.has("i-am")&&r.get("i-am")!==n[o]&&this.uppy.setState({companion:s({},n,(e={},e[o]=r.get("i-am"),e))});return t},r._getUrl=function(t){return/^(https?:|)\/\//.test(t)?t:this.hostname+"/"+t},r._json=function(t){if(401===t.status)throw new a;if(t.status<200||t.status>300){var e="Failed request with status: "+t.status+". "+t.statusText;return t.json().then((function(t){throw e=t.message?e+" message: "+t.message:e,e=t.requestId?e+" request-Id: "+t.requestId:e,new Error(e)})).catch((function(){throw new Error(e)}))}return t.json()},r.preflight=function(t){var e=this;return this.preflightDone?Promise.resolve(this.allowedHeaders.slice()):fetch(this._getUrl(t),{method:"OPTIONS"}).then((function(t){return t.headers.has("access-control-allow-headers")&&(e.allowedHeaders=t.headers.get("access-control-allow-headers").split(",").map((function(t){return t.trim().toLowerCase()}))),e.preflightDone=!0,e.allowedHeaders.slice()})).catch((function(t){return e.uppy.log("[CompanionClient] unable to make preflight request "+t,"warning"),e.preflightDone=!0,e.allowedHeaders.slice()}))},r.preflightAndHeaders=function(t){var e=this;return Promise.all([this.preflight(t),this.headers()]).then((function(t){var n=t[0],o=t[1];return Object.keys(o).forEach((function(t){-1===n.indexOf(t.toLowerCase())&&(e.uppy.log("[CompanionClient] excluding unallowed header "+t),delete o[t])})),o}))},r.get=function(t,e){var n=this;return this.preflightAndHeaders(t).then((function(e){return u(n._getUrl(t),{method:"get",headers:e,credentials:n.opts.companionCookiesRule||"same-origin"})})).then(this._getPostResponseFunc(e)).then((function(t){return n._json(t)})).catch((function(e){return e.isAuthError||(e.message="Could not get "+n._getUrl(t)+". "+e.message),Promise.reject(e)}))},r.post=function(t,e,n){var o=this;return this.preflightAndHeaders(t).then((function(n){return u(o._getUrl(t),{method:"post",headers:n,credentials:o.opts.companionCookiesRule||"same-origin",body:JSON.stringify(e)})})).then(this._getPostResponseFunc(n)).then((function(t){return o._json(t)})).catch((function(e){return e.isAuthError||(e.message="Could not post "+o._getUrl(t)+". "+e.message),Promise.reject(e)}))},r.delete=function(t,e,n){var o=this;return this.preflightAndHeaders(t).then((function(n){return u(o.hostname+"/"+t,{method:"delete",headers:n,credentials:o.opts.companionCookiesRule||"same-origin",body:e?JSON.stringify(e):null})})).then(this._getPostResponseFunc(n)).then((function(t){return o._json(t)})).catch((function(e){return e.isAuthError||(e.message="Could not delete "+o._getUrl(t)+". "+e.message),Promise.reject(e)}))},e=t,(n=[{key:"hostname",get:function(){var t=this.uppy.getState().companion,e=this.opts.companionUrl;return(t&&t[e]?t[e]:e).replace(/\/$/,"")}},{key:"defaultHeaders",get:function(){return{Accept:"application/json","Content-Type":"application/json","Uppy-Versions":"@uppy/companion-client="+t.VERSION}}}])&&i(e.prototype,n),o&&i(e,o),t}(),o.VERSION="1.10.2",r)},442:function(t,e,n){var o=n(434);t.exports=function(){return fetch.apply(void 0,arguments).catch((function(t){throw"AbortError"===t.name?t:new o(t)}))}},476:function(t,e,n){"use strict";t.exports=function(t,e){if(e=e.split(":")[0],!(t=+t))return!1;switch(e){case"http":case"ws":return 80!==t;case"https":case"wss":return 443!==t;case"ftp":return 21!==t;case"gopher":return 70!==t;case"file":return!1}return 0!==t}},477:function(t,e,n){"use strict";var o=Object.prototype.hasOwnProperty;function r(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(e){return null}}function s(t){try{return encodeURIComponent(t)}catch(e){return null}}e.stringify=function(t,e){e=e||"";var n,r,i=[];for(r in"string"!==typeof e&&(e="?"),t)if(o.call(t,r)){if((n=t[r])||null!==n&&undefined!==n&&!isNaN(n)||(n=""),r=s(r),n=s(n),null===r||null===n)continue;i.push(r+"="+n)}return i.length?e+i.join("&"):""},e.parse=function(t){for(var e,n=/([^=?#&]+)=?([^&]*)/g,o={};e=n.exec(t);){var s=r(e[1]),i=r(e[2]);null===s||null===i||s in o||(o[s]=i)}return o}},478:function(t,e,n){"use strict";function o(t){var e="function"===typeof Map?new Map:void 0;return o=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!==typeof t)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof e){if(e.has(t))return e.get(t);e.set(t,o)}function o(){return r(t,arguments,a(this).constructor)}return o.prototype=Object.create(t.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),i(o,t)},o(t)}function r(t,e,n){return r=s()?Reflect.construct:function(t,e,n){var o=[null];o.push.apply(o,e);var r=new(Function.bind.apply(t,o));return n&&i(r,n.prototype),r},r.apply(null,arguments)}function s(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function i(t,e){return i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},i(t,e)}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}var u=function(t){var e,n;function o(){var e;return(e=t.call(this,"Authorization required")||this).name="AuthError",e.isAuthError=!0,e}return n=t,(e=o).prototype=Object.create(n.prototype),e.prototype.constructor=e,i(e,n),o}(o(Error));t.exports=u},479:function(t,e,n){"use strict";function o(){return o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},o.apply(this,arguments)}function r(t,e){return r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(t,e)}var s=n(480),i=n(440),a=n(441),u=n(481);t.exports=function(t){var e,n;function a(e,n){var o;return(o=t.call(this,e,n)||this).provider=n.provider,o.id=o.provider,o.name=o.opts.name||o.id.split("-").map((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})).join(" "),o.pluginId=o.opts.pluginId,o.tokenKey="companion-"+o.pluginId+"-auth-token",o.companionKeysParams=o.opts.companionKeysParams,o.preAuthToken=null,o}n=t,(e=a).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n);var c=a.prototype;return c.headers=function(){var e=this;return Promise.all([t.prototype.headers.call(this),this.getAuthToken()]).then((function(t){var n=t[0],r=t[1],s={};return r&&(s["uppy-auth-token"]=r),e.companionKeysParams&&(s["uppy-credentials-params"]=btoa(JSON.stringify({params:e.companionKeysParams}))),o({},n,s)}))},c.onReceiveResponse=function(e){e=t.prototype.onReceiveResponse.call(this,e);var n=this.uppy.getPlugin(this.pluginId),o=n.getPluginState().authenticated?401!==e.status:e.status<400;return n.setPluginState({authenticated:o}),e},c.setAuthToken=function(t){return this.uppy.getPlugin(this.pluginId).storage.setItem(this.tokenKey,t)},c.getAuthToken=function(){return this.uppy.getPlugin(this.pluginId).storage.getItem(this.tokenKey)},c.authUrl=function(t){void 0===t&&(t={}),this.preAuthToken&&(t.uppyPreAuthToken=this.preAuthToken);var e=s(t);return e=e?"?"+e:e,this.hostname+"/"+this.id+"/connect"+e},c.fileUrl=function(t){return this.hostname+"/"+this.id+"/get/"+t},c.fetchPreAuthToken=function(){var t=this;return this.companionKeysParams?this.post(this.id+"/preauth/",{params:this.companionKeysParams}).then((function(e){t.preAuthToken=e.token})).catch((function(e){t.uppy.log("[CompanionClient] unable to fetch preAuthToken "+e,"warning")})):Promise.resolve()},c.list=function(t){return this.get(this.id+"/list/"+(t||""))},c.logout=function(){var t=this;return this.get(this.id+"/logout").then((function(e){return Promise.all([e,t.uppy.getPlugin(t.pluginId).storage.removeItem(t.tokenKey)])})).then((function(t){return t[0]}))},a.initPlugin=function(t,e,n){if(t.type="acquirer",t.files=[],n&&(t.opts=o({},n,e)),e.serverUrl||e.serverPattern)throw new Error("`serverUrl` and `serverPattern` have been renamed to `companionUrl` and `companionAllowedHosts` respectively in the 0.30.5 release. Please consult the docs (for example, https://uppy.io/docs/instagram/ for the Instagram plugin) and use the updated options.`");if(e.companionAllowedHosts){var r=e.companionAllowedHosts;if("string"!==typeof r&&!Array.isArray(r)&&!(r instanceof RegExp))throw new TypeError(t.id+': the option "companionAllowedHosts" must be one of string, Array, RegExp');t.opts.companionAllowedHosts=r}else/^(?!https?:\/\/).*$/i.test(e.companionUrl)?t.opts.companionAllowedHosts="https://"+e.companionUrl.replace(/^\/\//,""):t.opts.companionAllowedHosts=new i(e.companionUrl).origin;t.storage=t.opts.storage||u},a}(a)},480:function(t,e){var n=Object.prototype.hasOwnProperty;t.exports=function t(e,o){var r=[];for(var s in e)if(n.call(e,s)){var i,a=e[s],u=encodeURIComponent(s);i="object"===typeof a?t(a,o?o+"["+u+"]":u):(o?o+"["+u+"]":u)+"="+encodeURIComponent(a),r.push(i)}return r.join("&")}},481:function(t,e,n){"use strict";t.exports.setItem=function(t,e){return new Promise((function(n){localStorage.setItem(t,e),n()}))},t.exports.getItem=function(t){return Promise.resolve(localStorage.getItem(t))},t.exports.removeItem=function(t){return new Promise((function(e){localStorage.removeItem(t),e()}))}},482:function(t,e,n){"use strict";function o(t,e){return o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},o(t,e)}var r=n(441);t.exports=function(t){var e,n;function r(e,n){var o;return(o=t.call(this,e,n)||this).provider=n.provider,o.id=o.provider,o.name=o.opts.name||o.id.split("-").map((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})).join(" "),o.pluginId=o.opts.pluginId,o}n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,o(e,n);var s=r.prototype;return s.fileUrl=function(t){return this.hostname+"/search/"+this.id+"/get/"+t},s.search=function(t,e){return e=e?"&"+e:"",this.get("search/"+this.id+"/list?q="+encodeURIComponent(t)+e)},r}(r)},483:function(t,e,n){var o=n(220);t.exports=function(){function t(t){this.opts=t,this._queued=[],this.isOpen=!1,this.emitter=o(),this._handleMessage=this._handleMessage.bind(this),this.close=this.close.bind(this),this.emit=this.emit.bind(this),this.on=this.on.bind(this),this.once=this.once.bind(this),this.send=this.send.bind(this),t&&!1===t.autoOpen||this.open()}var e=t.prototype;return e.open=function(){var t=this;this.socket=new WebSocket(this.opts.target),this.socket.onopen=function(e){for(t.isOpen=!0;t._queued.length>0&&t.isOpen;){var n=t._queued[0];t.send(n.action,n.payload),t._queued=t._queued.slice(1)}},this.socket.onclose=function(e){t.isOpen=!1},this.socket.onmessage=this._handleMessage},e.close=function(){this.socket&&this.socket.close()},e.send=function(t,e){this.isOpen?this.socket.send(JSON.stringify({action:t,payload:e})):this._queued.push({action:t,payload:e})},e.on=function(t,e){this.emitter.on(t,e)},e.emit=function(t,e){this.emitter.emit(t,e)},e.once=function(t,e){this.emitter.once(t,e)},e._handleMessage=function(t){try{var e=JSON.parse(t.data);this.emit(e.action,e.payload)}catch(n){console.log(n)}},t}()}}]);
2
+ //# sourceMappingURL=0.e9d808b4.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../node_modules/@uppy/companion-client/lib/index.js","../../../node_modules/@uppy/utils/lib/NetworkError.js","../../../node_modules/url-parse/index.js","../../../node_modules/@uppy/companion-client/lib/RequestClient.js","../../../node_modules/@uppy/utils/lib/fetchWithNetworkError.js","../../../node_modules/requires-port/index.js","../../../node_modules/querystringify/index.js","../../../node_modules/@uppy/companion-client/lib/AuthError.js","../../../node_modules/@uppy/companion-client/lib/Provider.js","../../../node_modules/qs-stringify/index.js","../../../node_modules/@uppy/companion-client/lib/tokenStorage.js","../../../node_modules/@uppy/companion-client/lib/SearchProvider.js","../../../node_modules/@uppy/companion-client/lib/Socket.js"],"names":["RequestClient","require","Provider","SearchProvider","Socket","module","exports","_wrapNativeSuper","Class","_cache","Map","undefined","fn","Function","toString","call","indexOf","TypeError","has","get","set","Wrapper","_construct","arguments","_getPrototypeOf","this","constructor","prototype","Object","create","value","enumerable","writable","configurable","_setPrototypeOf","Parent","args","_isNativeReflectConstruct","Reflect","construct","a","push","apply","instance","bind","sham","Proxy","Boolean","valueOf","e","o","p","setPrototypeOf","__proto__","getPrototypeOf","NetworkError","_Error","subClass","superClass","error","xhr","_this","isNetworkError","request","Error","required","qs","slashes","protocolre","windowsDriveLetter","left","RegExp","trimLeft","str","replace","rules","address","url","isSpecial","protocol","NaN","ignore","hash","query","lolcation","loc","key","location","window","global","self","finaldestination","type","Url","unescape","pathname","test","href","scheme","extractProtocol","rest","match","exec","toLowerCase","forwardSlashes","otherSlashes","slashesCount","length","slice","parser","relative","extracted","parse","instruction","index","instructions","i","charAt","base","path","split","concat","last","unshift","up","splice","join","resolve","port","host","hostname","username","password","auth","origin","part","pop","char","ins","stringify","result","_class","_temp","_extends","assign","target","source","hasOwnProperty","_defineProperties","props","descriptor","defineProperty","AuthError","fetchWithNetworkError","uppy","opts","onReceiveResponse","allowedHeaders","preflightDone","Constructor","protoProps","staticProps","_proto","headers","userHeaders","companionHeaders","serverHeaders","Promise","defaultHeaders","_getPostResponseFunc","skip","response","_extends2","companion","getState","companionUrl","setState","_getUrl","_json","res","status","errMsg","statusText","json","then","errData","message","requestId","preflight","_this2","fetch","method","map","headerName","trim","err","log","preflightAndHeaders","_this3","all","_ref","keys","forEach","header","skipPostResponse","_this4","credentials","companionCookiesRule","isAuthError","reject","post","data","_this5","body","JSON","_this6","Accept","VERSION","name","decode","input","decodeURIComponent","encode","encodeURIComponent","obj","prefix","pairs","undef","isNaN","qsStringify","URL","tokenStorage","_RequestClient","provider","id","s","toUpperCase","pluginId","tokenKey","companionKeysParams","preAuthToken","getAuthToken","token","authHeaders","btoa","params","plugin","getPlugin","authenticated","getPluginState","setPluginState","setAuthToken","storage","setItem","getItem","authUrl","queries","uppyPreAuthToken","strigifiedQueries","fileUrl","fetchPreAuthToken","list","directory","logout","removeItem","_ref2","initPlugin","defaultOpts","files","serverUrl","serverPattern","companionAllowedHosts","pattern","Array","isArray","queryStringify","pair","enkey","localStorage","search","text","ee","UppySocket","_queued","isOpen","emitter","_handleMessage","close","emit","on","once","send","autoOpen","open","socket","WebSocket","onopen","first","action","payload","onclose","onmessage","handler","console"],"mappings":"wIAKA,IAAIA,EAAgBC,EAAQ,KAExBC,EAAWD,EAAQ,KAEnBE,EAAiBF,EAAQ,KAEzBG,EAASH,EAAQ,KAErBI,EAAOC,QAAU,CACfN,cAAeA,EACfE,SAAUA,EACVC,eAAgBA,EAChBC,OAAQA,I,kBCfV,SAASG,EAAiBC,GAAS,IAAIC,EAAwB,oBAARC,IAAqB,IAAIA,SAAQC,EAA8nB,OAAnnBJ,EAAmB,SAA0BC,GAAS,GAAc,OAAVA,IAMlII,EANuKJ,GAMjG,IAAzDK,SAASC,SAASC,KAAKH,GAAII,QAAQ,kBAN+H,OAAOR,EAMjN,IAA2BI,EAN6L,GAAqB,oBAAVJ,EAAwB,MAAM,IAAIS,UAAU,sDAAyD,GAAsB,qBAAXR,EAAwB,CAAE,GAAIA,EAAOS,IAAIV,GAAQ,OAAOC,EAAOU,IAAIX,GAAQC,EAAOW,IAAIZ,EAAOa,GAAY,SAASA,IAAY,OAAOC,EAAWd,EAAOe,UAAWC,EAAgBC,MAAMC,aAAgK,OAAhJL,EAAQM,UAAYC,OAAOC,OAAOrB,EAAMmB,UAAW,CAAED,YAAa,CAAEI,MAAOT,EAASU,YAAY,EAAOC,UAA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SAAcU,EAAQC,GAClClR,KAAKoQ,QAAQG,KAAKU,EAAQC,IAG5BzI,EAAOgI,KAAO,SAAcQ,EAAQI,GAClCrR,KAAKoQ,QAAQK,KAAKQ,EAAQI,IAG5B5I,EAAO4H,eAAiB,SAAwB7O,GAC9C,IACE,IAAIyI,EAAU4B,KAAKtG,MAAM/D,EAAEkK,MAC3B1L,KAAKuQ,KAAKtG,EAAQgH,OAAQhH,EAAQiH,SAClC,MAAOxG,GACP4G,QAAQ3G,IAAID,KAITuF,EAxFqB","file":"static/js/0.f79b9ef3.chunk.js","sourcesContent":["'use strict';\n/**\n * Manages communications with Companion\n */\n\nvar RequestClient = require('./RequestClient');\n\nvar Provider = require('./Provider');\n\nvar SearchProvider = require('./SearchProvider');\n\nvar Socket = require('./Socket');\n\nmodule.exports = {\n RequestClient: RequestClient,\n Provider: Provider,\n SearchProvider: SearchProvider,\n Socket: Socket\n};","function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar NetworkError = /*#__PURE__*/function (_Error) {\n _inheritsLoose(NetworkError, _Error);\n\n function NetworkError(error, xhr) {\n var _this;\n\n if (xhr === void 0) {\n xhr = null;\n }\n\n _this = _Error.call(this, \"This looks like a network error, the endpoint might be blocked by an internet provider or a firewall.\\n\\nSource error: [\" + error + \"]\") || this;\n _this.isNetworkError = true;\n _this.request = xhr;\n return _this;\n }\n\n return NetworkError;\n}( /*#__PURE__*/_wrapNativeSuper(Error));\n\nmodule.exports = NetworkError;","'use strict';\n\nvar required = require('requires-port')\n , qs = require('querystringify')\n , slashes = /^[A-Za-z][A-Za-z0-9+-.]*:\\/\\//\n , protocolre = /^([a-z][a-z0-9.+-]*:)?(\\/\\/)?([\\\\/]+)?([\\S\\s]*)/i\n , windowsDriveLetter = /^[a-zA-Z]:/\n , whitespace = '[\\\\x09\\\\x0A\\\\x0B\\\\x0C\\\\x0D\\\\x20\\\\xA0\\\\u1680\\\\u180E\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200A\\\\u202F\\\\u205F\\\\u3000\\\\u2028\\\\u2029\\\\uFEFF]'\n , left = new RegExp('^'+ whitespace +'+');\n\n/**\n * Trim a given string.\n *\n * @param {String} str String to trim.\n * @public\n */\nfunction trimLeft(str) {\n return (str ? str : '').toString().replace(left, '');\n}\n\n/**\n * These are the parse rules for the URL parser, it informs the parser\n * about:\n *\n * 0. The char it Needs to parse, if it's a string it should be done using\n * indexOf, RegExp using exec and NaN means set as current value.\n * 1. The property we should set when parsing this value.\n * 2. Indication if it's backwards or forward parsing, when set as number it's\n * the value of extra chars that should be split off.\n * 3. Inherit from location if non existing in the parser.\n * 4. `toLowerCase` the resulting value.\n */\nvar rules = [\n ['#', 'hash'], // Extract from the back.\n ['?', 'query'], // Extract from the back.\n function sanitize(address, url) { // Sanitize what is left of the address\n return isSpecial(url.protocol) ? address.replace(/\\\\/g, '/') : address;\n },\n ['/', 'pathname'], // Extract from the back.\n ['@', 'auth', 1], // Extract from the front.\n [NaN, 'host', undefined, 1, 1], // Set left over value.\n [/:(\\d+)$/, 'port', undefined, 1], // RegExp the back.\n [NaN, 'hostname', undefined, 1, 1] // Set left over.\n];\n\n/**\n * These properties should not be copied or inherited from. This is only needed\n * for all non blob URL's as a blob URL does not include a hash, only the\n * origin.\n *\n * @type {Object}\n * @private\n */\nvar ignore = { hash: 1, query: 1 };\n\n/**\n * The location object differs when your code is loaded through a normal page,\n * Worker or through a worker using a blob. And with the blobble begins the\n * trouble as the location object will contain the URL of the blob, not the\n * location of the page where our code is loaded in. The actual origin is\n * encoded in the `pathname` so we can thankfully generate a good \"default\"\n * location from it so we can generate proper relative URL's again.\n *\n * @param {Object|String} loc Optional default location object.\n * @returns {Object} lolcation object.\n * @public\n */\nfunction lolcation(loc) {\n var globalVar;\n\n if (typeof window !== 'undefined') globalVar = window;\n else if (typeof global !== 'undefined') globalVar = global;\n else if (typeof self !== 'undefined') globalVar = self;\n else globalVar = {};\n\n var location = globalVar.location || {};\n loc = loc || location;\n\n var finaldestination = {}\n , type = typeof loc\n , key;\n\n if ('blob:' === loc.protocol) {\n finaldestination = new Url(unescape(loc.pathname), {});\n } else if ('string' === type) {\n finaldestination = new Url(loc, {});\n for (key in ignore) delete finaldestination[key];\n } else if ('object' === type) {\n for (key in loc) {\n if (key in ignore) continue;\n finaldestination[key] = loc[key];\n }\n\n if (finaldestination.slashes === undefined) {\n finaldestination.slashes = slashes.test(loc.href);\n }\n }\n\n return finaldestination;\n}\n\n/**\n * Check whether a protocol scheme is special.\n *\n * @param {String} The protocol scheme of the URL\n * @return {Boolean} `true` if the protocol scheme is special, else `false`\n * @private\n */\nfunction isSpecial(scheme) {\n return (\n scheme === 'file:' ||\n scheme === 'ftp:' ||\n scheme === 'http:' ||\n scheme === 'https:' ||\n scheme === 'ws:' ||\n scheme === 'wss:'\n );\n}\n\n/**\n * @typedef ProtocolExtract\n * @type Object\n * @property {String} protocol Protocol matched in the URL, in lowercase.\n * @property {Boolean} slashes `true` if protocol is followed by \"//\", else `false`.\n * @property {String} rest Rest of the URL that is not part of the protocol.\n */\n\n/**\n * Extract protocol information from a URL with/without double slash (\"//\").\n *\n * @param {String} address URL we want to extract from.\n * @param {Object} location\n * @return {ProtocolExtract} Extracted information.\n * @private\n */\nfunction extractProtocol(address, location) {\n address = trimLeft(address);\n location = location || {};\n\n var match = protocolre.exec(address);\n var protocol = match[1] ? match[1].toLowerCase() : '';\n var forwardSlashes = !!match[2];\n var otherSlashes = !!match[3];\n var slashesCount = 0;\n var rest;\n\n if (forwardSlashes) {\n if (otherSlashes) {\n rest = match[2] + match[3] + match[4];\n slashesCount = match[2].length + match[3].length;\n } else {\n rest = match[2] + match[4];\n slashesCount = match[2].length;\n }\n } else {\n if (otherSlashes) {\n rest = match[3] + match[4];\n slashesCount = match[3].length;\n } else {\n rest = match[4]\n }\n }\n\n if (protocol === 'file:') {\n if (slashesCount >= 2) {\n rest = rest.slice(2);\n }\n } else if (isSpecial(protocol)) {\n rest = match[4];\n } else if (protocol) {\n if (forwardSlashes) {\n rest = rest.slice(2);\n }\n } else if (slashesCount >= 2 && isSpecial(location.protocol)) {\n rest = match[4];\n }\n\n return {\n protocol: protocol,\n slashes: forwardSlashes || isSpecial(protocol),\n slashesCount: slashesCount,\n rest: rest\n };\n}\n\n/**\n * Resolve a relative URL pathname against a base URL pathname.\n *\n * @param {String} relative Pathname of the relative URL.\n * @param {String} base Pathname of the base URL.\n * @return {String} Resolved pathname.\n * @private\n */\nfunction resolve(relative, base) {\n if (relative === '') return base;\n\n var path = (base || '/').split('/').slice(0, -1).concat(relative.split('/'))\n , i = path.length\n , last = path[i - 1]\n , unshift = false\n , up = 0;\n\n while (i--) {\n if (path[i] === '.') {\n path.splice(i, 1);\n } else if (path[i] === '..') {\n path.splice(i, 1);\n up++;\n } else if (up) {\n if (i === 0) unshift = true;\n path.splice(i, 1);\n up--;\n }\n }\n\n if (unshift) path.unshift('');\n if (last === '.' || last === '..') path.push('');\n\n return path.join('/');\n}\n\n/**\n * The actual URL instance. Instead of returning an object we've opted-in to\n * create an actual constructor as it's much more memory efficient and\n * faster and it pleases my OCD.\n *\n * It is worth noting that we should not use `URL` as class name to prevent\n * clashes with the global URL instance that got introduced in browsers.\n *\n * @constructor\n * @param {String} address URL we want to parse.\n * @param {Object|String} [location] Location defaults for relative paths.\n * @param {Boolean|Function} [parser] Parser for the query string.\n * @private\n */\nfunction Url(address, location, parser) {\n address = trimLeft(address);\n\n if (!(this instanceof Url)) {\n return new Url(address, location, parser);\n }\n\n var relative, extracted, parse, instruction, index, key\n , instructions = rules.slice()\n , type = typeof location\n , url = this\n , i = 0;\n\n //\n // The following if statements allows this module two have compatibility with\n // 2 different API:\n //\n // 1. Node.js's `url.parse` api which accepts a URL, boolean as arguments\n // where the boolean indicates that the query string should also be parsed.\n //\n // 2. The `URL` interface of the browser which accepts a URL, object as\n // arguments. The supplied object will be used as default values / fall-back\n // for relative paths.\n //\n if ('object' !== type && 'string' !== type) {\n parser = location;\n location = null;\n }\n\n if (parser && 'function' !== typeof parser) parser = qs.parse;\n\n location = lolcation(location);\n\n //\n // Extract protocol information before running the instructions.\n //\n extracted = extractProtocol(address || '', location);\n relative = !extracted.protocol && !extracted.slashes;\n url.slashes = extracted.slashes || relative && location.slashes;\n url.protocol = extracted.protocol || location.protocol || '';\n address = extracted.rest;\n\n //\n // When the authority component is absent the URL starts with a path\n // component.\n //\n if (\n extracted.protocol === 'file:' && (\n extracted.slashesCount !== 2 || windowsDriveLetter.test(address)) ||\n (!extracted.slashes &&\n (extracted.protocol ||\n extracted.slashesCount < 2 ||\n !isSpecial(url.protocol)))\n ) {\n instructions[3] = [/(.*)/, 'pathname'];\n }\n\n for (; i < instructions.length; i++) {\n instruction = instructions[i];\n\n if (typeof instruction === 'function') {\n address = instruction(address, url);\n continue;\n }\n\n parse = instruction[0];\n key = instruction[1];\n\n if (parse !== parse) {\n url[key] = address;\n } else if ('string' === typeof parse) {\n if (~(index = address.indexOf(parse))) {\n if ('number' === typeof instruction[2]) {\n url[key] = address.slice(0, index);\n address = address.slice(index + instruction[2]);\n } else {\n url[key] = address.slice(index);\n address = address.slice(0, index);\n }\n }\n } else if ((index = parse.exec(address))) {\n url[key] = index[1];\n address = address.slice(0, index.index);\n }\n\n url[key] = url[key] || (\n relative && instruction[3] ? location[key] || '' : ''\n );\n\n //\n // Hostname, host and protocol should be lowercased so they can be used to\n // create a proper `origin`.\n //\n if (instruction[4]) url[key] = url[key].toLowerCase();\n }\n\n //\n // Also parse the supplied query string in to an object. If we're supplied\n // with a custom parser as function use that instead of the default build-in\n // parser.\n //\n if (parser) url.query = parser(url.query);\n\n //\n // If the URL is relative, resolve the pathname against the base URL.\n //\n if (\n relative\n && location.slashes\n && url.pathname.charAt(0) !== '/'\n && (url.pathname !== '' || location.pathname !== '')\n ) {\n url.pathname = resolve(url.pathname, location.pathname);\n }\n\n //\n // Default to a / for pathname if none exists. This normalizes the URL\n // to always have a /\n //\n if (url.pathname.charAt(0) !== '/' && isSpecial(url.protocol)) {\n url.pathname = '/' + url.pathname;\n }\n\n //\n // We should not add port numbers if they are already the default port number\n // for a given protocol. As the host also contains the port number we're going\n // override it with the hostname which contains no port number.\n //\n if (!required(url.port, url.protocol)) {\n url.host = url.hostname;\n url.port = '';\n }\n\n //\n // Parse down the `auth` for the username and password.\n //\n url.username = url.password = '';\n if (url.auth) {\n instruction = url.auth.split(':');\n url.username = instruction[0] || '';\n url.password = instruction[1] || '';\n }\n\n url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host\n ? url.protocol +'//'+ url.host\n : 'null';\n\n //\n // The href is just the compiled result.\n //\n url.href = url.toString();\n}\n\n/**\n * This is convenience method for changing properties in the URL instance to\n * insure that they all propagate correctly.\n *\n * @param {String} part Property we need to adjust.\n * @param {Mixed} value The newly assigned value.\n * @param {Boolean|Function} fn When setting the query, it will be the function\n * used to parse the query.\n * When setting the protocol, double slash will be\n * removed from the final url if it is true.\n * @returns {URL} URL instance for chaining.\n * @public\n */\nfunction set(part, value, fn) {\n var url = this;\n\n switch (part) {\n case 'query':\n if ('string' === typeof value && value.length) {\n value = (fn || qs.parse)(value);\n }\n\n url[part] = value;\n break;\n\n case 'port':\n url[part] = value;\n\n if (!required(value, url.protocol)) {\n url.host = url.hostname;\n url[part] = '';\n } else if (value) {\n url.host = url.hostname +':'+ value;\n }\n\n break;\n\n case 'hostname':\n url[part] = value;\n\n if (url.port) value += ':'+ url.port;\n url.host = value;\n break;\n\n case 'host':\n url[part] = value;\n\n if (/:\\d+$/.test(value)) {\n value = value.split(':');\n url.port = value.pop();\n url.hostname = value.join(':');\n } else {\n url.hostname = value;\n url.port = '';\n }\n\n break;\n\n case 'protocol':\n url.protocol = value.toLowerCase();\n url.slashes = !fn;\n break;\n\n case 'pathname':\n case 'hash':\n if (value) {\n var char = part === 'pathname' ? '/' : '#';\n url[part] = value.charAt(0) !== char ? char + value : value;\n } else {\n url[part] = value;\n }\n break;\n\n default:\n url[part] = value;\n }\n\n for (var i = 0; i < rules.length; i++) {\n var ins = rules[i];\n\n if (ins[4]) url[ins[1]] = url[ins[1]].toLowerCase();\n }\n\n url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host\n ? url.protocol +'//'+ url.host\n : 'null';\n\n url.href = url.toString();\n\n return url;\n}\n\n/**\n * Transform the properties back in to a valid and full URL string.\n *\n * @param {Function} stringify Optional query stringify function.\n * @returns {String} Compiled version of the URL.\n * @public\n */\nfunction toString(stringify) {\n if (!stringify || 'function' !== typeof stringify) stringify = qs.stringify;\n\n var query\n , url = this\n , protocol = url.protocol;\n\n if (protocol && protocol.charAt(protocol.length - 1) !== ':') protocol += ':';\n\n var result = protocol + (url.slashes || isSpecial(url.protocol) ? '//' : '');\n\n if (url.username) {\n result += url.username;\n if (url.password) result += ':'+ url.password;\n result += '@';\n }\n\n result += url.host + url.pathname;\n\n query = 'object' === typeof url.query ? stringify(url.query) : url.query;\n if (query) result += '?' !== query.charAt(0) ? '?'+ query : query;\n\n if (url.hash) result += url.hash;\n\n return result;\n}\n\nUrl.prototype = { set: set, toString: toString };\n\n//\n// Expose the URL parser and some additional properties that might be useful for\n// others or testing.\n//\nUrl.extractProtocol = extractProtocol;\nUrl.location = lolcation;\nUrl.trimLeft = trimLeft;\nUrl.qs = qs;\n\nmodule.exports = Url;\n","'use strict';\n\nvar _class, _temp;\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar AuthError = require('./AuthError');\n\nvar fetchWithNetworkError = require('@uppy/utils/lib/fetchWithNetworkError'); // Remove the trailing slash so we can always safely append /xyz.\n\n\nfunction stripSlash(url) {\n return url.replace(/\\/$/, '');\n}\n\nmodule.exports = (_temp = _class = /*#__PURE__*/function () {\n function RequestClient(uppy, opts) {\n this.uppy = uppy;\n this.opts = opts;\n this.onReceiveResponse = this.onReceiveResponse.bind(this);\n this.allowedHeaders = ['accept', 'content-type', 'uppy-auth-token'];\n this.preflightDone = false;\n }\n\n var _proto = RequestClient.prototype;\n\n _proto.headers = function headers() {\n var userHeaders = this.opts.companionHeaders || this.opts.serverHeaders || {};\n return Promise.resolve(_extends({}, this.defaultHeaders, userHeaders));\n };\n\n _proto._getPostResponseFunc = function _getPostResponseFunc(skip) {\n var _this = this;\n\n return function (response) {\n if (!skip) {\n return _this.onReceiveResponse(response);\n }\n\n return response;\n };\n };\n\n _proto.onReceiveResponse = function onReceiveResponse(response) {\n var state = this.uppy.getState();\n var companion = state.companion || {};\n var host = this.opts.companionUrl;\n var headers = response.headers; // Store the self-identified domain name for the Companion instance we just hit.\n\n if (headers.has('i-am') && headers.get('i-am') !== companion[host]) {\n var _extends2;\n\n this.uppy.setState({\n companion: _extends({}, companion, (_extends2 = {}, _extends2[host] = headers.get('i-am'), _extends2))\n });\n }\n\n return response;\n };\n\n _proto._getUrl = function _getUrl(url) {\n if (/^(https?:|)\\/\\//.test(url)) {\n return url;\n }\n\n return this.hostname + \"/\" + url;\n };\n\n _proto._json = function _json(res) {\n if (res.status === 401) {\n throw new AuthError();\n }\n\n if (res.status < 200 || res.status > 300) {\n var errMsg = \"Failed request with status: \" + res.status + \". \" + res.statusText;\n return res.json().then(function (errData) {\n errMsg = errData.message ? errMsg + \" message: \" + errData.message : errMsg;\n errMsg = errData.requestId ? errMsg + \" request-Id: \" + errData.requestId : errMsg;\n throw new Error(errMsg);\n }).catch(function () {\n throw new Error(errMsg);\n });\n }\n\n return res.json();\n };\n\n _proto.preflight = function preflight(path) {\n var _this2 = this;\n\n if (this.preflightDone) {\n return Promise.resolve(this.allowedHeaders.slice());\n }\n\n return fetch(this._getUrl(path), {\n method: 'OPTIONS'\n }).then(function (response) {\n if (response.headers.has('access-control-allow-headers')) {\n _this2.allowedHeaders = response.headers.get('access-control-allow-headers').split(',').map(function (headerName) {\n return headerName.trim().toLowerCase();\n });\n }\n\n _this2.preflightDone = true;\n return _this2.allowedHeaders.slice();\n }).catch(function (err) {\n _this2.uppy.log(\"[CompanionClient] unable to make preflight request \" + err, 'warning');\n\n _this2.preflightDone = true;\n return _this2.allowedHeaders.slice();\n });\n };\n\n _proto.preflightAndHeaders = function preflightAndHeaders(path) {\n var _this3 = this;\n\n return Promise.all([this.preflight(path), this.headers()]).then(function (_ref) {\n var allowedHeaders = _ref[0],\n headers = _ref[1];\n // filter to keep only allowed Headers\n Object.keys(headers).forEach(function (header) {\n if (allowedHeaders.indexOf(header.toLowerCase()) === -1) {\n _this3.uppy.log(\"[CompanionClient] excluding unallowed header \" + header);\n\n delete headers[header];\n }\n });\n return headers;\n });\n };\n\n _proto.get = function get(path, skipPostResponse) {\n var _this4 = this;\n\n return this.preflightAndHeaders(path).then(function (headers) {\n return fetchWithNetworkError(_this4._getUrl(path), {\n method: 'get',\n headers: headers,\n credentials: _this4.opts.companionCookiesRule || 'same-origin'\n });\n }).then(this._getPostResponseFunc(skipPostResponse)).then(function (res) {\n return _this4._json(res);\n }).catch(function (err) {\n if (!err.isAuthError) {\n err.message = \"Could not get \" + _this4._getUrl(path) + \". \" + err.message;\n }\n\n return Promise.reject(err);\n });\n };\n\n _proto.post = function post(path, data, skipPostResponse) {\n var _this5 = this;\n\n return this.preflightAndHeaders(path).then(function (headers) {\n return fetchWithNetworkError(_this5._getUrl(path), {\n method: 'post',\n headers: headers,\n credentials: _this5.opts.companionCookiesRule || 'same-origin',\n body: JSON.stringify(data)\n });\n }).then(this._getPostResponseFunc(skipPostResponse)).then(function (res) {\n return _this5._json(res);\n }).catch(function (err) {\n if (!err.isAuthError) {\n err.message = \"Could not post \" + _this5._getUrl(path) + \". \" + err.message;\n }\n\n return Promise.reject(err);\n });\n };\n\n _proto.delete = function _delete(path, data, skipPostResponse) {\n var _this6 = this;\n\n return this.preflightAndHeaders(path).then(function (headers) {\n return fetchWithNetworkError(_this6.hostname + \"/\" + path, {\n method: 'delete',\n headers: headers,\n credentials: _this6.opts.companionCookiesRule || 'same-origin',\n body: data ? JSON.stringify(data) : null\n });\n }).then(this._getPostResponseFunc(skipPostResponse)).then(function (res) {\n return _this6._json(res);\n }).catch(function (err) {\n if (!err.isAuthError) {\n err.message = \"Could not delete \" + _this6._getUrl(path) + \". \" + err.message;\n }\n\n return Promise.reject(err);\n });\n };\n\n _createClass(RequestClient, [{\n key: \"hostname\",\n get: function get() {\n var _this$uppy$getState = this.uppy.getState(),\n companion = _this$uppy$getState.companion;\n\n var host = this.opts.companionUrl;\n return stripSlash(companion && companion[host] ? companion[host] : host);\n }\n }, {\n key: \"defaultHeaders\",\n get: function get() {\n return {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n 'Uppy-Versions': \"@uppy/companion-client=\" + RequestClient.VERSION\n };\n }\n }]);\n\n return RequestClient;\n}(), _class.VERSION = \"1.10.2\", _temp);","var NetworkError = require('./NetworkError');\n/**\n * Wrapper around window.fetch that throws a NetworkError when appropriate\n */\n\n\nmodule.exports = function fetchWithNetworkError() {\n return fetch.apply(void 0, arguments).catch(function (err) {\n if (err.name === 'AbortError') {\n throw err;\n } else {\n throw new NetworkError(err);\n }\n });\n};","'use strict';\n\n/**\n * Check if we're required to add a port number.\n *\n * @see https://url.spec.whatwg.org/#default-port\n * @param {Number|String} port Port number we need to check\n * @param {String} protocol Protocol we need to check against.\n * @returns {Boolean} Is it a default port for the given protocol\n * @api private\n */\nmodule.exports = function required(port, protocol) {\n protocol = protocol.split(':')[0];\n port = +port;\n\n if (!port) return false;\n\n switch (protocol) {\n case 'http':\n case 'ws':\n return port !== 80;\n\n case 'https':\n case 'wss':\n return port !== 443;\n\n case 'ftp':\n return port !== 21;\n\n case 'gopher':\n return port !== 70;\n\n case 'file':\n return false;\n }\n\n return port !== 0;\n};\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , undef;\n\n/**\n * Decode a URI encoded string.\n *\n * @param {String} input The URI encoded string.\n * @returns {String|Null} The decoded string.\n * @api private\n */\nfunction decode(input) {\n try {\n return decodeURIComponent(input.replace(/\\+/g, ' '));\n } catch (e) {\n return null;\n }\n}\n\n/**\n * Attempts to encode a given input.\n *\n * @param {String} input The string that needs to be encoded.\n * @returns {String|Null} The encoded string.\n * @api private\n */\nfunction encode(input) {\n try {\n return encodeURIComponent(input);\n } catch (e) {\n return null;\n }\n}\n\n/**\n * Simple query string parser.\n *\n * @param {String} query The query string that needs to be parsed.\n * @returns {Object}\n * @api public\n */\nfunction querystring(query) {\n var parser = /([^=?#&]+)=?([^&]*)/g\n , result = {}\n , part;\n\n while (part = parser.exec(query)) {\n var key = decode(part[1])\n , value = decode(part[2]);\n\n //\n // Prevent overriding of existing properties. This ensures that build-in\n // methods like `toString` or __proto__ are not overriden by malicious\n // querystrings.\n //\n // In the case if failed decoding, we want to omit the key/value pairs\n // from the result.\n //\n if (key === null || value === null || key in result) continue;\n result[key] = value;\n }\n\n return result;\n}\n\n/**\n * Transform a query string to an object.\n *\n * @param {Object} obj Object that should be transformed.\n * @param {String} prefix Optional prefix.\n * @returns {String}\n * @api public\n */\nfunction querystringify(obj, prefix) {\n prefix = prefix || '';\n\n var pairs = []\n , value\n , key;\n\n //\n // Optionally prefix with a '?' if needed\n //\n if ('string' !== typeof prefix) prefix = '?';\n\n for (key in obj) {\n if (has.call(obj, key)) {\n value = obj[key];\n\n //\n // Edge cases where we actually want to encode the value to an empty\n // string instead of the stringified value.\n //\n if (!value && (value === null || value === undef || isNaN(value))) {\n value = '';\n }\n\n key = encode(key);\n value = encode(value);\n\n //\n // If we failed to encode the strings, we should bail out as we don't\n // want to add invalid strings to the query.\n //\n if (key === null || value === null) continue;\n pairs.push(key +'='+ value);\n }\n }\n\n return pairs.length ? prefix + pairs.join('&') : '';\n}\n\n//\n// Expose the module.\n//\nexports.stringify = querystringify;\nexports.parse = querystring;\n","'use strict';\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar AuthError = /*#__PURE__*/function (_Error) {\n _inheritsLoose(AuthError, _Error);\n\n function AuthError() {\n var _this;\n\n _this = _Error.call(this, 'Authorization required') || this;\n _this.name = 'AuthError';\n _this.isAuthError = true;\n return _this;\n }\n\n return AuthError;\n}( /*#__PURE__*/_wrapNativeSuper(Error));\n\nmodule.exports = AuthError;","'use strict';\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nvar qsStringify = require('qs-stringify');\n\nvar URL = require('url-parse');\n\nvar RequestClient = require('./RequestClient');\n\nvar tokenStorage = require('./tokenStorage');\n\nvar _getName = function _getName(id) {\n return id.split('-').map(function (s) {\n return s.charAt(0).toUpperCase() + s.slice(1);\n }).join(' ');\n};\n\nmodule.exports = /*#__PURE__*/function (_RequestClient) {\n _inheritsLoose(Provider, _RequestClient);\n\n function Provider(uppy, opts) {\n var _this;\n\n _this = _RequestClient.call(this, uppy, opts) || this;\n _this.provider = opts.provider;\n _this.id = _this.provider;\n _this.name = _this.opts.name || _getName(_this.id);\n _this.pluginId = _this.opts.pluginId;\n _this.tokenKey = \"companion-\" + _this.pluginId + \"-auth-token\";\n _this.companionKeysParams = _this.opts.companionKeysParams;\n _this.preAuthToken = null;\n return _this;\n }\n\n var _proto = Provider.prototype;\n\n _proto.headers = function headers() {\n var _this2 = this;\n\n return Promise.all([_RequestClient.prototype.headers.call(this), this.getAuthToken()]).then(function (_ref) {\n var headers = _ref[0],\n token = _ref[1];\n var authHeaders = {};\n\n if (token) {\n authHeaders['uppy-auth-token'] = token;\n }\n\n if (_this2.companionKeysParams) {\n authHeaders['uppy-credentials-params'] = btoa(JSON.stringify({\n params: _this2.companionKeysParams\n }));\n }\n\n return _extends({}, headers, authHeaders);\n });\n };\n\n _proto.onReceiveResponse = function onReceiveResponse(response) {\n response = _RequestClient.prototype.onReceiveResponse.call(this, response);\n var plugin = this.uppy.getPlugin(this.pluginId);\n var oldAuthenticated = plugin.getPluginState().authenticated;\n var authenticated = oldAuthenticated ? response.status !== 401 : response.status < 400;\n plugin.setPluginState({\n authenticated: authenticated\n });\n return response;\n } // @todo(i.olarewaju) consider whether or not this method should be exposed\n ;\n\n _proto.setAuthToken = function setAuthToken(token) {\n return this.uppy.getPlugin(this.pluginId).storage.setItem(this.tokenKey, token);\n };\n\n _proto.getAuthToken = function getAuthToken() {\n return this.uppy.getPlugin(this.pluginId).storage.getItem(this.tokenKey);\n };\n\n _proto.authUrl = function authUrl(queries) {\n if (queries === void 0) {\n queries = {};\n }\n\n if (this.preAuthToken) {\n queries.uppyPreAuthToken = this.preAuthToken;\n }\n\n var strigifiedQueries = qsStringify(queries);\n strigifiedQueries = strigifiedQueries ? \"?\" + strigifiedQueries : strigifiedQueries;\n return this.hostname + \"/\" + this.id + \"/connect\" + strigifiedQueries;\n };\n\n _proto.fileUrl = function fileUrl(id) {\n return this.hostname + \"/\" + this.id + \"/get/\" + id;\n };\n\n _proto.fetchPreAuthToken = function fetchPreAuthToken() {\n var _this3 = this;\n\n if (!this.companionKeysParams) {\n return Promise.resolve();\n }\n\n return this.post(this.id + \"/preauth/\", {\n params: this.companionKeysParams\n }).then(function (res) {\n _this3.preAuthToken = res.token;\n }).catch(function (err) {\n _this3.uppy.log(\"[CompanionClient] unable to fetch preAuthToken \" + err, 'warning');\n });\n };\n\n _proto.list = function list(directory) {\n return this.get(this.id + \"/list/\" + (directory || ''));\n };\n\n _proto.logout = function logout() {\n var _this4 = this;\n\n return this.get(this.id + \"/logout\").then(function (response) {\n return Promise.all([response, _this4.uppy.getPlugin(_this4.pluginId).storage.removeItem(_this4.tokenKey)]);\n }).then(function (_ref2) {\n var response = _ref2[0];\n return response;\n });\n };\n\n Provider.initPlugin = function initPlugin(plugin, opts, defaultOpts) {\n plugin.type = 'acquirer';\n plugin.files = [];\n\n if (defaultOpts) {\n plugin.opts = _extends({}, defaultOpts, opts);\n }\n\n if (opts.serverUrl || opts.serverPattern) {\n throw new Error('`serverUrl` and `serverPattern` have been renamed to `companionUrl` and `companionAllowedHosts` respectively in the 0.30.5 release. Please consult the docs (for example, https://uppy.io/docs/instagram/ for the Instagram plugin) and use the updated options.`');\n }\n\n if (opts.companionAllowedHosts) {\n var pattern = opts.companionAllowedHosts; // validate companionAllowedHosts param\n\n if (typeof pattern !== 'string' && !Array.isArray(pattern) && !(pattern instanceof RegExp)) {\n throw new TypeError(plugin.id + \": the option \\\"companionAllowedHosts\\\" must be one of string, Array, RegExp\");\n }\n\n plugin.opts.companionAllowedHosts = pattern;\n } else {\n // does not start with https://\n if (/^(?!https?:\\/\\/).*$/i.test(opts.companionUrl)) {\n plugin.opts.companionAllowedHosts = \"https://\" + opts.companionUrl.replace(/^\\/\\//, '');\n } else {\n plugin.opts.companionAllowedHosts = new URL(opts.companionUrl).origin;\n }\n }\n\n plugin.storage = plugin.opts.storage || tokenStorage;\n };\n\n return Provider;\n}(RequestClient);","var has = Object.prototype.hasOwnProperty\n\n/**\n * Stringify an object for use in a query string.\n *\n * @param {Object} obj - The object.\n * @param {string} prefix - When nesting, the parent key.\n * keys in `obj` will be stringified as `prefix[key]`.\n * @returns {string}\n */\n\nmodule.exports = function queryStringify (obj, prefix) {\n var pairs = []\n for (var key in obj) {\n if (!has.call(obj, key)) {\n continue\n }\n\n var value = obj[key]\n var enkey = encodeURIComponent(key)\n var pair\n if (typeof value === 'object') {\n pair = queryStringify(value, prefix ? prefix + '[' + enkey + ']' : enkey)\n } else {\n pair = (prefix ? prefix + '[' + enkey + ']' : enkey) + '=' + encodeURIComponent(value)\n }\n pairs.push(pair)\n }\n return pairs.join('&')\n}\n","'use strict';\n/**\n * This module serves as an Async wrapper for LocalStorage\n */\n\nmodule.exports.setItem = function (key, value) {\n return new Promise(function (resolve) {\n localStorage.setItem(key, value);\n resolve();\n });\n};\n\nmodule.exports.getItem = function (key) {\n return Promise.resolve(localStorage.getItem(key));\n};\n\nmodule.exports.removeItem = function (key) {\n return new Promise(function (resolve) {\n localStorage.removeItem(key);\n resolve();\n });\n};","'use strict';\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nvar RequestClient = require('./RequestClient');\n\nvar _getName = function _getName(id) {\n return id.split('-').map(function (s) {\n return s.charAt(0).toUpperCase() + s.slice(1);\n }).join(' ');\n};\n\nmodule.exports = /*#__PURE__*/function (_RequestClient) {\n _inheritsLoose(SearchProvider, _RequestClient);\n\n function SearchProvider(uppy, opts) {\n var _this;\n\n _this = _RequestClient.call(this, uppy, opts) || this;\n _this.provider = opts.provider;\n _this.id = _this.provider;\n _this.name = _this.opts.name || _getName(_this.id);\n _this.pluginId = _this.opts.pluginId;\n return _this;\n }\n\n var _proto = SearchProvider.prototype;\n\n _proto.fileUrl = function fileUrl(id) {\n return this.hostname + \"/search/\" + this.id + \"/get/\" + id;\n };\n\n _proto.search = function search(text, queries) {\n queries = queries ? \"&\" + queries : '';\n return this.get(\"search/\" + this.id + \"/list?q=\" + encodeURIComponent(text) + queries);\n };\n\n return SearchProvider;\n}(RequestClient);","var ee = require('namespace-emitter');\n\nmodule.exports = /*#__PURE__*/function () {\n function UppySocket(opts) {\n this.opts = opts;\n this._queued = [];\n this.isOpen = false;\n this.emitter = ee();\n this._handleMessage = this._handleMessage.bind(this);\n this.close = this.close.bind(this);\n this.emit = this.emit.bind(this);\n this.on = this.on.bind(this);\n this.once = this.once.bind(this);\n this.send = this.send.bind(this);\n\n if (!opts || opts.autoOpen !== false) {\n this.open();\n }\n }\n\n var _proto = UppySocket.prototype;\n\n _proto.open = function open() {\n var _this = this;\n\n this.socket = new WebSocket(this.opts.target);\n\n this.socket.onopen = function (e) {\n _this.isOpen = true;\n\n while (_this._queued.length > 0 && _this.isOpen) {\n var first = _this._queued[0];\n\n _this.send(first.action, first.payload);\n\n _this._queued = _this._queued.slice(1);\n }\n };\n\n this.socket.onclose = function (e) {\n _this.isOpen = false;\n };\n\n this.socket.onmessage = this._handleMessage;\n };\n\n _proto.close = function close() {\n if (this.socket) {\n this.socket.close();\n }\n };\n\n _proto.send = function send(action, payload) {\n // attach uuid\n if (!this.isOpen) {\n this._queued.push({\n action: action,\n payload: payload\n });\n\n return;\n }\n\n this.socket.send(JSON.stringify({\n action: action,\n payload: payload\n }));\n };\n\n _proto.on = function on(action, handler) {\n this.emitter.on(action, handler);\n };\n\n _proto.emit = function emit(action, payload) {\n this.emitter.emit(action, payload);\n };\n\n _proto.once = function once(action, handler) {\n this.emitter.once(action, handler);\n };\n\n _proto._handleMessage = function _handleMessage(e) {\n try {\n var message = JSON.parse(e.data);\n this.emit(message.action, message.payload);\n } catch (err) {\n console.log(err);\n }\n };\n\n return UppySocket;\n}();"],"sourceRoot":""}
1
+ {"version":3,"sources":["../../../node_modules/@uppy/companion-client/lib/index.js","../../../node_modules/@uppy/utils/lib/NetworkError.js","../../../node_modules/url-parse/index.js","../../../node_modules/@uppy/companion-client/lib/RequestClient.js","../../../node_modules/@uppy/utils/lib/fetchWithNetworkError.js","../../../node_modules/requires-port/index.js","../../../node_modules/querystringify/index.js","../../../node_modules/@uppy/companion-client/lib/AuthError.js","../../../node_modules/@uppy/companion-client/lib/Provider.js","../../../node_modules/qs-stringify/index.js","../../../node_modules/@uppy/companion-client/lib/tokenStorage.js","../../../node_modules/@uppy/companion-client/lib/SearchProvider.js","../../../node_modules/@uppy/companion-client/lib/Socket.js"],"names":["RequestClient","require","Provider","SearchProvider","Socket","module","exports","_wrapNativeSuper","Class","_cache","Map","undefined","fn","Function","toString","call","indexOf","TypeError","has","get","set","Wrapper","_construct","arguments","_getPrototypeOf","this","constructor","prototype","Object","create","value","enumerable","writable","configurable","_setPrototypeOf","Parent","args","_isNativeReflectConstruct","Reflect","construct","a","push","apply","instance","bind","sham","Proxy","Boolean","valueOf","e","o","p","setPrototypeOf","__proto__","getPrototypeOf","NetworkError","_Error","subClass","superClass","error","xhr","_this","isNetworkError","request","Error","required","qs","slashes","protocolre","windowsDriveLetter","left","RegExp","trimLeft","str","replace","rules","address","url","isSpecial","protocol","NaN","ignore","hash","query","lolcation","loc","key","location","window","global","self","finaldestination","type","Url","unescape","pathname","test","href","scheme","extractProtocol","rest","match","exec","toLowerCase","forwardSlashes","otherSlashes","slashesCount","length","slice","parser","relative","extracted","parse","instruction","index","instructions","i","charAt","base","path","split","concat","last","unshift","up","splice","join","resolve","port","host","hostname","username","password","auth","origin","part","pop","char","ins","stringify","result","_class","_temp","_extends","assign","target","source","hasOwnProperty","_defineProperties","props","descriptor","defineProperty","AuthError","fetchWithNetworkError","uppy","opts","onReceiveResponse","allowedHeaders","preflightDone","Constructor","protoProps","staticProps","_proto","headers","userHeaders","companionHeaders","serverHeaders","Promise","defaultHeaders","_getPostResponseFunc","skip","response","_extends2","companion","getState","companionUrl","setState","_getUrl","_json","res","status","errMsg","statusText","json","then","errData","message","requestId","preflight","_this2","fetch","method","map","headerName","trim","err","log","preflightAndHeaders","_this3","all","_ref","keys","forEach","header","skipPostResponse","_this4","credentials","companionCookiesRule","isAuthError","reject","post","data","_this5","body","JSON","_this6","Accept","VERSION","name","decode","input","decodeURIComponent","encode","encodeURIComponent","obj","prefix","pairs","undef","isNaN","qsStringify","URL","tokenStorage","_RequestClient","provider","id","s","toUpperCase","pluginId","tokenKey","companionKeysParams","preAuthToken","getAuthToken","token","authHeaders","btoa","params","plugin","getPlugin","authenticated","getPluginState","setPluginState","setAuthToken","storage","setItem","getItem","authUrl","queries","uppyPreAuthToken","strigifiedQueries","fileUrl","fetchPreAuthToken","list","directory","logout","removeItem","_ref2","initPlugin","defaultOpts","files","serverUrl","serverPattern","companionAllowedHosts","pattern","Array","isArray","queryStringify","pair","enkey","localStorage","search","text","ee","UppySocket","_queued","isOpen","emitter","_handleMessage","close","emit","on","once","send","autoOpen","open","socket","WebSocket","onopen","first","action","payload","onclose","onmessage","handler","console"],"mappings":"wIAKA,IAAIA,EAAgBC,EAAQ,KAExBC,EAAWD,EAAQ,KAEnBE,EAAiBF,EAAQ,KAEzBG,EAASH,EAAQ,KAErBI,EAAOC,QAAU,CACfN,cAAeA,EACfE,SAAUA,EACVC,eAAgBA,EAChBC,OAAQA,I,kBCfV,SAASG,EAAiBC,GAAS,IAAIC,EAAwB,oBAARC,IAAqB,IAAIA,SAAQC,EAA8nB,OAAnnBJ,EAAmB,SAA0BC,GAAS,GAAc,OAAVA,IAMlII,EANuKJ,GAMjG,IAAzDK,SAASC,SAASC,KAAKH,GAAII,QAAQ,kBAN+H,OAAOR,EAMjN,IAA2BI,EAN6L,GAAqB,oBAAVJ,EAAwB,MAAM,IAAIS,UAAU,sDAAyD,GAAsB,qBAAXR,EAAwB,CAAE,GAAIA,EAAOS,IAAIV,GAAQ,OAAOC,EAAOU,IAAIX,GAAQC,EAAOW,IAAIZ,EAAOa,GAAY,SAASA,IAAY,OAAOC,EAAWd,EAAOe,UAAWC,EAAgBC,MAAMC,aAAgK,OAAhJL,EAAQM,UAAYC,OAAOC,OAAOrB,EAAMmB,UAAW,CAAED,YAAa,CAAEI,MAAOT,EAASU,YAAY,EAAOC,UAAU,EAAMC,cAAc,KAAkBC,EAAgBb,EAASb,IAAkBD,EAAiBC,GAE9uB,SAASc,EAAWa,EAAQC,EAAM5B,GAAqV,OAAzSc,EAA/Be,IAA4CC,QAAQC,UAAiC,SAAoBJ,EAAQC,EAAM5B,GAA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GAC9C,IACE,IAAIyI,EAAU4B,KAAKtG,MAAM/D,EAAEkK,MAC3B1L,KAAKuQ,KAAKtG,EAAQgH,OAAQhH,EAAQiH,SAClC,MAAOxG,GACP4G,QAAQ3G,IAAID,KAITuF,EAxFqB","file":"static/js/0.e9d808b4.chunk.js","sourcesContent":["'use strict';\n/**\n * Manages communications with Companion\n */\n\nvar RequestClient = require('./RequestClient');\n\nvar Provider = require('./Provider');\n\nvar SearchProvider = require('./SearchProvider');\n\nvar Socket = require('./Socket');\n\nmodule.exports = {\n RequestClient: RequestClient,\n Provider: Provider,\n SearchProvider: SearchProvider,\n Socket: Socket\n};","function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar NetworkError = /*#__PURE__*/function (_Error) {\n _inheritsLoose(NetworkError, _Error);\n\n function NetworkError(error, xhr) {\n var _this;\n\n if (xhr === void 0) {\n xhr = null;\n }\n\n _this = _Error.call(this, \"This looks like a network error, the endpoint might be blocked by an internet provider or a firewall.\\n\\nSource error: [\" + error + \"]\") || this;\n _this.isNetworkError = true;\n _this.request = xhr;\n return _this;\n }\n\n return NetworkError;\n}( /*#__PURE__*/_wrapNativeSuper(Error));\n\nmodule.exports = NetworkError;","'use strict';\n\nvar required = require('requires-port')\n , qs = require('querystringify')\n , slashes = /^[A-Za-z][A-Za-z0-9+-.]*:\\/\\//\n , protocolre = /^([a-z][a-z0-9.+-]*:)?(\\/\\/)?([\\\\/]+)?([\\S\\s]*)/i\n , windowsDriveLetter = /^[a-zA-Z]:/\n , whitespace = '[\\\\x09\\\\x0A\\\\x0B\\\\x0C\\\\x0D\\\\x20\\\\xA0\\\\u1680\\\\u180E\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200A\\\\u202F\\\\u205F\\\\u3000\\\\u2028\\\\u2029\\\\uFEFF]'\n , left = new RegExp('^'+ whitespace +'+');\n\n/**\n * Trim a given string.\n *\n * @param {String} str String to trim.\n * @public\n */\nfunction trimLeft(str) {\n return (str ? str : '').toString().replace(left, '');\n}\n\n/**\n * These are the parse rules for the URL parser, it informs the parser\n * about:\n *\n * 0. The char it Needs to parse, if it's a string it should be done using\n * indexOf, RegExp using exec and NaN means set as current value.\n * 1. The property we should set when parsing this value.\n * 2. Indication if it's backwards or forward parsing, when set as number it's\n * the value of extra chars that should be split off.\n * 3. Inherit from location if non existing in the parser.\n * 4. `toLowerCase` the resulting value.\n */\nvar rules = [\n ['#', 'hash'], // Extract from the back.\n ['?', 'query'], // Extract from the back.\n function sanitize(address, url) { // Sanitize what is left of the address\n return isSpecial(url.protocol) ? address.replace(/\\\\/g, '/') : address;\n },\n ['/', 'pathname'], // Extract from the back.\n ['@', 'auth', 1], // Extract from the front.\n [NaN, 'host', undefined, 1, 1], // Set left over value.\n [/:(\\d+)$/, 'port', undefined, 1], // RegExp the back.\n [NaN, 'hostname', undefined, 1, 1] // Set left over.\n];\n\n/**\n * These properties should not be copied or inherited from. This is only needed\n * for all non blob URL's as a blob URL does not include a hash, only the\n * origin.\n *\n * @type {Object}\n * @private\n */\nvar ignore = { hash: 1, query: 1 };\n\n/**\n * The location object differs when your code is loaded through a normal page,\n * Worker or through a worker using a blob. And with the blobble begins the\n * trouble as the location object will contain the URL of the blob, not the\n * location of the page where our code is loaded in. The actual origin is\n * encoded in the `pathname` so we can thankfully generate a good \"default\"\n * location from it so we can generate proper relative URL's again.\n *\n * @param {Object|String} loc Optional default location object.\n * @returns {Object} lolcation object.\n * @public\n */\nfunction lolcation(loc) {\n var globalVar;\n\n if (typeof window !== 'undefined') globalVar = window;\n else if (typeof global !== 'undefined') globalVar = global;\n else if (typeof self !== 'undefined') globalVar = self;\n else globalVar = {};\n\n var location = globalVar.location || {};\n loc = loc || location;\n\n var finaldestination = {}\n , type = typeof loc\n , key;\n\n if ('blob:' === loc.protocol) {\n finaldestination = new Url(unescape(loc.pathname), {});\n } else if ('string' === type) {\n finaldestination = new Url(loc, {});\n for (key in ignore) delete finaldestination[key];\n } else if ('object' === type) {\n for (key in loc) {\n if (key in ignore) continue;\n finaldestination[key] = loc[key];\n }\n\n if (finaldestination.slashes === undefined) {\n finaldestination.slashes = slashes.test(loc.href);\n }\n }\n\n return finaldestination;\n}\n\n/**\n * Check whether a protocol scheme is special.\n *\n * @param {String} The protocol scheme of the URL\n * @return {Boolean} `true` if the protocol scheme is special, else `false`\n * @private\n */\nfunction isSpecial(scheme) {\n return (\n scheme === 'file:' ||\n scheme === 'ftp:' ||\n scheme === 'http:' ||\n scheme === 'https:' ||\n scheme === 'ws:' ||\n scheme === 'wss:'\n );\n}\n\n/**\n * @typedef ProtocolExtract\n * @type Object\n * @property {String} protocol Protocol matched in the URL, in lowercase.\n * @property {Boolean} slashes `true` if protocol is followed by \"//\", else `false`.\n * @property {String} rest Rest of the URL that is not part of the protocol.\n */\n\n/**\n * Extract protocol information from a URL with/without double slash (\"//\").\n *\n * @param {String} address URL we want to extract from.\n * @param {Object} location\n * @return {ProtocolExtract} Extracted information.\n * @private\n */\nfunction extractProtocol(address, location) {\n address = trimLeft(address);\n location = location || {};\n\n var match = protocolre.exec(address);\n var protocol = match[1] ? match[1].toLowerCase() : '';\n var forwardSlashes = !!match[2];\n var otherSlashes = !!match[3];\n var slashesCount = 0;\n var rest;\n\n if (forwardSlashes) {\n if (otherSlashes) {\n rest = match[2] + match[3] + match[4];\n slashesCount = match[2].length + match[3].length;\n } else {\n rest = match[2] + match[4];\n slashesCount = match[2].length;\n }\n } else {\n if (otherSlashes) {\n rest = match[3] + match[4];\n slashesCount = match[3].length;\n } else {\n rest = match[4]\n }\n }\n\n if (protocol === 'file:') {\n if (slashesCount >= 2) {\n rest = rest.slice(2);\n }\n } else if (isSpecial(protocol)) {\n rest = match[4];\n } else if (protocol) {\n if (forwardSlashes) {\n rest = rest.slice(2);\n }\n } else if (slashesCount >= 2 && isSpecial(location.protocol)) {\n rest = match[4];\n }\n\n return {\n protocol: protocol,\n slashes: forwardSlashes || isSpecial(protocol),\n slashesCount: slashesCount,\n rest: rest\n };\n}\n\n/**\n * Resolve a relative URL pathname against a base URL pathname.\n *\n * @param {String} relative Pathname of the relative URL.\n * @param {String} base Pathname of the base URL.\n * @return {String} Resolved pathname.\n * @private\n */\nfunction resolve(relative, base) {\n if (relative === '') return base;\n\n var path = (base || '/').split('/').slice(0, -1).concat(relative.split('/'))\n , i = path.length\n , last = path[i - 1]\n , unshift = false\n , up = 0;\n\n while (i--) {\n if (path[i] === '.') {\n path.splice(i, 1);\n } else if (path[i] === '..') {\n path.splice(i, 1);\n up++;\n } else if (up) {\n if (i === 0) unshift = true;\n path.splice(i, 1);\n up--;\n }\n }\n\n if (unshift) path.unshift('');\n if (last === '.' || last === '..') path.push('');\n\n return path.join('/');\n}\n\n/**\n * The actual URL instance. Instead of returning an object we've opted-in to\n * create an actual constructor as it's much more memory efficient and\n * faster and it pleases my OCD.\n *\n * It is worth noting that we should not use `URL` as class name to prevent\n * clashes with the global URL instance that got introduced in browsers.\n *\n * @constructor\n * @param {String} address URL we want to parse.\n * @param {Object|String} [location] Location defaults for relative paths.\n * @param {Boolean|Function} [parser] Parser for the query string.\n * @private\n */\nfunction Url(address, location, parser) {\n address = trimLeft(address);\n\n if (!(this instanceof Url)) {\n return new Url(address, location, parser);\n }\n\n var relative, extracted, parse, instruction, index, key\n , instructions = rules.slice()\n , type = typeof location\n , url = this\n , i = 0;\n\n //\n // The following if statements allows this module two have compatibility with\n // 2 different API:\n //\n // 1. Node.js's `url.parse` api which accepts a URL, boolean as arguments\n // where the boolean indicates that the query string should also be parsed.\n //\n // 2. The `URL` interface of the browser which accepts a URL, object as\n // arguments. The supplied object will be used as default values / fall-back\n // for relative paths.\n //\n if ('object' !== type && 'string' !== type) {\n parser = location;\n location = null;\n }\n\n if (parser && 'function' !== typeof parser) parser = qs.parse;\n\n location = lolcation(location);\n\n //\n // Extract protocol information before running the instructions.\n //\n extracted = extractProtocol(address || '', location);\n relative = !extracted.protocol && !extracted.slashes;\n url.slashes = extracted.slashes || relative && location.slashes;\n url.protocol = extracted.protocol || location.protocol || '';\n address = extracted.rest;\n\n //\n // When the authority component is absent the URL starts with a path\n // component.\n //\n if (\n extracted.protocol === 'file:' && (\n extracted.slashesCount !== 2 || windowsDriveLetter.test(address)) ||\n (!extracted.slashes &&\n (extracted.protocol ||\n extracted.slashesCount < 2 ||\n !isSpecial(url.protocol)))\n ) {\n instructions[3] = [/(.*)/, 'pathname'];\n }\n\n for (; i < instructions.length; i++) {\n instruction = instructions[i];\n\n if (typeof instruction === 'function') {\n address = instruction(address, url);\n continue;\n }\n\n parse = instruction[0];\n key = instruction[1];\n\n if (parse !== parse) {\n url[key] = address;\n } else if ('string' === typeof parse) {\n if (~(index = address.indexOf(parse))) {\n if ('number' === typeof instruction[2]) {\n url[key] = address.slice(0, index);\n address = address.slice(index + instruction[2]);\n } else {\n url[key] = address.slice(index);\n address = address.slice(0, index);\n }\n }\n } else if ((index = parse.exec(address))) {\n url[key] = index[1];\n address = address.slice(0, index.index);\n }\n\n url[key] = url[key] || (\n relative && instruction[3] ? location[key] || '' : ''\n );\n\n //\n // Hostname, host and protocol should be lowercased so they can be used to\n // create a proper `origin`.\n //\n if (instruction[4]) url[key] = url[key].toLowerCase();\n }\n\n //\n // Also parse the supplied query string in to an object. If we're supplied\n // with a custom parser as function use that instead of the default build-in\n // parser.\n //\n if (parser) url.query = parser(url.query);\n\n //\n // If the URL is relative, resolve the pathname against the base URL.\n //\n if (\n relative\n && location.slashes\n && url.pathname.charAt(0) !== '/'\n && (url.pathname !== '' || location.pathname !== '')\n ) {\n url.pathname = resolve(url.pathname, location.pathname);\n }\n\n //\n // Default to a / for pathname if none exists. This normalizes the URL\n // to always have a /\n //\n if (url.pathname.charAt(0) !== '/' && isSpecial(url.protocol)) {\n url.pathname = '/' + url.pathname;\n }\n\n //\n // We should not add port numbers if they are already the default port number\n // for a given protocol. As the host also contains the port number we're going\n // override it with the hostname which contains no port number.\n //\n if (!required(url.port, url.protocol)) {\n url.host = url.hostname;\n url.port = '';\n }\n\n //\n // Parse down the `auth` for the username and password.\n //\n url.username = url.password = '';\n if (url.auth) {\n instruction = url.auth.split(':');\n url.username = instruction[0] || '';\n url.password = instruction[1] || '';\n }\n\n url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host\n ? url.protocol +'//'+ url.host\n : 'null';\n\n //\n // The href is just the compiled result.\n //\n url.href = url.toString();\n}\n\n/**\n * This is convenience method for changing properties in the URL instance to\n * insure that they all propagate correctly.\n *\n * @param {String} part Property we need to adjust.\n * @param {Mixed} value The newly assigned value.\n * @param {Boolean|Function} fn When setting the query, it will be the function\n * used to parse the query.\n * When setting the protocol, double slash will be\n * removed from the final url if it is true.\n * @returns {URL} URL instance for chaining.\n * @public\n */\nfunction set(part, value, fn) {\n var url = this;\n\n switch (part) {\n case 'query':\n if ('string' === typeof value && value.length) {\n value = (fn || qs.parse)(value);\n }\n\n url[part] = value;\n break;\n\n case 'port':\n url[part] = value;\n\n if (!required(value, url.protocol)) {\n url.host = url.hostname;\n url[part] = '';\n } else if (value) {\n url.host = url.hostname +':'+ value;\n }\n\n break;\n\n case 'hostname':\n url[part] = value;\n\n if (url.port) value += ':'+ url.port;\n url.host = value;\n break;\n\n case 'host':\n url[part] = value;\n\n if (/:\\d+$/.test(value)) {\n value = value.split(':');\n url.port = value.pop();\n url.hostname = value.join(':');\n } else {\n url.hostname = value;\n url.port = '';\n }\n\n break;\n\n case 'protocol':\n url.protocol = value.toLowerCase();\n url.slashes = !fn;\n break;\n\n case 'pathname':\n case 'hash':\n if (value) {\n var char = part === 'pathname' ? '/' : '#';\n url[part] = value.charAt(0) !== char ? char + value : value;\n } else {\n url[part] = value;\n }\n break;\n\n default:\n url[part] = value;\n }\n\n for (var i = 0; i < rules.length; i++) {\n var ins = rules[i];\n\n if (ins[4]) url[ins[1]] = url[ins[1]].toLowerCase();\n }\n\n url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host\n ? url.protocol +'//'+ url.host\n : 'null';\n\n url.href = url.toString();\n\n return url;\n}\n\n/**\n * Transform the properties back in to a valid and full URL string.\n *\n * @param {Function} stringify Optional query stringify function.\n * @returns {String} Compiled version of the URL.\n * @public\n */\nfunction toString(stringify) {\n if (!stringify || 'function' !== typeof stringify) stringify = qs.stringify;\n\n var query\n , url = this\n , protocol = url.protocol;\n\n if (protocol && protocol.charAt(protocol.length - 1) !== ':') protocol += ':';\n\n var result = protocol + (url.slashes || isSpecial(url.protocol) ? '//' : '');\n\n if (url.username) {\n result += url.username;\n if (url.password) result += ':'+ url.password;\n result += '@';\n }\n\n result += url.host + url.pathname;\n\n query = 'object' === typeof url.query ? stringify(url.query) : url.query;\n if (query) result += '?' !== query.charAt(0) ? '?'+ query : query;\n\n if (url.hash) result += url.hash;\n\n return result;\n}\n\nUrl.prototype = { set: set, toString: toString };\n\n//\n// Expose the URL parser and some additional properties that might be useful for\n// others or testing.\n//\nUrl.extractProtocol = extractProtocol;\nUrl.location = lolcation;\nUrl.trimLeft = trimLeft;\nUrl.qs = qs;\n\nmodule.exports = Url;\n","'use strict';\n\nvar _class, _temp;\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar AuthError = require('./AuthError');\n\nvar fetchWithNetworkError = require('@uppy/utils/lib/fetchWithNetworkError'); // Remove the trailing slash so we can always safely append /xyz.\n\n\nfunction stripSlash(url) {\n return url.replace(/\\/$/, '');\n}\n\nmodule.exports = (_temp = _class = /*#__PURE__*/function () {\n function RequestClient(uppy, opts) {\n this.uppy = uppy;\n this.opts = opts;\n this.onReceiveResponse = this.onReceiveResponse.bind(this);\n this.allowedHeaders = ['accept', 'content-type', 'uppy-auth-token'];\n this.preflightDone = false;\n }\n\n var _proto = RequestClient.prototype;\n\n _proto.headers = function headers() {\n var userHeaders = this.opts.companionHeaders || this.opts.serverHeaders || {};\n return Promise.resolve(_extends({}, this.defaultHeaders, userHeaders));\n };\n\n _proto._getPostResponseFunc = function _getPostResponseFunc(skip) {\n var _this = this;\n\n return function (response) {\n if (!skip) {\n return _this.onReceiveResponse(response);\n }\n\n return response;\n };\n };\n\n _proto.onReceiveResponse = function onReceiveResponse(response) {\n var state = this.uppy.getState();\n var companion = state.companion || {};\n var host = this.opts.companionUrl;\n var headers = response.headers; // Store the self-identified domain name for the Companion instance we just hit.\n\n if (headers.has('i-am') && headers.get('i-am') !== companion[host]) {\n var _extends2;\n\n this.uppy.setState({\n companion: _extends({}, companion, (_extends2 = {}, _extends2[host] = headers.get('i-am'), _extends2))\n });\n }\n\n return response;\n };\n\n _proto._getUrl = function _getUrl(url) {\n if (/^(https?:|)\\/\\//.test(url)) {\n return url;\n }\n\n return this.hostname + \"/\" + url;\n };\n\n _proto._json = function _json(res) {\n if (res.status === 401) {\n throw new AuthError();\n }\n\n if (res.status < 200 || res.status > 300) {\n var errMsg = \"Failed request with status: \" + res.status + \". \" + res.statusText;\n return res.json().then(function (errData) {\n errMsg = errData.message ? errMsg + \" message: \" + errData.message : errMsg;\n errMsg = errData.requestId ? errMsg + \" request-Id: \" + errData.requestId : errMsg;\n throw new Error(errMsg);\n }).catch(function () {\n throw new Error(errMsg);\n });\n }\n\n return res.json();\n };\n\n _proto.preflight = function preflight(path) {\n var _this2 = this;\n\n if (this.preflightDone) {\n return Promise.resolve(this.allowedHeaders.slice());\n }\n\n return fetch(this._getUrl(path), {\n method: 'OPTIONS'\n }).then(function (response) {\n if (response.headers.has('access-control-allow-headers')) {\n _this2.allowedHeaders = response.headers.get('access-control-allow-headers').split(',').map(function (headerName) {\n return headerName.trim().toLowerCase();\n });\n }\n\n _this2.preflightDone = true;\n return _this2.allowedHeaders.slice();\n }).catch(function (err) {\n _this2.uppy.log(\"[CompanionClient] unable to make preflight request \" + err, 'warning');\n\n _this2.preflightDone = true;\n return _this2.allowedHeaders.slice();\n });\n };\n\n _proto.preflightAndHeaders = function preflightAndHeaders(path) {\n var _this3 = this;\n\n return Promise.all([this.preflight(path), this.headers()]).then(function (_ref) {\n var allowedHeaders = _ref[0],\n headers = _ref[1];\n // filter to keep only allowed Headers\n Object.keys(headers).forEach(function (header) {\n if (allowedHeaders.indexOf(header.toLowerCase()) === -1) {\n _this3.uppy.log(\"[CompanionClient] excluding unallowed header \" + header);\n\n delete headers[header];\n }\n });\n return headers;\n });\n };\n\n _proto.get = function get(path, skipPostResponse) {\n var _this4 = this;\n\n return this.preflightAndHeaders(path).then(function (headers) {\n return fetchWithNetworkError(_this4._getUrl(path), {\n method: 'get',\n headers: headers,\n credentials: _this4.opts.companionCookiesRule || 'same-origin'\n });\n }).then(this._getPostResponseFunc(skipPostResponse)).then(function (res) {\n return _this4._json(res);\n }).catch(function (err) {\n if (!err.isAuthError) {\n err.message = \"Could not get \" + _this4._getUrl(path) + \". \" + err.message;\n }\n\n return Promise.reject(err);\n });\n };\n\n _proto.post = function post(path, data, skipPostResponse) {\n var _this5 = this;\n\n return this.preflightAndHeaders(path).then(function (headers) {\n return fetchWithNetworkError(_this5._getUrl(path), {\n method: 'post',\n headers: headers,\n credentials: _this5.opts.companionCookiesRule || 'same-origin',\n body: JSON.stringify(data)\n });\n }).then(this._getPostResponseFunc(skipPostResponse)).then(function (res) {\n return _this5._json(res);\n }).catch(function (err) {\n if (!err.isAuthError) {\n err.message = \"Could not post \" + _this5._getUrl(path) + \". \" + err.message;\n }\n\n return Promise.reject(err);\n });\n };\n\n _proto.delete = function _delete(path, data, skipPostResponse) {\n var _this6 = this;\n\n return this.preflightAndHeaders(path).then(function (headers) {\n return fetchWithNetworkError(_this6.hostname + \"/\" + path, {\n method: 'delete',\n headers: headers,\n credentials: _this6.opts.companionCookiesRule || 'same-origin',\n body: data ? JSON.stringify(data) : null\n });\n }).then(this._getPostResponseFunc(skipPostResponse)).then(function (res) {\n return _this6._json(res);\n }).catch(function (err) {\n if (!err.isAuthError) {\n err.message = \"Could not delete \" + _this6._getUrl(path) + \". \" + err.message;\n }\n\n return Promise.reject(err);\n });\n };\n\n _createClass(RequestClient, [{\n key: \"hostname\",\n get: function get() {\n var _this$uppy$getState = this.uppy.getState(),\n companion = _this$uppy$getState.companion;\n\n var host = this.opts.companionUrl;\n return stripSlash(companion && companion[host] ? companion[host] : host);\n }\n }, {\n key: \"defaultHeaders\",\n get: function get() {\n return {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n 'Uppy-Versions': \"@uppy/companion-client=\" + RequestClient.VERSION\n };\n }\n }]);\n\n return RequestClient;\n}(), _class.VERSION = \"1.10.2\", _temp);","var NetworkError = require('./NetworkError');\n/**\n * Wrapper around window.fetch that throws a NetworkError when appropriate\n */\n\n\nmodule.exports = function fetchWithNetworkError() {\n return fetch.apply(void 0, arguments).catch(function (err) {\n if (err.name === 'AbortError') {\n throw err;\n } else {\n throw new NetworkError(err);\n }\n });\n};","'use strict';\n\n/**\n * Check if we're required to add a port number.\n *\n * @see https://url.spec.whatwg.org/#default-port\n * @param {Number|String} port Port number we need to check\n * @param {String} protocol Protocol we need to check against.\n * @returns {Boolean} Is it a default port for the given protocol\n * @api private\n */\nmodule.exports = function required(port, protocol) {\n protocol = protocol.split(':')[0];\n port = +port;\n\n if (!port) return false;\n\n switch (protocol) {\n case 'http':\n case 'ws':\n return port !== 80;\n\n case 'https':\n case 'wss':\n return port !== 443;\n\n case 'ftp':\n return port !== 21;\n\n case 'gopher':\n return port !== 70;\n\n case 'file':\n return false;\n }\n\n return port !== 0;\n};\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , undef;\n\n/**\n * Decode a URI encoded string.\n *\n * @param {String} input The URI encoded string.\n * @returns {String|Null} The decoded string.\n * @api private\n */\nfunction decode(input) {\n try {\n return decodeURIComponent(input.replace(/\\+/g, ' '));\n } catch (e) {\n return null;\n }\n}\n\n/**\n * Attempts to encode a given input.\n *\n * @param {String} input The string that needs to be encoded.\n * @returns {String|Null} The encoded string.\n * @api private\n */\nfunction encode(input) {\n try {\n return encodeURIComponent(input);\n } catch (e) {\n return null;\n }\n}\n\n/**\n * Simple query string parser.\n *\n * @param {String} query The query string that needs to be parsed.\n * @returns {Object}\n * @api public\n */\nfunction querystring(query) {\n var parser = /([^=?#&]+)=?([^&]*)/g\n , result = {}\n , part;\n\n while (part = parser.exec(query)) {\n var key = decode(part[1])\n , value = decode(part[2]);\n\n //\n // Prevent overriding of existing properties. This ensures that build-in\n // methods like `toString` or __proto__ are not overriden by malicious\n // querystrings.\n //\n // In the case if failed decoding, we want to omit the key/value pairs\n // from the result.\n //\n if (key === null || value === null || key in result) continue;\n result[key] = value;\n }\n\n return result;\n}\n\n/**\n * Transform a query string to an object.\n *\n * @param {Object} obj Object that should be transformed.\n * @param {String} prefix Optional prefix.\n * @returns {String}\n * @api public\n */\nfunction querystringify(obj, prefix) {\n prefix = prefix || '';\n\n var pairs = []\n , value\n , key;\n\n //\n // Optionally prefix with a '?' if needed\n //\n if ('string' !== typeof prefix) prefix = '?';\n\n for (key in obj) {\n if (has.call(obj, key)) {\n value = obj[key];\n\n //\n // Edge cases where we actually want to encode the value to an empty\n // string instead of the stringified value.\n //\n if (!value && (value === null || value === undef || isNaN(value))) {\n value = '';\n }\n\n key = encode(key);\n value = encode(value);\n\n //\n // If we failed to encode the strings, we should bail out as we don't\n // want to add invalid strings to the query.\n //\n if (key === null || value === null) continue;\n pairs.push(key +'='+ value);\n }\n }\n\n return pairs.length ? prefix + pairs.join('&') : '';\n}\n\n//\n// Expose the module.\n//\nexports.stringify = querystringify;\nexports.parse = querystring;\n","'use strict';\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar AuthError = /*#__PURE__*/function (_Error) {\n _inheritsLoose(AuthError, _Error);\n\n function AuthError() {\n var _this;\n\n _this = _Error.call(this, 'Authorization required') || this;\n _this.name = 'AuthError';\n _this.isAuthError = true;\n return _this;\n }\n\n return AuthError;\n}( /*#__PURE__*/_wrapNativeSuper(Error));\n\nmodule.exports = AuthError;","'use strict';\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nvar qsStringify = require('qs-stringify');\n\nvar URL = require('url-parse');\n\nvar RequestClient = require('./RequestClient');\n\nvar tokenStorage = require('./tokenStorage');\n\nvar _getName = function _getName(id) {\n return id.split('-').map(function (s) {\n return s.charAt(0).toUpperCase() + s.slice(1);\n }).join(' ');\n};\n\nmodule.exports = /*#__PURE__*/function (_RequestClient) {\n _inheritsLoose(Provider, _RequestClient);\n\n function Provider(uppy, opts) {\n var _this;\n\n _this = _RequestClient.call(this, uppy, opts) || this;\n _this.provider = opts.provider;\n _this.id = _this.provider;\n _this.name = _this.opts.name || _getName(_this.id);\n _this.pluginId = _this.opts.pluginId;\n _this.tokenKey = \"companion-\" + _this.pluginId + \"-auth-token\";\n _this.companionKeysParams = _this.opts.companionKeysParams;\n _this.preAuthToken = null;\n return _this;\n }\n\n var _proto = Provider.prototype;\n\n _proto.headers = function headers() {\n var _this2 = this;\n\n return Promise.all([_RequestClient.prototype.headers.call(this), this.getAuthToken()]).then(function (_ref) {\n var headers = _ref[0],\n token = _ref[1];\n var authHeaders = {};\n\n if (token) {\n authHeaders['uppy-auth-token'] = token;\n }\n\n if (_this2.companionKeysParams) {\n authHeaders['uppy-credentials-params'] = btoa(JSON.stringify({\n params: _this2.companionKeysParams\n }));\n }\n\n return _extends({}, headers, authHeaders);\n });\n };\n\n _proto.onReceiveResponse = function onReceiveResponse(response) {\n response = _RequestClient.prototype.onReceiveResponse.call(this, response);\n var plugin = this.uppy.getPlugin(this.pluginId);\n var oldAuthenticated = plugin.getPluginState().authenticated;\n var authenticated = oldAuthenticated ? response.status !== 401 : response.status < 400;\n plugin.setPluginState({\n authenticated: authenticated\n });\n return response;\n } // @todo(i.olarewaju) consider whether or not this method should be exposed\n ;\n\n _proto.setAuthToken = function setAuthToken(token) {\n return this.uppy.getPlugin(this.pluginId).storage.setItem(this.tokenKey, token);\n };\n\n _proto.getAuthToken = function getAuthToken() {\n return this.uppy.getPlugin(this.pluginId).storage.getItem(this.tokenKey);\n };\n\n _proto.authUrl = function authUrl(queries) {\n if (queries === void 0) {\n queries = {};\n }\n\n if (this.preAuthToken) {\n queries.uppyPreAuthToken = this.preAuthToken;\n }\n\n var strigifiedQueries = qsStringify(queries);\n strigifiedQueries = strigifiedQueries ? \"?\" + strigifiedQueries : strigifiedQueries;\n return this.hostname + \"/\" + this.id + \"/connect\" + strigifiedQueries;\n };\n\n _proto.fileUrl = function fileUrl(id) {\n return this.hostname + \"/\" + this.id + \"/get/\" + id;\n };\n\n _proto.fetchPreAuthToken = function fetchPreAuthToken() {\n var _this3 = this;\n\n if (!this.companionKeysParams) {\n return Promise.resolve();\n }\n\n return this.post(this.id + \"/preauth/\", {\n params: this.companionKeysParams\n }).then(function (res) {\n _this3.preAuthToken = res.token;\n }).catch(function (err) {\n _this3.uppy.log(\"[CompanionClient] unable to fetch preAuthToken \" + err, 'warning');\n });\n };\n\n _proto.list = function list(directory) {\n return this.get(this.id + \"/list/\" + (directory || ''));\n };\n\n _proto.logout = function logout() {\n var _this4 = this;\n\n return this.get(this.id + \"/logout\").then(function (response) {\n return Promise.all([response, _this4.uppy.getPlugin(_this4.pluginId).storage.removeItem(_this4.tokenKey)]);\n }).then(function (_ref2) {\n var response = _ref2[0];\n return response;\n });\n };\n\n Provider.initPlugin = function initPlugin(plugin, opts, defaultOpts) {\n plugin.type = 'acquirer';\n plugin.files = [];\n\n if (defaultOpts) {\n plugin.opts = _extends({}, defaultOpts, opts);\n }\n\n if (opts.serverUrl || opts.serverPattern) {\n throw new Error('`serverUrl` and `serverPattern` have been renamed to `companionUrl` and `companionAllowedHosts` respectively in the 0.30.5 release. Please consult the docs (for example, https://uppy.io/docs/instagram/ for the Instagram plugin) and use the updated options.`');\n }\n\n if (opts.companionAllowedHosts) {\n var pattern = opts.companionAllowedHosts; // validate companionAllowedHosts param\n\n if (typeof pattern !== 'string' && !Array.isArray(pattern) && !(pattern instanceof RegExp)) {\n throw new TypeError(plugin.id + \": the option \\\"companionAllowedHosts\\\" must be one of string, Array, RegExp\");\n }\n\n plugin.opts.companionAllowedHosts = pattern;\n } else {\n // does not start with https://\n if (/^(?!https?:\\/\\/).*$/i.test(opts.companionUrl)) {\n plugin.opts.companionAllowedHosts = \"https://\" + opts.companionUrl.replace(/^\\/\\//, '');\n } else {\n plugin.opts.companionAllowedHosts = new URL(opts.companionUrl).origin;\n }\n }\n\n plugin.storage = plugin.opts.storage || tokenStorage;\n };\n\n return Provider;\n}(RequestClient);","var has = Object.prototype.hasOwnProperty\n\n/**\n * Stringify an object for use in a query string.\n *\n * @param {Object} obj - The object.\n * @param {string} prefix - When nesting, the parent key.\n * keys in `obj` will be stringified as `prefix[key]`.\n * @returns {string}\n */\n\nmodule.exports = function queryStringify (obj, prefix) {\n var pairs = []\n for (var key in obj) {\n if (!has.call(obj, key)) {\n continue\n }\n\n var value = obj[key]\n var enkey = encodeURIComponent(key)\n var pair\n if (typeof value === 'object') {\n pair = queryStringify(value, prefix ? prefix + '[' + enkey + ']' : enkey)\n } else {\n pair = (prefix ? prefix + '[' + enkey + ']' : enkey) + '=' + encodeURIComponent(value)\n }\n pairs.push(pair)\n }\n return pairs.join('&')\n}\n","'use strict';\n/**\n * This module serves as an Async wrapper for LocalStorage\n */\n\nmodule.exports.setItem = function (key, value) {\n return new Promise(function (resolve) {\n localStorage.setItem(key, value);\n resolve();\n });\n};\n\nmodule.exports.getItem = function (key) {\n return Promise.resolve(localStorage.getItem(key));\n};\n\nmodule.exports.removeItem = function (key) {\n return new Promise(function (resolve) {\n localStorage.removeItem(key);\n resolve();\n });\n};","'use strict';\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nvar RequestClient = require('./RequestClient');\n\nvar _getName = function _getName(id) {\n return id.split('-').map(function (s) {\n return s.charAt(0).toUpperCase() + s.slice(1);\n }).join(' ');\n};\n\nmodule.exports = /*#__PURE__*/function (_RequestClient) {\n _inheritsLoose(SearchProvider, _RequestClient);\n\n function SearchProvider(uppy, opts) {\n var _this;\n\n _this = _RequestClient.call(this, uppy, opts) || this;\n _this.provider = opts.provider;\n _this.id = _this.provider;\n _this.name = _this.opts.name || _getName(_this.id);\n _this.pluginId = _this.opts.pluginId;\n return _this;\n }\n\n var _proto = SearchProvider.prototype;\n\n _proto.fileUrl = function fileUrl(id) {\n return this.hostname + \"/search/\" + this.id + \"/get/\" + id;\n };\n\n _proto.search = function search(text, queries) {\n queries = queries ? \"&\" + queries : '';\n return this.get(\"search/\" + this.id + \"/list?q=\" + encodeURIComponent(text) + queries);\n };\n\n return SearchProvider;\n}(RequestClient);","var ee = require('namespace-emitter');\n\nmodule.exports = /*#__PURE__*/function () {\n function UppySocket(opts) {\n this.opts = opts;\n this._queued = [];\n this.isOpen = false;\n this.emitter = ee();\n this._handleMessage = this._handleMessage.bind(this);\n this.close = this.close.bind(this);\n this.emit = this.emit.bind(this);\n this.on = this.on.bind(this);\n this.once = this.once.bind(this);\n this.send = this.send.bind(this);\n\n if (!opts || opts.autoOpen !== false) {\n this.open();\n }\n }\n\n var _proto = UppySocket.prototype;\n\n _proto.open = function open() {\n var _this = this;\n\n this.socket = new WebSocket(this.opts.target);\n\n this.socket.onopen = function (e) {\n _this.isOpen = true;\n\n while (_this._queued.length > 0 && _this.isOpen) {\n var first = _this._queued[0];\n\n _this.send(first.action, first.payload);\n\n _this._queued = _this._queued.slice(1);\n }\n };\n\n this.socket.onclose = function (e) {\n _this.isOpen = false;\n };\n\n this.socket.onmessage = this._handleMessage;\n };\n\n _proto.close = function close() {\n if (this.socket) {\n this.socket.close();\n }\n };\n\n _proto.send = function send(action, payload) {\n // attach uuid\n if (!this.isOpen) {\n this._queued.push({\n action: action,\n payload: payload\n });\n\n return;\n }\n\n this.socket.send(JSON.stringify({\n action: action,\n payload: payload\n }));\n };\n\n _proto.on = function on(action, handler) {\n this.emitter.on(action, handler);\n };\n\n _proto.emit = function emit(action, payload) {\n this.emitter.emit(action, payload);\n };\n\n _proto.once = function once(action, handler) {\n this.emitter.once(action, handler);\n };\n\n _proto._handleMessage = function _handleMessage(e) {\n try {\n var message = JSON.parse(e.data);\n this.emit(message.action, message.payload);\n } catch (err) {\n console.log(err);\n }\n };\n\n return UppySocket;\n}();"],"sourceRoot":""}