diff --git a/index.js b/index.js index 6c07198b..02ab07fc 100644 --- a/index.js +++ b/index.js @@ -1,2 +1,2 @@ -!function(e){function t(a){if(n[a])return n[a].exports;var r=n[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,a){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:a})},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=43)}([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,n){"use strict";e.exports={analytics:{googleId:"UA-60403362-6"},logging:{logLevel:"debug",slackWebHook:"https://hooks.slack.com/services/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",slackErrorChannel:null,slackInfoChannel:"#speech-dev1-errors"},session:{sessionKey:"nans$#kfjanwe234rydns"},files:{uploadDirectory:"/home/lbry/Uploads"},site:{title:"dev1.Spee.ch",name:"dev1.Spee.ch",host:"https://dev1.spee.ch",description:"Open-source, decentralized image and video sharing."},publish:{primaryClaimAddress:"bDZ2wPwtULUGxT7GXuNLpQhXmdPRUTUkcL",additionalClaimAddresses:["banpwixPosfVDWnGvXqU2af36Qpsd7buGd"],thumbnailChannel:"@dev1thumbs",thumbnailChannelId:"aeb625ff6f66c3eeeb42885070f4e53876033626"},claim:{defaultTitle:"dev1 Spee.ch",defaultThumbnail:"https://spee.ch/assets/img/video_thumb_default.png",defaultDescription:"Open-source, decentralized image and video sharing."},testing:{testChannel:"@test",testChannelId:"3b5bc6b6819172c6e2f3f90aa855b14a956b4a82",testChannelPassword:"1234"},api:{apiHost:"localhost",apiPort:"5279"}}},function(e,t){e.exports=require("react-router-dom")},function(e,t,n){"use strict";function a(e){return{type:h.FILE_SELECTED,data:e}}function r(){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 d(e){return{type:h.TOGGLE_METADATA_INPUTS,data:e}}function f(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=a,t.clearFile=r,t.updateMetadata=l,t.updateClaim=o,t.setPublishInChannel=i,t.updatePublishStatus=u,t.updateError=s,t.updateSelectedChannel=c,t.toggleMetadataInputs=d,t.onNewThumbnail=f,t.startPublish=p;var m=n(31),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";var a=n(59),r=n(2);e.exports=function(e){var t=e.database,l=e.username,o=e.password,i={},u=new a(t,l,o,{host:"localhost",dialect:"mysql",dialectOptions:{decimalNumbers:!0},logging:!1,pool:{max:5,min:0,idle:1e4,acquire:1e4}});u.authenticate().then(function(){r.info("Sequelize has established mysql connection successfully.")}).catch(function(e){r.error("Sequelize was unable to connect to the database:",e)});var s=n(60),c=n(61),d=n(62),f=n(63),p=n(64),m=n(65);return i.Certificate=u.import("Certificate",s),i.Channel=u.import("Channel",c),i.Claim=u.import("Claim",d),i.File=u.import("File",f),i.Request=u.import("Request",p),i.User=u.import("User",m),Object.keys(i).forEach(function(e){i[e].associate&&(r.info("Associating model:",e),i[e].associate(i))}),i.sequelize=u,i.Sequelize=a,i.upsert=function(e,t,n,a){return e.findOne({where:n}).then(function(n){return n?(r.debug("updating record in db."+a),n.update(t)):(r.debug("creating record in db."+a),e.create(t))}).catch(function(e){throw r.error(a+".upsert error",e),e})},i}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(1),r=n(19),l=n(87),o=function(e){return e&&e.__esModule?e:{default:e}}(l),i=n(5),u=function(e){var t=e.channel;return{channelName:t.loggedInChannel.name,channelShortId:t.loggedInChannel.shortId,channelLongId:t.loggedInChannel.longId}},s=function(e){return{onChannelLogin:function(t,n,a){e((0,r.updateLoggedInChannel)(t,n,a)),e((0,i.updateSelectedChannel)(t))},onChannelLogout:function(){e((0,r.updateLoggedInChannel)(null,null,null))}}};t.default=(0,a.connect)(u,s)(o.default)},function(e,t,n){"use strict";function a(e){return{type:g.HANDLE_SHOW_URI,data:e}}function r(e){return{type:g.REQUEST_ERROR,data:e}}function l(e,t){var n=v.CHANNEL,a="cr#"+e+"#"+t;return{type:g.CHANNEL_REQUEST_NEW,data:{requestType:n,requestId:a,channelName:e,channelId:t}}}function o(e,t,n,a,r){var l=r?v.ASSET_LITE:v.ASSET_DETAILS,o="ar#"+e+"#"+t+"#"+n+"#"+a;return{type:g.ASSET_REQUEST_NEW,data:{requestType:l,requestId:o,name:e,modifier:{id:t,channel:{name:n,id:a}}}}}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,a,r,l){return{type:g.ASSET_ADD,data:{id:e,error:t,name:n,claimId:a,shortId:r,claimData:l}}}function c(e,t,n,a,r){return{type:g.CHANNEL_ADD,data:{id:e,name:t,shortId:n,longId:a,claimsData:r}}}function d(e,t,n,a){return{type:g.CHANNEL_CLAIMS_UPDATE_ASYNC,data:{channelKey:e,name:t,longId:n,page:a}}}function f(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=a,t.onRequestError=r,t.onNewChannelRequest=l,t.onNewAssetRequest=o,t.onRequestUpdate=i,t.addRequestToRequestList=u,t.addAssetToAssetList=s,t.addNewChannelToChannelList=c,t.onUpdateChannelClaims=d,t.updateChannelClaims=f,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(40)},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function r(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=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,a(e)])}).then(function(e){var t=o(e,2);return r(t[0],t[1])})}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){var n=[],a=!0,r=!1,l=void 0;try{for(var o,i=e[Symbol.iterator]();!(a=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);a=!0);}catch(e){r=!0,l=e}finally{try{!a&&i.return&&i.return()}finally{if(r)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(90)},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 a=n(67),r=n(2),l=n(3),o=l.api,i=o.apiHost,u=o.apiPort,s="http://"+i+":"+u,c=n(17),d=c.chooseGaLbrynetPublishLabel,f=c.sendGATimingEvent,p=function(e,t,n){var a=e.data;if(r.debug("lbry api data:",a),a.result)return a.result.error?(r.debug("Lbrynet api error:",a.result.error),void n(new Error(a.result.error))):void t(a.result);n(JSON.stringify(a))};e.exports={publishClaim:function(e){r.debug('lbryApi >> Publishing claim to "'+e.name+'"');var t=Date.now();return new Promise(function(n,r){a.post(s,{method:"publish",params:e}).then(function(a){f("lbrynet","publish",d(e),t,Date.now()),p(a,n,r)}).catch(function(e){r(e)})})},getClaim:function(e){r.debug('lbryApi >> Getting Claim for "'+e+'"');var t=Date.now();return new Promise(function(n,r){a.post(s,{method:"get",params:{uri:e,timeout:20}}).then(function(e){f("lbrynet","getClaim","GET",t,Date.now()),p(e,n,r)}).catch(function(e){r(e)})})},getClaimList:function(e){r.debug('lbryApi >> Getting claim_list for "'+e+'"');var t=Date.now();return new Promise(function(n,r){a.post(s,{method:"claim_list",params:{name:e}}).then(function(e){f("lbrynet","getClaimList","CLAIM_LIST",t,Date.now()),p(e,n,r)}).catch(function(e){r(e)})})},resolveUri:function(e){r.debug('lbryApi >> Resolving URI for "'+e+'"');var t=Date.now();return new Promise(function(n,r){a.post(s,{method:"resolve",params:{uri:e}}).then(function(a){var l=a.data;f("lbrynet","resolveUri","RESOLVE",t,Date.now()),l.result[e].error?r(l.result[e].error):n(l.result[e])}).catch(function(e){r(e)})})},getDownloadDirectory:function(){r.debug("lbryApi >> Retrieving the download directory path from lbry daemon...");var e=Date.now();return new Promise(function(t,n){a.post(s,{method:"settings_get"}).then(function(n){var a=n.data;if(f("lbrynet","getDownloadDirectory","SETTINGS_GET",e,Date.now()),!a.result)return new Error("Successfully connected to lbry daemon, but unable to retrieve the download directory.");t(a.result.download_directory)}).catch(function(e){r.error("Lbrynet Error:",e),t("/home/lbry/Downloads/")})})},createChannel:function(e){r.debug("lbryApi >> Creating channel for "+e+"...");var t=Date.now();return new Promise(function(n,r){a.post(s,{method:"channel_new",params:{channel_name:e,amount:.1}}).then(function(e){f("lbrynet","createChannel","CHANNEL_NEW",t,Date.now()),p(e,n,r)}).catch(function(e){r(e)})})}}},function(e,t,n){"use strict";function a(e,t,n){return{eventCategory:"client requests",eventAction:"serve request",eventLabel:n,ipOverride:t,userAgentOverride:e["user-agent"]}}function r(e,t,n,a,r){return{userTimingCategory:e,userTimingVariableName:t,userTimingTime:r-a,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(68),s=n(3),c=s.analytics.googleId,d=s.site.name;e.exports={sendGAServeEvent:function(e,t,n){l(t,a(e,t,n))},sendGATimingEvent:function(e,t,n,a,l){var i=r(e,t,n,a,l);o(d,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 a(e,t,n){return{type:l.CHANNEL_UPDATE,data:{name:e,shortId:t,longId:n}}}Object.defineProperty(t,"__esModule",{value:!0}),t.updateLoggedInChannel=a;var r=n(33),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}(r)},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function r(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;nthis.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:d.default.number.isRequired},t.default=b},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function r(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;n0;)r+=1,a=t.substring(0,r),l=l.filter(function(e){return e.claimId&&e.claimId.substring(0,r)===a});return a}}},function(e,t){e.exports=require("passport-local")},function(e,t,n){"use strict";var a=n(2),r=n(74),l=n(3),o=l.site,i=l.wallet,u=l.publish;e.exports={parsePublishApiRequestBody:function(e){var t=e.name,n=e.nsfw,a=e.license,r=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,a=a||null,r=r||null,l=l||null,o=o||null,{name:t,nsfw:n,license:a,title:r,description:l,thumbnail:o}},parsePublishApiRequestFiles:function(t){var n=t.file,a=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:a?a.name:null,thumbnailFilePath:a?a.path:null,thumbnailFileType:a?a.type:null}},validateFileTypeAndSize:function(e){switch(e.type){case"image/jpeg":case"image/jpg":case"image/png":if(e.size>1e7)throw a.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 a.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 a.debug("publish > file validation > .mp4 was too big"),new Error("Sorry, videos are limited to 50 megabytes.");break;default:throw a.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,r,l,u,s){a.debug("Creating Publish Parameters"),null!==n&&""!==n.trim()||(n=t),null!==r&&""!==r.trim()||(r=""),null!==l&&""!==l.trim()||(l=" ");var c={name:t,file_path:e,bid:.01,metadata:{description:r,title:n,author:o.title,language:"en",license:l,nsfw:u},claim_address:i.lbryClaimAddress};return s&&(c.metadata.thumbnail=s),c},createThumbnailPublishParams:function(e,t,n,r){if(e)return a.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:r},claim_address:i.lbryClaimAddress,channel_name:u.thumbnailChannel,channel_id:u.thumbnailChannelId}},deleteTemporaryFile:function(e){r.unlink(e,function(t){if(t)throw a.error("error deleting temporary file "+e),t;a.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,a=e.outpoint,r=e.height,l=e.address,o=e.nsfw;return{name:t,claimId:n,outpoint:a,height:r,address:l,fileName:"",filePath:"",fileType:e.contentType,nsfw:o}}}},function(e,t,n){"use strict";var a=function(){function e(e,t){var n=[],a=!0,r=!1,l=void 0;try{for(var o,i=e[Symbol.iterator]();!(a=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);a=!0);}catch(e){r=!0,l=e}finally{try{!a&&i.return&&i.return()}finally{if(r)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")}}(),r=n(2);e.exports={handleErrorResponse:function(t,n,l,o){r.error("Error on "+t,e.exports.useObjectPropertiesIfNoKeys(l));var i=e.exports.returnErrorMessageAndStatus(l),u=a(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 a=function(){function e(e,t){var n=[],a=!0,r=!1,l=void 0;try{for(var o,i=e[Symbol.iterator]();!(a=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);a=!0);}catch(e){r=!0,l=e}finally{try{!a&&i.return&&i.return()}finally{if(r)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")}}(),r=n(6),l=n(2),o=n(76),i=o.returnPaginatedChannelClaims;e.exports={getClaimId:function(t,n,a,r){return t?e.exports.getClaimIdByChannel(t,n,a):e.exports.getClaimIdByClaim(a,r)},getClaimIdByClaim:function(e,t){return l.debug("getClaimIdByClaim("+e+", "+t+")"),new Promise(function(n,a){r.Claim.getLongClaimId(e,t).then(function(e){e||n("NO_CLAIM"),n(e)}).catch(function(e){a(e)})})},getClaimIdByChannel:function(e,t,n){return l.debug("getClaimIdByChannel("+e+", "+t+", "+n+")"),new Promise(function(l,o){r.Certificate.getLongChannelId(e,t).then(function(e){return e?Promise.all([e,r.Claim.getClaimIdByLongChannelId(e,n)]):[null,null]}).then(function(e){var t=a(e,2),n=t[0],r=t[1];return n?r?void l(r):l("NO_CLAIM"):l("NO_CHANNEL")}).catch(function(e){o(e)})})},getChannelData:function(e,t,n){return new Promise(function(n,l){r.Certificate.getLongChannelId(e,t).then(function(t){return t?Promise.all([t,r.Certificate.getShortChannelIdFromLongChannelId(t,e)]):[null,null,null]}).then(function(t){var r=a(t,2),l=r[0],o=r[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){r.Certificate.getLongChannelId(e,t).then(function(e){return e?Promise.all([e,r.Claim.getAllChannelClaims(e)]):[null,null,null]}).then(function(t){var r=a(t,2),o=r[0],u=r[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 r.File.findOne({where:{claimId:e,name:t}}).then(function(e){return e?e.dataValues:"NO_FILE"})}}},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}var r=n(0),l=a(r),o=n(29),i=n(18),u=n(30),s=a(u),c=n(1),d=n(4),f=n(35),p=a(f),m=n(36),h=a(m),b=n(42),g=a(b),v=n(14),y=a(v);e.exports=function(e,t){var n={},a=(0,i.createStore)(s.default),r=(0,o.renderToString)(l.default.createElement(c.Provider,{store:a},l.default.createElement(d.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 f=a.getState();t.send((0,g.default)(u,r,f))}},function(e,t){e.exports=require("react-dom/server")},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(18),l=n(78),o=a(l),i=n(79),u=a(i),s=n(80),c=a(s),d=n(81),f=a(d);t.default=(0,r.combineReducers)({channel:u.default,publish:o.default,show:c.default,site:f.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 a(e){return e&&e.__esModule?e:{default:e}}function r(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\n \n \n \n \n \n \x3c!--helmet--\x3e\n '+e.title.toString()+"\n "+e.meta.toString()+"\n "+e.link.toString()+'\n \x3c!--style sheets--\x3e\n \n \n \n \x3c!--google font--\x3e\n \n \n \n
\n
'+t+"
\n
\n \\n \\n \\n \\n ';\n};\n\n/***/ }),\n/* 43 */\n/***/ (function(module, exports, __webpack_require__) {\n\n__webpack_require__(44);\n__webpack_require__(45);\nmodule.exports = __webpack_require__(46);\n\n\n/***/ }),\n/* 44 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"babel-polyfill\");\n\n/***/ }),\n/* 45 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"whatwg-fetch\");\n\n/***/ }),\n/* 46 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n// load dependencies\nvar express = __webpack_require__(47);\nvar bodyParser = __webpack_require__(48);\nvar expressHandlebars = __webpack_require__(49);\nvar Handlebars = __webpack_require__(50);\n\nvar _require = __webpack_require__(51),\n populateLocalsDotUser = _require.populateLocalsDotUser,\n serializeSpeechUser = _require.serializeSpeechUser,\n deserializeSpeechUser = _require.deserializeSpeechUser;\n\nvar config = __webpack_require__(3);\nvar logger = __webpack_require__(2);\nvar helmet = __webpack_require__(52);\nvar PORT = 3000; // set port\nvar app = express(); // create an Express application\nvar passport = __webpack_require__(22);\nvar cookieSession = __webpack_require__(53);\n\n// configure logging\nvar logLevel = config.logging.logLevel;\n__webpack_require__(54)(logger, logLevel);\n__webpack_require__(55)(logger);\n\n// check for global config variables\n__webpack_require__(57)();\n\n// trust the proxy to get ip address for us\napp.enable('trust proxy');\n\n// add middleware\napp.use(helmet()); // set HTTP headers to protect against well-known web vulnerabilties\napp.use(express.static(__dirname + '/public')); // 'express.static' to serve static files from public directory\napp.use(bodyParser.json()); // 'body parser' for parsing application/json\napp.use(bodyParser.urlencoded({ extended: true })); // 'body parser' for parsing application/x-www-form-urlencoded\napp.use(function (req, res, next) {\n // custom logging middleware to log all incoming http requests\n logger.verbose('Request on ' + req.originalUrl + ' from ' + req.ip);\n next();\n});\n\n// configure passport\npassport.serializeUser(serializeSpeechUser);\npassport.deserializeUser(deserializeSpeechUser);\nvar localSignupStrategy = __webpack_require__(58);\nvar localLoginStrategy = __webpack_require__(69);\npassport.use('local-signup', localSignupStrategy);\npassport.use('local-login', localLoginStrategy);\n// initialize passport\napp.use(cookieSession({\n name: 'session',\n keys: [config.session.sessionKey],\n maxAge: 24 * 60 * 60 * 1000 // 24 hours\n}));\napp.use(passport.initialize());\napp.use(passport.session());\n\n// configure handlebars & register it with express app\nvar hbs = expressHandlebars.create({\n defaultLayout: 'embed', // sets the default layout\n handlebars: Handlebars // includes basic handlebars for access to that library\n});\napp.engine('handlebars', hbs.engine);\napp.set('view engine', 'handlebars');\n\n// middleware to pass user info back to client (for handlebars access), if user is logged in\napp.use(populateLocalsDotUser);\n\n// start the server\nvar startServer = function startServer(mysqlConfig) {\n var db = __webpack_require__(6)(mysqlConfig); // require our models for syncing\n db.sequelize\n // sync sequelize\n .sync()\n // require routes\n .then(function () {\n __webpack_require__(70)(app);\n __webpack_require__(71)(app);\n __webpack_require__(77)(app);\n __webpack_require__(137)(app);\n __webpack_require__(148)(app);\n var http = __webpack_require__(149);\n return http.Server(app);\n })\n // start the server\n .then(function (server) {\n server.listen(PORT, function () {\n logger.info('Trusting proxy?', app.get('trust proxy'));\n logger.info('Server is listening on PORT ' + PORT);\n });\n }).catch(function (error) {\n logger.error('Startup Error:', error);\n });\n};\n\nmodule.exports = {\n hello: function hello() {\n console.log('hello world');\n },\n speak: function speak(something) {\n console.log(something);\n },\n start: function start(config) {\n var mysqlConfig = config.mysqlConfig;\n\n startServer(mysqlConfig);\n }\n};\n\n/***/ }),\n/* 47 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"express\");\n\n/***/ }),\n/* 48 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"body-parser\");\n\n/***/ }),\n/* 49 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"express-handlebars\");\n\n/***/ }),\n/* 50 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"handlebars\");\n\n/***/ }),\n/* 51 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n// const db = require('../models'); // require our models for syncing\nvar logger = __webpack_require__(2);\n\nmodule.exports = {\n populateLocalsDotUser: function populateLocalsDotUser(req, res, next) {\n if (req.user) {\n logger.debug('populating res.locals.user');\n res.locals.user = {\n id: req.user.id,\n userName: req.user.userName,\n channelName: req.user.channelName,\n channelClaimId: req.user.channelClaimId,\n shortChannelId: req.user.shortChannelId\n };\n }\n next();\n },\n serializeSpeechUser: function serializeSpeechUser(user, done) {\n // returns user data to be serialized into session\n logger.debug('serializing user');\n done(null, user);\n },\n deserializeSpeechUser: function deserializeSpeechUser(user, done) {\n // deserializes session and populates additional info to req.user\n logger.debug('deserializing user');\n done(null, user);\n }\n};\n\n/***/ }),\n/* 52 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"helmet\");\n\n/***/ }),\n/* 53 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"cookie-session\");\n\n/***/ }),\n/* 54 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nmodule.exports = function (winston, logLevel) {\n winston.configure({\n transports: [new winston.transports.Console({\n level: logLevel,\n timestamp: false,\n colorize: true,\n prettyPrint: true,\n handleExceptions: true,\n humanReadableUnhandledException: true\n })]\n });\n\n winston.error('Level 0');\n winston.warn('Level 1');\n winston.info('Level 2');\n winston.verbose('Level 3');\n winston.debug('Level 4');\n winston.silly('Level 5');\n};\n\n/***/ }),\n/* 55 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _require = __webpack_require__(3),\n logging = _require.logging;\n\nvar slackWebHook = logging.slackWebHook,\n slackErrorChannel = logging.slackErrorChannel,\n slackInfoChannel = logging.slackInfoChannel;\n\nvar winstonSlackWebHook = __webpack_require__(56).SlackWebHook;\n\nmodule.exports = function (winston) {\n if (slackWebHook) {\n // add a transport for errors to slack\n if (slackErrorChannel) {\n winston.add(winstonSlackWebHook, {\n name: 'slack-errors-transport',\n level: 'warn',\n webhookUrl: slackWebHook,\n channel: slackErrorChannel,\n username: 'spee.ch',\n iconEmoji: ':face_with_head_bandage:'\n });\n };\n if (slackInfoChannel) {\n winston.add(winstonSlackWebHook, {\n name: 'slack-info-transport',\n level: 'info',\n webhookUrl: slackWebHook,\n channel: slackInfoChannel,\n username: 'spee.ch',\n iconEmoji: ':nerd_face:'\n });\n };\n // send test message\n winston.error('Slack \"error\" logging is online.');\n winston.info('Slack \"info\" logging is online.');\n } else {\n winston.warn('Slack logging is not enabled because no slackWebHook config var provided.');\n }\n};\n\n/***/ }),\n/* 56 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"winston-slack-webhook\");\n\n/***/ }),\n/* 57 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar config = __webpack_require__(3);\nvar logger = __webpack_require__(2);\n\nmodule.exports = function () {\n // get the config file\n\n for (var configCategoryKey in config) {\n if (config.hasOwnProperty(configCategoryKey)) {\n // get the final variables for each config category\n var configVariables = config[configCategoryKey];\n for (var configVarKey in configVariables) {\n if (configVariables.hasOwnProperty(configVarKey)) {\n // print each variable\n logger.debug('CONFIG CHECK: ' + configCategoryKey + '.' + configVarKey + ' === ' + configVariables[configVarKey]);\n }\n }\n }\n }\n};\n\n/***/ }),\n/* 58 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar db = __webpack_require__(6);\nvar PassportLocalStrategy = __webpack_require__(24).Strategy;\nvar lbryApi = __webpack_require__(16);\nvar logger = __webpack_require__(2);\n\nmodule.exports = new PassportLocalStrategy({\n usernameField: 'username',\n passwordField: 'password'\n}, function (username, password, done) {\n logger.verbose('new channel signup request. user: ' + username + ' pass: ' + password + ' .');\n var userInfo = {};\n // server-side validaton of inputs (username, password)\n\n // create the channel and retrieve the metadata\n return lbryApi.createChannel('@' + username).then(function (tx) {\n // create user record\n var userData = {\n userName: username,\n password: password\n };\n logger.verbose('userData >', userData);\n // create user record\n var channelData = {\n channelName: '@' + username,\n channelClaimId: tx.claim_id\n };\n logger.verbose('channelData >', channelData);\n // create certificate record\n var certificateData = {\n claimId: tx.claim_id,\n name: '@' + username\n // address,\n };\n logger.verbose('certificateData >', certificateData);\n // save user and certificate to db\n return Promise.all([db.User.create(userData), db.Channel.create(channelData), db.Certificate.create(certificateData)]);\n }).then(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 3),\n newUser = _ref2[0],\n newChannel = _ref2[1],\n newCertificate = _ref2[2];\n\n logger.verbose('user and certificate successfully created');\n // store the relevant newUser info to be passed back for req.User\n userInfo['id'] = newUser.id;\n userInfo['userName'] = newUser.userName;\n userInfo['channelName'] = newChannel.channelName;\n userInfo['channelClaimId'] = newChannel.channelClaimId;\n // associate the instances\n return Promise.all([newCertificate.setChannel(newChannel), newChannel.setUser(newUser)]);\n }).then(function () {\n logger.verbose('user and certificate successfully associated');\n return db.Certificate.getShortChannelIdFromLongChannelId(userInfo.channelClaimId, userInfo.channelName);\n }).then(function (shortChannelId) {\n userInfo['shortChannelId'] = shortChannelId;\n return done(null, userInfo);\n }).catch(function (error) {\n logger.error('signup error', error);\n return done(error);\n });\n});\n\n/***/ }),\n/* 59 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"sequelize\");\n\n/***/ }),\n/* 60 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar logger = __webpack_require__(2);\n\nvar _require = __webpack_require__(23),\n returnShortId = _require.returnShortId;\n\nmodule.exports = function (sequelize, _ref) {\n var STRING = _ref.STRING,\n BOOLEAN = _ref.BOOLEAN,\n INTEGER = _ref.INTEGER,\n TEXT = _ref.TEXT,\n DECIMAL = _ref.DECIMAL;\n\n var Certificate = sequelize.define('Certificate', {\n address: {\n type: STRING,\n default: null\n },\n amount: {\n type: DECIMAL(19, 8),\n default: null\n },\n claimId: {\n type: STRING,\n default: null\n },\n claimSequence: {\n type: INTEGER,\n default: null\n },\n decodedClaim: {\n type: BOOLEAN,\n default: null\n },\n depth: {\n type: INTEGER,\n default: null\n },\n effectiveAmount: {\n type: DECIMAL(19, 8),\n default: null\n },\n hasSignature: {\n type: BOOLEAN,\n default: null\n },\n height: {\n type: INTEGER,\n default: null\n },\n hex: {\n type: TEXT('long'),\n default: null\n },\n name: {\n type: STRING,\n default: null\n },\n nout: {\n type: INTEGER,\n default: null\n },\n txid: {\n type: STRING,\n default: null\n },\n validAtHeight: {\n type: INTEGER,\n default: null\n },\n outpoint: {\n type: STRING,\n default: null\n },\n valueVersion: {\n type: STRING,\n default: null\n },\n claimType: {\n type: STRING,\n default: null\n },\n certificateVersion: {\n type: STRING,\n default: null\n },\n keyType: {\n type: STRING,\n default: null\n },\n publicKey: {\n type: TEXT('long'),\n default: null\n }\n }, {\n freezeTableName: true\n });\n\n Certificate.associate = function (db) {\n Certificate.belongsTo(db.Channel, {\n foreignKey: {\n allowNull: true\n }\n });\n };\n\n Certificate.getShortChannelIdFromLongChannelId = function (longChannelId, channelName) {\n var _this = this;\n\n logger.debug('getShortChannelIdFromLongChannelId ' + channelName + ':' + longChannelId);\n return new Promise(function (resolve, reject) {\n _this.findAll({\n where: { name: channelName },\n order: [['height', 'ASC']]\n }).then(function (result) {\n switch (result.length) {\n case 0:\n throw new Error('No channel(s) found with that channel name');\n default:\n return resolve(returnShortId(result, longChannelId));\n }\n }).catch(function (error) {\n reject(error);\n });\n });\n };\n\n Certificate.getLongChannelIdFromShortChannelId = function (channelName, channelClaimId) {\n var _this2 = this;\n\n logger.debug('getLongChannelIdFromShortChannelId(' + channelName + ', ' + channelClaimId + ')');\n return new Promise(function (resolve, reject) {\n _this2.findAll({\n where: {\n name: channelName,\n claimId: {\n $like: channelClaimId + '%'\n }\n },\n order: [['height', 'ASC']]\n }).then(function (result) {\n switch (result.length) {\n case 0:\n return resolve(null);\n default:\n // note results must be sorted\n return resolve(result[0].claimId);\n }\n }).catch(function (error) {\n reject(error);\n });\n });\n };\n\n Certificate.getLongChannelIdFromChannelName = function (channelName) {\n var _this3 = this;\n\n logger.debug('getLongChannelIdFromChannelName(' + channelName + ')');\n return new Promise(function (resolve, reject) {\n _this3.findAll({\n where: { name: channelName },\n order: [['effectiveAmount', 'DESC'], ['height', 'ASC']]\n }).then(function (result) {\n switch (result.length) {\n case 0:\n return resolve(null);\n default:\n return resolve(result[0].claimId);\n }\n }).catch(function (error) {\n reject(error);\n });\n });\n };\n\n Certificate.validateLongChannelId = function (name, claimId) {\n var _this4 = this;\n\n logger.debug('validateLongChannelId(' + name + ', ' + claimId + ')');\n return new Promise(function (resolve, reject) {\n _this4.findOne({\n where: { name: name, claimId: claimId }\n }).then(function (result) {\n if (!result) {\n return resolve(null);\n };\n resolve(claimId);\n }).catch(function (error) {\n reject(error);\n });\n });\n };\n\n Certificate.getLongChannelId = function (channelName, channelClaimId) {\n logger.debug('getLongChannelId(' + channelName + ', ' + channelClaimId + ')');\n if (channelClaimId && channelClaimId.length === 40) {\n // if a full channel id is provided\n return this.validateLongChannelId(channelName, channelClaimId);\n } else if (channelClaimId && channelClaimId.length < 40) {\n // if a short channel id is provided\n return this.getLongChannelIdFromShortChannelId(channelName, channelClaimId);\n } else {\n return this.getLongChannelIdFromChannelName(channelName); // if no channel id provided\n }\n };\n\n return Certificate;\n};\n\n/***/ }),\n/* 61 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nmodule.exports = function (sequelize, _ref) {\n var STRING = _ref.STRING;\n\n var Channel = sequelize.define('Channel', {\n channelName: {\n type: STRING,\n allowNull: false\n },\n channelClaimId: {\n type: STRING,\n allowNull: false\n }\n }, {\n freezeTableName: true\n });\n\n Channel.associate = function (db) {\n Channel.belongsTo(db.User);\n Channel.hasOne(db.Certificate);\n };\n\n return Channel;\n};\n\n/***/ }),\n/* 62 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar logger = __webpack_require__(2);\n\nvar _require = __webpack_require__(23),\n returnShortId = _require.returnShortId;\n\nvar _require2 = __webpack_require__(3),\n claim = _require2.claim,\n site = _require2.site;\n\nvar defaultThumbnail = claim.defaultThumbnail;\n\n\nfunction determineFileExtensionFromContentType(contentType) {\n switch (contentType) {\n case 'image/jpeg':\n case 'image/jpg':\n return 'jpeg';\n case 'image/png':\n return 'png';\n case 'image/gif':\n return 'gif';\n case 'video/mp4':\n return 'mp4';\n default:\n logger.debug('setting unknown file type as file extension jpeg');\n return 'jpeg';\n }\n};\n\nfunction determineThumbnail(storedThumbnail, defaultThumbnail) {\n if (storedThumbnail === '') {\n return defaultThumbnail;\n }\n return storedThumbnail;\n};\n\nfunction prepareClaimData(claim) {\n // logger.debug('preparing claim data based on resolved data:', claim);\n claim['thumbnail'] = determineThumbnail(claim.thumbnail, defaultThumbnail);\n claim['fileExt'] = determineFileExtensionFromContentType(claim.contentType);\n claim['host'] = site.host;\n return claim;\n};\n\nmodule.exports = function (sequelize, _ref) {\n var STRING = _ref.STRING,\n BOOLEAN = _ref.BOOLEAN,\n INTEGER = _ref.INTEGER,\n TEXT = _ref.TEXT,\n DECIMAL = _ref.DECIMAL;\n\n var Claim = sequelize.define('Claim', {\n address: {\n type: STRING,\n default: null\n },\n amount: {\n type: DECIMAL(19, 8),\n default: null\n },\n claimId: {\n type: STRING,\n default: null\n },\n claimSequence: {\n type: INTEGER,\n default: null\n },\n decodedClaim: {\n type: BOOLEAN,\n default: null\n },\n depth: {\n type: INTEGER,\n default: null\n },\n effectiveAmount: {\n type: DECIMAL(19, 8),\n default: null\n },\n hasSignature: {\n type: BOOLEAN,\n default: null\n },\n height: {\n type: INTEGER,\n default: null\n },\n hex: {\n type: TEXT('long'),\n default: null\n },\n name: {\n type: STRING,\n default: null\n },\n nout: {\n type: INTEGER,\n default: null\n },\n txid: {\n type: STRING,\n default: null\n },\n validAtHeight: {\n type: INTEGER,\n default: null\n },\n outpoint: {\n type: STRING,\n default: null\n },\n claimType: {\n type: STRING,\n default: null\n },\n certificateId: {\n type: STRING,\n default: null\n },\n author: {\n type: STRING,\n default: null\n },\n description: {\n type: TEXT('long'),\n default: null\n },\n language: {\n type: STRING,\n default: null\n },\n license: {\n type: STRING,\n default: null\n },\n licenseUrl: {\n type: STRING,\n default: null\n },\n nsfw: {\n type: BOOLEAN,\n default: null\n },\n preview: {\n type: STRING,\n default: null\n },\n thumbnail: {\n type: STRING,\n default: null\n },\n title: {\n type: STRING,\n default: null\n },\n metadataVersion: {\n type: STRING,\n default: null\n },\n contentType: {\n type: STRING,\n default: null\n },\n source: {\n type: STRING,\n default: null\n },\n sourceType: {\n type: STRING,\n default: null\n },\n sourceVersion: {\n type: STRING,\n default: null\n },\n streamVersion: {\n type: STRING,\n default: null\n },\n valueVersion: {\n type: STRING,\n default: null\n },\n channelName: {\n type: STRING,\n allowNull: true,\n default: null\n }\n }, {\n freezeTableName: true\n });\n\n Claim.associate = function (db) {\n Claim.belongsTo(db.File, {\n foreignKey: {\n allowNull: true\n }\n });\n };\n\n Claim.getShortClaimIdFromLongClaimId = function (claimId, claimName) {\n var _this = this;\n\n logger.debug('Claim.getShortClaimIdFromLongClaimId for ' + claimName + '#' + claimId);\n return new Promise(function (resolve, reject) {\n _this.findAll({\n where: { name: claimName },\n order: [['height', 'ASC']]\n }).then(function (result) {\n switch (result.length) {\n case 0:\n throw new Error('No claim(s) found with that claim name');\n default:\n resolve(returnShortId(result, claimId));\n }\n }).catch(function (error) {\n reject(error);\n });\n });\n };\n\n Claim.getAllChannelClaims = function (channelClaimId) {\n var _this2 = this;\n\n logger.debug('Claim.getAllChannelClaims for ' + channelClaimId);\n return new Promise(function (resolve, reject) {\n _this2.findAll({\n where: { certificateId: channelClaimId },\n order: [['height', 'ASC']],\n raw: true // returns an array of only data, not an array of instances\n }).then(function (channelClaimsArray) {\n // logger.debug('channelclaimsarray length:', channelClaimsArray.length);\n switch (channelClaimsArray.length) {\n case 0:\n return resolve(null);\n default:\n channelClaimsArray.forEach(function (claim) {\n claim['fileExt'] = determineFileExtensionFromContentType(claim.contentType);\n claim['thumbnail'] = determineThumbnail(claim.thumbnail, defaultThumbnail);\n return claim;\n });\n return resolve(channelClaimsArray);\n }\n }).catch(function (error) {\n reject(error);\n });\n });\n };\n\n Claim.getClaimIdByLongChannelId = function (channelClaimId, claimName) {\n var _this3 = this;\n\n logger.debug('finding claim id for claim ' + claimName + ' from channel ' + channelClaimId);\n return new Promise(function (resolve, reject) {\n _this3.findAll({\n where: { name: claimName, certificateId: channelClaimId },\n order: [['id', 'ASC']]\n }).then(function (result) {\n switch (result.length) {\n case 0:\n return resolve(null);\n case 1:\n return resolve(result[0].claimId);\n default:\n logger.error(result.length + ' records found for \"' + claimName + '\" in channel \"' + channelClaimId + '\"');\n return resolve(result[0].claimId);\n }\n }).catch(function (error) {\n reject(error);\n });\n });\n };\n\n Claim.getLongClaimIdFromShortClaimId = function (name, shortId) {\n var _this4 = this;\n\n return new Promise(function (resolve, reject) {\n _this4.findAll({\n where: {\n name: name,\n claimId: {\n $like: shortId + '%'\n } },\n order: [['height', 'ASC']]\n }).then(function (result) {\n switch (result.length) {\n case 0:\n return resolve(null);\n default:\n // note results must be sorted\n return resolve(result[0].claimId);\n }\n }).catch(function (error) {\n reject(error);\n });\n });\n };\n\n Claim.getTopFreeClaimIdByClaimName = function (name) {\n var _this5 = this;\n\n return new Promise(function (resolve, reject) {\n _this5.findAll({\n where: { name: name },\n order: [['effectiveAmount', 'DESC'], ['height', 'ASC']] // note: maybe height and effective amount need to switch?\n }).then(function (result) {\n logger.debug('length of result', result.length);\n switch (result.length) {\n case 0:\n return resolve(null);\n default:\n return resolve(result[0].dataValues.claimId);\n }\n }).catch(function (error) {\n reject(error);\n });\n });\n };\n\n Claim.validateLongClaimId = function (name, claimId) {\n var _this6 = this;\n\n return new Promise(function (resolve, reject) {\n _this6.findOne({\n where: { name: name, claimId: claimId }\n }).then(function (result) {\n if (!result) {\n return resolve(null);\n };\n resolve(claimId);\n }).catch(function (error) {\n reject(error);\n });\n });\n };\n\n Claim.getLongClaimId = function (claimName, claimId) {\n logger.debug('getLongClaimId(' + claimName + ', ' + claimId + ')');\n if (claimId && claimId.length === 40) {\n // if a full claim id is provided\n return this.validateLongClaimId(claimName, claimId);\n } else if (claimId && claimId.length < 40) {\n return this.getLongClaimIdFromShortClaimId(claimName, claimId); // if a short claim id is provided\n } else {\n return this.getTopFreeClaimIdByClaimName(claimName); // if no claim id is provided\n }\n };\n\n Claim.resolveClaim = function (name, claimId) {\n var _this7 = this;\n\n logger.debug('Claim.resolveClaim: ' + name + ' ' + claimId);\n return new Promise(function (resolve, reject) {\n _this7.findAll({\n where: { name: name, claimId: claimId }\n }).then(function (claimArray) {\n logger.debug('claims found on resolve:', claimArray.length);\n switch (claimArray.length) {\n case 0:\n return resolve(null);\n case 1:\n return resolve(prepareClaimData(claimArray[0].dataValues));\n default:\n logger.error('more than one entry matches that name (' + name + ') and claimID (' + claimId + ')');\n return resolve(prepareClaimData(claimArray[0].dataValues));\n }\n }).catch(function (error) {\n reject(error);\n });\n });\n };\n\n return Claim;\n};\n\n/***/ }),\n/* 63 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nmodule.exports = function (sequelize, _ref) {\n var STRING = _ref.STRING,\n BOOLEAN = _ref.BOOLEAN,\n INTEGER = _ref.INTEGER;\n\n var File = sequelize.define('File', {\n name: {\n type: STRING,\n allowNull: false\n },\n claimId: {\n type: STRING,\n allowNull: false\n },\n address: {\n type: STRING,\n allowNull: false\n },\n outpoint: {\n type: STRING,\n allowNull: false\n },\n height: {\n type: INTEGER,\n allowNull: false,\n default: 0\n },\n fileName: {\n type: STRING,\n allowNull: false\n },\n filePath: {\n type: STRING,\n allowNull: false\n },\n fileType: {\n type: STRING\n },\n nsfw: {\n type: BOOLEAN,\n allowNull: false,\n defaultValue: false\n },\n trendingEligible: {\n type: BOOLEAN,\n allowNull: false,\n defaultValue: true\n }\n }, {\n freezeTableName: true\n });\n\n File.associate = function (db) {\n File.hasMany(db.Request);\n File.hasOne(db.Claim);\n };\n\n File.getRecentClaims = function () {\n return this.findAll({\n where: { nsfw: false, trendingEligible: true },\n order: [['createdAt', 'DESC']],\n limit: 25\n });\n };\n\n return File;\n};\n\n/***/ }),\n/* 64 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nmodule.exports = function (sequelize, _ref) {\n var STRING = _ref.STRING,\n BOOLEAN = _ref.BOOLEAN,\n TEXT = _ref.TEXT;\n\n var Request = sequelize.define('Request', {\n action: {\n type: STRING,\n allowNull: false\n },\n url: {\n type: STRING,\n allowNull: false\n },\n ipAddress: {\n type: STRING,\n allowNull: true\n },\n result: {\n type: TEXT('long'),\n allowNull: true,\n default: null\n }\n }, {\n freezeTableName: true\n });\n\n Request.associate = function (db) {\n Request.belongsTo(db.File, {\n foreignKey: {\n allowNull: true\n }\n });\n };\n\n return Request;\n};\n\n/***/ }),\n/* 65 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar bcrypt = __webpack_require__(66);\nvar logger = __webpack_require__(2);\n\nmodule.exports = function (sequelize, _ref) {\n var STRING = _ref.STRING;\n\n var User = sequelize.define('User', {\n userName: {\n type: STRING,\n allowNull: false\n },\n password: {\n type: STRING,\n allowNull: false\n }\n }, {\n freezeTableName: true\n });\n\n User.associate = function (db) {\n User.hasOne(db.Channel);\n };\n\n User.prototype.comparePassword = function (password) {\n return bcrypt.compare(password, this.password);\n };\n\n User.prototype.changePassword = function (newPassword) {\n var _this = this;\n\n return new Promise(function (resolve, reject) {\n // generate a salt string to use for hashing\n bcrypt.genSalt(function (saltError, salt) {\n if (saltError) {\n logger.error('salt error', saltError);\n reject(saltError);\n return;\n }\n // generate a hashed version of the user's password\n bcrypt.hash(newPassword, salt, function (hashError, hash) {\n // if there is an error with the hash generation return the error\n if (hashError) {\n logger.error('hash error', hashError);\n reject(hashError);\n return;\n }\n // replace the current password with the new hash\n _this.update({ password: hash }).then(function () {\n resolve();\n }).catch(function (error) {\n reject(error);\n });\n });\n });\n });\n };\n\n // pre-save hook method to hash the user's password before the user's info is saved to the db.\n User.hook('beforeCreate', function (user, options) {\n logger.debug('User.beforeCreate hook...');\n return new Promise(function (resolve, reject) {\n // generate a salt string to use for hashing\n bcrypt.genSalt(function (saltError, salt) {\n if (saltError) {\n logger.error('salt error', saltError);\n reject(saltError);\n return;\n }\n // generate a hashed version of the user's password\n bcrypt.hash(user.password, salt, function (hashError, hash) {\n // if there is an error with the hash generation return the error\n if (hashError) {\n logger.error('hash error', hashError);\n reject(hashError);\n return;\n }\n // replace the password string with the hash password value\n user.password = hash;\n resolve();\n });\n });\n });\n });\n\n return User;\n};\n\n/***/ }),\n/* 66 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"bcrypt\");\n\n/***/ }),\n/* 67 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"axios\");\n\n/***/ }),\n/* 68 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"universal-analytics\");\n\n/***/ }),\n/* 69 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar PassportLocalStrategy = __webpack_require__(24).Strategy;\nvar db = __webpack_require__(6);\nvar logger = __webpack_require__(2);\n\nfunction returnUserAndChannelInfo(userInstance) {\n return new Promise(function (resolve, reject) {\n var userInfo = {};\n userInfo['id'] = userInstance.id;\n userInfo['userName'] = userInstance.userName;\n userInstance.getChannel().then(function (_ref) {\n var channelName = _ref.channelName,\n channelClaimId = _ref.channelClaimId;\n\n userInfo['channelName'] = channelName;\n userInfo['channelClaimId'] = channelClaimId;\n return db.Certificate.getShortChannelIdFromLongChannelId(channelClaimId, channelName);\n }).then(function (shortChannelId) {\n userInfo['shortChannelId'] = shortChannelId;\n resolve(userInfo);\n }).catch(function (error) {\n reject(error);\n });\n });\n}\n\nmodule.exports = new PassportLocalStrategy({\n usernameField: 'username',\n passwordField: 'password'\n}, function (username, password, done) {\n return db.User.findOne({\n where: { userName: username }\n }).then(function (user) {\n if (!user) {\n logger.debug('no user found');\n return done(null, false, { message: 'Incorrect username or password' });\n }\n return user.comparePassword(password).then(function (isMatch) {\n if (!isMatch) {\n logger.debug('incorrect password');\n return done(null, false, { message: 'Incorrect username or password' });\n }\n logger.debug('Password was a match, returning User');\n return returnUserAndChannelInfo(user).then(function (userInfo) {\n return done(null, userInfo);\n }).catch(function (error) {\n return error;\n });\n }).catch(function (error) {\n return error;\n });\n }).catch(function (error) {\n return done(error);\n });\n});\n\n/***/ }),\n/* 70 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar logger = __webpack_require__(2);\nvar passport = __webpack_require__(22);\n\nmodule.exports = function (app) {\n // route for sign up\n app.post('/signup', passport.authenticate('local-signup'), function (req, res) {\n logger.verbose('successful signup for ' + req.user.channelName);\n res.status(200).json({\n success: true,\n channelName: req.user.channelName,\n channelClaimId: req.user.channelClaimId,\n shortChannelId: req.user.shortChannelId\n });\n });\n // route for log in\n app.post('/login', function (req, res, next) {\n passport.authenticate('local-login', function (err, user, info) {\n logger.debug('info:', info);\n if (err) {\n return next(err);\n }\n if (!user) {\n return res.status(400).json({\n success: false,\n message: info.message\n });\n }\n logger.debug('successful login');\n req.logIn(user, function (err) {\n if (err) {\n return next(err);\n }\n return res.status(200).json({\n success: true,\n channelName: req.user.channelName,\n channelClaimId: req.user.channelClaimId,\n shortChannelId: req.user.shortChannelId\n });\n });\n })(req, res, next);\n });\n // route to log out\n app.get('/logout', function (req, res) {\n req.logout();\n res.status(200).json({ success: true, message: 'you successfully logged out' });\n });\n // see if user is authenticated, and return credentials if so\n app.get('/user', function (req, res) {\n if (req.user) {\n res.status(200).json({ success: true, data: req.user });\n } else {\n res.status(401).json({ success: false, message: 'user is not logged in' });\n }\n });\n};\n\n/***/ }),\n/* 71 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar logger = __webpack_require__(2);\nvar multipart = __webpack_require__(72);\n\nvar _require = __webpack_require__(3),\n files = _require.files,\n site = _require.site;\n\nvar multipartMiddleware = multipart({ uploadDir: files.uploadDirectory });\nvar db = __webpack_require__(6);\n\nvar _require2 = __webpack_require__(73),\n claimNameIsAvailable = _require2.claimNameIsAvailable,\n checkChannelAvailability = _require2.checkChannelAvailability,\n publish = _require2.publish;\n\nvar _require3 = __webpack_require__(16),\n getClaimList = _require3.getClaimList,\n resolveUri = _require3.resolveUri,\n getClaim = _require3.getClaim;\n\nvar _require4 = __webpack_require__(25),\n addGetResultsToFileData = _require4.addGetResultsToFileData,\n createBasicPublishParams = _require4.createBasicPublishParams,\n createThumbnailPublishParams = _require4.createThumbnailPublishParams,\n parsePublishApiRequestBody = _require4.parsePublishApiRequestBody,\n parsePublishApiRequestFiles = _require4.parsePublishApiRequestFiles,\n createFileData = _require4.createFileData;\n\nvar errorHandlers = __webpack_require__(26);\n\nvar _require5 = __webpack_require__(17),\n sendGATimingEvent = _require5.sendGATimingEvent;\n\nvar _require6 = __webpack_require__(75),\n authenticateUser = _require6.authenticateUser;\n\nvar _require7 = __webpack_require__(27),\n getChannelData = _require7.getChannelData,\n getChannelClaims = _require7.getChannelClaims,\n getClaimId = _require7.getClaimId;\n\nvar NO_CHANNEL = 'NO_CHANNEL';\nvar NO_CLAIM = 'NO_CLAIM';\n\nmodule.exports = function (app) {\n // route to check whether site has published to a channel\n app.get('/api/channel/availability/:name', function (_ref, res) {\n var ip = _ref.ip,\n originalUrl = _ref.originalUrl,\n params = _ref.params;\n\n checkChannelAvailability(params.name).then(function (result) {\n if (result === true) {\n res.status(200).json(true);\n } else {\n res.status(200).json(false);\n }\n }).catch(function (error) {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n // route to get a short channel id from long channel Id\n app.get('/api/channel/short-id/:longId/:name', function (_ref2, res) {\n var ip = _ref2.ip,\n originalUrl = _ref2.originalUrl,\n params = _ref2.params;\n\n db.Certificate.getShortChannelIdFromLongChannelId(params.longId, params.name).then(function (shortId) {\n res.status(200).json(shortId);\n }).catch(function (error) {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n app.get('/api/channel/data/:channelName/:channelClaimId', function (_ref3, res) {\n var ip = _ref3.ip,\n originalUrl = _ref3.originalUrl,\n body = _ref3.body,\n params = _ref3.params;\n\n var channelName = params.channelName;\n var channelClaimId = params.channelClaimId;\n if (channelClaimId === 'none') channelClaimId = null;\n getChannelData(channelName, channelClaimId, 0).then(function (data) {\n if (data === NO_CHANNEL) {\n return res.status(404).json({ success: false, message: 'No matching channel was found' });\n }\n res.status(200).json({ success: true, data: data });\n }).catch(function (error) {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n app.get('/api/channel/claims/:channelName/:channelClaimId/:page', function (_ref4, res) {\n var ip = _ref4.ip,\n originalUrl = _ref4.originalUrl,\n body = _ref4.body,\n params = _ref4.params;\n\n var channelName = params.channelName;\n var channelClaimId = params.channelClaimId;\n if (channelClaimId === 'none') channelClaimId = null;\n var page = params.page;\n getChannelClaims(channelName, channelClaimId, page).then(function (data) {\n if (data === NO_CHANNEL) {\n return res.status(404).json({ success: false, message: 'No matching channel was found' });\n }\n res.status(200).json({ success: true, data: data });\n }).catch(function (error) {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n // route to run a claim_list request on the daemon\n app.get('/api/claim/list/:name', function (_ref5, res) {\n var ip = _ref5.ip,\n originalUrl = _ref5.originalUrl,\n params = _ref5.params;\n\n getClaimList(params.name).then(function (claimsList) {\n res.status(200).json(claimsList);\n }).catch(function (error) {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n // route to get an asset\n app.get('/api/claim/get/:name/:claimId', function (_ref6, res) {\n var ip = _ref6.ip,\n originalUrl = _ref6.originalUrl,\n params = _ref6.params;\n\n var name = params.name;\n var claimId = params.claimId;\n // resolve the claim\n db.Claim.resolveClaim(name, claimId).then(function (resolveResult) {\n // make sure a claim actually exists at that uri\n if (!resolveResult) {\n throw new Error('No matching uri found in Claim table');\n }\n var fileData = createFileData(resolveResult);\n // get the claim\n return Promise.all([fileData, getClaim(name + '#' + claimId)]);\n }).then(function (_ref7) {\n var _ref8 = _slicedToArray(_ref7, 2),\n fileData = _ref8[0],\n getResult = _ref8[1];\n\n fileData = addGetResultsToFileData(fileData, getResult);\n return Promise.all([db.upsert(db.File, fileData, { name: name, claimId: claimId }, 'File'), getResult]);\n }).then(function (_ref9) {\n var _ref10 = _slicedToArray(_ref9, 2),\n fileRecord = _ref10[0],\n _ref10$ = _ref10[1],\n message = _ref10$.message,\n completed = _ref10$.completed;\n\n res.status(200).json({ success: true, message: message, completed: completed });\n }).catch(function (error) {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n // route to check whether this site published to a claim\n app.get('/api/claim/availability/:name', function (_ref11, res) {\n var ip = _ref11.ip,\n originalUrl = _ref11.originalUrl,\n params = _ref11.params;\n\n claimNameIsAvailable(params.name).then(function (result) {\n res.status(200).json(result);\n }).catch(function (error) {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n // route to run a resolve request on the daemon\n app.get('/api/claim/resolve/:name/:claimId', function (_ref12, res) {\n var headers = _ref12.headers,\n ip = _ref12.ip,\n originalUrl = _ref12.originalUrl,\n params = _ref12.params;\n\n resolveUri(params.name + '#' + params.claimId).then(function (resolvedUri) {\n res.status(200).json(resolvedUri);\n }).catch(function (error) {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n // route to run a publish request on the daemon\n app.post('/api/claim/publish', multipartMiddleware, function (_ref13, res) {\n var body = _ref13.body,\n files = _ref13.files,\n headers = _ref13.headers,\n ip = _ref13.ip,\n originalUrl = _ref13.originalUrl,\n user = _ref13.user;\n\n logger.debug('api/claim/publish req.body:', body);\n logger.debug('api/claim/publish req.files:', files);\n // define variables\n var channelName = void 0,\n channelId = void 0,\n channelPassword = void 0,\n description = void 0,\n fileName = void 0,\n filePath = void 0,\n fileType = void 0,\n gaStartTime = void 0,\n license = void 0,\n name = void 0,\n nsfw = void 0,\n thumbnail = void 0,\n thumbnailFileName = void 0,\n thumbnailFilePath = void 0,\n thumbnailFileType = void 0,\n title = void 0;\n // record the start time of the request\n gaStartTime = Date.now();\n // validate the body and files of the request\n try {\n var _parsePublishApiReque = parsePublishApiRequestBody(body);\n // validateApiPublishRequest(body, files);\n\n\n name = _parsePublishApiReque.name;\n nsfw = _parsePublishApiReque.nsfw;\n license = _parsePublishApiReque.license;\n title = _parsePublishApiReque.title;\n description = _parsePublishApiReque.description;\n thumbnail = _parsePublishApiReque.thumbnail;\n\n var _parsePublishApiReque2 = parsePublishApiRequestFiles(files);\n\n fileName = _parsePublishApiReque2.fileName;\n filePath = _parsePublishApiReque2.filePath;\n fileType = _parsePublishApiReque2.fileType;\n thumbnailFileName = _parsePublishApiReque2.thumbnailFileName;\n thumbnailFilePath = _parsePublishApiReque2.thumbnailFilePath;\n thumbnailFileType = _parsePublishApiReque2.thumbnailFileType;\n channelName = body.channelName;\n channelId = body.channelId;\n channelPassword = body.channelPassword;\n } catch (error) {\n return res.status(400).json({ success: false, message: error.message });\n }\n // check channel authorization\n Promise.all([authenticateUser(channelName, channelId, channelPassword, user), claimNameIsAvailable(name), createBasicPublishParams(filePath, name, title, description, license, nsfw, thumbnail), createThumbnailPublishParams(thumbnailFilePath, name, license, nsfw)]).then(function (_ref14) {\n var _ref15 = _slicedToArray(_ref14, 4),\n _ref15$ = _ref15[0],\n channelName = _ref15$.channelName,\n channelClaimId = _ref15$.channelClaimId,\n validatedClaimName = _ref15[1],\n publishParams = _ref15[2],\n thumbnailPublishParams = _ref15[3];\n\n // add channel details to the publish params\n if (channelName && channelClaimId) {\n publishParams['channel_name'] = channelName;\n publishParams['channel_id'] = channelClaimId;\n }\n // publish the thumbnail\n if (thumbnailPublishParams) {\n publish(thumbnailPublishParams, thumbnailFileName, thumbnailFileType);\n }\n // publish the asset\n return publish(publishParams, fileName, fileType);\n }).then(function (result) {\n res.status(200).json({\n success: true,\n message: 'publish completed successfully',\n data: {\n name: name,\n claimId: result.claim_id,\n url: site.host + '/' + result.claim_id + '/' + name,\n lbryTx: result\n }\n });\n // record the publish end time and send to google analytics\n sendGATimingEvent('end-to-end', 'publish', fileType, gaStartTime, Date.now());\n }).catch(function (error) {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n // route to get a short claim id from long claim Id\n app.get('/api/claim/short-id/:longId/:name', function (_ref16, res) {\n var ip = _ref16.ip,\n originalUrl = _ref16.originalUrl,\n body = _ref16.body,\n params = _ref16.params;\n\n db.Claim.getShortClaimIdFromLongClaimId(params.longId, params.name).then(function (shortId) {\n res.status(200).json({ success: true, data: shortId });\n }).catch(function (error) {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n app.post('/api/claim/long-id', function (_ref17, res) {\n var ip = _ref17.ip,\n originalUrl = _ref17.originalUrl,\n body = _ref17.body,\n params = _ref17.params;\n\n logger.debug('body:', body);\n var channelName = body.channelName;\n var channelClaimId = body.channelClaimId;\n var claimName = body.claimName;\n var claimId = body.claimId;\n getClaimId(channelName, channelClaimId, claimName, claimId).then(function (result) {\n if (result === NO_CHANNEL) {\n return res.status(404).json({ success: false, message: 'No matching channel could be found' });\n }\n if (result === NO_CLAIM) {\n return res.status(404).json({ success: false, message: 'No matching claim id could be found' });\n }\n res.status(200).json({ success: true, data: result });\n }).catch(function (error) {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n app.get('/api/claim/data/:claimName/:claimId', function (_ref18, res) {\n var ip = _ref18.ip,\n originalUrl = _ref18.originalUrl,\n body = _ref18.body,\n params = _ref18.params;\n\n var claimName = params.claimName;\n var claimId = params.claimId;\n if (claimId === 'none') claimId = null;\n db.Claim.resolveClaim(claimName, claimId).then(function (claimInfo) {\n if (!claimInfo) {\n return res.status(404).json({ success: false, message: 'No claim could be found' });\n }\n res.status(200).json({ success: true, data: claimInfo });\n }).catch(function (error) {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n // route to see if asset is available locally\n app.get('/api/file/availability/:name/:claimId', function (_ref19, res) {\n var ip = _ref19.ip,\n originalUrl = _ref19.originalUrl,\n params = _ref19.params;\n\n var name = params.name;\n var claimId = params.claimId;\n db.File.findOne({ where: { name: name, claimId: claimId } }).then(function (result) {\n if (result) {\n return res.status(200).json({ success: true, data: true });\n }\n res.status(200).json({ success: true, data: false });\n }).catch(function (error) {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n};\n\n/***/ }),\n/* 72 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"connect-multiparty\");\n\n/***/ }),\n/* 73 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar logger = __webpack_require__(2);\nvar db = __webpack_require__(6);\nvar lbryApi = __webpack_require__(16);\nvar publishHelpers = __webpack_require__(25);\nvar config = __webpack_require__(3);\n\nmodule.exports = {\n publish: function publish(publishParams, fileName, fileType) {\n return new Promise(function (resolve, reject) {\n var publishResults = void 0,\n certificateId = void 0,\n channelName = void 0;\n // publish the file\n return lbryApi.publishClaim(publishParams).then(function (tx) {\n logger.info('Successfully published ' + publishParams.name + ' ' + fileName, tx);\n publishResults = tx;\n // get the channel information\n if (publishParams.channel_name) {\n logger.debug('this claim was published in channel: ' + publishParams.channel_name);\n return db.Channel.findOne({ where: { channelName: publishParams.channel_name } });\n } else {\n logger.debug('this claim was not published in a channel');\n return null;\n }\n }).then(function (channel) {\n // set channel information\n certificateId = null;\n channelName = null;\n if (channel) {\n certificateId = channel.channelClaimId;\n channelName = channel.channelName;\n }\n logger.debug('certificateId: ' + certificateId);\n }).then(function () {\n // create the File record\n var fileRecord = {\n name: publishParams.name,\n claimId: publishResults.claim_id,\n title: publishParams.metadata.title,\n description: publishParams.metadata.description,\n address: publishParams.claim_address,\n outpoint: publishResults.txid + ':' + publishResults.nout,\n height: 0,\n fileName: fileName,\n filePath: publishParams.file_path,\n fileType: fileType,\n nsfw: publishParams.metadata.nsfw\n };\n // create the Claim record\n var claimRecord = {\n name: publishParams.name,\n claimId: publishResults.claim_id,\n title: publishParams.metadata.title,\n description: publishParams.metadata.description,\n address: publishParams.claim_address,\n thumbnail: publishParams.metadata.thumbnail,\n outpoint: publishResults.txid + ':' + publishResults.nout,\n height: 0,\n contentType: fileType,\n nsfw: publishParams.metadata.nsfw,\n amount: publishParams.bid,\n certificateId: certificateId,\n channelName: channelName\n };\n // upsert criteria\n var upsertCriteria = {\n name: publishParams.name,\n claimId: publishResults.claim_id\n };\n // upsert the records\n return Promise.all([db.upsert(db.File, fileRecord, upsertCriteria, 'File'), db.upsert(db.Claim, claimRecord, upsertCriteria, 'Claim')]);\n }).then(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n file = _ref2[0],\n claim = _ref2[1];\n\n logger.debug('File and Claim records successfully created');\n return Promise.all([file.setClaim(claim), claim.setFile(file)]);\n }).then(function () {\n logger.debug('File and Claim records successfully associated');\n resolve(publishResults); // resolve the promise with the result from lbryApi.publishClaim;\n }).catch(function (error) {\n logger.error('PUBLISH ERROR', error);\n publishHelpers.deleteTemporaryFile(publishParams.file_path); // delete the local file\n reject(error);\n });\n });\n },\n claimNameIsAvailable: function claimNameIsAvailable(name) {\n // find any records where the name is used\n return db.File.findAll({ where: { name: name } }).then(function (result) {\n if (result.length >= 1) {\n var claimAddress = config.wallet.lbryClaimAddress;\n // filter out any results that were not published from spee.ch's wallet address\n var filteredResult = result.filter(function (claim) {\n return claim.address === claimAddress;\n });\n // return based on whether any non-spee.ch claims were left\n if (filteredResult.length >= 1) {\n throw new Error('That claim is already in use');\n };\n return name;\n };\n return name;\n });\n },\n checkChannelAvailability: function checkChannelAvailability(name) {\n return new Promise(function (resolve, reject) {\n // find any records where the name is used\n db.Channel.findAll({ where: { channelName: name } }).then(function (result) {\n if (result.length >= 1) {\n return resolve(false);\n }\n resolve(true);\n }).catch(function (error) {\n reject(error);\n });\n });\n }\n};\n\n/***/ }),\n/* 74 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"fs\");\n\n/***/ }),\n/* 75 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar db = __webpack_require__(6);\nvar logger = __webpack_require__(2);\n\nmodule.exports = {\n authenticateUser: function authenticateUser(channelName, channelId, channelPassword, user) {\n // case: no channelName or channel Id are provided (anonymous), regardless of whether user token is provided\n if (!channelName && !channelId) {\n return {\n channelName: null,\n channelClaimId: null\n };\n }\n // case: channelName or channel Id are provided with user token\n if (user) {\n if (channelName && channelName !== user.channelName) {\n throw new Error('the provided channel name does not match user credentials');\n }\n if (channelId && channelId !== user.channelClaimId) {\n throw new Error('the provided channel id does not match user credentials');\n }\n return {\n channelName: user.channelName,\n channelClaimId: user.channelClaimId\n };\n }\n // case: channelName or channel Id are provided with password instead of user token\n if (!channelPassword) throw new Error('no channel password provided');\n return module.exports.authenticateChannelCredentials(channelName, channelId, channelPassword);\n },\n authenticateChannelCredentials: function authenticateChannelCredentials(channelName, channelId, userPassword) {\n return new Promise(function (resolve, reject) {\n // hoisted variables\n var channelData = void 0;\n // build the params for finding the channel\n var channelFindParams = {};\n if (channelName) channelFindParams['channelName'] = channelName;\n if (channelId) channelFindParams['channelClaimId'] = channelId;\n // find the channel\n db.Channel.findOne({\n where: channelFindParams\n }).then(function (channel) {\n if (!channel) {\n logger.debug('no channel found');\n throw new Error('Authentication failed, you do not have access to that channel');\n }\n channelData = channel.get();\n logger.debug('channel data:', channelData);\n return db.User.findOne({\n where: { userName: channelData.channelName.substring(1) }\n });\n }).then(function (user) {\n if (!user) {\n logger.debug('no user found');\n throw new Error('Authentication failed, you do not have access to that channel');\n }\n return user.comparePassword(userPassword);\n }).then(function (isMatch) {\n if (!isMatch) {\n logger.debug('incorrect password');\n throw new Error('Authentication failed, you do not have access to that channel');\n }\n logger.debug('...password was a match...');\n resolve(channelData);\n }).catch(function (error) {\n reject(error);\n });\n });\n }\n};\n\n/***/ }),\n/* 76 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar CLAIMS_PER_PAGE = 12;\n\nmodule.exports = {\n returnPaginatedChannelClaims: function returnPaginatedChannelClaims(channelName, longChannelClaimId, claims, page) {\n var totalPages = module.exports.determineTotalPages(claims);\n var paginationPage = module.exports.getPageFromQuery(page);\n var viewData = {\n channelName: channelName,\n longChannelClaimId: longChannelClaimId,\n claims: module.exports.extractPageFromClaims(claims, paginationPage),\n previousPage: module.exports.determinePreviousPage(paginationPage),\n currentPage: paginationPage,\n nextPage: module.exports.determineNextPage(totalPages, paginationPage),\n totalPages: totalPages,\n totalResults: module.exports.determineTotalClaims(claims)\n };\n return viewData;\n },\n getPageFromQuery: function getPageFromQuery(page) {\n if (page) {\n return parseInt(page);\n }\n return 1;\n },\n extractPageFromClaims: function extractPageFromClaims(claims, pageNumber) {\n if (!claims) {\n return []; // if no claims, return this default\n }\n // logger.debug('claims is array?', Array.isArray(claims));\n // logger.debug(`pageNumber ${pageNumber} is number?`, Number.isInteger(pageNumber));\n var claimStartIndex = (pageNumber - 1) * CLAIMS_PER_PAGE;\n var claimEndIndex = claimStartIndex + CLAIMS_PER_PAGE;\n var pageOfClaims = claims.slice(claimStartIndex, claimEndIndex);\n return pageOfClaims;\n },\n determineTotalPages: function determineTotalPages(claims) {\n if (!claims) {\n return 0;\n } else {\n var totalClaims = claims.length;\n if (totalClaims < CLAIMS_PER_PAGE) {\n return 1;\n }\n var fullPages = Math.floor(totalClaims / CLAIMS_PER_PAGE);\n var remainder = totalClaims % CLAIMS_PER_PAGE;\n if (remainder === 0) {\n return fullPages;\n }\n return fullPages + 1;\n }\n },\n determinePreviousPage: function determinePreviousPage(currentPage) {\n if (currentPage === 1) {\n return null;\n }\n return currentPage - 1;\n },\n determineNextPage: function determineNextPage(totalPages, currentPage) {\n if (currentPage === totalPages) {\n return null;\n }\n return currentPage + 1;\n },\n determineTotalClaims: function determineTotalClaims(claims) {\n if (!claims) {\n return 0;\n }\n return claims.length;\n }\n};\n\n/***/ }),\n/* 77 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _require = __webpack_require__(3),\n site = _require.site;\n\nvar handlePageRender = __webpack_require__(28);\n\nmodule.exports = function (app) {\n // route for the home page\n app.get('/', function (req, res) {\n handlePageRender(req, res);\n });\n // route to display login page\n app.get('/login', function (req, res) {\n handlePageRender(req, res);\n });\n // route to show 'about' page\n app.get('/about', function (req, res) {\n handlePageRender(req, res);\n });\n // route to display a list of the trending images\n app.get('/trending', function (req, res) {\n res.status(301).redirect('/popular');\n });\n app.get('/popular', function (req, res) {\n handlePageRender(req, res);\n });\n // route to display a list of the trending images\n app.get('/new', function (req, res) {\n handlePageRender(req, res);\n });\n // route to send embedable video player (for twitter)\n app.get('/embed/:claimId/:name', function (_ref, res) {\n var params = _ref.params;\n\n var claimId = params.claimId;\n var name = params.name;\n var host = site.host;\n // get and render the content\n res.status(200).render('embed', { layout: 'embed', host: host, claimId: claimId, name: name });\n });\n};\n\n/***/ }),\n/* 78 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nexports.default = function () {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments[1];\n\n switch (action.type) {\n case actions.FILE_SELECTED:\n return Object.assign({}, initialState, { // note: clears to initial state\n file: action.data\n });\n case actions.FILE_CLEAR:\n return initialState;\n case actions.METADATA_UPDATE:\n return Object.assign({}, state, {\n metadata: Object.assign({}, state.metadata, _defineProperty({}, action.data.name, action.data.value))\n });\n case actions.CLAIM_UPDATE:\n return Object.assign({}, state, {\n claim: action.data\n });\n case actions.SET_PUBLISH_IN_CHANNEL:\n return Object.assign({}, state, {\n publishInChannel: action.channel\n });\n case actions.PUBLISH_STATUS_UPDATE:\n return Object.assign({}, state, {\n status: action.data\n });\n case actions.ERROR_UPDATE:\n return Object.assign({}, state, {\n error: Object.assign({}, state.error, _defineProperty({}, action.data.name, action.data.value))\n });\n case actions.SELECTED_CHANNEL_UPDATE:\n return Object.assign({}, state, {\n selectedChannel: action.data\n });\n case actions.TOGGLE_METADATA_INPUTS:\n return Object.assign({}, state, {\n showMetadataInputs: action.data\n });\n case actions.THUMBNAIL_NEW:\n return Object.assign({}, state, {\n thumbnail: action.data\n });\n default:\n return state;\n }\n};\n\nvar _publish_action_types = __webpack_require__(31);\n\nvar actions = _interopRequireWildcard(_publish_action_types);\n\nvar _publish_channel_select_states = __webpack_require__(32);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar _require = __webpack_require__(3),\n publish = _require.publish;\n\nvar initialState = {\n publishInChannel: false,\n selectedChannel: _publish_channel_select_states.LOGIN,\n showMetadataInputs: false,\n status: {\n status: null,\n message: null\n },\n error: {\n file: null,\n url: null,\n channel: null,\n publishSubmit: null\n },\n file: null,\n claim: '',\n metadata: {\n title: '',\n description: '',\n license: '',\n nsfw: false\n },\n thumbnailChannel: publish.thumbnailChannel,\n thumbnailChannelId: publish.thumbnailChannelId,\n thumbnail: null\n};\n\n/***/ }),\n/* 79 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nexports.default = function () {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments[1];\n\n switch (action.type) {\n case actions.CHANNEL_UPDATE:\n return Object.assign({}, state, {\n loggedInChannel: action.data\n });\n default:\n return state;\n }\n};\n\nvar _channel_action_types = __webpack_require__(33);\n\nvar actions = _interopRequireWildcard(_channel_action_types);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nvar initialState = {\n loggedInChannel: {\n name: null,\n shortId: null,\n longId: null\n }\n};\n\n/***/ }),\n/* 80 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nexports.default = function () {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments[1];\n\n switch (action.type) {\n // handle request\n case actions.REQUEST_ERROR:\n return Object.assign({}, state, {\n request: Object.assign({}, state.request, {\n error: action.data\n })\n });\n case actions.REQUEST_UPDATE:\n return Object.assign({}, state, {\n request: Object.assign({}, state.request, {\n type: action.data.requestType,\n id: action.data.requestId\n })\n });\n // store requests\n case actions.REQUEST_LIST_ADD:\n return Object.assign({}, state, {\n requestList: Object.assign({}, state.requestList, _defineProperty({}, action.data.id, {\n error: action.data.error,\n key: action.data.key\n }))\n });\n // asset data\n case actions.ASSET_ADD:\n return Object.assign({}, state, {\n assetList: Object.assign({}, state.assetList, _defineProperty({}, action.data.id, {\n error: action.data.error,\n name: action.data.name,\n claimId: action.data.claimId,\n shortId: action.data.shortId,\n claimData: action.data.claimData\n }))\n });\n // channel data\n case actions.CHANNEL_ADD:\n return Object.assign({}, state, {\n channelList: Object.assign({}, state.channelList, _defineProperty({}, action.data.id, {\n name: action.data.name,\n longId: action.data.longId,\n shortId: action.data.shortId,\n claimsData: action.data.claimsData\n }))\n });\n case actions.CHANNEL_CLAIMS_UPDATE_SUCCESS:\n return Object.assign({}, state, {\n channelList: Object.assign({}, state.channelList, _defineProperty({}, action.data.channelListId, Object.assign({}, state.channelList[action.data.channelListId], {\n claimsData: action.data.claimsData\n })))\n });\n // display an asset\n case actions.FILE_AVAILABILITY_UPDATE:\n return Object.assign({}, state, {\n displayAsset: Object.assign({}, state.displayAsset, {\n status: action.data\n })\n });\n case actions.DISPLAY_ASSET_ERROR:\n return Object.assign({}, state, {\n displayAsset: Object.assign({}, state.displayAsset, {\n error: action.data,\n status: _asset_display_states.ERROR\n })\n });\n default:\n return state;\n }\n};\n\nvar _show_action_types = __webpack_require__(12);\n\nvar actions = _interopRequireWildcard(_show_action_types);\n\nvar _asset_display_states = __webpack_require__(34);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar initialState = {\n request: {\n error: null,\n type: null,\n id: null\n },\n requestList: {},\n channelList: {},\n assetList: {},\n displayAsset: {\n error: null,\n status: _asset_display_states.LOCAL_CHECK\n }\n};\n\n/***/ }),\n/* 81 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nexports.default = function () {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments[1];\n\n switch (action.type) {\n default:\n return state;\n }\n};\n\nvar _require = __webpack_require__(3),\n site = _require.site;\n\nvar initialState = {\n host: site.host\n};\n\n/***/ }),\n/* 82 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"react-ga\");\n\n/***/ }),\n/* 83 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _SEO = __webpack_require__(9);\n\nvar _SEO2 = _interopRequireDefault(_SEO);\n\nvar _NavBar = __webpack_require__(7);\n\nvar _NavBar2 = _interopRequireDefault(_NavBar);\n\nvar _PublishTool = __webpack_require__(91);\n\nvar _PublishTool2 = _interopRequireDefault(_PublishTool);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar HomePage = function (_React$Component) {\n _inherits(HomePage, _React$Component);\n\n function HomePage() {\n _classCallCheck(this, HomePage);\n\n return _possibleConstructorReturn(this, (HomePage.__proto__ || Object.getPrototypeOf(HomePage)).apply(this, arguments));\n }\n\n _createClass(HomePage, [{\n key: 'render',\n value: function render() {\n return _react2.default.createElement(\n 'div',\n { className: 'row row--tall flex-container--column' },\n _react2.default.createElement(_SEO2.default, null),\n _react2.default.createElement(_NavBar2.default, null),\n _react2.default.createElement(\n 'div',\n { className: 'row row--tall row--padded flex-container--column' },\n _react2.default.createElement(_PublishTool2.default, null)\n )\n );\n }\n }]);\n\n return HomePage;\n}(_react2.default.Component);\n\n;\n\nexports.default = HomePage;\n\n/***/ }),\n/* 84 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _require = __webpack_require__(3),\n siteTitle = _require.site.title;\n\nvar createPageTitle = exports.createPageTitle = function createPageTitle(pageTitle) {\n if (!pageTitle) {\n return '' + siteTitle;\n }\n return siteTitle + ' - ' + pageTitle;\n};\n\n/***/ }),\n/* 85 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _require = __webpack_require__(3),\n _require$site = _require.site,\n title = _require$site.title,\n host = _require$site.host,\n description = _require$site.description,\n _require$claim = _require.claim,\n defaultThumbnail = _require$claim.defaultThumbnail,\n defaultDescription = _require$claim.defaultDescription;\n\nvar determineOgThumbnailContentType = function determineOgThumbnailContentType(thumbnail) {\n if (thumbnail) {\n var fileExt = thumbnail.substring(thumbnail.lastIndexOf('.'));\n switch (fileExt) {\n case 'jpeg':\n case 'jpg':\n return 'image/jpeg';\n case 'png':\n return 'image/png';\n case 'gif':\n return 'image/gif';\n case 'mp4':\n return 'video/mp4';\n default:\n return 'image/jpeg';\n }\n }\n return '';\n};\n\nvar createBasicMetaTags = function createBasicMetaTags() {\n return [{ property: 'og:title', content: title }, { property: 'og:url', content: host }, { property: 'og:site_name', content: title }, { property: 'og:description', content: description }, { property: 'twitter:site', content: '@spee_ch' }, { property: 'twitter:card', content: 'summary' }];\n};\n\nvar createChannelMetaTags = function createChannelMetaTags(channel) {\n var name = channel.name,\n longId = channel.longId;\n\n return [{ property: 'og:title', content: name + ' on ' + title }, { property: 'og:url', content: host + '/' + name + ':' + longId }, { property: 'og:site_name', content: title }, { property: 'og:description', content: name + ', a channel on ' + title }, { property: 'twitter:site', content: '@spee_ch' }, { property: 'twitter:card', content: 'summary' }];\n};\n\nvar createAssetMetaTags = function createAssetMetaTags(asset) {\n var claimData = asset.claimData;\n var contentType = claimData.contentType;\n\n var embedUrl = host + '/' + claimData.claimId + '/' + claimData.name;\n var showUrl = host + '/' + claimData.claimId + '/' + claimData.name;\n var source = host + '/' + claimData.claimId + '/' + claimData.name + '.' + claimData.fileExt;\n var ogTitle = claimData.title || claimData.name;\n var ogDescription = claimData.description || defaultDescription;\n var ogThumbnailContentType = determineOgThumbnailContentType(claimData.thumbnail);\n var ogThumbnail = claimData.thumbnail || defaultThumbnail;\n var metaTags = [{ property: 'og:title', content: ogTitle }, { property: 'og:url', content: showUrl }, { property: 'og:site_name', content: title }, { property: 'og:description', content: ogDescription }, { property: 'og:image:width', content: 600 }, { property: 'og:image:height', content: 315 }, { property: 'twitter:site', content: '@spee_ch' }];\n if (contentType === 'video/mp4' || contentType === 'video/webm') {\n metaTags.push({ property: 'og:video', content: source });\n metaTags.push({ property: 'og:video:secure_url', content: source });\n metaTags.push({ property: 'og:video:type', content: contentType });\n metaTags.push({ property: 'og:image', content: ogThumbnail });\n metaTags.push({ property: 'og:image:type', content: ogThumbnailContentType });\n metaTags.push({ property: 'og:type', content: 'video' });\n metaTags.push({ property: 'twitter:card', content: 'player' });\n metaTags.push({ property: 'twitter:player', content: embedUrl });\n metaTags.push({ property: 'twitter:player:width', content: 600 });\n metaTags.push({ property: 'twitter:text:player_width', content: 600 });\n metaTags.push({ property: 'twitter:player:height', content: 337 });\n metaTags.push({ property: 'twitter:player:stream', content: source });\n metaTags.push({ property: 'twitter:player:stream:content_type', content: contentType });\n } else {\n metaTags.push({ property: 'og:image', content: source });\n metaTags.push({ property: 'og:image:type', content: contentType });\n metaTags.push({ property: 'og:type', content: 'article' });\n metaTags.push({ property: 'twitter:card', content: 'summary_large_image' });\n }\n return metaTags;\n};\n\nvar createMetaTags = exports.createMetaTags = function createMetaTags(asset, channel) {\n if (asset) {\n return createAssetMetaTags(asset);\n };\n if (channel) {\n return createChannelMetaTags(channel);\n };\n return createBasicMetaTags();\n};\n\n/***/ }),\n/* 86 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _require = __webpack_require__(3),\n host = _require.site.host;\n\nvar createBasicCanonicalLink = function createBasicCanonicalLink(page) {\n if (!page) {\n return '' + host;\n };\n return host + '/' + page;\n};\n\nvar createAssetCanonicalLink = function createAssetCanonicalLink(asset) {\n var channelName = void 0,\n certificateId = void 0,\n name = void 0,\n claimId = void 0;\n if (asset.claimData) {\n var _asset$claimData = asset.claimData;\n channelName = _asset$claimData.channelName;\n certificateId = _asset$claimData.certificateId;\n name = _asset$claimData.name;\n claimId = _asset$claimData.claimId;\n };\n if (channelName) {\n return host + '/' + channelName + ':' + certificateId + '/' + name;\n };\n return host + '/' + claimId + '/' + name;\n};\n\nvar createChannelCanonicalLink = function createChannelCanonicalLink(channel) {\n var name = channel.name,\n longId = channel.longId;\n\n return host + '/' + name + ':' + longId;\n};\n\nvar createCanonicalLink = exports.createCanonicalLink = function createCanonicalLink(asset, channel, page) {\n if (asset) {\n return createAssetCanonicalLink(asset);\n }\n if (channel) {\n return createChannelCanonicalLink(channel);\n }\n if (page) {\n return createBasicCanonicalLink(page);\n }\n return createBasicCanonicalLink();\n};\n\n/***/ }),\n/* 87 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactRouterDom = __webpack_require__(4);\n\nvar _Logo = __webpack_require__(88);\n\nvar _Logo2 = _interopRequireDefault(_Logo);\n\nvar _NavBarChannelOptionsDropdown = __webpack_require__(89);\n\nvar _NavBarChannelOptionsDropdown2 = _interopRequireDefault(_NavBarChannelOptionsDropdown);\n\nvar _request = __webpack_require__(11);\n\nvar _request2 = _interopRequireDefault(_request);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar VIEW = 'VIEW';\nvar LOGOUT = 'LOGOUT';\n\nvar NavBar = function (_React$Component) {\n _inherits(NavBar, _React$Component);\n\n function NavBar(props) {\n _classCallCheck(this, NavBar);\n\n var _this = _possibleConstructorReturn(this, (NavBar.__proto__ || Object.getPrototypeOf(NavBar)).call(this, props));\n\n _this.checkForLoggedInUser = _this.checkForLoggedInUser.bind(_this);\n _this.logoutUser = _this.logoutUser.bind(_this);\n _this.handleSelection = _this.handleSelection.bind(_this);\n return _this;\n }\n\n _createClass(NavBar, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n // check to see if the user is already logged in\n this.checkForLoggedInUser();\n }\n }, {\n key: 'checkForLoggedInUser',\n value: function checkForLoggedInUser() {\n var _this2 = this;\n\n var params = { credentials: 'include' };\n (0, _request2.default)('/user', params).then(function (_ref) {\n var data = _ref.data;\n\n _this2.props.onChannelLogin(data.channelName, data.shortChannelId, data.channelClaimId);\n }).catch(function (error) {\n console.log('/user error:', error.message);\n });\n }\n }, {\n key: 'logoutUser',\n value: function logoutUser() {\n var _this3 = this;\n\n var params = { credentials: 'include' };\n (0, _request2.default)('/logout', params).then(function () {\n _this3.props.onChannelLogout();\n }).catch(function (error) {\n console.log('/logout error', error.message);\n });\n }\n }, {\n key: 'handleSelection',\n value: function handleSelection(event) {\n var value = event.target.selectedOptions[0].value;\n switch (value) {\n case LOGOUT:\n this.logoutUser();\n break;\n case VIEW:\n // redirect to channel page\n this.props.history.push('/' + this.props.channelName + ':' + this.props.channelLongId);\n break;\n default:\n break;\n }\n }\n }, {\n key: 'render',\n value: function render() {\n return _react2.default.createElement(\n 'div',\n { className: 'row row--wide nav-bar' },\n _react2.default.createElement(\n 'div',\n { className: 'row row--padded row--short flex-container--row flex-container--space-between-center' },\n _react2.default.createElement(_Logo2.default, null),\n _react2.default.createElement(\n 'div',\n { className: 'nav-bar--center' },\n _react2.default.createElement(\n 'span',\n { className: 'nav-bar-tagline' },\n 'Open-source, decentralized image and video sharing.'\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'nav-bar--right' },\n _react2.default.createElement(\n _reactRouterDom.NavLink,\n { className: 'nav-bar-link link--nav', activeClassName: 'link--nav-active', to: '/', exact: true },\n 'Publish'\n ),\n _react2.default.createElement(\n _reactRouterDom.NavLink,\n { className: 'nav-bar-link link--nav', activeClassName: 'link--nav-active', to: '/about' },\n 'About'\n ),\n this.props.channelName ? _react2.default.createElement(_NavBarChannelOptionsDropdown2.default, {\n channelName: this.props.channelName,\n handleSelection: this.handleSelection,\n defaultSelection: this.props.channelName,\n VIEW: VIEW,\n LOGOUT: LOGOUT\n }) : _react2.default.createElement(\n _reactRouterDom.NavLink,\n { id: 'nav-bar-login-link', className: 'nav-bar-link link--nav', activeClassName: 'link--nav-active', to: '/login' },\n 'Channel'\n )\n )\n )\n );\n }\n }]);\n\n return NavBar;\n}(_react2.default.Component);\n\nexports.default = (0, _reactRouterDom.withRouter)(NavBar);\n\n/***/ }),\n/* 88 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactRouterDom = __webpack_require__(4);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction Logo() {\n return _react2.default.createElement(\n 'svg',\n { 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' },\n _react2.default.createElement(\n _reactRouterDom.Link,\n { to: '/' },\n _react2.default.createElement(\n 'title',\n null,\n 'Logo'\n ),\n _react2.default.createElement(\n 'desc',\n null,\n 'Spee.ch logo'\n ),\n _react2.default.createElement(\n 'g',\n { id: 'About' },\n _react2.default.createElement(\n 'g',\n { id: 'Publish-Form-V2-_x28_filled_x29_', transform: 'translate(-42.000000, -23.000000)' },\n _react2.default.createElement(\n 'g',\n { id: 'Group-17', transform: 'translate(42.000000, 22.000000)' },\n _react2.default.createElement(\n 'text',\n { transform: 'matrix(1 0 0 1 0 20)', fontSize: '25', fontFamily: 'Roboto' },\n 'Spee 10000000) {\n throw new Error('Sorry, images are limited to 10 megabytes.');\n }\n break;\n case 'image/gif':\n if (file.size > 50000000) {\n throw new Error('Sorry, GIFs are limited to 50 megabytes.');\n }\n break;\n case 'video/mp4':\n if (file.size > 50000000) {\n throw new Error('Sorry, videos are limited to 50 megabytes.');\n }\n break;\n default:\n throw new Error(file.type + ' is not a supported file type. Only, .jpeg, .png, .gif, and .mp4 files are currently supported.');\n }\n }\n};\n\n/***/ }),\n/* 95 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = __webpack_require__(10);\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Preview = function (_React$Component) {\n _inherits(Preview, _React$Component);\n\n function Preview(props) {\n _classCallCheck(this, Preview);\n\n var _this = _possibleConstructorReturn(this, (Preview.__proto__ || Object.getPrototypeOf(Preview)).call(this, props));\n\n _this.state = {\n imgSource: '',\n defaultThumbnail: '/assets/img/video_thumb_default.png'\n };\n return _this;\n }\n\n _createClass(Preview, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.setPreviewImageSource(this.props.file);\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(newProps) {\n if (newProps.file !== this.props.file) {\n this.setPreviewImageSource(newProps.file);\n }\n if (newProps.thumbnail !== this.props.thumbnail) {\n if (newProps.thumbnail) {\n this.setPreviewImageSourceFromFile(newProps.thumbnail);\n } else {\n this.setState({ imgSource: this.state.defaultThumbnail });\n }\n }\n }\n }, {\n key: 'setPreviewImageSourceFromFile',\n value: function setPreviewImageSourceFromFile(file) {\n var _this2 = this;\n\n var previewReader = new FileReader();\n previewReader.readAsDataURL(file);\n previewReader.onloadend = function () {\n _this2.setState({ imgSource: previewReader.result });\n };\n }\n }, {\n key: 'setPreviewImageSource',\n value: function setPreviewImageSource(file) {\n if (file.type !== 'video/mp4') {\n this.setPreviewImageSourceFromFile(file);\n } else {\n if (this.props.thumbnail) {\n this.setPreviewImageSourceFromFile(this.props.thumbnail);\n }\n this.setState({ imgSource: this.state.defaultThumbnail });\n }\n }\n }, {\n key: 'render',\n value: function render() {\n return _react2.default.createElement('img', {\n id: 'dropzone-preview',\n src: this.state.imgSource,\n className: this.props.dimPreview ? 'dim' : '',\n alt: 'publish preview'\n });\n }\n }]);\n\n return Preview;\n}(_react2.default.Component);\n\n;\n\nPreview.propTypes = {\n dimPreview: _propTypes2.default.bool.isRequired,\n file: _propTypes2.default.object.isRequired,\n thumbnail: _propTypes2.default.object\n};\n\nexports.default = Preview;\n\n/***/ }),\n/* 96 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _publish = __webpack_require__(5);\n\nvar _view = __webpack_require__(97);\n\nvar _view2 = _interopRequireDefault(_view);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapStateToProps = function mapStateToProps(_ref) {\n var channel = _ref.channel,\n publish = _ref.publish;\n\n return {\n file: publish.file\n };\n};\n\nvar mapDispatchToProps = {\n clearFile: _publish.clearFile,\n startPublish: _publish.startPublish\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view2.default);\n\n/***/ }),\n/* 97 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactRouterDom = __webpack_require__(4);\n\nvar _Dropzone = __webpack_require__(37);\n\nvar _Dropzone2 = _interopRequireDefault(_Dropzone);\n\nvar _PublishTitleInput = __webpack_require__(98);\n\nvar _PublishTitleInput2 = _interopRequireDefault(_PublishTitleInput);\n\nvar _PublishUrlInput = __webpack_require__(100);\n\nvar _PublishUrlInput2 = _interopRequireDefault(_PublishUrlInput);\n\nvar _PublishThumbnailInput = __webpack_require__(103);\n\nvar _PublishThumbnailInput2 = _interopRequireDefault(_PublishThumbnailInput);\n\nvar _PublishMetadataInputs = __webpack_require__(105);\n\nvar _PublishMetadataInputs2 = _interopRequireDefault(_PublishMetadataInputs);\n\nvar _ChannelSelect = __webpack_require__(108);\n\nvar _ChannelSelect2 = _interopRequireDefault(_ChannelSelect);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar PublishDetails = function (_React$Component) {\n _inherits(PublishDetails, _React$Component);\n\n function PublishDetails(props) {\n _classCallCheck(this, PublishDetails);\n\n var _this = _possibleConstructorReturn(this, (PublishDetails.__proto__ || Object.getPrototypeOf(PublishDetails)).call(this, props));\n\n _this.onPublishSubmit = _this.onPublishSubmit.bind(_this);\n return _this;\n }\n\n _createClass(PublishDetails, [{\n key: 'onPublishSubmit',\n value: function onPublishSubmit() {\n this.props.startPublish(this.props.history);\n }\n }, {\n key: 'render',\n value: function render() {\n return _react2.default.createElement(\n 'div',\n { className: 'row row--no-bottom' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--10' },\n _react2.default.createElement(_PublishTitleInput2.default, null)\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--5 column--sml-10' },\n _react2.default.createElement(\n 'div',\n { className: 'row row--padded' },\n _react2.default.createElement(_Dropzone2.default, null)\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--5 column--sml-10 align-content-top' },\n _react2.default.createElement(\n 'div',\n { id: 'publish-active-area', className: 'row row--padded' },\n _react2.default.createElement(\n 'div',\n { className: 'row row--padded row--no-top row--wide' },\n _react2.default.createElement(_PublishUrlInput2.default, null)\n ),\n _react2.default.createElement(\n 'div',\n { className: 'row row--padded row--no-top row--wide' },\n _react2.default.createElement(_ChannelSelect2.default, null)\n ),\n this.props.file.type === 'video/mp4' && _react2.default.createElement(\n 'div',\n { className: 'row row--padded row--no-top row--wide ' },\n _react2.default.createElement(_PublishThumbnailInput2.default, null)\n ),\n _react2.default.createElement(\n 'div',\n { className: 'row row--padded row--no-top row--no-bottom row--wide' },\n _react2.default.createElement(_PublishMetadataInputs2.default, null)\n ),\n _react2.default.createElement(\n 'div',\n { className: 'row row--wide align-content-center' },\n _react2.default.createElement(\n 'button',\n { id: 'publish-submit', className: 'button--primary button--large', onClick: this.onPublishSubmit },\n 'Publish'\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'row row--padded row--no-bottom align-content-center' },\n _react2.default.createElement(\n 'button',\n { className: 'button--cancel', onClick: this.props.clearFile },\n 'Cancel'\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'row row--short align-content-center' },\n _react2.default.createElement(\n 'p',\n { className: 'fine-print' },\n '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. ',\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', target: '_blank', href: 'https://lbry.io/learn' },\n 'Read more.'\n )\n )\n )\n )\n )\n );\n }\n }]);\n\n return PublishDetails;\n}(_react2.default.Component);\n\n;\n\nexports.default = (0, _reactRouterDom.withRouter)(PublishDetails);\n\n/***/ }),\n/* 98 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _publish = __webpack_require__(5);\n\nvar _view = __webpack_require__(99);\n\nvar _view2 = _interopRequireDefault(_view);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapStateToProps = function mapStateToProps(_ref) {\n var publish = _ref.publish;\n\n return {\n title: publish.metadata.title\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch) {\n return {\n onMetadataChange: function onMetadataChange(name, value) {\n dispatch((0, _publish.updateMetadata)(name, value));\n }\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view2.default);\n\n/***/ }),\n/* 99 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar PublishTitleInput = function (_React$Component) {\n _inherits(PublishTitleInput, _React$Component);\n\n function PublishTitleInput(props) {\n _classCallCheck(this, PublishTitleInput);\n\n var _this = _possibleConstructorReturn(this, (PublishTitleInput.__proto__ || Object.getPrototypeOf(PublishTitleInput)).call(this, props));\n\n _this.handleInput = _this.handleInput.bind(_this);\n return _this;\n }\n\n _createClass(PublishTitleInput, [{\n key: 'handleInput',\n value: function handleInput(e) {\n var name = e.target.name;\n var value = e.target.value;\n this.props.onMetadataChange(name, value);\n }\n }, {\n key: 'render',\n value: function render() {\n return _react2.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 });\n }\n }]);\n\n return PublishTitleInput;\n}(_react2.default.Component);\n\nexports.default = PublishTitleInput;\n\n/***/ }),\n/* 100 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _publish = __webpack_require__(5);\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _view = __webpack_require__(101);\n\nvar _view2 = _interopRequireDefault(_view);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapStateToProps = function mapStateToProps(_ref) {\n var channel = _ref.channel,\n publish = _ref.publish;\n\n return {\n loggedInChannelName: channel.loggedInChannel.name,\n loggedInChannelShortId: channel.loggedInChannel.shortId,\n fileName: publish.file.name,\n publishInChannel: publish.publishInChannel,\n selectedChannel: publish.selectedChannel,\n claim: publish.claim,\n urlError: publish.error.url\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch) {\n return {\n onClaimChange: function onClaimChange(value) {\n dispatch((0, _publish.updateClaim)(value));\n dispatch((0, _publish.updateError)('publishSubmit', null));\n },\n onUrlError: function onUrlError(value) {\n dispatch((0, _publish.updateError)('url', value));\n }\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view2.default);\n\n/***/ }),\n/* 101 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _request = __webpack_require__(11);\n\nvar _request2 = _interopRequireDefault(_request);\n\nvar _PublishUrlMiddleDisplay = __webpack_require__(102);\n\nvar _PublishUrlMiddleDisplay2 = _interopRequireDefault(_PublishUrlMiddleDisplay);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar PublishUrlInput = function (_React$Component) {\n _inherits(PublishUrlInput, _React$Component);\n\n function PublishUrlInput(props) {\n _classCallCheck(this, PublishUrlInput);\n\n var _this = _possibleConstructorReturn(this, (PublishUrlInput.__proto__ || Object.getPrototypeOf(PublishUrlInput)).call(this, props));\n\n _this.handleInput = _this.handleInput.bind(_this);\n return _this;\n }\n\n _createClass(PublishUrlInput, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n var _props = this.props,\n claim = _props.claim,\n fileName = _props.fileName;\n\n if (!claim) {\n this.setClaimName(fileName);\n }\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(_ref) {\n var claim = _ref.claim,\n fileName = _ref.fileName;\n\n // if a new file was chosen, update the claim name\n if (fileName !== this.props.fileName) {\n return this.setClaimName(fileName);\n }\n // if the claim has updated, check its availability\n if (claim !== this.props.claim) {\n this.validateClaim(claim);\n }\n }\n }, {\n key: 'handleInput',\n value: function handleInput(event) {\n var value = event.target.value;\n value = this.cleanseInput(value);\n // update the state\n this.props.onClaimChange(value);\n }\n }, {\n key: 'cleanseInput',\n value: function cleanseInput(input) {\n input = input.replace(/\\s+/g, '-'); // replace spaces with dashes\n input = input.replace(/[^A-Za-z0-9-]/g, ''); // remove all characters that are not A-Z, a-z, 0-9, or '-'\n return input;\n }\n }, {\n key: 'setClaimName',\n value: function setClaimName(fileName) {\n var fileNameWithoutEnding = fileName.substring(0, fileName.lastIndexOf('.'));\n var cleanClaimName = this.cleanseInput(fileNameWithoutEnding);\n this.props.onClaimChange(cleanClaimName);\n }\n }, {\n key: 'validateClaim',\n value: function validateClaim(claim) {\n var _this2 = this;\n\n if (!claim) {\n return this.props.onUrlError('Enter a url above');\n }\n (0, _request2.default)('/api/claim/availability/' + claim).then(function () {\n _this2.props.onUrlError(null);\n }).catch(function (error) {\n _this2.props.onUrlError(error.message);\n });\n }\n }, {\n key: 'render',\n value: function render() {\n var _props2 = this.props,\n claim = _props2.claim,\n loggedInChannelName = _props2.loggedInChannelName,\n loggedInChannelShortId = _props2.loggedInChannelShortId,\n publishInChannel = _props2.publishInChannel,\n selectedChannel = _props2.selectedChannel,\n urlError = _props2.urlError;\n\n return _react2.default.createElement(\n 'div',\n { className: 'column column--10 column--sml-10' },\n _react2.default.createElement(\n 'div',\n { className: 'input-text--primary span--relative' },\n _react2.default.createElement(\n 'span',\n { className: 'url-text--secondary' },\n 'spee.ch / '\n ),\n _react2.default.createElement(_PublishUrlMiddleDisplay2.default, {\n publishInChannel: publishInChannel,\n selectedChannel: selectedChannel,\n loggedInChannelName: loggedInChannelName,\n loggedInChannelShortId: loggedInChannelShortId\n }),\n _react2.default.createElement('input', { type: 'text', id: 'claim-name-input', className: 'input-text', name: 'claim', placeholder: 'your-url-here', onChange: this.handleInput, value: claim }),\n claim && !urlError && _react2.default.createElement(\n 'span',\n { id: 'input-success-claim-name', className: 'info-message--success span--absolute' },\n '\\u2713'\n ),\n urlError && _react2.default.createElement(\n 'span',\n { id: 'input-success-channel-name', className: 'info-message--failure span--absolute' },\n '\\u2716'\n )\n ),\n _react2.default.createElement(\n 'div',\n null,\n urlError ? _react2.default.createElement(\n 'p',\n { id: 'input-error-claim-name', className: 'info-message--failure' },\n urlError\n ) : _react2.default.createElement(\n 'p',\n { className: 'info-message' },\n 'Choose a custom url'\n )\n )\n );\n }\n }]);\n\n return PublishUrlInput;\n}(_react2.default.Component);\n\nexports.default = PublishUrlInput;\n\n/***/ }),\n/* 102 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = __webpack_require__(10);\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction UrlMiddle(_ref) {\n var publishInChannel = _ref.publishInChannel,\n selectedChannel = _ref.selectedChannel,\n loggedInChannelName = _ref.loggedInChannelName,\n loggedInChannelShortId = _ref.loggedInChannelShortId;\n\n if (publishInChannel) {\n if (selectedChannel === loggedInChannelName) {\n return _react2.default.createElement(\n 'span',\n { id: 'url-channel', className: 'url-text--secondary' },\n loggedInChannelName,\n ':',\n loggedInChannelShortId,\n ' /'\n );\n }\n return _react2.default.createElement(\n 'span',\n { id: 'url-channel-placeholder', className: 'url-text--secondary tooltip' },\n '@channel',\n _react2.default.createElement(\n 'span',\n {\n className: 'tooltip-text' },\n 'Select a channel below'\n ),\n ' /'\n );\n }\n return _react2.default.createElement(\n 'span',\n { id: 'url-no-channel-placeholder', className: 'url-text--secondary tooltip' },\n 'xyz',\n _react2.default.createElement(\n 'span',\n { className: 'tooltip-text' },\n 'This will be a random id'\n ),\n ' /'\n );\n}\n\nUrlMiddle.propTypes = {\n publishInChannel: _propTypes2.default.bool.isRequired,\n loggedInChannelName: _propTypes2.default.string,\n loggedInChannelShortId: _propTypes2.default.string\n};\n\nexports.default = UrlMiddle;\n\n/***/ }),\n/* 103 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _publish = __webpack_require__(5);\n\nvar _view = __webpack_require__(104);\n\nvar _view2 = _interopRequireDefault(_view);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapStateToProps = function mapStateToProps(_ref) {\n var file = _ref.publish.file;\n\n return {\n file: file\n };\n};\n\nvar mapDispatchToProps = {\n onNewThumbnail: _publish.onNewThumbnail\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view2.default);\n\n/***/ }),\n/* 104 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nfunction dataURItoBlob(dataURI) {\n // convert base64/URLEncoded data component to raw binary data held in a string\n var byteString = atob(dataURI.split(',')[1]);\n // separate out the mime component\n var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];\n // write the bytes of the string to a typed array\n var ia = new Uint8Array(byteString.length);\n for (var i = 0; i < byteString.length; i++) {\n ia[i] = byteString.charCodeAt(i);\n }\n return new Blob([ia], { type: mimeString });\n}\n\nvar PublishThumbnailInput = function (_React$Component) {\n _inherits(PublishThumbnailInput, _React$Component);\n\n function PublishThumbnailInput(props) {\n _classCallCheck(this, PublishThumbnailInput);\n\n var _this = _possibleConstructorReturn(this, (PublishThumbnailInput.__proto__ || Object.getPrototypeOf(PublishThumbnailInput)).call(this, props));\n\n _this.state = {\n videoSource: null,\n error: null,\n sliderMinRange: 1,\n sliderMaxRange: null,\n sliderValue: null\n };\n _this.handleVideoLoadedData = _this.handleVideoLoadedData.bind(_this);\n _this.handleSliderChange = _this.handleSliderChange.bind(_this);\n _this.createThumbnail = _this.createThumbnail.bind(_this);\n return _this;\n }\n\n _createClass(PublishThumbnailInput, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n var file = this.props.file;\n\n this.setVideoSource(file);\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(nextProps) {\n // if file changes\n if (nextProps.file && nextProps.file !== this.props.file) {\n var file = nextProps.file;\n\n this.setVideoSource(file);\n };\n }\n }, {\n key: 'setVideoSource',\n value: function setVideoSource(file) {\n var _this2 = this;\n\n var previewReader = new FileReader();\n previewReader.readAsDataURL(file);\n previewReader.onloadend = function () {\n var dataUri = previewReader.result;\n var blob = dataURItoBlob(dataUri);\n var videoSource = URL.createObjectURL(blob);\n _this2.setState({ videoSource: videoSource });\n };\n }\n }, {\n key: 'handleVideoLoadedData',\n value: function handleVideoLoadedData(event) {\n var duration = event.target.duration;\n var totalMinutes = Math.floor(duration / 60);\n var totalSeconds = Math.floor(duration % 60);\n // set the slider\n this.setState({\n sliderMaxRange: duration * 100,\n sliderValue: duration * 100 / 2,\n totalMinutes: totalMinutes,\n totalSeconds: totalSeconds\n });\n // update the current time of the video\n var video = document.getElementById('video-thumb-player');\n video.currentTime = duration / 2;\n }\n }, {\n key: 'handleSliderChange',\n value: function handleSliderChange(event) {\n var value = parseInt(event.target.value);\n // update the slider value\n this.setState({\n sliderValue: value\n });\n // update the current time of the video\n var video = document.getElementById('video-thumb-player');\n video.currentTime = value / 100;\n }\n }, {\n key: 'createThumbnail',\n value: function createThumbnail() {\n // take a snapshot\n var video = document.getElementById('video-thumb-player');\n var canvas = document.createElement('canvas');\n canvas.width = video.videoWidth;\n canvas.height = video.videoHeight;\n canvas.getContext('2d').drawImage(video, 0, 0, canvas.width, canvas.height);\n var dataUrl = canvas.toDataURL();\n var blob = dataURItoBlob(dataUrl);\n var snapshot = new File([blob], 'thumbnail.png', {\n type: 'image/png'\n });\n // set the thumbnail in redux store\n if (snapshot) {\n this.props.onNewThumbnail(snapshot);\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _state = this.state,\n error = _state.error,\n videoSource = _state.videoSource,\n sliderMinRange = _state.sliderMinRange,\n sliderMaxRange = _state.sliderMaxRange,\n sliderValue = _state.sliderValue,\n totalMinutes = _state.totalMinutes,\n totalSeconds = _state.totalSeconds;\n\n return _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n 'label',\n { className: 'label' },\n 'Thumbnail:'\n ),\n _react2.default.createElement('video', {\n id: 'video-thumb-player',\n preload: 'metadata',\n muted: true,\n style: { display: 'none' },\n playsInline: true,\n onLoadedData: this.handleVideoLoadedData,\n src: videoSource,\n onSeeked: this.createThumbnail\n }),\n sliderValue ? _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n 'div',\n { className: 'flex-container--row flex-container--space-between-center', style: { width: '100%' } },\n _react2.default.createElement(\n 'span',\n { className: 'info-message' },\n '0\\'00\"'\n ),\n _react2.default.createElement(\n 'span',\n { className: 'info-message' },\n totalMinutes,\n '\\'',\n totalSeconds,\n '\"'\n )\n ),\n _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement('input', {\n type: 'range',\n min: sliderMinRange,\n max: sliderMaxRange,\n value: sliderValue,\n className: 'slider',\n onChange: this.handleSliderChange\n })\n )\n ) : _react2.default.createElement(\n 'p',\n { className: 'info-message' },\n 'loading... '\n ),\n error ? _react2.default.createElement(\n 'p',\n { className: 'info-message--failure' },\n error\n ) : _react2.default.createElement(\n 'p',\n { className: 'info-message' },\n 'Use slider to set thumbnail'\n )\n );\n }\n }]);\n\n return PublishThumbnailInput;\n}(_react2.default.Component);\n\nexports.default = PublishThumbnailInput;\n\n/***/ }),\n/* 105 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _publish = __webpack_require__(5);\n\nvar _view = __webpack_require__(106);\n\nvar _view2 = _interopRequireDefault(_view);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapStateToProps = function mapStateToProps(_ref) {\n var publish = _ref.publish;\n\n return {\n showMetadataInputs: publish.showMetadataInputs,\n description: publish.metadata.description,\n license: publish.metadata.license,\n nsfw: publish.metadata.nsfw\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch) {\n return {\n onMetadataChange: function onMetadataChange(name, value) {\n dispatch((0, _publish.updateMetadata)(name, value));\n },\n onToggleMetadataInputs: function onToggleMetadataInputs(value) {\n dispatch((0, _publish.toggleMetadataInputs)(value));\n }\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view2.default);\n\n/***/ }),\n/* 106 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _ExpandingTextArea = __webpack_require__(107);\n\nvar _ExpandingTextArea2 = _interopRequireDefault(_ExpandingTextArea);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar PublishMetadataInputs = function (_React$Component) {\n _inherits(PublishMetadataInputs, _React$Component);\n\n function PublishMetadataInputs(props) {\n _classCallCheck(this, PublishMetadataInputs);\n\n var _this = _possibleConstructorReturn(this, (PublishMetadataInputs.__proto__ || Object.getPrototypeOf(PublishMetadataInputs)).call(this, props));\n\n _this.toggleShowInputs = _this.toggleShowInputs.bind(_this);\n _this.handleInput = _this.handleInput.bind(_this);\n _this.handleSelect = _this.handleSelect.bind(_this);\n return _this;\n }\n\n _createClass(PublishMetadataInputs, [{\n key: 'toggleShowInputs',\n value: function toggleShowInputs() {\n this.props.onToggleMetadataInputs(!this.props.showMetadataInputs);\n }\n }, {\n key: 'handleInput',\n value: function handleInput(event) {\n var target = event.target;\n var value = target.type === 'checkbox' ? target.checked : target.value;\n var name = target.name;\n this.props.onMetadataChange(name, value);\n }\n }, {\n key: 'handleSelect',\n value: function handleSelect(event) {\n var name = event.target.name;\n var selectedOption = event.target.selectedOptions[0].value;\n this.props.onMetadataChange(name, selectedOption);\n }\n }, {\n key: 'render',\n value: function render() {\n return _react2.default.createElement(\n 'div',\n { id: 'publish-details', className: 'row row--padded row--no-top row--wide' },\n this.props.showMetadataInputs && _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n 'div',\n { className: 'row row--no-top' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--3 column--med-10 align-content-top' },\n _react2.default.createElement(\n 'label',\n { htmlFor: 'publish-license', className: 'label' },\n 'Description:'\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--7 column--sml-10' },\n _react2.default.createElement(_ExpandingTextArea2.default, {\n id: 'publish-description',\n className: 'textarea textarea--primary textarea--full-width',\n rows: 1,\n maxLength: 2000,\n style: { maxHeight: 200 },\n name: 'description',\n placeholder: 'Optional description',\n value: this.props.description,\n onChange: this.handleInput })\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'row row--no-top' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--3 column--med-10' },\n _react2.default.createElement(\n 'label',\n { htmlFor: 'publish-license', className: 'label' },\n 'License:'\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--7 column--sml-10' },\n _react2.default.createElement(\n 'select',\n { type: 'text', name: 'license', id: 'publish-license', className: 'select select--primary', onChange: this.handleSelect },\n _react2.default.createElement(\n 'option',\n { value: ' ' },\n 'Unspecified'\n ),\n _react2.default.createElement(\n 'option',\n { value: 'Public Domain' },\n 'Public Domain'\n ),\n _react2.default.createElement(\n 'option',\n { value: 'Creative Commons' },\n 'Creative Commons'\n )\n )\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'row row--no-top' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--3' },\n _react2.default.createElement(\n 'label',\n { htmlFor: 'publish-nsfw', className: 'label' },\n 'Mature:'\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--7' },\n _react2.default.createElement('input', { className: 'input-checkbox', type: 'checkbox', id: 'publish-nsfw', name: 'nsfw', value: this.props.nsfw, onChange: this.handleInput })\n )\n )\n ),\n _react2.default.createElement(\n 'button',\n { className: 'button--secondary', onClick: this.toggleShowInputs },\n this.props.showMetadataInputs ? 'less' : 'more'\n )\n );\n }\n }]);\n\n return PublishMetadataInputs;\n}(_react2.default.Component);\n\nexports.default = PublishMetadataInputs;\n\n/***/ }),\n/* 107 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = __webpack_require__(10);\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ExpandingTextarea = function (_Component) {\n _inherits(ExpandingTextarea, _Component);\n\n function ExpandingTextarea(props) {\n _classCallCheck(this, ExpandingTextarea);\n\n var _this = _possibleConstructorReturn(this, (ExpandingTextarea.__proto__ || Object.getPrototypeOf(ExpandingTextarea)).call(this, props));\n\n _this._handleChange = _this._handleChange.bind(_this);\n return _this;\n }\n\n _createClass(ExpandingTextarea, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.adjustTextarea({});\n }\n }, {\n key: '_handleChange',\n value: function _handleChange(event) {\n var onChange = this.props.onChange;\n\n if (onChange) onChange(event);\n this.adjustTextarea(event);\n }\n }, {\n key: 'adjustTextarea',\n value: function adjustTextarea(_ref) {\n var _ref$target = _ref.target,\n target = _ref$target === undefined ? this.el : _ref$target;\n\n target.style.height = 0;\n target.style.height = target.scrollHeight + 'px';\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var rest = _objectWithoutProperties(this.props, []);\n\n return _react2.default.createElement('textarea', _extends({}, rest, {\n ref: function ref(x) {\n return _this2.el = x;\n },\n onChange: this._handleChange\n }));\n }\n }]);\n\n return ExpandingTextarea;\n}(_react.Component);\n\nExpandingTextarea.propTypes = {\n onChange: _propTypes2.default.func\n};\n\nexports.default = ExpandingTextarea;\n\n/***/ }),\n/* 108 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _publish = __webpack_require__(5);\n\nvar _view = __webpack_require__(109);\n\nvar _view2 = _interopRequireDefault(_view);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapStateToProps = function mapStateToProps(_ref) {\n var channel = _ref.channel,\n publish = _ref.publish;\n\n return {\n loggedInChannelName: channel.loggedInChannel.name,\n publishInChannel: publish.publishInChannel,\n selectedChannel: publish.selectedChannel,\n channelError: publish.error.channel\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch) {\n return {\n onPublishInChannelChange: function onPublishInChannelChange(value) {\n dispatch((0, _publish.updateError)('channel', null));\n dispatch((0, _publish.setPublishInChannel)(value));\n },\n onChannelSelect: function onChannelSelect(value) {\n dispatch((0, _publish.updateError)('channel', null));\n dispatch((0, _publish.updateSelectedChannel)(value));\n }\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view2.default);\n\n/***/ }),\n/* 109 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _ChannelLoginForm = __webpack_require__(38);\n\nvar _ChannelLoginForm2 = _interopRequireDefault(_ChannelLoginForm);\n\nvar _ChannelCreateForm = __webpack_require__(39);\n\nvar _ChannelCreateForm2 = _interopRequireDefault(_ChannelCreateForm);\n\nvar _publish_channel_select_states = __webpack_require__(32);\n\nvar states = _interopRequireWildcard(_publish_channel_select_states);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ChannelSelect = function (_React$Component) {\n _inherits(ChannelSelect, _React$Component);\n\n function ChannelSelect(props) {\n _classCallCheck(this, ChannelSelect);\n\n var _this = _possibleConstructorReturn(this, (ChannelSelect.__proto__ || Object.getPrototypeOf(ChannelSelect)).call(this, props));\n\n _this.toggleAnonymousPublish = _this.toggleAnonymousPublish.bind(_this);\n _this.handleSelection = _this.handleSelection.bind(_this);\n return _this;\n }\n\n _createClass(ChannelSelect, [{\n key: 'toggleAnonymousPublish',\n value: function toggleAnonymousPublish(event) {\n var value = event.target.value;\n if (value === 'anonymous') {\n this.props.onPublishInChannelChange(false);\n } else {\n this.props.onPublishInChannelChange(true);\n }\n }\n }, {\n key: 'handleSelection',\n value: function handleSelection(event) {\n var selectedOption = event.target.selectedOptions[0].value;\n this.props.onChannelSelect(selectedOption);\n }\n }, {\n key: 'render',\n value: function render() {\n return _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n 'form',\n null,\n _react2.default.createElement(\n 'div',\n { className: 'column column--3 column--med-10' },\n _react2.default.createElement('input', { type: 'radio', name: 'anonymous-or-channel', id: 'anonymous-radio', className: 'input-radio', value: 'anonymous', checked: !this.props.publishInChannel, onChange: this.toggleAnonymousPublish }),\n _react2.default.createElement(\n 'label',\n { className: 'label label--pointer', htmlFor: 'anonymous-radio' },\n 'Anonymous'\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--7 column--med-10' },\n _react2.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 }),\n _react2.default.createElement(\n 'label',\n { className: 'label label--pointer', htmlFor: 'channel-radio' },\n 'In a channel'\n )\n ),\n this.props.channelError ? _react2.default.createElement(\n 'p',\n { className: 'info-message--failure' },\n this.props.channelError\n ) : _react2.default.createElement(\n 'p',\n { className: 'info-message' },\n 'Publish anonymously or in a channel'\n )\n ),\n this.props.publishInChannel && _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n 'div',\n { className: 'column column--3' },\n _react2.default.createElement(\n 'label',\n { className: 'label', htmlFor: 'channel-name-select' },\n 'Channel:'\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--7' },\n _react2.default.createElement(\n 'select',\n { type: 'text', id: 'channel-name-select', className: 'select select--arrow', value: this.props.selectedChannel, onChange: this.handleSelection },\n this.props.loggedInChannelName && _react2.default.createElement(\n 'option',\n { value: this.props.loggedInChannelName, id: 'publish-channel-select-channel-option' },\n this.props.loggedInChannelName\n ),\n _react2.default.createElement(\n 'option',\n { value: states.LOGIN },\n 'Existing'\n ),\n _react2.default.createElement(\n 'option',\n { value: states.CREATE },\n 'New'\n )\n )\n ),\n this.props.selectedChannel === states.LOGIN && _react2.default.createElement(_ChannelLoginForm2.default, null),\n this.props.selectedChannel === states.CREATE && _react2.default.createElement(_ChannelCreateForm2.default, null)\n )\n );\n }\n }]);\n\n return ChannelSelect;\n}(_react2.default.Component);\n\nexports.default = ChannelSelect;\n\n/***/ }),\n/* 110 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _request = __webpack_require__(11);\n\nvar _request2 = _interopRequireDefault(_request);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ChannelLoginForm = function (_React$Component) {\n _inherits(ChannelLoginForm, _React$Component);\n\n function ChannelLoginForm(props) {\n _classCallCheck(this, ChannelLoginForm);\n\n var _this = _possibleConstructorReturn(this, (ChannelLoginForm.__proto__ || Object.getPrototypeOf(ChannelLoginForm)).call(this, props));\n\n _this.state = {\n error: null,\n name: '',\n password: ''\n };\n _this.handleInput = _this.handleInput.bind(_this);\n _this.loginToChannel = _this.loginToChannel.bind(_this);\n return _this;\n }\n\n _createClass(ChannelLoginForm, [{\n key: 'handleInput',\n value: function handleInput(event) {\n var name = event.target.name;\n var value = event.target.value;\n this.setState(_defineProperty({}, name, value));\n }\n }, {\n key: 'loginToChannel',\n value: function loginToChannel(event) {\n var _this2 = this;\n\n event.preventDefault();\n var params = {\n method: 'POST',\n body: JSON.stringify({ username: this.state.name, password: this.state.password }),\n headers: new Headers({\n 'Content-Type': 'application/json'\n }),\n credentials: 'include'\n };\n (0, _request2.default)('login', params).then(function (_ref) {\n var success = _ref.success,\n channelName = _ref.channelName,\n shortChannelId = _ref.shortChannelId,\n channelClaimId = _ref.channelClaimId,\n message = _ref.message;\n\n if (success) {\n _this2.props.onChannelLogin(channelName, shortChannelId, channelClaimId);\n } else {\n _this2.setState({ 'error': message });\n };\n }).catch(function (error) {\n if (error.message) {\n _this2.setState({ 'error': error.message });\n } else {\n _this2.setState({ 'error': error });\n }\n });\n }\n }, {\n key: 'render',\n value: function render() {\n return _react2.default.createElement(\n 'form',\n { id: 'channel-login-form' },\n _react2.default.createElement(\n 'div',\n { className: 'row row--wide row--short' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--3 column--sml-10' },\n _react2.default.createElement(\n 'label',\n { className: 'label', htmlFor: 'channel-login-name-input' },\n 'Name:'\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--6 column--sml-10' },\n _react2.default.createElement(\n 'div',\n { className: 'input-text--primary flex-container--row flex-container--left-bottom' },\n _react2.default.createElement(\n 'span',\n null,\n '@'\n ),\n _react2.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 })\n )\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'row row--wide row--short' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--3 column--sml-10' },\n _react2.default.createElement(\n 'label',\n { className: 'label', htmlFor: 'channel-login-password-input' },\n 'Password:'\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--6 column--sml-10' },\n _react2.default.createElement(\n 'div',\n { className: 'input-text--primary' },\n _react2.default.createElement('input', { type: 'password', id: 'channel-login-password-input', name: 'password', className: 'input-text', placeholder: '', value: this.state.channelPassword, onChange: this.handleInput })\n )\n )\n ),\n this.state.error ? _react2.default.createElement(\n 'p',\n { className: 'info-message--failure' },\n this.state.error\n ) : _react2.default.createElement(\n 'p',\n { className: 'info-message' },\n 'Enter the name and password for your channel'\n ),\n _react2.default.createElement(\n 'div',\n { className: 'row row--wide' },\n _react2.default.createElement(\n 'button',\n { className: 'button--primary', onClick: this.loginToChannel },\n 'Authenticate'\n )\n )\n );\n }\n }]);\n\n return ChannelLoginForm;\n}(_react2.default.Component);\n\nexports.default = ChannelLoginForm;\n\n/***/ }),\n/* 111 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _ProgressBar = __webpack_require__(20);\n\nvar _ProgressBar2 = _interopRequireDefault(_ProgressBar);\n\nvar _request = __webpack_require__(11);\n\nvar _request2 = _interopRequireDefault(_request);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ChannelCreateForm = function (_React$Component) {\n _inherits(ChannelCreateForm, _React$Component);\n\n function ChannelCreateForm(props) {\n _classCallCheck(this, ChannelCreateForm);\n\n var _this = _possibleConstructorReturn(this, (ChannelCreateForm.__proto__ || Object.getPrototypeOf(ChannelCreateForm)).call(this, props));\n\n _this.state = {\n error: null,\n channel: '',\n password: '',\n status: null\n };\n _this.handleChannelInput = _this.handleChannelInput.bind(_this);\n _this.handleInput = _this.handleInput.bind(_this);\n _this.createChannel = _this.createChannel.bind(_this);\n return _this;\n }\n\n _createClass(ChannelCreateForm, [{\n key: 'cleanseChannelInput',\n value: function cleanseChannelInput(input) {\n input = input.replace(/\\s+/g, '-'); // replace spaces with dashes\n input = input.replace(/[^A-Za-z0-9-]/g, ''); // remove all characters that are not A-Z, a-z, 0-9, or '-'\n return input;\n }\n }, {\n key: 'handleChannelInput',\n value: function handleChannelInput(event) {\n var value = event.target.value;\n value = this.cleanseChannelInput(value);\n this.setState({ channel: value });\n if (value) {\n this.updateIsChannelAvailable(value);\n } else {\n this.setState({ error: 'Please enter a channel name' });\n }\n }\n }, {\n key: 'handleInput',\n value: function handleInput(event) {\n var name = event.target.name;\n var value = event.target.value;\n this.setState(_defineProperty({}, name, value));\n }\n }, {\n key: 'updateIsChannelAvailable',\n value: function updateIsChannelAvailable(channel) {\n var _this2 = this;\n\n var channelWithAtSymbol = '@' + channel;\n (0, _request2.default)('/api/channel/availability/' + channelWithAtSymbol).then(function (isAvailable) {\n if (isAvailable) {\n _this2.setState({ 'error': null });\n } else {\n _this2.setState({ 'error': 'That channel has already been claimed' });\n }\n }).catch(function (error) {\n _this2.setState({ 'error': error.message });\n });\n }\n }, {\n key: 'checkIsChannelAvailable',\n value: function checkIsChannelAvailable(channel) {\n var channelWithAtSymbol = '@' + channel;\n return new Promise(function (resolve, reject) {\n (0, _request2.default)('/api/channel/availability/' + channelWithAtSymbol).then(function (isAvailable) {\n if (!isAvailable) {\n return reject(new Error('That channel has already been claimed'));\n }\n resolve();\n }).catch(function (error) {\n reject(error);\n });\n });\n }\n }, {\n key: 'checkIsPasswordProvided',\n value: function checkIsPasswordProvided() {\n var password = this.state.password;\n return new Promise(function (resolve, reject) {\n if (!password || password.length < 1) {\n return reject(new Error('Please provide a password'));\n }\n resolve();\n });\n }\n }, {\n key: 'makePublishChannelRequest',\n value: function makePublishChannelRequest(username, password) {\n var params = {\n method: 'POST',\n body: JSON.stringify({ username: username, password: password }),\n headers: new Headers({\n 'Content-Type': 'application/json'\n }),\n credentials: 'include'\n };\n return new Promise(function (resolve, reject) {\n (0, _request2.default)('/signup', params).then(function (result) {\n return resolve(result);\n }).catch(function (error) {\n reject(new Error('Unfortunately, we encountered an error while creating your channel. Please let us know in Discord! ' + error.message));\n });\n });\n }\n }, {\n key: 'createChannel',\n value: function createChannel(event) {\n var _this3 = this;\n\n event.preventDefault();\n this.checkIsPasswordProvided().then(function () {\n return _this3.checkIsChannelAvailable(_this3.state.channel, _this3.state.password);\n }).then(function () {\n _this3.setState({ status: 'We are publishing your new channel. Sit tight...' });\n return _this3.makePublishChannelRequest(_this3.state.channel, _this3.state.password);\n }).then(function (result) {\n _this3.setState({ status: null });\n _this3.props.onChannelLogin(result.channelName, result.shortChannelId, result.channelClaimId);\n }).catch(function (error) {\n _this3.setState({ 'error': error.message, status: null });\n });\n }\n }, {\n key: 'render',\n value: function render() {\n return _react2.default.createElement(\n 'div',\n null,\n !this.state.status ? _react2.default.createElement(\n 'form',\n { id: 'publish-channel-form' },\n _react2.default.createElement(\n 'div',\n { className: 'row row--wide row--short' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--3 column--sml-10' },\n _react2.default.createElement(\n 'label',\n { className: 'label', htmlFor: 'new-channel-name' },\n 'Name:'\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--6 column--sml-10' },\n _react2.default.createElement(\n 'div',\n { className: 'input-text--primary flex-container--row flex-container--left-bottom span--relative' },\n _react2.default.createElement(\n 'span',\n null,\n '@'\n ),\n _react2.default.createElement('input', { type: 'text', name: 'channel', id: 'new-channel-name', className: 'input-text', placeholder: 'exampleChannelName', value: this.state.channel, onChange: this.handleChannelInput }),\n this.state.channel && !this.state.error && _react2.default.createElement(\n 'span',\n { id: 'input-success-channel-name', className: 'info-message--success span--absolute' },\n '\\u2713'\n ),\n this.state.error && _react2.default.createElement(\n 'span',\n { id: 'input-success-channel-name', className: 'info-message--failure span--absolute' },\n '\\u2716'\n )\n )\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'row row--wide row--short' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--3 column--sml-10' },\n _react2.default.createElement(\n 'label',\n { className: 'label', htmlFor: 'new-channel-password' },\n 'Password:'\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--6 column--sml-10' },\n _react2.default.createElement(\n 'div',\n { className: 'input-text--primary' },\n _react2.default.createElement('input', { type: 'password', name: 'password', id: 'new-channel-password', className: 'input-text', placeholder: '', value: this.state.password, onChange: this.handleInput })\n )\n )\n ),\n this.state.error ? _react2.default.createElement(\n 'p',\n { className: 'info-message--failure' },\n this.state.error\n ) : _react2.default.createElement(\n 'p',\n { className: 'info-message' },\n 'Choose a name and password for your channel'\n ),\n _react2.default.createElement(\n 'div',\n { className: 'row row--wide' },\n _react2.default.createElement(\n 'button',\n { className: 'button--primary', onClick: this.createChannel },\n 'Create Channel'\n )\n )\n ) : _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n 'p',\n { className: 'fine-print' },\n this.state.status\n ),\n _react2.default.createElement(_ProgressBar2.default, { size: 12 })\n )\n );\n }\n }]);\n\n return ChannelCreateForm;\n}(_react2.default.Component);\n\nexports.default = ChannelCreateForm;\n\n/***/ }),\n/* 112 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar ActiveStatusBar = function ActiveStatusBar() {\n return _react2.default.createElement(\n 'span',\n { className: 'progress-bar progress-bar--active' },\n '| '\n );\n};\n\nexports.default = ActiveStatusBar;\n\n/***/ }),\n/* 113 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar InactiveStatusBar = function InactiveStatusBar() {\n return _react2.default.createElement(\n 'span',\n { className: 'progress-bar progress-bar--inactive' },\n '| '\n );\n};\n\nexports.default = InactiveStatusBar;\n\n/***/ }),\n/* 114 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _publish = __webpack_require__(5);\n\nvar _view = __webpack_require__(115);\n\nvar _view2 = _interopRequireDefault(_view);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapStateToProps = function mapStateToProps(_ref) {\n var publish = _ref.publish;\n\n return {\n status: publish.status.status,\n message: publish.status.message\n };\n};\n\nvar mapDispatchToProps = {\n clearFile: _publish.clearFile\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view2.default);\n\n/***/ }),\n/* 115 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _ProgressBar = __webpack_require__(20);\n\nvar _ProgressBar2 = _interopRequireDefault(_ProgressBar);\n\nvar _publish_claim_states = __webpack_require__(116);\n\nvar publishStates = _interopRequireWildcard(_publish_claim_states);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar PublishStatus = function (_React$Component) {\n _inherits(PublishStatus, _React$Component);\n\n function PublishStatus() {\n _classCallCheck(this, PublishStatus);\n\n return _possibleConstructorReturn(this, (PublishStatus.__proto__ || Object.getPrototypeOf(PublishStatus)).apply(this, arguments));\n }\n\n _createClass(PublishStatus, [{\n key: 'render',\n value: function render() {\n var _props = this.props,\n status = _props.status,\n message = _props.message,\n clearFile = _props.clearFile;\n\n return _react2.default.createElement(\n 'div',\n { className: 'row row--tall flex-container--column flex-container--center-center' },\n status === publishStates.LOAD_START && _react2.default.createElement(\n 'div',\n { className: 'row align-content-center' },\n _react2.default.createElement(\n 'p',\n null,\n 'File is loading to server'\n ),\n _react2.default.createElement(\n 'p',\n { className: 'blue' },\n '0%'\n )\n ),\n status === publishStates.LOADING && _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n 'div',\n { className: 'row align-content-center' },\n _react2.default.createElement(\n 'p',\n null,\n 'File is loading to server'\n ),\n _react2.default.createElement(\n 'p',\n { className: 'blue' },\n message\n )\n )\n ),\n status === publishStates.PUBLISHING && _react2.default.createElement(\n 'div',\n { className: 'row align-content-center' },\n _react2.default.createElement(\n 'p',\n null,\n 'Upload complete. Your file is now being published on the blockchain...'\n ),\n _react2.default.createElement(_ProgressBar2.default, { size: 12 }),\n _react2.default.createElement(\n 'p',\n null,\n 'Curious what magic is happening here? ',\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', target: 'blank', href: 'https://lbry.io/faq/what-is-lbry' },\n 'Learn more.'\n )\n )\n ),\n status === publishStates.SUCCESS && _react2.default.createElement(\n 'div',\n { className: 'row align-content-center' },\n _react2.default.createElement(\n 'p',\n null,\n 'Your publish is complete! You are being redirected to it now.'\n ),\n _react2.default.createElement(\n 'p',\n null,\n 'If you are not automatically redirected, ',\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', target: '_blank', href: message },\n 'click here.'\n )\n )\n ),\n status === publishStates.FAILED && _react2.default.createElement(\n 'div',\n { className: 'row align-content-center' },\n _react2.default.createElement(\n 'p',\n null,\n 'Something went wrong...'\n ),\n _react2.default.createElement(\n 'p',\n null,\n _react2.default.createElement(\n 'strong',\n null,\n message\n )\n ),\n _react2.default.createElement(\n 'p',\n null,\n 'For help, post the above error text in the #speech channel on the ',\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', href: 'https://discord.gg/YjYbwhS', target: '_blank' },\n 'lbry discord'\n )\n ),\n _react2.default.createElement(\n 'button',\n { className: 'button--secondary', onClick: clearFile },\n 'Reset'\n )\n )\n );\n }\n }]);\n\n return PublishStatus;\n}(_react2.default.Component);\n\n;\n\nexports.default = PublishStatus;\n\n/***/ }),\n/* 116 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar LOAD_START = exports.LOAD_START = 'LOAD_START';\nvar LOADING = exports.LOADING = 'LOADING';\nvar PUBLISHING = exports.PUBLISHING = 'PUBLISHING';\nvar SUCCESS = exports.SUCCESS = 'SUCCESS';\nvar FAILED = exports.FAILED = 'FAILED';\n\n/***/ }),\n/* 117 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _NavBar = __webpack_require__(7);\n\nvar _NavBar2 = _interopRequireDefault(_NavBar);\n\nvar _SEO = __webpack_require__(9);\n\nvar _SEO2 = _interopRequireDefault(_SEO);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar AboutPage = function (_React$Component) {\n _inherits(AboutPage, _React$Component);\n\n function AboutPage() {\n _classCallCheck(this, AboutPage);\n\n return _possibleConstructorReturn(this, (AboutPage.__proto__ || Object.getPrototypeOf(AboutPage)).apply(this, arguments));\n }\n\n _createClass(AboutPage, [{\n key: 'render',\n value: function render() {\n return _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(_SEO2.default, { pageTitle: 'About', pageUri: 'about' }),\n _react2.default.createElement(_NavBar2.default, null),\n _react2.default.createElement(\n 'div',\n { className: 'row row--padded' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--5 column--med-10 align-content-top' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--8 column--med-10' },\n _react2.default.createElement(\n 'p',\n { className: 'pull-quote' },\n 'Spee.ch is an open-source project. Please contribute to the existing site, or fork it and make your own.'\n ),\n _react2.default.createElement(\n 'p',\n null,\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', target: '_blank', href: 'https://twitter.com/spee_ch' },\n 'TWITTER'\n )\n ),\n _react2.default.createElement(\n 'p',\n null,\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', target: '_blank', href: 'https://github.com/lbryio/spee.ch' },\n 'GITHUB'\n )\n ),\n _react2.default.createElement(\n 'p',\n null,\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', target: '_blank', href: 'https://discord.gg/YjYbwhS' },\n 'DISCORD CHANNEL'\n )\n ),\n _react2.default.createElement(\n 'p',\n null,\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', target: '_blank', href: 'https://github.com/lbryio/spee.ch/blob/master/README.md' },\n 'DOCUMENTATION'\n )\n )\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--5 column--med-10 align-content-top' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--8 column--med-10' },\n _react2.default.createElement(\n 'p',\n null,\n 'Spee.ch is a media-hosting site that reads from and publishes content to the ',\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', href: 'https://lbry.io' },\n 'LBRY'\n ),\n ' blockchain.'\n ),\n _react2.default.createElement(\n 'p',\n null,\n 'Spee.ch is a hosting service, but with the added benefit that it stores your content on a decentralized network of computers -- the LBRY network. This means that your images are stored in multiple locations without a single point of failure.'\n ),\n _react2.default.createElement(\n 'h3',\n null,\n 'Contribute'\n ),\n _react2.default.createElement(\n 'p',\n null,\n 'If you have an idea for your own spee.ch-like site on top of LBRY, fork our ',\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', href: 'https://github.com/lbryio/spee.ch' },\n 'github repo'\n ),\n ' and go to town!'\n ),\n _react2.default.createElement(\n 'p',\n null,\n 'If you want to improve spee.ch, join our ',\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', href: 'https://discord.gg/YjYbwhS' },\n 'discord channel'\n ),\n ' or solve one of our ',\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', href: 'https://github.com/lbryio/spee.ch/issues' },\n 'github issues'\n ),\n '.'\n )\n )\n )\n )\n );\n }\n }]);\n\n return AboutPage;\n}(_react2.default.Component);\n\n;\n\nexports.default = AboutPage;\n\n/***/ }),\n/* 118 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _view = __webpack_require__(119);\n\nvar _view2 = _interopRequireDefault(_view);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapStateToProps = function mapStateToProps(_ref) {\n var channel = _ref.channel;\n\n return {\n loggedInChannelName: channel.loggedInChannel.name\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, null)(_view2.default);\n\n/***/ }),\n/* 119 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactRouterDom = __webpack_require__(4);\n\nvar _SEO = __webpack_require__(9);\n\nvar _SEO2 = _interopRequireDefault(_SEO);\n\nvar _NavBar = __webpack_require__(7);\n\nvar _NavBar2 = _interopRequireDefault(_NavBar);\n\nvar _ChannelLoginForm = __webpack_require__(38);\n\nvar _ChannelLoginForm2 = _interopRequireDefault(_ChannelLoginForm);\n\nvar _ChannelCreateForm = __webpack_require__(39);\n\nvar _ChannelCreateForm2 = _interopRequireDefault(_ChannelCreateForm);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar LoginPage = function (_React$Component) {\n _inherits(LoginPage, _React$Component);\n\n function LoginPage() {\n _classCallCheck(this, LoginPage);\n\n return _possibleConstructorReturn(this, (LoginPage.__proto__ || Object.getPrototypeOf(LoginPage)).apply(this, arguments));\n }\n\n _createClass(LoginPage, [{\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(newProps) {\n // re-route the user to the homepage if the user is logged in\n if (newProps.loggedInChannelName !== this.props.loggedInChannelName) {\n this.props.history.push('/');\n }\n }\n }, {\n key: 'render',\n value: function render() {\n return _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(_SEO2.default, { pageTitle: 'Login', pageUri: 'login' }),\n _react2.default.createElement(_NavBar2.default, null),\n _react2.default.createElement(\n 'div',\n { className: 'row row--padded' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--5 column--med-10 align-content-top' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--8 column--med-10' },\n _react2.default.createElement(\n 'p',\n null,\n '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 ',\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', target: '_blank', href: '/@catalonia2017:43dcf47163caa21d8404d9fe9b30f78ef3e146a8' },\n 'documenting important events'\n ),\n ', or making a public repository for ',\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', target: '_blank', href: '/@catGifs' },\n 'cat gifs'\n ),\n ' (password: \\'1234\\'), try creating a channel for it!'\n )\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--5 column--med-10 align-content-top' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--8 column--med-10' },\n _react2.default.createElement(\n 'h3',\n { className: 'h3--no-bottom' },\n 'Log in to an existing channel:'\n ),\n _react2.default.createElement(_ChannelLoginForm2.default, null),\n _react2.default.createElement(\n 'h3',\n { className: 'h3--no-bottom' },\n 'Create a brand new channel:'\n ),\n _react2.default.createElement(_ChannelCreateForm2.default, null)\n )\n )\n )\n );\n }\n }]);\n\n return LoginPage;\n}(_react2.default.Component);\n\n;\n\nexports.default = (0, _reactRouterDom.withRouter)(LoginPage);\n\n/***/ }),\n/* 120 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _show = __webpack_require__(8);\n\nvar _view = __webpack_require__(121);\n\nvar _view2 = _interopRequireDefault(_view);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapStateToProps = function mapStateToProps(_ref) {\n var show = _ref.show;\n\n return {\n error: show.request.error,\n requestType: show.request.type\n };\n};\n\nvar mapDispatchToProps = {\n onHandleShowPageUri: _show.onHandleShowPageUri\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view2.default);\n\n/***/ }),\n/* 121 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _ErrorPage = __webpack_require__(21);\n\nvar _ErrorPage2 = _interopRequireDefault(_ErrorPage);\n\nvar _ShowAssetLite = __webpack_require__(122);\n\nvar _ShowAssetLite2 = _interopRequireDefault(_ShowAssetLite);\n\nvar _ShowAssetDetails = __webpack_require__(125);\n\nvar _ShowAssetDetails2 = _interopRequireDefault(_ShowAssetDetails);\n\nvar _ShowChannel = __webpack_require__(131);\n\nvar _ShowChannel2 = _interopRequireDefault(_ShowChannel);\n\nvar _show_request_types = __webpack_require__(40);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ShowPage = function (_React$Component) {\n _inherits(ShowPage, _React$Component);\n\n function ShowPage() {\n _classCallCheck(this, ShowPage);\n\n return _possibleConstructorReturn(this, (ShowPage.__proto__ || Object.getPrototypeOf(ShowPage)).apply(this, arguments));\n }\n\n _createClass(ShowPage, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.props.onHandleShowPageUri(this.props.match.params);\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(nextProps) {\n if (nextProps.match.params !== this.props.match.params) {\n this.props.onHandleShowPageUri(nextProps.match.params);\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _props = this.props,\n error = _props.error,\n requestType = _props.requestType;\n\n if (error) {\n return _react2.default.createElement(_ErrorPage2.default, { error: error });\n }\n switch (requestType) {\n case _show_request_types.CHANNEL:\n return _react2.default.createElement(_ShowChannel2.default, null);\n case _show_request_types.ASSET_LITE:\n return _react2.default.createElement(_ShowAssetLite2.default, null);\n case _show_request_types.ASSET_DETAILS:\n return _react2.default.createElement(_ShowAssetDetails2.default, null);\n default:\n return _react2.default.createElement(\n 'p',\n null,\n 'loading...'\n );\n }\n }\n }]);\n\n return ShowPage;\n}(_react2.default.Component);\n\n;\n\nexports.default = ShowPage;\n\n/***/ }),\n/* 122 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _view = __webpack_require__(123);\n\nvar _view2 = _interopRequireDefault(_view);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapStateToProps = function mapStateToProps(_ref) {\n var show = _ref.show;\n\n // select request info\n var requestId = show.request.id;\n // select asset info\n var asset = void 0;\n var request = show.requestList[requestId] || null;\n var assetList = show.assetList;\n if (request && assetList) {\n var assetKey = request.key; // note: just store this in the request\n asset = assetList[assetKey] || null;\n };\n // return props\n return {\n asset: asset\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, null)(_view2.default);\n\n/***/ }),\n/* 123 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _SEO = __webpack_require__(9);\n\nvar _SEO2 = _interopRequireDefault(_SEO);\n\nvar _reactRouterDom = __webpack_require__(4);\n\nvar _AssetDisplay = __webpack_require__(41);\n\nvar _AssetDisplay2 = _interopRequireDefault(_AssetDisplay);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ShowLite = function (_React$Component) {\n _inherits(ShowLite, _React$Component);\n\n function ShowLite() {\n _classCallCheck(this, ShowLite);\n\n return _possibleConstructorReturn(this, (ShowLite.__proto__ || Object.getPrototypeOf(ShowLite)).apply(this, arguments));\n }\n\n _createClass(ShowLite, [{\n key: 'render',\n value: function render() {\n var asset = this.props.asset;\n\n if (asset) {\n var _asset$claimData = asset.claimData,\n name = _asset$claimData.name,\n claimId = _asset$claimData.claimId;\n\n return _react2.default.createElement(\n 'div',\n { className: 'row row--tall flex-container--column flex-container--center-center show-lite-container' },\n _react2.default.createElement(_SEO2.default, { pageTitle: name, asset: asset }),\n _react2.default.createElement(_AssetDisplay2.default, null),\n _react2.default.createElement(\n _reactRouterDom.Link,\n { id: 'asset-boilerpate', className: 'link--primary fine-print', to: '/' + claimId + '/' + name },\n 'hosted via Spee.ch'\n )\n );\n }\n return _react2.default.createElement(\n 'div',\n { className: 'row row--tall row--padded flex-container--column flex-container--center-center' },\n _react2.default.createElement(\n 'p',\n null,\n 'loading asset data...'\n )\n );\n }\n }]);\n\n return ShowLite;\n}(_react2.default.Component);\n\n;\n\nexports.default = ShowLite;\n\n/***/ }),\n/* 124 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _ProgressBar = __webpack_require__(20);\n\nvar _ProgressBar2 = _interopRequireDefault(_ProgressBar);\n\nvar _asset_display_states = __webpack_require__(34);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar AssetDisplay = function (_React$Component) {\n _inherits(AssetDisplay, _React$Component);\n\n function AssetDisplay() {\n _classCallCheck(this, AssetDisplay);\n\n return _possibleConstructorReturn(this, (AssetDisplay.__proto__ || Object.getPrototypeOf(AssetDisplay)).apply(this, arguments));\n }\n\n _createClass(AssetDisplay, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n var _props$asset$claimDat = this.props.asset.claimData,\n name = _props$asset$claimDat.name,\n claimId = _props$asset$claimDat.claimId;\n\n this.props.onFileRequest(name, claimId);\n }\n }, {\n key: 'render',\n value: function render() {\n var _props = this.props,\n status = _props.status,\n error = _props.error,\n _props$asset$claimDat2 = _props.asset.claimData,\n name = _props$asset$claimDat2.name,\n claimId = _props$asset$claimDat2.claimId,\n contentType = _props$asset$claimDat2.contentType,\n fileExt = _props$asset$claimDat2.fileExt,\n thumbnail = _props$asset$claimDat2.thumbnail;\n\n return _react2.default.createElement(\n 'div',\n { id: 'asset-display-component' },\n status === _asset_display_states.LOCAL_CHECK && _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n 'p',\n null,\n 'Checking to see if Spee.ch has your asset locally...'\n )\n ),\n status === _asset_display_states.UNAVAILABLE && _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n 'p',\n null,\n 'Sit tight, we\\'re searching the LBRY blockchain for your asset!'\n ),\n _react2.default.createElement(_ProgressBar2.default, { size: 12 }),\n _react2.default.createElement(\n 'p',\n null,\n 'Curious what magic is happening here? ',\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', target: 'blank', href: 'https://lbry.io/faq/what-is-lbry' },\n 'Learn more.'\n )\n )\n ),\n status === _asset_display_states.ERROR && _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n 'p',\n null,\n 'Unfortunately, we couldn\\'t download your asset from LBRY. You can help us out by sharing the below error message in the ',\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', href: 'https://discord.gg/YjYbwhS', target: '_blank' },\n 'LBRY discord'\n ),\n '.'\n ),\n _react2.default.createElement(\n 'i',\n null,\n _react2.default.createElement(\n 'p',\n { id: 'error-message' },\n error\n )\n )\n ),\n status === _asset_display_states.AVAILABLE && function () {\n switch (contentType) {\n case 'image/jpeg':\n case 'image/jpg':\n case 'image/png':\n return _react2.default.createElement('img', {\n className: 'asset',\n src: '/' + claimId + '/' + name + '.' + fileExt,\n alt: name });\n case 'image/gif':\n return _react2.default.createElement('img', {\n className: 'asset',\n src: '/' + claimId + '/' + name + '.' + fileExt,\n alt: name\n });\n case 'video/mp4':\n return _react2.default.createElement(\n 'video',\n { className: 'asset video', controls: true, poster: thumbnail },\n _react2.default.createElement('source', {\n src: '/' + claimId + '/' + name + '.' + fileExt\n }),\n _react2.default.createElement(\n 'p',\n null,\n 'Your browser does not support the ',\n _react2.default.createElement(\n 'code',\n null,\n 'video'\n ),\n ' element.'\n )\n );\n default:\n return _react2.default.createElement(\n 'p',\n null,\n 'Unsupported file type'\n );\n }\n }()\n );\n }\n }]);\n\n return AssetDisplay;\n}(_react2.default.Component);\n\n;\n\nexports.default = AssetDisplay;\n\n/***/ }),\n/* 125 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _view = __webpack_require__(126);\n\nvar _view2 = _interopRequireDefault(_view);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapStateToProps = function mapStateToProps(_ref) {\n var show = _ref.show;\n\n // select request info\n var requestId = show.request.id;\n // select asset info\n var asset = void 0;\n var request = show.requestList[requestId] || null;\n var assetList = show.assetList;\n if (request && assetList) {\n var assetKey = request.key; // note: just store this in the request\n asset = assetList[assetKey] || null;\n };\n // return props\n return {\n asset: asset\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, null)(_view2.default);\n\n/***/ }),\n/* 126 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _SEO = __webpack_require__(9);\n\nvar _SEO2 = _interopRequireDefault(_SEO);\n\nvar _NavBar = __webpack_require__(7);\n\nvar _NavBar2 = _interopRequireDefault(_NavBar);\n\nvar _ErrorPage = __webpack_require__(21);\n\nvar _ErrorPage2 = _interopRequireDefault(_ErrorPage);\n\nvar _AssetTitle = __webpack_require__(127);\n\nvar _AssetTitle2 = _interopRequireDefault(_AssetTitle);\n\nvar _AssetDisplay = __webpack_require__(41);\n\nvar _AssetDisplay2 = _interopRequireDefault(_AssetDisplay);\n\nvar _AssetInfo = __webpack_require__(129);\n\nvar _AssetInfo2 = _interopRequireDefault(_AssetInfo);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ShowAssetDetails = function (_React$Component) {\n _inherits(ShowAssetDetails, _React$Component);\n\n function ShowAssetDetails() {\n _classCallCheck(this, ShowAssetDetails);\n\n return _possibleConstructorReturn(this, (ShowAssetDetails.__proto__ || Object.getPrototypeOf(ShowAssetDetails)).apply(this, arguments));\n }\n\n _createClass(ShowAssetDetails, [{\n key: 'render',\n value: function render() {\n var asset = this.props.asset;\n\n if (asset) {\n var name = asset.claimData.name;\n\n return _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(_SEO2.default, { pageTitle: name + ' - details', asset: asset }),\n _react2.default.createElement(_NavBar2.default, null),\n _react2.default.createElement(\n 'div',\n { className: 'row row--tall row--padded' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--10' },\n _react2.default.createElement(_AssetTitle2.default, null)\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--5 column--sml-10 align-content-top' },\n _react2.default.createElement(\n 'div',\n { className: 'row row--padded show-details-container' },\n _react2.default.createElement(_AssetDisplay2.default, null)\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--5 column--sml-10 align-content-top' },\n _react2.default.createElement(\n 'div',\n { className: 'row row--padded' },\n _react2.default.createElement(_AssetInfo2.default, null)\n )\n )\n ),\n '}'\n );\n };\n return _react2.default.createElement(_ErrorPage2.default, { error: 'loading asset data...' });\n }\n }]);\n\n return ShowAssetDetails;\n}(_react2.default.Component);\n\n;\n\nexports.default = ShowAssetDetails;\n\n/***/ }),\n/* 127 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _view = __webpack_require__(128);\n\nvar _view2 = _interopRequireDefault(_view);\n\nvar _show = __webpack_require__(13);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapStateToProps = function mapStateToProps(_ref) {\n var show = _ref.show;\n\n var _selectAsset = (0, _show.selectAsset)(show),\n title = _selectAsset.claimData.title;\n\n return {\n title: title\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, null)(_view2.default);\n\n/***/ }),\n/* 128 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar AssetTitle = function AssetTitle(_ref) {\n var title = _ref.title;\n\n return _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n 'span',\n { className: 'text--large' },\n title\n )\n );\n};\n\nexports.default = AssetTitle;\n\n/***/ }),\n/* 129 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _view = __webpack_require__(130);\n\nvar _view2 = _interopRequireDefault(_view);\n\nvar _show = __webpack_require__(13);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapStateToProps = function mapStateToProps(_ref) {\n var show = _ref.show;\n\n // select asset\n var asset = (0, _show.selectAsset)(show);\n // return props\n return {\n asset: asset\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, null)(_view2.default);\n\n/***/ }),\n/* 130 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactRouterDom = __webpack_require__(4);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar AssetInfo = function (_React$Component) {\n _inherits(AssetInfo, _React$Component);\n\n function AssetInfo(props) {\n _classCallCheck(this, AssetInfo);\n\n var _this = _possibleConstructorReturn(this, (AssetInfo.__proto__ || Object.getPrototypeOf(AssetInfo)).call(this, props));\n\n _this.copyToClipboard = _this.copyToClipboard.bind(_this);\n return _this;\n }\n\n _createClass(AssetInfo, [{\n key: 'copyToClipboard',\n value: function copyToClipboard(event) {\n var elementToCopy = event.target.dataset.elementtocopy;\n var element = document.getElementById(elementToCopy);\n element.select();\n try {\n document.execCommand('copy');\n } catch (err) {\n this.setState({ error: 'Oops, unable to copy' });\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _props$asset = this.props.asset,\n shortId = _props$asset.shortId,\n _props$asset$claimDat = _props$asset.claimData,\n channelName = _props$asset$claimDat.channelName,\n certificateId = _props$asset$claimDat.certificateId,\n description = _props$asset$claimDat.description,\n name = _props$asset$claimDat.name,\n claimId = _props$asset$claimDat.claimId,\n fileExt = _props$asset$claimDat.fileExt,\n contentType = _props$asset$claimDat.contentType,\n thumbnail = _props$asset$claimDat.thumbnail,\n host = _props$asset$claimDat.host;\n\n return _react2.default.createElement(\n 'div',\n null,\n channelName && _react2.default.createElement(\n 'div',\n { className: 'row row--padded row--wide row--no-top' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--2 column--med-10' },\n _react2.default.createElement(\n 'span',\n { className: 'text' },\n 'Channel:'\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--8 column--med-10' },\n _react2.default.createElement(\n 'span',\n { className: 'text' },\n _react2.default.createElement(\n _reactRouterDom.Link,\n { to: '/' + channelName + ':' + certificateId },\n channelName\n )\n )\n )\n ),\n description && _react2.default.createElement(\n 'div',\n { className: 'row row--padded row--wide row--no-top' },\n _react2.default.createElement(\n 'span',\n { className: 'text' },\n description\n )\n ),\n _react2.default.createElement(\n 'div',\n { id: 'show-share-buttons' },\n _react2.default.createElement(\n 'div',\n { className: 'row row--padded row--wide row--no-top' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--2 column--med-10' },\n _react2.default.createElement(\n 'span',\n { className: 'text' },\n 'Share:'\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--8 column--med-10' },\n _react2.default.createElement(\n 'div',\n {\n className: 'row row--short row--wide flex-container--row flex-container--space-between-bottom flex-container--wrap' },\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', target: '_blank', href: 'https://twitter.com/intent/tweet?text=' + host + '/' + shortId + '/' + name },\n 'twitter'\n ),\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', target: '_blank', href: 'https://www.facebook.com/sharer/sharer.php?u=' + host + '/' + shortId + '/' + name },\n 'facebook'\n ),\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', target: '_blank', href: 'http://tumblr.com/widgets/share/tool?canonicalUrl=' + host + '/' + shortId + '/' + name },\n 'tumblr'\n ),\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', target: '_blank', href: 'https://www.reddit.com/submit?url=' + host + '/' + shortId + '/' + name + '&title=' + name },\n 'reddit'\n )\n )\n )\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'row row--padded row--wide row--no-top' },\n _react2.default.createElement(\n 'div',\n { id: 'show-short-link' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--2 column--med-10' },\n _react2.default.createElement(\n 'span',\n { className: 'text' },\n 'Link:'\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--8 column--med-10' },\n _react2.default.createElement(\n 'div',\n { className: 'row row--short row--wide' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--7' },\n _react2.default.createElement(\n 'div',\n { className: 'input-error', id: 'input-error-copy-short-link', hidden: 'true' },\n 'error here'\n ),\n _react2.default.createElement('input', { type: 'text', id: 'short-link', className: 'input-disabled input-text--full-width', readOnly: true,\n spellCheck: 'false',\n value: host + '/' + shortId + '/' + name + '.' + fileExt,\n onClick: this.select })\n ),\n _react2.default.createElement('div', { className: 'column column--1' }),\n _react2.default.createElement(\n 'div',\n { className: 'column column--2' },\n _react2.default.createElement(\n 'button',\n { className: 'button--primary button--wide', 'data-elementtocopy': 'short-link',\n onClick: this.copyToClipboard },\n 'copy'\n )\n )\n )\n )\n ),\n _react2.default.createElement(\n 'div',\n { id: 'show-embed-code' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--2 column--med-10' },\n _react2.default.createElement(\n 'span',\n { className: 'text' },\n 'Embed:'\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--8 column--med-10' },\n _react2.default.createElement(\n 'div',\n { className: 'row row--short row--wide' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--7' },\n _react2.default.createElement(\n 'div',\n { className: 'input-error', id: 'input-error-copy-embed-text', hidden: 'true' },\n 'error here'\n ),\n contentType === 'video/mp4' ? _react2.default.createElement('input', { type: 'text', id: 'embed-text', className: 'input-disabled input-text--full-width', readOnly: true,\n onClick: this.select, spellCheck: 'false',\n value: '' }) : _react2.default.createElement('input', { type: 'text', id: 'embed-text', className: 'input-disabled input-text--full-width', readOnly: true,\n onClick: this.select, spellCheck: 'false',\n value: ''\n })\n ),\n _react2.default.createElement('div', { className: 'column column--1' }),\n _react2.default.createElement(\n 'div',\n { className: 'column column--2' },\n _react2.default.createElement(\n 'button',\n { className: 'button--primary button--wide', 'data-elementtocopy': 'embed-text',\n onClick: this.copyToClipboard },\n 'copy'\n )\n )\n )\n )\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'flex-container--row flex-container--space-between-bottom' },\n _react2.default.createElement(\n _reactRouterDom.Link,\n { className: 'link--primary', to: '/' + shortId + '/' + name + '.' + fileExt },\n _react2.default.createElement(\n 'span',\n {\n className: 'text' },\n 'Direct Link'\n )\n ),\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', href: host + '/' + claimId + '/' + name + '.' + fileExt, download: name },\n 'Download'\n ),\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', target: '_blank', href: 'https://lbry.io/dmca' },\n 'Report'\n )\n )\n );\n }\n }]);\n\n return AssetInfo;\n}(_react2.default.Component);\n\n;\n\nexports.default = AssetInfo;\n\n/***/ }),\n/* 131 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _view = __webpack_require__(132);\n\nvar _view2 = _interopRequireDefault(_view);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapStateToProps = function mapStateToProps(_ref) {\n var show = _ref.show;\n\n // select request info\n var requestId = show.request.id;\n // select request\n var previousRequest = show.requestList[requestId] || null;\n // select channel\n var channel = void 0;\n if (previousRequest) {\n var channelKey = previousRequest.key;\n channel = show.channelList[channelKey] || null;\n }\n return {\n channel: channel\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, null)(_view2.default);\n\n/***/ }),\n/* 132 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _SEO = __webpack_require__(9);\n\nvar _SEO2 = _interopRequireDefault(_SEO);\n\nvar _ErrorPage = __webpack_require__(21);\n\nvar _ErrorPage2 = _interopRequireDefault(_ErrorPage);\n\nvar _NavBar = __webpack_require__(7);\n\nvar _NavBar2 = _interopRequireDefault(_NavBar);\n\nvar _ChannelClaimsDisplay = __webpack_require__(133);\n\nvar _ChannelClaimsDisplay2 = _interopRequireDefault(_ChannelClaimsDisplay);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ShowChannel = function (_React$Component) {\n _inherits(ShowChannel, _React$Component);\n\n function ShowChannel() {\n _classCallCheck(this, ShowChannel);\n\n return _possibleConstructorReturn(this, (ShowChannel.__proto__ || Object.getPrototypeOf(ShowChannel)).apply(this, arguments));\n }\n\n _createClass(ShowChannel, [{\n key: 'render',\n value: function render() {\n var channel = this.props.channel;\n\n if (channel) {\n var name = channel.name,\n longId = channel.longId,\n shortId = channel.shortId;\n\n return _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(_SEO2.default, { pageTitle: name, channel: channel }),\n _react2.default.createElement(_NavBar2.default, null),\n _react2.default.createElement(\n 'div',\n { className: 'row row--tall row--padded' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--10' },\n _react2.default.createElement(\n 'h2',\n null,\n 'channel name: ',\n name\n ),\n _react2.default.createElement(\n 'p',\n { className: 'fine-print' },\n 'full channel id: ',\n longId\n ),\n _react2.default.createElement(\n 'p',\n { className: 'fine-print' },\n 'short channel id: ',\n shortId\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--10' },\n _react2.default.createElement(_ChannelClaimsDisplay2.default, null)\n )\n )\n );\n };\n return _react2.default.createElement(_ErrorPage2.default, { error: 'loading channel data...' });\n }\n }]);\n\n return ShowChannel;\n}(_react2.default.Component);\n\n;\n\nexports.default = ShowChannel;\n\n/***/ }),\n/* 133 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _show = __webpack_require__(8);\n\nvar _view = __webpack_require__(134);\n\nvar _view2 = _interopRequireDefault(_view);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapStateToProps = function mapStateToProps(_ref) {\n var show = _ref.show;\n\n // select channel key\n var request = show.requestList[show.request.id];\n var channelKey = request.key;\n // select channel claims\n var channel = show.channelList[channelKey] || null;\n // return props\n return {\n channelKey: channelKey,\n channel: channel\n };\n};\n\nvar mapDispatchToProps = {\n onUpdateChannelClaims: _show.onUpdateChannelClaims\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view2.default);\n\n/***/ }),\n/* 134 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _AssetPreview = __webpack_require__(135);\n\nvar _AssetPreview2 = _interopRequireDefault(_AssetPreview);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ChannelClaimsDisplay = function (_React$Component) {\n _inherits(ChannelClaimsDisplay, _React$Component);\n\n function ChannelClaimsDisplay(props) {\n _classCallCheck(this, ChannelClaimsDisplay);\n\n var _this = _possibleConstructorReturn(this, (ChannelClaimsDisplay.__proto__ || Object.getPrototypeOf(ChannelClaimsDisplay)).call(this, props));\n\n _this.showNextResultsPage = _this.showNextResultsPage.bind(_this);\n _this.showPreviousResultsPage = _this.showPreviousResultsPage.bind(_this);\n return _this;\n }\n\n _createClass(ChannelClaimsDisplay, [{\n key: 'showPreviousResultsPage',\n value: function showPreviousResultsPage() {\n var currentPage = this.props.channel.claimsData.currentPage;\n\n var previousPage = parseInt(currentPage) - 1;\n this.showNewPage(previousPage);\n }\n }, {\n key: 'showNextResultsPage',\n value: function showNextResultsPage() {\n var currentPage = this.props.channel.claimsData.currentPage;\n\n var nextPage = parseInt(currentPage) + 1;\n this.showNewPage(nextPage);\n }\n }, {\n key: 'showNewPage',\n value: function showNewPage(page) {\n var _props = this.props,\n channelKey = _props.channelKey,\n _props$channel = _props.channel,\n name = _props$channel.name,\n longId = _props$channel.longId;\n\n this.props.onUpdateChannelClaims(channelKey, name, longId, page);\n }\n }, {\n key: 'render',\n value: function render() {\n var _props$channel$claims = this.props.channel.claimsData,\n claims = _props$channel$claims.claims,\n currentPage = _props$channel$claims.currentPage,\n totalPages = _props$channel$claims.totalPages;\n\n return _react2.default.createElement(\n 'div',\n { className: 'row row--tall' },\n claims.length > 0 ? _react2.default.createElement(\n 'div',\n null,\n claims.map(function (claim, index) {\n return _react2.default.createElement(_AssetPreview2.default, {\n claimData: claim,\n key: claim.name + '-' + index\n });\n }),\n _react2.default.createElement(\n 'div',\n null,\n currentPage > 1 && _react2.default.createElement(\n 'button',\n { className: 'button--secondary', onClick: this.showPreviousResultsPage },\n 'Previous Page'\n ),\n currentPage < totalPages && _react2.default.createElement(\n 'button',\n { className: 'button--secondary', onClick: this.showNextResultsPage },\n 'Next Page'\n )\n )\n ) : _react2.default.createElement(\n 'p',\n null,\n 'There are no claims in this channel'\n )\n );\n }\n }]);\n\n return ChannelClaimsDisplay;\n}(_react2.default.Component);\n\n;\n\nexports.default = ChannelClaimsDisplay;\n\n/***/ }),\n/* 135 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactRouterDom = __webpack_require__(4);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar _require = __webpack_require__(3),\n defaultThumbnail = _require.claim.defaultThumbnail;\n\nvar AssetPreview = function AssetPreview(_ref) {\n var _ref$claimData = _ref.claimData,\n name = _ref$claimData.name,\n claimId = _ref$claimData.claimId,\n fileExt = _ref$claimData.fileExt,\n contentType = _ref$claimData.contentType,\n thumbnail = _ref$claimData.thumbnail;\n\n var directSourceLink = claimId + '/' + name + '.' + fileExt;\n var showUrlLink = '/' + claimId + '/' + name;\n return _react2.default.createElement(\n 'div',\n { className: 'asset-holder' },\n _react2.default.createElement(\n _reactRouterDom.Link,\n { to: showUrlLink },\n function () {\n switch (contentType) {\n case 'image/jpeg':\n case 'image/jpg':\n case 'image/png':\n case 'image/gif':\n return _react2.default.createElement('img', {\n className: 'asset-preview',\n src: directSourceLink,\n alt: name\n });\n case 'video/mp4':\n return _react2.default.createElement('img', {\n className: 'asset-preview video',\n src: thumbnail || defaultThumbnail,\n alt: name\n });\n default:\n return _react2.default.createElement(\n 'p',\n null,\n 'unsupported file type'\n );\n }\n }()\n )\n );\n};\n\nexports.default = AssetPreview;\n\n/***/ }),\n/* 136 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _NavBar = __webpack_require__(7);\n\nvar _NavBar2 = _interopRequireDefault(_NavBar);\n\nvar _reactHelmet = __webpack_require__(14);\n\nvar _reactHelmet2 = _interopRequireDefault(_reactHelmet);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar _require = __webpack_require__(3),\n _require$site = _require.site,\n title = _require$site.title,\n host = _require$site.host;\n\nvar FourOhForPage = function (_React$Component) {\n _inherits(FourOhForPage, _React$Component);\n\n function FourOhForPage() {\n _classCallCheck(this, FourOhForPage);\n\n return _possibleConstructorReturn(this, (FourOhForPage.__proto__ || Object.getPrototypeOf(FourOhForPage)).apply(this, arguments));\n }\n\n _createClass(FourOhForPage, [{\n key: 'render',\n value: function render() {\n return _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n _reactHelmet2.default,\n null,\n _react2.default.createElement(\n 'title',\n null,\n title,\n ' - 404'\n ),\n _react2.default.createElement('link', { rel: 'canonical', href: host + '/404' })\n ),\n _react2.default.createElement(_NavBar2.default, null),\n _react2.default.createElement(\n 'div',\n { className: 'row row--padded' },\n _react2.default.createElement(\n 'h2',\n null,\n '404'\n ),\n _react2.default.createElement(\n 'p',\n null,\n 'That page does not exist'\n )\n )\n );\n }\n }]);\n\n return FourOhForPage;\n}(_react2.default.Component);\n\n;\n\nexports.default = FourOhForPage;\n\n/***/ }),\n/* 137 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _require = __webpack_require__(17),\n sendGAServeEvent = _require.sendGAServeEvent;\n\nvar _require2 = __webpack_require__(138),\n determineResponseType = _require2.determineResponseType,\n flipClaimNameAndIdForBackwardsCompatibility = _require2.flipClaimNameAndIdForBackwardsCompatibility,\n logRequestData = _require2.logRequestData,\n getClaimIdAndServeAsset = _require2.getClaimIdAndServeAsset;\n\nvar lbryUri = __webpack_require__(139);\nvar handleShowRender = __webpack_require__(140);\nvar SERVE = 'SERVE';\n\nmodule.exports = function (app) {\n // route to serve a specific asset using the channel or claim id\n app.get('/:identifier/:claim', function (req, res) {\n var headers = req.headers,\n ip = req.ip,\n originalUrl = req.originalUrl,\n params = req.params;\n // decide if this is a show request\n\n var hasFileExtension = void 0;\n try {\n var _lbryUri$parseModifie = lbryUri.parseModifier(params.claim);\n\n hasFileExtension = _lbryUri$parseModifie.hasFileExtension;\n } catch (error) {\n return res.status(400).json({ success: false, message: error.message });\n }\n var responseType = determineResponseType(hasFileExtension, headers);\n if (responseType !== SERVE) {\n return handleShowRender(req, res);\n }\n // handle serve request\n // send google analytics\n sendGAServeEvent(headers, ip, originalUrl);\n // parse the claim\n var claimName = void 0;\n try {\n var _lbryUri$parseClaim = lbryUri.parseClaim(params.claim);\n\n claimName = _lbryUri$parseClaim.claimName;\n } catch (error) {\n return res.status(400).json({ success: false, message: error.message });\n }\n // parse the identifier\n var isChannel = void 0,\n channelName = void 0,\n channelClaimId = void 0,\n claimId = void 0;\n try {\n var _lbryUri$parseIdentif = lbryUri.parseIdentifier(params.identifier);\n\n isChannel = _lbryUri$parseIdentif.isChannel;\n channelName = _lbryUri$parseIdentif.channelName;\n channelClaimId = _lbryUri$parseIdentif.channelClaimId;\n claimId = _lbryUri$parseIdentif.claimId;\n } catch (error) {\n return res.status(400).json({ success: false, message: error.message });\n }\n if (!isChannel) {\n var _flipClaimNameAndIdFo = flipClaimNameAndIdForBackwardsCompatibility(claimId, claimName);\n\n var _flipClaimNameAndIdFo2 = _slicedToArray(_flipClaimNameAndIdFo, 2);\n\n claimId = _flipClaimNameAndIdFo2[0];\n claimName = _flipClaimNameAndIdFo2[1];\n }\n // log the request data for debugging\n logRequestData(responseType, claimName, channelName, claimId);\n // get the claim Id and then serve the asset\n getClaimIdAndServeAsset(channelName, channelClaimId, claimName, claimId, originalUrl, ip, res);\n });\n // route to serve the winning asset at a claim or a channel page\n app.get('/:claim', function (req, res) {\n var headers = req.headers,\n ip = req.ip,\n originalUrl = req.originalUrl,\n params = req.params;\n // decide if this is a show request\n\n var hasFileExtension = void 0;\n try {\n var _lbryUri$parseModifie2 = lbryUri.parseModifier(params.claim);\n\n hasFileExtension = _lbryUri$parseModifie2.hasFileExtension;\n } catch (error) {\n return res.status(400).json({ success: false, message: error.message });\n }\n var responseType = determineResponseType(hasFileExtension, headers);\n if (responseType !== SERVE) {\n return handleShowRender(req, res);\n }\n // handle serve request\n // send google analytics\n sendGAServeEvent(headers, ip, originalUrl);\n // parse the claim\n var claimName = void 0;\n try {\n var _lbryUri$parseClaim2 = lbryUri.parseClaim(params.claim);\n\n claimName = _lbryUri$parseClaim2.claimName;\n } catch (error) {\n return res.status(400).json({ success: false, message: error.message });\n }\n // log the request data for debugging\n logRequestData(responseType, claimName, null, null);\n // get the claim Id and then serve the asset\n getClaimIdAndServeAsset(null, null, claimName, null, originalUrl, ip, res);\n });\n};\n\n/***/ }),\n/* 138 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar logger = __webpack_require__(2);\n\nvar _require = __webpack_require__(27),\n getClaimId = _require.getClaimId,\n getLocalFileRecord = _require.getLocalFileRecord;\n\nvar _require2 = __webpack_require__(26),\n handleErrorResponse = _require2.handleErrorResponse;\n\nvar SERVE = 'SERVE';\nvar SHOW = 'SHOW';\nvar NO_FILE = 'NO_FILE';\nvar NO_CHANNEL = 'NO_CHANNEL';\nvar NO_CLAIM = 'NO_CLAIM';\n\nfunction clientAcceptsHtml(_ref) {\n var accept = _ref.accept;\n\n return accept && accept.match(/text\\/html/);\n};\n\nfunction requestIsFromBrowser(headers) {\n return headers['user-agent'] && headers['user-agent'].match(/Mozilla/);\n};\n\nfunction clientWantsAsset(_ref2) {\n var accept = _ref2.accept,\n range = _ref2.range;\n\n var imageIsWanted = accept && accept.match(/image\\/.*/) && !accept.match(/text\\/html/) && !accept.match(/text\\/\\*/);\n var videoIsWanted = accept && range;\n return imageIsWanted || videoIsWanted;\n};\n\nfunction isValidClaimId(claimId) {\n return claimId.length === 40 && !/[^A-Za-z0-9]/g.test(claimId);\n};\n\nfunction isValidShortId(claimId) {\n return claimId.length === 1; // it should really evaluate the short url itself\n};\n\nfunction isValidShortIdOrClaimId(input) {\n return isValidClaimId(input) || isValidShortId(input);\n};\n\nfunction serveAssetToClient(claimId, name, res) {\n return getLocalFileRecord(claimId, name).then(function (fileRecord) {\n // check that a local record was found\n if (fileRecord === NO_FILE) {\n return res.status(307).redirect('/api/claim/get/' + name + '/' + claimId);\n }\n // serve the file\n var filePath = fileRecord.filePath,\n fileType = fileRecord.fileType;\n\n logger.verbose('serving file: ' + filePath);\n var sendFileOptions = {\n headers: {\n 'X-Content-Type-Options': 'nosniff',\n 'Content-Type': fileType || 'image/jpeg'\n }\n };\n res.status(200).sendFile(filePath, sendFileOptions);\n }).catch(function (error) {\n throw error;\n });\n};\n\nmodule.exports = {\n getClaimIdAndServeAsset: function getClaimIdAndServeAsset(channelName, channelClaimId, claimName, claimId, originalUrl, ip, res) {\n // get the claim Id and then serve the asset\n getClaimId(channelName, channelClaimId, claimName, claimId).then(function (fullClaimId) {\n if (fullClaimId === NO_CLAIM) {\n return res.status(404).json({ success: false, message: 'no claim id could be found' });\n } else if (fullClaimId === NO_CHANNEL) {\n return res.status(404).json({ success: false, message: 'no channel id could be found' });\n }\n serveAssetToClient(fullClaimId, claimName, res);\n // postToStats(responseType, originalUrl, ip, claimName, fullClaimId, 'success');\n }).catch(function (error) {\n handleErrorResponse(originalUrl, ip, error, res);\n // postToStats(responseType, originalUrl, ip, claimName, fullClaimId, 'fail');\n });\n },\n determineResponseType: function determineResponseType(hasFileExtension, headers) {\n var responseType = void 0;\n if (hasFileExtension) {\n responseType = SERVE; // assume a serve request if file extension is present\n if (clientAcceptsHtml(headers)) {\n // if the request comes from a browser, change it to a show request\n responseType = SHOW;\n }\n } else {\n responseType = SHOW;\n if (clientWantsAsset(headers) && requestIsFromBrowser(headers)) {\n // this is in case someone embeds a show url\n logger.debug('Show request came from browser but wants an image/video. Changing response to serve...');\n responseType = SERVE;\n }\n }\n return responseType;\n },\n flipClaimNameAndIdForBackwardsCompatibility: function flipClaimNameAndIdForBackwardsCompatibility(identifier, name) {\n // this is a patch for backwards compatability with '/name/claim_id' url format\n if (isValidShortIdOrClaimId(name) && !isValidShortIdOrClaimId(identifier)) {\n var tempName = name;\n name = identifier;\n identifier = tempName;\n }\n return [identifier, name];\n },\n logRequestData: function logRequestData(responseType, claimName, channelName, claimId) {\n logger.debug('responseType ===', responseType);\n logger.debug('claim name === ', claimName);\n logger.debug('channel name ===', channelName);\n logger.debug('claim id ===', claimId);\n }\n};\n\n/***/ }),\n/* 139 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar logger = __webpack_require__(2);\n\nmodule.exports = {\n REGEXP_INVALID_CLAIM: /[^A-Za-z0-9-]/g,\n REGEXP_INVALID_CHANNEL: /[^A-Za-z0-9-@]/g,\n REGEXP_ADDRESS: /^b(?=[^0OIl]{32,33})[0-9A-Za-z]{32,33}$/,\n CHANNEL_CHAR: '@',\n parseIdentifier: function parseIdentifier(identifier) {\n logger.debug('parsing identifier:', identifier);\n var componentsRegex = new RegExp('([^:$#/]*)' + // value (stops at the first separator or end)\n '([:$#]?)([^/]*)' // modifier separator, modifier (stops at the first path separator or end)\n );\n\n var _componentsRegex$exec = componentsRegex.exec(identifier).map(function (match) {\n return match || null;\n }),\n _componentsRegex$exec2 = _slicedToArray(_componentsRegex$exec, 4),\n proto = _componentsRegex$exec2[0],\n value = _componentsRegex$exec2[1],\n modifierSeperator = _componentsRegex$exec2[2],\n modifier = _componentsRegex$exec2[3];\n\n logger.debug(proto + ', ' + value + ', ' + modifierSeperator + ', ' + modifier);\n\n // Validate and process name\n if (!value) {\n throw new Error('Check your url. No channel name provided before \"' + modifierSeperator + '\"');\n }\n var isChannel = value.startsWith(module.exports.CHANNEL_CHAR);\n var channelName = isChannel ? value : null;\n var claimId = void 0;\n if (isChannel) {\n if (!channelName) {\n throw new Error('No channel name after @.');\n }\n var nameBadChars = channelName.match(module.exports.REGEXP_INVALID_CHANNEL);\n if (nameBadChars) {\n throw new Error('Invalid characters in channel name: ' + nameBadChars.join(', ') + '.');\n }\n } else {\n claimId = value;\n }\n\n // Validate and process modifier\n var channelClaimId = void 0;\n if (modifierSeperator) {\n if (!modifier) {\n throw new Error('No modifier provided after separator \"' + modifierSeperator + '\"');\n }\n\n if (modifierSeperator === ':') {\n channelClaimId = modifier;\n } else {\n throw new Error('The \"' + modifierSeperator + '\" modifier is not currently supported');\n }\n }\n return {\n isChannel: isChannel,\n channelName: channelName,\n channelClaimId: channelClaimId,\n claimId: claimId\n };\n },\n parseClaim: function parseClaim(claim) {\n logger.debug('parsing name:', claim);\n var componentsRegex = new RegExp('([^:$#/.]*)' + // name (stops at the first modifier)\n '([:$#.]?)([^/]*)' // modifier separator, modifier (stops at the first path separator or end)\n );\n\n var _componentsRegex$exec3 = componentsRegex.exec(claim).map(function (match) {\n return match || null;\n }),\n _componentsRegex$exec4 = _slicedToArray(_componentsRegex$exec3, 4),\n proto = _componentsRegex$exec4[0],\n claimName = _componentsRegex$exec4[1],\n modifierSeperator = _componentsRegex$exec4[2],\n modifier = _componentsRegex$exec4[3];\n\n logger.debug(proto + ', ' + claimName + ', ' + modifierSeperator + ', ' + modifier);\n\n // Validate and process name\n if (!claimName) {\n throw new Error('No claim name provided before .');\n }\n var nameBadChars = claimName.match(module.exports.REGEXP_INVALID_CLAIM);\n if (nameBadChars) {\n throw new Error('Invalid characters in claim name: ' + nameBadChars.join(', ') + '.');\n }\n // Validate and process modifier\n if (modifierSeperator) {\n if (!modifier) {\n throw new Error('No file extension provided after separator ' + modifierSeperator + '.');\n }\n if (modifierSeperator !== '.') {\n throw new Error('The ' + modifierSeperator + ' modifier is not supported in the claim name');\n }\n }\n // return results\n return {\n claimName: claimName\n };\n },\n parseModifier: function parseModifier(claim) {\n logger.debug('parsing modifier:', claim);\n var componentsRegex = new RegExp('([^:$#/.]*)' + // name (stops at the first modifier)\n '([:$#.]?)([^/]*)' // modifier separator, modifier (stops at the first path separator or end)\n );\n\n var _componentsRegex$exec5 = componentsRegex.exec(claim).map(function (match) {\n return match || null;\n }),\n _componentsRegex$exec6 = _slicedToArray(_componentsRegex$exec5, 4),\n proto = _componentsRegex$exec6[0],\n claimName = _componentsRegex$exec6[1],\n modifierSeperator = _componentsRegex$exec6[2],\n modifier = _componentsRegex$exec6[3];\n\n logger.debug(proto + ', ' + claimName + ', ' + modifierSeperator + ', ' + modifier);\n // Validate and process modifier\n var hasFileExtension = false;\n if (modifierSeperator) {\n hasFileExtension = true;\n }\n return {\n hasFileExtension: hasFileExtension\n };\n }\n};\n\n/***/ }),\n/* 140 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _server = __webpack_require__(29);\n\nvar _redux = __webpack_require__(18);\n\nvar _reducers = __webpack_require__(30);\n\nvar _reducers2 = _interopRequireDefault(_reducers);\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _reactRouterDom = __webpack_require__(4);\n\nvar _GAListener = __webpack_require__(35);\n\nvar _GAListener2 = _interopRequireDefault(_GAListener);\n\nvar _app = __webpack_require__(36);\n\nvar _app2 = _interopRequireDefault(_app);\n\nvar _renderFullPage = __webpack_require__(42);\n\nvar _renderFullPage2 = _interopRequireDefault(_renderFullPage);\n\nvar _reduxSaga = __webpack_require__(141);\n\nvar _reduxSaga2 = _interopRequireDefault(_reduxSaga);\n\nvar _effects = __webpack_require__(15);\n\nvar _show_uri = __webpack_require__(142);\n\nvar _show = __webpack_require__(8);\n\nvar _reactHelmet = __webpack_require__(14);\n\nvar _reactHelmet2 = _interopRequireDefault(_reactHelmet);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar returnSagaWithParams = function returnSagaWithParams(saga, params) {\n return (/*#__PURE__*/regeneratorRuntime.mark(function _callee() {\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return (0, _effects.call)(saga, params);\n\n case 2:\n case 'end':\n return _context.stop();\n }\n }\n }, _callee, this);\n })\n );\n};\n\nmodule.exports = function (req, res) {\n var context = {};\n\n // create and apply middleware\n var sagaMiddleware = (0, _reduxSaga2.default)();\n var middleware = (0, _redux.applyMiddleware)(sagaMiddleware);\n\n // create a new Redux store instance\n var store = (0, _redux.createStore)(_reducers2.default, middleware);\n\n // create saga\n var action = (0, _show.onHandleShowPageUri)(req.params);\n var saga = returnSagaWithParams(_show_uri.handleShowPageUri, action);\n\n // run the saga middleware\n sagaMiddleware.run(saga).done.then(function () {\n // render component to a string\n var html = (0, _server.renderToString)(_react2.default.createElement(\n _reactRedux.Provider,\n { store: store },\n _react2.default.createElement(\n _reactRouterDom.StaticRouter,\n { location: req.url, context: context },\n _react2.default.createElement(\n _GAListener2.default,\n null,\n _react2.default.createElement(_app2.default, null)\n )\n )\n ));\n\n // get head tags from helmet\n var helmet = _reactHelmet2.default.renderStatic();\n\n // check for a redirect\n if (context.url) {\n return res.redirect(301, context.url);\n }\n\n // get the initial state from our Redux store\n var preloadedState = store.getState();\n\n // send the rendered page back to the client\n res.send((0, _renderFullPage2.default)(helmet, html, preloadedState));\n });\n};\n\n/***/ }),\n/* 141 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"redux-saga\");\n\n/***/ }),\n/* 142 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.handleShowPageUri = handleShowPageUri;\nexports.watchHandleShowPageUri = watchHandleShowPageUri;\n\nvar _effects = __webpack_require__(15);\n\nvar _show_action_types = __webpack_require__(12);\n\nvar actions = _interopRequireWildcard(_show_action_types);\n\nvar _show = __webpack_require__(8);\n\nvar _show_asset = __webpack_require__(143);\n\nvar _show_channel = __webpack_require__(145);\n\nvar _lbryUri = __webpack_require__(147);\n\nvar _lbryUri2 = _interopRequireDefault(_lbryUri);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nvar _marked = /*#__PURE__*/regeneratorRuntime.mark(parseAndUpdateIdentifierAndClaim),\n _marked2 = /*#__PURE__*/regeneratorRuntime.mark(parseAndUpdateClaimOnly),\n _marked3 = /*#__PURE__*/regeneratorRuntime.mark(handleShowPageUri),\n _marked4 = /*#__PURE__*/regeneratorRuntime.mark(watchHandleShowPageUri);\n\nfunction parseAndUpdateIdentifierAndClaim(modifier, claim) {\n var isChannel, channelName, channelClaimId, claimId, claimName, extension, _lbryUri$parseIdentif, _lbryUri$parseClaim;\n\n return regeneratorRuntime.wrap(function parseAndUpdateIdentifierAndClaim$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n // this is a request for an asset\n // claim will be an asset claim\n // the identifier could be a channel or a claim id\n isChannel = void 0, channelName = void 0, channelClaimId = void 0, claimId = void 0, claimName = void 0, extension = void 0;\n _context.prev = 1;\n _lbryUri$parseIdentif = _lbryUri2.default.parseIdentifier(modifier);\n isChannel = _lbryUri$parseIdentif.isChannel;\n channelName = _lbryUri$parseIdentif.channelName;\n channelClaimId = _lbryUri$parseIdentif.channelClaimId;\n claimId = _lbryUri$parseIdentif.claimId;\n _lbryUri$parseClaim = _lbryUri2.default.parseClaim(claim);\n claimName = _lbryUri$parseClaim.claimName;\n extension = _lbryUri$parseClaim.extension;\n _context.next = 17;\n break;\n\n case 12:\n _context.prev = 12;\n _context.t0 = _context['catch'](1);\n _context.next = 16;\n return (0, _effects.put)((0, _show.onRequestError)(_context.t0.message));\n\n case 16:\n return _context.abrupt('return', _context.sent);\n\n case 17:\n if (!isChannel) {\n _context.next = 21;\n break;\n }\n\n _context.next = 20;\n return (0, _effects.call)(_show_asset.newAssetRequest, (0, _show.onNewAssetRequest)(claimName, null, channelName, channelClaimId, extension));\n\n case 20:\n return _context.abrupt('return', _context.sent);\n\n case 21:\n ;\n _context.next = 24;\n return (0, _effects.call)(_show_asset.newAssetRequest, (0, _show.onNewAssetRequest)(claimName, claimId, null, null, extension));\n\n case 24:\n case 'end':\n return _context.stop();\n }\n }\n }, _marked, this, [[1, 12]]);\n}\nfunction parseAndUpdateClaimOnly(claim) {\n var isChannel, channelName, channelClaimId, _lbryUri$parseIdentif2, claimName, extension, _lbryUri$parseClaim2;\n\n return regeneratorRuntime.wrap(function parseAndUpdateClaimOnly$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n // this could be a request for an asset or a channel page\n // claim could be an asset claim or a channel claim\n isChannel = void 0, channelName = void 0, channelClaimId = void 0;\n _context2.prev = 1;\n _lbryUri$parseIdentif2 = _lbryUri2.default.parseIdentifier(claim);\n isChannel = _lbryUri$parseIdentif2.isChannel;\n channelName = _lbryUri$parseIdentif2.channelName;\n channelClaimId = _lbryUri$parseIdentif2.channelClaimId;\n _context2.next = 13;\n break;\n\n case 8:\n _context2.prev = 8;\n _context2.t0 = _context2['catch'](1);\n _context2.next = 12;\n return (0, _effects.put)((0, _show.onRequestError)(_context2.t0.message));\n\n case 12:\n return _context2.abrupt('return', _context2.sent);\n\n case 13:\n if (!isChannel) {\n _context2.next = 17;\n break;\n }\n\n _context2.next = 16;\n return (0, _effects.call)(_show_channel.newChannelRequest, (0, _show.onNewChannelRequest)(channelName, channelClaimId));\n\n case 16:\n return _context2.abrupt('return', _context2.sent);\n\n case 17:\n // if not for a channel, parse the claim request\n claimName = void 0, extension = void 0;\n _context2.prev = 18;\n _lbryUri$parseClaim2 = _lbryUri2.default.parseClaim(claim);\n claimName = _lbryUri$parseClaim2.claimName;\n extension = _lbryUri$parseClaim2.extension;\n _context2.next = 29;\n break;\n\n case 24:\n _context2.prev = 24;\n _context2.t1 = _context2['catch'](18);\n _context2.next = 28;\n return (0, _effects.put)((0, _show.onRequestError)(_context2.t1.message));\n\n case 28:\n return _context2.abrupt('return', _context2.sent);\n\n case 29:\n _context2.next = 31;\n return (0, _effects.call)(_show_asset.newAssetRequest, (0, _show.onNewAssetRequest)(claimName, null, null, null, extension));\n\n case 31:\n case 'end':\n return _context2.stop();\n }\n }\n }, _marked2, this, [[1, 8], [18, 24]]);\n}\n\nfunction handleShowPageUri(action) {\n var _action$data, identifier, claim;\n\n return regeneratorRuntime.wrap(function handleShowPageUri$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n _action$data = action.data, identifier = _action$data.identifier, claim = _action$data.claim;\n\n if (!identifier) {\n _context3.next = 5;\n break;\n }\n\n _context3.next = 4;\n return (0, _effects.call)(parseAndUpdateIdentifierAndClaim, identifier, claim);\n\n case 4:\n return _context3.abrupt('return', _context3.sent);\n\n case 5:\n _context3.next = 7;\n return (0, _effects.call)(parseAndUpdateClaimOnly, claim);\n\n case 7:\n case 'end':\n return _context3.stop();\n }\n }\n }, _marked3, this);\n};\n\nfunction watchHandleShowPageUri() {\n return regeneratorRuntime.wrap(function watchHandleShowPageUri$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n _context4.next = 2;\n return (0, _effects.takeLatest)(actions.HANDLE_SHOW_URI, handleShowPageUri);\n\n case 2:\n case 'end':\n return _context4.stop();\n }\n }\n }, _marked4, this);\n};\n\n/***/ }),\n/* 143 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.newAssetRequest = newAssetRequest;\nexports.watchNewAssetRequest = watchNewAssetRequest;\n\nvar _effects = __webpack_require__(15);\n\nvar _show_action_types = __webpack_require__(12);\n\nvar actions = _interopRequireWildcard(_show_action_types);\n\nvar _show = __webpack_require__(8);\n\nvar _assetApi = __webpack_require__(144);\n\nvar _show2 = __webpack_require__(13);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nvar _marked = /*#__PURE__*/regeneratorRuntime.mark(newAssetRequest),\n _marked2 = /*#__PURE__*/regeneratorRuntime.mark(watchNewAssetRequest);\n\nfunction newAssetRequest(action) {\n var _action$data, requestType, requestId, name, modifier, state, longId, _ref, assetKey, shortId, _ref2, claimData, _ref3;\n\n return regeneratorRuntime.wrap(function newAssetRequest$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _action$data = action.data, requestType = _action$data.requestType, requestId = _action$data.requestId, name = _action$data.name, modifier = _action$data.modifier;\n // put an action to update the request in redux\n\n _context.next = 3;\n return (0, _effects.put)((0, _show.onRequestUpdate)(requestType, requestId));\n\n case 3:\n _context.next = 5;\n return (0, _effects.select)(_show2.selectShowState);\n\n case 5:\n state = _context.sent;\n\n if (!state.requestList[requestId]) {\n _context.next = 8;\n break;\n }\n\n return _context.abrupt('return', null);\n\n case 8:\n // get long id && add request to request list\n longId = void 0;\n _context.prev = 9;\n _context.next = 12;\n return (0, _effects.call)(_assetApi.getLongClaimId, name, modifier);\n\n case 12:\n _ref = _context.sent;\n longId = _ref.data;\n _context.next = 21;\n break;\n\n case 16:\n _context.prev = 16;\n _context.t0 = _context['catch'](9);\n _context.next = 20;\n return (0, _effects.put)((0, _show.onRequestError)(_context.t0.message));\n\n case 20:\n return _context.abrupt('return', _context.sent);\n\n case 21:\n assetKey = 'a#' + name + '#' + longId;\n _context.next = 24;\n return (0, _effects.put)((0, _show.addRequestToRequestList)(requestId, null, assetKey));\n\n case 24:\n if (!state.assetList[assetKey]) {\n _context.next = 26;\n break;\n }\n\n return _context.abrupt('return', null);\n\n case 26:\n // get short Id\n shortId = void 0;\n _context.prev = 27;\n _context.next = 30;\n return (0, _effects.call)(_assetApi.getShortId, name, longId);\n\n case 30:\n _ref2 = _context.sent;\n shortId = _ref2.data;\n _context.next = 39;\n break;\n\n case 34:\n _context.prev = 34;\n _context.t1 = _context['catch'](27);\n _context.next = 38;\n return (0, _effects.put)((0, _show.onRequestError)(_context.t1.message));\n\n case 38:\n return _context.abrupt('return', _context.sent);\n\n case 39:\n // get asset claim data\n claimData = void 0;\n _context.prev = 40;\n _context.next = 43;\n return (0, _effects.call)(_assetApi.getClaimData, name, longId);\n\n case 43:\n _ref3 = _context.sent;\n claimData = _ref3.data;\n _context.next = 52;\n break;\n\n case 47:\n _context.prev = 47;\n _context.t2 = _context['catch'](40);\n _context.next = 51;\n return (0, _effects.put)((0, _show.onRequestError)(_context.t2.message));\n\n case 51:\n return _context.abrupt('return', _context.sent);\n\n case 52:\n _context.next = 54;\n return (0, _effects.put)((0, _show.addAssetToAssetList)(assetKey, null, name, longId, shortId, claimData));\n\n case 54:\n _context.next = 56;\n return (0, _effects.put)((0, _show.onRequestError)(null));\n\n case 56:\n case 'end':\n return _context.stop();\n }\n }\n }, _marked, this, [[9, 16], [27, 34], [40, 47]]);\n};\n\nfunction watchNewAssetRequest() {\n return regeneratorRuntime.wrap(function watchNewAssetRequest$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return (0, _effects.takeLatest)(actions.ASSET_REQUEST_NEW, newAssetRequest);\n\n case 2:\n case 'end':\n return _context2.stop();\n }\n }\n }, _marked2, this);\n};\n\n/***/ }),\n/* 144 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getLongClaimId = getLongClaimId;\nexports.getShortId = getShortId;\nexports.getClaimData = getClaimData;\n\nvar _request = __webpack_require__(11);\n\nvar _request2 = _interopRequireDefault(_request);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar _require = __webpack_require__(3),\n host = _require.site.host;\n\nfunction getLongClaimId(name, modifier) {\n var body = {};\n // create request params\n if (modifier) {\n if (modifier.id) {\n body['claimId'] = modifier.id;\n } else {\n body['channelName'] = modifier.channel.name;\n body['channelClaimId'] = modifier.channel.id;\n }\n }\n body['claimName'] = name;\n var params = {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body)\n };\n // create url\n var url = host + '/api/claim/long-id';\n // return the request promise\n return (0, _request2.default)(url, params);\n};\n\nfunction getShortId(name, claimId) {\n var url = host + '/api/claim/short-id/' + claimId + '/' + name;\n return (0, _request2.default)(url);\n};\n\nfunction getClaimData(name, claimId) {\n var url = host + '/api/claim/data/' + name + '/' + claimId;\n return (0, _request2.default)(url);\n};\n\n/***/ }),\n/* 145 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.newChannelRequest = newChannelRequest;\nexports.watchNewChannelRequest = watchNewChannelRequest;\nexports.watchUpdateChannelClaims = watchUpdateChannelClaims;\n\nvar _effects = __webpack_require__(15);\n\nvar _show_action_types = __webpack_require__(12);\n\nvar actions = _interopRequireWildcard(_show_action_types);\n\nvar _show = __webpack_require__(8);\n\nvar _channelApi = __webpack_require__(146);\n\nvar _show2 = __webpack_require__(13);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nvar _marked = /*#__PURE__*/regeneratorRuntime.mark(newChannelRequest),\n _marked2 = /*#__PURE__*/regeneratorRuntime.mark(watchNewChannelRequest),\n _marked3 = /*#__PURE__*/regeneratorRuntime.mark(getNewClaimsAndUpdateChannel),\n _marked4 = /*#__PURE__*/regeneratorRuntime.mark(watchUpdateChannelClaims);\n\nfunction newChannelRequest(action) {\n var _action$data, requestType, requestId, channelName, channelId, state, longId, shortId, _ref, _ref$data, channelKey, claimsData, _ref2;\n\n return regeneratorRuntime.wrap(function newChannelRequest$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _action$data = action.data, requestType = _action$data.requestType, requestId = _action$data.requestId, channelName = _action$data.channelName, channelId = _action$data.channelId;\n // put an action to update the request in redux\n\n _context.next = 3;\n return (0, _effects.put)((0, _show.onRequestUpdate)(requestType, requestId));\n\n case 3:\n _context.next = 5;\n return (0, _effects.select)(_show2.selectShowState);\n\n case 5:\n state = _context.sent;\n\n if (!state.requestList[requestId]) {\n _context.next = 8;\n break;\n }\n\n return _context.abrupt('return', null);\n\n case 8:\n // get channel long id\n longId = void 0, shortId = void 0;\n _context.prev = 9;\n _context.next = 12;\n return (0, _effects.call)(_channelApi.getChannelData, channelName, channelId);\n\n case 12:\n _ref = _context.sent;\n _ref$data = _ref.data;\n longId = _ref$data.longChannelClaimId;\n shortId = _ref$data.shortChannelClaimId;\n _context.next = 23;\n break;\n\n case 18:\n _context.prev = 18;\n _context.t0 = _context['catch'](9);\n _context.next = 22;\n return (0, _effects.put)((0, _show.onRequestError)(_context.t0.message));\n\n case 22:\n return _context.abrupt('return', _context.sent);\n\n case 23:\n // store the request in the channel requests list\n channelKey = 'c#' + channelName + '#' + longId;\n _context.next = 26;\n return (0, _effects.put)((0, _show.addRequestToRequestList)(requestId, null, channelKey));\n\n case 26:\n if (!state.channelList[channelKey]) {\n _context.next = 28;\n break;\n }\n\n return _context.abrupt('return', null);\n\n case 28:\n // get channel claims data\n claimsData = void 0;\n _context.prev = 29;\n _context.next = 32;\n return (0, _effects.call)(_channelApi.getChannelClaims, channelName, longId, 1);\n\n case 32:\n _ref2 = _context.sent;\n claimsData = _ref2.data;\n _context.next = 41;\n break;\n\n case 36:\n _context.prev = 36;\n _context.t1 = _context['catch'](29);\n _context.next = 40;\n return (0, _effects.put)((0, _show.onRequestError)(_context.t1.message));\n\n case 40:\n return _context.abrupt('return', _context.sent);\n\n case 41:\n _context.next = 43;\n return (0, _effects.put)((0, _show.addNewChannelToChannelList)(channelKey, channelName, shortId, longId, claimsData));\n\n case 43:\n _context.next = 45;\n return (0, _effects.put)((0, _show.onRequestError)(null));\n\n case 45:\n case 'end':\n return _context.stop();\n }\n }\n }, _marked, this, [[9, 18], [29, 36]]);\n}\n\nfunction watchNewChannelRequest() {\n return regeneratorRuntime.wrap(function watchNewChannelRequest$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return (0, _effects.takeLatest)(actions.CHANNEL_REQUEST_NEW, newChannelRequest);\n\n case 2:\n case 'end':\n return _context2.stop();\n }\n }\n }, _marked2, this);\n};\n\nfunction getNewClaimsAndUpdateChannel(action) {\n var _action$data2, channelKey, name, longId, page, claimsData, _ref3;\n\n return regeneratorRuntime.wrap(function getNewClaimsAndUpdateChannel$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n _action$data2 = action.data, channelKey = _action$data2.channelKey, name = _action$data2.name, longId = _action$data2.longId, page = _action$data2.page;\n claimsData = void 0;\n _context3.prev = 2;\n _context3.next = 5;\n return (0, _effects.call)(_channelApi.getChannelClaims, name, longId, page);\n\n case 5:\n _ref3 = _context3.sent;\n claimsData = _ref3.data;\n _context3.next = 14;\n break;\n\n case 9:\n _context3.prev = 9;\n _context3.t0 = _context3['catch'](2);\n _context3.next = 13;\n return (0, _effects.put)((0, _show.onRequestError)(_context3.t0.message));\n\n case 13:\n return _context3.abrupt('return', _context3.sent);\n\n case 14:\n _context3.next = 16;\n return (0, _effects.put)((0, _show.updateChannelClaims)(channelKey, claimsData));\n\n case 16:\n case 'end':\n return _context3.stop();\n }\n }\n }, _marked3, this, [[2, 9]]);\n}\n\nfunction watchUpdateChannelClaims() {\n return regeneratorRuntime.wrap(function watchUpdateChannelClaims$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n _context4.next = 2;\n return (0, _effects.takeLatest)(actions.CHANNEL_CLAIMS_UPDATE_ASYNC, getNewClaimsAndUpdateChannel);\n\n case 2:\n case 'end':\n return _context4.stop();\n }\n }\n }, _marked4, this);\n}\n\n/***/ }),\n/* 146 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getChannelData = getChannelData;\nexports.getChannelClaims = getChannelClaims;\n\nvar _request = __webpack_require__(11);\n\nvar _request2 = _interopRequireDefault(_request);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar _require = __webpack_require__(3),\n host = _require.site.host;\n\nfunction getChannelData(name, id) {\n if (!id) id = 'none';\n var url = host + '/api/channel/data/' + name + '/' + id;\n return (0, _request2.default)(url);\n};\n\nfunction getChannelClaims(name, longId, page) {\n if (!page) page = 1;\n var url = host + '/api/channel/claims/' + name + '/' + longId + '/' + page;\n return (0, _request2.default)(url);\n};\n\n/***/ }),\n/* 147 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nmodule.exports = {\n REGEXP_INVALID_CLAIM: /[^A-Za-z0-9-]/g,\n REGEXP_INVALID_CHANNEL: /[^A-Za-z0-9-@]/g,\n REGEXP_ADDRESS: /^b(?=[^0OIl]{32,33})[0-9A-Za-z]{32,33}$/,\n CHANNEL_CHAR: '@',\n parseIdentifier: function parseIdentifier(identifier) {\n var componentsRegex = new RegExp('([^:$#/]*)' + // value (stops at the first separator or end)\n '([:$#]?)([^/]*)' // modifier separator, modifier (stops at the first path separator or end)\n );\n\n var _componentsRegex$exec = componentsRegex // eslint-disable-line no-unused-vars\n .exec(identifier).map(function (match) {\n return match || null;\n }),\n _componentsRegex$exec2 = _slicedToArray(_componentsRegex$exec, 4),\n proto = _componentsRegex$exec2[0],\n value = _componentsRegex$exec2[1],\n modifierSeperator = _componentsRegex$exec2[2],\n modifier = _componentsRegex$exec2[3];\n\n // Validate and process name\n\n\n if (!value) {\n throw new Error('Check your URL. No channel name provided before \"' + modifierSeperator + '\"');\n }\n var isChannel = value.startsWith(module.exports.CHANNEL_CHAR);\n var channelName = isChannel ? value : null;\n var claimId = void 0;\n if (isChannel) {\n if (!channelName) {\n throw new Error('Check your URL. No channel name after \"@\".');\n }\n var nameBadChars = channelName.match(module.exports.REGEXP_INVALID_CHANNEL);\n if (nameBadChars) {\n throw new Error('Check your URL. Invalid characters in channel name: \"' + nameBadChars.join(', ') + '\".');\n }\n } else {\n claimId = value;\n }\n\n // Validate and process modifier\n var channelClaimId = void 0;\n if (modifierSeperator) {\n if (!modifier) {\n throw new Error('Check your URL. No modifier provided after separator \"' + modifierSeperator + '\"');\n }\n\n if (modifierSeperator === ':') {\n channelClaimId = modifier;\n } else {\n throw new Error('Check your URL. The \"' + modifierSeperator + '\" modifier is not currently supported');\n }\n }\n return {\n isChannel: isChannel,\n channelName: channelName,\n channelClaimId: channelClaimId || null,\n claimId: claimId || null\n };\n },\n parseClaim: function parseClaim(name) {\n var componentsRegex = new RegExp('([^:$#/.]*)' + // name (stops at the first extension)\n '([:$#.]?)([^/]*)' // extension separator, extension (stops at the first path separator or end)\n );\n\n var _componentsRegex$exec3 = componentsRegex // eslint-disable-line no-unused-vars\n .exec(name).map(function (match) {\n return match || null;\n }),\n _componentsRegex$exec4 = _slicedToArray(_componentsRegex$exec3, 4),\n proto = _componentsRegex$exec4[0],\n claimName = _componentsRegex$exec4[1],\n extensionSeperator = _componentsRegex$exec4[2],\n extension = _componentsRegex$exec4[3];\n\n // Validate and process name\n\n\n if (!claimName) {\n throw new Error('Check your URL. No claim name provided before \".\"');\n }\n var nameBadChars = claimName.match(module.exports.REGEXP_INVALID_CLAIM);\n if (nameBadChars) {\n throw new Error('Check your URL. Invalid characters in claim name: \"' + nameBadChars.join(', ') + '\".');\n }\n // Validate and process extension\n if (extensionSeperator) {\n if (!extension) {\n throw new Error('Check your URL. No file extension provided after separator \"' + extensionSeperator + '\".');\n }\n if (extensionSeperator !== '.') {\n throw new Error('Check your URL. The \"' + extensionSeperator + '\" separator is not supported in the claim name.');\n }\n }\n return {\n claimName: claimName,\n extension: extension || null\n };\n }\n};\n\n/***/ }),\n/* 148 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar handlePageRender = __webpack_require__(28);\n\nmodule.exports = function (app) {\n // a catch-all route if someone visits a page that does not exist\n app.use('*', function (req, res) {\n // send response\n handlePageRender(req, res);\n });\n};\n\n/***/ }),\n/* 149 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"http\");\n\n/***/ })\n/******/ ]);\n\n\n// WEBPACK FOOTER //\n// index.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 43);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 9010b700cf4658b0bc97","module.exports = require(\"react\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"react\"\n// module id = 0\n// module chunks = 0","module.exports = require(\"react-redux\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"react-redux\"\n// module id = 1\n// module chunks = 0","module.exports = require(\"winston\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"winston\"\n// module id = 2\n// module chunks = 0","module.exports = {\n analytics: {\n googleId: 'UA-60403362-6', // google id for analytics tracking; leave `null` if not applicable\n },\n logging: {\n logLevel : 'debug', // options: silly, debug, verbose, info\n slackWebHook : 'https://hooks.slack.com/services/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', // enter a webhook if you wish to push logs to slack; otherwise leave as `null`\n slackErrorChannel: null, // enter a slack channel (#example) for errors to be sent to; otherwise leave null\n slackInfoChannel : '#speech-dev1-errors', // enter a slack channel (#info) for info level logs to be sent to otherwise leave null\n },\n session: {\n sessionKey: 'nans$#kfjanwe234rydns', // enter a secret key to be used for session encryption\n },\n files: {\n uploadDirectory: '/home/lbry/Uploads', // enter file path to where uploads/publishes should be stored\n },\n site: {\n title : 'dev1.Spee.ch',\n name : 'dev1.Spee.ch',\n host : 'https://dev1.spee.ch',\n description: 'Open-source, decentralized image and video sharing.',\n },\n publish: {\n primaryClaimAddress : 'bDZ2wPwtULUGxT7GXuNLpQhXmdPRUTUkcL',\n additionalClaimAddresses: ['banpwixPosfVDWnGvXqU2af36Qpsd7buGd'],\n thumbnailChannel : '@dev1thumbs', // create a channel to use for thumbnail images\n thumbnailChannelId : 'aeb625ff6f66c3eeeb42885070f4e53876033626', // the channel_id (claim id) for the channel above\n },\n claim: {\n defaultTitle : 'dev1 Spee.ch',\n defaultThumbnail : 'https://spee.ch/assets/img/video_thumb_default.png',\n defaultDescription: 'Open-source, decentralized image and video sharing.',\n },\n testing: {\n testChannel : '@test', // a channel to make test publishes in\n testChannelId : '3b5bc6b6819172c6e2f3f90aa855b14a956b4a82', // the claim id for the test channel\n testChannelPassword: '1234', // password for the test channel\n },\n api: {\n apiHost: 'localhost',\n apiPort: '5279',\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./config/speechConfig.js","module.exports = require(\"react-router-dom\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"react-router-dom\"\n// module id = 4\n// module chunks = 0","import * as actions from 'constants/publish_action_types';\n\n// export action creators\nexport function selectFile (file) {\n return {\n type: actions.FILE_SELECTED,\n data: file,\n };\n};\n\nexport function clearFile () {\n return {\n type: actions.FILE_CLEAR,\n };\n};\n\nexport function updateMetadata (name, value) {\n return {\n type: actions.METADATA_UPDATE,\n data: {\n name,\n value,\n },\n };\n};\n\nexport function updateClaim (value) {\n return {\n type: actions.CLAIM_UPDATE,\n data: value,\n };\n};\n\nexport function setPublishInChannel (channel) {\n return {\n type: actions.SET_PUBLISH_IN_CHANNEL,\n channel,\n };\n};\n\nexport function updatePublishStatus (status, message) {\n return {\n type: actions.PUBLISH_STATUS_UPDATE,\n data: {\n status,\n message,\n },\n };\n};\n\nexport function updateError (name, value) {\n return {\n type: actions.ERROR_UPDATE,\n data: {\n name,\n value,\n },\n };\n};\n\nexport function updateSelectedChannel (channelName) {\n return {\n type: actions.SELECTED_CHANNEL_UPDATE,\n data: channelName,\n };\n};\n\nexport function toggleMetadataInputs (showMetadataInputs) {\n return {\n type: actions.TOGGLE_METADATA_INPUTS,\n data: showMetadataInputs,\n };\n};\n\nexport function onNewThumbnail (file) {\n return {\n type: actions.THUMBNAIL_NEW,\n data: file,\n };\n};\n\nexport function startPublish (history) {\n return {\n type: actions.PUBLISH_START,\n data: { history },\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./react/actions/publish.js","const Sequelize = require('sequelize');\nconst logger = require('winston');\n\nmodule.exports = (mysqlConfig) => {\n const { database, username, password } = mysqlConfig;\n const db = {};\n // set sequelize options\n const sequelize = new Sequelize(database, username, password, {\n host : 'localhost',\n dialect : 'mysql',\n dialectOptions: {decimalNumbers: true}, // fix to ensure DECIMAL will not be stored as a string\n logging : false,\n pool : {\n max : 5,\n min : 0,\n idle : 10000,\n acquire: 10000,\n },\n });\n\n // establish mysql connection\n sequelize\n .authenticate()\n .then(() => {\n logger.info('Sequelize has established mysql connection successfully.');\n })\n .catch(err => {\n logger.error('Sequelize was unable to connect to the database:', err);\n });\n\n // manually add each model to the db object\n const Certificate = require('./certificate.js');\n const Channel = require('./channel.js');\n const Claim = require('./claim.js');\n const File = require('./file.js');\n const Request = require('./request.js');\n const User = require('./user.js');\n db['Certificate'] = sequelize.import('Certificate', Certificate);\n db['Channel'] = sequelize.import('Channel', Channel);\n db['Claim'] = sequelize.import('Claim', Claim);\n db['File'] = sequelize.import('File', File);\n db['Request'] = sequelize.import('Request', Request);\n db['User'] = sequelize.import('User', User);\n\n // run model.association for each model in the db object that has an association\n Object.keys(db).forEach(modelName => {\n if (db[modelName].associate) {\n logger.info('Associating model:', modelName);\n db[modelName].associate(db);\n }\n });\n\n db.sequelize = sequelize;\n db.Sequelize = Sequelize;\n\n // add an 'upsert' method to the db object\n db.upsert = (Model, values, condition, tableName) => {\n return Model\n .findOne({\n where: condition,\n })\n .then(obj => {\n if (obj) { // update\n logger.debug(`updating record in db.${tableName}`);\n return obj.update(values);\n } else { // insert\n logger.debug(`creating record in db.${tableName}`);\n return Model.create(values);\n }\n })\n .catch(function (error) {\n logger.error(`${tableName}.upsert error`, error);\n throw error;\n });\n };\n\n return db;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./models/index.js","import { connect } from 'react-redux';\nimport { updateLoggedInChannel } from 'actions/channel';\nimport View from './view';\nimport {updateSelectedChannel} from '../../actions/publish';\n\nconst mapStateToProps = ({ channel }) => {\n return {\n channelName : channel.loggedInChannel.name,\n channelShortId: channel.loggedInChannel.shortId,\n channelLongId : channel.loggedInChannel.longId,\n };\n};\n\nconst mapDispatchToProps = dispatch => {\n return {\n onChannelLogin: (name, shortId, longId) => {\n dispatch(updateLoggedInChannel(name, shortId, longId));\n dispatch(updateSelectedChannel(name));\n },\n onChannelLogout: () => {\n dispatch(updateLoggedInChannel(null, null, null));\n },\n };\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/NavBar/index.js","import * as actions from 'constants/show_action_types';\n\nimport { CHANNEL, ASSET_LITE, ASSET_DETAILS } from 'constants/show_request_types';\n\n// basic request parsing\nexport function onHandleShowPageUri (params) {\n return {\n type: actions.HANDLE_SHOW_URI,\n data: params,\n };\n};\n\nexport function onRequestError (error) {\n return {\n type: actions.REQUEST_ERROR,\n data: error,\n };\n};\n\nexport function onNewChannelRequest (channelName, channelId) {\n const requestType = CHANNEL;\n const requestId = `cr#${channelName}#${channelId}`;\n return {\n type: actions.CHANNEL_REQUEST_NEW,\n data: { requestType, requestId, channelName, channelId },\n };\n};\n\nexport function onNewAssetRequest (name, id, channelName, channelId, extension) {\n const requestType = extension ? ASSET_LITE : ASSET_DETAILS;\n const requestId = `ar#${name}#${id}#${channelName}#${channelId}`;\n return {\n type: actions.ASSET_REQUEST_NEW,\n data: {\n requestType,\n requestId,\n name,\n modifier: {\n id,\n channel: {\n name: channelName,\n id : channelId,\n },\n },\n },\n };\n};\n\nexport function onRequestUpdate (requestType, requestId) {\n return {\n type: actions.REQUEST_UPDATE,\n data: {\n requestType,\n requestId,\n },\n };\n};\n\nexport function addRequestToRequestList (id, error, key) {\n return {\n type: actions.REQUEST_LIST_ADD,\n data: { id, error, key },\n };\n};\n\n// asset actions\n\nexport function addAssetToAssetList (id, error, name, claimId, shortId, claimData) {\n return {\n type: actions.ASSET_ADD,\n data: { id, error, name, claimId, shortId, claimData },\n };\n}\n\n// channel actions\n\nexport function addNewChannelToChannelList (id, name, shortId, longId, claimsData) {\n return {\n type: actions.CHANNEL_ADD,\n data: { id, name, shortId, longId, claimsData },\n };\n};\n\nexport function onUpdateChannelClaims (channelKey, name, longId, page) {\n return {\n type: actions.CHANNEL_CLAIMS_UPDATE_ASYNC,\n data: {channelKey, name, longId, page},\n };\n};\n\nexport function updateChannelClaims (channelListId, claimsData) {\n return {\n type: actions.CHANNEL_CLAIMS_UPDATE_SUCCESS,\n data: {channelListId, claimsData},\n };\n};\n\n// display a file\n\nexport function fileRequested (name, claimId) {\n return {\n type: actions.FILE_REQUESTED,\n data: { name, claimId },\n };\n};\n\nexport function updateFileAvailability (status) {\n return {\n type: actions.FILE_AVAILABILITY_UPDATE,\n data: status,\n };\n};\n\nexport function updateDisplayAssetError (error) {\n return {\n type: actions.DISPLAY_ASSET_ERROR,\n data: error,\n };\n};\n\n\n\n// WEBPACK FOOTER //\n// ./react/actions/show.js","import React from 'react';\nimport Helmet from 'react-helmet';\nimport PropTypes from 'prop-types';\n\nimport { createPageTitle } from 'utils/pageTitle';\nimport { createMetaTags } from 'utils/metaTags';\nimport { createCanonicalLink } from 'utils/canonicalLink';\n\nclass SEO extends React.Component {\n render () {\n let { pageTitle, asset, channel, pageUri } = this.props;\n pageTitle = createPageTitle(pageTitle);\n const metaTags = createMetaTags(asset, channel);\n const canonicalLink = createCanonicalLink(asset, channel, pageUri);\n return (\n \n );\n }\n};\n\nSEO.propTypes = {\n pageTitle: PropTypes.string,\n pageUri : PropTypes.string,\n channel : PropTypes.object,\n asset : PropTypes.object,\n};\n\nexport default SEO;\n\n\n\n// WEBPACK FOOTER //\n// ./react/components/SEO/index.jsx","module.exports = require(\"prop-types\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"prop-types\"\n// module id = 10\n// module chunks = 0","import 'cross-fetch/polyfill';\n\n/**\n * Parses the JSON returned by a network request\n *\n * @param {object} response A response from a network request\n *\n * @return {object} The parsed JSON from the request\n */\nfunction parseJSON (response) {\n if (response.status === 204 || response.status === 205) {\n return null;\n }\n return response.json();\n}\n\n/**\n * Parses the status returned by a network request\n *\n * @param {object} response A response from a network request\n * @param {object} response The parsed JSON from the network request\n *\n * @return {object | undefined} Returns object with status and statusText, or undefined\n */\nfunction checkStatus (response, jsonResponse) {\n if (response.status >= 200 && response.status < 300) {\n return jsonResponse;\n }\n const error = new Error(jsonResponse.message);\n error.response = response;\n throw error;\n}\n\n/**\n * Requests a URL, returning a promise\n *\n * @param {string} url The URL we want to request\n * @param {object} [options] The options we want to pass to \"fetch\"\n *\n * @return {object} The response data\n */\n\nexport default function request (url, options) {\n return fetch(url, options)\n .then(response => {\n return Promise.all([response, parseJSON(response)]);\n })\n .then(([response, jsonResponse]) => {\n return checkStatus(response, jsonResponse);\n });\n}\n\n\n\n// WEBPACK FOOTER //\n// ./react/utils/request.js","// request actions\nexport const HANDLE_SHOW_URI = 'HANDLE_SHOW_URI';\nexport const REQUEST_ERROR = 'REQUEST_ERROR';\nexport const REQUEST_UPDATE = 'REQUEST_UPDATE';\nexport const ASSET_REQUEST_NEW = 'ASSET_REQUEST_NEW';\nexport const CHANNEL_REQUEST_NEW = 'CHANNEL_REQUEST_NEW';\nexport const REQUEST_LIST_ADD = 'REQUEST_LIST_ADD';\n\n// asset actions\nexport const ASSET_ADD = `ASSET_ADD`;\n\n// channel actions\nexport const CHANNEL_ADD = 'CHANNEL_ADD';\n\nexport const CHANNEL_CLAIMS_UPDATE_ASYNC = 'CHANNEL_CLAIMS_UPDATE_ASYNC';\nexport const CHANNEL_CLAIMS_UPDATE_SUCCESS = 'CHANNEL_CLAIMS_UPDATE_SUCCESS';\n\n// asset/file display actions\nexport const FILE_REQUESTED = 'FILE_REQUESTED';\nexport const FILE_AVAILABILITY_UPDATE = 'FILE_AVAILABILITY_UPDATE';\nexport const DISPLAY_ASSET_ERROR = 'DISPLAY_ASSET_ERROR';\n\n\n\n// WEBPACK FOOTER //\n// ./react/constants/show_action_types.js","export const selectAsset = (show) => {\n const request = show.requestList[show.request.id];\n const assetKey = request.key;\n return show.assetList[assetKey];\n};\n\nexport const selectShowState = (state) => {\n return state.show;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./react/selectors/show.js","module.exports = require(\"react-helmet\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"react-helmet\"\n// module id = 14\n// module chunks = 0","module.exports = require(\"redux-saga/effects\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"redux-saga/effects\"\n// module id = 15\n// module chunks = 0","const axios = require('axios');\nconst logger = require('winston');\nconst config = require('../config/speechConfig.js');\nconst { apiHost, apiPort } = config.api;\nconst lbryApiUri = 'http://' + apiHost + ':' + apiPort;\nconst { chooseGaLbrynetPublishLabel, sendGATimingEvent } = require('./googleAnalytics.js');\n\nconst handleLbrynetResponse = ({ data }, resolve, reject) => {\n logger.debug('lbry api data:', data);\n if (data.result) {\n // check for an error\n if (data.result.error) {\n logger.debug('Lbrynet api error:', data.result.error);\n reject(new Error(data.result.error));\n return;\n };\n resolve(data.result);\n return;\n }\n // fallback in case it just timed out\n reject(JSON.stringify(data));\n};\n\nmodule.exports = {\n publishClaim (publishParams) {\n logger.debug(`lbryApi >> Publishing claim to \"${publishParams.name}\"`);\n const gaStartTime = Date.now();\n return new Promise((resolve, reject) => {\n axios\n .post(lbryApiUri, {\n method: 'publish',\n params: publishParams,\n })\n .then(response => {\n sendGATimingEvent('lbrynet', 'publish', chooseGaLbrynetPublishLabel(publishParams), gaStartTime, Date.now());\n handleLbrynetResponse(response, resolve, reject);\n })\n .catch(error => {\n reject(error);\n });\n });\n },\n getClaim (uri) {\n logger.debug(`lbryApi >> Getting Claim for \"${uri}\"`);\n const gaStartTime = Date.now();\n return new Promise((resolve, reject) => {\n axios\n .post(lbryApiUri, {\n method: 'get',\n params: { uri, timeout: 20 },\n })\n .then(response => {\n sendGATimingEvent('lbrynet', 'getClaim', 'GET', gaStartTime, Date.now());\n handleLbrynetResponse(response, resolve, reject);\n })\n .catch(error => {\n reject(error);\n });\n });\n },\n getClaimList (claimName) {\n logger.debug(`lbryApi >> Getting claim_list for \"${claimName}\"`);\n const gaStartTime = Date.now();\n return new Promise((resolve, reject) => {\n axios\n .post(lbryApiUri, {\n method: 'claim_list',\n params: { name: claimName },\n })\n .then(response => {\n sendGATimingEvent('lbrynet', 'getClaimList', 'CLAIM_LIST', gaStartTime, Date.now());\n handleLbrynetResponse(response, resolve, reject);\n })\n .catch(error => {\n reject(error);\n });\n });\n },\n resolveUri (uri) {\n logger.debug(`lbryApi >> Resolving URI for \"${uri}\"`);\n const gaStartTime = Date.now();\n return new Promise((resolve, reject) => {\n axios\n .post(lbryApiUri, {\n method: 'resolve',\n params: { uri },\n })\n .then(({ data }) => {\n sendGATimingEvent('lbrynet', 'resolveUri', 'RESOLVE', gaStartTime, Date.now());\n if (data.result[uri].error) { // check for errors\n reject(data.result[uri].error);\n } else { // if no errors, resolve\n resolve(data.result[uri]);\n }\n })\n .catch(error => {\n reject(error);\n });\n });\n },\n getDownloadDirectory () {\n logger.debug('lbryApi >> Retrieving the download directory path from lbry daemon...');\n const gaStartTime = Date.now();\n return new Promise((resolve, reject) => {\n axios\n .post(lbryApiUri, {\n method: 'settings_get',\n })\n .then(({ data }) => {\n sendGATimingEvent('lbrynet', 'getDownloadDirectory', 'SETTINGS_GET', gaStartTime, Date.now());\n if (data.result) {\n resolve(data.result.download_directory);\n } else {\n return new Error('Successfully connected to lbry daemon, but unable to retrieve the download directory.');\n }\n })\n .catch(error => {\n logger.error('Lbrynet Error:', error);\n resolve('/home/lbry/Downloads/');\n });\n });\n },\n createChannel (name) {\n logger.debug(`lbryApi >> Creating channel for ${name}...`);\n const gaStartTime = Date.now();\n return new Promise((resolve, reject) => {\n axios\n .post(lbryApiUri, {\n method: 'channel_new',\n params: {\n channel_name: name,\n amount : 0.1,\n },\n })\n .then(response => {\n sendGATimingEvent('lbrynet', 'createChannel', 'CHANNEL_NEW', gaStartTime, Date.now());\n handleLbrynetResponse(response, resolve, reject);\n })\n .catch(error => {\n reject(error);\n });\n });\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./helpers/lbryApi.js","const logger = require('winston');\nconst ua = require('universal-analytics');\nconst { analytics : { googleId }, site: { name: siteName } } = require('../config/speechConfig.js');\n\nfunction createServeEventParams (headers, ip, originalUrl) {\n return {\n eventCategory : 'client requests',\n eventAction : 'serve request',\n eventLabel : originalUrl,\n ipOverride : ip,\n userAgentOverride: headers['user-agent'],\n };\n};\n\nfunction createPublishTimingEventParams (category, variable, label, startTime, endTime) {\n const duration = endTime - startTime;\n return {\n userTimingCategory : category,\n userTimingVariableName: variable,\n userTimingTime : duration,\n userTimingLabel : label,\n };\n};\n\nfunction sendGoogleAnalyticsEvent (ip, params) {\n const visitorId = ip.replace(/\\./g, '-');\n const visitor = ua(googleId, visitorId, { strictCidFormat: false, https: true });\n visitor.event(params, (err) => {\n if (err) {\n logger.error('Google Analytics Event Error >>', err);\n }\n });\n};\n\nfunction sendGoogleAnalyticsTiming (visitorId, params) {\n const visitor = ua(googleId, visitorId, { strictCidFormat: false, https: true });\n visitor.timing(params, (err) => {\n if (err) {\n logger.error('Google Analytics Event Error >>', err);\n }\n logger.debug(`Timing event successfully sent to google analytics`);\n });\n};\n\nmodule.exports = {\n sendGAServeEvent (headers, ip, originalUrl) {\n const params = createServeEventParams(headers, ip, originalUrl);\n sendGoogleAnalyticsEvent(ip, params);\n },\n sendGATimingEvent (category, variable, label, startTime, endTime) {\n const params = createPublishTimingEventParams(category, variable, label, startTime, endTime);\n sendGoogleAnalyticsTiming(siteName, params);\n },\n chooseGaLbrynetPublishLabel ({ channel_name: channelName, channel_id: channelId }) {\n return (channelName || channelId ? 'PUBLISH_IN_CHANNEL_CLAIM' : 'PUBLISH_ANONYMOUS_CLAIM');\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./helpers/googleAnalytics.js","module.exports = require(\"redux\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"redux\"\n// module id = 18\n// module chunks = 0","import * as actions from 'constants/channel_action_types';\n\n// export action creators\n\nexport function updateLoggedInChannel (name, shortId, longId) {\n return {\n type: actions.CHANNEL_UPDATE,\n data: {\n name,\n shortId,\n longId,\n },\n };\n};\n\n\n\n// WEBPACK FOOTER //\n// ./react/actions/channel.js","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ActiveStatusBar from 'components/ActiveStatusBar';\nimport InactiveStatusBar from 'components/InactiveStatusBar';\n\nclass ProgressBar extends React.Component {\n constructor (props) {\n super(props);\n this.state = {\n bars : [],\n index : 0,\n incrementer: 1,\n };\n this.createBars = this.createBars.bind(this);\n this.startProgressBar = this.startProgressBar.bind(this);\n this.updateProgressBar = this.updateProgressBar.bind(this);\n this.stopProgressBar = this.stopProgressBar.bind(this);\n }\n componentDidMount () {\n this.createBars();\n this.startProgressBar();\n }\n componentWillUnmount () {\n this.stopProgressBar();\n }\n createBars () {\n const bars = [];\n for (let i = 0; i <= this.props.size; i++) {\n bars.push({isActive: false});\n }\n this.setState({ bars });\n }\n startProgressBar () {\n this.updateInterval = setInterval(this.updateProgressBar.bind(this), 300);\n };\n updateProgressBar () {\n let index = this.state.index;\n let incrementer = this.state.incrementer;\n let bars = this.state.bars;\n // flip incrementer if necessary, to stay in bounds\n if ((index < 0) || (index > this.props.size)) {\n incrementer = incrementer * -1;\n index += incrementer;\n }\n // update the indexed bar\n if (incrementer > 0) {\n bars[index].isActive = true;\n } else {\n bars[index].isActive = false;\n };\n // increment index\n index += incrementer;\n // update state\n this.setState({\n bars,\n incrementer,\n index,\n });\n };\n stopProgressBar () {\n clearInterval(this.updateInterval);\n };\n render () {\n return (\n
\n {this.state.bars.map((bar, index) => bar.isActive ? : )}\n
\n );\n }\n};\n\nProgressBar.propTypes = {\n size: PropTypes.number.isRequired,\n};\n\nexport default ProgressBar;\n\n\n\n// WEBPACK FOOTER //\n// ./react/components/ProgressBar/index.jsx","import React from 'react';\nimport PropTypes from 'prop-types';\nimport NavBar from 'containers/NavBar';\n\nclass ErrorPage extends React.Component {\n render () {\n const { error } = this.props;\n return (\n
\n \n
\n

{error}

\n
\n
\n );\n }\n};\n\nErrorPage.propTypes = {\n error: PropTypes.string.isRequired,\n};\n\nexport default ErrorPage;\n\n\n\n// WEBPACK FOOTER //\n// ./react/components/ErrorPage/index.jsx","module.exports = require(\"passport\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"passport\"\n// module id = 22\n// module chunks = 0","module.exports = {\n returnShortId: function (claimsArray, longId) {\n let claimIndex;\n let shortId = longId.substring(0, 1); // default short id is the first letter\n let shortIdLength = 0;\n // find the index of this claim id\n claimIndex = claimsArray.findIndex(element => {\n return element.claimId === longId;\n });\n if (claimIndex < 0) {\n throw new Error('claim id not found in claims list');\n }\n // get an array of all claims with lower height\n let possibleMatches = claimsArray.slice(0, claimIndex);\n // remove certificates with the same prefixes until none are left.\n while (possibleMatches.length > 0) {\n shortIdLength += 1;\n shortId = longId.substring(0, shortIdLength);\n possibleMatches = possibleMatches.filter(element => {\n return (element.claimId && (element.claimId.substring(0, shortIdLength) === shortId));\n });\n }\n return shortId;\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./helpers/sequelizeHelpers.js","module.exports = require(\"passport-local\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"passport-local\"\n// module id = 24\n// module chunks = 0","const logger = require('winston');\nconst fs = require('fs');\nconst { site, wallet, publish } = require('../config/speechConfig.js');\n\nmodule.exports = {\n parsePublishApiRequestBody ({name, nsfw, license, title, description, thumbnail}) {\n // validate name\n if (!name) {\n throw new Error('no name field found in request');\n }\n const invalidNameCharacters = /[^A-Za-z0-9,-]/.exec(name);\n if (invalidNameCharacters) {\n throw new Error('The claim name you provided is not allowed. Only the following characters are allowed: A-Z, a-z, 0-9, and \"-\"');\n }\n // optional parameters\n nsfw = (nsfw === 'true');\n license = license || null;\n title = title || null;\n description = description || null;\n thumbnail = thumbnail || null;\n // return results\n return {\n name,\n nsfw,\n license,\n title,\n description,\n thumbnail,\n };\n },\n parsePublishApiRequestFiles ({file, thumbnail}) {\n // make sure a file was provided\n if (!file) {\n throw new Error('no file with key of [file] found in request');\n }\n if (!file.path) {\n throw new Error('no file path found');\n }\n if (!file.type) {\n throw new Error('no file type found');\n }\n if (!file.size) {\n throw new Error('no file type found');\n }\n // validate the file name\n if (/'/.test(file.name)) {\n throw new Error('apostrophes are not allowed in the file name');\n }\n // validate the file\n module.exports.validateFileTypeAndSize(file);\n // return results\n return {\n fileName : file.name,\n filePath : file.path,\n fileType : file.type,\n thumbnailFileName: (thumbnail ? thumbnail.name : null),\n thumbnailFilePath: (thumbnail ? thumbnail.path : null),\n thumbnailFileType: (thumbnail ? thumbnail.type : null),\n };\n },\n validateFileTypeAndSize (file) {\n // check file type and size\n switch (file.type) {\n case 'image/jpeg':\n case 'image/jpg':\n case 'image/png':\n if (file.size > 10000000) {\n logger.debug('publish > file validation > .jpeg/.jpg/.png was too big');\n throw new Error('Sorry, images are limited to 10 megabytes.');\n }\n break;\n case 'image/gif':\n if (file.size > 50000000) {\n logger.debug('publish > file validation > .gif was too big');\n throw new Error('Sorry, .gifs are limited to 50 megabytes.');\n }\n break;\n case 'video/mp4':\n if (file.size > 50000000) {\n logger.debug('publish > file validation > .mp4 was too big');\n throw new Error('Sorry, videos are limited to 50 megabytes.');\n }\n break;\n default:\n logger.debug('publish > file validation > unrecognized file type');\n throw new Error('The ' + file.type + ' content type is not supported. Only, .jpeg, .png, .gif, and .mp4 files are currently supported.');\n }\n return file;\n },\n createBasicPublishParams (filePath, name, title, description, license, nsfw, thumbnail) {\n logger.debug(`Creating Publish Parameters`);\n // provide defaults for title\n if (title === null || title.trim() === '') {\n title = name;\n }\n // provide default for description\n if (description === null || description.trim() === '') {\n description = '';\n }\n // provide default for license\n if (license === null || license.trim() === '') {\n license = ' '; // default to empty string\n }\n // create the publish params\n const publishParams = {\n name,\n file_path: filePath,\n bid : 0.01,\n metadata : {\n description,\n title,\n author : site.title,\n language: 'en',\n license,\n nsfw,\n },\n claim_address: wallet.lbryClaimAddress,\n };\n // add thumbnail to channel if video\n if (thumbnail) {\n publishParams['metadata']['thumbnail'] = thumbnail;\n }\n return publishParams;\n },\n createThumbnailPublishParams (thumbnailFilePath, claimName, license, nsfw) {\n if (!thumbnailFilePath) {\n return;\n }\n logger.debug(`Creating Thumbnail Publish Parameters`);\n // create the publish params\n return {\n name : `${claimName}-thumb`,\n file_path: thumbnailFilePath,\n bid : 0.01,\n metadata : {\n title : `${claimName} thumbnail`,\n description: `a thumbnail for ${claimName}`,\n author : site.title,\n language : 'en',\n license,\n nsfw,\n },\n claim_address: wallet.lbryClaimAddress,\n channel_name : publish.thumbnailChannel,\n channel_id : publish.thumbnailChannelId,\n };\n },\n deleteTemporaryFile (filePath) {\n fs.unlink(filePath, err => {\n if (err) {\n logger.error(`error deleting temporary file ${filePath}`);\n throw err;\n }\n logger.debug(`successfully deleted ${filePath}`);\n });\n },\n addGetResultsToFileData (fileInfo, getResult) {\n fileInfo.fileName = getResult.file_name;\n fileInfo.filePath = getResult.download_path;\n return fileInfo;\n },\n createFileData ({ name, claimId, outpoint, height, address, nsfw, contentType }) {\n return {\n name,\n claimId,\n outpoint,\n height,\n address,\n fileName: '',\n filePath: '',\n fileType: contentType,\n nsfw,\n };\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./helpers/publishHelpers.js","const logger = require('winston');\n\nmodule.exports = {\n handleErrorResponse: function (originalUrl, ip, error, res) {\n logger.error(`Error on ${originalUrl}`, module.exports.useObjectPropertiesIfNoKeys(error));\n const [status, message] = module.exports.returnErrorMessageAndStatus(error);\n res\n .status(status)\n .json(module.exports.createErrorResponsePayload(status, message));\n },\n returnErrorMessageAndStatus: function (error) {\n let status, message;\n // check for daemon being turned off\n if (error.code === 'ECONNREFUSED') {\n status = 503;\n message = 'Connection refused. The daemon may not be running.';\n // fallback for everything else\n } else {\n status = 400;\n if (error.message) {\n message = error.message;\n } else {\n message = error;\n };\n };\n return [status, message];\n },\n useObjectPropertiesIfNoKeys: function (err) {\n if (Object.keys(err).length === 0) {\n let newErrorObject = {};\n Object.getOwnPropertyNames(err).forEach((key) => {\n newErrorObject[key] = err[key];\n });\n return newErrorObject;\n }\n return err;\n },\n createErrorResponsePayload (status, message) {\n return {\n status,\n success: false,\n message,\n };\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./helpers/errorHandlers.js","const db = require('../models');\nconst logger = require('winston');\nconst { returnPaginatedChannelClaims } = require('../helpers/channelPagination.js');\n\nconst NO_CHANNEL = 'NO_CHANNEL';\nconst NO_CLAIM = 'NO_CLAIM';\nconst NO_FILE = 'NO_FILE';\n\nmodule.exports = {\n getClaimId (channelName, channelClaimId, name, claimId) {\n if (channelName) {\n return module.exports.getClaimIdByChannel(channelName, channelClaimId, name);\n } else {\n return module.exports.getClaimIdByClaim(name, claimId);\n }\n },\n getClaimIdByClaim (claimName, claimId) {\n logger.debug(`getClaimIdByClaim(${claimName}, ${claimId})`);\n return new Promise((resolve, reject) => {\n db.Claim.getLongClaimId(claimName, claimId)\n .then(longClaimId => {\n if (!longClaimId) {\n resolve(NO_CLAIM);\n }\n resolve(longClaimId);\n })\n .catch(error => {\n reject(error);\n });\n });\n },\n getClaimIdByChannel (channelName, channelClaimId, claimName) {\n logger.debug(`getClaimIdByChannel(${channelName}, ${channelClaimId}, ${claimName})`);\n return new Promise((resolve, reject) => {\n db.Certificate.getLongChannelId(channelName, channelClaimId) // 1. get the long channel id\n .then(longChannelId => {\n if (!longChannelId) {\n return [null, null];\n }\n return Promise.all([longChannelId, db.Claim.getClaimIdByLongChannelId(longChannelId, claimName)]); // 2. get the long claim id\n })\n .then(([longChannelId, longClaimId]) => {\n if (!longChannelId) {\n return resolve(NO_CHANNEL);\n }\n if (!longClaimId) {\n return resolve(NO_CLAIM);\n }\n resolve(longClaimId);\n })\n .catch(error => {\n reject(error);\n });\n });\n },\n getChannelData (channelName, channelClaimId, page) {\n return new Promise((resolve, reject) => {\n // 1. get the long channel Id (make sure channel exists)\n db.Certificate.getLongChannelId(channelName, channelClaimId)\n .then(longChannelClaimId => {\n if (!longChannelClaimId) {\n return [null, null, null];\n }\n // 2. get the short ID and all claims for that channel\n return Promise.all([longChannelClaimId, db.Certificate.getShortChannelIdFromLongChannelId(longChannelClaimId, channelName)]);\n })\n .then(([longChannelClaimId, shortChannelClaimId]) => {\n if (!longChannelClaimId) {\n return resolve(NO_CHANNEL);\n }\n // 3. return all the channel information\n resolve({\n channelName,\n longChannelClaimId,\n shortChannelClaimId,\n });\n })\n .catch(error => {\n reject(error);\n });\n });\n },\n getChannelClaims (channelName, channelClaimId, page) {\n return new Promise((resolve, reject) => {\n // 1. get the long channel Id (make sure channel exists)\n db.Certificate.getLongChannelId(channelName, channelClaimId)\n .then(longChannelClaimId => {\n if (!longChannelClaimId) {\n return [null, null, null];\n }\n // 2. get the short ID and all claims for that channel\n return Promise.all([longChannelClaimId, db.Claim.getAllChannelClaims(longChannelClaimId)]);\n })\n .then(([longChannelClaimId, channelClaimsArray]) => {\n if (!longChannelClaimId) {\n return resolve(NO_CHANNEL);\n }\n // 3. format the data for the view, including pagination\n let paginatedChannelViewData = returnPaginatedChannelClaims(channelName, longChannelClaimId, channelClaimsArray, page);\n // 4. return all the channel information and contents\n resolve(paginatedChannelViewData);\n })\n .catch(error => {\n reject(error);\n });\n });\n },\n getLocalFileRecord (claimId, name) {\n return db.File.findOne({where: {claimId, name}})\n .then(file => {\n if (!file) {\n return NO_FILE;\n }\n return file.dataValues;\n });\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./controllers/serveController.js","import React from 'react';\nimport { renderToString } from 'react-dom/server';\nimport { createStore } from 'redux';\nimport Reducer from '../react/reducers';\nimport { Provider } from 'react-redux';\nimport { StaticRouter } from 'react-router-dom';\nimport GAListener from '../react/components/GAListener';\nimport App from '../react/app';\nimport renderFullPage from './renderFullPage.js';\nimport Helmet from 'react-helmet';\n\nmodule.exports = (req, res) => {\n let context = {};\n\n // create a new Redux store instance\n const store = createStore(Reducer);\n\n // render component to a string\n const html = renderToString(\n \n \n \n \n \n \n \n );\n\n // get head tags from helmet\n const helmet = Helmet.renderStatic();\n\n // check for a redirect\n if (context.url) {\n // Somewhere a `` was rendered\n return res.redirect(301, context.url);\n } else {\n // we're good, send the response\n }\n\n // get the initial state from our Redux store\n const preloadedState = store.getState();\n\n // send the rendered page back to the client\n res.send(renderFullPage(helmet, html, preloadedState));\n};\n\n\n\n// WEBPACK FOOTER //\n// ./helpers/handlePageRender.jsx","module.exports = require(\"react-dom/server\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"react-dom/server\"\n// module id = 29\n// module chunks = 0","import { combineReducers } from 'redux';\nimport PublishReducer from 'reducers/publish';\nimport ChannelReducer from 'reducers/channel';\nimport ShowReducer from 'reducers/show';\nimport SiteReducer from 'reducers/site';\n\nexport default combineReducers({\n channel: ChannelReducer,\n publish: PublishReducer,\n show : ShowReducer,\n site : SiteReducer,\n});\n\n\n\n// WEBPACK FOOTER //\n// ./react/reducers/index.js","export const FILE_SELECTED = 'FILE_SELECTED';\nexport const FILE_CLEAR = 'FILE_CLEAR';\nexport const METADATA_UPDATE = 'METADATA_UPDATE';\nexport const CLAIM_UPDATE = 'CLAIM_UPDATE';\nexport const SET_PUBLISH_IN_CHANNEL = 'SET_PUBLISH_IN_CHANNEL';\nexport const PUBLISH_STATUS_UPDATE = 'PUBLISH_STATUS_UPDATE';\nexport const ERROR_UPDATE = 'ERROR_UPDATE';\nexport const SELECTED_CHANNEL_UPDATE = 'SELECTED_CHANNEL_UPDATE';\nexport const TOGGLE_METADATA_INPUTS = 'TOGGLE_METADATA_INPUTS';\nexport const THUMBNAIL_NEW = 'THUMBNAIL_NEW';\nexport const PUBLISH_START = 'PUBLISH_START';\n\n\n\n// WEBPACK FOOTER //\n// ./react/constants/publish_action_types.js","export const LOGIN = 'Existing';\nexport const CREATE = 'New';\n\n\n\n// WEBPACK FOOTER //\n// ./react/constants/publish_channel_select_states.js","export const CHANNEL_UPDATE = 'CHANNEL_UPDATE';\n\n\n\n// WEBPACK FOOTER //\n// ./react/constants/channel_action_types.js","export const LOCAL_CHECK = 'LOCAL_CHECK';\nexport const UNAVAILABLE = 'UNAVAILABLE';\nexport const ERROR = 'ERROR';\nexport const AVAILABLE = 'AVAILABLE';\n\n\n\n// WEBPACK FOOTER //\n// ./react/constants/asset_display_states.js","import React from 'react';\nimport GoogleAnalytics from 'react-ga';\nimport { withRouter } from 'react-router-dom';\nconst config = require('../../../config/speechConfig.js');\nconst googleApiKey = config.analytics.googleId;\n\nGoogleAnalytics.initialize(googleApiKey);\n\nclass GAListener extends React.Component {\n componentDidMount () {\n this.sendPageView(this.props.history.location);\n this.props.history.listen(this.sendPageView);\n }\n\n sendPageView (location) {\n GoogleAnalytics.set({ page: location.pathname });\n GoogleAnalytics.pageview(location.pathname);\n }\n\n render () {\n return this.props.children;\n }\n}\n\nexport default withRouter(GAListener);\n\n\n\n// WEBPACK FOOTER //\n// ./react/components/GAListener/index.jsx","import React from 'react';\nimport { Route, Switch } from 'react-router-dom';\nimport HomePage from 'components/HomePage';\nimport AboutPage from 'components/AboutPage';\nimport LoginPage from 'containers/LoginPage';\nimport ShowPage from 'containers/ShowPage';\nimport FourOhFourPage from 'components/FourOhFourPage';\n\nconst App = () => {\n return (\n \n \n \n \n \n \n \n \n );\n};\n\nexport default App;\n\n\n\n// WEBPACK FOOTER //\n// ./react/app.js","import { connect } from 'react-redux';\nimport { selectFile, updateError, clearFile } from 'actions/publish';\nimport View from './view';\n\nconst mapStateToProps = ({ publish }) => {\n return {\n file : publish.file,\n thumbnail: publish.thumbnail,\n fileError: publish.error.file,\n };\n};\n\nconst mapDispatchToProps = dispatch => {\n return {\n selectFile: (file) => {\n dispatch(selectFile(file));\n },\n setFileError: (value) => {\n dispatch(clearFile());\n dispatch(updateError('file', value));\n },\n };\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/Dropzone/index.js","import { connect } from 'react-redux';\nimport { updateLoggedInChannel } from 'actions/channel';\nimport View from './view';\nimport {updateSelectedChannel} from '../../actions/publish';\n\nconst mapDispatchToProps = dispatch => {\n return {\n onChannelLogin: (name, shortId, longId) => {\n dispatch(updateLoggedInChannel(name, shortId, longId));\n dispatch(updateSelectedChannel(name));\n },\n };\n};\n\nexport default connect(null, mapDispatchToProps)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/ChannelLoginForm/index.js","import { connect } from 'react-redux';\nimport { updateLoggedInChannel } from 'actions/channel';\nimport View from './view';\nimport {updateSelectedChannel} from 'actions/publish';\n\nconst mapDispatchToProps = dispatch => {\n return {\n onChannelLogin: (name, shortId, longId) => {\n dispatch(updateLoggedInChannel(name, shortId, longId));\n dispatch(updateSelectedChannel(name));\n },\n };\n};\n\nexport default connect(null, mapDispatchToProps)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/ChannelCreateForm/index.js","export const CHANNEL = 'CHANNEL';\nexport const ASSET_LITE = 'ASSET_LITE';\nexport const ASSET_DETAILS = 'ASSET_DETAILS';\n\n\n\n// WEBPACK FOOTER //\n// ./react/constants/show_request_types.js","import { connect } from 'react-redux';\nimport View from './view';\nimport { fileRequested } from 'actions/show';\nimport { selectAsset } from 'selectors/show';\n\nconst mapStateToProps = ({ show }) => {\n // select error and status\n const error = show.displayAsset.error;\n const status = show.displayAsset.status;\n // select asset\n const asset = selectAsset(show);\n // return props\n return {\n error,\n status,\n asset,\n };\n};\n\nconst mapDispatchToProps = dispatch => {\n return {\n onFileRequest: (name, claimId) => {\n dispatch(fileRequested(name, claimId));\n },\n };\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/AssetDisplay/index.js","module.exports = (helmet, html, preloadedState) => {\n // take the html and preloadedState and return the full page\n return `\n \n \n \n \n \n \n \n ${helmet.title.toString()}\n ${helmet.meta.toString()}\n ${helmet.link.toString()}\n \n \n \n \n \n \n \n \n
\n
${html}
\n
\n \n \n \n \n `;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./helpers/renderFullPage.js","module.exports = require(\"babel-polyfill\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"babel-polyfill\"\n// module id = 44\n// module chunks = 0","module.exports = require(\"whatwg-fetch\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"whatwg-fetch\"\n// module id = 45\n// module chunks = 0","// load dependencies\nconst express = require('express');\nconst bodyParser = require('body-parser');\nconst expressHandlebars = require('express-handlebars');\nconst Handlebars = require('handlebars');\nconst { populateLocalsDotUser, serializeSpeechUser, deserializeSpeechUser } = require('./helpers/authHelpers.js');\nconst config = require('./config/speechConfig.js');\nconst logger = require('winston');\nconst helmet = require('helmet');\nconst PORT = 3000; // set port\nconst app = express(); // create an Express application\nconst passport = require('passport');\nconst cookieSession = require('cookie-session');\n\n// configure logging\nconst logLevel = config.logging.logLevel;\nrequire('./config/loggerConfig.js')(logger, logLevel);\nrequire('./config/slackConfig.js')(logger);\n\n// check for global config variables\nrequire('./helpers/configVarCheck.js')();\n\n// trust the proxy to get ip address for us\napp.enable('trust proxy');\n\n// add middleware\napp.use(helmet()); // set HTTP headers to protect against well-known web vulnerabilties\napp.use(express.static(`${__dirname}/public`)); // 'express.static' to serve static files from public directory\napp.use(bodyParser.json()); // 'body parser' for parsing application/json\napp.use(bodyParser.urlencoded({ extended: true })); // 'body parser' for parsing application/x-www-form-urlencoded\napp.use((req, res, next) => { // custom logging middleware to log all incoming http requests\n logger.verbose(`Request on ${req.originalUrl} from ${req.ip}`);\n next();\n});\n\n// configure passport\npassport.serializeUser(serializeSpeechUser);\npassport.deserializeUser(deserializeSpeechUser);\nconst localSignupStrategy = require('./passport/local-signup.js');\nconst localLoginStrategy = require('./passport/local-login.js');\npassport.use('local-signup', localSignupStrategy);\npassport.use('local-login', localLoginStrategy);\n// initialize passport\napp.use(cookieSession({\n name : 'session',\n keys : [config.session.sessionKey],\n maxAge: 24 * 60 * 60 * 1000, // 24 hours\n}));\napp.use(passport.initialize());\napp.use(passport.session());\n\n// configure handlebars & register it with express app\nconst hbs = expressHandlebars.create({\n defaultLayout: 'embed', // sets the default layout\n handlebars : Handlebars, // includes basic handlebars for access to that library\n});\napp.engine('handlebars', hbs.engine);\napp.set('view engine', 'handlebars');\n\n// middleware to pass user info back to client (for handlebars access), if user is logged in\napp.use(populateLocalsDotUser);\n\n// start the server\nconst startServer = (mysqlConfig) => {\n const db = require('./models')(mysqlConfig); // require our models for syncing\n db.sequelize\n // sync sequelize\n .sync()\n // require routes\n .then(() => {\n require('./routes/auth-routes.js')(app);\n require('./routes/api-routes.js')(app);\n require('./routes/page-routes.js')(app);\n require('./routes/serve-routes.js')(app);\n require('./routes/fallback-routes.js')(app);\n const http = require('http');\n return http.Server(app);\n })\n // start the server\n .then(server => {\n server.listen(PORT, () => {\n logger.info('Trusting proxy?', app.get('trust proxy'));\n logger.info(`Server is listening on PORT ${PORT}`);\n });\n })\n .catch((error) => {\n logger.error(`Startup Error:`, error);\n });\n};\n\nmodule.exports = {\n hello () {\n console.log('hello world');\n },\n speak (something) {\n console.log(something);\n },\n start (config) {\n const { mysqlConfig } = config;\n startServer(mysqlConfig);\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./server.js","module.exports = require(\"express\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"express\"\n// module id = 47\n// module chunks = 0","module.exports = require(\"body-parser\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"body-parser\"\n// module id = 48\n// module chunks = 0","module.exports = require(\"express-handlebars\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"express-handlebars\"\n// module id = 49\n// module chunks = 0","module.exports = require(\"handlebars\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"handlebars\"\n// module id = 50\n// module chunks = 0","// const db = require('../models'); // require our models for syncing\nconst logger = require('winston');\n\nmodule.exports = {\n populateLocalsDotUser (req, res, next) {\n if (req.user) {\n logger.debug('populating res.locals.user');\n res.locals.user = {\n id : req.user.id,\n userName : req.user.userName,\n channelName : req.user.channelName,\n channelClaimId: req.user.channelClaimId,\n shortChannelId: req.user.shortChannelId,\n };\n }\n next();\n },\n serializeSpeechUser (user, done) { // returns user data to be serialized into session\n logger.debug('serializing user');\n done(null, user);\n },\n deserializeSpeechUser (user, done) { // deserializes session and populates additional info to req.user\n logger.debug('deserializing user');\n done(null, user);\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./helpers/authHelpers.js","module.exports = require(\"helmet\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"helmet\"\n// module id = 52\n// module chunks = 0","module.exports = require(\"cookie-session\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"cookie-session\"\n// module id = 53\n// module chunks = 0","module.exports = (winston, logLevel) => {\n winston.configure({\n transports: [\n new (winston.transports.Console)({\n level : logLevel,\n timestamp : false,\n colorize : true,\n prettyPrint : true,\n handleExceptions : true,\n humanReadableUnhandledException: true,\n }),\n ],\n });\n\n winston.error('Level 0');\n winston.warn('Level 1');\n winston.info('Level 2');\n winston.verbose('Level 3');\n winston.debug('Level 4');\n winston.silly('Level 5');\n};\n\n\n\n// WEBPACK FOOTER //\n// ./config/loggerConfig.js","const { logging } = require('./speechConfig.js');\nconst { slackWebHook, slackErrorChannel, slackInfoChannel } = logging;\nconst winstonSlackWebHook = require('winston-slack-webhook').SlackWebHook;\n\nmodule.exports = (winston) => {\n if (slackWebHook) {\n // add a transport for errors to slack\n if (slackErrorChannel) {\n winston.add(winstonSlackWebHook, {\n name : 'slack-errors-transport',\n level : 'warn',\n webhookUrl: slackWebHook,\n channel : slackErrorChannel,\n username : 'spee.ch',\n iconEmoji : ':face_with_head_bandage:',\n });\n };\n if (slackInfoChannel) {\n winston.add(winstonSlackWebHook, {\n name : 'slack-info-transport',\n level : 'info',\n webhookUrl: slackWebHook,\n channel : slackInfoChannel,\n username : 'spee.ch',\n iconEmoji : ':nerd_face:',\n });\n };\n // send test message\n winston.error('Slack \"error\" logging is online.');\n winston.info('Slack \"info\" logging is online.');\n } else {\n winston.warn('Slack logging is not enabled because no slackWebHook config var provided.');\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ./config/slackConfig.js","module.exports = require(\"winston-slack-webhook\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"winston-slack-webhook\"\n// module id = 56\n// module chunks = 0","const config = require('../config/speechConfig.js');\nconst logger = require('winston');\n\nmodule.exports = function () {\n // get the config file\n\n for (let configCategoryKey in config) {\n if (config.hasOwnProperty(configCategoryKey)) {\n // get the final variables for each config category\n const configVariables = config[configCategoryKey];\n for (let configVarKey in configVariables) {\n if (configVariables.hasOwnProperty(configVarKey)) {\n // print each variable\n logger.debug(`CONFIG CHECK: ${configCategoryKey}.${configVarKey} === ${configVariables[configVarKey]}`);\n }\n }\n }\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ./helpers/configVarCheck.js","const db = require('../models');\nconst PassportLocalStrategy = require('passport-local').Strategy;\nconst lbryApi = require('../helpers/lbryApi.js');\nconst logger = require('winston');\n\nmodule.exports = new PassportLocalStrategy(\n {\n usernameField: 'username',\n passwordField: 'password',\n },\n (username, password, done) => {\n logger.verbose(`new channel signup request. user: ${username} pass: ${password} .`);\n let userInfo = {};\n // server-side validaton of inputs (username, password)\n\n // create the channel and retrieve the metadata\n return lbryApi.createChannel(`@${username}`)\n .then(tx => {\n // create user record\n const userData = {\n userName: username,\n password: password,\n };\n logger.verbose('userData >', userData);\n // create user record\n const channelData = {\n channelName : `@${username}`,\n channelClaimId: tx.claim_id,\n };\n logger.verbose('channelData >', channelData);\n // create certificate record\n const certificateData = {\n claimId: tx.claim_id,\n name : `@${username}`,\n // address,\n };\n logger.verbose('certificateData >', certificateData);\n // save user and certificate to db\n return Promise.all([db.User.create(userData), db.Channel.create(channelData), db.Certificate.create(certificateData)]);\n })\n .then(([newUser, newChannel, newCertificate]) => {\n logger.verbose('user and certificate successfully created');\n // store the relevant newUser info to be passed back for req.User\n userInfo['id'] = newUser.id;\n userInfo['userName'] = newUser.userName;\n userInfo['channelName'] = newChannel.channelName;\n userInfo['channelClaimId'] = newChannel.channelClaimId;\n // associate the instances\n return Promise.all([newCertificate.setChannel(newChannel), newChannel.setUser(newUser)]);\n })\n .then(() => {\n logger.verbose('user and certificate successfully associated');\n return db.Certificate.getShortChannelIdFromLongChannelId(userInfo.channelClaimId, userInfo.channelName);\n })\n .then(shortChannelId => {\n userInfo['shortChannelId'] = shortChannelId;\n return done(null, userInfo);\n })\n .catch(error => {\n logger.error('signup error', error);\n return done(error);\n });\n }\n);\n\n\n\n// WEBPACK FOOTER //\n// ./passport/local-signup.js","module.exports = require(\"sequelize\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"sequelize\"\n// module id = 59\n// module chunks = 0","const logger = require('winston');\nconst { returnShortId } = require('../helpers/sequelizeHelpers.js');\n\nmodule.exports = (sequelize, { STRING, BOOLEAN, INTEGER, TEXT, DECIMAL }) => {\n const Certificate = sequelize.define(\n 'Certificate',\n {\n address: {\n type : STRING,\n default: null,\n },\n amount: {\n type : DECIMAL(19, 8),\n default: null,\n },\n claimId: {\n type : STRING,\n default: null,\n },\n claimSequence: {\n type : INTEGER,\n default: null,\n },\n decodedClaim: {\n type : BOOLEAN,\n default: null,\n },\n depth: {\n type : INTEGER,\n default: null,\n },\n effectiveAmount: {\n type : DECIMAL(19, 8),\n default: null,\n },\n hasSignature: {\n type : BOOLEAN,\n default: null,\n },\n height: {\n type : INTEGER,\n default: null,\n },\n hex: {\n type : TEXT('long'),\n default: null,\n },\n name: {\n type : STRING,\n default: null,\n },\n nout: {\n type : INTEGER,\n default: null,\n },\n txid: {\n type : STRING,\n default: null,\n },\n validAtHeight: {\n type : INTEGER,\n default: null,\n },\n outpoint: {\n type : STRING,\n default: null,\n },\n valueVersion: {\n type : STRING,\n default: null,\n },\n claimType: {\n type : STRING,\n default: null,\n },\n certificateVersion: {\n type : STRING,\n default: null,\n },\n keyType: {\n type : STRING,\n default: null,\n },\n publicKey: {\n type : TEXT('long'),\n default: null,\n },\n },\n {\n freezeTableName: true,\n }\n );\n\n Certificate.associate = db => {\n Certificate.belongsTo(db.Channel, {\n foreignKey: {\n allowNull: true,\n },\n });\n };\n\n Certificate.getShortChannelIdFromLongChannelId = function (longChannelId, channelName) {\n logger.debug(`getShortChannelIdFromLongChannelId ${channelName}:${longChannelId}`);\n return new Promise((resolve, reject) => {\n this\n .findAll({\n where: {name: channelName},\n order: [['height', 'ASC']],\n })\n .then(result => {\n switch (result.length) {\n case 0:\n throw new Error('No channel(s) found with that channel name');\n default:\n return resolve(returnShortId(result, longChannelId));\n }\n })\n .catch(error => {\n reject(error);\n });\n });\n };\n\n Certificate.getLongChannelIdFromShortChannelId = function (channelName, channelClaimId) {\n logger.debug(`getLongChannelIdFromShortChannelId(${channelName}, ${channelClaimId})`);\n return new Promise((resolve, reject) => {\n this\n .findAll({\n where: {\n name : channelName,\n claimId: {\n $like: `${channelClaimId}%`,\n },\n },\n order: [['height', 'ASC']],\n })\n .then(result => {\n switch (result.length) {\n case 0:\n return resolve(null);\n default: // note results must be sorted\n return resolve(result[0].claimId);\n }\n })\n .catch(error => {\n reject(error);\n });\n });\n };\n\n Certificate.getLongChannelIdFromChannelName = function (channelName) {\n logger.debug(`getLongChannelIdFromChannelName(${channelName})`);\n return new Promise((resolve, reject) => {\n this\n .findAll({\n where: { name: channelName },\n order: [['effectiveAmount', 'DESC'], ['height', 'ASC']],\n })\n .then(result => {\n switch (result.length) {\n case 0:\n return resolve(null);\n default:\n return resolve(result[0].claimId);\n }\n })\n .catch(error => {\n reject(error);\n });\n });\n };\n\n Certificate.validateLongChannelId = function (name, claimId) {\n logger.debug(`validateLongChannelId(${name}, ${claimId})`);\n return new Promise((resolve, reject) => {\n this.findOne({\n where: {name, claimId},\n })\n .then(result => {\n if (!result) {\n return resolve(null);\n };\n resolve(claimId);\n })\n .catch(error => {\n reject(error);\n });\n });\n };\n\n Certificate.getLongChannelId = function (channelName, channelClaimId) {\n logger.debug(`getLongChannelId(${channelName}, ${channelClaimId})`);\n if (channelClaimId && (channelClaimId.length === 40)) { // if a full channel id is provided\n return this.validateLongChannelId(channelName, channelClaimId);\n } else if (channelClaimId && channelClaimId.length < 40) { // if a short channel id is provided\n return this.getLongChannelIdFromShortChannelId(channelName, channelClaimId);\n } else {\n return this.getLongChannelIdFromChannelName(channelName); // if no channel id provided\n }\n };\n\n return Certificate;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./models/certificate.js","module.exports = (sequelize, { STRING }) => {\n const Channel = sequelize.define(\n 'Channel',\n {\n channelName: {\n type : STRING,\n allowNull: false,\n },\n channelClaimId: {\n type : STRING,\n allowNull: false,\n },\n },\n {\n freezeTableName: true,\n }\n );\n\n Channel.associate = db => {\n Channel.belongsTo(db.User);\n Channel.hasOne(db.Certificate);\n };\n\n return Channel;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./models/channel.js","const logger = require('winston');\nconst { returnShortId } = require('../helpers/sequelizeHelpers.js');\nconst { claim, site } = require('../config/speechConfig.js');\nconst { defaultThumbnail } = claim;\n\nfunction determineFileExtensionFromContentType (contentType) {\n switch (contentType) {\n case 'image/jpeg':\n case 'image/jpg':\n return 'jpeg';\n case 'image/png':\n return 'png';\n case 'image/gif':\n return 'gif';\n case 'video/mp4':\n return 'mp4';\n default:\n logger.debug('setting unknown file type as file extension jpeg');\n return 'jpeg';\n }\n};\n\nfunction determineThumbnail (storedThumbnail, defaultThumbnail) {\n if (storedThumbnail === '') {\n return defaultThumbnail;\n }\n return storedThumbnail;\n};\n\nfunction prepareClaimData (claim) {\n // logger.debug('preparing claim data based on resolved data:', claim);\n claim['thumbnail'] = determineThumbnail(claim.thumbnail, defaultThumbnail);\n claim['fileExt'] = determineFileExtensionFromContentType(claim.contentType);\n claim['host'] = site.host;\n return claim;\n};\n\nmodule.exports = (sequelize, { STRING, BOOLEAN, INTEGER, TEXT, DECIMAL }) => {\n const Claim = sequelize.define(\n 'Claim',\n {\n address: {\n type : STRING,\n default: null,\n },\n amount: {\n type : DECIMAL(19, 8),\n default: null,\n },\n claimId: {\n type : STRING,\n default: null,\n },\n claimSequence: {\n type : INTEGER,\n default: null,\n },\n decodedClaim: {\n type : BOOLEAN,\n default: null,\n },\n depth: {\n type : INTEGER,\n default: null,\n },\n effectiveAmount: {\n type : DECIMAL(19, 8),\n default: null,\n },\n hasSignature: {\n type : BOOLEAN,\n default: null,\n },\n height: {\n type : INTEGER,\n default: null,\n },\n hex: {\n type : TEXT('long'),\n default: null,\n },\n name: {\n type : STRING,\n default: null,\n },\n nout: {\n type : INTEGER,\n default: null,\n },\n txid: {\n type : STRING,\n default: null,\n },\n validAtHeight: {\n type : INTEGER,\n default: null,\n },\n outpoint: {\n type : STRING,\n default: null,\n },\n claimType: {\n type : STRING,\n default: null,\n },\n certificateId: {\n type : STRING,\n default: null,\n },\n author: {\n type : STRING,\n default: null,\n },\n description: {\n type : TEXT('long'),\n default: null,\n },\n language: {\n type : STRING,\n default: null,\n },\n license: {\n type : STRING,\n default: null,\n },\n licenseUrl: {\n type : STRING,\n default: null,\n },\n nsfw: {\n type : BOOLEAN,\n default: null,\n },\n preview: {\n type : STRING,\n default: null,\n },\n thumbnail: {\n type : STRING,\n default: null,\n },\n title: {\n type : STRING,\n default: null,\n },\n metadataVersion: {\n type : STRING,\n default: null,\n },\n contentType: {\n type : STRING,\n default: null,\n },\n source: {\n type : STRING,\n default: null,\n },\n sourceType: {\n type : STRING,\n default: null,\n },\n sourceVersion: {\n type : STRING,\n default: null,\n },\n streamVersion: {\n type : STRING,\n default: null,\n },\n valueVersion: {\n type : STRING,\n default: null,\n },\n channelName: {\n type : STRING,\n allowNull: true,\n default : null,\n },\n },\n {\n freezeTableName: true,\n }\n );\n\n Claim.associate = db => {\n Claim.belongsTo(db.File, {\n foreignKey: {\n allowNull: true,\n },\n });\n };\n\n Claim.getShortClaimIdFromLongClaimId = function (claimId, claimName) {\n logger.debug(`Claim.getShortClaimIdFromLongClaimId for ${claimName}#${claimId}`);\n return new Promise((resolve, reject) => {\n this\n .findAll({\n where: { name: claimName },\n order: [['height', 'ASC']],\n })\n .then(result => {\n switch (result.length) {\n case 0:\n throw new Error('No claim(s) found with that claim name');\n default:\n resolve(returnShortId(result, claimId));\n }\n })\n .catch(error => {\n reject(error);\n });\n });\n };\n\n Claim.getAllChannelClaims = function (channelClaimId) {\n logger.debug(`Claim.getAllChannelClaims for ${channelClaimId}`);\n return new Promise((resolve, reject) => {\n this\n .findAll({\n where: { certificateId: channelClaimId },\n order: [['height', 'ASC']],\n raw : true, // returns an array of only data, not an array of instances\n })\n .then(channelClaimsArray => {\n // logger.debug('channelclaimsarray length:', channelClaimsArray.length);\n switch (channelClaimsArray.length) {\n case 0:\n return resolve(null);\n default:\n channelClaimsArray.forEach(claim => {\n claim['fileExt'] = determineFileExtensionFromContentType(claim.contentType);\n claim['thumbnail'] = determineThumbnail(claim.thumbnail, defaultThumbnail);\n return claim;\n });\n return resolve(channelClaimsArray);\n }\n })\n .catch(error => {\n reject(error);\n });\n });\n };\n\n Claim.getClaimIdByLongChannelId = function (channelClaimId, claimName) {\n logger.debug(`finding claim id for claim ${claimName} from channel ${channelClaimId}`);\n return new Promise((resolve, reject) => {\n this\n .findAll({\n where: { name: claimName, certificateId: channelClaimId },\n order: [['id', 'ASC']],\n })\n .then(result => {\n switch (result.length) {\n case 0:\n return resolve(null);\n case 1:\n return resolve(result[0].claimId);\n default:\n logger.error(`${result.length} records found for \"${claimName}\" in channel \"${channelClaimId}\"`);\n return resolve(result[0].claimId);\n }\n })\n .catch(error => {\n reject(error);\n });\n });\n };\n\n Claim.getLongClaimIdFromShortClaimId = function (name, shortId) {\n return new Promise((resolve, reject) => {\n this\n .findAll({\n where: {\n name,\n claimId: {\n $like: `${shortId}%`,\n }},\n order: [['height', 'ASC']],\n })\n .then(result => {\n switch (result.length) {\n case 0:\n return resolve(null);\n default: // note results must be sorted\n return resolve(result[0].claimId);\n }\n })\n .catch(error => {\n reject(error);\n });\n });\n };\n\n Claim.getTopFreeClaimIdByClaimName = function (name) {\n return new Promise((resolve, reject) => {\n this\n .findAll({\n where: { name },\n order: [['effectiveAmount', 'DESC'], ['height', 'ASC']], // note: maybe height and effective amount need to switch?\n })\n .then(result => {\n logger.debug('length of result', result.length);\n switch (result.length) {\n case 0:\n return resolve(null);\n default:\n return resolve(result[0].dataValues.claimId);\n }\n })\n .catch(error => {\n reject(error);\n });\n });\n };\n\n Claim.validateLongClaimId = function (name, claimId) {\n return new Promise((resolve, reject) => {\n this.findOne({\n where: {name, claimId},\n })\n .then(result => {\n if (!result) {\n return resolve(null);\n };\n resolve(claimId);\n })\n .catch(error => {\n reject(error);\n });\n });\n };\n\n Claim.getLongClaimId = function (claimName, claimId) {\n logger.debug(`getLongClaimId(${claimName}, ${claimId})`);\n if (claimId && (claimId.length === 40)) { // if a full claim id is provided\n return this.validateLongClaimId(claimName, claimId);\n } else if (claimId && claimId.length < 40) {\n return this.getLongClaimIdFromShortClaimId(claimName, claimId); // if a short claim id is provided\n } else {\n return this.getTopFreeClaimIdByClaimName(claimName); // if no claim id is provided\n }\n };\n\n Claim.resolveClaim = function (name, claimId) {\n logger.debug(`Claim.resolveClaim: ${name} ${claimId}`);\n return new Promise((resolve, reject) => {\n this\n .findAll({\n where: { name, claimId },\n })\n .then(claimArray => {\n logger.debug('claims found on resolve:', claimArray.length);\n switch (claimArray.length) {\n case 0:\n return resolve(null);\n case 1:\n return resolve(prepareClaimData(claimArray[0].dataValues));\n default:\n logger.error(`more than one entry matches that name (${name}) and claimID (${claimId})`);\n return resolve(prepareClaimData(claimArray[0].dataValues));\n }\n })\n .catch(error => {\n reject(error);\n });\n });\n };\n\n return Claim;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./models/claim.js","module.exports = (sequelize, { STRING, BOOLEAN, INTEGER }) => {\n const File = sequelize.define(\n 'File',\n {\n name: {\n type : STRING,\n allowNull: false,\n },\n claimId: {\n type : STRING,\n allowNull: false,\n },\n address: {\n type : STRING,\n allowNull: false,\n },\n outpoint: {\n type : STRING,\n allowNull: false,\n },\n height: {\n type : INTEGER,\n allowNull: false,\n default : 0,\n },\n fileName: {\n type : STRING,\n allowNull: false,\n },\n filePath: {\n type : STRING,\n allowNull: false,\n },\n fileType: {\n type: STRING,\n },\n nsfw: {\n type : BOOLEAN,\n allowNull : false,\n defaultValue: false,\n },\n trendingEligible: {\n type : BOOLEAN,\n allowNull : false,\n defaultValue: true,\n },\n },\n {\n freezeTableName: true,\n }\n );\n\n File.associate = db => {\n File.hasMany(db.Request);\n File.hasOne(db.Claim);\n };\n\n File.getRecentClaims = function () {\n return this.findAll({\n where: { nsfw: false, trendingEligible: true },\n order: [['createdAt', 'DESC']],\n limit: 25,\n });\n };\n\n return File;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./models/file.js","module.exports = (sequelize, { STRING, BOOLEAN, TEXT }) => {\n const Request = sequelize.define(\n 'Request',\n {\n action: {\n type : STRING,\n allowNull: false,\n },\n url: {\n type : STRING,\n allowNull: false,\n },\n ipAddress: {\n type : STRING,\n allowNull: true,\n },\n result: {\n type : TEXT('long'),\n allowNull: true,\n default : null,\n },\n },\n {\n freezeTableName: true,\n }\n );\n\n Request.associate = db => {\n Request.belongsTo(db.File, {\n foreignKey: {\n allowNull: true,\n },\n });\n };\n\n return Request;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./models/request.js","'use strict';\nconst bcrypt = require('bcrypt');\nconst logger = require('winston');\n\nmodule.exports = (sequelize, { STRING }) => {\n const User = sequelize.define(\n 'User',\n {\n userName: {\n type : STRING,\n allowNull: false,\n },\n password: {\n type : STRING,\n allowNull: false,\n },\n },\n {\n freezeTableName: true,\n }\n );\n\n User.associate = db => {\n User.hasOne(db.Channel);\n };\n\n User.prototype.comparePassword = function (password) {\n return bcrypt.compare(password, this.password);\n };\n\n User.prototype.changePassword = function (newPassword) {\n return new Promise((resolve, reject) => {\n // generate a salt string to use for hashing\n bcrypt.genSalt((saltError, salt) => {\n if (saltError) {\n logger.error('salt error', saltError);\n reject(saltError);\n return;\n }\n // generate a hashed version of the user's password\n bcrypt.hash(newPassword, salt, (hashError, hash) => {\n // if there is an error with the hash generation return the error\n if (hashError) {\n logger.error('hash error', hashError);\n reject(hashError);\n return;\n }\n // replace the current password with the new hash\n this\n .update({password: hash})\n .then(() => {\n resolve();\n })\n .catch(error => {\n reject(error);\n });\n });\n });\n });\n };\n\n // pre-save hook method to hash the user's password before the user's info is saved to the db.\n User.hook('beforeCreate', (user, options) => {\n logger.debug('User.beforeCreate hook...');\n return new Promise((resolve, reject) => {\n // generate a salt string to use for hashing\n bcrypt.genSalt((saltError, salt) => {\n if (saltError) {\n logger.error('salt error', saltError);\n reject(saltError);\n return;\n }\n // generate a hashed version of the user's password\n bcrypt.hash(user.password, salt, (hashError, hash) => {\n // if there is an error with the hash generation return the error\n if (hashError) {\n logger.error('hash error', hashError);\n reject(hashError);\n return;\n }\n // replace the password string with the hash password value\n user.password = hash;\n resolve();\n });\n });\n });\n });\n\n return User;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./models/user.js","module.exports = require(\"bcrypt\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"bcrypt\"\n// module id = 66\n// module chunks = 0","module.exports = require(\"axios\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"axios\"\n// module id = 67\n// module chunks = 0","module.exports = require(\"universal-analytics\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"universal-analytics\"\n// module id = 68\n// module chunks = 0","const PassportLocalStrategy = require('passport-local').Strategy;\nconst db = require('../models');\nconst logger = require('winston');\n\nfunction returnUserAndChannelInfo (userInstance) {\n return new Promise((resolve, reject) => {\n let userInfo = {};\n userInfo['id'] = userInstance.id;\n userInfo['userName'] = userInstance.userName;\n userInstance\n .getChannel()\n .then(({channelName, channelClaimId}) => {\n userInfo['channelName'] = channelName;\n userInfo['channelClaimId'] = channelClaimId;\n return db.Certificate.getShortChannelIdFromLongChannelId(channelClaimId, channelName);\n })\n .then(shortChannelId => {\n userInfo['shortChannelId'] = shortChannelId;\n resolve(userInfo);\n })\n .catch(error => {\n reject(error);\n });\n });\n}\n\nmodule.exports = new PassportLocalStrategy(\n {\n usernameField: 'username',\n passwordField: 'password',\n },\n (username, password, done) => {\n return db.User\n .findOne({\n where: {userName: username},\n })\n .then(user => {\n if (!user) {\n logger.debug('no user found');\n return done(null, false, {message: 'Incorrect username or password'});\n }\n return user.comparePassword(password)\n .then(isMatch => {\n if (!isMatch) {\n logger.debug('incorrect password');\n return done(null, false, {message: 'Incorrect username or password'});\n }\n logger.debug('Password was a match, returning User');\n return returnUserAndChannelInfo(user)\n .then(userInfo => {\n return done(null, userInfo);\n })\n .catch(error => {\n return error;\n });\n })\n .catch(error => {\n return error;\n });\n })\n .catch(error => {\n return done(error);\n });\n }\n);\n\n\n\n// WEBPACK FOOTER //\n// ./passport/local-login.js","const logger = require('winston');\nconst passport = require('passport');\n\nmodule.exports = (app) => {\n // route for sign up\n app.post('/signup', passport.authenticate('local-signup'), (req, res) => {\n logger.verbose(`successful signup for ${req.user.channelName}`);\n res.status(200).json({\n success : true,\n channelName : req.user.channelName,\n channelClaimId: req.user.channelClaimId,\n shortChannelId: req.user.shortChannelId,\n });\n });\n // route for log in\n app.post('/login', (req, res, next) => {\n passport.authenticate('local-login', (err, user, info) => {\n logger.debug('info:', info);\n if (err) {\n return next(err);\n }\n if (!user) {\n return res.status(400).json({\n success: false,\n message: info.message,\n });\n }\n logger.debug('successful login');\n req.logIn(user, (err) => {\n if (err) {\n return next(err);\n }\n return res.status(200).json({\n success : true,\n channelName : req.user.channelName,\n channelClaimId: req.user.channelClaimId,\n shortChannelId: req.user.shortChannelId,\n });\n });\n })(req, res, next);\n });\n // route to log out\n app.get('/logout', (req, res) => {\n req.logout();\n res.status(200).json({success: true, message: 'you successfully logged out'});\n });\n // see if user is authenticated, and return credentials if so\n app.get('/user', (req, res) => {\n if (req.user) {\n res.status(200).json({success: true, data: req.user});\n } else {\n res.status(401).json({success: false, message: 'user is not logged in'});\n }\n });\n};\n\n\n\n// WEBPACK FOOTER //\n// ./routes/auth-routes.js","const logger = require('winston');\nconst multipart = require('connect-multiparty');\nconst { files, site } = require('../config/speechConfig.js');\nconst multipartMiddleware = multipart({uploadDir: files.uploadDirectory});\nconst db = require('../models');\nconst { claimNameIsAvailable, checkChannelAvailability, publish } = require('../controllers/publishController.js');\nconst { getClaimList, resolveUri, getClaim } = require('../helpers/lbryApi.js');\nconst { addGetResultsToFileData, createBasicPublishParams, createThumbnailPublishParams, parsePublishApiRequestBody, parsePublishApiRequestFiles, createFileData } = require('../helpers/publishHelpers.js');\nconst errorHandlers = require('../helpers/errorHandlers.js');\nconst { sendGATimingEvent } = require('../helpers/googleAnalytics.js');\nconst { authenticateUser } = require('../auth/authentication.js');\nconst { getChannelData, getChannelClaims, getClaimId } = require('../controllers/serveController.js');\n\nconst NO_CHANNEL = 'NO_CHANNEL';\nconst NO_CLAIM = 'NO_CLAIM';\n\nmodule.exports = (app) => {\n // route to check whether site has published to a channel\n app.get('/api/channel/availability/:name', ({ ip, originalUrl, params }, res) => {\n checkChannelAvailability(params.name)\n .then(result => {\n if (result === true) {\n res.status(200).json(true);\n } else {\n res.status(200).json(false);\n }\n })\n .catch(error => {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n // route to get a short channel id from long channel Id\n app.get('/api/channel/short-id/:longId/:name', ({ ip, originalUrl, params }, res) => {\n db.Certificate.getShortChannelIdFromLongChannelId(params.longId, params.name)\n .then(shortId => {\n res.status(200).json(shortId);\n })\n .catch(error => {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n app.get('/api/channel/data/:channelName/:channelClaimId', ({ ip, originalUrl, body, params }, res) => {\n const channelName = params.channelName;\n let channelClaimId = params.channelClaimId;\n if (channelClaimId === 'none') channelClaimId = null;\n getChannelData(channelName, channelClaimId, 0)\n .then(data => {\n if (data === NO_CHANNEL) {\n return res.status(404).json({success: false, message: 'No matching channel was found'});\n }\n res.status(200).json({success: true, data});\n })\n .catch(error => {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n app.get('/api/channel/claims/:channelName/:channelClaimId/:page', ({ ip, originalUrl, body, params }, res) => {\n const channelName = params.channelName;\n let channelClaimId = params.channelClaimId;\n if (channelClaimId === 'none') channelClaimId = null;\n const page = params.page;\n getChannelClaims(channelName, channelClaimId, page)\n .then(data => {\n if (data === NO_CHANNEL) {\n return res.status(404).json({success: false, message: 'No matching channel was found'});\n }\n res.status(200).json({success: true, data});\n })\n .catch(error => {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n // route to run a claim_list request on the daemon\n app.get('/api/claim/list/:name', ({ ip, originalUrl, params }, res) => {\n getClaimList(params.name)\n .then(claimsList => {\n res.status(200).json(claimsList);\n })\n .catch(error => {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n // route to get an asset\n app.get('/api/claim/get/:name/:claimId', ({ ip, originalUrl, params }, res) => {\n const name = params.name;\n const claimId = params.claimId;\n // resolve the claim\n db.Claim.resolveClaim(name, claimId)\n .then(resolveResult => {\n // make sure a claim actually exists at that uri\n if (!resolveResult) {\n throw new Error('No matching uri found in Claim table');\n }\n let fileData = createFileData(resolveResult);\n // get the claim\n return Promise.all([fileData, getClaim(`${name}#${claimId}`)]);\n })\n .then(([ fileData, getResult ]) => {\n fileData = addGetResultsToFileData(fileData, getResult);\n return Promise.all([db.upsert(db.File, fileData, {name, claimId}, 'File'), getResult]);\n })\n .then(([ fileRecord, {message, completed} ]) => {\n res.status(200).json({ success: true, message, completed });\n })\n .catch(error => {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n // route to check whether this site published to a claim\n app.get('/api/claim/availability/:name', ({ ip, originalUrl, params }, res) => {\n claimNameIsAvailable(params.name)\n .then(result => {\n res.status(200).json(result);\n })\n .catch(error => {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n // route to run a resolve request on the daemon\n app.get('/api/claim/resolve/:name/:claimId', ({ headers, ip, originalUrl, params }, res) => {\n resolveUri(`${params.name}#${params.claimId}`)\n .then(resolvedUri => {\n res.status(200).json(resolvedUri);\n })\n .catch(error => {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n // route to run a publish request on the daemon\n app.post('/api/claim/publish', multipartMiddleware, ({ body, files, headers, ip, originalUrl, user }, res) => {\n logger.debug('api/claim/publish req.body:', body);\n logger.debug('api/claim/publish req.files:', files);\n // define variables\n let channelName, channelId, channelPassword, description, fileName, filePath, fileType, gaStartTime, license, name, nsfw, thumbnail, thumbnailFileName, thumbnailFilePath, thumbnailFileType, title;\n // record the start time of the request\n gaStartTime = Date.now();\n // validate the body and files of the request\n try {\n // validateApiPublishRequest(body, files);\n ({name, nsfw, license, title, description, thumbnail} = parsePublishApiRequestBody(body));\n ({fileName, filePath, fileType, thumbnailFileName, thumbnailFilePath, thumbnailFileType} = parsePublishApiRequestFiles(files));\n ({channelName, channelId, channelPassword} = body);\n } catch (error) {\n return res.status(400).json({success: false, message: error.message});\n }\n // check channel authorization\n Promise.all([\n authenticateUser(channelName, channelId, channelPassword, user),\n claimNameIsAvailable(name),\n createBasicPublishParams(filePath, name, title, description, license, nsfw, thumbnail),\n createThumbnailPublishParams(thumbnailFilePath, name, license, nsfw),\n ])\n .then(([{channelName, channelClaimId}, validatedClaimName, publishParams, thumbnailPublishParams]) => {\n // add channel details to the publish params\n if (channelName && channelClaimId) {\n publishParams['channel_name'] = channelName;\n publishParams['channel_id'] = channelClaimId;\n }\n // publish the thumbnail\n if (thumbnailPublishParams) {\n publish(thumbnailPublishParams, thumbnailFileName, thumbnailFileType);\n }\n // publish the asset\n return publish(publishParams, fileName, fileType);\n })\n .then(result => {\n res.status(200).json({\n success: true,\n message: 'publish completed successfully',\n data : {\n name,\n claimId: result.claim_id,\n url : `${site.host}/${result.claim_id}/${name}`,\n lbryTx : result,\n },\n });\n // record the publish end time and send to google analytics\n sendGATimingEvent('end-to-end', 'publish', fileType, gaStartTime, Date.now());\n })\n .catch(error => {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n // route to get a short claim id from long claim Id\n app.get('/api/claim/short-id/:longId/:name', ({ ip, originalUrl, body, params }, res) => {\n db.Claim.getShortClaimIdFromLongClaimId(params.longId, params.name)\n .then(shortId => {\n res.status(200).json({success: true, data: shortId});\n })\n .catch(error => {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n app.post('/api/claim/long-id', ({ ip, originalUrl, body, params }, res) => {\n logger.debug('body:', body);\n const channelName = body.channelName;\n const channelClaimId = body.channelClaimId;\n const claimName = body.claimName;\n const claimId = body.claimId;\n getClaimId(channelName, channelClaimId, claimName, claimId)\n .then(result => {\n if (result === NO_CHANNEL) {\n return res.status(404).json({success: false, message: 'No matching channel could be found'});\n }\n if (result === NO_CLAIM) {\n return res.status(404).json({success: false, message: 'No matching claim id could be found'});\n }\n res.status(200).json({success: true, data: result});\n })\n .catch(error => {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n app.get('/api/claim/data/:claimName/:claimId', ({ ip, originalUrl, body, params }, res) => {\n const claimName = params.claimName;\n let claimId = params.claimId;\n if (claimId === 'none') claimId = null;\n db.Claim.resolveClaim(claimName, claimId)\n .then(claimInfo => {\n if (!claimInfo) {\n return res.status(404).json({success: false, message: 'No claim could be found'});\n }\n res.status(200).json({success: true, data: claimInfo});\n })\n .catch(error => {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n // route to see if asset is available locally\n app.get('/api/file/availability/:name/:claimId', ({ ip, originalUrl, params }, res) => {\n const name = params.name;\n const claimId = params.claimId;\n db.File.findOne({where: {name, claimId}})\n .then(result => {\n if (result) {\n return res.status(200).json({success: true, data: true});\n }\n res.status(200).json({success: true, data: false});\n })\n .catch(error => {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n};\n\n\n\n// WEBPACK FOOTER //\n// ./routes/api-routes.js","module.exports = require(\"connect-multiparty\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"connect-multiparty\"\n// module id = 72\n// module chunks = 0","const logger = require('winston');\nconst db = require('../models');\nconst lbryApi = require('../helpers/lbryApi.js');\nconst publishHelpers = require('../helpers/publishHelpers.js');\nconst config = require('../config/speechConfig.js');\n\nmodule.exports = {\n publish (publishParams, fileName, fileType) {\n return new Promise((resolve, reject) => {\n let publishResults, certificateId, channelName;\n // publish the file\n return lbryApi.publishClaim(publishParams)\n .then(tx => {\n logger.info(`Successfully published ${publishParams.name} ${fileName}`, tx);\n publishResults = tx;\n // get the channel information\n if (publishParams.channel_name) {\n logger.debug(`this claim was published in channel: ${publishParams.channel_name}`);\n return db.Channel.findOne({where: {channelName: publishParams.channel_name}});\n } else {\n logger.debug('this claim was not published in a channel');\n return null;\n }\n })\n .then(channel => {\n // set channel information\n certificateId = null;\n channelName = null;\n if (channel) {\n certificateId = channel.channelClaimId;\n channelName = channel.channelName;\n }\n logger.debug(`certificateId: ${certificateId}`);\n })\n .then(() => {\n // create the File record\n const fileRecord = {\n name : publishParams.name,\n claimId : publishResults.claim_id,\n title : publishParams.metadata.title,\n description: publishParams.metadata.description,\n address : publishParams.claim_address,\n outpoint : `${publishResults.txid}:${publishResults.nout}`,\n height : 0,\n fileName,\n filePath : publishParams.file_path,\n fileType,\n nsfw : publishParams.metadata.nsfw,\n };\n // create the Claim record\n const claimRecord = {\n name : publishParams.name,\n claimId : publishResults.claim_id,\n title : publishParams.metadata.title,\n description: publishParams.metadata.description,\n address : publishParams.claim_address,\n thumbnail : publishParams.metadata.thumbnail,\n outpoint : `${publishResults.txid}:${publishResults.nout}`,\n height : 0,\n contentType: fileType,\n nsfw : publishParams.metadata.nsfw,\n amount : publishParams.bid,\n certificateId,\n channelName,\n };\n // upsert criteria\n const upsertCriteria = {\n name : publishParams.name,\n claimId: publishResults.claim_id,\n };\n // upsert the records\n return Promise.all([db.upsert(db.File, fileRecord, upsertCriteria, 'File'), db.upsert(db.Claim, claimRecord, upsertCriteria, 'Claim')]);\n })\n .then(([file, claim]) => {\n logger.debug('File and Claim records successfully created');\n return Promise.all([file.setClaim(claim), claim.setFile(file)]);\n })\n .then(() => {\n logger.debug('File and Claim records successfully associated');\n resolve(publishResults); // resolve the promise with the result from lbryApi.publishClaim;\n })\n .catch(error => {\n logger.error('PUBLISH ERROR', error);\n publishHelpers.deleteTemporaryFile(publishParams.file_path); // delete the local file\n reject(error);\n });\n });\n },\n claimNameIsAvailable (name) {\n // find any records where the name is used\n return db.File.findAll({ where: { name } })\n .then(result => {\n if (result.length >= 1) {\n const claimAddress = config.wallet.lbryClaimAddress;\n // filter out any results that were not published from spee.ch's wallet address\n const filteredResult = result.filter((claim) => {\n return (claim.address === claimAddress);\n });\n // return based on whether any non-spee.ch claims were left\n if (filteredResult.length >= 1) {\n throw new Error('That claim is already in use');\n };\n return name;\n };\n return name;\n });\n },\n checkChannelAvailability (name) {\n return new Promise((resolve, reject) => {\n // find any records where the name is used\n db.Channel.findAll({ where: { channelName: name } })\n .then(result => {\n if (result.length >= 1) {\n return resolve(false);\n }\n resolve(true);\n })\n .catch(error => {\n reject(error);\n });\n });\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./controllers/publishController.js","module.exports = require(\"fs\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"fs\"\n// module id = 74\n// module chunks = 0","const db = require('../models');\nconst logger = require('winston');\n\nmodule.exports = {\n authenticateUser (channelName, channelId, channelPassword, user) {\n // case: no channelName or channel Id are provided (anonymous), regardless of whether user token is provided\n if (!channelName && !channelId) {\n return {\n channelName : null,\n channelClaimId: null,\n };\n }\n // case: channelName or channel Id are provided with user token\n if (user) {\n if (channelName && channelName !== user.channelName) {\n throw new Error('the provided channel name does not match user credentials');\n }\n if (channelId && channelId !== user.channelClaimId) {\n throw new Error('the provided channel id does not match user credentials');\n }\n return {\n channelName : user.channelName,\n channelClaimId: user.channelClaimId,\n };\n }\n // case: channelName or channel Id are provided with password instead of user token\n if (!channelPassword) throw new Error('no channel password provided');\n return module.exports.authenticateChannelCredentials(channelName, channelId, channelPassword);\n },\n authenticateChannelCredentials (channelName, channelId, userPassword) {\n return new Promise((resolve, reject) => {\n // hoisted variables\n let channelData;\n // build the params for finding the channel\n let channelFindParams = {};\n if (channelName) channelFindParams['channelName'] = channelName;\n if (channelId) channelFindParams['channelClaimId'] = channelId;\n // find the channel\n db.Channel\n .findOne({\n where: channelFindParams,\n })\n .then(channel => {\n if (!channel) {\n logger.debug('no channel found');\n throw new Error('Authentication failed, you do not have access to that channel');\n }\n channelData = channel.get();\n logger.debug('channel data:', channelData);\n return db.User.findOne({\n where: { userName: channelData.channelName.substring(1) },\n });\n })\n .then(user => {\n if (!user) {\n logger.debug('no user found');\n throw new Error('Authentication failed, you do not have access to that channel');\n }\n return user.comparePassword(userPassword);\n })\n .then(isMatch => {\n if (!isMatch) {\n logger.debug('incorrect password');\n throw new Error('Authentication failed, you do not have access to that channel');\n }\n logger.debug('...password was a match...');\n resolve(channelData);\n })\n .catch(error => {\n reject(error);\n });\n });\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./auth/authentication.js","const CLAIMS_PER_PAGE = 12;\n\nmodule.exports = {\n returnPaginatedChannelClaims (channelName, longChannelClaimId, claims, page) {\n const totalPages = module.exports.determineTotalPages(claims);\n const paginationPage = module.exports.getPageFromQuery(page);\n const viewData = {\n channelName : channelName,\n longChannelClaimId: longChannelClaimId,\n claims : module.exports.extractPageFromClaims(claims, paginationPage),\n previousPage : module.exports.determinePreviousPage(paginationPage),\n currentPage : paginationPage,\n nextPage : module.exports.determineNextPage(totalPages, paginationPage),\n totalPages : totalPages,\n totalResults : module.exports.determineTotalClaims(claims),\n };\n return viewData;\n },\n getPageFromQuery (page) {\n if (page) {\n return parseInt(page);\n }\n return 1;\n },\n extractPageFromClaims (claims, pageNumber) {\n if (!claims) {\n return []; // if no claims, return this default\n }\n // logger.debug('claims is array?', Array.isArray(claims));\n // logger.debug(`pageNumber ${pageNumber} is number?`, Number.isInteger(pageNumber));\n const claimStartIndex = (pageNumber - 1) * CLAIMS_PER_PAGE;\n const claimEndIndex = claimStartIndex + CLAIMS_PER_PAGE;\n const pageOfClaims = claims.slice(claimStartIndex, claimEndIndex);\n return pageOfClaims;\n },\n determineTotalPages (claims) {\n if (!claims) {\n return 0;\n } else {\n const totalClaims = claims.length;\n if (totalClaims < CLAIMS_PER_PAGE) {\n return 1;\n }\n const fullPages = Math.floor(totalClaims / CLAIMS_PER_PAGE);\n const remainder = totalClaims % CLAIMS_PER_PAGE;\n if (remainder === 0) {\n return fullPages;\n }\n return fullPages + 1;\n }\n },\n determinePreviousPage (currentPage) {\n if (currentPage === 1) {\n return null;\n }\n return currentPage - 1;\n },\n determineNextPage (totalPages, currentPage) {\n if (currentPage === totalPages) {\n return null;\n }\n return currentPage + 1;\n },\n determineTotalClaims (claims) {\n if (!claims) {\n return 0;\n }\n return claims.length;\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./helpers/channelPagination.js","const { site } = require('../config/speechConfig.js');\nconst handlePageRender = require('../helpers/handlePageRender.jsx');\n\nmodule.exports = (app) => {\n // route for the home page\n app.get('/', (req, res) => {\n handlePageRender(req, res);\n });\n // route to display login page\n app.get('/login', (req, res) => {\n handlePageRender(req, res);\n });\n // route to show 'about' page\n app.get('/about', (req, res) => {\n handlePageRender(req, res);\n });\n // route to display a list of the trending images\n app.get('/trending', (req, res) => {\n res.status(301).redirect('/popular');\n });\n app.get('/popular', (req, res) => {\n handlePageRender(req, res);\n });\n // route to display a list of the trending images\n app.get('/new', (req, res) => {\n handlePageRender(req, res);\n });\n // route to send embedable video player (for twitter)\n app.get('/embed/:claimId/:name', ({ params }, res) => {\n const claimId = params.claimId;\n const name = params.name;\n const host = site.host;\n // get and render the content\n res.status(200).render('embed', { layout: 'embed', host, claimId, name });\n });\n};\n\n\n\n// WEBPACK FOOTER //\n// ./routes/page-routes.js","import * as actions from 'constants/publish_action_types';\nimport { LOGIN } from 'constants/publish_channel_select_states';\nconst { publish } = require('../../config/speechConfig.js');\n\nconst initialState = {\n publishInChannel : false,\n selectedChannel : LOGIN,\n showMetadataInputs: false,\n status : {\n status : null,\n message: null,\n },\n error: {\n file : null,\n url : null,\n channel : null,\n publishSubmit: null,\n },\n file : null,\n claim : '',\n metadata: {\n title : '',\n description: '',\n license : '',\n nsfw : false,\n },\n thumbnailChannel : publish.thumbnailChannel,\n thumbnailChannelId: publish.thumbnailChannelId,\n thumbnail : null,\n};\n\nexport default function (state = initialState, action) {\n switch (action.type) {\n case actions.FILE_SELECTED:\n return Object.assign({}, initialState, { // note: clears to initial state\n file: action.data,\n });\n case actions.FILE_CLEAR:\n return initialState;\n case actions.METADATA_UPDATE:\n return Object.assign({}, state, {\n metadata: Object.assign({}, state.metadata, {\n [action.data.name]: action.data.value,\n }),\n });\n case actions.CLAIM_UPDATE:\n return Object.assign({}, state, {\n claim: action.data,\n });\n case actions.SET_PUBLISH_IN_CHANNEL:\n return Object.assign({}, state, {\n publishInChannel: action.channel,\n });\n case actions.PUBLISH_STATUS_UPDATE:\n return Object.assign({}, state, {\n status: action.data,\n });\n case actions.ERROR_UPDATE:\n return Object.assign({}, state, {\n error: Object.assign({}, state.error, {\n [action.data.name]: action.data.value,\n }),\n });\n case actions.SELECTED_CHANNEL_UPDATE:\n return Object.assign({}, state, {\n selectedChannel: action.data,\n });\n case actions.TOGGLE_METADATA_INPUTS:\n return Object.assign({}, state, {\n showMetadataInputs: action.data,\n });\n case actions.THUMBNAIL_NEW:\n return Object.assign({}, state, {\n thumbnail: action.data,\n });\n default:\n return state;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./react/reducers/publish.js","import * as actions from 'constants/channel_action_types';\n\nconst initialState = {\n loggedInChannel: {\n name : null,\n shortId: null,\n longId : null,\n },\n};\n\nexport default function (state = initialState, action) {\n switch (action.type) {\n case actions.CHANNEL_UPDATE:\n return Object.assign({}, state, {\n loggedInChannel: action.data,\n });\n default:\n return state;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./react/reducers/channel.js","import * as actions from 'constants/show_action_types';\nimport { LOCAL_CHECK, ERROR } from 'constants/asset_display_states';\n\nconst initialState = {\n request: {\n error: null,\n type : null,\n id : null,\n },\n requestList : {},\n channelList : {},\n assetList : {},\n displayAsset: {\n error : null,\n status: LOCAL_CHECK,\n },\n};\n\nexport default function (state = initialState, action) {\n switch (action.type) {\n // handle request\n case actions.REQUEST_ERROR:\n return Object.assign({}, state, {\n request: Object.assign({}, state.request, {\n error: action.data,\n }),\n });\n case actions.REQUEST_UPDATE:\n return Object.assign({}, state, {\n request: Object.assign({}, state.request, {\n type: action.data.requestType,\n id : action.data.requestId,\n }),\n });\n // store requests\n case actions.REQUEST_LIST_ADD:\n return Object.assign({}, state, {\n requestList: Object.assign({}, state.requestList, {\n [action.data.id]: {\n error: action.data.error,\n key : action.data.key,\n },\n }),\n });\n // asset data\n case actions.ASSET_ADD:\n return Object.assign({}, state, {\n assetList: Object.assign({}, state.assetList, {\n [action.data.id]: {\n error : action.data.error,\n name : action.data.name,\n claimId : action.data.claimId,\n shortId : action.data.shortId,\n claimData: action.data.claimData,\n },\n }),\n });\n // channel data\n case actions.CHANNEL_ADD:\n return Object.assign({}, state, {\n channelList: Object.assign({}, state.channelList, {\n [action.data.id]: {\n name : action.data.name,\n longId : action.data.longId,\n shortId : action.data.shortId,\n claimsData: action.data.claimsData,\n },\n }),\n });\n case actions.CHANNEL_CLAIMS_UPDATE_SUCCESS:\n return Object.assign({}, state, {\n channelList: Object.assign({}, state.channelList, {\n [action.data.channelListId]: Object.assign({}, state.channelList[action.data.channelListId], {\n claimsData: action.data.claimsData,\n }),\n }),\n });\n // display an asset\n case actions.FILE_AVAILABILITY_UPDATE:\n return Object.assign({}, state, {\n displayAsset: Object.assign({}, state.displayAsset, {\n status: action.data,\n }),\n });\n case actions.DISPLAY_ASSET_ERROR:\n return Object.assign({}, state, {\n displayAsset: Object.assign({}, state.displayAsset, {\n error : action.data,\n status: ERROR,\n }),\n });\n default:\n return state;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./react/reducers/show.js","const { site } = require('../../config/speechConfig.js');\n\nconst initialState = {\n host: site.host,\n};\n\nexport default function (state = initialState, action) {\n switch (action.type) {\n default:\n return state;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./react/reducers/site.js","module.exports = require(\"react-ga\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"react-ga\"\n// module id = 82\n// module chunks = 0","import React from 'react';\nimport SEO from 'components/SEO';\nimport NavBar from 'containers/NavBar';\nimport PublishTool from 'containers/PublishTool';\n\nclass HomePage extends React.Component {\n render () {\n return (\n
\n \n \n
\n \n
\n
\n );\n }\n};\n\nexport default HomePage;\n\n\n\n// WEBPACK FOOTER //\n// ./react/components/HomePage/index.jsx","const { site: { title: siteTitle } } = require('../../config/speechConfig.js');\n\nexport const createPageTitle = (pageTitle) => {\n if (!pageTitle) {\n return `${siteTitle}`;\n }\n return `${siteTitle} - ${pageTitle}`;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./react/utils/pageTitle.js","const { site: { title, host, description }, claim: { defaultThumbnail, defaultDescription } } = require('../../config/speechConfig.js');\n\nconst determineOgThumbnailContentType = (thumbnail) => {\n if (thumbnail) {\n const fileExt = thumbnail.substring(thumbnail.lastIndexOf('.'));\n switch (fileExt) {\n case 'jpeg':\n case 'jpg':\n return 'image/jpeg';\n case 'png':\n return 'image/png';\n case 'gif':\n return 'image/gif';\n case 'mp4':\n return 'video/mp4';\n default:\n return 'image/jpeg';\n }\n }\n return '';\n};\n\nconst createBasicMetaTags = () => {\n return [\n {property: 'og:title', content: title},\n {property: 'og:url', content: host},\n {property: 'og:site_name', content: title},\n {property: 'og:description', content: description},\n {property: 'twitter:site', content: '@spee_ch'},\n {property: 'twitter:card', content: 'summary'},\n ];\n};\n\nconst createChannelMetaTags = (channel) => {\n const { name, longId } = channel;\n return [\n {property: 'og:title', content: `${name} on ${title}`},\n {property: 'og:url', content: `${host}/${name}:${longId}`},\n {property: 'og:site_name', content: title},\n {property: 'og:description', content: `${name}, a channel on ${title}`},\n {property: 'twitter:site', content: '@spee_ch'},\n {property: 'twitter:card', content: 'summary'},\n ];\n};\n\nconst createAssetMetaTags = (asset) => {\n const { claimData } = asset;\n const { contentType } = claimData;\n const embedUrl = `${host}/${claimData.claimId}/${claimData.name}`;\n const showUrl = `${host}/${claimData.claimId}/${claimData.name}`;\n const source = `${host}/${claimData.claimId}/${claimData.name}.${claimData.fileExt}`;\n const ogTitle = claimData.title || claimData.name;\n const ogDescription = claimData.description || defaultDescription;\n const ogThumbnailContentType = determineOgThumbnailContentType(claimData.thumbnail);\n const ogThumbnail = claimData.thumbnail || defaultThumbnail;\n const metaTags = [\n {property: 'og:title', content: ogTitle},\n {property: 'og:url', content: showUrl},\n {property: 'og:site_name', content: title},\n {property: 'og:description', content: ogDescription},\n {property: 'og:image:width', content: 600},\n {property: 'og:image:height', content: 315},\n {property: 'twitter:site', content: '@spee_ch'},\n ];\n if (contentType === 'video/mp4' || contentType === 'video/webm') {\n metaTags.push({property: 'og:video', content: source});\n metaTags.push({property: 'og:video:secure_url', content: source});\n metaTags.push({property: 'og:video:type', content: contentType});\n metaTags.push({property: 'og:image', content: ogThumbnail});\n metaTags.push({property: 'og:image:type', content: ogThumbnailContentType});\n metaTags.push({property: 'og:type', content: 'video'});\n metaTags.push({property: 'twitter:card', content: 'player'});\n metaTags.push({property: 'twitter:player', content: embedUrl});\n metaTags.push({property: 'twitter:player:width', content: 600});\n metaTags.push({property: 'twitter:text:player_width', content: 600});\n metaTags.push({property: 'twitter:player:height', content: 337});\n metaTags.push({property: 'twitter:player:stream', content: source});\n metaTags.push({property: 'twitter:player:stream:content_type', content: contentType});\n } else {\n metaTags.push({property: 'og:image', content: source});\n metaTags.push({property: 'og:image:type', content: contentType});\n metaTags.push({property: 'og:type', content: 'article'});\n metaTags.push({property: 'twitter:card', content: 'summary_large_image'});\n }\n return metaTags;\n};\n\nexport const createMetaTags = (asset, channel) => {\n if (asset) {\n return createAssetMetaTags(asset);\n };\n if (channel) {\n return createChannelMetaTags(channel);\n };\n return createBasicMetaTags();\n};\n\n\n\n// WEBPACK FOOTER //\n// ./react/utils/metaTags.js","const { site: { host } } = require('../../config/speechConfig.js');\n\nconst createBasicCanonicalLink = (page) => {\n if (!page) {\n return `${host}`;\n };\n return `${host}/${page}`;\n};\n\nconst createAssetCanonicalLink = (asset) => {\n let channelName, certificateId, name, claimId;\n if (asset.claimData) {\n ({ channelName, certificateId, name, claimId } = asset.claimData);\n };\n if (channelName) {\n return `${host}/${channelName}:${certificateId}/${name}`;\n };\n return `${host}/${claimId}/${name}`;\n};\n\nconst createChannelCanonicalLink = (channel) => {\n const { name, longId } = channel;\n return `${host}/${name}:${longId}`;\n};\n\nexport const createCanonicalLink = (asset, channel, page) => {\n if (asset) {\n return createAssetCanonicalLink(asset);\n }\n if (channel) {\n return createChannelCanonicalLink(channel);\n }\n if (page) {\n return createBasicCanonicalLink(page);\n }\n return createBasicCanonicalLink();\n};\n\n\n\n// WEBPACK FOOTER //\n// ./react/utils/canonicalLink.js","import React from 'react';\nimport { NavLink, withRouter } from 'react-router-dom';\nimport Logo from 'components/Logo';\nimport NavBarChannelDropdown from 'components/NavBarChannelOptionsDropdown';\nimport request from 'utils/request';\n\nconst VIEW = 'VIEW';\nconst LOGOUT = 'LOGOUT';\n\nclass NavBar extends React.Component {\n constructor (props) {\n super(props);\n this.checkForLoggedInUser = this.checkForLoggedInUser.bind(this);\n this.logoutUser = this.logoutUser.bind(this);\n this.handleSelection = this.handleSelection.bind(this);\n }\n componentDidMount () {\n // check to see if the user is already logged in\n this.checkForLoggedInUser();\n }\n checkForLoggedInUser () {\n const params = {credentials: 'include'};\n request('/user', params)\n .then(({ data }) => {\n this.props.onChannelLogin(data.channelName, data.shortChannelId, data.channelClaimId);\n })\n .catch(error => {\n console.log('/user error:', error.message);\n });\n }\n logoutUser () {\n const params = {credentials: 'include'};\n request('/logout', params)\n .then(() => {\n this.props.onChannelLogout();\n })\n .catch(error => {\n console.log('/logout error', error.message);\n });\n }\n handleSelection (event) {\n const value = event.target.selectedOptions[0].value;\n switch (value) {\n case LOGOUT:\n this.logoutUser();\n break;\n case VIEW:\n // redirect to channel page\n this.props.history.push(`/${this.props.channelName}:${this.props.channelLongId}`);\n break;\n default:\n break;\n }\n }\n render () {\n return (\n
\n
\n \n
\n Open-source, decentralized image and video sharing.\n
\n
\n Publish\n About\n { this.props.channelName ? (\n \n ) : (\n Channel\n )}\n
\n
\n
\n );\n }\n}\n\nexport default withRouter(NavBar);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/NavBar/view.jsx","import React from 'react';\nimport { Link } from 'react-router-dom';\n\nfunction Logo () {\n return (\n \n \n Logo\n Spee.ch logo\n \n \n \n Spee<h\n \n \n \n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default Logo;\n\n\n\n// WEBPACK FOOTER //\n// ./react/components/Logo/index.jsx","import React from 'react';\n\nfunction NavBarChannelDropdown ({ channelName, handleSelection, defaultSelection, VIEW, LOGOUT }) {\n return (\n \n );\n};\n\nexport default NavBarChannelDropdown;\n\n\n\n// WEBPACK FOOTER //\n// ./react/components/NavBarChannelOptionsDropdown/index.jsx","module.exports = require(\"cross-fetch/polyfill\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"cross-fetch/polyfill\"\n// module id = 90\n// module chunks = 0","import {connect} from 'react-redux';\nimport View from './view';\n\nconst mapStateToProps = ({ publish }) => {\n return {\n file : publish.file,\n status: publish.status.status,\n };\n};\n\nexport default connect(mapStateToProps, null)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/PublishTool/index.js","import React from 'react';\nimport Dropzone from 'containers/Dropzone';\nimport PublishDetails from 'containers/PublishDetails';\nimport PublishStatus from 'containers/PublishStatus';\n\nclass PublishTool extends React.Component {\n render () {\n if (this.props.file) {\n if (this.props.status) {\n return (\n \n );\n } else {\n return ;\n }\n } else {\n return ;\n }\n }\n};\n\nexport default PublishTool;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/PublishTool/view.jsx","import React from 'react';\nimport { validateFile } from 'utils/file';\nimport Preview from 'components/Preview';\n\nclass Dropzone extends React.Component {\n constructor (props) {\n super(props);\n this.state = {\n dragOver : false,\n mouseOver : false,\n dimPreview: false,\n };\n this.handleDrop = this.handleDrop.bind(this);\n this.handleDragOver = this.handleDragOver.bind(this);\n this.handleDragEnd = this.handleDragEnd.bind(this);\n this.handleDragEnter = this.handleDragEnter.bind(this);\n this.handleDragLeave = this.handleDragLeave.bind(this);\n this.handleMouseEnter = this.handleMouseEnter.bind(this);\n this.handleMouseLeave = this.handleMouseLeave.bind(this);\n this.handleClick = this.handleClick.bind(this);\n this.handleFileInput = this.handleFileInput.bind(this);\n this.chooseFile = this.chooseFile.bind(this);\n }\n handleDrop (event) {\n event.preventDefault();\n this.setState({dragOver: false});\n // if dropped items aren't files, reject them\n const dt = event.dataTransfer;\n if (dt.items) {\n if (dt.items[0].kind === 'file') {\n const droppedFile = dt.items[0].getAsFile();\n this.chooseFile(droppedFile);\n }\n }\n }\n handleDragOver (event) {\n event.preventDefault();\n }\n handleDragEnd (event) {\n var dt = event.dataTransfer;\n if (dt.items) {\n for (var i = 0; i < dt.items.length; i++) {\n dt.items.remove(i);\n }\n } else {\n event.dataTransfer.clearData();\n }\n }\n handleDragEnter () {\n this.setState({dragOver: true, dimPreview: true});\n }\n handleDragLeave () {\n this.setState({dragOver: false, dimPreview: false});\n }\n handleMouseEnter () {\n this.setState({mouseOver: true, dimPreview: true});\n }\n handleMouseLeave () {\n this.setState({mouseOver: false, dimPreview: false});\n }\n handleClick (event) {\n event.preventDefault();\n document.getElementById('file_input').click();\n }\n handleFileInput (event) {\n event.preventDefault();\n const fileList = event.target.files;\n this.chooseFile(fileList[0]);\n }\n chooseFile (file) {\n if (file) {\n try {\n validateFile(file); // validate the file's name, type, and size\n } catch (error) {\n return this.props.setFileError(error.message);\n }\n // stage it so it will be ready when the publish button is clicked\n this.props.selectFile(file);\n }\n }\n render () {\n return (\n
\n
\n \n
\n
\n {this.props.file ? (\n
\n \n
\n { this.state.dragOver ? (\n
\n

Drop it.

\n
\n ) : (\n null\n )}\n { this.state.mouseOver ? (\n
\n

{this.props.fileError}

\n

Drag & drop image or video here to publish

\n

OR

\n

CHOOSE FILE

\n
\n ) : (\n null\n )}\n
\n
\n ) : (\n
\n { this.state.dragOver ? (\n
\n

Drop it.

\n
\n ) : (\n
\n

{this.props.fileError}

\n

Drag & drop image or video here to publish

\n

OR

\n

CHOOSE FILE

\n
\n )}\n
\n )}\n
\n
\n );\n }\n};\n\nexport default Dropzone;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/Dropzone/view.jsx","module.exports = {\n validateFile (file) {\n if (!file) {\n throw new Error('no file provided');\n }\n if (/'/.test(file.name)) {\n throw new Error('apostrophes are not allowed in the file name');\n }\n // validate size and type\n switch (file.type) {\n case 'image/jpeg':\n case 'image/jpg':\n case 'image/png':\n if (file.size > 10000000) {\n throw new Error('Sorry, images are limited to 10 megabytes.');\n }\n break;\n case 'image/gif':\n if (file.size > 50000000) {\n throw new Error('Sorry, GIFs are limited to 50 megabytes.');\n }\n break;\n case 'video/mp4':\n if (file.size > 50000000) {\n throw new Error('Sorry, videos are limited to 50 megabytes.');\n }\n break;\n default:\n throw new Error(file.type + ' is not a supported file type. Only, .jpeg, .png, .gif, and .mp4 files are currently supported.');\n }\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./react/utils/file.js","import React from 'react';\nimport PropTypes from 'prop-types';\n\nclass Preview extends React.Component {\n constructor (props) {\n super(props);\n this.state = {\n imgSource : '',\n defaultThumbnail: '/assets/img/video_thumb_default.png',\n };\n }\n componentDidMount () {\n this.setPreviewImageSource(this.props.file);\n }\n componentWillReceiveProps (newProps) {\n if (newProps.file !== this.props.file) {\n this.setPreviewImageSource(newProps.file);\n }\n if (newProps.thumbnail !== this.props.thumbnail) {\n if (newProps.thumbnail) {\n this.setPreviewImageSourceFromFile(newProps.thumbnail);\n } else {\n this.setState({imgSource: this.state.defaultThumbnail});\n }\n }\n }\n setPreviewImageSourceFromFile (file) {\n const previewReader = new FileReader();\n previewReader.readAsDataURL(file);\n previewReader.onloadend = () => {\n this.setState({imgSource: previewReader.result});\n };\n }\n setPreviewImageSource (file) {\n if (file.type !== 'video/mp4') {\n this.setPreviewImageSourceFromFile(file);\n } else {\n if (this.props.thumbnail) {\n this.setPreviewImageSourceFromFile(this.props.thumbnail);\n }\n this.setState({imgSource: this.state.defaultThumbnail});\n }\n }\n render () {\n return (\n \n );\n }\n};\n\nPreview.propTypes = {\n dimPreview: PropTypes.bool.isRequired,\n file : PropTypes.object.isRequired,\n thumbnail : PropTypes.object,\n};\n\nexport default Preview;\n\n\n\n// WEBPACK FOOTER //\n// ./react/components/Preview/index.jsx","import {connect} from 'react-redux';\nimport {clearFile, startPublish} from 'actions/publish';\nimport View from './view';\n\nconst mapStateToProps = ({ channel, publish }) => {\n return {\n file: publish.file,\n };\n};\n\nconst mapDispatchToProps = {\n clearFile,\n startPublish,\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/PublishDetails/index.js","import React from 'react';\nimport { withRouter } from 'react-router-dom';\nimport Dropzone from 'containers/Dropzone';\nimport PublishTitleInput from 'containers/PublishTitleInput';\nimport PublishUrlInput from 'containers/PublishUrlInput';\nimport PublishThumbnailInput from 'containers/PublishThumbnailInput';\nimport PublishMetadataInputs from 'containers/PublishMetadataInputs';\nimport ChannelSelect from 'containers/ChannelSelect';\n\nclass PublishDetails extends React.Component {\n constructor (props) {\n super(props)\n this.onPublishSubmit = this.onPublishSubmit.bind(this);\n }\n onPublishSubmit () {\n this.props.startPublish(this.props.history);\n }\n render () {\n return (\n
\n
\n \n
\n {/* left column */}\n
\n
\n \n
\n
\n {/* right column */}\n
\n
\n
\n \n
\n
\n \n
\n { (this.props.file.type === 'video/mp4') && (\n
\n \n
\n )}\n
\n \n
\n
\n \n
\n
\n \n
\n
\n

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. Read more.

\n
\n
\n
\n
\n );\n }\n};\n\nexport default withRouter(PublishDetails);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/PublishDetails/view.jsx","import {connect} from 'react-redux';\nimport {updateMetadata} from 'actions/publish';\nimport View from './view';\n\nconst mapStateToProps = ({ publish }) => {\n return {\n title: publish.metadata.title,\n };\n};\n\nconst mapDispatchToProps = dispatch => {\n return {\n onMetadataChange: (name, value) => {\n dispatch(updateMetadata(name, value));\n },\n };\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/PublishTitleInput/index.js","import React from 'react';\n\nclass PublishTitleInput extends React.Component {\n constructor (props) {\n super(props);\n this.handleInput = this.handleInput.bind(this);\n }\n handleInput (e) {\n const name = e.target.name;\n const value = e.target.value;\n this.props.onMetadataChange(name, value);\n }\n render () {\n return (\n \n );\n }\n}\n\nexport default PublishTitleInput;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/PublishTitleInput/view.jsx","import {updateClaim, updateError} from 'actions/publish';\nimport {connect} from 'react-redux';\nimport View from './view';\n\nconst mapStateToProps = ({ channel, publish }) => {\n return {\n loggedInChannelName : channel.loggedInChannel.name,\n loggedInChannelShortId: channel.loggedInChannel.shortId,\n fileName : publish.file.name,\n publishInChannel : publish.publishInChannel,\n selectedChannel : publish.selectedChannel,\n claim : publish.claim,\n urlError : publish.error.url,\n };\n};\n\nconst mapDispatchToProps = dispatch => {\n return {\n onClaimChange: (value) => {\n dispatch(updateClaim(value));\n dispatch(updateError('publishSubmit', null));\n },\n onUrlError: (value) => {\n dispatch(updateError('url', value));\n },\n };\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/PublishUrlInput/index.js","import React from 'react';\nimport request from 'utils/request';\nimport UrlMiddle from 'components/PublishUrlMiddleDisplay';\n\nclass PublishUrlInput extends React.Component {\n constructor (props) {\n super(props);\n this.handleInput = this.handleInput.bind(this);\n }\n componentDidMount () {\n const { claim, fileName } = this.props;\n if (!claim) {\n this.setClaimName(fileName);\n }\n }\n componentWillReceiveProps ({ claim, fileName }) {\n // if a new file was chosen, update the claim name\n if (fileName !== this.props.fileName) {\n return this.setClaimName(fileName);\n }\n // if the claim has updated, check its availability\n if (claim !== this.props.claim) {\n this.validateClaim(claim);\n }\n }\n handleInput (event) {\n let value = event.target.value;\n value = this.cleanseInput(value);\n // update the state\n this.props.onClaimChange(value);\n }\n cleanseInput (input) {\n input = input.replace(/\\s+/g, '-'); // replace spaces with dashes\n input = input.replace(/[^A-Za-z0-9-]/g, ''); // remove all characters that are not A-Z, a-z, 0-9, or '-'\n return input;\n }\n setClaimName (fileName) {\n const fileNameWithoutEnding = fileName.substring(0, fileName.lastIndexOf('.'));\n const cleanClaimName = this.cleanseInput(fileNameWithoutEnding);\n this.props.onClaimChange(cleanClaimName);\n }\n validateClaim (claim) {\n if (!claim) {\n return this.props.onUrlError('Enter a url above');\n }\n request(`/api/claim/availability/${claim}`)\n .then(() => {\n this.props.onUrlError(null);\n })\n .catch((error) => {\n this.props.onUrlError(error.message);\n });\n }\n render () {\n const { claim, loggedInChannelName, loggedInChannelShortId, publishInChannel, selectedChannel, urlError } = this.props;\n return (\n
\n
\n spee.ch / \n \n \n { (claim && !urlError) && {'\\u2713'} }\n { urlError && {'\\u2716'} }\n
\n
\n { urlError ? (\n

{urlError}

\n ) : (\n

Choose a custom url

\n )}\n
\n
\n );\n }\n}\n\nexport default PublishUrlInput;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/PublishUrlInput/view.jsx","import React from 'react';\nimport PropTypes from 'prop-types';\n\nfunction UrlMiddle ({publishInChannel, selectedChannel, loggedInChannelName, loggedInChannelShortId}) {\n if (publishInChannel) {\n if (selectedChannel === loggedInChannelName) {\n return {loggedInChannelName}:{loggedInChannelShortId} /;\n }\n return @channelSelect a channel below /;\n }\n return (\n xyzThis will be a random id /\n );\n}\n\nUrlMiddle.propTypes = {\n publishInChannel : PropTypes.bool.isRequired,\n loggedInChannelName : PropTypes.string,\n loggedInChannelShortId: PropTypes.string,\n};\n\nexport default UrlMiddle;\n\n\n\n// WEBPACK FOOTER //\n// ./react/components/PublishUrlMiddleDisplay/index.jsx","import { connect } from 'react-redux';\nimport { onNewThumbnail } from 'actions/publish';\nimport View from './view';\n\nconst mapStateToProps = ({ publish: { file } }) => {\n return {\n file,\n };\n};\n\nconst mapDispatchToProps = {\n onNewThumbnail,\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/PublishThumbnailInput/index.js","import React from 'react';\n\nfunction dataURItoBlob(dataURI) {\n // convert base64/URLEncoded data component to raw binary data held in a string\n let byteString = atob(dataURI.split(',')[1]);\n // separate out the mime component\n let mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];\n // write the bytes of the string to a typed array\n let ia = new Uint8Array(byteString.length);\n for (let i = 0; i < byteString.length; i++) {\n ia[i] = byteString.charCodeAt(i);\n }\n return new Blob([ia], {type: mimeString});\n}\n\nclass PublishThumbnailInput extends React.Component {\n constructor (props) {\n super(props);\n this.state = {\n videoSource : null,\n error : null,\n sliderMinRange: 1,\n sliderMaxRange: null,\n sliderValue : null,\n };\n this.handleVideoLoadedData = this.handleVideoLoadedData.bind(this);\n this.handleSliderChange = this.handleSliderChange.bind(this);\n this.createThumbnail = this.createThumbnail.bind(this);\n }\n componentDidMount () {\n const { file } = this.props;\n this.setVideoSource(file);\n }\n componentWillReceiveProps (nextProps) {\n // if file changes\n if (nextProps.file && nextProps.file !== this.props.file) {\n const { file } = nextProps;\n this.setVideoSource(file);\n };\n }\n setVideoSource (file) {\n const previewReader = new FileReader();\n previewReader.readAsDataURL(file);\n previewReader.onloadend = () => {\n const dataUri = previewReader.result;\n const blob = dataURItoBlob(dataUri);\n const videoSource = URL.createObjectURL(blob);\n this.setState({ videoSource });\n };\n }\n handleVideoLoadedData (event) {\n const duration = event.target.duration;\n const totalMinutes = Math.floor(duration / 60);\n const totalSeconds = Math.floor(duration % 60);\n // set the slider\n this.setState({\n sliderMaxRange: duration * 100,\n sliderValue : duration * 100 / 2,\n totalMinutes,\n totalSeconds,\n });\n // update the current time of the video\n let video = document.getElementById('video-thumb-player');\n video.currentTime = duration / 2;\n }\n handleSliderChange (event) {\n const value = parseInt(event.target.value);\n // update the slider value\n this.setState({\n sliderValue: value,\n });\n // update the current time of the video\n let video = document.getElementById('video-thumb-player');\n video.currentTime = value / 100;\n }\n createThumbnail () {\n // take a snapshot\n let video = document.getElementById('video-thumb-player');\n let canvas = document.createElement('canvas');\n canvas.width = video.videoWidth;\n canvas.height = video.videoHeight;\n canvas.getContext('2d').drawImage(video, 0, 0, canvas.width, canvas.height);\n const dataUrl = canvas.toDataURL();\n const blob = dataURItoBlob(dataUrl);\n const snapshot = new File([blob], `thumbnail.png`, {\n type: 'image/png',\n });\n // set the thumbnail in redux store\n if (snapshot) {\n this.props.onNewThumbnail(snapshot);\n }\n }\n render () {\n const { error, videoSource, sliderMinRange, sliderMaxRange, sliderValue, totalMinutes, totalSeconds } = this.state;\n return (\n
\n \n \n {\n sliderValue ? (\n
\n
\n 0'00\"\n {totalMinutes}'{totalSeconds}\"\n
\n
\n \n
\n
\n ) : (\n

loading...

\n )\n }\n { error ? (\n

{error}

\n ) : (\n

Use slider to set thumbnail

\n )}\n
\n );\n }\n}\n\nexport default PublishThumbnailInput;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/PublishThumbnailInput/view.jsx","import {connect} from 'react-redux';\nimport {updateMetadata, toggleMetadataInputs} from 'actions/publish';\nimport View from './view';\n\nconst mapStateToProps = ({ publish }) => {\n return {\n showMetadataInputs: publish.showMetadataInputs,\n description : publish.metadata.description,\n license : publish.metadata.license,\n nsfw : publish.metadata.nsfw,\n };\n};\n\nconst mapDispatchToProps = dispatch => {\n return {\n onMetadataChange: (name, value) => {\n dispatch(updateMetadata(name, value));\n },\n onToggleMetadataInputs: (value) => {\n dispatch(toggleMetadataInputs(value));\n },\n };\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/PublishMetadataInputs/index.js","import React from 'react';\nimport ExpandingTextArea from 'components/ExpandingTextArea';\n\nclass PublishMetadataInputs extends React.Component {\n constructor (props) {\n super(props);\n this.toggleShowInputs = this.toggleShowInputs.bind(this);\n this.handleInput = this.handleInput.bind(this);\n this.handleSelect = this.handleSelect.bind(this);\n }\n toggleShowInputs () {\n this.props.onToggleMetadataInputs(!this.props.showMetadataInputs);\n }\n handleInput (event) {\n const target = event.target;\n const value = target.type === 'checkbox' ? target.checked : target.value;\n const name = target.name;\n this.props.onMetadataChange(name, value);\n }\n handleSelect (event) {\n const name = event.target.name;\n const selectedOption = event.target.selectedOptions[0].value;\n this.props.onMetadataChange(name, selectedOption);\n }\n render () {\n return (\n
\n {this.props.showMetadataInputs && (\n
\n
\n
\n \n
\n \n
\n
\n\n
\n
\n \n
\n \n
\n
\n\n
\n
\n \n
\n \n
\n
\n
\n )}\n \n
\n );\n }\n}\n\nexport default PublishMetadataInputs;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/PublishMetadataInputs/view.jsx","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n\nclass ExpandingTextarea extends Component {\n constructor (props) {\n super(props);\n this._handleChange = this._handleChange.bind(this);\n }\n componentDidMount () {\n this.adjustTextarea({});\n }\n _handleChange (event) {\n const { onChange } = this.props;\n if (onChange) onChange(event);\n this.adjustTextarea(event);\n }\n adjustTextarea ({ target = this.el }) {\n target.style.height = 0;\n target.style.height = `${target.scrollHeight}px`;\n }\n render () {\n const { ...rest } = this.props;\n return (\n this.el = x}\n onChange={this._handleChange}\n />\n );\n }\n}\n\nExpandingTextarea.propTypes = {\n onChange: PropTypes.func,\n};\n\nexport default ExpandingTextarea;\n\n\n\n// WEBPACK FOOTER //\n// ./react/components/ExpandingTextArea/index.jsx","import {connect} from 'react-redux';\nimport {setPublishInChannel, updateSelectedChannel, updateError} from 'actions/publish';\nimport View from './view';\n\nconst mapStateToProps = ({ channel, publish }) => {\n return {\n loggedInChannelName: channel.loggedInChannel.name,\n publishInChannel : publish.publishInChannel,\n selectedChannel : publish.selectedChannel,\n channelError : publish.error.channel,\n };\n};\n\nconst mapDispatchToProps = dispatch => {\n return {\n onPublishInChannelChange: (value) => {\n dispatch(updateError('channel', null));\n dispatch(setPublishInChannel(value));\n },\n onChannelSelect: (value) => {\n dispatch(updateError('channel', null));\n dispatch(updateSelectedChannel(value));\n },\n };\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/ChannelSelect/index.js","import React from 'react';\nimport ChannelLoginForm from 'containers/ChannelLoginForm';\nimport ChannelCreateForm from 'containers/ChannelCreateForm';\nimport * as states from 'constants/publish_channel_select_states';\n\nclass ChannelSelect extends React.Component {\n constructor (props) {\n super(props);\n this.toggleAnonymousPublish = this.toggleAnonymousPublish.bind(this);\n this.handleSelection = this.handleSelection.bind(this);\n }\n toggleAnonymousPublish (event) {\n const value = event.target.value;\n if (value === 'anonymous') {\n this.props.onPublishInChannelChange(false);\n } else {\n this.props.onPublishInChannelChange(true);\n }\n }\n handleSelection (event) {\n const selectedOption = event.target.selectedOptions[0].value;\n this.props.onChannelSelect(selectedOption);\n }\n render () {\n return (\n
\n
\n
\n \n \n
\n
\n \n \n
\n { this.props.channelError ? (\n

{this.props.channelError}

\n ) : (\n

Publish anonymously or in a channel

\n )}\n
\n { this.props.publishInChannel && (\n
\n
\n \n
\n \n
\n { (this.props.selectedChannel === states.LOGIN) && }\n { (this.props.selectedChannel === states.CREATE) && }\n
\n )}\n
\n );\n }\n}\n\nexport default ChannelSelect;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/ChannelSelect/view.jsx","import React from 'react';\nimport request from 'utils/request';\n\nclass ChannelLoginForm extends React.Component {\n constructor (props) {\n super(props);\n this.state = {\n error : null,\n name : '',\n password: '',\n };\n this.handleInput = this.handleInput.bind(this);\n this.loginToChannel = this.loginToChannel.bind(this);\n }\n handleInput (event) {\n const name = event.target.name;\n const value = event.target.value;\n this.setState({[name]: value});\n }\n loginToChannel (event) {\n event.preventDefault();\n const params = {\n method : 'POST',\n body : JSON.stringify({username: this.state.name, password: this.state.password}),\n headers: new Headers({\n 'Content-Type': 'application/json',\n }),\n credentials: 'include',\n };\n request('login', params)\n .then(({success, channelName, shortChannelId, channelClaimId, message}) => {\n if (success) {\n this.props.onChannelLogin(channelName, shortChannelId, channelClaimId);\n } else {\n this.setState({'error': message});\n };\n })\n .catch(error => {\n if (error.message) {\n this.setState({'error': error.message});\n } else {\n this.setState({'error': error});\n }\n });\n }\n render () {\n return (\n
\n
\n
\n \n
\n
\n @\n \n
\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n { this.state.error ? (\n

{this.state.error}

\n ) : (\n

Enter the name and password for your channel

\n )}\n
\n \n
\n
\n );\n }\n}\n\nexport default ChannelLoginForm;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/ChannelLoginForm/view.jsx","import React from 'react';\nimport ProgressBar from 'components/ProgressBar';\nimport request from 'utils/request';\n\nclass ChannelCreateForm extends React.Component {\n constructor (props) {\n super(props);\n this.state = {\n error : null,\n channel : '',\n password: '',\n status : null,\n };\n this.handleChannelInput = this.handleChannelInput.bind(this);\n this.handleInput = this.handleInput.bind(this);\n this.createChannel = this.createChannel.bind(this);\n }\n cleanseChannelInput (input) {\n input = input.replace(/\\s+/g, '-'); // replace spaces with dashes\n input = input.replace(/[^A-Za-z0-9-]/g, ''); // remove all characters that are not A-Z, a-z, 0-9, or '-'\n return input;\n }\n handleChannelInput (event) {\n let value = event.target.value;\n value = this.cleanseChannelInput(value);\n this.setState({channel: value});\n if (value) {\n this.updateIsChannelAvailable(value);\n } else {\n this.setState({error: 'Please enter a channel name'});\n }\n }\n handleInput (event) {\n const name = event.target.name;\n const value = event.target.value;\n this.setState({[name]: value});\n }\n updateIsChannelAvailable (channel) {\n const channelWithAtSymbol = `@${channel}`;\n request(`/api/channel/availability/${channelWithAtSymbol}`)\n .then(isAvailable => {\n if (isAvailable) {\n this.setState({'error': null});\n } else {\n this.setState({'error': 'That channel has already been claimed'});\n }\n })\n .catch((error) => {\n this.setState({'error': error.message});\n });\n }\n checkIsChannelAvailable (channel) {\n const channelWithAtSymbol = `@${channel}`;\n return new Promise((resolve, reject) => {\n request(`/api/channel/availability/${channelWithAtSymbol}`)\n .then(isAvailable => {\n if (!isAvailable) {\n return reject(new Error('That channel has already been claimed'));\n }\n resolve();\n })\n .catch((error) => {\n reject(error);\n });\n });\n }\n checkIsPasswordProvided () {\n const password = this.state.password;\n return new Promise((resolve, reject) => {\n if (!password || password.length < 1) {\n return reject(new Error('Please provide a password'));\n }\n resolve();\n });\n }\n makePublishChannelRequest (username, password) {\n const params = {\n method : 'POST',\n body : JSON.stringify({username, password}),\n headers: new Headers({\n 'Content-Type': 'application/json',\n }),\n credentials: 'include',\n };\n return new Promise((resolve, reject) => {\n request('/signup', params)\n .then(result => {\n return resolve(result);\n })\n .catch(error => {\n reject(new Error(`Unfortunately, we encountered an error while creating your channel. Please let us know in Discord! ${error.message}`));\n });\n });\n }\n createChannel (event) {\n event.preventDefault();\n this.checkIsPasswordProvided()\n .then(() => {\n return this.checkIsChannelAvailable(this.state.channel, this.state.password);\n })\n .then(() => {\n this.setState({status: 'We are publishing your new channel. Sit tight...'});\n return this.makePublishChannelRequest(this.state.channel, this.state.password);\n })\n .then(result => {\n this.setState({status: null});\n this.props.onChannelLogin(result.channelName, result.shortChannelId, result.channelClaimId);\n })\n .catch((error) => {\n this.setState({'error': error.message, status: null});\n });\n }\n render () {\n return (\n
\n { !this.state.status ? (\n
\n
\n
\n \n
\n
\n @\n \n { (this.state.channel && !this.state.error) && {'\\u2713'} }\n { this.state.error && {'\\u2716'} }\n
\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n {this.state.error ? (\n

{this.state.error}

\n ) : (\n

Choose a name and password for your channel

\n )}\n
\n \n
\n
\n ) : (\n
\n

{this.state.status}

\n \n
\n )}\n
\n );\n }\n}\n\nexport default ChannelCreateForm;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/ChannelCreateForm/view.jsx","import React from 'react';\n\nconst ActiveStatusBar = () => {\n return | ;\n};\n\nexport default ActiveStatusBar;\n\n\n\n// WEBPACK FOOTER //\n// ./react/components/ActiveStatusBar/index.jsx","import React from 'react';\n\nconst InactiveStatusBar = () => {\n return | ;\n};\n\nexport default InactiveStatusBar;\n\n\n\n// WEBPACK FOOTER //\n// ./react/components/InactiveStatusBar/index.jsx","import {connect} from 'react-redux';\nimport {clearFile} from 'actions/publish';\nimport View from './view';\n\nconst mapStateToProps = ({ publish }) => {\n return {\n status : publish.status.status,\n message: publish.status.message,\n };\n};\n\nconst mapDispatchToProps = {\n clearFile,\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/PublishStatus/index.js","import React from 'react';\nimport ProgressBar from 'components/ProgressBar';\nimport * as publishStates from 'constants/publish_claim_states';\n\nclass PublishStatus extends React.Component {\n render () {\n const { status, message, clearFile } = this.props;\n return (\n
\n {status === publishStates.LOAD_START &&\n
\n

File is loading to server

\n

0%

\n
\n }\n {status === publishStates.LOADING &&\n
\n
\n

File is loading to server

\n

{message}

\n
\n
\n }\n {status === publishStates.PUBLISHING &&\n
\n

Upload complete. Your file is now being published on the blockchain...

\n \n

Curious what magic is happening here? Learn more.

\n
\n }\n {status === publishStates.SUCCESS &&\n
\n

Your publish is complete! You are being redirected to it now.

\n

If you are not automatically redirected, click here.

\n
\n }\n {status === publishStates.FAILED &&\n
\n

Something went wrong...

\n

{message}

\n

For help, post the above error text in the #speech channel on the lbry discord

\n \n
\n }\n
\n );\n }\n};\n\nexport default PublishStatus;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/PublishStatus/view.jsx","export const LOAD_START = 'LOAD_START';\nexport const LOADING = 'LOADING';\nexport const PUBLISHING = 'PUBLISHING';\nexport const SUCCESS = 'SUCCESS';\nexport const FAILED = 'FAILED';\n\n\n\n// WEBPACK FOOTER //\n// ./react/constants/publish_claim_states.js","import React from 'react';\nimport NavBar from 'containers/NavBar';\nimport SEO from 'components/SEO';\n\nclass AboutPage extends React.Component {\n render () {\n return (\n
\n \n \n
\n
\n
\n

Spee.ch is an open-source project. Please contribute to the existing site, or fork it and make your own.

\n

TWITTER

\n

GITHUB

\n

DISCORD CHANNEL

\n

DOCUMENTATION

\n
\n
\n
\n

Spee.ch is a media-hosting site that reads from and publishes content to the LBRY blockchain.

\n

Spee.ch is a hosting service, but with the added benefit that it stores your content on a decentralized network of computers -- the LBRY network. This means that your images are stored in multiple locations without a single point of failure.

\n

Contribute

\n

If you have an idea for your own spee.ch-like site on top of LBRY, fork our github repo and go to town!

\n

If you want to improve spee.ch, join our discord channel or solve one of our github issues.

\n
\n
\n
\n
\n );\n }\n};\n\nexport default AboutPage;\n\n\n\n// WEBPACK FOOTER //\n// ./react/components/AboutPage/index.jsx","import {connect} from 'react-redux';\nimport View from './view';\n\nconst mapStateToProps = ({ channel }) => {\n return {\n loggedInChannelName: channel.loggedInChannel.name,\n };\n};\n\nexport default connect(mapStateToProps, null)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/LoginPage/index.js","import React from 'react';\nimport { withRouter } from 'react-router-dom';\nimport SEO from 'components/SEO';\nimport NavBar from 'containers/NavBar';\nimport ChannelLoginForm from 'containers/ChannelLoginForm';\nimport ChannelCreateForm from 'containers/ChannelCreateForm';\n\nclass LoginPage extends React.Component {\n componentWillReceiveProps (newProps) {\n // re-route the user to the homepage if the user is logged in\n if (newProps.loggedInChannelName !== this.props.loggedInChannelName) {\n this.props.history.push(`/`);\n }\n }\n render () {\n return (\n
\n \n \n
\n
\n
\n

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 documenting important events, or making a public repository for cat gifs (password: '1234'), try creating a channel for it!

\n
\n
\n
\n

Log in to an existing channel:

\n \n

Create a brand new channel:

\n \n
\n
\n
\n
\n );\n }\n};\n\nexport default withRouter(LoginPage);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/LoginPage/view.jsx","import { connect } from 'react-redux';\nimport { onHandleShowPageUri } from 'actions/show';\nimport View from './view';\n\nconst mapStateToProps = ({ show }) => {\n return {\n error : show.request.error,\n requestType: show.request.type,\n };\n};\n\nconst mapDispatchToProps = {\n onHandleShowPageUri,\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/ShowPage/index.js","import React from 'react';\nimport ErrorPage from 'components/ErrorPage';\nimport ShowAssetLite from 'containers/ShowAssetLite';\nimport ShowAssetDetails from 'containers/ShowAssetDetails';\nimport ShowChannel from 'containers/ShowChannel';\n\nimport { CHANNEL, ASSET_LITE, ASSET_DETAILS } from 'constants/show_request_types';\n\nclass ShowPage extends React.Component {\n componentDidMount () {\n this.props.onHandleShowPageUri(this.props.match.params);\n }\n componentWillReceiveProps (nextProps) {\n if (nextProps.match.params !== this.props.match.params) {\n this.props.onHandleShowPageUri(nextProps.match.params);\n }\n }\n render () {\n const { error, requestType } = this.props;\n if (error) {\n return (\n \n );\n }\n switch (requestType) {\n case CHANNEL:\n return ;\n case ASSET_LITE:\n return ;\n case ASSET_DETAILS:\n return ;\n default:\n return

loading...

;\n }\n }\n};\n\nexport default ShowPage;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/ShowPage/view.jsx","import { connect } from 'react-redux';\nimport View from './view';\n\nconst mapStateToProps = ({ show }) => {\n // select request info\n const requestId = show.request.id;\n // select asset info\n let asset;\n const request = show.requestList[requestId] || null;\n const assetList = show.assetList;\n if (request && assetList) {\n const assetKey = request.key; // note: just store this in the request\n asset = assetList[assetKey] || null;\n };\n // return props\n return {\n asset,\n };\n};\n\nexport default connect(mapStateToProps, null)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/ShowAssetLite/index.js","import React from 'react';\nimport SEO from 'components/SEO';\nimport { Link } from 'react-router-dom';\nimport AssetDisplay from 'containers/AssetDisplay';\n\nclass ShowLite extends React.Component {\n render () {\n const { asset } = this.props;\n if (asset) {\n const { name, claimId } = asset.claimData;\n return (\n
\n \n \n hosted\n via Spee.ch\n
\n );\n }\n return (\n
\n

loading asset data...

\n
\n );\n }\n};\n\nexport default ShowLite;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/ShowAssetLite/view.jsx","import React from 'react';\nimport ProgressBar from 'components/ProgressBar';\nimport { LOCAL_CHECK, UNAVAILABLE, ERROR, AVAILABLE } from 'constants/asset_display_states';\n\nclass AssetDisplay extends React.Component {\n componentDidMount () {\n const { asset: { claimData: { name, claimId } } } = this.props;\n this.props.onFileRequest(name, claimId);\n }\n render () {\n const { status, error, asset: { claimData: { name, claimId, contentType, fileExt, thumbnail } } } = this.props;\n return (\n
\n {(status === LOCAL_CHECK) &&\n
\n

Checking to see if Spee.ch has your asset locally...

\n
\n }\n {(status === UNAVAILABLE) &&\n
\n

Sit tight, we're searching the LBRY blockchain for your asset!

\n \n

Curious what magic is happening here? Learn more.

\n
\n }\n {(status === ERROR) &&\n
\n

Unfortunately, we couldn't download your asset from LBRY. You can help us out by sharing the below error message in the LBRY discord.

\n

{error}

\n
\n }\n {(status === AVAILABLE) &&\n (() => {\n switch (contentType) {\n case 'image/jpeg':\n case 'image/jpg':\n case 'image/png':\n return (\n \n );\n case 'image/gif':\n return (\n \n );\n case 'video/mp4':\n return (\n \n );\n default:\n return (\n

Unsupported file type

\n );\n }\n })()\n }\n
\n );\n }\n};\n\nexport default AssetDisplay;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/AssetDisplay/view.jsx","import { connect } from 'react-redux';\nimport View from './view';\n\nconst mapStateToProps = ({ show }) => {\n // select request info\n const requestId = show.request.id;\n // select asset info\n let asset;\n const request = show.requestList[requestId] || null;\n const assetList = show.assetList;\n if (request && assetList) {\n const assetKey = request.key; // note: just store this in the request\n asset = assetList[assetKey] || null;\n };\n // return props\n return {\n asset,\n };\n};\n\nexport default connect(mapStateToProps, null)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/ShowAssetDetails/index.js","import React from 'react';\nimport SEO from 'components/SEO';\nimport NavBar from 'containers/NavBar';\nimport ErrorPage from 'components/ErrorPage';\nimport AssetTitle from 'containers/AssetTitle';\nimport AssetDisplay from 'containers/AssetDisplay';\nimport AssetInfo from 'containers/AssetInfo';\n\nclass ShowAssetDetails extends React.Component {\n render () {\n const { asset } = this.props;\n if (asset) {\n const { claimData: { name } } = asset;\n return (\n
\n \n \n
\n
\n \n
\n
\n
\n \n
\n
\n
\n \n
\n
\n
\n }\n
\n );\n };\n return (\n \n );\n }\n};\n\nexport default ShowAssetDetails;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/ShowAssetDetails/view.jsx","import { connect } from 'react-redux';\nimport View from './view';\nimport { selectAsset } from 'selectors/show';\n\nconst mapStateToProps = ({ show }) => {\n const { claimData: { title } } = selectAsset(show);\n return {\n title,\n };\n};\n\nexport default connect(mapStateToProps, null)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/AssetTitle/index.js","import React from 'react';\n\nconst AssetTitle = ({ title }) => {\n return (\n
\n {title}\n
\n );\n};\n\nexport default AssetTitle;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/AssetTitle/view.jsx","import { connect } from 'react-redux';\nimport View from './view';\nimport { selectAsset } from 'selectors/show';\n\nconst mapStateToProps = ({ show }) => {\n // select asset\n const asset = selectAsset(show);\n // return props\n return {\n asset,\n };\n};\n\nexport default connect(mapStateToProps, null)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/AssetInfo/index.js","import React from 'react';\nimport { Link } from 'react-router-dom';\n\nclass AssetInfo extends React.Component {\n constructor (props) {\n super(props);\n this.copyToClipboard = this.copyToClipboard.bind(this);\n }\n copyToClipboard (event) {\n var elementToCopy = event.target.dataset.elementtocopy;\n var element = document.getElementById(elementToCopy);\n element.select();\n try {\n document.execCommand('copy');\n } catch (err) {\n this.setState({error: 'Oops, unable to copy'});\n }\n }\n render () {\n const { asset: { shortId, claimData : { channelName, certificateId, description, name, claimId, fileExt, contentType, thumbnail, host } } } = this.props;\n return (\n
\n {channelName &&\n
\n
\n Channel:\n
\n
\n {channelName}\n
\n
\n }\n\n {description &&\n
\n {description}\n
\n }\n\n
\n
\n
\n Share:\n
\n
\n \n twitter\n facebook\n tumblr\n reddit\n
\n
\n
\n
\n\n
\n \n );\n }\n};\n\nexport default AssetInfo;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/AssetInfo/view.jsx","import { connect } from 'react-redux';\nimport View from './view';\n\nconst mapStateToProps = ({ show }) => {\n // select request info\n const requestId = show.request.id;\n // select request\n const previousRequest = show.requestList[requestId] || null;\n // select channel\n let channel;\n if (previousRequest) {\n const channelKey = previousRequest.key;\n channel = show.channelList[channelKey] || null;\n }\n return {\n channel,\n };\n};\n\nexport default connect(mapStateToProps, null)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/ShowChannel/index.js","import React from 'react';\nimport SEO from 'components/SEO';\nimport ErrorPage from 'components/ErrorPage';\nimport NavBar from 'containers/NavBar';\nimport ChannelClaimsDisplay from 'containers/ChannelClaimsDisplay';\n\nclass ShowChannel extends React.Component {\n render () {\n const { channel } = this.props;\n if (channel) {\n const { name, longId, shortId } = channel;\n return (\n
\n \n \n
\n
\n

channel name: {name}

\n

full channel id: {longId}

\n

short channel id: {shortId}

\n
\n
\n \n
\n
\n
\n );\n };\n return (\n \n );\n }\n};\n\nexport default ShowChannel;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/ShowChannel/view.jsx","import { connect } from 'react-redux';\nimport { onUpdateChannelClaims } from 'actions/show';\nimport View from './view';\n\nconst mapStateToProps = ({ show }) => {\n // select channel key\n const request = show.requestList[show.request.id];\n const channelKey = request.key;\n // select channel claims\n const channel = show.channelList[channelKey] || null;\n // return props\n return {\n channelKey,\n channel,\n };\n};\n\nconst mapDispatchToProps = {\n onUpdateChannelClaims,\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/ChannelClaimsDisplay/index.js","import React from 'react';\nimport AssetPreview from 'components/AssetPreview';\n\nclass ChannelClaimsDisplay extends React.Component {\n constructor (props) {\n super(props);\n this.showNextResultsPage = this.showNextResultsPage.bind(this);\n this.showPreviousResultsPage = this.showPreviousResultsPage.bind(this);\n }\n showPreviousResultsPage () {\n const { channel: { claimsData: { currentPage } } } = this.props;\n const previousPage = parseInt(currentPage) - 1;\n this.showNewPage(previousPage);\n }\n showNextResultsPage () {\n const { channel: { claimsData: { currentPage } } } = this.props;\n const nextPage = parseInt(currentPage) + 1;\n this.showNewPage(nextPage);\n }\n showNewPage (page) {\n const { channelKey, channel: { name, longId } } = this.props;\n this.props.onUpdateChannelClaims(channelKey, name, longId, page);\n }\n render () {\n const { channel: { claimsData: { claims, currentPage, totalPages } } } = this.props;\n return (\n
\n {(claims.length > 0) ? (\n
\n {claims.map((claim, index) => )}\n
\n {(currentPage > 1) &&\n \n }\n {(currentPage < totalPages) &&\n \n }\n
\n
\n ) : (\n

There are no claims in this channel

\n )}\n
\n );\n }\n};\n\nexport default ChannelClaimsDisplay;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/ChannelClaimsDisplay/view.jsx","import React from 'react';\nimport { Link } from 'react-router-dom';\nconst { claim: { defaultThumbnail } } = require('../../../config/speechConfig.js');\n\nconst AssetPreview = ({ claimData: { name, claimId, fileExt, contentType, thumbnail } }) => {\n const directSourceLink = `${claimId}/${name}.${fileExt}`;\n const showUrlLink = `/${claimId}/${name}`;\n return (\n
\n \n {(() => {\n switch (contentType) {\n case 'image/jpeg':\n case 'image/jpg':\n case 'image/png':\n case 'image/gif':\n return (\n \n );\n case 'video/mp4':\n return (\n \n );\n default:\n return (\n

unsupported file type

\n );\n }\n })()}\n \n
\n );\n};\n\nexport default AssetPreview;\n\n\n\n// WEBPACK FOOTER //\n// ./react/components/AssetPreview/index.jsx","import React from 'react';\nimport NavBar from 'containers/NavBar';\nimport Helmet from 'react-helmet';\nconst { site: { title, host } } = require('../../../config/speechConfig.js');\n\nclass FourOhForPage extends React.Component {\n render () {\n return (\n
\n \n {title} - 404\n \n \n \n
\n

404

\n

That page does not exist

\n
\n
\n );\n }\n};\n\nexport default FourOhForPage;\n\n\n\n// WEBPACK FOOTER //\n// ./react/components/FourOhFourPage/index.jsx","const { sendGAServeEvent } = require('../helpers/googleAnalytics');\nconst { determineResponseType, flipClaimNameAndIdForBackwardsCompatibility, logRequestData, getClaimIdAndServeAsset } = require('../helpers/serveHelpers.js');\nconst lbryUri = require('../helpers/lbryUri.js');\nconst handleShowRender = require('../helpers/handleShowRender.jsx');\nconst SERVE = 'SERVE';\n\nmodule.exports = (app) => {\n // route to serve a specific asset using the channel or claim id\n app.get('/:identifier/:claim', (req, res) => {\n const { headers, ip, originalUrl, params } = req;\n // decide if this is a show request\n let hasFileExtension;\n try {\n ({ hasFileExtension } = lbryUri.parseModifier(params.claim));\n } catch (error) {\n return res.status(400).json({success: false, message: error.message});\n }\n let responseType = determineResponseType(hasFileExtension, headers);\n if (responseType !== SERVE) {\n return handleShowRender(req, res);\n }\n // handle serve request\n // send google analytics\n sendGAServeEvent(headers, ip, originalUrl);\n // parse the claim\n let claimName;\n try {\n ({ claimName } = lbryUri.parseClaim(params.claim));\n } catch (error) {\n return res.status(400).json({success: false, message: error.message});\n }\n // parse the identifier\n let isChannel, channelName, channelClaimId, claimId;\n try {\n ({ isChannel, channelName, channelClaimId, claimId } = lbryUri.parseIdentifier(params.identifier));\n } catch (error) {\n return res.status(400).json({success: false, message: error.message});\n }\n if (!isChannel) {\n [claimId, claimName] = flipClaimNameAndIdForBackwardsCompatibility(claimId, claimName);\n }\n // log the request data for debugging\n logRequestData(responseType, claimName, channelName, claimId);\n // get the claim Id and then serve the asset\n getClaimIdAndServeAsset(channelName, channelClaimId, claimName, claimId, originalUrl, ip, res);\n });\n // route to serve the winning asset at a claim or a channel page\n app.get('/:claim', (req, res) => {\n const { headers, ip, originalUrl, params } = req;\n // decide if this is a show request\n let hasFileExtension;\n try {\n ({ hasFileExtension } = lbryUri.parseModifier(params.claim));\n } catch (error) {\n return res.status(400).json({success: false, message: error.message});\n }\n let responseType = determineResponseType(hasFileExtension, headers);\n if (responseType !== SERVE) {\n return handleShowRender(req, res);\n }\n // handle serve request\n // send google analytics\n sendGAServeEvent(headers, ip, originalUrl);\n // parse the claim\n let claimName;\n try {\n ({claimName} = lbryUri.parseClaim(params.claim));\n } catch (error) {\n return res.status(400).json({success: false, message: error.message});\n }\n // log the request data for debugging\n logRequestData(responseType, claimName, null, null);\n // get the claim Id and then serve the asset\n getClaimIdAndServeAsset(null, null, claimName, null, originalUrl, ip, res);\n });\n};\n\n\n\n// WEBPACK FOOTER //\n// ./routes/serve-routes.js","const logger = require('winston');\nconst { getClaimId, getLocalFileRecord } = require('../controllers/serveController.js');\nconst { handleErrorResponse } = require('../helpers/errorHandlers.js');\n\nconst SERVE = 'SERVE';\nconst SHOW = 'SHOW';\nconst NO_FILE = 'NO_FILE';\nconst NO_CHANNEL = 'NO_CHANNEL';\nconst NO_CLAIM = 'NO_CLAIM';\n\nfunction clientAcceptsHtml ({accept}) {\n return accept && accept.match(/text\\/html/);\n};\n\nfunction requestIsFromBrowser (headers) {\n return headers['user-agent'] && headers['user-agent'].match(/Mozilla/);\n};\n\nfunction clientWantsAsset ({accept, range}) {\n const imageIsWanted = accept && accept.match(/image\\/.*/) && !accept.match(/text\\/html/) && !accept.match(/text\\/\\*/);\n const videoIsWanted = accept && range;\n return imageIsWanted || videoIsWanted;\n};\n\nfunction isValidClaimId (claimId) {\n return ((claimId.length === 40) && !/[^A-Za-z0-9]/g.test(claimId));\n};\n\nfunction isValidShortId (claimId) {\n return claimId.length === 1; // it should really evaluate the short url itself\n};\n\nfunction isValidShortIdOrClaimId (input) {\n return (isValidClaimId(input) || isValidShortId(input));\n};\n\nfunction serveAssetToClient (claimId, name, res) {\n return getLocalFileRecord(claimId, name)\n .then(fileRecord => {\n // check that a local record was found\n if (fileRecord === NO_FILE) {\n return res.status(307).redirect(`/api/claim/get/${name}/${claimId}`);\n }\n // serve the file\n const {filePath, fileType} = fileRecord;\n logger.verbose(`serving file: ${filePath}`);\n const sendFileOptions = {\n headers: {\n 'X-Content-Type-Options': 'nosniff',\n 'Content-Type' : fileType || 'image/jpeg',\n },\n };\n res.status(200).sendFile(filePath, sendFileOptions);\n })\n .catch(error => {\n throw error;\n });\n};\n\nmodule.exports = {\n getClaimIdAndServeAsset (channelName, channelClaimId, claimName, claimId, originalUrl, ip, res) {\n // get the claim Id and then serve the asset\n getClaimId(channelName, channelClaimId, claimName, claimId)\n .then(fullClaimId => {\n if (fullClaimId === NO_CLAIM) {\n return res.status(404).json({success: false, message: 'no claim id could be found'});\n } else if (fullClaimId === NO_CHANNEL) {\n return res.status(404).json({success: false, message: 'no channel id could be found'});\n }\n serveAssetToClient(fullClaimId, claimName, res);\n // postToStats(responseType, originalUrl, ip, claimName, fullClaimId, 'success');\n })\n .catch(error => {\n handleErrorResponse(originalUrl, ip, error, res);\n // postToStats(responseType, originalUrl, ip, claimName, fullClaimId, 'fail');\n });\n },\n determineResponseType (hasFileExtension, headers) {\n let responseType;\n if (hasFileExtension) {\n responseType = SERVE; // assume a serve request if file extension is present\n if (clientAcceptsHtml(headers)) { // if the request comes from a browser, change it to a show request\n responseType = SHOW;\n }\n } else {\n responseType = SHOW;\n if (clientWantsAsset(headers) && requestIsFromBrowser(headers)) { // this is in case someone embeds a show url\n logger.debug('Show request came from browser but wants an image/video. Changing response to serve...');\n responseType = SERVE;\n }\n }\n return responseType;\n },\n flipClaimNameAndIdForBackwardsCompatibility (identifier, name) {\n // this is a patch for backwards compatability with '/name/claim_id' url format\n if (isValidShortIdOrClaimId(name) && !isValidShortIdOrClaimId(identifier)) {\n const tempName = name;\n name = identifier;\n identifier = tempName;\n }\n return [identifier, name];\n },\n logRequestData (responseType, claimName, channelName, claimId) {\n logger.debug('responseType ===', responseType);\n logger.debug('claim name === ', claimName);\n logger.debug('channel name ===', channelName);\n logger.debug('claim id ===', claimId);\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./helpers/serveHelpers.js","const logger = require('winston');\n\nmodule.exports = {\n REGEXP_INVALID_CLAIM : /[^A-Za-z0-9-]/g,\n REGEXP_INVALID_CHANNEL: /[^A-Za-z0-9-@]/g,\n REGEXP_ADDRESS : /^b(?=[^0OIl]{32,33})[0-9A-Za-z]{32,33}$/,\n CHANNEL_CHAR : '@',\n parseIdentifier : function (identifier) {\n logger.debug('parsing identifier:', identifier);\n const componentsRegex = new RegExp(\n '([^:$#/]*)' + // value (stops at the first separator or end)\n '([:$#]?)([^/]*)' // modifier separator, modifier (stops at the first path separator or end)\n );\n const [proto, value, modifierSeperator, modifier] = componentsRegex\n .exec(identifier)\n .map(match => match || null);\n logger.debug(`${proto}, ${value}, ${modifierSeperator}, ${modifier}`);\n\n // Validate and process name\n if (!value) {\n throw new Error(`Check your url. No channel name provided before \"${modifierSeperator}\"`);\n }\n const isChannel = value.startsWith(module.exports.CHANNEL_CHAR);\n const channelName = isChannel ? value : null;\n let claimId;\n if (isChannel) {\n if (!channelName) {\n throw new Error('No channel name after @.');\n }\n const nameBadChars = (channelName).match(module.exports.REGEXP_INVALID_CHANNEL);\n if (nameBadChars) {\n throw new Error(`Invalid characters in channel name: ${nameBadChars.join(', ')}.`);\n }\n } else {\n claimId = value;\n }\n\n // Validate and process modifier\n let channelClaimId;\n if (modifierSeperator) {\n if (!modifier) {\n throw new Error(`No modifier provided after separator \"${modifierSeperator}\"`);\n }\n\n if (modifierSeperator === ':') {\n channelClaimId = modifier;\n } else {\n throw new Error(`The \"${modifierSeperator}\" modifier is not currently supported`);\n }\n }\n return {\n isChannel,\n channelName,\n channelClaimId,\n claimId,\n };\n },\n parseClaim: function (claim) {\n logger.debug('parsing name:', claim);\n const componentsRegex = new RegExp(\n '([^:$#/.]*)' + // name (stops at the first modifier)\n '([:$#.]?)([^/]*)' // modifier separator, modifier (stops at the first path separator or end)\n );\n const [proto, claimName, modifierSeperator, modifier] = componentsRegex\n .exec(claim)\n .map(match => match || null);\n logger.debug(`${proto}, ${claimName}, ${modifierSeperator}, ${modifier}`);\n\n // Validate and process name\n if (!claimName) {\n throw new Error('No claim name provided before .');\n }\n const nameBadChars = (claimName).match(module.exports.REGEXP_INVALID_CLAIM);\n if (nameBadChars) {\n throw new Error(`Invalid characters in claim name: ${nameBadChars.join(', ')}.`);\n }\n // Validate and process modifier\n if (modifierSeperator) {\n if (!modifier) {\n throw new Error(`No file extension provided after separator ${modifierSeperator}.`);\n }\n if (modifierSeperator !== '.') {\n throw new Error(`The ${modifierSeperator} modifier is not supported in the claim name`);\n }\n }\n // return results\n return {\n claimName,\n };\n },\n parseModifier: function (claim) {\n logger.debug('parsing modifier:', claim);\n const componentsRegex = new RegExp(\n '([^:$#/.]*)' + // name (stops at the first modifier)\n '([:$#.]?)([^/]*)' // modifier separator, modifier (stops at the first path separator or end)\n );\n const [proto, claimName, modifierSeperator, modifier] = componentsRegex\n .exec(claim)\n .map(match => match || null);\n logger.debug(`${proto}, ${claimName}, ${modifierSeperator}, ${modifier}`);\n // Validate and process modifier\n let hasFileExtension = false;\n if (modifierSeperator) {\n hasFileExtension = true;\n }\n return {\n hasFileExtension,\n };\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./helpers/lbryUri.js","import React from 'react';\nimport { renderToString } from 'react-dom/server';\nimport { createStore, applyMiddleware } from 'redux';\nimport Reducer from '../react/reducers';\nimport { Provider } from 'react-redux';\nimport { StaticRouter } from 'react-router-dom';\nimport GAListener from '../react/components/GAListener';\nimport App from '../react/app';\nimport renderFullPage from './renderFullPage';\nimport createSagaMiddleware from 'redux-saga';\nimport { call } from 'redux-saga/effects';\nimport { handleShowPageUri } from '../react/sagas/show_uri';\nimport { onHandleShowPageUri } from '../react/actions/show';\n\nimport Helmet from 'react-helmet';\n\nconst returnSagaWithParams = (saga, params) => {\n return function * () {\n yield call(saga, params);\n };\n};\n\nmodule.exports = (req, res) => {\n let context = {};\n\n // create and apply middleware\n const sagaMiddleware = createSagaMiddleware();\n const middleware = applyMiddleware(sagaMiddleware);\n\n // create a new Redux store instance\n const store = createStore(Reducer, middleware);\n\n // create saga\n const action = onHandleShowPageUri(req.params);\n const saga = returnSagaWithParams(handleShowPageUri, action);\n\n // run the saga middleware\n sagaMiddleware\n .run(saga)\n .done\n .then(() => {\n // render component to a string\n const html = renderToString(\n \n \n \n \n \n \n \n );\n\n // get head tags from helmet\n const helmet = Helmet.renderStatic();\n\n // check for a redirect\n if (context.url) {\n return res.redirect(301, context.url);\n }\n\n // get the initial state from our Redux store\n const preloadedState = store.getState();\n\n // send the rendered page back to the client\n res.send(renderFullPage(helmet, html, preloadedState));\n });\n};\n\n\n\n// WEBPACK FOOTER //\n// ./helpers/handleShowRender.jsx","module.exports = require(\"redux-saga\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"redux-saga\"\n// module id = 141\n// module chunks = 0","import { call, put, takeLatest } from 'redux-saga/effects';\nimport * as actions from 'constants/show_action_types';\nimport { onRequestError, onNewChannelRequest, onNewAssetRequest } from 'actions/show';\nimport { newAssetRequest } from 'sagas/show_asset';\nimport { newChannelRequest } from 'sagas/show_channel';\nimport lbryUri from 'utils/lbryUri';\n\nfunction * parseAndUpdateIdentifierAndClaim (modifier, claim) {\n // this is a request for an asset\n // claim will be an asset claim\n // the identifier could be a channel or a claim id\n let isChannel, channelName, channelClaimId, claimId, claimName, extension;\n try {\n ({ isChannel, channelName, channelClaimId, claimId } = lbryUri.parseIdentifier(modifier));\n ({ claimName, extension } = lbryUri.parseClaim(claim));\n } catch (error) {\n return yield put(onRequestError(error.message));\n }\n // trigger an new action to update the store\n if (isChannel) {\n return yield call(newAssetRequest, onNewAssetRequest(claimName, null, channelName, channelClaimId, extension));\n };\n yield call(newAssetRequest, onNewAssetRequest(claimName, claimId, null, null, extension));\n}\nfunction * parseAndUpdateClaimOnly (claim) {\n // this could be a request for an asset or a channel page\n // claim could be an asset claim or a channel claim\n let isChannel, channelName, channelClaimId;\n try {\n ({ isChannel, channelName, channelClaimId } = lbryUri.parseIdentifier(claim));\n } catch (error) {\n return yield put(onRequestError(error.message));\n }\n // trigger an new action to update the store\n // return early if this request is for a channel\n if (isChannel) {\n return yield call(newChannelRequest, onNewChannelRequest(channelName, channelClaimId));\n }\n // if not for a channel, parse the claim request\n let claimName, extension;\n try {\n ({claimName, extension} = lbryUri.parseClaim(claim));\n } catch (error) {\n return yield put(onRequestError(error.message));\n }\n yield call(newAssetRequest, onNewAssetRequest(claimName, null, null, null, extension));\n}\n\nexport function * handleShowPageUri (action) {\n const { identifier, claim } = action.data;\n if (identifier) {\n return yield call(parseAndUpdateIdentifierAndClaim, identifier, claim);\n }\n yield call(parseAndUpdateClaimOnly, claim);\n};\n\nexport function * watchHandleShowPageUri () {\n yield takeLatest(actions.HANDLE_SHOW_URI, handleShowPageUri);\n};\n\n\n\n// WEBPACK FOOTER //\n// ./react/sagas/show_uri.js","import { call, put, select, takeLatest } from 'redux-saga/effects';\nimport * as actions from 'constants/show_action_types';\nimport { addRequestToRequestList, onRequestError, onRequestUpdate, addAssetToAssetList } from 'actions/show';\nimport { getLongClaimId, getShortId, getClaimData } from 'api/assetApi';\nimport { selectShowState } from 'selectors/show';\n\nexport function * newAssetRequest (action) {\n const { requestType, requestId, name, modifier } = action.data;\n // put an action to update the request in redux\n yield put(onRequestUpdate(requestType, requestId));\n // is this an existing request?\n // If this uri is in the request list, it's already been fetched\n const state = yield select(selectShowState);\n if (state.requestList[requestId]) {\n return null;\n }\n // get long id && add request to request list\n let longId;\n try {\n ({data: longId} = yield call(getLongClaimId, name, modifier));\n } catch (error) {\n return yield put(onRequestError(error.message));\n }\n const assetKey = `a#${name}#${longId}`;\n yield put(addRequestToRequestList(requestId, null, assetKey));\n // is this an existing asset?\n // If this asset is in the asset list, it's already been fetched\n if (state.assetList[assetKey]) {\n return null;\n }\n // get short Id\n let shortId;\n try {\n ({data: shortId} = yield call(getShortId, name, longId));\n } catch (error) {\n return yield put(onRequestError(error.message));\n }\n // get asset claim data\n let claimData;\n try {\n ({data: claimData} = yield call(getClaimData, name, longId));\n } catch (error) {\n return yield put(onRequestError(error.message));\n }\n // add asset to asset list\n yield put(addAssetToAssetList(assetKey, null, name, longId, shortId, claimData));\n // clear any errors in request error\n yield put(onRequestError(null));\n};\n\nexport function * watchNewAssetRequest () {\n yield takeLatest(actions.ASSET_REQUEST_NEW, newAssetRequest);\n};\n\n\n\n// WEBPACK FOOTER //\n// ./react/sagas/show_asset.js","import Request from 'utils/request';\nconst { site: { host } } = require('../../config/speechConfig.js');\n\nexport function getLongClaimId (name, modifier) {\n let body = {};\n // create request params\n if (modifier) {\n if (modifier.id) {\n body['claimId'] = modifier.id;\n } else {\n body['channelName'] = modifier.channel.name;\n body['channelClaimId'] = modifier.channel.id;\n }\n }\n body['claimName'] = name;\n const params = {\n method : 'POST',\n headers: { 'Content-Type': 'application/json' },\n body : JSON.stringify(body),\n };\n // create url\n const url = `${host}/api/claim/long-id`;\n // return the request promise\n return Request(url, params);\n};\n\nexport function getShortId (name, claimId) {\n const url = `${host}/api/claim/short-id/${claimId}/${name}`;\n return Request(url);\n};\n\nexport function getClaimData (name, claimId) {\n const url = `${host}/api/claim/data/${name}/${claimId}`;\n return Request(url);\n};\n\n\n\n// WEBPACK FOOTER //\n// ./react/api/assetApi.js","import {call, put, select, takeLatest} from 'redux-saga/effects';\nimport * as actions from 'constants/show_action_types';\nimport { addNewChannelToChannelList, addRequestToRequestList, onRequestError, onRequestUpdate, updateChannelClaims } from 'actions/show';\nimport { getChannelClaims, getChannelData } from 'api/channelApi';\nimport { selectShowState } from 'selectors/show';\n\nexport function * newChannelRequest (action) {\n const { requestType, requestId, channelName, channelId } = action.data;\n // put an action to update the request in redux\n yield put(onRequestUpdate(requestType, requestId));\n // is this an existing request?\n // If this uri is in the request list, it's already been fetched\n const state = yield select(selectShowState);\n if (state.requestList[requestId]) {\n return null;\n }\n // get channel long id\n let longId, shortId;\n try {\n ({ data: {longChannelClaimId: longId, shortChannelClaimId: shortId} } = yield call(getChannelData, channelName, channelId));\n } catch (error) {\n return yield put(onRequestError(error.message));\n }\n // store the request in the channel requests list\n const channelKey = `c#${channelName}#${longId}`;\n yield put(addRequestToRequestList(requestId, null, channelKey));\n // is this an existing channel?\n // If this channel is in the channel list, it's already been fetched\n if (state.channelList[channelKey]) {\n return null;\n }\n // get channel claims data\n let claimsData;\n try {\n ({ data: claimsData } = yield call(getChannelClaims, channelName, longId, 1));\n } catch (error) {\n return yield put(onRequestError(error.message));\n }\n // store the channel data in the channel list\n yield put(addNewChannelToChannelList(channelKey, channelName, shortId, longId, claimsData));\n // clear any request errors\n yield put(onRequestError(null));\n}\n\nexport function * watchNewChannelRequest () {\n yield takeLatest(actions.CHANNEL_REQUEST_NEW, newChannelRequest);\n};\n\nfunction * getNewClaimsAndUpdateChannel (action) {\n const { channelKey, name, longId, page } = action.data;\n let claimsData;\n try {\n ({ data: claimsData } = yield call(getChannelClaims, name, longId, page));\n } catch (error) {\n return yield put(onRequestError(error.message));\n }\n yield put(updateChannelClaims(channelKey, claimsData));\n}\n\nexport function * watchUpdateChannelClaims () {\n yield takeLatest(actions.CHANNEL_CLAIMS_UPDATE_ASYNC, getNewClaimsAndUpdateChannel);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./react/sagas/show_channel.js","import Request from 'utils/request';\nconst { site: { host } } = require('../../config/speechConfig.js');\n\nexport function getChannelData (name, id) {\n if (!id) id = 'none';\n const url = `${host}/api/channel/data/${name}/${id}`;\n return Request(url);\n};\n\nexport function getChannelClaims (name, longId, page) {\n if (!page) page = 1;\n const url = `${host}/api/channel/claims/${name}/${longId}/${page}`;\n return Request(url);\n};\n\n\n\n// WEBPACK FOOTER //\n// ./react/api/channelApi.js","module.exports = {\n REGEXP_INVALID_CLAIM : /[^A-Za-z0-9-]/g,\n REGEXP_INVALID_CHANNEL: /[^A-Za-z0-9-@]/g,\n REGEXP_ADDRESS : /^b(?=[^0OIl]{32,33})[0-9A-Za-z]{32,33}$/,\n CHANNEL_CHAR : '@',\n parseIdentifier : function (identifier) {\n const componentsRegex = new RegExp(\n '([^:$#/]*)' + // value (stops at the first separator or end)\n '([:$#]?)([^/]*)' // modifier separator, modifier (stops at the first path separator or end)\n );\n const [proto, value, modifierSeperator, modifier] = componentsRegex // eslint-disable-line no-unused-vars\n .exec(identifier)\n .map(match => match || null);\n\n // Validate and process name\n if (!value) {\n throw new Error(`Check your URL. No channel name provided before \"${modifierSeperator}\"`);\n }\n const isChannel = value.startsWith(module.exports.CHANNEL_CHAR);\n const channelName = isChannel ? value : null;\n let claimId;\n if (isChannel) {\n if (!channelName) {\n throw new Error('Check your URL. No channel name after \"@\".');\n }\n const nameBadChars = (channelName).match(module.exports.REGEXP_INVALID_CHANNEL);\n if (nameBadChars) {\n throw new Error(`Check your URL. Invalid characters in channel name: \"${nameBadChars.join(', ')}\".`);\n }\n } else {\n claimId = value;\n }\n\n // Validate and process modifier\n let channelClaimId;\n if (modifierSeperator) {\n if (!modifier) {\n throw new Error(`Check your URL. No modifier provided after separator \"${modifierSeperator}\"`);\n }\n\n if (modifierSeperator === ':') {\n channelClaimId = modifier;\n } else {\n throw new Error(`Check your URL. The \"${modifierSeperator}\" modifier is not currently supported`);\n }\n }\n return {\n isChannel,\n channelName,\n channelClaimId: channelClaimId || null,\n claimId : claimId || null,\n };\n },\n parseClaim: function (name) {\n const componentsRegex = new RegExp(\n '([^:$#/.]*)' + // name (stops at the first extension)\n '([:$#.]?)([^/]*)' // extension separator, extension (stops at the first path separator or end)\n );\n const [proto, claimName, extensionSeperator, extension] = componentsRegex // eslint-disable-line no-unused-vars\n .exec(name)\n .map(match => match || null);\n\n // Validate and process name\n if (!claimName) {\n throw new Error('Check your URL. No claim name provided before \".\"');\n }\n const nameBadChars = (claimName).match(module.exports.REGEXP_INVALID_CLAIM);\n if (nameBadChars) {\n throw new Error(`Check your URL. Invalid characters in claim name: \"${nameBadChars.join(', ')}\".`);\n }\n // Validate and process extension\n if (extensionSeperator) {\n if (!extension) {\n throw new Error(`Check your URL. No file extension provided after separator \"${extensionSeperator}\".`);\n }\n if (extensionSeperator !== '.') {\n throw new Error(`Check your URL. The \"${extensionSeperator}\" separator is not supported in the claim name.`);\n }\n }\n return {\n claimName,\n extension: extension || null,\n };\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./react/utils/lbryUri.js","const handlePageRender = require('../helpers/handlePageRender.jsx');\n\nmodule.exports = app => {\n // a catch-all route if someone visits a page that does not exist\n app.use('*', (req, res) => {\n // send response\n handlePageRender(req, res);\n });\n};\n\n\n\n// WEBPACK FOOTER //\n// ./routes/fallback-routes.js","module.exports = require(\"http\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"http\"\n// module id = 149\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///index.js","webpack:///webpack/bootstrap 32f6e2d4999aefc27a90","webpack:///external \"react\"","webpack:///external \"react-redux\"","webpack:///external \"winston\"","webpack:///./config/speechConfig.js","webpack:///external \"react-router-dom\"","webpack:///./react/actions/publish.js","webpack:///./models/index.js","webpack:///./react/containers/NavBar/index.js","webpack:///./react/actions/show.js","webpack:///./react/components/SEO/index.jsx","webpack:///external \"prop-types\"","webpack:///./react/utils/request.js","webpack:///./react/constants/show_action_types.js","webpack:///./react/selectors/show.js","webpack:///external \"react-helmet\"","webpack:///external \"redux-saga/effects\"","webpack:///./helpers/lbryApi.js","webpack:///./helpers/googleAnalytics.js","webpack:///external \"redux\"","webpack:///./react/actions/channel.js","webpack:///./react/components/ProgressBar/index.jsx","webpack:///./react/components/ErrorPage/index.jsx","webpack:///external \"passport\"","webpack:///./helpers/sequelizeHelpers.js","webpack:///external \"passport-local\"","webpack:///./helpers/publishHelpers.js","webpack:///./helpers/errorHandlers.js","webpack:///./controllers/serveController.js","webpack:///./helpers/handlePageRender.jsx","webpack:///external \"react-dom/server\"","webpack:///./react/reducers/index.js","webpack:///./react/constants/publish_action_types.js","webpack:///./react/constants/publish_channel_select_states.js","webpack:///./react/constants/channel_action_types.js","webpack:///./react/constants/asset_display_states.js","webpack:///./react/components/GAListener/index.jsx","webpack:///./react/app.js","webpack:///./react/containers/Dropzone/index.js","webpack:///./react/containers/ChannelLoginForm/index.js","webpack:///./react/containers/ChannelCreateForm/index.js","webpack:///./react/constants/show_request_types.js","webpack:///./react/containers/AssetDisplay/index.js","webpack:///./helpers/renderFullPage.js","webpack:///external \"babel-polyfill\"","webpack:///external \"whatwg-fetch\"","webpack:///./server.js","webpack:///external \"express\"","webpack:///external \"body-parser\"","webpack:///external \"express-handlebars\"","webpack:///external \"handlebars\"","webpack:///./helpers/authHelpers.js","webpack:///external \"helmet\"","webpack:///external \"cookie-session\"","webpack:///./config/loggerConfig.js","webpack:///./config/slackConfig.js","webpack:///external \"winston-slack-webhook\"","webpack:///./helpers/configVarCheck.js","webpack:///./passport/local-signup.js","webpack:///external \"sequelize\"","webpack:///./models/certificate.js","webpack:///./models/channel.js","webpack:///./models/claim.js","webpack:///./models/file.js","webpack:///./models/request.js","webpack:///./models/user.js","webpack:///external \"bcrypt\"","webpack:///external \"axios\"","webpack:///external \"universal-analytics\"","webpack:///./passport/local-login.js","webpack:///./routes/auth-routes.js","webpack:///./routes/api-routes.js","webpack:///external \"connect-multiparty\"","webpack:///./controllers/publishController.js","webpack:///external \"fs\"","webpack:///./auth/authentication.js","webpack:///./helpers/channelPagination.js","webpack:///./routes/page-routes.js","webpack:///./react/reducers/publish.js","webpack:///./react/reducers/channel.js","webpack:///./react/reducers/show.js","webpack:///./react/reducers/site.js","webpack:///external \"react-ga\"","webpack:///./react/components/HomePage/index.jsx","webpack:///./react/utils/pageTitle.js","webpack:///./react/utils/metaTags.js","webpack:///./react/utils/canonicalLink.js","webpack:///./react/containers/NavBar/view.jsx","webpack:///./react/components/Logo/index.jsx","webpack:///./react/components/NavBarChannelOptionsDropdown/index.jsx","webpack:///external \"cross-fetch/polyfill\"","webpack:///./react/containers/PublishTool/index.js","webpack:///./react/containers/PublishTool/view.jsx","webpack:///./react/containers/Dropzone/view.jsx","webpack:///./react/utils/file.js","webpack:///./react/components/Preview/index.jsx","webpack:///./react/containers/PublishDetails/index.js","webpack:///./react/containers/PublishDetails/view.jsx","webpack:///./react/containers/PublishTitleInput/index.js","webpack:///./react/containers/PublishTitleInput/view.jsx","webpack:///./react/containers/PublishUrlInput/index.js","webpack:///./react/containers/PublishUrlInput/view.jsx","webpack:///./react/components/PublishUrlMiddleDisplay/index.jsx","webpack:///./react/containers/PublishThumbnailInput/index.js","webpack:///./react/containers/PublishThumbnailInput/view.jsx","webpack:///./react/containers/PublishMetadataInputs/index.js","webpack:///./react/containers/PublishMetadataInputs/view.jsx","webpack:///./react/components/ExpandingTextArea/index.jsx","webpack:///./react/containers/ChannelSelect/index.js","webpack:///./react/containers/ChannelSelect/view.jsx","webpack:///./react/containers/ChannelLoginForm/view.jsx","webpack:///./react/containers/ChannelCreateForm/view.jsx","webpack:///./react/components/ActiveStatusBar/index.jsx","webpack:///./react/components/InactiveStatusBar/index.jsx","webpack:///./react/containers/PublishStatus/index.js","webpack:///./react/containers/PublishStatus/view.jsx","webpack:///./react/constants/publish_claim_states.js","webpack:///./react/components/AboutPage/index.jsx","webpack:///./react/containers/LoginPage/index.js","webpack:///./react/containers/LoginPage/view.jsx","webpack:///./react/containers/ShowPage/index.js","webpack:///./react/containers/ShowPage/view.jsx","webpack:///./react/containers/ShowAssetLite/index.js","webpack:///./react/containers/ShowAssetLite/view.jsx","webpack:///./react/containers/AssetDisplay/view.jsx","webpack:///./react/containers/ShowAssetDetails/index.js","webpack:///./react/containers/ShowAssetDetails/view.jsx","webpack:///./react/containers/AssetTitle/index.js","webpack:///./react/containers/AssetTitle/view.jsx","webpack:///./react/containers/AssetInfo/index.js","webpack:///./react/containers/AssetInfo/view.jsx","webpack:///./react/containers/ShowChannel/index.js","webpack:///./react/containers/ShowChannel/view.jsx","webpack:///./react/containers/ChannelClaimsDisplay/index.js","webpack:///./react/containers/ChannelClaimsDisplay/view.jsx","webpack:///./react/components/AssetPreview/index.jsx","webpack:///./react/components/FourOhFourPage/index.jsx","webpack:///./routes/serve-routes.js","webpack:///./helpers/serveHelpers.js","webpack:///./helpers/lbryUri.js","webpack:///./helpers/handleShowRender.jsx","webpack:///external \"redux-saga\"","webpack:///./react/sagas/show_uri.js","webpack:///./react/sagas/show_asset.js","webpack:///./react/api/assetApi.js","webpack:///./react/sagas/show_channel.js","webpack:///./react/api/channelApi.js","webpack:///./react/utils/lbryUri.js","webpack:///./routes/fallback-routes.js","webpack:///external \"http\""],"names":["module","exports","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","require","analytics","googleId","logging","logLevel","slackWebHook","slackErrorChannel","slackInfoChannel","session","sessionKey","files","uploadDirectory","site","title","host","description","publish","primaryClaimAddress","additionalClaimAddresses","thumbnailChannel","thumbnailChannelId","claim","defaultTitle","defaultThumbnail","defaultDescription","testing","testChannel","testChannelId","testChannelPassword","api","apiHost","apiPort","selectFile","file","type","actions","FILE_SELECTED","data","clearFile","FILE_CLEAR","updateMetadata","value","METADATA_UPDATE","updateClaim","CLAIM_UPDATE","setPublishInChannel","channel","SET_PUBLISH_IN_CHANNEL","updatePublishStatus","status","message","PUBLISH_STATUS_UPDATE","updateError","ERROR_UPDATE","updateSelectedChannel","channelName","SELECTED_CHANNEL_UPDATE","toggleMetadataInputs","showMetadataInputs","TOGGLE_METADATA_INPUTS","onNewThumbnail","THUMBNAIL_NEW","startPublish","history","PUBLISH_START","_publish_action_types","obj","newObj","key","default","Sequelize","logger","mysqlConfig","database","username","password","db","sequelize","dialect","dialectOptions","decimalNumbers","pool","max","min","idle","acquire","authenticate","then","info","catch","err","error","Certificate","Channel","Claim","File","Request","User","import","keys","forEach","modelName","associate","upsert","Model","values","condition","tableName","findOne","where","debug","update","create","_reactRedux","_channel","_view","_view2","_publish","mapStateToProps","_ref","loggedInChannel","channelShortId","shortId","channelLongId","longId","mapDispatchToProps","dispatch","onChannelLogin","updateLoggedInChannel","onChannelLogout","connect","onHandleShowPageUri","params","HANDLE_SHOW_URI","onRequestError","REQUEST_ERROR","onNewChannelRequest","channelId","requestType","requestId","CHANNEL_REQUEST_NEW","onNewAssetRequest","id","extension","ASSET_REQUEST_NEW","modifier","onRequestUpdate","REQUEST_UPDATE","addRequestToRequestList","REQUEST_LIST_ADD","addAssetToAssetList","claimId","claimData","ASSET_ADD","addNewChannelToChannelList","claimsData","CHANNEL_ADD","onUpdateChannelClaims","channelKey","page","CHANNEL_CLAIMS_UPDATE_ASYNC","updateChannelClaims","channelListId","CHANNEL_CLAIMS_UPDATE_SUCCESS","fileRequested","FILE_REQUESTED","updateFileAvailability","FILE_AVAILABILITY_UPDATE","updateDisplayAssetError","DISPLAY_ASSET_ERROR","_show_action_types","_show_request_types","_interopRequireDefault","_classCallCheck","instance","Constructor","TypeError","_possibleConstructorReturn","self","ReferenceError","_inherits","subClass","superClass","constructor","writable","setPrototypeOf","__proto__","_createClass","defineProperties","target","props","length","descriptor","protoProps","staticProps","_react","_react2","_reactHelmet","_reactHelmet2","_propTypes","_propTypes2","_pageTitle","_metaTags","_canonicalLink","SEO","_React$Component","this","getPrototypeOf","apply","arguments","_props","pageTitle","asset","pageUri","createPageTitle","metaTags","createMetaTags","canonicalLink","createCanonicalLink","createElement","meta","link","rel","href","Component","propTypes","string","parseJSON","response","json","checkStatus","jsonResponse","Error","request","url","options","fetch","Promise","all","_ref2","_slicedToArray","sliceIterator","arr","_arr","_n","_d","_e","undefined","_s","_i","Symbol","iterator","next","done","push","Array","isArray","selectAsset","show","requestList","assetKey","assetList","selectShowState","state","axios","config","_config$api","lbryApiUri","_require","chooseGaLbrynetPublishLabel","sendGATimingEvent","handleLbrynetResponse","resolve","reject","result","JSON","stringify","publishClaim","publishParams","gaStartTime","Date","now","post","method","getClaim","uri","timeout","getClaimList","claimName","resolveUri","getDownloadDirectory","_ref3","download_directory","createChannel","channel_name","amount","createServeEventParams","headers","ip","originalUrl","eventCategory","eventAction","eventLabel","ipOverride","userAgentOverride","createPublishTimingEventParams","category","variable","label","startTime","endTime","userTimingCategory","userTimingVariableName","userTimingTime","userTimingLabel","sendGoogleAnalyticsEvent","visitorId","replace","ua","strictCidFormat","https","event","sendGoogleAnalyticsTiming","timing","siteName","sendGAServeEvent","channel_id","CHANNEL_UPDATE","_channel_action_types","_ActiveStatusBar","_ActiveStatusBar2","_InactiveStatusBar","_InactiveStatusBar2","ProgressBar","_this","bars","index","incrementer","createBars","bind","startProgressBar","updateProgressBar","stopProgressBar","size","isActive","setState","updateInterval","setInterval","clearInterval","map","bar","number","isRequired","_NavBar","_NavBar2","ErrorPage","className","returnShortId","claimsArray","claimIndex","substring","shortIdLength","findIndex","element","possibleMatches","slice","filter","fs","wallet","parsePublishApiRequestBody","nsfw","license","thumbnail","exec","parsePublishApiRequestFiles","path","test","validateFileTypeAndSize","fileName","filePath","fileType","thumbnailFileName","thumbnailFilePath","thumbnailFileType","createBasicPublishParams","trim","file_path","bid","metadata","author","language","claim_address","lbryClaimAddress","createThumbnailPublishParams","deleteTemporaryFile","unlink","addGetResultsToFileData","fileInfo","getResult","file_name","download_path","createFileData","outpoint","height","address","contentType","handleErrorResponse","res","useObjectPropertiesIfNoKeys","_module$exports$retur","returnErrorMessageAndStatus","_module$exports$retur2","createErrorResponsePayload","code","newErrorObject","getOwnPropertyNames","success","returnPaginatedChannelClaims","getClaimId","channelClaimId","getClaimIdByChannel","getClaimIdByClaim","getLongClaimId","longClaimId","getLongChannelId","longChannelId","getClaimIdByLongChannelId","getChannelData","longChannelClaimId","getShortChannelIdFromLongChannelId","_ref4","shortChannelClaimId","getChannelClaims","getAllChannelClaims","_ref5","_ref6","channelClaimsArray","paginatedChannelViewData","getLocalFileRecord","dataValues","_server","_redux","_reducers","_reducers2","_reactRouterDom","_GAListener","_GAListener2","_app","_app2","_renderFullPage","_renderFullPage2","req","context","store","createStore","html","renderToString","Provider","StaticRouter","location","helmet","renderStatic","redirect","preloadedState","getState","send","_publish2","_channel2","_show","_show2","_site","_site2","combineReducers","LOGIN","CREATE","LOCAL_CHECK","UNAVAILABLE","ERROR","AVAILABLE","_reactGa","_reactGa2","googleApiKey","initialize","GAListener","sendPageView","listen","set","pathname","pageview","children","withRouter","_HomePage","_HomePage2","_AboutPage","_AboutPage2","_LoginPage","_LoginPage2","_ShowPage","_ShowPage2","_FourOhFourPage","_FourOhFourPage2","App","Switch","Route","exact","component","fileError","setFileError","CHANNEL","ASSET_LITE","ASSET_DETAILS","displayAsset","onFileRequest","toString","express","bodyParser","expressHandlebars","Handlebars","populateLocalsDotUser","serializeSpeechUser","deserializeSpeechUser","app","passport","cookieSession","enable","use","static","__dirname","urlencoded","extended","verbose","serializeUser","deserializeUser","localSignupStrategy","localLoginStrategy","maxAge","hbs","defaultLayout","handlebars","engine","start","sync","Server","server","speak","something","console","log","user","locals","userName","shortChannelId","winston","configure","transports","Console","level","timestamp","colorize","prettyPrint","handleExceptions","humanReadableUnhandledException","warn","silly","winstonSlackWebHook","SlackWebHook","add","webhookUrl","iconEmoji","configCategoryKey","configVariables","configVarKey","PassportLocalStrategy","Strategy","lbryApi","usernameField","passwordField","userInfo","tx","userData","channelData","claim_id","certificateData","newUser","newChannel","newCertificate","setChannel","setUser","STRING","BOOLEAN","INTEGER","TEXT","DECIMAL","define","claimSequence","decodedClaim","depth","effectiveAmount","hasSignature","hex","nout","txid","validAtHeight","valueVersion","claimType","certificateVersion","keyType","publicKey","freezeTableName","belongsTo","foreignKey","allowNull","findAll","order","getLongChannelIdFromShortChannelId","_this2","$like","getLongChannelIdFromChannelName","_this3","validateLongChannelId","_this4","hasOne","determineFileExtensionFromContentType","determineThumbnail","storedThumbnail","prepareClaimData","_require2","certificateId","licenseUrl","preview","metadataVersion","source","sourceType","sourceVersion","streamVersion","getShortClaimIdFromLongClaimId","raw","getLongClaimIdFromShortClaimId","getTopFreeClaimIdByClaimName","_this5","validateLongClaimId","_this6","resolveClaim","_this7","claimArray","defaultValue","trendingEligible","hasMany","getRecentClaims","limit","action","ipAddress","bcrypt","comparePassword","compare","changePassword","newPassword","genSalt","saltError","salt","hash","hashError","hook","returnUserAndChannelInfo","userInstance","getChannel","isMatch","logIn","logout","multipart","multipartMiddleware","uploadDir","claimNameIsAvailable","checkChannelAvailability","_require3","_require4","errorHandlers","_require5","_require6","authenticateUser","_require7","body","claimsList","resolveResult","fileData","_ref7","_ref8","_ref9","_ref10","_ref10$","completed","_ref11","_ref12","resolvedUri","_ref13","channelPassword","_parsePublishApiReque","_parsePublishApiReque2","_ref14","_ref15","_ref15$","thumbnailPublishParams","lbryTx","_ref16","_ref17","_ref18","claimInfo","_ref19","publishHelpers","publishResults","fileRecord","claimRecord","upsertCriteria","setClaim","setFile","claimAddress","authenticateChannelCredentials","userPassword","channelFindParams","claims","totalPages","determineTotalPages","paginationPage","getPageFromQuery","extractPageFromClaims","previousPage","determinePreviousPage","currentPage","nextPage","determineNextPage","totalResults","determineTotalClaims","parseInt","pageNumber","claimStartIndex","claimEndIndex","totalClaims","fullPages","Math","floor","handlePageRender","render","layout","_defineProperty","initialState","assign","publishInChannel","selectedChannel","_publish_channel_select_states","publishSubmit","channelList","_asset_display_states","_SEO","_SEO2","_PublishTool","_PublishTool2","HomePage","siteTitle","_require$site","_require$claim","determineOgThumbnailContentType","lastIndexOf","createBasicMetaTags","content","createChannelMetaTags","createAssetMetaTags","embedUrl","showUrl","fileExt","ogTitle","ogDescription","ogThumbnailContentType","ogThumbnail","createBasicCanonicalLink","createAssetCanonicalLink","_asset$claimData","createChannelCanonicalLink","_Logo","_Logo2","_NavBarChannelOptionsDropdown","_NavBarChannelOptionsDropdown2","_request","_request2","NavBar","checkForLoggedInUser","logoutUser","handleSelection","credentials","selectedOptions","NavLink","activeClassName","to","defaultSelection","VIEW","LOGOUT","Logo","version","x","y","viewBox","enableBackground","Link","transform","fontSize","fontFamily","fill","stroke","strokeWidth","strokeLinecap","NavBarChannelDropdown","onChange","_Dropzone","_Dropzone2","_PublishDetails","_PublishDetails2","_PublishStatus","_PublishStatus2","PublishTool","_file","_Preview","_Preview2","Dropzone","dragOver","mouseOver","dimPreview","handleDrop","handleDragOver","handleDragEnd","handleDragEnter","handleDragLeave","handleMouseEnter","handleMouseLeave","handleClick","handleFileInput","chooseFile","preventDefault","dt","dataTransfer","items","kind","droppedFile","getAsFile","remove","clearData","document","getElementById","click","fileList","validateFile","accept","encType","onDrop","onDragOver","onDragEnd","onDragEnter","onDragLeave","onMouseEnter","onMouseLeave","onClick","Preview","imgSource","setPreviewImageSource","newProps","setPreviewImageSourceFromFile","previewReader","FileReader","readAsDataURL","onloadend","src","alt","bool","_PublishTitleInput","_PublishTitleInput2","_PublishUrlInput","_PublishUrlInput2","_PublishThumbnailInput","_PublishThumbnailInput2","_PublishMetadataInputs","_PublishMetadataInputs2","_ChannelSelect","_ChannelSelect2","PublishDetails","onPublishSubmit","onMetadataChange","PublishTitleInput","handleInput","e","placeholder","loggedInChannelName","loggedInChannelShortId","urlError","onClaimChange","onUrlError","_PublishUrlMiddleDisplay","_PublishUrlMiddleDisplay2","PublishUrlInput","setClaimName","validateClaim","cleanseInput","input","fileNameWithoutEnding","cleanClaimName","_props2","UrlMiddle","dataURItoBlob","dataURI","byteString","atob","split","mimeString","ia","Uint8Array","charCodeAt","Blob","PublishThumbnailInput","videoSource","sliderMinRange","sliderMaxRange","sliderValue","handleVideoLoadedData","handleSliderChange","createThumbnail","setVideoSource","nextProps","dataUri","blob","URL","createObjectURL","duration","totalMinutes","totalSeconds","currentTime","video","canvas","width","videoWidth","videoHeight","getContext","drawImage","dataUrl","toDataURL","snapshot","_state","preload","muted","style","display","playsInline","onLoadedData","onSeeked","onToggleMetadataInputs","_ExpandingTextArea","_ExpandingTextArea2","PublishMetadataInputs","toggleShowInputs","handleSelect","checked","selectedOption","htmlFor","rows","maxLength","maxHeight","_objectWithoutProperties","indexOf","_extends","ExpandingTextarea","_Component","_handleChange","adjustTextarea","_ref$target","el","scrollHeight","rest","ref","func","channelError","onPublishInChannelChange","onChannelSelect","_ChannelLoginForm","_ChannelLoginForm2","_ChannelCreateForm","_ChannelCreateForm2","states","ChannelSelect","toggleAnonymousPublish","ChannelLoginForm","loginToChannel","Headers","Content-Type","_ProgressBar","_ProgressBar2","ChannelCreateForm","handleChannelInput","cleanseChannelInput","updateIsChannelAvailable","channelWithAtSymbol","isAvailable","checkIsPasswordProvided","checkIsChannelAvailable","makePublishChannelRequest","ActiveStatusBar","InactiveStatusBar","_publish_claim_states","publishStates","PublishStatus","LOAD_START","LOADING","PUBLISHING","SUCCESS","FAILED","AboutPage","LoginPage","_ErrorPage","_ErrorPage2","_ShowAssetLite","_ShowAssetLite2","_ShowAssetDetails","_ShowAssetDetails2","_ShowChannel","_ShowChannel2","ShowPage","match","_AssetDisplay","_AssetDisplay2","ShowLite","AssetDisplay","_props$asset$claimDat","_props$asset$claimDat2","controls","poster","_AssetTitle","_AssetTitle2","_AssetInfo","_AssetInfo2","ShowAssetDetails","AssetTitle","AssetInfo","copyToClipboard","elementToCopy","dataset","elementtocopy","select","execCommand","_props$asset","hidden","readOnly","spellCheck","data-elementtocopy","download","previousRequest","_ChannelClaimsDisplay","_ChannelClaimsDisplay2","ShowChannel","_AssetPreview","_AssetPreview2","ChannelClaimsDisplay","showNextResultsPage","showPreviousResultsPage","showNewPage","_props$channel","_props$channel$claims","AssetPreview","_ref$claimData","directSourceLink","showUrlLink","FourOhForPage","determineResponseType","flipClaimNameAndIdForBackwardsCompatibility","logRequestData","getClaimIdAndServeAsset","lbryUri","handleShowRender","hasFileExtension","parseModifier","responseType","parseClaim","isChannel","_lbryUri$parseIdentif","parseIdentifier","identifier","_flipClaimNameAndIdFo","_flipClaimNameAndIdFo2","clientAcceptsHtml","requestIsFromBrowser","clientWantsAsset","range","imageIsWanted","videoIsWanted","isValidClaimId","isValidShortId","isValidShortIdOrClaimId","serveAssetToClient","NO_FILE","sendFileOptions","X-Content-Type-Options","sendFile","fullClaimId","tempName","REGEXP_INVALID_CLAIM","REGEXP_INVALID_CHANNEL","REGEXP_ADDRESS","CHANNEL_CHAR","componentsRegex","RegExp","_componentsRegex$exec","_componentsRegex$exec2","proto","modifierSeperator","startsWith","nameBadChars","join","_componentsRegex$exec3","_componentsRegex$exec4","_componentsRegex$exec5","_componentsRegex$exec6","_reduxSaga","_reduxSaga2","_effects","_show_uri","returnSagaWithParams","saga","regeneratorRuntime","mark","_callee","wrap","_context","prev","stop","sagaMiddleware","middleware","applyMiddleware","run","parseAndUpdateIdentifierAndClaim","_lbryUri$parseClaim","_lbryUri2","t0","put","abrupt","sent","_show_asset","newAssetRequest","_marked","parseAndUpdateClaimOnly","_lbryUri$parseIdentif2","_lbryUri$parseClaim2","_context2","_show_channel","newChannelRequest","t1","_marked2","handleShowPageUri","_action$data","_context3","_marked3","watchHandleShowPageUri","_context4","takeLatest","_marked4","_lbryUri","_assetApi","getShortId","getClaimData","t2","watchNewAssetRequest","_ref$data","_channelApi","watchNewChannelRequest","getNewClaimsAndUpdateChannel","_action$data2","watchUpdateChannelClaims","extensionSeperator"],"mappings":"AAAAA,OAAOC,QACE,SAAUC,GCGnB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAH,OAGA,IAAAD,GAAAK,EAAAD,IACAE,EAAAF,EACAG,GAAA,EACAN,WAUA,OANA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C,GAAkB,GAAIC,QAC1B,+BAFwBQ,EAKgCT,EACvDztB,KAAKrY,GACL6W,IAAI,SAAAgqB,GAAA,MAASA,IAAS,OAPC2F,EAAAx2B,EAAAu2B,EAAA,GAKZvzB,GALYwzB,EAAA,GAAAA,EAAA,IAKD0D,EALC1D,EAAA,GAKmBz8B,EALnBy8B,EAAA,EAU1B,KAAKxzB,EACH,KAAM,IAAIxD,OAAM,qDAElB,IAAM62B,GAAgBrzB,EAAW6tB,MAAMzhC,EAAOC,QAAQqmC,qBACtD,IAAIW,EACF,KAAM,IAAI72B,OAAJ,uDAAiE62B,EAAaC,KAAK,MAAnF,KAGR,IAAI4D,EAAoB,CACtB,IAAKngC,EACH,KAAM,IAAIyF,OAAJ,gEAA0E06B,EAA1E,KAER,IAA2B,MAAvBA,EACF,KAAM,IAAI16B,OAAJ,yBAAmC06B,EAAnC,mDAGV,OACEl3B,YACAjJ,UAAWA,GAAa,SpJi1UxB,SAAU3K,EAAQC,EAASE,GAEjC,YqJp6UA,IAAM6vB,GAAmB7vB,EAAQ,GAEjCH,GAAOC,QAAU,SAAAoiB,GAEfA,EAAII,IAAI,IAAK,SAAC1E,EAAK5C,GAEjB6U,EAAiBjS,EAAK5C,OrJ66UpB,SAAUnb,EAAQC,GsJn7UxBD,EAAAC,QAAA2B,QAAA","file":"index.js","sourcesContent":["module.exports =\n/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"/\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 43);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"react\");\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"react-redux\");\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"winston\");\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nmodule.exports = {\n analytics: {\n googleId: 'UA-60403362-6' // google id for analytics tracking; leave `null` if not applicable\n },\n logging: {\n logLevel: 'debug', // options: silly, debug, verbose, info\n slackWebHook: 'https://hooks.slack.com/services/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', // enter a webhook if you wish to push logs to slack; otherwise leave as `null`\n slackErrorChannel: null, // enter a slack channel (#example) for errors to be sent to; otherwise leave null\n slackInfoChannel: '#speech-dev1-errors' // enter a slack channel (#info) for info level logs to be sent to otherwise leave null\n },\n session: {\n sessionKey: 'nans$#kfjanwe234rydns' // enter a secret key to be used for session encryption\n },\n files: {\n uploadDirectory: '/home/lbry/Uploads' // enter file path to where uploads/publishes should be stored\n },\n site: {\n title: 'dev1.Spee.ch',\n name: 'dev1.Spee.ch',\n host: 'https://dev1.spee.ch',\n description: 'Open-source, decentralized image and video sharing.'\n },\n publish: {\n primaryClaimAddress: 'bDZ2wPwtULUGxT7GXuNLpQhXmdPRUTUkcL',\n additionalClaimAddresses: ['banpwixPosfVDWnGvXqU2af36Qpsd7buGd'],\n thumbnailChannel: '@dev1thumbs', // create a channel to use for thumbnail images\n thumbnailChannelId: 'aeb625ff6f66c3eeeb42885070f4e53876033626' // the channel_id (claim id) for the channel above\n },\n claim: {\n defaultTitle: 'dev1 Spee.ch',\n defaultThumbnail: 'https://spee.ch/assets/img/video_thumb_default.png',\n defaultDescription: 'Open-source, decentralized image and video sharing.'\n },\n testing: {\n testChannel: '@test', // a channel to make test publishes in\n testChannelId: '3b5bc6b6819172c6e2f3f90aa855b14a956b4a82', // the claim id for the test channel\n testChannelPassword: '1234' // password for the test channel\n },\n api: {\n apiHost: 'localhost',\n apiPort: '5279'\n }\n};\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"react-router-dom\");\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.selectFile = selectFile;\nexports.clearFile = clearFile;\nexports.updateMetadata = updateMetadata;\nexports.updateClaim = updateClaim;\nexports.setPublishInChannel = setPublishInChannel;\nexports.updatePublishStatus = updatePublishStatus;\nexports.updateError = updateError;\nexports.updateSelectedChannel = updateSelectedChannel;\nexports.toggleMetadataInputs = toggleMetadataInputs;\nexports.onNewThumbnail = onNewThumbnail;\nexports.startPublish = startPublish;\n\nvar _publish_action_types = __webpack_require__(31);\n\nvar actions = _interopRequireWildcard(_publish_action_types);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\n// export action creators\nfunction selectFile(file) {\n return {\n type: actions.FILE_SELECTED,\n data: file\n };\n};\n\nfunction clearFile() {\n return {\n type: actions.FILE_CLEAR\n };\n};\n\nfunction updateMetadata(name, value) {\n return {\n type: actions.METADATA_UPDATE,\n data: {\n name: name,\n value: value\n }\n };\n};\n\nfunction updateClaim(value) {\n return {\n type: actions.CLAIM_UPDATE,\n data: value\n };\n};\n\nfunction setPublishInChannel(channel) {\n return {\n type: actions.SET_PUBLISH_IN_CHANNEL,\n channel: channel\n };\n};\n\nfunction updatePublishStatus(status, message) {\n return {\n type: actions.PUBLISH_STATUS_UPDATE,\n data: {\n status: status,\n message: message\n }\n };\n};\n\nfunction updateError(name, value) {\n return {\n type: actions.ERROR_UPDATE,\n data: {\n name: name,\n value: value\n }\n };\n};\n\nfunction updateSelectedChannel(channelName) {\n return {\n type: actions.SELECTED_CHANNEL_UPDATE,\n data: channelName\n };\n};\n\nfunction toggleMetadataInputs(showMetadataInputs) {\n return {\n type: actions.TOGGLE_METADATA_INPUTS,\n data: showMetadataInputs\n };\n};\n\nfunction onNewThumbnail(file) {\n return {\n type: actions.THUMBNAIL_NEW,\n data: file\n };\n};\n\nfunction startPublish(history) {\n return {\n type: actions.PUBLISH_START,\n data: { history: history }\n };\n}\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar Sequelize = __webpack_require__(59);\nvar logger = __webpack_require__(2);\n\nmodule.exports = function (mysqlConfig) {\n var database = mysqlConfig.database,\n username = mysqlConfig.username,\n password = mysqlConfig.password;\n\n var db = {};\n // set sequelize options\n var sequelize = new Sequelize(database, username, password, {\n host: 'localhost',\n dialect: 'mysql',\n dialectOptions: { decimalNumbers: true }, // fix to ensure DECIMAL will not be stored as a string\n logging: false,\n pool: {\n max: 5,\n min: 0,\n idle: 10000,\n acquire: 10000\n }\n });\n\n // establish mysql connection\n sequelize.authenticate().then(function () {\n logger.info('Sequelize has established mysql connection successfully.');\n }).catch(function (err) {\n logger.error('Sequelize was unable to connect to the database:', err);\n });\n\n // manually add each model to the db object\n var Certificate = __webpack_require__(60);\n var Channel = __webpack_require__(61);\n var Claim = __webpack_require__(62);\n var File = __webpack_require__(63);\n var Request = __webpack_require__(64);\n var User = __webpack_require__(65);\n db['Certificate'] = sequelize.import('Certificate', Certificate);\n db['Channel'] = sequelize.import('Channel', Channel);\n db['Claim'] = sequelize.import('Claim', Claim);\n db['File'] = sequelize.import('File', File);\n db['Request'] = sequelize.import('Request', Request);\n db['User'] = sequelize.import('User', User);\n\n // run model.association for each model in the db object that has an association\n Object.keys(db).forEach(function (modelName) {\n if (db[modelName].associate) {\n logger.info('Associating model:', modelName);\n db[modelName].associate(db);\n }\n });\n\n db.sequelize = sequelize;\n db.Sequelize = Sequelize;\n\n // add an 'upsert' method to the db object\n db.upsert = function (Model, values, condition, tableName) {\n return Model.findOne({\n where: condition\n }).then(function (obj) {\n if (obj) {\n // update\n logger.debug('updating record in db.' + tableName);\n return obj.update(values);\n } else {\n // insert\n logger.debug('creating record in db.' + tableName);\n return Model.create(values);\n }\n }).catch(function (error) {\n logger.error(tableName + '.upsert error', error);\n throw error;\n });\n };\n\n return db;\n};\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _channel = __webpack_require__(19);\n\nvar _view = __webpack_require__(87);\n\nvar _view2 = _interopRequireDefault(_view);\n\nvar _publish = __webpack_require__(5);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapStateToProps = function mapStateToProps(_ref) {\n var channel = _ref.channel;\n\n return {\n channelName: channel.loggedInChannel.name,\n channelShortId: channel.loggedInChannel.shortId,\n channelLongId: channel.loggedInChannel.longId\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch) {\n return {\n onChannelLogin: function onChannelLogin(name, shortId, longId) {\n dispatch((0, _channel.updateLoggedInChannel)(name, shortId, longId));\n dispatch((0, _publish.updateSelectedChannel)(name));\n },\n onChannelLogout: function onChannelLogout() {\n dispatch((0, _channel.updateLoggedInChannel)(null, null, null));\n }\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view2.default);\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.onHandleShowPageUri = onHandleShowPageUri;\nexports.onRequestError = onRequestError;\nexports.onNewChannelRequest = onNewChannelRequest;\nexports.onNewAssetRequest = onNewAssetRequest;\nexports.onRequestUpdate = onRequestUpdate;\nexports.addRequestToRequestList = addRequestToRequestList;\nexports.addAssetToAssetList = addAssetToAssetList;\nexports.addNewChannelToChannelList = addNewChannelToChannelList;\nexports.onUpdateChannelClaims = onUpdateChannelClaims;\nexports.updateChannelClaims = updateChannelClaims;\nexports.fileRequested = fileRequested;\nexports.updateFileAvailability = updateFileAvailability;\nexports.updateDisplayAssetError = updateDisplayAssetError;\n\nvar _show_action_types = __webpack_require__(12);\n\nvar actions = _interopRequireWildcard(_show_action_types);\n\nvar _show_request_types = __webpack_require__(40);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\n// basic request parsing\nfunction onHandleShowPageUri(params) {\n return {\n type: actions.HANDLE_SHOW_URI,\n data: params\n };\n};\n\nfunction onRequestError(error) {\n return {\n type: actions.REQUEST_ERROR,\n data: error\n };\n};\n\nfunction onNewChannelRequest(channelName, channelId) {\n var requestType = _show_request_types.CHANNEL;\n var requestId = 'cr#' + channelName + '#' + channelId;\n return {\n type: actions.CHANNEL_REQUEST_NEW,\n data: { requestType: requestType, requestId: requestId, channelName: channelName, channelId: channelId }\n };\n};\n\nfunction onNewAssetRequest(name, id, channelName, channelId, extension) {\n var requestType = extension ? _show_request_types.ASSET_LITE : _show_request_types.ASSET_DETAILS;\n var requestId = 'ar#' + name + '#' + id + '#' + channelName + '#' + channelId;\n return {\n type: actions.ASSET_REQUEST_NEW,\n data: {\n requestType: requestType,\n requestId: requestId,\n name: name,\n modifier: {\n id: id,\n channel: {\n name: channelName,\n id: channelId\n }\n }\n }\n };\n};\n\nfunction onRequestUpdate(requestType, requestId) {\n return {\n type: actions.REQUEST_UPDATE,\n data: {\n requestType: requestType,\n requestId: requestId\n }\n };\n};\n\nfunction addRequestToRequestList(id, error, key) {\n return {\n type: actions.REQUEST_LIST_ADD,\n data: { id: id, error: error, key: key }\n };\n};\n\n// asset actions\n\nfunction addAssetToAssetList(id, error, name, claimId, shortId, claimData) {\n return {\n type: actions.ASSET_ADD,\n data: { id: id, error: error, name: name, claimId: claimId, shortId: shortId, claimData: claimData }\n };\n}\n\n// channel actions\n\nfunction addNewChannelToChannelList(id, name, shortId, longId, claimsData) {\n return {\n type: actions.CHANNEL_ADD,\n data: { id: id, name: name, shortId: shortId, longId: longId, claimsData: claimsData }\n };\n};\n\nfunction onUpdateChannelClaims(channelKey, name, longId, page) {\n return {\n type: actions.CHANNEL_CLAIMS_UPDATE_ASYNC,\n data: { channelKey: channelKey, name: name, longId: longId, page: page }\n };\n};\n\nfunction updateChannelClaims(channelListId, claimsData) {\n return {\n type: actions.CHANNEL_CLAIMS_UPDATE_SUCCESS,\n data: { channelListId: channelListId, claimsData: claimsData }\n };\n};\n\n// display a file\n\nfunction fileRequested(name, claimId) {\n return {\n type: actions.FILE_REQUESTED,\n data: { name: name, claimId: claimId }\n };\n};\n\nfunction updateFileAvailability(status) {\n return {\n type: actions.FILE_AVAILABILITY_UPDATE,\n data: status\n };\n};\n\nfunction updateDisplayAssetError(error) {\n return {\n type: actions.DISPLAY_ASSET_ERROR,\n data: error\n };\n};\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactHelmet = __webpack_require__(14);\n\nvar _reactHelmet2 = _interopRequireDefault(_reactHelmet);\n\nvar _propTypes = __webpack_require__(10);\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _pageTitle = __webpack_require__(84);\n\nvar _metaTags = __webpack_require__(85);\n\nvar _canonicalLink = __webpack_require__(86);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar SEO = function (_React$Component) {\n _inherits(SEO, _React$Component);\n\n function SEO() {\n _classCallCheck(this, SEO);\n\n return _possibleConstructorReturn(this, (SEO.__proto__ || Object.getPrototypeOf(SEO)).apply(this, arguments));\n }\n\n _createClass(SEO, [{\n key: 'render',\n value: function render() {\n var _props = this.props,\n pageTitle = _props.pageTitle,\n asset = _props.asset,\n channel = _props.channel,\n pageUri = _props.pageUri;\n\n pageTitle = (0, _pageTitle.createPageTitle)(pageTitle);\n var metaTags = (0, _metaTags.createMetaTags)(asset, channel);\n var canonicalLink = (0, _canonicalLink.createCanonicalLink)(asset, channel, pageUri);\n return _react2.default.createElement(_reactHelmet2.default, {\n title: pageTitle,\n meta: metaTags,\n link: [{ rel: 'canonical', href: canonicalLink }]\n });\n }\n }]);\n\n return SEO;\n}(_react2.default.Component);\n\n;\n\nSEO.propTypes = {\n pageTitle: _propTypes2.default.string,\n pageUri: _propTypes2.default.string,\n channel: _propTypes2.default.object,\n asset: _propTypes2.default.object\n};\n\nexports.default = SEO;\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"prop-types\");\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nexports.default = request;\n\n__webpack_require__(90);\n\n/**\n * Parses the JSON returned by a network request\n *\n * @param {object} response A response from a network request\n *\n * @return {object} The parsed JSON from the request\n */\nfunction parseJSON(response) {\n if (response.status === 204 || response.status === 205) {\n return null;\n }\n return response.json();\n}\n\n/**\n * Parses the status returned by a network request\n *\n * @param {object} response A response from a network request\n * @param {object} response The parsed JSON from the network request\n *\n * @return {object | undefined} Returns object with status and statusText, or undefined\n */\nfunction checkStatus(response, jsonResponse) {\n if (response.status >= 200 && response.status < 300) {\n return jsonResponse;\n }\n var error = new Error(jsonResponse.message);\n error.response = response;\n throw error;\n}\n\n/**\n * Requests a URL, returning a promise\n *\n * @param {string} url The URL we want to request\n * @param {object} [options] The options we want to pass to \"fetch\"\n *\n * @return {object} The response data\n */\n\nfunction request(url, options) {\n return fetch(url, options).then(function (response) {\n return Promise.all([response, parseJSON(response)]);\n }).then(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n response = _ref2[0],\n jsonResponse = _ref2[1];\n\n return checkStatus(response, jsonResponse);\n });\n}\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n// request actions\nvar HANDLE_SHOW_URI = exports.HANDLE_SHOW_URI = 'HANDLE_SHOW_URI';\nvar REQUEST_ERROR = exports.REQUEST_ERROR = 'REQUEST_ERROR';\nvar REQUEST_UPDATE = exports.REQUEST_UPDATE = 'REQUEST_UPDATE';\nvar ASSET_REQUEST_NEW = exports.ASSET_REQUEST_NEW = 'ASSET_REQUEST_NEW';\nvar CHANNEL_REQUEST_NEW = exports.CHANNEL_REQUEST_NEW = 'CHANNEL_REQUEST_NEW';\nvar REQUEST_LIST_ADD = exports.REQUEST_LIST_ADD = 'REQUEST_LIST_ADD';\n\n// asset actions\nvar ASSET_ADD = exports.ASSET_ADD = 'ASSET_ADD';\n\n// channel actions\nvar CHANNEL_ADD = exports.CHANNEL_ADD = 'CHANNEL_ADD';\n\nvar CHANNEL_CLAIMS_UPDATE_ASYNC = exports.CHANNEL_CLAIMS_UPDATE_ASYNC = 'CHANNEL_CLAIMS_UPDATE_ASYNC';\nvar CHANNEL_CLAIMS_UPDATE_SUCCESS = exports.CHANNEL_CLAIMS_UPDATE_SUCCESS = 'CHANNEL_CLAIMS_UPDATE_SUCCESS';\n\n// asset/file display actions\nvar FILE_REQUESTED = exports.FILE_REQUESTED = 'FILE_REQUESTED';\nvar FILE_AVAILABILITY_UPDATE = exports.FILE_AVAILABILITY_UPDATE = 'FILE_AVAILABILITY_UPDATE';\nvar DISPLAY_ASSET_ERROR = exports.DISPLAY_ASSET_ERROR = 'DISPLAY_ASSET_ERROR';\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar selectAsset = exports.selectAsset = function selectAsset(show) {\n var request = show.requestList[show.request.id];\n var assetKey = request.key;\n return show.assetList[assetKey];\n};\n\nvar selectShowState = exports.selectShowState = function selectShowState(state) {\n return state.show;\n};\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"react-helmet\");\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"redux-saga/effects\");\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar axios = __webpack_require__(67);\nvar logger = __webpack_require__(2);\nvar config = __webpack_require__(3);\nvar _config$api = config.api,\n apiHost = _config$api.apiHost,\n apiPort = _config$api.apiPort;\n\nvar lbryApiUri = 'http://' + apiHost + ':' + apiPort;\n\nvar _require = __webpack_require__(17),\n chooseGaLbrynetPublishLabel = _require.chooseGaLbrynetPublishLabel,\n sendGATimingEvent = _require.sendGATimingEvent;\n\nvar handleLbrynetResponse = function handleLbrynetResponse(_ref, resolve, reject) {\n var data = _ref.data;\n\n logger.debug('lbry api data:', data);\n if (data.result) {\n // check for an error\n if (data.result.error) {\n logger.debug('Lbrynet api error:', data.result.error);\n reject(new Error(data.result.error));\n return;\n };\n resolve(data.result);\n return;\n }\n // fallback in case it just timed out\n reject(JSON.stringify(data));\n};\n\nmodule.exports = {\n publishClaim: function publishClaim(publishParams) {\n logger.debug('lbryApi >> Publishing claim to \"' + publishParams.name + '\"');\n var gaStartTime = Date.now();\n return new Promise(function (resolve, reject) {\n axios.post(lbryApiUri, {\n method: 'publish',\n params: publishParams\n }).then(function (response) {\n sendGATimingEvent('lbrynet', 'publish', chooseGaLbrynetPublishLabel(publishParams), gaStartTime, Date.now());\n handleLbrynetResponse(response, resolve, reject);\n }).catch(function (error) {\n reject(error);\n });\n });\n },\n getClaim: function getClaim(uri) {\n logger.debug('lbryApi >> Getting Claim for \"' + uri + '\"');\n var gaStartTime = Date.now();\n return new Promise(function (resolve, reject) {\n axios.post(lbryApiUri, {\n method: 'get',\n params: { uri: uri, timeout: 20 }\n }).then(function (response) {\n sendGATimingEvent('lbrynet', 'getClaim', 'GET', gaStartTime, Date.now());\n handleLbrynetResponse(response, resolve, reject);\n }).catch(function (error) {\n reject(error);\n });\n });\n },\n getClaimList: function getClaimList(claimName) {\n logger.debug('lbryApi >> Getting claim_list for \"' + claimName + '\"');\n var gaStartTime = Date.now();\n return new Promise(function (resolve, reject) {\n axios.post(lbryApiUri, {\n method: 'claim_list',\n params: { name: claimName }\n }).then(function (response) {\n sendGATimingEvent('lbrynet', 'getClaimList', 'CLAIM_LIST', gaStartTime, Date.now());\n handleLbrynetResponse(response, resolve, reject);\n }).catch(function (error) {\n reject(error);\n });\n });\n },\n resolveUri: function resolveUri(uri) {\n logger.debug('lbryApi >> Resolving URI for \"' + uri + '\"');\n var gaStartTime = Date.now();\n return new Promise(function (resolve, reject) {\n axios.post(lbryApiUri, {\n method: 'resolve',\n params: { uri: uri }\n }).then(function (_ref2) {\n var data = _ref2.data;\n\n sendGATimingEvent('lbrynet', 'resolveUri', 'RESOLVE', gaStartTime, Date.now());\n if (data.result[uri].error) {\n // check for errors\n reject(data.result[uri].error);\n } else {\n // if no errors, resolve\n resolve(data.result[uri]);\n }\n }).catch(function (error) {\n reject(error);\n });\n });\n },\n getDownloadDirectory: function getDownloadDirectory() {\n logger.debug('lbryApi >> Retrieving the download directory path from lbry daemon...');\n var gaStartTime = Date.now();\n return new Promise(function (resolve, reject) {\n axios.post(lbryApiUri, {\n method: 'settings_get'\n }).then(function (_ref3) {\n var data = _ref3.data;\n\n sendGATimingEvent('lbrynet', 'getDownloadDirectory', 'SETTINGS_GET', gaStartTime, Date.now());\n if (data.result) {\n resolve(data.result.download_directory);\n } else {\n return new Error('Successfully connected to lbry daemon, but unable to retrieve the download directory.');\n }\n }).catch(function (error) {\n logger.error('Lbrynet Error:', error);\n resolve('/home/lbry/Downloads/');\n });\n });\n },\n createChannel: function createChannel(name) {\n logger.debug('lbryApi >> Creating channel for ' + name + '...');\n var gaStartTime = Date.now();\n return new Promise(function (resolve, reject) {\n axios.post(lbryApiUri, {\n method: 'channel_new',\n params: {\n channel_name: name,\n amount: 0.1\n }\n }).then(function (response) {\n sendGATimingEvent('lbrynet', 'createChannel', 'CHANNEL_NEW', gaStartTime, Date.now());\n handleLbrynetResponse(response, resolve, reject);\n }).catch(function (error) {\n reject(error);\n });\n });\n }\n};\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar logger = __webpack_require__(2);\nvar ua = __webpack_require__(68);\n\nvar _require = __webpack_require__(3),\n googleId = _require.analytics.googleId,\n siteName = _require.site.name;\n\nfunction createServeEventParams(headers, ip, originalUrl) {\n return {\n eventCategory: 'client requests',\n eventAction: 'serve request',\n eventLabel: originalUrl,\n ipOverride: ip,\n userAgentOverride: headers['user-agent']\n };\n};\n\nfunction createPublishTimingEventParams(category, variable, label, startTime, endTime) {\n var duration = endTime - startTime;\n return {\n userTimingCategory: category,\n userTimingVariableName: variable,\n userTimingTime: duration,\n userTimingLabel: label\n };\n};\n\nfunction sendGoogleAnalyticsEvent(ip, params) {\n var visitorId = ip.replace(/\\./g, '-');\n var visitor = ua(googleId, visitorId, { strictCidFormat: false, https: true });\n visitor.event(params, function (err) {\n if (err) {\n logger.error('Google Analytics Event Error >>', err);\n }\n });\n};\n\nfunction sendGoogleAnalyticsTiming(visitorId, params) {\n var visitor = ua(googleId, visitorId, { strictCidFormat: false, https: true });\n visitor.timing(params, function (err) {\n if (err) {\n logger.error('Google Analytics Event Error >>', err);\n }\n logger.debug('Timing event successfully sent to google analytics');\n });\n};\n\nmodule.exports = {\n sendGAServeEvent: function sendGAServeEvent(headers, ip, originalUrl) {\n var params = createServeEventParams(headers, ip, originalUrl);\n sendGoogleAnalyticsEvent(ip, params);\n },\n sendGATimingEvent: function sendGATimingEvent(category, variable, label, startTime, endTime) {\n var params = createPublishTimingEventParams(category, variable, label, startTime, endTime);\n sendGoogleAnalyticsTiming(siteName, params);\n },\n chooseGaLbrynetPublishLabel: function chooseGaLbrynetPublishLabel(_ref) {\n var channelName = _ref.channel_name,\n channelId = _ref.channel_id;\n\n return channelName || channelId ? 'PUBLISH_IN_CHANNEL_CLAIM' : 'PUBLISH_ANONYMOUS_CLAIM';\n }\n};\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"redux\");\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.updateLoggedInChannel = updateLoggedInChannel;\n\nvar _channel_action_types = __webpack_require__(33);\n\nvar actions = _interopRequireWildcard(_channel_action_types);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\n// export action creators\n\nfunction updateLoggedInChannel(name, shortId, longId) {\n return {\n type: actions.CHANNEL_UPDATE,\n data: {\n name: name,\n shortId: shortId,\n longId: longId\n }\n };\n};\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = __webpack_require__(10);\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _ActiveStatusBar = __webpack_require__(112);\n\nvar _ActiveStatusBar2 = _interopRequireDefault(_ActiveStatusBar);\n\nvar _InactiveStatusBar = __webpack_require__(113);\n\nvar _InactiveStatusBar2 = _interopRequireDefault(_InactiveStatusBar);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ProgressBar = function (_React$Component) {\n _inherits(ProgressBar, _React$Component);\n\n function ProgressBar(props) {\n _classCallCheck(this, ProgressBar);\n\n var _this = _possibleConstructorReturn(this, (ProgressBar.__proto__ || Object.getPrototypeOf(ProgressBar)).call(this, props));\n\n _this.state = {\n bars: [],\n index: 0,\n incrementer: 1\n };\n _this.createBars = _this.createBars.bind(_this);\n _this.startProgressBar = _this.startProgressBar.bind(_this);\n _this.updateProgressBar = _this.updateProgressBar.bind(_this);\n _this.stopProgressBar = _this.stopProgressBar.bind(_this);\n return _this;\n }\n\n _createClass(ProgressBar, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.createBars();\n this.startProgressBar();\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n this.stopProgressBar();\n }\n }, {\n key: 'createBars',\n value: function createBars() {\n var bars = [];\n for (var i = 0; i <= this.props.size; i++) {\n bars.push({ isActive: false });\n }\n this.setState({ bars: bars });\n }\n }, {\n key: 'startProgressBar',\n value: function startProgressBar() {\n this.updateInterval = setInterval(this.updateProgressBar.bind(this), 300);\n }\n }, {\n key: 'updateProgressBar',\n value: function updateProgressBar() {\n var index = this.state.index;\n var incrementer = this.state.incrementer;\n var bars = this.state.bars;\n // flip incrementer if necessary, to stay in bounds\n if (index < 0 || index > this.props.size) {\n incrementer = incrementer * -1;\n index += incrementer;\n }\n // update the indexed bar\n if (incrementer > 0) {\n bars[index].isActive = true;\n } else {\n bars[index].isActive = false;\n };\n // increment index\n index += incrementer;\n // update state\n this.setState({\n bars: bars,\n incrementer: incrementer,\n index: index\n });\n }\n }, {\n key: 'stopProgressBar',\n value: function stopProgressBar() {\n clearInterval(this.updateInterval);\n }\n }, {\n key: 'render',\n value: function render() {\n return _react2.default.createElement(\n 'div',\n null,\n this.state.bars.map(function (bar, index) {\n return bar.isActive ? _react2.default.createElement(_ActiveStatusBar2.default, { key: index }) : _react2.default.createElement(_InactiveStatusBar2.default, { key: index });\n })\n );\n }\n }]);\n\n return ProgressBar;\n}(_react2.default.Component);\n\n;\n\nProgressBar.propTypes = {\n size: _propTypes2.default.number.isRequired\n};\n\nexports.default = ProgressBar;\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = __webpack_require__(10);\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _NavBar = __webpack_require__(7);\n\nvar _NavBar2 = _interopRequireDefault(_NavBar);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ErrorPage = function (_React$Component) {\n _inherits(ErrorPage, _React$Component);\n\n function ErrorPage() {\n _classCallCheck(this, ErrorPage);\n\n return _possibleConstructorReturn(this, (ErrorPage.__proto__ || Object.getPrototypeOf(ErrorPage)).apply(this, arguments));\n }\n\n _createClass(ErrorPage, [{\n key: 'render',\n value: function render() {\n var error = this.props.error;\n\n return _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(_NavBar2.default, null),\n _react2.default.createElement(\n 'div',\n { className: 'row row--padded' },\n _react2.default.createElement(\n 'p',\n null,\n error\n )\n )\n );\n }\n }]);\n\n return ErrorPage;\n}(_react2.default.Component);\n\n;\n\nErrorPage.propTypes = {\n error: _propTypes2.default.string.isRequired\n};\n\nexports.default = ErrorPage;\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"passport\");\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nmodule.exports = {\n returnShortId: function returnShortId(claimsArray, longId) {\n var claimIndex = void 0;\n var shortId = longId.substring(0, 1); // default short id is the first letter\n var shortIdLength = 0;\n // find the index of this claim id\n claimIndex = claimsArray.findIndex(function (element) {\n return element.claimId === longId;\n });\n if (claimIndex < 0) {\n throw new Error('claim id not found in claims list');\n }\n // get an array of all claims with lower height\n var possibleMatches = claimsArray.slice(0, claimIndex);\n // remove certificates with the same prefixes until none are left.\n while (possibleMatches.length > 0) {\n shortIdLength += 1;\n shortId = longId.substring(0, shortIdLength);\n possibleMatches = possibleMatches.filter(function (element) {\n return element.claimId && element.claimId.substring(0, shortIdLength) === shortId;\n });\n }\n return shortId;\n }\n};\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"passport-local\");\n\n/***/ }),\n/* 25 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar logger = __webpack_require__(2);\nvar fs = __webpack_require__(74);\n\nvar _require = __webpack_require__(3),\n site = _require.site,\n wallet = _require.wallet,\n publish = _require.publish;\n\nmodule.exports = {\n parsePublishApiRequestBody: function parsePublishApiRequestBody(_ref) {\n var name = _ref.name,\n nsfw = _ref.nsfw,\n license = _ref.license,\n title = _ref.title,\n description = _ref.description,\n thumbnail = _ref.thumbnail;\n\n // validate name\n if (!name) {\n throw new Error('no name field found in request');\n }\n var invalidNameCharacters = /[^A-Za-z0-9,-]/.exec(name);\n if (invalidNameCharacters) {\n throw new Error('The claim name you provided is not allowed. Only the following characters are allowed: A-Z, a-z, 0-9, and \"-\"');\n }\n // optional parameters\n nsfw = nsfw === 'true';\n license = license || null;\n title = title || null;\n description = description || null;\n thumbnail = thumbnail || null;\n // return results\n return {\n name: name,\n nsfw: nsfw,\n license: license,\n title: title,\n description: description,\n thumbnail: thumbnail\n };\n },\n parsePublishApiRequestFiles: function parsePublishApiRequestFiles(_ref2) {\n var file = _ref2.file,\n thumbnail = _ref2.thumbnail;\n\n // make sure a file was provided\n if (!file) {\n throw new Error('no file with key of [file] found in request');\n }\n if (!file.path) {\n throw new Error('no file path found');\n }\n if (!file.type) {\n throw new Error('no file type found');\n }\n if (!file.size) {\n throw new Error('no file type found');\n }\n // validate the file name\n if (/'/.test(file.name)) {\n throw new Error('apostrophes are not allowed in the file name');\n }\n // validate the file\n module.exports.validateFileTypeAndSize(file);\n // return results\n return {\n fileName: file.name,\n filePath: file.path,\n fileType: file.type,\n thumbnailFileName: thumbnail ? thumbnail.name : null,\n thumbnailFilePath: thumbnail ? thumbnail.path : null,\n thumbnailFileType: thumbnail ? thumbnail.type : null\n };\n },\n validateFileTypeAndSize: function validateFileTypeAndSize(file) {\n // check file type and size\n switch (file.type) {\n case 'image/jpeg':\n case 'image/jpg':\n case 'image/png':\n if (file.size > 10000000) {\n logger.debug('publish > file validation > .jpeg/.jpg/.png was too big');\n throw new Error('Sorry, images are limited to 10 megabytes.');\n }\n break;\n case 'image/gif':\n if (file.size > 50000000) {\n logger.debug('publish > file validation > .gif was too big');\n throw new Error('Sorry, .gifs are limited to 50 megabytes.');\n }\n break;\n case 'video/mp4':\n if (file.size > 50000000) {\n logger.debug('publish > file validation > .mp4 was too big');\n throw new Error('Sorry, videos are limited to 50 megabytes.');\n }\n break;\n default:\n logger.debug('publish > file validation > unrecognized file type');\n throw new Error('The ' + file.type + ' content type is not supported. Only, .jpeg, .png, .gif, and .mp4 files are currently supported.');\n }\n return file;\n },\n createBasicPublishParams: function createBasicPublishParams(filePath, name, title, description, license, nsfw, thumbnail) {\n logger.debug('Creating Publish Parameters');\n // provide defaults for title\n if (title === null || title.trim() === '') {\n title = name;\n }\n // provide default for description\n if (description === null || description.trim() === '') {\n description = '';\n }\n // provide default for license\n if (license === null || license.trim() === '') {\n license = ' '; // default to empty string\n }\n // create the publish params\n var publishParams = {\n name: name,\n file_path: filePath,\n bid: 0.01,\n metadata: {\n description: description,\n title: title,\n author: site.title,\n language: 'en',\n license: license,\n nsfw: nsfw\n },\n claim_address: wallet.lbryClaimAddress\n };\n // add thumbnail to channel if video\n if (thumbnail) {\n publishParams['metadata']['thumbnail'] = thumbnail;\n }\n return publishParams;\n },\n createThumbnailPublishParams: function createThumbnailPublishParams(thumbnailFilePath, claimName, license, nsfw) {\n if (!thumbnailFilePath) {\n return;\n }\n logger.debug('Creating Thumbnail Publish Parameters');\n // create the publish params\n return {\n name: claimName + '-thumb',\n file_path: thumbnailFilePath,\n bid: 0.01,\n metadata: {\n title: claimName + ' thumbnail',\n description: 'a thumbnail for ' + claimName,\n author: site.title,\n language: 'en',\n license: license,\n nsfw: nsfw\n },\n claim_address: wallet.lbryClaimAddress,\n channel_name: publish.thumbnailChannel,\n channel_id: publish.thumbnailChannelId\n };\n },\n deleteTemporaryFile: function deleteTemporaryFile(filePath) {\n fs.unlink(filePath, function (err) {\n if (err) {\n logger.error('error deleting temporary file ' + filePath);\n throw err;\n }\n logger.debug('successfully deleted ' + filePath);\n });\n },\n addGetResultsToFileData: function addGetResultsToFileData(fileInfo, getResult) {\n fileInfo.fileName = getResult.file_name;\n fileInfo.filePath = getResult.download_path;\n return fileInfo;\n },\n createFileData: function createFileData(_ref3) {\n var name = _ref3.name,\n claimId = _ref3.claimId,\n outpoint = _ref3.outpoint,\n height = _ref3.height,\n address = _ref3.address,\n nsfw = _ref3.nsfw,\n contentType = _ref3.contentType;\n\n return {\n name: name,\n claimId: claimId,\n outpoint: outpoint,\n height: height,\n address: address,\n fileName: '',\n filePath: '',\n fileType: contentType,\n nsfw: nsfw\n };\n }\n};\n\n/***/ }),\n/* 26 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar logger = __webpack_require__(2);\n\nmodule.exports = {\n handleErrorResponse: function handleErrorResponse(originalUrl, ip, error, res) {\n logger.error('Error on ' + originalUrl, module.exports.useObjectPropertiesIfNoKeys(error));\n\n var _module$exports$retur = module.exports.returnErrorMessageAndStatus(error),\n _module$exports$retur2 = _slicedToArray(_module$exports$retur, 2),\n status = _module$exports$retur2[0],\n message = _module$exports$retur2[1];\n\n res.status(status).json(module.exports.createErrorResponsePayload(status, message));\n },\n returnErrorMessageAndStatus: function returnErrorMessageAndStatus(error) {\n var status = void 0,\n message = void 0;\n // check for daemon being turned off\n if (error.code === 'ECONNREFUSED') {\n status = 503;\n message = 'Connection refused. The daemon may not be running.';\n // fallback for everything else\n } else {\n status = 400;\n if (error.message) {\n message = error.message;\n } else {\n message = error;\n };\n };\n return [status, message];\n },\n useObjectPropertiesIfNoKeys: function useObjectPropertiesIfNoKeys(err) {\n if (Object.keys(err).length === 0) {\n var newErrorObject = {};\n Object.getOwnPropertyNames(err).forEach(function (key) {\n newErrorObject[key] = err[key];\n });\n return newErrorObject;\n }\n return err;\n },\n createErrorResponsePayload: function createErrorResponsePayload(status, message) {\n return {\n status: status,\n success: false,\n message: message\n };\n }\n};\n\n/***/ }),\n/* 27 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar db = __webpack_require__(6);\nvar logger = __webpack_require__(2);\n\nvar _require = __webpack_require__(76),\n returnPaginatedChannelClaims = _require.returnPaginatedChannelClaims;\n\nvar NO_CHANNEL = 'NO_CHANNEL';\nvar NO_CLAIM = 'NO_CLAIM';\nvar NO_FILE = 'NO_FILE';\n\nmodule.exports = {\n getClaimId: function getClaimId(channelName, channelClaimId, name, claimId) {\n if (channelName) {\n return module.exports.getClaimIdByChannel(channelName, channelClaimId, name);\n } else {\n return module.exports.getClaimIdByClaim(name, claimId);\n }\n },\n getClaimIdByClaim: function getClaimIdByClaim(claimName, claimId) {\n logger.debug('getClaimIdByClaim(' + claimName + ', ' + claimId + ')');\n return new Promise(function (resolve, reject) {\n db.Claim.getLongClaimId(claimName, claimId).then(function (longClaimId) {\n if (!longClaimId) {\n resolve(NO_CLAIM);\n }\n resolve(longClaimId);\n }).catch(function (error) {\n reject(error);\n });\n });\n },\n getClaimIdByChannel: function getClaimIdByChannel(channelName, channelClaimId, claimName) {\n logger.debug('getClaimIdByChannel(' + channelName + ', ' + channelClaimId + ', ' + claimName + ')');\n return new Promise(function (resolve, reject) {\n db.Certificate.getLongChannelId(channelName, channelClaimId) // 1. get the long channel id\n .then(function (longChannelId) {\n if (!longChannelId) {\n return [null, null];\n }\n return Promise.all([longChannelId, db.Claim.getClaimIdByLongChannelId(longChannelId, claimName)]); // 2. get the long claim id\n }).then(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n longChannelId = _ref2[0],\n longClaimId = _ref2[1];\n\n if (!longChannelId) {\n return resolve(NO_CHANNEL);\n }\n if (!longClaimId) {\n return resolve(NO_CLAIM);\n }\n resolve(longClaimId);\n }).catch(function (error) {\n reject(error);\n });\n });\n },\n getChannelData: function getChannelData(channelName, channelClaimId, page) {\n return new Promise(function (resolve, reject) {\n // 1. get the long channel Id (make sure channel exists)\n db.Certificate.getLongChannelId(channelName, channelClaimId).then(function (longChannelClaimId) {\n if (!longChannelClaimId) {\n return [null, null, null];\n }\n // 2. get the short ID and all claims for that channel\n return Promise.all([longChannelClaimId, db.Certificate.getShortChannelIdFromLongChannelId(longChannelClaimId, channelName)]);\n }).then(function (_ref3) {\n var _ref4 = _slicedToArray(_ref3, 2),\n longChannelClaimId = _ref4[0],\n shortChannelClaimId = _ref4[1];\n\n if (!longChannelClaimId) {\n return resolve(NO_CHANNEL);\n }\n // 3. return all the channel information\n resolve({\n channelName: channelName,\n longChannelClaimId: longChannelClaimId,\n shortChannelClaimId: shortChannelClaimId\n });\n }).catch(function (error) {\n reject(error);\n });\n });\n },\n getChannelClaims: function getChannelClaims(channelName, channelClaimId, page) {\n return new Promise(function (resolve, reject) {\n // 1. get the long channel Id (make sure channel exists)\n db.Certificate.getLongChannelId(channelName, channelClaimId).then(function (longChannelClaimId) {\n if (!longChannelClaimId) {\n return [null, null, null];\n }\n // 2. get the short ID and all claims for that channel\n return Promise.all([longChannelClaimId, db.Claim.getAllChannelClaims(longChannelClaimId)]);\n }).then(function (_ref5) {\n var _ref6 = _slicedToArray(_ref5, 2),\n longChannelClaimId = _ref6[0],\n channelClaimsArray = _ref6[1];\n\n if (!longChannelClaimId) {\n return resolve(NO_CHANNEL);\n }\n // 3. format the data for the view, including pagination\n var paginatedChannelViewData = returnPaginatedChannelClaims(channelName, longChannelClaimId, channelClaimsArray, page);\n // 4. return all the channel information and contents\n resolve(paginatedChannelViewData);\n }).catch(function (error) {\n reject(error);\n });\n });\n },\n getLocalFileRecord: function getLocalFileRecord(claimId, name) {\n return db.File.findOne({ where: { claimId: claimId, name: name } }).then(function (file) {\n if (!file) {\n return NO_FILE;\n }\n return file.dataValues;\n });\n }\n};\n\n/***/ }),\n/* 28 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _server = __webpack_require__(29);\n\nvar _redux = __webpack_require__(18);\n\nvar _reducers = __webpack_require__(30);\n\nvar _reducers2 = _interopRequireDefault(_reducers);\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _reactRouterDom = __webpack_require__(4);\n\nvar _GAListener = __webpack_require__(35);\n\nvar _GAListener2 = _interopRequireDefault(_GAListener);\n\nvar _app = __webpack_require__(36);\n\nvar _app2 = _interopRequireDefault(_app);\n\nvar _renderFullPage = __webpack_require__(42);\n\nvar _renderFullPage2 = _interopRequireDefault(_renderFullPage);\n\nvar _reactHelmet = __webpack_require__(14);\n\nvar _reactHelmet2 = _interopRequireDefault(_reactHelmet);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nmodule.exports = function (req, res) {\n var context = {};\n\n // create a new Redux store instance\n var store = (0, _redux.createStore)(_reducers2.default);\n\n // render component to a string\n var html = (0, _server.renderToString)(_react2.default.createElement(\n _reactRedux.Provider,\n { store: store },\n _react2.default.createElement(\n _reactRouterDom.StaticRouter,\n { location: req.url, context: context },\n _react2.default.createElement(\n _GAListener2.default,\n null,\n _react2.default.createElement(_app2.default, null)\n )\n )\n ));\n\n // get head tags from helmet\n var helmet = _reactHelmet2.default.renderStatic();\n\n // check for a redirect\n if (context.url) {\n // Somewhere a `` was rendered\n return res.redirect(301, context.url);\n } else {}\n // we're good, send the response\n\n\n // get the initial state from our Redux store\n var preloadedState = store.getState();\n\n // send the rendered page back to the client\n res.send((0, _renderFullPage2.default)(helmet, html, preloadedState));\n};\n\n/***/ }),\n/* 29 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"react-dom/server\");\n\n/***/ }),\n/* 30 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _redux = __webpack_require__(18);\n\nvar _publish = __webpack_require__(78);\n\nvar _publish2 = _interopRequireDefault(_publish);\n\nvar _channel = __webpack_require__(79);\n\nvar _channel2 = _interopRequireDefault(_channel);\n\nvar _show = __webpack_require__(80);\n\nvar _show2 = _interopRequireDefault(_show);\n\nvar _site = __webpack_require__(81);\n\nvar _site2 = _interopRequireDefault(_site);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = (0, _redux.combineReducers)({\n channel: _channel2.default,\n publish: _publish2.default,\n show: _show2.default,\n site: _site2.default\n});\n\n/***/ }),\n/* 31 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar FILE_SELECTED = exports.FILE_SELECTED = 'FILE_SELECTED';\nvar FILE_CLEAR = exports.FILE_CLEAR = 'FILE_CLEAR';\nvar METADATA_UPDATE = exports.METADATA_UPDATE = 'METADATA_UPDATE';\nvar CLAIM_UPDATE = exports.CLAIM_UPDATE = 'CLAIM_UPDATE';\nvar SET_PUBLISH_IN_CHANNEL = exports.SET_PUBLISH_IN_CHANNEL = 'SET_PUBLISH_IN_CHANNEL';\nvar PUBLISH_STATUS_UPDATE = exports.PUBLISH_STATUS_UPDATE = 'PUBLISH_STATUS_UPDATE';\nvar ERROR_UPDATE = exports.ERROR_UPDATE = 'ERROR_UPDATE';\nvar SELECTED_CHANNEL_UPDATE = exports.SELECTED_CHANNEL_UPDATE = 'SELECTED_CHANNEL_UPDATE';\nvar TOGGLE_METADATA_INPUTS = exports.TOGGLE_METADATA_INPUTS = 'TOGGLE_METADATA_INPUTS';\nvar THUMBNAIL_NEW = exports.THUMBNAIL_NEW = 'THUMBNAIL_NEW';\nvar PUBLISH_START = exports.PUBLISH_START = 'PUBLISH_START';\n\n/***/ }),\n/* 32 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar LOGIN = exports.LOGIN = 'Existing';\nvar CREATE = exports.CREATE = 'New';\n\n/***/ }),\n/* 33 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar CHANNEL_UPDATE = exports.CHANNEL_UPDATE = 'CHANNEL_UPDATE';\n\n/***/ }),\n/* 34 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar LOCAL_CHECK = exports.LOCAL_CHECK = 'LOCAL_CHECK';\nvar UNAVAILABLE = exports.UNAVAILABLE = 'UNAVAILABLE';\nvar ERROR = exports.ERROR = 'ERROR';\nvar AVAILABLE = exports.AVAILABLE = 'AVAILABLE';\n\n/***/ }),\n/* 35 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactGa = __webpack_require__(82);\n\nvar _reactGa2 = _interopRequireDefault(_reactGa);\n\nvar _reactRouterDom = __webpack_require__(4);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar config = __webpack_require__(3);\nvar googleApiKey = config.analytics.googleId;\n\n_reactGa2.default.initialize(googleApiKey);\n\nvar GAListener = function (_React$Component) {\n _inherits(GAListener, _React$Component);\n\n function GAListener() {\n _classCallCheck(this, GAListener);\n\n return _possibleConstructorReturn(this, (GAListener.__proto__ || Object.getPrototypeOf(GAListener)).apply(this, arguments));\n }\n\n _createClass(GAListener, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.sendPageView(this.props.history.location);\n this.props.history.listen(this.sendPageView);\n }\n }, {\n key: 'sendPageView',\n value: function sendPageView(location) {\n _reactGa2.default.set({ page: location.pathname });\n _reactGa2.default.pageview(location.pathname);\n }\n }, {\n key: 'render',\n value: function render() {\n return this.props.children;\n }\n }]);\n\n return GAListener;\n}(_react2.default.Component);\n\nexports.default = (0, _reactRouterDom.withRouter)(GAListener);\n\n/***/ }),\n/* 36 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactRouterDom = __webpack_require__(4);\n\nvar _HomePage = __webpack_require__(83);\n\nvar _HomePage2 = _interopRequireDefault(_HomePage);\n\nvar _AboutPage = __webpack_require__(117);\n\nvar _AboutPage2 = _interopRequireDefault(_AboutPage);\n\nvar _LoginPage = __webpack_require__(118);\n\nvar _LoginPage2 = _interopRequireDefault(_LoginPage);\n\nvar _ShowPage = __webpack_require__(120);\n\nvar _ShowPage2 = _interopRequireDefault(_ShowPage);\n\nvar _FourOhFourPage = __webpack_require__(136);\n\nvar _FourOhFourPage2 = _interopRequireDefault(_FourOhFourPage);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar App = function App() {\n return _react2.default.createElement(\n _reactRouterDom.Switch,\n null,\n _react2.default.createElement(_reactRouterDom.Route, { exact: true, path: '/', component: _HomePage2.default }),\n _react2.default.createElement(_reactRouterDom.Route, { exact: true, path: '/about', component: _AboutPage2.default }),\n _react2.default.createElement(_reactRouterDom.Route, { exact: true, path: '/login', component: _LoginPage2.default }),\n _react2.default.createElement(_reactRouterDom.Route, { exact: true, path: '/:identifier/:claim', component: _ShowPage2.default }),\n _react2.default.createElement(_reactRouterDom.Route, { exact: true, path: '/:claim', component: _ShowPage2.default }),\n _react2.default.createElement(_reactRouterDom.Route, { component: _FourOhFourPage2.default })\n );\n};\n\nexports.default = App;\n\n/***/ }),\n/* 37 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _publish = __webpack_require__(5);\n\nvar _view = __webpack_require__(93);\n\nvar _view2 = _interopRequireDefault(_view);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapStateToProps = function mapStateToProps(_ref) {\n var publish = _ref.publish;\n\n return {\n file: publish.file,\n thumbnail: publish.thumbnail,\n fileError: publish.error.file\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch) {\n return {\n selectFile: function selectFile(file) {\n dispatch((0, _publish.selectFile)(file));\n },\n setFileError: function setFileError(value) {\n dispatch((0, _publish.clearFile)());\n dispatch((0, _publish.updateError)('file', value));\n }\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view2.default);\n\n/***/ }),\n/* 38 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _channel = __webpack_require__(19);\n\nvar _view = __webpack_require__(110);\n\nvar _view2 = _interopRequireDefault(_view);\n\nvar _publish = __webpack_require__(5);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch) {\n return {\n onChannelLogin: function onChannelLogin(name, shortId, longId) {\n dispatch((0, _channel.updateLoggedInChannel)(name, shortId, longId));\n dispatch((0, _publish.updateSelectedChannel)(name));\n }\n };\n};\n\nexports.default = (0, _reactRedux.connect)(null, mapDispatchToProps)(_view2.default);\n\n/***/ }),\n/* 39 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _channel = __webpack_require__(19);\n\nvar _view = __webpack_require__(111);\n\nvar _view2 = _interopRequireDefault(_view);\n\nvar _publish = __webpack_require__(5);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch) {\n return {\n onChannelLogin: function onChannelLogin(name, shortId, longId) {\n dispatch((0, _channel.updateLoggedInChannel)(name, shortId, longId));\n dispatch((0, _publish.updateSelectedChannel)(name));\n }\n };\n};\n\nexports.default = (0, _reactRedux.connect)(null, mapDispatchToProps)(_view2.default);\n\n/***/ }),\n/* 40 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar CHANNEL = exports.CHANNEL = 'CHANNEL';\nvar ASSET_LITE = exports.ASSET_LITE = 'ASSET_LITE';\nvar ASSET_DETAILS = exports.ASSET_DETAILS = 'ASSET_DETAILS';\n\n/***/ }),\n/* 41 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _view = __webpack_require__(124);\n\nvar _view2 = _interopRequireDefault(_view);\n\nvar _show = __webpack_require__(8);\n\nvar _show2 = __webpack_require__(13);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapStateToProps = function mapStateToProps(_ref) {\n var show = _ref.show;\n\n // select error and status\n var error = show.displayAsset.error;\n var status = show.displayAsset.status;\n // select asset\n var asset = (0, _show2.selectAsset)(show);\n // return props\n return {\n error: error,\n status: status,\n asset: asset\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch) {\n return {\n onFileRequest: function onFileRequest(name, claimId) {\n dispatch((0, _show.fileRequested)(name, claimId));\n }\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view2.default);\n\n/***/ }),\n/* 42 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nmodule.exports = function (helmet, html, preloadedState) {\n // take the html and preloadedState and return the full page\n return '\\n \\n \\n \\n \\n \\n \\n \\n ' + helmet.title.toString() + '\\n ' + helmet.meta.toString() + '\\n ' + helmet.link.toString() + '\\n \\n \\n \\n \\n \\n \\n \\n \\n
\\n
' + html + '
\\n
\\n \\n \\n \\n \\n ';\n};\n\n/***/ }),\n/* 43 */\n/***/ (function(module, exports, __webpack_require__) {\n\n__webpack_require__(44);\n__webpack_require__(45);\nmodule.exports = __webpack_require__(46);\n\n\n/***/ }),\n/* 44 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"babel-polyfill\");\n\n/***/ }),\n/* 45 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"whatwg-fetch\");\n\n/***/ }),\n/* 46 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n// load dependencies\nvar express = __webpack_require__(47);\nvar bodyParser = __webpack_require__(48);\nvar expressHandlebars = __webpack_require__(49);\nvar Handlebars = __webpack_require__(50);\n\nvar _require = __webpack_require__(51),\n populateLocalsDotUser = _require.populateLocalsDotUser,\n serializeSpeechUser = _require.serializeSpeechUser,\n deserializeSpeechUser = _require.deserializeSpeechUser;\n\nvar config = __webpack_require__(3);\nvar logger = __webpack_require__(2);\nvar helmet = __webpack_require__(52);\nvar PORT = 3000; // set port\nvar app = express(); // create an Express application\nvar passport = __webpack_require__(22);\nvar cookieSession = __webpack_require__(53);\n\n// configure logging\nvar logLevel = config.logging.logLevel;\n__webpack_require__(54)(logger, logLevel);\n__webpack_require__(55)(logger);\n\n// check for global config variables\n__webpack_require__(57)();\n\n// trust the proxy to get ip address for us\napp.enable('trust proxy');\n\n// add middleware\napp.use(helmet()); // set HTTP headers to protect against well-known web vulnerabilties\napp.use(express.static(__dirname + '/public')); // 'express.static' to serve static files from public directory\napp.use(bodyParser.json()); // 'body parser' for parsing application/json\napp.use(bodyParser.urlencoded({ extended: true })); // 'body parser' for parsing application/x-www-form-urlencoded\napp.use(function (req, res, next) {\n // custom logging middleware to log all incoming http requests\n logger.verbose('Request on ' + req.originalUrl + ' from ' + req.ip);\n next();\n});\n\n// configure passport\npassport.serializeUser(serializeSpeechUser);\npassport.deserializeUser(deserializeSpeechUser);\nvar localSignupStrategy = __webpack_require__(58);\nvar localLoginStrategy = __webpack_require__(69);\npassport.use('local-signup', localSignupStrategy);\npassport.use('local-login', localLoginStrategy);\n// initialize passport\napp.use(cookieSession({\n name: 'session',\n keys: [config.session.sessionKey],\n maxAge: 24 * 60 * 60 * 1000 // 24 hours\n}));\napp.use(passport.initialize());\napp.use(passport.session());\n\n// configure handlebars & register it with express app\nvar hbs = expressHandlebars.create({\n defaultLayout: 'embed', // sets the default layout\n handlebars: Handlebars // includes basic handlebars for access to that library\n});\napp.engine('handlebars', hbs.engine);\napp.set('view engine', 'handlebars');\n\n// middleware to pass user info back to client (for handlebars access), if user is logged in\napp.use(populateLocalsDotUser);\n\n// start the server\nvar start = function start(config) {\n var mysqlConfig = config.mysqlConfig;\n\n var db = __webpack_require__(6)(mysqlConfig); // require our models for syncing\n db.sequelize\n // sync sequelize\n .sync()\n // require routes\n .then(function () {\n __webpack_require__(70)(app);\n __webpack_require__(71)(app);\n __webpack_require__(77)(app);\n __webpack_require__(137)(app);\n __webpack_require__(148)(app);\n var http = __webpack_require__(149);\n return http.Server(app);\n })\n // start the server\n .then(function (server) {\n server.listen(PORT, function () {\n logger.info('Trusting proxy?', app.get('trust proxy'));\n logger.info('Server is listening on PORT ' + PORT);\n });\n }).catch(function (error) {\n logger.error('Startup Error:', error);\n });\n};\n\nmodule.exports = {\n speak: function speak(something) {\n console.log(something);\n },\n\n start: start\n};\n\n/***/ }),\n/* 47 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"express\");\n\n/***/ }),\n/* 48 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"body-parser\");\n\n/***/ }),\n/* 49 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"express-handlebars\");\n\n/***/ }),\n/* 50 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"handlebars\");\n\n/***/ }),\n/* 51 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n// const db = require('../models'); // require our models for syncing\nvar logger = __webpack_require__(2);\n\nmodule.exports = {\n populateLocalsDotUser: function populateLocalsDotUser(req, res, next) {\n if (req.user) {\n logger.debug('populating res.locals.user');\n res.locals.user = {\n id: req.user.id,\n userName: req.user.userName,\n channelName: req.user.channelName,\n channelClaimId: req.user.channelClaimId,\n shortChannelId: req.user.shortChannelId\n };\n }\n next();\n },\n serializeSpeechUser: function serializeSpeechUser(user, done) {\n // returns user data to be serialized into session\n logger.debug('serializing user');\n done(null, user);\n },\n deserializeSpeechUser: function deserializeSpeechUser(user, done) {\n // deserializes session and populates additional info to req.user\n logger.debug('deserializing user');\n done(null, user);\n }\n};\n\n/***/ }),\n/* 52 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"helmet\");\n\n/***/ }),\n/* 53 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"cookie-session\");\n\n/***/ }),\n/* 54 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nmodule.exports = function (winston, logLevel) {\n winston.configure({\n transports: [new winston.transports.Console({\n level: logLevel,\n timestamp: false,\n colorize: true,\n prettyPrint: true,\n handleExceptions: true,\n humanReadableUnhandledException: true\n })]\n });\n\n winston.error('Level 0');\n winston.warn('Level 1');\n winston.info('Level 2');\n winston.verbose('Level 3');\n winston.debug('Level 4');\n winston.silly('Level 5');\n};\n\n/***/ }),\n/* 55 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _require = __webpack_require__(3),\n logging = _require.logging;\n\nvar slackWebHook = logging.slackWebHook,\n slackErrorChannel = logging.slackErrorChannel,\n slackInfoChannel = logging.slackInfoChannel;\n\nvar winstonSlackWebHook = __webpack_require__(56).SlackWebHook;\n\nmodule.exports = function (winston) {\n if (slackWebHook) {\n // add a transport for errors to slack\n if (slackErrorChannel) {\n winston.add(winstonSlackWebHook, {\n name: 'slack-errors-transport',\n level: 'warn',\n webhookUrl: slackWebHook,\n channel: slackErrorChannel,\n username: 'spee.ch',\n iconEmoji: ':face_with_head_bandage:'\n });\n };\n if (slackInfoChannel) {\n winston.add(winstonSlackWebHook, {\n name: 'slack-info-transport',\n level: 'info',\n webhookUrl: slackWebHook,\n channel: slackInfoChannel,\n username: 'spee.ch',\n iconEmoji: ':nerd_face:'\n });\n };\n // send test message\n winston.error('Slack \"error\" logging is online.');\n winston.info('Slack \"info\" logging is online.');\n } else {\n winston.warn('Slack logging is not enabled because no slackWebHook config var provided.');\n }\n};\n\n/***/ }),\n/* 56 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"winston-slack-webhook\");\n\n/***/ }),\n/* 57 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar config = __webpack_require__(3);\nvar logger = __webpack_require__(2);\n\nmodule.exports = function () {\n // get the config file\n\n for (var configCategoryKey in config) {\n if (config.hasOwnProperty(configCategoryKey)) {\n // get the final variables for each config category\n var configVariables = config[configCategoryKey];\n for (var configVarKey in configVariables) {\n if (configVariables.hasOwnProperty(configVarKey)) {\n // print each variable\n logger.debug('CONFIG CHECK: ' + configCategoryKey + '.' + configVarKey + ' === ' + configVariables[configVarKey]);\n }\n }\n }\n }\n};\n\n/***/ }),\n/* 58 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar db = __webpack_require__(6);\nvar PassportLocalStrategy = __webpack_require__(24).Strategy;\nvar lbryApi = __webpack_require__(16);\nvar logger = __webpack_require__(2);\n\nmodule.exports = new PassportLocalStrategy({\n usernameField: 'username',\n passwordField: 'password'\n}, function (username, password, done) {\n logger.verbose('new channel signup request. user: ' + username + ' pass: ' + password + ' .');\n var userInfo = {};\n // server-side validaton of inputs (username, password)\n\n // create the channel and retrieve the metadata\n return lbryApi.createChannel('@' + username).then(function (tx) {\n // create user record\n var userData = {\n userName: username,\n password: password\n };\n logger.verbose('userData >', userData);\n // create user record\n var channelData = {\n channelName: '@' + username,\n channelClaimId: tx.claim_id\n };\n logger.verbose('channelData >', channelData);\n // create certificate record\n var certificateData = {\n claimId: tx.claim_id,\n name: '@' + username\n // address,\n };\n logger.verbose('certificateData >', certificateData);\n // save user and certificate to db\n return Promise.all([db.User.create(userData), db.Channel.create(channelData), db.Certificate.create(certificateData)]);\n }).then(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 3),\n newUser = _ref2[0],\n newChannel = _ref2[1],\n newCertificate = _ref2[2];\n\n logger.verbose('user and certificate successfully created');\n // store the relevant newUser info to be passed back for req.User\n userInfo['id'] = newUser.id;\n userInfo['userName'] = newUser.userName;\n userInfo['channelName'] = newChannel.channelName;\n userInfo['channelClaimId'] = newChannel.channelClaimId;\n // associate the instances\n return Promise.all([newCertificate.setChannel(newChannel), newChannel.setUser(newUser)]);\n }).then(function () {\n logger.verbose('user and certificate successfully associated');\n return db.Certificate.getShortChannelIdFromLongChannelId(userInfo.channelClaimId, userInfo.channelName);\n }).then(function (shortChannelId) {\n userInfo['shortChannelId'] = shortChannelId;\n return done(null, userInfo);\n }).catch(function (error) {\n logger.error('signup error', error);\n return done(error);\n });\n});\n\n/***/ }),\n/* 59 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"sequelize\");\n\n/***/ }),\n/* 60 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar logger = __webpack_require__(2);\n\nvar _require = __webpack_require__(23),\n returnShortId = _require.returnShortId;\n\nmodule.exports = function (sequelize, _ref) {\n var STRING = _ref.STRING,\n BOOLEAN = _ref.BOOLEAN,\n INTEGER = _ref.INTEGER,\n TEXT = _ref.TEXT,\n DECIMAL = _ref.DECIMAL;\n\n var Certificate = sequelize.define('Certificate', {\n address: {\n type: STRING,\n default: null\n },\n amount: {\n type: DECIMAL(19, 8),\n default: null\n },\n claimId: {\n type: STRING,\n default: null\n },\n claimSequence: {\n type: INTEGER,\n default: null\n },\n decodedClaim: {\n type: BOOLEAN,\n default: null\n },\n depth: {\n type: INTEGER,\n default: null\n },\n effectiveAmount: {\n type: DECIMAL(19, 8),\n default: null\n },\n hasSignature: {\n type: BOOLEAN,\n default: null\n },\n height: {\n type: INTEGER,\n default: null\n },\n hex: {\n type: TEXT('long'),\n default: null\n },\n name: {\n type: STRING,\n default: null\n },\n nout: {\n type: INTEGER,\n default: null\n },\n txid: {\n type: STRING,\n default: null\n },\n validAtHeight: {\n type: INTEGER,\n default: null\n },\n outpoint: {\n type: STRING,\n default: null\n },\n valueVersion: {\n type: STRING,\n default: null\n },\n claimType: {\n type: STRING,\n default: null\n },\n certificateVersion: {\n type: STRING,\n default: null\n },\n keyType: {\n type: STRING,\n default: null\n },\n publicKey: {\n type: TEXT('long'),\n default: null\n }\n }, {\n freezeTableName: true\n });\n\n Certificate.associate = function (db) {\n Certificate.belongsTo(db.Channel, {\n foreignKey: {\n allowNull: true\n }\n });\n };\n\n Certificate.getShortChannelIdFromLongChannelId = function (longChannelId, channelName) {\n var _this = this;\n\n logger.debug('getShortChannelIdFromLongChannelId ' + channelName + ':' + longChannelId);\n return new Promise(function (resolve, reject) {\n _this.findAll({\n where: { name: channelName },\n order: [['height', 'ASC']]\n }).then(function (result) {\n switch (result.length) {\n case 0:\n throw new Error('No channel(s) found with that channel name');\n default:\n return resolve(returnShortId(result, longChannelId));\n }\n }).catch(function (error) {\n reject(error);\n });\n });\n };\n\n Certificate.getLongChannelIdFromShortChannelId = function (channelName, channelClaimId) {\n var _this2 = this;\n\n logger.debug('getLongChannelIdFromShortChannelId(' + channelName + ', ' + channelClaimId + ')');\n return new Promise(function (resolve, reject) {\n _this2.findAll({\n where: {\n name: channelName,\n claimId: {\n $like: channelClaimId + '%'\n }\n },\n order: [['height', 'ASC']]\n }).then(function (result) {\n switch (result.length) {\n case 0:\n return resolve(null);\n default:\n // note results must be sorted\n return resolve(result[0].claimId);\n }\n }).catch(function (error) {\n reject(error);\n });\n });\n };\n\n Certificate.getLongChannelIdFromChannelName = function (channelName) {\n var _this3 = this;\n\n logger.debug('getLongChannelIdFromChannelName(' + channelName + ')');\n return new Promise(function (resolve, reject) {\n _this3.findAll({\n where: { name: channelName },\n order: [['effectiveAmount', 'DESC'], ['height', 'ASC']]\n }).then(function (result) {\n switch (result.length) {\n case 0:\n return resolve(null);\n default:\n return resolve(result[0].claimId);\n }\n }).catch(function (error) {\n reject(error);\n });\n });\n };\n\n Certificate.validateLongChannelId = function (name, claimId) {\n var _this4 = this;\n\n logger.debug('validateLongChannelId(' + name + ', ' + claimId + ')');\n return new Promise(function (resolve, reject) {\n _this4.findOne({\n where: { name: name, claimId: claimId }\n }).then(function (result) {\n if (!result) {\n return resolve(null);\n };\n resolve(claimId);\n }).catch(function (error) {\n reject(error);\n });\n });\n };\n\n Certificate.getLongChannelId = function (channelName, channelClaimId) {\n logger.debug('getLongChannelId(' + channelName + ', ' + channelClaimId + ')');\n if (channelClaimId && channelClaimId.length === 40) {\n // if a full channel id is provided\n return this.validateLongChannelId(channelName, channelClaimId);\n } else if (channelClaimId && channelClaimId.length < 40) {\n // if a short channel id is provided\n return this.getLongChannelIdFromShortChannelId(channelName, channelClaimId);\n } else {\n return this.getLongChannelIdFromChannelName(channelName); // if no channel id provided\n }\n };\n\n return Certificate;\n};\n\n/***/ }),\n/* 61 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nmodule.exports = function (sequelize, _ref) {\n var STRING = _ref.STRING;\n\n var Channel = sequelize.define('Channel', {\n channelName: {\n type: STRING,\n allowNull: false\n },\n channelClaimId: {\n type: STRING,\n allowNull: false\n }\n }, {\n freezeTableName: true\n });\n\n Channel.associate = function (db) {\n Channel.belongsTo(db.User);\n Channel.hasOne(db.Certificate);\n };\n\n return Channel;\n};\n\n/***/ }),\n/* 62 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar logger = __webpack_require__(2);\n\nvar _require = __webpack_require__(23),\n returnShortId = _require.returnShortId;\n\nvar _require2 = __webpack_require__(3),\n claim = _require2.claim,\n site = _require2.site;\n\nvar defaultThumbnail = claim.defaultThumbnail;\n\n\nfunction determineFileExtensionFromContentType(contentType) {\n switch (contentType) {\n case 'image/jpeg':\n case 'image/jpg':\n return 'jpeg';\n case 'image/png':\n return 'png';\n case 'image/gif':\n return 'gif';\n case 'video/mp4':\n return 'mp4';\n default:\n logger.debug('setting unknown file type as file extension jpeg');\n return 'jpeg';\n }\n};\n\nfunction determineThumbnail(storedThumbnail, defaultThumbnail) {\n if (storedThumbnail === '') {\n return defaultThumbnail;\n }\n return storedThumbnail;\n};\n\nfunction prepareClaimData(claim) {\n // logger.debug('preparing claim data based on resolved data:', claim);\n claim['thumbnail'] = determineThumbnail(claim.thumbnail, defaultThumbnail);\n claim['fileExt'] = determineFileExtensionFromContentType(claim.contentType);\n claim['host'] = site.host;\n return claim;\n};\n\nmodule.exports = function (sequelize, _ref) {\n var STRING = _ref.STRING,\n BOOLEAN = _ref.BOOLEAN,\n INTEGER = _ref.INTEGER,\n TEXT = _ref.TEXT,\n DECIMAL = _ref.DECIMAL;\n\n var Claim = sequelize.define('Claim', {\n address: {\n type: STRING,\n default: null\n },\n amount: {\n type: DECIMAL(19, 8),\n default: null\n },\n claimId: {\n type: STRING,\n default: null\n },\n claimSequence: {\n type: INTEGER,\n default: null\n },\n decodedClaim: {\n type: BOOLEAN,\n default: null\n },\n depth: {\n type: INTEGER,\n default: null\n },\n effectiveAmount: {\n type: DECIMAL(19, 8),\n default: null\n },\n hasSignature: {\n type: BOOLEAN,\n default: null\n },\n height: {\n type: INTEGER,\n default: null\n },\n hex: {\n type: TEXT('long'),\n default: null\n },\n name: {\n type: STRING,\n default: null\n },\n nout: {\n type: INTEGER,\n default: null\n },\n txid: {\n type: STRING,\n default: null\n },\n validAtHeight: {\n type: INTEGER,\n default: null\n },\n outpoint: {\n type: STRING,\n default: null\n },\n claimType: {\n type: STRING,\n default: null\n },\n certificateId: {\n type: STRING,\n default: null\n },\n author: {\n type: STRING,\n default: null\n },\n description: {\n type: TEXT('long'),\n default: null\n },\n language: {\n type: STRING,\n default: null\n },\n license: {\n type: STRING,\n default: null\n },\n licenseUrl: {\n type: STRING,\n default: null\n },\n nsfw: {\n type: BOOLEAN,\n default: null\n },\n preview: {\n type: STRING,\n default: null\n },\n thumbnail: {\n type: STRING,\n default: null\n },\n title: {\n type: STRING,\n default: null\n },\n metadataVersion: {\n type: STRING,\n default: null\n },\n contentType: {\n type: STRING,\n default: null\n },\n source: {\n type: STRING,\n default: null\n },\n sourceType: {\n type: STRING,\n default: null\n },\n sourceVersion: {\n type: STRING,\n default: null\n },\n streamVersion: {\n type: STRING,\n default: null\n },\n valueVersion: {\n type: STRING,\n default: null\n },\n channelName: {\n type: STRING,\n allowNull: true,\n default: null\n }\n }, {\n freezeTableName: true\n });\n\n Claim.associate = function (db) {\n Claim.belongsTo(db.File, {\n foreignKey: {\n allowNull: true\n }\n });\n };\n\n Claim.getShortClaimIdFromLongClaimId = function (claimId, claimName) {\n var _this = this;\n\n logger.debug('Claim.getShortClaimIdFromLongClaimId for ' + claimName + '#' + claimId);\n return new Promise(function (resolve, reject) {\n _this.findAll({\n where: { name: claimName },\n order: [['height', 'ASC']]\n }).then(function (result) {\n switch (result.length) {\n case 0:\n throw new Error('No claim(s) found with that claim name');\n default:\n resolve(returnShortId(result, claimId));\n }\n }).catch(function (error) {\n reject(error);\n });\n });\n };\n\n Claim.getAllChannelClaims = function (channelClaimId) {\n var _this2 = this;\n\n logger.debug('Claim.getAllChannelClaims for ' + channelClaimId);\n return new Promise(function (resolve, reject) {\n _this2.findAll({\n where: { certificateId: channelClaimId },\n order: [['height', 'ASC']],\n raw: true // returns an array of only data, not an array of instances\n }).then(function (channelClaimsArray) {\n // logger.debug('channelclaimsarray length:', channelClaimsArray.length);\n switch (channelClaimsArray.length) {\n case 0:\n return resolve(null);\n default:\n channelClaimsArray.forEach(function (claim) {\n claim['fileExt'] = determineFileExtensionFromContentType(claim.contentType);\n claim['thumbnail'] = determineThumbnail(claim.thumbnail, defaultThumbnail);\n return claim;\n });\n return resolve(channelClaimsArray);\n }\n }).catch(function (error) {\n reject(error);\n });\n });\n };\n\n Claim.getClaimIdByLongChannelId = function (channelClaimId, claimName) {\n var _this3 = this;\n\n logger.debug('finding claim id for claim ' + claimName + ' from channel ' + channelClaimId);\n return new Promise(function (resolve, reject) {\n _this3.findAll({\n where: { name: claimName, certificateId: channelClaimId },\n order: [['id', 'ASC']]\n }).then(function (result) {\n switch (result.length) {\n case 0:\n return resolve(null);\n case 1:\n return resolve(result[0].claimId);\n default:\n logger.error(result.length + ' records found for \"' + claimName + '\" in channel \"' + channelClaimId + '\"');\n return resolve(result[0].claimId);\n }\n }).catch(function (error) {\n reject(error);\n });\n });\n };\n\n Claim.getLongClaimIdFromShortClaimId = function (name, shortId) {\n var _this4 = this;\n\n return new Promise(function (resolve, reject) {\n _this4.findAll({\n where: {\n name: name,\n claimId: {\n $like: shortId + '%'\n } },\n order: [['height', 'ASC']]\n }).then(function (result) {\n switch (result.length) {\n case 0:\n return resolve(null);\n default:\n // note results must be sorted\n return resolve(result[0].claimId);\n }\n }).catch(function (error) {\n reject(error);\n });\n });\n };\n\n Claim.getTopFreeClaimIdByClaimName = function (name) {\n var _this5 = this;\n\n return new Promise(function (resolve, reject) {\n _this5.findAll({\n where: { name: name },\n order: [['effectiveAmount', 'DESC'], ['height', 'ASC']] // note: maybe height and effective amount need to switch?\n }).then(function (result) {\n logger.debug('length of result', result.length);\n switch (result.length) {\n case 0:\n return resolve(null);\n default:\n return resolve(result[0].dataValues.claimId);\n }\n }).catch(function (error) {\n reject(error);\n });\n });\n };\n\n Claim.validateLongClaimId = function (name, claimId) {\n var _this6 = this;\n\n return new Promise(function (resolve, reject) {\n _this6.findOne({\n where: { name: name, claimId: claimId }\n }).then(function (result) {\n if (!result) {\n return resolve(null);\n };\n resolve(claimId);\n }).catch(function (error) {\n reject(error);\n });\n });\n };\n\n Claim.getLongClaimId = function (claimName, claimId) {\n logger.debug('getLongClaimId(' + claimName + ', ' + claimId + ')');\n if (claimId && claimId.length === 40) {\n // if a full claim id is provided\n return this.validateLongClaimId(claimName, claimId);\n } else if (claimId && claimId.length < 40) {\n return this.getLongClaimIdFromShortClaimId(claimName, claimId); // if a short claim id is provided\n } else {\n return this.getTopFreeClaimIdByClaimName(claimName); // if no claim id is provided\n }\n };\n\n Claim.resolveClaim = function (name, claimId) {\n var _this7 = this;\n\n logger.debug('Claim.resolveClaim: ' + name + ' ' + claimId);\n return new Promise(function (resolve, reject) {\n _this7.findAll({\n where: { name: name, claimId: claimId }\n }).then(function (claimArray) {\n logger.debug('claims found on resolve:', claimArray.length);\n switch (claimArray.length) {\n case 0:\n return resolve(null);\n case 1:\n return resolve(prepareClaimData(claimArray[0].dataValues));\n default:\n logger.error('more than one entry matches that name (' + name + ') and claimID (' + claimId + ')');\n return resolve(prepareClaimData(claimArray[0].dataValues));\n }\n }).catch(function (error) {\n reject(error);\n });\n });\n };\n\n return Claim;\n};\n\n/***/ }),\n/* 63 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nmodule.exports = function (sequelize, _ref) {\n var STRING = _ref.STRING,\n BOOLEAN = _ref.BOOLEAN,\n INTEGER = _ref.INTEGER;\n\n var File = sequelize.define('File', {\n name: {\n type: STRING,\n allowNull: false\n },\n claimId: {\n type: STRING,\n allowNull: false\n },\n address: {\n type: STRING,\n allowNull: false\n },\n outpoint: {\n type: STRING,\n allowNull: false\n },\n height: {\n type: INTEGER,\n allowNull: false,\n default: 0\n },\n fileName: {\n type: STRING,\n allowNull: false\n },\n filePath: {\n type: STRING,\n allowNull: false\n },\n fileType: {\n type: STRING\n },\n nsfw: {\n type: BOOLEAN,\n allowNull: false,\n defaultValue: false\n },\n trendingEligible: {\n type: BOOLEAN,\n allowNull: false,\n defaultValue: true\n }\n }, {\n freezeTableName: true\n });\n\n File.associate = function (db) {\n File.hasMany(db.Request);\n File.hasOne(db.Claim);\n };\n\n File.getRecentClaims = function () {\n return this.findAll({\n where: { nsfw: false, trendingEligible: true },\n order: [['createdAt', 'DESC']],\n limit: 25\n });\n };\n\n return File;\n};\n\n/***/ }),\n/* 64 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nmodule.exports = function (sequelize, _ref) {\n var STRING = _ref.STRING,\n BOOLEAN = _ref.BOOLEAN,\n TEXT = _ref.TEXT;\n\n var Request = sequelize.define('Request', {\n action: {\n type: STRING,\n allowNull: false\n },\n url: {\n type: STRING,\n allowNull: false\n },\n ipAddress: {\n type: STRING,\n allowNull: true\n },\n result: {\n type: TEXT('long'),\n allowNull: true,\n default: null\n }\n }, {\n freezeTableName: true\n });\n\n Request.associate = function (db) {\n Request.belongsTo(db.File, {\n foreignKey: {\n allowNull: true\n }\n });\n };\n\n return Request;\n};\n\n/***/ }),\n/* 65 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar bcrypt = __webpack_require__(66);\nvar logger = __webpack_require__(2);\n\nmodule.exports = function (sequelize, _ref) {\n var STRING = _ref.STRING;\n\n var User = sequelize.define('User', {\n userName: {\n type: STRING,\n allowNull: false\n },\n password: {\n type: STRING,\n allowNull: false\n }\n }, {\n freezeTableName: true\n });\n\n User.associate = function (db) {\n User.hasOne(db.Channel);\n };\n\n User.prototype.comparePassword = function (password) {\n return bcrypt.compare(password, this.password);\n };\n\n User.prototype.changePassword = function (newPassword) {\n var _this = this;\n\n return new Promise(function (resolve, reject) {\n // generate a salt string to use for hashing\n bcrypt.genSalt(function (saltError, salt) {\n if (saltError) {\n logger.error('salt error', saltError);\n reject(saltError);\n return;\n }\n // generate a hashed version of the user's password\n bcrypt.hash(newPassword, salt, function (hashError, hash) {\n // if there is an error with the hash generation return the error\n if (hashError) {\n logger.error('hash error', hashError);\n reject(hashError);\n return;\n }\n // replace the current password with the new hash\n _this.update({ password: hash }).then(function () {\n resolve();\n }).catch(function (error) {\n reject(error);\n });\n });\n });\n });\n };\n\n // pre-save hook method to hash the user's password before the user's info is saved to the db.\n User.hook('beforeCreate', function (user, options) {\n logger.debug('User.beforeCreate hook...');\n return new Promise(function (resolve, reject) {\n // generate a salt string to use for hashing\n bcrypt.genSalt(function (saltError, salt) {\n if (saltError) {\n logger.error('salt error', saltError);\n reject(saltError);\n return;\n }\n // generate a hashed version of the user's password\n bcrypt.hash(user.password, salt, function (hashError, hash) {\n // if there is an error with the hash generation return the error\n if (hashError) {\n logger.error('hash error', hashError);\n reject(hashError);\n return;\n }\n // replace the password string with the hash password value\n user.password = hash;\n resolve();\n });\n });\n });\n });\n\n return User;\n};\n\n/***/ }),\n/* 66 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"bcrypt\");\n\n/***/ }),\n/* 67 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"axios\");\n\n/***/ }),\n/* 68 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"universal-analytics\");\n\n/***/ }),\n/* 69 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar PassportLocalStrategy = __webpack_require__(24).Strategy;\nvar db = __webpack_require__(6);\nvar logger = __webpack_require__(2);\n\nfunction returnUserAndChannelInfo(userInstance) {\n return new Promise(function (resolve, reject) {\n var userInfo = {};\n userInfo['id'] = userInstance.id;\n userInfo['userName'] = userInstance.userName;\n userInstance.getChannel().then(function (_ref) {\n var channelName = _ref.channelName,\n channelClaimId = _ref.channelClaimId;\n\n userInfo['channelName'] = channelName;\n userInfo['channelClaimId'] = channelClaimId;\n return db.Certificate.getShortChannelIdFromLongChannelId(channelClaimId, channelName);\n }).then(function (shortChannelId) {\n userInfo['shortChannelId'] = shortChannelId;\n resolve(userInfo);\n }).catch(function (error) {\n reject(error);\n });\n });\n}\n\nmodule.exports = new PassportLocalStrategy({\n usernameField: 'username',\n passwordField: 'password'\n}, function (username, password, done) {\n return db.User.findOne({\n where: { userName: username }\n }).then(function (user) {\n if (!user) {\n logger.debug('no user found');\n return done(null, false, { message: 'Incorrect username or password' });\n }\n return user.comparePassword(password).then(function (isMatch) {\n if (!isMatch) {\n logger.debug('incorrect password');\n return done(null, false, { message: 'Incorrect username or password' });\n }\n logger.debug('Password was a match, returning User');\n return returnUserAndChannelInfo(user).then(function (userInfo) {\n return done(null, userInfo);\n }).catch(function (error) {\n return error;\n });\n }).catch(function (error) {\n return error;\n });\n }).catch(function (error) {\n return done(error);\n });\n});\n\n/***/ }),\n/* 70 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar logger = __webpack_require__(2);\nvar passport = __webpack_require__(22);\n\nmodule.exports = function (app) {\n // route for sign up\n app.post('/signup', passport.authenticate('local-signup'), function (req, res) {\n logger.verbose('successful signup for ' + req.user.channelName);\n res.status(200).json({\n success: true,\n channelName: req.user.channelName,\n channelClaimId: req.user.channelClaimId,\n shortChannelId: req.user.shortChannelId\n });\n });\n // route for log in\n app.post('/login', function (req, res, next) {\n passport.authenticate('local-login', function (err, user, info) {\n logger.debug('info:', info);\n if (err) {\n return next(err);\n }\n if (!user) {\n return res.status(400).json({\n success: false,\n message: info.message\n });\n }\n logger.debug('successful login');\n req.logIn(user, function (err) {\n if (err) {\n return next(err);\n }\n return res.status(200).json({\n success: true,\n channelName: req.user.channelName,\n channelClaimId: req.user.channelClaimId,\n shortChannelId: req.user.shortChannelId\n });\n });\n })(req, res, next);\n });\n // route to log out\n app.get('/logout', function (req, res) {\n req.logout();\n res.status(200).json({ success: true, message: 'you successfully logged out' });\n });\n // see if user is authenticated, and return credentials if so\n app.get('/user', function (req, res) {\n if (req.user) {\n res.status(200).json({ success: true, data: req.user });\n } else {\n res.status(401).json({ success: false, message: 'user is not logged in' });\n }\n });\n};\n\n/***/ }),\n/* 71 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar logger = __webpack_require__(2);\nvar multipart = __webpack_require__(72);\n\nvar _require = __webpack_require__(3),\n files = _require.files,\n site = _require.site;\n\nvar multipartMiddleware = multipart({ uploadDir: files.uploadDirectory });\nvar db = __webpack_require__(6);\n\nvar _require2 = __webpack_require__(73),\n claimNameIsAvailable = _require2.claimNameIsAvailable,\n checkChannelAvailability = _require2.checkChannelAvailability,\n publish = _require2.publish;\n\nvar _require3 = __webpack_require__(16),\n getClaimList = _require3.getClaimList,\n resolveUri = _require3.resolveUri,\n getClaim = _require3.getClaim;\n\nvar _require4 = __webpack_require__(25),\n addGetResultsToFileData = _require4.addGetResultsToFileData,\n createBasicPublishParams = _require4.createBasicPublishParams,\n createThumbnailPublishParams = _require4.createThumbnailPublishParams,\n parsePublishApiRequestBody = _require4.parsePublishApiRequestBody,\n parsePublishApiRequestFiles = _require4.parsePublishApiRequestFiles,\n createFileData = _require4.createFileData;\n\nvar errorHandlers = __webpack_require__(26);\n\nvar _require5 = __webpack_require__(17),\n sendGATimingEvent = _require5.sendGATimingEvent;\n\nvar _require6 = __webpack_require__(75),\n authenticateUser = _require6.authenticateUser;\n\nvar _require7 = __webpack_require__(27),\n getChannelData = _require7.getChannelData,\n getChannelClaims = _require7.getChannelClaims,\n getClaimId = _require7.getClaimId;\n\nvar NO_CHANNEL = 'NO_CHANNEL';\nvar NO_CLAIM = 'NO_CLAIM';\n\nmodule.exports = function (app) {\n // route to check whether site has published to a channel\n app.get('/api/channel/availability/:name', function (_ref, res) {\n var ip = _ref.ip,\n originalUrl = _ref.originalUrl,\n params = _ref.params;\n\n checkChannelAvailability(params.name).then(function (result) {\n if (result === true) {\n res.status(200).json(true);\n } else {\n res.status(200).json(false);\n }\n }).catch(function (error) {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n // route to get a short channel id from long channel Id\n app.get('/api/channel/short-id/:longId/:name', function (_ref2, res) {\n var ip = _ref2.ip,\n originalUrl = _ref2.originalUrl,\n params = _ref2.params;\n\n db.Certificate.getShortChannelIdFromLongChannelId(params.longId, params.name).then(function (shortId) {\n res.status(200).json(shortId);\n }).catch(function (error) {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n app.get('/api/channel/data/:channelName/:channelClaimId', function (_ref3, res) {\n var ip = _ref3.ip,\n originalUrl = _ref3.originalUrl,\n body = _ref3.body,\n params = _ref3.params;\n\n var channelName = params.channelName;\n var channelClaimId = params.channelClaimId;\n if (channelClaimId === 'none') channelClaimId = null;\n getChannelData(channelName, channelClaimId, 0).then(function (data) {\n if (data === NO_CHANNEL) {\n return res.status(404).json({ success: false, message: 'No matching channel was found' });\n }\n res.status(200).json({ success: true, data: data });\n }).catch(function (error) {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n app.get('/api/channel/claims/:channelName/:channelClaimId/:page', function (_ref4, res) {\n var ip = _ref4.ip,\n originalUrl = _ref4.originalUrl,\n body = _ref4.body,\n params = _ref4.params;\n\n var channelName = params.channelName;\n var channelClaimId = params.channelClaimId;\n if (channelClaimId === 'none') channelClaimId = null;\n var page = params.page;\n getChannelClaims(channelName, channelClaimId, page).then(function (data) {\n if (data === NO_CHANNEL) {\n return res.status(404).json({ success: false, message: 'No matching channel was found' });\n }\n res.status(200).json({ success: true, data: data });\n }).catch(function (error) {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n // route to run a claim_list request on the daemon\n app.get('/api/claim/list/:name', function (_ref5, res) {\n var ip = _ref5.ip,\n originalUrl = _ref5.originalUrl,\n params = _ref5.params;\n\n getClaimList(params.name).then(function (claimsList) {\n res.status(200).json(claimsList);\n }).catch(function (error) {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n // route to get an asset\n app.get('/api/claim/get/:name/:claimId', function (_ref6, res) {\n var ip = _ref6.ip,\n originalUrl = _ref6.originalUrl,\n params = _ref6.params;\n\n var name = params.name;\n var claimId = params.claimId;\n // resolve the claim\n db.Claim.resolveClaim(name, claimId).then(function (resolveResult) {\n // make sure a claim actually exists at that uri\n if (!resolveResult) {\n throw new Error('No matching uri found in Claim table');\n }\n var fileData = createFileData(resolveResult);\n // get the claim\n return Promise.all([fileData, getClaim(name + '#' + claimId)]);\n }).then(function (_ref7) {\n var _ref8 = _slicedToArray(_ref7, 2),\n fileData = _ref8[0],\n getResult = _ref8[1];\n\n fileData = addGetResultsToFileData(fileData, getResult);\n return Promise.all([db.upsert(db.File, fileData, { name: name, claimId: claimId }, 'File'), getResult]);\n }).then(function (_ref9) {\n var _ref10 = _slicedToArray(_ref9, 2),\n fileRecord = _ref10[0],\n _ref10$ = _ref10[1],\n message = _ref10$.message,\n completed = _ref10$.completed;\n\n res.status(200).json({ success: true, message: message, completed: completed });\n }).catch(function (error) {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n // route to check whether this site published to a claim\n app.get('/api/claim/availability/:name', function (_ref11, res) {\n var ip = _ref11.ip,\n originalUrl = _ref11.originalUrl,\n params = _ref11.params;\n\n claimNameIsAvailable(params.name).then(function (result) {\n res.status(200).json(result);\n }).catch(function (error) {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n // route to run a resolve request on the daemon\n app.get('/api/claim/resolve/:name/:claimId', function (_ref12, res) {\n var headers = _ref12.headers,\n ip = _ref12.ip,\n originalUrl = _ref12.originalUrl,\n params = _ref12.params;\n\n resolveUri(params.name + '#' + params.claimId).then(function (resolvedUri) {\n res.status(200).json(resolvedUri);\n }).catch(function (error) {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n // route to run a publish request on the daemon\n app.post('/api/claim/publish', multipartMiddleware, function (_ref13, res) {\n var body = _ref13.body,\n files = _ref13.files,\n headers = _ref13.headers,\n ip = _ref13.ip,\n originalUrl = _ref13.originalUrl,\n user = _ref13.user;\n\n logger.debug('api/claim/publish req.body:', body);\n logger.debug('api/claim/publish req.files:', files);\n // define variables\n var channelName = void 0,\n channelId = void 0,\n channelPassword = void 0,\n description = void 0,\n fileName = void 0,\n filePath = void 0,\n fileType = void 0,\n gaStartTime = void 0,\n license = void 0,\n name = void 0,\n nsfw = void 0,\n thumbnail = void 0,\n thumbnailFileName = void 0,\n thumbnailFilePath = void 0,\n thumbnailFileType = void 0,\n title = void 0;\n // record the start time of the request\n gaStartTime = Date.now();\n // validate the body and files of the request\n try {\n var _parsePublishApiReque = parsePublishApiRequestBody(body);\n // validateApiPublishRequest(body, files);\n\n\n name = _parsePublishApiReque.name;\n nsfw = _parsePublishApiReque.nsfw;\n license = _parsePublishApiReque.license;\n title = _parsePublishApiReque.title;\n description = _parsePublishApiReque.description;\n thumbnail = _parsePublishApiReque.thumbnail;\n\n var _parsePublishApiReque2 = parsePublishApiRequestFiles(files);\n\n fileName = _parsePublishApiReque2.fileName;\n filePath = _parsePublishApiReque2.filePath;\n fileType = _parsePublishApiReque2.fileType;\n thumbnailFileName = _parsePublishApiReque2.thumbnailFileName;\n thumbnailFilePath = _parsePublishApiReque2.thumbnailFilePath;\n thumbnailFileType = _parsePublishApiReque2.thumbnailFileType;\n channelName = body.channelName;\n channelId = body.channelId;\n channelPassword = body.channelPassword;\n } catch (error) {\n return res.status(400).json({ success: false, message: error.message });\n }\n // check channel authorization\n Promise.all([authenticateUser(channelName, channelId, channelPassword, user), claimNameIsAvailable(name), createBasicPublishParams(filePath, name, title, description, license, nsfw, thumbnail), createThumbnailPublishParams(thumbnailFilePath, name, license, nsfw)]).then(function (_ref14) {\n var _ref15 = _slicedToArray(_ref14, 4),\n _ref15$ = _ref15[0],\n channelName = _ref15$.channelName,\n channelClaimId = _ref15$.channelClaimId,\n validatedClaimName = _ref15[1],\n publishParams = _ref15[2],\n thumbnailPublishParams = _ref15[3];\n\n // add channel details to the publish params\n if (channelName && channelClaimId) {\n publishParams['channel_name'] = channelName;\n publishParams['channel_id'] = channelClaimId;\n }\n // publish the thumbnail\n if (thumbnailPublishParams) {\n publish(thumbnailPublishParams, thumbnailFileName, thumbnailFileType);\n }\n // publish the asset\n return publish(publishParams, fileName, fileType);\n }).then(function (result) {\n res.status(200).json({\n success: true,\n message: 'publish completed successfully',\n data: {\n name: name,\n claimId: result.claim_id,\n url: site.host + '/' + result.claim_id + '/' + name,\n lbryTx: result\n }\n });\n // record the publish end time and send to google analytics\n sendGATimingEvent('end-to-end', 'publish', fileType, gaStartTime, Date.now());\n }).catch(function (error) {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n // route to get a short claim id from long claim Id\n app.get('/api/claim/short-id/:longId/:name', function (_ref16, res) {\n var ip = _ref16.ip,\n originalUrl = _ref16.originalUrl,\n body = _ref16.body,\n params = _ref16.params;\n\n db.Claim.getShortClaimIdFromLongClaimId(params.longId, params.name).then(function (shortId) {\n res.status(200).json({ success: true, data: shortId });\n }).catch(function (error) {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n app.post('/api/claim/long-id', function (_ref17, res) {\n var ip = _ref17.ip,\n originalUrl = _ref17.originalUrl,\n body = _ref17.body,\n params = _ref17.params;\n\n logger.debug('body:', body);\n var channelName = body.channelName;\n var channelClaimId = body.channelClaimId;\n var claimName = body.claimName;\n var claimId = body.claimId;\n getClaimId(channelName, channelClaimId, claimName, claimId).then(function (result) {\n if (result === NO_CHANNEL) {\n return res.status(404).json({ success: false, message: 'No matching channel could be found' });\n }\n if (result === NO_CLAIM) {\n return res.status(404).json({ success: false, message: 'No matching claim id could be found' });\n }\n res.status(200).json({ success: true, data: result });\n }).catch(function (error) {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n app.get('/api/claim/data/:claimName/:claimId', function (_ref18, res) {\n var ip = _ref18.ip,\n originalUrl = _ref18.originalUrl,\n body = _ref18.body,\n params = _ref18.params;\n\n var claimName = params.claimName;\n var claimId = params.claimId;\n if (claimId === 'none') claimId = null;\n db.Claim.resolveClaim(claimName, claimId).then(function (claimInfo) {\n if (!claimInfo) {\n return res.status(404).json({ success: false, message: 'No claim could be found' });\n }\n res.status(200).json({ success: true, data: claimInfo });\n }).catch(function (error) {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n // route to see if asset is available locally\n app.get('/api/file/availability/:name/:claimId', function (_ref19, res) {\n var ip = _ref19.ip,\n originalUrl = _ref19.originalUrl,\n params = _ref19.params;\n\n var name = params.name;\n var claimId = params.claimId;\n db.File.findOne({ where: { name: name, claimId: claimId } }).then(function (result) {\n if (result) {\n return res.status(200).json({ success: true, data: true });\n }\n res.status(200).json({ success: true, data: false });\n }).catch(function (error) {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n};\n\n/***/ }),\n/* 72 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"connect-multiparty\");\n\n/***/ }),\n/* 73 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar logger = __webpack_require__(2);\nvar db = __webpack_require__(6);\nvar lbryApi = __webpack_require__(16);\nvar publishHelpers = __webpack_require__(25);\nvar config = __webpack_require__(3);\n\nmodule.exports = {\n publish: function publish(publishParams, fileName, fileType) {\n return new Promise(function (resolve, reject) {\n var publishResults = void 0,\n certificateId = void 0,\n channelName = void 0;\n // publish the file\n return lbryApi.publishClaim(publishParams).then(function (tx) {\n logger.info('Successfully published ' + publishParams.name + ' ' + fileName, tx);\n publishResults = tx;\n // get the channel information\n if (publishParams.channel_name) {\n logger.debug('this claim was published in channel: ' + publishParams.channel_name);\n return db.Channel.findOne({ where: { channelName: publishParams.channel_name } });\n } else {\n logger.debug('this claim was not published in a channel');\n return null;\n }\n }).then(function (channel) {\n // set channel information\n certificateId = null;\n channelName = null;\n if (channel) {\n certificateId = channel.channelClaimId;\n channelName = channel.channelName;\n }\n logger.debug('certificateId: ' + certificateId);\n }).then(function () {\n // create the File record\n var fileRecord = {\n name: publishParams.name,\n claimId: publishResults.claim_id,\n title: publishParams.metadata.title,\n description: publishParams.metadata.description,\n address: publishParams.claim_address,\n outpoint: publishResults.txid + ':' + publishResults.nout,\n height: 0,\n fileName: fileName,\n filePath: publishParams.file_path,\n fileType: fileType,\n nsfw: publishParams.metadata.nsfw\n };\n // create the Claim record\n var claimRecord = {\n name: publishParams.name,\n claimId: publishResults.claim_id,\n title: publishParams.metadata.title,\n description: publishParams.metadata.description,\n address: publishParams.claim_address,\n thumbnail: publishParams.metadata.thumbnail,\n outpoint: publishResults.txid + ':' + publishResults.nout,\n height: 0,\n contentType: fileType,\n nsfw: publishParams.metadata.nsfw,\n amount: publishParams.bid,\n certificateId: certificateId,\n channelName: channelName\n };\n // upsert criteria\n var upsertCriteria = {\n name: publishParams.name,\n claimId: publishResults.claim_id\n };\n // upsert the records\n return Promise.all([db.upsert(db.File, fileRecord, upsertCriteria, 'File'), db.upsert(db.Claim, claimRecord, upsertCriteria, 'Claim')]);\n }).then(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n file = _ref2[0],\n claim = _ref2[1];\n\n logger.debug('File and Claim records successfully created');\n return Promise.all([file.setClaim(claim), claim.setFile(file)]);\n }).then(function () {\n logger.debug('File and Claim records successfully associated');\n resolve(publishResults); // resolve the promise with the result from lbryApi.publishClaim;\n }).catch(function (error) {\n logger.error('PUBLISH ERROR', error);\n publishHelpers.deleteTemporaryFile(publishParams.file_path); // delete the local file\n reject(error);\n });\n });\n },\n claimNameIsAvailable: function claimNameIsAvailable(name) {\n // find any records where the name is used\n return db.File.findAll({ where: { name: name } }).then(function (result) {\n if (result.length >= 1) {\n var claimAddress = config.wallet.lbryClaimAddress;\n // filter out any results that were not published from spee.ch's wallet address\n var filteredResult = result.filter(function (claim) {\n return claim.address === claimAddress;\n });\n // return based on whether any non-spee.ch claims were left\n if (filteredResult.length >= 1) {\n throw new Error('That claim is already in use');\n };\n return name;\n };\n return name;\n });\n },\n checkChannelAvailability: function checkChannelAvailability(name) {\n return new Promise(function (resolve, reject) {\n // find any records where the name is used\n db.Channel.findAll({ where: { channelName: name } }).then(function (result) {\n if (result.length >= 1) {\n return resolve(false);\n }\n resolve(true);\n }).catch(function (error) {\n reject(error);\n });\n });\n }\n};\n\n/***/ }),\n/* 74 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"fs\");\n\n/***/ }),\n/* 75 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar db = __webpack_require__(6);\nvar logger = __webpack_require__(2);\n\nmodule.exports = {\n authenticateUser: function authenticateUser(channelName, channelId, channelPassword, user) {\n // case: no channelName or channel Id are provided (anonymous), regardless of whether user token is provided\n if (!channelName && !channelId) {\n return {\n channelName: null,\n channelClaimId: null\n };\n }\n // case: channelName or channel Id are provided with user token\n if (user) {\n if (channelName && channelName !== user.channelName) {\n throw new Error('the provided channel name does not match user credentials');\n }\n if (channelId && channelId !== user.channelClaimId) {\n throw new Error('the provided channel id does not match user credentials');\n }\n return {\n channelName: user.channelName,\n channelClaimId: user.channelClaimId\n };\n }\n // case: channelName or channel Id are provided with password instead of user token\n if (!channelPassword) throw new Error('no channel password provided');\n return module.exports.authenticateChannelCredentials(channelName, channelId, channelPassword);\n },\n authenticateChannelCredentials: function authenticateChannelCredentials(channelName, channelId, userPassword) {\n return new Promise(function (resolve, reject) {\n // hoisted variables\n var channelData = void 0;\n // build the params for finding the channel\n var channelFindParams = {};\n if (channelName) channelFindParams['channelName'] = channelName;\n if (channelId) channelFindParams['channelClaimId'] = channelId;\n // find the channel\n db.Channel.findOne({\n where: channelFindParams\n }).then(function (channel) {\n if (!channel) {\n logger.debug('no channel found');\n throw new Error('Authentication failed, you do not have access to that channel');\n }\n channelData = channel.get();\n logger.debug('channel data:', channelData);\n return db.User.findOne({\n where: { userName: channelData.channelName.substring(1) }\n });\n }).then(function (user) {\n if (!user) {\n logger.debug('no user found');\n throw new Error('Authentication failed, you do not have access to that channel');\n }\n return user.comparePassword(userPassword);\n }).then(function (isMatch) {\n if (!isMatch) {\n logger.debug('incorrect password');\n throw new Error('Authentication failed, you do not have access to that channel');\n }\n logger.debug('...password was a match...');\n resolve(channelData);\n }).catch(function (error) {\n reject(error);\n });\n });\n }\n};\n\n/***/ }),\n/* 76 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar CLAIMS_PER_PAGE = 12;\n\nmodule.exports = {\n returnPaginatedChannelClaims: function returnPaginatedChannelClaims(channelName, longChannelClaimId, claims, page) {\n var totalPages = module.exports.determineTotalPages(claims);\n var paginationPage = module.exports.getPageFromQuery(page);\n var viewData = {\n channelName: channelName,\n longChannelClaimId: longChannelClaimId,\n claims: module.exports.extractPageFromClaims(claims, paginationPage),\n previousPage: module.exports.determinePreviousPage(paginationPage),\n currentPage: paginationPage,\n nextPage: module.exports.determineNextPage(totalPages, paginationPage),\n totalPages: totalPages,\n totalResults: module.exports.determineTotalClaims(claims)\n };\n return viewData;\n },\n getPageFromQuery: function getPageFromQuery(page) {\n if (page) {\n return parseInt(page);\n }\n return 1;\n },\n extractPageFromClaims: function extractPageFromClaims(claims, pageNumber) {\n if (!claims) {\n return []; // if no claims, return this default\n }\n // logger.debug('claims is array?', Array.isArray(claims));\n // logger.debug(`pageNumber ${pageNumber} is number?`, Number.isInteger(pageNumber));\n var claimStartIndex = (pageNumber - 1) * CLAIMS_PER_PAGE;\n var claimEndIndex = claimStartIndex + CLAIMS_PER_PAGE;\n var pageOfClaims = claims.slice(claimStartIndex, claimEndIndex);\n return pageOfClaims;\n },\n determineTotalPages: function determineTotalPages(claims) {\n if (!claims) {\n return 0;\n } else {\n var totalClaims = claims.length;\n if (totalClaims < CLAIMS_PER_PAGE) {\n return 1;\n }\n var fullPages = Math.floor(totalClaims / CLAIMS_PER_PAGE);\n var remainder = totalClaims % CLAIMS_PER_PAGE;\n if (remainder === 0) {\n return fullPages;\n }\n return fullPages + 1;\n }\n },\n determinePreviousPage: function determinePreviousPage(currentPage) {\n if (currentPage === 1) {\n return null;\n }\n return currentPage - 1;\n },\n determineNextPage: function determineNextPage(totalPages, currentPage) {\n if (currentPage === totalPages) {\n return null;\n }\n return currentPage + 1;\n },\n determineTotalClaims: function determineTotalClaims(claims) {\n if (!claims) {\n return 0;\n }\n return claims.length;\n }\n};\n\n/***/ }),\n/* 77 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _require = __webpack_require__(3),\n site = _require.site;\n\nvar handlePageRender = __webpack_require__(28);\n\nmodule.exports = function (app) {\n // route for the home page\n app.get('/', function (req, res) {\n handlePageRender(req, res);\n });\n // route to display login page\n app.get('/login', function (req, res) {\n handlePageRender(req, res);\n });\n // route to show 'about' page\n app.get('/about', function (req, res) {\n handlePageRender(req, res);\n });\n // route to display a list of the trending images\n app.get('/trending', function (req, res) {\n res.status(301).redirect('/popular');\n });\n app.get('/popular', function (req, res) {\n handlePageRender(req, res);\n });\n // route to display a list of the trending images\n app.get('/new', function (req, res) {\n handlePageRender(req, res);\n });\n // route to send embedable video player (for twitter)\n app.get('/embed/:claimId/:name', function (_ref, res) {\n var params = _ref.params;\n\n var claimId = params.claimId;\n var name = params.name;\n var host = site.host;\n // get and render the content\n res.status(200).render('embed', { layout: 'embed', host: host, claimId: claimId, name: name });\n });\n};\n\n/***/ }),\n/* 78 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nexports.default = function () {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments[1];\n\n switch (action.type) {\n case actions.FILE_SELECTED:\n return Object.assign({}, initialState, { // note: clears to initial state\n file: action.data\n });\n case actions.FILE_CLEAR:\n return initialState;\n case actions.METADATA_UPDATE:\n return Object.assign({}, state, {\n metadata: Object.assign({}, state.metadata, _defineProperty({}, action.data.name, action.data.value))\n });\n case actions.CLAIM_UPDATE:\n return Object.assign({}, state, {\n claim: action.data\n });\n case actions.SET_PUBLISH_IN_CHANNEL:\n return Object.assign({}, state, {\n publishInChannel: action.channel\n });\n case actions.PUBLISH_STATUS_UPDATE:\n return Object.assign({}, state, {\n status: action.data\n });\n case actions.ERROR_UPDATE:\n return Object.assign({}, state, {\n error: Object.assign({}, state.error, _defineProperty({}, action.data.name, action.data.value))\n });\n case actions.SELECTED_CHANNEL_UPDATE:\n return Object.assign({}, state, {\n selectedChannel: action.data\n });\n case actions.TOGGLE_METADATA_INPUTS:\n return Object.assign({}, state, {\n showMetadataInputs: action.data\n });\n case actions.THUMBNAIL_NEW:\n return Object.assign({}, state, {\n thumbnail: action.data\n });\n default:\n return state;\n }\n};\n\nvar _publish_action_types = __webpack_require__(31);\n\nvar actions = _interopRequireWildcard(_publish_action_types);\n\nvar _publish_channel_select_states = __webpack_require__(32);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar _require = __webpack_require__(3),\n publish = _require.publish;\n\nvar initialState = {\n publishInChannel: false,\n selectedChannel: _publish_channel_select_states.LOGIN,\n showMetadataInputs: false,\n status: {\n status: null,\n message: null\n },\n error: {\n file: null,\n url: null,\n channel: null,\n publishSubmit: null\n },\n file: null,\n claim: '',\n metadata: {\n title: '',\n description: '',\n license: '',\n nsfw: false\n },\n thumbnailChannel: publish.thumbnailChannel,\n thumbnailChannelId: publish.thumbnailChannelId,\n thumbnail: null\n};\n\n/***/ }),\n/* 79 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nexports.default = function () {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments[1];\n\n switch (action.type) {\n case actions.CHANNEL_UPDATE:\n return Object.assign({}, state, {\n loggedInChannel: action.data\n });\n default:\n return state;\n }\n};\n\nvar _channel_action_types = __webpack_require__(33);\n\nvar actions = _interopRequireWildcard(_channel_action_types);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nvar initialState = {\n loggedInChannel: {\n name: null,\n shortId: null,\n longId: null\n }\n};\n\n/***/ }),\n/* 80 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nexports.default = function () {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments[1];\n\n switch (action.type) {\n // handle request\n case actions.REQUEST_ERROR:\n return Object.assign({}, state, {\n request: Object.assign({}, state.request, {\n error: action.data\n })\n });\n case actions.REQUEST_UPDATE:\n return Object.assign({}, state, {\n request: Object.assign({}, state.request, {\n type: action.data.requestType,\n id: action.data.requestId\n })\n });\n // store requests\n case actions.REQUEST_LIST_ADD:\n return Object.assign({}, state, {\n requestList: Object.assign({}, state.requestList, _defineProperty({}, action.data.id, {\n error: action.data.error,\n key: action.data.key\n }))\n });\n // asset data\n case actions.ASSET_ADD:\n return Object.assign({}, state, {\n assetList: Object.assign({}, state.assetList, _defineProperty({}, action.data.id, {\n error: action.data.error,\n name: action.data.name,\n claimId: action.data.claimId,\n shortId: action.data.shortId,\n claimData: action.data.claimData\n }))\n });\n // channel data\n case actions.CHANNEL_ADD:\n return Object.assign({}, state, {\n channelList: Object.assign({}, state.channelList, _defineProperty({}, action.data.id, {\n name: action.data.name,\n longId: action.data.longId,\n shortId: action.data.shortId,\n claimsData: action.data.claimsData\n }))\n });\n case actions.CHANNEL_CLAIMS_UPDATE_SUCCESS:\n return Object.assign({}, state, {\n channelList: Object.assign({}, state.channelList, _defineProperty({}, action.data.channelListId, Object.assign({}, state.channelList[action.data.channelListId], {\n claimsData: action.data.claimsData\n })))\n });\n // display an asset\n case actions.FILE_AVAILABILITY_UPDATE:\n return Object.assign({}, state, {\n displayAsset: Object.assign({}, state.displayAsset, {\n status: action.data\n })\n });\n case actions.DISPLAY_ASSET_ERROR:\n return Object.assign({}, state, {\n displayAsset: Object.assign({}, state.displayAsset, {\n error: action.data,\n status: _asset_display_states.ERROR\n })\n });\n default:\n return state;\n }\n};\n\nvar _show_action_types = __webpack_require__(12);\n\nvar actions = _interopRequireWildcard(_show_action_types);\n\nvar _asset_display_states = __webpack_require__(34);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar initialState = {\n request: {\n error: null,\n type: null,\n id: null\n },\n requestList: {},\n channelList: {},\n assetList: {},\n displayAsset: {\n error: null,\n status: _asset_display_states.LOCAL_CHECK\n }\n};\n\n/***/ }),\n/* 81 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nexports.default = function () {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;\n var action = arguments[1];\n\n switch (action.type) {\n default:\n return state;\n }\n};\n\nvar _require = __webpack_require__(3),\n site = _require.site;\n\nvar initialState = {\n host: site.host\n};\n\n/***/ }),\n/* 82 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"react-ga\");\n\n/***/ }),\n/* 83 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _SEO = __webpack_require__(9);\n\nvar _SEO2 = _interopRequireDefault(_SEO);\n\nvar _NavBar = __webpack_require__(7);\n\nvar _NavBar2 = _interopRequireDefault(_NavBar);\n\nvar _PublishTool = __webpack_require__(91);\n\nvar _PublishTool2 = _interopRequireDefault(_PublishTool);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar HomePage = function (_React$Component) {\n _inherits(HomePage, _React$Component);\n\n function HomePage() {\n _classCallCheck(this, HomePage);\n\n return _possibleConstructorReturn(this, (HomePage.__proto__ || Object.getPrototypeOf(HomePage)).apply(this, arguments));\n }\n\n _createClass(HomePage, [{\n key: 'render',\n value: function render() {\n return _react2.default.createElement(\n 'div',\n { className: 'row row--tall flex-container--column' },\n _react2.default.createElement(_SEO2.default, null),\n _react2.default.createElement(_NavBar2.default, null),\n _react2.default.createElement(\n 'div',\n { className: 'row row--tall row--padded flex-container--column' },\n _react2.default.createElement(_PublishTool2.default, null)\n )\n );\n }\n }]);\n\n return HomePage;\n}(_react2.default.Component);\n\n;\n\nexports.default = HomePage;\n\n/***/ }),\n/* 84 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _require = __webpack_require__(3),\n siteTitle = _require.site.title;\n\nvar createPageTitle = exports.createPageTitle = function createPageTitle(pageTitle) {\n if (!pageTitle) {\n return '' + siteTitle;\n }\n return siteTitle + ' - ' + pageTitle;\n};\n\n/***/ }),\n/* 85 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _require = __webpack_require__(3),\n _require$site = _require.site,\n title = _require$site.title,\n host = _require$site.host,\n description = _require$site.description,\n _require$claim = _require.claim,\n defaultThumbnail = _require$claim.defaultThumbnail,\n defaultDescription = _require$claim.defaultDescription;\n\nvar determineOgThumbnailContentType = function determineOgThumbnailContentType(thumbnail) {\n if (thumbnail) {\n var fileExt = thumbnail.substring(thumbnail.lastIndexOf('.'));\n switch (fileExt) {\n case 'jpeg':\n case 'jpg':\n return 'image/jpeg';\n case 'png':\n return 'image/png';\n case 'gif':\n return 'image/gif';\n case 'mp4':\n return 'video/mp4';\n default:\n return 'image/jpeg';\n }\n }\n return '';\n};\n\nvar createBasicMetaTags = function createBasicMetaTags() {\n return [{ property: 'og:title', content: title }, { property: 'og:url', content: host }, { property: 'og:site_name', content: title }, { property: 'og:description', content: description }, { property: 'twitter:site', content: '@spee_ch' }, { property: 'twitter:card', content: 'summary' }];\n};\n\nvar createChannelMetaTags = function createChannelMetaTags(channel) {\n var name = channel.name,\n longId = channel.longId;\n\n return [{ property: 'og:title', content: name + ' on ' + title }, { property: 'og:url', content: host + '/' + name + ':' + longId }, { property: 'og:site_name', content: title }, { property: 'og:description', content: name + ', a channel on ' + title }, { property: 'twitter:site', content: '@spee_ch' }, { property: 'twitter:card', content: 'summary' }];\n};\n\nvar createAssetMetaTags = function createAssetMetaTags(asset) {\n var claimData = asset.claimData;\n var contentType = claimData.contentType;\n\n var embedUrl = host + '/' + claimData.claimId + '/' + claimData.name;\n var showUrl = host + '/' + claimData.claimId + '/' + claimData.name;\n var source = host + '/' + claimData.claimId + '/' + claimData.name + '.' + claimData.fileExt;\n var ogTitle = claimData.title || claimData.name;\n var ogDescription = claimData.description || defaultDescription;\n var ogThumbnailContentType = determineOgThumbnailContentType(claimData.thumbnail);\n var ogThumbnail = claimData.thumbnail || defaultThumbnail;\n var metaTags = [{ property: 'og:title', content: ogTitle }, { property: 'og:url', content: showUrl }, { property: 'og:site_name', content: title }, { property: 'og:description', content: ogDescription }, { property: 'og:image:width', content: 600 }, { property: 'og:image:height', content: 315 }, { property: 'twitter:site', content: '@spee_ch' }];\n if (contentType === 'video/mp4' || contentType === 'video/webm') {\n metaTags.push({ property: 'og:video', content: source });\n metaTags.push({ property: 'og:video:secure_url', content: source });\n metaTags.push({ property: 'og:video:type', content: contentType });\n metaTags.push({ property: 'og:image', content: ogThumbnail });\n metaTags.push({ property: 'og:image:type', content: ogThumbnailContentType });\n metaTags.push({ property: 'og:type', content: 'video' });\n metaTags.push({ property: 'twitter:card', content: 'player' });\n metaTags.push({ property: 'twitter:player', content: embedUrl });\n metaTags.push({ property: 'twitter:player:width', content: 600 });\n metaTags.push({ property: 'twitter:text:player_width', content: 600 });\n metaTags.push({ property: 'twitter:player:height', content: 337 });\n metaTags.push({ property: 'twitter:player:stream', content: source });\n metaTags.push({ property: 'twitter:player:stream:content_type', content: contentType });\n } else {\n metaTags.push({ property: 'og:image', content: source });\n metaTags.push({ property: 'og:image:type', content: contentType });\n metaTags.push({ property: 'og:type', content: 'article' });\n metaTags.push({ property: 'twitter:card', content: 'summary_large_image' });\n }\n return metaTags;\n};\n\nvar createMetaTags = exports.createMetaTags = function createMetaTags(asset, channel) {\n if (asset) {\n return createAssetMetaTags(asset);\n };\n if (channel) {\n return createChannelMetaTags(channel);\n };\n return createBasicMetaTags();\n};\n\n/***/ }),\n/* 86 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _require = __webpack_require__(3),\n host = _require.site.host;\n\nvar createBasicCanonicalLink = function createBasicCanonicalLink(page) {\n if (!page) {\n return '' + host;\n };\n return host + '/' + page;\n};\n\nvar createAssetCanonicalLink = function createAssetCanonicalLink(asset) {\n var channelName = void 0,\n certificateId = void 0,\n name = void 0,\n claimId = void 0;\n if (asset.claimData) {\n var _asset$claimData = asset.claimData;\n channelName = _asset$claimData.channelName;\n certificateId = _asset$claimData.certificateId;\n name = _asset$claimData.name;\n claimId = _asset$claimData.claimId;\n };\n if (channelName) {\n return host + '/' + channelName + ':' + certificateId + '/' + name;\n };\n return host + '/' + claimId + '/' + name;\n};\n\nvar createChannelCanonicalLink = function createChannelCanonicalLink(channel) {\n var name = channel.name,\n longId = channel.longId;\n\n return host + '/' + name + ':' + longId;\n};\n\nvar createCanonicalLink = exports.createCanonicalLink = function createCanonicalLink(asset, channel, page) {\n if (asset) {\n return createAssetCanonicalLink(asset);\n }\n if (channel) {\n return createChannelCanonicalLink(channel);\n }\n if (page) {\n return createBasicCanonicalLink(page);\n }\n return createBasicCanonicalLink();\n};\n\n/***/ }),\n/* 87 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactRouterDom = __webpack_require__(4);\n\nvar _Logo = __webpack_require__(88);\n\nvar _Logo2 = _interopRequireDefault(_Logo);\n\nvar _NavBarChannelOptionsDropdown = __webpack_require__(89);\n\nvar _NavBarChannelOptionsDropdown2 = _interopRequireDefault(_NavBarChannelOptionsDropdown);\n\nvar _request = __webpack_require__(11);\n\nvar _request2 = _interopRequireDefault(_request);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar VIEW = 'VIEW';\nvar LOGOUT = 'LOGOUT';\n\nvar NavBar = function (_React$Component) {\n _inherits(NavBar, _React$Component);\n\n function NavBar(props) {\n _classCallCheck(this, NavBar);\n\n var _this = _possibleConstructorReturn(this, (NavBar.__proto__ || Object.getPrototypeOf(NavBar)).call(this, props));\n\n _this.checkForLoggedInUser = _this.checkForLoggedInUser.bind(_this);\n _this.logoutUser = _this.logoutUser.bind(_this);\n _this.handleSelection = _this.handleSelection.bind(_this);\n return _this;\n }\n\n _createClass(NavBar, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n // check to see if the user is already logged in\n this.checkForLoggedInUser();\n }\n }, {\n key: 'checkForLoggedInUser',\n value: function checkForLoggedInUser() {\n var _this2 = this;\n\n var params = { credentials: 'include' };\n (0, _request2.default)('/user', params).then(function (_ref) {\n var data = _ref.data;\n\n _this2.props.onChannelLogin(data.channelName, data.shortChannelId, data.channelClaimId);\n }).catch(function (error) {\n console.log('/user error:', error.message);\n });\n }\n }, {\n key: 'logoutUser',\n value: function logoutUser() {\n var _this3 = this;\n\n var params = { credentials: 'include' };\n (0, _request2.default)('/logout', params).then(function () {\n _this3.props.onChannelLogout();\n }).catch(function (error) {\n console.log('/logout error', error.message);\n });\n }\n }, {\n key: 'handleSelection',\n value: function handleSelection(event) {\n var value = event.target.selectedOptions[0].value;\n switch (value) {\n case LOGOUT:\n this.logoutUser();\n break;\n case VIEW:\n // redirect to channel page\n this.props.history.push('/' + this.props.channelName + ':' + this.props.channelLongId);\n break;\n default:\n break;\n }\n }\n }, {\n key: 'render',\n value: function render() {\n return _react2.default.createElement(\n 'div',\n { className: 'row row--wide nav-bar' },\n _react2.default.createElement(\n 'div',\n { className: 'row row--padded row--short flex-container--row flex-container--space-between-center' },\n _react2.default.createElement(_Logo2.default, null),\n _react2.default.createElement(\n 'div',\n { className: 'nav-bar--center' },\n _react2.default.createElement(\n 'span',\n { className: 'nav-bar-tagline' },\n 'Open-source, decentralized image and video sharing.'\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'nav-bar--right' },\n _react2.default.createElement(\n _reactRouterDom.NavLink,\n { className: 'nav-bar-link link--nav', activeClassName: 'link--nav-active', to: '/', exact: true },\n 'Publish'\n ),\n _react2.default.createElement(\n _reactRouterDom.NavLink,\n { className: 'nav-bar-link link--nav', activeClassName: 'link--nav-active', to: '/about' },\n 'About'\n ),\n this.props.channelName ? _react2.default.createElement(_NavBarChannelOptionsDropdown2.default, {\n channelName: this.props.channelName,\n handleSelection: this.handleSelection,\n defaultSelection: this.props.channelName,\n VIEW: VIEW,\n LOGOUT: LOGOUT\n }) : _react2.default.createElement(\n _reactRouterDom.NavLink,\n { id: 'nav-bar-login-link', className: 'nav-bar-link link--nav', activeClassName: 'link--nav-active', to: '/login' },\n 'Channel'\n )\n )\n )\n );\n }\n }]);\n\n return NavBar;\n}(_react2.default.Component);\n\nexports.default = (0, _reactRouterDom.withRouter)(NavBar);\n\n/***/ }),\n/* 88 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactRouterDom = __webpack_require__(4);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction Logo() {\n return _react2.default.createElement(\n 'svg',\n { 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' },\n _react2.default.createElement(\n _reactRouterDom.Link,\n { to: '/' },\n _react2.default.createElement(\n 'title',\n null,\n 'Logo'\n ),\n _react2.default.createElement(\n 'desc',\n null,\n 'Spee.ch logo'\n ),\n _react2.default.createElement(\n 'g',\n { id: 'About' },\n _react2.default.createElement(\n 'g',\n { id: 'Publish-Form-V2-_x28_filled_x29_', transform: 'translate(-42.000000, -23.000000)' },\n _react2.default.createElement(\n 'g',\n { id: 'Group-17', transform: 'translate(42.000000, 22.000000)' },\n _react2.default.createElement(\n 'text',\n { transform: 'matrix(1 0 0 1 0 20)', fontSize: '25', fontFamily: 'Roboto' },\n 'Spee 10000000) {\n throw new Error('Sorry, images are limited to 10 megabytes.');\n }\n break;\n case 'image/gif':\n if (file.size > 50000000) {\n throw new Error('Sorry, GIFs are limited to 50 megabytes.');\n }\n break;\n case 'video/mp4':\n if (file.size > 50000000) {\n throw new Error('Sorry, videos are limited to 50 megabytes.');\n }\n break;\n default:\n throw new Error(file.type + ' is not a supported file type. Only, .jpeg, .png, .gif, and .mp4 files are currently supported.');\n }\n }\n};\n\n/***/ }),\n/* 95 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = __webpack_require__(10);\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Preview = function (_React$Component) {\n _inherits(Preview, _React$Component);\n\n function Preview(props) {\n _classCallCheck(this, Preview);\n\n var _this = _possibleConstructorReturn(this, (Preview.__proto__ || Object.getPrototypeOf(Preview)).call(this, props));\n\n _this.state = {\n imgSource: '',\n defaultThumbnail: '/assets/img/video_thumb_default.png'\n };\n return _this;\n }\n\n _createClass(Preview, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.setPreviewImageSource(this.props.file);\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(newProps) {\n if (newProps.file !== this.props.file) {\n this.setPreviewImageSource(newProps.file);\n }\n if (newProps.thumbnail !== this.props.thumbnail) {\n if (newProps.thumbnail) {\n this.setPreviewImageSourceFromFile(newProps.thumbnail);\n } else {\n this.setState({ imgSource: this.state.defaultThumbnail });\n }\n }\n }\n }, {\n key: 'setPreviewImageSourceFromFile',\n value: function setPreviewImageSourceFromFile(file) {\n var _this2 = this;\n\n var previewReader = new FileReader();\n previewReader.readAsDataURL(file);\n previewReader.onloadend = function () {\n _this2.setState({ imgSource: previewReader.result });\n };\n }\n }, {\n key: 'setPreviewImageSource',\n value: function setPreviewImageSource(file) {\n if (file.type !== 'video/mp4') {\n this.setPreviewImageSourceFromFile(file);\n } else {\n if (this.props.thumbnail) {\n this.setPreviewImageSourceFromFile(this.props.thumbnail);\n }\n this.setState({ imgSource: this.state.defaultThumbnail });\n }\n }\n }, {\n key: 'render',\n value: function render() {\n return _react2.default.createElement('img', {\n id: 'dropzone-preview',\n src: this.state.imgSource,\n className: this.props.dimPreview ? 'dim' : '',\n alt: 'publish preview'\n });\n }\n }]);\n\n return Preview;\n}(_react2.default.Component);\n\n;\n\nPreview.propTypes = {\n dimPreview: _propTypes2.default.bool.isRequired,\n file: _propTypes2.default.object.isRequired,\n thumbnail: _propTypes2.default.object\n};\n\nexports.default = Preview;\n\n/***/ }),\n/* 96 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _publish = __webpack_require__(5);\n\nvar _view = __webpack_require__(97);\n\nvar _view2 = _interopRequireDefault(_view);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapStateToProps = function mapStateToProps(_ref) {\n var channel = _ref.channel,\n publish = _ref.publish;\n\n return {\n file: publish.file\n };\n};\n\nvar mapDispatchToProps = {\n clearFile: _publish.clearFile,\n startPublish: _publish.startPublish\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view2.default);\n\n/***/ }),\n/* 97 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactRouterDom = __webpack_require__(4);\n\nvar _Dropzone = __webpack_require__(37);\n\nvar _Dropzone2 = _interopRequireDefault(_Dropzone);\n\nvar _PublishTitleInput = __webpack_require__(98);\n\nvar _PublishTitleInput2 = _interopRequireDefault(_PublishTitleInput);\n\nvar _PublishUrlInput = __webpack_require__(100);\n\nvar _PublishUrlInput2 = _interopRequireDefault(_PublishUrlInput);\n\nvar _PublishThumbnailInput = __webpack_require__(103);\n\nvar _PublishThumbnailInput2 = _interopRequireDefault(_PublishThumbnailInput);\n\nvar _PublishMetadataInputs = __webpack_require__(105);\n\nvar _PublishMetadataInputs2 = _interopRequireDefault(_PublishMetadataInputs);\n\nvar _ChannelSelect = __webpack_require__(108);\n\nvar _ChannelSelect2 = _interopRequireDefault(_ChannelSelect);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar PublishDetails = function (_React$Component) {\n _inherits(PublishDetails, _React$Component);\n\n function PublishDetails(props) {\n _classCallCheck(this, PublishDetails);\n\n var _this = _possibleConstructorReturn(this, (PublishDetails.__proto__ || Object.getPrototypeOf(PublishDetails)).call(this, props));\n\n _this.onPublishSubmit = _this.onPublishSubmit.bind(_this);\n return _this;\n }\n\n _createClass(PublishDetails, [{\n key: 'onPublishSubmit',\n value: function onPublishSubmit() {\n this.props.startPublish(this.props.history);\n }\n }, {\n key: 'render',\n value: function render() {\n return _react2.default.createElement(\n 'div',\n { className: 'row row--no-bottom' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--10' },\n _react2.default.createElement(_PublishTitleInput2.default, null)\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--5 column--sml-10' },\n _react2.default.createElement(\n 'div',\n { className: 'row row--padded' },\n _react2.default.createElement(_Dropzone2.default, null)\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--5 column--sml-10 align-content-top' },\n _react2.default.createElement(\n 'div',\n { id: 'publish-active-area', className: 'row row--padded' },\n _react2.default.createElement(\n 'div',\n { className: 'row row--padded row--no-top row--wide' },\n _react2.default.createElement(_PublishUrlInput2.default, null)\n ),\n _react2.default.createElement(\n 'div',\n { className: 'row row--padded row--no-top row--wide' },\n _react2.default.createElement(_ChannelSelect2.default, null)\n ),\n this.props.file.type === 'video/mp4' && _react2.default.createElement(\n 'div',\n { className: 'row row--padded row--no-top row--wide ' },\n _react2.default.createElement(_PublishThumbnailInput2.default, null)\n ),\n _react2.default.createElement(\n 'div',\n { className: 'row row--padded row--no-top row--no-bottom row--wide' },\n _react2.default.createElement(_PublishMetadataInputs2.default, null)\n ),\n _react2.default.createElement(\n 'div',\n { className: 'row row--wide align-content-center' },\n _react2.default.createElement(\n 'button',\n { id: 'publish-submit', className: 'button--primary button--large', onClick: this.onPublishSubmit },\n 'Publish'\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'row row--padded row--no-bottom align-content-center' },\n _react2.default.createElement(\n 'button',\n { className: 'button--cancel', onClick: this.props.clearFile },\n 'Cancel'\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'row row--short align-content-center' },\n _react2.default.createElement(\n 'p',\n { className: 'fine-print' },\n '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. ',\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', target: '_blank', href: 'https://lbry.io/learn' },\n 'Read more.'\n )\n )\n )\n )\n )\n );\n }\n }]);\n\n return PublishDetails;\n}(_react2.default.Component);\n\n;\n\nexports.default = (0, _reactRouterDom.withRouter)(PublishDetails);\n\n/***/ }),\n/* 98 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _publish = __webpack_require__(5);\n\nvar _view = __webpack_require__(99);\n\nvar _view2 = _interopRequireDefault(_view);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapStateToProps = function mapStateToProps(_ref) {\n var publish = _ref.publish;\n\n return {\n title: publish.metadata.title\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch) {\n return {\n onMetadataChange: function onMetadataChange(name, value) {\n dispatch((0, _publish.updateMetadata)(name, value));\n }\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view2.default);\n\n/***/ }),\n/* 99 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar PublishTitleInput = function (_React$Component) {\n _inherits(PublishTitleInput, _React$Component);\n\n function PublishTitleInput(props) {\n _classCallCheck(this, PublishTitleInput);\n\n var _this = _possibleConstructorReturn(this, (PublishTitleInput.__proto__ || Object.getPrototypeOf(PublishTitleInput)).call(this, props));\n\n _this.handleInput = _this.handleInput.bind(_this);\n return _this;\n }\n\n _createClass(PublishTitleInput, [{\n key: 'handleInput',\n value: function handleInput(e) {\n var name = e.target.name;\n var value = e.target.value;\n this.props.onMetadataChange(name, value);\n }\n }, {\n key: 'render',\n value: function render() {\n return _react2.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 });\n }\n }]);\n\n return PublishTitleInput;\n}(_react2.default.Component);\n\nexports.default = PublishTitleInput;\n\n/***/ }),\n/* 100 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _publish = __webpack_require__(5);\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _view = __webpack_require__(101);\n\nvar _view2 = _interopRequireDefault(_view);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapStateToProps = function mapStateToProps(_ref) {\n var channel = _ref.channel,\n publish = _ref.publish;\n\n return {\n loggedInChannelName: channel.loggedInChannel.name,\n loggedInChannelShortId: channel.loggedInChannel.shortId,\n fileName: publish.file.name,\n publishInChannel: publish.publishInChannel,\n selectedChannel: publish.selectedChannel,\n claim: publish.claim,\n urlError: publish.error.url\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch) {\n return {\n onClaimChange: function onClaimChange(value) {\n dispatch((0, _publish.updateClaim)(value));\n dispatch((0, _publish.updateError)('publishSubmit', null));\n },\n onUrlError: function onUrlError(value) {\n dispatch((0, _publish.updateError)('url', value));\n }\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view2.default);\n\n/***/ }),\n/* 101 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _request = __webpack_require__(11);\n\nvar _request2 = _interopRequireDefault(_request);\n\nvar _PublishUrlMiddleDisplay = __webpack_require__(102);\n\nvar _PublishUrlMiddleDisplay2 = _interopRequireDefault(_PublishUrlMiddleDisplay);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar PublishUrlInput = function (_React$Component) {\n _inherits(PublishUrlInput, _React$Component);\n\n function PublishUrlInput(props) {\n _classCallCheck(this, PublishUrlInput);\n\n var _this = _possibleConstructorReturn(this, (PublishUrlInput.__proto__ || Object.getPrototypeOf(PublishUrlInput)).call(this, props));\n\n _this.handleInput = _this.handleInput.bind(_this);\n return _this;\n }\n\n _createClass(PublishUrlInput, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n var _props = this.props,\n claim = _props.claim,\n fileName = _props.fileName;\n\n if (!claim) {\n this.setClaimName(fileName);\n }\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(_ref) {\n var claim = _ref.claim,\n fileName = _ref.fileName;\n\n // if a new file was chosen, update the claim name\n if (fileName !== this.props.fileName) {\n return this.setClaimName(fileName);\n }\n // if the claim has updated, check its availability\n if (claim !== this.props.claim) {\n this.validateClaim(claim);\n }\n }\n }, {\n key: 'handleInput',\n value: function handleInput(event) {\n var value = event.target.value;\n value = this.cleanseInput(value);\n // update the state\n this.props.onClaimChange(value);\n }\n }, {\n key: 'cleanseInput',\n value: function cleanseInput(input) {\n input = input.replace(/\\s+/g, '-'); // replace spaces with dashes\n input = input.replace(/[^A-Za-z0-9-]/g, ''); // remove all characters that are not A-Z, a-z, 0-9, or '-'\n return input;\n }\n }, {\n key: 'setClaimName',\n value: function setClaimName(fileName) {\n var fileNameWithoutEnding = fileName.substring(0, fileName.lastIndexOf('.'));\n var cleanClaimName = this.cleanseInput(fileNameWithoutEnding);\n this.props.onClaimChange(cleanClaimName);\n }\n }, {\n key: 'validateClaim',\n value: function validateClaim(claim) {\n var _this2 = this;\n\n if (!claim) {\n return this.props.onUrlError('Enter a url above');\n }\n (0, _request2.default)('/api/claim/availability/' + claim).then(function () {\n _this2.props.onUrlError(null);\n }).catch(function (error) {\n _this2.props.onUrlError(error.message);\n });\n }\n }, {\n key: 'render',\n value: function render() {\n var _props2 = this.props,\n claim = _props2.claim,\n loggedInChannelName = _props2.loggedInChannelName,\n loggedInChannelShortId = _props2.loggedInChannelShortId,\n publishInChannel = _props2.publishInChannel,\n selectedChannel = _props2.selectedChannel,\n urlError = _props2.urlError;\n\n return _react2.default.createElement(\n 'div',\n { className: 'column column--10 column--sml-10' },\n _react2.default.createElement(\n 'div',\n { className: 'input-text--primary span--relative' },\n _react2.default.createElement(\n 'span',\n { className: 'url-text--secondary' },\n 'spee.ch / '\n ),\n _react2.default.createElement(_PublishUrlMiddleDisplay2.default, {\n publishInChannel: publishInChannel,\n selectedChannel: selectedChannel,\n loggedInChannelName: loggedInChannelName,\n loggedInChannelShortId: loggedInChannelShortId\n }),\n _react2.default.createElement('input', { type: 'text', id: 'claim-name-input', className: 'input-text', name: 'claim', placeholder: 'your-url-here', onChange: this.handleInput, value: claim }),\n claim && !urlError && _react2.default.createElement(\n 'span',\n { id: 'input-success-claim-name', className: 'info-message--success span--absolute' },\n '\\u2713'\n ),\n urlError && _react2.default.createElement(\n 'span',\n { id: 'input-success-channel-name', className: 'info-message--failure span--absolute' },\n '\\u2716'\n )\n ),\n _react2.default.createElement(\n 'div',\n null,\n urlError ? _react2.default.createElement(\n 'p',\n { id: 'input-error-claim-name', className: 'info-message--failure' },\n urlError\n ) : _react2.default.createElement(\n 'p',\n { className: 'info-message' },\n 'Choose a custom url'\n )\n )\n );\n }\n }]);\n\n return PublishUrlInput;\n}(_react2.default.Component);\n\nexports.default = PublishUrlInput;\n\n/***/ }),\n/* 102 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = __webpack_require__(10);\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction UrlMiddle(_ref) {\n var publishInChannel = _ref.publishInChannel,\n selectedChannel = _ref.selectedChannel,\n loggedInChannelName = _ref.loggedInChannelName,\n loggedInChannelShortId = _ref.loggedInChannelShortId;\n\n if (publishInChannel) {\n if (selectedChannel === loggedInChannelName) {\n return _react2.default.createElement(\n 'span',\n { id: 'url-channel', className: 'url-text--secondary' },\n loggedInChannelName,\n ':',\n loggedInChannelShortId,\n ' /'\n );\n }\n return _react2.default.createElement(\n 'span',\n { id: 'url-channel-placeholder', className: 'url-text--secondary tooltip' },\n '@channel',\n _react2.default.createElement(\n 'span',\n {\n className: 'tooltip-text' },\n 'Select a channel below'\n ),\n ' /'\n );\n }\n return _react2.default.createElement(\n 'span',\n { id: 'url-no-channel-placeholder', className: 'url-text--secondary tooltip' },\n 'xyz',\n _react2.default.createElement(\n 'span',\n { className: 'tooltip-text' },\n 'This will be a random id'\n ),\n ' /'\n );\n}\n\nUrlMiddle.propTypes = {\n publishInChannel: _propTypes2.default.bool.isRequired,\n loggedInChannelName: _propTypes2.default.string,\n loggedInChannelShortId: _propTypes2.default.string\n};\n\nexports.default = UrlMiddle;\n\n/***/ }),\n/* 103 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _publish = __webpack_require__(5);\n\nvar _view = __webpack_require__(104);\n\nvar _view2 = _interopRequireDefault(_view);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapStateToProps = function mapStateToProps(_ref) {\n var file = _ref.publish.file;\n\n return {\n file: file\n };\n};\n\nvar mapDispatchToProps = {\n onNewThumbnail: _publish.onNewThumbnail\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view2.default);\n\n/***/ }),\n/* 104 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nfunction dataURItoBlob(dataURI) {\n // convert base64/URLEncoded data component to raw binary data held in a string\n var byteString = atob(dataURI.split(',')[1]);\n // separate out the mime component\n var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];\n // write the bytes of the string to a typed array\n var ia = new Uint8Array(byteString.length);\n for (var i = 0; i < byteString.length; i++) {\n ia[i] = byteString.charCodeAt(i);\n }\n return new Blob([ia], { type: mimeString });\n}\n\nvar PublishThumbnailInput = function (_React$Component) {\n _inherits(PublishThumbnailInput, _React$Component);\n\n function PublishThumbnailInput(props) {\n _classCallCheck(this, PublishThumbnailInput);\n\n var _this = _possibleConstructorReturn(this, (PublishThumbnailInput.__proto__ || Object.getPrototypeOf(PublishThumbnailInput)).call(this, props));\n\n _this.state = {\n videoSource: null,\n error: null,\n sliderMinRange: 1,\n sliderMaxRange: null,\n sliderValue: null\n };\n _this.handleVideoLoadedData = _this.handleVideoLoadedData.bind(_this);\n _this.handleSliderChange = _this.handleSliderChange.bind(_this);\n _this.createThumbnail = _this.createThumbnail.bind(_this);\n return _this;\n }\n\n _createClass(PublishThumbnailInput, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n var file = this.props.file;\n\n this.setVideoSource(file);\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(nextProps) {\n // if file changes\n if (nextProps.file && nextProps.file !== this.props.file) {\n var file = nextProps.file;\n\n this.setVideoSource(file);\n };\n }\n }, {\n key: 'setVideoSource',\n value: function setVideoSource(file) {\n var _this2 = this;\n\n var previewReader = new FileReader();\n previewReader.readAsDataURL(file);\n previewReader.onloadend = function () {\n var dataUri = previewReader.result;\n var blob = dataURItoBlob(dataUri);\n var videoSource = URL.createObjectURL(blob);\n _this2.setState({ videoSource: videoSource });\n };\n }\n }, {\n key: 'handleVideoLoadedData',\n value: function handleVideoLoadedData(event) {\n var duration = event.target.duration;\n var totalMinutes = Math.floor(duration / 60);\n var totalSeconds = Math.floor(duration % 60);\n // set the slider\n this.setState({\n sliderMaxRange: duration * 100,\n sliderValue: duration * 100 / 2,\n totalMinutes: totalMinutes,\n totalSeconds: totalSeconds\n });\n // update the current time of the video\n var video = document.getElementById('video-thumb-player');\n video.currentTime = duration / 2;\n }\n }, {\n key: 'handleSliderChange',\n value: function handleSliderChange(event) {\n var value = parseInt(event.target.value);\n // update the slider value\n this.setState({\n sliderValue: value\n });\n // update the current time of the video\n var video = document.getElementById('video-thumb-player');\n video.currentTime = value / 100;\n }\n }, {\n key: 'createThumbnail',\n value: function createThumbnail() {\n // take a snapshot\n var video = document.getElementById('video-thumb-player');\n var canvas = document.createElement('canvas');\n canvas.width = video.videoWidth;\n canvas.height = video.videoHeight;\n canvas.getContext('2d').drawImage(video, 0, 0, canvas.width, canvas.height);\n var dataUrl = canvas.toDataURL();\n var blob = dataURItoBlob(dataUrl);\n var snapshot = new File([blob], 'thumbnail.png', {\n type: 'image/png'\n });\n // set the thumbnail in redux store\n if (snapshot) {\n this.props.onNewThumbnail(snapshot);\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _state = this.state,\n error = _state.error,\n videoSource = _state.videoSource,\n sliderMinRange = _state.sliderMinRange,\n sliderMaxRange = _state.sliderMaxRange,\n sliderValue = _state.sliderValue,\n totalMinutes = _state.totalMinutes,\n totalSeconds = _state.totalSeconds;\n\n return _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n 'label',\n { className: 'label' },\n 'Thumbnail:'\n ),\n _react2.default.createElement('video', {\n id: 'video-thumb-player',\n preload: 'metadata',\n muted: true,\n style: { display: 'none' },\n playsInline: true,\n onLoadedData: this.handleVideoLoadedData,\n src: videoSource,\n onSeeked: this.createThumbnail\n }),\n sliderValue ? _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n 'div',\n { className: 'flex-container--row flex-container--space-between-center', style: { width: '100%' } },\n _react2.default.createElement(\n 'span',\n { className: 'info-message' },\n '0\\'00\"'\n ),\n _react2.default.createElement(\n 'span',\n { className: 'info-message' },\n totalMinutes,\n '\\'',\n totalSeconds,\n '\"'\n )\n ),\n _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement('input', {\n type: 'range',\n min: sliderMinRange,\n max: sliderMaxRange,\n value: sliderValue,\n className: 'slider',\n onChange: this.handleSliderChange\n })\n )\n ) : _react2.default.createElement(\n 'p',\n { className: 'info-message' },\n 'loading... '\n ),\n error ? _react2.default.createElement(\n 'p',\n { className: 'info-message--failure' },\n error\n ) : _react2.default.createElement(\n 'p',\n { className: 'info-message' },\n 'Use slider to set thumbnail'\n )\n );\n }\n }]);\n\n return PublishThumbnailInput;\n}(_react2.default.Component);\n\nexports.default = PublishThumbnailInput;\n\n/***/ }),\n/* 105 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _publish = __webpack_require__(5);\n\nvar _view = __webpack_require__(106);\n\nvar _view2 = _interopRequireDefault(_view);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapStateToProps = function mapStateToProps(_ref) {\n var publish = _ref.publish;\n\n return {\n showMetadataInputs: publish.showMetadataInputs,\n description: publish.metadata.description,\n license: publish.metadata.license,\n nsfw: publish.metadata.nsfw\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch) {\n return {\n onMetadataChange: function onMetadataChange(name, value) {\n dispatch((0, _publish.updateMetadata)(name, value));\n },\n onToggleMetadataInputs: function onToggleMetadataInputs(value) {\n dispatch((0, _publish.toggleMetadataInputs)(value));\n }\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view2.default);\n\n/***/ }),\n/* 106 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _ExpandingTextArea = __webpack_require__(107);\n\nvar _ExpandingTextArea2 = _interopRequireDefault(_ExpandingTextArea);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar PublishMetadataInputs = function (_React$Component) {\n _inherits(PublishMetadataInputs, _React$Component);\n\n function PublishMetadataInputs(props) {\n _classCallCheck(this, PublishMetadataInputs);\n\n var _this = _possibleConstructorReturn(this, (PublishMetadataInputs.__proto__ || Object.getPrototypeOf(PublishMetadataInputs)).call(this, props));\n\n _this.toggleShowInputs = _this.toggleShowInputs.bind(_this);\n _this.handleInput = _this.handleInput.bind(_this);\n _this.handleSelect = _this.handleSelect.bind(_this);\n return _this;\n }\n\n _createClass(PublishMetadataInputs, [{\n key: 'toggleShowInputs',\n value: function toggleShowInputs() {\n this.props.onToggleMetadataInputs(!this.props.showMetadataInputs);\n }\n }, {\n key: 'handleInput',\n value: function handleInput(event) {\n var target = event.target;\n var value = target.type === 'checkbox' ? target.checked : target.value;\n var name = target.name;\n this.props.onMetadataChange(name, value);\n }\n }, {\n key: 'handleSelect',\n value: function handleSelect(event) {\n var name = event.target.name;\n var selectedOption = event.target.selectedOptions[0].value;\n this.props.onMetadataChange(name, selectedOption);\n }\n }, {\n key: 'render',\n value: function render() {\n return _react2.default.createElement(\n 'div',\n { id: 'publish-details', className: 'row row--padded row--no-top row--wide' },\n this.props.showMetadataInputs && _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n 'div',\n { className: 'row row--no-top' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--3 column--med-10 align-content-top' },\n _react2.default.createElement(\n 'label',\n { htmlFor: 'publish-license', className: 'label' },\n 'Description:'\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--7 column--sml-10' },\n _react2.default.createElement(_ExpandingTextArea2.default, {\n id: 'publish-description',\n className: 'textarea textarea--primary textarea--full-width',\n rows: 1,\n maxLength: 2000,\n style: { maxHeight: 200 },\n name: 'description',\n placeholder: 'Optional description',\n value: this.props.description,\n onChange: this.handleInput })\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'row row--no-top' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--3 column--med-10' },\n _react2.default.createElement(\n 'label',\n { htmlFor: 'publish-license', className: 'label' },\n 'License:'\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--7 column--sml-10' },\n _react2.default.createElement(\n 'select',\n { type: 'text', name: 'license', id: 'publish-license', className: 'select select--primary', onChange: this.handleSelect },\n _react2.default.createElement(\n 'option',\n { value: ' ' },\n 'Unspecified'\n ),\n _react2.default.createElement(\n 'option',\n { value: 'Public Domain' },\n 'Public Domain'\n ),\n _react2.default.createElement(\n 'option',\n { value: 'Creative Commons' },\n 'Creative Commons'\n )\n )\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'row row--no-top' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--3' },\n _react2.default.createElement(\n 'label',\n { htmlFor: 'publish-nsfw', className: 'label' },\n 'Mature:'\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--7' },\n _react2.default.createElement('input', { className: 'input-checkbox', type: 'checkbox', id: 'publish-nsfw', name: 'nsfw', value: this.props.nsfw, onChange: this.handleInput })\n )\n )\n ),\n _react2.default.createElement(\n 'button',\n { className: 'button--secondary', onClick: this.toggleShowInputs },\n this.props.showMetadataInputs ? 'less' : 'more'\n )\n );\n }\n }]);\n\n return PublishMetadataInputs;\n}(_react2.default.Component);\n\nexports.default = PublishMetadataInputs;\n\n/***/ }),\n/* 107 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = __webpack_require__(10);\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ExpandingTextarea = function (_Component) {\n _inherits(ExpandingTextarea, _Component);\n\n function ExpandingTextarea(props) {\n _classCallCheck(this, ExpandingTextarea);\n\n var _this = _possibleConstructorReturn(this, (ExpandingTextarea.__proto__ || Object.getPrototypeOf(ExpandingTextarea)).call(this, props));\n\n _this._handleChange = _this._handleChange.bind(_this);\n return _this;\n }\n\n _createClass(ExpandingTextarea, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.adjustTextarea({});\n }\n }, {\n key: '_handleChange',\n value: function _handleChange(event) {\n var onChange = this.props.onChange;\n\n if (onChange) onChange(event);\n this.adjustTextarea(event);\n }\n }, {\n key: 'adjustTextarea',\n value: function adjustTextarea(_ref) {\n var _ref$target = _ref.target,\n target = _ref$target === undefined ? this.el : _ref$target;\n\n target.style.height = 0;\n target.style.height = target.scrollHeight + 'px';\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var rest = _objectWithoutProperties(this.props, []);\n\n return _react2.default.createElement('textarea', _extends({}, rest, {\n ref: function ref(x) {\n return _this2.el = x;\n },\n onChange: this._handleChange\n }));\n }\n }]);\n\n return ExpandingTextarea;\n}(_react.Component);\n\nExpandingTextarea.propTypes = {\n onChange: _propTypes2.default.func\n};\n\nexports.default = ExpandingTextarea;\n\n/***/ }),\n/* 108 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _publish = __webpack_require__(5);\n\nvar _view = __webpack_require__(109);\n\nvar _view2 = _interopRequireDefault(_view);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapStateToProps = function mapStateToProps(_ref) {\n var channel = _ref.channel,\n publish = _ref.publish;\n\n return {\n loggedInChannelName: channel.loggedInChannel.name,\n publishInChannel: publish.publishInChannel,\n selectedChannel: publish.selectedChannel,\n channelError: publish.error.channel\n };\n};\n\nvar mapDispatchToProps = function mapDispatchToProps(dispatch) {\n return {\n onPublishInChannelChange: function onPublishInChannelChange(value) {\n dispatch((0, _publish.updateError)('channel', null));\n dispatch((0, _publish.setPublishInChannel)(value));\n },\n onChannelSelect: function onChannelSelect(value) {\n dispatch((0, _publish.updateError)('channel', null));\n dispatch((0, _publish.updateSelectedChannel)(value));\n }\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view2.default);\n\n/***/ }),\n/* 109 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _ChannelLoginForm = __webpack_require__(38);\n\nvar _ChannelLoginForm2 = _interopRequireDefault(_ChannelLoginForm);\n\nvar _ChannelCreateForm = __webpack_require__(39);\n\nvar _ChannelCreateForm2 = _interopRequireDefault(_ChannelCreateForm);\n\nvar _publish_channel_select_states = __webpack_require__(32);\n\nvar states = _interopRequireWildcard(_publish_channel_select_states);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ChannelSelect = function (_React$Component) {\n _inherits(ChannelSelect, _React$Component);\n\n function ChannelSelect(props) {\n _classCallCheck(this, ChannelSelect);\n\n var _this = _possibleConstructorReturn(this, (ChannelSelect.__proto__ || Object.getPrototypeOf(ChannelSelect)).call(this, props));\n\n _this.toggleAnonymousPublish = _this.toggleAnonymousPublish.bind(_this);\n _this.handleSelection = _this.handleSelection.bind(_this);\n return _this;\n }\n\n _createClass(ChannelSelect, [{\n key: 'toggleAnonymousPublish',\n value: function toggleAnonymousPublish(event) {\n var value = event.target.value;\n if (value === 'anonymous') {\n this.props.onPublishInChannelChange(false);\n } else {\n this.props.onPublishInChannelChange(true);\n }\n }\n }, {\n key: 'handleSelection',\n value: function handleSelection(event) {\n var selectedOption = event.target.selectedOptions[0].value;\n this.props.onChannelSelect(selectedOption);\n }\n }, {\n key: 'render',\n value: function render() {\n return _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n 'form',\n null,\n _react2.default.createElement(\n 'div',\n { className: 'column column--3 column--med-10' },\n _react2.default.createElement('input', { type: 'radio', name: 'anonymous-or-channel', id: 'anonymous-radio', className: 'input-radio', value: 'anonymous', checked: !this.props.publishInChannel, onChange: this.toggleAnonymousPublish }),\n _react2.default.createElement(\n 'label',\n { className: 'label label--pointer', htmlFor: 'anonymous-radio' },\n 'Anonymous'\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--7 column--med-10' },\n _react2.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 }),\n _react2.default.createElement(\n 'label',\n { className: 'label label--pointer', htmlFor: 'channel-radio' },\n 'In a channel'\n )\n ),\n this.props.channelError ? _react2.default.createElement(\n 'p',\n { className: 'info-message--failure' },\n this.props.channelError\n ) : _react2.default.createElement(\n 'p',\n { className: 'info-message' },\n 'Publish anonymously or in a channel'\n )\n ),\n this.props.publishInChannel && _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n 'div',\n { className: 'column column--3' },\n _react2.default.createElement(\n 'label',\n { className: 'label', htmlFor: 'channel-name-select' },\n 'Channel:'\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--7' },\n _react2.default.createElement(\n 'select',\n { type: 'text', id: 'channel-name-select', className: 'select select--arrow', value: this.props.selectedChannel, onChange: this.handleSelection },\n this.props.loggedInChannelName && _react2.default.createElement(\n 'option',\n { value: this.props.loggedInChannelName, id: 'publish-channel-select-channel-option' },\n this.props.loggedInChannelName\n ),\n _react2.default.createElement(\n 'option',\n { value: states.LOGIN },\n 'Existing'\n ),\n _react2.default.createElement(\n 'option',\n { value: states.CREATE },\n 'New'\n )\n )\n ),\n this.props.selectedChannel === states.LOGIN && _react2.default.createElement(_ChannelLoginForm2.default, null),\n this.props.selectedChannel === states.CREATE && _react2.default.createElement(_ChannelCreateForm2.default, null)\n )\n );\n }\n }]);\n\n return ChannelSelect;\n}(_react2.default.Component);\n\nexports.default = ChannelSelect;\n\n/***/ }),\n/* 110 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _request = __webpack_require__(11);\n\nvar _request2 = _interopRequireDefault(_request);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ChannelLoginForm = function (_React$Component) {\n _inherits(ChannelLoginForm, _React$Component);\n\n function ChannelLoginForm(props) {\n _classCallCheck(this, ChannelLoginForm);\n\n var _this = _possibleConstructorReturn(this, (ChannelLoginForm.__proto__ || Object.getPrototypeOf(ChannelLoginForm)).call(this, props));\n\n _this.state = {\n error: null,\n name: '',\n password: ''\n };\n _this.handleInput = _this.handleInput.bind(_this);\n _this.loginToChannel = _this.loginToChannel.bind(_this);\n return _this;\n }\n\n _createClass(ChannelLoginForm, [{\n key: 'handleInput',\n value: function handleInput(event) {\n var name = event.target.name;\n var value = event.target.value;\n this.setState(_defineProperty({}, name, value));\n }\n }, {\n key: 'loginToChannel',\n value: function loginToChannel(event) {\n var _this2 = this;\n\n event.preventDefault();\n var params = {\n method: 'POST',\n body: JSON.stringify({ username: this.state.name, password: this.state.password }),\n headers: new Headers({\n 'Content-Type': 'application/json'\n }),\n credentials: 'include'\n };\n (0, _request2.default)('login', params).then(function (_ref) {\n var success = _ref.success,\n channelName = _ref.channelName,\n shortChannelId = _ref.shortChannelId,\n channelClaimId = _ref.channelClaimId,\n message = _ref.message;\n\n if (success) {\n _this2.props.onChannelLogin(channelName, shortChannelId, channelClaimId);\n } else {\n _this2.setState({ 'error': message });\n };\n }).catch(function (error) {\n if (error.message) {\n _this2.setState({ 'error': error.message });\n } else {\n _this2.setState({ 'error': error });\n }\n });\n }\n }, {\n key: 'render',\n value: function render() {\n return _react2.default.createElement(\n 'form',\n { id: 'channel-login-form' },\n _react2.default.createElement(\n 'div',\n { className: 'row row--wide row--short' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--3 column--sml-10' },\n _react2.default.createElement(\n 'label',\n { className: 'label', htmlFor: 'channel-login-name-input' },\n 'Name:'\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--6 column--sml-10' },\n _react2.default.createElement(\n 'div',\n { className: 'input-text--primary flex-container--row flex-container--left-bottom' },\n _react2.default.createElement(\n 'span',\n null,\n '@'\n ),\n _react2.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 })\n )\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'row row--wide row--short' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--3 column--sml-10' },\n _react2.default.createElement(\n 'label',\n { className: 'label', htmlFor: 'channel-login-password-input' },\n 'Password:'\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--6 column--sml-10' },\n _react2.default.createElement(\n 'div',\n { className: 'input-text--primary' },\n _react2.default.createElement('input', { type: 'password', id: 'channel-login-password-input', name: 'password', className: 'input-text', placeholder: '', value: this.state.channelPassword, onChange: this.handleInput })\n )\n )\n ),\n this.state.error ? _react2.default.createElement(\n 'p',\n { className: 'info-message--failure' },\n this.state.error\n ) : _react2.default.createElement(\n 'p',\n { className: 'info-message' },\n 'Enter the name and password for your channel'\n ),\n _react2.default.createElement(\n 'div',\n { className: 'row row--wide' },\n _react2.default.createElement(\n 'button',\n { className: 'button--primary', onClick: this.loginToChannel },\n 'Authenticate'\n )\n )\n );\n }\n }]);\n\n return ChannelLoginForm;\n}(_react2.default.Component);\n\nexports.default = ChannelLoginForm;\n\n/***/ }),\n/* 111 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _ProgressBar = __webpack_require__(20);\n\nvar _ProgressBar2 = _interopRequireDefault(_ProgressBar);\n\nvar _request = __webpack_require__(11);\n\nvar _request2 = _interopRequireDefault(_request);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ChannelCreateForm = function (_React$Component) {\n _inherits(ChannelCreateForm, _React$Component);\n\n function ChannelCreateForm(props) {\n _classCallCheck(this, ChannelCreateForm);\n\n var _this = _possibleConstructorReturn(this, (ChannelCreateForm.__proto__ || Object.getPrototypeOf(ChannelCreateForm)).call(this, props));\n\n _this.state = {\n error: null,\n channel: '',\n password: '',\n status: null\n };\n _this.handleChannelInput = _this.handleChannelInput.bind(_this);\n _this.handleInput = _this.handleInput.bind(_this);\n _this.createChannel = _this.createChannel.bind(_this);\n return _this;\n }\n\n _createClass(ChannelCreateForm, [{\n key: 'cleanseChannelInput',\n value: function cleanseChannelInput(input) {\n input = input.replace(/\\s+/g, '-'); // replace spaces with dashes\n input = input.replace(/[^A-Za-z0-9-]/g, ''); // remove all characters that are not A-Z, a-z, 0-9, or '-'\n return input;\n }\n }, {\n key: 'handleChannelInput',\n value: function handleChannelInput(event) {\n var value = event.target.value;\n value = this.cleanseChannelInput(value);\n this.setState({ channel: value });\n if (value) {\n this.updateIsChannelAvailable(value);\n } else {\n this.setState({ error: 'Please enter a channel name' });\n }\n }\n }, {\n key: 'handleInput',\n value: function handleInput(event) {\n var name = event.target.name;\n var value = event.target.value;\n this.setState(_defineProperty({}, name, value));\n }\n }, {\n key: 'updateIsChannelAvailable',\n value: function updateIsChannelAvailable(channel) {\n var _this2 = this;\n\n var channelWithAtSymbol = '@' + channel;\n (0, _request2.default)('/api/channel/availability/' + channelWithAtSymbol).then(function (isAvailable) {\n if (isAvailable) {\n _this2.setState({ 'error': null });\n } else {\n _this2.setState({ 'error': 'That channel has already been claimed' });\n }\n }).catch(function (error) {\n _this2.setState({ 'error': error.message });\n });\n }\n }, {\n key: 'checkIsChannelAvailable',\n value: function checkIsChannelAvailable(channel) {\n var channelWithAtSymbol = '@' + channel;\n return new Promise(function (resolve, reject) {\n (0, _request2.default)('/api/channel/availability/' + channelWithAtSymbol).then(function (isAvailable) {\n if (!isAvailable) {\n return reject(new Error('That channel has already been claimed'));\n }\n resolve();\n }).catch(function (error) {\n reject(error);\n });\n });\n }\n }, {\n key: 'checkIsPasswordProvided',\n value: function checkIsPasswordProvided() {\n var password = this.state.password;\n return new Promise(function (resolve, reject) {\n if (!password || password.length < 1) {\n return reject(new Error('Please provide a password'));\n }\n resolve();\n });\n }\n }, {\n key: 'makePublishChannelRequest',\n value: function makePublishChannelRequest(username, password) {\n var params = {\n method: 'POST',\n body: JSON.stringify({ username: username, password: password }),\n headers: new Headers({\n 'Content-Type': 'application/json'\n }),\n credentials: 'include'\n };\n return new Promise(function (resolve, reject) {\n (0, _request2.default)('/signup', params).then(function (result) {\n return resolve(result);\n }).catch(function (error) {\n reject(new Error('Unfortunately, we encountered an error while creating your channel. Please let us know in Discord! ' + error.message));\n });\n });\n }\n }, {\n key: 'createChannel',\n value: function createChannel(event) {\n var _this3 = this;\n\n event.preventDefault();\n this.checkIsPasswordProvided().then(function () {\n return _this3.checkIsChannelAvailable(_this3.state.channel, _this3.state.password);\n }).then(function () {\n _this3.setState({ status: 'We are publishing your new channel. Sit tight...' });\n return _this3.makePublishChannelRequest(_this3.state.channel, _this3.state.password);\n }).then(function (result) {\n _this3.setState({ status: null });\n _this3.props.onChannelLogin(result.channelName, result.shortChannelId, result.channelClaimId);\n }).catch(function (error) {\n _this3.setState({ 'error': error.message, status: null });\n });\n }\n }, {\n key: 'render',\n value: function render() {\n return _react2.default.createElement(\n 'div',\n null,\n !this.state.status ? _react2.default.createElement(\n 'form',\n { id: 'publish-channel-form' },\n _react2.default.createElement(\n 'div',\n { className: 'row row--wide row--short' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--3 column--sml-10' },\n _react2.default.createElement(\n 'label',\n { className: 'label', htmlFor: 'new-channel-name' },\n 'Name:'\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--6 column--sml-10' },\n _react2.default.createElement(\n 'div',\n { className: 'input-text--primary flex-container--row flex-container--left-bottom span--relative' },\n _react2.default.createElement(\n 'span',\n null,\n '@'\n ),\n _react2.default.createElement('input', { type: 'text', name: 'channel', id: 'new-channel-name', className: 'input-text', placeholder: 'exampleChannelName', value: this.state.channel, onChange: this.handleChannelInput }),\n this.state.channel && !this.state.error && _react2.default.createElement(\n 'span',\n { id: 'input-success-channel-name', className: 'info-message--success span--absolute' },\n '\\u2713'\n ),\n this.state.error && _react2.default.createElement(\n 'span',\n { id: 'input-success-channel-name', className: 'info-message--failure span--absolute' },\n '\\u2716'\n )\n )\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'row row--wide row--short' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--3 column--sml-10' },\n _react2.default.createElement(\n 'label',\n { className: 'label', htmlFor: 'new-channel-password' },\n 'Password:'\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--6 column--sml-10' },\n _react2.default.createElement(\n 'div',\n { className: 'input-text--primary' },\n _react2.default.createElement('input', { type: 'password', name: 'password', id: 'new-channel-password', className: 'input-text', placeholder: '', value: this.state.password, onChange: this.handleInput })\n )\n )\n ),\n this.state.error ? _react2.default.createElement(\n 'p',\n { className: 'info-message--failure' },\n this.state.error\n ) : _react2.default.createElement(\n 'p',\n { className: 'info-message' },\n 'Choose a name and password for your channel'\n ),\n _react2.default.createElement(\n 'div',\n { className: 'row row--wide' },\n _react2.default.createElement(\n 'button',\n { className: 'button--primary', onClick: this.createChannel },\n 'Create Channel'\n )\n )\n ) : _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n 'p',\n { className: 'fine-print' },\n this.state.status\n ),\n _react2.default.createElement(_ProgressBar2.default, { size: 12 })\n )\n );\n }\n }]);\n\n return ChannelCreateForm;\n}(_react2.default.Component);\n\nexports.default = ChannelCreateForm;\n\n/***/ }),\n/* 112 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar ActiveStatusBar = function ActiveStatusBar() {\n return _react2.default.createElement(\n 'span',\n { className: 'progress-bar progress-bar--active' },\n '| '\n );\n};\n\nexports.default = ActiveStatusBar;\n\n/***/ }),\n/* 113 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar InactiveStatusBar = function InactiveStatusBar() {\n return _react2.default.createElement(\n 'span',\n { className: 'progress-bar progress-bar--inactive' },\n '| '\n );\n};\n\nexports.default = InactiveStatusBar;\n\n/***/ }),\n/* 114 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _publish = __webpack_require__(5);\n\nvar _view = __webpack_require__(115);\n\nvar _view2 = _interopRequireDefault(_view);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapStateToProps = function mapStateToProps(_ref) {\n var publish = _ref.publish;\n\n return {\n status: publish.status.status,\n message: publish.status.message\n };\n};\n\nvar mapDispatchToProps = {\n clearFile: _publish.clearFile\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view2.default);\n\n/***/ }),\n/* 115 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _ProgressBar = __webpack_require__(20);\n\nvar _ProgressBar2 = _interopRequireDefault(_ProgressBar);\n\nvar _publish_claim_states = __webpack_require__(116);\n\nvar publishStates = _interopRequireWildcard(_publish_claim_states);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar PublishStatus = function (_React$Component) {\n _inherits(PublishStatus, _React$Component);\n\n function PublishStatus() {\n _classCallCheck(this, PublishStatus);\n\n return _possibleConstructorReturn(this, (PublishStatus.__proto__ || Object.getPrototypeOf(PublishStatus)).apply(this, arguments));\n }\n\n _createClass(PublishStatus, [{\n key: 'render',\n value: function render() {\n var _props = this.props,\n status = _props.status,\n message = _props.message,\n clearFile = _props.clearFile;\n\n return _react2.default.createElement(\n 'div',\n { className: 'row row--tall flex-container--column flex-container--center-center' },\n status === publishStates.LOAD_START && _react2.default.createElement(\n 'div',\n { className: 'row align-content-center' },\n _react2.default.createElement(\n 'p',\n null,\n 'File is loading to server'\n ),\n _react2.default.createElement(\n 'p',\n { className: 'blue' },\n '0%'\n )\n ),\n status === publishStates.LOADING && _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n 'div',\n { className: 'row align-content-center' },\n _react2.default.createElement(\n 'p',\n null,\n 'File is loading to server'\n ),\n _react2.default.createElement(\n 'p',\n { className: 'blue' },\n message\n )\n )\n ),\n status === publishStates.PUBLISHING && _react2.default.createElement(\n 'div',\n { className: 'row align-content-center' },\n _react2.default.createElement(\n 'p',\n null,\n 'Upload complete. Your file is now being published on the blockchain...'\n ),\n _react2.default.createElement(_ProgressBar2.default, { size: 12 }),\n _react2.default.createElement(\n 'p',\n null,\n 'Curious what magic is happening here? ',\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', target: 'blank', href: 'https://lbry.io/faq/what-is-lbry' },\n 'Learn more.'\n )\n )\n ),\n status === publishStates.SUCCESS && _react2.default.createElement(\n 'div',\n { className: 'row align-content-center' },\n _react2.default.createElement(\n 'p',\n null,\n 'Your publish is complete! You are being redirected to it now.'\n ),\n _react2.default.createElement(\n 'p',\n null,\n 'If you are not automatically redirected, ',\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', target: '_blank', href: message },\n 'click here.'\n )\n )\n ),\n status === publishStates.FAILED && _react2.default.createElement(\n 'div',\n { className: 'row align-content-center' },\n _react2.default.createElement(\n 'p',\n null,\n 'Something went wrong...'\n ),\n _react2.default.createElement(\n 'p',\n null,\n _react2.default.createElement(\n 'strong',\n null,\n message\n )\n ),\n _react2.default.createElement(\n 'p',\n null,\n 'For help, post the above error text in the #speech channel on the ',\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', href: 'https://discord.gg/YjYbwhS', target: '_blank' },\n 'lbry discord'\n )\n ),\n _react2.default.createElement(\n 'button',\n { className: 'button--secondary', onClick: clearFile },\n 'Reset'\n )\n )\n );\n }\n }]);\n\n return PublishStatus;\n}(_react2.default.Component);\n\n;\n\nexports.default = PublishStatus;\n\n/***/ }),\n/* 116 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar LOAD_START = exports.LOAD_START = 'LOAD_START';\nvar LOADING = exports.LOADING = 'LOADING';\nvar PUBLISHING = exports.PUBLISHING = 'PUBLISHING';\nvar SUCCESS = exports.SUCCESS = 'SUCCESS';\nvar FAILED = exports.FAILED = 'FAILED';\n\n/***/ }),\n/* 117 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _NavBar = __webpack_require__(7);\n\nvar _NavBar2 = _interopRequireDefault(_NavBar);\n\nvar _SEO = __webpack_require__(9);\n\nvar _SEO2 = _interopRequireDefault(_SEO);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar AboutPage = function (_React$Component) {\n _inherits(AboutPage, _React$Component);\n\n function AboutPage() {\n _classCallCheck(this, AboutPage);\n\n return _possibleConstructorReturn(this, (AboutPage.__proto__ || Object.getPrototypeOf(AboutPage)).apply(this, arguments));\n }\n\n _createClass(AboutPage, [{\n key: 'render',\n value: function render() {\n return _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(_SEO2.default, { pageTitle: 'About', pageUri: 'about' }),\n _react2.default.createElement(_NavBar2.default, null),\n _react2.default.createElement(\n 'div',\n { className: 'row row--padded' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--5 column--med-10 align-content-top' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--8 column--med-10' },\n _react2.default.createElement(\n 'p',\n { className: 'pull-quote' },\n 'Spee.ch is an open-source project. Please contribute to the existing site, or fork it and make your own.'\n ),\n _react2.default.createElement(\n 'p',\n null,\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', target: '_blank', href: 'https://twitter.com/spee_ch' },\n 'TWITTER'\n )\n ),\n _react2.default.createElement(\n 'p',\n null,\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', target: '_blank', href: 'https://github.com/lbryio/spee.ch' },\n 'GITHUB'\n )\n ),\n _react2.default.createElement(\n 'p',\n null,\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', target: '_blank', href: 'https://discord.gg/YjYbwhS' },\n 'DISCORD CHANNEL'\n )\n ),\n _react2.default.createElement(\n 'p',\n null,\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', target: '_blank', href: 'https://github.com/lbryio/spee.ch/blob/master/README.md' },\n 'DOCUMENTATION'\n )\n )\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--5 column--med-10 align-content-top' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--8 column--med-10' },\n _react2.default.createElement(\n 'p',\n null,\n 'Spee.ch is a media-hosting site that reads from and publishes content to the ',\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', href: 'https://lbry.io' },\n 'LBRY'\n ),\n ' blockchain.'\n ),\n _react2.default.createElement(\n 'p',\n null,\n 'Spee.ch is a hosting service, but with the added benefit that it stores your content on a decentralized network of computers -- the LBRY network. This means that your images are stored in multiple locations without a single point of failure.'\n ),\n _react2.default.createElement(\n 'h3',\n null,\n 'Contribute'\n ),\n _react2.default.createElement(\n 'p',\n null,\n 'If you have an idea for your own spee.ch-like site on top of LBRY, fork our ',\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', href: 'https://github.com/lbryio/spee.ch' },\n 'github repo'\n ),\n ' and go to town!'\n ),\n _react2.default.createElement(\n 'p',\n null,\n 'If you want to improve spee.ch, join our ',\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', href: 'https://discord.gg/YjYbwhS' },\n 'discord channel'\n ),\n ' or solve one of our ',\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', href: 'https://github.com/lbryio/spee.ch/issues' },\n 'github issues'\n ),\n '.'\n )\n )\n )\n )\n );\n }\n }]);\n\n return AboutPage;\n}(_react2.default.Component);\n\n;\n\nexports.default = AboutPage;\n\n/***/ }),\n/* 118 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _view = __webpack_require__(119);\n\nvar _view2 = _interopRequireDefault(_view);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapStateToProps = function mapStateToProps(_ref) {\n var channel = _ref.channel;\n\n return {\n loggedInChannelName: channel.loggedInChannel.name\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, null)(_view2.default);\n\n/***/ }),\n/* 119 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactRouterDom = __webpack_require__(4);\n\nvar _SEO = __webpack_require__(9);\n\nvar _SEO2 = _interopRequireDefault(_SEO);\n\nvar _NavBar = __webpack_require__(7);\n\nvar _NavBar2 = _interopRequireDefault(_NavBar);\n\nvar _ChannelLoginForm = __webpack_require__(38);\n\nvar _ChannelLoginForm2 = _interopRequireDefault(_ChannelLoginForm);\n\nvar _ChannelCreateForm = __webpack_require__(39);\n\nvar _ChannelCreateForm2 = _interopRequireDefault(_ChannelCreateForm);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar LoginPage = function (_React$Component) {\n _inherits(LoginPage, _React$Component);\n\n function LoginPage() {\n _classCallCheck(this, LoginPage);\n\n return _possibleConstructorReturn(this, (LoginPage.__proto__ || Object.getPrototypeOf(LoginPage)).apply(this, arguments));\n }\n\n _createClass(LoginPage, [{\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(newProps) {\n // re-route the user to the homepage if the user is logged in\n if (newProps.loggedInChannelName !== this.props.loggedInChannelName) {\n this.props.history.push('/');\n }\n }\n }, {\n key: 'render',\n value: function render() {\n return _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(_SEO2.default, { pageTitle: 'Login', pageUri: 'login' }),\n _react2.default.createElement(_NavBar2.default, null),\n _react2.default.createElement(\n 'div',\n { className: 'row row--padded' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--5 column--med-10 align-content-top' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--8 column--med-10' },\n _react2.default.createElement(\n 'p',\n null,\n '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 ',\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', target: '_blank', href: '/@catalonia2017:43dcf47163caa21d8404d9fe9b30f78ef3e146a8' },\n 'documenting important events'\n ),\n ', or making a public repository for ',\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', target: '_blank', href: '/@catGifs' },\n 'cat gifs'\n ),\n ' (password: \\'1234\\'), try creating a channel for it!'\n )\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--5 column--med-10 align-content-top' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--8 column--med-10' },\n _react2.default.createElement(\n 'h3',\n { className: 'h3--no-bottom' },\n 'Log in to an existing channel:'\n ),\n _react2.default.createElement(_ChannelLoginForm2.default, null),\n _react2.default.createElement(\n 'h3',\n { className: 'h3--no-bottom' },\n 'Create a brand new channel:'\n ),\n _react2.default.createElement(_ChannelCreateForm2.default, null)\n )\n )\n )\n );\n }\n }]);\n\n return LoginPage;\n}(_react2.default.Component);\n\n;\n\nexports.default = (0, _reactRouterDom.withRouter)(LoginPage);\n\n/***/ }),\n/* 120 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _show = __webpack_require__(8);\n\nvar _view = __webpack_require__(121);\n\nvar _view2 = _interopRequireDefault(_view);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapStateToProps = function mapStateToProps(_ref) {\n var show = _ref.show;\n\n return {\n error: show.request.error,\n requestType: show.request.type\n };\n};\n\nvar mapDispatchToProps = {\n onHandleShowPageUri: _show.onHandleShowPageUri\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view2.default);\n\n/***/ }),\n/* 121 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _ErrorPage = __webpack_require__(21);\n\nvar _ErrorPage2 = _interopRequireDefault(_ErrorPage);\n\nvar _ShowAssetLite = __webpack_require__(122);\n\nvar _ShowAssetLite2 = _interopRequireDefault(_ShowAssetLite);\n\nvar _ShowAssetDetails = __webpack_require__(125);\n\nvar _ShowAssetDetails2 = _interopRequireDefault(_ShowAssetDetails);\n\nvar _ShowChannel = __webpack_require__(131);\n\nvar _ShowChannel2 = _interopRequireDefault(_ShowChannel);\n\nvar _show_request_types = __webpack_require__(40);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ShowPage = function (_React$Component) {\n _inherits(ShowPage, _React$Component);\n\n function ShowPage() {\n _classCallCheck(this, ShowPage);\n\n return _possibleConstructorReturn(this, (ShowPage.__proto__ || Object.getPrototypeOf(ShowPage)).apply(this, arguments));\n }\n\n _createClass(ShowPage, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.props.onHandleShowPageUri(this.props.match.params);\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(nextProps) {\n if (nextProps.match.params !== this.props.match.params) {\n this.props.onHandleShowPageUri(nextProps.match.params);\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _props = this.props,\n error = _props.error,\n requestType = _props.requestType;\n\n if (error) {\n return _react2.default.createElement(_ErrorPage2.default, { error: error });\n }\n switch (requestType) {\n case _show_request_types.CHANNEL:\n return _react2.default.createElement(_ShowChannel2.default, null);\n case _show_request_types.ASSET_LITE:\n return _react2.default.createElement(_ShowAssetLite2.default, null);\n case _show_request_types.ASSET_DETAILS:\n return _react2.default.createElement(_ShowAssetDetails2.default, null);\n default:\n return _react2.default.createElement(\n 'p',\n null,\n 'loading...'\n );\n }\n }\n }]);\n\n return ShowPage;\n}(_react2.default.Component);\n\n;\n\nexports.default = ShowPage;\n\n/***/ }),\n/* 122 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _view = __webpack_require__(123);\n\nvar _view2 = _interopRequireDefault(_view);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapStateToProps = function mapStateToProps(_ref) {\n var show = _ref.show;\n\n // select request info\n var requestId = show.request.id;\n // select asset info\n var asset = void 0;\n var request = show.requestList[requestId] || null;\n var assetList = show.assetList;\n if (request && assetList) {\n var assetKey = request.key; // note: just store this in the request\n asset = assetList[assetKey] || null;\n };\n // return props\n return {\n asset: asset\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, null)(_view2.default);\n\n/***/ }),\n/* 123 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _SEO = __webpack_require__(9);\n\nvar _SEO2 = _interopRequireDefault(_SEO);\n\nvar _reactRouterDom = __webpack_require__(4);\n\nvar _AssetDisplay = __webpack_require__(41);\n\nvar _AssetDisplay2 = _interopRequireDefault(_AssetDisplay);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ShowLite = function (_React$Component) {\n _inherits(ShowLite, _React$Component);\n\n function ShowLite() {\n _classCallCheck(this, ShowLite);\n\n return _possibleConstructorReturn(this, (ShowLite.__proto__ || Object.getPrototypeOf(ShowLite)).apply(this, arguments));\n }\n\n _createClass(ShowLite, [{\n key: 'render',\n value: function render() {\n var asset = this.props.asset;\n\n if (asset) {\n var _asset$claimData = asset.claimData,\n name = _asset$claimData.name,\n claimId = _asset$claimData.claimId;\n\n return _react2.default.createElement(\n 'div',\n { className: 'row row--tall flex-container--column flex-container--center-center show-lite-container' },\n _react2.default.createElement(_SEO2.default, { pageTitle: name, asset: asset }),\n _react2.default.createElement(_AssetDisplay2.default, null),\n _react2.default.createElement(\n _reactRouterDom.Link,\n { id: 'asset-boilerpate', className: 'link--primary fine-print', to: '/' + claimId + '/' + name },\n 'hosted via Spee.ch'\n )\n );\n }\n return _react2.default.createElement(\n 'div',\n { className: 'row row--tall row--padded flex-container--column flex-container--center-center' },\n _react2.default.createElement(\n 'p',\n null,\n 'loading asset data...'\n )\n );\n }\n }]);\n\n return ShowLite;\n}(_react2.default.Component);\n\n;\n\nexports.default = ShowLite;\n\n/***/ }),\n/* 124 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _ProgressBar = __webpack_require__(20);\n\nvar _ProgressBar2 = _interopRequireDefault(_ProgressBar);\n\nvar _asset_display_states = __webpack_require__(34);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar AssetDisplay = function (_React$Component) {\n _inherits(AssetDisplay, _React$Component);\n\n function AssetDisplay() {\n _classCallCheck(this, AssetDisplay);\n\n return _possibleConstructorReturn(this, (AssetDisplay.__proto__ || Object.getPrototypeOf(AssetDisplay)).apply(this, arguments));\n }\n\n _createClass(AssetDisplay, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n var _props$asset$claimDat = this.props.asset.claimData,\n name = _props$asset$claimDat.name,\n claimId = _props$asset$claimDat.claimId;\n\n this.props.onFileRequest(name, claimId);\n }\n }, {\n key: 'render',\n value: function render() {\n var _props = this.props,\n status = _props.status,\n error = _props.error,\n _props$asset$claimDat2 = _props.asset.claimData,\n name = _props$asset$claimDat2.name,\n claimId = _props$asset$claimDat2.claimId,\n contentType = _props$asset$claimDat2.contentType,\n fileExt = _props$asset$claimDat2.fileExt,\n thumbnail = _props$asset$claimDat2.thumbnail;\n\n return _react2.default.createElement(\n 'div',\n { id: 'asset-display-component' },\n status === _asset_display_states.LOCAL_CHECK && _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n 'p',\n null,\n 'Checking to see if Spee.ch has your asset locally...'\n )\n ),\n status === _asset_display_states.UNAVAILABLE && _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n 'p',\n null,\n 'Sit tight, we\\'re searching the LBRY blockchain for your asset!'\n ),\n _react2.default.createElement(_ProgressBar2.default, { size: 12 }),\n _react2.default.createElement(\n 'p',\n null,\n 'Curious what magic is happening here? ',\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', target: 'blank', href: 'https://lbry.io/faq/what-is-lbry' },\n 'Learn more.'\n )\n )\n ),\n status === _asset_display_states.ERROR && _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n 'p',\n null,\n 'Unfortunately, we couldn\\'t download your asset from LBRY. You can help us out by sharing the below error message in the ',\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', href: 'https://discord.gg/YjYbwhS', target: '_blank' },\n 'LBRY discord'\n ),\n '.'\n ),\n _react2.default.createElement(\n 'i',\n null,\n _react2.default.createElement(\n 'p',\n { id: 'error-message' },\n error\n )\n )\n ),\n status === _asset_display_states.AVAILABLE && function () {\n switch (contentType) {\n case 'image/jpeg':\n case 'image/jpg':\n case 'image/png':\n return _react2.default.createElement('img', {\n className: 'asset',\n src: '/' + claimId + '/' + name + '.' + fileExt,\n alt: name });\n case 'image/gif':\n return _react2.default.createElement('img', {\n className: 'asset',\n src: '/' + claimId + '/' + name + '.' + fileExt,\n alt: name\n });\n case 'video/mp4':\n return _react2.default.createElement(\n 'video',\n { className: 'asset video', controls: true, poster: thumbnail },\n _react2.default.createElement('source', {\n src: '/' + claimId + '/' + name + '.' + fileExt\n }),\n _react2.default.createElement(\n 'p',\n null,\n 'Your browser does not support the ',\n _react2.default.createElement(\n 'code',\n null,\n 'video'\n ),\n ' element.'\n )\n );\n default:\n return _react2.default.createElement(\n 'p',\n null,\n 'Unsupported file type'\n );\n }\n }()\n );\n }\n }]);\n\n return AssetDisplay;\n}(_react2.default.Component);\n\n;\n\nexports.default = AssetDisplay;\n\n/***/ }),\n/* 125 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _view = __webpack_require__(126);\n\nvar _view2 = _interopRequireDefault(_view);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapStateToProps = function mapStateToProps(_ref) {\n var show = _ref.show;\n\n // select request info\n var requestId = show.request.id;\n // select asset info\n var asset = void 0;\n var request = show.requestList[requestId] || null;\n var assetList = show.assetList;\n if (request && assetList) {\n var assetKey = request.key; // note: just store this in the request\n asset = assetList[assetKey] || null;\n };\n // return props\n return {\n asset: asset\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, null)(_view2.default);\n\n/***/ }),\n/* 126 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _SEO = __webpack_require__(9);\n\nvar _SEO2 = _interopRequireDefault(_SEO);\n\nvar _NavBar = __webpack_require__(7);\n\nvar _NavBar2 = _interopRequireDefault(_NavBar);\n\nvar _ErrorPage = __webpack_require__(21);\n\nvar _ErrorPage2 = _interopRequireDefault(_ErrorPage);\n\nvar _AssetTitle = __webpack_require__(127);\n\nvar _AssetTitle2 = _interopRequireDefault(_AssetTitle);\n\nvar _AssetDisplay = __webpack_require__(41);\n\nvar _AssetDisplay2 = _interopRequireDefault(_AssetDisplay);\n\nvar _AssetInfo = __webpack_require__(129);\n\nvar _AssetInfo2 = _interopRequireDefault(_AssetInfo);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ShowAssetDetails = function (_React$Component) {\n _inherits(ShowAssetDetails, _React$Component);\n\n function ShowAssetDetails() {\n _classCallCheck(this, ShowAssetDetails);\n\n return _possibleConstructorReturn(this, (ShowAssetDetails.__proto__ || Object.getPrototypeOf(ShowAssetDetails)).apply(this, arguments));\n }\n\n _createClass(ShowAssetDetails, [{\n key: 'render',\n value: function render() {\n var asset = this.props.asset;\n\n if (asset) {\n var name = asset.claimData.name;\n\n return _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(_SEO2.default, { pageTitle: name + ' - details', asset: asset }),\n _react2.default.createElement(_NavBar2.default, null),\n _react2.default.createElement(\n 'div',\n { className: 'row row--tall row--padded' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--10' },\n _react2.default.createElement(_AssetTitle2.default, null)\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--5 column--sml-10 align-content-top' },\n _react2.default.createElement(\n 'div',\n { className: 'row row--padded show-details-container' },\n _react2.default.createElement(_AssetDisplay2.default, null)\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--5 column--sml-10 align-content-top' },\n _react2.default.createElement(\n 'div',\n { className: 'row row--padded' },\n _react2.default.createElement(_AssetInfo2.default, null)\n )\n )\n ),\n '}'\n );\n };\n return _react2.default.createElement(_ErrorPage2.default, { error: 'loading asset data...' });\n }\n }]);\n\n return ShowAssetDetails;\n}(_react2.default.Component);\n\n;\n\nexports.default = ShowAssetDetails;\n\n/***/ }),\n/* 127 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _view = __webpack_require__(128);\n\nvar _view2 = _interopRequireDefault(_view);\n\nvar _show = __webpack_require__(13);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapStateToProps = function mapStateToProps(_ref) {\n var show = _ref.show;\n\n var _selectAsset = (0, _show.selectAsset)(show),\n title = _selectAsset.claimData.title;\n\n return {\n title: title\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, null)(_view2.default);\n\n/***/ }),\n/* 128 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar AssetTitle = function AssetTitle(_ref) {\n var title = _ref.title;\n\n return _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n 'span',\n { className: 'text--large' },\n title\n )\n );\n};\n\nexports.default = AssetTitle;\n\n/***/ }),\n/* 129 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _view = __webpack_require__(130);\n\nvar _view2 = _interopRequireDefault(_view);\n\nvar _show = __webpack_require__(13);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapStateToProps = function mapStateToProps(_ref) {\n var show = _ref.show;\n\n // select asset\n var asset = (0, _show.selectAsset)(show);\n // return props\n return {\n asset: asset\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, null)(_view2.default);\n\n/***/ }),\n/* 130 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactRouterDom = __webpack_require__(4);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar AssetInfo = function (_React$Component) {\n _inherits(AssetInfo, _React$Component);\n\n function AssetInfo(props) {\n _classCallCheck(this, AssetInfo);\n\n var _this = _possibleConstructorReturn(this, (AssetInfo.__proto__ || Object.getPrototypeOf(AssetInfo)).call(this, props));\n\n _this.copyToClipboard = _this.copyToClipboard.bind(_this);\n return _this;\n }\n\n _createClass(AssetInfo, [{\n key: 'copyToClipboard',\n value: function copyToClipboard(event) {\n var elementToCopy = event.target.dataset.elementtocopy;\n var element = document.getElementById(elementToCopy);\n element.select();\n try {\n document.execCommand('copy');\n } catch (err) {\n this.setState({ error: 'Oops, unable to copy' });\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _props$asset = this.props.asset,\n shortId = _props$asset.shortId,\n _props$asset$claimDat = _props$asset.claimData,\n channelName = _props$asset$claimDat.channelName,\n certificateId = _props$asset$claimDat.certificateId,\n description = _props$asset$claimDat.description,\n name = _props$asset$claimDat.name,\n claimId = _props$asset$claimDat.claimId,\n fileExt = _props$asset$claimDat.fileExt,\n contentType = _props$asset$claimDat.contentType,\n thumbnail = _props$asset$claimDat.thumbnail,\n host = _props$asset$claimDat.host;\n\n return _react2.default.createElement(\n 'div',\n null,\n channelName && _react2.default.createElement(\n 'div',\n { className: 'row row--padded row--wide row--no-top' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--2 column--med-10' },\n _react2.default.createElement(\n 'span',\n { className: 'text' },\n 'Channel:'\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--8 column--med-10' },\n _react2.default.createElement(\n 'span',\n { className: 'text' },\n _react2.default.createElement(\n _reactRouterDom.Link,\n { to: '/' + channelName + ':' + certificateId },\n channelName\n )\n )\n )\n ),\n description && _react2.default.createElement(\n 'div',\n { className: 'row row--padded row--wide row--no-top' },\n _react2.default.createElement(\n 'span',\n { className: 'text' },\n description\n )\n ),\n _react2.default.createElement(\n 'div',\n { id: 'show-share-buttons' },\n _react2.default.createElement(\n 'div',\n { className: 'row row--padded row--wide row--no-top' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--2 column--med-10' },\n _react2.default.createElement(\n 'span',\n { className: 'text' },\n 'Share:'\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--8 column--med-10' },\n _react2.default.createElement(\n 'div',\n {\n className: 'row row--short row--wide flex-container--row flex-container--space-between-bottom flex-container--wrap' },\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', target: '_blank', href: 'https://twitter.com/intent/tweet?text=' + host + '/' + shortId + '/' + name },\n 'twitter'\n ),\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', target: '_blank', href: 'https://www.facebook.com/sharer/sharer.php?u=' + host + '/' + shortId + '/' + name },\n 'facebook'\n ),\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', target: '_blank', href: 'http://tumblr.com/widgets/share/tool?canonicalUrl=' + host + '/' + shortId + '/' + name },\n 'tumblr'\n ),\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', target: '_blank', href: 'https://www.reddit.com/submit?url=' + host + '/' + shortId + '/' + name + '&title=' + name },\n 'reddit'\n )\n )\n )\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'row row--padded row--wide row--no-top' },\n _react2.default.createElement(\n 'div',\n { id: 'show-short-link' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--2 column--med-10' },\n _react2.default.createElement(\n 'span',\n { className: 'text' },\n 'Link:'\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--8 column--med-10' },\n _react2.default.createElement(\n 'div',\n { className: 'row row--short row--wide' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--7' },\n _react2.default.createElement(\n 'div',\n { className: 'input-error', id: 'input-error-copy-short-link', hidden: 'true' },\n 'error here'\n ),\n _react2.default.createElement('input', { type: 'text', id: 'short-link', className: 'input-disabled input-text--full-width', readOnly: true,\n spellCheck: 'false',\n value: host + '/' + shortId + '/' + name + '.' + fileExt,\n onClick: this.select })\n ),\n _react2.default.createElement('div', { className: 'column column--1' }),\n _react2.default.createElement(\n 'div',\n { className: 'column column--2' },\n _react2.default.createElement(\n 'button',\n { className: 'button--primary button--wide', 'data-elementtocopy': 'short-link',\n onClick: this.copyToClipboard },\n 'copy'\n )\n )\n )\n )\n ),\n _react2.default.createElement(\n 'div',\n { id: 'show-embed-code' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--2 column--med-10' },\n _react2.default.createElement(\n 'span',\n { className: 'text' },\n 'Embed:'\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--8 column--med-10' },\n _react2.default.createElement(\n 'div',\n { className: 'row row--short row--wide' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--7' },\n _react2.default.createElement(\n 'div',\n { className: 'input-error', id: 'input-error-copy-embed-text', hidden: 'true' },\n 'error here'\n ),\n contentType === 'video/mp4' ? _react2.default.createElement('input', { type: 'text', id: 'embed-text', className: 'input-disabled input-text--full-width', readOnly: true,\n onClick: this.select, spellCheck: 'false',\n value: '' }) : _react2.default.createElement('input', { type: 'text', id: 'embed-text', className: 'input-disabled input-text--full-width', readOnly: true,\n onClick: this.select, spellCheck: 'false',\n value: ''\n })\n ),\n _react2.default.createElement('div', { className: 'column column--1' }),\n _react2.default.createElement(\n 'div',\n { className: 'column column--2' },\n _react2.default.createElement(\n 'button',\n { className: 'button--primary button--wide', 'data-elementtocopy': 'embed-text',\n onClick: this.copyToClipboard },\n 'copy'\n )\n )\n )\n )\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'flex-container--row flex-container--space-between-bottom' },\n _react2.default.createElement(\n _reactRouterDom.Link,\n { className: 'link--primary', to: '/' + shortId + '/' + name + '.' + fileExt },\n _react2.default.createElement(\n 'span',\n {\n className: 'text' },\n 'Direct Link'\n )\n ),\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', href: host + '/' + claimId + '/' + name + '.' + fileExt, download: name },\n 'Download'\n ),\n _react2.default.createElement(\n 'a',\n { className: 'link--primary', target: '_blank', href: 'https://lbry.io/dmca' },\n 'Report'\n )\n )\n );\n }\n }]);\n\n return AssetInfo;\n}(_react2.default.Component);\n\n;\n\nexports.default = AssetInfo;\n\n/***/ }),\n/* 131 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _view = __webpack_require__(132);\n\nvar _view2 = _interopRequireDefault(_view);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapStateToProps = function mapStateToProps(_ref) {\n var show = _ref.show;\n\n // select request info\n var requestId = show.request.id;\n // select request\n var previousRequest = show.requestList[requestId] || null;\n // select channel\n var channel = void 0;\n if (previousRequest) {\n var channelKey = previousRequest.key;\n channel = show.channelList[channelKey] || null;\n }\n return {\n channel: channel\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, null)(_view2.default);\n\n/***/ }),\n/* 132 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _SEO = __webpack_require__(9);\n\nvar _SEO2 = _interopRequireDefault(_SEO);\n\nvar _ErrorPage = __webpack_require__(21);\n\nvar _ErrorPage2 = _interopRequireDefault(_ErrorPage);\n\nvar _NavBar = __webpack_require__(7);\n\nvar _NavBar2 = _interopRequireDefault(_NavBar);\n\nvar _ChannelClaimsDisplay = __webpack_require__(133);\n\nvar _ChannelClaimsDisplay2 = _interopRequireDefault(_ChannelClaimsDisplay);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ShowChannel = function (_React$Component) {\n _inherits(ShowChannel, _React$Component);\n\n function ShowChannel() {\n _classCallCheck(this, ShowChannel);\n\n return _possibleConstructorReturn(this, (ShowChannel.__proto__ || Object.getPrototypeOf(ShowChannel)).apply(this, arguments));\n }\n\n _createClass(ShowChannel, [{\n key: 'render',\n value: function render() {\n var channel = this.props.channel;\n\n if (channel) {\n var name = channel.name,\n longId = channel.longId,\n shortId = channel.shortId;\n\n return _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(_SEO2.default, { pageTitle: name, channel: channel }),\n _react2.default.createElement(_NavBar2.default, null),\n _react2.default.createElement(\n 'div',\n { className: 'row row--tall row--padded' },\n _react2.default.createElement(\n 'div',\n { className: 'column column--10' },\n _react2.default.createElement(\n 'h2',\n null,\n 'channel name: ',\n name\n ),\n _react2.default.createElement(\n 'p',\n { className: 'fine-print' },\n 'full channel id: ',\n longId\n ),\n _react2.default.createElement(\n 'p',\n { className: 'fine-print' },\n 'short channel id: ',\n shortId\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'column column--10' },\n _react2.default.createElement(_ChannelClaimsDisplay2.default, null)\n )\n )\n );\n };\n return _react2.default.createElement(_ErrorPage2.default, { error: 'loading channel data...' });\n }\n }]);\n\n return ShowChannel;\n}(_react2.default.Component);\n\n;\n\nexports.default = ShowChannel;\n\n/***/ }),\n/* 133 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _show = __webpack_require__(8);\n\nvar _view = __webpack_require__(134);\n\nvar _view2 = _interopRequireDefault(_view);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mapStateToProps = function mapStateToProps(_ref) {\n var show = _ref.show;\n\n // select channel key\n var request = show.requestList[show.request.id];\n var channelKey = request.key;\n // select channel claims\n var channel = show.channelList[channelKey] || null;\n // return props\n return {\n channelKey: channelKey,\n channel: channel\n };\n};\n\nvar mapDispatchToProps = {\n onUpdateChannelClaims: _show.onUpdateChannelClaims\n};\n\nexports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view2.default);\n\n/***/ }),\n/* 134 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _AssetPreview = __webpack_require__(135);\n\nvar _AssetPreview2 = _interopRequireDefault(_AssetPreview);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ChannelClaimsDisplay = function (_React$Component) {\n _inherits(ChannelClaimsDisplay, _React$Component);\n\n function ChannelClaimsDisplay(props) {\n _classCallCheck(this, ChannelClaimsDisplay);\n\n var _this = _possibleConstructorReturn(this, (ChannelClaimsDisplay.__proto__ || Object.getPrototypeOf(ChannelClaimsDisplay)).call(this, props));\n\n _this.showNextResultsPage = _this.showNextResultsPage.bind(_this);\n _this.showPreviousResultsPage = _this.showPreviousResultsPage.bind(_this);\n return _this;\n }\n\n _createClass(ChannelClaimsDisplay, [{\n key: 'showPreviousResultsPage',\n value: function showPreviousResultsPage() {\n var currentPage = this.props.channel.claimsData.currentPage;\n\n var previousPage = parseInt(currentPage) - 1;\n this.showNewPage(previousPage);\n }\n }, {\n key: 'showNextResultsPage',\n value: function showNextResultsPage() {\n var currentPage = this.props.channel.claimsData.currentPage;\n\n var nextPage = parseInt(currentPage) + 1;\n this.showNewPage(nextPage);\n }\n }, {\n key: 'showNewPage',\n value: function showNewPage(page) {\n var _props = this.props,\n channelKey = _props.channelKey,\n _props$channel = _props.channel,\n name = _props$channel.name,\n longId = _props$channel.longId;\n\n this.props.onUpdateChannelClaims(channelKey, name, longId, page);\n }\n }, {\n key: 'render',\n value: function render() {\n var _props$channel$claims = this.props.channel.claimsData,\n claims = _props$channel$claims.claims,\n currentPage = _props$channel$claims.currentPage,\n totalPages = _props$channel$claims.totalPages;\n\n return _react2.default.createElement(\n 'div',\n { className: 'row row--tall' },\n claims.length > 0 ? _react2.default.createElement(\n 'div',\n null,\n claims.map(function (claim, index) {\n return _react2.default.createElement(_AssetPreview2.default, {\n claimData: claim,\n key: claim.name + '-' + index\n });\n }),\n _react2.default.createElement(\n 'div',\n null,\n currentPage > 1 && _react2.default.createElement(\n 'button',\n { className: 'button--secondary', onClick: this.showPreviousResultsPage },\n 'Previous Page'\n ),\n currentPage < totalPages && _react2.default.createElement(\n 'button',\n { className: 'button--secondary', onClick: this.showNextResultsPage },\n 'Next Page'\n )\n )\n ) : _react2.default.createElement(\n 'p',\n null,\n 'There are no claims in this channel'\n )\n );\n }\n }]);\n\n return ChannelClaimsDisplay;\n}(_react2.default.Component);\n\n;\n\nexports.default = ChannelClaimsDisplay;\n\n/***/ }),\n/* 135 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactRouterDom = __webpack_require__(4);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar _require = __webpack_require__(3),\n defaultThumbnail = _require.claim.defaultThumbnail;\n\nvar AssetPreview = function AssetPreview(_ref) {\n var _ref$claimData = _ref.claimData,\n name = _ref$claimData.name,\n claimId = _ref$claimData.claimId,\n fileExt = _ref$claimData.fileExt,\n contentType = _ref$claimData.contentType,\n thumbnail = _ref$claimData.thumbnail;\n\n var directSourceLink = claimId + '/' + name + '.' + fileExt;\n var showUrlLink = '/' + claimId + '/' + name;\n return _react2.default.createElement(\n 'div',\n { className: 'asset-holder' },\n _react2.default.createElement(\n _reactRouterDom.Link,\n { to: showUrlLink },\n function () {\n switch (contentType) {\n case 'image/jpeg':\n case 'image/jpg':\n case 'image/png':\n case 'image/gif':\n return _react2.default.createElement('img', {\n className: 'asset-preview',\n src: directSourceLink,\n alt: name\n });\n case 'video/mp4':\n return _react2.default.createElement('img', {\n className: 'asset-preview video',\n src: thumbnail || defaultThumbnail,\n alt: name\n });\n default:\n return _react2.default.createElement(\n 'p',\n null,\n 'unsupported file type'\n );\n }\n }()\n )\n );\n};\n\nexports.default = AssetPreview;\n\n/***/ }),\n/* 136 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _NavBar = __webpack_require__(7);\n\nvar _NavBar2 = _interopRequireDefault(_NavBar);\n\nvar _reactHelmet = __webpack_require__(14);\n\nvar _reactHelmet2 = _interopRequireDefault(_reactHelmet);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar _require = __webpack_require__(3),\n _require$site = _require.site,\n title = _require$site.title,\n host = _require$site.host;\n\nvar FourOhForPage = function (_React$Component) {\n _inherits(FourOhForPage, _React$Component);\n\n function FourOhForPage() {\n _classCallCheck(this, FourOhForPage);\n\n return _possibleConstructorReturn(this, (FourOhForPage.__proto__ || Object.getPrototypeOf(FourOhForPage)).apply(this, arguments));\n }\n\n _createClass(FourOhForPage, [{\n key: 'render',\n value: function render() {\n return _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n _reactHelmet2.default,\n null,\n _react2.default.createElement(\n 'title',\n null,\n title,\n ' - 404'\n ),\n _react2.default.createElement('link', { rel: 'canonical', href: host + '/404' })\n ),\n _react2.default.createElement(_NavBar2.default, null),\n _react2.default.createElement(\n 'div',\n { className: 'row row--padded' },\n _react2.default.createElement(\n 'h2',\n null,\n '404'\n ),\n _react2.default.createElement(\n 'p',\n null,\n 'That page does not exist'\n )\n )\n );\n }\n }]);\n\n return FourOhForPage;\n}(_react2.default.Component);\n\n;\n\nexports.default = FourOhForPage;\n\n/***/ }),\n/* 137 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _require = __webpack_require__(17),\n sendGAServeEvent = _require.sendGAServeEvent;\n\nvar _require2 = __webpack_require__(138),\n determineResponseType = _require2.determineResponseType,\n flipClaimNameAndIdForBackwardsCompatibility = _require2.flipClaimNameAndIdForBackwardsCompatibility,\n logRequestData = _require2.logRequestData,\n getClaimIdAndServeAsset = _require2.getClaimIdAndServeAsset;\n\nvar lbryUri = __webpack_require__(139);\nvar handleShowRender = __webpack_require__(140);\nvar SERVE = 'SERVE';\n\nmodule.exports = function (app) {\n // route to serve a specific asset using the channel or claim id\n app.get('/:identifier/:claim', function (req, res) {\n var headers = req.headers,\n ip = req.ip,\n originalUrl = req.originalUrl,\n params = req.params;\n // decide if this is a show request\n\n var hasFileExtension = void 0;\n try {\n var _lbryUri$parseModifie = lbryUri.parseModifier(params.claim);\n\n hasFileExtension = _lbryUri$parseModifie.hasFileExtension;\n } catch (error) {\n return res.status(400).json({ success: false, message: error.message });\n }\n var responseType = determineResponseType(hasFileExtension, headers);\n if (responseType !== SERVE) {\n return handleShowRender(req, res);\n }\n // handle serve request\n // send google analytics\n sendGAServeEvent(headers, ip, originalUrl);\n // parse the claim\n var claimName = void 0;\n try {\n var _lbryUri$parseClaim = lbryUri.parseClaim(params.claim);\n\n claimName = _lbryUri$parseClaim.claimName;\n } catch (error) {\n return res.status(400).json({ success: false, message: error.message });\n }\n // parse the identifier\n var isChannel = void 0,\n channelName = void 0,\n channelClaimId = void 0,\n claimId = void 0;\n try {\n var _lbryUri$parseIdentif = lbryUri.parseIdentifier(params.identifier);\n\n isChannel = _lbryUri$parseIdentif.isChannel;\n channelName = _lbryUri$parseIdentif.channelName;\n channelClaimId = _lbryUri$parseIdentif.channelClaimId;\n claimId = _lbryUri$parseIdentif.claimId;\n } catch (error) {\n return res.status(400).json({ success: false, message: error.message });\n }\n if (!isChannel) {\n var _flipClaimNameAndIdFo = flipClaimNameAndIdForBackwardsCompatibility(claimId, claimName);\n\n var _flipClaimNameAndIdFo2 = _slicedToArray(_flipClaimNameAndIdFo, 2);\n\n claimId = _flipClaimNameAndIdFo2[0];\n claimName = _flipClaimNameAndIdFo2[1];\n }\n // log the request data for debugging\n logRequestData(responseType, claimName, channelName, claimId);\n // get the claim Id and then serve the asset\n getClaimIdAndServeAsset(channelName, channelClaimId, claimName, claimId, originalUrl, ip, res);\n });\n // route to serve the winning asset at a claim or a channel page\n app.get('/:claim', function (req, res) {\n var headers = req.headers,\n ip = req.ip,\n originalUrl = req.originalUrl,\n params = req.params;\n // decide if this is a show request\n\n var hasFileExtension = void 0;\n try {\n var _lbryUri$parseModifie2 = lbryUri.parseModifier(params.claim);\n\n hasFileExtension = _lbryUri$parseModifie2.hasFileExtension;\n } catch (error) {\n return res.status(400).json({ success: false, message: error.message });\n }\n var responseType = determineResponseType(hasFileExtension, headers);\n if (responseType !== SERVE) {\n return handleShowRender(req, res);\n }\n // handle serve request\n // send google analytics\n sendGAServeEvent(headers, ip, originalUrl);\n // parse the claim\n var claimName = void 0;\n try {\n var _lbryUri$parseClaim2 = lbryUri.parseClaim(params.claim);\n\n claimName = _lbryUri$parseClaim2.claimName;\n } catch (error) {\n return res.status(400).json({ success: false, message: error.message });\n }\n // log the request data for debugging\n logRequestData(responseType, claimName, null, null);\n // get the claim Id and then serve the asset\n getClaimIdAndServeAsset(null, null, claimName, null, originalUrl, ip, res);\n });\n};\n\n/***/ }),\n/* 138 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar logger = __webpack_require__(2);\n\nvar _require = __webpack_require__(27),\n getClaimId = _require.getClaimId,\n getLocalFileRecord = _require.getLocalFileRecord;\n\nvar _require2 = __webpack_require__(26),\n handleErrorResponse = _require2.handleErrorResponse;\n\nvar SERVE = 'SERVE';\nvar SHOW = 'SHOW';\nvar NO_FILE = 'NO_FILE';\nvar NO_CHANNEL = 'NO_CHANNEL';\nvar NO_CLAIM = 'NO_CLAIM';\n\nfunction clientAcceptsHtml(_ref) {\n var accept = _ref.accept;\n\n return accept && accept.match(/text\\/html/);\n};\n\nfunction requestIsFromBrowser(headers) {\n return headers['user-agent'] && headers['user-agent'].match(/Mozilla/);\n};\n\nfunction clientWantsAsset(_ref2) {\n var accept = _ref2.accept,\n range = _ref2.range;\n\n var imageIsWanted = accept && accept.match(/image\\/.*/) && !accept.match(/text\\/html/) && !accept.match(/text\\/\\*/);\n var videoIsWanted = accept && range;\n return imageIsWanted || videoIsWanted;\n};\n\nfunction isValidClaimId(claimId) {\n return claimId.length === 40 && !/[^A-Za-z0-9]/g.test(claimId);\n};\n\nfunction isValidShortId(claimId) {\n return claimId.length === 1; // it should really evaluate the short url itself\n};\n\nfunction isValidShortIdOrClaimId(input) {\n return isValidClaimId(input) || isValidShortId(input);\n};\n\nfunction serveAssetToClient(claimId, name, res) {\n return getLocalFileRecord(claimId, name).then(function (fileRecord) {\n // check that a local record was found\n if (fileRecord === NO_FILE) {\n return res.status(307).redirect('/api/claim/get/' + name + '/' + claimId);\n }\n // serve the file\n var filePath = fileRecord.filePath,\n fileType = fileRecord.fileType;\n\n logger.verbose('serving file: ' + filePath);\n var sendFileOptions = {\n headers: {\n 'X-Content-Type-Options': 'nosniff',\n 'Content-Type': fileType || 'image/jpeg'\n }\n };\n res.status(200).sendFile(filePath, sendFileOptions);\n }).catch(function (error) {\n throw error;\n });\n};\n\nmodule.exports = {\n getClaimIdAndServeAsset: function getClaimIdAndServeAsset(channelName, channelClaimId, claimName, claimId, originalUrl, ip, res) {\n // get the claim Id and then serve the asset\n getClaimId(channelName, channelClaimId, claimName, claimId).then(function (fullClaimId) {\n if (fullClaimId === NO_CLAIM) {\n return res.status(404).json({ success: false, message: 'no claim id could be found' });\n } else if (fullClaimId === NO_CHANNEL) {\n return res.status(404).json({ success: false, message: 'no channel id could be found' });\n }\n serveAssetToClient(fullClaimId, claimName, res);\n // postToStats(responseType, originalUrl, ip, claimName, fullClaimId, 'success');\n }).catch(function (error) {\n handleErrorResponse(originalUrl, ip, error, res);\n // postToStats(responseType, originalUrl, ip, claimName, fullClaimId, 'fail');\n });\n },\n determineResponseType: function determineResponseType(hasFileExtension, headers) {\n var responseType = void 0;\n if (hasFileExtension) {\n responseType = SERVE; // assume a serve request if file extension is present\n if (clientAcceptsHtml(headers)) {\n // if the request comes from a browser, change it to a show request\n responseType = SHOW;\n }\n } else {\n responseType = SHOW;\n if (clientWantsAsset(headers) && requestIsFromBrowser(headers)) {\n // this is in case someone embeds a show url\n logger.debug('Show request came from browser but wants an image/video. Changing response to serve...');\n responseType = SERVE;\n }\n }\n return responseType;\n },\n flipClaimNameAndIdForBackwardsCompatibility: function flipClaimNameAndIdForBackwardsCompatibility(identifier, name) {\n // this is a patch for backwards compatability with '/name/claim_id' url format\n if (isValidShortIdOrClaimId(name) && !isValidShortIdOrClaimId(identifier)) {\n var tempName = name;\n name = identifier;\n identifier = tempName;\n }\n return [identifier, name];\n },\n logRequestData: function logRequestData(responseType, claimName, channelName, claimId) {\n logger.debug('responseType ===', responseType);\n logger.debug('claim name === ', claimName);\n logger.debug('channel name ===', channelName);\n logger.debug('claim id ===', claimId);\n }\n};\n\n/***/ }),\n/* 139 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar logger = __webpack_require__(2);\n\nmodule.exports = {\n REGEXP_INVALID_CLAIM: /[^A-Za-z0-9-]/g,\n REGEXP_INVALID_CHANNEL: /[^A-Za-z0-9-@]/g,\n REGEXP_ADDRESS: /^b(?=[^0OIl]{32,33})[0-9A-Za-z]{32,33}$/,\n CHANNEL_CHAR: '@',\n parseIdentifier: function parseIdentifier(identifier) {\n logger.debug('parsing identifier:', identifier);\n var componentsRegex = new RegExp('([^:$#/]*)' + // value (stops at the first separator or end)\n '([:$#]?)([^/]*)' // modifier separator, modifier (stops at the first path separator or end)\n );\n\n var _componentsRegex$exec = componentsRegex.exec(identifier).map(function (match) {\n return match || null;\n }),\n _componentsRegex$exec2 = _slicedToArray(_componentsRegex$exec, 4),\n proto = _componentsRegex$exec2[0],\n value = _componentsRegex$exec2[1],\n modifierSeperator = _componentsRegex$exec2[2],\n modifier = _componentsRegex$exec2[3];\n\n logger.debug(proto + ', ' + value + ', ' + modifierSeperator + ', ' + modifier);\n\n // Validate and process name\n if (!value) {\n throw new Error('Check your url. No channel name provided before \"' + modifierSeperator + '\"');\n }\n var isChannel = value.startsWith(module.exports.CHANNEL_CHAR);\n var channelName = isChannel ? value : null;\n var claimId = void 0;\n if (isChannel) {\n if (!channelName) {\n throw new Error('No channel name after @.');\n }\n var nameBadChars = channelName.match(module.exports.REGEXP_INVALID_CHANNEL);\n if (nameBadChars) {\n throw new Error('Invalid characters in channel name: ' + nameBadChars.join(', ') + '.');\n }\n } else {\n claimId = value;\n }\n\n // Validate and process modifier\n var channelClaimId = void 0;\n if (modifierSeperator) {\n if (!modifier) {\n throw new Error('No modifier provided after separator \"' + modifierSeperator + '\"');\n }\n\n if (modifierSeperator === ':') {\n channelClaimId = modifier;\n } else {\n throw new Error('The \"' + modifierSeperator + '\" modifier is not currently supported');\n }\n }\n return {\n isChannel: isChannel,\n channelName: channelName,\n channelClaimId: channelClaimId,\n claimId: claimId\n };\n },\n parseClaim: function parseClaim(claim) {\n logger.debug('parsing name:', claim);\n var componentsRegex = new RegExp('([^:$#/.]*)' + // name (stops at the first modifier)\n '([:$#.]?)([^/]*)' // modifier separator, modifier (stops at the first path separator or end)\n );\n\n var _componentsRegex$exec3 = componentsRegex.exec(claim).map(function (match) {\n return match || null;\n }),\n _componentsRegex$exec4 = _slicedToArray(_componentsRegex$exec3, 4),\n proto = _componentsRegex$exec4[0],\n claimName = _componentsRegex$exec4[1],\n modifierSeperator = _componentsRegex$exec4[2],\n modifier = _componentsRegex$exec4[3];\n\n logger.debug(proto + ', ' + claimName + ', ' + modifierSeperator + ', ' + modifier);\n\n // Validate and process name\n if (!claimName) {\n throw new Error('No claim name provided before .');\n }\n var nameBadChars = claimName.match(module.exports.REGEXP_INVALID_CLAIM);\n if (nameBadChars) {\n throw new Error('Invalid characters in claim name: ' + nameBadChars.join(', ') + '.');\n }\n // Validate and process modifier\n if (modifierSeperator) {\n if (!modifier) {\n throw new Error('No file extension provided after separator ' + modifierSeperator + '.');\n }\n if (modifierSeperator !== '.') {\n throw new Error('The ' + modifierSeperator + ' modifier is not supported in the claim name');\n }\n }\n // return results\n return {\n claimName: claimName\n };\n },\n parseModifier: function parseModifier(claim) {\n logger.debug('parsing modifier:', claim);\n var componentsRegex = new RegExp('([^:$#/.]*)' + // name (stops at the first modifier)\n '([:$#.]?)([^/]*)' // modifier separator, modifier (stops at the first path separator or end)\n );\n\n var _componentsRegex$exec5 = componentsRegex.exec(claim).map(function (match) {\n return match || null;\n }),\n _componentsRegex$exec6 = _slicedToArray(_componentsRegex$exec5, 4),\n proto = _componentsRegex$exec6[0],\n claimName = _componentsRegex$exec6[1],\n modifierSeperator = _componentsRegex$exec6[2],\n modifier = _componentsRegex$exec6[3];\n\n logger.debug(proto + ', ' + claimName + ', ' + modifierSeperator + ', ' + modifier);\n // Validate and process modifier\n var hasFileExtension = false;\n if (modifierSeperator) {\n hasFileExtension = true;\n }\n return {\n hasFileExtension: hasFileExtension\n };\n }\n};\n\n/***/ }),\n/* 140 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _react = __webpack_require__(0);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _server = __webpack_require__(29);\n\nvar _redux = __webpack_require__(18);\n\nvar _reducers = __webpack_require__(30);\n\nvar _reducers2 = _interopRequireDefault(_reducers);\n\nvar _reactRedux = __webpack_require__(1);\n\nvar _reactRouterDom = __webpack_require__(4);\n\nvar _GAListener = __webpack_require__(35);\n\nvar _GAListener2 = _interopRequireDefault(_GAListener);\n\nvar _app = __webpack_require__(36);\n\nvar _app2 = _interopRequireDefault(_app);\n\nvar _renderFullPage = __webpack_require__(42);\n\nvar _renderFullPage2 = _interopRequireDefault(_renderFullPage);\n\nvar _reduxSaga = __webpack_require__(141);\n\nvar _reduxSaga2 = _interopRequireDefault(_reduxSaga);\n\nvar _effects = __webpack_require__(15);\n\nvar _show_uri = __webpack_require__(142);\n\nvar _show = __webpack_require__(8);\n\nvar _reactHelmet = __webpack_require__(14);\n\nvar _reactHelmet2 = _interopRequireDefault(_reactHelmet);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar returnSagaWithParams = function returnSagaWithParams(saga, params) {\n return (/*#__PURE__*/regeneratorRuntime.mark(function _callee() {\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return (0, _effects.call)(saga, params);\n\n case 2:\n case 'end':\n return _context.stop();\n }\n }\n }, _callee, this);\n })\n );\n};\n\nmodule.exports = function (req, res) {\n var context = {};\n\n // create and apply middleware\n var sagaMiddleware = (0, _reduxSaga2.default)();\n var middleware = (0, _redux.applyMiddleware)(sagaMiddleware);\n\n // create a new Redux store instance\n var store = (0, _redux.createStore)(_reducers2.default, middleware);\n\n // create saga\n var action = (0, _show.onHandleShowPageUri)(req.params);\n var saga = returnSagaWithParams(_show_uri.handleShowPageUri, action);\n\n // run the saga middleware\n sagaMiddleware.run(saga).done.then(function () {\n // render component to a string\n var html = (0, _server.renderToString)(_react2.default.createElement(\n _reactRedux.Provider,\n { store: store },\n _react2.default.createElement(\n _reactRouterDom.StaticRouter,\n { location: req.url, context: context },\n _react2.default.createElement(\n _GAListener2.default,\n null,\n _react2.default.createElement(_app2.default, null)\n )\n )\n ));\n\n // get head tags from helmet\n var helmet = _reactHelmet2.default.renderStatic();\n\n // check for a redirect\n if (context.url) {\n return res.redirect(301, context.url);\n }\n\n // get the initial state from our Redux store\n var preloadedState = store.getState();\n\n // send the rendered page back to the client\n res.send((0, _renderFullPage2.default)(helmet, html, preloadedState));\n });\n};\n\n/***/ }),\n/* 141 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"redux-saga\");\n\n/***/ }),\n/* 142 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.handleShowPageUri = handleShowPageUri;\nexports.watchHandleShowPageUri = watchHandleShowPageUri;\n\nvar _effects = __webpack_require__(15);\n\nvar _show_action_types = __webpack_require__(12);\n\nvar actions = _interopRequireWildcard(_show_action_types);\n\nvar _show = __webpack_require__(8);\n\nvar _show_asset = __webpack_require__(143);\n\nvar _show_channel = __webpack_require__(145);\n\nvar _lbryUri = __webpack_require__(147);\n\nvar _lbryUri2 = _interopRequireDefault(_lbryUri);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nvar _marked = /*#__PURE__*/regeneratorRuntime.mark(parseAndUpdateIdentifierAndClaim),\n _marked2 = /*#__PURE__*/regeneratorRuntime.mark(parseAndUpdateClaimOnly),\n _marked3 = /*#__PURE__*/regeneratorRuntime.mark(handleShowPageUri),\n _marked4 = /*#__PURE__*/regeneratorRuntime.mark(watchHandleShowPageUri);\n\nfunction parseAndUpdateIdentifierAndClaim(modifier, claim) {\n var isChannel, channelName, channelClaimId, claimId, claimName, extension, _lbryUri$parseIdentif, _lbryUri$parseClaim;\n\n return regeneratorRuntime.wrap(function parseAndUpdateIdentifierAndClaim$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n // this is a request for an asset\n // claim will be an asset claim\n // the identifier could be a channel or a claim id\n isChannel = void 0, channelName = void 0, channelClaimId = void 0, claimId = void 0, claimName = void 0, extension = void 0;\n _context.prev = 1;\n _lbryUri$parseIdentif = _lbryUri2.default.parseIdentifier(modifier);\n isChannel = _lbryUri$parseIdentif.isChannel;\n channelName = _lbryUri$parseIdentif.channelName;\n channelClaimId = _lbryUri$parseIdentif.channelClaimId;\n claimId = _lbryUri$parseIdentif.claimId;\n _lbryUri$parseClaim = _lbryUri2.default.parseClaim(claim);\n claimName = _lbryUri$parseClaim.claimName;\n extension = _lbryUri$parseClaim.extension;\n _context.next = 17;\n break;\n\n case 12:\n _context.prev = 12;\n _context.t0 = _context['catch'](1);\n _context.next = 16;\n return (0, _effects.put)((0, _show.onRequestError)(_context.t0.message));\n\n case 16:\n return _context.abrupt('return', _context.sent);\n\n case 17:\n if (!isChannel) {\n _context.next = 21;\n break;\n }\n\n _context.next = 20;\n return (0, _effects.call)(_show_asset.newAssetRequest, (0, _show.onNewAssetRequest)(claimName, null, channelName, channelClaimId, extension));\n\n case 20:\n return _context.abrupt('return', _context.sent);\n\n case 21:\n ;\n _context.next = 24;\n return (0, _effects.call)(_show_asset.newAssetRequest, (0, _show.onNewAssetRequest)(claimName, claimId, null, null, extension));\n\n case 24:\n case 'end':\n return _context.stop();\n }\n }\n }, _marked, this, [[1, 12]]);\n}\nfunction parseAndUpdateClaimOnly(claim) {\n var isChannel, channelName, channelClaimId, _lbryUri$parseIdentif2, claimName, extension, _lbryUri$parseClaim2;\n\n return regeneratorRuntime.wrap(function parseAndUpdateClaimOnly$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n // this could be a request for an asset or a channel page\n // claim could be an asset claim or a channel claim\n isChannel = void 0, channelName = void 0, channelClaimId = void 0;\n _context2.prev = 1;\n _lbryUri$parseIdentif2 = _lbryUri2.default.parseIdentifier(claim);\n isChannel = _lbryUri$parseIdentif2.isChannel;\n channelName = _lbryUri$parseIdentif2.channelName;\n channelClaimId = _lbryUri$parseIdentif2.channelClaimId;\n _context2.next = 13;\n break;\n\n case 8:\n _context2.prev = 8;\n _context2.t0 = _context2['catch'](1);\n _context2.next = 12;\n return (0, _effects.put)((0, _show.onRequestError)(_context2.t0.message));\n\n case 12:\n return _context2.abrupt('return', _context2.sent);\n\n case 13:\n if (!isChannel) {\n _context2.next = 17;\n break;\n }\n\n _context2.next = 16;\n return (0, _effects.call)(_show_channel.newChannelRequest, (0, _show.onNewChannelRequest)(channelName, channelClaimId));\n\n case 16:\n return _context2.abrupt('return', _context2.sent);\n\n case 17:\n // if not for a channel, parse the claim request\n claimName = void 0, extension = void 0;\n _context2.prev = 18;\n _lbryUri$parseClaim2 = _lbryUri2.default.parseClaim(claim);\n claimName = _lbryUri$parseClaim2.claimName;\n extension = _lbryUri$parseClaim2.extension;\n _context2.next = 29;\n break;\n\n case 24:\n _context2.prev = 24;\n _context2.t1 = _context2['catch'](18);\n _context2.next = 28;\n return (0, _effects.put)((0, _show.onRequestError)(_context2.t1.message));\n\n case 28:\n return _context2.abrupt('return', _context2.sent);\n\n case 29:\n _context2.next = 31;\n return (0, _effects.call)(_show_asset.newAssetRequest, (0, _show.onNewAssetRequest)(claimName, null, null, null, extension));\n\n case 31:\n case 'end':\n return _context2.stop();\n }\n }\n }, _marked2, this, [[1, 8], [18, 24]]);\n}\n\nfunction handleShowPageUri(action) {\n var _action$data, identifier, claim;\n\n return regeneratorRuntime.wrap(function handleShowPageUri$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n _action$data = action.data, identifier = _action$data.identifier, claim = _action$data.claim;\n\n if (!identifier) {\n _context3.next = 5;\n break;\n }\n\n _context3.next = 4;\n return (0, _effects.call)(parseAndUpdateIdentifierAndClaim, identifier, claim);\n\n case 4:\n return _context3.abrupt('return', _context3.sent);\n\n case 5:\n _context3.next = 7;\n return (0, _effects.call)(parseAndUpdateClaimOnly, claim);\n\n case 7:\n case 'end':\n return _context3.stop();\n }\n }\n }, _marked3, this);\n};\n\nfunction watchHandleShowPageUri() {\n return regeneratorRuntime.wrap(function watchHandleShowPageUri$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n _context4.next = 2;\n return (0, _effects.takeLatest)(actions.HANDLE_SHOW_URI, handleShowPageUri);\n\n case 2:\n case 'end':\n return _context4.stop();\n }\n }\n }, _marked4, this);\n};\n\n/***/ }),\n/* 143 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.newAssetRequest = newAssetRequest;\nexports.watchNewAssetRequest = watchNewAssetRequest;\n\nvar _effects = __webpack_require__(15);\n\nvar _show_action_types = __webpack_require__(12);\n\nvar actions = _interopRequireWildcard(_show_action_types);\n\nvar _show = __webpack_require__(8);\n\nvar _assetApi = __webpack_require__(144);\n\nvar _show2 = __webpack_require__(13);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nvar _marked = /*#__PURE__*/regeneratorRuntime.mark(newAssetRequest),\n _marked2 = /*#__PURE__*/regeneratorRuntime.mark(watchNewAssetRequest);\n\nfunction newAssetRequest(action) {\n var _action$data, requestType, requestId, name, modifier, state, longId, _ref, assetKey, shortId, _ref2, claimData, _ref3;\n\n return regeneratorRuntime.wrap(function newAssetRequest$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _action$data = action.data, requestType = _action$data.requestType, requestId = _action$data.requestId, name = _action$data.name, modifier = _action$data.modifier;\n // put an action to update the request in redux\n\n _context.next = 3;\n return (0, _effects.put)((0, _show.onRequestUpdate)(requestType, requestId));\n\n case 3:\n _context.next = 5;\n return (0, _effects.select)(_show2.selectShowState);\n\n case 5:\n state = _context.sent;\n\n if (!state.requestList[requestId]) {\n _context.next = 8;\n break;\n }\n\n return _context.abrupt('return', null);\n\n case 8:\n // get long id && add request to request list\n longId = void 0;\n _context.prev = 9;\n _context.next = 12;\n return (0, _effects.call)(_assetApi.getLongClaimId, name, modifier);\n\n case 12:\n _ref = _context.sent;\n longId = _ref.data;\n _context.next = 21;\n break;\n\n case 16:\n _context.prev = 16;\n _context.t0 = _context['catch'](9);\n _context.next = 20;\n return (0, _effects.put)((0, _show.onRequestError)(_context.t0.message));\n\n case 20:\n return _context.abrupt('return', _context.sent);\n\n case 21:\n assetKey = 'a#' + name + '#' + longId;\n _context.next = 24;\n return (0, _effects.put)((0, _show.addRequestToRequestList)(requestId, null, assetKey));\n\n case 24:\n if (!state.assetList[assetKey]) {\n _context.next = 26;\n break;\n }\n\n return _context.abrupt('return', null);\n\n case 26:\n // get short Id\n shortId = void 0;\n _context.prev = 27;\n _context.next = 30;\n return (0, _effects.call)(_assetApi.getShortId, name, longId);\n\n case 30:\n _ref2 = _context.sent;\n shortId = _ref2.data;\n _context.next = 39;\n break;\n\n case 34:\n _context.prev = 34;\n _context.t1 = _context['catch'](27);\n _context.next = 38;\n return (0, _effects.put)((0, _show.onRequestError)(_context.t1.message));\n\n case 38:\n return _context.abrupt('return', _context.sent);\n\n case 39:\n // get asset claim data\n claimData = void 0;\n _context.prev = 40;\n _context.next = 43;\n return (0, _effects.call)(_assetApi.getClaimData, name, longId);\n\n case 43:\n _ref3 = _context.sent;\n claimData = _ref3.data;\n _context.next = 52;\n break;\n\n case 47:\n _context.prev = 47;\n _context.t2 = _context['catch'](40);\n _context.next = 51;\n return (0, _effects.put)((0, _show.onRequestError)(_context.t2.message));\n\n case 51:\n return _context.abrupt('return', _context.sent);\n\n case 52:\n _context.next = 54;\n return (0, _effects.put)((0, _show.addAssetToAssetList)(assetKey, null, name, longId, shortId, claimData));\n\n case 54:\n _context.next = 56;\n return (0, _effects.put)((0, _show.onRequestError)(null));\n\n case 56:\n case 'end':\n return _context.stop();\n }\n }\n }, _marked, this, [[9, 16], [27, 34], [40, 47]]);\n};\n\nfunction watchNewAssetRequest() {\n return regeneratorRuntime.wrap(function watchNewAssetRequest$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return (0, _effects.takeLatest)(actions.ASSET_REQUEST_NEW, newAssetRequest);\n\n case 2:\n case 'end':\n return _context2.stop();\n }\n }\n }, _marked2, this);\n};\n\n/***/ }),\n/* 144 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getLongClaimId = getLongClaimId;\nexports.getShortId = getShortId;\nexports.getClaimData = getClaimData;\n\nvar _request = __webpack_require__(11);\n\nvar _request2 = _interopRequireDefault(_request);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar _require = __webpack_require__(3),\n host = _require.site.host;\n\nfunction getLongClaimId(name, modifier) {\n var body = {};\n // create request params\n if (modifier) {\n if (modifier.id) {\n body['claimId'] = modifier.id;\n } else {\n body['channelName'] = modifier.channel.name;\n body['channelClaimId'] = modifier.channel.id;\n }\n }\n body['claimName'] = name;\n var params = {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body)\n };\n // create url\n var url = host + '/api/claim/long-id';\n // return the request promise\n return (0, _request2.default)(url, params);\n};\n\nfunction getShortId(name, claimId) {\n var url = host + '/api/claim/short-id/' + claimId + '/' + name;\n return (0, _request2.default)(url);\n};\n\nfunction getClaimData(name, claimId) {\n var url = host + '/api/claim/data/' + name + '/' + claimId;\n return (0, _request2.default)(url);\n};\n\n/***/ }),\n/* 145 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.newChannelRequest = newChannelRequest;\nexports.watchNewChannelRequest = watchNewChannelRequest;\nexports.watchUpdateChannelClaims = watchUpdateChannelClaims;\n\nvar _effects = __webpack_require__(15);\n\nvar _show_action_types = __webpack_require__(12);\n\nvar actions = _interopRequireWildcard(_show_action_types);\n\nvar _show = __webpack_require__(8);\n\nvar _channelApi = __webpack_require__(146);\n\nvar _show2 = __webpack_require__(13);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nvar _marked = /*#__PURE__*/regeneratorRuntime.mark(newChannelRequest),\n _marked2 = /*#__PURE__*/regeneratorRuntime.mark(watchNewChannelRequest),\n _marked3 = /*#__PURE__*/regeneratorRuntime.mark(getNewClaimsAndUpdateChannel),\n _marked4 = /*#__PURE__*/regeneratorRuntime.mark(watchUpdateChannelClaims);\n\nfunction newChannelRequest(action) {\n var _action$data, requestType, requestId, channelName, channelId, state, longId, shortId, _ref, _ref$data, channelKey, claimsData, _ref2;\n\n return regeneratorRuntime.wrap(function newChannelRequest$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _action$data = action.data, requestType = _action$data.requestType, requestId = _action$data.requestId, channelName = _action$data.channelName, channelId = _action$data.channelId;\n // put an action to update the request in redux\n\n _context.next = 3;\n return (0, _effects.put)((0, _show.onRequestUpdate)(requestType, requestId));\n\n case 3:\n _context.next = 5;\n return (0, _effects.select)(_show2.selectShowState);\n\n case 5:\n state = _context.sent;\n\n if (!state.requestList[requestId]) {\n _context.next = 8;\n break;\n }\n\n return _context.abrupt('return', null);\n\n case 8:\n // get channel long id\n longId = void 0, shortId = void 0;\n _context.prev = 9;\n _context.next = 12;\n return (0, _effects.call)(_channelApi.getChannelData, channelName, channelId);\n\n case 12:\n _ref = _context.sent;\n _ref$data = _ref.data;\n longId = _ref$data.longChannelClaimId;\n shortId = _ref$data.shortChannelClaimId;\n _context.next = 23;\n break;\n\n case 18:\n _context.prev = 18;\n _context.t0 = _context['catch'](9);\n _context.next = 22;\n return (0, _effects.put)((0, _show.onRequestError)(_context.t0.message));\n\n case 22:\n return _context.abrupt('return', _context.sent);\n\n case 23:\n // store the request in the channel requests list\n channelKey = 'c#' + channelName + '#' + longId;\n _context.next = 26;\n return (0, _effects.put)((0, _show.addRequestToRequestList)(requestId, null, channelKey));\n\n case 26:\n if (!state.channelList[channelKey]) {\n _context.next = 28;\n break;\n }\n\n return _context.abrupt('return', null);\n\n case 28:\n // get channel claims data\n claimsData = void 0;\n _context.prev = 29;\n _context.next = 32;\n return (0, _effects.call)(_channelApi.getChannelClaims, channelName, longId, 1);\n\n case 32:\n _ref2 = _context.sent;\n claimsData = _ref2.data;\n _context.next = 41;\n break;\n\n case 36:\n _context.prev = 36;\n _context.t1 = _context['catch'](29);\n _context.next = 40;\n return (0, _effects.put)((0, _show.onRequestError)(_context.t1.message));\n\n case 40:\n return _context.abrupt('return', _context.sent);\n\n case 41:\n _context.next = 43;\n return (0, _effects.put)((0, _show.addNewChannelToChannelList)(channelKey, channelName, shortId, longId, claimsData));\n\n case 43:\n _context.next = 45;\n return (0, _effects.put)((0, _show.onRequestError)(null));\n\n case 45:\n case 'end':\n return _context.stop();\n }\n }\n }, _marked, this, [[9, 18], [29, 36]]);\n}\n\nfunction watchNewChannelRequest() {\n return regeneratorRuntime.wrap(function watchNewChannelRequest$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return (0, _effects.takeLatest)(actions.CHANNEL_REQUEST_NEW, newChannelRequest);\n\n case 2:\n case 'end':\n return _context2.stop();\n }\n }\n }, _marked2, this);\n};\n\nfunction getNewClaimsAndUpdateChannel(action) {\n var _action$data2, channelKey, name, longId, page, claimsData, _ref3;\n\n return regeneratorRuntime.wrap(function getNewClaimsAndUpdateChannel$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n _action$data2 = action.data, channelKey = _action$data2.channelKey, name = _action$data2.name, longId = _action$data2.longId, page = _action$data2.page;\n claimsData = void 0;\n _context3.prev = 2;\n _context3.next = 5;\n return (0, _effects.call)(_channelApi.getChannelClaims, name, longId, page);\n\n case 5:\n _ref3 = _context3.sent;\n claimsData = _ref3.data;\n _context3.next = 14;\n break;\n\n case 9:\n _context3.prev = 9;\n _context3.t0 = _context3['catch'](2);\n _context3.next = 13;\n return (0, _effects.put)((0, _show.onRequestError)(_context3.t0.message));\n\n case 13:\n return _context3.abrupt('return', _context3.sent);\n\n case 14:\n _context3.next = 16;\n return (0, _effects.put)((0, _show.updateChannelClaims)(channelKey, claimsData));\n\n case 16:\n case 'end':\n return _context3.stop();\n }\n }\n }, _marked3, this, [[2, 9]]);\n}\n\nfunction watchUpdateChannelClaims() {\n return regeneratorRuntime.wrap(function watchUpdateChannelClaims$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n _context4.next = 2;\n return (0, _effects.takeLatest)(actions.CHANNEL_CLAIMS_UPDATE_ASYNC, getNewClaimsAndUpdateChannel);\n\n case 2:\n case 'end':\n return _context4.stop();\n }\n }\n }, _marked4, this);\n}\n\n/***/ }),\n/* 146 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getChannelData = getChannelData;\nexports.getChannelClaims = getChannelClaims;\n\nvar _request = __webpack_require__(11);\n\nvar _request2 = _interopRequireDefault(_request);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar _require = __webpack_require__(3),\n host = _require.site.host;\n\nfunction getChannelData(name, id) {\n if (!id) id = 'none';\n var url = host + '/api/channel/data/' + name + '/' + id;\n return (0, _request2.default)(url);\n};\n\nfunction getChannelClaims(name, longId, page) {\n if (!page) page = 1;\n var url = host + '/api/channel/claims/' + name + '/' + longId + '/' + page;\n return (0, _request2.default)(url);\n};\n\n/***/ }),\n/* 147 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nmodule.exports = {\n REGEXP_INVALID_CLAIM: /[^A-Za-z0-9-]/g,\n REGEXP_INVALID_CHANNEL: /[^A-Za-z0-9-@]/g,\n REGEXP_ADDRESS: /^b(?=[^0OIl]{32,33})[0-9A-Za-z]{32,33}$/,\n CHANNEL_CHAR: '@',\n parseIdentifier: function parseIdentifier(identifier) {\n var componentsRegex = new RegExp('([^:$#/]*)' + // value (stops at the first separator or end)\n '([:$#]?)([^/]*)' // modifier separator, modifier (stops at the first path separator or end)\n );\n\n var _componentsRegex$exec = componentsRegex // eslint-disable-line no-unused-vars\n .exec(identifier).map(function (match) {\n return match || null;\n }),\n _componentsRegex$exec2 = _slicedToArray(_componentsRegex$exec, 4),\n proto = _componentsRegex$exec2[0],\n value = _componentsRegex$exec2[1],\n modifierSeperator = _componentsRegex$exec2[2],\n modifier = _componentsRegex$exec2[3];\n\n // Validate and process name\n\n\n if (!value) {\n throw new Error('Check your URL. No channel name provided before \"' + modifierSeperator + '\"');\n }\n var isChannel = value.startsWith(module.exports.CHANNEL_CHAR);\n var channelName = isChannel ? value : null;\n var claimId = void 0;\n if (isChannel) {\n if (!channelName) {\n throw new Error('Check your URL. No channel name after \"@\".');\n }\n var nameBadChars = channelName.match(module.exports.REGEXP_INVALID_CHANNEL);\n if (nameBadChars) {\n throw new Error('Check your URL. Invalid characters in channel name: \"' + nameBadChars.join(', ') + '\".');\n }\n } else {\n claimId = value;\n }\n\n // Validate and process modifier\n var channelClaimId = void 0;\n if (modifierSeperator) {\n if (!modifier) {\n throw new Error('Check your URL. No modifier provided after separator \"' + modifierSeperator + '\"');\n }\n\n if (modifierSeperator === ':') {\n channelClaimId = modifier;\n } else {\n throw new Error('Check your URL. The \"' + modifierSeperator + '\" modifier is not currently supported');\n }\n }\n return {\n isChannel: isChannel,\n channelName: channelName,\n channelClaimId: channelClaimId || null,\n claimId: claimId || null\n };\n },\n parseClaim: function parseClaim(name) {\n var componentsRegex = new RegExp('([^:$#/.]*)' + // name (stops at the first extension)\n '([:$#.]?)([^/]*)' // extension separator, extension (stops at the first path separator or end)\n );\n\n var _componentsRegex$exec3 = componentsRegex // eslint-disable-line no-unused-vars\n .exec(name).map(function (match) {\n return match || null;\n }),\n _componentsRegex$exec4 = _slicedToArray(_componentsRegex$exec3, 4),\n proto = _componentsRegex$exec4[0],\n claimName = _componentsRegex$exec4[1],\n extensionSeperator = _componentsRegex$exec4[2],\n extension = _componentsRegex$exec4[3];\n\n // Validate and process name\n\n\n if (!claimName) {\n throw new Error('Check your URL. No claim name provided before \".\"');\n }\n var nameBadChars = claimName.match(module.exports.REGEXP_INVALID_CLAIM);\n if (nameBadChars) {\n throw new Error('Check your URL. Invalid characters in claim name: \"' + nameBadChars.join(', ') + '\".');\n }\n // Validate and process extension\n if (extensionSeperator) {\n if (!extension) {\n throw new Error('Check your URL. No file extension provided after separator \"' + extensionSeperator + '\".');\n }\n if (extensionSeperator !== '.') {\n throw new Error('Check your URL. The \"' + extensionSeperator + '\" separator is not supported in the claim name.');\n }\n }\n return {\n claimName: claimName,\n extension: extension || null\n };\n }\n};\n\n/***/ }),\n/* 148 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar handlePageRender = __webpack_require__(28);\n\nmodule.exports = function (app) {\n // a catch-all route if someone visits a page that does not exist\n app.use('*', function (req, res) {\n // send response\n handlePageRender(req, res);\n });\n};\n\n/***/ }),\n/* 149 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"http\");\n\n/***/ })\n/******/ ]);\n\n\n// WEBPACK FOOTER //\n// index.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 43);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 32f6e2d4999aefc27a90","module.exports = require(\"react\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"react\"\n// module id = 0\n// module chunks = 0","module.exports = require(\"react-redux\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"react-redux\"\n// module id = 1\n// module chunks = 0","module.exports = require(\"winston\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"winston\"\n// module id = 2\n// module chunks = 0","module.exports = {\n analytics: {\n googleId: 'UA-60403362-6', // google id for analytics tracking; leave `null` if not applicable\n },\n logging: {\n logLevel : 'debug', // options: silly, debug, verbose, info\n slackWebHook : 'https://hooks.slack.com/services/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', // enter a webhook if you wish to push logs to slack; otherwise leave as `null`\n slackErrorChannel: null, // enter a slack channel (#example) for errors to be sent to; otherwise leave null\n slackInfoChannel : '#speech-dev1-errors', // enter a slack channel (#info) for info level logs to be sent to otherwise leave null\n },\n session: {\n sessionKey: 'nans$#kfjanwe234rydns', // enter a secret key to be used for session encryption\n },\n files: {\n uploadDirectory: '/home/lbry/Uploads', // enter file path to where uploads/publishes should be stored\n },\n site: {\n title : 'dev1.Spee.ch',\n name : 'dev1.Spee.ch',\n host : 'https://dev1.spee.ch',\n description: 'Open-source, decentralized image and video sharing.',\n },\n publish: {\n primaryClaimAddress : 'bDZ2wPwtULUGxT7GXuNLpQhXmdPRUTUkcL',\n additionalClaimAddresses: ['banpwixPosfVDWnGvXqU2af36Qpsd7buGd'],\n thumbnailChannel : '@dev1thumbs', // create a channel to use for thumbnail images\n thumbnailChannelId : 'aeb625ff6f66c3eeeb42885070f4e53876033626', // the channel_id (claim id) for the channel above\n },\n claim: {\n defaultTitle : 'dev1 Spee.ch',\n defaultThumbnail : 'https://spee.ch/assets/img/video_thumb_default.png',\n defaultDescription: 'Open-source, decentralized image and video sharing.',\n },\n testing: {\n testChannel : '@test', // a channel to make test publishes in\n testChannelId : '3b5bc6b6819172c6e2f3f90aa855b14a956b4a82', // the claim id for the test channel\n testChannelPassword: '1234', // password for the test channel\n },\n api: {\n apiHost: 'localhost',\n apiPort: '5279',\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./config/speechConfig.js","module.exports = require(\"react-router-dom\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"react-router-dom\"\n// module id = 4\n// module chunks = 0","import * as actions from 'constants/publish_action_types';\n\n// export action creators\nexport function selectFile (file) {\n return {\n type: actions.FILE_SELECTED,\n data: file,\n };\n};\n\nexport function clearFile () {\n return {\n type: actions.FILE_CLEAR,\n };\n};\n\nexport function updateMetadata (name, value) {\n return {\n type: actions.METADATA_UPDATE,\n data: {\n name,\n value,\n },\n };\n};\n\nexport function updateClaim (value) {\n return {\n type: actions.CLAIM_UPDATE,\n data: value,\n };\n};\n\nexport function setPublishInChannel (channel) {\n return {\n type: actions.SET_PUBLISH_IN_CHANNEL,\n channel,\n };\n};\n\nexport function updatePublishStatus (status, message) {\n return {\n type: actions.PUBLISH_STATUS_UPDATE,\n data: {\n status,\n message,\n },\n };\n};\n\nexport function updateError (name, value) {\n return {\n type: actions.ERROR_UPDATE,\n data: {\n name,\n value,\n },\n };\n};\n\nexport function updateSelectedChannel (channelName) {\n return {\n type: actions.SELECTED_CHANNEL_UPDATE,\n data: channelName,\n };\n};\n\nexport function toggleMetadataInputs (showMetadataInputs) {\n return {\n type: actions.TOGGLE_METADATA_INPUTS,\n data: showMetadataInputs,\n };\n};\n\nexport function onNewThumbnail (file) {\n return {\n type: actions.THUMBNAIL_NEW,\n data: file,\n };\n};\n\nexport function startPublish (history) {\n return {\n type: actions.PUBLISH_START,\n data: { history },\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./react/actions/publish.js","const Sequelize = require('sequelize');\nconst logger = require('winston');\n\nmodule.exports = (mysqlConfig) => {\n const { database, username, password } = mysqlConfig;\n const db = {};\n // set sequelize options\n const sequelize = new Sequelize(database, username, password, {\n host : 'localhost',\n dialect : 'mysql',\n dialectOptions: {decimalNumbers: true}, // fix to ensure DECIMAL will not be stored as a string\n logging : false,\n pool : {\n max : 5,\n min : 0,\n idle : 10000,\n acquire: 10000,\n },\n });\n\n // establish mysql connection\n sequelize\n .authenticate()\n .then(() => {\n logger.info('Sequelize has established mysql connection successfully.');\n })\n .catch(err => {\n logger.error('Sequelize was unable to connect to the database:', err);\n });\n\n // manually add each model to the db object\n const Certificate = require('./certificate.js');\n const Channel = require('./channel.js');\n const Claim = require('./claim.js');\n const File = require('./file.js');\n const Request = require('./request.js');\n const User = require('./user.js');\n db['Certificate'] = sequelize.import('Certificate', Certificate);\n db['Channel'] = sequelize.import('Channel', Channel);\n db['Claim'] = sequelize.import('Claim', Claim);\n db['File'] = sequelize.import('File', File);\n db['Request'] = sequelize.import('Request', Request);\n db['User'] = sequelize.import('User', User);\n\n // run model.association for each model in the db object that has an association\n Object.keys(db).forEach(modelName => {\n if (db[modelName].associate) {\n logger.info('Associating model:', modelName);\n db[modelName].associate(db);\n }\n });\n\n db.sequelize = sequelize;\n db.Sequelize = Sequelize;\n\n // add an 'upsert' method to the db object\n db.upsert = (Model, values, condition, tableName) => {\n return Model\n .findOne({\n where: condition,\n })\n .then(obj => {\n if (obj) { // update\n logger.debug(`updating record in db.${tableName}`);\n return obj.update(values);\n } else { // insert\n logger.debug(`creating record in db.${tableName}`);\n return Model.create(values);\n }\n })\n .catch(function (error) {\n logger.error(`${tableName}.upsert error`, error);\n throw error;\n });\n };\n\n return db;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./models/index.js","import { connect } from 'react-redux';\nimport { updateLoggedInChannel } from 'actions/channel';\nimport View from './view';\nimport {updateSelectedChannel} from '../../actions/publish';\n\nconst mapStateToProps = ({ channel }) => {\n return {\n channelName : channel.loggedInChannel.name,\n channelShortId: channel.loggedInChannel.shortId,\n channelLongId : channel.loggedInChannel.longId,\n };\n};\n\nconst mapDispatchToProps = dispatch => {\n return {\n onChannelLogin: (name, shortId, longId) => {\n dispatch(updateLoggedInChannel(name, shortId, longId));\n dispatch(updateSelectedChannel(name));\n },\n onChannelLogout: () => {\n dispatch(updateLoggedInChannel(null, null, null));\n },\n };\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/NavBar/index.js","import * as actions from 'constants/show_action_types';\n\nimport { CHANNEL, ASSET_LITE, ASSET_DETAILS } from 'constants/show_request_types';\n\n// basic request parsing\nexport function onHandleShowPageUri (params) {\n return {\n type: actions.HANDLE_SHOW_URI,\n data: params,\n };\n};\n\nexport function onRequestError (error) {\n return {\n type: actions.REQUEST_ERROR,\n data: error,\n };\n};\n\nexport function onNewChannelRequest (channelName, channelId) {\n const requestType = CHANNEL;\n const requestId = `cr#${channelName}#${channelId}`;\n return {\n type: actions.CHANNEL_REQUEST_NEW,\n data: { requestType, requestId, channelName, channelId },\n };\n};\n\nexport function onNewAssetRequest (name, id, channelName, channelId, extension) {\n const requestType = extension ? ASSET_LITE : ASSET_DETAILS;\n const requestId = `ar#${name}#${id}#${channelName}#${channelId}`;\n return {\n type: actions.ASSET_REQUEST_NEW,\n data: {\n requestType,\n requestId,\n name,\n modifier: {\n id,\n channel: {\n name: channelName,\n id : channelId,\n },\n },\n },\n };\n};\n\nexport function onRequestUpdate (requestType, requestId) {\n return {\n type: actions.REQUEST_UPDATE,\n data: {\n requestType,\n requestId,\n },\n };\n};\n\nexport function addRequestToRequestList (id, error, key) {\n return {\n type: actions.REQUEST_LIST_ADD,\n data: { id, error, key },\n };\n};\n\n// asset actions\n\nexport function addAssetToAssetList (id, error, name, claimId, shortId, claimData) {\n return {\n type: actions.ASSET_ADD,\n data: { id, error, name, claimId, shortId, claimData },\n };\n}\n\n// channel actions\n\nexport function addNewChannelToChannelList (id, name, shortId, longId, claimsData) {\n return {\n type: actions.CHANNEL_ADD,\n data: { id, name, shortId, longId, claimsData },\n };\n};\n\nexport function onUpdateChannelClaims (channelKey, name, longId, page) {\n return {\n type: actions.CHANNEL_CLAIMS_UPDATE_ASYNC,\n data: {channelKey, name, longId, page},\n };\n};\n\nexport function updateChannelClaims (channelListId, claimsData) {\n return {\n type: actions.CHANNEL_CLAIMS_UPDATE_SUCCESS,\n data: {channelListId, claimsData},\n };\n};\n\n// display a file\n\nexport function fileRequested (name, claimId) {\n return {\n type: actions.FILE_REQUESTED,\n data: { name, claimId },\n };\n};\n\nexport function updateFileAvailability (status) {\n return {\n type: actions.FILE_AVAILABILITY_UPDATE,\n data: status,\n };\n};\n\nexport function updateDisplayAssetError (error) {\n return {\n type: actions.DISPLAY_ASSET_ERROR,\n data: error,\n };\n};\n\n\n\n// WEBPACK FOOTER //\n// ./react/actions/show.js","import React from 'react';\nimport Helmet from 'react-helmet';\nimport PropTypes from 'prop-types';\n\nimport { createPageTitle } from 'utils/pageTitle';\nimport { createMetaTags } from 'utils/metaTags';\nimport { createCanonicalLink } from 'utils/canonicalLink';\n\nclass SEO extends React.Component {\n render () {\n let { pageTitle, asset, channel, pageUri } = this.props;\n pageTitle = createPageTitle(pageTitle);\n const metaTags = createMetaTags(asset, channel);\n const canonicalLink = createCanonicalLink(asset, channel, pageUri);\n return (\n \n );\n }\n};\n\nSEO.propTypes = {\n pageTitle: PropTypes.string,\n pageUri : PropTypes.string,\n channel : PropTypes.object,\n asset : PropTypes.object,\n};\n\nexport default SEO;\n\n\n\n// WEBPACK FOOTER //\n// ./react/components/SEO/index.jsx","module.exports = require(\"prop-types\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"prop-types\"\n// module id = 10\n// module chunks = 0","import 'cross-fetch/polyfill';\n\n/**\n * Parses the JSON returned by a network request\n *\n * @param {object} response A response from a network request\n *\n * @return {object} The parsed JSON from the request\n */\nfunction parseJSON (response) {\n if (response.status === 204 || response.status === 205) {\n return null;\n }\n return response.json();\n}\n\n/**\n * Parses the status returned by a network request\n *\n * @param {object} response A response from a network request\n * @param {object} response The parsed JSON from the network request\n *\n * @return {object | undefined} Returns object with status and statusText, or undefined\n */\nfunction checkStatus (response, jsonResponse) {\n if (response.status >= 200 && response.status < 300) {\n return jsonResponse;\n }\n const error = new Error(jsonResponse.message);\n error.response = response;\n throw error;\n}\n\n/**\n * Requests a URL, returning a promise\n *\n * @param {string} url The URL we want to request\n * @param {object} [options] The options we want to pass to \"fetch\"\n *\n * @return {object} The response data\n */\n\nexport default function request (url, options) {\n return fetch(url, options)\n .then(response => {\n return Promise.all([response, parseJSON(response)]);\n })\n .then(([response, jsonResponse]) => {\n return checkStatus(response, jsonResponse);\n });\n}\n\n\n\n// WEBPACK FOOTER //\n// ./react/utils/request.js","// request actions\nexport const HANDLE_SHOW_URI = 'HANDLE_SHOW_URI';\nexport const REQUEST_ERROR = 'REQUEST_ERROR';\nexport const REQUEST_UPDATE = 'REQUEST_UPDATE';\nexport const ASSET_REQUEST_NEW = 'ASSET_REQUEST_NEW';\nexport const CHANNEL_REQUEST_NEW = 'CHANNEL_REQUEST_NEW';\nexport const REQUEST_LIST_ADD = 'REQUEST_LIST_ADD';\n\n// asset actions\nexport const ASSET_ADD = `ASSET_ADD`;\n\n// channel actions\nexport const CHANNEL_ADD = 'CHANNEL_ADD';\n\nexport const CHANNEL_CLAIMS_UPDATE_ASYNC = 'CHANNEL_CLAIMS_UPDATE_ASYNC';\nexport const CHANNEL_CLAIMS_UPDATE_SUCCESS = 'CHANNEL_CLAIMS_UPDATE_SUCCESS';\n\n// asset/file display actions\nexport const FILE_REQUESTED = 'FILE_REQUESTED';\nexport const FILE_AVAILABILITY_UPDATE = 'FILE_AVAILABILITY_UPDATE';\nexport const DISPLAY_ASSET_ERROR = 'DISPLAY_ASSET_ERROR';\n\n\n\n// WEBPACK FOOTER //\n// ./react/constants/show_action_types.js","export const selectAsset = (show) => {\n const request = show.requestList[show.request.id];\n const assetKey = request.key;\n return show.assetList[assetKey];\n};\n\nexport const selectShowState = (state) => {\n return state.show;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./react/selectors/show.js","module.exports = require(\"react-helmet\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"react-helmet\"\n// module id = 14\n// module chunks = 0","module.exports = require(\"redux-saga/effects\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"redux-saga/effects\"\n// module id = 15\n// module chunks = 0","const axios = require('axios');\nconst logger = require('winston');\nconst config = require('../config/speechConfig.js');\nconst { apiHost, apiPort } = config.api;\nconst lbryApiUri = 'http://' + apiHost + ':' + apiPort;\nconst { chooseGaLbrynetPublishLabel, sendGATimingEvent } = require('./googleAnalytics.js');\n\nconst handleLbrynetResponse = ({ data }, resolve, reject) => {\n logger.debug('lbry api data:', data);\n if (data.result) {\n // check for an error\n if (data.result.error) {\n logger.debug('Lbrynet api error:', data.result.error);\n reject(new Error(data.result.error));\n return;\n };\n resolve(data.result);\n return;\n }\n // fallback in case it just timed out\n reject(JSON.stringify(data));\n};\n\nmodule.exports = {\n publishClaim (publishParams) {\n logger.debug(`lbryApi >> Publishing claim to \"${publishParams.name}\"`);\n const gaStartTime = Date.now();\n return new Promise((resolve, reject) => {\n axios\n .post(lbryApiUri, {\n method: 'publish',\n params: publishParams,\n })\n .then(response => {\n sendGATimingEvent('lbrynet', 'publish', chooseGaLbrynetPublishLabel(publishParams), gaStartTime, Date.now());\n handleLbrynetResponse(response, resolve, reject);\n })\n .catch(error => {\n reject(error);\n });\n });\n },\n getClaim (uri) {\n logger.debug(`lbryApi >> Getting Claim for \"${uri}\"`);\n const gaStartTime = Date.now();\n return new Promise((resolve, reject) => {\n axios\n .post(lbryApiUri, {\n method: 'get',\n params: { uri, timeout: 20 },\n })\n .then(response => {\n sendGATimingEvent('lbrynet', 'getClaim', 'GET', gaStartTime, Date.now());\n handleLbrynetResponse(response, resolve, reject);\n })\n .catch(error => {\n reject(error);\n });\n });\n },\n getClaimList (claimName) {\n logger.debug(`lbryApi >> Getting claim_list for \"${claimName}\"`);\n const gaStartTime = Date.now();\n return new Promise((resolve, reject) => {\n axios\n .post(lbryApiUri, {\n method: 'claim_list',\n params: { name: claimName },\n })\n .then(response => {\n sendGATimingEvent('lbrynet', 'getClaimList', 'CLAIM_LIST', gaStartTime, Date.now());\n handleLbrynetResponse(response, resolve, reject);\n })\n .catch(error => {\n reject(error);\n });\n });\n },\n resolveUri (uri) {\n logger.debug(`lbryApi >> Resolving URI for \"${uri}\"`);\n const gaStartTime = Date.now();\n return new Promise((resolve, reject) => {\n axios\n .post(lbryApiUri, {\n method: 'resolve',\n params: { uri },\n })\n .then(({ data }) => {\n sendGATimingEvent('lbrynet', 'resolveUri', 'RESOLVE', gaStartTime, Date.now());\n if (data.result[uri].error) { // check for errors\n reject(data.result[uri].error);\n } else { // if no errors, resolve\n resolve(data.result[uri]);\n }\n })\n .catch(error => {\n reject(error);\n });\n });\n },\n getDownloadDirectory () {\n logger.debug('lbryApi >> Retrieving the download directory path from lbry daemon...');\n const gaStartTime = Date.now();\n return new Promise((resolve, reject) => {\n axios\n .post(lbryApiUri, {\n method: 'settings_get',\n })\n .then(({ data }) => {\n sendGATimingEvent('lbrynet', 'getDownloadDirectory', 'SETTINGS_GET', gaStartTime, Date.now());\n if (data.result) {\n resolve(data.result.download_directory);\n } else {\n return new Error('Successfully connected to lbry daemon, but unable to retrieve the download directory.');\n }\n })\n .catch(error => {\n logger.error('Lbrynet Error:', error);\n resolve('/home/lbry/Downloads/');\n });\n });\n },\n createChannel (name) {\n logger.debug(`lbryApi >> Creating channel for ${name}...`);\n const gaStartTime = Date.now();\n return new Promise((resolve, reject) => {\n axios\n .post(lbryApiUri, {\n method: 'channel_new',\n params: {\n channel_name: name,\n amount : 0.1,\n },\n })\n .then(response => {\n sendGATimingEvent('lbrynet', 'createChannel', 'CHANNEL_NEW', gaStartTime, Date.now());\n handleLbrynetResponse(response, resolve, reject);\n })\n .catch(error => {\n reject(error);\n });\n });\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./helpers/lbryApi.js","const logger = require('winston');\nconst ua = require('universal-analytics');\nconst { analytics : { googleId }, site: { name: siteName } } = require('../config/speechConfig.js');\n\nfunction createServeEventParams (headers, ip, originalUrl) {\n return {\n eventCategory : 'client requests',\n eventAction : 'serve request',\n eventLabel : originalUrl,\n ipOverride : ip,\n userAgentOverride: headers['user-agent'],\n };\n};\n\nfunction createPublishTimingEventParams (category, variable, label, startTime, endTime) {\n const duration = endTime - startTime;\n return {\n userTimingCategory : category,\n userTimingVariableName: variable,\n userTimingTime : duration,\n userTimingLabel : label,\n };\n};\n\nfunction sendGoogleAnalyticsEvent (ip, params) {\n const visitorId = ip.replace(/\\./g, '-');\n const visitor = ua(googleId, visitorId, { strictCidFormat: false, https: true });\n visitor.event(params, (err) => {\n if (err) {\n logger.error('Google Analytics Event Error >>', err);\n }\n });\n};\n\nfunction sendGoogleAnalyticsTiming (visitorId, params) {\n const visitor = ua(googleId, visitorId, { strictCidFormat: false, https: true });\n visitor.timing(params, (err) => {\n if (err) {\n logger.error('Google Analytics Event Error >>', err);\n }\n logger.debug(`Timing event successfully sent to google analytics`);\n });\n};\n\nmodule.exports = {\n sendGAServeEvent (headers, ip, originalUrl) {\n const params = createServeEventParams(headers, ip, originalUrl);\n sendGoogleAnalyticsEvent(ip, params);\n },\n sendGATimingEvent (category, variable, label, startTime, endTime) {\n const params = createPublishTimingEventParams(category, variable, label, startTime, endTime);\n sendGoogleAnalyticsTiming(siteName, params);\n },\n chooseGaLbrynetPublishLabel ({ channel_name: channelName, channel_id: channelId }) {\n return (channelName || channelId ? 'PUBLISH_IN_CHANNEL_CLAIM' : 'PUBLISH_ANONYMOUS_CLAIM');\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./helpers/googleAnalytics.js","module.exports = require(\"redux\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"redux\"\n// module id = 18\n// module chunks = 0","import * as actions from 'constants/channel_action_types';\n\n// export action creators\n\nexport function updateLoggedInChannel (name, shortId, longId) {\n return {\n type: actions.CHANNEL_UPDATE,\n data: {\n name,\n shortId,\n longId,\n },\n };\n};\n\n\n\n// WEBPACK FOOTER //\n// ./react/actions/channel.js","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ActiveStatusBar from 'components/ActiveStatusBar';\nimport InactiveStatusBar from 'components/InactiveStatusBar';\n\nclass ProgressBar extends React.Component {\n constructor (props) {\n super(props);\n this.state = {\n bars : [],\n index : 0,\n incrementer: 1,\n };\n this.createBars = this.createBars.bind(this);\n this.startProgressBar = this.startProgressBar.bind(this);\n this.updateProgressBar = this.updateProgressBar.bind(this);\n this.stopProgressBar = this.stopProgressBar.bind(this);\n }\n componentDidMount () {\n this.createBars();\n this.startProgressBar();\n }\n componentWillUnmount () {\n this.stopProgressBar();\n }\n createBars () {\n const bars = [];\n for (let i = 0; i <= this.props.size; i++) {\n bars.push({isActive: false});\n }\n this.setState({ bars });\n }\n startProgressBar () {\n this.updateInterval = setInterval(this.updateProgressBar.bind(this), 300);\n };\n updateProgressBar () {\n let index = this.state.index;\n let incrementer = this.state.incrementer;\n let bars = this.state.bars;\n // flip incrementer if necessary, to stay in bounds\n if ((index < 0) || (index > this.props.size)) {\n incrementer = incrementer * -1;\n index += incrementer;\n }\n // update the indexed bar\n if (incrementer > 0) {\n bars[index].isActive = true;\n } else {\n bars[index].isActive = false;\n };\n // increment index\n index += incrementer;\n // update state\n this.setState({\n bars,\n incrementer,\n index,\n });\n };\n stopProgressBar () {\n clearInterval(this.updateInterval);\n };\n render () {\n return (\n
\n {this.state.bars.map((bar, index) => bar.isActive ? : )}\n
\n );\n }\n};\n\nProgressBar.propTypes = {\n size: PropTypes.number.isRequired,\n};\n\nexport default ProgressBar;\n\n\n\n// WEBPACK FOOTER //\n// ./react/components/ProgressBar/index.jsx","import React from 'react';\nimport PropTypes from 'prop-types';\nimport NavBar from 'containers/NavBar';\n\nclass ErrorPage extends React.Component {\n render () {\n const { error } = this.props;\n return (\n
\n \n
\n

{error}

\n
\n
\n );\n }\n};\n\nErrorPage.propTypes = {\n error: PropTypes.string.isRequired,\n};\n\nexport default ErrorPage;\n\n\n\n// WEBPACK FOOTER //\n// ./react/components/ErrorPage/index.jsx","module.exports = require(\"passport\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"passport\"\n// module id = 22\n// module chunks = 0","module.exports = {\n returnShortId: function (claimsArray, longId) {\n let claimIndex;\n let shortId = longId.substring(0, 1); // default short id is the first letter\n let shortIdLength = 0;\n // find the index of this claim id\n claimIndex = claimsArray.findIndex(element => {\n return element.claimId === longId;\n });\n if (claimIndex < 0) {\n throw new Error('claim id not found in claims list');\n }\n // get an array of all claims with lower height\n let possibleMatches = claimsArray.slice(0, claimIndex);\n // remove certificates with the same prefixes until none are left.\n while (possibleMatches.length > 0) {\n shortIdLength += 1;\n shortId = longId.substring(0, shortIdLength);\n possibleMatches = possibleMatches.filter(element => {\n return (element.claimId && (element.claimId.substring(0, shortIdLength) === shortId));\n });\n }\n return shortId;\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./helpers/sequelizeHelpers.js","module.exports = require(\"passport-local\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"passport-local\"\n// module id = 24\n// module chunks = 0","const logger = require('winston');\nconst fs = require('fs');\nconst { site, wallet, publish } = require('../config/speechConfig.js');\n\nmodule.exports = {\n parsePublishApiRequestBody ({name, nsfw, license, title, description, thumbnail}) {\n // validate name\n if (!name) {\n throw new Error('no name field found in request');\n }\n const invalidNameCharacters = /[^A-Za-z0-9,-]/.exec(name);\n if (invalidNameCharacters) {\n throw new Error('The claim name you provided is not allowed. Only the following characters are allowed: A-Z, a-z, 0-9, and \"-\"');\n }\n // optional parameters\n nsfw = (nsfw === 'true');\n license = license || null;\n title = title || null;\n description = description || null;\n thumbnail = thumbnail || null;\n // return results\n return {\n name,\n nsfw,\n license,\n title,\n description,\n thumbnail,\n };\n },\n parsePublishApiRequestFiles ({file, thumbnail}) {\n // make sure a file was provided\n if (!file) {\n throw new Error('no file with key of [file] found in request');\n }\n if (!file.path) {\n throw new Error('no file path found');\n }\n if (!file.type) {\n throw new Error('no file type found');\n }\n if (!file.size) {\n throw new Error('no file type found');\n }\n // validate the file name\n if (/'/.test(file.name)) {\n throw new Error('apostrophes are not allowed in the file name');\n }\n // validate the file\n module.exports.validateFileTypeAndSize(file);\n // return results\n return {\n fileName : file.name,\n filePath : file.path,\n fileType : file.type,\n thumbnailFileName: (thumbnail ? thumbnail.name : null),\n thumbnailFilePath: (thumbnail ? thumbnail.path : null),\n thumbnailFileType: (thumbnail ? thumbnail.type : null),\n };\n },\n validateFileTypeAndSize (file) {\n // check file type and size\n switch (file.type) {\n case 'image/jpeg':\n case 'image/jpg':\n case 'image/png':\n if (file.size > 10000000) {\n logger.debug('publish > file validation > .jpeg/.jpg/.png was too big');\n throw new Error('Sorry, images are limited to 10 megabytes.');\n }\n break;\n case 'image/gif':\n if (file.size > 50000000) {\n logger.debug('publish > file validation > .gif was too big');\n throw new Error('Sorry, .gifs are limited to 50 megabytes.');\n }\n break;\n case 'video/mp4':\n if (file.size > 50000000) {\n logger.debug('publish > file validation > .mp4 was too big');\n throw new Error('Sorry, videos are limited to 50 megabytes.');\n }\n break;\n default:\n logger.debug('publish > file validation > unrecognized file type');\n throw new Error('The ' + file.type + ' content type is not supported. Only, .jpeg, .png, .gif, and .mp4 files are currently supported.');\n }\n return file;\n },\n createBasicPublishParams (filePath, name, title, description, license, nsfw, thumbnail) {\n logger.debug(`Creating Publish Parameters`);\n // provide defaults for title\n if (title === null || title.trim() === '') {\n title = name;\n }\n // provide default for description\n if (description === null || description.trim() === '') {\n description = '';\n }\n // provide default for license\n if (license === null || license.trim() === '') {\n license = ' '; // default to empty string\n }\n // create the publish params\n const publishParams = {\n name,\n file_path: filePath,\n bid : 0.01,\n metadata : {\n description,\n title,\n author : site.title,\n language: 'en',\n license,\n nsfw,\n },\n claim_address: wallet.lbryClaimAddress,\n };\n // add thumbnail to channel if video\n if (thumbnail) {\n publishParams['metadata']['thumbnail'] = thumbnail;\n }\n return publishParams;\n },\n createThumbnailPublishParams (thumbnailFilePath, claimName, license, nsfw) {\n if (!thumbnailFilePath) {\n return;\n }\n logger.debug(`Creating Thumbnail Publish Parameters`);\n // create the publish params\n return {\n name : `${claimName}-thumb`,\n file_path: thumbnailFilePath,\n bid : 0.01,\n metadata : {\n title : `${claimName} thumbnail`,\n description: `a thumbnail for ${claimName}`,\n author : site.title,\n language : 'en',\n license,\n nsfw,\n },\n claim_address: wallet.lbryClaimAddress,\n channel_name : publish.thumbnailChannel,\n channel_id : publish.thumbnailChannelId,\n };\n },\n deleteTemporaryFile (filePath) {\n fs.unlink(filePath, err => {\n if (err) {\n logger.error(`error deleting temporary file ${filePath}`);\n throw err;\n }\n logger.debug(`successfully deleted ${filePath}`);\n });\n },\n addGetResultsToFileData (fileInfo, getResult) {\n fileInfo.fileName = getResult.file_name;\n fileInfo.filePath = getResult.download_path;\n return fileInfo;\n },\n createFileData ({ name, claimId, outpoint, height, address, nsfw, contentType }) {\n return {\n name,\n claimId,\n outpoint,\n height,\n address,\n fileName: '',\n filePath: '',\n fileType: contentType,\n nsfw,\n };\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./helpers/publishHelpers.js","const logger = require('winston');\n\nmodule.exports = {\n handleErrorResponse: function (originalUrl, ip, error, res) {\n logger.error(`Error on ${originalUrl}`, module.exports.useObjectPropertiesIfNoKeys(error));\n const [status, message] = module.exports.returnErrorMessageAndStatus(error);\n res\n .status(status)\n .json(module.exports.createErrorResponsePayload(status, message));\n },\n returnErrorMessageAndStatus: function (error) {\n let status, message;\n // check for daemon being turned off\n if (error.code === 'ECONNREFUSED') {\n status = 503;\n message = 'Connection refused. The daemon may not be running.';\n // fallback for everything else\n } else {\n status = 400;\n if (error.message) {\n message = error.message;\n } else {\n message = error;\n };\n };\n return [status, message];\n },\n useObjectPropertiesIfNoKeys: function (err) {\n if (Object.keys(err).length === 0) {\n let newErrorObject = {};\n Object.getOwnPropertyNames(err).forEach((key) => {\n newErrorObject[key] = err[key];\n });\n return newErrorObject;\n }\n return err;\n },\n createErrorResponsePayload (status, message) {\n return {\n status,\n success: false,\n message,\n };\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./helpers/errorHandlers.js","const db = require('../models');\nconst logger = require('winston');\nconst { returnPaginatedChannelClaims } = require('../helpers/channelPagination.js');\n\nconst NO_CHANNEL = 'NO_CHANNEL';\nconst NO_CLAIM = 'NO_CLAIM';\nconst NO_FILE = 'NO_FILE';\n\nmodule.exports = {\n getClaimId (channelName, channelClaimId, name, claimId) {\n if (channelName) {\n return module.exports.getClaimIdByChannel(channelName, channelClaimId, name);\n } else {\n return module.exports.getClaimIdByClaim(name, claimId);\n }\n },\n getClaimIdByClaim (claimName, claimId) {\n logger.debug(`getClaimIdByClaim(${claimName}, ${claimId})`);\n return new Promise((resolve, reject) => {\n db.Claim.getLongClaimId(claimName, claimId)\n .then(longClaimId => {\n if (!longClaimId) {\n resolve(NO_CLAIM);\n }\n resolve(longClaimId);\n })\n .catch(error => {\n reject(error);\n });\n });\n },\n getClaimIdByChannel (channelName, channelClaimId, claimName) {\n logger.debug(`getClaimIdByChannel(${channelName}, ${channelClaimId}, ${claimName})`);\n return new Promise((resolve, reject) => {\n db.Certificate.getLongChannelId(channelName, channelClaimId) // 1. get the long channel id\n .then(longChannelId => {\n if (!longChannelId) {\n return [null, null];\n }\n return Promise.all([longChannelId, db.Claim.getClaimIdByLongChannelId(longChannelId, claimName)]); // 2. get the long claim id\n })\n .then(([longChannelId, longClaimId]) => {\n if (!longChannelId) {\n return resolve(NO_CHANNEL);\n }\n if (!longClaimId) {\n return resolve(NO_CLAIM);\n }\n resolve(longClaimId);\n })\n .catch(error => {\n reject(error);\n });\n });\n },\n getChannelData (channelName, channelClaimId, page) {\n return new Promise((resolve, reject) => {\n // 1. get the long channel Id (make sure channel exists)\n db.Certificate.getLongChannelId(channelName, channelClaimId)\n .then(longChannelClaimId => {\n if (!longChannelClaimId) {\n return [null, null, null];\n }\n // 2. get the short ID and all claims for that channel\n return Promise.all([longChannelClaimId, db.Certificate.getShortChannelIdFromLongChannelId(longChannelClaimId, channelName)]);\n })\n .then(([longChannelClaimId, shortChannelClaimId]) => {\n if (!longChannelClaimId) {\n return resolve(NO_CHANNEL);\n }\n // 3. return all the channel information\n resolve({\n channelName,\n longChannelClaimId,\n shortChannelClaimId,\n });\n })\n .catch(error => {\n reject(error);\n });\n });\n },\n getChannelClaims (channelName, channelClaimId, page) {\n return new Promise((resolve, reject) => {\n // 1. get the long channel Id (make sure channel exists)\n db.Certificate.getLongChannelId(channelName, channelClaimId)\n .then(longChannelClaimId => {\n if (!longChannelClaimId) {\n return [null, null, null];\n }\n // 2. get the short ID and all claims for that channel\n return Promise.all([longChannelClaimId, db.Claim.getAllChannelClaims(longChannelClaimId)]);\n })\n .then(([longChannelClaimId, channelClaimsArray]) => {\n if (!longChannelClaimId) {\n return resolve(NO_CHANNEL);\n }\n // 3. format the data for the view, including pagination\n let paginatedChannelViewData = returnPaginatedChannelClaims(channelName, longChannelClaimId, channelClaimsArray, page);\n // 4. return all the channel information and contents\n resolve(paginatedChannelViewData);\n })\n .catch(error => {\n reject(error);\n });\n });\n },\n getLocalFileRecord (claimId, name) {\n return db.File.findOne({where: {claimId, name}})\n .then(file => {\n if (!file) {\n return NO_FILE;\n }\n return file.dataValues;\n });\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./controllers/serveController.js","import React from 'react';\nimport { renderToString } from 'react-dom/server';\nimport { createStore } from 'redux';\nimport Reducer from '../react/reducers';\nimport { Provider } from 'react-redux';\nimport { StaticRouter } from 'react-router-dom';\nimport GAListener from '../react/components/GAListener';\nimport App from '../react/app';\nimport renderFullPage from './renderFullPage.js';\nimport Helmet from 'react-helmet';\n\nmodule.exports = (req, res) => {\n let context = {};\n\n // create a new Redux store instance\n const store = createStore(Reducer);\n\n // render component to a string\n const html = renderToString(\n \n \n \n \n \n \n \n );\n\n // get head tags from helmet\n const helmet = Helmet.renderStatic();\n\n // check for a redirect\n if (context.url) {\n // Somewhere a `` was rendered\n return res.redirect(301, context.url);\n } else {\n // we're good, send the response\n }\n\n // get the initial state from our Redux store\n const preloadedState = store.getState();\n\n // send the rendered page back to the client\n res.send(renderFullPage(helmet, html, preloadedState));\n};\n\n\n\n// WEBPACK FOOTER //\n// ./helpers/handlePageRender.jsx","module.exports = require(\"react-dom/server\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"react-dom/server\"\n// module id = 29\n// module chunks = 0","import { combineReducers } from 'redux';\nimport PublishReducer from 'reducers/publish';\nimport ChannelReducer from 'reducers/channel';\nimport ShowReducer from 'reducers/show';\nimport SiteReducer from 'reducers/site';\n\nexport default combineReducers({\n channel: ChannelReducer,\n publish: PublishReducer,\n show : ShowReducer,\n site : SiteReducer,\n});\n\n\n\n// WEBPACK FOOTER //\n// ./react/reducers/index.js","export const FILE_SELECTED = 'FILE_SELECTED';\nexport const FILE_CLEAR = 'FILE_CLEAR';\nexport const METADATA_UPDATE = 'METADATA_UPDATE';\nexport const CLAIM_UPDATE = 'CLAIM_UPDATE';\nexport const SET_PUBLISH_IN_CHANNEL = 'SET_PUBLISH_IN_CHANNEL';\nexport const PUBLISH_STATUS_UPDATE = 'PUBLISH_STATUS_UPDATE';\nexport const ERROR_UPDATE = 'ERROR_UPDATE';\nexport const SELECTED_CHANNEL_UPDATE = 'SELECTED_CHANNEL_UPDATE';\nexport const TOGGLE_METADATA_INPUTS = 'TOGGLE_METADATA_INPUTS';\nexport const THUMBNAIL_NEW = 'THUMBNAIL_NEW';\nexport const PUBLISH_START = 'PUBLISH_START';\n\n\n\n// WEBPACK FOOTER //\n// ./react/constants/publish_action_types.js","export const LOGIN = 'Existing';\nexport const CREATE = 'New';\n\n\n\n// WEBPACK FOOTER //\n// ./react/constants/publish_channel_select_states.js","export const CHANNEL_UPDATE = 'CHANNEL_UPDATE';\n\n\n\n// WEBPACK FOOTER //\n// ./react/constants/channel_action_types.js","export const LOCAL_CHECK = 'LOCAL_CHECK';\nexport const UNAVAILABLE = 'UNAVAILABLE';\nexport const ERROR = 'ERROR';\nexport const AVAILABLE = 'AVAILABLE';\n\n\n\n// WEBPACK FOOTER //\n// ./react/constants/asset_display_states.js","import React from 'react';\nimport GoogleAnalytics from 'react-ga';\nimport { withRouter } from 'react-router-dom';\nconst config = require('../../../config/speechConfig.js');\nconst googleApiKey = config.analytics.googleId;\n\nGoogleAnalytics.initialize(googleApiKey);\n\nclass GAListener extends React.Component {\n componentDidMount () {\n this.sendPageView(this.props.history.location);\n this.props.history.listen(this.sendPageView);\n }\n\n sendPageView (location) {\n GoogleAnalytics.set({ page: location.pathname });\n GoogleAnalytics.pageview(location.pathname);\n }\n\n render () {\n return this.props.children;\n }\n}\n\nexport default withRouter(GAListener);\n\n\n\n// WEBPACK FOOTER //\n// ./react/components/GAListener/index.jsx","import React from 'react';\nimport { Route, Switch } from 'react-router-dom';\nimport HomePage from 'components/HomePage';\nimport AboutPage from 'components/AboutPage';\nimport LoginPage from 'containers/LoginPage';\nimport ShowPage from 'containers/ShowPage';\nimport FourOhFourPage from 'components/FourOhFourPage';\n\nconst App = () => {\n return (\n \n \n \n \n \n \n \n \n );\n};\n\nexport default App;\n\n\n\n// WEBPACK FOOTER //\n// ./react/app.js","import { connect } from 'react-redux';\nimport { selectFile, updateError, clearFile } from 'actions/publish';\nimport View from './view';\n\nconst mapStateToProps = ({ publish }) => {\n return {\n file : publish.file,\n thumbnail: publish.thumbnail,\n fileError: publish.error.file,\n };\n};\n\nconst mapDispatchToProps = dispatch => {\n return {\n selectFile: (file) => {\n dispatch(selectFile(file));\n },\n setFileError: (value) => {\n dispatch(clearFile());\n dispatch(updateError('file', value));\n },\n };\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/Dropzone/index.js","import { connect } from 'react-redux';\nimport { updateLoggedInChannel } from 'actions/channel';\nimport View from './view';\nimport {updateSelectedChannel} from '../../actions/publish';\n\nconst mapDispatchToProps = dispatch => {\n return {\n onChannelLogin: (name, shortId, longId) => {\n dispatch(updateLoggedInChannel(name, shortId, longId));\n dispatch(updateSelectedChannel(name));\n },\n };\n};\n\nexport default connect(null, mapDispatchToProps)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/ChannelLoginForm/index.js","import { connect } from 'react-redux';\nimport { updateLoggedInChannel } from 'actions/channel';\nimport View from './view';\nimport {updateSelectedChannel} from 'actions/publish';\n\nconst mapDispatchToProps = dispatch => {\n return {\n onChannelLogin: (name, shortId, longId) => {\n dispatch(updateLoggedInChannel(name, shortId, longId));\n dispatch(updateSelectedChannel(name));\n },\n };\n};\n\nexport default connect(null, mapDispatchToProps)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/ChannelCreateForm/index.js","export const CHANNEL = 'CHANNEL';\nexport const ASSET_LITE = 'ASSET_LITE';\nexport const ASSET_DETAILS = 'ASSET_DETAILS';\n\n\n\n// WEBPACK FOOTER //\n// ./react/constants/show_request_types.js","import { connect } from 'react-redux';\nimport View from './view';\nimport { fileRequested } from 'actions/show';\nimport { selectAsset } from 'selectors/show';\n\nconst mapStateToProps = ({ show }) => {\n // select error and status\n const error = show.displayAsset.error;\n const status = show.displayAsset.status;\n // select asset\n const asset = selectAsset(show);\n // return props\n return {\n error,\n status,\n asset,\n };\n};\n\nconst mapDispatchToProps = dispatch => {\n return {\n onFileRequest: (name, claimId) => {\n dispatch(fileRequested(name, claimId));\n },\n };\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/AssetDisplay/index.js","module.exports = (helmet, html, preloadedState) => {\n // take the html and preloadedState and return the full page\n return `\n \n \n \n \n \n \n \n ${helmet.title.toString()}\n ${helmet.meta.toString()}\n ${helmet.link.toString()}\n \n \n \n \n \n \n \n \n
\n
${html}
\n
\n \n \n \n \n `;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./helpers/renderFullPage.js","module.exports = require(\"babel-polyfill\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"babel-polyfill\"\n// module id = 44\n// module chunks = 0","module.exports = require(\"whatwg-fetch\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"whatwg-fetch\"\n// module id = 45\n// module chunks = 0","// load dependencies\nconst express = require('express');\nconst bodyParser = require('body-parser');\nconst expressHandlebars = require('express-handlebars');\nconst Handlebars = require('handlebars');\nconst { populateLocalsDotUser, serializeSpeechUser, deserializeSpeechUser } = require('./helpers/authHelpers.js');\nconst config = require('./config/speechConfig.js');\nconst logger = require('winston');\nconst helmet = require('helmet');\nconst PORT = 3000; // set port\nconst app = express(); // create an Express application\nconst passport = require('passport');\nconst cookieSession = require('cookie-session');\n\n// configure logging\nconst logLevel = config.logging.logLevel;\nrequire('./config/loggerConfig.js')(logger, logLevel);\nrequire('./config/slackConfig.js')(logger);\n\n// check for global config variables\nrequire('./helpers/configVarCheck.js')();\n\n// trust the proxy to get ip address for us\napp.enable('trust proxy');\n\n// add middleware\napp.use(helmet()); // set HTTP headers to protect against well-known web vulnerabilties\napp.use(express.static(`${__dirname}/public`)); // 'express.static' to serve static files from public directory\napp.use(bodyParser.json()); // 'body parser' for parsing application/json\napp.use(bodyParser.urlencoded({ extended: true })); // 'body parser' for parsing application/x-www-form-urlencoded\napp.use((req, res, next) => { // custom logging middleware to log all incoming http requests\n logger.verbose(`Request on ${req.originalUrl} from ${req.ip}`);\n next();\n});\n\n// configure passport\npassport.serializeUser(serializeSpeechUser);\npassport.deserializeUser(deserializeSpeechUser);\nconst localSignupStrategy = require('./passport/local-signup.js');\nconst localLoginStrategy = require('./passport/local-login.js');\npassport.use('local-signup', localSignupStrategy);\npassport.use('local-login', localLoginStrategy);\n// initialize passport\napp.use(cookieSession({\n name : 'session',\n keys : [config.session.sessionKey],\n maxAge: 24 * 60 * 60 * 1000, // 24 hours\n}));\napp.use(passport.initialize());\napp.use(passport.session());\n\n// configure handlebars & register it with express app\nconst hbs = expressHandlebars.create({\n defaultLayout: 'embed', // sets the default layout\n handlebars : Handlebars, // includes basic handlebars for access to that library\n});\napp.engine('handlebars', hbs.engine);\napp.set('view engine', 'handlebars');\n\n// middleware to pass user info back to client (for handlebars access), if user is logged in\napp.use(populateLocalsDotUser);\n\n// start the server\nconst start = (config) => {\n const { mysqlConfig } = config;\n const db = require('./models')(mysqlConfig); // require our models for syncing\n db.sequelize\n // sync sequelize\n .sync()\n // require routes\n .then(() => {\n require('./routes/auth-routes.js')(app);\n require('./routes/api-routes.js')(app);\n require('./routes/page-routes.js')(app);\n require('./routes/serve-routes.js')(app);\n require('./routes/fallback-routes.js')(app);\n const http = require('http');\n return http.Server(app);\n })\n // start the server\n .then(server => {\n server.listen(PORT, () => {\n logger.info('Trusting proxy?', app.get('trust proxy'));\n logger.info(`Server is listening on PORT ${PORT}`);\n });\n })\n .catch((error) => {\n logger.error(`Startup Error:`, error);\n });\n};\n\nmodule.exports = {\n speak (something) {\n console.log(something);\n },\n start,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./server.js","module.exports = require(\"express\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"express\"\n// module id = 47\n// module chunks = 0","module.exports = require(\"body-parser\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"body-parser\"\n// module id = 48\n// module chunks = 0","module.exports = require(\"express-handlebars\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"express-handlebars\"\n// module id = 49\n// module chunks = 0","module.exports = require(\"handlebars\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"handlebars\"\n// module id = 50\n// module chunks = 0","// const db = require('../models'); // require our models for syncing\nconst logger = require('winston');\n\nmodule.exports = {\n populateLocalsDotUser (req, res, next) {\n if (req.user) {\n logger.debug('populating res.locals.user');\n res.locals.user = {\n id : req.user.id,\n userName : req.user.userName,\n channelName : req.user.channelName,\n channelClaimId: req.user.channelClaimId,\n shortChannelId: req.user.shortChannelId,\n };\n }\n next();\n },\n serializeSpeechUser (user, done) { // returns user data to be serialized into session\n logger.debug('serializing user');\n done(null, user);\n },\n deserializeSpeechUser (user, done) { // deserializes session and populates additional info to req.user\n logger.debug('deserializing user');\n done(null, user);\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./helpers/authHelpers.js","module.exports = require(\"helmet\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"helmet\"\n// module id = 52\n// module chunks = 0","module.exports = require(\"cookie-session\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"cookie-session\"\n// module id = 53\n// module chunks = 0","module.exports = (winston, logLevel) => {\n winston.configure({\n transports: [\n new (winston.transports.Console)({\n level : logLevel,\n timestamp : false,\n colorize : true,\n prettyPrint : true,\n handleExceptions : true,\n humanReadableUnhandledException: true,\n }),\n ],\n });\n\n winston.error('Level 0');\n winston.warn('Level 1');\n winston.info('Level 2');\n winston.verbose('Level 3');\n winston.debug('Level 4');\n winston.silly('Level 5');\n};\n\n\n\n// WEBPACK FOOTER //\n// ./config/loggerConfig.js","const { logging } = require('./speechConfig.js');\nconst { slackWebHook, slackErrorChannel, slackInfoChannel } = logging;\nconst winstonSlackWebHook = require('winston-slack-webhook').SlackWebHook;\n\nmodule.exports = (winston) => {\n if (slackWebHook) {\n // add a transport for errors to slack\n if (slackErrorChannel) {\n winston.add(winstonSlackWebHook, {\n name : 'slack-errors-transport',\n level : 'warn',\n webhookUrl: slackWebHook,\n channel : slackErrorChannel,\n username : 'spee.ch',\n iconEmoji : ':face_with_head_bandage:',\n });\n };\n if (slackInfoChannel) {\n winston.add(winstonSlackWebHook, {\n name : 'slack-info-transport',\n level : 'info',\n webhookUrl: slackWebHook,\n channel : slackInfoChannel,\n username : 'spee.ch',\n iconEmoji : ':nerd_face:',\n });\n };\n // send test message\n winston.error('Slack \"error\" logging is online.');\n winston.info('Slack \"info\" logging is online.');\n } else {\n winston.warn('Slack logging is not enabled because no slackWebHook config var provided.');\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ./config/slackConfig.js","module.exports = require(\"winston-slack-webhook\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"winston-slack-webhook\"\n// module id = 56\n// module chunks = 0","const config = require('../config/speechConfig.js');\nconst logger = require('winston');\n\nmodule.exports = function () {\n // get the config file\n\n for (let configCategoryKey in config) {\n if (config.hasOwnProperty(configCategoryKey)) {\n // get the final variables for each config category\n const configVariables = config[configCategoryKey];\n for (let configVarKey in configVariables) {\n if (configVariables.hasOwnProperty(configVarKey)) {\n // print each variable\n logger.debug(`CONFIG CHECK: ${configCategoryKey}.${configVarKey} === ${configVariables[configVarKey]}`);\n }\n }\n }\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ./helpers/configVarCheck.js","const db = require('../models');\nconst PassportLocalStrategy = require('passport-local').Strategy;\nconst lbryApi = require('../helpers/lbryApi.js');\nconst logger = require('winston');\n\nmodule.exports = new PassportLocalStrategy(\n {\n usernameField: 'username',\n passwordField: 'password',\n },\n (username, password, done) => {\n logger.verbose(`new channel signup request. user: ${username} pass: ${password} .`);\n let userInfo = {};\n // server-side validaton of inputs (username, password)\n\n // create the channel and retrieve the metadata\n return lbryApi.createChannel(`@${username}`)\n .then(tx => {\n // create user record\n const userData = {\n userName: username,\n password: password,\n };\n logger.verbose('userData >', userData);\n // create user record\n const channelData = {\n channelName : `@${username}`,\n channelClaimId: tx.claim_id,\n };\n logger.verbose('channelData >', channelData);\n // create certificate record\n const certificateData = {\n claimId: tx.claim_id,\n name : `@${username}`,\n // address,\n };\n logger.verbose('certificateData >', certificateData);\n // save user and certificate to db\n return Promise.all([db.User.create(userData), db.Channel.create(channelData), db.Certificate.create(certificateData)]);\n })\n .then(([newUser, newChannel, newCertificate]) => {\n logger.verbose('user and certificate successfully created');\n // store the relevant newUser info to be passed back for req.User\n userInfo['id'] = newUser.id;\n userInfo['userName'] = newUser.userName;\n userInfo['channelName'] = newChannel.channelName;\n userInfo['channelClaimId'] = newChannel.channelClaimId;\n // associate the instances\n return Promise.all([newCertificate.setChannel(newChannel), newChannel.setUser(newUser)]);\n })\n .then(() => {\n logger.verbose('user and certificate successfully associated');\n return db.Certificate.getShortChannelIdFromLongChannelId(userInfo.channelClaimId, userInfo.channelName);\n })\n .then(shortChannelId => {\n userInfo['shortChannelId'] = shortChannelId;\n return done(null, userInfo);\n })\n .catch(error => {\n logger.error('signup error', error);\n return done(error);\n });\n }\n);\n\n\n\n// WEBPACK FOOTER //\n// ./passport/local-signup.js","module.exports = require(\"sequelize\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"sequelize\"\n// module id = 59\n// module chunks = 0","const logger = require('winston');\nconst { returnShortId } = require('../helpers/sequelizeHelpers.js');\n\nmodule.exports = (sequelize, { STRING, BOOLEAN, INTEGER, TEXT, DECIMAL }) => {\n const Certificate = sequelize.define(\n 'Certificate',\n {\n address: {\n type : STRING,\n default: null,\n },\n amount: {\n type : DECIMAL(19, 8),\n default: null,\n },\n claimId: {\n type : STRING,\n default: null,\n },\n claimSequence: {\n type : INTEGER,\n default: null,\n },\n decodedClaim: {\n type : BOOLEAN,\n default: null,\n },\n depth: {\n type : INTEGER,\n default: null,\n },\n effectiveAmount: {\n type : DECIMAL(19, 8),\n default: null,\n },\n hasSignature: {\n type : BOOLEAN,\n default: null,\n },\n height: {\n type : INTEGER,\n default: null,\n },\n hex: {\n type : TEXT('long'),\n default: null,\n },\n name: {\n type : STRING,\n default: null,\n },\n nout: {\n type : INTEGER,\n default: null,\n },\n txid: {\n type : STRING,\n default: null,\n },\n validAtHeight: {\n type : INTEGER,\n default: null,\n },\n outpoint: {\n type : STRING,\n default: null,\n },\n valueVersion: {\n type : STRING,\n default: null,\n },\n claimType: {\n type : STRING,\n default: null,\n },\n certificateVersion: {\n type : STRING,\n default: null,\n },\n keyType: {\n type : STRING,\n default: null,\n },\n publicKey: {\n type : TEXT('long'),\n default: null,\n },\n },\n {\n freezeTableName: true,\n }\n );\n\n Certificate.associate = db => {\n Certificate.belongsTo(db.Channel, {\n foreignKey: {\n allowNull: true,\n },\n });\n };\n\n Certificate.getShortChannelIdFromLongChannelId = function (longChannelId, channelName) {\n logger.debug(`getShortChannelIdFromLongChannelId ${channelName}:${longChannelId}`);\n return new Promise((resolve, reject) => {\n this\n .findAll({\n where: {name: channelName},\n order: [['height', 'ASC']],\n })\n .then(result => {\n switch (result.length) {\n case 0:\n throw new Error('No channel(s) found with that channel name');\n default:\n return resolve(returnShortId(result, longChannelId));\n }\n })\n .catch(error => {\n reject(error);\n });\n });\n };\n\n Certificate.getLongChannelIdFromShortChannelId = function (channelName, channelClaimId) {\n logger.debug(`getLongChannelIdFromShortChannelId(${channelName}, ${channelClaimId})`);\n return new Promise((resolve, reject) => {\n this\n .findAll({\n where: {\n name : channelName,\n claimId: {\n $like: `${channelClaimId}%`,\n },\n },\n order: [['height', 'ASC']],\n })\n .then(result => {\n switch (result.length) {\n case 0:\n return resolve(null);\n default: // note results must be sorted\n return resolve(result[0].claimId);\n }\n })\n .catch(error => {\n reject(error);\n });\n });\n };\n\n Certificate.getLongChannelIdFromChannelName = function (channelName) {\n logger.debug(`getLongChannelIdFromChannelName(${channelName})`);\n return new Promise((resolve, reject) => {\n this\n .findAll({\n where: { name: channelName },\n order: [['effectiveAmount', 'DESC'], ['height', 'ASC']],\n })\n .then(result => {\n switch (result.length) {\n case 0:\n return resolve(null);\n default:\n return resolve(result[0].claimId);\n }\n })\n .catch(error => {\n reject(error);\n });\n });\n };\n\n Certificate.validateLongChannelId = function (name, claimId) {\n logger.debug(`validateLongChannelId(${name}, ${claimId})`);\n return new Promise((resolve, reject) => {\n this.findOne({\n where: {name, claimId},\n })\n .then(result => {\n if (!result) {\n return resolve(null);\n };\n resolve(claimId);\n })\n .catch(error => {\n reject(error);\n });\n });\n };\n\n Certificate.getLongChannelId = function (channelName, channelClaimId) {\n logger.debug(`getLongChannelId(${channelName}, ${channelClaimId})`);\n if (channelClaimId && (channelClaimId.length === 40)) { // if a full channel id is provided\n return this.validateLongChannelId(channelName, channelClaimId);\n } else if (channelClaimId && channelClaimId.length < 40) { // if a short channel id is provided\n return this.getLongChannelIdFromShortChannelId(channelName, channelClaimId);\n } else {\n return this.getLongChannelIdFromChannelName(channelName); // if no channel id provided\n }\n };\n\n return Certificate;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./models/certificate.js","module.exports = (sequelize, { STRING }) => {\n const Channel = sequelize.define(\n 'Channel',\n {\n channelName: {\n type : STRING,\n allowNull: false,\n },\n channelClaimId: {\n type : STRING,\n allowNull: false,\n },\n },\n {\n freezeTableName: true,\n }\n );\n\n Channel.associate = db => {\n Channel.belongsTo(db.User);\n Channel.hasOne(db.Certificate);\n };\n\n return Channel;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./models/channel.js","const logger = require('winston');\nconst { returnShortId } = require('../helpers/sequelizeHelpers.js');\nconst { claim, site } = require('../config/speechConfig.js');\nconst { defaultThumbnail } = claim;\n\nfunction determineFileExtensionFromContentType (contentType) {\n switch (contentType) {\n case 'image/jpeg':\n case 'image/jpg':\n return 'jpeg';\n case 'image/png':\n return 'png';\n case 'image/gif':\n return 'gif';\n case 'video/mp4':\n return 'mp4';\n default:\n logger.debug('setting unknown file type as file extension jpeg');\n return 'jpeg';\n }\n};\n\nfunction determineThumbnail (storedThumbnail, defaultThumbnail) {\n if (storedThumbnail === '') {\n return defaultThumbnail;\n }\n return storedThumbnail;\n};\n\nfunction prepareClaimData (claim) {\n // logger.debug('preparing claim data based on resolved data:', claim);\n claim['thumbnail'] = determineThumbnail(claim.thumbnail, defaultThumbnail);\n claim['fileExt'] = determineFileExtensionFromContentType(claim.contentType);\n claim['host'] = site.host;\n return claim;\n};\n\nmodule.exports = (sequelize, { STRING, BOOLEAN, INTEGER, TEXT, DECIMAL }) => {\n const Claim = sequelize.define(\n 'Claim',\n {\n address: {\n type : STRING,\n default: null,\n },\n amount: {\n type : DECIMAL(19, 8),\n default: null,\n },\n claimId: {\n type : STRING,\n default: null,\n },\n claimSequence: {\n type : INTEGER,\n default: null,\n },\n decodedClaim: {\n type : BOOLEAN,\n default: null,\n },\n depth: {\n type : INTEGER,\n default: null,\n },\n effectiveAmount: {\n type : DECIMAL(19, 8),\n default: null,\n },\n hasSignature: {\n type : BOOLEAN,\n default: null,\n },\n height: {\n type : INTEGER,\n default: null,\n },\n hex: {\n type : TEXT('long'),\n default: null,\n },\n name: {\n type : STRING,\n default: null,\n },\n nout: {\n type : INTEGER,\n default: null,\n },\n txid: {\n type : STRING,\n default: null,\n },\n validAtHeight: {\n type : INTEGER,\n default: null,\n },\n outpoint: {\n type : STRING,\n default: null,\n },\n claimType: {\n type : STRING,\n default: null,\n },\n certificateId: {\n type : STRING,\n default: null,\n },\n author: {\n type : STRING,\n default: null,\n },\n description: {\n type : TEXT('long'),\n default: null,\n },\n language: {\n type : STRING,\n default: null,\n },\n license: {\n type : STRING,\n default: null,\n },\n licenseUrl: {\n type : STRING,\n default: null,\n },\n nsfw: {\n type : BOOLEAN,\n default: null,\n },\n preview: {\n type : STRING,\n default: null,\n },\n thumbnail: {\n type : STRING,\n default: null,\n },\n title: {\n type : STRING,\n default: null,\n },\n metadataVersion: {\n type : STRING,\n default: null,\n },\n contentType: {\n type : STRING,\n default: null,\n },\n source: {\n type : STRING,\n default: null,\n },\n sourceType: {\n type : STRING,\n default: null,\n },\n sourceVersion: {\n type : STRING,\n default: null,\n },\n streamVersion: {\n type : STRING,\n default: null,\n },\n valueVersion: {\n type : STRING,\n default: null,\n },\n channelName: {\n type : STRING,\n allowNull: true,\n default : null,\n },\n },\n {\n freezeTableName: true,\n }\n );\n\n Claim.associate = db => {\n Claim.belongsTo(db.File, {\n foreignKey: {\n allowNull: true,\n },\n });\n };\n\n Claim.getShortClaimIdFromLongClaimId = function (claimId, claimName) {\n logger.debug(`Claim.getShortClaimIdFromLongClaimId for ${claimName}#${claimId}`);\n return new Promise((resolve, reject) => {\n this\n .findAll({\n where: { name: claimName },\n order: [['height', 'ASC']],\n })\n .then(result => {\n switch (result.length) {\n case 0:\n throw new Error('No claim(s) found with that claim name');\n default:\n resolve(returnShortId(result, claimId));\n }\n })\n .catch(error => {\n reject(error);\n });\n });\n };\n\n Claim.getAllChannelClaims = function (channelClaimId) {\n logger.debug(`Claim.getAllChannelClaims for ${channelClaimId}`);\n return new Promise((resolve, reject) => {\n this\n .findAll({\n where: { certificateId: channelClaimId },\n order: [['height', 'ASC']],\n raw : true, // returns an array of only data, not an array of instances\n })\n .then(channelClaimsArray => {\n // logger.debug('channelclaimsarray length:', channelClaimsArray.length);\n switch (channelClaimsArray.length) {\n case 0:\n return resolve(null);\n default:\n channelClaimsArray.forEach(claim => {\n claim['fileExt'] = determineFileExtensionFromContentType(claim.contentType);\n claim['thumbnail'] = determineThumbnail(claim.thumbnail, defaultThumbnail);\n return claim;\n });\n return resolve(channelClaimsArray);\n }\n })\n .catch(error => {\n reject(error);\n });\n });\n };\n\n Claim.getClaimIdByLongChannelId = function (channelClaimId, claimName) {\n logger.debug(`finding claim id for claim ${claimName} from channel ${channelClaimId}`);\n return new Promise((resolve, reject) => {\n this\n .findAll({\n where: { name: claimName, certificateId: channelClaimId },\n order: [['id', 'ASC']],\n })\n .then(result => {\n switch (result.length) {\n case 0:\n return resolve(null);\n case 1:\n return resolve(result[0].claimId);\n default:\n logger.error(`${result.length} records found for \"${claimName}\" in channel \"${channelClaimId}\"`);\n return resolve(result[0].claimId);\n }\n })\n .catch(error => {\n reject(error);\n });\n });\n };\n\n Claim.getLongClaimIdFromShortClaimId = function (name, shortId) {\n return new Promise((resolve, reject) => {\n this\n .findAll({\n where: {\n name,\n claimId: {\n $like: `${shortId}%`,\n }},\n order: [['height', 'ASC']],\n })\n .then(result => {\n switch (result.length) {\n case 0:\n return resolve(null);\n default: // note results must be sorted\n return resolve(result[0].claimId);\n }\n })\n .catch(error => {\n reject(error);\n });\n });\n };\n\n Claim.getTopFreeClaimIdByClaimName = function (name) {\n return new Promise((resolve, reject) => {\n this\n .findAll({\n where: { name },\n order: [['effectiveAmount', 'DESC'], ['height', 'ASC']], // note: maybe height and effective amount need to switch?\n })\n .then(result => {\n logger.debug('length of result', result.length);\n switch (result.length) {\n case 0:\n return resolve(null);\n default:\n return resolve(result[0].dataValues.claimId);\n }\n })\n .catch(error => {\n reject(error);\n });\n });\n };\n\n Claim.validateLongClaimId = function (name, claimId) {\n return new Promise((resolve, reject) => {\n this.findOne({\n where: {name, claimId},\n })\n .then(result => {\n if (!result) {\n return resolve(null);\n };\n resolve(claimId);\n })\n .catch(error => {\n reject(error);\n });\n });\n };\n\n Claim.getLongClaimId = function (claimName, claimId) {\n logger.debug(`getLongClaimId(${claimName}, ${claimId})`);\n if (claimId && (claimId.length === 40)) { // if a full claim id is provided\n return this.validateLongClaimId(claimName, claimId);\n } else if (claimId && claimId.length < 40) {\n return this.getLongClaimIdFromShortClaimId(claimName, claimId); // if a short claim id is provided\n } else {\n return this.getTopFreeClaimIdByClaimName(claimName); // if no claim id is provided\n }\n };\n\n Claim.resolveClaim = function (name, claimId) {\n logger.debug(`Claim.resolveClaim: ${name} ${claimId}`);\n return new Promise((resolve, reject) => {\n this\n .findAll({\n where: { name, claimId },\n })\n .then(claimArray => {\n logger.debug('claims found on resolve:', claimArray.length);\n switch (claimArray.length) {\n case 0:\n return resolve(null);\n case 1:\n return resolve(prepareClaimData(claimArray[0].dataValues));\n default:\n logger.error(`more than one entry matches that name (${name}) and claimID (${claimId})`);\n return resolve(prepareClaimData(claimArray[0].dataValues));\n }\n })\n .catch(error => {\n reject(error);\n });\n });\n };\n\n return Claim;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./models/claim.js","module.exports = (sequelize, { STRING, BOOLEAN, INTEGER }) => {\n const File = sequelize.define(\n 'File',\n {\n name: {\n type : STRING,\n allowNull: false,\n },\n claimId: {\n type : STRING,\n allowNull: false,\n },\n address: {\n type : STRING,\n allowNull: false,\n },\n outpoint: {\n type : STRING,\n allowNull: false,\n },\n height: {\n type : INTEGER,\n allowNull: false,\n default : 0,\n },\n fileName: {\n type : STRING,\n allowNull: false,\n },\n filePath: {\n type : STRING,\n allowNull: false,\n },\n fileType: {\n type: STRING,\n },\n nsfw: {\n type : BOOLEAN,\n allowNull : false,\n defaultValue: false,\n },\n trendingEligible: {\n type : BOOLEAN,\n allowNull : false,\n defaultValue: true,\n },\n },\n {\n freezeTableName: true,\n }\n );\n\n File.associate = db => {\n File.hasMany(db.Request);\n File.hasOne(db.Claim);\n };\n\n File.getRecentClaims = function () {\n return this.findAll({\n where: { nsfw: false, trendingEligible: true },\n order: [['createdAt', 'DESC']],\n limit: 25,\n });\n };\n\n return File;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./models/file.js","module.exports = (sequelize, { STRING, BOOLEAN, TEXT }) => {\n const Request = sequelize.define(\n 'Request',\n {\n action: {\n type : STRING,\n allowNull: false,\n },\n url: {\n type : STRING,\n allowNull: false,\n },\n ipAddress: {\n type : STRING,\n allowNull: true,\n },\n result: {\n type : TEXT('long'),\n allowNull: true,\n default : null,\n },\n },\n {\n freezeTableName: true,\n }\n );\n\n Request.associate = db => {\n Request.belongsTo(db.File, {\n foreignKey: {\n allowNull: true,\n },\n });\n };\n\n return Request;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./models/request.js","'use strict';\nconst bcrypt = require('bcrypt');\nconst logger = require('winston');\n\nmodule.exports = (sequelize, { STRING }) => {\n const User = sequelize.define(\n 'User',\n {\n userName: {\n type : STRING,\n allowNull: false,\n },\n password: {\n type : STRING,\n allowNull: false,\n },\n },\n {\n freezeTableName: true,\n }\n );\n\n User.associate = db => {\n User.hasOne(db.Channel);\n };\n\n User.prototype.comparePassword = function (password) {\n return bcrypt.compare(password, this.password);\n };\n\n User.prototype.changePassword = function (newPassword) {\n return new Promise((resolve, reject) => {\n // generate a salt string to use for hashing\n bcrypt.genSalt((saltError, salt) => {\n if (saltError) {\n logger.error('salt error', saltError);\n reject(saltError);\n return;\n }\n // generate a hashed version of the user's password\n bcrypt.hash(newPassword, salt, (hashError, hash) => {\n // if there is an error with the hash generation return the error\n if (hashError) {\n logger.error('hash error', hashError);\n reject(hashError);\n return;\n }\n // replace the current password with the new hash\n this\n .update({password: hash})\n .then(() => {\n resolve();\n })\n .catch(error => {\n reject(error);\n });\n });\n });\n });\n };\n\n // pre-save hook method to hash the user's password before the user's info is saved to the db.\n User.hook('beforeCreate', (user, options) => {\n logger.debug('User.beforeCreate hook...');\n return new Promise((resolve, reject) => {\n // generate a salt string to use for hashing\n bcrypt.genSalt((saltError, salt) => {\n if (saltError) {\n logger.error('salt error', saltError);\n reject(saltError);\n return;\n }\n // generate a hashed version of the user's password\n bcrypt.hash(user.password, salt, (hashError, hash) => {\n // if there is an error with the hash generation return the error\n if (hashError) {\n logger.error('hash error', hashError);\n reject(hashError);\n return;\n }\n // replace the password string with the hash password value\n user.password = hash;\n resolve();\n });\n });\n });\n });\n\n return User;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./models/user.js","module.exports = require(\"bcrypt\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"bcrypt\"\n// module id = 66\n// module chunks = 0","module.exports = require(\"axios\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"axios\"\n// module id = 67\n// module chunks = 0","module.exports = require(\"universal-analytics\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"universal-analytics\"\n// module id = 68\n// module chunks = 0","const PassportLocalStrategy = require('passport-local').Strategy;\nconst db = require('../models');\nconst logger = require('winston');\n\nfunction returnUserAndChannelInfo (userInstance) {\n return new Promise((resolve, reject) => {\n let userInfo = {};\n userInfo['id'] = userInstance.id;\n userInfo['userName'] = userInstance.userName;\n userInstance\n .getChannel()\n .then(({channelName, channelClaimId}) => {\n userInfo['channelName'] = channelName;\n userInfo['channelClaimId'] = channelClaimId;\n return db.Certificate.getShortChannelIdFromLongChannelId(channelClaimId, channelName);\n })\n .then(shortChannelId => {\n userInfo['shortChannelId'] = shortChannelId;\n resolve(userInfo);\n })\n .catch(error => {\n reject(error);\n });\n });\n}\n\nmodule.exports = new PassportLocalStrategy(\n {\n usernameField: 'username',\n passwordField: 'password',\n },\n (username, password, done) => {\n return db.User\n .findOne({\n where: {userName: username},\n })\n .then(user => {\n if (!user) {\n logger.debug('no user found');\n return done(null, false, {message: 'Incorrect username or password'});\n }\n return user.comparePassword(password)\n .then(isMatch => {\n if (!isMatch) {\n logger.debug('incorrect password');\n return done(null, false, {message: 'Incorrect username or password'});\n }\n logger.debug('Password was a match, returning User');\n return returnUserAndChannelInfo(user)\n .then(userInfo => {\n return done(null, userInfo);\n })\n .catch(error => {\n return error;\n });\n })\n .catch(error => {\n return error;\n });\n })\n .catch(error => {\n return done(error);\n });\n }\n);\n\n\n\n// WEBPACK FOOTER //\n// ./passport/local-login.js","const logger = require('winston');\nconst passport = require('passport');\n\nmodule.exports = (app) => {\n // route for sign up\n app.post('/signup', passport.authenticate('local-signup'), (req, res) => {\n logger.verbose(`successful signup for ${req.user.channelName}`);\n res.status(200).json({\n success : true,\n channelName : req.user.channelName,\n channelClaimId: req.user.channelClaimId,\n shortChannelId: req.user.shortChannelId,\n });\n });\n // route for log in\n app.post('/login', (req, res, next) => {\n passport.authenticate('local-login', (err, user, info) => {\n logger.debug('info:', info);\n if (err) {\n return next(err);\n }\n if (!user) {\n return res.status(400).json({\n success: false,\n message: info.message,\n });\n }\n logger.debug('successful login');\n req.logIn(user, (err) => {\n if (err) {\n return next(err);\n }\n return res.status(200).json({\n success : true,\n channelName : req.user.channelName,\n channelClaimId: req.user.channelClaimId,\n shortChannelId: req.user.shortChannelId,\n });\n });\n })(req, res, next);\n });\n // route to log out\n app.get('/logout', (req, res) => {\n req.logout();\n res.status(200).json({success: true, message: 'you successfully logged out'});\n });\n // see if user is authenticated, and return credentials if so\n app.get('/user', (req, res) => {\n if (req.user) {\n res.status(200).json({success: true, data: req.user});\n } else {\n res.status(401).json({success: false, message: 'user is not logged in'});\n }\n });\n};\n\n\n\n// WEBPACK FOOTER //\n// ./routes/auth-routes.js","const logger = require('winston');\nconst multipart = require('connect-multiparty');\nconst { files, site } = require('../config/speechConfig.js');\nconst multipartMiddleware = multipart({uploadDir: files.uploadDirectory});\nconst db = require('../models');\nconst { claimNameIsAvailable, checkChannelAvailability, publish } = require('../controllers/publishController.js');\nconst { getClaimList, resolveUri, getClaim } = require('../helpers/lbryApi.js');\nconst { addGetResultsToFileData, createBasicPublishParams, createThumbnailPublishParams, parsePublishApiRequestBody, parsePublishApiRequestFiles, createFileData } = require('../helpers/publishHelpers.js');\nconst errorHandlers = require('../helpers/errorHandlers.js');\nconst { sendGATimingEvent } = require('../helpers/googleAnalytics.js');\nconst { authenticateUser } = require('../auth/authentication.js');\nconst { getChannelData, getChannelClaims, getClaimId } = require('../controllers/serveController.js');\n\nconst NO_CHANNEL = 'NO_CHANNEL';\nconst NO_CLAIM = 'NO_CLAIM';\n\nmodule.exports = (app) => {\n // route to check whether site has published to a channel\n app.get('/api/channel/availability/:name', ({ ip, originalUrl, params }, res) => {\n checkChannelAvailability(params.name)\n .then(result => {\n if (result === true) {\n res.status(200).json(true);\n } else {\n res.status(200).json(false);\n }\n })\n .catch(error => {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n // route to get a short channel id from long channel Id\n app.get('/api/channel/short-id/:longId/:name', ({ ip, originalUrl, params }, res) => {\n db.Certificate.getShortChannelIdFromLongChannelId(params.longId, params.name)\n .then(shortId => {\n res.status(200).json(shortId);\n })\n .catch(error => {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n app.get('/api/channel/data/:channelName/:channelClaimId', ({ ip, originalUrl, body, params }, res) => {\n const channelName = params.channelName;\n let channelClaimId = params.channelClaimId;\n if (channelClaimId === 'none') channelClaimId = null;\n getChannelData(channelName, channelClaimId, 0)\n .then(data => {\n if (data === NO_CHANNEL) {\n return res.status(404).json({success: false, message: 'No matching channel was found'});\n }\n res.status(200).json({success: true, data});\n })\n .catch(error => {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n app.get('/api/channel/claims/:channelName/:channelClaimId/:page', ({ ip, originalUrl, body, params }, res) => {\n const channelName = params.channelName;\n let channelClaimId = params.channelClaimId;\n if (channelClaimId === 'none') channelClaimId = null;\n const page = params.page;\n getChannelClaims(channelName, channelClaimId, page)\n .then(data => {\n if (data === NO_CHANNEL) {\n return res.status(404).json({success: false, message: 'No matching channel was found'});\n }\n res.status(200).json({success: true, data});\n })\n .catch(error => {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n // route to run a claim_list request on the daemon\n app.get('/api/claim/list/:name', ({ ip, originalUrl, params }, res) => {\n getClaimList(params.name)\n .then(claimsList => {\n res.status(200).json(claimsList);\n })\n .catch(error => {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n // route to get an asset\n app.get('/api/claim/get/:name/:claimId', ({ ip, originalUrl, params }, res) => {\n const name = params.name;\n const claimId = params.claimId;\n // resolve the claim\n db.Claim.resolveClaim(name, claimId)\n .then(resolveResult => {\n // make sure a claim actually exists at that uri\n if (!resolveResult) {\n throw new Error('No matching uri found in Claim table');\n }\n let fileData = createFileData(resolveResult);\n // get the claim\n return Promise.all([fileData, getClaim(`${name}#${claimId}`)]);\n })\n .then(([ fileData, getResult ]) => {\n fileData = addGetResultsToFileData(fileData, getResult);\n return Promise.all([db.upsert(db.File, fileData, {name, claimId}, 'File'), getResult]);\n })\n .then(([ fileRecord, {message, completed} ]) => {\n res.status(200).json({ success: true, message, completed });\n })\n .catch(error => {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n // route to check whether this site published to a claim\n app.get('/api/claim/availability/:name', ({ ip, originalUrl, params }, res) => {\n claimNameIsAvailable(params.name)\n .then(result => {\n res.status(200).json(result);\n })\n .catch(error => {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n // route to run a resolve request on the daemon\n app.get('/api/claim/resolve/:name/:claimId', ({ headers, ip, originalUrl, params }, res) => {\n resolveUri(`${params.name}#${params.claimId}`)\n .then(resolvedUri => {\n res.status(200).json(resolvedUri);\n })\n .catch(error => {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n // route to run a publish request on the daemon\n app.post('/api/claim/publish', multipartMiddleware, ({ body, files, headers, ip, originalUrl, user }, res) => {\n logger.debug('api/claim/publish req.body:', body);\n logger.debug('api/claim/publish req.files:', files);\n // define variables\n let channelName, channelId, channelPassword, description, fileName, filePath, fileType, gaStartTime, license, name, nsfw, thumbnail, thumbnailFileName, thumbnailFilePath, thumbnailFileType, title;\n // record the start time of the request\n gaStartTime = Date.now();\n // validate the body and files of the request\n try {\n // validateApiPublishRequest(body, files);\n ({name, nsfw, license, title, description, thumbnail} = parsePublishApiRequestBody(body));\n ({fileName, filePath, fileType, thumbnailFileName, thumbnailFilePath, thumbnailFileType} = parsePublishApiRequestFiles(files));\n ({channelName, channelId, channelPassword} = body);\n } catch (error) {\n return res.status(400).json({success: false, message: error.message});\n }\n // check channel authorization\n Promise.all([\n authenticateUser(channelName, channelId, channelPassword, user),\n claimNameIsAvailable(name),\n createBasicPublishParams(filePath, name, title, description, license, nsfw, thumbnail),\n createThumbnailPublishParams(thumbnailFilePath, name, license, nsfw),\n ])\n .then(([{channelName, channelClaimId}, validatedClaimName, publishParams, thumbnailPublishParams]) => {\n // add channel details to the publish params\n if (channelName && channelClaimId) {\n publishParams['channel_name'] = channelName;\n publishParams['channel_id'] = channelClaimId;\n }\n // publish the thumbnail\n if (thumbnailPublishParams) {\n publish(thumbnailPublishParams, thumbnailFileName, thumbnailFileType);\n }\n // publish the asset\n return publish(publishParams, fileName, fileType);\n })\n .then(result => {\n res.status(200).json({\n success: true,\n message: 'publish completed successfully',\n data : {\n name,\n claimId: result.claim_id,\n url : `${site.host}/${result.claim_id}/${name}`,\n lbryTx : result,\n },\n });\n // record the publish end time and send to google analytics\n sendGATimingEvent('end-to-end', 'publish', fileType, gaStartTime, Date.now());\n })\n .catch(error => {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n // route to get a short claim id from long claim Id\n app.get('/api/claim/short-id/:longId/:name', ({ ip, originalUrl, body, params }, res) => {\n db.Claim.getShortClaimIdFromLongClaimId(params.longId, params.name)\n .then(shortId => {\n res.status(200).json({success: true, data: shortId});\n })\n .catch(error => {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n app.post('/api/claim/long-id', ({ ip, originalUrl, body, params }, res) => {\n logger.debug('body:', body);\n const channelName = body.channelName;\n const channelClaimId = body.channelClaimId;\n const claimName = body.claimName;\n const claimId = body.claimId;\n getClaimId(channelName, channelClaimId, claimName, claimId)\n .then(result => {\n if (result === NO_CHANNEL) {\n return res.status(404).json({success: false, message: 'No matching channel could be found'});\n }\n if (result === NO_CLAIM) {\n return res.status(404).json({success: false, message: 'No matching claim id could be found'});\n }\n res.status(200).json({success: true, data: result});\n })\n .catch(error => {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n app.get('/api/claim/data/:claimName/:claimId', ({ ip, originalUrl, body, params }, res) => {\n const claimName = params.claimName;\n let claimId = params.claimId;\n if (claimId === 'none') claimId = null;\n db.Claim.resolveClaim(claimName, claimId)\n .then(claimInfo => {\n if (!claimInfo) {\n return res.status(404).json({success: false, message: 'No claim could be found'});\n }\n res.status(200).json({success: true, data: claimInfo});\n })\n .catch(error => {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n // route to see if asset is available locally\n app.get('/api/file/availability/:name/:claimId', ({ ip, originalUrl, params }, res) => {\n const name = params.name;\n const claimId = params.claimId;\n db.File.findOne({where: {name, claimId}})\n .then(result => {\n if (result) {\n return res.status(200).json({success: true, data: true});\n }\n res.status(200).json({success: true, data: false});\n })\n .catch(error => {\n errorHandlers.handleErrorResponse(originalUrl, ip, error, res);\n });\n });\n};\n\n\n\n// WEBPACK FOOTER //\n// ./routes/api-routes.js","module.exports = require(\"connect-multiparty\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"connect-multiparty\"\n// module id = 72\n// module chunks = 0","const logger = require('winston');\nconst db = require('../models');\nconst lbryApi = require('../helpers/lbryApi.js');\nconst publishHelpers = require('../helpers/publishHelpers.js');\nconst config = require('../config/speechConfig.js');\n\nmodule.exports = {\n publish (publishParams, fileName, fileType) {\n return new Promise((resolve, reject) => {\n let publishResults, certificateId, channelName;\n // publish the file\n return lbryApi.publishClaim(publishParams)\n .then(tx => {\n logger.info(`Successfully published ${publishParams.name} ${fileName}`, tx);\n publishResults = tx;\n // get the channel information\n if (publishParams.channel_name) {\n logger.debug(`this claim was published in channel: ${publishParams.channel_name}`);\n return db.Channel.findOne({where: {channelName: publishParams.channel_name}});\n } else {\n logger.debug('this claim was not published in a channel');\n return null;\n }\n })\n .then(channel => {\n // set channel information\n certificateId = null;\n channelName = null;\n if (channel) {\n certificateId = channel.channelClaimId;\n channelName = channel.channelName;\n }\n logger.debug(`certificateId: ${certificateId}`);\n })\n .then(() => {\n // create the File record\n const fileRecord = {\n name : publishParams.name,\n claimId : publishResults.claim_id,\n title : publishParams.metadata.title,\n description: publishParams.metadata.description,\n address : publishParams.claim_address,\n outpoint : `${publishResults.txid}:${publishResults.nout}`,\n height : 0,\n fileName,\n filePath : publishParams.file_path,\n fileType,\n nsfw : publishParams.metadata.nsfw,\n };\n // create the Claim record\n const claimRecord = {\n name : publishParams.name,\n claimId : publishResults.claim_id,\n title : publishParams.metadata.title,\n description: publishParams.metadata.description,\n address : publishParams.claim_address,\n thumbnail : publishParams.metadata.thumbnail,\n outpoint : `${publishResults.txid}:${publishResults.nout}`,\n height : 0,\n contentType: fileType,\n nsfw : publishParams.metadata.nsfw,\n amount : publishParams.bid,\n certificateId,\n channelName,\n };\n // upsert criteria\n const upsertCriteria = {\n name : publishParams.name,\n claimId: publishResults.claim_id,\n };\n // upsert the records\n return Promise.all([db.upsert(db.File, fileRecord, upsertCriteria, 'File'), db.upsert(db.Claim, claimRecord, upsertCriteria, 'Claim')]);\n })\n .then(([file, claim]) => {\n logger.debug('File and Claim records successfully created');\n return Promise.all([file.setClaim(claim), claim.setFile(file)]);\n })\n .then(() => {\n logger.debug('File and Claim records successfully associated');\n resolve(publishResults); // resolve the promise with the result from lbryApi.publishClaim;\n })\n .catch(error => {\n logger.error('PUBLISH ERROR', error);\n publishHelpers.deleteTemporaryFile(publishParams.file_path); // delete the local file\n reject(error);\n });\n });\n },\n claimNameIsAvailable (name) {\n // find any records where the name is used\n return db.File.findAll({ where: { name } })\n .then(result => {\n if (result.length >= 1) {\n const claimAddress = config.wallet.lbryClaimAddress;\n // filter out any results that were not published from spee.ch's wallet address\n const filteredResult = result.filter((claim) => {\n return (claim.address === claimAddress);\n });\n // return based on whether any non-spee.ch claims were left\n if (filteredResult.length >= 1) {\n throw new Error('That claim is already in use');\n };\n return name;\n };\n return name;\n });\n },\n checkChannelAvailability (name) {\n return new Promise((resolve, reject) => {\n // find any records where the name is used\n db.Channel.findAll({ where: { channelName: name } })\n .then(result => {\n if (result.length >= 1) {\n return resolve(false);\n }\n resolve(true);\n })\n .catch(error => {\n reject(error);\n });\n });\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./controllers/publishController.js","module.exports = require(\"fs\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"fs\"\n// module id = 74\n// module chunks = 0","const db = require('../models');\nconst logger = require('winston');\n\nmodule.exports = {\n authenticateUser (channelName, channelId, channelPassword, user) {\n // case: no channelName or channel Id are provided (anonymous), regardless of whether user token is provided\n if (!channelName && !channelId) {\n return {\n channelName : null,\n channelClaimId: null,\n };\n }\n // case: channelName or channel Id are provided with user token\n if (user) {\n if (channelName && channelName !== user.channelName) {\n throw new Error('the provided channel name does not match user credentials');\n }\n if (channelId && channelId !== user.channelClaimId) {\n throw new Error('the provided channel id does not match user credentials');\n }\n return {\n channelName : user.channelName,\n channelClaimId: user.channelClaimId,\n };\n }\n // case: channelName or channel Id are provided with password instead of user token\n if (!channelPassword) throw new Error('no channel password provided');\n return module.exports.authenticateChannelCredentials(channelName, channelId, channelPassword);\n },\n authenticateChannelCredentials (channelName, channelId, userPassword) {\n return new Promise((resolve, reject) => {\n // hoisted variables\n let channelData;\n // build the params for finding the channel\n let channelFindParams = {};\n if (channelName) channelFindParams['channelName'] = channelName;\n if (channelId) channelFindParams['channelClaimId'] = channelId;\n // find the channel\n db.Channel\n .findOne({\n where: channelFindParams,\n })\n .then(channel => {\n if (!channel) {\n logger.debug('no channel found');\n throw new Error('Authentication failed, you do not have access to that channel');\n }\n channelData = channel.get();\n logger.debug('channel data:', channelData);\n return db.User.findOne({\n where: { userName: channelData.channelName.substring(1) },\n });\n })\n .then(user => {\n if (!user) {\n logger.debug('no user found');\n throw new Error('Authentication failed, you do not have access to that channel');\n }\n return user.comparePassword(userPassword);\n })\n .then(isMatch => {\n if (!isMatch) {\n logger.debug('incorrect password');\n throw new Error('Authentication failed, you do not have access to that channel');\n }\n logger.debug('...password was a match...');\n resolve(channelData);\n })\n .catch(error => {\n reject(error);\n });\n });\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./auth/authentication.js","const CLAIMS_PER_PAGE = 12;\n\nmodule.exports = {\n returnPaginatedChannelClaims (channelName, longChannelClaimId, claims, page) {\n const totalPages = module.exports.determineTotalPages(claims);\n const paginationPage = module.exports.getPageFromQuery(page);\n const viewData = {\n channelName : channelName,\n longChannelClaimId: longChannelClaimId,\n claims : module.exports.extractPageFromClaims(claims, paginationPage),\n previousPage : module.exports.determinePreviousPage(paginationPage),\n currentPage : paginationPage,\n nextPage : module.exports.determineNextPage(totalPages, paginationPage),\n totalPages : totalPages,\n totalResults : module.exports.determineTotalClaims(claims),\n };\n return viewData;\n },\n getPageFromQuery (page) {\n if (page) {\n return parseInt(page);\n }\n return 1;\n },\n extractPageFromClaims (claims, pageNumber) {\n if (!claims) {\n return []; // if no claims, return this default\n }\n // logger.debug('claims is array?', Array.isArray(claims));\n // logger.debug(`pageNumber ${pageNumber} is number?`, Number.isInteger(pageNumber));\n const claimStartIndex = (pageNumber - 1) * CLAIMS_PER_PAGE;\n const claimEndIndex = claimStartIndex + CLAIMS_PER_PAGE;\n const pageOfClaims = claims.slice(claimStartIndex, claimEndIndex);\n return pageOfClaims;\n },\n determineTotalPages (claims) {\n if (!claims) {\n return 0;\n } else {\n const totalClaims = claims.length;\n if (totalClaims < CLAIMS_PER_PAGE) {\n return 1;\n }\n const fullPages = Math.floor(totalClaims / CLAIMS_PER_PAGE);\n const remainder = totalClaims % CLAIMS_PER_PAGE;\n if (remainder === 0) {\n return fullPages;\n }\n return fullPages + 1;\n }\n },\n determinePreviousPage (currentPage) {\n if (currentPage === 1) {\n return null;\n }\n return currentPage - 1;\n },\n determineNextPage (totalPages, currentPage) {\n if (currentPage === totalPages) {\n return null;\n }\n return currentPage + 1;\n },\n determineTotalClaims (claims) {\n if (!claims) {\n return 0;\n }\n return claims.length;\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./helpers/channelPagination.js","const { site } = require('../config/speechConfig.js');\nconst handlePageRender = require('../helpers/handlePageRender.jsx');\n\nmodule.exports = (app) => {\n // route for the home page\n app.get('/', (req, res) => {\n handlePageRender(req, res);\n });\n // route to display login page\n app.get('/login', (req, res) => {\n handlePageRender(req, res);\n });\n // route to show 'about' page\n app.get('/about', (req, res) => {\n handlePageRender(req, res);\n });\n // route to display a list of the trending images\n app.get('/trending', (req, res) => {\n res.status(301).redirect('/popular');\n });\n app.get('/popular', (req, res) => {\n handlePageRender(req, res);\n });\n // route to display a list of the trending images\n app.get('/new', (req, res) => {\n handlePageRender(req, res);\n });\n // route to send embedable video player (for twitter)\n app.get('/embed/:claimId/:name', ({ params }, res) => {\n const claimId = params.claimId;\n const name = params.name;\n const host = site.host;\n // get and render the content\n res.status(200).render('embed', { layout: 'embed', host, claimId, name });\n });\n};\n\n\n\n// WEBPACK FOOTER //\n// ./routes/page-routes.js","import * as actions from 'constants/publish_action_types';\nimport { LOGIN } from 'constants/publish_channel_select_states';\nconst { publish } = require('../../config/speechConfig.js');\n\nconst initialState = {\n publishInChannel : false,\n selectedChannel : LOGIN,\n showMetadataInputs: false,\n status : {\n status : null,\n message: null,\n },\n error: {\n file : null,\n url : null,\n channel : null,\n publishSubmit: null,\n },\n file : null,\n claim : '',\n metadata: {\n title : '',\n description: '',\n license : '',\n nsfw : false,\n },\n thumbnailChannel : publish.thumbnailChannel,\n thumbnailChannelId: publish.thumbnailChannelId,\n thumbnail : null,\n};\n\nexport default function (state = initialState, action) {\n switch (action.type) {\n case actions.FILE_SELECTED:\n return Object.assign({}, initialState, { // note: clears to initial state\n file: action.data,\n });\n case actions.FILE_CLEAR:\n return initialState;\n case actions.METADATA_UPDATE:\n return Object.assign({}, state, {\n metadata: Object.assign({}, state.metadata, {\n [action.data.name]: action.data.value,\n }),\n });\n case actions.CLAIM_UPDATE:\n return Object.assign({}, state, {\n claim: action.data,\n });\n case actions.SET_PUBLISH_IN_CHANNEL:\n return Object.assign({}, state, {\n publishInChannel: action.channel,\n });\n case actions.PUBLISH_STATUS_UPDATE:\n return Object.assign({}, state, {\n status: action.data,\n });\n case actions.ERROR_UPDATE:\n return Object.assign({}, state, {\n error: Object.assign({}, state.error, {\n [action.data.name]: action.data.value,\n }),\n });\n case actions.SELECTED_CHANNEL_UPDATE:\n return Object.assign({}, state, {\n selectedChannel: action.data,\n });\n case actions.TOGGLE_METADATA_INPUTS:\n return Object.assign({}, state, {\n showMetadataInputs: action.data,\n });\n case actions.THUMBNAIL_NEW:\n return Object.assign({}, state, {\n thumbnail: action.data,\n });\n default:\n return state;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./react/reducers/publish.js","import * as actions from 'constants/channel_action_types';\n\nconst initialState = {\n loggedInChannel: {\n name : null,\n shortId: null,\n longId : null,\n },\n};\n\nexport default function (state = initialState, action) {\n switch (action.type) {\n case actions.CHANNEL_UPDATE:\n return Object.assign({}, state, {\n loggedInChannel: action.data,\n });\n default:\n return state;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./react/reducers/channel.js","import * as actions from 'constants/show_action_types';\nimport { LOCAL_CHECK, ERROR } from 'constants/asset_display_states';\n\nconst initialState = {\n request: {\n error: null,\n type : null,\n id : null,\n },\n requestList : {},\n channelList : {},\n assetList : {},\n displayAsset: {\n error : null,\n status: LOCAL_CHECK,\n },\n};\n\nexport default function (state = initialState, action) {\n switch (action.type) {\n // handle request\n case actions.REQUEST_ERROR:\n return Object.assign({}, state, {\n request: Object.assign({}, state.request, {\n error: action.data,\n }),\n });\n case actions.REQUEST_UPDATE:\n return Object.assign({}, state, {\n request: Object.assign({}, state.request, {\n type: action.data.requestType,\n id : action.data.requestId,\n }),\n });\n // store requests\n case actions.REQUEST_LIST_ADD:\n return Object.assign({}, state, {\n requestList: Object.assign({}, state.requestList, {\n [action.data.id]: {\n error: action.data.error,\n key : action.data.key,\n },\n }),\n });\n // asset data\n case actions.ASSET_ADD:\n return Object.assign({}, state, {\n assetList: Object.assign({}, state.assetList, {\n [action.data.id]: {\n error : action.data.error,\n name : action.data.name,\n claimId : action.data.claimId,\n shortId : action.data.shortId,\n claimData: action.data.claimData,\n },\n }),\n });\n // channel data\n case actions.CHANNEL_ADD:\n return Object.assign({}, state, {\n channelList: Object.assign({}, state.channelList, {\n [action.data.id]: {\n name : action.data.name,\n longId : action.data.longId,\n shortId : action.data.shortId,\n claimsData: action.data.claimsData,\n },\n }),\n });\n case actions.CHANNEL_CLAIMS_UPDATE_SUCCESS:\n return Object.assign({}, state, {\n channelList: Object.assign({}, state.channelList, {\n [action.data.channelListId]: Object.assign({}, state.channelList[action.data.channelListId], {\n claimsData: action.data.claimsData,\n }),\n }),\n });\n // display an asset\n case actions.FILE_AVAILABILITY_UPDATE:\n return Object.assign({}, state, {\n displayAsset: Object.assign({}, state.displayAsset, {\n status: action.data,\n }),\n });\n case actions.DISPLAY_ASSET_ERROR:\n return Object.assign({}, state, {\n displayAsset: Object.assign({}, state.displayAsset, {\n error : action.data,\n status: ERROR,\n }),\n });\n default:\n return state;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./react/reducers/show.js","const { site } = require('../../config/speechConfig.js');\n\nconst initialState = {\n host: site.host,\n};\n\nexport default function (state = initialState, action) {\n switch (action.type) {\n default:\n return state;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./react/reducers/site.js","module.exports = require(\"react-ga\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"react-ga\"\n// module id = 82\n// module chunks = 0","import React from 'react';\nimport SEO from 'components/SEO';\nimport NavBar from 'containers/NavBar';\nimport PublishTool from 'containers/PublishTool';\n\nclass HomePage extends React.Component {\n render () {\n return (\n
\n \n \n
\n \n
\n
\n );\n }\n};\n\nexport default HomePage;\n\n\n\n// WEBPACK FOOTER //\n// ./react/components/HomePage/index.jsx","const { site: { title: siteTitle } } = require('../../config/speechConfig.js');\n\nexport const createPageTitle = (pageTitle) => {\n if (!pageTitle) {\n return `${siteTitle}`;\n }\n return `${siteTitle} - ${pageTitle}`;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./react/utils/pageTitle.js","const { site: { title, host, description }, claim: { defaultThumbnail, defaultDescription } } = require('../../config/speechConfig.js');\n\nconst determineOgThumbnailContentType = (thumbnail) => {\n if (thumbnail) {\n const fileExt = thumbnail.substring(thumbnail.lastIndexOf('.'));\n switch (fileExt) {\n case 'jpeg':\n case 'jpg':\n return 'image/jpeg';\n case 'png':\n return 'image/png';\n case 'gif':\n return 'image/gif';\n case 'mp4':\n return 'video/mp4';\n default:\n return 'image/jpeg';\n }\n }\n return '';\n};\n\nconst createBasicMetaTags = () => {\n return [\n {property: 'og:title', content: title},\n {property: 'og:url', content: host},\n {property: 'og:site_name', content: title},\n {property: 'og:description', content: description},\n {property: 'twitter:site', content: '@spee_ch'},\n {property: 'twitter:card', content: 'summary'},\n ];\n};\n\nconst createChannelMetaTags = (channel) => {\n const { name, longId } = channel;\n return [\n {property: 'og:title', content: `${name} on ${title}`},\n {property: 'og:url', content: `${host}/${name}:${longId}`},\n {property: 'og:site_name', content: title},\n {property: 'og:description', content: `${name}, a channel on ${title}`},\n {property: 'twitter:site', content: '@spee_ch'},\n {property: 'twitter:card', content: 'summary'},\n ];\n};\n\nconst createAssetMetaTags = (asset) => {\n const { claimData } = asset;\n const { contentType } = claimData;\n const embedUrl = `${host}/${claimData.claimId}/${claimData.name}`;\n const showUrl = `${host}/${claimData.claimId}/${claimData.name}`;\n const source = `${host}/${claimData.claimId}/${claimData.name}.${claimData.fileExt}`;\n const ogTitle = claimData.title || claimData.name;\n const ogDescription = claimData.description || defaultDescription;\n const ogThumbnailContentType = determineOgThumbnailContentType(claimData.thumbnail);\n const ogThumbnail = claimData.thumbnail || defaultThumbnail;\n const metaTags = [\n {property: 'og:title', content: ogTitle},\n {property: 'og:url', content: showUrl},\n {property: 'og:site_name', content: title},\n {property: 'og:description', content: ogDescription},\n {property: 'og:image:width', content: 600},\n {property: 'og:image:height', content: 315},\n {property: 'twitter:site', content: '@spee_ch'},\n ];\n if (contentType === 'video/mp4' || contentType === 'video/webm') {\n metaTags.push({property: 'og:video', content: source});\n metaTags.push({property: 'og:video:secure_url', content: source});\n metaTags.push({property: 'og:video:type', content: contentType});\n metaTags.push({property: 'og:image', content: ogThumbnail});\n metaTags.push({property: 'og:image:type', content: ogThumbnailContentType});\n metaTags.push({property: 'og:type', content: 'video'});\n metaTags.push({property: 'twitter:card', content: 'player'});\n metaTags.push({property: 'twitter:player', content: embedUrl});\n metaTags.push({property: 'twitter:player:width', content: 600});\n metaTags.push({property: 'twitter:text:player_width', content: 600});\n metaTags.push({property: 'twitter:player:height', content: 337});\n metaTags.push({property: 'twitter:player:stream', content: source});\n metaTags.push({property: 'twitter:player:stream:content_type', content: contentType});\n } else {\n metaTags.push({property: 'og:image', content: source});\n metaTags.push({property: 'og:image:type', content: contentType});\n metaTags.push({property: 'og:type', content: 'article'});\n metaTags.push({property: 'twitter:card', content: 'summary_large_image'});\n }\n return metaTags;\n};\n\nexport const createMetaTags = (asset, channel) => {\n if (asset) {\n return createAssetMetaTags(asset);\n };\n if (channel) {\n return createChannelMetaTags(channel);\n };\n return createBasicMetaTags();\n};\n\n\n\n// WEBPACK FOOTER //\n// ./react/utils/metaTags.js","const { site: { host } } = require('../../config/speechConfig.js');\n\nconst createBasicCanonicalLink = (page) => {\n if (!page) {\n return `${host}`;\n };\n return `${host}/${page}`;\n};\n\nconst createAssetCanonicalLink = (asset) => {\n let channelName, certificateId, name, claimId;\n if (asset.claimData) {\n ({ channelName, certificateId, name, claimId } = asset.claimData);\n };\n if (channelName) {\n return `${host}/${channelName}:${certificateId}/${name}`;\n };\n return `${host}/${claimId}/${name}`;\n};\n\nconst createChannelCanonicalLink = (channel) => {\n const { name, longId } = channel;\n return `${host}/${name}:${longId}`;\n};\n\nexport const createCanonicalLink = (asset, channel, page) => {\n if (asset) {\n return createAssetCanonicalLink(asset);\n }\n if (channel) {\n return createChannelCanonicalLink(channel);\n }\n if (page) {\n return createBasicCanonicalLink(page);\n }\n return createBasicCanonicalLink();\n};\n\n\n\n// WEBPACK FOOTER //\n// ./react/utils/canonicalLink.js","import React from 'react';\nimport { NavLink, withRouter } from 'react-router-dom';\nimport Logo from 'components/Logo';\nimport NavBarChannelDropdown from 'components/NavBarChannelOptionsDropdown';\nimport request from 'utils/request';\n\nconst VIEW = 'VIEW';\nconst LOGOUT = 'LOGOUT';\n\nclass NavBar extends React.Component {\n constructor (props) {\n super(props);\n this.checkForLoggedInUser = this.checkForLoggedInUser.bind(this);\n this.logoutUser = this.logoutUser.bind(this);\n this.handleSelection = this.handleSelection.bind(this);\n }\n componentDidMount () {\n // check to see if the user is already logged in\n this.checkForLoggedInUser();\n }\n checkForLoggedInUser () {\n const params = {credentials: 'include'};\n request('/user', params)\n .then(({ data }) => {\n this.props.onChannelLogin(data.channelName, data.shortChannelId, data.channelClaimId);\n })\n .catch(error => {\n console.log('/user error:', error.message);\n });\n }\n logoutUser () {\n const params = {credentials: 'include'};\n request('/logout', params)\n .then(() => {\n this.props.onChannelLogout();\n })\n .catch(error => {\n console.log('/logout error', error.message);\n });\n }\n handleSelection (event) {\n const value = event.target.selectedOptions[0].value;\n switch (value) {\n case LOGOUT:\n this.logoutUser();\n break;\n case VIEW:\n // redirect to channel page\n this.props.history.push(`/${this.props.channelName}:${this.props.channelLongId}`);\n break;\n default:\n break;\n }\n }\n render () {\n return (\n
\n
\n \n
\n Open-source, decentralized image and video sharing.\n
\n
\n Publish\n About\n { this.props.channelName ? (\n \n ) : (\n Channel\n )}\n
\n
\n
\n );\n }\n}\n\nexport default withRouter(NavBar);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/NavBar/view.jsx","import React from 'react';\nimport { Link } from 'react-router-dom';\n\nfunction Logo () {\n return (\n \n \n Logo\n Spee.ch logo\n \n \n \n Spee<h\n \n \n \n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default Logo;\n\n\n\n// WEBPACK FOOTER //\n// ./react/components/Logo/index.jsx","import React from 'react';\n\nfunction NavBarChannelDropdown ({ channelName, handleSelection, defaultSelection, VIEW, LOGOUT }) {\n return (\n \n );\n};\n\nexport default NavBarChannelDropdown;\n\n\n\n// WEBPACK FOOTER //\n// ./react/components/NavBarChannelOptionsDropdown/index.jsx","module.exports = require(\"cross-fetch/polyfill\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"cross-fetch/polyfill\"\n// module id = 90\n// module chunks = 0","import {connect} from 'react-redux';\nimport View from './view';\n\nconst mapStateToProps = ({ publish }) => {\n return {\n file : publish.file,\n status: publish.status.status,\n };\n};\n\nexport default connect(mapStateToProps, null)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/PublishTool/index.js","import React from 'react';\nimport Dropzone from 'containers/Dropzone';\nimport PublishDetails from 'containers/PublishDetails';\nimport PublishStatus from 'containers/PublishStatus';\n\nclass PublishTool extends React.Component {\n render () {\n if (this.props.file) {\n if (this.props.status) {\n return (\n \n );\n } else {\n return ;\n }\n } else {\n return ;\n }\n }\n};\n\nexport default PublishTool;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/PublishTool/view.jsx","import React from 'react';\nimport { validateFile } from 'utils/file';\nimport Preview from 'components/Preview';\n\nclass Dropzone extends React.Component {\n constructor (props) {\n super(props);\n this.state = {\n dragOver : false,\n mouseOver : false,\n dimPreview: false,\n };\n this.handleDrop = this.handleDrop.bind(this);\n this.handleDragOver = this.handleDragOver.bind(this);\n this.handleDragEnd = this.handleDragEnd.bind(this);\n this.handleDragEnter = this.handleDragEnter.bind(this);\n this.handleDragLeave = this.handleDragLeave.bind(this);\n this.handleMouseEnter = this.handleMouseEnter.bind(this);\n this.handleMouseLeave = this.handleMouseLeave.bind(this);\n this.handleClick = this.handleClick.bind(this);\n this.handleFileInput = this.handleFileInput.bind(this);\n this.chooseFile = this.chooseFile.bind(this);\n }\n handleDrop (event) {\n event.preventDefault();\n this.setState({dragOver: false});\n // if dropped items aren't files, reject them\n const dt = event.dataTransfer;\n if (dt.items) {\n if (dt.items[0].kind === 'file') {\n const droppedFile = dt.items[0].getAsFile();\n this.chooseFile(droppedFile);\n }\n }\n }\n handleDragOver (event) {\n event.preventDefault();\n }\n handleDragEnd (event) {\n var dt = event.dataTransfer;\n if (dt.items) {\n for (var i = 0; i < dt.items.length; i++) {\n dt.items.remove(i);\n }\n } else {\n event.dataTransfer.clearData();\n }\n }\n handleDragEnter () {\n this.setState({dragOver: true, dimPreview: true});\n }\n handleDragLeave () {\n this.setState({dragOver: false, dimPreview: false});\n }\n handleMouseEnter () {\n this.setState({mouseOver: true, dimPreview: true});\n }\n handleMouseLeave () {\n this.setState({mouseOver: false, dimPreview: false});\n }\n handleClick (event) {\n event.preventDefault();\n document.getElementById('file_input').click();\n }\n handleFileInput (event) {\n event.preventDefault();\n const fileList = event.target.files;\n this.chooseFile(fileList[0]);\n }\n chooseFile (file) {\n if (file) {\n try {\n validateFile(file); // validate the file's name, type, and size\n } catch (error) {\n return this.props.setFileError(error.message);\n }\n // stage it so it will be ready when the publish button is clicked\n this.props.selectFile(file);\n }\n }\n render () {\n return (\n
\n
\n \n
\n
\n {this.props.file ? (\n
\n \n
\n { this.state.dragOver ? (\n
\n

Drop it.

\n
\n ) : (\n null\n )}\n { this.state.mouseOver ? (\n
\n

{this.props.fileError}

\n

Drag & drop image or video here to publish

\n

OR

\n

CHOOSE FILE

\n
\n ) : (\n null\n )}\n
\n
\n ) : (\n
\n { this.state.dragOver ? (\n
\n

Drop it.

\n
\n ) : (\n
\n

{this.props.fileError}

\n

Drag & drop image or video here to publish

\n

OR

\n

CHOOSE FILE

\n
\n )}\n
\n )}\n
\n
\n );\n }\n};\n\nexport default Dropzone;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/Dropzone/view.jsx","module.exports = {\n validateFile (file) {\n if (!file) {\n throw new Error('no file provided');\n }\n if (/'/.test(file.name)) {\n throw new Error('apostrophes are not allowed in the file name');\n }\n // validate size and type\n switch (file.type) {\n case 'image/jpeg':\n case 'image/jpg':\n case 'image/png':\n if (file.size > 10000000) {\n throw new Error('Sorry, images are limited to 10 megabytes.');\n }\n break;\n case 'image/gif':\n if (file.size > 50000000) {\n throw new Error('Sorry, GIFs are limited to 50 megabytes.');\n }\n break;\n case 'video/mp4':\n if (file.size > 50000000) {\n throw new Error('Sorry, videos are limited to 50 megabytes.');\n }\n break;\n default:\n throw new Error(file.type + ' is not a supported file type. Only, .jpeg, .png, .gif, and .mp4 files are currently supported.');\n }\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./react/utils/file.js","import React from 'react';\nimport PropTypes from 'prop-types';\n\nclass Preview extends React.Component {\n constructor (props) {\n super(props);\n this.state = {\n imgSource : '',\n defaultThumbnail: '/assets/img/video_thumb_default.png',\n };\n }\n componentDidMount () {\n this.setPreviewImageSource(this.props.file);\n }\n componentWillReceiveProps (newProps) {\n if (newProps.file !== this.props.file) {\n this.setPreviewImageSource(newProps.file);\n }\n if (newProps.thumbnail !== this.props.thumbnail) {\n if (newProps.thumbnail) {\n this.setPreviewImageSourceFromFile(newProps.thumbnail);\n } else {\n this.setState({imgSource: this.state.defaultThumbnail});\n }\n }\n }\n setPreviewImageSourceFromFile (file) {\n const previewReader = new FileReader();\n previewReader.readAsDataURL(file);\n previewReader.onloadend = () => {\n this.setState({imgSource: previewReader.result});\n };\n }\n setPreviewImageSource (file) {\n if (file.type !== 'video/mp4') {\n this.setPreviewImageSourceFromFile(file);\n } else {\n if (this.props.thumbnail) {\n this.setPreviewImageSourceFromFile(this.props.thumbnail);\n }\n this.setState({imgSource: this.state.defaultThumbnail});\n }\n }\n render () {\n return (\n \n );\n }\n};\n\nPreview.propTypes = {\n dimPreview: PropTypes.bool.isRequired,\n file : PropTypes.object.isRequired,\n thumbnail : PropTypes.object,\n};\n\nexport default Preview;\n\n\n\n// WEBPACK FOOTER //\n// ./react/components/Preview/index.jsx","import {connect} from 'react-redux';\nimport {clearFile, startPublish} from 'actions/publish';\nimport View from './view';\n\nconst mapStateToProps = ({ channel, publish }) => {\n return {\n file: publish.file,\n };\n};\n\nconst mapDispatchToProps = {\n clearFile,\n startPublish,\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/PublishDetails/index.js","import React from 'react';\nimport { withRouter } from 'react-router-dom';\nimport Dropzone from 'containers/Dropzone';\nimport PublishTitleInput from 'containers/PublishTitleInput';\nimport PublishUrlInput from 'containers/PublishUrlInput';\nimport PublishThumbnailInput from 'containers/PublishThumbnailInput';\nimport PublishMetadataInputs from 'containers/PublishMetadataInputs';\nimport ChannelSelect from 'containers/ChannelSelect';\n\nclass PublishDetails extends React.Component {\n constructor (props) {\n super(props)\n this.onPublishSubmit = this.onPublishSubmit.bind(this);\n }\n onPublishSubmit () {\n this.props.startPublish(this.props.history);\n }\n render () {\n return (\n
\n
\n \n
\n {/* left column */}\n
\n
\n \n
\n
\n {/* right column */}\n
\n
\n
\n \n
\n
\n \n
\n { (this.props.file.type === 'video/mp4') && (\n
\n \n
\n )}\n
\n \n
\n
\n \n
\n
\n \n
\n
\n

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. Read more.

\n
\n
\n
\n
\n );\n }\n};\n\nexport default withRouter(PublishDetails);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/PublishDetails/view.jsx","import {connect} from 'react-redux';\nimport {updateMetadata} from 'actions/publish';\nimport View from './view';\n\nconst mapStateToProps = ({ publish }) => {\n return {\n title: publish.metadata.title,\n };\n};\n\nconst mapDispatchToProps = dispatch => {\n return {\n onMetadataChange: (name, value) => {\n dispatch(updateMetadata(name, value));\n },\n };\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/PublishTitleInput/index.js","import React from 'react';\n\nclass PublishTitleInput extends React.Component {\n constructor (props) {\n super(props);\n this.handleInput = this.handleInput.bind(this);\n }\n handleInput (e) {\n const name = e.target.name;\n const value = e.target.value;\n this.props.onMetadataChange(name, value);\n }\n render () {\n return (\n \n );\n }\n}\n\nexport default PublishTitleInput;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/PublishTitleInput/view.jsx","import {updateClaim, updateError} from 'actions/publish';\nimport {connect} from 'react-redux';\nimport View from './view';\n\nconst mapStateToProps = ({ channel, publish }) => {\n return {\n loggedInChannelName : channel.loggedInChannel.name,\n loggedInChannelShortId: channel.loggedInChannel.shortId,\n fileName : publish.file.name,\n publishInChannel : publish.publishInChannel,\n selectedChannel : publish.selectedChannel,\n claim : publish.claim,\n urlError : publish.error.url,\n };\n};\n\nconst mapDispatchToProps = dispatch => {\n return {\n onClaimChange: (value) => {\n dispatch(updateClaim(value));\n dispatch(updateError('publishSubmit', null));\n },\n onUrlError: (value) => {\n dispatch(updateError('url', value));\n },\n };\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/PublishUrlInput/index.js","import React from 'react';\nimport request from 'utils/request';\nimport UrlMiddle from 'components/PublishUrlMiddleDisplay';\n\nclass PublishUrlInput extends React.Component {\n constructor (props) {\n super(props);\n this.handleInput = this.handleInput.bind(this);\n }\n componentDidMount () {\n const { claim, fileName } = this.props;\n if (!claim) {\n this.setClaimName(fileName);\n }\n }\n componentWillReceiveProps ({ claim, fileName }) {\n // if a new file was chosen, update the claim name\n if (fileName !== this.props.fileName) {\n return this.setClaimName(fileName);\n }\n // if the claim has updated, check its availability\n if (claim !== this.props.claim) {\n this.validateClaim(claim);\n }\n }\n handleInput (event) {\n let value = event.target.value;\n value = this.cleanseInput(value);\n // update the state\n this.props.onClaimChange(value);\n }\n cleanseInput (input) {\n input = input.replace(/\\s+/g, '-'); // replace spaces with dashes\n input = input.replace(/[^A-Za-z0-9-]/g, ''); // remove all characters that are not A-Z, a-z, 0-9, or '-'\n return input;\n }\n setClaimName (fileName) {\n const fileNameWithoutEnding = fileName.substring(0, fileName.lastIndexOf('.'));\n const cleanClaimName = this.cleanseInput(fileNameWithoutEnding);\n this.props.onClaimChange(cleanClaimName);\n }\n validateClaim (claim) {\n if (!claim) {\n return this.props.onUrlError('Enter a url above');\n }\n request(`/api/claim/availability/${claim}`)\n .then(() => {\n this.props.onUrlError(null);\n })\n .catch((error) => {\n this.props.onUrlError(error.message);\n });\n }\n render () {\n const { claim, loggedInChannelName, loggedInChannelShortId, publishInChannel, selectedChannel, urlError } = this.props;\n return (\n
\n
\n spee.ch / \n \n \n { (claim && !urlError) && {'\\u2713'} }\n { urlError && {'\\u2716'} }\n
\n
\n { urlError ? (\n

{urlError}

\n ) : (\n

Choose a custom url

\n )}\n
\n
\n );\n }\n}\n\nexport default PublishUrlInput;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/PublishUrlInput/view.jsx","import React from 'react';\nimport PropTypes from 'prop-types';\n\nfunction UrlMiddle ({publishInChannel, selectedChannel, loggedInChannelName, loggedInChannelShortId}) {\n if (publishInChannel) {\n if (selectedChannel === loggedInChannelName) {\n return {loggedInChannelName}:{loggedInChannelShortId} /;\n }\n return @channelSelect a channel below /;\n }\n return (\n xyzThis will be a random id /\n );\n}\n\nUrlMiddle.propTypes = {\n publishInChannel : PropTypes.bool.isRequired,\n loggedInChannelName : PropTypes.string,\n loggedInChannelShortId: PropTypes.string,\n};\n\nexport default UrlMiddle;\n\n\n\n// WEBPACK FOOTER //\n// ./react/components/PublishUrlMiddleDisplay/index.jsx","import { connect } from 'react-redux';\nimport { onNewThumbnail } from 'actions/publish';\nimport View from './view';\n\nconst mapStateToProps = ({ publish: { file } }) => {\n return {\n file,\n };\n};\n\nconst mapDispatchToProps = {\n onNewThumbnail,\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/PublishThumbnailInput/index.js","import React from 'react';\n\nfunction dataURItoBlob(dataURI) {\n // convert base64/URLEncoded data component to raw binary data held in a string\n let byteString = atob(dataURI.split(',')[1]);\n // separate out the mime component\n let mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];\n // write the bytes of the string to a typed array\n let ia = new Uint8Array(byteString.length);\n for (let i = 0; i < byteString.length; i++) {\n ia[i] = byteString.charCodeAt(i);\n }\n return new Blob([ia], {type: mimeString});\n}\n\nclass PublishThumbnailInput extends React.Component {\n constructor (props) {\n super(props);\n this.state = {\n videoSource : null,\n error : null,\n sliderMinRange: 1,\n sliderMaxRange: null,\n sliderValue : null,\n };\n this.handleVideoLoadedData = this.handleVideoLoadedData.bind(this);\n this.handleSliderChange = this.handleSliderChange.bind(this);\n this.createThumbnail = this.createThumbnail.bind(this);\n }\n componentDidMount () {\n const { file } = this.props;\n this.setVideoSource(file);\n }\n componentWillReceiveProps (nextProps) {\n // if file changes\n if (nextProps.file && nextProps.file !== this.props.file) {\n const { file } = nextProps;\n this.setVideoSource(file);\n };\n }\n setVideoSource (file) {\n const previewReader = new FileReader();\n previewReader.readAsDataURL(file);\n previewReader.onloadend = () => {\n const dataUri = previewReader.result;\n const blob = dataURItoBlob(dataUri);\n const videoSource = URL.createObjectURL(blob);\n this.setState({ videoSource });\n };\n }\n handleVideoLoadedData (event) {\n const duration = event.target.duration;\n const totalMinutes = Math.floor(duration / 60);\n const totalSeconds = Math.floor(duration % 60);\n // set the slider\n this.setState({\n sliderMaxRange: duration * 100,\n sliderValue : duration * 100 / 2,\n totalMinutes,\n totalSeconds,\n });\n // update the current time of the video\n let video = document.getElementById('video-thumb-player');\n video.currentTime = duration / 2;\n }\n handleSliderChange (event) {\n const value = parseInt(event.target.value);\n // update the slider value\n this.setState({\n sliderValue: value,\n });\n // update the current time of the video\n let video = document.getElementById('video-thumb-player');\n video.currentTime = value / 100;\n }\n createThumbnail () {\n // take a snapshot\n let video = document.getElementById('video-thumb-player');\n let canvas = document.createElement('canvas');\n canvas.width = video.videoWidth;\n canvas.height = video.videoHeight;\n canvas.getContext('2d').drawImage(video, 0, 0, canvas.width, canvas.height);\n const dataUrl = canvas.toDataURL();\n const blob = dataURItoBlob(dataUrl);\n const snapshot = new File([blob], `thumbnail.png`, {\n type: 'image/png',\n });\n // set the thumbnail in redux store\n if (snapshot) {\n this.props.onNewThumbnail(snapshot);\n }\n }\n render () {\n const { error, videoSource, sliderMinRange, sliderMaxRange, sliderValue, totalMinutes, totalSeconds } = this.state;\n return (\n
\n \n \n {\n sliderValue ? (\n
\n
\n 0'00\"\n {totalMinutes}'{totalSeconds}\"\n
\n
\n \n
\n
\n ) : (\n

loading...

\n )\n }\n { error ? (\n

{error}

\n ) : (\n

Use slider to set thumbnail

\n )}\n
\n );\n }\n}\n\nexport default PublishThumbnailInput;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/PublishThumbnailInput/view.jsx","import {connect} from 'react-redux';\nimport {updateMetadata, toggleMetadataInputs} from 'actions/publish';\nimport View from './view';\n\nconst mapStateToProps = ({ publish }) => {\n return {\n showMetadataInputs: publish.showMetadataInputs,\n description : publish.metadata.description,\n license : publish.metadata.license,\n nsfw : publish.metadata.nsfw,\n };\n};\n\nconst mapDispatchToProps = dispatch => {\n return {\n onMetadataChange: (name, value) => {\n dispatch(updateMetadata(name, value));\n },\n onToggleMetadataInputs: (value) => {\n dispatch(toggleMetadataInputs(value));\n },\n };\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/PublishMetadataInputs/index.js","import React from 'react';\nimport ExpandingTextArea from 'components/ExpandingTextArea';\n\nclass PublishMetadataInputs extends React.Component {\n constructor (props) {\n super(props);\n this.toggleShowInputs = this.toggleShowInputs.bind(this);\n this.handleInput = this.handleInput.bind(this);\n this.handleSelect = this.handleSelect.bind(this);\n }\n toggleShowInputs () {\n this.props.onToggleMetadataInputs(!this.props.showMetadataInputs);\n }\n handleInput (event) {\n const target = event.target;\n const value = target.type === 'checkbox' ? target.checked : target.value;\n const name = target.name;\n this.props.onMetadataChange(name, value);\n }\n handleSelect (event) {\n const name = event.target.name;\n const selectedOption = event.target.selectedOptions[0].value;\n this.props.onMetadataChange(name, selectedOption);\n }\n render () {\n return (\n
\n {this.props.showMetadataInputs && (\n
\n
\n
\n \n
\n \n
\n
\n\n
\n
\n \n
\n \n
\n
\n\n
\n
\n \n
\n \n
\n
\n
\n )}\n \n
\n );\n }\n}\n\nexport default PublishMetadataInputs;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/PublishMetadataInputs/view.jsx","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n\nclass ExpandingTextarea extends Component {\n constructor (props) {\n super(props);\n this._handleChange = this._handleChange.bind(this);\n }\n componentDidMount () {\n this.adjustTextarea({});\n }\n _handleChange (event) {\n const { onChange } = this.props;\n if (onChange) onChange(event);\n this.adjustTextarea(event);\n }\n adjustTextarea ({ target = this.el }) {\n target.style.height = 0;\n target.style.height = `${target.scrollHeight}px`;\n }\n render () {\n const { ...rest } = this.props;\n return (\n this.el = x}\n onChange={this._handleChange}\n />\n );\n }\n}\n\nExpandingTextarea.propTypes = {\n onChange: PropTypes.func,\n};\n\nexport default ExpandingTextarea;\n\n\n\n// WEBPACK FOOTER //\n// ./react/components/ExpandingTextArea/index.jsx","import {connect} from 'react-redux';\nimport {setPublishInChannel, updateSelectedChannel, updateError} from 'actions/publish';\nimport View from './view';\n\nconst mapStateToProps = ({ channel, publish }) => {\n return {\n loggedInChannelName: channel.loggedInChannel.name,\n publishInChannel : publish.publishInChannel,\n selectedChannel : publish.selectedChannel,\n channelError : publish.error.channel,\n };\n};\n\nconst mapDispatchToProps = dispatch => {\n return {\n onPublishInChannelChange: (value) => {\n dispatch(updateError('channel', null));\n dispatch(setPublishInChannel(value));\n },\n onChannelSelect: (value) => {\n dispatch(updateError('channel', null));\n dispatch(updateSelectedChannel(value));\n },\n };\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/ChannelSelect/index.js","import React from 'react';\nimport ChannelLoginForm from 'containers/ChannelLoginForm';\nimport ChannelCreateForm from 'containers/ChannelCreateForm';\nimport * as states from 'constants/publish_channel_select_states';\n\nclass ChannelSelect extends React.Component {\n constructor (props) {\n super(props);\n this.toggleAnonymousPublish = this.toggleAnonymousPublish.bind(this);\n this.handleSelection = this.handleSelection.bind(this);\n }\n toggleAnonymousPublish (event) {\n const value = event.target.value;\n if (value === 'anonymous') {\n this.props.onPublishInChannelChange(false);\n } else {\n this.props.onPublishInChannelChange(true);\n }\n }\n handleSelection (event) {\n const selectedOption = event.target.selectedOptions[0].value;\n this.props.onChannelSelect(selectedOption);\n }\n render () {\n return (\n
\n
\n
\n \n \n
\n
\n \n \n
\n { this.props.channelError ? (\n

{this.props.channelError}

\n ) : (\n

Publish anonymously or in a channel

\n )}\n
\n { this.props.publishInChannel && (\n
\n
\n \n
\n \n
\n { (this.props.selectedChannel === states.LOGIN) && }\n { (this.props.selectedChannel === states.CREATE) && }\n
\n )}\n
\n );\n }\n}\n\nexport default ChannelSelect;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/ChannelSelect/view.jsx","import React from 'react';\nimport request from 'utils/request';\n\nclass ChannelLoginForm extends React.Component {\n constructor (props) {\n super(props);\n this.state = {\n error : null,\n name : '',\n password: '',\n };\n this.handleInput = this.handleInput.bind(this);\n this.loginToChannel = this.loginToChannel.bind(this);\n }\n handleInput (event) {\n const name = event.target.name;\n const value = event.target.value;\n this.setState({[name]: value});\n }\n loginToChannel (event) {\n event.preventDefault();\n const params = {\n method : 'POST',\n body : JSON.stringify({username: this.state.name, password: this.state.password}),\n headers: new Headers({\n 'Content-Type': 'application/json',\n }),\n credentials: 'include',\n };\n request('login', params)\n .then(({success, channelName, shortChannelId, channelClaimId, message}) => {\n if (success) {\n this.props.onChannelLogin(channelName, shortChannelId, channelClaimId);\n } else {\n this.setState({'error': message});\n };\n })\n .catch(error => {\n if (error.message) {\n this.setState({'error': error.message});\n } else {\n this.setState({'error': error});\n }\n });\n }\n render () {\n return (\n
\n
\n
\n \n
\n
\n @\n \n
\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n { this.state.error ? (\n

{this.state.error}

\n ) : (\n

Enter the name and password for your channel

\n )}\n
\n \n
\n
\n );\n }\n}\n\nexport default ChannelLoginForm;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/ChannelLoginForm/view.jsx","import React from 'react';\nimport ProgressBar from 'components/ProgressBar';\nimport request from 'utils/request';\n\nclass ChannelCreateForm extends React.Component {\n constructor (props) {\n super(props);\n this.state = {\n error : null,\n channel : '',\n password: '',\n status : null,\n };\n this.handleChannelInput = this.handleChannelInput.bind(this);\n this.handleInput = this.handleInput.bind(this);\n this.createChannel = this.createChannel.bind(this);\n }\n cleanseChannelInput (input) {\n input = input.replace(/\\s+/g, '-'); // replace spaces with dashes\n input = input.replace(/[^A-Za-z0-9-]/g, ''); // remove all characters that are not A-Z, a-z, 0-9, or '-'\n return input;\n }\n handleChannelInput (event) {\n let value = event.target.value;\n value = this.cleanseChannelInput(value);\n this.setState({channel: value});\n if (value) {\n this.updateIsChannelAvailable(value);\n } else {\n this.setState({error: 'Please enter a channel name'});\n }\n }\n handleInput (event) {\n const name = event.target.name;\n const value = event.target.value;\n this.setState({[name]: value});\n }\n updateIsChannelAvailable (channel) {\n const channelWithAtSymbol = `@${channel}`;\n request(`/api/channel/availability/${channelWithAtSymbol}`)\n .then(isAvailable => {\n if (isAvailable) {\n this.setState({'error': null});\n } else {\n this.setState({'error': 'That channel has already been claimed'});\n }\n })\n .catch((error) => {\n this.setState({'error': error.message});\n });\n }\n checkIsChannelAvailable (channel) {\n const channelWithAtSymbol = `@${channel}`;\n return new Promise((resolve, reject) => {\n request(`/api/channel/availability/${channelWithAtSymbol}`)\n .then(isAvailable => {\n if (!isAvailable) {\n return reject(new Error('That channel has already been claimed'));\n }\n resolve();\n })\n .catch((error) => {\n reject(error);\n });\n });\n }\n checkIsPasswordProvided () {\n const password = this.state.password;\n return new Promise((resolve, reject) => {\n if (!password || password.length < 1) {\n return reject(new Error('Please provide a password'));\n }\n resolve();\n });\n }\n makePublishChannelRequest (username, password) {\n const params = {\n method : 'POST',\n body : JSON.stringify({username, password}),\n headers: new Headers({\n 'Content-Type': 'application/json',\n }),\n credentials: 'include',\n };\n return new Promise((resolve, reject) => {\n request('/signup', params)\n .then(result => {\n return resolve(result);\n })\n .catch(error => {\n reject(new Error(`Unfortunately, we encountered an error while creating your channel. Please let us know in Discord! ${error.message}`));\n });\n });\n }\n createChannel (event) {\n event.preventDefault();\n this.checkIsPasswordProvided()\n .then(() => {\n return this.checkIsChannelAvailable(this.state.channel, this.state.password);\n })\n .then(() => {\n this.setState({status: 'We are publishing your new channel. Sit tight...'});\n return this.makePublishChannelRequest(this.state.channel, this.state.password);\n })\n .then(result => {\n this.setState({status: null});\n this.props.onChannelLogin(result.channelName, result.shortChannelId, result.channelClaimId);\n })\n .catch((error) => {\n this.setState({'error': error.message, status: null});\n });\n }\n render () {\n return (\n
\n { !this.state.status ? (\n
\n
\n
\n \n
\n
\n @\n \n { (this.state.channel && !this.state.error) && {'\\u2713'} }\n { this.state.error && {'\\u2716'} }\n
\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n {this.state.error ? (\n

{this.state.error}

\n ) : (\n

Choose a name and password for your channel

\n )}\n
\n \n
\n
\n ) : (\n
\n

{this.state.status}

\n \n
\n )}\n
\n );\n }\n}\n\nexport default ChannelCreateForm;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/ChannelCreateForm/view.jsx","import React from 'react';\n\nconst ActiveStatusBar = () => {\n return | ;\n};\n\nexport default ActiveStatusBar;\n\n\n\n// WEBPACK FOOTER //\n// ./react/components/ActiveStatusBar/index.jsx","import React from 'react';\n\nconst InactiveStatusBar = () => {\n return | ;\n};\n\nexport default InactiveStatusBar;\n\n\n\n// WEBPACK FOOTER //\n// ./react/components/InactiveStatusBar/index.jsx","import {connect} from 'react-redux';\nimport {clearFile} from 'actions/publish';\nimport View from './view';\n\nconst mapStateToProps = ({ publish }) => {\n return {\n status : publish.status.status,\n message: publish.status.message,\n };\n};\n\nconst mapDispatchToProps = {\n clearFile,\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/PublishStatus/index.js","import React from 'react';\nimport ProgressBar from 'components/ProgressBar';\nimport * as publishStates from 'constants/publish_claim_states';\n\nclass PublishStatus extends React.Component {\n render () {\n const { status, message, clearFile } = this.props;\n return (\n
\n {status === publishStates.LOAD_START &&\n
\n

File is loading to server

\n

0%

\n
\n }\n {status === publishStates.LOADING &&\n
\n
\n

File is loading to server

\n

{message}

\n
\n
\n }\n {status === publishStates.PUBLISHING &&\n
\n

Upload complete. Your file is now being published on the blockchain...

\n \n

Curious what magic is happening here? Learn more.

\n
\n }\n {status === publishStates.SUCCESS &&\n
\n

Your publish is complete! You are being redirected to it now.

\n

If you are not automatically redirected, click here.

\n
\n }\n {status === publishStates.FAILED &&\n
\n

Something went wrong...

\n

{message}

\n

For help, post the above error text in the #speech channel on the lbry discord

\n \n
\n }\n
\n );\n }\n};\n\nexport default PublishStatus;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/PublishStatus/view.jsx","export const LOAD_START = 'LOAD_START';\nexport const LOADING = 'LOADING';\nexport const PUBLISHING = 'PUBLISHING';\nexport const SUCCESS = 'SUCCESS';\nexport const FAILED = 'FAILED';\n\n\n\n// WEBPACK FOOTER //\n// ./react/constants/publish_claim_states.js","import React from 'react';\nimport NavBar from 'containers/NavBar';\nimport SEO from 'components/SEO';\n\nclass AboutPage extends React.Component {\n render () {\n return (\n
\n \n \n
\n
\n
\n

Spee.ch is an open-source project. Please contribute to the existing site, or fork it and make your own.

\n

TWITTER

\n

GITHUB

\n

DISCORD CHANNEL

\n

DOCUMENTATION

\n
\n
\n
\n

Spee.ch is a media-hosting site that reads from and publishes content to the LBRY blockchain.

\n

Spee.ch is a hosting service, but with the added benefit that it stores your content on a decentralized network of computers -- the LBRY network. This means that your images are stored in multiple locations without a single point of failure.

\n

Contribute

\n

If you have an idea for your own spee.ch-like site on top of LBRY, fork our github repo and go to town!

\n

If you want to improve spee.ch, join our discord channel or solve one of our github issues.

\n
\n
\n
\n
\n );\n }\n};\n\nexport default AboutPage;\n\n\n\n// WEBPACK FOOTER //\n// ./react/components/AboutPage/index.jsx","import {connect} from 'react-redux';\nimport View from './view';\n\nconst mapStateToProps = ({ channel }) => {\n return {\n loggedInChannelName: channel.loggedInChannel.name,\n };\n};\n\nexport default connect(mapStateToProps, null)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/LoginPage/index.js","import React from 'react';\nimport { withRouter } from 'react-router-dom';\nimport SEO from 'components/SEO';\nimport NavBar from 'containers/NavBar';\nimport ChannelLoginForm from 'containers/ChannelLoginForm';\nimport ChannelCreateForm from 'containers/ChannelCreateForm';\n\nclass LoginPage extends React.Component {\n componentWillReceiveProps (newProps) {\n // re-route the user to the homepage if the user is logged in\n if (newProps.loggedInChannelName !== this.props.loggedInChannelName) {\n this.props.history.push(`/`);\n }\n }\n render () {\n return (\n
\n \n \n
\n
\n
\n

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 documenting important events, or making a public repository for cat gifs (password: '1234'), try creating a channel for it!

\n
\n
\n
\n

Log in to an existing channel:

\n \n

Create a brand new channel:

\n \n
\n
\n
\n
\n );\n }\n};\n\nexport default withRouter(LoginPage);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/LoginPage/view.jsx","import { connect } from 'react-redux';\nimport { onHandleShowPageUri } from 'actions/show';\nimport View from './view';\n\nconst mapStateToProps = ({ show }) => {\n return {\n error : show.request.error,\n requestType: show.request.type,\n };\n};\n\nconst mapDispatchToProps = {\n onHandleShowPageUri,\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/ShowPage/index.js","import React from 'react';\nimport ErrorPage from 'components/ErrorPage';\nimport ShowAssetLite from 'containers/ShowAssetLite';\nimport ShowAssetDetails from 'containers/ShowAssetDetails';\nimport ShowChannel from 'containers/ShowChannel';\n\nimport { CHANNEL, ASSET_LITE, ASSET_DETAILS } from 'constants/show_request_types';\n\nclass ShowPage extends React.Component {\n componentDidMount () {\n this.props.onHandleShowPageUri(this.props.match.params);\n }\n componentWillReceiveProps (nextProps) {\n if (nextProps.match.params !== this.props.match.params) {\n this.props.onHandleShowPageUri(nextProps.match.params);\n }\n }\n render () {\n const { error, requestType } = this.props;\n if (error) {\n return (\n \n );\n }\n switch (requestType) {\n case CHANNEL:\n return ;\n case ASSET_LITE:\n return ;\n case ASSET_DETAILS:\n return ;\n default:\n return

loading...

;\n }\n }\n};\n\nexport default ShowPage;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/ShowPage/view.jsx","import { connect } from 'react-redux';\nimport View from './view';\n\nconst mapStateToProps = ({ show }) => {\n // select request info\n const requestId = show.request.id;\n // select asset info\n let asset;\n const request = show.requestList[requestId] || null;\n const assetList = show.assetList;\n if (request && assetList) {\n const assetKey = request.key; // note: just store this in the request\n asset = assetList[assetKey] || null;\n };\n // return props\n return {\n asset,\n };\n};\n\nexport default connect(mapStateToProps, null)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/ShowAssetLite/index.js","import React from 'react';\nimport SEO from 'components/SEO';\nimport { Link } from 'react-router-dom';\nimport AssetDisplay from 'containers/AssetDisplay';\n\nclass ShowLite extends React.Component {\n render () {\n const { asset } = this.props;\n if (asset) {\n const { name, claimId } = asset.claimData;\n return (\n
\n \n \n hosted\n via Spee.ch\n
\n );\n }\n return (\n
\n

loading asset data...

\n
\n );\n }\n};\n\nexport default ShowLite;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/ShowAssetLite/view.jsx","import React from 'react';\nimport ProgressBar from 'components/ProgressBar';\nimport { LOCAL_CHECK, UNAVAILABLE, ERROR, AVAILABLE } from 'constants/asset_display_states';\n\nclass AssetDisplay extends React.Component {\n componentDidMount () {\n const { asset: { claimData: { name, claimId } } } = this.props;\n this.props.onFileRequest(name, claimId);\n }\n render () {\n const { status, error, asset: { claimData: { name, claimId, contentType, fileExt, thumbnail } } } = this.props;\n return (\n
\n {(status === LOCAL_CHECK) &&\n
\n

Checking to see if Spee.ch has your asset locally...

\n
\n }\n {(status === UNAVAILABLE) &&\n
\n

Sit tight, we're searching the LBRY blockchain for your asset!

\n \n

Curious what magic is happening here? Learn more.

\n
\n }\n {(status === ERROR) &&\n
\n

Unfortunately, we couldn't download your asset from LBRY. You can help us out by sharing the below error message in the LBRY discord.

\n

{error}

\n
\n }\n {(status === AVAILABLE) &&\n (() => {\n switch (contentType) {\n case 'image/jpeg':\n case 'image/jpg':\n case 'image/png':\n return (\n \n );\n case 'image/gif':\n return (\n \n );\n case 'video/mp4':\n return (\n \n );\n default:\n return (\n

Unsupported file type

\n );\n }\n })()\n }\n
\n );\n }\n};\n\nexport default AssetDisplay;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/AssetDisplay/view.jsx","import { connect } from 'react-redux';\nimport View from './view';\n\nconst mapStateToProps = ({ show }) => {\n // select request info\n const requestId = show.request.id;\n // select asset info\n let asset;\n const request = show.requestList[requestId] || null;\n const assetList = show.assetList;\n if (request && assetList) {\n const assetKey = request.key; // note: just store this in the request\n asset = assetList[assetKey] || null;\n };\n // return props\n return {\n asset,\n };\n};\n\nexport default connect(mapStateToProps, null)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/ShowAssetDetails/index.js","import React from 'react';\nimport SEO from 'components/SEO';\nimport NavBar from 'containers/NavBar';\nimport ErrorPage from 'components/ErrorPage';\nimport AssetTitle from 'containers/AssetTitle';\nimport AssetDisplay from 'containers/AssetDisplay';\nimport AssetInfo from 'containers/AssetInfo';\n\nclass ShowAssetDetails extends React.Component {\n render () {\n const { asset } = this.props;\n if (asset) {\n const { claimData: { name } } = asset;\n return (\n
\n \n \n
\n
\n \n
\n
\n
\n \n
\n
\n
\n \n
\n
\n
\n }\n
\n );\n };\n return (\n \n );\n }\n};\n\nexport default ShowAssetDetails;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/ShowAssetDetails/view.jsx","import { connect } from 'react-redux';\nimport View from './view';\nimport { selectAsset } from 'selectors/show';\n\nconst mapStateToProps = ({ show }) => {\n const { claimData: { title } } = selectAsset(show);\n return {\n title,\n };\n};\n\nexport default connect(mapStateToProps, null)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/AssetTitle/index.js","import React from 'react';\n\nconst AssetTitle = ({ title }) => {\n return (\n
\n {title}\n
\n );\n};\n\nexport default AssetTitle;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/AssetTitle/view.jsx","import { connect } from 'react-redux';\nimport View from './view';\nimport { selectAsset } from 'selectors/show';\n\nconst mapStateToProps = ({ show }) => {\n // select asset\n const asset = selectAsset(show);\n // return props\n return {\n asset,\n };\n};\n\nexport default connect(mapStateToProps, null)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/AssetInfo/index.js","import React from 'react';\nimport { Link } from 'react-router-dom';\n\nclass AssetInfo extends React.Component {\n constructor (props) {\n super(props);\n this.copyToClipboard = this.copyToClipboard.bind(this);\n }\n copyToClipboard (event) {\n var elementToCopy = event.target.dataset.elementtocopy;\n var element = document.getElementById(elementToCopy);\n element.select();\n try {\n document.execCommand('copy');\n } catch (err) {\n this.setState({error: 'Oops, unable to copy'});\n }\n }\n render () {\n const { asset: { shortId, claimData : { channelName, certificateId, description, name, claimId, fileExt, contentType, thumbnail, host } } } = this.props;\n return (\n
\n {channelName &&\n
\n
\n Channel:\n
\n
\n {channelName}\n
\n
\n }\n\n {description &&\n
\n {description}\n
\n }\n\n
\n
\n
\n Share:\n
\n
\n \n twitter\n facebook\n tumblr\n reddit\n
\n
\n
\n
\n\n
\n \n );\n }\n};\n\nexport default AssetInfo;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/AssetInfo/view.jsx","import { connect } from 'react-redux';\nimport View from './view';\n\nconst mapStateToProps = ({ show }) => {\n // select request info\n const requestId = show.request.id;\n // select request\n const previousRequest = show.requestList[requestId] || null;\n // select channel\n let channel;\n if (previousRequest) {\n const channelKey = previousRequest.key;\n channel = show.channelList[channelKey] || null;\n }\n return {\n channel,\n };\n};\n\nexport default connect(mapStateToProps, null)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/ShowChannel/index.js","import React from 'react';\nimport SEO from 'components/SEO';\nimport ErrorPage from 'components/ErrorPage';\nimport NavBar from 'containers/NavBar';\nimport ChannelClaimsDisplay from 'containers/ChannelClaimsDisplay';\n\nclass ShowChannel extends React.Component {\n render () {\n const { channel } = this.props;\n if (channel) {\n const { name, longId, shortId } = channel;\n return (\n
\n \n \n
\n
\n

channel name: {name}

\n

full channel id: {longId}

\n

short channel id: {shortId}

\n
\n
\n \n
\n
\n
\n );\n };\n return (\n \n );\n }\n};\n\nexport default ShowChannel;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/ShowChannel/view.jsx","import { connect } from 'react-redux';\nimport { onUpdateChannelClaims } from 'actions/show';\nimport View from './view';\n\nconst mapStateToProps = ({ show }) => {\n // select channel key\n const request = show.requestList[show.request.id];\n const channelKey = request.key;\n // select channel claims\n const channel = show.channelList[channelKey] || null;\n // return props\n return {\n channelKey,\n channel,\n };\n};\n\nconst mapDispatchToProps = {\n onUpdateChannelClaims,\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(View);\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/ChannelClaimsDisplay/index.js","import React from 'react';\nimport AssetPreview from 'components/AssetPreview';\n\nclass ChannelClaimsDisplay extends React.Component {\n constructor (props) {\n super(props);\n this.showNextResultsPage = this.showNextResultsPage.bind(this);\n this.showPreviousResultsPage = this.showPreviousResultsPage.bind(this);\n }\n showPreviousResultsPage () {\n const { channel: { claimsData: { currentPage } } } = this.props;\n const previousPage = parseInt(currentPage) - 1;\n this.showNewPage(previousPage);\n }\n showNextResultsPage () {\n const { channel: { claimsData: { currentPage } } } = this.props;\n const nextPage = parseInt(currentPage) + 1;\n this.showNewPage(nextPage);\n }\n showNewPage (page) {\n const { channelKey, channel: { name, longId } } = this.props;\n this.props.onUpdateChannelClaims(channelKey, name, longId, page);\n }\n render () {\n const { channel: { claimsData: { claims, currentPage, totalPages } } } = this.props;\n return (\n
\n {(claims.length > 0) ? (\n
\n {claims.map((claim, index) => )}\n
\n {(currentPage > 1) &&\n \n }\n {(currentPage < totalPages) &&\n \n }\n
\n
\n ) : (\n

There are no claims in this channel

\n )}\n
\n );\n }\n};\n\nexport default ChannelClaimsDisplay;\n\n\n\n// WEBPACK FOOTER //\n// ./react/containers/ChannelClaimsDisplay/view.jsx","import React from 'react';\nimport { Link } from 'react-router-dom';\nconst { claim: { defaultThumbnail } } = require('../../../config/speechConfig.js');\n\nconst AssetPreview = ({ claimData: { name, claimId, fileExt, contentType, thumbnail } }) => {\n const directSourceLink = `${claimId}/${name}.${fileExt}`;\n const showUrlLink = `/${claimId}/${name}`;\n return (\n
\n \n {(() => {\n switch (contentType) {\n case 'image/jpeg':\n case 'image/jpg':\n case 'image/png':\n case 'image/gif':\n return (\n \n );\n case 'video/mp4':\n return (\n \n );\n default:\n return (\n

unsupported file type

\n );\n }\n })()}\n \n
\n );\n};\n\nexport default AssetPreview;\n\n\n\n// WEBPACK FOOTER //\n// ./react/components/AssetPreview/index.jsx","import React from 'react';\nimport NavBar from 'containers/NavBar';\nimport Helmet from 'react-helmet';\nconst { site: { title, host } } = require('../../../config/speechConfig.js');\n\nclass FourOhForPage extends React.Component {\n render () {\n return (\n
\n \n {title} - 404\n \n \n \n
\n

404

\n

That page does not exist

\n
\n
\n );\n }\n};\n\nexport default FourOhForPage;\n\n\n\n// WEBPACK FOOTER //\n// ./react/components/FourOhFourPage/index.jsx","const { sendGAServeEvent } = require('../helpers/googleAnalytics');\nconst { determineResponseType, flipClaimNameAndIdForBackwardsCompatibility, logRequestData, getClaimIdAndServeAsset } = require('../helpers/serveHelpers.js');\nconst lbryUri = require('../helpers/lbryUri.js');\nconst handleShowRender = require('../helpers/handleShowRender.jsx');\nconst SERVE = 'SERVE';\n\nmodule.exports = (app) => {\n // route to serve a specific asset using the channel or claim id\n app.get('/:identifier/:claim', (req, res) => {\n const { headers, ip, originalUrl, params } = req;\n // decide if this is a show request\n let hasFileExtension;\n try {\n ({ hasFileExtension } = lbryUri.parseModifier(params.claim));\n } catch (error) {\n return res.status(400).json({success: false, message: error.message});\n }\n let responseType = determineResponseType(hasFileExtension, headers);\n if (responseType !== SERVE) {\n return handleShowRender(req, res);\n }\n // handle serve request\n // send google analytics\n sendGAServeEvent(headers, ip, originalUrl);\n // parse the claim\n let claimName;\n try {\n ({ claimName } = lbryUri.parseClaim(params.claim));\n } catch (error) {\n return res.status(400).json({success: false, message: error.message});\n }\n // parse the identifier\n let isChannel, channelName, channelClaimId, claimId;\n try {\n ({ isChannel, channelName, channelClaimId, claimId } = lbryUri.parseIdentifier(params.identifier));\n } catch (error) {\n return res.status(400).json({success: false, message: error.message});\n }\n if (!isChannel) {\n [claimId, claimName] = flipClaimNameAndIdForBackwardsCompatibility(claimId, claimName);\n }\n // log the request data for debugging\n logRequestData(responseType, claimName, channelName, claimId);\n // get the claim Id and then serve the asset\n getClaimIdAndServeAsset(channelName, channelClaimId, claimName, claimId, originalUrl, ip, res);\n });\n // route to serve the winning asset at a claim or a channel page\n app.get('/:claim', (req, res) => {\n const { headers, ip, originalUrl, params } = req;\n // decide if this is a show request\n let hasFileExtension;\n try {\n ({ hasFileExtension } = lbryUri.parseModifier(params.claim));\n } catch (error) {\n return res.status(400).json({success: false, message: error.message});\n }\n let responseType = determineResponseType(hasFileExtension, headers);\n if (responseType !== SERVE) {\n return handleShowRender(req, res);\n }\n // handle serve request\n // send google analytics\n sendGAServeEvent(headers, ip, originalUrl);\n // parse the claim\n let claimName;\n try {\n ({claimName} = lbryUri.parseClaim(params.claim));\n } catch (error) {\n return res.status(400).json({success: false, message: error.message});\n }\n // log the request data for debugging\n logRequestData(responseType, claimName, null, null);\n // get the claim Id and then serve the asset\n getClaimIdAndServeAsset(null, null, claimName, null, originalUrl, ip, res);\n });\n};\n\n\n\n// WEBPACK FOOTER //\n// ./routes/serve-routes.js","const logger = require('winston');\nconst { getClaimId, getLocalFileRecord } = require('../controllers/serveController.js');\nconst { handleErrorResponse } = require('../helpers/errorHandlers.js');\n\nconst SERVE = 'SERVE';\nconst SHOW = 'SHOW';\nconst NO_FILE = 'NO_FILE';\nconst NO_CHANNEL = 'NO_CHANNEL';\nconst NO_CLAIM = 'NO_CLAIM';\n\nfunction clientAcceptsHtml ({accept}) {\n return accept && accept.match(/text\\/html/);\n};\n\nfunction requestIsFromBrowser (headers) {\n return headers['user-agent'] && headers['user-agent'].match(/Mozilla/);\n};\n\nfunction clientWantsAsset ({accept, range}) {\n const imageIsWanted = accept && accept.match(/image\\/.*/) && !accept.match(/text\\/html/) && !accept.match(/text\\/\\*/);\n const videoIsWanted = accept && range;\n return imageIsWanted || videoIsWanted;\n};\n\nfunction isValidClaimId (claimId) {\n return ((claimId.length === 40) && !/[^A-Za-z0-9]/g.test(claimId));\n};\n\nfunction isValidShortId (claimId) {\n return claimId.length === 1; // it should really evaluate the short url itself\n};\n\nfunction isValidShortIdOrClaimId (input) {\n return (isValidClaimId(input) || isValidShortId(input));\n};\n\nfunction serveAssetToClient (claimId, name, res) {\n return getLocalFileRecord(claimId, name)\n .then(fileRecord => {\n // check that a local record was found\n if (fileRecord === NO_FILE) {\n return res.status(307).redirect(`/api/claim/get/${name}/${claimId}`);\n }\n // serve the file\n const {filePath, fileType} = fileRecord;\n logger.verbose(`serving file: ${filePath}`);\n const sendFileOptions = {\n headers: {\n 'X-Content-Type-Options': 'nosniff',\n 'Content-Type' : fileType || 'image/jpeg',\n },\n };\n res.status(200).sendFile(filePath, sendFileOptions);\n })\n .catch(error => {\n throw error;\n });\n};\n\nmodule.exports = {\n getClaimIdAndServeAsset (channelName, channelClaimId, claimName, claimId, originalUrl, ip, res) {\n // get the claim Id and then serve the asset\n getClaimId(channelName, channelClaimId, claimName, claimId)\n .then(fullClaimId => {\n if (fullClaimId === NO_CLAIM) {\n return res.status(404).json({success: false, message: 'no claim id could be found'});\n } else if (fullClaimId === NO_CHANNEL) {\n return res.status(404).json({success: false, message: 'no channel id could be found'});\n }\n serveAssetToClient(fullClaimId, claimName, res);\n // postToStats(responseType, originalUrl, ip, claimName, fullClaimId, 'success');\n })\n .catch(error => {\n handleErrorResponse(originalUrl, ip, error, res);\n // postToStats(responseType, originalUrl, ip, claimName, fullClaimId, 'fail');\n });\n },\n determineResponseType (hasFileExtension, headers) {\n let responseType;\n if (hasFileExtension) {\n responseType = SERVE; // assume a serve request if file extension is present\n if (clientAcceptsHtml(headers)) { // if the request comes from a browser, change it to a show request\n responseType = SHOW;\n }\n } else {\n responseType = SHOW;\n if (clientWantsAsset(headers) && requestIsFromBrowser(headers)) { // this is in case someone embeds a show url\n logger.debug('Show request came from browser but wants an image/video. Changing response to serve...');\n responseType = SERVE;\n }\n }\n return responseType;\n },\n flipClaimNameAndIdForBackwardsCompatibility (identifier, name) {\n // this is a patch for backwards compatability with '/name/claim_id' url format\n if (isValidShortIdOrClaimId(name) && !isValidShortIdOrClaimId(identifier)) {\n const tempName = name;\n name = identifier;\n identifier = tempName;\n }\n return [identifier, name];\n },\n logRequestData (responseType, claimName, channelName, claimId) {\n logger.debug('responseType ===', responseType);\n logger.debug('claim name === ', claimName);\n logger.debug('channel name ===', channelName);\n logger.debug('claim id ===', claimId);\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./helpers/serveHelpers.js","const logger = require('winston');\n\nmodule.exports = {\n REGEXP_INVALID_CLAIM : /[^A-Za-z0-9-]/g,\n REGEXP_INVALID_CHANNEL: /[^A-Za-z0-9-@]/g,\n REGEXP_ADDRESS : /^b(?=[^0OIl]{32,33})[0-9A-Za-z]{32,33}$/,\n CHANNEL_CHAR : '@',\n parseIdentifier : function (identifier) {\n logger.debug('parsing identifier:', identifier);\n const componentsRegex = new RegExp(\n '([^:$#/]*)' + // value (stops at the first separator or end)\n '([:$#]?)([^/]*)' // modifier separator, modifier (stops at the first path separator or end)\n );\n const [proto, value, modifierSeperator, modifier] = componentsRegex\n .exec(identifier)\n .map(match => match || null);\n logger.debug(`${proto}, ${value}, ${modifierSeperator}, ${modifier}`);\n\n // Validate and process name\n if (!value) {\n throw new Error(`Check your url. No channel name provided before \"${modifierSeperator}\"`);\n }\n const isChannel = value.startsWith(module.exports.CHANNEL_CHAR);\n const channelName = isChannel ? value : null;\n let claimId;\n if (isChannel) {\n if (!channelName) {\n throw new Error('No channel name after @.');\n }\n const nameBadChars = (channelName).match(module.exports.REGEXP_INVALID_CHANNEL);\n if (nameBadChars) {\n throw new Error(`Invalid characters in channel name: ${nameBadChars.join(', ')}.`);\n }\n } else {\n claimId = value;\n }\n\n // Validate and process modifier\n let channelClaimId;\n if (modifierSeperator) {\n if (!modifier) {\n throw new Error(`No modifier provided after separator \"${modifierSeperator}\"`);\n }\n\n if (modifierSeperator === ':') {\n channelClaimId = modifier;\n } else {\n throw new Error(`The \"${modifierSeperator}\" modifier is not currently supported`);\n }\n }\n return {\n isChannel,\n channelName,\n channelClaimId,\n claimId,\n };\n },\n parseClaim: function (claim) {\n logger.debug('parsing name:', claim);\n const componentsRegex = new RegExp(\n '([^:$#/.]*)' + // name (stops at the first modifier)\n '([:$#.]?)([^/]*)' // modifier separator, modifier (stops at the first path separator or end)\n );\n const [proto, claimName, modifierSeperator, modifier] = componentsRegex\n .exec(claim)\n .map(match => match || null);\n logger.debug(`${proto}, ${claimName}, ${modifierSeperator}, ${modifier}`);\n\n // Validate and process name\n if (!claimName) {\n throw new Error('No claim name provided before .');\n }\n const nameBadChars = (claimName).match(module.exports.REGEXP_INVALID_CLAIM);\n if (nameBadChars) {\n throw new Error(`Invalid characters in claim name: ${nameBadChars.join(', ')}.`);\n }\n // Validate and process modifier\n if (modifierSeperator) {\n if (!modifier) {\n throw new Error(`No file extension provided after separator ${modifierSeperator}.`);\n }\n if (modifierSeperator !== '.') {\n throw new Error(`The ${modifierSeperator} modifier is not supported in the claim name`);\n }\n }\n // return results\n return {\n claimName,\n };\n },\n parseModifier: function (claim) {\n logger.debug('parsing modifier:', claim);\n const componentsRegex = new RegExp(\n '([^:$#/.]*)' + // name (stops at the first modifier)\n '([:$#.]?)([^/]*)' // modifier separator, modifier (stops at the first path separator or end)\n );\n const [proto, claimName, modifierSeperator, modifier] = componentsRegex\n .exec(claim)\n .map(match => match || null);\n logger.debug(`${proto}, ${claimName}, ${modifierSeperator}, ${modifier}`);\n // Validate and process modifier\n let hasFileExtension = false;\n if (modifierSeperator) {\n hasFileExtension = true;\n }\n return {\n hasFileExtension,\n };\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./helpers/lbryUri.js","import React from 'react';\nimport { renderToString } from 'react-dom/server';\nimport { createStore, applyMiddleware } from 'redux';\nimport Reducer from '../react/reducers';\nimport { Provider } from 'react-redux';\nimport { StaticRouter } from 'react-router-dom';\nimport GAListener from '../react/components/GAListener';\nimport App from '../react/app';\nimport renderFullPage from './renderFullPage';\nimport createSagaMiddleware from 'redux-saga';\nimport { call } from 'redux-saga/effects';\nimport { handleShowPageUri } from '../react/sagas/show_uri';\nimport { onHandleShowPageUri } from '../react/actions/show';\n\nimport Helmet from 'react-helmet';\n\nconst returnSagaWithParams = (saga, params) => {\n return function * () {\n yield call(saga, params);\n };\n};\n\nmodule.exports = (req, res) => {\n let context = {};\n\n // create and apply middleware\n const sagaMiddleware = createSagaMiddleware();\n const middleware = applyMiddleware(sagaMiddleware);\n\n // create a new Redux store instance\n const store = createStore(Reducer, middleware);\n\n // create saga\n const action = onHandleShowPageUri(req.params);\n const saga = returnSagaWithParams(handleShowPageUri, action);\n\n // run the saga middleware\n sagaMiddleware\n .run(saga)\n .done\n .then(() => {\n // render component to a string\n const html = renderToString(\n \n \n \n \n \n \n \n );\n\n // get head tags from helmet\n const helmet = Helmet.renderStatic();\n\n // check for a redirect\n if (context.url) {\n return res.redirect(301, context.url);\n }\n\n // get the initial state from our Redux store\n const preloadedState = store.getState();\n\n // send the rendered page back to the client\n res.send(renderFullPage(helmet, html, preloadedState));\n });\n};\n\n\n\n// WEBPACK FOOTER //\n// ./helpers/handleShowRender.jsx","module.exports = require(\"redux-saga\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"redux-saga\"\n// module id = 141\n// module chunks = 0","import { call, put, takeLatest } from 'redux-saga/effects';\nimport * as actions from 'constants/show_action_types';\nimport { onRequestError, onNewChannelRequest, onNewAssetRequest } from 'actions/show';\nimport { newAssetRequest } from 'sagas/show_asset';\nimport { newChannelRequest } from 'sagas/show_channel';\nimport lbryUri from 'utils/lbryUri';\n\nfunction * parseAndUpdateIdentifierAndClaim (modifier, claim) {\n // this is a request for an asset\n // claim will be an asset claim\n // the identifier could be a channel or a claim id\n let isChannel, channelName, channelClaimId, claimId, claimName, extension;\n try {\n ({ isChannel, channelName, channelClaimId, claimId } = lbryUri.parseIdentifier(modifier));\n ({ claimName, extension } = lbryUri.parseClaim(claim));\n } catch (error) {\n return yield put(onRequestError(error.message));\n }\n // trigger an new action to update the store\n if (isChannel) {\n return yield call(newAssetRequest, onNewAssetRequest(claimName, null, channelName, channelClaimId, extension));\n };\n yield call(newAssetRequest, onNewAssetRequest(claimName, claimId, null, null, extension));\n}\nfunction * parseAndUpdateClaimOnly (claim) {\n // this could be a request for an asset or a channel page\n // claim could be an asset claim or a channel claim\n let isChannel, channelName, channelClaimId;\n try {\n ({ isChannel, channelName, channelClaimId } = lbryUri.parseIdentifier(claim));\n } catch (error) {\n return yield put(onRequestError(error.message));\n }\n // trigger an new action to update the store\n // return early if this request is for a channel\n if (isChannel) {\n return yield call(newChannelRequest, onNewChannelRequest(channelName, channelClaimId));\n }\n // if not for a channel, parse the claim request\n let claimName, extension;\n try {\n ({claimName, extension} = lbryUri.parseClaim(claim));\n } catch (error) {\n return yield put(onRequestError(error.message));\n }\n yield call(newAssetRequest, onNewAssetRequest(claimName, null, null, null, extension));\n}\n\nexport function * handleShowPageUri (action) {\n const { identifier, claim } = action.data;\n if (identifier) {\n return yield call(parseAndUpdateIdentifierAndClaim, identifier, claim);\n }\n yield call(parseAndUpdateClaimOnly, claim);\n};\n\nexport function * watchHandleShowPageUri () {\n yield takeLatest(actions.HANDLE_SHOW_URI, handleShowPageUri);\n};\n\n\n\n// WEBPACK FOOTER //\n// ./react/sagas/show_uri.js","import { call, put, select, takeLatest } from 'redux-saga/effects';\nimport * as actions from 'constants/show_action_types';\nimport { addRequestToRequestList, onRequestError, onRequestUpdate, addAssetToAssetList } from 'actions/show';\nimport { getLongClaimId, getShortId, getClaimData } from 'api/assetApi';\nimport { selectShowState } from 'selectors/show';\n\nexport function * newAssetRequest (action) {\n const { requestType, requestId, name, modifier } = action.data;\n // put an action to update the request in redux\n yield put(onRequestUpdate(requestType, requestId));\n // is this an existing request?\n // If this uri is in the request list, it's already been fetched\n const state = yield select(selectShowState);\n if (state.requestList[requestId]) {\n return null;\n }\n // get long id && add request to request list\n let longId;\n try {\n ({data: longId} = yield call(getLongClaimId, name, modifier));\n } catch (error) {\n return yield put(onRequestError(error.message));\n }\n const assetKey = `a#${name}#${longId}`;\n yield put(addRequestToRequestList(requestId, null, assetKey));\n // is this an existing asset?\n // If this asset is in the asset list, it's already been fetched\n if (state.assetList[assetKey]) {\n return null;\n }\n // get short Id\n let shortId;\n try {\n ({data: shortId} = yield call(getShortId, name, longId));\n } catch (error) {\n return yield put(onRequestError(error.message));\n }\n // get asset claim data\n let claimData;\n try {\n ({data: claimData} = yield call(getClaimData, name, longId));\n } catch (error) {\n return yield put(onRequestError(error.message));\n }\n // add asset to asset list\n yield put(addAssetToAssetList(assetKey, null, name, longId, shortId, claimData));\n // clear any errors in request error\n yield put(onRequestError(null));\n};\n\nexport function * watchNewAssetRequest () {\n yield takeLatest(actions.ASSET_REQUEST_NEW, newAssetRequest);\n};\n\n\n\n// WEBPACK FOOTER //\n// ./react/sagas/show_asset.js","import Request from 'utils/request';\nconst { site: { host } } = require('../../config/speechConfig.js');\n\nexport function getLongClaimId (name, modifier) {\n let body = {};\n // create request params\n if (modifier) {\n if (modifier.id) {\n body['claimId'] = modifier.id;\n } else {\n body['channelName'] = modifier.channel.name;\n body['channelClaimId'] = modifier.channel.id;\n }\n }\n body['claimName'] = name;\n const params = {\n method : 'POST',\n headers: { 'Content-Type': 'application/json' },\n body : JSON.stringify(body),\n };\n // create url\n const url = `${host}/api/claim/long-id`;\n // return the request promise\n return Request(url, params);\n};\n\nexport function getShortId (name, claimId) {\n const url = `${host}/api/claim/short-id/${claimId}/${name}`;\n return Request(url);\n};\n\nexport function getClaimData (name, claimId) {\n const url = `${host}/api/claim/data/${name}/${claimId}`;\n return Request(url);\n};\n\n\n\n// WEBPACK FOOTER //\n// ./react/api/assetApi.js","import {call, put, select, takeLatest} from 'redux-saga/effects';\nimport * as actions from 'constants/show_action_types';\nimport { addNewChannelToChannelList, addRequestToRequestList, onRequestError, onRequestUpdate, updateChannelClaims } from 'actions/show';\nimport { getChannelClaims, getChannelData } from 'api/channelApi';\nimport { selectShowState } from 'selectors/show';\n\nexport function * newChannelRequest (action) {\n const { requestType, requestId, channelName, channelId } = action.data;\n // put an action to update the request in redux\n yield put(onRequestUpdate(requestType, requestId));\n // is this an existing request?\n // If this uri is in the request list, it's already been fetched\n const state = yield select(selectShowState);\n if (state.requestList[requestId]) {\n return null;\n }\n // get channel long id\n let longId, shortId;\n try {\n ({ data: {longChannelClaimId: longId, shortChannelClaimId: shortId} } = yield call(getChannelData, channelName, channelId));\n } catch (error) {\n return yield put(onRequestError(error.message));\n }\n // store the request in the channel requests list\n const channelKey = `c#${channelName}#${longId}`;\n yield put(addRequestToRequestList(requestId, null, channelKey));\n // is this an existing channel?\n // If this channel is in the channel list, it's already been fetched\n if (state.channelList[channelKey]) {\n return null;\n }\n // get channel claims data\n let claimsData;\n try {\n ({ data: claimsData } = yield call(getChannelClaims, channelName, longId, 1));\n } catch (error) {\n return yield put(onRequestError(error.message));\n }\n // store the channel data in the channel list\n yield put(addNewChannelToChannelList(channelKey, channelName, shortId, longId, claimsData));\n // clear any request errors\n yield put(onRequestError(null));\n}\n\nexport function * watchNewChannelRequest () {\n yield takeLatest(actions.CHANNEL_REQUEST_NEW, newChannelRequest);\n};\n\nfunction * getNewClaimsAndUpdateChannel (action) {\n const { channelKey, name, longId, page } = action.data;\n let claimsData;\n try {\n ({ data: claimsData } = yield call(getChannelClaims, name, longId, page));\n } catch (error) {\n return yield put(onRequestError(error.message));\n }\n yield put(updateChannelClaims(channelKey, claimsData));\n}\n\nexport function * watchUpdateChannelClaims () {\n yield takeLatest(actions.CHANNEL_CLAIMS_UPDATE_ASYNC, getNewClaimsAndUpdateChannel);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./react/sagas/show_channel.js","import Request from 'utils/request';\nconst { site: { host } } = require('../../config/speechConfig.js');\n\nexport function getChannelData (name, id) {\n if (!id) id = 'none';\n const url = `${host}/api/channel/data/${name}/${id}`;\n return Request(url);\n};\n\nexport function getChannelClaims (name, longId, page) {\n if (!page) page = 1;\n const url = `${host}/api/channel/claims/${name}/${longId}/${page}`;\n return Request(url);\n};\n\n\n\n// WEBPACK FOOTER //\n// ./react/api/channelApi.js","module.exports = {\n REGEXP_INVALID_CLAIM : /[^A-Za-z0-9-]/g,\n REGEXP_INVALID_CHANNEL: /[^A-Za-z0-9-@]/g,\n REGEXP_ADDRESS : /^b(?=[^0OIl]{32,33})[0-9A-Za-z]{32,33}$/,\n CHANNEL_CHAR : '@',\n parseIdentifier : function (identifier) {\n const componentsRegex = new RegExp(\n '([^:$#/]*)' + // value (stops at the first separator or end)\n '([:$#]?)([^/]*)' // modifier separator, modifier (stops at the first path separator or end)\n );\n const [proto, value, modifierSeperator, modifier] = componentsRegex // eslint-disable-line no-unused-vars\n .exec(identifier)\n .map(match => match || null);\n\n // Validate and process name\n if (!value) {\n throw new Error(`Check your URL. No channel name provided before \"${modifierSeperator}\"`);\n }\n const isChannel = value.startsWith(module.exports.CHANNEL_CHAR);\n const channelName = isChannel ? value : null;\n let claimId;\n if (isChannel) {\n if (!channelName) {\n throw new Error('Check your URL. No channel name after \"@\".');\n }\n const nameBadChars = (channelName).match(module.exports.REGEXP_INVALID_CHANNEL);\n if (nameBadChars) {\n throw new Error(`Check your URL. Invalid characters in channel name: \"${nameBadChars.join(', ')}\".`);\n }\n } else {\n claimId = value;\n }\n\n // Validate and process modifier\n let channelClaimId;\n if (modifierSeperator) {\n if (!modifier) {\n throw new Error(`Check your URL. No modifier provided after separator \"${modifierSeperator}\"`);\n }\n\n if (modifierSeperator === ':') {\n channelClaimId = modifier;\n } else {\n throw new Error(`Check your URL. The \"${modifierSeperator}\" modifier is not currently supported`);\n }\n }\n return {\n isChannel,\n channelName,\n channelClaimId: channelClaimId || null,\n claimId : claimId || null,\n };\n },\n parseClaim: function (name) {\n const componentsRegex = new RegExp(\n '([^:$#/.]*)' + // name (stops at the first extension)\n '([:$#.]?)([^/]*)' // extension separator, extension (stops at the first path separator or end)\n );\n const [proto, claimName, extensionSeperator, extension] = componentsRegex // eslint-disable-line no-unused-vars\n .exec(name)\n .map(match => match || null);\n\n // Validate and process name\n if (!claimName) {\n throw new Error('Check your URL. No claim name provided before \".\"');\n }\n const nameBadChars = (claimName).match(module.exports.REGEXP_INVALID_CLAIM);\n if (nameBadChars) {\n throw new Error(`Check your URL. Invalid characters in claim name: \"${nameBadChars.join(', ')}\".`);\n }\n // Validate and process extension\n if (extensionSeperator) {\n if (!extension) {\n throw new Error(`Check your URL. No file extension provided after separator \"${extensionSeperator}\".`);\n }\n if (extensionSeperator !== '.') {\n throw new Error(`Check your URL. The \"${extensionSeperator}\" separator is not supported in the claim name.`);\n }\n }\n return {\n claimName,\n extension: extension || null,\n };\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./react/utils/lbryUri.js","const handlePageRender = require('../helpers/handlePageRender.jsx');\n\nmodule.exports = app => {\n // a catch-all route if someone visits a page that does not exist\n app.use('*', (req, res) => {\n // send response\n handlePageRender(req, res);\n });\n};\n\n\n\n// WEBPACK FOOTER //\n// ./routes/fallback-routes.js","module.exports = require(\"http\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"http\"\n// module id = 149\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff --git a/server.js b/server.js index 898124f1..b2a4368b 100644 --- a/server.js +++ b/server.js @@ -61,7 +61,8 @@ app.set('view engine', 'handlebars'); app.use(populateLocalsDotUser); // start the server -const startServer = (mysqlConfig) => { +const start = (config) => { + const { mysqlConfig } = config; const db = require('./models')(mysqlConfig); // require our models for syncing db.sequelize // sync sequelize @@ -89,14 +90,8 @@ const startServer = (mysqlConfig) => { }; module.exports = { - hello () { - console.log('hello world'); - }, speak (something) { console.log(something); }, - start (config) { - const { mysqlConfig } = config; - startServer(mysqlConfig); - }, + start, }; diff --git a/webpack.server.common.js b/webpack.server.common.js index 65c445a1..0e987713 100644 --- a/webpack.server.common.js +++ b/webpack.server.common.js @@ -13,7 +13,8 @@ module.exports = { path : Path.join(__dirname, '/'), publicPath : '/', filename : 'index.js', - libraryExport: 'default', + library : '', + libraryTarget: 'commonjs-module', }, module: { rules: [