You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
5 lines
26 KiB
5 lines
26 KiB
(self.webpackChunk=self.webpackChunk||[]).push([[4058],{71419:function(Ne,ve){(function(Q,A){A(ve)})(this,function(Q){"use strict";var A=function(){return(A=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function O(e,t,n,r){return new(n||(n=Promise))(function(o,s){function a(c){try{d(r.next(c))}catch(i){s(i)}}function f(c){try{d(r.throw(c))}catch(i){s(i)}}function d(c){var i;c.done?o(c.value):(i=c.value,i instanceof n?i:new n(function(h){h(i)})).then(a,f)}d((r=r.apply(e,t||[])).next())})}function I(e,t){var n,r,o,s,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function f(d){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){a=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(i[0]===6&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(h){i=[6,h],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([d,c])}}}var T=function(){function e(){}return e.add=function(t){e.HANDLE_LIST.push(t),window.addEventListener("message",t,!1)},e.remove=function(t){var n=e.HANDLE_LIST.indexOf(t);n>=0&&e.HANDLE_LIST.splice(n,1),window.removeEventListener("message",t,!1)},e.empty=function(){for(;e.HANDLE_LIST.length;)window.removeEventListener("message",e.HANDLE_LIST.shift(),!1)},e.parse=function(t){try{return typeof t=="object"?t:t&&JSON.parse(t)}catch(n){return console.log("Message.parse Error:",n),t}},e.HANDLE_LIST=[],e}();function le(e){return{}.toString.call(e)==="[object Function]"}var W,G,Y,q,ie={origin:""};function te(e,t){ie[e]=t}function J(e){return ie[e]}function K(e){var t=J("origin");return!!function(n,r){return n!==r&&(n.replace(/www\./i,"").toLowerCase()!==r.replace(/www\./i,"").toLowerCase()||(n.match("www.")?void 0:(te("origin",r),!1)))}(t,e.origin)&&(console.warn("postMessage \u57DF\u540D\u68C0\u67E5\u4E0D\u901A\u8FC7",{safeOrigin:t,eventOrigin:e.origin}),!0)}(function(e){e.unknown="unknown",e.spreadsheet="s",e.writer="w",e.presentation="p",e.pdf="f"})(W||(W={})),function(e){e.wps="w",e.et="s",e.presentation="p",e.pdf="f"}(G||(G={})),function(e){e.nomal="nomal",e.simple="simple"}(Y||(Y={})),function(e){e[e.requestFullscreen=1]="requestFullscreen",e[e.exitFullscreen=0]="exitFullscreen"}(q||(q={}));var re,S,R,ae=(re=0,function(){return re+=1}),we=function(e,t,n){n===void 0&&(n=!0);var r=t;if(!S){var o=function f(d){var c=d.clientHeight,i=d.clientWidth;c!==0||i!==0||R?c===0&&i===0||!R||(R.disconnect(),R=null):window.ResizeObserver&&(R=new ResizeObserver(function(h){f(d)})).observe(d),S.style.cssText+="height: "+c+"px; width: "+i+"px"}.bind(null,r);(S=document.createElement("iframe")).classList.add("web-office-iframe");var s={id:"office-iframe",src:e,scrolling:"no",frameborder:"0",allowfullscreen:"allowfullscreen",webkitallowfullscreen:"true",mozallowfullscreen:"true",allow:"clipboard-read; clipboard-write"};for(var a in r?(s.style="width: "+r.clientWidth+"px; height: "+r.clientHeight+"px;",n&&window.addEventListener("resize",o)):((r=document.createElement("div")).classList.add("web-office-default-container"),function(f){var d=document.createElement("style");document.head.appendChild(d);var c=d.sheet;c.insertRule(f,c.cssRules.length)}(".web-office-default-container {position: absolute; padding: 0; margin: 0; width: 100%; height: 100%; left: 0; top: 0;}"),document.body.appendChild(r),s.style="position: fixed; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%;"),s)S.setAttribute(a,s[a]);r.appendChild(S),S.destroy=function(){S.parentNode.removeChild(S),S=null,window.removeEventListener("resize",o),R&&(R.disconnect(),R=null)}}return S},H=function(e){we().contentWindow&&we().contentWindow.postMessage(JSON.stringify(e),J("origin"))};function Oe(e,t,n){return new Promise(function(r){var o=ae(),s=function(a){if(!K(a)){var f=T.parse(a.data);f.eventName===n&&f.msgId===o&&(r(f.data),T.remove(s))}};T.add(s),H({data:e,msgId:o,eventName:t})})}var Pe=function(e){return Oe(e,"wps.jssdk.api","wps.api.reply")},ye=function(e){return Oe(e,"api.basic","api.basic.reply")},N={idMap:{}};function Ie(e){return O(this,void 0,void 0,function(){var t,n,r,o,s,a,f,d,c,i;return I(this,function(h){switch(h.label){case 0:return K(e)?[2]:(t=T.parse(e.data),n=t.eventName,r=t.callbackId,o=t.data,r&&(s=N.idMap[r])?(a=s.split(":"),f=a[0],d=a[1],n==="api.callback"&&N[f]&&N[f][d]?[4,(i=N[f][d]).callback.apply(i,o.args)]:[3,2]):[3,2]);case 1:c=h.sent(),H({result:c,callbackId:r,eventName:"api.callback.reply"}),h.label=2;case 2:return[2]}})})}var Be=function(e){return O(void 0,void 0,void 0,function(){function t(){return Object.keys(N.idMap).find(function(h){return N.idMap[h]===r+":"+n})}var n,r,o,s,a,f,d,c,i;return I(this,function(h){switch(h.label){case 0:return n=e.prop,r=e.parentObjId,[4,Ce([o=e.value])];case 1:return s=h.sent(),a=s[0],f=s[1],e.value=a[0],d=Object.keys(f)[0],c=N[r],o===null&&c&&c[n]&&((i=t())&&delete N.idMap[i],delete c[n],Object.keys(c).length||delete N[r],Object.keys(N.idMap).length||T.remove(Ie)),d&&(Object.keys(N.idMap).length||T.add(Ie),N[r]||(N[r]={}),N[r][n]={callbackId:d,callback:f[d]},(i=t())&&delete N.idMap[i],N.idMap[d]=r+":"+n),[2]}})})},ke=function(e,t,n,r){return O(void 0,void 0,void 0,function(){var o,s,a,f,d,c,i,h;return I(this,function(b){switch(b.label){case 0:return o=ae(),f=new Promise(function(v,l){s=v,a=l}),d={},t.args?[4,Ce(t.args)]:[3,2];case 1:c=b.sent(),i=c[0],h=c[1],t.args=i,d=h,b.label=2;case 2:return e!=="api.setter"?[3,4]:[4,Be(t)];case 3:b.sent(),b.label=4;case 4:return function(v){var l=v[0],w=v[1];typeof(l=A({},l)).data=="function"&&(l.data=l.data()),w(),H(l)}([{eventName:e,data:t,msgId:o},function(){var v=this,l=function(w){return O(v,void 0,void 0,function(){var k,L,F;return I(this,function(m){switch(m.label){case 0:return K(w)?[2]:(k=T.parse(w.data)).eventName==="api.callback"&&k.callbackId&&d[k.callbackId]?[4,d[k.callbackId].apply(d,k.data.args)]:[3,2];case 1:L=m.sent(),H({result:L,eventName:"api.callback.reply",callbackId:k.callbackId}),m.label=2;case 2:return k.eventName===e+".reply"&&k.msgId===o&&(k.error?((F=new Error("")).stack=k.error+`
|
|
`+n,r&&r(),a(F)):s(k.result),T.remove(l)),[2]}})})};return T.add(l),f}]),[2,f]}})})};function Ce(e){return O(this,void 0,void 0,function(){var t,n,r,o,s,a,f,d,c,i,h;return I(this,function(b){switch(b.label){case 0:t={},n=[],r=e.slice(0),b.label=1;case 1:return r.length?(o=void 0,[4,r.shift()]):[3,13];case 2:return(s=b.sent())&&s.done?[4,s.done()]:[3,4];case 3:b.sent(),b.label=4;case 4:if(!function(v){if(!v)return!1;for(var l=v;Object.getPrototypeOf(l)!==null;)l=Object.getPrototypeOf(l);return Object.getPrototypeOf(v)===l}(o))return[3,11];for(f in o={},a=[],s)a.push(f);d=0,b.label=5;case 5:return d<a.length?(c=a[d],i=s[c],/^[A-Z]/.test(c)?i&&i.done?[4,i.done()]:[3,7]:[3,8]):[3,10];case 6:b.sent(),b.label=7;case 7:i&&i.objId?i={objId:i.objId}:typeof i=="function"&&(h=ae(),t[h]=i,i={callbackId:h}),b.label=8;case 8:o[c]=i,b.label=9;case 9:return d++,[3,5];case 10:return[3,12];case 11:s&&s.objId?o={objId:s.objId}:typeof s=="function"&&s.objId===void 0?(h=ae(),t[h]=s,o={callbackId:h}):o=s,b.label=12;case 12:return n.push(o),[3,1];case 13:return[2,[n,t]]}})})}var Re=function(e,t){t===void 0&&(t=!0);var n=A({},e),r=n.headers,o=r===void 0?{}:r,s=n.subscriptions,a=s===void 0?{}:s,f=n.mode,d=f===void 0?Y.nomal:f,c=n.commonOptions,i=o.backBtn,h=i===void 0?{}:i,b=o.shareBtn,v=b===void 0?{}:b,l=o.otherMenuBtn,w=l===void 0?{}:l,k=function(y,u){y.subscribe&&typeof y.subscribe=="function"&&(y.callback=u,a[u]=y.subscribe,t&&delete y.subscribe)};if(k(h,"wpsconfig_back_btn"),k(v,"wpsconfig_share_btn"),k(w,"wpsconfig_other_menu_btn"),w.items&&Array.isArray(w.items)){var L=[];w.items.forEach(function(y,u){switch(y===void 0&&(y={}),y.type){case"export_img":y.type=1,y.callback="export_img";break;case"export_pdf":y.type=1,y.callback="export_pdf";break;case"save_version":y.type=1,y.callback="save_version";break;case"about_wps":y.type=1,y.callback="about_wps";break;case"split_line":y.type=2;break;case"custom":y.type=3,k(y,"wpsconfig_other_menu_btn_"+u),L.push(y)}}),L.length&&(Me||ze)&&(w.items=L)}n.url=n.url||n.wpsUrl;var F=[];if((d===Y.simple||c&&c.isShowTopArea===!1)&&F.push("simple","hidecmb"),n.debug&&F.push("debugger"),n.url&&F.length&&(n.url=n.url+(n.url.indexOf("?")>=0?"&":"?")+F.join("&")),c&&(c.isParentFullscreen||c.isBrowserViewFullscreen)&&(document.addEventListener("fullscreenchange",be),document.addEventListener("webkitfullscreenchange",be),document.addEventListener("mozfullscreenchange",be)),n.wordOptions&&(n.wpsOptions=n.wordOptions),n.excelOptions&&(n.etOptions=n.excelOptions),n.pptOptions&&(n.wppOptions=n.pptOptions),typeof a.print=="object"){var m="wpsconfig_print";typeof a.print.subscribe=="function"&&(a[m]=a.print.subscribe,n.print={callback:m},a.print.custom!==void 0&&(n.print.custom=a.print.custom)),delete a.print}return typeof a.exportPdf=="function"&&(a[m="wpsconfig_export_pdf"]=a.exportPdf,n.exportPdf={callback:m},delete a.exportPdf),n.commandBars&&he(n.commandBars,!1),A(A({},n),{subscriptions:a})},Ve=function(e){e===void 0&&(e="");var t="";if(!t&&e){var n=e.toLowerCase();n.indexOf("/office/s/")!==-1&&(t=W.spreadsheet),n.indexOf("/office/w/")!==-1&&(t=W.writer),n.indexOf("/office/p/")!==-1&&(t=W.presentation),n.indexOf("/office/f/")!==-1&&(t=W.pdf)}if(!t){var r=e.match(/[\?&]type=([a-z]+)/)||[];t=G[r[1]]||""}return t};function he(e,t){t===void 0&&(t=!0);var n=e.map(function(r){var o=r.attributes;if(!Array.isArray(o)){var s=[];for(var a in o)if(o.hasOwnProperty(a)){var f={name:a,value:o[a]};s.push(f)}r.attributes=s}return r});return t&&H({data:n,eventName:"setCommandBars"}),n}var He=window.navigator.userAgent.toLowerCase(),Me=/Android|webOS|iPhone|iPod|BlackBerry|iPad/i.test(He),ze=function(){try{return window._parent.location.search.indexOf("from=wxminiprogram")!==-1}catch(e){return!1}}();function be(){var e={status:q.requestFullscreen},t=document,n=t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement;e.status=n?q.requestFullscreen:q.exitFullscreen,H({data:e,eventName:"fullscreenchange"})}var We=function(){N.idMap={}};function Fe(){console.group("JSSDK \u4E8B\u4EF6\u673A\u5236\u8C03\u6574\u8BF4\u660E"),console.warn("jssdk.on\u3001jssdk.off \u548C jssdk.Application.Sub \u5C06\u5728\u540E\u7EED\u7248\u672C\u4E2D\u88AB\u5F03\u7528\uFF0C\u5EFA\u8BAE\u4F7F\u7528\u6539\u8FDB\u540E\u7684 ApiEvent"),console.warn("\u5177\u4F53\u8BF7\u53C2\u8003\uFF1Ahttps://wwo.wps.cn/docs/front-end/basic-usage/events/intro/"),console.groupEnd()}var se=0,me=new Set;function ue(e){return se+=1,!e&&function(t){me.forEach(function(n){return n(t)})}(se),se}function ce(){var e=new Error("");return(e.stack||e.message||"").split(`
|
|
`).slice(2).join(`
|
|
`)}function qe(e,t){var n,r=this,o=t.Events,s=t.Enum,a=t.Props,f=a[0],d=a[1],c={objId:se};switch(function v(l,w,k){for(var L=w.slice(0),F=function(){var m=L.shift();!m.alias&&~je.indexOf(m.prop)&&L.push(A(A({},m),{alias:m.prop+"Async"})),Object.defineProperty(l,m.alias||m.prop,{get:function(){var y=this,u=m.cache===1,p=u&&this["__"+m.prop+"CacheValue"];if(!p){var j=ce(),U=ue(u),g=function(){for(var E,_=[],C=0;C<arguments.length;C++)_[C]=arguments[C];return m.caller!==void 0?function D(V,z,B){for(var P=z.slice(0),ee=function(){var x=P.shift();!x.alias&&~je.indexOf(x.prop)&&P.push(A(A({},x),{alias:x.prop+"Async"})),Object.defineProperty(V,x.alias||x.prop,{get:function(){var fe=this,de=x.cache===1,_e=de&&this["__"+x.prop+"CacheValue"];if(!_e){var Le=ce(),Je=ue(de),ne=function(){for(var pe,De=[],ge=0;ge<arguments.length;ge++)De[ge]=arguments[ge];return x.caller!==void 0?D(pe={objId:ue()},B[x.caller],B):pe={},$(ne,pe,"api.caller",{obj:ne,args:De,parentObjId:V.objId,objId:pe.objId,prop:x.prop},Le),pe};return ne.objId=-1,x.getter!==void 0&&(ne.objId=Je,D(ne,B[x.getter],B)),$(V,ne,"api.getter",{parentObjId:V.objId,objId:ne.objId,prop:x.prop},Le,function(){delete fe["__"+x.prop+"CacheValue"]}),de&&(this["__"+x.prop+"CacheValue"]=ne),ne}return _e},set:function(fe){var de=ce();return $(V,{},"api.setter",{value:fe,parentObjId:V.objId,objId:-1,prop:x.prop},de)}})};P.length;)ee()}(E={objId:ue()},k[m.caller],k):E={},$(g,E,"api.caller",{obj:g,args:_,parentObjId:l.objId,objId:E.objId,prop:m.prop},j),E};return g.objId=-1,m.getter!==void 0&&(g.objId=U,v(g,k[m.getter],k)),$(l,g,"api.getter",{parentObjId:l.objId,objId:g.objId,prop:m.prop},j,function(){delete y["__"+m.prop+"CacheValue"]}),u&&(this["__"+m.prop+"CacheValue"]=g),g}return p},set:function(y){var u=ce();return $(l,{},"api.setter",{value:y,parentObjId:l.objId,objId:-1,prop:m.prop},u)}})};L.length;)F()}(c,f,d),c.Events=o,c.Enum=s,e.Enum=c.Enum,e.Events=c.Events,e.Props=a,Ve(e.url)){case W.writer:e.WordApplication=e.WpsApplication=function(){return c};break;case W.spreadsheet:e.ExcelApplication=e.EtApplication=function(){return c};break;case W.presentation:e.PPTApplication=e.WppApplication=function(){return c};break;case W.pdf:e.PDFApplication=function(){return c}}e.Application=c,e.Free=function(v){return ke("api.free",{objId:v},"")},e.Stack=c.Stack=(n=function(v){e&&e.Free(v)},function(){var v=[],l=function(w){v.push(w)};return me.add(l),{End:function(){n(v),me.delete(l)}}});var i={};T.add(function(v){return O(r,void 0,void 0,function(){var l,w,k,L,F;return I(this,function(m){switch(m.label){case 0:return K(v)?[2]:(l=T.parse(v.data)).eventName==="api.event"&&l.data?(w=l.data,k=w.eventName,L=w.data,(F=i[k])?[4,F(L)]:[3,2]):[3,2];case 1:m.sent(),m.label=2;case 2:return[2]}})})}),c.Sub={};var h=function(v){var l=o[v];Object.defineProperty(c.Sub,l,{set:function(w){Fe(),i[l]=w,H({eventName:"api.event.register",data:{eventName:l,register:!!w,objId:se+=1}})}})};for(var b in o)h(b)}var je=["ExportAsFixedFormat","GetOperatorsInfo","ImportDataIntoFields","ReplaceText","ReplaceBookmark","GetBookmarkText","GetComments"];function Ae(e,t,n){for(var r=t.slice(0),o=function(){var s=r.shift();!s.alias&&~je.indexOf(s.prop)&&r.push(A(A({},s),{alias:s.prop+"Async"})),Object.defineProperty(e,s.alias||s.prop,{get:function(){var a=this,f=s.cache===1,d=f&&this["__"+s.prop+"CacheValue"];if(!d){var c=ce(),i=ue(f),h=function(){for(var v=[],l=0,w;l<arguments.length;l++)v[l]=arguments[l];return s.caller!==void 0?(w={objId:ue()},Ae(w,n[s.caller],n)):w={},$(b,w,"api.caller",{obj:b,args:v,parentObjId:e.objId,objId:w.objId,prop:s.prop},c),w},b=h;return b.objId=-1,s.getter!==void 0&&(b.objId=i,Ae(b,n[s.getter],n)),$(e,b,"api.getter",{parentObjId:e.objId,objId:b.objId,prop:s.prop},c,function(){delete a["__"+s.prop+"CacheValue"]}),f&&(this["__"+s.prop+"CacheValue"]=b),b}return d},set:function(a){var f=ce();return $(e,{},"api.setter",{value:a,parentObjId:e.objId,objId:-1,prop:s.prop},f)}})};r.length;)o()}function $(e,t,n,r,o,s){var a,f=(e.done?e.done():Promise.resolve()).then(function(){return a||(a=ke(n,r,o,s)),a});t.done=function(){return f},t.then=function(d,c){return r.objId>=0?(t.then=null,t.catch=null,f.then(function(){d(t)}).catch(function(i){return c(i)})):f.then(d,c)},t.catch=function(d){return f.catch(d)},t.Destroy=function(){return ke("api.free",{objId:t.objId},"")}}var M={},Z=null,oe={fileOpen:"fileOpen",tabSwitch:"tabSwitch",fileSaved:"fileSaved",fileStatus:"fileStatus",fullscreenChange:"fullscreenChange",error:"error",stage:"stage"},X={getToken:"api.getToken",onToast:"event.toast",onHyperLinkOpen:"event.hyperLinkOpen",getClipboardData:"api.getClipboardData"};function Te(e,t,n,r,o,s,a){var f=this;n===void 0&&(n={}),T.add(function(d){return O(f,void 0,void 0,function(){var c,i,h,b,v,l,w,k,L,F,m,y,u,p,j,U,g,E,_;return I(this,function(C){switch(C.label){case 0:return K(d)?[2]:(c=T.parse(d.data),i=c.eventName,h=i===void 0?"":i,b=c.data,v=b===void 0?null:b,l=c.url,w=l===void 0?null:l,["wps.jssdk.api"].indexOf(h)!==-1?[2]:h!=="ready"?[3,1]:(o.apiReadySended&&function(D){var V=[];Object.keys(M).forEach(function(z){M[z].forEach(function(B){var P=z;D.off(P,B),V.push({handle:B,eventName:P})}),delete M[z]}),V.forEach(function(z){var B=z.eventName,P=z.handle;Z==null||Z.ApiEvent.AddApiEventListener(B,P)})}(t),H({eventName:"setConfig",data:A(A({},n),{version:e.version})}),e.tokenData&&e.setToken(A(A({},e.tokenData),{hasRefreshTokenConfig:!!n.refreshToken})),e.iframeReady=!0,[3,15]));case 1:return h!=="error"?[3,2]:(t.emit(oe.error,v),[3,15]);case 2:return h!=="open.result"?[3,3]:(((g=v==null?void 0:v.fileInfo)===null||g===void 0?void 0:g.officeVersion)!==void 0&&(e.mainVersion=v.fileInfo.officeVersion,console.log("aliyun Main Version: V"+e.mainVersion)),t.emit(oe.fileOpen,v),[3,15]);case 3:return h!=="api.scroll"?[3,4]:(window.scrollTo(v.x,v.y),[3,15]);case 4:if(h!==X.getToken)return[3,9];k={token:!1},C.label=5;case 5:return C.trys.push([5,7,,8]),[4,o.refreshToken()];case 6:return k=C.sent(),[3,8];case 7:return L=C.sent(),console.error("refreshToken: "+(L||"fail to get")),[3,8];case 8:return H({eventName:X.getToken+".reply",data:k}),[3,15];case 9:if(h!==X.getClipboardData)return[3,14];F={text:"",html:""},C.label=10;case 10:return C.trys.push([10,12,,13]),[4,o.getClipboardData()];case 11:return F=C.sent(),[3,13];case 12:return m=C.sent(),console.error("getClipboardData: "+(m||"fail to get")),[3,13];case 13:return H({eventName:X.getClipboardData+".reply",data:F}),[3,15];case 14:h===X.onToast?o.onToast(v):h===X.onHyperLinkOpen?o.onHyperLinkOpen(v):h==="stage"?t.emit(oe.stage,v):h==="event.callback"?(y=v.eventName,u=v.data,p=y,y==="fullScreenChange"&&(p=oe.fullscreenChange),y==="file.saved"&&(p=oe.fileStatus),(!((E=n.commonOptions)===null||E===void 0)&&E.isBrowserViewFullscreen||!((_=n.commonOptions)===null||_===void 0)&&_.isParentFullscreen)&&p==="fullscreenchange"&&(j=u.status,U=u.isDispatchEvent,n.commonOptions.isBrowserViewFullscreen?function(D,V,z,B){D===0?V.style="position: static; width: "+z.width+"; height: "+z.height:D===1&&(V.style="position: absolute; width: 100%; height: 100%"),B&&function(P){["fullscreen","fullscreenElement"].forEach(function(x){Object.defineProperty(document,x,{get:function(){return!!P.status},configurable:!0})});var ee=new CustomEvent("fullscreenchange");document.dispatchEvent(ee)}({status:D})}(j,s,a,U):n.commonOptions.isParentFullscreen&&function(D,V,z){var B=document.querySelector(z),P=B&&B.nodeType===1?B:V;if(D===0){var ee=document,x=ee.exitFullscreen||ee.mozCancelFullScreen||ee.msExitFullscreen||ee.webkitCancelFullScreen||ee.webkitExitFullscreen;x.call(document)}else if(D===1){var fe=P.requestFullscreen||P.mozRequestFullScreen||P.msRequestFullscreen||P.webkitRequestFullscreen;fe.call(P)}}(j,s,n.commonOptions.isParentFullscreen)),t.emit(p,u)):h==="api.ready"&&qe(e,v),C.label=15;case 15:return typeof r[h]=="function"&&r[h](e,w||v),[2]}})})})}function Ee(e){return new Promise(function(t){var n=function(r){K(r)||T.parse(r.data).eventName===e&&(t(),T.remove(n))};T.add(n)})}function xe(e){var t,n=this;e===void 0&&(e={}),Z&&Z.destroy();try{var r=Re(e),o=r.subscriptions,s=o===void 0?{}:o,a=r.mount,f=a===void 0?null:a,d=r.url,c=r.refreshToken,i=r.onToast,h=r.onHyperLinkOpen,b=r.getClipboardData;te("origin",(d.match(/https*:\/\/[^\/]+/g)||[])[0]);var v=we(d,f),l=Ee("ready"),w=Ee("open.result"),k=Ee("api.ready"),L=f?{width:f.clientWidth+"px",height:f.clientHeight+"px"}:{width:"100vw",height:"100vh"};delete r.mount,d&&delete r.url,delete r.subscriptions;var F=(t=t||Object.create(null),{on:function(u,p){(t[u]||(t[u]=[])).push(p)},off:function(u,p){t[u]&&t[u].splice(t[u].indexOf(p)>>>0,1)},emit:function(u,p){(t[u]||[]).slice().map(function(j){j(p)}),(t["*"]||[]).slice().map(function(j){j(u,p)})}}),m={apiReadySended:!1},y=function(u,p,j){return O(n,void 0,void 0,function(){return I(this,function(U){switch(U.label){case 0:return function(g,E,_){if(M[g]){var C=!!M[g].find(function(D){return D===E});return C&&_==="off"?(F.off(g,E),M[g]=M[g].filter(function(D){return D!==E}),!!M[g].length||(M[g]=void 0,!1)):(C||_!=="on"||(M[g].push(E),F.on(g,E)),!0)}return _==="on"?(M[g]=[],M[g].push(E),!1):_==="off"||void 0}(u,p,j)?[3,2]:[4,l];case 1:U.sent(),function(g,E){var _=g.eventName,C=g.type,D=g.handle;E==="on"?F.on(_,D):F.off(_,D),C==="base.event"&&H({eventName:"basic.event",data:{eventName:_,action:E}}),Fe()}(function(g,E){var _=g,C="base.event";switch(_){case oe.fileSaved:console.warn("fileSaved\u4E8B\u4EF6\u76D1\u542C\u5373\u5C06\u5F03\u7528\uFF0C \u63A8\u8350\u4F7F\u7528fileStatus\u8FDB\u884C\u6587\u4EF6\u72B6\u6001\u7684\u76D1\u542C"),_="fileStatus";break;case oe.fullscreenChange:_="fullscreenchange";break;case"error":case"fileOpen":C="callback.event"}return{eventName:_,type:C,handle:E}}(u,p),j),U.label=2;case 2:return[2]}})})};return Z={url:d,iframe:v,version:"1.1.19",iframeReady:!1,tokenData:null,commandBars:null,tabs:{getTabs:function(){return O(this,void 0,void 0,function(){return I(this,function(u){switch(u.label){case 0:return[4,l];case 1:return u.sent(),[2,ye({api:"tab.getTabs"})]}})})},switchTab:function(u){return O(this,void 0,void 0,function(){return I(this,function(p){switch(p.label){case 0:return[4,l];case 1:return p.sent(),[2,ye({api:"tab.switchTab",args:{tabKey:u}})]}})})}},setCooperUserColor:function(u){return O(this,void 0,void 0,function(){return I(this,function(p){switch(p.label){case 0:return[4,l];case 1:return p.sent(),[2,ye({api:"setCooperUserColor",args:u})]}})})},setToken:function(u){return O(this,void 0,void 0,function(){return I(this,function(p){switch(p.label){case 0:return[4,l];case 1:return p.sent(),Z.tokenData=u,H({eventName:"setToken",data:u}),[2]}})})},ready:function(){return O(this,void 0,void 0,function(){return I(this,function(u){switch(u.label){case 0:return m.apiReadySended?[3,2]:[4,w];case 1:u.sent(),m.apiReadySended=!0,H({eventName:"api.ready"}),u.label=2;case 2:return[4,k];case 3:return u.sent(),[2,new Promise(function(p){return setTimeout(function(){return p(Z==null?void 0:Z.Application)},0)})]}})})},destroy:function(){M={},v.destroy(),T.empty(),Z=null,me=new Set,se=0,document.removeEventListener("fullscreenchange",be),We()},save:function(){return O(this,void 0,void 0,function(){return I(this,function(u){switch(u.label){case 0:return[4,l];case 1:return u.sent(),[2,Pe({api:"save"})]}})})},setCommandBars:function(u){return O(this,void 0,void 0,function(){return I(this,function(p){switch(p.label){case 0:return[4,l];case 1:return p.sent(),he(u),[2]}})})},updateConfig:function(u){return u===void 0&&(u={}),O(this,void 0,void 0,function(){return I(this,function(p){switch(p.label){case 0:return[4,l];case 1:return p.sent(),u.commandBars?(console.warn("Deprecated: `updateConfig()` \u65B9\u6CD5\u5373\u5C06\u5E9F\u5F03\uFF0C\u8BF7\u4F7F\u7528`setCommandBars()`\u4EE3\u66FF`updateConfig()`\u66F4\u65B0`commandBars`\u914D\u7F6E\u3002"),[4,he(u.commandBars)]):[3,3];case 2:p.sent(),p.label=3;case 3:return[2]}})})},executeCommandBar:function(u){return O(this,void 0,void 0,function(){return I(this,function(p){switch(p.label){case 0:return[4,l];case 1:return p.sent(),he([{cmbId:u,attributes:[{name:"click",value:!0}]}]),[2]}})})},on:function(u,p){return O(this,void 0,void 0,function(){return I(this,function(j){return[2,this.ApiEvent.AddApiEventListener(u,p)]})})},off:function(u,p){return O(this,void 0,void 0,function(){return I(this,function(j){return[2,this.ApiEvent.RemoveApiEventListener(u,p)]})})},ApiEvent:{AddApiEventListener:function(u,p){return O(this,void 0,void 0,function(){return I(this,function(j){switch(j.label){case 0:return[4,y(u,p,"on")];case 1:return[2,j.sent()]}})})},RemoveApiEventListener:function(u,p){return O(this,void 0,void 0,function(){return I(this,function(j){switch(j.label){case 0:return[4,y(u,p,"off")];case 1:return[2,j.sent()]}})})}}},function(u,p,j,U,g,E){p&&le(p)&&(g.refreshToken=p,u.refreshToken={eventName:X.getToken}),E&&le(E)&&(g.getClipboardData=E,u.getClipboardData={eventName:X.getClipboardData}),j&&le(j)&&(g.onToast=j,u.onToast={eventName:X.onToast}),U&&le(U)&&(g.onHyperLinkOpen=U,u.onHyperLinkOpen={eventName:X.onHyperLinkOpen})}(r,c,i,h,m,b),Te(Z,F,r,s,m,v,L),Z}catch(u){console.error(u)}}console.log("aliyun JS-SDK V1.1.19");var Ue=Object.freeze({__proto__:null,listener:Te,config:xe});window.WPS=Ue;var Se=xe,Ge={config:Se};Q.config=Se,Q.default=Ge,Object.defineProperty(Q,"__esModule",{value:!0})})},79700:function(Ne,ve,Q){"use strict";Q.r(ve),Q.d(ve,{default:function(){return W}});var A=Q(59301),O=Q(71419),I=Q.n(O),T=(G,Y,q)=>new Promise((ie,te)=>{var J=S=>{try{re(q.next(S))}catch(R){te(R)}},K=S=>{try{re(q.throw(S))}catch(R){te(R)}},re=S=>S.done?ie(S.value):Promise.resolve(S.value).then(J,K);re((q=q.apply(G,Y)).next())}),W=()=>{const G=(0,A.useRef)(),Y={accessToken:"e37cf86890354732b6c19cf3e7890aecv3",accessTokenExpiredTime:"2025-03-17T09:22:59.116008714Z",refreshToken:"38a40a2ce30c40638f57271865adeddav3",refreshTokenExpiredTime:"2025-03-18T08:52:59.116008714Z",requestId:"6B594144-0935-5ADF-B2AE-74FE41080786",webofficeURL:"https://office-cn-beijing.imm.aliyuncs.com/office/p/2eb6686a9a908028e608a021baab7a0afe8616b2?_w_tokentype=1"};(0,A.useEffect)(()=>{q()},[]);function q(){return T(this,null,function*(){var J=document.getElementById("weboffice-zone");G.current=I().config({mount:J,url:Y.webofficeURL,refreshToken:ie}),G.current.setToken({token:Y.accessToken,timeout:25*60*1e3}),G.current.on("fileStatus",function(K){console.log("fileStatus:",K)}),te()})}function ie(){}function te(){return T(this,null,function*(){yield G.current.ready();const J=G.current.Application;console.log("app:",J);const S=yield(yield(yield J.ActivePresentation).Slides).Count;console.log("count:",S);const R=yield J.ActivePresentation.SlideShowWindow.View.Slide.SlideIndex;console.log("curryPage:",R),J.Sub.SlideSelectionChanged=ae=>T(this,null,function*(){console.log("\u5207\u6362\u540E\u7684\u9875\u7801\uFF1A",ae)})})}return A.createElement("div",{id:"weboffice-zone",style:{height:"100vh"}})}}}]);
|