text: webpackJsonp([1],{"/IgW":function(e,t){e.exports={render:function(){var e=this.$createElement;return(this._self._c||e)("button",{staticClass:"bg-red hover:bg-red-dark inline-block text-white no-underline font-bold py-2 px-4 rounded cursor-pointer",on:{click:this.destroy}},[this._v("Delete")])},staticRenderFns:[]}},"023d":function(e,t,n){var r=n("wHij");"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);n("rjj0")("1872b6bb",r,!0,{})},"0tcR":function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"h-screen bg-white flex flex-col"},[n("div",{staticClass:"p-4 border-b shadow text-right"},[n("button",{staticClass:"bg-green hover:bg-green-dark inline-block text-white no-underline font-bold py-2 px-4 rounded cursor-pointer",on:{click:e.store,keyup:function(t){return("button"in t||31===t.keyCode)&&t.metaKey?e.store(t):null}}},[e._v("Save")]),e._v(" "),n("delete-entry-button",{attrs:{entryId:e.entryId,journalId:e.journalId}})],1),e._v(" "),n("div",{staticClass:"p-8 flex-grow overflow-scroll"},[n("form",{on:{submit:function(t){return t.preventDefault(),e.store(t)}}},[n("div",{staticClass:"mb-4"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.title,expression:"title"}],staticClass:"shadow appearance-none inline-block border rounded py-2 px-3 text-grey-darker w-full",attrs:{type:"text",placeholder:"This is the title of your entry"},domProps:{value:e.title},on:{input:function(t){t.target.composing||(e.title=t.target.value)}}})]),e._v(" "),n("div",{staticClass:"form-group"},[n("textarea",{staticClass:"shadow appearance-none inline-block border rounded py-2 px-3 text-grey-darker w-full",attrs:{rows:"10",placeholder:"The content of your entry. **Markdown** is *supported*!"},domProps:{value:e.content},on:{focus:e.updateSizeOfTextarea,input:e.update}})]),e._v("\n\n            "+e._s(e.entry.attributes.id)+"\n\n            "),n("files-list",{attrs:{files:e.files,entryId:e.entryId}})],1)]),e._v(" "),n("div",{staticClass:"p-4 border-t"},[n("files-bag",{attrs:{files:e.files,entryId:e.entryId}})],1)])},staticRenderFns:[]}},"3g4S":function(e,t,n){var r=n("VU/8")(n("agxy"),n("0tcR"),!1,null,null,null);e.exports=r.exports},"F/CI":function(e,t,n){var r=n("VU/8")(n("wNJ/"),n("qrY3"),!1,function(e){n("023d")},"data-v-459d6068",null);e.exports=r.exports},H93s:function(e,t,n){(e.exports=n("FZ+f")(!1)).push([e.i,"img[data-v-7ea03c2d]{max-width:250px}",""])},JI1t:function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",e._l(e.files,function(t){return e.files.length>0?n("div",{key:t.id,staticClass:"media mb-1"},[n("img",{staticClass:"d-flex mr-3",attrs:{src:t.attributes.url,alt:""}}),e._v(" "),n("div",{staticClass:"media-body"},[n("h6",{staticClass:"mt-0"},[e._v(e._s(t.attributes.name))]),e._v(" "),n("p",[n("small",[e._v("Added "+e._s(t.attributes.created_at))])]),e._v(" "),n("button",{staticClass:"bg-red hover:bg-red-dark inline-block text-white no-underline font-bold py-2 px-4 rounded cursor-pointer",attrs:{type:"button"},on:{click:function(n){e.destroy(t.id)}}},[e._v("Delete File")])])]):e._e()}))},staticRenderFns:[]}},JnrT:function(e,t,n){var r,o,s,i;i=function(e,t){"use strict";var n,r,o="function"==typeof Map?new Map:(n=[],r=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return r[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),r.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),r.splice(t,1))}}),s=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){s=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function i(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!o.has(e)){var t,n=null,r=e.clientWidth,i=null,a=function(){e.clientWidth!==r&&c()},d=function(t){window.removeEventListener("resize",a,!1),e.removeEventListener("input",c,!1),e.removeEventListener("keyup",c,!1),e.removeEventListener("autosize:destroy",d,!1),e.removeEventListener("autosize:update",c,!1),Object.keys(t).forEach(function(n){e.style[n]=t[n]}),o.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",d,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",c,!1),window.addEventListener("resize",a,!1),e.addEventListener("input",c,!1),e.addEventListener("autosize:update",c,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",o.set(e,{destroy:d,update:c}),"vertical"===(t=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===t.resize&&(e.style.resize="horizontal"),n="content-box"===t.boxSizing?-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),isNaN(n)&&(n=0),c()}function l(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(){var t=e.style.height,o=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(e),s=document.documentElement&&document.documentElement.scrollTop;e.style.height="";var i=e.scrollHeight+n;0!==e.scrollHeight?(e.style.height=i+"px",r=e.clientWidth,o.forEach(function(e){e.node.scrollTop=e.scrollTop}),s&&(document.documentElement.scrollTop=s)):e.style.height=t}function c(){u();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r!==t?"hidden"===n.overflowY&&(l("scroll"),u(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(l("hidden"),u(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),i!==r){i=r;var o=s("autosize:resized");try{e.dispatchEvent(o)}catch(e){}}}}function a(e){var t=o.get(e);t&&t.destroy()}function d(e){var t=o.get(e);t&&t.update()}var l=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((l=function(e){return e}).destroy=function(e){return e},l.update=function(e){return e}):((l=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],function(e){return i(e)}),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e},l.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],d),e}),t.exports=l},o=[t,e],void 0===(s="function"==typeof(r=i)?r.apply(t,o):r)||(e.exports=s)},XyTJ:function(e,t,n){var r=n("VU/8")(n("yzdo"),n("JI1t"),!1,function(e){n("wNhU")},"data-v-7ea03c2d",null);e.exports=r.exports},a2GO:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={props:["entryId","journalId"],methods:{destroy:function(){var e=this;this.$store.dispatch("deleteEntry",this.entryId).then(function(){e.$store.dispatch("getEntries",e.journalId);var t=e.journalId;e.$router.push({name:"journals.show",params:{journalId:t}})})}}}},agxy:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=d(n("JnrT")),o=d(n("g4da")),s=d(n("F/CI")),i=d(n("XyTJ")),a=d(n("ruLx"));function d(e){return e&&e.__esModule?e:{default:e}}t.default={props:["journalId","entryId"],data:function(){return{title:"",content:""}},components:{FilesBag:s.default,FilesList:i.default,DeleteEntryButton:a.default},watch:{$route:"fetchData"},created:function(){this.fetchData(),this.$on("receivedEntry",function(e){this.updateSizeOfTextarea(),this.title=new o.default(this.$store.state.encryption_password).decrypt(e.attributes.title),this.content=new o.default(this.$store.state.encryption_password).decrypt(e.attributes.content)})},methods:{fetchData:function(){this.$store.dispatch("getEntry",this.entryId),this.$store.dispatch("getMedia",this.entryId)},updateSizeOfTextarea:function(){(0,r.default)(document.querySelector("textarea"))},update:function(e){this.updateSizeOfTextarea(),this.content=e.target.value},store:function(){var e=this;this.$store.dispatch("updateEntry",{entryId:this.entry.id,title:new o.default(this.$store.state.encryption_password).encrypt(this.title),content:new o.default(this.$store.state.encryption_password).encrypt(this.content)}).then(function(){e.$store.dispatch("getEntry",e.entryId),e.$store.dispatch("getEntries",e.journalId),e.$router.push({name:"entries.show",params:{journalId:e.journalId,entryId:e.entryId}})})}},computed:{files:function(){return this.$store.state.files},entry:function(){return null!=this.$store.state.entry&&this.$emit("receivedEntry",this.$store.state.entry),this.$store.state.entry}}}},qrY3:function(e,t){e.exports={render:function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{staticClass:"text-xs dropzone",on:{drop:function(t){return t.preventDefault(),e.readFiles(t)},dragover:function(t){return t.preventDefault(),e.dragover(t)}}},[e._v("\n    Drop Images Here\n")])},staticRenderFns:[]}},rjj0:function(e,t,n){var r="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!r)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var o=n("tTVk"),s={},i=r&&(document.head||document.getElementsByTagName("head")[0]),a=null,d=0,l=!1,u=function(){},c=null,p="data-vue-ssr-id",f="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function h(e){for(var t=0;t<e.length;t++){var n=e[t],r=s[n.id];if(r){r.refs++;for(var o=0;o<r.parts.length;o++)r.parts[o](n.parts[o]);for(;o<n.parts.length;o++)r.parts.push(y(n.parts[o]));r.parts.length>n.parts.length&&(r.parts.length=n.parts.length)}else{var i=[];for(o=0;o<n.parts.length;o++)i.push(y(n.parts[o]));s[n.id]={id:n.id,refs:1,parts:i}}}}function v(){var e=document.createElement("style");return e.type="text/css",i.appendChild(e),e}function y(e){var t,n,r=document.querySelector("style["+p+'~="'+e.id+'"]');if(r){if(l)return u;r.parentNode.removeChild(r)}if(f){var o=d++;r=a||(a=v()),t=b.bind(null,r,o,!1),n=b.bind(null,r,o,!0)}else r=v(),t=function(e,t){var n=t.css,r=t.media,o=t.sourceMap;r&&e.setAttribute("media",r);c.ssrId&&e.setAttribute(p,t.id);o&&(n+="\n/*# sourceURL="+o.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,r),n=function(){r.parentNode.removeChild(r)};return t(e),function(r){if(r){if(r.css===e.css&&r.media===e.media&&r.sourceMap===e.sourceMap)return;t(e=r)}else n()}}e.exports=function(e,t,n,r){l=n,c=r||{};var i=o(e,t);return h(i),function(t){for(var n=[],r=0;r<i.length;r++){var a=i[r];(d=s[a.id]).refs--,n.push(d)}t?h(i=o(e,t)):i=[];for(r=0;r<n.length;r++){var d;if(0===(d=n[r]).refs){for(var l=0;l<d.parts.length;l++)d.parts[l]();delete s[d.id]}}}};var g,m=(g=[],function(e,t){return g[e]=t,g.filter(Boolean).join("\n")});function b(e,t,n,r){var o=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=m(t,o);else{var s=document.createTextNode(o),i=e.childNodes;i[t]&&e.removeChild(i[t]),i.length?e.insertBefore(s,i[t]):e.appendChild(s)}}},ruLx:function(e,t,n){var r=n("VU/8")(n("a2GO"),n("/IgW"),!1,null,null,null);e.exports=r.exports},tTVk:function(e,t){e.exports=function(e,t){for(var n=[],r={},o=0;o<t.length;o++){var s=t[o],i=s[0],a={id:e+":"+o,css:s[1],media:s[2],sourceMap:s[3]};r[i]?r[i].parts.push(a):n.push(r[i]={id:i,parts:[a]})}return n}},wHij:function(e,t,n){(e.exports=n("FZ+f")(!1)).push([e.i,".dropzone[data-v-459d6068]{border:2px dashed #bbb;border-radius:5px;padding:20px;text-align:center;font-weight:700;color:#bbb;text-transform:uppercase}",""])},"wNJ/":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n("g4da");(r=o)&&r.__esModule;t.default={props:["entryId"],methods:{dragover:function(e){},readFiles:function(e){for(var t=e.target.files||e.dataTransfer.files,n=0;n<t.length;n++)this.$store.dispatch("storeMedia",{entryId:this.entryId,blob:t[n]})}}}},wNhU:function(e,t,n){var r=n("H93s");"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);n("rjj0")("8676442c",r,!0,{})},yzdo:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={props:["entryId","files"],methods:{destroy:function(e){var t=this;this.$store.dispatch("deleteMedia",{entryId:this.entryId,mediaId:e}).then(function(){t.$store.dispatch("getMedia",t.entryId)})}}}}});