"use strict";(self.webpackChunkseahub_frontend=self.webpackChunkseahub_frontend||[]).push([[1226],{86848:function(e,t,n){var r=n(23029),s=n(92901),o=n(39874),i=n(85501),a=n(9950),c=n(17119),u=n(97011),d=n(40326),f=n(88204),h=n(15167),p=n(81446),v=n(9223),l=(n(20479),n(44414)),g=window.shared.pageOptions,A=g.repoID,m=g.filePath,k=g.err,w=g.commitID,j=g.fileType,b=g.sharedToken,x=function(e){function t(){return(0,r.A)(this,t),(0,o.A)(this,t,arguments)}return(0,i.A)(t,e),(0,s.A)(t,[{key:"render",value:function(){return(0,l.jsx)(f.A,{content:(0,l.jsx)(y,{})})}}])}(a.Component),y=function(e){function t(e){var n;return(0,r.A)(this,t),(n=(0,o.A)(this,t,[e])).state={isLoading:!k,errorMsg:""},n}return(0,i.A)(t,e),(0,s.A)(t,[{key:"componentDidMount",value:function(){var e=this;if(!k){var t=function(){u.e.queryOfficeFileConvertStatus(A,w,m,j.toLowerCase(),b).then((function(n){switch(n.data.status){case"PROCESSING":e.setState({isLoading:!0}),setTimeout(t,2e3);break;case"ERROR":e.setState({isLoading:!1,errorMsg:(0,d.AP)("Document convertion failed.")});break;case"DONE":e.setState({isLoading:!1,errorMsg:""});var r=document.createElement("script");r.type="text/javascript",r.src="".concat(d.SG,"js/pdf/web/viewer.js"),document.body.append(r)}})).catch((function(t){t.response?e.setState({isLoading:!1,errorMsg:(0,d.AP)("Document convertion failed.")}):e.setState({isLoading:!1,errorMsg:(0,d.AP)("Please check the network.")})}))};t()}}},{key:"render",value:function(){var e=this.state,t=e.isLoading,n=e.errorMsg;return k?(0,l.jsx)(h.A,{}):t?(0,l.jsx)(p.A,{}):n?(0,l.jsx)(h.A,{errorMsg:n}):(0,l.jsx)("div",{className:"shared-file-view-body pdf-file-view",children:(0,l.jsx)(v.A,{})})}}])}(a.Component);c.render((0,l.jsx)(x,{}),document.getElementById("wrapper"))}},function(e){e.O(0,[4223],(function(){return t=86848,e(e.s=t);var t}));e.O()}]);