text: (function(e){function t(t){for(var r,i,s=t[0],l=t[1],d=t[2],c=0,p=[];c<s.length;c++)i=s[c],a[i]&&p.push(a[i][0]),a[i]=0;for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r]);u&&u(t);while(p.length)p.shift()();return o.push.apply(o,d||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],r=!0,s=1;s<n.length;s++){var l=n[s];0!==a[l]&&(r=!1)}r&&(o.splice(t--,1),e=i(i.s=n[0]))}return e}var r={},a={app:0},o=[];function i(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=e,i.c=r,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/";var s=window["webpackJsonp"]=window["webpackJsonp"]||[],l=s.push.bind(s);s.push=t,s=s.slice();for(var d=0;d<s.length;d++)t(s[d]);var u=l;o.push([0,"chunk-vendors"]),n()})({0:function(e,t,n){e.exports=n("56d7")},"034f":function(e,t,n){"use strict";var r=n("64a9"),a=n.n(r);a.a},"56d7":function(e,t,n){"use strict";n.r(t);n("cadf"),n("551c"),n("f751"),n("097d");var r=n("2b0e"),a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"app"}},[n("dropzone",{attrs:{dropzone:e.dropzone}})],1)},o=[],i=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{attrs:{id:"file-drag-drop"}},[r("div",{staticClass:"blueBoxNormalAppearance",attrs:{id:"blueBox"}},[r("form",{ref:"fileform",attrs:{id:"dropFormID"}},[r("span",{staticClass:"showUserMessage",attrs:{id:"userMessage"}},[e._v(e._s(e.userMessage))]),r("img",{staticClass:"dropIconHidden",attrs:{id:"dropIcon",src:n("d403"),height:"90vh"}})]),r("div",{ref:"dropTargetDiv",attrs:{id:"dragTarget"}})]),r("label",{attrs:{id:"buttonFileSelectorLabel",for:"buttonFileSelector"}},[e._v("Or "),r("strong",[e._v("choose it")]),e._v(" here.\n    "),r("input",{ref:"buttonFileSelector",attrs:{id:"buttonFileSelector",type:"file"},on:{change:function(t){return e.buttonFileSelectorFunction()}}})]),r("progress",{directives:[{name:"show",rawName:"v-show",value:e.uploadPercentage>0&&e.uploadPercentage<100,expression:"uploadPercentage > 0 && uploadPercentage < 100"}],attrs:{max:"100"},domProps:{value:e.uploadPercentage}}),r("div",{directives:[{name:"show",rawName:"v-show",value:"All done. Yum!"==e.userMessage,expression:"userMessage == 'All done. Yum!'"}],staticClass:"u-full-width",attrs:{id:"displayContactsDiv"}})])},s=[],l=(n("ac4d"),n("8a81"),n("28a5"),n("7f7f"),n("4917"),n("ac6a"),n("bc3a")),d=n.n(l),u=(n("3934a"),{data:function(){return{isBrowserDragandDropCapable:!1,file:null,uploadPercentage:0,uploadMessage:"",userMessage:"Drop your CSV file here."}},mounted:function(){var e=this;this.isBrowserDragandDropCapable=this.determineDragAndDropCapable(),this.isBrowserDragandDropCapable&&(["drag","dragstart","dragend","dragover","dragenter","dragleave","drop"].forEach(function(t){return e.$refs.dropTargetDiv.addEventListener(t,function(e){e.preventDefault(),e.stopPropagation()},!1)}),window.addEventListener("drop",this.stopDefaultBehaviorOfDragOnWindow),window.addEventListener("dragover",this.stopDefaultBehaviorOfDragOnWindow),this.$refs.dropTargetDiv.addEventListener("drop",this.handleFileDrop),this.dropZoneHoverAnimations())},methods:{stopDefaultBehaviorOfDragOnWindow:function(e){e.preventDefault()},handleFileDrop:function(e){e.dataTransfer.files.length>1?this.userMessage="Please upload one file at a time.":this.handleFileSelection(e.dataTransfer.files[0])},buttonFileSelectorFunction:function(){this.handleFileSelection(this.$refs.buttonFileSelector.files[0])},handleFileSelection:function(e){e.name.match(/\.csv$/i)?(this.file=e,this.startUploadingAnimation(),this.submitFile()):this.userMessage="Whoops! I can only eat CSV files!"},dropZoneHoverAnimations:function(){var e=document.getElementById("blueBox"),t=document.getElementById("dropFormID"),n=document.getElementById("userMessage"),r=document.getElementById("dropIcon"),a=document.getElementById("dragTarget");function o(){e.classList.add("blueBoxAnimations"),t.classList.add("formAnimations"),r.classList.add("unhideDropIcon"),n.classList.add("hideUserMessage")}function i(){e.classList.remove("blueBoxAnimations"),t.classList.remove("formAnimations"),r.classList.remove("unhideDropIcon"),n.classList.remove("hideUserMessage")}a.addEventListener("dragenter",o),a.addEventListener("drop",i),a.addEventListener("dragleave",i)},startUploadingAnimation:function(){document.getElementById("userMessage").classList.add("munching")},endUploadingAnimation:function(){document.getElementById("userMessage").classList.remove("munching")},determineDragAndDropCapable:function(){var e=document.createElement("div");return("draggable"in e||"ondragstart"in e&&"ondrop"in e)&&"FormData"in window&&"FileReader"in window},displayCsvContents:function(){var e="<h1>Your Contacts:</h1><table class='u-full-width' id='contactsTable'>",t=new FileReader;function n(t){var n=t.target.result.split(/\r\n|\n/),r=!0,a=!1,o=void 0;try{for(var i,s=n[Symbol.iterator]();!(r=(i=s.next()).done);r=!0){var l=i.value,d=l.split(",");if("<h1>Your Contacts:</h1><table class='u-full-width' id='contactsTable'>"==e){e+="<thead> <tr>";var u=!0,c=!1,p=void 0;try{for(var f,h=d[Symbol.iterator]();!(u=(f=h.next()).done);u=!0){var g=f.value;e+="<th>".concat(g,"</th>")}}catch(M){c=!0,p=M}finally{try{u||null==h.return||h.return()}finally{if(c)throw p}}e+="</tr> </thead><tbody> <tr>"}else{e+="<tr>";var v=!0,m=!1,b=void 0;try{for(var y,w=d[Symbol.iterator]();!(v=(y=w.next()).done);v=!0){var D=y.value;e+="<td>".concat(D,"</td>")}}catch(M){m=!0,b=M}finally{try{v||null==w.return||w.return()}finally{if(m)throw b}}e+="</tr>"}}}catch(M){a=!0,o=M}finally{try{r||null==s.return||s.return()}finally{if(a)throw o}}e+="</tr></tbody></table>",document.getElementById("displayContactsDiv").innerHTML="".concat(e)}t.readAsText(this.file),t.onload=n},submitFile:function(){var e=this;this.userMessage="Munching...";var t=new FormData;t.append("file",this.file),d.a.post("https://vuedraganddropper.proxy.beeceptor.com",t,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:function(t){return e.uploadPercentage=parseInt(Math.round(100*t.loaded/t.total))}}).then(function(){e.displayCsvContents(),e.userMessage="All done. Yum!",e.endUploadingAnimation()}).catch(function(){e.userMessage="Uh-oh, that didn't work. Try again?",e.endUploadingAnimation()})}}}),c=u,p=(n("e930"),n("2877")),f=Object(p["a"])(c,i,s,!1,null,null,null),h=f.exports,g={name:"app",components:{dropzone:h},data:function(){return{dropzone:{}}}},v=g,m=(n("034f"),Object(p["a"])(v,a,o,!1,null,null,null)),b=m.exports;r["a"].config.productionTip=!1,new r["a"]({render:function(e){return e(b)}}).$mount("#root")},"64a9":function(e,t,n){},d1a7:function(e,t,n){},d403:function(e,t,n){e.exports=n.p+"img/dropicon.de3f2b95.png"},e930:function(e,t,n){"use strict";var r=n("d1a7"),a=n.n(r);a.a}});
  //# sourceMappingURL=app.1a048248.js.map