iking-web-ui-pro 0.2.28 → 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.
Files changed (37) hide show
  1. package/dist/IKPreviewFile/ik.index.es.js +927 -872
  2. package/dist/IKPreviewFile/ik.index.umd.js +36 -36
  3. package/dist/IKSearch/ik.index.es.js +727 -665
  4. package/dist/IKSearch/ik.index.umd.js +2 -2
  5. package/dist/IKSearch/style.css +1 -1
  6. package/dist/IkApprovalProcess/ik.index.es.js +580 -527
  7. package/dist/IkApprovalProcess/ik.index.umd.js +1 -1
  8. package/dist/IkApprovalProcess/style.css +1 -1
  9. package/dist/IkApprovalProcessDetail/ik.index.es.js +674 -619
  10. package/dist/IkApprovalProcessDetail/ik.index.umd.js +38 -38
  11. package/dist/IkCalendar/ik.index.es.js +1815 -1753
  12. package/dist/IkCalendar/ik.index.umd.js +1 -1
  13. package/dist/IkCalendar/style.css +1 -1
  14. package/dist/IkDescription/ik.index.es.js +1031 -976
  15. package/dist/IkDescription/ik.index.umd.js +36 -36
  16. package/dist/IkDetailPreviewFiles/ik.index.es.js +970 -915
  17. package/dist/IkDetailPreviewFiles/ik.index.umd.js +42 -42
  18. package/dist/IkPageFull/ik.index.es.js +1038 -976
  19. package/dist/IkPageFull/ik.index.umd.js +3 -3
  20. package/dist/IkPageFull/style.css +1 -1
  21. package/dist/IkPickerUser/ik.index.es.js +741 -679
  22. package/dist/IkPickerUser/ik.index.umd.js +1 -1
  23. package/dist/IkPickerUser/style.css +1 -1
  24. package/dist/IkPlayer/ik.index.es.js +54 -1
  25. package/dist/IkPlayer/ik.index.umd.js +1 -1
  26. package/dist/IkPreviewFileDialog/ik.index.es.js +54 -1
  27. package/dist/IkPreviewFileDialog/ik.index.umd.js +1 -1
  28. package/dist/IkUploadFile/ik.index.es.js +1640 -1579
  29. package/dist/IkUploadFile/ik.index.umd.js +58 -58
  30. package/dist/IkUploadFile/style.css +1 -1
  31. package/dist/IkUploadImage/ik.index.es.js +143 -90
  32. package/dist/IkUploadImage/ik.index.umd.js +1 -1
  33. package/dist/index.es.js +15155 -15092
  34. package/dist/index.umd.js +106 -106
  35. package/dist/src/utils/use-provider.d.ts +1 -0
  36. package/dist/style.css +1 -1
  37. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- (function(ie,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("vue"),require("iking-utils-pro"),require("element-plus")):typeof define=="function"&&define.amd?define(["exports","vue","iking-utils-pro","element-plus"],p):(ie=typeof globalThis<"u"?globalThis:ie||self,p(ie.index={},ie.vue,ie["iking-utils-pro"],ie["element-plus"]))})(this,function(ie,p,st,Zi){"use strict";const Re=(a,o)=>{if(a.install=r=>{for(const t of[a,...Object.values(o??{})])r.component(t.name,t)},o)for(const[r,t]of Object.entries(o))a[r]=t;return a},ot=(a,o)=>o?o.startsWith("http")?o:`${a||location.origin}${o}`:"",Vt=(a,o)=>{var i,n,s,l;const r=(i=a==null?void 0:a.response)!=null&&i.data?zt((s=(n=a==null?void 0:a.response)==null?void 0:n.data)==null?void 0:s.suffix):((l=a.raw)==null?void 0:l.type)||zt(a[o.suffix]),t=r==null?void 0:r.toLowerCase(),e={sheet:"excel",excel:"excel",zip:"zip","application/x-compressed":"zip",image:"image",video:"video",audio:"audio",pdf:"pdf",text:"txt",txt:"txt",word:"word",ppt:"ppt",exe:"exe",json:"json"};for(let u in e)if(typeof t=="string"&&(t.includes(u)||t===u))return e[u];return"unknown"},Ji={".doc":"word",".docx":"word",".docxf":"word",".docm":"word",".dot":"word",".dotm":"word",".dotx":"word",".epub":"word",".fodt":"word",".htm":"word",".html":"word",".mht":"word",".odt":"word",".ott":"word",".rtf":"word",".djvu":"word",".oxps":"word",".oform":"word",".fb2":"word",".xml":"word",".xps":"word",".csv":"excel",".xls":"excel",".xlsx":"excel",".fods":"excel",".ods":"excel",".ots":"excel",".xlsb":"excel",".xlsm":"excel",".xlt":"excel",".xltm":"excel",".xltx":"excel",".fodp":"ppt",".odp":"ppt",".otp":"ppt",".pot":"ppt",".potm":"ppt",".potx":"ppt",".pps":"ppt",".ppsm":"ppt",".ppsx":"ppt",".ppt":"ppt",".pptm":"ppt",".pptx":"ppt",".zip":"zip",".rar":"zip",".7z":"zip",".apz":"zip",".ar":"zip",".bz":"zip",".car":"zip",".dar":"zip",".cpgz":"zip",".f":"zip",".ha":"zip",".hbc":"zip",".hbc2":"zip",".hbe":"zip",".hpk":"zip",".hyp":"zip",".png":"image",".jpg":"image",".jpeg":"image",".bmp":"image",".gif":"image",".webp":"image",".psd":"image",".svg":"image",".tiff":"image",".avi":"video",".wmv":"video",".mpeg":"video",".mp4":"video",".mpm4v":"video",".mov":"video",".asf":"video",".flv":"video",".f4v":"video",".rmvb":"video",".rm":"video",".3gp":"video",".vob":"video",".txt":"txt",".pdf":"pdf"},zt=a=>{const o=a==null?void 0:a.toLocaleLowerCase(),r=o!=null&&o.startsWith(".")?o:`.${o}`;return r&&Ji[r]||"unknow"},Qi=a=>{let o="",r=["doc","docx"],t=["xls","xlsx"],e=["ppt","pptx"],i=["pdf"];return r.includes(a)&&(o="word"),t.includes(a)&&(o="cell"),e.includes(a)&&(o="slide"),i.includes(a)&&(o="text-pdf"),o};/*! Element Plus Icons Vue v2.3.1 */var en=p.defineComponent({name:"Close",__name:"close",setup(a){return(o,r)=>(p.openBlock(),p.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[p.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),tn=en;const He=(a,o)=>{const r=a.__vccOpts||a;for(const[t,e]of o)r[t]=e;return r},nn=a=>{const o=p.inject("loadUrl"),r=p.computed(()=>a.loadUrl||a.fileUrl||(o==null?void 0:o.value)),t=p.inject("uploadUrl"),e=p.computed(()=>a.action||a.uploadUrl||(t==null?void 0:t.value)),i=p.inject("token"),n=p.computed(()=>a.token||(i==null?void 0:i.value)),s=p.inject("onlyofficeConfig"),l=p.computed(()=>a.onlyofficeConfig||(s==null?void 0:s.value)),u=p.inject("userInfo"),c=p.computed(()=>a.userInfo||(u==null?void 0:u.value));return{cLoadUrl:r,cUploadUrl:e,cToken:n,cOnlyofficeConfig:l,cUserInfo:c}},rn={key:0,class:"ik-svg-icon ik-icon-span inline-block inline-flex justify-center box-content line-height-[0]"},sn={key:1,class:"h-[1em] w-[1em]","aria-hidden":"true"},on=["xlink:href"],an=["src"],ln={key:1,class:"h-[1em] w-[1em]","aria-hidden":"true"},un=["xlink:href"],cn=["src"],fn=p.defineComponent({name:"IkSvgIcon",__name:"index",props:{active:{type:Boolean,default:!1},bg:{type:Boolean,default:!1},color:{},colorLight:{},disabled:{type:Boolean,default:!1},error:{type:Boolean},flip:{},name:{},notip:{type:Boolean,default:!1},opacity:{default:.5},padding:{default:"6px"},primary:{type:Boolean},rotate:{},showBg:{type:Boolean,default:!1},size:{default:""},success:{type:Boolean},tableIconType:{},title:{},type:{},warning:{type:Boolean},width:{}},setup(a){const o=a,r=p.computed(()=>o),t=p.computed(()=>{const{name:i}=r.value;return/^http?:\/\//.test(i)?"img":/i-[^:]+:[^:]+/.test(i)?"unocss":i!=null&&i.startsWith("iksig")?"iksig":i!=null&&i.includes(":")?"iconify":i!=null&&i.startsWith("iksvg")?"svg":"i"}),e=p.computed(()=>{const i=[];if(r.value.flip)switch(r.value.flip){case"horizontal":i.push("rotateY(180deg)");break;case"vertical":i.push("rotateX(180deg)");break;case"both":i.push("rotateX(180deg)"),i.push("rotateY(180deg)");break}r.value.rotate&&i.push(`rotate(${r.value.rotate%360}deg)`);const n={pointerEvents:r.value.disabled?"none":"auto",...r.value.color&&{color:r.value.color},...r.value.size&&{fontSize:typeof r.value.size=="number"?`${r.value.size}px`:r.value.size},...i.length&&{transform:i.join(" ")},padding:r.value.showBg||r.value.bg?r.value.padding:0,...r.value.color&&t.value!=="iksig"?{"--ik-color-icon-dark":r.value.color,"--ik-color-icon-light":r.value.colorLight||st.ikColor.setOpacity(r.value.color,r.value.opacity)}:{}};return r.value.width&&(n.width=n.height=typeof r.value.width=="number"?`${r.value.width}px`:r.value.width),n});return(i,n)=>{const s=p.resolveComponent("el-tooltip"),l=p.resolveComponent("el-button");return r.value.tableIconType==="icon"||!r.value.tableIconType?(p.openBlock(),p.createElementBlock("span",rn,[r.value.notip||!r.value.title?(p.openBlock(),p.createElementBlock("i",{key:0,class:p.normalizeClass(["ik-svg-icon ik-icon relative h-[1em] w-[1em] inline-flex items-center justify-center fill-current leading-[1em] transition",{[i.name]:t.value==="unocss","show-bg":r.value.showBg||r.value.bg,default:r.value.size==="default",small:r.value.size==="small",big:r.value.size==="big",warning:r.value.warning||r.value.type==="warning",primary:r.value.primary||r.value.type==="primary",success:i.success||r.value.type==="success",error:r.value.error||r.value.type==="error",active:r.value.active,disabled:r.value.disabled}]),style:p.normalizeStyle(e.value)},[p.createCommentVNode(` <Icon v-if="outputType === 'iconify'" :icon="name" /> `),t.value==="iksig"?(p.openBlock(),p.createElementBlock("i",{key:0,class:p.normalizeClass(`iksig ${r.value.name}`),style:p.normalizeStyle(e.value)},null,6)):t.value==="svg"?(p.openBlock(),p.createElementBlock("svg",sn,[p.createElementVNode("use",{"xlink:href":`#${r.value.name}`},null,8,on)])):t.value==="img"?(p.openBlock(),p.createElementBlock("img",{key:2,src:r.value.name,class:"h-[1em] w-[1em]"},null,8,an)):(p.openBlock(),p.createElementBlock("i",{key:3,class:p.normalizeClass(r.value.name),style:p.normalizeStyle(e.value)},null,6))],6)):(p.openBlock(),p.createBlock(s,{key:1,content:r.value.title,placement:"top"},{default:p.withCtx(()=>[p.createElementVNode("i",{class:p.normalizeClass(["ik-svg-icon ik-icon relative h-[1em] w-[1em] inline-flex items-center justify-center fill-current leading-[1em] transition",{[i.name]:t.value==="unocss","show-bg":r.value.showBg||r.value.bg,default:r.value.size==="default",small:r.value.size==="small",big:r.value.size==="big",warning:r.value.warning||r.value.type==="warning",primary:i.primary||r.value.type==="primary",success:i.success||r.value.type==="success",error:r.value.error||r.value.type==="error",active:r.value.active}]),style:p.normalizeStyle(e.value)},[t.value==="iksig"?(p.openBlock(),p.createElementBlock("i",{key:0,class:p.normalizeClass(`iksig ${r.value.name}`),style:p.normalizeStyle(e.value)},null,6)):t.value==="svg"?(p.openBlock(),p.createElementBlock("svg",ln,[p.createElementVNode("use",{"xlink:href":`#${r.value.name}`},null,8,un)])):t.value==="img"?(p.openBlock(),p.createElementBlock("img",{key:2,src:r.value.name,class:"h-[1em] w-[1em]"},null,8,cn)):(p.openBlock(),p.createElementBlock("i",{key:3,class:p.normalizeClass(r.value.name),style:p.normalizeStyle(e.value)},null,6))],6)]),_:1},8,["content"]))])):(p.openBlock(),p.createBlock(l,{key:1,type:["warning","error"].includes(r.value.type)?"danger":""},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(r.value.title),1)]),_:1},8,["type"]))}}}),zs="",jt=Re(He(fn,[["__scopeId","data-v-52806adf"]])),hn=p.defineComponent({__name:"CloseIcon",props:{showBg:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1}},setup(a){return(o,r)=>(p.openBlock(),p.createElementBlock("div",{class:p.normalizeClass({"exit-main-page-maximize":a.showBg&&a.fullscreen})},[p.createVNode(p.unref(jt),{name:"iksvg_guanbidanchuang",title:"关闭",size:20,error:""})],2))}}),Ws="",dn=He(hn,[["__scopeId","data-v-da39e979"]]),gn={class:"base-header"},pn=p.defineComponent({__name:"IkBaseDialog",props:p.mergeModels({title:{default:""},cancelText:{default:"取消"},confirmText:{default:"确认"},noHeader:{type:Boolean},noFooter:{type:Boolean},showCloseBg:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1}},{modelValue:{type:Boolean,default:!1,noHeader:!1,noFooter:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const o=a,r=p.useModel(a,"modelValue"),t=p.ref(o.fullscreen),e=()=>{t.value=!t.value},i=p.defineComponent({setup(){return()=>p.h(dn,{showBg:o.showCloseBg,fullscreen:o.fullscreen})}});return(n,s)=>{const l=p.resolveComponent("el-dialog");return p.openBlock(),p.createBlock(l,p.mergeProps({modelValue:r.value,"onUpdate:modelValue":s[0]||(s[0]=u=>r.value=u)},n.$attrs,{"close-icon":p.unref(i),class:`ik-base-dialog ${n.noHeader?"no-header":""} ${n.noFooter?"no-footer":""}`,fullscreen:t.value,"modal-class":"baseDialog"}),p.createSlots({icon:p.withCtx(()=>[p.renderSlot(n.$slots,"title",{},()=>[p.createTextVNode(p.toDisplayString(n.title),1)])]),header:p.withCtx(()=>[p.createElementVNode("div",gn,[p.renderSlot(n.$slots,"header",{},()=>[p.createTextVNode(p.toDisplayString(n.title),1)])]),n.$attrs.showClose?(p.openBlock(),p.createBlock(p.unref(jt),{key:0,onClick:e,name:t.value?"iksvg_tuichuquanping":"iksvg_quanping-daohang",class:"absolute! top-[18px] right-[50px] icon-dialog-full",title:t.value?"退出全屏":"全屏"},null,8,["name","title"])):p.createCommentVNode("v-if",!0)]),default:p.withCtx(()=>[p.renderSlot(n.$slots,"default")]),_:2},[n.$slots.footer?{name:"footer",fn:p.withCtx(()=>[p.renderSlot(n.$slots,"footer")]),key:"0"}:void 0]),1040,["modelValue","close-icon","class","fullscreen"])}}}),Gs="",vn=Re(pn);var mn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function at(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}function yn(a,o,r,t){function e(i){return i instanceof r?i:new r(function(n){n(i)})}return new(r||(r=Promise))(function(i,n){function s(c){try{u(t.next(c))}catch(h){n(h)}}function l(c){try{u(t.throw(c))}catch(h){n(h)}}function u(c){c.done?i(c.value):e(c.value).then(s,l)}u((t=t.apply(a,o||[])).next())})}function _n(a,o){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,e,i,n;return n={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(n[Symbol.iterator]=function(){return this}),n;function s(u){return function(c){return l([u,c])}}function l(u){if(t)throw new TypeError("Generator is already executing.");for(;n&&(n=0,u[0]&&(r=0)),r;)try{if(t=1,e&&(i=u[0]&2?e.return:u[0]?e.throw||((i=e.return)&&i.call(e),0):e.next)&&!(i=i.call(e,u[1])).done)return i;switch(e=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,e=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){r.label=u[1];break}if(u[0]===6&&r.label<i[1]){r.label=i[1],i=u;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(u);break}i[2]&&r.ops.pop(),r.trys.pop();continue}u=o.call(a,r)}catch(c){u=[6,c],e=0}finally{t=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}typeof SuppressedError=="function"&&SuppressedError;var Cn=function(a,o){return yn(void 0,void 0,void 0,function(){return _n(this,function(r){return[2,new Promise(function(t,e){try{if(window.DocsAPI)return t(null);var i=document.getElementById(o);if(i)var n=setInterval(function(){var l=i.getAttribute("loading");if(!l){if(clearInterval(n),window.DocsAPI)return t(null);var u=Wt(o,a,t,e);i.remove(),document.body.appendChild(u)}},500);else{var s=Wt(o,a,t,e);document.body.appendChild(s)}}catch(l){console.error(l)}})]})})},Wt=function(a,o,r,t){var e=document.createElement("script");return e.id=a,e.type="text/javascript",e.src=o,e.async=!0,e.onload=function(){e.removeAttribute("loading"),r(null)},e.onerror=function(i){e.removeAttribute("loading"),t(i)},e.setAttribute("loading",""),e},lt=p.defineComponent({name:"DocumentEditor",props:{id:{type:String,required:!0},documentServerUrl:{type:String,required:!0},config:{type:Object,required:!0},document_fileType:String,document_title:String,documentType:String,editorConfig_lang:String,height:String,type:String,width:String,onLoadComponentError:Function,events_onAppReady:Function,events_onDocumentStateChange:Function,events_onMetaChange:Function,events_onDocumentReady:Function,events_onInfo:Function,events_onWarning:Function,events_onError:Function,events_onRequestSharingSettings:Function,events_onRequestRename:Function,events_onMakeActionLink:Function,events_onRequestInsertImage:Function,events_onRequestSaveAs:Function,events_onRequestMailMergeRecipients:Function,events_onRequestCompareFile:Function,events_onRequestEditRights:Function,events_onRequestHistory:Function,events_onRequestHistoryClose:Function,events_onRequestHistoryData:Function,events_onRequestRestore:Function,events_onRequestSelectSpreadsheet:Function,events_onRequestSelectDocument:Function},mounted:function(){var a=this,o=this.documentServerUrl;o.endsWith("/")||(o+="/");var r="".concat(o,"web-apps/apps/api/documents/api.js");Cn(r,"onlyoffice-api-script").then(function(){return a.onLoad()}).catch(function(){a.onError(-2)})},unmounted:function(){var a,o=this.id||"";!((a=window==null?void 0:window.DocEditor)===null||a===void 0)&&a.instances[o]&&(window.DocEditor.instances[o].destroyEditor(),window.DocEditor.instances[o]=void 0)},watch:{config:{handler:function(a,o){this.onChangeProps()},deep:!0},document_fileType:function(a,o){this.onChangeProps()},document_title:function(a,o){this.onChangeProps()},documentType:function(a,o){this.onChangeProps()},editorConfig_lang:function(a,o){this.onChangeProps()},height:function(a,o){this.onChangeProps()},type:function(a,o){this.onChangeProps()},width:function(a,o){this.onChangeProps()}},methods:{onLoad:function(){var a,o;try{var r=this.id||"";if(window.DocsAPI||this.onError(-3),!((a=window==null?void 0:window.DocEditor)===null||a===void 0)&&a.instances[r]){console.log("Skip loading. Instance already exists",r);return}!((o=window==null?void 0:window.DocEditor)===null||o===void 0)&&o.instances||(window.DocEditor={instances:{}});var t=Object.assign({document:{fileType:this.document_fileType,title:this.document_title},documentType:this.documentType,editorConfig:{lang:this.editorConfig_lang},events:{onAppReady:this.onAppReady,onDocumentStateChange:this.events_onDocumentStateChange,onMetaChange:this.events_onMetaChange,onDocumentReady:this.events_onDocumentReady,onInfo:this.events_onInfo,onWarning:this.events_onWarning,onError:this.events_onError,onRequestSharingSettings:this.events_onRequestSharingSettings,onRequestRename:this.events_onRequestRename,onMakeActionLink:this.events_onMakeActionLink,onRequestInsertImage:this.events_onRequestInsertImage,onRequestSaveAs:this.events_onRequestSaveAs,onRequestMailMergeRecipients:this.events_onRequestMailMergeRecipients,onRequestCompareFile:this.events_onRequestCompareFile,onRequestEditRights:this.events_onRequestEditRights,onRequestHistory:this.events_onRequestHistory,onRequestHistoryClose:this.events_onRequestHistoryClose,onRequestHistoryData:this.events_onRequestHistoryData,onRequestRestore:this.events_onRequestRestore,onRequestSelectSpreadsheet:this.events_onRequestSelectSpreadsheet,onRequestSelectDocument:this.events_onRequestSelectDocument},height:this.height,type:this.type,width:this.width},this.config||{}),e=window.DocsAPI.DocEditor(r,t);window.DocEditor.instances[r]=e}catch(i){console.error(i),this.onError(-1)}},onError:function(a){var o;switch(a){case-2:o="Error load DocsAPI from "+this.documentServerUrl;break;case-3:o="DocsAPI is not defined";break;default:o="Unknown error loading component",a=-1}typeof this.onLoadComponentError>"u"?console.error(o):this.onLoadComponentError(a,o)},onAppReady:function(){var a=this.id||"";this.events_onAppReady(window.DocEditor.instances[a])},onChangeProps:function(){var a,o=this.id||"";!((a=window==null?void 0:window.DocEditor)===null||a===void 0)&&a.instances[o]&&(window.DocEditor.instances[o].destroyEditor(),window.DocEditor.instances[o]=void 0,console.log("Important props have been changed. Load new Editor."),this.onLoad())}}});const kn=["id"];function bn(a,o,r,t,e,i){return p.openBlock(),p.createElementBlock("div",{id:a.id},null,8,kn)}lt.render=bn,lt.__file="src/components/DocumentEditor.vue";const Tn=p.defineComponent({__name:"IkOnlyOffice",props:{documentServerUrl:{type:String,default:""},configOptions:{type:Object,default:()=>{}},officeHeight:{type:String,default:"100%"}},setup(a){const o=a,r=p.ref({width:"100%",height:"100%",...o.configOptions||{},...o.configOptions}),t=()=>{console.info("文档加载完成",o.configOptions)};return(e,i)=>(p.openBlock(),p.createElementBlock("div",{style:p.normalizeStyle({height:o.officeHeight})},[p.createVNode(p.unref(lt),{id:`${new Date().getTime()}`,ref:"editorRef","document-server-url":a.documentServerUrl,config:r.value,events_onDocumentReady:t},null,8,["id","document-server-url","config"])],4))}}),Ks="",wn=Re(He(Tn,[["__scopeId","data-v-98d51ef9"]]));function Gt(a,o){var r=Object.keys(a);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(a);o&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable})),r.push.apply(r,t)}return r}function V(a){for(var o=1;o<arguments.length;o++){var r=arguments[o]!=null?arguments[o]:{};o%2?Gt(Object(r),!0).forEach(function(t){_(a,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(r)):Gt(Object(r)).forEach(function(t){Object.defineProperty(a,t,Object.getOwnPropertyDescriptor(r,t))})}return a}function W(a){"@babel/helpers - typeof";return W=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},W(a)}function E(a,o){if(!(a instanceof o))throw new TypeError("Cannot call a class as a function")}function Kt(a,o){for(var r=0;r<o.length;r++){var t=o[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(a,Yt(t.key),t)}}function S(a,o,r){return o&&Kt(a.prototype,o),r&&Kt(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a}function _(a,o,r){return o=Yt(o),o in a?Object.defineProperty(a,o,{value:r,enumerable:!0,configurable:!0,writable:!0}):a[o]=r,a}function x(a,o){if(typeof o!="function"&&o!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(o&&o.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),o&&ut(a,o)}function I(a){return I=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},I(a)}function ut(a,o){return ut=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ut(a,o)}function En(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function m(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function ct(a,o){if(o&&(typeof o=="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return m(a)}function P(a){var o=En();return function(){var t=I(a),e;if(o){var i=I(this).constructor;e=Reflect.construct(t,arguments,i)}else e=t.apply(this,arguments);return ct(this,e)}}function Sn(a,o){for(;!Object.prototype.hasOwnProperty.call(a,o)&&(a=I(a),a!==null););return a}function A(){return typeof Reflect<"u"&&Reflect.get?A=Reflect.get.bind():A=function(o,r,t){var e=Sn(o,r);if(e){var i=Object.getOwnPropertyDescriptor(e,r);return i.get?i.get.call(arguments.length<3?o:t):i.value}},A.apply(this,arguments)}function J(a){return xn(a)||Pn(a)||In(a)||An()}function xn(a){if(Array.isArray(a))return ft(a)}function Pn(a){if(typeof Symbol<"u"&&a[Symbol.iterator]!=null||a["@@iterator"]!=null)return Array.from(a)}function In(a,o){if(a){if(typeof a=="string")return ft(a,o);var r=Object.prototype.toString.call(a).slice(8,-1);if(r==="Object"&&a.constructor&&(r=a.constructor.name),r==="Map"||r==="Set")return Array.from(a);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ft(a,o)}}function ft(a,o){(o==null||o>a.length)&&(o=a.length);for(var r=0,t=new Array(o);r<o;r++)t[r]=a[r];return t}function An(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1
+ (function(ie,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("vue"),require("iking-utils-pro"),require("element-plus")):typeof define=="function"&&define.amd?define(["exports","vue","iking-utils-pro","element-plus"],p):(ie=typeof globalThis<"u"?globalThis:ie||self,p(ie.index={},ie.vue,ie["iking-utils-pro"],ie["element-plus"]))})(this,function(ie,p,st,Zi){"use strict";const Re=(a,o)=>{if(a.install=r=>{for(const t of[a,...Object.values(o??{})])r.component(t.name,t)},o)for(const[r,t]of Object.entries(o))a[r]=t;return a},ot=(a,o)=>o?o.startsWith("http")?o:`${a||location.origin}${o}`:"",Vt=(a,o)=>{var i,n,s,l;const r=(i=a==null?void 0:a.response)!=null&&i.data?zt((s=(n=a==null?void 0:a.response)==null?void 0:n.data)==null?void 0:s.suffix):((l=a.raw)==null?void 0:l.type)||zt(a[o.suffix]),t=r==null?void 0:r.toLowerCase(),e={sheet:"excel",excel:"excel",zip:"zip","application/x-compressed":"zip",image:"image",video:"video",audio:"audio",pdf:"pdf",text:"txt",txt:"txt",word:"word",ppt:"ppt",exe:"exe",json:"json"};for(let u in e)if(typeof t=="string"&&(t.includes(u)||t===u))return e[u];return"unknown"},Ji={".doc":"word",".docx":"word",".docxf":"word",".docm":"word",".dot":"word",".dotm":"word",".dotx":"word",".epub":"word",".fodt":"word",".htm":"word",".html":"word",".mht":"word",".odt":"word",".ott":"word",".rtf":"word",".djvu":"word",".oxps":"word",".oform":"word",".fb2":"word",".xml":"word",".xps":"word",".csv":"excel",".xls":"excel",".xlsx":"excel",".fods":"excel",".ods":"excel",".ots":"excel",".xlsb":"excel",".xlsm":"excel",".xlt":"excel",".xltm":"excel",".xltx":"excel",".fodp":"ppt",".odp":"ppt",".otp":"ppt",".pot":"ppt",".potm":"ppt",".potx":"ppt",".pps":"ppt",".ppsm":"ppt",".ppsx":"ppt",".ppt":"ppt",".pptm":"ppt",".pptx":"ppt",".zip":"zip",".rar":"zip",".7z":"zip",".apz":"zip",".ar":"zip",".bz":"zip",".car":"zip",".dar":"zip",".cpgz":"zip",".f":"zip",".ha":"zip",".hbc":"zip",".hbc2":"zip",".hbe":"zip",".hpk":"zip",".hyp":"zip",".png":"image",".jpg":"image",".jpeg":"image",".bmp":"image",".gif":"image",".webp":"image",".psd":"image",".svg":"image",".tiff":"image",".avi":"video",".wmv":"video",".mpeg":"video",".mp4":"video",".mpm4v":"video",".mov":"video",".asf":"video",".flv":"video",".f4v":"video",".rmvb":"video",".rm":"video",".3gp":"video",".vob":"video",".txt":"txt",".pdf":"pdf"},zt=a=>{const o=a==null?void 0:a.toLocaleLowerCase(),r=o!=null&&o.startsWith(".")?o:`.${o}`;return r&&Ji[r]||"unknow"},Qi=a=>{let o="",r=["doc","docx"],t=["xls","xlsx"],e=["ppt","pptx"],i=["pdf"];return r.includes(a)&&(o="word"),t.includes(a)&&(o="cell"),e.includes(a)&&(o="slide"),i.includes(a)&&(o="text-pdf"),o};/*! Element Plus Icons Vue v2.3.1 */var en=p.defineComponent({name:"Close",__name:"close",setup(a){return(o,r)=>(p.openBlock(),p.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[p.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),tn=en;const He=(a,o)=>{const r=a.__vccOpts||a;for(const[t,e]of o)r[t]=e;return r},nn=a=>{const o=p.inject("loadUrl"),r=p.computed(()=>a.loadUrl||a.fileUrl||(o==null?void 0:o.value)),t=p.inject("uploadUrl"),e=p.computed(()=>a.action||a.uploadUrl||(t==null?void 0:t.value)),i=p.inject("token"),n=p.computed(()=>a.token||(i==null?void 0:i.value)),s=p.inject("onlyofficeConfig"),l=p.computed(()=>a.onlyofficeConfig||(s==null?void 0:s.value)),u=p.inject("userInfo"),c=p.computed(()=>a.userInfo||(u==null?void 0:u.value));return{cLoadUrl:r,cUploadUrl:e,cToken:n,cOnlyofficeConfig:l,cUserInfo:c,cOnlyofficePreviewType:["csv","djvu","doc","docm","docx","docxf","dot","dotm","dotx","epub","fb2","fodp","fods","fodt","htm","html","mht","odp","ods","odt","oform","otp","ots","ott","oxps","pdf","pot","potm","potx","pps","ppsm","ppsx","ppt","pptm","pptx","rtf","txt","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xml","xps","png","jpeg","jpg","video","mp4"]}},rn={key:0,class:"ik-svg-icon ik-icon-span inline-block inline-flex justify-center box-content line-height-[0]"},sn={key:1,class:"h-[1em] w-[1em]","aria-hidden":"true"},on=["xlink:href"],an=["src"],ln={key:1,class:"h-[1em] w-[1em]","aria-hidden":"true"},un=["xlink:href"],cn=["src"],fn=p.defineComponent({name:"IkSvgIcon",__name:"index",props:{active:{type:Boolean,default:!1},bg:{type:Boolean,default:!1},color:{},colorLight:{},disabled:{type:Boolean,default:!1},error:{type:Boolean},flip:{},name:{},notip:{type:Boolean,default:!1},opacity:{default:.5},padding:{default:"6px"},primary:{type:Boolean},rotate:{},showBg:{type:Boolean,default:!1},size:{default:""},success:{type:Boolean},tableIconType:{},title:{},type:{},warning:{type:Boolean},width:{}},setup(a){const o=a,r=p.computed(()=>o),t=p.computed(()=>{const{name:i}=r.value;return/^http?:\/\//.test(i)?"img":/i-[^:]+:[^:]+/.test(i)?"unocss":i!=null&&i.startsWith("iksig")?"iksig":i!=null&&i.includes(":")?"iconify":i!=null&&i.startsWith("iksvg")?"svg":"i"}),e=p.computed(()=>{const i=[];if(r.value.flip)switch(r.value.flip){case"horizontal":i.push("rotateY(180deg)");break;case"vertical":i.push("rotateX(180deg)");break;case"both":i.push("rotateX(180deg)"),i.push("rotateY(180deg)");break}r.value.rotate&&i.push(`rotate(${r.value.rotate%360}deg)`);const n={pointerEvents:r.value.disabled?"none":"auto",...r.value.color&&{color:r.value.color},...r.value.size&&{fontSize:typeof r.value.size=="number"?`${r.value.size}px`:r.value.size},...i.length&&{transform:i.join(" ")},padding:r.value.showBg||r.value.bg?r.value.padding:0,...r.value.color&&t.value!=="iksig"?{"--ik-color-icon-dark":r.value.color,"--ik-color-icon-light":r.value.colorLight||st.ikColor.setOpacity(r.value.color,r.value.opacity)}:{}};return r.value.width&&(n.width=n.height=typeof r.value.width=="number"?`${r.value.width}px`:r.value.width),n});return(i,n)=>{const s=p.resolveComponent("el-tooltip"),l=p.resolveComponent("el-button");return r.value.tableIconType==="icon"||!r.value.tableIconType?(p.openBlock(),p.createElementBlock("span",rn,[r.value.notip||!r.value.title?(p.openBlock(),p.createElementBlock("i",{key:0,class:p.normalizeClass(["ik-svg-icon ik-icon relative h-[1em] w-[1em] inline-flex items-center justify-center fill-current leading-[1em] transition",{[i.name]:t.value==="unocss","show-bg":r.value.showBg||r.value.bg,default:r.value.size==="default",small:r.value.size==="small",big:r.value.size==="big",warning:r.value.warning||r.value.type==="warning",primary:r.value.primary||r.value.type==="primary",success:i.success||r.value.type==="success",error:r.value.error||r.value.type==="error",active:r.value.active,disabled:r.value.disabled}]),style:p.normalizeStyle(e.value)},[p.createCommentVNode(` <Icon v-if="outputType === 'iconify'" :icon="name" /> `),t.value==="iksig"?(p.openBlock(),p.createElementBlock("i",{key:0,class:p.normalizeClass(`iksig ${r.value.name}`),style:p.normalizeStyle(e.value)},null,6)):t.value==="svg"?(p.openBlock(),p.createElementBlock("svg",sn,[p.createElementVNode("use",{"xlink:href":`#${r.value.name}`},null,8,on)])):t.value==="img"?(p.openBlock(),p.createElementBlock("img",{key:2,src:r.value.name,class:"h-[1em] w-[1em]"},null,8,an)):(p.openBlock(),p.createElementBlock("i",{key:3,class:p.normalizeClass(r.value.name),style:p.normalizeStyle(e.value)},null,6))],6)):(p.openBlock(),p.createBlock(s,{key:1,content:r.value.title,placement:"top"},{default:p.withCtx(()=>[p.createElementVNode("i",{class:p.normalizeClass(["ik-svg-icon ik-icon relative h-[1em] w-[1em] inline-flex items-center justify-center fill-current leading-[1em] transition",{[i.name]:t.value==="unocss","show-bg":r.value.showBg||r.value.bg,default:r.value.size==="default",small:r.value.size==="small",big:r.value.size==="big",warning:r.value.warning||r.value.type==="warning",primary:i.primary||r.value.type==="primary",success:i.success||r.value.type==="success",error:r.value.error||r.value.type==="error",active:r.value.active}]),style:p.normalizeStyle(e.value)},[t.value==="iksig"?(p.openBlock(),p.createElementBlock("i",{key:0,class:p.normalizeClass(`iksig ${r.value.name}`),style:p.normalizeStyle(e.value)},null,6)):t.value==="svg"?(p.openBlock(),p.createElementBlock("svg",ln,[p.createElementVNode("use",{"xlink:href":`#${r.value.name}`},null,8,un)])):t.value==="img"?(p.openBlock(),p.createElementBlock("img",{key:2,src:r.value.name,class:"h-[1em] w-[1em]"},null,8,cn)):(p.openBlock(),p.createElementBlock("i",{key:3,class:p.normalizeClass(r.value.name),style:p.normalizeStyle(e.value)},null,6))],6)]),_:1},8,["content"]))])):(p.openBlock(),p.createBlock(l,{key:1,type:["warning","error"].includes(r.value.type)?"danger":""},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(r.value.title),1)]),_:1},8,["type"]))}}}),zs="",jt=Re(He(fn,[["__scopeId","data-v-52806adf"]])),hn=p.defineComponent({__name:"CloseIcon",props:{showBg:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1}},setup(a){return(o,r)=>(p.openBlock(),p.createElementBlock("div",{class:p.normalizeClass({"exit-main-page-maximize":a.showBg&&a.fullscreen})},[p.createVNode(p.unref(jt),{name:"iksvg_guanbidanchuang",title:"关闭",size:20,error:""})],2))}}),Ws="",dn=He(hn,[["__scopeId","data-v-da39e979"]]),gn={class:"base-header"},pn=p.defineComponent({__name:"IkBaseDialog",props:p.mergeModels({title:{default:""},cancelText:{default:"取消"},confirmText:{default:"确认"},noHeader:{type:Boolean},noFooter:{type:Boolean},showCloseBg:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1}},{modelValue:{type:Boolean,default:!1,noHeader:!1,noFooter:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const o=a,r=p.useModel(a,"modelValue"),t=p.ref(o.fullscreen),e=()=>{t.value=!t.value},i=p.defineComponent({setup(){return()=>p.h(dn,{showBg:o.showCloseBg,fullscreen:o.fullscreen})}});return(n,s)=>{const l=p.resolveComponent("el-dialog");return p.openBlock(),p.createBlock(l,p.mergeProps({modelValue:r.value,"onUpdate:modelValue":s[0]||(s[0]=u=>r.value=u)},n.$attrs,{"close-icon":p.unref(i),class:`ik-base-dialog ${n.noHeader?"no-header":""} ${n.noFooter?"no-footer":""}`,fullscreen:t.value,"modal-class":"baseDialog"}),p.createSlots({icon:p.withCtx(()=>[p.renderSlot(n.$slots,"title",{},()=>[p.createTextVNode(p.toDisplayString(n.title),1)])]),header:p.withCtx(()=>[p.createElementVNode("div",gn,[p.renderSlot(n.$slots,"header",{},()=>[p.createTextVNode(p.toDisplayString(n.title),1)])]),n.$attrs.showClose?(p.openBlock(),p.createBlock(p.unref(jt),{key:0,onClick:e,name:t.value?"iksvg_tuichuquanping":"iksvg_quanping-daohang",class:"absolute! top-[18px] right-[50px] icon-dialog-full",title:t.value?"退出全屏":"全屏"},null,8,["name","title"])):p.createCommentVNode("v-if",!0)]),default:p.withCtx(()=>[p.renderSlot(n.$slots,"default")]),_:2},[n.$slots.footer?{name:"footer",fn:p.withCtx(()=>[p.renderSlot(n.$slots,"footer")]),key:"0"}:void 0]),1040,["modelValue","close-icon","class","fullscreen"])}}}),Gs="",vn=Re(pn);var mn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function at(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}function yn(a,o,r,t){function e(i){return i instanceof r?i:new r(function(n){n(i)})}return new(r||(r=Promise))(function(i,n){function s(c){try{u(t.next(c))}catch(h){n(h)}}function l(c){try{u(t.throw(c))}catch(h){n(h)}}function u(c){c.done?i(c.value):e(c.value).then(s,l)}u((t=t.apply(a,o||[])).next())})}function _n(a,o){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,e,i,n;return n={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(n[Symbol.iterator]=function(){return this}),n;function s(u){return function(c){return l([u,c])}}function l(u){if(t)throw new TypeError("Generator is already executing.");for(;n&&(n=0,u[0]&&(r=0)),r;)try{if(t=1,e&&(i=u[0]&2?e.return:u[0]?e.throw||((i=e.return)&&i.call(e),0):e.next)&&!(i=i.call(e,u[1])).done)return i;switch(e=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,e=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){r.label=u[1];break}if(u[0]===6&&r.label<i[1]){r.label=i[1],i=u;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(u);break}i[2]&&r.ops.pop(),r.trys.pop();continue}u=o.call(a,r)}catch(c){u=[6,c],e=0}finally{t=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}typeof SuppressedError=="function"&&SuppressedError;var Cn=function(a,o){return yn(void 0,void 0,void 0,function(){return _n(this,function(r){return[2,new Promise(function(t,e){try{if(window.DocsAPI)return t(null);var i=document.getElementById(o);if(i)var n=setInterval(function(){var l=i.getAttribute("loading");if(!l){if(clearInterval(n),window.DocsAPI)return t(null);var u=Wt(o,a,t,e);i.remove(),document.body.appendChild(u)}},500);else{var s=Wt(o,a,t,e);document.body.appendChild(s)}}catch(l){console.error(l)}})]})})},Wt=function(a,o,r,t){var e=document.createElement("script");return e.id=a,e.type="text/javascript",e.src=o,e.async=!0,e.onload=function(){e.removeAttribute("loading"),r(null)},e.onerror=function(i){e.removeAttribute("loading"),t(i)},e.setAttribute("loading",""),e},lt=p.defineComponent({name:"DocumentEditor",props:{id:{type:String,required:!0},documentServerUrl:{type:String,required:!0},config:{type:Object,required:!0},document_fileType:String,document_title:String,documentType:String,editorConfig_lang:String,height:String,type:String,width:String,onLoadComponentError:Function,events_onAppReady:Function,events_onDocumentStateChange:Function,events_onMetaChange:Function,events_onDocumentReady:Function,events_onInfo:Function,events_onWarning:Function,events_onError:Function,events_onRequestSharingSettings:Function,events_onRequestRename:Function,events_onMakeActionLink:Function,events_onRequestInsertImage:Function,events_onRequestSaveAs:Function,events_onRequestMailMergeRecipients:Function,events_onRequestCompareFile:Function,events_onRequestEditRights:Function,events_onRequestHistory:Function,events_onRequestHistoryClose:Function,events_onRequestHistoryData:Function,events_onRequestRestore:Function,events_onRequestSelectSpreadsheet:Function,events_onRequestSelectDocument:Function},mounted:function(){var a=this,o=this.documentServerUrl;o.endsWith("/")||(o+="/");var r="".concat(o,"web-apps/apps/api/documents/api.js");Cn(r,"onlyoffice-api-script").then(function(){return a.onLoad()}).catch(function(){a.onError(-2)})},unmounted:function(){var a,o=this.id||"";!((a=window==null?void 0:window.DocEditor)===null||a===void 0)&&a.instances[o]&&(window.DocEditor.instances[o].destroyEditor(),window.DocEditor.instances[o]=void 0)},watch:{config:{handler:function(a,o){this.onChangeProps()},deep:!0},document_fileType:function(a,o){this.onChangeProps()},document_title:function(a,o){this.onChangeProps()},documentType:function(a,o){this.onChangeProps()},editorConfig_lang:function(a,o){this.onChangeProps()},height:function(a,o){this.onChangeProps()},type:function(a,o){this.onChangeProps()},width:function(a,o){this.onChangeProps()}},methods:{onLoad:function(){var a,o;try{var r=this.id||"";if(window.DocsAPI||this.onError(-3),!((a=window==null?void 0:window.DocEditor)===null||a===void 0)&&a.instances[r]){console.log("Skip loading. Instance already exists",r);return}!((o=window==null?void 0:window.DocEditor)===null||o===void 0)&&o.instances||(window.DocEditor={instances:{}});var t=Object.assign({document:{fileType:this.document_fileType,title:this.document_title},documentType:this.documentType,editorConfig:{lang:this.editorConfig_lang},events:{onAppReady:this.onAppReady,onDocumentStateChange:this.events_onDocumentStateChange,onMetaChange:this.events_onMetaChange,onDocumentReady:this.events_onDocumentReady,onInfo:this.events_onInfo,onWarning:this.events_onWarning,onError:this.events_onError,onRequestSharingSettings:this.events_onRequestSharingSettings,onRequestRename:this.events_onRequestRename,onMakeActionLink:this.events_onMakeActionLink,onRequestInsertImage:this.events_onRequestInsertImage,onRequestSaveAs:this.events_onRequestSaveAs,onRequestMailMergeRecipients:this.events_onRequestMailMergeRecipients,onRequestCompareFile:this.events_onRequestCompareFile,onRequestEditRights:this.events_onRequestEditRights,onRequestHistory:this.events_onRequestHistory,onRequestHistoryClose:this.events_onRequestHistoryClose,onRequestHistoryData:this.events_onRequestHistoryData,onRequestRestore:this.events_onRequestRestore,onRequestSelectSpreadsheet:this.events_onRequestSelectSpreadsheet,onRequestSelectDocument:this.events_onRequestSelectDocument},height:this.height,type:this.type,width:this.width},this.config||{}),e=window.DocsAPI.DocEditor(r,t);window.DocEditor.instances[r]=e}catch(i){console.error(i),this.onError(-1)}},onError:function(a){var o;switch(a){case-2:o="Error load DocsAPI from "+this.documentServerUrl;break;case-3:o="DocsAPI is not defined";break;default:o="Unknown error loading component",a=-1}typeof this.onLoadComponentError>"u"?console.error(o):this.onLoadComponentError(a,o)},onAppReady:function(){var a=this.id||"";this.events_onAppReady(window.DocEditor.instances[a])},onChangeProps:function(){var a,o=this.id||"";!((a=window==null?void 0:window.DocEditor)===null||a===void 0)&&a.instances[o]&&(window.DocEditor.instances[o].destroyEditor(),window.DocEditor.instances[o]=void 0,console.log("Important props have been changed. Load new Editor."),this.onLoad())}}});const kn=["id"];function bn(a,o,r,t,e,i){return p.openBlock(),p.createElementBlock("div",{id:a.id},null,8,kn)}lt.render=bn,lt.__file="src/components/DocumentEditor.vue";const Tn=p.defineComponent({__name:"IkOnlyOffice",props:{documentServerUrl:{type:String,default:""},configOptions:{type:Object,default:()=>{}},officeHeight:{type:String,default:"100%"}},setup(a){const o=a,r=p.ref({width:"100%",height:"100%",...o.configOptions||{},...o.configOptions}),t=()=>{console.info("文档加载完成",o.configOptions)};return(e,i)=>(p.openBlock(),p.createElementBlock("div",{style:p.normalizeStyle({height:o.officeHeight})},[p.createVNode(p.unref(lt),{id:`${new Date().getTime()}`,ref:"editorRef","document-server-url":a.documentServerUrl,config:r.value,events_onDocumentReady:t},null,8,["id","document-server-url","config"])],4))}}),Ks="",wn=Re(He(Tn,[["__scopeId","data-v-98d51ef9"]]));function Gt(a,o){var r=Object.keys(a);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(a);o&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable})),r.push.apply(r,t)}return r}function V(a){for(var o=1;o<arguments.length;o++){var r=arguments[o]!=null?arguments[o]:{};o%2?Gt(Object(r),!0).forEach(function(t){_(a,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(r)):Gt(Object(r)).forEach(function(t){Object.defineProperty(a,t,Object.getOwnPropertyDescriptor(r,t))})}return a}function W(a){"@babel/helpers - typeof";return W=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},W(a)}function E(a,o){if(!(a instanceof o))throw new TypeError("Cannot call a class as a function")}function Kt(a,o){for(var r=0;r<o.length;r++){var t=o[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(a,Yt(t.key),t)}}function S(a,o,r){return o&&Kt(a.prototype,o),r&&Kt(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a}function _(a,o,r){return o=Yt(o),o in a?Object.defineProperty(a,o,{value:r,enumerable:!0,configurable:!0,writable:!0}):a[o]=r,a}function x(a,o){if(typeof o!="function"&&o!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(o&&o.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),o&&ut(a,o)}function I(a){return I=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},I(a)}function ut(a,o){return ut=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ut(a,o)}function En(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function m(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function ct(a,o){if(o&&(typeof o=="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return m(a)}function P(a){var o=En();return function(){var t=I(a),e;if(o){var i=I(this).constructor;e=Reflect.construct(t,arguments,i)}else e=t.apply(this,arguments);return ct(this,e)}}function Sn(a,o){for(;!Object.prototype.hasOwnProperty.call(a,o)&&(a=I(a),a!==null););return a}function A(){return typeof Reflect<"u"&&Reflect.get?A=Reflect.get.bind():A=function(o,r,t){var e=Sn(o,r);if(e){var i=Object.getOwnPropertyDescriptor(e,r);return i.get?i.get.call(arguments.length<3?o:t):i.value}},A.apply(this,arguments)}function J(a){return xn(a)||Pn(a)||In(a)||An()}function xn(a){if(Array.isArray(a))return ft(a)}function Pn(a){if(typeof Symbol<"u"&&a[Symbol.iterator]!=null||a["@@iterator"]!=null)return Array.from(a)}function In(a,o){if(a){if(typeof a=="string")return ft(a,o);var r=Object.prototype.toString.call(a).slice(8,-1);if(r==="Object"&&a.constructor&&(r=a.constructor.name),r==="Map"||r==="Set")return Array.from(a);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ft(a,o)}}function ft(a,o){(o==null||o>a.length)&&(o=a.length);for(var r=0,t=new Array(o);r<o;r++)t[r]=a[r];return t}function An(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ln(a,o){if(typeof a!="object"||a===null)return a;var r=a[Symbol.toPrimitive];if(r!==void 0){var t=r.call(a,o||"default");if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(a)}function Yt(a){var o=Ln(a,"string");return typeof o=="symbol"?o:String(o)}var $t={exports:{}};(function(a){var o=Object.prototype.hasOwnProperty,r="~";function t(){}Object.create&&(t.prototype=Object.create(null),new t().__proto__||(r=!1));function e(l,u,c){this.fn=l,this.context=u,this.once=c||!1}function i(l,u,c,h,d){if(typeof c!="function")throw new TypeError("The listener must be a function");var g=new e(c,h||l,d),v=r?r+u:u;return l._events[v]?l._events[v].fn?l._events[v]=[l._events[v],g]:l._events[v].push(g):(l._events[v]=g,l._eventsCount++),l}function n(l,u){--l._eventsCount===0?l._events=new t:delete l._events[u]}function s(){this._events=new t,this._eventsCount=0}s.prototype.eventNames=function(){var u=[],c,h;if(this._eventsCount===0)return u;for(h in c=this._events)o.call(c,h)&&u.push(r?h.slice(1):h);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(c)):u},s.prototype.listeners=function(u){var c=r?r+u:u,h=this._events[c];if(!h)return[];if(h.fn)return[h.fn];for(var d=0,g=h.length,v=new Array(g);d<g;d++)v[d]=h[d].fn;return v},s.prototype.listenerCount=function(u){var c=r?r+u:u,h=this._events[c];return h?h.fn?1:h.length:0},s.prototype.emit=function(u,c,h,d,g,v){var y=r?r+u:u;if(!this._events[y])return!1;var C=this._events[y],b=arguments.length,w,T;if(C.fn){switch(C.once&&this.removeListener(u,C.fn,void 0,!0),b){case 1:return C.fn.call(C.context),!0;case 2:return C.fn.call(C.context,c),!0;case 3:return C.fn.call(C.context,c,h),!0;case 4:return C.fn.call(C.context,c,h,d),!0;case 5:return C.fn.call(C.context,c,h,d,g),!0;case 6:return C.fn.call(C.context,c,h,d,g,v),!0}for(T=1,w=new Array(b-1);T<b;T++)w[T-1]=arguments[T];C.fn.apply(C.context,w)}else{var B=C.length,O;for(T=0;T<B;T++)switch(C[T].once&&this.removeListener(u,C[T].fn,void 0,!0),b){case 1:C[T].fn.call(C[T].context);break;case 2:C[T].fn.call(C[T].context,c);break;case 3:C[T].fn.call(C[T].context,c,h);break;case 4:C[T].fn.call(C[T].context,c,h,d);break;default:if(!w)for(O=1,w=new Array(b-1);O<b;O++)w[O-1]=arguments[O];C[T].fn.apply(C[T].context,w)}}return!0},s.prototype.on=function(u,c,h){return i(this,u,c,h,!1)},s.prototype.once=function(u,c,h){return i(this,u,c,h,!0)},s.prototype.removeListener=function(u,c,h,d){var g=r?r+u:u;if(!this._events[g])return this;if(!c)return n(this,g),this;var v=this._events[g];if(v.fn)v.fn===c&&(!d||v.once)&&(!h||v.context===h)&&n(this,g);else{for(var y=0,C=[],b=v.length;y<b;y++)(v[y].fn!==c||d&&!v[y].once||h&&v[y].context!==h)&&C.push(v[y]);C.length?this._events[g]=C.length===1?C[0]:C:n(this,g)}return this},s.prototype.removeAllListeners=function(u){var c;return u?(c=r?r+u:u,this._events[c]&&n(this,c)):(this._events=new t,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=r,s.EventEmitter=s,a.exports=s})($t);var Xt=$t.exports;const qt=at(Xt);var Dn=typeof window<"u"&&window.location&&window.location.href.indexOf("xgplayerdebugger=1")>-1,ht={info:"color: #525252; background-color: #90ee90;",error:"color: #525252; background-color: red;",warn:"color: #525252; background-color: yellow; "},dt="%c[xgplayer]",R={config:{debug:Dn?3:0},logInfo:function(o){for(var r,t=arguments.length,e=new Array(t>1?t-1:0),i=1;i<t;i++)e[i-1]=arguments[i];this.config.debug>=3&&(r=console).log.apply(r,[dt,ht.info,o].concat(e))},logWarn:function(o){for(var r,t=arguments.length,e=new Array(t>1?t-1:0),i=1;i<t;i++)e[i-1]=arguments[i];this.config.debug>=1&&(r=console).warn.apply(r,[dt,ht.warn,o].concat(e))},logError:function(o){var r;if(!(this.config.debug<1)){for(var t=this.config.debug>=2?"trace":"error",e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];(r=console)[t].apply(r,[dt,ht.error,o].concat(i))}}};function Rn(a){a.logInfo=R.logInfo.bind(a),a.logWarn=R.logWarn.bind(a),a.logError=R.logError.bind(a)}var On=function(){function a(o){E(this,a),this.bufferedList=o}return S(a,[{key:"start",value:function(r){return this.bufferedList[r].start}},{key:"end",value:function(r){return this.bufferedList[r].end}},{key:"length",get:function(){return this.bufferedList.length}}]),a}(),f={};f.createDom=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"div",o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"",e=document.createElement(a);return e.className=t,e.innerHTML=o,Object.keys(r).forEach(function(i){var n=i,s=r[i];a==="video"||a==="audio"||a==="live-video"?s&&e.setAttribute(n,s):e.setAttribute(n,s)}),e},f.createDomFromHtml=function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";try{var t=document.createElement("div");t.innerHTML=a;var e=t.children;return t=null,e.length>0?(e=e[0],r&&f.addClass(e,r),o&&Object.keys(o).forEach(function(i){e.setAttribute(i,o[i])}),e):null}catch(i){return R.logError("util.createDomFromHtml",i),null}},f.hasClass=function(a,o){if(!a||!o)return!1;try{return Array.prototype.some.call(a.classList,function(t){return t===o})}catch{var r=a.className&&W(a.className)==="object"?a.getAttribute("class"):a.className;return r&&!!r.match(new RegExp("(\\s|^)"+o+"(\\s|$)"))}},f.addClass=function(a,o){if(!(!a||!o))try{o.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach(function(r){r&&a.classList.add(r)})}catch{f.hasClass(a,o)||(a.className&&W(a.className)==="object"?a.setAttribute("class",a.getAttribute("class")+" "+o):a.className+=" "+o)}},f.removeClass=function(a,o){if(!(!a||!o))try{o.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach(function(r){r&&a.classList.remove(r)})}catch{f.hasClass(a,o)&&o.split(/\s+/g).forEach(function(t){var e=new RegExp("(\\s|^)"+t+"(\\s|$)");a.className&&W(a.className)==="object"?a.setAttribute("class",a.getAttribute("class").replace(e," ")):a.className=a.className.replace(e," ")})}},f.toggleClass=function(a,o){a&&o.split(/\s+/g).forEach(function(r){f.hasClass(a,r)?f.removeClass(a,r):f.addClass(a,r)})},f.classNames=function(){for(var a=arguments,o=[],r=function(i){f.typeOf(a[i])==="String"?o.push(a[i]):f.typeOf(a[i])==="Object"&&Object.keys(a[i]).map(function(n){a[i][n]&&o.push(n)})},t=0;t<arguments.length;t++)r(t);return o.join(" ")},f.findDom=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,o=arguments.length>1?arguments[1]:void 0,r;try{r=a.querySelector(o)}catch(t){R.logError("util.findDom",t),o.indexOf("#")===0&&(r=a.getElementById(o.slice(1)))}return r},f.getCss=function(a,o){return a.currentStyle?a.currentStyle[o]:document.defaultView.getComputedStyle(a,!1)[o]},f.padStart=function(a,o,r){for(var t=String(r),e=o>>0,i=Math.ceil(e/t.length),n=[],s=String(a);i--;)n.push(t);return n.join("").substring(0,e-s.length)+s},f.format=function(a){if(window.isNaN(a))return"";a=Math.round(a);var o=f.padStart(Math.floor(a/3600),2,0),r=f.padStart(Math.floor((a-o*3600)/60),2,0),t=f.padStart(Math.floor(a-o*3600-r*60),2,0);return(o==="00"?[r,t]:[o,r,t]).join(":")},f.event=function(a){if(a.touches){var o=a.touches[0]||a.changedTouches[0];a.clientX=o.clientX||0,a.clientY=o.clientY||0,a.offsetX=o.pageX-o.target.offsetLeft,a.offsetY=o.pageY-o.target.offsetTop}a._target=a.target||a.srcElement},f.typeOf=function(a){return Object.prototype.toString.call(a).match(/([^\s.*]+)(?=]$)/g)[0]},f.deepCopy=function(a,o){if(f.typeOf(o)==="Object"&&f.typeOf(a)==="Object")return Object.keys(o).forEach(function(r){f.typeOf(o[r])==="Object"&&!(o[r]instanceof Node)?a[r]===void 0||a[r]===void 0?a[r]=o[r]:f.deepCopy(a[r],o[r]):f.typeOf(o[r])==="Array"?a[r]=f.typeOf(a[r])==="Array"?a[r].concat(o[r]):o[r]:a[r]=o[r]}),a},f.deepMerge=function(a,o){return Object.keys(o).map(function(r){if(f.typeOf(o[r])==="Array"&&f.typeOf(a[r])==="Array"){if(f.typeOf(a[r])==="Array"){var t;(t=a[r]).push.apply(t,J(o[r]))}}else f.typeOf(a[r])===f.typeOf(o[r])&&a[r]!==null&&f.typeOf(a[r])==="Object"&&!(o[r]instanceof window.Node)?f.deepMerge(a[r],o[r]):o[r]!==null&&(a[r]=o[r])}),a},f.getBgImage=function(a){var o=(a.currentStyle||window.getComputedStyle(a,null)).backgroundImage;if(!o||o==="none")return"";var r=document.createElement("a");return r.href=o.replace(/url\("|"\)/g,""),r.href},f.copyDom=function(a){if(a&&a.nodeType===1){var o=document.createElement(a.tagName);return Array.prototype.forEach.call(a.attributes,function(r){o.setAttribute(r.name,r.value)}),a.innerHTML&&(o.innerHTML=a.innerHTML),o}else return""},f.setInterval=function(a,o,r,t){a._interval[o]||(a._interval[o]=window.setInterval(r.bind(a),t))},f.clearInterval=function(a,o){clearInterval(a._interval[o]),a._interval[o]=null},f.setTimeout=function(a,o,r){a._timers||(a._timers=[]);var t=setTimeout(function(){o(),f.clearTimeout(a,t)},r);return a._timers.push(t),t},f.clearTimeout=function(a,o){var r=a._timers;if(f.typeOf(r)==="Array"){for(var t=0;t<r.length;t++)if(r[t]===o){r.splice(t,1),clearTimeout(o);break}}else clearTimeout(o)},f.clearAllTimers=function(a){var o=a._timers;f.typeOf(o)==="Array"&&(o.map(function(r){clearTimeout(r)}),a._timerIds=[])},f.createImgBtn=function(a,o,r,t){var e=f.createDom("xg-".concat(a),"",{},"xgplayer-".concat(a,"-img"));if(e.style.backgroundImage='url("'.concat(o,'")'),r&&t){var i,n,s;["px","rem","em","pt","dp","vw","vh","vm","%"].every(function(l){return r.indexOf(l)>-1&&t.indexOf(l)>-1?(i=parseFloat(r.slice(0,r.indexOf(l)).trim()),n=parseFloat(t.slice(0,t.indexOf(l)).trim()),s=l,!1):!0}),e.style.width="".concat(i).concat(s),e.style.height="".concat(n).concat(s),e.style.backgroundSize="".concat(i).concat(s," ").concat(n).concat(s),a==="start"?e.style.margin="-".concat(n/2).concat(s," auto auto -").concat(i/2).concat(s):e.style.margin="auto 5px auto 5px"}return e},f.Hex2RGBA=function(a,o){var r=[];if(/^\#[0-9A-F]{3}$/i.test(a)){var t="#";a.replace(/[0-9A-F]/ig,function(e){t+=e+e}),a=t}return/^#[0-9A-F]{6}$/i.test(a)?(a.replace(/[0-9A-F]{2}/ig,function(e){r.push(parseInt(e,16))}),"rgba(".concat(r.join(","),", ").concat(o,")")):"rgba(255, 255, 255, 0.1)"},f.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},f.checkIsFunction=function(a){return a&&typeof a=="function"},f.checkIsObject=function(a){return a!==null&&W(a)==="object"},f.hide=function(a){a.style.display="none"},f.show=function(a,o){a.style.display=o||"block"},f.isUndefined=function(a){if(typeof a>"u"||a===null)return!0},f.isNotNull=function(a){return a!=null},f.setStyleFromCsstext=function(a,o){if(o)if(f.typeOf(o)==="String"){var r=o.replace(/\s+/g,"").split(";");r.map(function(t){if(t){var e=t.split(":");e.length>1&&(a.style[e[0]]=e[1])}})}else Object.keys(o).map(function(t){a.style[t]=o[t]})};function Mn(a,o){for(var r=0,t=o.length;r<t;r++)if(a.indexOf(o[r])>-1)return!0;return!1}f.filterStyleFromText=function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["width","height","top","left","bottom","right","position","z-index","padding","margin","transform"],r=a.style.cssText;if(!r)return{};var t=r.replace(/\s+/g,"").split(";"),e={},i={};return t.map(function(n){if(n){var s=n.split(":");s.length>1&&(Mn(s[0],o)?e[s[0]]=s[1]:i[s[0]]=s[1])}}),a.setAttribute("style",""),Object.keys(i).map(function(n){a.style[n]=i[n]}),e},f.getStyleFromCsstext=function(a){var o=a.style.cssText;if(!o)return{};var r=o.replace(/\s+/g,"").split(";"),t={};return r.map(function(e){if(e){var i=e.split(":");i.length>1&&(t[i[0]]=i[1])}}),t},f.preloadImg=function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){};if(a){var t=new window.Image;t.onload=function(e){t=null,o&&o(e)},t.onerror=function(e){t=null,r&&r(e)},t.src=a}},f.stopPropagation=function(a){a&&a.stopPropagation()},f.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},f.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},f.checkTouchSupport=function(){return"ontouchstart"in window},f.getBuffered2=function(a){for(var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:.5,r=[],t=0;t<a.length;t++)r.push({start:a.start(t)<.5?0:a.start(t),end:a.end(t)});r.sort(function(l,u){var c=l.start-u.start;return c||u.end-l.end});var e=[];if(o)for(var i=0;i<r.length;i++){var n=e.length;if(n){var s=e[n-1].end;r[i].start-s<o?r[i].end>s&&(e[n-1].end=r[i].end):e.push(r[i])}else e.push(r[i])}else e=r;return new On(e)},f.getEventPos=function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return a.touches&&a.touches.length>0&&(a=a.touches[0]),{x:a.x/o,y:a.y/o,clientX:a.clientX/o,clientY:a.clientY/o,offsetX:a.offsetX/o,offsetY:a.offsetY/o,pageX:a.pageX/o,pageY:a.pageY/o}},f.requestAnimationFrame=function(a){var o=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(o)return o(a)},f.getHostFromUrl=function(a){if(f.typeOf(a)!=="String")return"";var o=a.split("/"),r="";return o.length>3&&o[2]&&(r=o[2]),r},f.cancelAnimationFrame=function(a){var o=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;o&&o(a)},f.isMSE=function(a){return a.media&&(a=a.media),!a||!(a instanceof HTMLMediaElement)?!1:/^blob/.test(a.currentSrc)||/^blob/.test(a.src)},f.isBlob=function(a){return typeof a=="string"&&/^blob/.test(a)},f.generateSessionId=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,o=new Date().getTime();try{a=parseInt(a)}catch{a=0}o+=a,window.performance&&typeof window.performance.now=="function"&&(o+=parseInt(window.performance.now()));var r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=(o+Math.random()*16)%16|0;return o=Math.floor(o/16),(t==="x"?e:e&3|8).toString(16)});return r},f.createEvent=function(a){var o;return typeof window.Event=="function"?o=new Event(a):(o=document.createEvent("Event"),o.initEvent(a,!0,!0)),o},f.adjustTimeByDuration=function(a,o,r){return!o||!a?a:a>o||r&&a<o?o:a},f.createPositionBar=function(a,o){var r=f.createDom("xg-bar","",{"data-index":-1},a);return o.appendChild(r),r},f.getTransformStyle=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{x:0,y:0,scale:1,rotate:0},o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r={scale:"".concat(a.scale||1),translate:"".concat(a.x||0,"%, ").concat(a.y||0,"%"),rotate:"".concat(a.rotate||0,"deg")},t=Object.keys(r);return t.forEach(function(e){var i=new RegExp("".concat(e,"\\([^\\(]+\\)"),"g"),n="".concat(e,"(").concat(r[e],")");i.test(o)?(i.lastIndex=-1,o=o.replace(i,n)):o+="".concat(n," ")}),o},f.convertDeg=function(a){return Math.abs(a)<=1?a*360:a%360},f.getIndexByTime=function(a,o){var r=o.length,t=-1;if(r<1)return t;if(a<=o[0].end||r<2)t=0;else if(a>o[r-1].end)t=r-1;else for(var e=1;e<r;e++)if(a>o[e-1].end&&a<=o[e].end){t=e;break}return t},f.getOffsetCurrentTime=function(a,o){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:-1,t=-1;if(r>=0&&r<o.length?t=r:t=f.getIndexByTime(a,o),t<0)return-1;var e=o.length,i=o[t],n=i.start,s=i.end,l=i.cTime,u=i.offset;return a<n?l:a>=n&&a<=s?a-u:a>s&&t>=e-1?s:-1},f.getCurrentTimeByOffset=function(a,o){var r=-1;if(!o||o.length<0)return a;for(var t=0;t<o.length;t++)if(a<=o[t].duration){r=t;break}if(r!==-1){var e=o[r].start;return r-1<0?e+a:e+(a-o[r-1].duration)}return a};function Zt(a){var o=W(a);return a!==null&&(o==="object"||o==="function")}function Nn(a,o,r){var t,e,i,n,s,l,u=0,c=!1,h=!1,d=!0,g=!o&&o!==0&&typeof window.requestAnimationFrame=="function";if(typeof a!="function")throw new TypeError("Expected a function");o=+o||0,Zt(r)&&(c=!!r.leading,h="maxWait"in r,i=h?Math.max(+r.maxWait||0,o):i,d="trailing"in r?!!r.trailing:d);function v(N){var Z=t,ee=e;return t=e=void 0,u=N,n=a.apply(ee,Z),n}function y(N,Z){return g?(window.cancelAnimationFrame(s),window.requestAnimationFrame(N)):setTimeout(N,Z)}function C(N){if(g)return window.cancelAnimationFrame(N);clearTimeout(N)}function b(N){return u=N,s=y(B,o),c?v(N):n}function w(N){var Z=N-l,ee=N-u,te=o-Z;return h?Math.min(te,i-ee):te}function T(N){var Z=N-l,ee=N-u;return l===void 0||Z>=o||Z<0||h&&ee>=i}function B(){var N=Date.now();if(T(N))return O(N);s=y(B,w(N))}function O(N){return s=void 0,d&&t?v(N):(t=e=void 0,n)}function U(){s!==void 0&&C(s),u=0,t=l=e=s=void 0}function L(){return s===void 0?n:O(Date.now())}function Y(){return s!==void 0}function j(){for(var N=Date.now(),Z=T(N),ee=arguments.length,te=new Array(ee),Te=0;Te<ee;Te++)te[Te]=arguments[Te];if(t=te,e=this,l=N,Z){if(s===void 0)return b(l);if(h)return s=y(B,o),v(l)}return s===void 0&&(s=y(B,o)),n}return j.cancel=U,j.flush=L,j.pending=Y,j}function Fn(a,o,r){var t=!0,e=!0;if(typeof a!="function")throw new TypeError("Expected a function");return Zt(r)&&(t="leading"in r?!!r.leading:t,e="trailing"in r?!!r.trailing:e),Nn(a,o,{leading:t,trailing:e,maxWait:o})}function Bn(){var a=(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase();return a==="zh-cn"&&(a="zh"),a}function Hn(a,o,r){if(a){var t=a.getAttribute(r);return!!(t&&t===o&&(a.tagName==="VIDEO"||a.tagName==="AUDIO"))}}var Jt={android:/(Android)\s([\d.]+)/,ios:/(Version)\/([\d.]+)/},Un=["avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","avc1.42E01E","mp4v.20.8","avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","mp4v.20.8, mp4a.40.2","mp4v.20.240, mp4a.40.2"],D={get device(){var a=D.os;return a.isPc?"pc":"mobile"},get browser(){if(typeof navigator>"u")return"";var a=navigator.userAgent.toLowerCase(),o={ie:/rv:([\d.]+)\) like gecko/,firefox:/firefox\/([\d.]+)/,chrome:/chrome\/([\d.]+)/,opera:/opera.([\d.]+)/,safari:/version\/([\d.]+).*safari/};return[].concat(Object.keys(o).filter(function(r){return o[r].test(a)}))[0]},get os(){if(typeof navigator>"u")return{};var a=navigator.userAgent,o=/(?:Windows Phone)/.test(a),r=/(?:SymbianOS)/.test(a)||o,t=/(?:Android)/.test(a),e=/(?:Firefox)/.test(a),i=/(?:iPad|PlayBook)/.test(a)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,n=i||t&&!/(?:Mobile)/.test(a)||e&&/(?:Tablet)/.test(a),s=/(?:iPhone)/.test(a)&&!n,l=!s&&!t&&!r&&!n;return{isTablet:n,isPhone:s,isIpad:i,isIos:s||i,isAndroid:t,isPc:l,isSymbian:r,isWindowsPhone:o,isFireFox:e}},get osVersion(){if(typeof navigator>"u")return 0;var a=navigator.userAgent,o="";/(?:iPhone)|(?:iPad|PlayBook)/.test(a)?o=Jt.ios:o=Jt.android;var r=o?o.exec(a):[];if(r&&r.length>=3){var t=r[2].split(".");return t.length>0?parseInt(t[0]):0}return 0},get isWeixin(){if(typeof navigator>"u")return!1;var a=/(micromessenger)\/([\d.]+)/,o=a.exec(navigator.userAgent.toLocaleLowerCase());return!!o},isSupportMP4:function(){var o={isSupport:!1,mime:""};if(typeof document>"u")return o;if(this.supportResult)return this.supportResult;var r=document.createElement("video");return typeof r.canPlayType=="function"&&Un.map(function(t){r.canPlayType('video/mp4; codecs="'.concat(t,'"'))==="probably"&&(o.isSupport=!0,o.mime+="||".concat(t))}),this.supportResult=o,r=null,o},isMSESupport:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:'video/mp4; codecs="avc1.42E01E,mp4a.40.2"';if(typeof MediaSource>"u"||!MediaSource)return!1;try{return MediaSource.isTypeSupported(o)}catch(r){return this._logger.error(o,r),!1}},isHevcSupported:function(){return typeof MediaSource>"u"||!MediaSource.isTypeSupported?!1:MediaSource.isTypeSupported('video/mp4;codecs="hev1.1.6.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.2.4.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.3.E.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.4.10.L120.90"')},probeConfigSupported:function(o){var r={supported:!1,smooth:!1,powerEfficient:!1};if(!o||typeof navigator>"u")return Promise.resolve(r);if(navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo)return navigator.mediaCapabilities.decodingInfo(o);var t=o.video||{},e=o.audio||{};try{var i=MediaSource.isTypeSupported(t.contentType),n=MediaSource.isTypeSupported(e.contentType);return Promise.resolve({supported:i&&n,smooth:!1,powerEfficient:!1})}catch{return Promise.resolve(r)}}},gt="3.0.18",Qt={1:"media",2:"media",3:"media",4:"media",5:"media",6:"media"},ei={1:5101,2:5102,3:5103,4:5104,5:5105,6:5106},Ue=S(function a(o){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null};E(this,a);var t=o&&o.i18n?o.i18n.ERROR_TYPES:null;if(o.media){var e=r.mediaError?r.mediaError:o.media.error||{},i=o.duration,n=o.currentTime,s=o.ended,l=o.src,u=o.currentSrc,c=o.media,h=c.readyState,d=c.networkState,g=r.errorCode||e.code;ei[g]&&(g=ei[g]);var v={playerVersion:gt,currentTime:n,duration:i,ended:s,readyState:h,networkState:d,src:l||u,errorType:r.errorType,errorCode:g,message:r.errorMessage||e.message,mediaError:e,originError:r.originError?r.originError.stack:"",host:f.getHostFromUrl(l||u)};return r.ext&&Object.keys(r.ext).map(function(w){v[w]=r.ext[w]}),v}else if(arguments.length>1){for(var y={playerVersion:gt,domain:document.domain},C=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"],b=0;b<arguments.length;b++)y[C[b]]=arguments[b];return y.ex=t?(t[arguments[0]]||{}).msg:"",y}}),$="play",pt="playing",me="ended",we="pause",Oe="error",Ve="seeking",se="seeked",X="timeupdate",Me="waiting",oe="canplay",Vn="canplaythrough",ce="durationchange",ti="volumechange",ae="loadeddata",zn="loadedmetadata",ii="ratechange",ni="progress",vt="loadstart",ye="emptied",jn="stalled",Wn="suspend",Gn="abort",Kn="bufferedChange",mt="focus",ri="blur",yt="ready",si="urlNull",_e="autoplay_started",_t="autoplay_was_prevented",ze="complete",je="replay",Ct="destroy",We="urlchange",kt="download_speed_change",oi="leaveplayer",ai="enterplayer",li="loading",le="fullscreen_change",Ge="cssFullscreen_change",Ke="mini_state_change",bt="definition_change",Yn="before_definition_change",Tt="after_definition_change",$n="SEI_PARSED",Xn="retry",fe="video_resize",wt="pip_change",ui="rotate",ci="screenShot",Ye="playnext",fi="shortcut",hi="xglog",$e="user_action",Xe="reset",di="source_error",gi="source_success",qn="switch_subtitle",pi=["play","playing","ended","pause","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","volumechange","loadeddata","loadedmetadata","ratechange","progress","loadstart","emptied","stalled","suspend","abort","lowdecode"],vi={STATS_INFO:"stats_info",STATS_DOWNLOAD:"stats_download",STATS_RESET:"stats_reset"},mi="fps_stuck";const Zn=Object.freeze(Object.defineProperty({__proto__:null,ABORT:Gn,AFTER_DEFINITION_CHANGE:Tt,AUTOPLAY_PREVENTED:_t,AUTOPLAY_STARTED:_e,BEFORE_DEFINITION_CHANGE:Yn,BUFFER_CHANGE:Kn,CANPLAY:oe,CANPLAY_THROUGH:Vn,COMPLETE:ze,CSS_FULLSCREEN_CHANGE:Ge,DEFINITION_CHANGE:bt,DESTROY:Ct,DOWNLOAD_SPEED_CHANGE:kt,DURATION_CHANGE:ce,EMPTIED:ye,ENDED:me,ENTER_PLAYER:ai,ERROR:Oe,FPS_STUCK:mi,FULLSCREEN_CHANGE:le,LEAVE_PLAYER:oi,LOADED_DATA:ae,LOADED_METADATA:zn,LOADING:li,LOAD_START:vt,MINI_STATE_CHANGE:Ke,PAUSE:we,PIP_CHANGE:wt,PLAY:$,PLAYER_BLUR:ri,PLAYER_FOCUS:mt,PLAYING:pt,PLAYNEXT:Ye,PROGRESS:ni,RATE_CHANGE:ii,READY:yt,REPLAY:je,RESET:Xe,RETRY:Xn,ROTATE:ui,SCREEN_SHOT:ci,SEEKED:se,SEEKING:Ve,SEI_PARSED:$n,SHORTCUT:fi,SOURCE_ERROR:di,SOURCE_SUCCESS:gi,STALLED:jn,STATS_EVENTS:vi,SUSPEND:Wn,SWITCH_SUBTITLE:qn,TIME_UPDATE:X,URL_CHANGE:We,URL_NULL:si,USER_ACTION:$e,VIDEO_EVENTS:pi,VIDEO_RESIZE:fe,VOLUME_CHANGE:ti,WAITING:Me,XGLOG:hi},Symbol.toStringTag,{value:"Module"}));function Et(a,o){!this||!this.emit||(a==="error"?this.errorHandler(a,o.error):this.emit(a,o))}function Jn(a,o){return function(r,t){var e={player:o,eventName:a,originalEvent:r,detail:r.detail||{},timeStamp:r.timeStamp,currentTime:o.currentTime,duration:o.duration,paused:o.paused,ended:o.ended,isInternalOp:!!o._internalOp[r.type],muted:o.muted,volume:o.volume,host:f.getHostFromUrl(o.currentSrc),vtype:o.vtype};if(o.removeInnerOP(r.type),a==="timeupdate"&&(o._currentTime=o.media&&o.media.currentTime),a==="ratechange"){var i=o.media?o.media.playbackRate:0;if(i&&o._rate===i)return;o._rate=o.media&&o.media.playbackRate}if(a==="durationchange"&&(o._duration=o.media.duration),a==="volumechange"&&(e.isMutedChange=o._lastMuted!==o.muted,o._lastMuted=o.muted),a==="error"&&(e.error=t||o.video.error),o.mediaEventMiddleware[a]){var n=Et.bind(o,a,e);try{o.mediaEventMiddleware[a].call(o,e,n)}catch(s){throw Et.call(o,a,e),s}}else Et.call(o,a,e)}}var Qn=function(a){x(r,a);var o=P(r);function r(t){var e;E(this,r),e=o.call(this,t),e._hasStart=!1,e._currentTime=0,e._duration=0,e._internalOp={},e._lastMuted=!1,e.vtype="MP4",e._rate=-1,e.mediaConfig=Object.assign({},{controls:!1,autoplay:t.autoplay,playsinline:t.playsinline,"x5-playsinline":t.playsinline,"webkit-playsinline":t.playsinline,"x5-video-player-fullscreen":t["x5-video-player-fullscreen"]||t.x5VideoPlayerFullscreen,"x5-video-orientation":t["x5-video-orientation"]||t.x5VideoOrientation,airplay:t.airplay,"webkit-airplay":t.airplay,tabindex:t.tabindex|0,mediaType:t.mediaType||"video","data-index":-1},t.videoConfig,t.videoAttributes);var i=t["x5-video-player-type"]||t.x5VideoPlayerType;return D.isWeixin&&D.os.isAndroid&&i&&(e.mediaConfig["x5-video-player-type"]=i,delete e.mediaConfig.playsinline,delete e.mediaConfig["webkit-playsinline"],delete e.mediaConfig["x5-playsinline"]),t.loop&&(e.mediaConfig.loop="loop"),t.autoplayMuted&&!Object.prototype.hasOwnProperty.call(e.mediaConfig,"muted")&&(e.mediaConfig.muted=!0),e.media=f.createDom(e.mediaConfig.mediaType,"",e.mediaConfig,""),t.defaultPlaybackRate&&(e.media.defaultPlaybackRate=e.media.playbackRate=t.defaultPlaybackRate),f.typeOf(t.volume)==="Number"&&(e.volume=t.volume),t.autoplayMuted&&(e.media.muted=!0,e._lastMuted=!0),t.autoplay&&(e.media.autoplay=!0),e._interval={},e.mediaEventMiddleware={},e.attachVideoEvents(),e}return S(r,[{key:"setEventsMiddleware",value:function(e){var i=this;Object.keys(e).map(function(n){i.mediaEventMiddleware[n]=e[n]})}},{key:"removeEventsMiddleware",value:function(e){var i=this;Object.keys(e).map(function(n){delete i.mediaEventMiddleware[n]})}},{key:"attachVideoEvents",value:function(){var e=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.media;this._evHandlers||(this._evHandlers=pi.map(function(n){var s="on".concat(n.charAt(0).toUpperCase()).concat(n.slice(1));return typeof e[s]=="function"&&e.on(n,e[s]),_({},n,Jn(n,e))})),this._evHandlers.forEach(function(n){var s=Object.keys(n)[0];i.addEventListener(s,n[s],!1)})}},{key:"detachVideoEvents",value:function(){var e=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.media;this._evHandlers.forEach(function(n){var s=Object.keys(n)[0];i.removeEventListener(s,n[s],!1)}),this._evHandlers.forEach(function(n){var s=Object.keys(n)[0],l="on".concat(s.charAt(0).toUpperCase()).concat(s.slice(1));typeof e[l]=="function"&&e.off(s,e[l])}),this._evHandlers=null}},{key:"_attachSourceEvents",value:function(e,i){var n=this;e.removeAttribute("src"),e.load(),i.forEach(function(h,d){n.media.appendChild(f.createDom("source","",{src:"".concat(h.src),type:"".concat(h.type||""),"data-index":d+1}))});var s=e.children;if(s){this._videoSourceCount=s.length,this._videoSourceIndex=s.length,this._vLoadeddata=function(h){n.emit(gi,{src:h.target.currentSrc,host:f.getHostFromUrl(h.target.currentSrc)})};for(var l=null,u=0;u<this._evHandlers.length;u++)if(Object.keys(this._evHandlers[u])[0]==="error"){l=this._evHandlers[u];break}!this._sourceError&&(this._sourceError=function(h){var d=parseInt(h.target.getAttribute("data-index"),10);if(n._videoSourceIndex--,n._videoSourceIndex===0||d>=n._videoSourceCount){var g={code:4,message:"sources_load_error"};l?l.error(h,g):n.errorHandler("error",g)}var v=Qt[4];n.emit(di,new Ue(n,{errorType:v,errorCode:4,errorMessage:"sources_load_error",mediaError:{code:4,message:"sources_load_error"},src:h.target.src}))});for(var c=0;c<s.length;c++)s[c].addEventListener("error",this._sourceError);e.addEventListener("loadeddata",this._vLoadeddata)}}},{key:"_detachSourceEvents",value:function(e){var i=e.children;if(!(!i||i.length===0||!this._sourceError)){for(var n=0;n<i.length;n++)i[n].removeEventListener("error",this._sourceError);for(;i.length>0;)e.removeChild(i[0]);this._vLoadeddata&&e.removeEventListener("loadeddata",this._vLoadeddata)}}},{key:"errorHandler",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.media&&(this.media.error||i)){var n=this.media.error||i,s=n.code?Qt[n.code]:"other",l=n.message;this.media.currentSrc||(l="empty_src",n={code:6,message:l}),this.emit(e,new Ue(this,{errorType:s,errorCode:n.code,errorMessage:n.message||"",mediaError:n}))}}},{key:"destroy",value:function(){this.media&&(this.media.pause&&(this.media.pause(),this.media.muted=!0),this.media.removeAttribute("src"),this.media.load()),this._currentTime=0,this._duration=0,this.mediaConfig=null;for(var e in this._interval)Object.prototype.hasOwnProperty.call(this._interval,e)&&(clearInterval(this._interval[e]),this._interval[e]=null);this.detachVideoEvents(),this.media=null,this.mediaEventMiddleware={},this.removeAllListeners()}},{key:"video",get:function(){return this.media},set:function(e){this.media=e}},{key:"play",value:function(){var e=this.media?this.media.play():null;return e}},{key:"pause",value:function(){this.media&&this.media.pause()}},{key:"load",value:function(){this.media&&this.media.load()}},{key:"canPlayType",value:function(e){return this.media?this.media.canPlayType(e):!1}},{key:"getBufferedRange",value:function(e){var i=[0,0];if(!this.media)return i;e||(e=this.media.buffered);var n=this.media.currentTime;if(e)for(var s=0,l=e.length;s<l&&(i[0]=e.start(s),i[1]=e.end(s),!(i[0]<=n&&n<=i[1]));s++);return i[0]-n<=0&&n-i[1]<=0?i:[0,0]}},{key:"autoplay",get:function(){return this.media?this.media.autoplay:!1},set:function(e){this.media&&(this.media.autoplay=e)}},{key:"buffered",get:function(){return this.media?this.media.buffered:null}},{key:"buffered2",get:function(){return this.media&&this.media.buffered?f.getBuffered2(this.media.buffered):null}},{key:"bufferedPoint",get:function(){var e={start:0,end:0};if(!this.media)return e;var i=this.media.buffered;if(!i||i.length===0)return e;for(var n=0;n<i.length;n++)if((i.start(n)<=this.currentTime||i.start(n)<.1)&&i.end(n)>=this.currentTime)return{start:i.start(n),end:i.end(n)};return e}},{key:"crossOrigin",get:function(){return this.media?this.media.crossOrigin:""},set:function(e){this.media&&(this.media.crossOrigin=e)}},{key:"currentSrc",get:function(){return this.media?this.media.currentSrc:""},set:function(e){this.media&&(this.media.currentSrc=e)}},{key:"currentTime",get:function(){return this.media?this.media.currentTime!==void 0?this.media.currentTime:this._currentTime:0},set:function(e){this.media&&(this.media.currentTime=e)}},{key:"defaultMuted",get:function(){return this.media?this.media.defaultMuted:!1},set:function(e){this.media&&(this.media.defaultMuted=e)}},{key:"duration",get:function(){return this._duration}},{key:"ended",get:function(){return this.media?this.media.ended:!1}},{key:"error",get:function(){return this.media.error}},{key:"errorNote",get:function(){var e=this.media.error;if(!e)return"";var i=["MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED"];return i[this.media.error.code-1]}},{key:"loop",get:function(){return this.media?this.media.loop:!1},set:function(e){this.media&&(this.media.loop=e)}},{key:"muted",get:function(){return this.media?this.media.muted:!1},set:function(e){!this.media||this.media.muted===e||(this._lastMuted=this.media.muted,this.media.muted=e)}},{key:"networkState",get:function(){return this.media.networkState}},{key:"paused",get:function(){return this.media?this.media.paused:!0}},{key:"playbackRate",get:function(){return this.media?this.media.playbackRate:0},set:function(e){!this.media||e===1/0||(this.media.defaultPlaybackRate=e,this.media.playbackRate=e)}},{key:"played",get:function(){return this.media?this.media.played:null}},{key:"preload",get:function(){return this.media?this.media.preload:!1},set:function(e){this.media&&(this.media.preload=e)}},{key:"readyState",get:function(){return this.media.readyState}},{key:"seekable",get:function(){return this.media?this.media.seekable:!1}},{key:"seeking",get:function(){return this.media?this.media.seeking:!1}},{key:"src",get:function(){return this.media?this.media.src:""},set:function(e){if(this.media){if(this.emit(We,e),this.emit(Me),this._currentTime=0,this._duration=0,f.isMSE(this.media)){this.onWaiting();return}this._detachSourceEvents(this.media),f.typeOf(e)==="Array"?this._attachSourceEvents(this.media,e):e?this.media.src=e:this.media.removeAttribute("src"),this.load()}}},{key:"volume",get:function(){return this.media?this.media.volume:0},set:function(e){e===1/0||!this.media||(this.media.volume=e)}},{key:"aspectRatio",get:function(){return this.media?this.media.videoWidth/this.media.videoHeight:0}},{key:"addInnerOP",value:function(e){this._internalOp[e]=!0}},{key:"removeInnerOP",value:function(e){delete this._internalOp[e]}},{key:"emit",value:function(e,i){for(var n,s=arguments.length,l=new Array(s>2?s-2:0),u=2;u<s;u++)l[u-2]=arguments[u];(n=A(I(r.prototype),"emit",this)).call.apply(n,[this,e,i].concat(l))}},{key:"on",value:function(e,i){for(var n,s=arguments.length,l=new Array(s>2?s-2:0),u=2;u<s;u++)l[u-2]=arguments[u];(n=A(I(r.prototype),"on",this)).call.apply(n,[this,e,i].concat(l))}},{key:"once",value:function(e,i){for(var n,s=arguments.length,l=new Array(s>2?s-2:0),u=2;u<s;u++)l[u-2]=arguments[u];(n=A(I(r.prototype),"once",this)).call.apply(n,[this,e,i].concat(l))}},{key:"off",value:function(e,i){for(var n,s=arguments.length,l=new Array(s>2?s-2:0),u=2;u<s;u++)l[u-2]=arguments[u];(n=A(I(r.prototype),"off",this)).call.apply(n,[this,e,i].concat(l))}},{key:"offAll",value:function(){A(I(r.prototype),"removeAllListeners",this).call(this)}}]),r}(qt),er=function(){function a(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{name:"xgplayer",version:1,db:null,ojstore:{name:"xg-m4a",keypath:"vid"}};E(this,a),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=o}return S(a,[{key:"openDB",value:function(r){var t=this,e=this,i=this.myDB.version||1,n=e.indexedDB.open(e.myDB.name,i);n.onerror=function(s){},n.onsuccess=function(s){t.myDB.db=s.target.result,r.call(e)},n.onupgradeneeded=function(s){var l=s.target.result;s.target.transaction,l.objectStoreNames.contains(e.myDB.ojstore.name)||l.createObjectStore(e.myDB.ojstore.name,{keyPath:e.myDB.ojstore.keypath})}}},{key:"deletedb",value:function(){var r=this;r.indexedDB.deleteDatabase(this.myDB.name)}},{key:"closeDB",value:function(){this.myDB.db.close()}},{key:"addData",value:function(r,t){for(var e=this.myDB.db.transaction(r,"readwrite").objectStore(r),i,n=0;n<t.length;n++)i=e.add(t[n]),i.onerror=function(){},i.onsuccess=function(){}}},{key:"putData",value:function(r,t){for(var e=this.myDB.db.transaction(r,"readwrite").objectStore(r),i,n=0;n<t.length;n++)i=e.put(t[n]),i.onerror=function(){},i.onsuccess=function(){}}},{key:"getDataByKey",value:function(r,t,e){var i=this,n=this.myDB.db.transaction(r,"readwrite").objectStore(r),s=n.get(t);s.onerror=function(){e.call(i,null)},s.onsuccess=function(l){var u=l.target.result;e.call(i,u)}}},{key:"deleteData",value:function(r,t){var e=this.myDB.db.transaction(r,"readwrite").objectStore(r);e.delete(t)}},{key:"clearData",value:function(r){var t=this.myDB.db.transaction(r,"readwrite").objectStore(r);t.clear()}}]),a}(),yi=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],_i=["requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen"],Ci=["exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"],Ce="data-xgplayerid";function qe(a,o,r){for(var t=arguments.length,e=new Array(t>3?t-3:0),i=3;i<t;i++)e[i-3]=arguments[i];var n=o.call.apply(o,[a].concat(e));!r||typeof r!="function"||(n&&n.then?n.then(function(){for(var s=arguments.length,l=new Array(s),u=0;u<s;u++)l[u]=arguments[u];r.call.apply(r,[a].concat(l))}):r.call.apply(r,[a].concat(e)))}function Ze(a,o){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{pre:null,next:null};return this.__hooks||(this.__hooks={}),!this.__hooks[a]&&(this.__hooks[a]=null),(function(){var t=arguments,e=this;if(r.pre)try{var i;(i=r.pre).call.apply(i,[this].concat(Array.prototype.slice.call(arguments)))}catch(l){throw l.message="[pluginName: ".concat(this.pluginName,":").concat(a,":pre error] >> ").concat(l.message),l}if(this.__hooks&&this.__hooks[a])try{var n,s=(n=this.__hooks[a]).call.apply(n,[this,this].concat(Array.prototype.slice.call(arguments)));s?s.then?s.then(function(l){l!==!1&&qe.apply(void 0,[e,o,r.next].concat(J(t)))}).catch(function(l){throw l}):qe.apply(void 0,[this,o,r.next].concat(Array.prototype.slice.call(arguments))):s===void 0&&qe.apply(void 0,[this,o,r.next].concat(Array.prototype.slice.call(arguments)))}catch(l){throw l.message="[pluginName: ".concat(this.pluginName,":").concat(a,"] >> ").concat(l.message),l}else qe.apply(void 0,[this,o,r.next].concat(Array.prototype.slice.call(arguments)))}).bind(this)}function Je(a,o){var r=this.__hooks;if(r)return r.hasOwnProperty(a)?(r&&(r[a]=o),!0):(console.warn("has no supported hook which name [".concat(a,"]")),!1)}function Qe(a,o){var r=this.__hooks;r&&delete r[a]}function ki(a){if(!(!this.plugins||!this.plugins[a.toLowerCase()])){for(var o=this.plugins[a.toLowerCase()],r=arguments.length,t=new Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];return o.useHooks&&o.useHooks.apply(o,t)}}function bi(a){if(!(!this.plugins||!this.plugins[a.toLowerCase()])){var o=this.plugins[a.toLowerCase()];if(o){for(var r=arguments.length,t=new Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];return o.removeHooks&&o.removeHooks.apply(o,t)}}}function Ti(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];a.__hooks={},o&&o.map(function(r){a.__hooks[r]=null}),Object.defineProperty(a,"hooks",{get:function(){return a.__hooks&&Object.keys(a.__hooks).map(function(t){if(a.__hooks[t])return t})}})}function wi(a){a.__hooks=null}function ue(a,o,r){for(var t=arguments.length,e=new Array(t>3?t-3:0),i=3;i<t;i++)e[i-3]=arguments[i];if(a.__hooks&&a.__hooks[o]){var n,s=(n=a.__hooks[o]).call.apply(n,[a,a].concat(e));if(s&&s.then)s.then(function(l){return l===!1?null:r.call.apply(r,[a,a].concat(e))}).catch(function(l){console.warn("[runHooks]".concat(o," reject"),l.message)});else if(s!==!1)return r.call.apply(r,[a,a].concat(e))}else return r.call.apply(r,[a,a].concat(e))}function St(a,o){R.logError("[".concat(a,"] event or callback cant be undefined or null when call ").concat(o))}var he=function(){function a(o){E(this,a),f.checkIsFunction(this.beforeCreate)&&this.beforeCreate(o),Ti(this),this.__args=o,this.__events={},this.__onceEvents={},this.config=o.config||{},this.player=null,this.playerConfig={},this.pluginName="",this.__init(o)}return S(a,[{key:"beforeCreate",value:function(r){}},{key:"afterCreate",value:function(){}},{key:"beforePlayerInit",value:function(){}},{key:"onPluginsReady",value:function(){}},{key:"afterPlayerInit",value:function(){}},{key:"destroy",value:function(){}},{key:"__init",value:function(r){this.player=r.player,this.playerConfig=r.player&&r.player.config,this.pluginName=r.pluginName?r.pluginName.toLowerCase():this.constructor.pluginName.toLowerCase(),this.logger=r.player&&r.player.logger}},{key:"updateLang",value:function(r){r||(r=this.lang)}},{key:"lang",get:function(){return this.player.lang}},{key:"i18n",get:function(){return this.player.i18n}},{key:"i18nKeys",get:function(){return this.player.i18nKeys}},{key:"domEventType",get:function(){var r=f.checkTouchSupport()?"touch":"mouse";return this.playerConfig&&(this.playerConfig.domEventType==="touch"||this.playerConfig.domEventType==="mouse")&&(r=this.playerConfig.domEventType),r}},{key:"on",value:function(r,t){var e=this;if(!r||!t||!this.player){St(this.pluginName,"plugin.on(event, callback)");return}typeof r=="string"?(this.__events[r]=t,this.player.on(r,t)):Array.isArray(r)&&r.forEach(function(i){e.__events[i]=t,e.player.on(i,t)})}},{key:"once",value:function(r,t){var e=this;if(!r||!t||!this.player){St(this.pluginName,"plugin.once(event, callback)");return}typeof r=="string"?(this.__onceEvents[r]=t,this.player.once(r,t)):Array.isArray(r)&&r.forEach(function(i){e.__onceEvents[i]=t,e.player.once(r,t)})}},{key:"off",value:function(r,t){var e=this;if(!r||!t||!this.player){St(this.pluginName,"plugin.off(event, callback)");return}typeof r=="string"?(delete this.__events[r],this.player.off(r,t)):Array.isArray(r)&&r.forEach(function(i){delete e.__events[r],e.player.off(i,t)})}},{key:"offAll",value:function(){var r=this;["__events","__onceEvents"].forEach(function(t){Object.keys(r[t]).forEach(function(e){r[t][e]&&r.off(e,r[t][e]),e&&delete r[t][e]})}),this.__events={},this.__onceEvents={}}},{key:"emit",value:function(r){var t;if(this.player){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];(t=this.player).emit.apply(t,[r].concat(i))}}},{key:"emitUserAction",value:function(r,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.player){var i=V(V({},e),{},{pluginName:this.pluginName});this.player.emitUserAction(r,t,i)}}},{key:"hook",value:function(r,t){return Ze.call.apply(Ze,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(r,t){for(var e=arguments.length,i=new Array(e>2?e-2:0),n=2;n<e;n++)i[n-2]=arguments[n];return Je.call.apply(Je,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(r,t){for(var e=arguments.length,i=new Array(e>2?e-2:0),n=2;n<e;n++)i[n-2]=arguments[n];return Qe.call.apply(Qe,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"registerPlugin",value:function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";if(this.player)return e&&(t.pluginName=e),this.player.registerPlugin({plugin:r,options:t})}},{key:"getPlugin",value:function(r){return this.player?this.player.getPlugin(r):null}},{key:"__destroy",value:function(){var r=this,t=this.player,e=this.pluginName;this.offAll(),f.clearAllTimers(this),f.checkIsFunction(this.destroy)&&this.destroy(),["player","playerConfig","pluginName","logger","__args","__hooks"].map(function(i){r[i]=null}),t.unRegisterPlugin(e),wi(this)}}],[{key:"defineGetterOrSetter",value:function(r,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&Object.defineProperty(r,e,t[e])}},{key:"defaultConfig",get:function(){return{}}},{key:"pluginName",get:function(){return"pluginName"}}]),a}(),tr=9;if(typeof Element<"u"&&!Element.prototype.matches){var Ee=Element.prototype;Ee.matches=Ee.matchesSelector||Ee.mozMatchesSelector||Ee.msMatchesSelector||Ee.oMatchesSelector||Ee.webkitMatchesSelector}function ir(a,o){for(;a&&a.nodeType!==tr;){if(typeof a.matches=="function"&&a.matches(o))return a;a=a.parentNode}}var nr=ir,rr=nr;function xt(a,o,r,t,e){var i=or.apply(this,arguments);return a.addEventListener(r,i,e),{destroy:function(){a.removeEventListener(r,i,e)}}}function sr(a,o,r,t,e){return typeof a.addEventListener=="function"?xt.apply(null,arguments):typeof r=="function"?xt.bind(null,document).apply(null,arguments):(typeof a=="string"&&(a=document.querySelectorAll(a)),Array.prototype.map.call(a,function(i){return xt(i,o,r,t,e)}))}function or(a,o,r,t){return function(e){e.delegateTarget=rr(e.target,o),e.delegateTarget&&t.call(a,e)}}var ar=sr;const Ei=at(ar);var lr={CONTROLS:"controls",ROOT:"root"},H={ROOT:"root",ROOT_LEFT:"rootLeft",ROOT_RIGHT:"rootRight",ROOT_TOP:"rootTop",CONTROLS_LEFT:"controlsLeft",CONTROLS_RIGTH:"controlsRight",CONTROLS_RIGHT:"controlsRight",CONTROLS_CENTER:"controlsCenter",CONTROLS:"controls"},Si={ICON_DISABLE:"xg-icon-disable",ICON_HIDE:"xg-icon-hide"};function Pt(a){return a?a.indexOf&&/^(?:http|data:|\/)/.test(a):!1}function ur(a,o){return W(a)==="object"&&a.class&&typeof a.class=="string"?"".concat(o," ").concat(a.class):o}function cr(a,o){return W(a)==="object"&&a.attr&&W(a.attr)==="object"&&Object.keys(a.attr).map(function(r){o[r]=a.attr[r]}),o}function xi(a,o){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},e=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"",i=null;if(a instanceof window.Element)return f.addClass(a,r),Object.keys(t).map(function(n){a.setAttribute(n,t[n])}),a;if(Pt(a)||Pt(a.url))return t.src=Pt(a)?a:a.url||"",i=f.createDom(a.tag||"img","",t,"xg-img ".concat(r)),i;if(typeof a=="function")try{return i=a(),i instanceof window.Element?(f.addClass(i,r),Object.keys(t).map(function(n){i.setAttribute(n,t[n])}),i):(R.logWarn("warn>>icons.".concat(o," in config of plugin named [").concat(e,"] is a function mast return an Element Object")),null)}catch(n){return R.logError("Plugin named [".concat(e,"]:createIcon"),n),null}return typeof a=="string"?f.createDomFromHtml(a,t,r):(R.logWarn("warn>>icons.".concat(o," in config of plugin named [").concat(e,"] is invalid")),null)}function fr(a,o){var r=o.config.icons||o.playerConfig.icons;Object.keys(a).map(function(t){var e=a[t],i=e&&e.class?e.class:"",n=e&&e.attr?e.attr:{},s=null;r&&r[t]&&(i=ur(r[t],i),n=cr(r[t],n),s=xi(r[t],t,i,n,o.pluginName)),!s&&e&&(s=xi(e.icon?e.icon:e,n,i,{},o.pluginName)),o.icons[t]=s})}function hr(a,o){Object.keys(a).map(function(r){Object.defineProperty(o.langText,r,{get:function(){var e=o.lang,i=o.i18n;return i[r]?i[r]:a[r]&&a[r][e]||""}})})}var F=function(a){x(r,a);var o=P(r);function r(){var t,e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return E(this,r),t=o.call(this,e),t.__delegates=[],t}return S(r,[{key:"__init",value:function(e){if(A(I(r.prototype),"__init",this).call(this,e),!!e.root){var i=e.root,n=null;this.icons={},this.root=null,this.parent=null;var s=this.registerIcons()||{};fr(s,this),this.langText={};var l=this.registerLanguageTexts()||{};hr(l,this);var u="";try{u=this.render()}catch(d){throw R.logError("Plugin:".concat(this.pluginName,":render"),d),new Error("Plugin:".concat(this.pluginName,":render:").concat(d.message))}if(u)n=r.insert(u,i,e.index),n.setAttribute("data-index",e.index);else if(e.tag)n=f.createDom(e.tag,"",e.attr,e.name),n.setAttribute("data-index",e.index),i.appendChild(n);else return;this.root=n,this.parent=i;var c=this.config.attr||{},h=this.config.style||{};this.setAttr(c),this.setStyle(h),this.config.index&&this.root.setAttribute("data-index",this.config.index),this.__registerChildren()}}},{key:"__registerChildren",value:function(){var e=this;if(this.root){this._children=[];var i=this.children();i&&W(i)==="object"&&Object.keys(i).length>0&&Object.keys(i).map(function(n){var s=n,l=i[s],u={root:e.root},c,h;typeof l=="function"?(c=e.config[s]||{},h=l):W(l)==="object"&&typeof l.plugin=="function"&&(c=l.options?f.deepCopy(e.config[s]||{},l.options):e.config[s]||{},h=l.plugin),u.config=c,c.index!==void 0&&(u.index=c.index),c.root&&(u.root=c.root),e.registerPlugin(h,u,s)})}}},{key:"updateLang",value:function(e){e||(e=this.lang);function i(u,c){for(var h=0;h<u.children.length;h++)u.children[h].children.length>0?i(u.children[h],c):c(u.children[h])}var n=this.root,s=this.i18n,l=this.langText;n&&i(n,function(u){var c=u.getAttribute&&u.getAttribute("lang-key");if(c){var h=s[c.toUpperCase()]||l[c];h&&(u.innerHTML=typeof h=="function"?h(e):h)}})}},{key:"lang",get:function(){return this.player.lang}},{key:"changeLangTextKey",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",n=this.i18n||{},s=this.langText;e.setAttribute&&e.setAttribute("lang-key",i);var l=n[i]||s[i]||"";l&&(e.innerHTML=l)}},{key:"plugins",value:function(){return this._children}},{key:"disable",value:function(){this.config.disable=!0,f.addClass(this.find(".xgplayer-icon"),Si.ICON_DISABLE)}},{key:"enable",value:function(){this.config.disable=!1,f.removeClass(this.find(".xgplayer-icon"),Si.ICON_DISABLE)}},{key:"children",value:function(){return{}}},{key:"registerPlugin",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";i.root=i.root||this.root;var s=A(I(r.prototype),"registerPlugin",this).call(this,e,i,n);return this._children.push(s),s}},{key:"registerIcons",value:function(){return{}}},{key:"registerLanguageTexts",value:function(){return{}}},{key:"find",value:function(e){if(this.root)return this.root.querySelector(e)}},{key:"bind",value:function(e,i,n){var s=this;if(arguments.length<3&&typeof i=="function")Array.isArray(e)?e.forEach(function(u){s.bindEL(u,i)}):this.bindEL(e,i);else{var l=r.delegate.call(this,this.root,e,i,n);this.__delegates=this.__delegates.concat(l)}}},{key:"unbind",value:function(e,i){var n=this;if(arguments.length<3&&typeof i=="function")Array.isArray(e)?e.forEach(function(u){n.unbindEL(u,i)}):this.unbindEL(e,i);else for(var s="".concat(e,"_").concat(i),l=0;l<this.__delegates.length;l++)if(this.__delegates[l].key===s){this.__delegates[l].destroy(),this.__delegates.splice(l,1);break}}},{key:"setStyle",value:function(e,i){var n=this;if(this.root){if(f.typeOf(e)==="String")return this.root.style[e]=i;f.typeOf(e)==="Object"&&Object.keys(e).map(function(s){n.root.style[s]=e[s]})}}},{key:"setAttr",value:function(e,i){var n=this;if(this.root){if(f.typeOf(e)==="String")return this.root.setAttribute(e,i);f.typeOf(e)==="Object"&&Object.keys(e).map(function(s){n.root.setAttribute(s,e[s])})}}},{key:"setHtml",value:function(e,i){this.root&&(this.root.innerHTML=e,typeof i=="function"&&i())}},{key:"bindEL",value:function(e,i){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.root&&"on".concat(e)in this.root&&typeof i=="function"&&this.root.addEventListener(e,i,n)}},{key:"unbindEL",value:function(e,i){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.root&&"on".concat(e)in this.root&&typeof i=="function"&&this.root.removeEventListener(e,i,n)}},{key:"show",value:function(e){if(this.root){this.root.style.display=e!==void 0?e:"block";var i=window.getComputedStyle(this.root,null),n=i.getPropertyValue("display");if(n==="none")return this.root.style.display="block"}}},{key:"hide",value:function(){this.root&&(this.root.style.display="none")}},{key:"appendChild",value:function(e,i){if(!this.root)return null;if(arguments.length<2&&arguments[0]instanceof window.Element)return this.root.appendChild(arguments[0]);if(!i||!(i instanceof window.Element))return null;try{return typeof e=="string"?this.find(e).appendChild(i):e.appendChild(i)}catch(n){return R.logError("Plugin:appendChild",n),null}}},{key:"render",value:function(){return""}},{key:"destroy",value:function(){}},{key:"__destroy",value:function(){var e=this,i=this.player;this.__delegates.map(function(n){n.destroy()}),this.__delegates=[],this._children instanceof Array&&(this._children.map(function(n){i.unRegisterPlugin(n.pluginName)}),this._children=null),this.root&&(this.root.hasOwnProperty("remove")?this.root.remove():this.root.parentNode&&this.root.parentNode.removeChild(this.root)),A(I(r.prototype),"__destroy",this).call(this),this.icons={},["root","parent"].map(function(n){e[n]=null})}}],[{key:"insert",value:function(e,i){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=i.children.length,l=Number(n),u=e instanceof window.Node;if(s){for(var c=0,h=null,d="";c<s;c++){h=i.children[c];var g=Number(h.getAttribute("data-index"));if(g>=l){d="beforebegin";break}else g<l&&(d="afterend")}return u?d==="afterend"?i.appendChild(e):i.insertBefore(e,h):h.insertAdjacentHTML(d,e),d==="afterend"?i.children[i.children.length-1]:i.children[c]}else return u?i.appendChild(e):i.insertAdjacentHTML("beforeend",e),i.children[i.children.length-1]}},{key:"defaultConfig",get:function(){return{}}},{key:"delegate",value:function(e,i,n,s){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,u=[];if(e instanceof window.Node&&typeof s=="function")if(Array.isArray(n))n.forEach(function(h){var d=Ei(e,i,h,s,l);d.key="".concat(i,"_").concat(h),u.push(d)});else{var c=Ei(e,i,n,s,l);c.key="".concat(i,"_").concat(n),u.push(c)}return u}},{key:"ROOT_TYPES",get:function(){return lr}},{key:"POSITIONS",get:function(){return H}}]),r}(he),dr=function(){function a(){var o=this;if(E(this,a),_(this,"__trigger",function(r){var t=new Date().getTime();o.timeStamp=t;for(var e=0;e<r.length;e++)o.__runHandler(r[e].target)}),this.__handlers=[],this.timeStamp=0,this.observer=null,!!window.ResizeObserver)try{this.observer=new window.ResizeObserver(Fn(this.__trigger,100,{trailing:!0})),this.timeStamp=new Date().getTime()}catch(r){console.error(r)}}return S(a,[{key:"addObserver",value:function(r,t){if(this.observer){this.observer&&this.observer.observe(r);for(var e=r.getAttribute(Ce),i=this.__handlers,n=-1,s=0;s<i.length;s++)i[s]&&r===i[s].target&&(n=s);n>-1?this.__handlers[n].handler=t:this.__handlers.push({target:r,handler:t,playerId:e})}}},{key:"unObserver",value:function(r){var t=-1;this.__handlers.map(function(e,i){r===e.target&&(t=i)});try{this.observer&&this.observer.unobserve(r)}catch{}this.observer&&this.observer.unobserve(r),t>-1&&this.__handlers.splice(t,1)}},{key:"destroyObserver",value:function(){this.observer&&this.observer.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(r){for(var t=this.__handlers,e=0;e<t.length;e++)if(t[e]&&r===t[e].target){try{t[e].handler(r)}catch(i){console.error(i)}return!0}return!1}}]),a}(),Ne=null;function gr(a,o){return Ne||(Ne=new dr),Ne.addObserver(a,o),Ne}function pr(a,o){Ne.unObserver(a,o)}var z={pluginGroup:{},init:function(o){var r=o._pluginInfoId;r||(r=new Date().getTime(),o._pluginInfoId=r),!o.config.closeResizeObserver&&gr(o.root,function(){o.resize()}),this.pluginGroup[r]={_originalOptions:o.config||{},_plugins:{}}},formatPluginInfo:function(o,r){var t=null,e=null;return o.plugin&&typeof o.plugin=="function"?(t=o.plugin,e=o.options):(t=o,e={}),r&&(e.config=r||{}),{PLUFGIN:t,options:e}},checkPluginIfExits:function(o,r){for(var t=0;t<r.length;t++)if(o.toLowerCase()===r[t].pluginName.toLowerCase())return!0;return!1},getRootByConfig:function(o,r){for(var t=Object.keys(r),e=null,i=0;i<t.length;i++)if(o.toLowerCase()===t[i].toLowerCase()){e=r[t[i]];break}return f.typeOf(e)==="Object"?{root:e.root,position:e.position}:{}},lazyRegister:function(o,r){var t=this,e=r.timeout||1500;return Promise.race([r.loader().then(function(i){var n;i&&i.__esModule?n=i.default:n=i,t.register(o,n,i.options)}),new Promise(function(i,n){setTimeout(function(){n(new Error("timeout"))},e)})])},register:function(o,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!(!o||!r||typeof r!="function"||r.prototype===void 0)){var e=o._pluginInfoId;if(!(!e||!this.pluginGroup[e])){this.pluginGroup[e]._plugins||(this.pluginGroup[e]._plugins={});var i=this.pluginGroup[e]._plugins,n=this.pluginGroup[e]._originalOptions;t.player=o;var s=t.pluginName||r.pluginName;if(!s)throw new Error("The property pluginName is necessary");if(r.isSupported&&!r.isSupported(o.config.mediaType,o.config.codecType)){console.warn("not supported plugin [".concat(s,"]"));return}t.config||(t.config={});for(var l=Object.keys(n),u=0;u<l.length;u++)if(s.toLowerCase()===l[u].toLowerCase()){var c=n[l[u]];f.typeOf(c)==="Object"?t.config=Object.assign({},t.config,n[l[u]]):f.typeOf(c)==="Boolean"&&(t.config.disable=!c);break}r.defaultConfig&&Object.keys(r.defaultConfig).forEach(function(d){typeof t.config[d]>"u"&&(t.config[d]=r.defaultConfig[d])}),t.root?typeof t.root=="string"&&(t.root=o[t.root]):t.root=o.root,t.index=t.config.index||0;try{i[s.toLowerCase()]&&(this.unRegister(e,s.toLowerCase()),console.warn("the is one plugin with same pluginName [".concat(s,"] exist, destroy the old instance")));var h=new r(t);return i[s.toLowerCase()]=h,i[s.toLowerCase()].func=r,h&&typeof h.afterCreate=="function"&&h.afterCreate(),h}catch(d){throw console.error(d),d}}}},unRegister:function(o,r){o._pluginInfoId&&(o=o._pluginInfoId),r=r.toLowerCase();try{var t=this.pluginGroup[o]._plugins[r];t&&(t.pluginName&&t.__destroy(),delete this.pluginGroup[o]._plugins[r])}catch(e){console.error("[unRegister:".concat(r,"] cgid:[").concat(o,"] error"),e)}},deletePlugin:function(o,r){var t=o._pluginInfoId;t&&this.pluginGroup[t]&&this.pluginGroup[t]._plugins&&delete this.pluginGroup[t]._plugins[r]},getPlugins:function(o){var r=o._pluginInfoId;return r&&this.pluginGroup[r]?this.pluginGroup[r]._plugins:{}},findPlugin:function(o,r){var t=o._pluginInfoId;if(!t||!this.pluginGroup[t])return null;var e=r.toLowerCase();return this.pluginGroup[t]._plugins[e]},beforeInit:function(o){var r=this;function t(e){return!e||!e.then?new Promise(function(i){i()}):e}return new Promise(function(e){if(r.pluginGroup){var i;return o._loadingPlugins&&o._loadingPlugins.length?i=Promise.all(o._loadingPlugins):i=Promise.resolve(),i.then(function(){var n=o._pluginInfoId;if(!r.pluginGroup[n]){e();return}var s=r.pluginGroup[n]._plugins,l=[];Object.keys(s).forEach(function(u){if(s[u]&&s[u].beforePlayerInit)try{var c=s[u].beforePlayerInit();l.push(t(c))}catch(h){throw l.push(t(null)),h}}),Promise.all([].concat(l)).then(function(){e()}).catch(function(u){console.error(u),e()})})}})},afterInit:function(o){var r=o._pluginInfoId;if(!(!r||!this.pluginGroup[r])){var t=this.pluginGroup[r]._plugins;Object.keys(t).forEach(function(e){t[e]&&t[e].afterPlayerInit&&t[e].afterPlayerInit()})}},setLang:function(o,r){var t=r._pluginInfoId;if(!(!t||!this.pluginGroup[t])){var e=this.pluginGroup[t]._plugins;Object.keys(e).forEach(function(i){if(e[i].updateLang)e[i].updateLang(o);else try{e[i].lang=o}catch{console.warn("".concat(i," setLang"))}})}},reRender:function(o){var r=this,t=o._pluginInfoId;if(!(!t||!this.pluginGroup[t])){var e=[],i=this.pluginGroup[t]._plugins;Object.keys(i).forEach(function(n){n!=="controls"&&i[n]&&(e.push({plugin:i[n].func,options:i[n].__args}),r.unRegister(t,n))}),e.forEach(function(n){r.register(o,n.plugin,n.options)})}},onPluginsReady:function(o){var r=o._pluginInfoId;if(!(!r||!this.pluginGroup[r])){var t=this.pluginGroup[r]._plugins||{};Object.keys(t).forEach(function(e){t[e].onPluginsReady&&typeof t[e].onPluginsReady=="function"&&t[e].onPluginsReady()})}},destroy:function(o){var r=o._pluginInfoId;if(this.pluginGroup[r]){pr(o.root);for(var t=this.pluginGroup[r]._plugins,e=0,i=Object.keys(t);e<i.length;e++){var n=i[e];this.unRegister(r,n)}delete this.pluginGroup[r],delete o._pluginInfoId}}},k={DEFAULT:"xgplayer",DEFAULT_SKIN:"xgplayer-skin-default",ENTER:"xgplayer-is-enter",PAUSED:"xgplayer-pause",PLAYING:"xgplayer-playing",ENDED:"xgplayer-ended",CANPLAY:"xgplayer-canplay",LOADING:"xgplayer-isloading",ERROR:"xgplayer-is-error",REPLAY:"xgplayer-replay",NO_START:"xgplayer-nostart",ACTIVE:"xgplayer-active",INACTIVE:"xgplayer-inactive",FULLSCREEN:"xgplayer-is-fullscreen",CSS_FULLSCREEN:"xgplayer-is-cssfullscreen",ROTATE_FULLSCREEN:"xgplayer-rotate-fullscreen",PARENT_ROTATE_FULLSCREEN:"xgplayer-rotate-parent",PARENT_FULLSCREEN:"xgplayer-fullscreen-parent",INNER_FULLSCREEN:"xgplayer-fullscreen-inner",NO_CONTROLS:"no-controls",FLEX_CONTROLS:"flex-controls",CONTROLS_FOLLOW:"controls-follow",CONTROLS_AUTOHIDE:"controls-autohide",TOP_BAR_AUTOHIDE:"top-bar-autohide",NOT_ALLOW_AUTOPLAY:"not-allow-autoplay",SEEKING:"seeking",PC:"xgplayer-pc",MOBILE:"xgplayer-mobile",MINI:"xgplayer-mini"};function Pi(){return{id:"",el:null,url:"",domEventType:"default",nullUrlStart:!1,width:600,height:337.5,fluid:!1,fitVideoSize:"fixed",videoFillMode:"auto",volume:.6,autoplay:!1,autoplayMuted:!1,loop:!1,isLive:!1,zoom:1,videoInit:!0,poster:"",isMobileSimulateMode:!1,defaultPlaybackRate:1,execBeforePluginsCall:null,allowSeekAfterEnded:!0,enableContextmenu:!0,closeVideoClick:!1,closeVideoDblclick:!1,closePlayerBlur:!1,closeDelayBlur:!1,leavePlayerTime:3e3,closePlayVideoFocus:!1,closePauseVideoFocus:!1,closeFocusVideoFocus:!0,closeControlsBlur:!0,topBarAutoHide:!0,videoAttributes:{},startTime:0,seekedStatus:"play",miniprogress:!1,disableSwipeHandler:function(){},enableSwipeHandler:function(){},preProcessUrl:null,ignores:[],whitelist:[],inactive:3e3,lang:Bn(),controls:!0,marginControls:!1,fullscreenTarget:null,screenShot:!1,rotate:!1,pip:!1,download:!1,mini:!1,cssFullscreen:!0,keyShortcut:!0,presets:[],plugins:[],playbackRate:1,definition:{list:[]},playsinline:!0,customDuration:0,timeOffset:0,icons:{},i18n:[],tabindex:0,thumbnail:null,videoConfig:{},isHideTips:!1,minWaitDelay:200,commonStyle:{progressColor:"",playedColor:"",cachedColor:"",sliderBtnStyle:{},volumeColor:""}}}var vr=function(o,r){var t,e,i;r.preset&&r.options?i=new r.preset(r.options,o.config):i=new r({},o.config);var n=i,s=n.plugins,l=s===void 0?[]:s,u=n.ignores,c=u===void 0?[]:u,h=n.icons,d=h===void 0?{}:h,g=n.i18n,v=g===void 0?[]:g;o.config.plugins||(o.config.plugins=[]),o.config.ignores||(o.config.ignores=[]),(t=o.config.plugins).push.apply(t,J(l)),(e=o.config.ignores).push.apply(e,J(c)),Object.keys(d).map(function(C){o.config.icons[C]||(o.config.icons[C]=d[C])});var y=o.config.i18n||[];v.push.apply(v,J(y)),o.config.i18n=v},mr=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)),_(m(t),"onMouseEnter",function(s){var l=m(t),u=l.player,c=l.playerConfig;c.closeControlsBlur&&u.focus({autoHide:!1})}),_(m(t),"onMouseLeave",function(s){var l=m(t),u=l.player;u.focus()}),t}return S(r,[{key:"beforeCreate",value:function(e){!e.config.mode&&D.device==="mobile"&&(e.config.mode="flex"),e.player.config.marginControls&&(e.config.autoHide=!1)}},{key:"afterCreate",value:function(){var e=this,i=this.config,n=i.disable,s=i.height,l=i.mode;if(!n){l==="flex"&&this.player.addClass(k.FLEX_CONTROLS);var u={height:"".concat(s,"px")};Object.keys(u).map(function(h){e.root.style[h]=u[h]}),this.left=this.find("xg-left-grid"),this.center=this.find("xg-center-grid"),this.right=this.find("xg-right-grid"),this.innerRoot=this.find("xg-inner-controls"),this.on(Ke,function(h){h?f.addClass(e.root,"mini-controls"):f.removeClass(e.root,"mini-controls")});var c=this.playerConfig.isMobileSimulateMode;D.device!=="mobile"&&c!=="mobile"&&(this.bind("mouseenter",this.onMouseEnter),this.bind("mouseleave",this.onMouseLeave))}}},{key:"focus",value:function(){this.player.focus({autoHide:!1})}},{key:"focusAwhile",value:function(){this.player.focus({autoHide:!0})}},{key:"blur",value:function(){this.player.blur({ignorePaused:!0})}},{key:"recoverAutoHide",value:function(){this.config.autoHide&&f.addClass(this.root,k.CONTROLS_AUTOHIDE)}},{key:"pauseAutoHide",value:function(){f.removeClass(this.root,k.CONTROLS_AUTOHIDE)}},{key:"show",value:function(e){this.root.style.display="",this.player.focus()}},{key:"hide",value:function(){this.root.style.display="none"}},{key:"mode",get:function(){return this.config.mode}},{key:"registerPlugin",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;if(this.root){var s=e.defaultConfig||{};if(!i.root){var l=i.position?i.position:i.config&&i.config.position?i.config.position:s.position;switch(l){case H.CONTROLS_LEFT:i.root=this.left;break;case H.CONTROLS_RIGHT:i.root=this.right;break;case H.CONTROLS_CENTER:i.root=this.center;break;case H.CONTROLS:i.root=this.root;break;default:i.root=this.left}return A(I(r.prototype),"registerPlugin",this).call(this,e,i,n)}}}},{key:"destroy",value:function(){D.device!=="mobile"&&(this.unbind("mouseenter",this.onMouseEnter),this.unbind("mouseleave",this.onMouseLeave))}},{key:"render",value:function(){var e=this.config,i=e.mode,n=e.autoHide,s=e.initShow,l=e.disable;if(!l){var u=f.classNames({"xgplayer-controls":!0},{"flex-controls":i==="flex"},{"bottom-controls":i==="bottom"},_({},k.CONTROLS_AUTOHIDE,n),{"xgplayer-controls-initshow":s||!n});return'<xg-controls class="'.concat(u,`" unselectable="on">
3
3
  <xg-inner-controls class="xg-inner-controls xg-pos">
4
4
  <xg-left-grid class="xg-left-grid">