/*! For license information please see dll.163.js.LICENSE.txt */
(window.webpackJsonp_name_dll=window.webpackJsonp_name_dll||[]).push([[163],{3919:function(e,t,n){"use strict";n.r(t);var a=n(13),r=n.n(a),i=n(12),o=n.n(i),s=n(6),l=n.n(s),c=n(14),u=n.n(c),d=n(15),p=n.n(d),f=n(8),h=n.n(f),m=n(5),w=n.n(m),v=n(0),k=n.n(v),y=n(24),E=n(123),D=n(1),F=n.n(D),g=n(19),P=n.n(g);function H(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=h()(e);if(t){var r=h()(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return p()(this,n)}}var b=function(e){u()(n,e);var t=H(n);function n(e){var a;return r()(this,n),a=t.call(this,e),w()(l()(a),"clickHide",(function(){a.props.onHide()})),w()(l()(a),"handlePDFExport",(function(){a.props.saveAsPDF(),a.props.onHide()})),w()(l()(a),"handlePNGExport",(function(){a.props.saveAsPNG(),a.props.onHide()})),a.state={ownerFile:null},a}return o()(n,[{key:"componentDidMount",value:function(){var e=this;this.props.session.getLessonOwnerFiles((function(t,n){P()(n)&&n.length>0&&(n=n.filter((function(t){return t.title===e.props.id+".pdf"})),e.setState({ownerFile:n[n.length-1]}))}))}},{key:"render",value:function(){var e,t,n=this.props.session;return this.state.ownerFile&&(e=new Date(this.state.ownerFile.updatedAt),t=this.state.ownerFile.name),k.a.createElement(E.default,{onHide:this.clickHide,show:this.props.show,dialogClassName:"modal-w30"},k.a.createElement(E.default.Header,{closeButton:!0},k.a.createElement(E.default.Title,{as:"h4"},"Download Slides")),k.a.createElement(E.default.Body,null,this.props.pdf?k.a.createElement(y.default,{size:"large",variant:"secondary",block:!0,onClick:this.clickHide},k.a.createElement("a",{className:"unstyled-link",href:this.props.pdf,download:!0},"Download original PDF")):null,this.state.ownerFile?k.a.createElement(y.default,{size:"large",variant:"secondary",block:!0,onClick:this.clickHide},k.a.createElement("a",{className:"unstyled-link",href:n.server+"/"+this.state.ownerFile.filename,download:!0},"Download PDF with instructor annotations ",k.a.createElement("br",null),k.a.createElement("small",null,"(last updated: ",e.toDateString()+", "+e.toLocaleTimeString()," by ",t,")"))):null,k.a.createElement(y.default,{variant:"secondary",size:"large",onClick:this.handlePDFExport,block:!0},"Export my annotations as PDF"),k.a.createElement(y.default,{variant:"secondary",size:"large",onClick:this.handlePNGExport,block:!0},"Export current slide as PNG")))}}]),n}(v.Component);b.propTypes={id:F.a.string.isRequired,onHide:F.a.func,pdf:F.a.string,saveAsPDF:F.a.func.isRequired,saveAsPNG:F.a.func.isRequired,session:F.a.object.isRequired,show:F.a.bool.isRequired},b.defaultProps={pdf:null,onHide:function(){}},t.default=b}}]);