spee.ch/index.js
2018-03-15 17:55:30 -07:00

2 lines
No EOL
170 KiB
JavaScript

module.exports=function(e){function t(r){if(n[r])return n[r].exports;var a=n[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s=47)}([function(e,t){e.exports=require("react")},function(e,t){e.exports=require("react-redux")},function(e,t){e.exports=require("winston")},function(e,t){e.exports=require("react-router-dom")},function(e,t,n){"use strict";function r(e){return{type:h.FILE_SELECTED,data:e}}function a(){return{type:h.FILE_CLEAR}}function l(e,t){return{type:h.METADATA_UPDATE,data:{name:e,value:t}}}function o(e){return{type:h.CLAIM_UPDATE,data:e}}function i(e){return{type:h.SET_PUBLISH_IN_CHANNEL,channel:e}}function u(e,t){return{type:h.PUBLISH_STATUS_UPDATE,data:{status:e,message:t}}}function s(e,t){return{type:h.ERROR_UPDATE,data:{name:e,value:t}}}function c(e){return{type:h.SELECTED_CHANNEL_UPDATE,data:e}}function f(e){return{type:h.TOGGLE_METADATA_INPUTS,data:e}}function d(e){return{type:h.THUMBNAIL_NEW,data:e}}function p(e){return{type:h.PUBLISH_START,data:{history:e}}}Object.defineProperty(t,"__esModule",{value:!0}),t.selectFile=r,t.clearFile=a,t.updateMetadata=l,t.updateClaim=o,t.setPublishInChannel=i,t.updatePublishStatus=u,t.updateError=s,t.updateSelectedChannel=c,t.toggleMetadataInputs=f,t.onNewThumbnail=d,t.startPublish=p;var m=n(34),h=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(m)},function(e,t,n){"use strict";function r(){var e=this;this.analytics={googleId:"default"},this.assetDefaults={description:"An asset published on Spee.ch",thumbnail:"https://spee.ch/assets/img/video_thumb_default.png",title:"Spee.ch"},this.auth={sessionKey:"default"},this.details={description:"Open-source, decentralized image and video sharing.",host:"default",port:3e3,title:"Spee.ch",twitter:"@spee_ch"},this.publishing={additionalClaimAddresses:[],disabled:!1,disabledMessage:"Please check back soon.",primaryClaimAddress:"default",thumbnailChannel:"default",thumbnailChannelId:"default",uploadDirectory:"/home/lbry/Uploads"},this.configure=function(t){if(!t)return console.log("No site config received.");var n=t.analytics,r=t.assetDefaults,a=t.auth,l=t.details,o=t.publishing;e.analytics=n,e.assetDefaults=r,e.auth=a,e.details=l,e.publishing=o}}e.exports=new r},function(e,t,n){"use strict";var r=n(26),a=n(2);console.log("exporting sequelize models");var l=n(23),o=l.database,i=l.username,u=l.password,s={},c=new r(o,i,u,{host:"localhost",dialect:"mysql",dialectOptions:{decimalNumbers:!0},logging:!1,pool:{max:5,min:0,idle:1e4,acquire:1e4}});c.authenticate().then(function(){a.info("Sequelize has established mysql connection successfully.")}).catch(function(e){a.error("Sequelize was unable to connect to the database:",e)});var f=n(67),d=n(68),p=n(69),m=n(70),h=n(71),b=n(72);s.Certificate=c.import("Certificate",f),s.Channel=c.import("Channel",d),s.Claim=c.import("Claim",p),s.File=c.import("File",m),s.Request=c.import("Request",h),s.User=c.import("User",b),Object.keys(s).forEach(function(e){s[e].associate&&(a.info("Associating model:",e),s[e].associate(s))}),s.sequelize=c,s.Sequelize=r,s.upsert=function(e,t,n,r){return e.findOne({where:n}).then(function(n){return n?(a.debug("updating record in db."+r),n.update(t)):(a.debug("creating record in db."+r),e.create(t))}).catch(function(e){throw a.error(r+".upsert error",e),e})},e.exports=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(19),l=n(4),o=n(93),i=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(e){var t=e.channel,n=e.site;return{channelName:t.loggedInChannel.name,channelShortId:t.loggedInChannel.shortId,channelLongId:t.loggedInChannel.longId,siteDescription:n.description}},s=function(e){return{onChannelLogin:function(t,n,r){e((0,a.updateLoggedInChannel)(t,n,r)),e((0,l.updateSelectedChannel)(t))},onChannelLogout:function(){e((0,a.updateLoggedInChannel)(null,null,null))}}};t.default=(0,r.connect)(u,s)(i.default)},function(e,t,n){"use strict";function r(e){return{type:g.HANDLE_SHOW_URI,data:e}}function a(e){return{type:g.REQUEST_ERROR,data:e}}function l(e,t){var n=v.CHANNEL,r="cr#"+e+"#"+t;return{type:g.CHANNEL_REQUEST_NEW,data:{requestType:n,requestId:r,channelName:e,channelId:t}}}function o(e,t,n,r,a){var l=a?v.ASSET_LITE:v.ASSET_DETAILS,o="ar#"+e+"#"+t+"#"+n+"#"+r;return{type:g.ASSET_REQUEST_NEW,data:{requestType:l,requestId:o,name:e,modifier:{id:t,channel:{name:n,id:r}}}}}function i(e,t){return{type:g.REQUEST_UPDATE,data:{requestType:e,requestId:t}}}function u(e,t,n){return{type:g.REQUEST_LIST_ADD,data:{id:e,error:t,key:n}}}function s(e,t,n,r,a,l){return{type:g.ASSET_ADD,data:{id:e,error:t,name:n,claimId:r,shortId:a,claimData:l}}}function c(e,t,n,r,a){return{type:g.CHANNEL_ADD,data:{id:e,name:t,shortId:n,longId:r,claimsData:a}}}function f(e,t,n,r){return{type:g.CHANNEL_CLAIMS_UPDATE_ASYNC,data:{channelKey:e,name:t,longId:n,page:r}}}function d(e,t){return{type:g.CHANNEL_CLAIMS_UPDATE_SUCCESS,data:{channelListId:e,claimsData:t}}}function p(e,t){return{type:g.FILE_REQUESTED,data:{name:e,claimId:t}}}function m(e){return{type:g.FILE_AVAILABILITY_UPDATE,data:e}}function h(e){return{type:g.DISPLAY_ASSET_ERROR,data:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.onHandleShowPageUri=r,t.onRequestError=a,t.onNewChannelRequest=l,t.onNewAssetRequest=o,t.onRequestUpdate=i,t.addRequestToRequestList=u,t.addAssetToAssetList=s,t.addNewChannelToChannelList=c,t.onUpdateChannelClaims=f,t.updateChannelClaims=d,t.fileRequested=p,t.updateFileAvailability=m,t.updateDisplayAssetError=h;var b=n(12),g=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(b),v=n(43)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(89),l=function(e){return e&&e.__esModule?e:{default:e}}(a),o=function(e){var t=e.site;return{defaultDescription:t.defaultDescription,defaultThumbnail:t.defaultThumbnail,siteDescription:t.description,siteHost:t.host,siteTitle:t.title,siteTwitter:t.twitter}};t.default=(0,r.connect)(o,null)(l.default)},function(e,t){e.exports=require("prop-types")},function(e,t,n){"use strict";function r(e){return 204===e.status||205===e.status?null:e.json()}function a(e,t){if(e.status>=200&&e.status<300)return t;var n=new Error(t.message);throw n.response=e,n}function l(e,t){return fetch(e,t).then(function(e){return Promise.all([e,r(e)])}).then(function(e){var t=o(e,2);return a(t[0],t[1])})}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){var n=[],r=!0,a=!1,l=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,l=e}finally{try{!r&&i.return&&i.return()}finally{if(a)throw l}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.default=l,n(96)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.HANDLE_SHOW_URI="HANDLE_SHOW_URI",t.REQUEST_ERROR="REQUEST_ERROR",t.REQUEST_UPDATE="REQUEST_UPDATE",t.ASSET_REQUEST_NEW="ASSET_REQUEST_NEW",t.CHANNEL_REQUEST_NEW="CHANNEL_REQUEST_NEW",t.REQUEST_LIST_ADD="REQUEST_LIST_ADD",t.ASSET_ADD="ASSET_ADD",t.CHANNEL_ADD="CHANNEL_ADD",t.CHANNEL_CLAIMS_UPDATE_ASYNC="CHANNEL_CLAIMS_UPDATE_ASYNC",t.CHANNEL_CLAIMS_UPDATE_SUCCESS="CHANNEL_CLAIMS_UPDATE_SUCCESS",t.FILE_REQUESTED="FILE_REQUESTED",t.FILE_AVAILABILITY_UPDATE="FILE_AVAILABILITY_UPDATE",t.DISPLAY_ASSET_ERROR="DISPLAY_ASSET_ERROR"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.selectAsset=function(e){var t=e.requestList[e.request.id],n=t.key;return e.assetList[n]},t.selectShowState=function(e){return e.show}},function(e,t){e.exports=require("react-helmet")},function(e,t){e.exports=require("redux-saga/effects")},function(e,t,n){"use strict";var r=n(64),a=n(2),l=n(65),o=l.api,i=o.apiHost,u=o.apiPort,s="http://"+i+":"+u,c=n(17),f=c.chooseGaLbrynetPublishLabel,d=c.sendGATimingEvent,p=function(e,t,n){var r=e.data;if(a.debug("lbry api data:",r),r.result)return r.result.error?(a.debug("Lbrynet api error:",r.result.error),void n(new Error(r.result.error))):void t(r.result);n(JSON.stringify(r))};e.exports={publishClaim:function(e){a.debug('lbryApi >> Publishing claim to "'+e.name+'"');var t=Date.now();return new Promise(function(n,a){r.post(s,{method:"publish",params:e}).then(function(r){d("lbrynet","publish",f(e),t,Date.now()),p(r,n,a)}).catch(function(e){a(e)})})},getClaim:function(e){a.debug('lbryApi >> Getting Claim for "'+e+'"');var t=Date.now();return new Promise(function(n,a){r.post(s,{method:"get",params:{uri:e,timeout:20}}).then(function(e){d("lbrynet","getClaim","GET",t,Date.now()),p(e,n,a)}).catch(function(e){a(e)})})},getClaimList:function(e){a.debug('lbryApi >> Getting claim_list for "'+e+'"');var t=Date.now();return new Promise(function(n,a){r.post(s,{method:"claim_list",params:{name:e}}).then(function(e){d("lbrynet","getClaimList","CLAIM_LIST",t,Date.now()),p(e,n,a)}).catch(function(e){a(e)})})},resolveUri:function(e){a.debug('lbryApi >> Resolving URI for "'+e+'"');var t=Date.now();return new Promise(function(n,a){r.post(s,{method:"resolve",params:{uri:e}}).then(function(r){var l=r.data;d("lbrynet","resolveUri","RESOLVE",t,Date.now()),l.result[e].error?a(l.result[e].error):n(l.result[e])}).catch(function(e){a(e)})})},getDownloadDirectory:function(){a.debug("lbryApi >> Retrieving the download directory path from lbry daemon...");var e=Date.now();return new Promise(function(t,n){r.post(s,{method:"settings_get"}).then(function(n){var r=n.data;if(d("lbrynet","getDownloadDirectory","SETTINGS_GET",e,Date.now()),!r.result)return new Error("Successfully connected to lbry daemon, but unable to retrieve the download directory.");t(r.result.download_directory)}).catch(function(e){a.error("Lbrynet Error:",e),t("/home/lbry/Downloads/")})})},createChannel:function(e){a.debug("lbryApi >> Creating channel for "+e+"...");var t=Date.now();return new Promise(function(n,a){r.post(s,{method:"channel_new",params:{channel_name:e,amount:.1}}).then(function(e){d("lbrynet","createChannel","CHANNEL_NEW",t,Date.now()),p(e,n,a)}).catch(function(e){a(e)})})}}},function(e,t,n){"use strict";function r(e,t,n){return{eventCategory:"client requests",eventAction:"serve request",eventLabel:n,ipOverride:t,userAgentOverride:e["user-agent"]}}function a(e,t,n,r,a){return{userTimingCategory:e,userTimingVariableName:t,userTimingTime:a-r,userTimingLabel:n}}function l(e,t){var n=e.replace(/\./g,"-");u(c,n,{strictCidFormat:!1,https:!0}).event(t,function(e){e&&i.error("Google Analytics Event Error >>",e)})}function o(e,t){u(c,e,{strictCidFormat:!1,https:!0}).timing(t,function(e){e&&i.error("Google Analytics Event Error >>",e),i.debug("Timing event successfully sent to google analytics")})}var i=n(2),u=n(66),s=n(5),c=s.analytics.googleId,f=s.details.title;e.exports={sendGAServeEvent:function(e,t,n){l(t,r(e,t,n))},sendGATimingEvent:function(e,t,n,r,l){var i=a(e,t,n,r,l);o(f,i)},chooseGaLbrynetPublishLabel:function(e){var t=e.channel_name,n=e.channel_id;return t||n?"PUBLISH_IN_CHANNEL_CLAIM":"PUBLISH_ANONYMOUS_CLAIM"}}},function(e,t){e.exports=require("redux")},function(e,t,n){"use strict";function r(e,t,n){return{type:l.CHANNEL_UPDATE,data:{name:e,shortId:t,longId:n}}}Object.defineProperty(t,"__esModule",{value:!0}),t.updateLoggedInChannel=r;var a=n(36),l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(a)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(10),f=r(c),d=n(118),p=r(d),m=n(119),h=r(m),b=function(e){function t(e){a(this,t);var n=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={bars:[],index:0,incrementer:1},n.createBars=n.createBars.bind(n),n.startProgressBar=n.startProgressBar.bind(n),n.updateProgressBar=n.updateProgressBar.bind(n),n.stopProgressBar=n.stopProgressBar.bind(n),n}return o(t,e),i(t,[{key:"componentDidMount",value:function(){this.createBars(),this.startProgressBar()}},{key:"componentWillUnmount",value:function(){this.stopProgressBar()}},{key:"createBars",value:function(){for(var e=[],t=0;t<=this.props.size;t++)e.push({isActive:!1});this.setState({bars:e})}},{key:"startProgressBar",value:function(){this.updateInterval=setInterval(this.updateProgressBar.bind(this),300)}},{key:"updateProgressBar",value:function(){var e=this.state.index,t=this.state.incrementer,n=this.state.bars;(e<0||e>this.props.size)&&(t*=-1,e+=t),n[e].isActive=t>0,e+=t,this.setState({bars:n,incrementer:t,index:e})}},{key:"stopProgressBar",value:function(){clearInterval(this.updateInterval)}},{key:"render",value:function(){return s.default.createElement("div",null,this.state.bars.map(function(e,t){return e.isActive?s.default.createElement(p.default,{key:t}):s.default.createElement(h.default,{key:t})}))}}]),t}(s.default.Component);b.propTypes={size:f.default.number.isRequired},t.default=b},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(10),f=r(c),d=n(7),p=r(d),m=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),i(t,[{key:"render",value:function(){var e=this.props.error;return s.default.createElement("div",null,s.default.createElement(p.default,null),s.default.createElement("div",{className:"row row--padded"},s.default.createElement("p",null,e)))}}]),t}(s.default.Component);m.propTypes={error:f.default.string.isRequired},t.default=m},function(e,t){e.exports=require("passport")},function(e,t,n){"use strict";function r(){var e=this;this.database="default",this.username="default",this.password="default",this.configure=function(t){if(!t)return console.log("No MySQL config received.");var n=t.database,r=t.username,a=t.password;e.database=n,e.username=r,e.password=a}}e.exports=new r},function(e,t,n){"use strict";function r(){var e=this;this.slackWebHook="default",this.slackErrorChannel="default",this.slackInfoChannel="default",this.configure=function(t){if(!t)return console.log("No slack config received.");var n=t.slackWebHook,r=t.slackErrorChannel,a=t.slackInfoChannel;e.slackWebHook=n,e.slackErrorChannel=r,e.slackInfoChannel=a}}e.exports=new r},function(e,t){e.exports=require("passport-local")},function(e,t){e.exports=require("sequelize")},function(e,t,n){"use strict";e.exports={returnShortId:function(e,t){var n=void 0,r=t.substring(0,1),a=0;if((n=e.findIndex(function(e){return e.claimId===t}))<0)throw new Error("claim id not found in claims list");for(var l=e.slice(0,n);l.length>0;)a+=1,r=t.substring(0,a),l=l.filter(function(e){return e.claimId&&e.claimId.substring(0,a)===r});return r}}},function(e,t,n){"use strict";var r=n(2),a=n(79),l=n(5),o=l.details,i=l.publishing;e.exports={parsePublishApiRequestBody:function(e){var t=e.name,n=e.nsfw,r=e.license,a=e.title,l=e.description,o=e.thumbnail;if(!t)throw new Error("no name field found in request");if(/[^A-Za-z0-9,-]/.exec(t))throw new Error('The claim name you provided is not allowed. Only the following characters are allowed: A-Z, a-z, 0-9, and "-"');return n="true"===n,r=r||null,a=a||null,l=l||null,o=o||null,{name:t,nsfw:n,license:r,title:a,description:l,thumbnail:o}},parsePublishApiRequestFiles:function(t){var n=t.file,r=t.thumbnail;if(!n)throw new Error("no file with key of [file] found in request");if(!n.path)throw new Error("no file path found");if(!n.type)throw new Error("no file type found");if(!n.size)throw new Error("no file type found");if(/'/.test(n.name))throw new Error("apostrophes are not allowed in the file name");return e.exports.validateFileTypeAndSize(n),{fileName:n.name,filePath:n.path,fileType:n.type,thumbnailFileName:r?r.name:null,thumbnailFilePath:r?r.path:null,thumbnailFileType:r?r.type:null}},validateFileTypeAndSize:function(e){switch(e.type){case"image/jpeg":case"image/jpg":case"image/png":if(e.size>1e7)throw r.debug("publish > file validation > .jpeg/.jpg/.png was too big"),new Error("Sorry, images are limited to 10 megabytes.");break;case"image/gif":if(e.size>5e7)throw r.debug("publish > file validation > .gif was too big"),new Error("Sorry, .gifs are limited to 50 megabytes.");break;case"video/mp4":if(e.size>5e7)throw r.debug("publish > file validation > .mp4 was too big"),new Error("Sorry, videos are limited to 50 megabytes.");break;default:throw r.debug("publish > file validation > unrecognized file type"),new Error("The "+e.type+" content type is not supported. Only, .jpeg, .png, .gif, and .mp4 files are currently supported.")}return e},createBasicPublishParams:function(e,t,n,a,l,u,s){r.debug("Creating Publish Parameters"),null!==n&&""!==n.trim()||(n=t),null!==a&&""!==a.trim()||(a=""),null!==l&&""!==l.trim()||(l=" ");var c={name:t,file_path:e,bid:.01,metadata:{description:a,title:n,author:o.title,language:"en",license:l,nsfw:u},claim_address:i.primaryClaimAddress};return s&&(c.metadata.thumbnail=s),c},createThumbnailPublishParams:function(e,t,n,a){if(e)return r.debug("Creating Thumbnail Publish Parameters"),{name:t+"-thumb",file_path:e,bid:.01,metadata:{title:t+" thumbnail",description:"a thumbnail for "+t,author:o.title,language:"en",license:n,nsfw:a},claim_address:i.primaryClaimAddress,channel_name:i.thumbnailChannel,channel_id:i.thumbnailChannelId}},deleteTemporaryFile:function(e){a.unlink(e,function(t){if(t)throw r.error("error deleting temporary file "+e),t;r.debug("successfully deleted "+e)})},addGetResultsToFileData:function(e,t){return e.fileName=t.file_name,e.filePath=t.download_path,e},createFileData:function(e){var t=e.name,n=e.claimId,r=e.outpoint,a=e.height,l=e.address,o=e.nsfw;return{name:t,claimId:n,outpoint:r,height:a,address:l,fileName:"",filePath:"",fileType:e.contentType,nsfw:o}}}},function(e,t,n){"use strict";var r=function(){function e(e,t){var n=[],r=!0,a=!1,l=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,l=e}finally{try{!r&&i.return&&i.return()}finally{if(a)throw l}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=n(2);e.exports={handleErrorResponse:function(t,n,l,o){a.error("Error on "+t,e.exports.useObjectPropertiesIfNoKeys(l));var i=e.exports.returnErrorMessageAndStatus(l),u=r(i,2),s=u[0],c=u[1];o.status(s).json(e.exports.createErrorResponsePayload(s,c))},returnErrorMessageAndStatus:function(e){var t=void 0,n=void 0;return"ECONNREFUSED"===e.code?(t=503,n="Connection refused. The daemon may not be running."):(t=400,n=e.message?e.message:e),[t,n]},useObjectPropertiesIfNoKeys:function(e){if(0===Object.keys(e).length){var t={};return Object.getOwnPropertyNames(e).forEach(function(n){t[n]=e[n]}),t}return e},createErrorResponsePayload:function(e,t){return{status:e,success:!1,message:t}}}},function(e,t,n){"use strict";var r=function(){function e(e,t){var n=[],r=!0,a=!1,l=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,l=e}finally{try{!r&&i.return&&i.return()}finally{if(a)throw l}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=n(6),l=n(2),o=n(81),i=o.returnPaginatedChannelClaims;e.exports={getClaimId:function(t,n,r,a){return t?e.exports.getClaimIdByChannel(t,n,r):e.exports.getClaimIdByClaim(r,a)},getClaimIdByClaim:function(e,t){return l.debug("getClaimIdByClaim("+e+", "+t+")"),new Promise(function(n,r){a.Claim.getLongClaimId(e,t).then(function(e){e||n("NO_CLAIM"),n(e)}).catch(function(e){r(e)})})},getClaimIdByChannel:function(e,t,n){return l.debug("getClaimIdByChannel("+e+", "+t+", "+n+")"),new Promise(function(l,o){a.Certificate.getLongChannelId(e,t).then(function(e){return e?Promise.all([e,a.Claim.getClaimIdByLongChannelId(e,n)]):[null,null]}).then(function(e){var t=r(e,2),n=t[0],a=t[1];return n?a?void l(a):l("NO_CLAIM"):l("NO_CHANNEL")}).catch(function(e){o(e)})})},getChannelData:function(e,t,n){return new Promise(function(n,l){a.Certificate.getLongChannelId(e,t).then(function(t){return t?Promise.all([t,a.Certificate.getShortChannelIdFromLongChannelId(t,e)]):[null,null,null]}).then(function(t){var a=r(t,2),l=a[0],o=a[1];if(!l)return n("NO_CHANNEL");n({channelName:e,longChannelClaimId:l,shortChannelClaimId:o})}).catch(function(e){l(e)})})},getChannelClaims:function(e,t,n){return new Promise(function(l,o){a.Certificate.getLongChannelId(e,t).then(function(e){return e?Promise.all([e,a.Claim.getAllChannelClaims(e)]):[null,null,null]}).then(function(t){var a=r(t,2),o=a[0],u=a[1];if(!o)return l("NO_CHANNEL");var s=i(e,o,u,n);l(s)}).catch(function(e){o(e)})})},getLocalFileRecord:function(e,t){return a.File.findOne({where:{claimId:e,name:t}}).then(function(e){return e?e.dataValues:"NO_FILE"})}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var a=n(0),l=r(a),o=n(32),i=n(18),u=n(33),s=r(u),c=n(1),f=n(3),d=n(38),p=r(d),m=n(39),h=r(m),b=n(45),g=r(b),v=n(14),y=r(v);e.exports=function(e,t){var n={},r=(0,i.createStore)(s.default),a=(0,o.renderToString)(l.default.createElement(c.Provider,{store:r},l.default.createElement(f.StaticRouter,{location:e.url,context:n},l.default.createElement(p.default,null,l.default.createElement(h.default,null))))),u=y.default.renderStatic();if(n.url)return t.redirect(301,n.url);var d=r.getState();t.send((0,g.default)(u,a,d))}},function(e,t){e.exports=require("react-dom/server")},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(18),l=n(83),o=r(l),i=n(84),u=r(i),s=n(85),c=r(s),f=n(86),d=r(f);t.default=(0,a.combineReducers)({channel:u.default,publish:o.default,show:c.default,site:d.default})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.FILE_SELECTED="FILE_SELECTED",t.FILE_CLEAR="FILE_CLEAR",t.METADATA_UPDATE="METADATA_UPDATE",t.CLAIM_UPDATE="CLAIM_UPDATE",t.SET_PUBLISH_IN_CHANNEL="SET_PUBLISH_IN_CHANNEL",t.PUBLISH_STATUS_UPDATE="PUBLISH_STATUS_UPDATE",t.ERROR_UPDATE="ERROR_UPDATE",t.SELECTED_CHANNEL_UPDATE="SELECTED_CHANNEL_UPDATE",t.TOGGLE_METADATA_INPUTS="TOGGLE_METADATA_INPUTS",t.THUMBNAIL_NEW="THUMBNAIL_NEW",t.PUBLISH_START="PUBLISH_START"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.LOGIN="Existing",t.CREATE="New"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.CHANNEL_UPDATE="CHANNEL_UPDATE"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.LOCAL_CHECK="LOCAL_CHECK",t.UNAVAILABLE="UNAVAILABLE",t.ERROR="ERROR",t.AVAILABLE="AVAILABLE"},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(87),f=r(c),d=n(3),p=n(5),m=p.analytics.googleId;f.default.initialize(m);var h=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),i(t,[{key:"componentDidMount",value:function(){this.sendPageView(this.props.history.location),this.props.history.listen(this.sendPageView)}},{key:"sendPageView",value:function(e){f.default.set({page:e.pathname}),f.default.pageview(e.pathname)}},{key:"render",value:function(){return this.props.children}}]),t}(s.default.Component);t.default=(0,d.withRouter)(h)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),l=r(a),o=n(3),i=n(88),u=r(i),s=n(125),c=r(s),f=n(126),d=r(f),p=n(128),m=r(p),h=n(145),b=r(h),g=function(){return l.default.createElement(o.Switch,null,l.default.createElement(o.Route,{exact:!0,path:"/",component:u.default}),l.default.createElement(o.Route,{exact:!0,path:"/about",component:c.default}),l.default.createElement(o.Route,{exact:!0,path:"/login",component:d.default}),l.default.createElement(o.Route,{exact:!0,path:"/:identifier/:claim",component:m.default}),l.default.createElement(o.Route,{exact:!0,path:"/:claim",component:m.default}),l.default.createElement(o.Route,{component:b.default}))};t.default=g},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(4),l=n(99),o=function(e){return e&&e.__esModule?e:{default:e}}(l),i=function(e){var t=e.publish;return{file:t.file,thumbnail:t.thumbnail,fileError:t.error.file}},u=function(e){return{selectFile:function(t){e((0,a.selectFile)(t))},setFileError:function(t){e((0,a.clearFile)()),e((0,a.updateError)("file",t))}}};t.default=(0,r.connect)(i,u)(o.default)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(19),l=n(116),o=function(e){return e&&e.__esModule?e:{default:e}}(l),i=n(4),u=function(e){return{onChannelLogin:function(t,n,r){e((0,a.updateLoggedInChannel)(t,n,r)),e((0,i.updateSelectedChannel)(t))}}};t.default=(0,r.connect)(null,u)(o.default)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(19),l=n(117),o=function(e){return e&&e.__esModule?e:{default:e}}(l),i=n(4),u=function(e){return{onChannelLogin:function(t,n,r){e((0,a.updateLoggedInChannel)(t,n,r)),e((0,i.updateSelectedChannel)(t))}}};t.default=(0,r.connect)(null,u)(o.default)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.CHANNEL="CHANNEL",t.ASSET_LITE="ASSET_LITE",t.ASSET_DETAILS="ASSET_DETAILS"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(132),l=function(e){return e&&e.__esModule?e:{default:e}}(a),o=n(8),i=n(13),u=function(e){var t=e.show;return{error:t.displayAsset.error,status:t.displayAsset.status,asset:(0,i.selectAsset)(t)}},s=function(e){return{onFileRequest:function(t,n){e((0,o.fileRequested)(t,n))}}};t.default=(0,r.connect)(u,s)(l.default)},function(e,t,n){"use strict";e.exports=function(e,t,n){return'\n <!DOCTYPE html>\n <html lang="en" prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#">\n <head>\n <meta charset="UTF-8">\n <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">\n <meta http-equiv="X-UA-Compatible" content="ie=edge">\n \x3c!--helmet--\x3e\n '+e.title.toString()+"\n "+e.meta.toString()+"\n "+e.link.toString()+'\n \x3c!--style sheets--\x3e\n <link rel="stylesheet" href="/assets/css/reset.css" type="text/css">\n <link rel="stylesheet" href="/assets/css/general.css" type="text/css">\n <link rel="stylesheet" href="/assets/css/mediaQueries.css" type="text/css">\n \x3c!--google font--\x3e\n <link href="https://fonts.googleapis.com/css?family=Roboto:300" rel="stylesheet">\n </head>\n <body id="main-body">\n <div class="row row--tall flex-container--column">\n <div id="react-app" class="row row--tall flex-container--column">'+t+"</div>\n </div>\n <script>\n window.__PRELOADED_STATE__ = "+JSON.stringify(n).replace(/</g,"\\<")+'\n <\/script>\n <script src="/bundle/bundle.js"><\/script>\n </body>\n </html>\n '}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.selectSiteState=function(e){return e.site},t.selectSiteHost=function(e){return e.site.host}},function(e,t,n){n(48),n(49),e.exports=n(50)},function(e,t){e.exports=require("babel-polyfill")},function(e,t){e.exports=require("whatwg-fetch")},function(e,t,n){"use strict";function r(e){var t=this,r=e.mysqlConfig,c=e.siteConfig,g=e.slackConfig;this.start=function(){t.configureConfigFiles(),t.configureLogging(),t.configureApp(),t.configureServer(),t.startServer()},this.configureConfigFiles=function(){n(23).configure(r);var e=n(5);e.configure(c),t.PORT=e.details.port,n(24).configure(g)},this.configureLogging=function(){n(59)(b),n(61)(b)},this.configureApp=function(){var e=a();e.enable("trust proxy"),e.use(u()),e.use(a.static(__dirname+"/public")),e.use(l.json()),e.use(l.urlencoded({extended:!0})),e.use(function(e,t,n){b.verbose("Request on "+e.originalUrl+" from "+e.ip),n()}),s.serializeUser(d),s.deserializeUser(p);var r=n(63),h=n(74);s.use("local-signup",r),s.use("local-login",h),e.use(m({name:"session",keys:[c.auth.sessionKey],maxAge:864e5})),e.use(s.initialize()),e.use(s.session());var g=o.create({defaultLayout:"embed",handlebars:i});e.engine("handlebars",g.engine),e.set("view engine","handlebars"),e.use(f),n(75)(e),n(76)(e),n(82)(e),n(147)(e),n(158)(e),t.app=e},this.configureServer=function(){t.server=h.Server(t.app)},this.startServer=function(){n(6).sequelize.sync().then(function(){t.server.listen(t.PORT,function(){b.info("Server is listening on PORT "+t.PORT)})}).catch(function(e){b.error("Startup Error:",e)})}}var a=n(51),l=n(52),o=n(53),i=n(54),u=n(55),s=n(22),c=n(56),f=c.populateLocalsDotUser,d=c.serializeSpeechUser,p=c.deserializeSpeechUser,m=n(57),h=n(58),b=n(2);e.exports=r},function(e,t){e.exports=require("express")},function(e,t){e.exports=require("body-parser")},function(e,t){e.exports=require("express-handlebars")},function(e,t){e.exports=require("handlebars")},function(e,t){e.exports=require("helmet")},function(e,t,n){"use strict";var r=n(2);e.exports={populateLocalsDotUser:function(e,t,n){e.user&&(r.debug("populating res.locals.user"),t.locals.user={id:e.user.id,userName:e.user.userName,channelName:e.user.channelName,channelClaimId:e.user.channelClaimId,shortChannelId:e.user.shortChannelId}),n()},serializeSpeechUser:function(e,t){r.debug("serializing user"),t(null,e)},deserializeSpeechUser:function(e,t){r.debug("deserializing user"),t(null,e)}}},function(e,t){e.exports=require("cookie-session")},function(e,t){e.exports=require("http")},function(e,t,n){"use strict";var r=n(60),a=r.logLevel;e.exports=function(e){e.configure({transports:[new e.transports.Console({level:a,timestamp:!1,colorize:!0,prettyPrint:!0,handleExceptions:!0,humanReadableUnhandledException:!0})]}),e.error("Level 0"),e.warn("Level 1"),e.info("Level 2"),e.verbose("Level 3"),e.debug("Level 4"),e.silly("Level 5")}},function(e,t,n){"use strict";var r={logLevel:"debug"};e.exports=r},function(e,t,n){"use strict";var r=n(62).SlackWebHook,a=n(24);e.exports=function(e){var t=a.slackWebHook,n=a.slackErrorChannel,l=a.slackInfoChannel;t?(n&&e.add(r,{name:"slack-errors-transport",level:"warn",webhookUrl:t,channel:n,username:"spee.ch",iconEmoji:":face_with_head_bandage:"}),l&&e.add(r,{name:"slack-info-transport",level:"info",webhookUrl:t,channel:l,username:"spee.ch",iconEmoji:":nerd_face:"}),e.error('Slack "error" logging is online.'),e.info('Slack "info" logging is online.')):e.warn("Slack logging is not enabled because no slackWebHook config var provided.")}},function(e,t){e.exports=require("winston-slack-webhook")},function(e,t,n){"use strict";var r=function(){function e(e,t){var n=[],r=!0,a=!1,l=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,l=e}finally{try{!r&&i.return&&i.return()}finally{if(a)throw l}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=n(25).Strategy,l=n(16),o=n(2),i=n(6);e.exports=new a({usernameField:"username",passwordField:"password"},function(e,t,n){o.verbose("new channel signup request. user: "+e+" pass: "+t+" .");var a={};return l.createChannel("@"+e).then(function(n){var r={userName:e,password:t};o.verbose("userData >",r);var a={channelName:"@"+e,channelClaimId:n.claim_id};o.verbose("channelData >",a);var l={claimId:n.claim_id,name:"@"+e};return o.verbose("certificateData >",l),Promise.all([i.User.create(r),i.Channel.create(a),i.Certificate.create(l)])}).then(function(e){var t=r(e,3),n=t[0],l=t[1],i=t[2];return o.verbose("user and certificate successfully created"),a.id=n.id,a.userName=n.userName,a.channelName=l.channelName,a.channelClaimId=l.channelClaimId,Promise.all([i.setChannel(l),l.setUser(n)])}).then(function(){return o.verbose("user and certificate successfully associated"),i.Certificate.getShortChannelIdFromLongChannelId(a.channelClaimId,a.channelName)}).then(function(e){return a.shortChannelId=e,n(null,a)}).catch(function(e){return o.error("signup error",e),n(e)})})},function(e,t){e.exports=require("axios")},function(e,t,n){"use strict";var r={api:{apiHost:"localhost",apiPort:"5279"}};e.exports=r},function(e,t){e.exports=require("universal-analytics")},function(e,t,n){"use strict";var r=n(2),a=n(27),l=a.returnShortId;e.exports=function(e,t){var n=t.STRING,a=t.BOOLEAN,o=t.INTEGER,i=t.TEXT,u=t.DECIMAL,s=e.define("Certificate",{address:{type:n,default:null},amount:{type:u(19,8),default:null},claimId:{type:n,default:null},claimSequence:{type:o,default:null},decodedClaim:{type:a,default:null},depth:{type:o,default:null},effectiveAmount:{type:u(19,8),default:null},hasSignature:{type:a,default:null},height:{type:o,default:null},hex:{type:i("long"),default:null},name:{type:n,default:null},nout:{type:o,default:null},txid:{type:n,default:null},validAtHeight:{type:o,default:null},outpoint:{type:n,default:null},valueVersion:{type:n,default:null},claimType:{type:n,default:null},certificateVersion:{type:n,default:null},keyType:{type:n,default:null},publicKey:{type:i("long"),default:null}},{freezeTableName:!0});return s.associate=function(e){s.belongsTo(e.Channel,{foreignKey:{allowNull:!0}})},s.getShortChannelIdFromLongChannelId=function(e,t){var n=this;return r.debug("getShortChannelIdFromLongChannelId "+t+":"+e),new Promise(function(r,a){n.findAll({where:{name:t},order:[["height","ASC"]]}).then(function(t){switch(t.length){case 0:throw new Error("No channel(s) found with that channel name");default:return r(l(t,e))}}).catch(function(e){a(e)})})},s.getLongChannelIdFromShortChannelId=function(e,t){var n=this;return r.debug("getLongChannelIdFromShortChannelId("+e+", "+t+")"),new Promise(function(r,a){n.findAll({where:{name:e,claimId:{$like:t+"%"}},order:[["height","ASC"]]}).then(function(e){switch(e.length){case 0:return r(null);default:return r(e[0].claimId)}}).catch(function(e){a(e)})})},s.getLongChannelIdFromChannelName=function(e){var t=this;return r.debug("getLongChannelIdFromChannelName("+e+")"),new Promise(function(n,r){t.findAll({where:{name:e},order:[["effectiveAmount","DESC"],["height","ASC"]]}).then(function(e){switch(e.length){case 0:return n(null);default:return n(e[0].claimId)}}).catch(function(e){r(e)})})},s.validateLongChannelId=function(e,t){var n=this;return r.debug("validateLongChannelId("+e+", "+t+")"),new Promise(function(r,a){n.findOne({where:{name:e,claimId:t}}).then(function(e){if(!e)return r(null);r(t)}).catch(function(e){a(e)})})},s.getLongChannelId=function(e,t){return r.debug("getLongChannelId("+e+", "+t+")"),t&&40===t.length?this.validateLongChannelId(e,t):t&&t.length<40?this.getLongChannelIdFromShortChannelId(e,t):this.getLongChannelIdFromChannelName(e)},s}},function(e,t,n){"use strict";e.exports=function(e,t){var n=t.STRING,r=e.define("Channel",{channelName:{type:n,allowNull:!1},channelClaimId:{type:n,allowNull:!1}},{freezeTableName:!0});return r.associate=function(e){r.belongsTo(e.User),r.hasOne(e.Certificate)},r}},function(e,t,n){"use strict";function r(e){switch(e){case"image/jpeg":case"image/jpg":return"jpeg";case"image/png":return"png";case"image/gif":return"gif";case"video/mp4":return"mp4";default:return o.debug("setting unknown file type as file extension jpeg"),"jpeg"}}function a(e,t){return""===e?t:e}function l(e){return e.thumbnail=a(e.thumbnail,c),e.fileExt=r(e.contentType),e.host=f,e}var o=n(2),i=n(27),u=i.returnShortId,s=n(5),c=s.assetDefaults.thumbnail,f=s.details.host;e.exports=function(e,t){var n=t.STRING,i=t.BOOLEAN,s=t.INTEGER,f=t.TEXT,d=t.DECIMAL,p=e.define("Claim",{address:{type:n,default:null},amount:{type:d(19,8),default:null},claimId:{type:n,default:null},claimSequence:{type:s,default:null},decodedClaim:{type:i,default:null},depth:{type:s,default:null},effectiveAmount:{type:d(19,8),default:null},hasSignature:{type:i,default:null},height:{type:s,default:null},hex:{type:f("long"),default:null},name:{type:n,default:null},nout:{type:s,default:null},txid:{type:n,default:null},validAtHeight:{type:s,default:null},outpoint:{type:n,default:null},claimType:{type:n,default:null},certificateId:{type:n,default:null},author:{type:n,default:null},description:{type:f("long"),default:null},language:{type:n,default:null},license:{type:n,default:null},licenseUrl:{type:n,default:null},nsfw:{type:i,default:null},preview:{type:n,default:null},thumbnail:{type:n,default:null},title:{type:n,default:null},metadataVersion:{type:n,default:null},contentType:{type:n,default:null},source:{type:n,default:null},sourceType:{type:n,default:null},sourceVersion:{type:n,default:null},streamVersion:{type:n,default:null},valueVersion:{type:n,default:null},channelName:{type:n,allowNull:!0,default:null}},{freezeTableName:!0});return p.associate=function(e){p.belongsTo(e.File,{foreignKey:{allowNull:!0}})},p.getShortClaimIdFromLongClaimId=function(e,t){var n=this;return o.debug("Claim.getShortClaimIdFromLongClaimId for "+t+"#"+e),new Promise(function(r,a){n.findAll({where:{name:t},order:[["height","ASC"]]}).then(function(t){switch(t.length){case 0:throw new Error("No claim(s) found with that claim name");default:r(u(t,e))}}).catch(function(e){a(e)})})},p.getAllChannelClaims=function(e){var t=this;return o.debug("Claim.getAllChannelClaims for "+e),new Promise(function(n,l){t.findAll({where:{certificateId:e},order:[["height","ASC"]],raw:!0}).then(function(e){switch(e.length){case 0:return n(null);default:return e.forEach(function(e){return e.fileExt=r(e.contentType),e.thumbnail=a(e.thumbnail,c),e}),n(e)}}).catch(function(e){l(e)})})},p.getClaimIdByLongChannelId=function(e,t){var n=this;return o.debug("finding claim id for claim "+t+" from channel "+e),new Promise(function(r,a){n.findAll({where:{name:t,certificateId:e},order:[["id","ASC"]]}).then(function(n){switch(n.length){case 0:return r(null);case 1:return r(n[0].claimId);default:return o.error(n.length+' records found for "'+t+'" in channel "'+e+'"'),r(n[0].claimId)}}).catch(function(e){a(e)})})},p.getLongClaimIdFromShortClaimId=function(e,t){var n=this;return new Promise(function(r,a){n.findAll({where:{name:e,claimId:{$like:t+"%"}},order:[["height","ASC"]]}).then(function(e){switch(e.length){case 0:return r(null);default:return r(e[0].claimId)}}).catch(function(e){a(e)})})},p.getTopFreeClaimIdByClaimName=function(e){var t=this;return new Promise(function(n,r){t.findAll({where:{name:e},order:[["effectiveAmount","DESC"],["height","ASC"]]}).then(function(e){switch(o.debug("length of result",e.length),e.length){case 0:return n(null);default:return n(e[0].dataValues.claimId)}}).catch(function(e){r(e)})})},p.validateLongClaimId=function(e,t){var n=this;return new Promise(function(r,a){n.findOne({where:{name:e,claimId:t}}).then(function(e){if(!e)return r(null);r(t)}).catch(function(e){a(e)})})},p.getLongClaimId=function(e,t){return o.debug("getLongClaimId("+e+", "+t+")"),t&&40===t.length?this.validateLongClaimId(e,t):t&&t.length<40?this.getLongClaimIdFromShortClaimId(e,t):this.getTopFreeClaimIdByClaimName(e)},p.resolveClaim=function(e,t){var n=this;return o.debug("Claim.resolveClaim: "+e+" "+t),new Promise(function(r,a){n.findAll({where:{name:e,claimId:t}}).then(function(n){switch(n.length){case 0:return r(null);case 1:return r(l(n[0].dataValues));default:return o.error("more than one record matches "+e+"#"+t+" in db.Claim"),r(l(n[0].dataValues))}}).catch(function(e){a(e)})})},p}},function(e,t,n){"use strict";e.exports=function(e,t){var n=t.STRING,r=t.BOOLEAN,a=t.INTEGER,l=e.define("File",{name:{type:n,allowNull:!1},claimId:{type:n,allowNull:!1},address:{type:n,allowNull:!1},outpoint:{type:n,allowNull:!1},height:{type:a,allowNull:!1,default:0},fileName:{type:n,allowNull:!1},filePath:{type:n,allowNull:!1},fileType:{type:n},nsfw:{type:r,allowNull:!1,defaultValue:!1},trendingEligible:{type:r,allowNull:!1,defaultValue:!0}},{freezeTableName:!0});return l.associate=function(e){l.hasMany(e.Request),l.hasOne(e.Claim)},l.getRecentClaims=function(){return this.findAll({where:{nsfw:!1,trendingEligible:!0},order:[["createdAt","DESC"]],limit:25})},l}},function(e,t,n){"use strict";e.exports=function(e,t){var n=t.STRING,r=(t.BOOLEAN,t.TEXT),a=e.define("Request",{action:{type:n,allowNull:!1},url:{type:n,allowNull:!1},ipAddress:{type:n,allowNull:!0},result:{type:r("long"),allowNull:!0,default:null}},{freezeTableName:!0});return a.associate=function(e){a.belongsTo(e.File,{foreignKey:{allowNull:!0}})},a}},function(e,t,n){"use strict";var r=n(73),a=n(2);e.exports=function(e,t){var n=t.STRING,l=e.define("User",{userName:{type:n,allowNull:!1},password:{type:n,allowNull:!1}},{freezeTableName:!0});return l.associate=function(e){l.hasOne(e.Channel)},l.prototype.comparePassword=function(e){return r.compare(e,this.password)},l.prototype.changePassword=function(e){var t=this;return new Promise(function(n,l){r.genSalt(function(o,i){if(o)return a.error("salt error",o),void l(o);r.hash(e,i,function(e,r){if(e)return a.error("hash error",e),void l(e);t.update({password:r}).then(function(){n()}).catch(function(e){l(e)})})})})},l.hook("beforeCreate",function(e,t){return a.debug("User.beforeCreate hook..."),new Promise(function(t,n){r.genSalt(function(l,o){if(l)return a.error("salt error",l),void n(l);r.hash(e.password,o,function(r,l){if(r)return a.error("hash error",r),void n(r);e.password=l,t()})})})}),l}},function(e,t){e.exports=require("bcrypt")},function(e,t,n){"use strict";var r=n(25).Strategy,a=n(2),l=n(6),o=function(e){return new Promise(function(t,n){var r={};r.id=e.id,r.userName=e.userName,e.getChannel().then(function(e){var t=e.channelName,n=e.channelClaimId;return r.channelName=t,r.channelClaimId=n,l.Certificate.getShortChannelIdFromLongChannelId(n,t)}).then(function(e){r.shortChannelId=e,t(r)}).catch(function(e){n(e)})})};e.exports=new r({usernameField:"username",passwordField:"password"},function(e,t,n){return l.User.findOne({where:{userName:e}}).then(function(e){return e?e.comparePassword(t).then(function(t){return t?(a.debug("Password was a match, returning User"),o(e).then(function(e){return n(null,e)}).catch(function(e){return e})):(a.debug("incorrect password"),n(null,!1,{message:"Incorrect username or password"}))}).catch(function(e){return e}):(a.debug("no user found"),n(null,!1,{message:"Incorrect username or password"}))}).catch(function(e){return n(e)})})},function(e,t,n){"use strict";var r=n(2),a=n(22);e.exports=function(e){e.post("/signup",a.authenticate("local-signup"),function(e,t){r.verbose("successful signup for "+e.user.channelName),t.status(200).json({success:!0,channelName:e.user.channelName,channelClaimId:e.user.channelClaimId,shortChannelId:e.user.shortChannelId})}),e.post("/login",function(e,t,n){a.authenticate("local-login",function(a,l,o){return a?n(a):l?(r.debug("successful login"),void e.logIn(l,function(r){return r?n(r):t.status(200).json({success:!0,channelName:e.user.channelName,channelClaimId:e.user.channelClaimId,shortChannelId:e.user.shortChannelId})})):t.status(400).json({success:!1,message:o.message})})(e,t,n)}),e.get("/logout",function(e,t){e.logout(),t.status(200).json({success:!0,message:"you successfully logged out"})}),e.get("/user",function(e,t){e.user?t.status(200).json({success:!0,data:e.user}):t.status(401).json({success:!1,message:"user is not logged in"})})}},function(e,t,n){"use strict";var r=function(){function e(e,t){var n=[],r=!0,a=!1,l=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,l=e}finally{try{!r&&i.return&&i.return()}finally{if(a)throw l}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=n(2),l=n(77),o=n(5),i=o.publishing.uploadDirectory,u=o.details.host,s=l({uploadDir:i}),c=n(6),f=n(78),d=f.claimNameIsAvailable,p=f.checkChannelAvailability,m=f.publish,h=n(16),b=h.getClaimList,g=h.resolveUri,v=h.getClaim,y=n(28),E=y.addGetResultsToFileData,w=y.createBasicPublishParams,_=y.createThumbnailPublishParams,C=y.parsePublishApiRequestBody,N=y.parsePublishApiRequestFiles,I=y.createFileData,O=n(29),P=n(17),S=P.sendGATimingEvent,A=n(80),T=A.authenticateUser,j=n(30),x=j.getChannelData,L=j.getChannelClaims,k=j.getClaimId;e.exports=function(e){e.get("/api/channel/availability/:name",function(e,t){var n=e.ip,r=e.originalUrl,a=e.params.name,l=Date.now();p(a).then(function(e){t.status(200).json(e),S("end-to-end","claim name availability",a,l,Date.now())}).catch(function(e){O.handleErrorResponse(r,n,e,t)})}),e.get("/api/channel/short-id/:longId/:name",function(e,t){var n=e.ip,r=e.originalUrl,a=e.params;c.Certificate.getShortChannelIdFromLongChannelId(a.longId,a.name).then(function(e){t.status(200).json(e)}).catch(function(e){O.handleErrorResponse(r,n,e,t)})}),e.get("/api/channel/data/:channelName/:channelClaimId",function(e,t){var n=e.ip,r=e.originalUrl,a=(e.body,e.params),l=a.channelName,o=a.channelClaimId;"none"===o&&(o=null),x(l,o,0).then(function(e){if("NO_CHANNEL"===e)return t.status(404).json({success:!1,message:"No matching channel was found"});t.status(200).json({success:!0,data:e})}).catch(function(e){O.handleErrorResponse(r,n,e,t)})}),e.get("/api/channel/claims/:channelName/:channelClaimId/:page",function(e,t){var n=e.ip,r=e.originalUrl,a=(e.body,e.params),l=a.channelName,o=a.channelClaimId;"none"===o&&(o=null);var i=a.page;L(l,o,i).then(function(e){if("NO_CHANNEL"===e)return t.status(404).json({success:!1,message:"No matching channel was found"});t.status(200).json({success:!0,data:e})}).catch(function(e){O.handleErrorResponse(r,n,e,t)})}),e.get("/api/claim/list/:name",function(e,t){var n=e.ip,r=e.originalUrl,a=e.params;b(a.name).then(function(e){t.status(200).json(e)}).catch(function(e){O.handleErrorResponse(r,n,e,t)})}),e.get("/api/claim/get/:name/:claimId",function(e,t){var n=e.ip,a=e.originalUrl,l=e.params,o=l.name,i=l.claimId;c.Claim.resolveClaim(o,i).then(function(e){if(!e)throw new Error("No matching uri found in Claim table");var t=I(e);return Promise.all([t,v(o+"#"+i)])}).then(function(e){var t=r(e,2),n=t[0],a=t[1];return n=E(n,a),Promise.all([c.upsert(c.File,n,{name:o,claimId:i},"File"),a])}).then(function(e){var n=r(e,2),a=(n[0],n[1]),l=a.message,o=a.completed;t.status(200).json({success:!0,message:l,completed:o})}).catch(function(e){O.handleErrorResponse(a,n,e,t)})}),e.get("/api/claim/availability/:name",function(e,t){var n=e.ip,r=e.originalUrl,a=e.params.name,l=Date.now();d(a).then(function(e){t.status(200).json(e),S("end-to-end","claim name availability",a,l,Date.now())}).catch(function(e){O.handleErrorResponse(r,n,e,t)})}),e.get("/api/claim/resolve/:name/:claimId",function(e,t){var n=(e.headers,e.ip),r=e.originalUrl,a=e.params;g(a.name+"#"+a.claimId).then(function(e){t.status(200).json(e)}).catch(function(e){O.handleErrorResponse(r,n,e,t)})}),e.post("/api/claim/publish",s,function(e,t){var n=e.body,a=e.files,l=(e.headers,e.ip),o=e.originalUrl,i=e.user,s=void 0,c=void 0,f=void 0,p=void 0,h=void 0,b=void 0,g=void 0,v=void 0,y=void 0,E=void 0,I=void 0,P=void 0,A=void 0,j=void 0,x=void 0,L=void 0;v=Date.now();try{var k=C(n);E=k.name,I=k.nsfw,y=k.license,L=k.title,p=k.description,P=k.thumbnail;var R=N(a);h=R.fileName,b=R.filePath,g=R.fileType,A=R.thumbnailFileName,j=R.thumbnailFilePath,x=R.thumbnailFileType,s=n.channelName,c=n.channelId,f=n.channelPassword}catch(e){return t.status(400).json({success:!1,message:e.message})}Promise.all([T(s,c,f,i),d(E),w(b,E,L,p,y,I,P),_(j,E,y,I)]).then(function(e){var t=r(e,4),n=t[0],a=n.channelName,l=n.channelClaimId,o=(t[1],t[2]),i=t[3];return a&&l&&(o.channel_name=a,o.channel_id=l),i&&m(i,A,x),m(o,h,g)}).then(function(e){t.status(200).json({success:!0,message:"publish completed successfully",data:{name:E,claimId:e.claim_id,url:u+"/"+e.claim_id+"/"+E,lbryTx:e}}),S("end-to-end","publish",g,v,Date.now())}).catch(function(e){O.handleErrorResponse(o,l,e,t)})}),e.get("/api/claim/short-id/:longId/:name",function(e,t){var n=e.ip,r=e.originalUrl,a=(e.body,e.params);c.Claim.getShortClaimIdFromLongClaimId(a.longId,a.name).then(function(e){t.status(200).json({success:!0,data:e})}).catch(function(e){O.handleErrorResponse(r,n,e,t)})}),e.post("/api/claim/long-id",function(e,t){var n=e.ip,r=e.originalUrl,l=e.body;e.params;a.debug("body:",l);var o=l.channelName,i=l.channelClaimId,u=l.claimName,s=l.claimId;k(o,i,u,s).then(function(e){return"NO_CHANNEL"===e?t.status(404).json({success:!1,message:"No matching channel could be found"}):"NO_CLAIM"===e?t.status(404).json({success:!1,message:"No matching claim id could be found"}):void t.status(200).json({success:!0,data:e})}).catch(function(e){O.handleErrorResponse(r,n,e,t)})}),e.get("/api/claim/data/:claimName/:claimId",function(e,t){var n=e.ip,r=e.originalUrl,a=(e.body,e.params),l=a.claimName,o=a.claimId;"none"===o&&(o=null),c.Claim.resolveClaim(l,o).then(function(e){if(!e)return t.status(404).json({success:!1,message:"No claim could be found"});t.status(200).json({success:!0,data:e})}).catch(function(e){O.handleErrorResponse(r,n,e,t)})}),e.get("/api/file/availability/:name/:claimId",function(e,t){var n=e.ip,r=e.originalUrl,a=e.params,l=a.name,o=a.claimId;c.File.findOne({where:{name:l,claimId:o}}).then(function(e){if(e)return t.status(200).json({success:!0,data:!0});t.status(200).json({success:!0,data:!1})}).catch(function(e){O.handleErrorResponse(r,n,e,t)})})}},function(e,t){e.exports=require("connect-multiparty")},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a=function(){function e(e,t){var n=[],r=!0,a=!1,l=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,l=e}finally{try{!r&&i.return&&i.return()}finally{if(a)throw l}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=n(2),o=n(6),i=n(16),u=n(28),s=n(5),c=s.publishing,f=c.primaryClaimAddress,d=c.additionalClaimAddresses,p=n(26),m=p.Op;e.exports={publish:function(e,t,n){return new Promise(function(r,s){var c=void 0,f=void 0,d=void 0;return i.publishClaim(e).then(function(n){return l.info("Successfully published "+e.name+" "+t,n),c=n,e.channel_name?(l.debug("this claim was published in channel: "+e.channel_name),o.Channel.findOne({where:{channelName:e.channel_name}})):(l.debug("this claim was not published in a channel"),null)}).then(function(e){f=null,d=null,e&&(f=e.channelClaimId,d=e.channelName),l.debug("certificateId: "+f)}).then(function(){var r={name:e.name,claimId:c.claim_id,title:e.metadata.title,description:e.metadata.description,address:e.claim_address,outpoint:c.txid+":"+c.nout,height:0,fileName:t,filePath:e.file_path,fileType:n,nsfw:e.metadata.nsfw},a={name:e.name,claimId:c.claim_id,title:e.metadata.title,description:e.metadata.description,address:e.claim_address,thumbnail:e.metadata.thumbnail,outpoint:c.txid+":"+c.nout,height:0,contentType:n,nsfw:e.metadata.nsfw,amount:e.bid,certificateId:f,channelName:d},l={name:e.name,claimId:c.claim_id};return Promise.all([o.upsert(o.File,r,l,"File"),o.upsert(o.Claim,a,l,"Claim")])}).then(function(e){var t=a(e,2),n=t[0],r=t[1];return l.debug("File and Claim records successfully created"),Promise.all([n.setClaim(r),r.setFile(n)])}).then(function(){l.debug("File and Claim records successfully associated"),r(c)}).catch(function(t){l.error("PUBLISH ERROR",t),u.deleteTemporaryFile(e.file_path),s(t)})})},claimNameIsAvailable:function(e){var t=d||[];return t.push(f),o.Claim.findAll({attributes:["address"],where:{name:e,address:r({},m.or,t)}}).then(function(t){if(t.length>=1)throw new Error("That claim is already in use");return e}).catch(function(e){throw e})},checkChannelAvailability:function(e){return o.Channel.findAll({where:{channelName:e}}).then(function(t){if(t.length>=1)throw new Error("That channel has already been claimed");return e}).catch(function(e){throw e})}}},function(e,t){e.exports=require("fs")},function(e,t,n){"use strict";var r=n(6),a=n(2);e.exports={authenticateUser:function(t,n,r,a){if(!t&&!n)return{channelName:null,channelClaimId:null};if(a){if(t&&t!==a.channelName)throw new Error("the provided channel name does not match user credentials");if(n&&n!==a.channelClaimId)throw new Error("the provided channel id does not match user credentials");return{channelName:a.channelName,channelClaimId:a.channelClaimId}}if(!r)throw new Error("no channel password provided");return e.exports.authenticateChannelCredentials(t,n,r)},authenticateChannelCredentials:function(e,t,n){return new Promise(function(l,o){var i=void 0,u={};e&&(u.channelName=e),t&&(u.channelClaimId=t),r.Channel.findOne({where:u}).then(function(e){if(!e)throw a.debug("no channel found"),new Error("Authentication failed, you do not have access to that channel");return i=e.get(),a.debug("channel data:",i),r.User.findOne({where:{userName:i.channelName.substring(1)}})}).then(function(e){if(!e)throw a.debug("no user found"),new Error("Authentication failed, you do not have access to that channel");return e.comparePassword(n)}).then(function(e){if(!e)throw a.debug("incorrect password"),new Error("Authentication failed, you do not have access to that channel");a.debug("...password was a match..."),l(i)}).catch(function(e){o(e)})})}}},function(e,t,n){"use strict";e.exports={returnPaginatedChannelClaims:function(t,n,r,a){var l=e.exports.determineTotalPages(r),o=e.exports.getPageFromQuery(a);return{channelName:t,longChannelClaimId:n,claims:e.exports.extractPageFromClaims(r,o),previousPage:e.exports.determinePreviousPage(o),currentPage:o,nextPage:e.exports.determineNextPage(l,o),totalPages:l,totalResults:e.exports.determineTotalClaims(r)}},getPageFromQuery:function(e){return e?parseInt(e):1},extractPageFromClaims:function(e,t){if(!e)return[];var n=12*(t-1),r=n+12;return e.slice(n,r)},determineTotalPages:function(e){if(e){var t=e.length;if(t<12)return 1;var n=Math.floor(t/12);return 0===t%12?n:n+1}return 0},determinePreviousPage:function(e){return 1===e?null:e-1},determineNextPage:function(e,t){return t===e?null:t+1},determineTotalClaims:function(e){return e?e.length:0}}},function(e,t,n){"use strict";var r=n(5),a=r.details,l=n(31);e.exports=function(e){e.get("/",function(e,t){l(e,t)}),e.get("/login",function(e,t){l(e,t)}),e.get("/about",function(e,t){l(e,t)}),e.get("/trending",function(e,t){t.status(301).redirect("/popular")}),e.get("/popular",function(e,t){l(e,t)}),e.get("/new",function(e,t){l(e,t)}),e.get("/embed/:claimId/:name",function(e,t){var n=e.params,r=n.claimId,l=n.name;t.status(200).render("embed",{layout:"embed",host:a,claimId:r,name:l})})}},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,t=arguments[1];switch(t.type){case l.FILE_SELECTED:return Object.assign({},s,{file:t.data});case l.FILE_CLEAR:return s;case l.METADATA_UPDATE:return Object.assign({},e,{metadata:Object.assign({},e.metadata,r({},t.data.name,t.data.value))});case l.CLAIM_UPDATE:return Object.assign({},e,{claim:t.data});case l.SET_PUBLISH_IN_CHANNEL:return Object.assign({},e,{publishInChannel:t.channel});case l.PUBLISH_STATUS_UPDATE:return Object.assign({},e,{status:t.data});case l.ERROR_UPDATE:return Object.assign({},e,{error:Object.assign({},e.error,r({},t.data.name,t.data.value))});case l.SELECTED_CHANNEL_UPDATE:return Object.assign({},e,{selectedChannel:t.data});case l.TOGGLE_METADATA_INPUTS:return Object.assign({},e,{showMetadataInputs:t.data});case l.THUMBNAIL_NEW:return Object.assign({},e,{thumbnail:t.data});default:return e}};var a=n(34),l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(a),o=n(35),i=n(5),u=i.publishing,s={disabled:u.disabled,disabledMessage:u.disabledMessage,publishInChannel:!1,selectedChannel:o.LOGIN,showMetadataInputs:!1,status:{status:null,message:null},error:{file:null,url:null,channel:null,publishSubmit:null},file:null,claim:"",metadata:{title:"",description:"",license:"",nsfw:!1},thumbnail:null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments[1];switch(t.type){case a.CHANNEL_UPDATE:return Object.assign({},e,{loggedInChannel:t.data});default:return e}};var r=n(36),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(r),l={loggedInChannel:{name:null,shortId:null,longId:null}}},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,t=arguments[1];switch(t.type){case l.REQUEST_ERROR:return Object.assign({},e,{request:Object.assign({},e.request,{error:t.data})});case l.REQUEST_UPDATE:return Object.assign({},e,{request:Object.assign({},e.request,{type:t.data.requestType,id:t.data.requestId})});case l.REQUEST_LIST_ADD:return Object.assign({},e,{requestList:Object.assign({},e.requestList,r({},t.data.id,{error:t.data.error,key:t.data.key}))});case l.ASSET_ADD:return Object.assign({},e,{assetList:Object.assign({},e.assetList,r({},t.data.id,{error:t.data.error,name:t.data.name,claimId:t.data.claimId,shortId:t.data.shortId,claimData:t.data.claimData}))});case l.CHANNEL_ADD:return Object.assign({},e,{channelList:Object.assign({},e.channelList,r({},t.data.id,{name:t.data.name,longId:t.data.longId,shortId:t.data.shortId,claimsData:t.data.claimsData}))});case l.CHANNEL_CLAIMS_UPDATE_SUCCESS:return Object.assign({},e,{channelList:Object.assign({},e.channelList,r({},t.data.channelListId,Object.assign({},e.channelList[t.data.channelListId],{claimsData:t.data.claimsData})))});case l.FILE_AVAILABILITY_UPDATE:return Object.assign({},e,{displayAsset:Object.assign({},e.displayAsset,{status:t.data})});case l.DISPLAY_ASSET_ERROR:return Object.assign({},e,{displayAsset:Object.assign({},e.displayAsset,{error:t.data,status:o.ERROR})});default:return e}};var a=n(12),l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(a),o=n(37),i={request:{error:null,type:null,id:null},requestList:{},channelList:{},assetList:{},displayAsset:{error:null,status:o.LOCAL_CHECK}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p;return arguments[1].type,e};var r=n(5),a=r.analytics.googleId,l=r.assetDefaults,o=l.thumbnail,i=l.description,u=r.details,s=u.description,c=u.host,f=u.title,d=u.twitter,p={description:s,googleAnalyticsId:a,host:c,title:f,twitter:d,defaultDescription:i,defaultThumbnail:o}},function(e,t){e.exports=require("react-ga")},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(9),f=r(c),d=n(7),p=r(d),m=n(97),h=r(m),b=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),i(t,[{key:"render",value:function(){return s.default.createElement("div",{className:"row row--tall flex-container--column"},s.default.createElement(f.default,null),s.default.createElement(p.default,null),s.default.createElement("div",{className:"row row--tall row--padded flex-container--column"},s.default.createElement(h.default,null)))}}]),t}(s.default.Component);t.default=b},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(14),f=r(c),d=n(10),p=r(d),m=n(90),h=n(91),b=n(92),g=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),i(t,[{key:"render",value:function(){var e=this.props,t=e.defaultDescription,n=e.defaultThumbnail,r=e.siteDescription,a=e.siteHost,l=e.siteTitle,o=e.siteTwitter,i=this.props,u=i.asset,c=i.channel,d=i.pageUri,p=this.props.pageTitle;p=(0,m.createPageTitle)(l,p);var g=(0,h.createMetaTags)(r,a,l,o,u,c,t,n),v=(0,b.createCanonicalLink)(u,c,d,a);return s.default.createElement(f.default,{title:p,meta:g,link:[{rel:"canonical",href:v}]})}}]),t}(s.default.Component);g.propTypes={pageTitle:p.default.string,pageUri:p.default.string,channel:p.default.object,asset:p.default.object},t.default=g},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.createPageTitle=function(e,t){return t?e+" - "+t:""+e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e){if(e){switch(e.substring(e.lastIndexOf("."))){case"jpeg":case"jpg":return"image/jpeg";case"png":return"image/png";case"gif":return"image/gif";case"mp4":return"video/mp4";default:return"image/jpeg"}}return""},a=function(e,t,n,r){return[{property:"og:title",content:n},{property:"og:url",content:e},{property:"og:site_name",content:n},{property:"og:description",content:t},{property:"twitter:site",content:r},{property:"twitter:card",content:"summary"}]},l=function(e,t,n,r){var a=r.name;return[{property:"og:title",content:a+" on "+e},{property:"og:url",content:t+"/"+a+":"+r.longId},{property:"og:site_name",content:e},{property:"og:description",content:a+", a channel on "+e},{property:"twitter:site",content:n},{property:"twitter:card",content:"summary"}]},o=function(e,t,n,a,l,o){var i=a.claimData,u=i.contentType,s=e+"/"+i.claimId+"/"+i.name,c=e+"/"+i.claimId+"/"+i.name,f=e+"/"+i.claimId+"/"+i.name+"."+i.fileExt,d=i.title||i.name,p=i.description||l,m=r(i.thumbnail),h=i.thumbnail||o,b=[{property:"og:title",content:d},{property:"og:url",content:c},{property:"og:site_name",content:t},{property:"og:description",content:p},{property:"og:image:width",content:600},{property:"og:image:height",content:315},{property:"twitter:site",content:n}];return"video/mp4"===u||"video/webm"===u?(b.push({property:"og:video",content:f}),b.push({property:"og:video:secure_url",content:f}),b.push({property:"og:video:type",content:u}),b.push({property:"og:image",content:h}),b.push({property:"og:image:type",content:m}),b.push({property:"og:type",content:"video"}),b.push({property:"twitter:card",content:"player"}),b.push({property:"twitter:player",content:s}),b.push({property:"twitter:player:width",content:600}),b.push({property:"twitter:text:player_width",content:600}),b.push({property:"twitter:player:height",content:337}),b.push({property:"twitter:player:stream",content:f}),b.push({property:"twitter:player:stream:content_type",content:u})):(b.push({property:"og:image",content:f}),b.push({property:"og:image:type",content:u}),b.push({property:"og:type",content:"article"}),b.push({property:"twitter:card",content:"summary_large_image"})),b};t.createMetaTags=function(e,t,n,r,i,u,s,c){return i?o(t,n,r,i,s,c):u?l(t,n,r,u):a(e,t,n,r)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){return t+"/"+e},a=function(e,t){var n=void 0,r=void 0,a=void 0,l=void 0;if(e.claimData){var o=e.claimData;n=o.channelName,r=o.certificateId,a=o.name,l=o.claimId}return n?t+"/"+n+":"+r+"/"+a:t+"/"+l+"/"+a},l=function(e,t){return t+"/"+e.name+":"+e.longId};t.createCanonicalLink=function(e,t,n,o){return e?a(e,o):t?l(t,o):r(n,o)}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(3),f=n(94),d=r(f),p=n(95),m=r(p),h=n(11),b=r(h),g=function(e){function t(e){a(this,t);var n=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.checkForLoggedInUser=n.checkForLoggedInUser.bind(n),n.logoutUser=n.logoutUser.bind(n),n.handleSelection=n.handleSelection.bind(n),n}return o(t,e),i(t,[{key:"componentDidMount",value:function(){this.checkForLoggedInUser()}},{key:"checkForLoggedInUser",value:function(){var e=this,t={credentials:"include"};(0,b.default)("/user",t).then(function(t){var n=t.data;e.props.onChannelLogin(n.channelName,n.shortChannelId,n.channelClaimId)}).catch(function(e){console.log("/user error:",e.message)})}},{key:"logoutUser",value:function(){var e=this,t={credentials:"include"};(0,b.default)("/logout",t).then(function(){e.props.onChannelLogout()}).catch(function(e){console.log("/logout error",e.message)})}},{key:"handleSelection",value:function(e){switch(e.target.selectedOptions[0].value){case"LOGOUT":this.logoutUser();break;case"VIEW":this.props.history.push("/"+this.props.channelName+":"+this.props.channelLongId)}}},{key:"render",value:function(){var e=this.props.siteDescription;return s.default.createElement("div",{className:"row row--wide nav-bar"},s.default.createElement("div",{className:"row row--padded row--short flex-container--row flex-container--space-between-center"},s.default.createElement(d.default,null),s.default.createElement("div",{className:"nav-bar--center"},s.default.createElement("span",{className:"nav-bar-tagline"},e)),s.default.createElement("div",{className:"nav-bar--right"},s.default.createElement(c.NavLink,{className:"nav-bar-link link--nav",activeClassName:"link--nav-active",to:"/",exact:!0},"Publish"),s.default.createElement(c.NavLink,{className:"nav-bar-link link--nav",activeClassName:"link--nav-active",to:"/about"},"About"),this.props.channelName?s.default.createElement(m.default,{channelName:this.props.channelName,handleSelection:this.handleSelection,defaultSelection:this.props.channelName,VIEW:"VIEW",LOGOUT:"LOGOUT"}):s.default.createElement(c.NavLink,{id:"nav-bar-login-link",className:"nav-bar-link link--nav",activeClassName:"link--nav-active",to:"/login"},"Channel"))))}}]),t}(s.default.Component);t.default=(0,c.withRouter)(g)},function(e,t,n){"use strict";function r(){return l.default.createElement("svg",{version:"1.1",id:"Layer_1",x:"0px",y:"0px",height:"24px",viewBox:"0 0 80 31",enableBackground:"new 0 0 80 31",className:"nav-bar-logo"},l.default.createElement(o.Link,{to:"/"},l.default.createElement("title",null,"Logo"),l.default.createElement("desc",null,"Spee.ch logo"),l.default.createElement("g",{id:"About"},l.default.createElement("g",{id:"Publish-Form-V2-_x28_filled_x29_",transform:"translate(-42.000000, -23.000000)"},l.default.createElement("g",{id:"Group-17",transform:"translate(42.000000, 22.000000)"},l.default.createElement("text",{transform:"matrix(1 0 0 1 0 20)",fontSize:"25",fontFamily:"Roboto"},"Spee<h"),l.default.createElement("g",{id:"Group-16",transform:"translate(0.000000, 30.000000)"},l.default.createElement("path",{id:"Line-8",fill:"none",stroke:"#09F911",strokeWidth:"1",strokeLinecap:"square",d:"M0.5,1.5h15"}),l.default.createElement("path",{id:"Line-8-Copy",fill:"none",stroke:"#029D74",strokeWidth:"1",strokeLinecap:"square",d:"M16.5,1.5h15"}),l.default.createElement("path",{id:"Line-8-Copy-2",fill:"none",stroke:"#E35BD8",strokeWidth:"1",strokeLinecap:"square",d:"M32.5,1.5h15"}),l.default.createElement("path",{id:"Line-8-Copy-3",fill:"none",stroke:"#4156C5",strokeWidth:"1",strokeLinecap:"square",d:"M48.5,1.5h15"}),l.default.createElement("path",{id:"Line-8-Copy-4",fill:"none",stroke:"#635688",strokeWidth:"1",strokeLinecap:"square",d:"M64.5,1.5h15"})))))))}Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),l=function(e){return e&&e.__esModule?e:{default:e}}(a),o=n(3);t.default=r},function(e,t,n){"use strict";function r(e){var t=e.channelName,n=e.handleSelection,r=e.defaultSelection,a=e.VIEW,o=e.LOGOUT;return l.default.createElement("select",{type:"text",id:"nav-bar-channel-select",className:"select select--arrow link--nav",onChange:n,value:r},l.default.createElement("option",{id:"nav-bar-channel-select-channel-option"},t),l.default.createElement("option",{value:a},"View"),l.default.createElement("option",{value:o},"Logout"))}Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),l=function(e){return e&&e.__esModule?e:{default:e}}(a);t.default=r},function(e,t){e.exports=require("cross-fetch/polyfill")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(98),l=function(e){return e&&e.__esModule?e:{default:e}}(a),o=function(e){var t=e.publish;return{disabled:t.disabled,file:t.file,status:t.status.status}};t.default=(0,r.connect)(o,null)(l.default)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(40),f=r(c),d=n(102),p=r(d),m=n(120),h=r(m),b=n(123),g=r(b),v=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),i(t,[{key:"render",value:function(){return this.props.disabled?(console.log("publish is disabled"),s.default.createElement(g.default,null)):(console.log("publish is not disabled"),this.props.file?this.props.status?s.default.createElement(h.default,null):s.default.createElement(p.default,null):s.default.createElement(f.default,null))}}]),t}(s.default.Component);t.default=v},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(100),f=n(101),d=r(f),p=function(e){function t(e){a(this,t);var n=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={dragOver:!1,mouseOver:!1,dimPreview:!1},n.handleDrop=n.handleDrop.bind(n),n.handleDragOver=n.handleDragOver.bind(n),n.handleDragEnd=n.handleDragEnd.bind(n),n.handleDragEnter=n.handleDragEnter.bind(n),n.handleDragLeave=n.handleDragLeave.bind(n),n.handleMouseEnter=n.handleMouseEnter.bind(n),n.handleMouseLeave=n.handleMouseLeave.bind(n),n.handleClick=n.handleClick.bind(n),n.handleFileInput=n.handleFileInput.bind(n),n.chooseFile=n.chooseFile.bind(n),n}return o(t,e),i(t,[{key:"handleDrop",value:function(e){e.preventDefault(),this.setState({dragOver:!1});var t=e.dataTransfer;if(t.items&&"file"===t.items[0].kind){var n=t.items[0].getAsFile();this.chooseFile(n)}}},{key:"handleDragOver",value:function(e){e.preventDefault()}},{key:"handleDragEnd",value:function(e){var t=e.dataTransfer;if(t.items)for(var n=0;n<t.items.length;n++)t.items.remove(n);else e.dataTransfer.clearData()}},{key:"handleDragEnter",value:function(){this.setState({dragOver:!0,dimPreview:!0})}},{key:"handleDragLeave",value:function(){this.setState({dragOver:!1,dimPreview:!1})}},{key:"handleMouseEnter",value:function(){this.setState({mouseOver:!0,dimPreview:!0})}},{key:"handleMouseLeave",value:function(){this.setState({mouseOver:!1,dimPreview:!1})}},{key:"handleClick",value:function(e){e.preventDefault(),document.getElementById("file_input").click()}},{key:"handleFileInput",value:function(e){e.preventDefault();var t=e.target.files;this.chooseFile(t[0])}},{key:"chooseFile",value:function(e){if(e){try{(0,c.validateFile)(e)}catch(e){return this.props.setFileError(e.message)}this.props.selectFile(e)}}},{key:"render",value:function(){return s.default.createElement("div",{className:"row row--tall flex-container--column"},s.default.createElement("form",null,s.default.createElement("input",{className:"input-file",type:"file",id:"file_input",name:"file_input",accept:"video/*,image/*",onChange:this.handleFileInput,encType:"multipart/form-data"})),s.default.createElement("div",{id:"preview-dropzone",className:"row row--padded row--tall dropzone"+(this.state.dragOver?" dropzone--drag-over":""),onDrop:this.handleDrop,onDragOver:this.handleDragOver,onDragEnd:this.handleDragEnd,onDragEnter:this.handleDragEnter,onDragLeave:this.handleDragLeave,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onClick:this.handleClick},this.props.file?s.default.createElement("div",null,s.default.createElement(d.default,{dimPreview:this.state.dimPreview,file:this.props.file,thumbnail:this.props.thumbnail}),s.default.createElement("div",{id:"dropzone-text-holder",className:"flex-container--column flex-container--center-center"},this.state.dragOver?s.default.createElement("div",{id:"dropzone-dragover"},s.default.createElement("p",{className:"blue"},"Drop it.")):null,this.state.mouseOver?s.default.createElement("div",{id:"dropzone-instructions"},s.default.createElement("p",{className:"info-message-placeholder info-message--failure",id:"input-error-file-selection"},this.props.fileError),s.default.createElement("p",null,"Drag & drop image or video here to publish"),s.default.createElement("p",{className:"fine-print"},"OR"),s.default.createElement("p",{className:"blue--underlined"},"CHOOSE FILE")):null)):s.default.createElement("div",{id:"dropzone-text-holder",className:"flex-container--column flex-container--center-center"},this.state.dragOver?s.default.createElement("div",{id:"dropzone-dragover"},s.default.createElement("p",{className:"blue"},"Drop it.")):s.default.createElement("div",{id:"dropzone-instructions"},s.default.createElement("p",{className:"info-message-placeholder info-message--failure",id:"input-error-file-selection"},this.props.fileError),s.default.createElement("p",null,"Drag & drop image or video here to publish"),s.default.createElement("p",{className:"fine-print"},"OR"),s.default.createElement("p",{className:"blue--underlined"},"CHOOSE FILE")))))}}]),t}(s.default.Component);t.default=p},function(e,t,n){"use strict";e.exports={validateFile:function(e){if(!e)throw new Error("no file provided");if(/'/.test(e.name))throw new Error("apostrophes are not allowed in the file name");switch(e.type){case"image/jpeg":case"image/jpg":case"image/png":if(e.size>1e7)throw new Error("Sorry, images are limited to 10 megabytes.");break;case"image/gif":if(e.size>5e7)throw new Error("Sorry, GIFs are limited to 50 megabytes.");break;case"video/mp4":if(e.size>5e7)throw new Error("Sorry, videos are limited to 50 megabytes.");break;default:throw new Error(e.type+" is not a supported file type. Only, .jpeg, .png, .gif, and .mp4 files are currently supported.")}}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(10),f=r(c),d=function(e){function t(e){a(this,t);var n=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={imgSource:"",defaultThumbnail:"/assets/img/video_thumb_default.png"},n}return o(t,e),i(t,[{key:"componentDidMount",value:function(){this.setPreviewImageSource(this.props.file)}},{key:"componentWillReceiveProps",value:function(e){e.file!==this.props.file&&this.setPreviewImageSource(e.file),e.thumbnail!==this.props.thumbnail&&(e.thumbnail?this.setPreviewImageSourceFromFile(e.thumbnail):this.setState({imgSource:this.state.defaultThumbnail}))}},{key:"setPreviewImageSourceFromFile",value:function(e){var t=this,n=new FileReader;n.readAsDataURL(e),n.onloadend=function(){t.setState({imgSource:n.result})}}},{key:"setPreviewImageSource",value:function(e){"video/mp4"!==e.type?this.setPreviewImageSourceFromFile(e):(this.props.thumbnail&&this.setPreviewImageSourceFromFile(this.props.thumbnail),this.setState({imgSource:this.state.defaultThumbnail}))}},{key:"render",value:function(){return s.default.createElement("img",{id:"dropzone-preview",src:this.state.imgSource,className:this.props.dimPreview?"dim":"",alt:"publish preview"})}}]),t}(s.default.Component);d.propTypes={dimPreview:f.default.bool.isRequired,file:f.default.object.isRequired,thumbnail:f.default.object},t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(4),l=n(103),o=function(e){return e&&e.__esModule?e:{default:e}}(l),i=function(e){e.channel;return{file:e.publish.file}},u={clearFile:a.clearFile,startPublish:a.startPublish};t.default=(0,r.connect)(i,u)(o.default)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(3),f=n(40),d=r(f),p=n(104),m=r(p),h=n(106),b=r(h),g=n(109),v=r(g),y=n(111),E=r(y),w=n(114),_=r(w),C=function(e){function t(e){a(this,t);var n=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onPublishSubmit=n.onPublishSubmit.bind(n),n}return o(t,e),i(t,[{key:"onPublishSubmit",value:function(){this.props.startPublish(this.props.history)}},{key:"render",value:function(){return s.default.createElement("div",{className:"row row--no-bottom"},s.default.createElement("div",{className:"column column--10"},s.default.createElement(m.default,null)),s.default.createElement("div",{className:"column column--5 column--sml-10"},s.default.createElement("div",{className:"row row--padded"},s.default.createElement(d.default,null))),s.default.createElement("div",{className:"column column--5 column--sml-10 align-content-top"},s.default.createElement("div",{id:"publish-active-area",className:"row row--padded"},s.default.createElement("div",{className:"row row--padded row--no-top row--wide"},s.default.createElement(b.default,null)),s.default.createElement("div",{className:"row row--padded row--no-top row--wide"},s.default.createElement(_.default,null)),"video/mp4"===this.props.file.type&&s.default.createElement("div",{className:"row row--padded row--no-top row--wide "},s.default.createElement(v.default,null)),s.default.createElement("div",{className:"row row--padded row--no-top row--no-bottom row--wide"},s.default.createElement(E.default,null)),s.default.createElement("div",{className:"row row--wide align-content-center"},s.default.createElement("button",{id:"publish-submit",className:"button--primary button--large",onClick:this.onPublishSubmit},"Publish")),s.default.createElement("div",{className:"row row--padded row--no-bottom align-content-center"},s.default.createElement("button",{className:"button--cancel",onClick:this.props.clearFile},"Cancel")),s.default.createElement("div",{className:"row row--short align-content-center"},s.default.createElement("p",{className:"fine-print"},"By clicking 'Publish', you affirm that you have the rights to publish this content to the LBRY network, and that you understand the properties of publishing it to a decentralized, user-controlled network. ",s.default.createElement("a",{className:"link--primary",target:"_blank",href:"https://lbry.io/learn"},"Read more."))))))}}]),t}(s.default.Component);t.default=(0,c.withRouter)(C)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(4),l=n(105),o=function(e){return e&&e.__esModule?e:{default:e}}(l),i=function(e){return{title:e.publish.metadata.title}},u=function(e){return{onMetadataChange:function(t,n){e((0,a.updateMetadata)(t,n))}}};t.default=(0,r.connect)(i,u)(o.default)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),u=function(e){return e&&e.__esModule?e:{default:e}}(i),s=function(e){function t(e){r(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.handleInput=n.handleInput.bind(n),n}return l(t,e),o(t,[{key:"handleInput",value:function(e){var t=e.target.name,n=e.target.value;this.props.onMetadataChange(t,n)}},{key:"render",value:function(){return u.default.createElement("input",{type:"text",id:"publish-title",className:"input-text text--large input-text--full-width",name:"title",placeholder:"Give your post a title...",onChange:this.handleInput,value:this.props.title})}}]),t}(u.default.Component);t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),a=n(1),l=n(107),o=function(e){return e&&e.__esModule?e:{default:e}}(l),i=function(e){var t=e.channel,n=e.publish;return{loggedInChannelName:t.loggedInChannel.name,loggedInChannelShortId:t.loggedInChannel.shortId,fileName:n.file.name,publishInChannel:n.publishInChannel,selectedChannel:n.selectedChannel,claim:n.claim,urlError:n.error.url}},u=function(e){return{onClaimChange:function(t){e((0,r.updateClaim)(t)),e((0,r.updateError)("publishSubmit",null))},onUrlError:function(t){e((0,r.updateError)("url",t))}}};t.default=(0,a.connect)(i,u)(o.default)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(11),f=r(c),d=n(108),p=r(d),m=function(e){function t(e){a(this,t);var n=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.handleInput=n.handleInput.bind(n),n}return o(t,e),i(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.claim,n=e.fileName;t||this.setClaimName(n)}},{key:"componentWillReceiveProps",value:function(e){var t=e.claim,n=e.fileName;if(n!==this.props.fileName)return this.setClaimName(n);t!==this.props.claim&&this.validateClaim(t)}},{key:"handleInput",value:function(e){var t=e.target.value;t=this.cleanseInput(t),this.props.onClaimChange(t)}},{key:"cleanseInput",value:function(e){return e=e.replace(/\s+/g,"-"),e=e.replace(/[^A-Za-z0-9-]/g,"")}},{key:"setClaimName",value:function(e){var t=e.substring(0,e.lastIndexOf(".")),n=this.cleanseInput(t);this.props.onClaimChange(n)}},{key:"validateClaim",value:function(e){var t=this;if(!e)return this.props.onUrlError("Enter a url above");(0,f.default)("/api/claim/availability/"+e).then(function(){t.props.onUrlError(null)}).catch(function(e){t.props.onUrlError(e.message)})}},{key:"render",value:function(){var e=this.props,t=e.claim,n=e.loggedInChannelName,r=e.loggedInChannelShortId,a=e.publishInChannel,l=e.selectedChannel,o=e.urlError;return s.default.createElement("div",{className:"column column--10 column--sml-10"},s.default.createElement("div",{className:"input-text--primary span--relative"},s.default.createElement("span",{className:"url-text--secondary"},"spee.ch / "),s.default.createElement(p.default,{publishInChannel:a,selectedChannel:l,loggedInChannelName:n,loggedInChannelShortId:r}),s.default.createElement("input",{type:"text",id:"claim-name-input",className:"input-text",name:"claim",placeholder:"your-url-here",onChange:this.handleInput,value:t}),t&&!o&&s.default.createElement("span",{id:"input-success-claim-name",className:"info-message--success span--absolute"},"✓"),o&&s.default.createElement("span",{id:"input-success-channel-name",className:"info-message--failure span--absolute"},"✖")),s.default.createElement("div",null,o?s.default.createElement("p",{id:"input-error-claim-name",className:"info-message--failure"},o):s.default.createElement("p",{className:"info-message"},"Choose a custom url")))}}]),t}(s.default.Component);t.default=m},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e){var t=e.publishInChannel,n=e.selectedChannel,r=e.loggedInChannelName,a=e.loggedInChannelShortId;return t?n===r?o.default.createElement("span",{id:"url-channel",className:"url-text--secondary"},r,":",a," /"):o.default.createElement("span",{id:"url-channel-placeholder",className:"url-text--secondary tooltip"},"@channel",o.default.createElement("span",{className:"tooltip-text"},"Select a channel below")," /"):o.default.createElement("span",{id:"url-no-channel-placeholder",className:"url-text--secondary tooltip"},"xyz",o.default.createElement("span",{className:"tooltip-text"},"This will be a random id")," /")}Object.defineProperty(t,"__esModule",{value:!0});var l=n(0),o=r(l),i=n(10),u=r(i);a.propTypes={publishInChannel:u.default.bool.isRequired,loggedInChannelName:u.default.string,loggedInChannelShortId:u.default.string},t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(4),l=n(110),o=function(e){return e&&e.__esModule?e:{default:e}}(l),i=function(e){return{file:e.publish.file}},u={onNewThumbnail:a.onNewThumbnail};t.default=(0,r.connect)(i,u)(o.default)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e){for(var t=atob(e.split(",")[1]),n=e.split(",")[0].split(":")[1].split(";")[0],r=new Uint8Array(t.length),a=0;a<t.length;a++)r[a]=t.charCodeAt(a);return new Blob([r],{type:n})}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){r(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={videoSource:null,error:null,sliderMinRange:1,sliderMaxRange:null,sliderValue:null},n.handleVideoLoadedData=n.handleVideoLoadedData.bind(n),n.handleSliderChange=n.handleSliderChange.bind(n),n.createThumbnail=n.createThumbnail.bind(n),n}return l(t,e),i(t,[{key:"componentDidMount",value:function(){var e=this.props.file;this.setVideoSource(e)}},{key:"componentWillReceiveProps",value:function(e){if(e.file&&e.file!==this.props.file){var t=e.file;this.setVideoSource(t)}}},{key:"setVideoSource",value:function(e){var t=this,n=new FileReader;n.readAsDataURL(e),n.onloadend=function(){var e=n.result,r=o(e),a=URL.createObjectURL(r);t.setState({videoSource:a})}}},{key:"handleVideoLoadedData",value:function(e){var t=e.target.duration,n=Math.floor(t/60),r=Math.floor(t%60);this.setState({sliderMaxRange:100*t,sliderValue:100*t/2,totalMinutes:n,totalSeconds:r}),document.getElementById("video-thumb-player").currentTime=t/2}},{key:"handleSliderChange",value:function(e){var t=parseInt(e.target.value);this.setState({sliderValue:t}),document.getElementById("video-thumb-player").currentTime=t/100}},{key:"createThumbnail",value:function(){var e=document.getElementById("video-thumb-player"),t=document.createElement("canvas");t.width=e.videoWidth,t.height=e.videoHeight,t.getContext("2d").drawImage(e,0,0,t.width,t.height);var n=t.toDataURL(),r=o(n),a=new File([r],"thumbnail.png",{type:"image/png"});a&&this.props.onNewThumbnail(a)}},{key:"render",value:function(){var e=this.state,t=e.error,n=e.videoSource,r=e.sliderMinRange,a=e.sliderMaxRange,l=e.sliderValue,o=e.totalMinutes,i=e.totalSeconds;return s.default.createElement("div",null,s.default.createElement("label",{className:"label"},"Thumbnail:"),s.default.createElement("video",{id:"video-thumb-player",preload:"metadata",muted:!0,style:{display:"none"},playsInline:!0,onLoadedData:this.handleVideoLoadedData,src:n,onSeeked:this.createThumbnail}),l?s.default.createElement("div",null,s.default.createElement("div",{className:"flex-container--row flex-container--space-between-center",style:{width:"100%"}},s.default.createElement("span",{className:"info-message"},"0'00\""),s.default.createElement("span",{className:"info-message"},o,"'",i,'"')),s.default.createElement("div",null,s.default.createElement("input",{type:"range",min:r,max:a,value:l,className:"slider",onChange:this.handleSliderChange}))):s.default.createElement("p",{className:"info-message"},"loading... "),t?s.default.createElement("p",{className:"info-message--failure"},t):s.default.createElement("p",{className:"info-message"},"Use slider to set thumbnail"))}}]),t}(s.default.Component);t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(4),l=n(112),o=function(e){return e&&e.__esModule?e:{default:e}}(l),i=function(e){var t=e.publish;return{showMetadataInputs:t.showMetadataInputs,description:t.metadata.description,license:t.metadata.license,nsfw:t.metadata.nsfw}},u=function(e){return{onMetadataChange:function(t,n){e((0,a.updateMetadata)(t,n))},onToggleMetadataInputs:function(t){e((0,a.toggleMetadataInputs)(t))}}};t.default=(0,r.connect)(i,u)(o.default)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(113),f=r(c),d=function(e){function t(e){a(this,t);var n=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.toggleShowInputs=n.toggleShowInputs.bind(n),n.handleInput=n.handleInput.bind(n),n.handleSelect=n.handleSelect.bind(n),n}return o(t,e),i(t,[{key:"toggleShowInputs",value:function(){this.props.onToggleMetadataInputs(!this.props.showMetadataInputs)}},{key:"handleInput",value:function(e){var t=e.target,n="checkbox"===t.type?t.checked:t.value,r=t.name;this.props.onMetadataChange(r,n)}},{key:"handleSelect",value:function(e){var t=e.target.name,n=e.target.selectedOptions[0].value;this.props.onMetadataChange(t,n)}},{key:"render",value:function(){return s.default.createElement("div",{id:"publish-details",className:"row row--padded row--no-top row--wide"},this.props.showMetadataInputs&&s.default.createElement("div",null,s.default.createElement("div",{className:"row row--no-top"},s.default.createElement("div",{className:"column column--3 column--med-10 align-content-top"},s.default.createElement("label",{htmlFor:"publish-license",className:"label"},"Description:")),s.default.createElement("div",{className:"column column--7 column--sml-10"},s.default.createElement(f.default,{id:"publish-description",className:"textarea textarea--primary textarea--full-width",rows:1,maxLength:2e3,style:{maxHeight:200},name:"description",placeholder:"Optional description",value:this.props.description,onChange:this.handleInput}))),s.default.createElement("div",{className:"row row--no-top"},s.default.createElement("div",{className:"column column--3 column--med-10"},s.default.createElement("label",{htmlFor:"publish-license",className:"label"},"License:")),s.default.createElement("div",{className:"column column--7 column--sml-10"},s.default.createElement("select",{type:"text",name:"license",id:"publish-license",className:"select select--primary",onChange:this.handleSelect},s.default.createElement("option",{value:" "},"Unspecified"),s.default.createElement("option",{value:"Public Domain"},"Public Domain"),s.default.createElement("option",{value:"Creative Commons"},"Creative Commons")))),s.default.createElement("div",{className:"row row--no-top"},s.default.createElement("div",{className:"column column--3"},s.default.createElement("label",{htmlFor:"publish-nsfw",className:"label"},"Mature:")),s.default.createElement("div",{className:"column column--7"},s.default.createElement("input",{className:"input-checkbox",type:"checkbox",id:"publish-nsfw",name:"nsfw",value:this.props.nsfw,onChange:this.handleInput})))),s.default.createElement("button",{className:"button--secondary",onClick:this.toggleShowInputs},this.props.showMetadataInputs?"less":"more"))}}]),t}(s.default.Component);t.default=d},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=r(c),d=n(10),p=r(d),m=function(e){function t(e){l(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n._handleChange=n._handleChange.bind(n),n}return i(t,e),s(t,[{key:"componentDidMount",value:function(){this.adjustTextarea({})}},{key:"_handleChange",value:function(e){var t=this.props.onChange;t&&t(e),this.adjustTextarea(e)}},{key:"adjustTextarea",value:function(e){var t=e.target,n=void 0===t?this.el:t;n.style.height=0,n.style.height=n.scrollHeight+"px"}},{key:"render",value:function(){var e=this,t=a(this.props,[]);return f.default.createElement("textarea",u({},t,{ref:function(t){return e.el=t},onChange:this._handleChange}))}}]),t}(c.Component);m.propTypes={onChange:p.default.func},t.default=m},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(4),l=n(115),o=function(e){return e&&e.__esModule?e:{default:e}}(l),i=function(e){var t=e.channel,n=e.publish;return{loggedInChannelName:t.loggedInChannel.name,publishInChannel:n.publishInChannel,selectedChannel:n.selectedChannel,channelError:n.error.channel}},u=function(e){return{onPublishInChannelChange:function(t){e((0,a.updateError)("channel",null)),e((0,a.setPublishInChannel)(t))},onChannelSelect:function(t){e((0,a.updateError)("channel",null)),e((0,a.updateSelectedChannel)(t))}}};t.default=(0,r.connect)(i,u)(o.default)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(41),f=r(c),d=n(42),p=r(d),m=n(35),h=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(m),b=function(e){function t(e){a(this,t);var n=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.toggleAnonymousPublish=n.toggleAnonymousPublish.bind(n),n.handleSelection=n.handleSelection.bind(n),n}return o(t,e),i(t,[{key:"toggleAnonymousPublish",value:function(e){"anonymous"===e.target.value?this.props.onPublishInChannelChange(!1):this.props.onPublishInChannelChange(!0)}},{key:"handleSelection",value:function(e){var t=e.target.selectedOptions[0].value;this.props.onChannelSelect(t)}},{key:"render",value:function(){return s.default.createElement("div",null,s.default.createElement("form",null,s.default.createElement("div",{className:"column column--3 column--med-10"},s.default.createElement("input",{type:"radio",name:"anonymous-or-channel",id:"anonymous-radio",className:"input-radio",value:"anonymous",checked:!this.props.publishInChannel,onChange:this.toggleAnonymousPublish}),s.default.createElement("label",{className:"label label--pointer",htmlFor:"anonymous-radio"},"Anonymous")),s.default.createElement("div",{className:"column column--7 column--med-10"},s.default.createElement("input",{type:"radio",name:"anonymous-or-channel",id:"channel-radio",className:"input-radio",value:"in a channel",checked:this.props.publishInChannel,onChange:this.toggleAnonymousPublish}),s.default.createElement("label",{className:"label label--pointer",htmlFor:"channel-radio"},"In a channel")),this.props.channelError?s.default.createElement("p",{className:"info-message--failure"},this.props.channelError):s.default.createElement("p",{className:"info-message"},"Publish anonymously or in a channel")),this.props.publishInChannel&&s.default.createElement("div",null,s.default.createElement("div",{className:"column column--3"},s.default.createElement("label",{className:"label",htmlFor:"channel-name-select"},"Channel:")),s.default.createElement("div",{className:"column column--7"},s.default.createElement("select",{type:"text",id:"channel-name-select",className:"select select--arrow",value:this.props.selectedChannel,onChange:this.handleSelection},this.props.loggedInChannelName&&s.default.createElement("option",{value:this.props.loggedInChannelName,id:"publish-channel-select-channel-option"},this.props.loggedInChannelName),s.default.createElement("option",{value:h.LOGIN},"Existing"),s.default.createElement("option",{value:h.CREATE},"New"))),this.props.selectedChannel===h.LOGIN&&s.default.createElement(f.default,null),this.props.selectedChannel===h.CREATE&&s.default.createElement(p.default,null)))}}]),t}(s.default.Component);t.default=b},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),c=r(s),f=n(11),d=r(f),p=function(e){function t(e){l(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={error:null,name:"",password:""},n.handleInput=n.handleInput.bind(n),n.loginToChannel=n.loginToChannel.bind(n),n}return i(t,e),u(t,[{key:"handleInput",value:function(e){var t=e.target.name,n=e.target.value;this.setState(a({},t,n))}},{key:"loginToChannel",value:function(e){var t=this;e.preventDefault();var n={method:"POST",body:JSON.stringify({username:this.state.name,password:this.state.password}),headers:new Headers({"Content-Type":"application/json"}),credentials:"include"};(0,d.default)("login",n).then(function(e){var n=e.success,r=e.channelName,a=e.shortChannelId,l=e.channelClaimId,o=e.message;n?t.props.onChannelLogin(r,a,l):t.setState({error:o})}).catch(function(e){e.message?t.setState({error:e.message}):t.setState({error:e})})}},{key:"render",value:function(){return c.default.createElement("form",{id:"channel-login-form"},c.default.createElement("div",{className:"row row--wide row--short"},c.default.createElement("div",{className:"column column--3 column--sml-10"},c.default.createElement("label",{className:"label",htmlFor:"channel-login-name-input"},"Name:")),c.default.createElement("div",{className:"column column--6 column--sml-10"},c.default.createElement("div",{className:"input-text--primary flex-container--row flex-container--left-bottom"},c.default.createElement("span",null,"@"),c.default.createElement("input",{type:"text",id:"channel-login-name-input",className:"input-text",name:"name",placeholder:"Your Channel Name",value:this.state.channelName,onChange:this.handleInput})))),c.default.createElement("div",{className:"row row--wide row--short"},c.default.createElement("div",{className:"column column--3 column--sml-10"},c.default.createElement("label",{className:"label",htmlFor:"channel-login-password-input"},"Password:")),c.default.createElement("div",{className:"column column--6 column--sml-10"},c.default.createElement("div",{className:"input-text--primary"},c.default.createElement("input",{type:"password",id:"channel-login-password-input",name:"password",className:"input-text",placeholder:"",value:this.state.channelPassword,onChange:this.handleInput})))),this.state.error?c.default.createElement("p",{className:"info-message--failure"},this.state.error):c.default.createElement("p",{className:"info-message"},"Enter the name and password for your channel"),c.default.createElement("div",{className:"row row--wide"},c.default.createElement("button",{className:"button--primary",onClick:this.loginToChannel},"Authenticate")))}}]),t}(c.default.Component);t.default=p},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),c=r(s),f=n(20),d=r(f),p=n(11),m=r(p),h=function(e){function t(e){l(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={error:null,channel:"",password:"",status:null},n.handleChannelInput=n.handleChannelInput.bind(n),n.handleInput=n.handleInput.bind(n),n.createChannel=n.createChannel.bind(n),n}return i(t,e),u(t,[{key:"cleanseChannelInput",value:function(e){return e=e.replace(/\s+/g,"-"),e=e.replace(/[^A-Za-z0-9-]/g,"")}},{key:"handleChannelInput",value:function(e){var t=e.target.value;t=this.cleanseChannelInput(t),this.setState({channel:t}),t?this.updateIsChannelAvailable(t):this.setState({error:"Please enter a channel name"})}},{key:"handleInput",value:function(e){var t=e.target.name,n=e.target.value;this.setState(a({},t,n))}},{key:"updateIsChannelAvailable",value:function(e){var t=this,n="@"+e;(0,m.default)("/api/channel/availability/"+n).then(function(){t.setState({error:null})}).catch(function(e){t.setState({error:e.message})})}},{key:"checkIsChannelAvailable",value:function(e){var t="@"+e;return(0,m.default)("/api/channel/availability/"+t)}},{key:"checkIsPasswordProvided",value:function(e){return new Promise(function(t,n){if(!e||e.length<1)return n(new Error("Please provide a password"));t()})}},{key:"makePublishChannelRequest",value:function(e,t){var n={method:"POST",body:JSON.stringify({username:e,password:t}),headers:new Headers({"Content-Type":"application/json"}),credentials:"include"};return new Promise(function(e,t){(0,m.default)("/signup",n).then(function(t){return e(t)}).catch(function(e){t(new Error("Unfortunately, we encountered an error while creating your channel. Please let us know in Discord! "+e.message))})})}},{key:"createChannel",value:function(e){var t=this;e.preventDefault(),this.checkIsPasswordProvided(this.state.password).then(function(){return t.checkIsChannelAvailable(t.state.channel)}).then(function(){return t.setState({status:"We are publishing your new channel. Sit tight..."}),t.makePublishChannelRequest(t.state.channel,t.state.password)}).then(function(e){t.setState({status:null}),t.props.onChannelLogin(e.channelName,e.shortChannelId,e.channelClaimId)}).catch(function(e){e.message?t.setState({error:e.message,status:null}):t.setState({error:e,status:null})})}},{key:"render",value:function(){return c.default.createElement("div",null,this.state.status?c.default.createElement("div",null,c.default.createElement("p",{className:"fine-print"},this.state.status),c.default.createElement(d.default,{size:12})):c.default.createElement("form",{id:"publish-channel-form"},c.default.createElement("div",{className:"row row--wide row--short"},c.default.createElement("div",{className:"column column--3 column--sml-10"},c.default.createElement("label",{className:"label",htmlFor:"new-channel-name"},"Name:")),c.default.createElement("div",{className:"column column--6 column--sml-10"},c.default.createElement("div",{className:"input-text--primary flex-container--row flex-container--left-bottom span--relative"},c.default.createElement("span",null,"@"),c.default.createElement("input",{type:"text",name:"channel",id:"new-channel-name",className:"input-text",placeholder:"exampleChannelName",value:this.state.channel,onChange:this.handleChannelInput}),this.state.channel&&!this.state.error&&c.default.createElement("span",{id:"input-success-channel-name",className:"info-message--success span--absolute"},"✓"),this.state.error&&c.default.createElement("span",{id:"input-success-channel-name",className:"info-message--failure span--absolute"},"✖")))),c.default.createElement("div",{className:"row row--wide row--short"},c.default.createElement("div",{className:"column column--3 column--sml-10"},c.default.createElement("label",{className:"label",htmlFor:"new-channel-password"},"Password:")),c.default.createElement("div",{className:"column column--6 column--sml-10"},c.default.createElement("div",{className:"input-text--primary"},c.default.createElement("input",{type:"password",name:"password",id:"new-channel-password",className:"input-text",placeholder:"",value:this.state.password,onChange:this.handleInput})))),this.state.error?c.default.createElement("p",{className:"info-message--failure"},this.state.error):c.default.createElement("p",{className:"info-message"},"Choose a name and password for your channel"),c.default.createElement("div",{className:"row row--wide"},c.default.createElement("button",{className:"button--primary",onClick:this.createChannel},"Create Channel"))))}}]),t}(c.default.Component);t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),a=function(e){return e&&e.__esModule?e:{default:e}}(r),l=function(){return a.default.createElement("span",{className:"progress-bar progress-bar--active"},"| ")};t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),a=function(e){return e&&e.__esModule?e:{default:e}}(r),l=function(){return a.default.createElement("span",{className:"progress-bar progress-bar--inactive"},"| ")};t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(4),l=n(121),o=function(e){return e&&e.__esModule?e:{default:e}}(l),i=function(e){var t=e.publish;return{status:t.status.status,message:t.status.message}},u={clearFile:a.clearFile};t.default=(0,r.connect)(i,u)(o.default)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(20),f=r(c),d=n(122),p=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(d),m=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),i(t,[{key:"render",value:function(){var e=this.props,t=e.status,n=e.message,r=e.clearFile;return s.default.createElement("div",{className:"row row--tall flex-container--column flex-container--center-center"},t===p.LOAD_START&&s.default.createElement("div",{className:"row align-content-center"},s.default.createElement("p",null,"File is loading to server"),s.default.createElement("p",{className:"blue"},"0%")),t===p.LOADING&&s.default.createElement("div",null,s.default.createElement("div",{className:"row align-content-center"},s.default.createElement("p",null,"File is loading to server"),s.default.createElement("p",{className:"blue"},n))),t===p.PUBLISHING&&s.default.createElement("div",{className:"row align-content-center"},s.default.createElement("p",null,"Upload complete. Your file is now being published on the blockchain..."),s.default.createElement(f.default,{size:12}),s.default.createElement("p",null,"Curious what magic is happening here? ",s.default.createElement("a",{className:"link--primary",target:"blank",href:"https://lbry.io/faq/what-is-lbry"},"Learn more."))),t===p.SUCCESS&&s.default.createElement("div",{className:"row align-content-center"},s.default.createElement("p",null,"Your publish is complete! You are being redirected to it now."),s.default.createElement("p",null,"If you are not automatically redirected, ",s.default.createElement("a",{className:"link--primary",target:"_blank",href:n},"click here."))),t===p.FAILED&&s.default.createElement("div",{className:"row align-content-center"},s.default.createElement("p",null,"Something went wrong..."),s.default.createElement("p",null,s.default.createElement("strong",null,n)),s.default.createElement("p",null,"For help, post the above error text in the #speech channel on the ",s.default.createElement("a",{className:"link--primary",href:"https://discord.gg/YjYbwhS",target:"_blank"},"lbry discord")),s.default.createElement("button",{className:"button--secondary",onClick:r},"Reset")))}}]),t}(s.default.Component);t.default=m},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.LOAD_START="LOAD_START",t.LOADING="LOADING",t.PUBLISHING="PUBLISHING",t.SUCCESS="SUCCESS",t.FAILED="FAILED"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(124),l=function(e){return e&&e.__esModule?e:{default:e}}(a),o=function(e){return{message:e.publish.disabledMessage}};t.default=(0,r.connect)(o,null)(l.default)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),u=function(e){return e&&e.__esModule?e:{default:e}}(i),s=function(e){function t(){return r(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return l(t,e),o(t,[{key:"render",value:function(){var e=this.props.message;return console.log("this.props.message:",e),u.default.createElement("div",{className:"row dropzone--disabled row--tall flex-container--column flex-container--center-center"},u.default.createElement("p",{className:"text--disabled"},"Publishing is currently disabled."),u.default.createElement("p",{className:"text--disabled"},e))}}]),t}(u.default.Component);t.default=s},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(7),f=r(c),d=n(9),p=r(d),m=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),i(t,[{key:"render",value:function(){return s.default.createElement("div",null,s.default.createElement(p.default,{pageTitle:"About",pageUri:"about"}),s.default.createElement(f.default,null),s.default.createElement("div",{className:"row row--padded"},s.default.createElement("div",{className:"column column--5 column--med-10 align-content-top"},s.default.createElement("div",{className:"column column--8 column--med-10"},s.default.createElement("p",{className:"pull-quote"},"Spee.ch is an open-source project. Please contribute to the existing site, or fork it and make your own."),s.default.createElement("p",null,s.default.createElement("a",{className:"link--primary",target:"_blank",href:"https://twitter.com/spee_ch"},"TWITTER")),s.default.createElement("p",null,s.default.createElement("a",{className:"link--primary",target:"_blank",href:"https://github.com/lbryio/spee.ch"},"GITHUB")),s.default.createElement("p",null,s.default.createElement("a",{className:"link--primary",target:"_blank",href:"https://discord.gg/YjYbwhS"},"DISCORD CHANNEL")),s.default.createElement("p",null,s.default.createElement("a",{className:"link--primary",target:"_blank",href:"https://github.com/lbryio/spee.ch/blob/master/README.md"},"DOCUMENTATION")))),s.default.createElement("div",{className:"column column--5 column--med-10 align-content-top"},s.default.createElement("div",{className:"column column--8 column--med-10"},s.default.createElement("p",null,"Spee.ch is a media-hosting site that reads from and publishes content to the ",s.default.createElement("a",{className:"link--primary",href:"https://lbry.io"},"LBRY")," blockchain."),s.default.createElement("p",null,"Spee.ch is a hosting service, but with the added benefit that it stores your content on a decentralized network of computers -- the ",s.default.createElement("a",{className:"link--primary",href:"https://lbry.io/get"},"LBRY")," network. This means that your images are stored in multiple locations without a single point of failure."),s.default.createElement("h3",null,"Contribute"),s.default.createElement("p",null,"If you have an idea for your own spee.ch-like site on top of LBRY, fork our ",s.default.createElement("a",{className:"link--primary",href:"https://github.com/lbryio/spee.ch"},"github repo")," and go to town!"),s.default.createElement("p",null,"If you want to improve spee.ch, join our ",s.default.createElement("a",{className:"link--primary",href:"https://discord.gg/YjYbwhS"},"discord channel")," or solve one of our ",s.default.createElement("a",{className:"link--primary",href:"https://github.com/lbryio/spee.ch/issues"},"github issues"),".")))))}}]),t}(s.default.Component);t.default=m},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(127),l=function(e){return e&&e.__esModule?e:{default:e}}(a),o=function(e){return{loggedInChannelName:e.channel.loggedInChannel.name}};t.default=(0,r.connect)(o,null)(l.default)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(3),f=n(9),d=r(f),p=n(7),m=r(p),h=n(41),b=r(h),g=n(42),v=r(g),y=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),i(t,[{key:"componentWillReceiveProps",value:function(e){e.loggedInChannelName!==this.props.loggedInChannelName&&this.props.history.push("/")}},{key:"render",value:function(){return s.default.createElement("div",null,s.default.createElement(d.default,{pageTitle:"Login",pageUri:"login"}),s.default.createElement(m.default,null),s.default.createElement("div",{className:"row row--padded"},s.default.createElement("div",{className:"column column--5 column--med-10 align-content-top"},s.default.createElement("div",{className:"column column--8 column--med-10"},s.default.createElement("p",null,"Channels allow you to publish and group content under an identity. You can create a channel for yourself, or share one with like-minded friends. You can create 1 channel, or 100, so whether you're ",s.default.createElement("a",{className:"link--primary",target:"_blank",href:"/@catalonia2017:43dcf47163caa21d8404d9fe9b30f78ef3e146a8"},"documenting important events"),", or making a public repository for ",s.default.createElement("a",{className:"link--primary",target:"_blank",href:"/@catGifs"},"cat gifs")," (password: '1234'), try creating a channel for it!"))),s.default.createElement("div",{className:"column column--5 column--med-10 align-content-top"},s.default.createElement("div",{className:"column column--8 column--med-10"},s.default.createElement("h3",{className:"h3--no-bottom"},"Log in to an existing channel:"),s.default.createElement(b.default,null),s.default.createElement("h3",{className:"h3--no-bottom"},"Create a brand new channel:"),s.default.createElement(v.default,null)))))}}]),t}(s.default.Component);t.default=(0,c.withRouter)(y)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(8),l=n(129),o=function(e){return e&&e.__esModule?e:{default:e}}(l),i=function(e){var t=e.show;return{error:t.request.error,requestType:t.request.type}},u={onHandleShowPageUri:a.onHandleShowPageUri};t.default=(0,r.connect)(i,u)(o.default)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(21),f=r(c),d=n(130),p=r(d),m=n(133),h=r(m),b=n(139),g=r(b),v=n(43),y=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),i(t,[{key:"componentDidMount",value:function(){this.props.onHandleShowPageUri(this.props.match.params)}},{key:"componentWillReceiveProps",value:function(e){e.match.params!==this.props.match.params&&this.props.onHandleShowPageUri(e.match.params)}},{key:"render",value:function(){var e=this.props,t=e.error,n=e.requestType;if(t)return s.default.createElement(f.default,{error:t});switch(n){case v.CHANNEL:return s.default.createElement(g.default,null);case v.ASSET_LITE:return s.default.createElement(p.default,null);case v.ASSET_DETAILS:return s.default.createElement(h.default,null);default:return s.default.createElement("p",null,"loading...")}}}]),t}(s.default.Component);t.default=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(131),l=function(e){return e&&e.__esModule?e:{default:e}}(a),o=function(e){var t=e.show,n=t.request.id,r=void 0,a=t.requestList[n]||null,l=t.assetList;if(a&&l){r=l[a.key]||null}return{asset:r}};t.default=(0,r.connect)(o,null)(l.default)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(9),f=r(c),d=n(3),p=n(44),m=r(p),h=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),i(t,[{key:"render",value:function(){var e=this.props.asset;if(e){var t=e.claimData,n=t.name,r=t.claimId;return s.default.createElement("div",{className:"row row--tall flex-container--column flex-container--center-center show-lite-container"},s.default.createElement(f.default,{pageTitle:n,asset:e}),s.default.createElement(m.default,null),s.default.createElement(d.Link,{id:"asset-boilerpate",className:"link--primary fine-print",to:"/"+r+"/"+n},"hosted via Spee.ch"))}return s.default.createElement("div",{className:"row row--tall row--padded flex-container--column flex-container--center-center"},s.default.createElement("p",null,"loading asset data..."))}}]),t}(s.default.Component);t.default=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(20),f=r(c),d=n(37),p=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),i(t,[{key:"componentDidMount",value:function(){var e=this.props.asset.claimData,t=e.name,n=e.claimId;this.props.onFileRequest(t,n)}},{key:"render",value:function(){var e=this.props,t=e.status,n=e.error,r=e.asset.claimData,a=r.name,l=r.claimId,o=r.contentType,i=r.fileExt,u=r.thumbnail;return s.default.createElement("div",{id:"asset-display-component"},t===d.LOCAL_CHECK&&s.default.createElement("div",null,s.default.createElement("p",null,"Checking to see if Spee.ch has your asset locally...")),t===d.UNAVAILABLE&&s.default.createElement("div",null,s.default.createElement("p",null,"Sit tight, we're searching the LBRY blockchain for your asset!"),s.default.createElement(f.default,{size:12}),s.default.createElement("p",null,"Curious what magic is happening here? ",s.default.createElement("a",{className:"link--primary",target:"blank",href:"https://lbry.io/faq/what-is-lbry"},"Learn more."))),t===d.ERROR&&s.default.createElement("div",null,s.default.createElement("p",null,"Unfortunately, we couldn't download your asset from LBRY. You can help us out by sharing the below error message in the ",s.default.createElement("a",{className:"link--primary",href:"https://discord.gg/YjYbwhS",target:"_blank"},"LBRY discord"),"."),s.default.createElement("i",null,s.default.createElement("p",{id:"error-message"},n))),t===d.AVAILABLE&&function(){switch(o){case"image/jpeg":case"image/jpg":case"image/png":case"image/gif":return s.default.createElement("img",{className:"asset",src:"/"+l+"/"+a+"."+i,alt:a});case"video/mp4":return s.default.createElement("video",{className:"asset video",controls:!0,poster:u},s.default.createElement("source",{src:"/"+l+"/"+a+"."+i}),s.default.createElement("p",null,"Your browser does not support the ",s.default.createElement("code",null,"video")," element."));default:return s.default.createElement("p",null,"Unsupported file type")}}())}}]),t}(s.default.Component);t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(134),l=function(e){return e&&e.__esModule?e:{default:e}}(a),o=function(e){var t=e.show,n=t.request.id,r=void 0,a=t.requestList[n]||null,l=t.assetList;if(a&&l){r=l[a.key]||null}return{asset:r}};t.default=(0,r.connect)(o,null)(l.default)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(9),f=r(c),d=n(7),p=r(d),m=n(21),h=r(m),b=n(135),g=r(b),v=n(44),y=r(v),E=n(137),w=r(E),_=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),i(t,[{key:"render",value:function(){var e=this.props.asset;if(e){var t=e.claimData.name;return s.default.createElement("div",null,s.default.createElement(f.default,{pageTitle:t+" - details",asset:e}),s.default.createElement(p.default,null),s.default.createElement("div",{className:"row row--tall row--padded"},s.default.createElement("div",{className:"column column--10"},s.default.createElement(g.default,null)),s.default.createElement("div",{className:"column column--5 column--sml-10 align-content-top"},s.default.createElement("div",{className:"row row--padded show-details-container"},s.default.createElement(y.default,null))),s.default.createElement("div",{className:"column column--5 column--sml-10 align-content-top"},s.default.createElement("div",{className:"row row--padded"},s.default.createElement(w.default,null)))))}return s.default.createElement(h.default,{error:"loading asset data..."})}}]),t}(s.default.Component);t.default=_},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(136),l=function(e){return e&&e.__esModule?e:{default:e}}(a),o=n(13),i=function(e){var t=e.show;return{title:(0,o.selectAsset)(t).claimData.title}};t.default=(0,r.connect)(i,null)(l.default)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),a=function(e){return e&&e.__esModule?e:{default:e}}(r),l=function(e){var t=e.title;return a.default.createElement("div",null,a.default.createElement("span",{className:"text--large"},t))};t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(138),l=function(e){return e&&e.__esModule?e:{default:e}}(a),o=n(13),i=function(e){var t=e.show;return{asset:(0,o.selectAsset)(t)}};t.default=(0,r.connect)(i,null)(l.default)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),u=function(e){return e&&e.__esModule?e:{default:e}}(i),s=n(3),c=function(e){function t(e){r(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.copyToClipboard=n.copyToClipboard.bind(n),n}return l(t,e),o(t,[{key:"copyToClipboard",value:function(e){var t=e.target.dataset.elementtocopy;document.getElementById(t).select();try{document.execCommand("copy")}catch(e){this.setState({error:"Oops, unable to copy"})}}},{key:"render",value:function(){var e=this.props.asset,t=e.shortId,n=e.claimData,r=n.channelName,a=n.certificateId,l=n.description,o=n.name,i=n.claimId,c=n.fileExt,f=n.contentType,d=n.thumbnail,p=n.host;return u.default.createElement("div",null,r&&u.default.createElement("div",{className:"row row--padded row--wide row--no-top"},u.default.createElement("div",{className:"column column--2 column--med-10"},u.default.createElement("span",{className:"text"},"Channel:")),u.default.createElement("div",{className:"column column--8 column--med-10"},u.default.createElement("span",{className:"text"},u.default.createElement(s.Link,{to:"/"+r+":"+a},r)))),l&&u.default.createElement("div",{className:"row row--padded row--wide row--no-top"},u.default.createElement("span",{className:"text"},l)),u.default.createElement("div",{id:"show-share-buttons"},u.default.createElement("div",{className:"row row--padded row--wide row--no-top"},u.default.createElement("div",{className:"column column--2 column--med-10"},u.default.createElement("span",{className:"text"},"Share:")),u.default.createElement("div",{className:"column column--8 column--med-10"},u.default.createElement("div",{className:"row row--short row--wide flex-container--row flex-container--space-between-bottom flex-container--wrap"},u.default.createElement("a",{className:"link--primary",target:"_blank",href:"https://twitter.com/intent/tweet?text="+p+"/"+t+"/"+o},"twitter"),u.default.createElement("a",{className:"link--primary",target:"_blank",href:"https://www.facebook.com/sharer/sharer.php?u="+p+"/"+t+"/"+o},"facebook"),u.default.createElement("a",{className:"link--primary",target:"_blank",href:"http://tumblr.com/widgets/share/tool?canonicalUrl="+p+"/"+t+"/"+o},"tumblr"),u.default.createElement("a",{className:"link--primary",target:"_blank",href:"https://www.reddit.com/submit?url="+p+"/"+t+"/"+o+"&title="+o},"reddit"))))),u.default.createElement("div",{className:"row row--padded row--wide row--no-top"},u.default.createElement("div",{id:"show-short-link"},u.default.createElement("div",{className:"column column--2 column--med-10"},u.default.createElement("span",{className:"text"},"Link:")),u.default.createElement("div",{className:"column column--8 column--med-10"},u.default.createElement("div",{className:"row row--short row--wide"},u.default.createElement("div",{className:"column column--7"},u.default.createElement("div",{className:"input-error",id:"input-error-copy-short-link",hidden:"true"},"error here"),u.default.createElement("input",{type:"text",id:"short-link",className:"input-disabled input-text--full-width",readOnly:!0,spellCheck:"false",value:p+"/"+t+"/"+o+"."+c,onClick:this.select})),u.default.createElement("div",{className:"column column--1"}),u.default.createElement("div",{className:"column column--2"},u.default.createElement("button",{className:"button--primary button--wide","data-elementtocopy":"short-link",onClick:this.copyToClipboard},"copy"))))),u.default.createElement("div",{id:"show-embed-code"},u.default.createElement("div",{className:"column column--2 column--med-10"},u.default.createElement("span",{className:"text"},"Embed:")),u.default.createElement("div",{className:"column column--8 column--med-10"},u.default.createElement("div",{className:"row row--short row--wide"},u.default.createElement("div",{className:"column column--7"},u.default.createElement("div",{className:"input-error",id:"input-error-copy-embed-text",hidden:"true"},"error here"),"video/mp4"===f?u.default.createElement("input",{type:"text",id:"embed-text",className:"input-disabled input-text--full-width",readOnly:!0,onClick:this.select,spellCheck:"false",value:'<video width="100%" controls poster="'+d+'" src="'+p+"/"+i+"/"+o+"."+c+'"/></video>'}):u.default.createElement("input",{type:"text",id:"embed-text",className:"input-disabled input-text--full-width",readOnly:!0,onClick:this.select,spellCheck:"false",value:'<img src="'+p+"/"+i+"/"+o+"."+c+'"/>'})),u.default.createElement("div",{className:"column column--1"}),u.default.createElement("div",{className:"column column--2"},u.default.createElement("button",{className:"button--primary button--wide","data-elementtocopy":"embed-text",onClick:this.copyToClipboard},"copy")))))),u.default.createElement("div",{className:"flex-container--row flex-container--space-between-bottom"},u.default.createElement(s.Link,{className:"link--primary",to:"/"+t+"/"+o+"."+c},u.default.createElement("span",{className:"text"},"Direct Link")),u.default.createElement("a",{className:"link--primary",href:p+"/"+i+"/"+o+"."+c,download:o},"Download"),u.default.createElement("a",{className:"link--primary",target:"_blank",href:"https://lbry.io/dmca"},"Report")))}}]),t}(u.default.Component);t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(140),l=function(e){return e&&e.__esModule?e:{default:e}}(a),o=function(e){var t=e.show,n=t.request.id,r=t.requestList[n]||null,a=void 0;if(r){var l=r.key;a=t.channelList[l]||null}return{channel:a}};t.default=(0,r.connect)(o,null)(l.default)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(9),f=r(c),d=n(21),p=r(d),m=n(7),h=r(m),b=n(141),g=r(b),v=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),i(t,[{key:"render",value:function(){var e=this.props.channel;if(e){var t=e.name,n=e.longId,r=e.shortId;return s.default.createElement("div",null,s.default.createElement(f.default,{pageTitle:t,channel:e}),s.default.createElement(h.default,null),s.default.createElement("div",{className:"row row--tall row--padded"},s.default.createElement("div",{className:"column column--10"},s.default.createElement("h2",null,"channel name: ",t),s.default.createElement("p",{className:"fine-print"},"full channel id: ",n),s.default.createElement("p",{className:"fine-print"},"short channel id: ",r)),s.default.createElement("div",{className:"column column--10"},s.default.createElement(g.default,null))))}return s.default.createElement(p.default,{error:"loading channel data..."})}}]),t}(s.default.Component);t.default=v},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(8),l=n(142),o=function(e){return e&&e.__esModule?e:{default:e}}(l),i=function(e){var t=e.show,n=t.requestList[t.request.id],r=n.key;return{channelKey:r,channel:t.channelList[r]||null}},u={onUpdateChannelClaims:a.onUpdateChannelClaims};t.default=(0,r.connect)(i,u)(o.default)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(143),f=r(c),d=function(e){function t(e){a(this,t);var n=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.showNextResultsPage=n.showNextResultsPage.bind(n),n.showPreviousResultsPage=n.showPreviousResultsPage.bind(n),n}return o(t,e),i(t,[{key:"showPreviousResultsPage",value:function(){var e=this.props.channel.claimsData.currentPage,t=parseInt(e)-1;this.showNewPage(t)}},{key:"showNextResultsPage",value:function(){var e=this.props.channel.claimsData.currentPage,t=parseInt(e)+1;this.showNewPage(t)}},{key:"showNewPage",value:function(e){var t=this.props,n=t.channelKey,r=t.channel,a=r.name,l=r.longId;this.props.onUpdateChannelClaims(n,a,l,e)}},{key:"render",value:function(){var e=this.props.channel.claimsData,t=e.claims,n=e.currentPage,r=e.totalPages;return s.default.createElement("div",{className:"row row--tall"},t.length>0?s.default.createElement("div",null,t.map(function(e,t){return s.default.createElement(f.default,{claimData:e,key:e.name+"-"+t})}),s.default.createElement("div",null,n>1&&s.default.createElement("button",{className:"button--secondary",onClick:this.showPreviousResultsPage},"Previous Page"),n<r&&s.default.createElement("button",{className:"button--secondary",onClick:this.showNextResultsPage},"Next Page"))):s.default.createElement("p",null,"There are no claims in this channel"))}}]),t}(s.default.Component);t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(144),l=function(e){return e&&e.__esModule?e:{default:e}}(a),o=function(e){return{defaultThumbnail:e.site.defaults.defaultThumbnail}};t.default=(0,r.connect)(o,null)(l.default)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),a=function(e){return e&&e.__esModule?e:{default:e}}(r),l=n(3),o=function(e){var t=e.defaultThumbnail,n=e.claimData,r=n.name,o=n.claimId,i=n.fileExt,u=n.contentType,s=n.thumbnail,c=o+"/"+r+"."+i,f="/"+o+"/"+r;return a.default.createElement("div",{className:"asset-holder"},a.default.createElement(l.Link,{to:f},function(){switch(u){case"image/jpeg":case"image/jpg":case"image/png":case"image/gif":return a.default.createElement("img",{className:"asset-preview",src:c,alt:r});case"video/mp4":return a.default.createElement("img",{className:"asset-preview video",src:s||t,alt:r});default:return a.default.createElement("p",null,"unsupported file type")}}()))};t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(146),l=function(e){return e&&e.__esModule?e:{default:e}}(a),o=function(e){var t=e.site;return{host:t.host,title:t.title}};t.default=(0,r.connect)(o,null)(l.default)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),s=r(u),c=n(7),f=r(c),d=n(14),p=r(d),m=function(e){function t(){return a(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),i(t,[{key:"render",value:function(){var e=this.props,t=e.title,n=e.host;return s.default.createElement("div",null,s.default.createElement(p.default,null,s.default.createElement("title",null,t," - 404"),s.default.createElement("link",{rel:"canonical",href:n+"/404"})),s.default.createElement(f.default,null),s.default.createElement("div",{className:"row row--padded"},s.default.createElement("h2",null,"404"),s.default.createElement("p",null,"That page does not exist")))}}]),t}(s.default.Component);t.default=m},function(e,t,n){"use strict";var r=function(){function e(e,t){var n=[],r=!0,a=!1,l=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,l=e}finally{try{!r&&i.return&&i.return()}finally{if(a)throw l}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=n(17),l=a.sendGAServeEvent,o=n(148),i=o.determineResponseType,u=o.flipClaimNameAndIdForBackwardsCompatibility,s=o.logRequestData,c=o.getClaimIdAndServeAsset,f=n(149),d=n(150);e.exports=function(e){e.get("/:identifier/:claim",function(e,t){var n=e.headers,a=e.ip,o=e.originalUrl,p=e.params,m=void 0;try{m=f.parseModifier(p.claim).hasFileExtension}catch(e){return t.status(400).json({success:!1,message:e.message})}var h=i(m,n);if("SERVE"!==h)return d(e,t);l(n,a,o);var b=void 0;try{b=f.parseClaim(p.claim).claimName}catch(e){return t.status(400).json({success:!1,message:e.message})}var g=void 0,v=void 0,y=void 0,E=void 0;try{var w=f.parseIdentifier(p.identifier);g=w.isChannel,v=w.channelName,y=w.channelClaimId,E=w.claimId}catch(e){return t.status(400).json({success:!1,message:e.message})}if(!g){var _=u(E,b),C=r(_,2);E=C[0],b=C[1]}s(h,b,v,E),c(v,y,b,E,o,a,t)}),e.get("/:claim",function(e,t){var n=e.headers,r=e.ip,a=e.originalUrl,o=e.params,u=void 0;try{u=f.parseModifier(o.claim).hasFileExtension}catch(e){return t.status(400).json({success:!1,message:e.message})}var p=i(u,n);if("SERVE"!==p)return d(e,t);l(n,r,a);var m=void 0;try{m=f.parseClaim(o.claim).claimName}catch(e){return t.status(400).json({success:!1,message:e.message})}s(p,m,null,null),c(null,null,m,null,a,r,t)})}},function(e,t,n){"use strict";function r(e){var t=e.accept;return t&&t.match(/text\/html/)}function a(e){return e["user-agent"]&&e["user-agent"].match(/Mozilla/)}function l(e){var t=e.accept,n=e.range,r=t&&t.match(/image\/.*/)&&!t.match(/text\/html/)&&!t.match(/text\/\*/),a=t&&n;return r||a}function o(e){return 40===e.length&&!/[^A-Za-z0-9]/g.test(e)}function i(e){return 1===e.length}function u(e){return o(e)||i(e)}function s(e,t,n){return p(e,t).then(function(r){if(r===b)return n.status(307).redirect("/api/claim/get/"+t+"/"+e);var a=r.filePath,l=r.fileType;c.verbose("serving file: "+a);var o={headers:{"X-Content-Type-Options":"nosniff","Content-Type":l||"image/jpeg"}};n.status(200).sendFile(a,o)}).catch(function(e){throw e})}var c=n(2),f=n(30),d=f.getClaimId,p=f.getLocalFileRecord,m=n(29),h=m.handleErrorResponse,b="NO_FILE";e.exports={getClaimIdAndServeAsset:function(e,t,n,r,a,l,o){d(e,t,n,r).then(function(e){return"NO_CLAIM"===e?o.status(404).json({success:!1,message:"no claim id could be found"}):"NO_CHANNEL"===e?o.status(404).json({success:!1,message:"no channel id could be found"}):void s(e,n,o)}).catch(function(e){h(a,l,e,o)})},determineResponseType:function(e,t){var n=void 0;return e?(n="SERVE",r(t)&&(n="SHOW")):(n="SHOW",l(t)&&a(t)&&(c.debug("Show request came from browser but wants an image/video. Changing response to serve..."),n="SERVE")),n},flipClaimNameAndIdForBackwardsCompatibility:function(e,t){if(u(t)&&!u(e)){var n=t;t=e,e=n}return[e,t]},logRequestData:function(e,t,n,r){c.debug("responseType ===",e),c.debug("claim name === ",t),c.debug("channel name ===",n),c.debug("claim id ===",r)}}},function(e,t,n){"use strict";var r=function(){function e(e,t){var n=[],r=!0,a=!1,l=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,l=e}finally{try{!r&&i.return&&i.return()}finally{if(a)throw l}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=n(2);e.exports={REGEXP_INVALID_CLAIM:/[^A-Za-z0-9-]/g,REGEXP_INVALID_CHANNEL:/[^A-Za-z0-9-@]/g,REGEXP_ADDRESS:/^b(?=[^0OIl]{32,33})[0-9A-Za-z]{32,33}$/,CHANNEL_CHAR:"@",parseIdentifier:function(t){a.debug("parsing identifier:",t);var n=new RegExp("([^:$#/]*)([:$#]?)([^/]*)"),l=n.exec(t).map(function(e){return e||null}),o=r(l,4),i=o[0],u=o[1],s=o[2],c=o[3];if(a.debug(i+", "+u+", "+s+", "+c),!u)throw new Error('Check your url. No channel name provided before "'+s+'"');var f=u.startsWith(e.exports.CHANNEL_CHAR),d=f?u:null,p=void 0;if(f){if(!d)throw new Error("No channel name after @.");var m=d.match(e.exports.REGEXP_INVALID_CHANNEL);if(m)throw new Error("Invalid characters in channel name: "+m.join(", ")+".")}else p=u;var h=void 0;if(s){if(!c)throw new Error('No modifier provided after separator "'+s+'"');if(":"!==s)throw new Error('The "'+s+'" modifier is not currently supported');h=c}return{isChannel:f,channelName:d,channelClaimId:h,claimId:p}},parseClaim:function(t){a.debug("parsing name:",t);var n=new RegExp("([^:$#/.]*)([:$#.]?)([^/]*)"),l=n.exec(t).map(function(e){return e||null}),o=r(l,4),i=o[0],u=o[1],s=o[2],c=o[3];if(a.debug(i+", "+u+", "+s+", "+c),!u)throw new Error("No claim name provided before .");var f=u.match(e.exports.REGEXP_INVALID_CLAIM);if(f)throw new Error("Invalid characters in claim name: "+f.join(", ")+".");if(s){if(!c)throw new Error("No file extension provided after separator "+s+".");if("."!==s)throw new Error("The "+s+" modifier is not supported in the claim name")}return{claimName:u}},parseModifier:function(e){a.debug("parsing modifier:",e);var t=new RegExp("([^:$#/.]*)([:$#.]?)([^/]*)"),n=t.exec(e).map(function(e){return e||null}),l=r(n,4),o=l[0],i=l[1],u=l[2],s=l[3];a.debug(o+", "+i+", "+u+", "+s);var c=!1;return u&&(c=!0),{hasFileExtension:c}}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var a=n(0),l=r(a),o=n(32),i=n(18),u=n(33),s=r(u),c=n(1),f=n(3),d=n(38),p=r(d),m=n(39),h=r(m),b=n(45),g=r(b),v=n(151),y=r(v),E=n(15),w=n(152),_=n(8),C=n(14),N=r(C),I=function(e,t){return regeneratorRuntime.mark(function n(){return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,E.call)(e,t);case 2:case"end":return n.stop()}},n,this)})};e.exports=function(e,t){var n={},r=(0,y.default)(),a=(0,i.applyMiddleware)(r),u=(0,i.createStore)(s.default,a),d=(0,_.onHandleShowPageUri)(e.params),m=I(w.handleShowPageUri,d);r.run(m).done.then(function(){var r=(0,o.renderToString)(l.default.createElement(c.Provider,{store:u},l.default.createElement(f.StaticRouter,{location:e.url,context:n},l.default.createElement(p.default,null,l.default.createElement(h.default,null))))),a=N.default.renderStatic();if(n.url)return t.redirect(301,n.url);var i=u.getState();t.send((0,g.default)(a,r,i))})}},function(e,t){e.exports=require("redux-saga")},function(e,t,n){"use strict";function r(e,t){var n,r,a,l,o,u,s,d;return regeneratorRuntime.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:n=void 0,r=void 0,a=void 0,l=void 0,o=void 0,u=void 0,p.prev=1,s=m.default.parseIdentifier(e),n=s.isChannel,r=s.channelName,a=s.channelClaimId,l=s.claimId,d=m.default.parseClaim(t),o=d.claimName,u=d.extension,p.next=17;break;case 12:return p.prev=12,p.t0=p.catch(1),p.next=16,(0,i.put)((0,c.onRequestError)(p.t0.message));case 16:return p.abrupt("return",p.sent);case 17:if(!n){p.next=21;break}return p.next=20,(0,i.call)(f.newAssetRequest,(0,c.onNewAssetRequest)(o,null,r,a,u));case 20:return p.abrupt("return",p.sent);case 21:return p.next=24,(0,i.call)(f.newAssetRequest,(0,c.onNewAssetRequest)(o,l,null,null,u));case 24:case"end":return p.stop()}},h,this,[[1,12]])}function a(e){var t,n,r,a,l,o,u;return regeneratorRuntime.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:t=void 0,n=void 0,r=void 0,s.prev=1,a=m.default.parseIdentifier(e),t=a.isChannel,n=a.channelName,r=a.channelClaimId,s.next=13;break;case 8:return s.prev=8,s.t0=s.catch(1),s.next=12,(0,i.put)((0,c.onRequestError)(s.t0.message));case 12:return s.abrupt("return",s.sent);case 13:if(!t){s.next=17;break}return s.next=16,(0,i.call)(d.newChannelRequest,(0,c.onNewChannelRequest)(n,r));case 16:return s.abrupt("return",s.sent);case 17:l=void 0,o=void 0,s.prev=18,u=m.default.parseClaim(e),l=u.claimName,o=u.extension,s.next=29;break;case 24:return s.prev=24,s.t1=s.catch(18),s.next=28,(0,i.put)((0,c.onRequestError)(s.t1.message));case 28:return s.abrupt("return",s.sent);case 29:return s.next=31,(0,i.call)(f.newAssetRequest,(0,c.onNewAssetRequest)(l,null,null,null,o));case 31:case"end":return s.stop()}},b,this,[[1,8],[18,24]])}function l(e){var t,n,l;return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(t=e.data,n=t.identifier,l=t.claim,!n){o.next=5;break}return o.next=4,(0,i.call)(r,n,l);case 4:return o.abrupt("return",o.sent);case 5:return o.next=7,(0,i.call)(a,l);case 7:case"end":return o.stop()}},g,this)}function o(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,i.takeLatest)(s.HANDLE_SHOW_URI,l);case 2:case"end":return e.stop()}},v,this)}Object.defineProperty(t,"__esModule",{value:!0}),t.handleShowPageUri=l,t.watchHandleShowPageUri=o;var i=n(15),u=n(12),s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(u),c=n(8),f=n(153),d=n(155),p=n(157),m=function(e){return e&&e.__esModule?e:{default:e}}(p),h=regeneratorRuntime.mark(r),b=regeneratorRuntime.mark(a),g=regeneratorRuntime.mark(l),v=regeneratorRuntime.mark(o)},function(e,t,n){"use strict";function r(e){var t,n,r,a,o,i,p,m,h,b,g,v,y,E;return regeneratorRuntime.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return t=e.data,n=t.requestType,r=t.requestId,a=t.name,o=t.modifier,d.next=3,(0,l.put)((0,u.onRequestUpdate)(n,r));case 3:return d.next=5,(0,l.select)(c.selectShowState);case 5:return i=d.sent,d.next=8,(0,l.select)(f.selectSiteHost);case 8:if(p=d.sent,!i.requestList[r]){d.next=11;break}return d.abrupt("return",null);case 11:return m=void 0,d.prev=12,d.next=15,(0,l.call)(s.getLongClaimId,p,a,o);case 15:h=d.sent,m=h.data,d.next=24;break;case 19:return d.prev=19,d.t0=d.catch(12),d.next=23,(0,l.put)((0,u.onRequestError)(d.t0.message));case 23:return d.abrupt("return",d.sent);case 24:return b="a#"+a+"#"+m,d.next=27,(0,l.put)((0,u.addRequestToRequestList)(r,null,b));case 27:if(!i.assetList[b]){d.next=29;break}return d.abrupt("return",null);case 29:return g=void 0,d.prev=30,d.next=33,(0,l.call)(s.getShortId,p,a,m);case 33:v=d.sent,g=v.data,d.next=42;break;case 37:return d.prev=37,d.t1=d.catch(30),d.next=41,(0,l.put)((0,u.onRequestError)(d.t1.message));case 41:return d.abrupt("return",d.sent);case 42:return y=void 0,d.prev=43,d.next=46,(0,l.call)(s.getClaimData,p,a,m);case 46:E=d.sent,y=E.data,d.next=55;break;case 50:return d.prev=50,d.t2=d.catch(43),d.next=54,(0,l.put)((0,u.onRequestError)(d.t2.message));case 54:return d.abrupt("return",d.sent);case 55:return d.next=57,(0,l.put)((0,u.addAssetToAssetList)(b,null,a,m,g,y));case 57:return d.next=59,(0,l.put)((0,u.onRequestError)(null));case 59:case"end":return d.stop()}},d,this,[[12,19],[30,37],[43,50]])}function a(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,l.takeLatest)(i.ASSET_REQUEST_NEW,r);case 2:case"end":return e.stop()}},p,this)}Object.defineProperty(t,"__esModule",{value:!0}),t.newAssetRequest=r,t.watchNewAssetRequest=a;var l=n(15),o=n(12),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(o),u=n(8),s=n(154),c=n(13),f=n(46),d=regeneratorRuntime.mark(r),p=regeneratorRuntime.mark(a)},function(e,t,n){"use strict";function r(e,t,n){var r={};n&&(n.id?r.claimId=n.id:(r.channelName=n.channel.name,r.channelClaimId=n.channel.id)),r.claimName=t;var a={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)},l=e+"/api/claim/long-id";return(0,i.default)(l,a)}function a(e,t,n){var r=e+"/api/claim/short-id/"+n+"/"+t;return(0,i.default)(r)}function l(e,t,n){var r=e+"/api/claim/data/"+t+"/"+n;return(0,i.default)(r)}Object.defineProperty(t,"__esModule",{value:!0}),t.getLongClaimId=r,t.getShortId=a,t.getClaimData=l;var o=n(11),i=function(e){return e&&e.__esModule?e:{default:e}}(o)},function(e,t,n){"use strict";function r(e){var t,n,r,a,l,o,u,s,h,b,g,v,y,E;return regeneratorRuntime.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return t=e.data,n=t.requestType,r=t.requestId,a=t.channelName,l=t.channelId,m.next=3,(0,i.put)((0,c.onRequestUpdate)(n,r));case 3:return m.next=5,(0,i.select)(d.selectShowState);case 5:return o=m.sent,m.next=8,(0,i.select)(p.selectSiteHost);case 8:if(u=m.sent,!o.requestList[r]){m.next=11;break}return m.abrupt("return",null);case 11:return s=void 0,h=void 0,m.prev=12,m.next=15,(0,i.call)(f.getChannelData,u,a,l);case 15:b=m.sent,g=b.data,s=g.longChannelClaimId,h=g.shortChannelClaimId,m.next=26;break;case 21:return m.prev=21,m.t0=m.catch(12),m.next=25,(0,i.put)((0,c.onRequestError)(m.t0.message));case 25:return m.abrupt("return",m.sent);case 26:return v="c#"+a+"#"+s,m.next=29,(0,i.put)((0,c.addRequestToRequestList)(r,null,v));case 29:if(!o.channelList[v]){m.next=31;break}return m.abrupt("return",null);case 31:return y=void 0,m.prev=32,m.next=35,(0,i.call)(f.getChannelClaims,u,s,a,1);case 35:E=m.sent,y=E.data,m.next=44;break;case 39:return m.prev=39,m.t1=m.catch(32),m.next=43,(0,i.put)((0,c.onRequestError)(m.t1.message));case 43:return m.abrupt("return",m.sent);case 44:return m.next=46,(0,i.put)((0,c.addNewChannelToChannelList)(v,a,h,s,y));case 46:return m.next=48,(0,i.put)((0,c.onRequestError)(null));case 48:case"end":return m.stop()}},m,this,[[12,21],[32,39]])}function a(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,i.takeLatest)(s.CHANNEL_REQUEST_NEW,r);case 2:case"end":return e.stop()}},h,this)}function l(e){var t,n,r,a,l,o,u,s;return regeneratorRuntime.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return t=e.data,n=t.channelKey,r=t.name,a=t.longId,l=t.page,d.next=3,(0,i.select)(p.selectSiteHost);case 3:return o=d.sent,u=void 0,d.prev=5,d.next=8,(0,i.call)(f.getChannelClaims,o,a,r,l);case 8:s=d.sent,u=s.data,d.next=17;break;case 12:return d.prev=12,d.t0=d.catch(5),d.next=16,(0,i.put)((0,c.onRequestError)(d.t0.message));case 16:return d.abrupt("return",d.sent);case 17:return d.next=19,(0,i.put)((0,c.updateChannelClaims)(n,u));case 19:case"end":return d.stop()}},b,this,[[5,12]])}function o(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,i.takeLatest)(s.CHANNEL_CLAIMS_UPDATE_ASYNC,l);case 2:case"end":return e.stop()}},g,this)}Object.defineProperty(t,"__esModule",{value:!0}),t.newChannelRequest=r,t.watchNewChannelRequest=a,t.watchUpdateChannelClaims=o;var i=n(15),u=n(12),s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(u),c=n(8),f=n(156),d=n(13),p=n(46),m=regeneratorRuntime.mark(r),h=regeneratorRuntime.mark(a),b=regeneratorRuntime.mark(l),g=regeneratorRuntime.mark(o)},function(e,t,n){"use strict";function r(e,t,n){t||(t="none");var r=e+"/api/channel/data/"+n+"/"+t;return(0,o.default)(r)}function a(e,t,n,r){r||(r=1);var a=e+"/api/channel/claims/"+n+"/"+t+"/"+r;return(0,o.default)(a)}Object.defineProperty(t,"__esModule",{value:!0}),t.getChannelData=r,t.getChannelClaims=a;var l=n(11),o=function(e){return e&&e.__esModule?e:{default:e}}(l)},function(e,t,n){"use strict";var r=function(){function e(e,t){var n=[],r=!0,a=!1,l=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,l=e}finally{try{!r&&i.return&&i.return()}finally{if(a)throw l}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e.exports={REGEXP_INVALID_CLAIM:/[^A-Za-z0-9-]/g,REGEXP_INVALID_CHANNEL:/[^A-Za-z0-9-@]/g,REGEXP_ADDRESS:/^b(?=[^0OIl]{32,33})[0-9A-Za-z]{32,33}$/,CHANNEL_CHAR:"@",parseIdentifier:function(t){var n=new RegExp("([^:$#/]*)([:$#]?)([^/]*)"),a=n.exec(t).map(function(e){return e||null}),l=r(a,4),o=(l[0],l[1]),i=l[2],u=l[3];if(!o)throw new Error('Check your URL. No channel name provided before "'+i+'"');var s=o.startsWith(e.exports.CHANNEL_CHAR),c=s?o:null,f=void 0;if(s){if(!c)throw new Error('Check your URL. No channel name after "@".');var d=c.match(e.exports.REGEXP_INVALID_CHANNEL);if(d)throw new Error('Check your URL. Invalid characters in channel name: "'+d.join(", ")+'".')}else f=o;var p=void 0;if(i){if(!u)throw new Error('Check your URL. No modifier provided after separator "'+i+'"');if(":"!==i)throw new Error('Check your URL. The "'+i+'" modifier is not currently supported');p=u}return{isChannel:s,channelName:c,channelClaimId:p||null,claimId:f||null}},parseClaim:function(t){var n=new RegExp("([^:$#/.]*)([:$#.]?)([^/]*)"),a=n.exec(t).map(function(e){return e||null}),l=r(a,4),o=(l[0],l[1]),i=l[2],u=l[3];if(!o)throw new Error('Check your URL. No claim name provided before "."');var s=o.match(e.exports.REGEXP_INVALID_CLAIM);if(s)throw new Error('Check your URL. Invalid characters in claim name: "'+s.join(", ")+'".');if(i){if(!u)throw new Error('Check your URL. No file extension provided after separator "'+i+'".');if("."!==i)throw new Error('Check your URL. The "'+i+'" separator is not supported in the claim name.')}return{claimName:o,extension:u||null}}}},function(e,t,n){"use strict";var r=n(31);e.exports=function(e){e.use("*",function(e,t){r(e,t)})}}]);
//# sourceMappingURL=index.js.map