"use strict";(self.webpackChunkseahub_frontend=self.webpackChunkseahub_frontend||[]).push([[6477],{34466:function(e,t,n){var r=n(23029),o=n(92901),a=n(39874),s=n(85501),i=n(9950),c=n(1352),u=n(97011),f=n(40326),d=n(88204),h=n(15167),l=n(9961),g=(n(44259),n(44414)),m=window.shared.pageOptions,v=m.repoID,p=m.filePath,k=m.err,w=m.commitID,x=m.fileType,L=m.fileName,b=m.sharedToken,j=function(e){function t(){return(0,r.default)(this,t),(0,a.default)(this,t,arguments)}return(0,s.default)(t,e),(0,o.default)(t,[{key:"render",value:function(){return(0,g.jsx)(d.A,{content:(0,g.jsx)(y,{})})}}])}(i.Component),y=function(e){function t(e){var n;return(0,r.default)(this,t),(n=(0,a.default)(this,t,[e])).setIframeHeight=function(e){var t=e.currentTarget;t.height=t.contentDocument.body.scrollHeight},n.state={isLoading:!k,errorMsg:""},n}return(0,s.default)(t,e),(0,o.default)(t,[{key:"componentDidMount",value:function(){var e=this;if(!k){var t=function(){u.e.queryOfficeFileConvertStatus(v,w,p,x.toLowerCase(),b).then((function(n){switch(n.data.status){case"QUEUED":case"PROCESSING":e.setState({isLoading:!0}),setTimeout(t,2e3);break;case"ERROR":e.setState({isLoading:!1,errorMsg:(0,f.APU)("Document conversion failed.")});break;case"DONE":e.setState({isLoading:!1,errorMsg:""})}})).catch((function(t){t.response?e.setState({isLoading:!1,errorMsg:(0,f.APU)("Document conversion failed.")}):e.setState({isLoading:!1,errorMsg:(0,f.APU)("Please check the network.")})}))};t()}}},{key:"render",value:function(){var e=this.state,t=e.isLoading,n=e.errorMsg;return k?(0,g.jsx)(h.A,{}):t?(0,g.jsx)(l.A,{}):n?(0,g.jsx)(h.A,{errorMsg:n}):(0,g.jsx)("div",{className:"shared-file-view-body spreadsheet-file-view",children:(0,g.jsx)("iframe",{id:"spreadsheet-container",title:L,src:"".concat(f.YcY,"office-convert/static/").concat(v,"/").concat(w).concat(encodeURIComponent(p),"/index.html?token=").concat(b),onLoad:this.setIframeHeight})})}}])}(i.Component);(0,c.createRoot)(document.getElementById("wrapper")).render((0,g.jsx)(j,{}))},44259:function(){}},function(e){e.O(0,[4223],(function(){return t=34466,e(e.s=t);var t}));e.O()}]);