var v=(n,e,t)=>new Promise((o,i)=>{var r=l=>{try{c(t.next(l))}catch(a){i(a)}},p=l=>{try{c(t.throw(l))}catch(a){i(a)}},c=l=>l.done?o(l.value):Promise.resolve(l.value).then(r,p);c((t=t.apply(n,e)).next())});import{X as axios,V as ElMessageBox}from"./index.9fabe127.js";var pluginsMode=location.search.split("=")[1],pluginType=WpsInvoke.ClientType.wps,pluginName="WpsOAAssist",wpsClient=new WpsClient(pluginType),clientStr=pluginName+pluginType+"ClientId";function _WpsInvoke(n,e,t,o){var i={};i.funcs=n,o&&(e=!1),pluginsMode!=2?singleInvoke(i,e,t,o):multInvoke(i,e,t,o)}function singleInvoke(n,e,t,o){WpsInvoke.InvokeAsHttp(pluginType,pluginName,"dispatcher",n,function(i){if(i.status){if(i.status==100){WpsInvoke.AuthHttpesCert('\u8BF7\u5728\u7A0D\u540E\u6253\u5F00\u7684\u7F51\u9875\u4E2D\uFF0C\u70B9\u51FB"\u9AD8\u7EA7" => "\u7EE7\u7EED\u524D\u5F80"\uFF0C\u5B8C\u6210\u6388\u6743\u3002');return}alert(i.message)}else console.log(i.response),showresult(i.response)},e,t,o),WpsInvoke.RegWebNotify(pluginType,pluginName,handleOaMessage)}function multInvoke(n,e,t,o){wpsClient.jsPluginsXml=t||"https://127.0.0.1:3888/jsplugins.xml",localStorage.getItem(clientStr)&&(wpsClient.clientId=localStorage.getItem(clientStr)),o?wpsClient.StartWpsInSilentMode(pluginName,function(){mult(n,e)}):mult(n,e),wpsClient.onMessage=handleOaMessage}function mult(n,e){wpsClient.InvokeAsHttp(pluginName,"dispatcher",n,function(t){if(wpsClient.clientId&&localStorage.setItem(clientStr,wpsClient.clientId),t.status!==0){if(console.log(t),t.message=='{"data": "Failed to send message to WPS."}'){wpsClient.IsClientRunning(function(o){console.log(o),o.response=="Client\xA0is\xA0running."?alert("\u4EFB\u52A1\u53D1\u9001\u5931\u8D25\uFF0CWPS\xA0\u6B63\u5728\u6267\u884C\u5176\u4ED6\u4EFB\u52A1\uFF0C\u8BF7\u524D\u5F80WPS\u5B8C\u6210\u5F53\u524D\u4EFB\u52A1"):(wpsClient.clientId="",wpsClient.notifyRegsitered=!1,localStorage.setItem(clientStr,""),mult(n))});return}else if(t.status==100)return;alert(t.message)}else console.log(t.response)},e)}function handleOaMessage(n){console.log(n)}function showresult(resultData){let json=eval("("+resultData+")");switch(json.message){case"GetDocStatus":{let n=json.docstatus;if(typeof n!="undefined"){let e="\u6587\u6863\u4FDD\u5B58\u72B6\u6001\uFF1A"+n.saved+`
\u6587\u6863\u5B57\u6570\uFF1A`+n.words+`
\u6587\u6863\u9875\u6570\uFF1A`+n.pages;alert(e)}}}}var _wps={};function newDoc(){_WpsInvoke([{NewDoc:{}}],!0)}_wps.newDoc={action:newDoc,code:_WpsInvoke.toString()+`

`+newDoc.toString(),detail:`
  \u8BF4\u660E\uFF1A
    \u70B9\u51FB\u6309\u94AE\uFF0C\u6253\u5F00WPS\u6587\u5B57\u540E,\u65B0\u5EFA\u4E00\u4E2A\u7A7A\u767Ddoc\u6587\u6863

  \u65B9\u6CD5\u4F7F\u7528\uFF1A
    \u9875\u9762\u70B9\u51FB\u6309\u94AE\uFF0C\u901A\u8FC7wps\u5BA2\u6237\u7AEF\u534F\u8BAE\u6765\u542F\u52A8WPS\uFF0C\u8C03\u7528oaassist\u63D2\u4EF6\uFF0C\u6267\u884C\u63D2\u4EF6\u4E2D\u7684js\u51FD\u6570NewDoc,\u65B0\u5EFA\u4E00\u4E2A\u7A7A\u767Ddoc
    funcs\u53C2\u6570\u8BF4\u660E:
        NewDoc\u65B9\u6CD5\u5BF9\u5E94\u4E8EOA\u52A9\u624Bdispatcher\u652F\u6301\u7684\u65B9\u6CD5\u540D
`};function GetDemoPath(n){var e=document.location.host;return document.location.protocol+"//"+e+"/file/"+n}function GetUploadPath(){var n=document.location.host;return document.location.protocol+"//"+n+"/Upload"}function GetDemoPngPath(){var n=document.location.toString();return n=decodeURI(n),n.indexOf("/")!=-1&&(n=n.substring(0,n.lastIndexOf("/"))),n.length!==0&&(n=n.concat("/WPS.png")),String.prototype.startsWith||(String.prototype.startsWith=function(e,t){return t=t||0,this.indexOf(e,t)===t}),n.startsWith("file:///")&&(n=n.substr(8)),n}function openDoc(n){_WpsInvoke([{OpenDoc:n}])}_wps.openDoc={action:openDoc,code:_WpsInvoke.toString()+`

`+openDoc.toString(),detail:`
  \u8BF4\u660E\uFF1A
    \u70B9\u51FB\u6309\u94AE\uFF0C\u8F93\u5165\u8981\u6253\u5F00\u7684\u6587\u6863\u8DEF\u5F84\uFF0C\u8F93\u5165\u6587\u6863\u4E0A\u4F20\u63A5\u53E3\uFF0C\u5982\u679C\u4F20\u7684\u4E0D\u662F\u6709\u6548\u7684\u670D\u52A1\u7AEF\u5730\u5740\uFF0C\u5C06\u65E0\u6CD5\u4F7F\u7528\u4FDD\u5B58\u4E0A\u4F20\u529F\u80FD\u3002
    \u6253\u5F00WPS\u6587\u5B57\u540E,\u5C06\u6839\u636E\u6587\u6863\u8DEF\u5F84\u4E0B\u8F7D\u5E76\u6253\u5F00\u5BF9\u5E94\u7684\u6587\u6863\uFF0C\u4FDD\u5B58\u5C06\u81EA\u52A8\u4E0A\u4F20\u6307\u5B9A\u670D\u52A1\u5668\u5730\u5740

  \u65B9\u6CD5\u4F7F\u7528\uFF1A
    \u9875\u9762\u70B9\u51FB\u6309\u94AE\uFF0C\u901A\u8FC7wps\u5BA2\u6237\u7AEF\u534F\u8BAE\u6765\u542F\u52A8WPS\uFF0C\u8C03\u7528oaassist\u63D2\u4EF6\uFF0C\u6267\u884C\u4F20\u8F93\u6570\u636E\u4E2D\u7684\u6307\u4EE4
    funcs\u53C2\u6570\u4FE1\u606F\u8BF4\u660E:
        OpenDoc\u65B9\u6CD5\u5BF9\u5E94\u4E8EOA\u52A9\u624Bdispatcher\u652F\u6301\u7684\u65B9\u6CD5\u540D
            uploadPath \u4FDD\u5B58\u6587\u6863\u4E0A\u4F20\u63A5\u53E3
            fileName \u6253\u5F00\u7684\u6587\u6863\u8DEF\u5F84
            uploadFieldName \u6587\u6863\u4E0A\u4F20\u5230\u4E1A\u52A1\u7CFB\u7EDF\u65F6\u81EA\u5B9A\u4E49\u5B57\u6BB5
            picPath \u63D2\u5165\u56FE\u7247\u7684\u8DEF\u5F84
            copyUrl \u5907\u4EFD\u7684\u670D\u52A1\u5668\u8DEF\u5F84
            userName \u4F20\u7ED9wps\u8981\u663E\u793A\u7684OA\u7528\u6237\u540D
`};function onlineEditDoc(){var n=prompt("\u8BF7\u8F93\u5165\u6253\u5F00\u6587\u4EF6\u8DEF\u5F84\uFF08\u672C\u5730\u6216\u662Furl\uFF09\uFF1A",GetDemoPath("\u6837\u7AE0.docx")),e=prompt("\u8BF7\u8F93\u5165\u6587\u6863\u4E0A\u4F20\u63A5\u53E3:",GetUploadPath()),t=prompt("\u8BF7\u8F93\u5165\u6587\u6863\u4E0A\u4F20\u5230\u4E1A\u52A1\u7CFB\u7EDF\u65F6\u81EA\u5B9A\u4E49\u5B57\u6BB5\uFF1A","\u81EA\u5B9A\u4E49\u5B57\u6BB5");_WpsInvoke([{OnlineEditDoc:{uploadPath:e,fileName:n,uploadFieldName:t,buttonGroups:"btnSaveAsFile,btnImportDoc,btnPageSetup,btnInsertDate,btnSelectBookmark",userName:"\u4E1C\u65B9\u4E0D\u8D25"}}],!0)}_wps.onlineEditDoc={action:onlineEditDoc,code:_WpsInvoke.toString()+`

`+onlineEditDoc.toString(),detail:`
  \u8BF4\u660E\uFF1A
    \u70B9\u51FB\u6309\u94AE\uFF0C\u8F93\u5165\u8981\u6253\u5F00\u7684\u6587\u6863\u8DEF\u5F84\uFF0C\u8F93\u5165\u6587\u6863\u4E0A\u4F20\u63A5\u53E3\uFF0C\u5982\u679C\u4F20\u7684\u4E0D\u662F\u6709\u6548\u7684\u670D\u52A1\u7AEF\u5730\u5740\uFF0C\u5C06\u65E0\u6CD5\u4F7F\u7528\u4FDD\u5B58\u4E0A\u4F20\u529F\u80FD\u3002
    \u6253\u5F00WPS\u6587\u5B57\u540E,\u5C06\u6839\u636E\u6587\u6863\u8DEF\u5F84\u5728\u7EBF\u6253\u5F00\u5BF9\u5E94\u7684\u6587\u6863\uFF0C\u4FDD\u5B58\u5C06\u81EA\u52A8\u4E0A\u4F20\u6307\u5B9A\u670D\u52A1\u5668\u5730\u5740
    
  \u65B9\u6CD5\u4F7F\u7528\uFF1A
    \u9875\u9762\u70B9\u51FB\u6309\u94AE\uFF0C\u901A\u8FC7wps\u5BA2\u6237\u7AEF\u534F\u8BAE\u6765\u542F\u52A8WPS\uFF0C\u8C03\u7528oaassist\u63D2\u4EF6\uFF0C\u6267\u884C\u4F20\u8F93\u6570\u636E\u4E2D\u7684\u6307\u4EE4
    funcs\u53C2\u6570\u4FE1\u606F\u8BF4\u660E:
        onlineEditDoc\u65B9\u6CD5\u5BF9\u5E94\u4E8EOA\u52A9\u624Bdispatcher\u652F\u6301\u7684\u65B9\u6CD5\u540D
            uploadPath \u4FDD\u5B58\u6587\u6863\u4E0A\u4F20\u63A5\u53E3
            fileName \u6253\u5F00\u7684\u6587\u6863\u8DEF\u5F84
            uploadFieldName \u6587\u6863\u4E0A\u4F20\u5230\u4E1A\u52A1\u7CFB\u7EDF\u65F6\u81EA\u5B9A\u4E49\u5B57\u6BB5
            buttonGroups \u5C4F\u853D\u7684OA\u52A9\u624B\u529F\u80FD\u6309\u94AE
            userName \u4F20\u7ED9wps\u8981\u663E\u793A\u7684OA\u7528\u6237\u540D
`};function openRevision(){var n=prompt("\u8BF7\u8F93\u5165\u6253\u5F00\u6587\u4EF6\u8DEF\u5F84\uFF08\u672C\u5730\u6216\u662Furl\uFF09\uFF1A",GetDemoPath("\u6837\u7AE0.docx")),e=prompt("\u8BF7\u8F93\u5165\u6587\u6863\u4E0A\u4F20\u63A5\u53E3:");_WpsInvoke([{OpenDoc:{uploadPath:e,fileName:n,userName:"\u738B\u4E94",revisionCtrl:{bOpenRevision:!0,bShowRevision:!0}}}])}_wps.openRevision={action:openRevision,code:_WpsInvoke.toString()+`

`+openRevision.toString(),detail:`
  \u8BF4\u660E\uFF1A
    \u70B9\u51FB\u6309\u94AE\uFF0C\u8F93\u5165\u53C2\u6570\u540E\uFF0C\u6253\u5F00WPS\u6587\u5B57\u540E\uFF0C\u6253\u5F00\u6307\u5B9A\u6587\u6863\uFF0C\u5E76\u6253\u5F00\u4FEE\u8BA2\u529F\u80FD\uFF0C\u5E76\u663E\u793A\u4FEE\u8BA2
    
  \u65B9\u6CD5\u4F7F\u7528\uFF1A
    \u9875\u9762\u70B9\u51FB\u6309\u94AE\uFF0C\u901A\u8FC7wps\u5BA2\u6237\u7AEF\u534F\u8BAE\u6765\u542F\u52A8WPS\uFF0C\u8C03\u7528oaassist\u63D2\u4EF6\uFF0C\u6267\u884C\u4F20\u8F93\u6570\u636E\u4E2D\u7684\u6307\u4EE4
    funcs\u53C2\u6570\u4FE1\u606F\u8BF4\u660E:
    OpenDoc\u65B9\u6CD5\u5BF9\u5E94\u4E8EOA\u52A9\u624Bdispatcher\u652F\u6301\u7684\u65B9\u6CD5\u540D
        userName \u7528\u6237\u540D\uFF0C\u8BBE\u7F6E\u5F53\u524D\u7F16\u8F91\u7528\u6237\u540D
        fileName \u6253\u5F00\u7684\u6587\u6863\u8DEF\u5F84
        revisionCtrl \u4FEE\u8BA2\u529F\u80FD\u63A7\u5236\u53C2\u6570
`};function closeRevision(){var n=prompt("\u8BF7\u8F93\u5165\u6253\u5F00\u6587\u4EF6\u8DEF\u5F84\uFF08\u672C\u5730\u6216\u662Furl\uFF09\uFF1A",GetDemoPath("\u6837\u7AE0.docx")),e=prompt("\u8BF7\u8F93\u5165\u6587\u6863\u4E0A\u4F20\u63A5\u53E3:");_WpsInvoke([{OpenDoc:{uploadPath:e,fileName:n,userName:"\u738B\u4E94",revisionCtrl:{bOpenRevision:!1,bShowRevision:!1}}}])}_wps.closeRevision={action:closeRevision,code:_WpsInvoke.toString()+`

`+closeRevision.toString(),detail:`
  \u8BF4\u660E\uFF1A
    \u70B9\u51FB\u6309\u94AE\uFF0C\u8F93\u5165\u53C2\u6570\u540E\uFF0C\u6253\u5F00WPS\u6587\u5B57\u540E\uFF0C\u6253\u5F00\u6307\u5B9A\u6587\u6863\uFF0C\u5E76\u5173\u95ED\u4FEE\u8BA2\u529F\u80FD
    
  \u65B9\u6CD5\u4F7F\u7528\uFF1A
    \u9875\u9762\u70B9\u51FB\u6309\u94AE\uFF0C\u901A\u8FC7wps\u5BA2\u6237\u7AEF\u534F\u8BAE\u6765\u542F\u52A8WPS\uFF0C\u8C03\u7528oaassist\u63D2\u4EF6\uFF0C\u6267\u884C\u4F20\u8F93\u6570\u636E\u4E2D\u7684\u6307\u4EE4
    funcs\u53C2\u6570\u4FE1\u606F\u8BF4\u660E:
    OpenDoc\u65B9\u6CD5\u5BF9\u5E94\u4E8EOA\u52A9\u624Bdispatcher\u652F\u6301\u7684\u65B9\u6CD5\u540D
        userName \u7528\u6237\u540D\uFF0C\u8BBE\u7F6E\u5F53\u524D\u7F16\u8F91\u7528\u6237\u540D
        fileName \u6253\u5F00\u7684\u6587\u6863\u8DEF\u5F84
        revisionCtrl \u4FEE\u8BA2\u529F\u80FD\u63A7\u5236\u53C2\u6570
`};function protectOpen(){var n=prompt("\u8BF7\u8F93\u5165\u6253\u5F00\u6587\u4EF6\u8DEF\u5F84\uFF08\u672C\u5730\u6216\u662Furl\uFF09\uFF1A",GetDemoPath("\u6837\u7AE0.docx")),e=prompt("\u8BF7\u8F93\u5165\u6587\u6863\u4E0A\u4F20\u63A5\u53E3:");_WpsInvoke([{OpenDoc:{uploadPath:e,fileName:n,openType:{protectType:3,password:"123456"}}}])}_wps.protectOpen={action:protectOpen,code:_WpsInvoke.toString()+`

`+protectOpen.toString(),detail:`
  \u8BF4\u660E\uFF1A
    \u70B9\u51FB\u6309\u94AE\uFF0C\u8F93\u5165\u53C2\u6570\u540E\uFF0C\u6253\u5F00WPS\u6587\u5B57\u540E\uFF0C\u6253\u5F00\u4F7F\u7528\u4FDD\u62A4\u6A21\u5F0F\u6307\u5B9A\u6587\u6863
    
  \u65B9\u6CD5\u4F7F\u7528\uFF1A
    \u9875\u9762\u70B9\u51FB\u6309\u94AE\uFF0C\u901A\u8FC7wps\u5BA2\u6237\u7AEF\u534F\u8BAE\u6765\u542F\u52A8WPS\uFF0C\u8C03\u7528oaassist\u63D2\u4EF6\uFF0C\u6267\u884C\u4F20\u8F93\u6570\u636E\u4E2D\u7684\u6307\u4EE4
    funcs\u53C2\u6570\u4FE1\u606F\u8BF4\u660E:
    OpenDoc\u65B9\u6CD5\u5BF9\u5E94\u4E8EOA\u52A9\u624Bdispatcher\u652F\u6301\u7684\u65B9\u6CD5\u540D
        uploadPath \u4FDD\u5B58\u6587\u6863\u4E0A\u4F20\u63A5\u53E3
        fileName \u6253\u5F00\u7684\u6587\u6863\u8DEF\u5F84
        openType \u6587\u6863\u6253\u5F00\u65B9\u5F0F\u63A7\u5236\u53C2\u6570 protectType\uFF1A1\uFF1A\u4E0D\u542F\u7528\u4FDD\u62A4\u6A21\u5F0F\uFF0C0\uFF1A\u53EA\u5141\u8BB8\u5BF9\u73B0\u6709\u5185\u5BB9\u8FDB\u884C\u4FEE\u8BA2\uFF0C
        		1\uFF1A\u53EA\u5141\u8BB8\u6DFB\u52A0\u6279\u6CE8\uFF0C2\uFF1A\u53EA\u5141\u8BB8\u4FEE\u6539\u7A97\u4F53\u57DF(\u7981\u6B62\u62F7\u8D1D\u529F\u80FD)\uFF0C3\uFF1A\u53EA\u8BFB password\u4E3A\u5BC6\u7801
`};function openWithPassWd(){var n=prompt("\u8BF7\u8F93\u5165\u6253\u5F00\u6587\u4EF6\u8DEF\u5F84\uFF08\u672C\u5730\u6216\u662Furl\uFF09\uFF1A"),e=prompt("\u8BF7\u8F93\u5165\u6587\u6863\u6253\u5F00\u5BC6\u7801:"),t=prompt("\u8BF7\u8F93\u5165\u6587\u6863\u4E0A\u4F20\u63A5\u53E3:");_WpsInvoke([{OpenDoc:{uploadPath:t,fileName:n,docPassword:{docPassword:e}}}])}_wps.openWithPassWd={action:openWithPassWd,code:_WpsInvoke.toString()+`

`+openWithPassWd.toString(),detail:`
  \u8BF4\u660E\uFF1A
    \u70B9\u51FB\u6309\u94AE\uFF0C\u8F93\u5165\u53C2\u6570\u540E\uFF0C\u6253\u5F00WPS\u6587\u5B57\u540E\uFF0C\u4F7F\u7528\u6307\u5B9A\u5BC6\u7801\u6253\u5F00\u6307\u5B9A\u52A0\u5BC6\u6587\u6863
    
  \u65B9\u6CD5\u4F7F\u7528\uFF1A
    \u9875\u9762\u70B9\u51FB\u6309\u94AE\uFF0C\u901A\u8FC7wps\u5BA2\u6237\u7AEF\u534F\u8BAE\u6765\u542F\u52A8WPS\uFF0C\u8C03\u7528oaassist\u63D2\u4EF6\uFF0C\u6267\u884C\u4F20\u8F93\u6570\u636E\u4E2D\u7684\u6307\u4EE4
    funcs\u53C2\u6570\u4FE1\u606F\u8BF4\u660E:
    OpenDoc\u65B9\u6CD5\u5BF9\u5E94\u4E8EOA\u52A9\u624Bdispatcher\u652F\u6301\u7684\u65B9\u6CD5\u540D
        uploadPath \u4FDD\u5B58\u6587\u6863\u4E0A\u4F20\u63A5\u53E3
        fileName \u6253\u5F00\u7684\u6587\u6863\u8DEF\u5F84
        docPassword \u6587\u6863\u5BC6\u7801
`};function insertRedHeader(){var n=prompt("\u8BF7\u8F93\u5165\u6253\u5F00\u6587\u4EF6\u8DEF\u5F84\uFF0C\u5982\u679C\u4E3A\u7A7A\u5219\u5BF9\u6D3B\u52A8\u6587\u6863\u5957\u7EA2\uFF1A",GetDemoPath("\u6837\u7AE0.docx")),e=prompt("\u8BF7\u8F93\u5165\u7EA2\u5934\u6A21\u677F\u8DEF\u5F84\uFF08\u672C\u5730\u6216\u662Furl\uFF09:",GetDemoPath("\u7EA2\u5934\u6587\u4EF6.docx"));n!=""&&n!=null?_WpsInvoke([{OnlineEditDoc:{fileName:n,insertFileUrl:e,bkInsertFile:"Content",buttonGroups:"btnSaveAsFile,btnImportDoc,btnPageSetup,btnInsertDate,btnSelectBookmark"}}]):_WpsInvoke([{InsertRedHead:{insertFileUrl:e,bkInsertFile:"Content"}}])}_wps.insertRedHeader={action:insertRedHeader,code:_WpsInvoke.toString()+`

`+insertRedHeader.toString(),detail:`
  \u8BF4\u660E\uFF1A
    \u70B9\u51FB\u6309\u94AE\uFF0C\u8F93\u5165\u53C2\u6570\u540E\uFF0C\u6253\u5F00WPS\u6587\u5B57\u540E\uFF0C\u6253\u5F00\u6307\u5B9A\u6587\u6863\uFF0C\u7136\u540E\u4F7F\u7528\u6307\u5B9A\u7EA2\u5934\u6A21\u677F\u5BF9\u8BE5\u6587\u6863\u8FDB\u884C\u5957\u7EA2\u5934
    
  \u65B9\u6CD5\u4F7F\u7528\uFF1A
    \u9875\u9762\u70B9\u51FB\u6309\u94AE\uFF0C\u901A\u8FC7wps\u5BA2\u6237\u7AEF\u534F\u8BAE\u6765\u542F\u52A8WPS\uFF0C\u8C03\u7528oaassist\u63D2\u4EF6\uFF0C\u6267\u884C\u4F20\u8F93\u6570\u636E\u4E2D\u7684\u6307\u4EE4
    funcs\u53C2\u6570\u4FE1\u606F\u8BF4\u660E:
    OpenDoc\u65B9\u6CD5\u5BF9\u5E94\u4E8EOA\u52A9\u624Bdispatcher\u652F\u6301\u7684\u65B9\u6CD5\u540D
        fileName \u6253\u5F00\u7684\u6587\u6863\u8DEF\u5F84
        insertFileUrl \u6307\u5B9A\u7684\u7EA2\u5934\u6A21\u677F
        bkInsertFile \u7EA2\u5934\u6A21\u677F\u4E2D\u6B63\u6587\u7684\u4F4D\u7F6E\u4E66\u7B7E\u540D
    InsertRedHead\u65B9\u6CD5\u5BF9\u5E94\u4E8EOA\u52A9\u624Bdispatcher\u652F\u6301\u7684\u65B9\u6CD5\u540D
        insertFileUrl \u6307\u5B9A\u7684\u7EA2\u5934\u6A21\u677F
        bkInsertFile \u7EA2\u5934\u6A21\u677F\u4E2D\u6B63\u6587\u7684\u4F4D\u7F6E\u4E66\u7B7E\u540D
`};function fillTemplate(){var n=prompt("\u8BF7\u8F93\u5165\u6253\u5F00\u6587\u4EF6\u8DEF\u5F84\uFF08\u672C\u5730\u6216\u662Furl\uFF09\uFF1A",GetDemoPath("\u6837\u7AE02.docx")),e=prompt("\u8BF7\u8F93\u5165\u9700\u8981\u586B\u5145\u7684\u6570\u636E\u7684\u8BF7\u6C42\u5730\u5740:",document.location.protocol+"//"+document.location.host+"/getTemplateData");_WpsInvoke([{OpenDoc:{fileName:n,templateDataUrl:e}}])}_wps.fillTemplate={action:fillTemplate,code:_WpsInvoke.toString()+`

`+fillTemplate.toString(),detail:`
  \u8BF4\u660E\uFF1A
    \u70B9\u51FB\u6309\u94AE\uFF0C\u8F93\u5165\u8981\u6253\u5F00\u7684\u6587\u6863\u8DEF\u5F84\uFF0C\u8F93\u5165\u6587\u6863\u4E0A\u4F20\u63A5\u53E3\uFF0C\u6253\u5F00WPS\u6587\u5B57\u540E,\u5C06\u6839\u636E\u6587\u6863\u8DEF\u5F84\u4E0B\u8F7D\u5E76\u6253\u5F00\u5BF9\u5E94\u7684\u6587\u6863\uFF0C
    \u5E76\u81EA\u52A8\u4ECE\u6A21\u677F\u670D\u52A1\u5668\u83B7\u53D6\u6A21\u677F\u6570\u636E\u5E76\u5957\u7528\u5230\u6587\u6863\u4E2D
    
  \u65B9\u6CD5\u4F7F\u7528\uFF1A
    \u9875\u9762\u70B9\u51FB\u6309\u94AE\uFF0C\u901A\u8FC7wps\u5BA2\u6237\u7AEF\u534F\u8BAE\u6765\u542F\u52A8WPS\uFF0C\u8C03\u7528oaassist\u63D2\u4EF6\uFF0C\u6267\u884C\u4F20\u8F93\u6570\u636E\u4E2D\u7684\u6307\u4EE4
    funcs\u53C2\u6570\u4FE1\u606F\u8BF4\u660E:
        OpenDoc\u65B9\u6CD5\u5BF9\u5E94\u4E8EOA\u52A9\u624Bdispatcher\u652F\u6301\u7684\u65B9\u6CD5\u540D
            fileName \u6253\u5F00\u7684\u6587\u6863\u8DEF\u5F84
            templateDataUrl \u6A21\u677F\u7684\u670D\u52A1\u5668\u8DEF\u5F84
`};function convertDoc(){var n=prompt("\u8BF7\u8F93\u5165\u6253\u5F00\u6587\u4EF6\u8DEF\u5F84\uFF08\u672C\u5730\u6216\u662Furl\uFF09\uFF1A",GetDemoPath("\u6837\u7AE0.docx")),e=prompt("\u8BF7\u8F93\u5165\u6587\u6863\u8F6C\u6362\u540E\u4E0A\u4F20\u63A5\u53E3:",GetUploadPath());_WpsInvoke([{OpenDoc:{uploadPath:e,fileName:n,suffix:".pdf",uploadWithAppendPath:"1"}}])}_wps.convertDoc={action:convertDoc,code:_WpsInvoke.toString()+`

`+convertDoc.toString(),detail:`
  \u8BF4\u660E\uFF1A
    \u70B9\u51FB\u6309\u94AE\uFF0C\u8F93\u5165\u8981\u6253\u5F00\u7684\u6587\u6863\u8DEF\u5F84\uFF0C\u8F93\u5165\u6587\u6863\u8F6C\u6362\u540E\u4E0A\u4F20\u63A5\u53E3\uFF0C\u5982\u679C\u4F20\u7684\u4E0D\u662F\u6709\u6548\u7684\u670D\u52A1\u7AEF\u5730\u5740\uFF0C\u5C06\u65E0\u6CD5\u4F7F\u7528\u4FDD\u5B58\u4E0A\u4F20\u529F\u80FD\u3002
    \u6253\u5F00WPS\u6587\u5B57\u540E,\u5C06\u6839\u636E\u6587\u6863\u8DEF\u5F84\u4E0B\u8F7D\u5E76\u6253\u5F00\u5BF9\u5E94\u7684\u6587\u6863\uFF0C\u8F6C\u6362\u5B8C\u5C06\u81EA\u52A8\u4E0A\u4F20\u6307\u5B9A\u670D\u52A1\u5668\u5730\u5740
    
  \u65B9\u6CD5\u4F7F\u7528\uFF1A
    \u9875\u9762\u70B9\u51FB\u6309\u94AE\uFF0C\u901A\u8FC7wps\u5BA2\u6237\u7AEF\u534F\u8BAE\u6765\u542F\u52A8WPS\uFF0C\u8C03\u7528oaassist\u63D2\u4EF6\uFF0C\u6267\u884C\u4F20\u8F93\u6570\u636E\u4E2D\u7684\u6307\u4EE4
    funcs\u53C2\u6570\u4FE1\u606F\u8BF4\u660E:
        OpenDoc\u65B9\u6CD5\u5BF9\u5E94\u4E8EOA\u52A9\u624Bdispatcher\u652F\u6301\u7684\u65B9\u6CD5\u540D
            uploadPath \u4FDD\u5B58\u6587\u6863\u4E0A\u4F20\u63A5\u53E3
            fileName \u6253\u5F00\u7684\u6587\u6863\u8DEF\u5F84
            suffix \u8F6C\u6362\u7C7B\u578B
            uploadWithAppendPath \u4FDD\u5B58\u65F6\u4E00\u5E76\u8F6C\u6362\u7684\u76EE\u6807\u683C\u5F0F
`};function taskPaneBookMark(){var n=prompt("\u8BF7\u8F93\u5165\u6253\u5F00\u5E26\u4E66\u7B7E\u6587\u4EF6\u8DEF\u5F84\uFF08\u672C\u5730\u6216\u662Furl\uFF09\uFF1A",GetDemoPath("\u6837\u7AE0.docx"));_WpsInvoke([{taskPaneBookMark:{fileName:n,userName:"\u4E1C\u65B9\u4E0D\u8D25"}}])}_wps.taskPaneBookMark={action:taskPaneBookMark,code:_WpsInvoke.toString()+`

`+taskPaneBookMark.toString(),detail:`
  \u8BF4\u660E\uFF1A
    \u70B9\u51FB\u6309\u94AE\uFF0C\u8F93\u5165\u8981\u6253\u5F00\u7684\u6587\u6863\u8DEF\u5F84\uFF0C\u6587\u6863\u4E2D\u7684\u4E66\u7B7E\u5C06\u4F1A\u5728OA\u52A9\u624B\u7684Taskpane\u4E2D\u663E\u793A\u51FA\u6765\u3002
    \u70B9\u51FBTaskPane\u4E2D\u7684\u4E66\u7B7E\uFF0C\u4F1A\u81EA\u52A8\u8DF3\u8F6C\u5230\u4E66\u7B7E\u6240\u5BF9\u5E94\u7684\u6587\u4EF6\u4E2D\u7684\u4F4D\u7F6E\uFF0C\u70B9\u51FBTaskpane\u6309F2\u952E\u53EF\u4EE5\u770BTaskpane\u4E2D\u7684html\u6E90\u7801\u3002
    
  \u65B9\u6CD5\u4F7F\u7528\uFF1A
    \u9875\u9762\u70B9\u51FB\u6309\u94AE\uFF0C\u901A\u8FC7wps\u5BA2\u6237\u7AEF\u534F\u8BAE\u6765\u542F\u52A8WPS\uFF0C\u8C03\u7528oaassist\u63D2\u4EF6\uFF0C\u6267\u884C\u4F20\u8F93\u6570\u636E\u4E2D\u7684\u6307\u4EE4
    funcs\u53C2\u6570\u4FE1\u606F\u8BF4\u660E:
    taskPaneBookMark \u65B9\u6CD5\u5BF9\u5E94\u4E8EOA\u52A9\u624Bdispatcher\u652F\u6301\u7684\u65B9\u6CD5\u540D
        fileName \u6587\u6863\u7684\u8DEF\u5F84
        userName \u4F20\u7ED9wps\u8981\u663E\u793A\u7684OA\u7528\u6237\u540D
`};function exitWPS(){_WpsInvoke([{ExitWPS:{}}],!0)}_wps.exitWPS={action:exitWPS,code:_WpsInvoke.toString()+`

`+exitWPS.toString(),detail:`
  \u8BF4\u660E\uFF1A
    \u70B9\u51FB\u6309\u94AE\uFF0C\u5173\u95ED\u5DF2\u6253\u5F00\u7684WPS
    
  \u65B9\u6CD5\u4F7F\u7528\uFF1A
    \u9875\u9762\u70B9\u51FB\u6309\u94AE\uFF0C\u901A\u8FC7wps\u5BA2\u6237\u7AEF\u534F\u8BAE\u901A\u77E5WPS\uFF0C\u8C03\u7528oaassist\u63D2\u4EF6\uFF0C\u6267\u884C\u4F20\u8F93\u6570\u636E\u4E2D\u7684\u6307\u4EE4
    funcs\u53C2\u6570\u4FE1\u606F\u8BF4\u660E:
    ExitWPS \u65B9\u6CD5\u5BF9\u5E94\u4E8EOA\u52A9\u624Bdispatcher\u652F\u6301\u7684\u65B9\u6CD5\u540D
`};function getDocStatus(){_WpsInvoke([{GetDocStatus:{}}],!1)}_wps.getDocStatus={action:getDocStatus,code:_WpsInvoke.toString()+`

`+getDocStatus.toString(),detail:`
  \u8BF4\u660E\uFF1A
    \u70B9\u51FB\u6309\u94AE\uFF0C\u83B7\u53D6\u6D3B\u52A8\u6587\u6863\u7684\u72B6\u6001
    
  \u65B9\u6CD5\u4F7F\u7528\uFF1A
    \u9875\u9762\u70B9\u51FB\u6309\u94AE\uFF0C\u901A\u8FC7wps\u5BA2\u6237\u7AEF\u534F\u8BAE\u901A\u77E5WPS\uFF0C\u8C03\u7528oaassist\u63D2\u4EF6\uFF0C\u6267\u884C\u4F20\u8F93\u6570\u636E\u4E2D\u7684\u6307\u4EE4
    funcs\u53C2\u6570\u4FE1\u606F\u8BF4\u660E:
    GetDocStatus \u65B9\u6CD5\u5BF9\u5E94\u4E8EOA\u52A9\u624Bdispatcher\u652F\u6301\u7684\u65B9\u6CD5\u540D
`};function checkOSisLinux(){if(detectOS()=="Linux")return!0;alert("\u6B64\u65B9\u6CD5\u4EC5\u5728WPS Linux\u7279\u5B9A\u7248\u672C\u652F\u6301")}function newOfficialDocument(){checkOSisLinux()&&_WpsInvoke([{NewOfficialDocument:{isOfficialDocument:!0}}])}_wps.newOfficialDocument={action:newOfficialDocument,code:_WpsInvoke.toString()+`

`+newOfficialDocument.toString(),detail:`
  \u8BF4\u660E\uFF1A
    \u70B9\u51FB\u6309\u94AE\uFF0C\u6253\u5F00WPS\u516C\u6587\u5199\u4F5C\u540E,\u65B0\u5EFA\u4E00\u4E2A\u516C\u6587

  \u65B9\u6CD5\u4F7F\u7528\uFF1A
    \u9875\u9762\u70B9\u51FB\u6309\u94AE\uFF0C \u901A\u8FC7wps\u5BA2\u6237\u7AEF\u534F\u8BAE\u6765\u542F\u52A8WPS\uFF0C \u8C03\u7528oaassist\u63D2\u4EF6\uFF0C \u6267\u884C\u63D2\u4EF6\u4E2D\u7684js\u51FD\u6570NewOfficialDocument, \u65B0\u5EFA\u4E00\u4E2A\u9ED8\u8BA4\u6A21\u677F\u7684\u516C\u6587 n    funcs\u53C2\u6570\u8BF4\u660E:
        NewOfficialDocument\u65B9\u6CD5\u5BF9\u5E94\u4E8EOA\u52A9\u624Bdispatcher\u652F\u6301\u7684\u65B9\u6CD5\u540D n`};function openOfficialDocument(){if(checkOSisLinux()){var n=prompt("\u8BF7\u8F93\u5165\u6253\u5F00\u6587\u4EF6\u8DEF\u5F84\uFF08\u672C\u5730\u6216\u662Furl\uFF09\uFF1A",GetDemoPath("\u516C\u6587\u6837\u7AE0.wps")),e=prompt("\u8BF7\u8F93\u5165\u6587\u6863\u4E0A\u4F20\u63A5\u53E3:",GetUploadPath()),t=prompt("\u8BF7\u8F93\u5165\u6587\u6863\u4E0A\u4F20\u5230\u4E1A\u52A1\u7CFB\u7EDF\u65F6\u81EA\u5B9A\u4E49\u5B57\u6BB5\uFF1A","\u81EA\u5B9A\u4E49\u5B57\u6BB5"),o=prompt("\u8BF7\u8F93\u5165\u6587\u6863\u5907\u4EFD\u8DEF\u5F84:");_WpsInvoke([{OpenDoc:{uploadPath:e,fileName:n,uploadFieldName:t,picPath:GetDemoPngPath(),copyUrl:o,userName:"\u4E1C\u65B9\u4E0D\u8D25"}}])}}_wps.openOfficialDocument={action:openOfficialDocument,code:_WpsInvoke.toString()+`

`+openOfficialDocument.toString(),detail:`
  \u8BF4\u660E\uFF1A
    \u70B9\u51FB\u6309\u94AE\uFF0C\u8F93\u5165\u8981\u6253\u5F00\u7684\u6587\u6863\u8DEF\u5F84\uFF0C\u8F93\u5165\u6587\u6863\u4E0A\u4F20\u63A5\u53E3\uFF0C\u5982\u679C\u4F20\u7684\u4E0D\u662F\u6709\u6548\u7684\u670D\u52A1\u7AEF\u5730\u5740\uFF0C\u5C06\u65E0\u6CD5\u4F7F\u7528\u4FDD\u5B58\u4E0A\u4F20\u529F\u80FD\u3002
    \u6253\u5F00WPS\u6587\u5B57\u540E,\u5C06\u6839\u636E\u6587\u6863\u8DEF\u5F84\u4E0B\u8F7D\u5E76\u6253\u5F00\u5BF9\u5E94\u7684\u6587\u6863\uFF0C\u4FDD\u5B58\u5C06\u81EA\u52A8\u4E0A\u4F20\u6307\u5B9A\u670D\u52A1\u5668\u5730\u5740

  \u65B9\u6CD5\u4F7F\u7528\uFF1A
    \u9875\u9762\u70B9\u51FB\u6309\u94AE\uFF0C\u901A\u8FC7wps\u5BA2\u6237\u7AEF\u534F\u8BAE\u6765\u542F\u52A8WPS\uFF0C\u8C03\u7528oaassist\u63D2\u4EF6\uFF0C\u6267\u884C\u4F20\u8F93\u6570\u636E\u4E2D\u7684\u6307\u4EE4
    funcs\u53C2\u6570\u4FE1\u606F\u8BF4\u660E:
        OpenDoc\u65B9\u6CD5\u5BF9\u5E94\u4E8EOA\u52A9\u624Bdispatcher\u652F\u6301\u7684\u65B9\u6CD5\u540D
            uploadPath \u4FDD\u5B58\u6587\u6863\u4E0A\u4F20\u63A5\u53E3
            fileName \u6253\u5F00\u7684\u6587\u6863\u8DEF\u5F84
            uploadFieldName \u6587\u6863\u4E0A\u4F20\u5230\u4E1A\u52A1\u7CFB\u7EDF\u65F6\u81EA\u5B9A\u4E49\u5B57\u6BB5
            picPath \u63D2\u5165\u56FE\u7247\u7684\u8DEF\u5F84
            copyUrl \u5907\u4EFD\u7684\u670D\u52A1\u5668\u8DEF\u5F84
            userName \u4F20\u7ED9wps\u8981\u663E\u793A\u7684OA\u7528\u6237\u540D
`};function onlineEditOfficialDocument(){if(checkOSisLinux()){var n=prompt("\u8BF7\u8F93\u5165\u6253\u5F00\u6587\u4EF6\u8DEF\u5F84\uFF08\u672C\u5730\u6216\u662Furl\uFF09\uFF1A",GetDemoPath("\u516C\u6587\u6837\u7AE0.wps")),e=prompt("\u8BF7\u8F93\u5165\u6587\u6863\u4E0A\u4F20\u63A5\u53E3:",GetUploadPath()),t=prompt("\u8BF7\u8F93\u5165\u6587\u6863\u4E0A\u4F20\u5230\u4E1A\u52A1\u7CFB\u7EDF\u65F6\u81EA\u5B9A\u4E49\u5B57\u6BB5\uFF1A","\u81EA\u5B9A\u4E49\u5B57\u6BB5");_WpsInvoke([{OnlineEditDoc:{uploadPath:e,fileName:n,uploadFieldName:t,buttonGroups:"btnSaveAsFile,btnImportDoc,btnPageSetup,btnInsertDate,btnSelectBookmark",userName:"\u4E1C\u65B9\u4E0D\u8D25"}}])}}_wps.onlineEditOfficialDocument={action:onlineEditOfficialDocument,code:_WpsInvoke.toString()+`

`+onlineEditOfficialDocument.toString(),detail:`
  \u8BF4\u660E\uFF1A
    \u70B9\u51FB\u6309\u94AE\uFF0C\u8F93\u5165\u8981\u6253\u5F00\u7684\u6587\u6863\u8DEF\u5F84\uFF0C\u8F93\u5165\u6587\u6863\u4E0A\u4F20\u63A5\u53E3\uFF0C\u5982\u679C\u4F20\u7684\u4E0D\u662F\u6709\u6548\u7684\u670D\u52A1\u7AEF\u5730\u5740\uFF0C\u5C06\u65E0\u6CD5\u4F7F\u7528\u4FDD\u5B58\u4E0A\u4F20\u529F\u80FD\u3002
    \u6253\u5F00WPS\u6587\u5B57\u540E,\u5C06\u6839\u636E\u6587\u6863\u8DEF\u5F84\u5728\u7EBF\u6253\u5F00\u5BF9\u5E94\u7684\u6587\u6863\uFF0C\u4FDD\u5B58\u5C06\u81EA\u52A8\u4E0A\u4F20\u6307\u5B9A\u670D\u52A1\u5668\u5730\u5740
    
  \u65B9\u6CD5\u4F7F\u7528\uFF1A
    \u9875\u9762\u70B9\u51FB\u6309\u94AE\uFF0C\u901A\u8FC7wps\u5BA2\u6237\u7AEF\u534F\u8BAE\u6765\u542F\u52A8WPS\uFF0C\u8C03\u7528oaassist\u63D2\u4EF6\uFF0C\u6267\u884C\u4F20\u8F93\u6570\u636E\u4E2D\u7684\u6307\u4EE4
    funcs\u53C2\u6570\u4FE1\u606F\u8BF4\u660E:
        OnlineEditDoc\u65B9\u6CD5\u5BF9\u5E94\u4E8EOA\u52A9\u624Bdispatcher\u652F\u6301\u7684\u65B9\u6CD5\u540D
            uploadPath \u4FDD\u5B58\u6587\u6863\u4E0A\u4F20\u63A5\u53E3
            fileName \u6253\u5F00\u7684\u6587\u6863\u8DEF\u5F84
            uploadFieldName \u6587\u6863\u4E0A\u4F20\u5230\u4E1A\u52A1\u7CFB\u7EDF\u65F6\u81EA\u5B9A\u4E49\u5B57\u6BB5
            buttonGroups \u5C4F\u853D\u7684OA\u52A9\u624B\u529F\u80FD\u6309\u94AE
            userName \u4F20\u7ED9wps\u8981\u663E\u793A\u7684OA\u7528\u6237\u540D
`};window.onload=function(){for(var n=document.getElementsByClassName("btn"),e=0;e<n.length;e++)n[e].onclick=function(t){document.getElementById("blockFunc").style.visibility="visible";var o=document.getElementById("demoBtn");o.innerText=this.innerText,document.getElementById("codeDes").innerText=_wps[this.id].detail.toString(),document.getElementById("code").innerText=_wps[this.id].code.toString();var i=_wps[this.id].action;document.getElementById("demoBtn").onclick=function(){var r=new WpsInvoke.CreateXHR;r.onload=function(){i()},r.onerror=function(){alert("\u8BF7\u786E\u8BA4\u672C\u5730\u670D\u52A1\u7AEF(StartupServer.js)\u662F\u542F\u52A8\u72B6\u6001")},r.open("get","http://127.0.0.1:3888/FileList",!0),r.send()},hljs.highlightBlock(document.getElementById("code"))}};function detectOS(){var n=navigator.userAgent,e=navigator.platform=="Win32"||navigator.platform=="Windows",t=navigator.platform=="Mac68K"||navigator.platform=="MacPPC"||navigator.platform=="Macintosh"||navigator.platform=="MacIntel";if(t)return"Mac";var o=navigator.platform=="X11"&&!e&&!t;if(o)return"Unix";var i=String(navigator.platform).indexOf("Linux")>-1;if(i)return"Linux";if(e){var r=n.indexOf("Windows NT 5.0")>-1||n.indexOf("Windows 2000")>-1;if(r)return"Win2000";var p=n.indexOf("Windows NT 5.1")>-1||n.indexOf("Windows XP")>-1;if(p)return"WinXP";var c=n.indexOf("Windows NT 5.2")>-1||n.indexOf("Windows 2003")>-1;if(c)return"Win2003";var l=n.indexOf("Windows NT 6.0")>-1||n.indexOf("Windows Vista")>-1;if(l)return"WinVista";var a=n.indexOf("Windows NT 6.1")>-1||n.indexOf("Windows 7")>-1;if(a)return"Win7";var s=n.indexOf("Windows NT 6.1")>-1||n.indexOf("Windows 10")>-1;if(s)return"Win10"}return"other"}function encode(n,e){var t=String.fromCharCode,o=function(a){if(a.length<2){var s=a.charCodeAt(0);return s<128?a:s<2048?t(192|s>>>6)+t(128|s&63):t(224|s>>>12&15)+t(128|s>>>6&63)+t(128|s&63)}else{var s=65536+(a.charCodeAt(0)-55296)*1024+(a.charCodeAt(1)-56320);return t(240|s>>>18&7)+t(128|s>>>12&63)+t(128|s>>>6&63)+t(128|s&63)}},i=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;function r(a){return a.replace(i,o)}function p(a){var s=Object.prototype.toString.call(a)==="[object Uint8Array]";return s?a.toString("base64"):btoa(r(String(a)))}typeof btoa!="function"&&(btoa=c);function c(a){for(var s=String(a),d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",f,m,u=0,g=d,h="";s.charAt(u|0)||(g="=",u%1);h+=g.charAt(63&f>>8-u%1*8)){if(m=s.charCodeAt(u+=3/4),m>255)throw new InvalidCharacterError("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");f=f<<8|m}return h}function l(a,s){return s?p(String(a)).replace(/[+\/]/g,function(d){return d=="+"?"-":"_"}).replace(/=/g,""):p(a)}return l(n,e)}function initWpsCloudServer(){window.location.href="ksoWPSCloudSvr://start=RelayHttpServer"}function createAxios(){const n=axios.create({baseURL:"http://127.0.0.1:58890/",withCredentials:!1});return n.interceptors.response.use(e=>Promise.resolve(e),e=>{if(e&&e.code&&e.code==="ERR_NETWORK")return ElMessageBox.confirm("\u6B64\u529F\u80FD\u9700\u8981\u6253\u5F00Wps\u670D\u52A1\uFF0C\u662F\u5426\u6253\u5F00\uFF1F\u6253\u5F00\u4E4B\u540E\u60A8\u9700\u8981\u91CD\u65B0\u5F00\u59CB\u6B64\u64CD\u4F5C").then(()=>{initWpsCloudServer()}).catch(()=>{}),Promise.reject(e)}),n}function getPluginHost(){return window.location.host==="xmgl.dsj.lishui.gov.cn"?`https://${window.location.host}/lspmlocal/wps/`:"http://lspm.ningdatech.com/lspmlocal/wps/"}function changePluginStatus(n){const e="http://localhost:58890/deployaddons/runParams",t={cmd:n?"enable":"disable",name:"WpsOAAssist",url:getPluginHost(),addonType:"wps",online:"true"};let o=encode(JSON.stringify(t));return createAxios().post(e,o)}function getWpsVersion(){return createAxios().post("http://127.0.0.1:58890/version","")}function getPluginStatus(){return new Promise((e,t)=>{const o="http://127.0.0.1:58890/publishlist";createAxios().get(o).then(i=>{const r=n(i.data);e(r)}).catch(i=>{t(i)})});function n(e){if(!e||!e.length||e.length<1)return!1;let t=!1;return e.forEach(o=>{o.name==="WpsOAAssist"&&o.enable==="true"&&(t=!0)}),t}}function autoOpenWpsDoc(n,e=!1){return v(this,null,function*(){const t=localStorage.getItem("wpsPluginInstall");console.log(t);let o=!1;try{o=yield getPluginStatus()}catch(r){return Promise.reject(r)}if(o)i(n);else try{yield changePluginStatus(!0),i(n)}catch(r){return Promise.reject(r)}function i(r){localStorage.setItem("wpsPluginInstall","true"),openDoc(r)}return Promise.resolve(n)})}export{getWpsVersion as a,getPluginStatus as b,changePluginStatus as c,autoOpenWpsDoc as d,getPluginHost as g,newDoc as n,openDoc as o};
