/*! For license information please see dll.234.js.LICENSE.txt */
(window.webpackJsonp_name_dll=window.webpackJsonp_name_dll||[]).push([[234],{3540:function(e,t,n){"use strict";n.r(t);var a=n(14),r=n.n(a),o=n(12),i=n.n(o),l=n(10),s=n.n(l),c=n(15),d=n.n(c),u=n(16),p=n.n(u),f=n(8),h=n.n(f),m=n(7),w=n.n(m),v=n(0),k=n.n(v),y=n(75),E=n(987),g=n(1),F=n.n(g),H=n(39),b=n.n(H);function P(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 R=function(e){d()(n,e);var t=P(n);function n(e){var a;return r()(this,n),a=t.call(this,e),w()(s()(a),"clickHide",(function(){a.props.onHide()})),w()(s()(a),"handlePDFExport",(function(){a.props.saveAsPDF(),a.props.onHide()})),w()(s()(a),"handlePNGExport",(function(){a.props.saveAsPNG(),a.props.onHide()})),a.state={ownerFile:null},a}return i()(n,[{key:"componentDidMount",value:function(){var e=this;this.props.session.getLessonOwnerFiles((function(t,n){b()(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;this.state.ownerFile&&(e=new Date(this.state.ownerFile.updatedAt),t=this.state.ownerFile.name);var a=this.props.t;return 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"},a("download"))),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},a("download-original"))):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},a("download-instructor-annotations"),k.a.createElement("br",null),k.a.createElement("small",null,"(",a("last-updated"),": ",e.toDateString()+", "+e.toLocaleTimeString()," ",a("by")," ",t,")"))):null,k.a.createElement(y.default,{variant:"secondary",size:"large",onClick:this.handlePDFExport,block:!0},a("export-pdf")),k.a.createElement(y.default,{variant:"secondary",size:"large",onClick:this.handlePNGExport,block:!0},a("export-png"))))}}]),n}(v.Component);R.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},R.defaultProps={pdf:null,onHide:function(){}},t.default=R}}]);