iking-web-ui-pro 0.2.29 → 0.2.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/IKPreviewFile/ik.index.es.js +1 -1
- package/dist/IKPreviewFile/ik.index.umd.js +1 -1
- package/dist/IkApprovalProcessDetail/ik.index.es.js +1 -1
- package/dist/IkApprovalProcessDetail/ik.index.umd.js +1 -1
- package/dist/IkDescription/ik.index.es.js +132 -132
- package/dist/IkDescription/ik.index.umd.js +1 -1
- package/dist/IkDetailPreviewFiles/ik.index.es.js +1 -1
- package/dist/IkDetailPreviewFiles/ik.index.umd.js +1 -1
- package/dist/IkUploadFile/ik.index.es.js +117 -117
- package/dist/IkUploadFile/ik.index.umd.js +12 -12
- package/dist/IkUploadFile/style.css +1 -1
- package/dist/index.es.js +743 -743
- package/dist/index.umd.js +25 -25
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -12514,7 +12514,7 @@ const Sa = /* @__PURE__ */ yt(Ea, [["__scopeId", "data-v-b301aa7d"]]), xa = De(S
|
|
|
12514
12514
|
...r.field
|
|
12515
12515
|
})), l = Ke({}), u = Ke(!1), c = (g) => {
|
|
12516
12516
|
var m, y;
|
|
12517
|
-
|
|
12517
|
+
l.value = {
|
|
12518
12518
|
...g,
|
|
12519
12519
|
name: g.name,
|
|
12520
12520
|
url: Qe(
|
|
@@ -223,4 +223,4 @@ Use Save As... to download, then click back to return to this page.`)&&(location
|
|
|
223
223
|
<xg-mini-progress-cache class="xg-mini-progress-cache" style="`).concat(c.cached,`"></xg-mini-progress-cache>
|
|
224
224
|
<xg-mini-progress-played class="xg-mini-progress-played" style="`).concat(c.played,`"></xg-mini-progress-played>
|
|
225
225
|
</xg-mini-progress>`)}}}],[{key:"pluginName",get:function(){return"MiniProgress"}},{key:"defaultConfig",get:function(){return{mode:"auto",height:2}}}]),r}(H),Re={REAL_TIME:"realtime",FIRST_FRAME:"firstframe",FRAME_RATE:"framerate",POSTER:"poster"};function io(){try{return parseInt(window.performance.now(),10)}catch{return new Date().getTime()}}function no(){try{var a=document.createElement("canvas").getContext;return!!a}catch{return!1}}var ot=null,ro=function(a){x(r,a);var o=P(r);function r(){var t;E(this,r);for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return t=o.call.apply(o,[this].concat(i)),k(m(t),"onLoadedData",function(s){t.player&&(t._frameCount=t.config.startFrameCount,t.stop(),t.renderOnTimeupdate(s),t.off(X,t.renderOnTimeupdate),t.on(X,t.renderOnTimeupdate))}),k(m(t),"onVisibilitychange",function(s){document.visibilityState==="visible"?t._checkIfCanStart()&&t.start():document.visibilityState==="hidden"&&t.stop()}),k(m(t),"renderOnTimeupdate",function(s){if(t._frameCount>0)t.renderOnce(),t._frameCount--;else{t._isLoaded=!0,t.off(X,t.renderOnTimeupdate);var l=t.config.startInterval;!t.player.paused&&t._checkIfCanStart()&&t.start(0,l)}}),k(m(t),"start",function(s,l){var u=t.player.video,c=io(),h=t.checkVideoIsSupport(u);!h||!t.canvasCtx||(l||(l=t.interval),t.stop(),u.videoWidth&&u.videoHeight&&(t.videoPI=u.videoHeight>0?parseInt(u.videoWidth/u.videoHeight*100,10):0,(t.config.mode===Re.REAL_TIME||c-t.preTime>=l)&&(u&&u.videoWidth&&t.update(h,t.videoPI),t.preTime=c)),t.frameId=t._loopType==="timer"?f.setTimeout(m(t),t.start,l):f.requestAnimationFrame(t.start))}),k(m(t),"stop",function(){t.frameId&&(t._loopType==="timer"?f.clearTimeout(m(t),t.frameId):f.cancelAnimationFrame(t.frameId),t.frameId=null)}),t}return S(r,[{key:"afterCreate",value:function(){var e=this;this.playerConfig.dynamicBg===!0&&(this.config.disable=!1),r.isSupport||(this.config.disable=!0);var i=this.config,n=i.disable,s=i.mode,l=i.frameRate;n||(this._pos={width:0,height:0,rwidth:0,rheight:0,x:0,y:0,pi:0},this.isStart=!1,this._isLoaded=!1,this.videoPI=0,this.preTime=0,this.interval=parseInt(1e3/l,10),this.canvas=null,this.canvasCtx=null,this._frameCount=0,this._loopType=this.config.mode!==Re.REAL_TIME&&this.interval>=1e3?"timer":"animation",this.once(Ge,function(){e.player&&(e.init(),e.renderByPoster(),e.player.paused||e.start())}),s!==Re.POSTER&&(s!==Re.FIRST_FRAME&&(this.on(_e,function(){e.stop()}),this.on(Y,function(){var u=e.config.startInterval;e._checkIfCanStart()&&e.start(0,u)}),this.on(Se,function(){e.stop()})),this.on(ae,this.onLoadedData),this.on(yt,function(){e._isLoaded=!1,e.stop()}),document.addEventListener("visibilitychange",this.onVisibilitychange)))}},{key:"setConfig",value:function(e){var i=this;Object.keys(e).forEach(function(n){n==="root"&&e[n]!==i.config[n]?i.reRender(e[n]):n==="frameRate"?i.interval=parseInt(1e3/e[n],10):n==="disable"&&e[n]&&i.stop(),i.config[n]=e[n]})}},{key:"init",value:function(e){var i=this.player,n=this.config;this.canvasFilter=r.supportCanvasFilter();try{var s=e||n.root;s||(s=n.isInnerRender&&i.innerContainer||i.root),s.insertAdjacentHTML("afterbegin",'<div class="xgplayer-dynamic-bg" data-index="'.concat(n.index,`"><canvas>
|
|
226
|
-
</canvas><xgmask></xgmask></div>`)),this.root=s.children[0],this.canvas=this.find("canvas"),this.canvasFilter||(this.canvas.style.filter=n.filter,this.canvas.style.webkitFilter=n.filter),this.mask=this.find("xgmask"),n.addMask&&(this.mask.style.background=n.maskBg),this.canvasCtx=this.canvas.getContext("2d")}catch(l){F.logError("plugin:DynamicBg",l)}}},{key:"reRender",value:function(e){var i=this.config.disable;if(!(!i&&!this.root)){this.stop();var n=this.root?this.root.parentElement:null;if(n!==e&&n.removeChild(this.root),!e){this.root=null;return}this.init(e),this.renderOnce();var s=this.config.startInterval;this._checkIfCanStart()&&this.start(0,s)}}},{key:"checkVideoIsSupport",value:function(e){if(!e)return null;var i=e&&e instanceof window.HTMLVideoElement?e:e.canvas?e.canvas:e.flyVideo?e.flyVideo:null;if(i&&!(O.browser==="safari"&&f.isMSE(i)))return i;var n=i?i.tagName.toLowerCase():"";return n==="canvas"||n==="img"?i:null}},{key:"renderByPoster",value:function(){var e=this.playerConfig.poster;if(e){var i=f.typeOf(e)==="String"?e:f.typeOf(e.poster)==="String"?e.poster:null;this.updateImg(i)}}},{key:"_checkIfCanStart",value:function(){var e=this.config.mode;return this._isLoaded&&!this.player.paused&&e!==Re.FIRST_FRAME&&e!==Re.POSTER}},{key:"renderOnce",value:function(){var e=this.player.video;if(!(!e.videoWidth||!e.videoHeight)){this.videoPI=parseInt(e.videoWidth/e.videoHeight*100,10);var i=this.checkVideoIsSupport(e);i&&this.update(i,this.videoPI)}}},{key:"updateImg",value:function(e){var i=this;if(e){var n=this.canvas.getBoundingClientRect(),s=n.width,l=n.height,u=new window.Image;u.onload=function(){if(!(!i.canvas||i.frameId||i.isStart)){i.canvas.height=l,i.canvas.width=s;var c=parseInt(s/l*100,10);i.update(u,c),u=null}},u.src=e}}},{key:"update",value:function(e,i){if(!(!this.canvas||!this.canvasCtx||!i))try{var n=this._pos,s=this.config,l=this.canvas.getBoundingClientRect(),u=l.width,c=l.height;if(u!==n.width||c!==n.height||n.pi!==i){var h=parseInt(u/c*100,10);n.pi=i,n.width!==u&&(n.width=this.canvas.width=u),n.height!==c&&(n.height=this.canvas.height=c);var g=c,v=u;h<i?v=parseInt(c*i/100,10):h>i&&(g=parseInt(u*100/i,10)),n.rwidth=v*s.multiple,n.rheight=g*s.multiple,n.x=(u-n.rwidth)/2,n.y=(c-n.rheight)/2}this.canvasFilter&&(this.canvasCtx.filter=s.filter),this.canvasCtx.drawImage(e,n.x,n.y,n.rwidth,n.rheight)}catch(p){F.logError("plugin:DynamicBg",p)}}},{key:"destroy",value:function(){this.stop(),document.removeEventListener("visibilitychange",this.onVisibilitychange),this.canvasCtx=null,this.canvas=null}},{key:"render",value:function(){return""}}],[{key:"pluginName",get:function(){return"dynamicBg"}},{key:"defaultConfig",get:function(){return{isInnerRender:!1,disable:!0,index:-1,mode:"framerate",frameRate:10,filter:"blur(50px)",startFrameCount:2,startInterval:0,addMask:!0,multiple:1.2,maskBg:"rgba(0,0,0,0.7)"}}},{key:"isSupport",get:function(){return typeof ot=="boolean"||(ot=no()),ot}},{key:"supportCanvasFilter",value:function(){return!(O.browser==="safari"||O.browser==="firefox")}}]),r}(H),so={LANG:"zh-cn",TEXT:{ERROR_TYPES:{network:{code:1,msg:"视频下载错误"},mse:{code:2,msg:"流追加错误"},parse:{code:3,msg:"解析错误"},format:{code:4,msg:"格式错误"},decoder:{code:5,msg:"解码错误"},runtime:{code:6,msg:"语法错误"},timeout:{code:7,msg:"播放超时"},other:{code:8,msg:"其他错误"}},HAVE_NOTHING:"没有关于音频/视频是否就绪的信息",HAVE_METADATA:"音频/视频的元数据已就绪",HAVE_CURRENT_DATA:"关于当前播放位置的数据是可用的,但没有足够的数据来播放下一帧/毫秒",HAVE_FUTURE_DATA:"当前及至少下一帧的数据是可用的",HAVE_ENOUGH_DATA:"可用数据足以开始播放",NETWORK_EMPTY:"音频/视频尚未初始化",NETWORK_IDLE:"音频/视频是活动的且已选取资源,但并未使用网络",NETWORK_LOADING:"浏览器正在下载数据",NETWORK_NO_SOURCE:"未找到音频/视频来源",MEDIA_ERR_ABORTED:"取回过程被用户中止",MEDIA_ERR_NETWORK:"网络错误",MEDIA_ERR_DECODE:"解码错误",MEDIA_ERR_SRC_NOT_SUPPORTED:"不支持的音频/视频格式",REPLAY:"重播",ERROR:"网络连接似乎出现了问题",PLAY_TIPS:"播放",PAUSE_TIPS:"暂停",PLAYNEXT_TIPS:"下一集",DOWNLOAD_TIPS:"下载",ROTATE_TIPS:"旋转",RELOAD_TIPS:"重新载入",FULLSCREEN_TIPS:"进入全屏",EXITFULLSCREEN_TIPS:"退出全屏",CSSFULLSCREEN_TIPS:"进入样式全屏",EXITCSSFULLSCREEN_TIPS:"退出样式全屏",TEXTTRACK:"字幕",PIP:"画中画",SCREENSHOT:"截图",LIVE:"正在直播",OFF:"关闭",OPEN:"开启",MINI_DRAG:"点击按住可拖动视频",MINISCREEN:"小屏幕",REFRESH_TIPS:"请试试",REFRESH:"刷新",FORWARD:"快进中",LIVE_TIP:"直播"}},Ve="info",zt=mi,oo=function(a){x(r,a);var o=P(r);function r(){var t;E(this,r);for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return t=o.call.apply(o,[this].concat(i)),k(m(t),"_recordUserActions",function(s){var l=t._getTime(),u=Object.assign({},s,{msg:s.msg||s.action});t._stats[Ve].push(V(V({type:"userAction"},l),{},{payload:u}))}),k(m(t),"_onReset",function(){t.reset()}),k(m(t),"_recordInfo",function(s){t.info(s)}),k(m(t),"_downloadStats",function(){var s=t.getStats(),l=new Blob([JSON.stringify(s)],{type:"application/json"}),u=window.URL.createObjectURL(l),c=document.createElement("a");c.style.display="none",c.href=u,c.download="player.txt",c.disabled=!1,c.click()}),t}return S(r,[{key:"_getTime",value:function(){return{timestamp:Date.now(),timeFormat:new Date().toISOString()}}},{key:"afterCreate",value:function(){this.reset(),this.on(Ze,this._recordUserActions),this.on(zt.STATS_INFO,this._recordInfo),this.on(zt.STATS_DOWNLOAD,this._downloadStats),this.on(zt.STATS_RESET,this._onReset)}},{key:"destroy",value:function(){this.offAll()}},{key:"downloadStats",value:function(){this._downloadStats()}},{key:"info",value:function(e){e.profile?this._infoProfile(e):this._info(e)}},{key:"_info",value:function(e){var i=this._getTime();this._stats[Ve].push(V(V({},i),{},{payload:e}))}},{key:"_infoProfile",value:function(e){if(e&&e.startMs){var i=Date.now(),n=i-e.startMs,s=V({cat:"function",dur:n,name:e.name||e.msg,ph:"X",pid:0,tid:0,ts:e.startMs,profile:!0},e);this._info(s)}else console.warn("infoProfile need object data, include startMs")}},{key:"reset",value:function(){var e;this._stats=(e={},k(e,Ve,[]),k(e,"media",{}),e)}},{key:"getStats",value:function(){for(var e=this.player,i=e.media,n=[],s=0;s<i.buffered.length;s++)n.push({start:i.buffered.start(s),end:i.buffered.end(s)});var l={currentTime:i.currentTime,readyState:i.readyState,buffered:n,paused:i.paused,ended:i.ended};return this._stats.media=l,{raw:this._stats,timestat:this._getTimeStats(),profile:this._getProfile()}}},{key:"_getTimeStats",value:function(){var e=this._stats[Ve],i=e.map(function(n){var s=n.payload.data,l="";try{s instanceof Error?l=s.msg:s!==void 0&&(l=JSON.stringify(s))}catch(u){console.log("err",u)}return"[".concat(n.timeFormat,"] : ").concat(n.payload.msg," ").concat(l," ")});return i}},{key:"_getProfile",value:function(){var e={traceEvents:[]},i=this._stats[Ve];return i.forEach(function(n){n.payload.profile&&e.traceEvents.push(n.payload)}),e}}],[{key:"pluginName",get:function(){return"stats"}},{key:"defaultConfig",get:function(){return{}}}]),r}(he),qi=function(a){x(r,a);var o=P(r);function r(){var t;E(this,r);for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return t=o.call.apply(o,[this].concat(i)),k(m(t),"onGapJump",function(){var s=m(t),l=s.player,u=s.config;if(l.media.readyState!==HTMLMediaElement.HAVE_NOTHING){if(l.media.seeking){if(!t.seekingEventReceived)return}else t.seekingEventReceived=!1;if(!(l.media.paused&&l.media.currentTime!==0&&t.hasPlayed)){var c=l.media.buffered,h=u.smallGapLimit||.5,g=u.gapDetectionThreshold||.3,v=l.media.currentTime,p=t._getIndex(c,v,g);if(!(p===null||p===0)){console.log("GapJump bufferRange ",c.start(p),c.end(p));var y=c.start(p)+.1,_=l.media.duration;if(!(y>_)){var w=y-v,T=w<=h;w<r.BROWSER_GAP_TOLERANCE||T&&(u.useGapJump!==!1&&(l.media.currentTime=t.isSafari?y+.1:y),t.player&&t.player.emit("detectGap"),console.log("gapJump gapIndex",p," isGapSamll:",T," currentTime:",l.media.currentTime," jumpSize:",v-l.media.currentTime),y!==.08&&l&&l.emit("log",{type:"oneevent",end_type:"gap",vid:l.config.vid,ext:{video_postion:Math.floor(y*1e3)}}))}}}}}),t}return S(r,[{key:"afterCreate",value:function(){var e=this,i=this.config.useGapJump;i!==!1&&(this.hasPlayed=!1,this.seekingEventReceived=!1,this.isSafari=/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),this.on(Be,this.onGapJump),this.on(Y,function(){e.hasPlayed=!0}),this.on(We,function(){e.seekingEventReceived=!0}))}},{key:"_getIndex",value:function(e,i,n){if(!e||!e.length||e.length===1&&e.end(0)-e.start(0)<1e-6)return null;for(var s=this._getBuffered(e),l=null,u=0;u<s.length;u++){var c=s[u];if(c.start>i&&(u===0||s[u-1].end-i<=n)){l=u;break}}return l}},{key:"_getBuffered",value:function(e){if(!e)return[];for(var i=[],n=0;n<e.length;n++)i.push({start:e.start(n),end:e.end(n)});return i}}],[{key:"pluginName",get:function(){return"gapJump"}},{key:"defaultConfig",get:function(){return{useGapJump:!1,smallGapLimit:.5,gapDetectionThreshold:.3}}}]),r}(H);qi.BROWSER_GAP_TOLERANCE=.001;var ao=function(a){x(r,a);var o=P(r);function r(){var t;E(this,r);for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return t=o.call.apply(o,[this].concat(i)),k(m(t),"onWaiting",function(){var s=m(t),l=s.config;t.jumpCnt>l.jumpCntMax||t.timer||l.useWaitingTimeoutJump===!1||(t.timer=setTimeout(t.onJump,l.waitingTime*1e3))}),k(m(t),"onJump",function(){var s=m(t),l=s.player,u=s.config;if(clearTimeout(t.timer),t.timer=null,!(t.jumpCnt>u.jumpCntMax||u.useWaitingTimeoutJump===!1)&&!(l.media.paused&&l.media.currentTime!==0&&t.hasPlayed)){t.jumpSize=u.jumpSize*(t.jumpCnt+1),t.jumpCnt===u.jumpSize&&t.jumpSize<6&&(t.jumpSize=6);var c=l.currentTime+t.jumpSize,h=l.media.duration;c>h||(t.jumpCnt++,l.currentTime=c)}}),t}return S(r,[{key:"afterCreate",value:function(){var e=this,i=this.config,n=i.useWaitingTimeoutJump,s=i.jumpSize;n!==!1&&(this.hasPlayed=!1,this.jumpCnt=0,this.timer=null,this.jumpSize=s,this.on(Be,this.onWaiting),this.on([mt,oe],function(){clearTimeout(e.timer),e.timer=null,e.jumpSize=e.config.jumpSize}),this.on(Y,function(){e.hasPlayed=!0}))}}],[{key:"pluginName",get:function(){return"waitingTimeoutJump"}},{key:"defaultConfig",get:function(){return{useWaitingTimeoutJump:!1,waitingTime:15,jumpSize:2,jumpCntMax:4}}}]),r}(H),Oe="cdn",at=["cdn"],lo=function(a){x(r,a);var o=P(r);function r(){var t;E(this,r);for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return t=o.call.apply(o,[this].concat(i)),k(m(t),"getSpeed",function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Oe;if(!t.speedListCache||!t.speedListCache[s]||t.speedListCache[s].length<=0)return 0;var l=0;return t.speedListCache[s].map(function(u){l+=u}),Math.floor(l/t.speedListCache[s].length)}),k(m(t),"startTimer",function(){f.isMSE(t.player.video)||(t.initSpeedList(),t.cnt=0,t.timer=setTimeout(t.testSpeed,t.config.testTimeStep))}),k(m(t),"initSpeedList",function(){t.speedListCache={},at.forEach(function(s){t.speedListCache[s]=[]})}),k(m(t),"_onRealSpeedChange",function(s){s.speed&&t.appendList(s.speed,s.type||Oe)}),k(m(t),"testSpeed",function(){if(clearTimeout(t.timer),t.timer=null,!(!t.player||!t.config.openSpeed)){var s=t.config,l=s.url,u=s.loadSize,c=s.testCnt,h=s.testTimeStep,g=l+(l.indexOf("?")<0?"?testst=":"&testst=")+Date.now();if(!(t.cnt>=c)){t.cnt++;try{var v=new Date().getTime(),p=null,y=new XMLHttpRequest;t.xhr=y,y.open("GET",g);var _={},w=Math.floor(Math.random()*10);_.Range="bytes="+w+"-"+(u+w),_&&Object.keys(_).forEach(function(T){y.setRequestHeader(T,_[T])}),y.onreadystatechange=function(){if(y.readyState===4){t.xhr=null,p=new Date().getTime();var T=y.getResponseHeader("Content-Length")/1024*8,b=Math.round(T*1e3/(p-v));t.appendList(b),t.timer=setTimeout(t.testSpeed,h)}},y.send()}catch(T){console.error(T)}}}}),k(m(t),"appendList",function(s){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Oe;if(!(!t.speedListCache||!t.speedListCache[l])){var u=t.config.saveSpeedMax;t.speedListCache[l].length>=u&&t.speedListCache[l].shift(),t.speedListCache[l].push(s);var c=m(t),h=c.player;h&&(l===Oe?h.realTimeSpeed=s:h[t.getSpeedName("realTime",l)]=s),t.updateSpeed(l)}}),k(m(t),"updateSpeed",function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Oe,l=t.getSpeed(s),u=m(t),c=u.player;if(c)if(s===Oe)(!c.avgSpeed||l!==c.avgSpeed)&&(c.avgSpeed=l,c.emit(bt,{speed:l,realTimeSpeed:c.realTimeSpeed}));else{var h=t.getSpeedName("avg",s);(!c[h]||l!==c[h])&&(c[h]=l,c.emit(bt,{speed:l,realTimeSpeed:c.realTimeSpeed}))}}),t}return S(r,[{key:"afterCreate",value:function(){var e=this.config,i=e.openSpeed,n=e.addSpeedTypeList;(n==null?void 0:n.length)>0&&at.push.apply(at,J(n)),this.initSpeedList(),this.on("real_time_speed",this._onRealSpeedChange),this.timer=null,this.cnt=0,this.xhr=null,i&&this.on([ae,$e],this.startTimer)}},{key:"getSpeedName",value:function(e,i){return e+"Speed"+i.toUpperCase()}},{key:"openSpeed",get:function(){return this.config.openSpeed},set:function(e){if(this.config.openSpeed=e,!e&&this.timer){clearTimeout(this.timer),this.timer=null;return}if(this.config.openSpeed){if(this.timer)return;this.timer=setTimeout(this.testSpeed,this.config.testTimeStep)}}},{key:"destroy",value:function(){var e=this;this.off("real_time_speed",this._onRealSpeedChange),this.off([ae,$e],this.startTimer),at.forEach(function(i){e.speedListCache&&e.speedListCache[i]&&(e.speedListCache[i]=[])}),this.speedListCache&&(this.speedListCache={}),clearTimeout(this.timer),this.timer=null,this.xhr&&this.xhr.readyState!==4&&(this.xhr.cancel&&this.xhr.cancel(),this.xhr=null)}}],[{key:"pluginName",get:function(){return"testspeed"}},{key:"defaultConfig",get:function(){return{openSpeed:!1,testCnt:3,loadSize:200*1024,testTimeStep:3e3,url:"",saveSpeedMax:5,addSpeedTypeList:[]}}}]),r}(H),uo=function(a){x(r,a);var o=P(r);function r(){return E(this,r),o.apply(this,arguments)}return S(r,[{key:"afterCreate",value:function(){var e=this,i=this.player,n=this.config,s=i.media||i.video;if(this.timer=null,this._lastDecodedFrames=0,this._currentStuckCount=0,this._lastCheckPoint=null,this._payload=[],!n.disabled){var l=s.getVideoPlaybackQuality;l&&(this.on(Y,function(){e._startTick()}),this.on(Se,function(){e._stopTick()}),this.on(ye,function(){e._stopTick()}),this.on(_e,function(){e._stopTick()}))}}},{key:"_startTick",value:function(){var e=this;this._stopTick(),this._timer=setTimeout(function(){e._checkDecodeFPS(),e._startTick()},this.config.tick)}},{key:"_stopTick",value:function(){clearTimeout(this._timer),this._timer=null}},{key:"_checkBuffer",value:function(e,i){for(var n=!1,s=[],l=0;l<i.length;l++){var u=i.start(l),c=i.end(l);if(s.push({start:u,end:c}),u<=e&&e<=c-1){n=!0;break}}return{enoughBuffer:n,buffers:s}}},{key:"_checkStuck",value:function(e,i,n,s){var l=this.player.media||this.player.video,u=document.hidden,c=l.paused,h=l.readyState,g=l.currentTime,v=l.buffered;if(!(u||c||h<4)){var p=this._checkBuffer(g,v),y=p.enoughBuffer,_=p.buffers;y&&(e<=this.config.reportFrame?(this._currentStuckCount++,this._payload.push({currentTime:g,buffers:_,curDecodedFrames:e,totalVideoFrames:i,droppedVideoFrames:n,checkInterval:s}),this._currentStuckCount>=this.config.stuckCount&&(this.emit(yi,this._payload),this._reset())):this._reset())}}},{key:"_reset",value:function(){this._payload=[],this._currentStuckCount=0}},{key:"_checkDecodeFPS",value:function(){var e=this.player.media||this.player.video;if(e){var i=e.getVideoPlaybackQuality(),n=i.totalVideoFrames,s=i.droppedVideoFrames,l=performance.now();if(n&&this._lastCheckPoint){var u=n-this._lastDecodedFrames,c=l-this._lastCheckPoint;this._checkStuck(u,n,s,c)}this._lastDecodedFrames=n,this._lastCheckPoint=l}}},{key:"destroy",value:function(){this._stopTick()}}],[{key:"pluginName",get:function(){return"FpsDetect"}},{key:"defaultConfig",get:function(){return{disabled:!1,tick:1e3,stuckCount:3,reportFrame:0}}}]),r}(H);Pe.use(so);var co=S(function a(o,r){var t,e,i;E(this,a);var n=r&&r.isMobileSimulateMode==="mobile",s=r.isLive,l=s?[]:[xs,_s,to,Qs,Ss],u=[].concat(l,[ks,Es,Rs,Bs,$s,Ks,zs,js,Ls,Ms]),c=[Qr,es,is,vs,ns,qs,Zs,eo,as];this.plugins=[oo,Zr].concat(J(u),c,[qi,ao]);var h=n?"mobile":O.device;switch(h){case"pc":(t=this.plugins).push.apply(t,[ji,Ht,$i,lo,uo]);break;case"mobile":(e=this.plugins).push.apply(e,[ds]);break;default:(i=this.plugins).push.apply(i,[ji,Ht,$i])}(O.os.isIpad||h==="pc")&&this.plugins.push(ro),O.os.isIpad&&this.plugins.push(Ht),this.ignores=[],this.i18n=[]}),Q=function(a){x(r,a);var o=P(r);function r(){return E(this,r),o.apply(this,arguments)}return S(r)}(nt);k(Q,"defaultPreset",co),k(Q,"Util",f),k(Q,"Sniffer",O),k(Q,"Errors",je),k(Q,"Events",Er),k(Q,"Plugin",H),k(Q,"BasePlugin",he),k(Q,"I18N",Pe),k(Q,"STATE_CLASS",C),k(Q,"InstManager",Di);const la="",fo=["id"],ho=d.defineComponent({name:"ElImageViewer",__name:"Player",props:d.mergeModels({url:{type:String,default:""},zIndex:{type:Number,default:200},config:{type:Object,default:()=>({})}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:d.mergeModels({close:()=>!0},["update:modelValue"]),setup(a,{emit:o}){let r=null;const t=a,{cLoadUrl:e}=Wt(t),i=d.computed(()=>Me(e.value,t.url)),n={width:"100%",height:"100%",autoplay:!1,volume:.6,controls:!0,playbackRate:[.5,.75,1,1.5,2],crossOrigin:!0,preload:"auto",muted:!1,loop:!0,poster:"",lang:"zh-CN",screenShot:!0},s=d.computed(()=>({...n,...t.config})),l=o,u=d.useModel(a,"modelValue"),c=Fe.buildUUID(),h=Ji.useNamespace("image-viewer");function g(){l("close"),u.value=!1,r.destroy()}return d.watch(()=>u.value,v=>{v&&d.nextTick(()=>{r=new Q({id:c,url:i.value,...s.value})})}),(v,p)=>{const y=d.resolveComponent("el-icon");return u.value?(d.openBlock(),d.createBlock(d.Teleport,{key:0,to:"body"},[d.createVNode(d.Transition,{name:"viewer-fade",appear:""},{default:d.withCtx(()=>[d.createElementVNode("div",{ref:"wrapper",tabindex:-1,class:d.normalizeClass(d.unref(h).e("wrapper")),style:d.normalizeStyle({zIndex:a.zIndex})},[d.createElementVNode("div",{class:d.normalizeClass(d.unref(h).e("mask"))},null,2),d.createCommentVNode(" CANVAS "),d.createElementVNode("div",{class:d.normalizeClass(d.unref(h).e("canvas"))},[d.createElementVNode("div",{id:d.unref(c)},null,8,fo),d.createCommentVNode(" CLOSE "),d.createElementVNode("span",{class:d.normalizeClass([d.unref(h).e("btn"),d.unref(h).e("close")]),onClick:g},[d.createVNode(y,{onClick:g},{default:d.withCtx(()=>[d.createVNode(d.unref(Pn))]),_:1})],2)],2),d.renderSlot(v.$slots,"default",{},void 0,!0)],6)]),_:3})])):d.createCommentVNode("v-if",!0)}}}),ua="",go=me(ze(ho,[["__scopeId","data-v-b301aa7d"]])),po=["onClick"],vo={class:"fileName simple"},mo=["onClick"],yo={class:"text"},_o={class:"fileName"},ko={class:"size"},Co=d.defineComponent({__name:"IkPreviewFile",props:{list:{type:Array,default:()=>[]},url:{required:!0,type:String,default:""},loadUrl:{type:String,default:""},field:{required:!0,type:Object,default:()=>({})},iconSize:{type:Number,default:40},showBg:{type:Boolean,default:!0},width:{type:Number||String,default:"100%"},iconHoverShow:{type:Boolean,default:!1},isOnlyOfficePreview:{type:Boolean,default:!0},onlyOfficeAccept:{type:String,default:".pdf,.docx,.doc.ppt,.pptx,.xlsx,.xls,"},onlyofficeServer:{type:String,default:""},onlyOfficeConfig:{type:Object,default:()=>({})},jwtToken:{type:String,default:""},simple:{type:Boolean,default:!1}},emits:["handPreview"],setup(a,{emit:o}){const r=a,{cLoadUrl:t,cOnlyofficeConfig:e,cOnlyofficePreviewType:i}=Wt(r),n=o,s=d.computed(()=>({name:"name",url:"url",suffix:"suffix",size:"size",...r.field})),l=d.ref({}),u=d.ref(!1),c=p=>{var y,_;console.log("priview",p),l.value={...p,name:p.name,url:Me(t.value,p.url||((_=(y=p==null?void 0:p.response)==null?void 0:y.data)==null?void 0:_.id)||(p==null?void 0:p.id))},r.isOnlyOfficePreview&&(u.value=!0),n("handPreview",l.value)},h=p=>{Fe.ikFile.downloadFile(Me(t.value,p[s.value.url]||p.attachmentId||p.id),p[s.value.name]||p.attachmentName)},g=d.computed(()=>Fe.paramType.isNumber(r.width)?`${r.width}px`:r.width),v=d.computed(()=>r.list.map(p=>({...p,name:p[s.value.name]||p.attachmentName,size:p[s.value.size]||p.fileSize||p.attachmentSize,suffix:p[s.value.suffix]||p.attachmentSuffix})));return(p,y)=>{var w,T,b;const _=d.resolveComponent("tmplate");return d.openBlock(),d.createElementBlock(d.Fragment,null,[(w=a.list)!=null&&w.length?(d.openBlock(),d.createElementBlock(d.Fragment,{key:0},[a.simple?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(v.value,(I,R)=>(d.openBlock(),d.createElementBlock("div",{class:"iking-privew-annex simple",onClick:N=>c(I),style:d.normalizeStyle({width:g.value})},[d.createElementVNode("div",vo,d.toDisplayString(I.name),1),d.createElementVNode("div",{class:d.normalizeClass(["flex flex-center",{"hover-show":a.iconHoverShow}])},[d.createVNode(d.unref(Ee),{name:"iksvg_daochu",onClick:d.withModifiers(N=>h(I),["stop"]),size:20,active:""},null,8,["onClick"]),d.unref(i).includes(I.suffix)?(d.openBlock(),d.createBlock(d.unref(Ee),{key:0,name:"iksvg_yulan",size:20,active:""})):d.createCommentVNode("v-if",!0),d.renderSlot(p.$slots,"operation",{data:{...I,findex:R}})],2)],12,po))),256)):(d.openBlock(),d.createBlock(_,{key:1},{default:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(v.value,(I,R)=>{var N;return d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["iking-privew-annex",{"is-bg":a.showBg}]),key:R,style:d.normalizeStyle({marginBottom:R==((N=a.list)==null?void 0:N.length)-1?"0":"10px",width:g.value})},[d.createElementVNode("div",{class:"file-card",onClick:D=>c(I)},[d.createVNode(d.unref(Sn),{file:I,style:d.normalizeStyle({height:`${a.iconSize}px`}),class:"ikui-w-auto",fields:s.value},null,8,["file","style","fields"]),d.createElementVNode("div",yo,[d.createElementVNode("div",_o,d.toDisplayString(I.name),1),d.createElementVNode("div",ko,d.toDisplayString(d.unref(In)(I.size)),1)]),d.createElementVNode("div",{class:d.normalizeClass(["flex flex-center",{"hover-show":a.iconHoverShow}])},[d.createVNode(d.unref(Ee),{name:"iksvg_daochu",onClick:d.withModifiers(D=>h(I),["stop"]),bg:a.showBg,size:a.showBg?"default":20,title:"下载"},null,8,["onClick","bg","size"]),d.unref(i).includes(I.suffix)?(d.openBlock(),d.createBlock(d.unref(Ee),{key:0,name:"iksvg_yulan",bg:a.showBg,size:a.showBg?"default":20,title:"预览"},null,8,["bg","size"])):d.createCommentVNode("v-if",!0),d.renderSlot(p.$slots,"operation",{data:{...I,findex:R}})],2)],8,mo)],6)}),128))]),_:3}))],64)):d.createCommentVNode("v-if",!0),d.createVNode(d.unref(Ln),{show:u.value,"onUpdate:show":y[0]||(y[0]=I=>u.value=I),loadUrl:d.unref(t),file:l.value,onlyofficeServer:((T=d.unref(e))==null?void 0:T.serverUrl)||a.onlyofficeServer,onlyOfficeConfig:d.unref(e),onlyOfficeAccept:((b=d.unref(e))==null?void 0:b.accept)||a.onlyOfficeAccept},null,8,["show","loadUrl","file","onlyofficeServer","onlyOfficeConfig","onlyOfficeAccept"])],64)}}}),fa="",Zi=me(Co);ie.IkPreviewFile=Zi,ie.default=Zi,Object.defineProperties(ie,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
226
|
+
</canvas><xgmask></xgmask></div>`)),this.root=s.children[0],this.canvas=this.find("canvas"),this.canvasFilter||(this.canvas.style.filter=n.filter,this.canvas.style.webkitFilter=n.filter),this.mask=this.find("xgmask"),n.addMask&&(this.mask.style.background=n.maskBg),this.canvasCtx=this.canvas.getContext("2d")}catch(l){F.logError("plugin:DynamicBg",l)}}},{key:"reRender",value:function(e){var i=this.config.disable;if(!(!i&&!this.root)){this.stop();var n=this.root?this.root.parentElement:null;if(n!==e&&n.removeChild(this.root),!e){this.root=null;return}this.init(e),this.renderOnce();var s=this.config.startInterval;this._checkIfCanStart()&&this.start(0,s)}}},{key:"checkVideoIsSupport",value:function(e){if(!e)return null;var i=e&&e instanceof window.HTMLVideoElement?e:e.canvas?e.canvas:e.flyVideo?e.flyVideo:null;if(i&&!(O.browser==="safari"&&f.isMSE(i)))return i;var n=i?i.tagName.toLowerCase():"";return n==="canvas"||n==="img"?i:null}},{key:"renderByPoster",value:function(){var e=this.playerConfig.poster;if(e){var i=f.typeOf(e)==="String"?e:f.typeOf(e.poster)==="String"?e.poster:null;this.updateImg(i)}}},{key:"_checkIfCanStart",value:function(){var e=this.config.mode;return this._isLoaded&&!this.player.paused&&e!==Re.FIRST_FRAME&&e!==Re.POSTER}},{key:"renderOnce",value:function(){var e=this.player.video;if(!(!e.videoWidth||!e.videoHeight)){this.videoPI=parseInt(e.videoWidth/e.videoHeight*100,10);var i=this.checkVideoIsSupport(e);i&&this.update(i,this.videoPI)}}},{key:"updateImg",value:function(e){var i=this;if(e){var n=this.canvas.getBoundingClientRect(),s=n.width,l=n.height,u=new window.Image;u.onload=function(){if(!(!i.canvas||i.frameId||i.isStart)){i.canvas.height=l,i.canvas.width=s;var c=parseInt(s/l*100,10);i.update(u,c),u=null}},u.src=e}}},{key:"update",value:function(e,i){if(!(!this.canvas||!this.canvasCtx||!i))try{var n=this._pos,s=this.config,l=this.canvas.getBoundingClientRect(),u=l.width,c=l.height;if(u!==n.width||c!==n.height||n.pi!==i){var h=parseInt(u/c*100,10);n.pi=i,n.width!==u&&(n.width=this.canvas.width=u),n.height!==c&&(n.height=this.canvas.height=c);var g=c,v=u;h<i?v=parseInt(c*i/100,10):h>i&&(g=parseInt(u*100/i,10)),n.rwidth=v*s.multiple,n.rheight=g*s.multiple,n.x=(u-n.rwidth)/2,n.y=(c-n.rheight)/2}this.canvasFilter&&(this.canvasCtx.filter=s.filter),this.canvasCtx.drawImage(e,n.x,n.y,n.rwidth,n.rheight)}catch(p){F.logError("plugin:DynamicBg",p)}}},{key:"destroy",value:function(){this.stop(),document.removeEventListener("visibilitychange",this.onVisibilitychange),this.canvasCtx=null,this.canvas=null}},{key:"render",value:function(){return""}}],[{key:"pluginName",get:function(){return"dynamicBg"}},{key:"defaultConfig",get:function(){return{isInnerRender:!1,disable:!0,index:-1,mode:"framerate",frameRate:10,filter:"blur(50px)",startFrameCount:2,startInterval:0,addMask:!0,multiple:1.2,maskBg:"rgba(0,0,0,0.7)"}}},{key:"isSupport",get:function(){return typeof ot=="boolean"||(ot=no()),ot}},{key:"supportCanvasFilter",value:function(){return!(O.browser==="safari"||O.browser==="firefox")}}]),r}(H),so={LANG:"zh-cn",TEXT:{ERROR_TYPES:{network:{code:1,msg:"视频下载错误"},mse:{code:2,msg:"流追加错误"},parse:{code:3,msg:"解析错误"},format:{code:4,msg:"格式错误"},decoder:{code:5,msg:"解码错误"},runtime:{code:6,msg:"语法错误"},timeout:{code:7,msg:"播放超时"},other:{code:8,msg:"其他错误"}},HAVE_NOTHING:"没有关于音频/视频是否就绪的信息",HAVE_METADATA:"音频/视频的元数据已就绪",HAVE_CURRENT_DATA:"关于当前播放位置的数据是可用的,但没有足够的数据来播放下一帧/毫秒",HAVE_FUTURE_DATA:"当前及至少下一帧的数据是可用的",HAVE_ENOUGH_DATA:"可用数据足以开始播放",NETWORK_EMPTY:"音频/视频尚未初始化",NETWORK_IDLE:"音频/视频是活动的且已选取资源,但并未使用网络",NETWORK_LOADING:"浏览器正在下载数据",NETWORK_NO_SOURCE:"未找到音频/视频来源",MEDIA_ERR_ABORTED:"取回过程被用户中止",MEDIA_ERR_NETWORK:"网络错误",MEDIA_ERR_DECODE:"解码错误",MEDIA_ERR_SRC_NOT_SUPPORTED:"不支持的音频/视频格式",REPLAY:"重播",ERROR:"网络连接似乎出现了问题",PLAY_TIPS:"播放",PAUSE_TIPS:"暂停",PLAYNEXT_TIPS:"下一集",DOWNLOAD_TIPS:"下载",ROTATE_TIPS:"旋转",RELOAD_TIPS:"重新载入",FULLSCREEN_TIPS:"进入全屏",EXITFULLSCREEN_TIPS:"退出全屏",CSSFULLSCREEN_TIPS:"进入样式全屏",EXITCSSFULLSCREEN_TIPS:"退出样式全屏",TEXTTRACK:"字幕",PIP:"画中画",SCREENSHOT:"截图",LIVE:"正在直播",OFF:"关闭",OPEN:"开启",MINI_DRAG:"点击按住可拖动视频",MINISCREEN:"小屏幕",REFRESH_TIPS:"请试试",REFRESH:"刷新",FORWARD:"快进中",LIVE_TIP:"直播"}},Ve="info",zt=mi,oo=function(a){x(r,a);var o=P(r);function r(){var t;E(this,r);for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return t=o.call.apply(o,[this].concat(i)),k(m(t),"_recordUserActions",function(s){var l=t._getTime(),u=Object.assign({},s,{msg:s.msg||s.action});t._stats[Ve].push(V(V({type:"userAction"},l),{},{payload:u}))}),k(m(t),"_onReset",function(){t.reset()}),k(m(t),"_recordInfo",function(s){t.info(s)}),k(m(t),"_downloadStats",function(){var s=t.getStats(),l=new Blob([JSON.stringify(s)],{type:"application/json"}),u=window.URL.createObjectURL(l),c=document.createElement("a");c.style.display="none",c.href=u,c.download="player.txt",c.disabled=!1,c.click()}),t}return S(r,[{key:"_getTime",value:function(){return{timestamp:Date.now(),timeFormat:new Date().toISOString()}}},{key:"afterCreate",value:function(){this.reset(),this.on(Ze,this._recordUserActions),this.on(zt.STATS_INFO,this._recordInfo),this.on(zt.STATS_DOWNLOAD,this._downloadStats),this.on(zt.STATS_RESET,this._onReset)}},{key:"destroy",value:function(){this.offAll()}},{key:"downloadStats",value:function(){this._downloadStats()}},{key:"info",value:function(e){e.profile?this._infoProfile(e):this._info(e)}},{key:"_info",value:function(e){var i=this._getTime();this._stats[Ve].push(V(V({},i),{},{payload:e}))}},{key:"_infoProfile",value:function(e){if(e&&e.startMs){var i=Date.now(),n=i-e.startMs,s=V({cat:"function",dur:n,name:e.name||e.msg,ph:"X",pid:0,tid:0,ts:e.startMs,profile:!0},e);this._info(s)}else console.warn("infoProfile need object data, include startMs")}},{key:"reset",value:function(){var e;this._stats=(e={},k(e,Ve,[]),k(e,"media",{}),e)}},{key:"getStats",value:function(){for(var e=this.player,i=e.media,n=[],s=0;s<i.buffered.length;s++)n.push({start:i.buffered.start(s),end:i.buffered.end(s)});var l={currentTime:i.currentTime,readyState:i.readyState,buffered:n,paused:i.paused,ended:i.ended};return this._stats.media=l,{raw:this._stats,timestat:this._getTimeStats(),profile:this._getProfile()}}},{key:"_getTimeStats",value:function(){var e=this._stats[Ve],i=e.map(function(n){var s=n.payload.data,l="";try{s instanceof Error?l=s.msg:s!==void 0&&(l=JSON.stringify(s))}catch(u){console.log("err",u)}return"[".concat(n.timeFormat,"] : ").concat(n.payload.msg," ").concat(l," ")});return i}},{key:"_getProfile",value:function(){var e={traceEvents:[]},i=this._stats[Ve];return i.forEach(function(n){n.payload.profile&&e.traceEvents.push(n.payload)}),e}}],[{key:"pluginName",get:function(){return"stats"}},{key:"defaultConfig",get:function(){return{}}}]),r}(he),qi=function(a){x(r,a);var o=P(r);function r(){var t;E(this,r);for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return t=o.call.apply(o,[this].concat(i)),k(m(t),"onGapJump",function(){var s=m(t),l=s.player,u=s.config;if(l.media.readyState!==HTMLMediaElement.HAVE_NOTHING){if(l.media.seeking){if(!t.seekingEventReceived)return}else t.seekingEventReceived=!1;if(!(l.media.paused&&l.media.currentTime!==0&&t.hasPlayed)){var c=l.media.buffered,h=u.smallGapLimit||.5,g=u.gapDetectionThreshold||.3,v=l.media.currentTime,p=t._getIndex(c,v,g);if(!(p===null||p===0)){console.log("GapJump bufferRange ",c.start(p),c.end(p));var y=c.start(p)+.1,_=l.media.duration;if(!(y>_)){var w=y-v,T=w<=h;w<r.BROWSER_GAP_TOLERANCE||T&&(u.useGapJump!==!1&&(l.media.currentTime=t.isSafari?y+.1:y),t.player&&t.player.emit("detectGap"),console.log("gapJump gapIndex",p," isGapSamll:",T," currentTime:",l.media.currentTime," jumpSize:",v-l.media.currentTime),y!==.08&&l&&l.emit("log",{type:"oneevent",end_type:"gap",vid:l.config.vid,ext:{video_postion:Math.floor(y*1e3)}}))}}}}}),t}return S(r,[{key:"afterCreate",value:function(){var e=this,i=this.config.useGapJump;i!==!1&&(this.hasPlayed=!1,this.seekingEventReceived=!1,this.isSafari=/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),this.on(Be,this.onGapJump),this.on(Y,function(){e.hasPlayed=!0}),this.on(We,function(){e.seekingEventReceived=!0}))}},{key:"_getIndex",value:function(e,i,n){if(!e||!e.length||e.length===1&&e.end(0)-e.start(0)<1e-6)return null;for(var s=this._getBuffered(e),l=null,u=0;u<s.length;u++){var c=s[u];if(c.start>i&&(u===0||s[u-1].end-i<=n)){l=u;break}}return l}},{key:"_getBuffered",value:function(e){if(!e)return[];for(var i=[],n=0;n<e.length;n++)i.push({start:e.start(n),end:e.end(n)});return i}}],[{key:"pluginName",get:function(){return"gapJump"}},{key:"defaultConfig",get:function(){return{useGapJump:!1,smallGapLimit:.5,gapDetectionThreshold:.3}}}]),r}(H);qi.BROWSER_GAP_TOLERANCE=.001;var ao=function(a){x(r,a);var o=P(r);function r(){var t;E(this,r);for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return t=o.call.apply(o,[this].concat(i)),k(m(t),"onWaiting",function(){var s=m(t),l=s.config;t.jumpCnt>l.jumpCntMax||t.timer||l.useWaitingTimeoutJump===!1||(t.timer=setTimeout(t.onJump,l.waitingTime*1e3))}),k(m(t),"onJump",function(){var s=m(t),l=s.player,u=s.config;if(clearTimeout(t.timer),t.timer=null,!(t.jumpCnt>u.jumpCntMax||u.useWaitingTimeoutJump===!1)&&!(l.media.paused&&l.media.currentTime!==0&&t.hasPlayed)){t.jumpSize=u.jumpSize*(t.jumpCnt+1),t.jumpCnt===u.jumpSize&&t.jumpSize<6&&(t.jumpSize=6);var c=l.currentTime+t.jumpSize,h=l.media.duration;c>h||(t.jumpCnt++,l.currentTime=c)}}),t}return S(r,[{key:"afterCreate",value:function(){var e=this,i=this.config,n=i.useWaitingTimeoutJump,s=i.jumpSize;n!==!1&&(this.hasPlayed=!1,this.jumpCnt=0,this.timer=null,this.jumpSize=s,this.on(Be,this.onWaiting),this.on([mt,oe],function(){clearTimeout(e.timer),e.timer=null,e.jumpSize=e.config.jumpSize}),this.on(Y,function(){e.hasPlayed=!0}))}}],[{key:"pluginName",get:function(){return"waitingTimeoutJump"}},{key:"defaultConfig",get:function(){return{useWaitingTimeoutJump:!1,waitingTime:15,jumpSize:2,jumpCntMax:4}}}]),r}(H),Oe="cdn",at=["cdn"],lo=function(a){x(r,a);var o=P(r);function r(){var t;E(this,r);for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return t=o.call.apply(o,[this].concat(i)),k(m(t),"getSpeed",function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Oe;if(!t.speedListCache||!t.speedListCache[s]||t.speedListCache[s].length<=0)return 0;var l=0;return t.speedListCache[s].map(function(u){l+=u}),Math.floor(l/t.speedListCache[s].length)}),k(m(t),"startTimer",function(){f.isMSE(t.player.video)||(t.initSpeedList(),t.cnt=0,t.timer=setTimeout(t.testSpeed,t.config.testTimeStep))}),k(m(t),"initSpeedList",function(){t.speedListCache={},at.forEach(function(s){t.speedListCache[s]=[]})}),k(m(t),"_onRealSpeedChange",function(s){s.speed&&t.appendList(s.speed,s.type||Oe)}),k(m(t),"testSpeed",function(){if(clearTimeout(t.timer),t.timer=null,!(!t.player||!t.config.openSpeed)){var s=t.config,l=s.url,u=s.loadSize,c=s.testCnt,h=s.testTimeStep,g=l+(l.indexOf("?")<0?"?testst=":"&testst=")+Date.now();if(!(t.cnt>=c)){t.cnt++;try{var v=new Date().getTime(),p=null,y=new XMLHttpRequest;t.xhr=y,y.open("GET",g);var _={},w=Math.floor(Math.random()*10);_.Range="bytes="+w+"-"+(u+w),_&&Object.keys(_).forEach(function(T){y.setRequestHeader(T,_[T])}),y.onreadystatechange=function(){if(y.readyState===4){t.xhr=null,p=new Date().getTime();var T=y.getResponseHeader("Content-Length")/1024*8,b=Math.round(T*1e3/(p-v));t.appendList(b),t.timer=setTimeout(t.testSpeed,h)}},y.send()}catch(T){console.error(T)}}}}),k(m(t),"appendList",function(s){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Oe;if(!(!t.speedListCache||!t.speedListCache[l])){var u=t.config.saveSpeedMax;t.speedListCache[l].length>=u&&t.speedListCache[l].shift(),t.speedListCache[l].push(s);var c=m(t),h=c.player;h&&(l===Oe?h.realTimeSpeed=s:h[t.getSpeedName("realTime",l)]=s),t.updateSpeed(l)}}),k(m(t),"updateSpeed",function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Oe,l=t.getSpeed(s),u=m(t),c=u.player;if(c)if(s===Oe)(!c.avgSpeed||l!==c.avgSpeed)&&(c.avgSpeed=l,c.emit(bt,{speed:l,realTimeSpeed:c.realTimeSpeed}));else{var h=t.getSpeedName("avg",s);(!c[h]||l!==c[h])&&(c[h]=l,c.emit(bt,{speed:l,realTimeSpeed:c.realTimeSpeed}))}}),t}return S(r,[{key:"afterCreate",value:function(){var e=this.config,i=e.openSpeed,n=e.addSpeedTypeList;(n==null?void 0:n.length)>0&&at.push.apply(at,J(n)),this.initSpeedList(),this.on("real_time_speed",this._onRealSpeedChange),this.timer=null,this.cnt=0,this.xhr=null,i&&this.on([ae,$e],this.startTimer)}},{key:"getSpeedName",value:function(e,i){return e+"Speed"+i.toUpperCase()}},{key:"openSpeed",get:function(){return this.config.openSpeed},set:function(e){if(this.config.openSpeed=e,!e&&this.timer){clearTimeout(this.timer),this.timer=null;return}if(this.config.openSpeed){if(this.timer)return;this.timer=setTimeout(this.testSpeed,this.config.testTimeStep)}}},{key:"destroy",value:function(){var e=this;this.off("real_time_speed",this._onRealSpeedChange),this.off([ae,$e],this.startTimer),at.forEach(function(i){e.speedListCache&&e.speedListCache[i]&&(e.speedListCache[i]=[])}),this.speedListCache&&(this.speedListCache={}),clearTimeout(this.timer),this.timer=null,this.xhr&&this.xhr.readyState!==4&&(this.xhr.cancel&&this.xhr.cancel(),this.xhr=null)}}],[{key:"pluginName",get:function(){return"testspeed"}},{key:"defaultConfig",get:function(){return{openSpeed:!1,testCnt:3,loadSize:200*1024,testTimeStep:3e3,url:"",saveSpeedMax:5,addSpeedTypeList:[]}}}]),r}(H),uo=function(a){x(r,a);var o=P(r);function r(){return E(this,r),o.apply(this,arguments)}return S(r,[{key:"afterCreate",value:function(){var e=this,i=this.player,n=this.config,s=i.media||i.video;if(this.timer=null,this._lastDecodedFrames=0,this._currentStuckCount=0,this._lastCheckPoint=null,this._payload=[],!n.disabled){var l=s.getVideoPlaybackQuality;l&&(this.on(Y,function(){e._startTick()}),this.on(Se,function(){e._stopTick()}),this.on(ye,function(){e._stopTick()}),this.on(_e,function(){e._stopTick()}))}}},{key:"_startTick",value:function(){var e=this;this._stopTick(),this._timer=setTimeout(function(){e._checkDecodeFPS(),e._startTick()},this.config.tick)}},{key:"_stopTick",value:function(){clearTimeout(this._timer),this._timer=null}},{key:"_checkBuffer",value:function(e,i){for(var n=!1,s=[],l=0;l<i.length;l++){var u=i.start(l),c=i.end(l);if(s.push({start:u,end:c}),u<=e&&e<=c-1){n=!0;break}}return{enoughBuffer:n,buffers:s}}},{key:"_checkStuck",value:function(e,i,n,s){var l=this.player.media||this.player.video,u=document.hidden,c=l.paused,h=l.readyState,g=l.currentTime,v=l.buffered;if(!(u||c||h<4)){var p=this._checkBuffer(g,v),y=p.enoughBuffer,_=p.buffers;y&&(e<=this.config.reportFrame?(this._currentStuckCount++,this._payload.push({currentTime:g,buffers:_,curDecodedFrames:e,totalVideoFrames:i,droppedVideoFrames:n,checkInterval:s}),this._currentStuckCount>=this.config.stuckCount&&(this.emit(yi,this._payload),this._reset())):this._reset())}}},{key:"_reset",value:function(){this._payload=[],this._currentStuckCount=0}},{key:"_checkDecodeFPS",value:function(){var e=this.player.media||this.player.video;if(e){var i=e.getVideoPlaybackQuality(),n=i.totalVideoFrames,s=i.droppedVideoFrames,l=performance.now();if(n&&this._lastCheckPoint){var u=n-this._lastDecodedFrames,c=l-this._lastCheckPoint;this._checkStuck(u,n,s,c)}this._lastDecodedFrames=n,this._lastCheckPoint=l}}},{key:"destroy",value:function(){this._stopTick()}}],[{key:"pluginName",get:function(){return"FpsDetect"}},{key:"defaultConfig",get:function(){return{disabled:!1,tick:1e3,stuckCount:3,reportFrame:0}}}]),r}(H);Pe.use(so);var co=S(function a(o,r){var t,e,i;E(this,a);var n=r&&r.isMobileSimulateMode==="mobile",s=r.isLive,l=s?[]:[xs,_s,to,Qs,Ss],u=[].concat(l,[ks,Es,Rs,Bs,$s,Ks,zs,js,Ls,Ms]),c=[Qr,es,is,vs,ns,qs,Zs,eo,as];this.plugins=[oo,Zr].concat(J(u),c,[qi,ao]);var h=n?"mobile":O.device;switch(h){case"pc":(t=this.plugins).push.apply(t,[ji,Ht,$i,lo,uo]);break;case"mobile":(e=this.plugins).push.apply(e,[ds]);break;default:(i=this.plugins).push.apply(i,[ji,Ht,$i])}(O.os.isIpad||h==="pc")&&this.plugins.push(ro),O.os.isIpad&&this.plugins.push(Ht),this.ignores=[],this.i18n=[]}),Q=function(a){x(r,a);var o=P(r);function r(){return E(this,r),o.apply(this,arguments)}return S(r)}(nt);k(Q,"defaultPreset",co),k(Q,"Util",f),k(Q,"Sniffer",O),k(Q,"Errors",je),k(Q,"Events",Er),k(Q,"Plugin",H),k(Q,"BasePlugin",he),k(Q,"I18N",Pe),k(Q,"STATE_CLASS",C),k(Q,"InstManager",Di);const la="",fo=["id"],ho=d.defineComponent({name:"ElImageViewer",__name:"Player",props:d.mergeModels({url:{type:String,default:""},zIndex:{type:Number,default:200},config:{type:Object,default:()=>({})}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:d.mergeModels({close:()=>!0},["update:modelValue"]),setup(a,{emit:o}){let r=null;const t=a,{cLoadUrl:e}=Wt(t),i=d.computed(()=>Me(e.value,t.url)),n={width:"100%",height:"100%",autoplay:!1,volume:.6,controls:!0,playbackRate:[.5,.75,1,1.5,2],crossOrigin:!0,preload:"auto",muted:!1,loop:!0,poster:"",lang:"zh-CN",screenShot:!0},s=d.computed(()=>({...n,...t.config})),l=o,u=d.useModel(a,"modelValue"),c=Fe.buildUUID(),h=Ji.useNamespace("image-viewer");function g(){l("close"),u.value=!1,r.destroy()}return d.watch(()=>u.value,v=>{v&&d.nextTick(()=>{r=new Q({id:c,url:i.value,...s.value})})}),(v,p)=>{const y=d.resolveComponent("el-icon");return u.value?(d.openBlock(),d.createBlock(d.Teleport,{key:0,to:"body"},[d.createVNode(d.Transition,{name:"viewer-fade",appear:""},{default:d.withCtx(()=>[d.createElementVNode("div",{ref:"wrapper",tabindex:-1,class:d.normalizeClass(d.unref(h).e("wrapper")),style:d.normalizeStyle({zIndex:a.zIndex})},[d.createElementVNode("div",{class:d.normalizeClass(d.unref(h).e("mask"))},null,2),d.createCommentVNode(" CANVAS "),d.createElementVNode("div",{class:d.normalizeClass(d.unref(h).e("canvas"))},[d.createElementVNode("div",{id:d.unref(c)},null,8,fo),d.createCommentVNode(" CLOSE "),d.createElementVNode("span",{class:d.normalizeClass([d.unref(h).e("btn"),d.unref(h).e("close")]),onClick:g},[d.createVNode(y,{onClick:g},{default:d.withCtx(()=>[d.createVNode(d.unref(Pn))]),_:1})],2)],2),d.renderSlot(v.$slots,"default",{},void 0,!0)],6)]),_:3})])):d.createCommentVNode("v-if",!0)}}}),ua="",go=me(ze(ho,[["__scopeId","data-v-b301aa7d"]])),po=["onClick"],vo={class:"fileName simple"},mo=["onClick"],yo={class:"text"},_o={class:"fileName"},ko={class:"size"},Co=d.defineComponent({__name:"IkPreviewFile",props:{list:{type:Array,default:()=>[]},url:{required:!0,type:String,default:""},loadUrl:{type:String,default:""},field:{required:!0,type:Object,default:()=>({})},iconSize:{type:Number,default:40},showBg:{type:Boolean,default:!0},width:{type:Number||String,default:"100%"},iconHoverShow:{type:Boolean,default:!1},isOnlyOfficePreview:{type:Boolean,default:!0},onlyOfficeAccept:{type:String,default:".pdf,.docx,.doc.ppt,.pptx,.xlsx,.xls,"},onlyofficeServer:{type:String,default:""},onlyOfficeConfig:{type:Object,default:()=>({})},jwtToken:{type:String,default:""},simple:{type:Boolean,default:!1}},emits:["handPreview"],setup(a,{emit:o}){const r=a,{cLoadUrl:t,cOnlyofficeConfig:e,cOnlyofficePreviewType:i}=Wt(r),n=o,s=d.computed(()=>({name:"name",url:"url",suffix:"suffix",size:"size",...r.field})),l=d.ref({}),u=d.ref(!1),c=p=>{var y,_;l.value={...p,name:p.name,url:Me(t.value,p.url||((_=(y=p==null?void 0:p.response)==null?void 0:y.data)==null?void 0:_.id)||(p==null?void 0:p.id))},r.isOnlyOfficePreview&&(u.value=!0),n("handPreview",l.value)},h=p=>{Fe.ikFile.downloadFile(Me(t.value,p[s.value.url]||p.attachmentId||p.id),p[s.value.name]||p.attachmentName)},g=d.computed(()=>Fe.paramType.isNumber(r.width)?`${r.width}px`:r.width),v=d.computed(()=>r.list.map(p=>({...p,name:p[s.value.name]||p.attachmentName,size:p[s.value.size]||p.fileSize||p.attachmentSize,suffix:p[s.value.suffix]||p.attachmentSuffix})));return(p,y)=>{var w,T,b;const _=d.resolveComponent("tmplate");return d.openBlock(),d.createElementBlock(d.Fragment,null,[(w=a.list)!=null&&w.length?(d.openBlock(),d.createElementBlock(d.Fragment,{key:0},[a.simple?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(v.value,(I,R)=>(d.openBlock(),d.createElementBlock("div",{class:"iking-privew-annex simple",onClick:N=>c(I),style:d.normalizeStyle({width:g.value})},[d.createElementVNode("div",vo,d.toDisplayString(I.name),1),d.createElementVNode("div",{class:d.normalizeClass(["flex flex-center",{"hover-show":a.iconHoverShow}])},[d.createVNode(d.unref(Ee),{name:"iksvg_daochu",onClick:d.withModifiers(N=>h(I),["stop"]),size:20,active:""},null,8,["onClick"]),d.unref(i).includes(I.suffix)?(d.openBlock(),d.createBlock(d.unref(Ee),{key:0,name:"iksvg_yulan",size:20,active:""})):d.createCommentVNode("v-if",!0),d.renderSlot(p.$slots,"operation",{data:{...I,findex:R}})],2)],12,po))),256)):(d.openBlock(),d.createBlock(_,{key:1},{default:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(v.value,(I,R)=>{var N;return d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["iking-privew-annex",{"is-bg":a.showBg}]),key:R,style:d.normalizeStyle({marginBottom:R==((N=a.list)==null?void 0:N.length)-1?"0":"10px",width:g.value})},[d.createElementVNode("div",{class:"file-card",onClick:D=>c(I)},[d.createVNode(d.unref(Sn),{file:I,style:d.normalizeStyle({height:`${a.iconSize}px`}),class:"ikui-w-auto",fields:s.value},null,8,["file","style","fields"]),d.createElementVNode("div",yo,[d.createElementVNode("div",_o,d.toDisplayString(I.name),1),d.createElementVNode("div",ko,d.toDisplayString(d.unref(In)(I.size)),1)]),d.createElementVNode("div",{class:d.normalizeClass(["flex flex-center",{"hover-show":a.iconHoverShow}])},[d.createVNode(d.unref(Ee),{name:"iksvg_daochu",onClick:d.withModifiers(D=>h(I),["stop"]),bg:a.showBg,size:a.showBg?"default":20,title:"下载"},null,8,["onClick","bg","size"]),d.unref(i).includes(I.suffix)?(d.openBlock(),d.createBlock(d.unref(Ee),{key:0,name:"iksvg_yulan",bg:a.showBg,size:a.showBg?"default":20,title:"预览"},null,8,["bg","size"])):d.createCommentVNode("v-if",!0),d.renderSlot(p.$slots,"operation",{data:{...I,findex:R}})],2)],8,mo)],6)}),128))]),_:3}))],64)):d.createCommentVNode("v-if",!0),d.createVNode(d.unref(Ln),{show:u.value,"onUpdate:show":y[0]||(y[0]=I=>u.value=I),loadUrl:d.unref(t),file:l.value,onlyofficeServer:((T=d.unref(e))==null?void 0:T.serverUrl)||a.onlyofficeServer,onlyOfficeConfig:d.unref(e),onlyOfficeAccept:((b=d.unref(e))==null?void 0:b.accept)||a.onlyOfficeAccept},null,8,["show","loadUrl","file","onlyofficeServer","onlyOfficeConfig","onlyOfficeAccept"])],64)}}}),fa="",Zi=me(Co);ie.IkPreviewFile=Zi,ie.default=Zi,Object.defineProperties(ie,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|