@yunzhijia/qing
Version:
> qingjs是为了方便前端人员在云之家环境调用native代码的工具类,兼容新版桌面端、老版桌面端、移动端、微信
2 lines • 23 kB
JavaScript
/** Fri Sep 15 2023 13:31:58 GMT+0800 (中国标准时间) **/
(self.qingJsonpFunction=self.qingJsonpFunction||[]).push([[271],{2037:(e,t,o)=>{"use strict";function n(){if(n.apis)return n.apis;var e={both:{"0.9.0":"hideWebViewTitle,setWebViewTitle,gotoApp,getPersonInfo,getNetworkType,share,switchCompany,personInfo,chat,selectPerson,fetchAvatar,joinBandCallback,socialShare,localFunction,selectFile,showFile,selectOrg,selectPic,scanQRCode,selectPersons","0.9.3":"gotoMyFile","0.9.4":"getPersonDepartment,getAdminOpenId","0.9.5":"setWebViewTitleBar,closeWebView","0.9.6":"createPop,closePop,getLocation,selectLocation","0.9.11":"defback,setDepartmentHeader","0.9.12":"clipBoard,freeCall,validate,orgManage","0.9.13":"enterpriseAuth","0.9.14":"selectOrgs","0.9.16":"previewImage","0.9.17":"iAppRevision,selectCloudhubContact,selectMobileContact","0.9.18":"gotoLightApp","0.9.19":"recordScreenshotsInfo,companyRename","0.9.20":"selectPhoto,gotoOpenAppRangeView","0.9.21":"extPersonInfo,selectPersonsInGroup,startLightApp,rotateUI","0.9.22":"startSignFeedback","0.9.23":"startRecord,stopRecord,playVoice,pauseVoice,stopVoice,uploadVoice,downloadVoice","0.9.24":"scanBizCard","0.9.25":"groupAppSort,screenShare,getMobileContact","0.9.26":"shareFile","0.9.27":"selectGroups","0.9.28":"defTitleBar","0.9.29":"selectConcernPersons","0.9.30":"mergeMsgRecord","0.9.50":"invoice,voiceRecognize,projection,getProjectionState,savePic,addCalendarEvent,runtime.auth,runtime.jsReady,ui.toast","0.9.51":"chooseImage,uploadImage,downloadImage,cloudoffice.request,cloudoffice.clearCardNotify,cloudoffice.showCardNotify,cloudoffice.getRoleType,cloudoffice.textShareClosed,cloudoffice.checkAppAuth,cloudoffice.downloadPic","0.9.52":"dateTimePicker","0.9.55":"getWiFi,selectAnyLocation,bluetooth.openBluetoothAdapter,bluetooth.closeBluetoothAdapter,bluetooth.getBluetoothAdapterState,bluetooth.onBluetoothAdapterStateChange,bluetooth.startBluetoothDevicesDiscovery,bluetooth.stopBluetoothDevicesDiscovery,bluetooth.getBluetoothDevices,bluetooth.onBluetoothDeviceFound,bluetooth.getConnectedBluetoothDevices,bluetooth.createBLEConnection,bluetooth.closeBLEConnection,bluetooth.getBLEDeviceServices,bluetooth.getBLEDeviceCharacteristics,bluetooth.readBLECharacteristicValue,bluetooth.writeBLECharacteristicValue,bluetooth.notifyBLECharacteristicValueChange,bluetooth.onBLEConnectionStateChange,bluetooth.onBLECharacteristicValueChange,bluetooth.getBondDevice","0.9.56":"commonRoute","0.9.60":"video.startRecord,video.upload,video.download,video.play","0.9.62":"voidceChanger,bluetooth.BLEPrint","0.9.63":"voiceSynthesize,selectBusinessUnits,keepScreenOn,cloudoffice.dataReport,cloudoffice.checkWorkbenchUpdate","0.9.65":"selectRoles","0.9.66":"ui.navigate","0.9.67":"voiceAssistant","0.9.70":"defHomeMainTitleBar,reloadWebView","0.9.71":"ui.changeNavStyle,ui.webViewPaddingTop","0.9.72":"getCalenderEvent,showTopMenu","0.9.73":"startLocation,stopLocation","0.9.74":"startSpeechRecognize,stopSpeechRecognize","0.9.75":"shareMiniprogram,video.select","0.9.76":"selectPersonsInRole,setCallBackData,storage.getItem,storage.setItem,storage.removeItem,storage.clear,openDialog","0.9.77":"createLive,createVoiceMeeting","0.9.79":"queryCalenderAccounts,assist,setShortcuts","0.9.80":"todoList"},ios:{"0.9.27":"setBounce","0.9.51":"getLocalImgData","0.9.61":"showARView","0.9.63":"setWebBottomInset","0.9.79":"setShortcuts"},android:{"0.9.30":"selectLocalFile","0.9.60":"getPhoneOSInfo"}};return n.apis={},Object.keys(e).forEach(function(t){var o=e[t];Object.keys(o).forEach(function(e){!function(e,t,o){t.split(",").forEach(function(t){var r=n.apis[t]={version:e};"both"!==o&&"ios"!==o||(r.ios=1),"both"!==o&&"android"!==o||(r.android=1)})}(e,o[e],t)})}),n.apis}o.d(t,{Z:()=>n})},2271:(e,t,o)=>{window.qing.define("mobile",function(e,t){var n=o(5766);for(var r in n)e[r]=n[r]})},5766:(e,t,o)=>{"use strict";function n(e){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}o.r(t),o.d(t,{call:()=>(function(e,t){S(e,t)}),checkJsApi:()=>(function(e){var t=e.jsApiList,o={};if(a.checkVersion("0.9.80"))a.call("checkJsApi",e);else{var n=(0,r.Z)();(t||[]).forEach(function(e){var t=n[e],r=a.isAndroid?"android":a.isIos?"ios":"other";t&&t[r]&&a.checkVersion(t.version)?o[e]=!0:o[e]=!1}),"function"==typeof e.success&&e.success({success:!0,data:o})}}),off:()=>(function(e,t){document.removeEventListener(m+e,t)}),on:()=>(function(e,t){if("function"!=typeof t)return;v(e),"function"==typeof t&&(t={success:t});document.addEventListener(m+e,function(e){"function"==typeof t.success&&t.success(e.eventData)})}),trigger:()=>(function(e,t){d.trigger(e,t)})});var r=o(2037),c=(o(1365),o(6276)),a=window.qing,s=function(e,t){var o=document.createEvent("HTMLEvents");!function e(){var t,o=arguments,r=!1;return"boolean"==typeof o[0]&&(r=Array.prototype.shift.call(o)),t=Array.prototype.shift.call(o),Array.prototype.forEach.call(o,function(o){o&&Object.keys(o).forEach(function(c){r&&"object"===n(o[c])&&"object"===n(t[c])?e(!0,t[c],o[c]):void 0!==o[c]&&(t[c]=o[c])})}),t}(o,t),o.initEvent(e),document.dispatchEvent(o)},i=function(){var e=navigator.userAgent.split(";")[0],t=e.slice(e.indexOf("Qing/")+5);return parseFloat(t.slice(2))}(),u={map:{},index:1e6*function(){for(var e=0,t=window;t!==t.parent&&!(e>=10);)e++,t=t.parent;return e}()+1,indexStep:2,register:function(e){this.index+=this.indexStep;var t=""+this.index;return"function"==typeof e&&(this.map[t]=function(e){this.cb.call(null,e)}.bind({map:this.map,id:t,cb:e})),t},invoke:function(e,t,o){var n=this.map[e+""];"function"==typeof n&&n(t),o&&delete this.map[e+""]}},l={},d={invoke:function(e,t,o){var n=(window.ClientInfo||{}).v9bridge||"cloudhub";return p.call(e,t,o,n)},callback:function(){return p.handleMessageFromXT.apply(null,arguments)},on:function(e,t){l[e]||(l[e]=[]),l[e].push(t)},trigger:function(e,t){(l[e]||[]).forEach(function(e){"function"==typeof e&&e(t)})}},f=/V9BridgeProtocalNoDoubleSlash/.test(navigator.userAgent)?":":"://",p={call:function(e,t,o,n){var r,c=u.register(o);if(t=void 0===t?"":encodeURIComponent(JSON.stringify(t)),n?(e=function(e){var t=e.match(/(.+)\.([^.]+)/);return t&&3===t.length?{name:t[2],ns:t[1]}:{ns:"",name:e}}(e),r=n+f+e.ns+":"+c+"/"+e.name+"?"+t):r="xuntong:"+e+":"+c+":"+t,a.isAndroid){if(window.AndroidInterface)return window.AndroidInterface.call(r),c;if(i>=9.59)return window.prompt(r),c}else{if(window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.wkbridge2)return window.webkit.messageHandlers.wkbridge2.postMessage({url:r}),c;if(window.kdUIWebViewBridge)return window.kdUIWebViewBridge(r),c}var s=window.XTBridgeIframes=window.XTBridgeIframes||function(){var e,t,o=[];for(t=0;t<9;t++)(e=document.createElement("IFRAME")).setAttribute("height","1px"),e.setAttribute("width","1px"),e.style.display="none",document.documentElement.appendChild(e),o.push(e);return o}();p.callbackIndex=p.callbackIndex||0;var l=p.callbackIndex;p.callbackIndex+=1;var d=s[l%9];return d.setAttribute("src",r),setTimeout(function(){d.removeAttribute("src")},10),c},handleMessageFromXT:function(e,t){if("string"==typeof t&&t.match(/^\s*\{/))try{(t=JSON.parse(t))&&"string"==typeof t.success&&(t.success="true"===t.success)}catch(e){console.error(e)}else t&&"string"==typeof t.success&&console.warn&&console.warn('QingJS未来的版本会将success的返回值,由string变更为boolean,可以通过代码 if (String(success) == "true")兼容');u.invoke(e,t)}},g=["runtime.auth","runtime.jsReady","cloudoffice.request","cloudoffice.showCardNotify","cloudoffice.clearCardNotify","cloudoffice.getRoleType","cloudoffice.checkAppAuth","cloudoffice.shareText","cloudoffice.downloadPic","cloudoffice.checkWorkbenchUpdate","cloudoffice.textShareClosed","cloudoffice.dataReport","cloudoffice.setScrollEnable","ui.changeNavBarStyle","ui.changeNavStyle","ui.toast","ui.webViewScrollTo","ui.webViewPaddingTop","ui.navigate","storage.getItem","storage.setItem","storage.removeItem","storage.clear","bluetooth.openBluetoothAdapter","bluetooth.closeBluetoothAdapter","bluetooth.getBluetoothAdapterState","bluetooth.onBluetoothAdapterStateChange","bluetooth.startBluetoothDevicesDiscovery","bluetooth.stopBluetoothDevicesDiscovery","bluetooth.getBluetoothDevices","bluetooth.onBluetoothDeviceFound","bluetooth.getConnectedBluetoothDevices","bluetooth.createBLEConnection","bluetooth.closeBLEConnection","bluetooth.getBLEDeviceServices","bluetooth.getBLEDeviceCharacteristic","bluetooth.readBLECharacteristicValue","bluetooth.writeBLECharacteristicValue","bluetooth.notifyBLECharacteristicValueChange","bluetooth.onBLEConnectionStateChange","bluetooth.onBLECharacteristicValueChange","bluetooth.getBLEDeviceCharacteristics","bluetooth.BLEPrint","bluetooth.getBondDevice","bluetooth.connectBluetoothDevice","bluetooth.writeBluetoothDevice","bluetooth.closeBluetoothConnection","video.startRecord","video.upload","video.download","video.play","video.select"];Object.defineProperty(window,"CloudHubJSBridge",{set:function(){},get:function(){return d}});var h={call:function(e){g.some(function(t){return t===e})?d.invoke.apply(null,arguments):p.call.apply(null,arguments)},on:d.on,handleMessageFromXT:p.handleMessageFromXT};h.invoke=h.call,window.XuntongJSBridge=h;var m="eventPrefix_",b={},v=function(e){b[e]||(b[e]=!0,h.on(e,function(t){s(m+e,{eventData:t})}))},y=function(e,t){var o=(t=t||{}).success,n=t.complete;delete t.success,delete t.complete,delete t.error,h.call(e,t,function(e){o&&o(e),n&&n(e)})},w=new c.Z,S=function(e,t){var o=window.top,n=Math.random();if(o!==window)try{if(!(t.inIframe||o.qing&&o.qing.__allowIframeCallback))return void y(e,t);o.postMessage({to:"QingTop",type:"QingCall",call:e,params:JSON.parse(JSON.stringify(t)),callbackId:n},"*"),w.once(n,function(e){t.success&&t.success(e),t.complete&&t.complete(e)})}catch(o){y(e,t)}else y(e,t)},I=[location.origin];if(window.qing.trust=function(e){I.push(e)},window.qing.__allowIframeCallback=!0,window.top===window?window.addEventListener("message",function(e){var t=e.data||{},o=t.params||{},n=e.source||e.target;"QingTop"===t.to&&"QingCall"===t.type&&t.call?(t.callbackId&&(o.success=function(e){n.postMessage({to:"QingSub",type:"QingCall",callbackId:t.callbackId,result:e},"*")}),y(t.call,o)):"QingTop"===t.to&&"QingEvent"===t.type&&t.event&&t.callbackId&&h.on(t.event,function(e){n.postMessage({to:"QingSub",type:"QingEvent",callbackId:t.callbackId,result:e},"*")})}):window.addEventListener("message",function(e){var t=e.data||{};t.callbackId&&w.emit(t.callbackId,t.result)}),window.top!==window)try{["appear","disappear","networkAvailable","networkDisAvailable","titleDoubleClick","keyboardChange"].forEach(function(e){var t=Math.random();top.postMessage({to:"QingTop",type:"QingEvent",event:e,callbackId:t},"*"),w.on(t,function(t){d.trigger(e,t)})})}catch(e){}},1365:(e,t,o)=>{window.qing.isMiniApp?o(660):o(9079)},4849:()=>{var e=function(e){return{name:window.qing.checkVersion("0.9.71")?"ui.changeNavStyle":"ui.changeNavBarStyle",params:e,simulate:!1}};window.qing._simulate("ui.changeNavBarStyle",e),window.qing._simulate("ui.changeNavStyle",e)},9185:()=>{qing._simulate("setClipboardData",function(e){qing.call("clipBoard",{type:"setString",string:e.data||""})}),qing._simulate("getClipboardData",function(e){return{name:"clipBoard",params:{type:"getString",success:function(t){t.success&&t.data?e.success({success:!0,data:decodeURIComponent(t.data.string||"")}):e.success(t)}}}})},9079:(e,t,o)=>{"use strict";o.r(t);o(686),o(1686),o(8738),o(6513),o(4849),o(9185),o(9091)},9091:(e,t,o)=>{"use strict";var n=o(9303),r="__qing_getJsBridgeRequestParams_cache__",c=window.qing;c._simulate("openDialog",function(e){var t=""+Date.now(),o=e.appId,n=new URL(e.url,location.href),r=(n.search?n.search+"&":"?")+"__callback_id="+t,a=n.origin+n.pathname+r+n.hash;c.call("storage.setItem",{shared:!0,key:t,value:JSON.stringify({body:e}),success:function(n){"true"!=String(n.success)&&n.error&&c.call("toast",{msg:n.error}),c._bridge.call("gotoLightApp",{appId:o,callbackId:t,urlParam:a,success:function(o){if(o.data&&o.data.callBackId==t){var n=JSON.parse(o.data.callBackData);e.success({success:!0,data:n.body})}}})}})}),n.Z.__callback_id&&(c._simulate("closeDialog",function(e){e?c.call("setCallBackData",{callbackId:n.Z.__callback_id,callBackData:JSON.stringify({body:e}),success:function(){c._bridge.call("closeWebView")}}):c._bridge.call("closeWebView")}),c._simulate("getJsBridgeRequestParams",function(e){var t=n.Z.__callback_id,o=sessionStorage.getItem(r);if(o)try{return o=JSON.parse(o),void e.success({success:!0,data:o})}catch(e){}c.call("storage.getItem",{shared:!0,key:t,success:function(o){var n=JSON.parse(o.data.value).body;delete n.appId,delete n.url,sessionStorage.setItem(r,JSON.stringify(n)),e.success({success:!0,data:n}),c.call("storage.removeItem",{shared:!0,key:t})}})}))},8738:()=>{window.qing._simulate("request",function(e){return{name:"cloudoffice.request",params:e}})},6513:(e,t,o)=>{var n=window.qing,r=o((n.isAndroid||n.isIos)&&n.checkVersion("0.9.76")?1274:4987);n._simulate("storage.getItem",r.getItem),n._simulate("storage.setItem",r.setItem),n._simulate("storage.removeItem",r.removeItem),n._simulate("storage.clear",r.clear)},1274:(e,t,o)=>{"use strict";o.r(t),o.d(t,{getItem:()=>(function(e){var t=e.success;return e.success=function(e){e.success&&e.data&&e.data.value&&(e.data.value=function(e){return"string"==typeof e?(e=unescape(e)).replace(/▴▴/gm,"'").replace(/▾▾/gm,'"'):e}(e.data.value)),t(e)},{name:"storage.getItem",params:e}}),setItem:()=>(function(e){return e.value=function(e){return"string"==typeof e?(e=e.replace(/'/gm,"▴▴").replace(/"/gm,"▾▾"),escape(e)):e}(e.value),{name:"storage.setItem",params:e}})})},1686:()=>{window.qing._simulate("toast",function(e){return e.message=e.msg,delete e.msg,{name:"ui.toast",params:e}})},6933:()=>{qing._simulate("chooseImage",function(e){return{name:"miniapp.chooseImage",params:e}}),qing._simulate("chooseFile",function(e){return{name:"miniapp.chooseFile",params:e}})},4908:()=>{var e,t=window.qing,o=t.utils.Events;t._simulate("getUpdateManager",function(){return e||(e=new function(){var e=new o;setTimeout(function(){t.call("miniapp.checkUpdate",{success:function(t){switch(t.data.state){case 0:case 1:e.emit("onCheckForUpdate",{hasUpdate:1==t.data.state});break;case 2:e.emit("onUpdateFailed");break;case 3:e.emit("onUpdateReady")}}})}),this.onCheckForUpdate=function(t){e.once("onCheckForUpdate",t)},this.onUpdateReady=function(t){e.once("onUpdateReady",t)},this.onUpdateFailed=function(t){e.once("onUpdateFailed",t)},this.applyUpdate=function(){t.call("miniapp.checkUpdate.action",{type:"relaunch"})}}),{raw:e}})},660:(e,t,o)=>{"use strict";o.r(t);o(1686),o(4789),o(4908),o(9729),o(6734),o(9185),o(9091),o(6933)},4789:()=>{function e(t){"@babel/helpers - typeof";return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,n)}return o}function o(e){for(var o=1;o<arguments.length;o++){var r=null!=arguments[o]?arguments[o]:{};o%2?t(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):t(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function n(t,o,n){return(o=function(t){var o=function(t,o){if("object"!==e(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,o||"default");if("object"!==e(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===o?String:Number)(t)}(t,"string");return"symbol"===e(o)?o:String(o)}(o))in t?Object.defineProperty(t,o,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[o]=n,t}var r=window.qing;window.qing._simulate("request",function(e){return e.serializer||e.headers&&e.headers["Cloudoffice-Version"]?{name:"cloudoffice.request",params:e}:{raw:new function(e){var t=e.success,n=Date.now()+"_"+~~(1e6*Math.random()),c=function(){t=null};this.abort=function(){c(),r.call("miniapp.request.action",{id:n,type:"abort"})},function(){r.call("miniapp.request",o(o({id:n},e),{},{success:function(o){var n=e.dataType||"json",r=o.data||{},a=r.data,s=o.success;if(s&&"json"==n&&"string"==typeof a)try{a=JSON.parse(a)}catch(e){s=!1,console.error("数据格式化错误")}t&&t({success:s,statusCode:r.statusCode,header:r.header,errorCode:o.errorCode,error:o.error,data:a}),c()}}))}()}(e)}})},6734:(e,t,o)=>{"use strict";var n,r=o(9483),c=o.n(r),a=window.qing,s=function(){n=c().createInstance({name:"__qingjs__stroage__",driver:[c().INDEXEDDB],size:20971520}),s=null};a._simulate("setStorage",function(e){s&&s(),n.setItem(e.key,e.data,function(t){t?e.error&&e.error({success:!1,error:t}):e.success&&e.success({success:!0})})}),a._simulate("getStorage",function(e){s&&s(),n.getItem(e.key,function(t,o){t?e.error&&e.error({success:!1,error:t}):e.success&&e.success({success:!0,data:o})})}),a._simulate("clearStorage",function(e){s&&s(),n.clear(function(t){t?e.error&&e.error({success:!1,error:t}):e.success&&e.success({success:!0})})}),a._simulate("removeStorage",function(e){s&&s(),n.removeItem(e.key,function(t){t?e.error&&e.error({success:!1,error:t}):e.success&&e.success({success:!0})})}),a._simulate("getStorageInfo",function(e){s&&s(),n.keys(function(t,o){t?e.error&&e.error({success:!1,error:t}):e.success&&e.success({success:!0,keys:o})})})},9729:()=>{function e(t){"@babel/helpers - typeof";return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,n)}return o}function o(e){for(var o=1;o<arguments.length;o++){var r=null!=arguments[o]?arguments[o]:{};o%2?t(Object(r),!0).forEach(function(t){n(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):t(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function n(t,o,n){return(o=function(t){var o=function(t,o){if("object"!==e(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,o||"default");if("object"!==e(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===o?String:Number)(t)}(t,"string");return"symbol"===e(o)?o:String(o)}(o))in t?Object.defineProperty(t,o,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[o]=n,t}var r=window.qing,c=r.utils.Events;r._simulate("uploadFile",function(e){return{raw:new function(e){var t={},n=new c,a=e.success,s=Date.now()+"_"+~~(1e6*Math.random()),i=function(){n=null,a=null,t=null};this.onProgressUpdate=function(e){n.on("progress",e)},this.offProgressUpdate=function(e){n.off("progress",e)},this.abort=function(){n.off("progress"),r.call("miniapp.request.action",{id:s,type:"abort"}),i()},function(){r.call("miniapp.uploadFile",o(o({id:s},e),{},{success:function(e){if(!e.success)return a&&a({success:!1,errorCode:e.errorCode,error:e.error}),void i();var o=e.data;switch(o.state){case"process":var r=o.progress;if(r&&100!=r){var c=parseInt(r/100*o.total,10);n.emit("progress",{progress:r,totalBytesSent:c,totalBytesExpectedToSend:o.total})}t.total=o.total;break;case"complete":n.emit("progress",{progress:100,totalBytesSent:t.total,totalBytesExpectedToSend:t.total}),a&&a({success:!0,statusCode:o.statusCode,data:o.data}),i()}}}))}()}(e)}})},686:()=>{"use strict";var e="JSON解析失败";var t="参数错误",o="鉴权失败",n="获取签名失败",r="签名信息错误";function c(c,a){function s(e,t,n){if(!(e&&e.appId&&e.timeStamp&&e.nonceStr&&e.signature))return n(r);var a={success:function(e){"string"==typeof e.success&&(e.success="true"===e.success),e.success?t&&t(e):n&&n(o)},error:function(e){n&&n(o)}};Object.assign(a,e),c.call("runtime.auth",a)}if("function"==typeof a.success)if(a.appId&&a.timeStamp&&a.nonceStr&&a.signature)s(a,a.success,a.error);else if(a.signUrl){var i=encodeURIComponent(location.href.split("#")[0]);/^file:/.test(location.href)&&(i=encodeURIComponent(location.href.replace(/file:\/\//,""))),function(t){var o,n=new XMLHttpRequest,r=/^(2\d{2}|304)$/;t.method||(t.method="GET"),t.error||(t.error=function(){}),t.success||(t.success=function(){}),n.open(t.method,t.url),n.onreadystatechange=function(){if(4===n.readyState)if(r.test(n.status))try{t.success(JSON.parse(n.responseText),n)}catch(o){t.error(e)}else t.error(n.responseText)},t.headers=t.headers||{},"json"===t.serializer?(o=JSON.stringify(t.data),t.headers["Content-type"]="application/json; charset=utf-8"):(o=function(e){var t=encodeURIComponent;return"string"!=typeof e&&e?Object.keys(e).map(function(o){return t(o)+"="+t(e[o])}).join("&"):e}(t.data),t.headers["Content-type"]="application/x-www-form-urlencoded; charset=utf-8"),t.headers&&Object.keys(t.headers).forEach(function(e){n.setRequestHeader(e,t.headers[e])}),n.send(o)}({url:a.signUrl.replace(/\?|$/,"?url="+i+"&").replace(/&$/,""),method:a.signMethod||"post",success:function(e){if(e&&e.success&&e.data){var t=e.data;"function"==typeof a.signFormat&&(t=a.signFormat(t)),s(t,a.success,a.error)}else a.error&&a.error(n)},error:function(e){a.error&&a.error(n)}})}else a.error&&a.error(t)}window.qing._simulate("getTicket",function(e){c(window.qing,e)},!0)},4987:(e,t,o)=>{"use strict";o.r(t),o.d(t,{clear:()=>(function(e){var t=e.error||a,o=e.success||a;r().dropInstance({name:c,storeName:i(e)}).then(function(){o({success:!0})}).catch(function(e){t({success:!1,error:e})})}),getItem:()=>(function(e){var t=u(e),o=e.error||a,n=e.success||a;t.getItem(e.key).then(function(e){n({success:!0,data:e})}).catch(function(e){o({success:!1,error:e})})}),removeItem:()=>(function(e){var t=u(e),o=e.error||a,n=e.success||a;t.removeItem(e.key).then(function(){n({success:!0})}).catch(function(e){o({success:!1,error:e})})}),setItem:()=>(function(e){var t=u(e),o=e.error||a,n=e.success||a;t.setItem(e.key,e.data).then(function(){n({success:!0})}).catch(function(e){o({success:!1,error:e})})})});var n=o(9483),r=o.n(n),c="__web__stroage__",a=qing.utils.noop,s={},i=function(e){var t="shared";if(!e.shared){var o=location.pathname.split("/");t=o.length<3?"default":o[1]}return t},u=function(e){var t=i(e);return s[t]||(s[t]=r().createInstance({name:c,driver:[r().INDEXEDDB],storeName:t,size:524288e3}))}}}]);