iking-web-ui-pro 1.0.49 → 1.0.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Demo/ik.index.es.js +0 -1
- package/dist/IkApprovalProcessDetail/iking-web-ui-pro.css +1 -1
- package/dist/IkCalendar/ik.index.es.js +3 -3
- package/dist/IkCalendar/iking-web-ui-pro.css +1 -1
- package/dist/IkDescription/ik.index.es.js +4 -4
- package/dist/IkDescription/iking-web-ui-pro.css +1 -1
- package/dist/IkDetailPreviewFiles/iking-web-ui-pro.css +1 -1
- package/dist/IkImageEditor/ik.index.es.js +12 -13
- package/dist/IkPreviewFile/iking-web-ui-pro.css +1 -1
- package/dist/IkUploadImage/ik.index.es.js +5 -5
- package/dist/IkUploadImage/iking-web-ui-pro.css +1 -1
- package/dist/iking-web-ui-pro.css +2 -2
- package/dist/{index-Ead_HYDP.mjs → index-_Nj-SOox.mjs} +797 -797
- package/dist/{index.es-B7kIaWOa.mjs → index.es-DnDbR-XX.mjs} +2 -2
- package/dist/index.es.js +1 -1
- package/dist/index.umd.js +787 -0
- package/dist/{jspdf.es.min-qkJb9M2W.mjs → jspdf.es.min-CZVsyoNP.mjs} +1 -1
- package/dist/{types/src → src}/utils/index.d.ts +0 -1
- package/package.json +7 -14
- package/dist/Demo/ik.index.cjs.js +0 -1
- package/dist/Demo/package.json +0 -7
- package/dist/IkApprovalProcess/ik.index.cjs.js +0 -1
- package/dist/IkApprovalProcess/package.json +0 -5
- package/dist/IkApprovalProcessDetail/ik.index.cjs.js +0 -228
- package/dist/IkApprovalProcessDetail/package.json +0 -5
- package/dist/IkAutoCard/ik.index.cjs.js +0 -1
- package/dist/IkAutoCard/package.json +0 -5
- package/dist/IkBaseDialog/ik.index.cjs.js +0 -3
- package/dist/IkBaseDialog/package.json +0 -5
- package/dist/IkBottomOperate/ik.index.cjs.js +0 -1
- package/dist/IkBottomOperate/package.json +0 -5
- package/dist/IkBtnContent/ik.index.cjs.js +0 -1
- package/dist/IkBtnContent/package.json +0 -5
- package/dist/IkBtnSetting/ik.index.cjs.js +0 -1
- package/dist/IkBtnSetting/package.json +0 -5
- package/dist/IkCalendar/ik.index.cjs.js +0 -1
- package/dist/IkCalendar/package.json +0 -5
- package/dist/IkCollapseCard/ik.index.cjs.js +0 -1
- package/dist/IkCollapseCard/package.json +0 -5
- package/dist/IkCurrencyInput/ik.index.cjs.js +0 -1
- package/dist/IkCurrencyInput/package.json +0 -5
- package/dist/IkDescription/ik.index.cjs.js +0 -228
- package/dist/IkDescription/package.json +0 -5
- package/dist/IkDetailPreviewFiles/ik.index.cjs.js +0 -228
- package/dist/IkDetailPreviewFiles/package.json +0 -5
- package/dist/IkDragList/ik.index.cjs.js +0 -1
- package/dist/IkDragList/package.json +0 -5
- package/dist/IkEmpty/ik.index.cjs.js +0 -1
- package/dist/IkEmpty/package.json +0 -5
- package/dist/IkExpandCollapse/ik.index.cjs.js +0 -1
- package/dist/IkExpandCollapse/package.json +0 -5
- package/dist/IkFileIcon/ik.index.cjs.js +0 -1
- package/dist/IkFileIcon/package.json +0 -5
- package/dist/IkHorizontalStepBar/ik.index.cjs.js +0 -1
- package/dist/IkHorizontalStepBar/package.json +0 -7
- package/dist/IkIconPicker/ik.index.cjs.js +0 -1
- package/dist/IkIconPicker/package.json +0 -5
- package/dist/IkImageEditor/ik.index.cjs.js +0 -1
- package/dist/IkImageEditor/package.json +0 -5
- package/dist/IkImageUploadEditor/ik.index.cjs.js +0 -33
- package/dist/IkImageUploadEditor/package.json +0 -5
- package/dist/IkImageViewer/ik.index.cjs.js +0 -1
- package/dist/IkImageViewer/package.json +0 -5
- package/dist/IkMonacoEditor/ik.index.cjs.js +0 -11
- package/dist/IkMonacoEditor/package.json +0 -5
- package/dist/IkOnlyOffice/ik.index.cjs.js +0 -1
- package/dist/IkOnlyOffice/package.json +0 -5
- package/dist/IkPage/ik.index.cjs.js +0 -1
- package/dist/IkPage/package.json +0 -5
- package/dist/IkPageFull/ik.index.cjs.js +0 -17
- package/dist/IkPageFull/package.json +0 -5
- package/dist/IkPageTabs/ik.index.cjs.js +0 -1
- package/dist/IkPageTabs/package.json +0 -5
- package/dist/IkPickerUser/ik.index.cjs.js +0 -1
- package/dist/IkPickerUser/package.json +0 -5
- package/dist/IkPlayer/ik.index.cjs.js +0 -226
- package/dist/IkPlayer/package.json +0 -5
- package/dist/IkPreviewFile/ik.index.cjs.js +0 -228
- package/dist/IkPreviewFile/package.json +0 -5
- package/dist/IkPreviewFileDialog/ik.index.cjs.js +0 -228
- package/dist/IkPreviewFileDialog/package.json +0 -5
- package/dist/IkPrint/html2canvas.esm-C4Mnoizn.js +0 -22
- package/dist/IkPrint/ik.index.cjs.js +0 -145
- package/dist/IkPrint/index.es-BMhBUwqb.js +0 -18
- package/dist/IkPrint/jspdf.es.min-BH6PQjtb.js +0 -193
- package/dist/IkPrint/package.json +0 -5
- package/dist/IkPrint/purify.es-8WZbZdhR.js +0 -2
- package/dist/IkPrintConfig/ik.index.cjs.js +0 -1
- package/dist/IkPrintConfig/package.json +0 -5
- package/dist/IkPrintView/ik.index.cjs.js +0 -1
- package/dist/IkPrintView/package.json +0 -5
- package/dist/IkRadioGroup/ik.index.cjs.js +0 -1
- package/dist/IkRadioGroup/package.json +0 -5
- package/dist/IkSearch/ik.index.cjs.js +0 -26
- package/dist/IkSearch/package.json +0 -5
- package/dist/IkSearchHead/ik.index.cjs.js +0 -1
- package/dist/IkSearchHead/package.json +0 -5
- package/dist/IkSelectTag/ik.index.cjs.js +0 -1
- package/dist/IkSelectTag/package.json +0 -5
- package/dist/IkSideText/ik.index.cjs.js +0 -1
- package/dist/IkSideText/package.json +0 -5
- package/dist/IkStatu/ik.index.cjs.js +0 -1
- package/dist/IkStatu/package.json +0 -5
- package/dist/IkStatuOver/ik.index.cjs.js +0 -1
- package/dist/IkStatuOver/package.json +0 -5
- package/dist/IkSvgIcon/ik.index.cjs.js +0 -1
- package/dist/IkSvgIcon/package.json +0 -5
- package/dist/IkTemplateOfficeConfig/ik.index.cjs.js +0 -1
- package/dist/IkTemplateOfficeConfig/package.json +0 -5
- package/dist/IkTinymce/ik.index.cjs.js +0 -102
- package/dist/IkTinymce/package.json +0 -5
- package/dist/IkTooltip/ik.index.cjs.js +0 -1
- package/dist/IkTooltip/package.json +0 -5
- package/dist/IkTree/ik.index.cjs.js +0 -1
- package/dist/IkTree/package.json +0 -5
- package/dist/IkUploadFile/ik.index.cjs.js +0 -228
- package/dist/IkUploadFile/package.json +0 -5
- package/dist/IkUploadImage/ik.index.cjs.js +0 -1
- package/dist/IkUploadImage/package.json +0 -5
- package/dist/IkVerticalStepBar/ik.index.cjs.js +0 -1
- package/dist/IkVerticalStepBar/package.json +0 -7
- package/dist/Provider/ik.index.cjs.js +0 -1
- package/dist/Provider/package.json +0 -5
- package/dist/html2canvas.esm-C4Mnoizn.js +0 -22
- package/dist/index-WKZ7ZkxJ.js +0 -556
- package/dist/index.cjs.js +0 -1
- package/dist/index.es-CFaOiLhV.js +0 -18
- package/dist/jspdf.es.min-ByZc3B2w.js +0 -193
- package/dist/purify.es-8WZbZdhR.js +0 -2
- package/dist/types/src/utils/use-cleanup.d.ts +0 -12
- /package/dist/{types/src → src}/components/Demo/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkApprovalProcess/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkApprovalProcess/src/IkApprovalProcess.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkApprovalProcessDetail/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkApprovalProcessDetail/src/IkApprovalProcessDetail.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkAutoCard/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkAutoCard/src/IkAutoCard.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkBaseDialog/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkBaseDialog/src/CloseIcon.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkBaseDialog/src/IkBaseDialog.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkBottomOperate/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkBottomOperate/src/IkBottomOperate.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkBtnContent/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkBtnContent/src/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkBtnSetting/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkBtnSetting/src/IkBtnSetting.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkCalendar/event-utils.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkCalendar/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkCalendar/src/IkCalendar.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkCollapseCard/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkCollapseCard/src/index.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkCurrencyInput/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkCurrencyInput/src/IkCurrencyInput.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkDescription/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkDescription/src/IkDescription.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkDetailPreviewFiles/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkDetailPreviewFiles/src/IkDetailPreviewFiles.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkDragList/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkDragList/src/IkDragList.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkDragList/src/default-props.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkEmpty/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkEmpty/src/index.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkExpandCollapse/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkExpandCollapse/src/IkExpandCollapse.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkFileIcon/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkFileIcon/src/IkFileIcon.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkHorizontalStepBar/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkHorizontalStepBar/src/IkHorizontalStepBar.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkIconPicker/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkIconPicker/src/index.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkImageEditor/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkImageUploadEditor/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkImageUploadEditor/src/IkImageUploadEditor.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkImageViewer/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkImageViewer/src/IkImageViewer.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkImageViewer/src/image-viewer.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkMonacoEditor/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkMonacoEditor/src/editor-config.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkMonacoEditor/src/index.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkOnlyOffice/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkOnlyOffice/src/IkOnlyOffice.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPage/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPageFull/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPageFull/src/IkDialog.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPageFull/src/IkPage.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPageFull/src/IkPageHead.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPageFull/src/IkPageTable.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPageFull/src/IkSearchAuto.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPageFull/src/index.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPageFull/src/props.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPageFull/src/search.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPageTabs/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPageTabs/src/IkPageTabs.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPickerUser/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPickerUser/src/avatar/Avatar.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPickerUser/src/default.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPickerUser/src/list/GroupList.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPickerUser/src/list/PostList.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPickerUser/src/list/RoleList.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPickerUser/src/list/props.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPickerUser/src/list/utils.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPickerUser/src/picker.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPickerUser/src/svg/close_svg.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPickerUser/src/svg/group_svg.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPickerUser/src/svg/post_svg.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPickerUser/src/svg/role_svg.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPickerUser/src/svg/search_svg.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPickerUser/src/use-picker-data.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPickerUser/types.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPlayer/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPlayer/src/Player.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPreviewFile/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPreviewFile/src/IkPreviewFile.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPreviewFileDialog/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPreviewFileDialog/src/IkPreviewFileDialog.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPrint/IkPrint.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPrint/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPrintConfig/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPrintConfig/src/IkPrintConfig.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkPrintView/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkRadioGroup/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkRadioGroup/src/index.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkSearch/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkSearch/src/IkSearch.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkSearch/src/IkSearchAuto.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkSearch/src/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkSearchHead/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkSearchHead/src/IkSearchHead.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkSelectTag/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkSelectTag/src/index.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkSideText/IkLinearIcon.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkSideText/IkSideText.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkSideText/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkSideText/useLinear.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkStatu/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkStatu/src/index.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkStatuOver/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkStatuOver/src/index.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkSvgIcon/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkSvgIcon/src/index.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkTemplateOfficeConfig/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkTemplateOfficeConfig/src/IkTemplateOfficeConfig.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkTemplateOfficeConfig/src/templateOfficeData.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkTinymce/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkTinymce/src/index.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkTooltip/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkTooltip/src/index.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkTree/IkTree.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkTree/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkUploadFile/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkUploadFile/src/index.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkUploadFile/src/utils.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkUploadImage/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkUploadImage/src/index.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkUploadImage/src/loading.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkVerticalStepBar/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/IkVerticalStepBar/src/IkVerticalStepBar.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/Provider/ProviderConfig.vue.d.ts +0 -0
- /package/dist/{types/src → src}/components/Provider/index.d.ts +0 -0
- /package/dist/{types/src → src}/components/index.d.ts +0 -0
- /package/dist/{types/src → src}/enum/search.d.ts +0 -0
- /package/dist/{types/src → src}/iking-ui/component.d.ts +0 -0
- /package/dist/{types/src → src}/iking-ui/defaults.d.ts +0 -0
- /package/dist/{types/src → src}/iking-ui/index.d.ts +0 -0
- /package/dist/{types/src → src}/iking-ui/make-installer.d.ts +0 -0
- /package/dist/{types/src → src}/utils/approval.d.ts +0 -0
- /package/dist/{types/src → src}/utils/file.d.ts +0 -0
- /package/dist/{types/src → src}/utils/install.d.ts +0 -0
- /package/dist/{types/src → src}/utils/math.d.ts +0 -0
- /package/dist/{types/src → src}/utils/object.d.ts +0 -0
- /package/dist/{types/src → src}/utils/theme.d.ts +0 -0
- /package/dist/{types/src → src}/utils/typescript.d.ts +0 -0
- /package/dist/{types/src → src}/utils/use-provider.d.ts +0 -0
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("vue"),he=require("iking-utils-pro"),J=require("element-plus"),Ee=(a,o)=>(a.install=n=>{for(const t of[a,...Object.values({})])n.component(t.name,t)},a),gr=(a,o)=>{var i,r,s,l;const n=(i=a==null?void 0:a.response)!=null&&i.data?Zr((s=(r=a==null?void 0:a.response)==null?void 0:r.data)==null?void 0:s.suffix):((l=a.raw)==null?void 0:l.type)||Zr(a[o.suffix]),t=n==null?void 0:n.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"},Kl={".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"},Zr=a=>{const o=a==null?void 0:a.toLocaleLowerCase(),n=o!=null&&o.startsWith(".")?o:`.${o}`;return n&&Kl[n]||"unknow"},$l=a=>{let o="",n=["doc","docx"],t=["xls","xlsx"],e=["ppt","pptx"],i=["pdf"];return n.includes(a)&&(o="word"),t.includes(a)&&(o="cell"),e.includes(a)&&(o="slide"),i.includes(a)&&(o="text-pdf"),o},Yl={key:0,t:"1686300059786",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"7671",width:"200",height:"200"},Xl={key:1,t:"1686301531714",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"9067",width:"200",height:"200"},Zl={key:2,t:"1686300141125",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"8137",width:"200",height:"200"},Jl={key:3,t:"1686300157181",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"8292",width:"200",height:"200"},Ql={key:4,t:"1686300180947",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"8447",width:"200",height:"200"},eu={key:5,t:"1686300195363",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"8602",width:"200",height:"200"},tu={key:6,t:"1686300209288",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"8757",width:"200",height:"200"},iu={key:7,t:"1686300225262",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"8912",width:"200",height:"200"},nu={key:8,t:"1692251753690",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4336",width:"200",height:"200"},ru={key:9,t:"1692251753690",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4336",width:"200",height:"200"},au={key:10,t:"1714099890925",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2271",width:"200",height:"200"},ou={key:11,t:"1686300037564",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"7515",width:"200",height:"200"},su=c.defineComponent({__name:"IkFileIcon",props:{type:{type:String,default:"unknow"},file:{type:Object,default:()=>null},fields:{type:Object,default:()=>({name:"name",url:"url",suffix:"suffix"})}},setup(a){const o=a,n=c.computed(()=>o.file?gr(o.file,o.fields):o.type);return(t,e)=>n.value==="image"?(c.openBlock(),c.createElementBlock("svg",Yl,[...e[0]||(e[0]=[c.createElementVNode("path",{d:"M160 0h512l256 256v704c0 35.3472-28.6528 64-64 64H160c-35.3472 0-64-28.6528-64-64V64c0-35.3472 28.6528-64 64-64z",fill:"#50CD89","p-id":"7672"},null,-1),c.createElementVNode("path",{d:"M258.528 742.0672L351.8336 604.928a14.5024 14.5024 0 0 1 22.1696-2.1824l61.664 60.416 135.296-212.064a14.5024 14.5024 0 0 1 24.8064 0.5568l168.1024 291.328a14.5024 14.5024 0 0 1-12.5696 21.7664H270.528a14.5024 14.5024 0 0 1-12.0064-22.6816z",fill:"#FFF7F7","p-id":"7673"},null,-1),c.createElementVNode("path",{d:"M359.616 431.5456m-73.1456 0a73.1456 73.1456 0 1 0 146.2912 0 73.1456 73.1456 0 1 0-146.2912 0Z",fill:"#FFFFFF","p-id":"7674"},null,-1),c.createElementVNode("path",{d:"M672 0l256 256h-192c-35.3472 0-64-28.6528-64-64V0z",fill:"#a9f6cc","p-id":"7675"},null,-1)])])):n.value==="zip"?(c.openBlock(),c.createElementBlock("svg",Xl,[...e[1]||(e[1]=[c.createElementVNode("path",{d:"M409.6 0v68.266667h-34.133333c-20.48 0-34.133333 13.653333-34.133334 34.133333s13.653333 34.133333 34.133334 34.133333H409.6v68.266667h-34.133333c-20.48 0-34.133333 13.653333-34.133334 34.133333s13.653333 34.133333 34.133334 34.133334H409.6v68.266666h-34.133333c-20.48 0-34.133333 13.653333-34.133334 34.133334s13.653333 34.133333 34.133334 34.133333H409.6v68.266667h-34.133333c-20.48 0-34.133333 13.653333-34.133334 34.133333s13.653333 34.133333 34.133334 34.133333h68.266666c20.48 0 34.133333-13.653333 34.133334-34.133333V477.866667h34.133333c20.48 0 34.133333-13.653333 34.133333-34.133334S532.48 409.6 512 409.6H477.866667V341.333333h34.133333c20.48 0 34.133333-13.653333 34.133333-34.133333S532.48 273.066667 512 273.066667H477.866667V204.8h34.133333c20.48 0 34.133333-13.653333 34.133333-34.133333S532.48 136.533333 512 136.533333H477.866667V0h204.8l273.066666 273.066667v614.4c0 75.093333-61.44 136.533333-136.533333 136.533333H204.8c-75.093333 0-136.533333-61.44-136.533333-136.533333V136.533333C68.266667 61.44 129.706667 0 204.8 0h204.8z m0 682.666667h68.266667v68.266666H409.6v-68.266666z m-34.133333-68.266667c-20.48 0-34.133333 13.653333-34.133334 34.133333v136.533334c0 20.48 13.653333 34.133333 34.133334 34.133333h136.533333c20.48 0 34.133333-13.653333 34.133333-34.133333v-136.533334c0-20.48-13.653333-34.133333-34.133333-34.133333h-136.533333z",fill:"#FFA621","p-id":"9068"},null,-1),c.createElementVNode("path",{d:"M682.666667 0l273.066666 273.066667h-204.8c-40.96 0-68.266667-27.306667-68.266666-68.266667V0z",fill:"#f5d37b","p-id":"9069"},null,-1)])])):n.value==="ppt"?(c.openBlock(),c.createElementBlock("svg",Zl,[...e[2]||(e[2]=[c.createElementVNode("path",{d:"M204.8 0h477.866667l273.066666 273.066667v614.4c0 75.093333-61.44 136.533333-136.533333 136.533333H204.8c-75.093333 0-136.533333-61.44-136.533333-136.533333V136.533333C68.266667 61.44 129.706667 0 204.8 0z m204.8 546.133333V443.733333h204.8v136.533334H409.6V546.133333z m0 102.4h204.8c40.96 0 68.266667-27.306667 68.266667-68.266666v-136.533334c0-40.96-27.306667-68.266667-68.266667-68.266666H409.6c-40.96 0-68.266667 27.306667-68.266667 68.266666V819.2c0 20.48 13.653333 34.133333 34.133334 34.133333s34.133333-13.653333 34.133333-34.133333V648.533333z",fill:"#F1416C","p-id":"8138"},null,-1),c.createElementVNode("path",{d:"M682.666667 0l273.066666 273.066667h-204.8c-40.96 0-68.266667-27.306667-68.266666-68.266667V0z",fill:"#f78cbc","p-id":"8139"},null,-1)])])):n.value==="word"?(c.openBlock(),c.createElementBlock("svg",Jl,[...e[3]||(e[3]=[c.createElementVNode("path",{d:"M204.8 0h477.866667l273.066666 273.066667v614.4c0 75.093333-61.44 136.533333-136.533333 136.533333H204.8c-75.093333 0-136.533333-61.44-136.533333-136.533333V136.533333C68.266667 61.44 129.706667 0 204.8 0z m307.2 607.573333l68.266667 191.146667c13.653333 27.306667 54.613333 27.306667 61.44 0l102.4-273.066667c6.826667-20.48 0-34.133333-20.48-40.96s-34.133333 0-40.96 13.653334l-68.266667 191.146666-68.266667-191.146666c-13.653333-27.306667-54.613333-27.306667-68.266666 0l-68.266667 191.146666-68.266667-191.146666c-6.826667-13.653333-27.306667-27.306667-47.786666-20.48s-27.306667 27.306667-20.48 47.786666l102.4 273.066667c13.653333 27.306667 54.613333 27.306667 61.44 0l75.093333-191.146667z",fill:"#029EF7","p-id":"8293"},null,-1),c.createElementVNode("path",{d:"M682.666667 0l273.066666 273.066667h-204.8c-40.96 0-68.266667-27.306667-68.266666-68.266667V0z",fill:"#64b5ed","p-id":"8294"},null,-1)])])):n.value==="pdf"?(c.openBlock(),c.createElementBlock("svg",Ql,[...e[4]||(e[4]=[c.createElementVNode("path",{d:"M204.8 0h477.866667l273.066666 273.066667v614.4c0 75.093333-61.44 136.533333-136.533333 136.533333H204.8c-75.093333 0-136.533333-61.44-136.533333-136.533333V136.533333C68.266667 61.44 129.706667 0 204.8 0z m477.866667 730.453333c20.48 0 68.266667 0 68.266666-47.786666 0-20.48-6.826667-47.786667-68.266666-47.786667-27.306667 0-54.613333 6.826667-81.92 6.826667-34.133333-27.306667-68.266667-61.44-88.746667-102.4 20.48-75.093333 20.48-122.88 6.826667-150.186667-6.826667-6.826667-20.48-13.653333-34.133334-13.653333-20.48 0-34.133333 6.826667-40.96 20.48-20.48 40.96 13.653333 116.053333 27.306667 150.186666-20.48 54.613333-40.96 109.226667-68.266667 163.84C273.066667 764.586667 273.066667 798.72 273.066667 812.373333c0 13.653333 6.826667 27.306667 20.48 34.133334 6.826667 6.826667 13.653333 6.826667 20.48 6.826666 34.133333 0 68.266667-34.133333 116.053333-109.226666 54.613333-20.48 102.4-40.96 157.013333-47.786667 27.306667 20.48 61.44 34.133333 95.573334 34.133333zM491.52 416.426667c6.826667 20.48 6.826667 47.786667 0 68.266666-13.653333-20.48-13.653333-40.96-13.653333-68.266666h13.653333z m-177.493333 395.946666c13.653333-20.48 27.306667-27.306667 47.786666-40.96-13.653333 20.48-27.306667 34.133333-47.786666 40.96z m184.32-204.8c13.653333 20.48 34.133333 47.786667 54.613333 68.266667H546.133333c-27.306667 6.826667-61.44 13.653333-88.746666 27.306667 13.653333-34.133333 27.306667-61.44 40.96-95.573334z m177.493333 68.266667c27.306667 0 34.133333 6.826667 34.133333 13.653333-6.826667 0-20.48 6.826667-27.306666 0-13.653333 0-27.306667-6.826667-40.96-13.653333h34.133333z",fill:"#F1416C","p-id":"8448"},null,-1),c.createElementVNode("path",{d:"M682.666667 0l273.066666 273.066667h-204.8c-40.96 0-68.266667-27.306667-68.266666-68.266667V0z",fill:"#f78cbc","p-id":"8449"},null,-1)])])):n.value==="txt"?(c.openBlock(),c.createElementBlock("svg",eu,[...e[5]||(e[5]=[c.createElementVNode("path",{d:"M204.8 0h477.866667l273.066666 273.066667v614.4c0 75.093333-61.44 136.533333-136.533333 136.533333H204.8c-75.093333 0-136.533333-61.44-136.533333-136.533333V136.533333C68.266667 61.44 129.706667 0 204.8 0z m341.333333 512h136.533334c20.48 0 34.133333-13.653333 34.133333-34.133333s-13.653333-34.133333-34.133333-34.133334H341.333333c-20.48 0-34.133333 13.653333-34.133333 34.133334s13.653333 34.133333 34.133333 34.133333h136.533334V819.2c0 20.48 13.653333 34.133333 34.133333 34.133333s34.133333-13.653333 34.133333-34.133333V512z",fill:"#029EF7","p-id":"8603"},null,-1),c.createElementVNode("path",{d:"M682.666667 0l273.066666 273.066667h-204.8c-40.96 0-68.266667-27.306667-68.266666-68.266667V0z",fill:"#64b5ed","p-id":"8604"},null,-1)])])):n.value==="audio"?(c.openBlock(),c.createElementBlock("svg",tu,[...e[6]||(e[6]=[c.createElementVNode("path",{d:"M204.8 0h477.866667l273.066666 273.066667v614.4c0 75.093333-61.44 136.533333-136.533333 136.533333H204.8c-75.093333 0-136.533333-61.44-136.533333-136.533333V136.533333C68.266667 61.44 129.706667 0 204.8 0z m464.213333 375.466667l-232.106666 61.44c-27.306667 13.653333-47.786667 34.133333-47.786667 61.44v218.453333s-20.48-13.653333-54.613333-6.826667c-47.786667 6.826667-95.573333 47.786667-95.573334 88.746667 0 40.96 47.786667 61.44 95.573334 54.613333 54.613333-6.826667 95.573333-40.96 95.573333-81.92V559.786667c0-13.653333 27.306667-27.306667 27.306667-27.306667L655.36 477.866667s20.48-6.826667 20.48 13.653333v170.666667s-20.48-13.653333-54.613333-6.826667c-54.613333 6.826667-95.573333 40.96-95.573334 81.92s47.786667 68.266667 95.573334 61.44 95.573333-40.96 95.573333-81.92V409.6c0-27.306667-27.306667-40.96-47.786667-34.133333z",fill:"#FFA621","p-id":"8758"},null,-1),c.createElementVNode("path",{d:"M682.666667 0l273.066666 273.066667h-204.8c-40.96 0-68.266667-27.306667-68.266666-68.266667V0z",fill:"#f5d37b","p-id":"8759"},null,-1)])])):n.value==="video"?(c.openBlock(),c.createElementBlock("svg",iu,[...e[7]||(e[7]=[c.createElementVNode("path",{d:"M204.8 0h477.866667l273.066666 273.066667v614.4c0 75.093333-61.44 136.533333-136.533333 136.533333H204.8c-75.093333 0-136.533333-61.44-136.533333-136.533333V136.533333C68.266667 61.44 129.706667 0 204.8 0z m307.2 853.333333c150.186667 0 273.066667-122.88 273.066667-273.066666s-122.88-273.066667-273.066667-273.066667-273.066667 122.88-273.066667 273.066667 122.88 273.066667 273.066667 273.066666z m0-68.266666c-116.053333 0-204.8-88.746667-204.8-204.8s88.746667-204.8 204.8-204.8 204.8 88.746667 204.8 204.8-88.746667 204.8-204.8 204.8zM614.4 600.746667l6.826667-6.826667c6.826667-13.653333 6.826667-27.306667-6.826667-34.133333L484.693333 471.04s-6.826667-6.826667-13.653333-6.826667c-13.653333 0-27.306667 13.653333-27.306667 27.306667v170.666667c0 6.826667 0 13.653333 6.826667 13.653333 6.826667 13.653333 27.306667 13.653333 40.96 6.826667L614.4 600.746667z",fill:"#FFA621","p-id":"8913"},null,-1),c.createElementVNode("path",{d:"M682.666667 0l273.066666 273.066667h-204.8c-40.96 0-68.266667-27.306667-68.266666-68.266667V0z",fill:"#f5d37b","p-id":"8914"},null,-1)])])):n.value==="excel"?(c.openBlock(),c.createElementBlock("svg",nu,[...e[8]||(e[8]=[c.createElementVNode("path",{d:"M192 0h448.170667l319.829333 320V896a128 128 0 0 1-128 128H192a128 128 0 0 1-128-128V128A128 128 0 0 1 192 0z",fill:"#00BD76","p-id":"4337"},null,-1),c.createElementVNode("path",{d:"M388.5056 631.261867H307.541333v54.852266h95.095467v33.8944H265.3184v-204.765866h136.977067v34.167466H307.5072v48.810667h80.9984v33.041067z m112.093867-45.397334l38.4-70.621866h48.503466l-59.630933 101.546666 61.201067 103.2192h-49.117867l-39.355733-71.714133-39.389867 71.68h-49.0496l61.166933-103.185067-59.630933-101.546666h48.503467l38.4 70.587733z m266.922666 65.9456c-0.648533 9.898667-3.037867 19.592533-7.0656 28.672-3.7888 8.533333-9.352533 16.1792-16.315733 22.4256-6.929067 6.2464-15.36 11.127467-25.258667 14.6432-9.864533 3.4816-21.128533 5.256533-33.792 5.256534-13.1072 0-24.917333-2.286933-35.362133-6.826667a72.260267 72.260267 0 0 1-26.555733-19.626667 89.019733 89.019733 0 0 1-16.725334-30.993066 133.597867 133.597867 0 0 1-5.870933-40.8576v-13.482667c0-15.121067 2.048-28.740267 6.0416-40.925867 4.061867-12.1856 9.728-22.528 17.1008-31.061333 7.338667-8.533333 16.4864-15.2576 26.794667-19.694933 10.478933-4.608 22.186667-6.894933 35.157333-6.894934 12.731733 0 24.029867 1.809067 33.792 5.393067 9.8304 3.618133 18.1248 8.635733 24.9856 15.0528 6.826667 6.485333 12.288 14.267733 16.042667 22.9376 3.822933 8.874667 6.2464 18.466133 7.304533 28.8768h-42.1888a63.829333 63.829333 0 0 0-3.1744-16.145067 31.744 31.744 0 0 0-7.099733-11.810133 29.354667 29.354667 0 0 0-11.946667-7.2704 55.944533 55.944533 0 0 0-17.749333-2.4576c-14.2336 0-24.849067 5.188267-31.812267 15.5648-6.997333 10.3424-10.478933 26.385067-10.478933 48.128v13.789867c0 10.581333 0.750933 19.899733 2.321066 27.8528 1.536 7.953067 3.959467 14.609067 7.304534 19.968a32.221867 32.221867 0 0 0 12.970666 12.014933c5.256533 2.696533 11.639467 4.027733 19.182934 4.027733 6.656 0 12.3904-0.750933 17.2032-2.2528a30.549333 30.549333 0 0 0 12.0832-6.826666 30.685867 30.685867 0 0 0 7.509333-11.4688c1.809067-4.573867 2.935467-9.898667 3.413333-16.042667h42.154667z",fill:"#FFFFFF",opacity:".9","p-id":"4338"},null,-1),c.createElementVNode("path",{d:"M640 0l320 320H768a128 128 0 0 1-128-128V0z",fill:"#19EA9C","p-id":"4339"},null,-1)])])):n.value==="exe"?(c.openBlock(),c.createElementBlock("svg",ru,[...e[9]||(e[9]=[c.createElementVNode("path",{d:"M145.6 0C100.8 0 64 36.8 64 81.6v860.8C64 987.2 100.8 1024 145.6 1024h732.8c44.8 0 81.6-36.8 81.6-81.6V324.8L657.6 0h-512z",fill:"#8199AF","p-id":"8002"},null,-1),c.createElementVNode("path",{d:"M960 326.4v16H755.2s-100.8-20.8-99.2-107.2c0 0 3.2 91.2 96 91.2h208z",fill:"#617F9B","p-id":"8003"},null,-1),c.createElementVNode("path",{d:"M657.6 0v233.6c0 25.6 17.6 92.8 97.6 92.8H960L657.6 0z",fill:"#FFFFFF",opacity:".5","p-id":"8004"},null,-1),c.createElementVNode("path",{d:"M344 862.4h-100.8c-9.6 0-17.6-8-17.6-17.6V688c0-9.6 8-17.6 17.6-17.6h100.8c4.8 0 9.6 4.8 9.6 11.2 0 6.4-4.8 9.6-9.6 9.6h-94.4v62.4h91.2c6.4 0 11.2 4.8 11.2 11.2 0 6.4-4.8 9.6-11.2 9.6h-91.2v67.2h94.4c4.8 0 9.6 4.8 9.6 9.6 0 6.4-4.8 11.2-9.6 11.2z m193.6 1.6c-4.8 0-8 0-9.6-3.2l-59.2-80-60.8 80c-1.6 3.2-4.8 3.2-8 3.2-6.4 0-11.2-4.8-11.2-11.2 0-1.6 0-4.8 1.6-6.4l62.4-81.6-57.6-78.4c-1.6-1.6-3.2-3.2-3.2-6.4 0-4.8 4.8-11.2 12.8-11.2 3.2 0 6.4 1.6 8 4.8l56 73.6 54.4-73.6c1.6-3.2 4.8-4.8 9.6-4.8s11.2 4.8 11.2 11.2c0 3.2 0 4.8-1.6 6.4l-57.6 76.8 60.8 83.2c1.6 1.6 3.2 4.8 3.2 6.4 0 6.4-6.4 11.2-11.2 11.2z m171.2-1.6h-99.2c-9.6 0-17.6-8-17.6-17.6V688c0-9.6 8-17.6 17.6-17.6h99.2c6.4 0 11.2 4.8 11.2 11.2 0 6.4-4.8 9.6-11.2 9.6h-92.8v62.4h91.2c6.4 0 11.2 4.8 11.2 11.2 0 6.4-4.8 9.6-11.2 9.6h-91.2v67.2h92.8c6.4 0 11.2 4.8 11.2 9.6 0 6.4-4.8 11.2-11.2 11.2z",fill:"#FFFFFF","p-id":"8005"},null,-1)])])):n.value==="json"?(c.openBlock(),c.createElementBlock("svg",au,[...e[10]||(e[10]=[c.createElementVNode("path",{d:"M227.555556 28.444444h389.404444a19.911111 19.911111 0 0 1 14.734222 6.542223l271.132445 298.211555a28.444444 28.444444 0 0 1 7.395555 19.143111V938.666667a56.888889 56.888889 0 0 1-56.888889 56.888889H227.555556a56.888889 56.888889 0 0 1-56.888889-56.888889V85.333333a56.888889 56.888889 0 0 1 56.888889-56.888889z",fill:"#0DD59D","p-id":"2272"},null,-1),c.createElementVNode("path",{d:"M625.777778 30.492444a19.911111 19.911111 0 0 1 5.916444 4.465778l271.132445 298.24a28.444444 28.444444 0 0 1 5.176889 8.135111H682.666667a56.888889 56.888889 0 0 1-56.888889-56.888889V30.492444z",fill:"#FFFFFF","fill-opacity":".65","p-id":"2273"},null,-1),c.createElementVNode("path",{d:"M396.288 645.176889c0 5.461333-0.796444 10.865778-2.389333 16.156444-1.592889 5.319111-4.266667 10.069333-7.964445 14.222223-3.697778 4.181333-8.647111 7.509333-14.791111 10.012444a60.871111 60.871111 0 0 1-22.869333 3.754667c-15.160889 0-26.851556-3.982222-35.043556-11.946667-8.192-7.964444-12.288-19.683556-12.288-35.157333v-10.012445h21.617778v6.826667c0 4.721778 0.369778 9.045333 1.137778 12.970667a28.074667 28.074667 0 0 0 3.982222 10.24 18.773333 18.773333 0 0 0 7.964444 6.712888c3.413333 1.592889 7.765333 2.389333 13.084445 2.389334 9.870222 0 16.64-2.645333 20.366222-7.964445 3.697778-5.290667 5.575111-12.430222 5.575111-21.390222v-118.784h21.617778v121.969778z m44.145778 3.413333c0.142222 4.266667 1.137778 7.850667 2.958222 10.808889a20.593778 20.593778 0 0 0 7.168 7.054222c2.958222 1.763556 6.286222 3.015111 10.012444 3.754667 3.697778 0.768 7.537778 1.137778 11.491556 1.137778 3.043556 0 6.229333-0.227556 9.557333-0.682667 3.328-0.455111 6.4-1.28 9.216-2.503111a17.294222 17.294222 0 0 0 6.940445-5.347556 14.250667 14.250667 0 0 0 2.730666-8.988444 12.885333 12.885333 0 0 0-5.688888-11.377778c-3.783111-2.56-8.533333-4.664889-14.222223-6.257778a232.561778 232.561778 0 0 0-18.545777-4.323555 96.227556 96.227556 0 0 1-18.545778-5.461333 38.4 38.4 0 0 1-14.222222-9.898667c-3.783111-4.266667-5.688889-10.154667-5.688889-17.749333a28.16 28.16 0 0 1 3.982222-15.246223c2.645333-4.266667 6.058667-7.68 10.24-10.353777 4.181333-2.645333 8.874667-4.608 14.108444-5.916445 5.233778-1.28 10.439111-1.934222 15.587556-1.934222 6.684444 0 12.8 0.568889 18.432 1.706667 5.603556 1.137778 10.581333 3.128889 14.904889 5.916444 4.323556 2.816 7.765333 6.599111 10.353778 11.377778 2.56 4.778667 4.096 10.752 4.551111 17.863111h-19.342223a19.569778 19.569778 0 0 0-2.958222-9.443556 19.370667 19.370667 0 0 0-6.371555-6.030222 28.956444 28.956444 0 0 0-8.533334-3.299555 43.918222 43.918222 0 0 0-9.443555-1.024c-2.872889 0-5.802667 0.227556-8.760889 0.682666a29.496889 29.496889 0 0 0-8.078222 2.389334 16.270222 16.270222 0 0 0-5.916445 4.551111 11.463111 11.463111 0 0 0-2.275555 7.395555c0 3.356444 1.166222 6.115556 3.527111 8.305778a28.16 28.16 0 0 0 8.988444 5.461333c3.640889 1.422222 7.736889 2.673778 12.288 3.640889 4.551111 0.995556 9.102222 1.991111 13.653334 3.072 4.835556 1.080889 9.585778 2.360889 14.222222 3.868445 4.636444 1.536 8.732444 3.527111 12.288 6.030222s6.456889 5.660444 8.647111 9.443555a27.733333 27.733333 0 0 1 3.299555 14.108445c0 7.111111-1.479111 13.056-4.437333 17.749333a34.702222 34.702222 0 0 1-11.605333 11.377778 48.497778 48.497778 0 0 1-16.156445 6.030222c-5.973333 1.137778-11.946667 1.706667-17.863111 1.706667a82.773333 82.773333 0 0 1-18.659555-2.048 45.795556 45.795556 0 0 1-15.701334-6.712889 34.218667 34.218667 0 0 1-10.922666-12.288 42.581333 42.581333 0 0 1-4.551111-18.545778h19.342222z m116.053333-21.617778c0 7.111111 0.938667 13.482667 2.844445 19.000889 1.905778 5.546667 4.522667 10.183111 7.850666 13.880889a34.076444 34.076444 0 0 0 25.941334 11.491556 34.076444 34.076444 0 0 0 25.941333-11.491556c3.328-3.697778 5.973333-8.334222 7.850667-13.880889 1.905778-5.518222 2.844444-11.861333 2.844444-19.000889 0-7.111111-0.938667-13.454222-2.844444-19.000888a41.016889 41.016889 0 0 0-7.850667-13.994667 33.422222 33.422222 0 0 0-11.719111-8.647111 34.872889 34.872889 0 0 0-14.222222-2.958222c-5.006222 0-9.756444 0.995556-14.222223 2.958222-4.465778 1.991111-8.391111 4.835556-11.719111 8.647111-3.328 3.811556-5.973333 8.476444-7.850666 13.994667-1.905778 5.546667-2.844444 11.889778-2.844445 19.000888z m-20.48 0c0-8.647111 1.223111-16.725333 3.640889-24.234666a54.897778 54.897778 0 0 1 10.922667-19.569778c4.835556-5.518222 10.837333-9.898667 17.976889-13.084444 7.111111-3.185778 15.331556-4.778667 24.576-4.778667 9.386667 0 17.635556 1.592889 24.689777 4.778667 7.054222 3.185778 12.999111 7.566222 17.863111 13.084444 4.835556 5.546667 8.504889 12.060444 10.922667 19.569778 2.417778 7.509333 3.640889 15.587556 3.640889 24.234666 0 8.647111-1.223111 16.696889-3.640889 24.120889-2.417778 7.452444-6.058667 13.937778-10.922667 19.456-4.835556 5.546667-10.808889 9.870222-17.863111 12.970667-7.054222 3.128889-15.274667 4.664889-24.689777 4.664889-9.244444 0-17.436444-1.536-24.576-4.664889a50.261333 50.261333 0 0 1-17.976889-12.970667 55.068444 55.068444 0 0 1-10.922667-19.456 77.283556 77.283556 0 0 1-3.640889-24.120889z m136.988445-58.936888h18.204444v18.659555h0.455111c8.049778-14.250667 20.764444-21.390222 38.229333-21.390222 7.736889 0 14.193778 1.080889 19.342223 3.185778 5.148444 2.133333 9.329778 5.091556 12.515555 8.874666 3.185778 3.811556 5.404444 8.305778 6.712889 13.539556 1.28 5.233778 1.934222 11.036444 1.934222 17.408v77.368889h-19.342222v-79.644445c0-7.281778-2.133333-13.027556-6.371555-17.294222-4.266667-4.266667-10.097778-6.371556-17.521778-6.371555-5.916444 0-11.036444 0.910222-15.36 2.730666a28.814222 28.814222 0 0 0-10.808889 7.736889 33.336889 33.336889 0 0 0-6.485333 11.719111c-1.422222 4.494222-2.161778 9.386667-2.161778 14.677334v66.446222h-19.342222V568.035556z",fill:"#FFFFFF","p-id":"2274"},null,-1)])])):(c.openBlock(),c.createElementBlock("svg",ou,[...e[11]||(e[11]=[c.createElementVNode("path",{d:"M160 0h512l256 256v704c0 35.3472-28.6528 64-64 64H160c-35.3472 0-64-28.6528-64-64V64c0-35.3472 28.6528-64 64-64z",fill:"#029EF7","p-id":"7516"},null,-1),c.createElementVNode("path",{d:"M672 0l256 256h-192c-35.3472 0-64-28.6528-64-64V0z",fill:"#64b5ed","p-id":"7517"},null,-1),c.createElementVNode("path",{d:"M384 499.2c0-25.6 5.12-46.08 10.24-58.88 5.12-12.8 15.36-25.6 28.16-35.84 12.8-12.8 25.6-20.48 43.52-25.6 15.36-5.12 30.72-7.68 48.64-7.68 35.84 0 64 10.24 89.6 30.72C627.2 422.4 640 448 640 481.28c0 15.36-5.12 28.16-10.24 40.96s-17.92 28.16-38.4 46.08-28.16 30.72-35.84 38.4c-7.68 7.68-10.24 17.92-15.36 28.16-5.12 10.24-2.56 17.92-2.56 43.52h-51.2c0-25.6 2.56-38.4 5.12-51.2s7.68-23.04 15.36-33.28 15.36-23.04 33.28-40.96c17.92-17.92 30.72-30.72 35.84-38.4 5.12-7.68 10.24-20.48 10.24-38.4s-7.68-30.72-20.48-43.52-30.72-20.48-53.76-20.48c-51.2 0-76.8 35.84-76.8 87.04h-51.2z m153.6 281.6h-51.2v-51.2h51.2v51.2z",fill:"#FFFFFF","p-id":"7518"},null,-1)])]))}}),Jr=Ee(su);/*! Element Plus Icons Vue v2.3.1 */var lu=c.defineComponent({name:"ArrowLeft",__name:"arrow-left",setup(a){return(o,n)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z"})]))}}),uu=lu,cu=c.defineComponent({name:"ArrowRight",__name:"arrow-right",setup(a){return(o,n)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"})]))}}),fu=cu,hu=c.defineComponent({name:"Close",__name:"close",setup(a){return(o,n)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.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"})]))}}),Vs=hu,du=c.defineComponent({name:"FullScreen",__name:"full-screen",setup(a){return(o,n)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"m160 96.064 192 .192a32 32 0 0 1 0 64l-192-.192V352a32 32 0 0 1-64 0V96h64zm0 831.872V928H96V672a32 32 0 1 1 64 0v191.936l192-.192a32 32 0 1 1 0 64zM864 96.064V96h64v256a32 32 0 1 1-64 0V160.064l-192 .192a32 32 0 1 1 0-64l192-.192zm0 831.872-192-.192a32 32 0 0 1 0-64l192 .192V672a32 32 0 1 1 64 0v256h-64z"})]))}}),gu=du,pu=c.defineComponent({name:"RefreshLeft",__name:"refresh-left",setup(a){return(o,n)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"M289.088 296.704h92.992a32 32 0 0 1 0 64H232.96a32 32 0 0 1-32-32V179.712a32 32 0 0 1 64 0v50.56a384 384 0 0 1 643.84 282.88 384 384 0 0 1-383.936 384 384 384 0 0 1-384-384h64a320 320 0 1 0 640 0 320 320 0 0 0-555.712-216.448z"})]))}}),vu=pu,mu=c.defineComponent({name:"RefreshRight",__name:"refresh-right",setup(a){return(o,n)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"M784.512 230.272v-50.56a32 32 0 1 1 64 0v149.056a32 32 0 0 1-32 32H667.52a32 32 0 1 1 0-64h92.992A320 320 0 1 0 524.8 833.152a320 320 0 0 0 320-320h64a384 384 0 0 1-384 384 384 384 0 0 1-384-384 384 384 0 0 1 643.712-282.88z"})]))}}),yu=mu,_u=c.defineComponent({name:"ScaleToOriginal",__name:"scale-to-original",setup(a){return(o,n)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"M813.176 180.706a60.235 60.235 0 0 1 60.236 60.235v481.883a60.235 60.235 0 0 1-60.236 60.235H210.824a60.235 60.235 0 0 1-60.236-60.235V240.94a60.235 60.235 0 0 1 60.236-60.235h602.352zm0-60.235H210.824A120.47 120.47 0 0 0 90.353 240.94v481.883a120.47 120.47 0 0 0 120.47 120.47h602.353a120.47 120.47 0 0 0 120.471-120.47V240.94a120.47 120.47 0 0 0-120.47-120.47zm-120.47 180.705a30.118 30.118 0 0 0-30.118 30.118v301.177a30.118 30.118 0 0 0 60.236 0V331.294a30.118 30.118 0 0 0-30.118-30.118zm-361.412 0a30.118 30.118 0 0 0-30.118 30.118v301.177a30.118 30.118 0 1 0 60.236 0V331.294a30.118 30.118 0 0 0-30.118-30.118M512 361.412a30.118 30.118 0 0 0-30.118 30.117v30.118a30.118 30.118 0 0 0 60.236 0V391.53A30.118 30.118 0 0 0 512 361.412M512 512a30.118 30.118 0 0 0-30.118 30.118v30.117a30.118 30.118 0 0 0 60.236 0v-30.117A30.118 30.118 0 0 0 512 512"})]))}}),Cu=_u,ku=c.defineComponent({name:"ZoomIn",__name:"zoom-in",setup(a){return(o,n)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704m-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64z"})]))}}),bu=ku,wu=c.defineComponent({name:"ZoomOut",__name:"zoom-out",setup(a){return(o,n)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704M352 448h256a32 32 0 0 1 0 64H352a32 32 0 0 1 0-64"})]))}}),Tu=wu;const Ut=(a,o)=>{const n=a.__vccOpts||a;for(const[t,e]of o)n[t]=e;return n},Qt=(a,o=2)=>{if(a===void 0)return"";if(a===0)return"0 B";const n=["B","KB","MB","GB","TB"],t=Math.floor(Math.log(a)/Math.log(1024));let e=a/Math.pow(1024,t);return(e%1===0?e.toFixed(o||0):e.toFixed(o))+" "+n[t]},ut=(a,o)=>{if(!o)return"";const n=/(\/api\/server\/oss\/download\?fileUrl=)(.*)(\/api\/server\/oss\/download\?fileUrl=)/;return o.startsWith("http")?o.replace(n,"$1$2"):`${a||location.origin}${o}`.replace(n,"$1$2")},Qr=["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","webp","video","mp4","flv","tls"],Us=a=>{const o=c.inject("loadUrl"),n=c.computed(()=>a.loadUrl||a.fileUrl||(o==null?void 0:o.value)),t=c.inject("uploadUrl"),e=c.computed(()=>a.action||a.uploadUrl||(t==null?void 0:t.value)),i=c.inject("token"),r=c.computed(()=>a.token||(i==null?void 0:i.value)),s=c.inject("onlyofficeConfig"),l=c.computed(()=>a.onlyofficeConfig||(s==null?void 0:s.value)),u=c.inject("userInfo"),f=c.computed(()=>a.userInfo||(u==null?void 0:u.value)),h=[...Qr,...Qr.map(g=>g.toLocaleUpperCase())];return{cLoadUrl:n,cUploadUrl:e,cToken:r,cOnlyofficeConfig:l,cUserInfo:f,cOnlyofficePreviewType:h}},Eu=["onClick"],Su={class:"flex align-center",style:{width:"100%"}},xu={class:"fileName simple"},Iu={key:0,class:"size",style:{"padding-right":"20px","white-space":"nowrap"}},Pu=["onClick"],Au={class:"file-list"},Lu={class:"fileName simple"},Du={key:0,class:"size",style:{"padding-right":"20px","white-space":"nowrap"}},Ru=["onClick"],Ou={class:"text"},Nu={class:"fileName"},Mu={class:"size"},Fu=c.defineComponent({__name:"IkPreviewFile",props:{list:{type:Array,default:()=>[]},url:{required:!0,type:String,default:""},loadUrl:{type:String,default:""},field:{required:!0,type:Object,default:()=>({})},iconSize:{type:Number,default:40},showBg:{type:Boolean,default:!0},width:{type:[Number,String],default:"100%"},iconHoverShow:{type:Boolean,default:!1},isOnlyOfficePreview:{type:Boolean,default:!0},onlyOfficeAccept:{type:String,default:".pdf,.docx,.doc.ppt,.pptx,.xlsx,.xls,"},onlyofficeServer:{type:String,default:""},onlyOfficeConfig:{type:Object,default:()=>null},jwtToken:{type:String,default:""},simple:{type:Boolean,default:!1},showType:{type:String,default:"default"},showDownloadBtn:{type:Boolean,default:!0},showPreviewBtn:{type:Boolean,default:!0},showFileSize:{type:Boolean,default:!1},customDownload:{type:Boolean,default:!1}},emits:["handPreview","download","close"],setup(a,{emit:o}){const n=a,t=c.computed(()=>n.simple?"simple":n.showType),{cLoadUrl:e,cOnlyofficeConfig:i,cOnlyofficePreviewType:r}=Us(n),s=o,l=c.computed(()=>({name:"name",url:"url",suffix:"suffix",size:"size",...n.field})),u=c.ref({}),f=c.ref(!1),h=m=>{var b,k;u.value={...m,name:m.name,url:ut(e.value,m[l.value.url]||((k=(b=m==null?void 0:m.response)==null?void 0:b.data)==null?void 0:k.id)||(m==null?void 0:m.id))},n.isOnlyOfficePreview&&(f.value=!0),s("handPreview",u.value)},g=m=>{n.customDownload?s("download",m):he.ikFile.downloadFile(ut(e.value,m[l.value.url]||m.attachmentId||m.id),m[l.value.name]||m.attachmentName)},p=m=>{s("close",m)},v=c.computed(()=>he.paramType.isNumber(n.width)?`${n.width}px`:n.width),y=c.computed(()=>n.list.map(m=>{var k;const b=m[l.value.name]||m.attachmentName;return{...m,name:b,size:m[l.value.size]||(m==null?void 0:m.fileSize)||(m==null?void 0:m.attachmentSize),suffix:m[l.value.suffix]||(m==null?void 0:m.attachmentSuffix)||((k=b.split("."))==null?void 0:k.at(-1))}}));return(m,b)=>{var k,w,S;return c.openBlock(),c.createElementBlock(c.Fragment,null,[(k=a.list)!=null&&k.length?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[c.createCommentVNode(" 简单模式 "),t.value==="simple"?(c.openBlock(!0),c.createElementBlock(c.Fragment,{key:0},c.renderList(y.value,(E,P)=>(c.openBlock(),c.createElementBlock("div",{class:"iking-privew-annex simple",key:P,onClick:A=>h(E),style:c.normalizeStyle({width:v.value})},[c.createElementVNode("div",Su,[c.createElementVNode("div",xu,c.toDisplayString(E.name),1),a.showFileSize?(c.openBlock(),c.createElementBlock("div",Iu,c.toDisplayString(E.size?`(${c.unref(Qt)(E.size)})`:""),1)):c.createCommentVNode("v-if",!0)]),c.createElementVNode("div",{class:c.normalizeClass(["flex flex-center",{"hover-show":a.iconHoverShow}])},[a.showDownloadBtn?(c.openBlock(),c.createBlock(c.unref(Ce),{key:0,name:"iksvg_daochu",onClick:c.withModifiers(A=>g(E),["stop"]),size:20},null,8,["onClick"])):c.createCommentVNode("v-if",!0),c.unref(r).includes(E.suffix)&&a.showPreviewBtn?(c.openBlock(),c.createBlock(c.unref(Ce),{key:1,name:"iksvg_yulan",size:20,onClick:c.withModifiers(A=>h(E),["stop"])},null,8,["onClick"])):c.createCommentVNode("v-if",!0),c.renderSlot(m.$slots,"operation",{data:{...E,findex:P}})],2)],12,Eu))),128)):t.value==="simple-icon"?(c.openBlock(),c.createElementBlock(c.Fragment,{key:1},[c.createCommentVNode(" 简单图标模式 "),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(y.value,(E,P)=>(c.openBlock(),c.createElementBlock("div",{class:"iking-privew-annex simple-icon",key:P,onClick:A=>h(E),style:c.normalizeStyle({width:v.value})},[c.createElementVNode("div",Au,[c.createCommentVNode(" 若为默认40,则simple-icon设置为20,否则设置为iconSize "),c.createVNode(c.unref(Jr),{file:E,style:c.normalizeStyle({height:`${a.iconSize===40?20:a.iconSize}px`,marginRight:"10px"}),class:"ikui-w-auto",fields:l.value},null,8,["file","style","fields"]),c.createElementVNode("div",{class:"flex",style:c.normalizeStyle({width:`calc(100% - ${a.iconSize+10}px)`})},[c.createElementVNode("p",Lu,c.toDisplayString(E.name),1),a.showFileSize?(c.openBlock(),c.createElementBlock("p",Du,c.toDisplayString(E.size?`(${c.unref(Qt)(E.size)})`:""),1)):c.createCommentVNode("v-if",!0)],4)]),a.showDownloadBtn?(c.openBlock(),c.createBlock(c.unref(Ce),{key:0,name:"iksvg_daochu",size:20,title:"下载",onClick:c.withModifiers(A=>g(E),["stop"])},null,8,["onClick"])):c.createCommentVNode("v-if",!0),c.unref(r).includes(E.suffix)&&a.showPreviewBtn?(c.openBlock(),c.createBlock(c.unref(Ce),{key:1,name:"iksvg_yulan",size:20,onClick:c.withModifiers(A=>h(E),["stop"]),title:"预览"},null,8,["onClick"])):c.createCommentVNode("v-if",!0)],12,Pu))),128))],64)):(c.openBlock(),c.createElementBlock(c.Fragment,{key:2},[c.createCommentVNode(" 默认模式 "),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(y.value,(E,P)=>{var A;return c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["iking-privew-annex",{"is-bg":a.showBg}]),key:P,style:c.normalizeStyle({marginBottom:P==((A=a.list)==null?void 0:A.length)-1?"0":"10px",width:v.value})},[c.createElementVNode("div",{class:"file-card",onClick:q=>h(E)},[c.createVNode(c.unref(Jr),{file:E,style:c.normalizeStyle({height:`${a.iconSize}px`}),class:"ikui-w-auto",fields:l.value},null,8,["file","style","fields"]),c.createElementVNode("div",Ou,[c.createElementVNode("div",Nu,c.toDisplayString(E.name),1),c.createElementVNode("div",Mu,c.toDisplayString(c.unref(Qt)(E.size)),1)]),c.createElementVNode("div",{class:c.normalizeClass(["flex flex-center",{"hover-show":a.iconHoverShow}])},[a.showDownloadBtn?(c.openBlock(),c.createBlock(c.unref(Ce),{key:0,name:"iksvg_daochu",onClick:c.withModifiers(q=>g(E),["stop"]),bg:a.showBg,size:a.showBg?"default":20,title:"下载"},null,8,["onClick","bg","size"])):c.createCommentVNode("v-if",!0),c.unref(r).includes(E.suffix)&&a.showPreviewBtn?(c.openBlock(),c.createBlock(c.unref(Ce),{key:1,name:"iksvg_yulan",bg:a.showBg,size:a.showBg?"default":20,title:"预览",onClick:c.withModifiers(q=>h(E),["stop"])},null,8,["bg","size","onClick"])):c.createCommentVNode("v-if",!0),c.renderSlot(m.$slots,"operation",{data:{...E,findex:P}})],2)],8,Ru)],6)}),128))],64))],64)):c.createCommentVNode("v-if",!0),c.createVNode(c.unref(zu),{onClose:p,show:f.value,"onUpdate:show":b[0]||(b[0]=E=>f.value=E),loadUrl:c.unref(e),file:u.value,onlyofficeServer:((w=c.unref(i))==null?void 0:w.serverUrl)||a.onlyofficeServer,onlyOfficeConfig:c.unref(i),onlyOfficeAccept:((S=c.unref(i))==null?void 0:S.accept)||a.onlyOfficeAccept},null,8,["show","loadUrl","file","onlyofficeServer","onlyOfficeConfig","onlyOfficeAccept"])],64)}}}),Bu=Ee(Fu),Hu={class:"head-logo"},Vu=["src"],Uu=c.defineComponent({__name:"IkPreviewFileDialog",props:c.mergeModels({file:{type:Object,default:()=>[]},loadUrl:{type:String,default:""},onlyOfficeAccept:{type:String,default:".pdf,.docx,.doc.ppt,.pptx,.xlsx,.xls,"},onlyofficeServer:{type:String,default:""},onlyOfficeConfig:{type:Object,default:()=>({})},field:{type:Object,default:()=>({})}},{show:{default:!1},showModifiers:{}}),emits:c.mergeModels(["close"],["update:show"]),setup(a,{emit:o}){const n=a,t=o,e=c.useModel(a,"show"),i=c.computed(()=>({name:"name",url:"url",suffix:"suffix",size:"fileSize",...n.field})),r=c.ref(null),s=c.ref(null),l=c.reactive({image:!1,office:!1,video:!1}),u=g=>{var p,v,y,m,b,k,w;try{const S=((p=g==null?void 0:g.response)==null?void 0:p.data)||g,E=S[i.value.url]||(S==null?void 0:S.id)||S.attachmentId,P=(v=S[i.value.suffix]||S.attachmentSuffix)==null?void 0:v.toLowerCase(),A=S[i.value.name]||(S==null?void 0:S.attachmentName)||(S==null?void 0:S.originName);if(s.value={...g,name:g[i.value.name],url:ut(n.loadUrl,E)},g&&gr(g,i.value)==="image"){l.image=!0;return}else if(g&&gr(g,i.value)==="video"){l.video=!0;return}else if((((y=n.onlyOfficeConfig)==null?void 0:y.accept)||n.onlyOfficeAccept).includes(P)){l.office=!0,r.value={...n.onlyOfficeConfig,editorConfig:{...((m=n.onlyOfficeConfig)==null?void 0:m.editorConfig)||{},customization:{...((k=(b=n.onlyOfficeConfig)==null?void 0:b.editorConfig)==null?void 0:k.customization)||{},review:{reviewDisplay:"final"}}},document:{key:(g==null?void 0:g.key)||he.buildUUID(),title:A,url:ut(n.loadUrl,E),fileType:P,...((w=n.onlyOfficeConfig)==null?void 0:w.document)||{}},documentType:$l(P)},console.log("config",r.value);return}}catch(S){console.info("预览错误: ",S)}};c.watch([e,n.file],([g,p])=>{g&&c.nextTick(()=>{u(n.file)})});const f=()=>{t("close",{file:(s==null?void 0:s.value)||null,config:(r==null?void 0:r.value)||null}),e.value=!1,l.office=!1,l.image=!1,l.video=!1,s.value=null},h=()=>{var g,p;(p=(g=r.value.editorConfig.customization)==null?void 0:g.logo)!=null&&p.link&&window.open(r.value.editorConfig.customization.logo.link)};return(g,p)=>{var v,y,m;return e.value?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[(v=s.value)!=null&&v.url&&l.image?(c.openBlock(),c.createBlock(c.unref(Gf),{key:0,onClose:p[0]||(p[0]=b=>f()),ref:"previewImgRef","url-list":[(y=s.value)==null?void 0:y.url],teleported:"","z-index":9999},null,8,["url-list"])):c.createCommentVNode("v-if",!0),c.createCommentVNode(' <IkPreviewVideo :file="fileData" v-model:show="modal.video" />'),c.createCommentVNode(" 文档类 "),c.createVNode(c.unref(tg),{modelValue:l.video,"onUpdate:modelValue":p[1]||(p[1]=b=>l.video=b),url:(m=s.value)==null?void 0:m.url,onClose:f},null,8,["modelValue","url"]),c.createVNode(c.unref(tc),{modelValue:l.office,"onUpdate:modelValue":p[2]||(p[2]=b=>l.office=b),draggable:"","no-footer":"","no-header":"",fullscreen:"","show-close-bg":"","destroy-on-close":"","close-on-click-modal":"","close-on-press-escape":!1,"append-to-body":"",onClose:f,"modal-class":"ik-only-preview-dialog"},{default:c.withCtx(()=>{var b,k,w;return[c.createElementVNode("div",Hu,[c.createElementVNode("img",{src:(k=(b=r.value.editorConfig.customization)==null?void 0:b.logo)==null?void 0:k.image,onClick:h,alt:""},null,8,Vu)]),c.createVNode(c.unref(Pf),{"config-options":r.value,"document-server-url":((w=a.onlyOfficeConfig)==null?void 0:w.serverUrl)||a.onlyofficeServer},null,8,["config-options","document-server-url"])]}),_:1},8,["modelValue"])],64)):c.createCommentVNode("v-if",!0)}}}),zu=Ee(Uu);function br(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}const ju={key:1,class:"h-[1em] w-[1em]","aria-hidden":"true"},qu=["xlink:href"],Gu=["src"],Wu={key:1,class:"h-[1em] w-[1em]","aria-hidden":"true"},Ku=["xlink:href"],$u=["src"],Yu=c.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:{default:"primary"},warning:{type:Boolean},width:{},iconClass:{default:""}},emits:["click","mouseenter","mouseleave","dblclick"],setup(a,{emit:o}){const n=a,t=c.computed(()=>n),e=c.computed(()=>{const{name:h}=t.value;return/^http?:\/\//.test(h)?"img":/i-[^:]+:[^:]+/.test(h)?"unocss":h!=null&&h.startsWith("iksig")?"iksig":h!=null&&h.includes(":")?"iconify":h!=null&&h.startsWith("iksvg")?"svg":"i"}),i=c.computed(()=>{const h=[];if(t.value.flip)switch(t.value.flip){case"horizontal":h.push("rotateY(180deg)");break;case"vertical":h.push("rotateX(180deg)");break;case"both":h.push("rotateX(180deg)"),h.push("rotateY(180deg)");break}t.value.rotate&&h.push(`rotate(${t.value.rotate%360}deg)`);const g={...t.value.color&&{color:t.value.color},...t.value.size&&{fontSize:typeof t.value.size=="number"?`${t.value.size}px`:t.value.size},...h.length&&{transform:h.join(" ")},padding:t.value.showBg||t.value.bg?t.value.padding:0,...t.value.color&&e.value!=="iksig"?{"--ik-icon-deep-color":t.value.color,"--ik-icon-shallow-color":t.value.colorLight||he.ikColor.setOpacity(t.value.color,t.value.opacity)}:{}};return t.value.width&&(g.width=g.height=typeof t.value.width=="number"?`${t.value.width}px`:t.value.width),g}),r=o,s=h=>{r("click",h)},l=h=>{r("mouseenter",h)},u=h=>{r("mouseleave",h)},f=h=>{r("dblclick",h)};return(h,g)=>{const p=c.resolveComponent("el-tooltip"),v=c.resolveComponent("el-button");return c.openBlock(),c.createElementBlock("i",{class:c.normalizeClass(["ik-svg-icon ik-icon relative h-[1em] w-[1em] inline-flex items-center justify-center fill-current leading-[1em] transition",{[a.iconClass]:!0,[a.name]:e.value==="unocss","show-bg":t.value.showBg||t.value.bg,default:t.value.size==="default",small:t.value.size==="small",big:t.value.size==="big",warning:t.value.warning||t.value.type==="warning",primary:t.value.primary||t.value.type==="primary",success:a.success||t.value.type==="success",error:t.value.error||t.value.type==="error",active:t.value.active,disabled:t.value.disabled}]),style:c.normalizeStyle(i.value),onClick:s,onDblclick:f,onMouseenter:l,onMouseleave:u},[t.value.tableIconType==="icon"||!t.value.tableIconType?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[t.value.notip||!t.value.title?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[e.value==="iksig"?(c.openBlock(),c.createElementBlock("i",{key:0,class:c.normalizeClass(`iksig ${t.value.name}`)},null,2)):e.value==="svg"?(c.openBlock(),c.createElementBlock("svg",ju,[c.createElementVNode("use",{"xlink:href":`#${t.value.name}`},null,8,qu)])):e.value==="img"?(c.openBlock(),c.createElementBlock("img",{key:2,src:t.value.name,class:"h-[1em] w-[1em]"},null,8,Gu)):(c.openBlock(),c.createElementBlock("i",{key:3,class:c.normalizeClass(t.value.name)},null,2))],64)):(c.openBlock(),c.createBlock(p,{key:1,content:t.value.title,placement:"top","popper-class":"ik-svg-icon-tooltip","hide-after":0},{default:c.withCtx(()=>[e.value==="iksig"?(c.openBlock(),c.createElementBlock("i",{key:0,class:c.normalizeClass(`iksig ${t.value.name}`)},null,2)):e.value==="svg"?(c.openBlock(),c.createElementBlock("svg",Wu,[c.createElementVNode("use",{"xlink:href":`#${t.value.name}`},null,8,Ku)])):e.value==="img"?(c.openBlock(),c.createElementBlock("img",{key:2,src:t.value.name,class:"h-[1em] w-[1em]"},null,8,$u)):(c.openBlock(),c.createElementBlock("i",{key:3,class:c.normalizeClass(t.value.name)},null,2))]),_:1},8,["content"]))],64)):(c.openBlock(),c.createBlock(v,c.mergeProps({key:1},h.$attrs,{type:["warning","error"].includes(t.value.type)?"danger":""}),{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(t.value.title),1)]),_:1},16,["type"]))],38)}}}),Xu=Ut(Yu,[["__scopeId","data-v-d5c74053"]]),Ce=Ee(Xu),Zu=c.defineComponent({__name:"CloseIcon",props:{showBg:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1}},setup(a){return(o,n)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass({"exit-main-page-maximize":a.showBg&&a.fullscreen})},[c.createVNode(c.unref(Ce),{name:"iksvg_guanbidanchuang",error:"",title:"关闭",size:20})],2))}}),Ju=Ut(Zu,[["__scopeId","data-v-22f2afe8"]]),Qu={class:"base-header"},ec=c.defineComponent({__name:"IkBaseDialog",props:c.mergeModels({title:{default:""},cancelText:{default:"取消"},confirmText:{default:"确认"},noHeader:{type:Boolean},noFooter:{type:Boolean},showCloseBg:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},{modelValue:{type:Boolean,default:!1,noHeader:!1,noFooter:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const o=a,n=c.useModel(a,"modelValue"),t=c.ref(o.fullscreen),e=c.defineComponent({setup(){return()=>c.h(Ju,{showBg:o.showCloseBg,fullscreen:o.fullscreen})}});return(i,r)=>{const s=c.resolveComponent("el-dialog");return c.openBlock(),c.createBlock(s,c.mergeProps({modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=l=>n.value=l),"align-center":""},i.$attrs,{"close-icon":c.unref(e),class:`ik-base-dialog ${a.noHeader?"no-header":""} ${a.noFooter?"no-footer":""}`,fullscreen:t.value,"modal-class":"baseDialog"}),c.createSlots({icon:c.withCtx(()=>[c.renderSlot(i.$slots,"title",{},()=>[c.createTextVNode(c.toDisplayString(a.title),1)])]),header:c.withCtx(()=>[c.createElementVNode("div",Qu,[c.renderSlot(i.$slots,"header",{},()=>[c.createTextVNode(c.toDisplayString(a.title),1)])]),c.createCommentVNode(` <IkSvgIcon v-if="$attrs.showClose" @click="handFullSize"\r
|
|
2
|
-
:name="isFull ? 'iksvg_tuichuquanping' : 'iksvg_quanping-daohang'"\r
|
|
3
|
-
class="absolute! top-[18px] right-[50px] icon-dialog-full" :title="isFull ? '退出全屏' : '全屏'" /> `)]),default:c.withCtx(()=>[c.renderSlot(i.$slots,"default")]),_:2},[i.$slots.footer?{name:"footer",fn:c.withCtx(()=>[c.renderSlot(i.$slots,"footer")]),key:"0"}:void 0]),1040,["modelValue","close-icon","class","fullscreen"])}}}),tc=Ee(ec);function ic(a,o,n,t){function e(i){return i instanceof n?i:new n(function(r){r(i)})}return new(n||(n=Promise))(function(i,r){function s(f){try{u(t.next(f))}catch(h){r(h)}}function l(f){try{u(t.throw(f))}catch(h){r(h)}}function u(f){f.done?i(f.value):e(f.value).then(s,l)}u((t=t.apply(a,[])).next())})}function nc(a,o){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,e,i,r=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return r.next=s(0),r.throw=s(1),r.return=s(2),typeof Symbol=="function"&&(r[Symbol.iterator]=function(){return this}),r;function s(u){return function(f){return l([u,f])}}function l(u){if(t)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(n=0)),n;)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 n.label++,{value:u[1],done:!1};case 5:n.label++,e=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){n.label=u[1];break}if(u[0]===6&&n.label<i[1]){n.label=i[1],i=u;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(u);break}i[2]&&n.ops.pop(),n.trys.pop();continue}u=o.call(a,n)}catch(f){u=[6,f],e=0}finally{t=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var rc=function(a,o){return ic(void 0,void 0,void 0,function(){return nc(this,function(n){return[2,new Promise(function(t,e){try{if(window.DocsAPI)return t(null);var i=document.getElementById(o);if(i)var r=setInterval(function(){var l=i.getAttribute("loading");if(!l){if(clearInterval(r),window.DocsAPI)return t(null);var u=ea(o,a,t,e);i.remove(),document.body.appendChild(u)}},500);else{var s=ea(o,a,t,e);document.body.appendChild(s)}}catch(l){console.error(l)}})]})})},ea=function(a,o,n,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"),n(null)},e.onerror=function(i){e.removeAttribute("loading"),t(i)},e.setAttribute("loading",""),e},Tt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ac(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var ei,ta;function oc(){if(ta)return ei;ta=1;function a(){this.__data__=[],this.size=0}return ei=a,ei}var ti,ia;function zs(){if(ia)return ti;ia=1;function a(o,n){return o===n||o!==o&&n!==n}return ti=a,ti}var ii,na;function zt(){if(na)return ii;na=1;var a=zs();function o(n,t){for(var e=n.length;e--;)if(a(n[e][0],t))return e;return-1}return ii=o,ii}var ni,ra;function sc(){if(ra)return ni;ra=1;var a=zt(),o=Array.prototype,n=o.splice;function t(e){var i=this.__data__,r=a(i,e);if(r<0)return!1;var s=i.length-1;return r==s?i.pop():n.call(i,r,1),--this.size,!0}return ni=t,ni}var ri,aa;function lc(){if(aa)return ri;aa=1;var a=zt();function o(n){var t=this.__data__,e=a(t,n);return e<0?void 0:t[e][1]}return ri=o,ri}var ai,oa;function uc(){if(oa)return ai;oa=1;var a=zt();function o(n){return a(this.__data__,n)>-1}return ai=o,ai}var oi,sa;function cc(){if(sa)return oi;sa=1;var a=zt();function o(n,t){var e=this.__data__,i=a(e,n);return i<0?(++this.size,e.push([n,t])):e[i][1]=t,this}return oi=o,oi}var si,la;function jt(){if(la)return si;la=1;var a=oc(),o=sc(),n=lc(),t=uc(),e=cc();function i(r){var s=-1,l=r==null?0:r.length;for(this.clear();++s<l;){var u=r[s];this.set(u[0],u[1])}}return i.prototype.clear=a,i.prototype.delete=o,i.prototype.get=n,i.prototype.has=t,i.prototype.set=e,si=i,si}var li,ua;function fc(){if(ua)return li;ua=1;var a=jt();function o(){this.__data__=new a,this.size=0}return li=o,li}var ui,ca;function hc(){if(ca)return ui;ca=1;function a(o){var n=this.__data__,t=n.delete(o);return this.size=n.size,t}return ui=a,ui}var ci,fa;function dc(){if(fa)return ci;fa=1;function a(o){return this.__data__.get(o)}return ci=a,ci}var fi,ha;function gc(){if(ha)return fi;ha=1;function a(o){return this.__data__.has(o)}return fi=a,fi}var hi,da;function js(){if(da)return hi;da=1;var a=typeof Tt=="object"&&Tt&&Tt.Object===Object&&Tt;return hi=a,hi}var di,ga;function ye(){if(ga)return di;ga=1;var a=js(),o=typeof self=="object"&&self&&self.Object===Object&&self,n=a||o||Function("return this")();return di=n,di}var gi,pa;function wr(){if(pa)return gi;pa=1;var a=ye(),o=a.Symbol;return gi=o,gi}var pi,va;function pc(){if(va)return pi;va=1;var a=wr(),o=Object.prototype,n=o.hasOwnProperty,t=o.toString,e=a?a.toStringTag:void 0;function i(r){var s=n.call(r,e),l=r[e];try{r[e]=void 0;var u=!0}catch{}var f=t.call(r);return u&&(s?r[e]=l:delete r[e]),f}return pi=i,pi}var vi,ma;function vc(){if(ma)return vi;ma=1;var a=Object.prototype,o=a.toString;function n(t){return o.call(t)}return vi=n,vi}var mi,ya;function qt(){if(ya)return mi;ya=1;var a=wr(),o=pc(),n=vc(),t="[object Null]",e="[object Undefined]",i=a?a.toStringTag:void 0;function r(s){return s==null?s===void 0?e:t:i&&i in Object(s)?o(s):n(s)}return mi=r,mi}var yi,_a;function ft(){if(_a)return yi;_a=1;function a(o){var n=typeof o;return o!=null&&(n=="object"||n=="function")}return yi=a,yi}var _i,Ca;function qs(){if(Ca)return _i;Ca=1;var a=qt(),o=ft(),n="[object AsyncFunction]",t="[object Function]",e="[object GeneratorFunction]",i="[object Proxy]";function r(s){if(!o(s))return!1;var l=a(s);return l==t||l==e||l==n||l==i}return _i=r,_i}var Ci,ka;function mc(){if(ka)return Ci;ka=1;var a=ye(),o=a["__core-js_shared__"];return Ci=o,Ci}var ki,ba;function yc(){if(ba)return ki;ba=1;var a=mc(),o=(function(){var t=/[^.]+$/.exec(a&&a.keys&&a.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function n(t){return!!o&&o in t}return ki=n,ki}var bi,wa;function Gs(){if(wa)return bi;wa=1;var a=Function.prototype,o=a.toString;function n(t){if(t!=null){try{return o.call(t)}catch{}try{return t+""}catch{}}return""}return bi=n,bi}var wi,Ta;function _c(){if(Ta)return wi;Ta=1;var a=qs(),o=yc(),n=ft(),t=Gs(),e=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,r=Function.prototype,s=Object.prototype,l=r.toString,u=s.hasOwnProperty,f=RegExp("^"+l.call(u).replace(e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function h(g){if(!n(g)||o(g))return!1;var p=a(g)?f:i;return p.test(t(g))}return wi=h,wi}var Ti,Ea;function Cc(){if(Ea)return Ti;Ea=1;function a(o,n){return o==null?void 0:o[n]}return Ti=a,Ti}var Ei,Sa;function Ve(){if(Sa)return Ei;Sa=1;var a=_c(),o=Cc();function n(t,e){var i=o(t,e);return a(i)?i:void 0}return Ei=n,Ei}var Si,xa;function Tr(){if(xa)return Si;xa=1;var a=Ve(),o=ye(),n=a(o,"Map");return Si=n,Si}var xi,Ia;function Gt(){if(Ia)return xi;Ia=1;var a=Ve(),o=a(Object,"create");return xi=o,xi}var Ii,Pa;function kc(){if(Pa)return Ii;Pa=1;var a=Gt();function o(){this.__data__=a?a(null):{},this.size=0}return Ii=o,Ii}var Pi,Aa;function bc(){if(Aa)return Pi;Aa=1;function a(o){var n=this.has(o)&&delete this.__data__[o];return this.size-=n?1:0,n}return Pi=a,Pi}var Ai,La;function wc(){if(La)return Ai;La=1;var a=Gt(),o="__lodash_hash_undefined__",n=Object.prototype,t=n.hasOwnProperty;function e(i){var r=this.__data__;if(a){var s=r[i];return s===o?void 0:s}return t.call(r,i)?r[i]:void 0}return Ai=e,Ai}var Li,Da;function Tc(){if(Da)return Li;Da=1;var a=Gt(),o=Object.prototype,n=o.hasOwnProperty;function t(e){var i=this.__data__;return a?i[e]!==void 0:n.call(i,e)}return Li=t,Li}var Di,Ra;function Ec(){if(Ra)return Di;Ra=1;var a=Gt(),o="__lodash_hash_undefined__";function n(t,e){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=a&&e===void 0?o:e,this}return Di=n,Di}var Ri,Oa;function Sc(){if(Oa)return Ri;Oa=1;var a=kc(),o=bc(),n=wc(),t=Tc(),e=Ec();function i(r){var s=-1,l=r==null?0:r.length;for(this.clear();++s<l;){var u=r[s];this.set(u[0],u[1])}}return i.prototype.clear=a,i.prototype.delete=o,i.prototype.get=n,i.prototype.has=t,i.prototype.set=e,Ri=i,Ri}var Oi,Na;function xc(){if(Na)return Oi;Na=1;var a=Sc(),o=jt(),n=Tr();function t(){this.size=0,this.__data__={hash:new a,map:new(n||o),string:new a}}return Oi=t,Oi}var Ni,Ma;function Ic(){if(Ma)return Ni;Ma=1;function a(o){var n=typeof o;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?o!=="__proto__":o===null}return Ni=a,Ni}var Mi,Fa;function Wt(){if(Fa)return Mi;Fa=1;var a=Ic();function o(n,t){var e=n.__data__;return a(t)?e[typeof t=="string"?"string":"hash"]:e.map}return Mi=o,Mi}var Fi,Ba;function Pc(){if(Ba)return Fi;Ba=1;var a=Wt();function o(n){var t=a(this,n).delete(n);return this.size-=t?1:0,t}return Fi=o,Fi}var Bi,Ha;function Ac(){if(Ha)return Bi;Ha=1;var a=Wt();function o(n){return a(this,n).get(n)}return Bi=o,Bi}var Hi,Va;function Lc(){if(Va)return Hi;Va=1;var a=Wt();function o(n){return a(this,n).has(n)}return Hi=o,Hi}var Vi,Ua;function Dc(){if(Ua)return Vi;Ua=1;var a=Wt();function o(n,t){var e=a(this,n),i=e.size;return e.set(n,t),this.size+=e.size==i?0:1,this}return Vi=o,Vi}var Ui,za;function Rc(){if(za)return Ui;za=1;var a=xc(),o=Pc(),n=Ac(),t=Lc(),e=Dc();function i(r){var s=-1,l=r==null?0:r.length;for(this.clear();++s<l;){var u=r[s];this.set(u[0],u[1])}}return i.prototype.clear=a,i.prototype.delete=o,i.prototype.get=n,i.prototype.has=t,i.prototype.set=e,Ui=i,Ui}var zi,ja;function Oc(){if(ja)return zi;ja=1;var a=jt(),o=Tr(),n=Rc(),t=200;function e(i,r){var s=this.__data__;if(s instanceof a){var l=s.__data__;if(!o||l.length<t-1)return l.push([i,r]),this.size=++s.size,this;s=this.__data__=new n(l)}return s.set(i,r),this.size=s.size,this}return zi=e,zi}var ji,qa;function Nc(){if(qa)return ji;qa=1;var a=jt(),o=fc(),n=hc(),t=dc(),e=gc(),i=Oc();function r(s){var l=this.__data__=new a(s);this.size=l.size}return r.prototype.clear=o,r.prototype.delete=n,r.prototype.get=t,r.prototype.has=e,r.prototype.set=i,ji=r,ji}var qi,Ga;function Mc(){if(Ga)return qi;Ga=1;function a(o,n){for(var t=-1,e=o==null?0:o.length;++t<e&&n(o[t],t,o)!==!1;);return o}return qi=a,qi}var Gi,Wa;function Fc(){if(Wa)return Gi;Wa=1;var a=Ve(),o=(function(){try{var n=a(Object,"defineProperty");return n({},"",{}),n}catch{}})();return Gi=o,Gi}var Wi,Ka;function Ws(){if(Ka)return Wi;Ka=1;var a=Fc();function o(n,t,e){t=="__proto__"&&a?a(n,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):n[t]=e}return Wi=o,Wi}var Ki,$a;function Ks(){if($a)return Ki;$a=1;var a=Ws(),o=zs(),n=Object.prototype,t=n.hasOwnProperty;function e(i,r,s){var l=i[r];(!(t.call(i,r)&&o(l,s))||s===void 0&&!(r in i))&&a(i,r,s)}return Ki=e,Ki}var $i,Ya;function Kt(){if(Ya)return $i;Ya=1;var a=Ks(),o=Ws();function n(t,e,i,r){var s=!i;i||(i={});for(var l=-1,u=e.length;++l<u;){var f=e[l],h=r?r(i[f],t[f],f,i,t):void 0;h===void 0&&(h=t[f]),s?o(i,f,h):a(i,f,h)}return i}return $i=n,$i}var Yi,Xa;function Bc(){if(Xa)return Yi;Xa=1;function a(o,n){for(var t=-1,e=Array(o);++t<o;)e[t]=n(t);return e}return Yi=a,Yi}var Xi,Za;function ht(){if(Za)return Xi;Za=1;function a(o){return o!=null&&typeof o=="object"}return Xi=a,Xi}var Zi,Ja;function Hc(){if(Ja)return Zi;Ja=1;var a=qt(),o=ht(),n="[object Arguments]";function t(e){return o(e)&&a(e)==n}return Zi=t,Zi}var Ji,Qa;function Vc(){if(Qa)return Ji;Qa=1;var a=Hc(),o=ht(),n=Object.prototype,t=n.hasOwnProperty,e=n.propertyIsEnumerable,i=a((function(){return arguments})())?a:function(r){return o(r)&&t.call(r,"callee")&&!e.call(r,"callee")};return Ji=i,Ji}var Qi,eo;function Er(){if(eo)return Qi;eo=1;var a=Array.isArray;return Qi=a,Qi}var at={exports:{}},en,to;function Uc(){if(to)return en;to=1;function a(){return!1}return en=a,en}at.exports;var io;function $s(){return io||(io=1,(function(a,o){var n=ye(),t=Uc(),e=o&&!o.nodeType&&o,i=e&&!0&&a&&!a.nodeType&&a,r=i&&i.exports===e,s=r?n.Buffer:void 0,l=s?s.isBuffer:void 0,u=l||t;a.exports=u})(at,at.exports)),at.exports}var tn,no;function zc(){if(no)return tn;no=1;var a=9007199254740991,o=/^(?:0|[1-9]\d*)$/;function n(t,e){var i=typeof t;return e=e??a,!!e&&(i=="number"||i!="symbol"&&o.test(t))&&t>-1&&t%1==0&&t<e}return tn=n,tn}var nn,ro;function Ys(){if(ro)return nn;ro=1;var a=9007199254740991;function o(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=a}return nn=o,nn}var rn,ao;function jc(){if(ao)return rn;ao=1;var a=qt(),o=Ys(),n=ht(),t="[object Arguments]",e="[object Array]",i="[object Boolean]",r="[object Date]",s="[object Error]",l="[object Function]",u="[object Map]",f="[object Number]",h="[object Object]",g="[object RegExp]",p="[object Set]",v="[object String]",y="[object WeakMap]",m="[object ArrayBuffer]",b="[object DataView]",k="[object Float32Array]",w="[object Float64Array]",S="[object Int8Array]",E="[object Int16Array]",P="[object Int32Array]",A="[object Uint8Array]",q="[object Uint8ClampedArray]",H="[object Uint16Array]",N="[object Uint32Array]",L={};L[k]=L[w]=L[S]=L[E]=L[P]=L[A]=L[q]=L[H]=L[N]=!0,L[t]=L[e]=L[m]=L[i]=L[b]=L[r]=L[s]=L[l]=L[u]=L[f]=L[h]=L[g]=L[p]=L[v]=L[y]=!1;function Y(Z){return n(Z)&&o(Z.length)&&!!L[a(Z)]}return rn=Y,rn}var an,oo;function Sr(){if(oo)return an;oo=1;function a(o){return function(n){return o(n)}}return an=a,an}var ot={exports:{}};ot.exports;var so;function xr(){return so||(so=1,(function(a,o){var n=js(),t=o&&!o.nodeType&&o,e=t&&!0&&a&&!a.nodeType&&a,i=e&&e.exports===t,r=i&&n.process,s=(function(){try{var l=e&&e.require&&e.require("util").types;return l||r&&r.binding&&r.binding("util")}catch{}})();a.exports=s})(ot,ot.exports)),ot.exports}var on,lo;function qc(){if(lo)return on;lo=1;var a=jc(),o=Sr(),n=xr(),t=n&&n.isTypedArray,e=t?o(t):a;return on=e,on}var sn,uo;function Xs(){if(uo)return sn;uo=1;var a=Bc(),o=Vc(),n=Er(),t=$s(),e=zc(),i=qc(),r=Object.prototype,s=r.hasOwnProperty;function l(u,f){var h=n(u),g=!h&&o(u),p=!h&&!g&&t(u),v=!h&&!g&&!p&&i(u),y=h||g||p||v,m=y?a(u.length,String):[],b=m.length;for(var k in u)(f||s.call(u,k))&&!(y&&(k=="length"||p&&(k=="offset"||k=="parent")||v&&(k=="buffer"||k=="byteLength"||k=="byteOffset")||e(k,b)))&&m.push(k);return m}return sn=l,sn}var ln,co;function Ir(){if(co)return ln;co=1;var a=Object.prototype;function o(n){var t=n&&n.constructor,e=typeof t=="function"&&t.prototype||a;return n===e}return ln=o,ln}var un,fo;function Zs(){if(fo)return un;fo=1;function a(o,n){return function(t){return o(n(t))}}return un=a,un}var cn,ho;function Gc(){if(ho)return cn;ho=1;var a=Zs(),o=a(Object.keys,Object);return cn=o,cn}var fn,go;function Wc(){if(go)return fn;go=1;var a=Ir(),o=Gc(),n=Object.prototype,t=n.hasOwnProperty;function e(i){if(!a(i))return o(i);var r=[];for(var s in Object(i))t.call(i,s)&&s!="constructor"&&r.push(s);return r}return fn=e,fn}var hn,po;function Js(){if(po)return hn;po=1;var a=qs(),o=Ys();function n(t){return t!=null&&o(t.length)&&!a(t)}return hn=n,hn}var dn,vo;function Pr(){if(vo)return dn;vo=1;var a=Xs(),o=Wc(),n=Js();function t(e){return n(e)?a(e):o(e)}return dn=t,dn}var gn,mo;function Kc(){if(mo)return gn;mo=1;var a=Kt(),o=Pr();function n(t,e){return t&&a(e,o(e),t)}return gn=n,gn}var pn,yo;function $c(){if(yo)return pn;yo=1;function a(o){var n=[];if(o!=null)for(var t in Object(o))n.push(t);return n}return pn=a,pn}var vn,_o;function Yc(){if(_o)return vn;_o=1;var a=ft(),o=Ir(),n=$c(),t=Object.prototype,e=t.hasOwnProperty;function i(r){if(!a(r))return n(r);var s=o(r),l=[];for(var u in r)u=="constructor"&&(s||!e.call(r,u))||l.push(u);return l}return vn=i,vn}var mn,Co;function Ar(){if(Co)return mn;Co=1;var a=Xs(),o=Yc(),n=Js();function t(e){return n(e)?a(e,!0):o(e)}return mn=t,mn}var yn,ko;function Xc(){if(ko)return yn;ko=1;var a=Kt(),o=Ar();function n(t,e){return t&&a(e,o(e),t)}return yn=n,yn}var st={exports:{}};st.exports;var bo;function Zc(){return bo||(bo=1,(function(a,o){var n=ye(),t=o&&!o.nodeType&&o,e=t&&!0&&a&&!a.nodeType&&a,i=e&&e.exports===t,r=i?n.Buffer:void 0,s=r?r.allocUnsafe:void 0;function l(u,f){if(f)return u.slice();var h=u.length,g=s?s(h):new u.constructor(h);return u.copy(g),g}a.exports=l})(st,st.exports)),st.exports}var _n,wo;function Jc(){if(wo)return _n;wo=1;function a(o,n){var t=-1,e=o.length;for(n||(n=Array(e));++t<e;)n[t]=o[t];return n}return _n=a,_n}var Cn,To;function Qc(){if(To)return Cn;To=1;function a(o,n){for(var t=-1,e=o==null?0:o.length,i=0,r=[];++t<e;){var s=o[t];n(s,t,o)&&(r[i++]=s)}return r}return Cn=a,Cn}var kn,Eo;function Qs(){if(Eo)return kn;Eo=1;function a(){return[]}return kn=a,kn}var bn,So;function Lr(){if(So)return bn;So=1;var a=Qc(),o=Qs(),n=Object.prototype,t=n.propertyIsEnumerable,e=Object.getOwnPropertySymbols,i=e?function(r){return r==null?[]:(r=Object(r),a(e(r),function(s){return t.call(r,s)}))}:o;return bn=i,bn}var wn,xo;function ef(){if(xo)return wn;xo=1;var a=Kt(),o=Lr();function n(t,e){return a(t,o(t),e)}return wn=n,wn}var Tn,Io;function el(){if(Io)return Tn;Io=1;function a(o,n){for(var t=-1,e=n.length,i=o.length;++t<e;)o[i+t]=n[t];return o}return Tn=a,Tn}var En,Po;function tl(){if(Po)return En;Po=1;var a=Zs(),o=a(Object.getPrototypeOf,Object);return En=o,En}var Sn,Ao;function il(){if(Ao)return Sn;Ao=1;var a=el(),o=tl(),n=Lr(),t=Qs(),e=Object.getOwnPropertySymbols,i=e?function(r){for(var s=[];r;)a(s,n(r)),r=o(r);return s}:t;return Sn=i,Sn}var xn,Lo;function tf(){if(Lo)return xn;Lo=1;var a=Kt(),o=il();function n(t,e){return a(t,o(t),e)}return xn=n,xn}var In,Do;function nl(){if(Do)return In;Do=1;var a=el(),o=Er();function n(t,e,i){var r=e(t);return o(t)?r:a(r,i(t))}return In=n,In}var Pn,Ro;function nf(){if(Ro)return Pn;Ro=1;var a=nl(),o=Lr(),n=Pr();function t(e){return a(e,n,o)}return Pn=t,Pn}var An,Oo;function rf(){if(Oo)return An;Oo=1;var a=nl(),o=il(),n=Ar();function t(e){return a(e,n,o)}return An=t,An}var Ln,No;function af(){if(No)return Ln;No=1;var a=Ve(),o=ye(),n=a(o,"DataView");return Ln=n,Ln}var Dn,Mo;function of(){if(Mo)return Dn;Mo=1;var a=Ve(),o=ye(),n=a(o,"Promise");return Dn=n,Dn}var Rn,Fo;function sf(){if(Fo)return Rn;Fo=1;var a=Ve(),o=ye(),n=a(o,"Set");return Rn=n,Rn}var On,Bo;function lf(){if(Bo)return On;Bo=1;var a=Ve(),o=ye(),n=a(o,"WeakMap");return On=n,On}var Nn,Ho;function Dr(){if(Ho)return Nn;Ho=1;var a=af(),o=Tr(),n=of(),t=sf(),e=lf(),i=qt(),r=Gs(),s="[object Map]",l="[object Object]",u="[object Promise]",f="[object Set]",h="[object WeakMap]",g="[object DataView]",p=r(a),v=r(o),y=r(n),m=r(t),b=r(e),k=i;return(a&&k(new a(new ArrayBuffer(1)))!=g||o&&k(new o)!=s||n&&k(n.resolve())!=u||t&&k(new t)!=f||e&&k(new e)!=h)&&(k=function(w){var S=i(w),E=S==l?w.constructor:void 0,P=E?r(E):"";if(P)switch(P){case p:return g;case v:return s;case y:return u;case m:return f;case b:return h}return S}),Nn=k,Nn}var Mn,Vo;function uf(){if(Vo)return Mn;Vo=1;var a=Object.prototype,o=a.hasOwnProperty;function n(t){var e=t.length,i=new t.constructor(e);return e&&typeof t[0]=="string"&&o.call(t,"index")&&(i.index=t.index,i.input=t.input),i}return Mn=n,Mn}var Fn,Uo;function cf(){if(Uo)return Fn;Uo=1;var a=ye(),o=a.Uint8Array;return Fn=o,Fn}var Bn,zo;function Rr(){if(zo)return Bn;zo=1;var a=cf();function o(n){var t=new n.constructor(n.byteLength);return new a(t).set(new a(n)),t}return Bn=o,Bn}var Hn,jo;function ff(){if(jo)return Hn;jo=1;var a=Rr();function o(n,t){var e=t?a(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.byteLength)}return Hn=o,Hn}var Vn,qo;function hf(){if(qo)return Vn;qo=1;var a=/\w*$/;function o(n){var t=new n.constructor(n.source,a.exec(n));return t.lastIndex=n.lastIndex,t}return Vn=o,Vn}var Un,Go;function df(){if(Go)return Un;Go=1;var a=wr(),o=a?a.prototype:void 0,n=o?o.valueOf:void 0;function t(e){return n?Object(n.call(e)):{}}return Un=t,Un}var zn,Wo;function gf(){if(Wo)return zn;Wo=1;var a=Rr();function o(n,t){var e=t?a(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.length)}return zn=o,zn}var jn,Ko;function pf(){if(Ko)return jn;Ko=1;var a=Rr(),o=ff(),n=hf(),t=df(),e=gf(),i="[object Boolean]",r="[object Date]",s="[object Map]",l="[object Number]",u="[object RegExp]",f="[object Set]",h="[object String]",g="[object Symbol]",p="[object ArrayBuffer]",v="[object DataView]",y="[object Float32Array]",m="[object Float64Array]",b="[object Int8Array]",k="[object Int16Array]",w="[object Int32Array]",S="[object Uint8Array]",E="[object Uint8ClampedArray]",P="[object Uint16Array]",A="[object Uint32Array]";function q(H,N,L){var Y=H.constructor;switch(N){case p:return a(H);case i:case r:return new Y(+H);case v:return o(H,L);case y:case m:case b:case k:case w:case S:case E:case P:case A:return e(H,L);case s:return new Y;case l:case h:return new Y(H);case u:return n(H);case f:return new Y;case g:return t(H)}}return jn=q,jn}var qn,$o;function vf(){if($o)return qn;$o=1;var a=ft(),o=Object.create,n=(function(){function t(){}return function(e){if(!a(e))return{};if(o)return o(e);t.prototype=e;var i=new t;return t.prototype=void 0,i}})();return qn=n,qn}var Gn,Yo;function mf(){if(Yo)return Gn;Yo=1;var a=vf(),o=tl(),n=Ir();function t(e){return typeof e.constructor=="function"&&!n(e)?a(o(e)):{}}return Gn=t,Gn}var Wn,Xo;function yf(){if(Xo)return Wn;Xo=1;var a=Dr(),o=ht(),n="[object Map]";function t(e){return o(e)&&a(e)==n}return Wn=t,Wn}var Kn,Zo;function _f(){if(Zo)return Kn;Zo=1;var a=yf(),o=Sr(),n=xr(),t=n&&n.isMap,e=t?o(t):a;return Kn=e,Kn}var $n,Jo;function Cf(){if(Jo)return $n;Jo=1;var a=Dr(),o=ht(),n="[object Set]";function t(e){return o(e)&&a(e)==n}return $n=t,$n}var Yn,Qo;function kf(){if(Qo)return Yn;Qo=1;var a=Cf(),o=Sr(),n=xr(),t=n&&n.isSet,e=t?o(t):a;return Yn=e,Yn}var Xn,es;function bf(){if(es)return Xn;es=1;var a=Nc(),o=Mc(),n=Ks(),t=Kc(),e=Xc(),i=Zc(),r=Jc(),s=ef(),l=tf(),u=nf(),f=rf(),h=Dr(),g=uf(),p=pf(),v=mf(),y=Er(),m=$s(),b=_f(),k=ft(),w=kf(),S=Pr(),E=Ar(),P=1,A=2,q=4,H="[object Arguments]",N="[object Array]",L="[object Boolean]",Y="[object Date]",Z="[object Error]",ue="[object Function]",pt="[object GeneratorFunction]",vt="[object Map]",tt="[object Number]",it="[object Object]",mt="[object RegExp]",_e="[object Set]",M="[object String]",z="[object Symbol]",$="[object WeakMap]",ae="[object ArrayBuffer]",ce="[object DataView]",fe="[object Float32Array]",ge="[object Float64Array]",Me="[object Int8Array]",yt="[object Int16Array]",_t="[object Int32Array]",nt="[object Uint8Array]",Ul="[object Uint8ClampedArray]",zl="[object Uint16Array]",jl="[object Uint32Array]",W={};W[H]=W[N]=W[ae]=W[ce]=W[L]=W[Y]=W[fe]=W[ge]=W[Me]=W[yt]=W[_t]=W[vt]=W[tt]=W[it]=W[mt]=W[_e]=W[M]=W[z]=W[nt]=W[Ul]=W[zl]=W[jl]=!0,W[Z]=W[ue]=W[$]=!1;function Ct(G,qe,Ge,ql,kt,xe){var ne,bt=qe&P,wt=qe&A,Gl=qe&q;if(Ge&&(ne=kt?Ge(G,ql,kt,xe):Ge(G)),ne!==void 0)return ne;if(!k(G))return G;var Kr=y(G);if(Kr){if(ne=g(G),!bt)return r(G,ne)}else{var We=h(G),$r=We==ue||We==pt;if(m(G))return i(G,bt);if(We==it||We==H||$r&&!kt){if(ne=wt||$r?{}:v(G),!bt)return wt?l(G,e(ne,G)):s(G,t(ne,G))}else{if(!W[We])return kt?G:{};ne=p(G,We,bt)}}xe||(xe=new a);var Yr=xe.get(G);if(Yr)return Yr;xe.set(G,ne),w(G)?G.forEach(function(Ie){ne.add(Ct(Ie,qe,Ge,Ie,G,xe))}):b(G)&&G.forEach(function(Ie,Fe){ne.set(Fe,Ct(Ie,qe,Ge,Fe,G,xe))});var Wl=Gl?wt?f:u:wt?E:S,Xr=Kr?void 0:Wl(G);return o(Xr||G,function(Ie,Fe){Xr&&(Fe=Ie,Ie=G[Fe]),n(ne,Fe,Ct(Ie,qe,Ge,Fe,G,xe))}),ne}return Xn=Ct,Xn}var Zn,ts;function wf(){if(ts)return Zn;ts=1;var a=bf(),o=1,n=4;function t(e){return a(e,o|n)}return Zn=t,Zn}var Tf=wf(),Ef=ac(Tf),Or=c.defineComponent({name:"DocumentEditor",props:{id:{type:String,required:!0},documentServerUrl:{type:String,required:!0},shardkey:{type:[String,Boolean],default:!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,events_onRequestUsers:Function},mounted:function(){var a=this,o,n=this.documentServerUrl;n.endsWith("/")||(n+="/");var t="".concat(n,"web-apps/apps/api/documents/api.js");this.shardkey&&(typeof this.shardkey=="boolean"?t+="?shardkey=".concat((o=this.config.document)===null||o===void 0?void 0:o.key):t+="?shardkey=".concat(this.shardkey)),rc(t,"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 n=this.id||"";if(window.DocsAPI||this.onError(-3),!((a=window==null?void 0:window.DocEditor)===null||a===void 0)&&a.instances[n]){console.log("Skip loading. Instance already exists",n);return}!((o=window==null?void 0:window.DocEditor)===null||o===void 0)&&o.instances||(window.DocEditor={instances:{}});var t=Ef(this.config),e={documentType:this.documentType,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,onRequestUsers:this.events_onRequestUsers},height:this.height,type:this.type,width:this.width},i=this.getDocument(),r=this.getEditorConfig();i!==null&&(e.document=i),r!==null&&(e.editorConfig=r);var s=Object.assign(e,t||{}),l=window.DocsAPI.DocEditor(n,s);window.DocEditor.instances[n]=l}catch(u){console.error(u),this.onError(-1)}},getDocument:function(){var a=null;return this.document_fileType&&(a=a||{},a.fileType=this.document_fileType),this.document_title&&(a=a||{},a.document_title=this.document_title),a},getEditorConfig:function(){var a=null;return this.editorConfig_lang&&(a=a||{},a.lang=this.editorConfig_lang),a},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 Sf=["id"];function xf(a,o,n,t,e,i){return c.openBlock(),c.createElementBlock("div",{id:a.id},null,8,Sf)}Or.render=xf;Or.__file="src/components/DocumentEditor.vue";const If=c.defineComponent({__name:"IkOnlyOffice",props:{documentServerUrl:{type:String,default:""},configOptions:{type:Object,default:()=>{}},officeHeight:{type:String,default:"100%"}},setup(a){const o=a,n=c.ref({width:"100%",height:"100%",...o.configOptions||{},...o.configOptions}),t=()=>{console.info("文档加载完成",n.value)};return(e,i)=>(c.openBlock(),c.createElementBlock("div",{style:c.normalizeStyle({height:o.officeHeight})},[c.createVNode(c.unref(Or),{id:`${new Date().getTime()}`,ref:"editorRef","document-server-url":a.documentServerUrl,config:n.value,events_onDocumentReady:t},null,8,["id","document-server-url","config"])],4))}}),Pf=Ee(If);var is;const rl=typeof window<"u",Af=a=>typeof a=="string",Lf=()=>{};rl&&((is=window==null?void 0:window.navigator)!=null&&is.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function al(a){return typeof a=="function"?a():c.unref(a)}function Df(a){return a}function Rf(a){return c.getCurrentScope()?(c.onScopeDispose(a),!0):!1}function Of(a){var o;const n=al(a);return(o=n==null?void 0:n.$el)!=null?o:n}const Nf=rl?window:void 0;function Et(...a){let o,n,t,e;if(Af(a[0])||Array.isArray(a[0])?([n,t,e]=a,o=Nf):[o,n,t,e]=a,!o)return Lf;Array.isArray(n)||(n=[n]),Array.isArray(t)||(t=[t]);const i=[],r=()=>{i.forEach(f=>f()),i.length=0},s=(f,h,g,p)=>(f.addEventListener(h,g,p),()=>f.removeEventListener(h,g,p)),l=c.watch(()=>[Of(o),al(e)],([f,h])=>{r(),f&&i.push(...n.flatMap(g=>t.map(p=>s(f,g,p,h))))},{immediate:!0,flush:"post"}),u=()=>{l(),r()};return Rf(u),u}const ns=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},rs="__vueuse_ssr_handlers__";ns[rs]=ns[rs]||{};var as;(function(a){a.UP="UP",a.RIGHT="RIGHT",a.DOWN="DOWN",a.LEFT="LEFT",a.NONE="NONE"})(as||(as={}));var Mf=Object.defineProperty,os=Object.getOwnPropertySymbols,Ff=Object.prototype.hasOwnProperty,Bf=Object.prototype.propertyIsEnumerable,ss=(a,o,n)=>o in a?Mf(a,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):a[o]=n,Hf=(a,o)=>{for(var n in o||(o={}))Ff.call(o,n)&&ss(a,n,o[n]);if(os)for(var n of os(o))Bf.call(o,n)&&ss(a,n,o[n]);return a};const Vf={easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]};Hf({linear:Df},Vf);const Uf={urlList:{type:Array,default:()=>[]},zIndex:{type:Number},initialIndex:{type:Number,default:0},infinite:{type:Boolean,default:!0},hideOnClickModal:Boolean,teleported:Boolean,closeOnPressEscape:{type:Boolean,default:!0},zoomRate:{type:Number,default:1.2},minScale:{type:Number,default:.2},maxScale:{type:Number,default:7},crossorigin:{type:["anonymous","use-credentials",""]}},zf={close:()=>!0,switch:a=>he.paramType.isNumber(a),rotate:a=>he.paramType.isNumber(a)},jf=["src","crossorigin"],qf=c.defineComponent({name:"ElImageViewer",__name:"IkImageViewer",props:Uf,emits:zf,setup(a,{expose:o,emit:n}){const t=M=>Object.keys(M),e={CONTAIN:{name:"contain",icon:c.markRaw(gu)},ORIGINAL:{name:"original",icon:c.markRaw(Cu)}},i=a,r=n,{t:s}=J.useLocale(),l=J.useNamespace("image-viewer"),{nextZIndex:u}=J.useZIndex(),f=c.ref(),h=c.ref([]),g=c.effectScope(),p=c.ref(!0),v=c.ref(i.initialIndex),y=c.shallowRef(e.CONTAIN),m=c.ref({scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}),b=c.ref(i.zIndex??u()),k=c.computed(()=>{const{urlList:M}=i;return M.length<=1}),w=c.computed(()=>v.value===0),S=c.computed(()=>v.value===i.urlList.length-1),E=c.computed(()=>i.urlList[v.value]),P=c.computed(()=>[l.e("btn"),l.e("prev"),l.is("disabled",!i.infinite&&w.value)]),A=c.computed(()=>[l.e("btn"),l.e("next"),l.is("disabled",!i.infinite&&S.value)]),q=c.computed(()=>{const{scale:M,deg:z,offsetX:$,offsetY:ae,enableTransition:ce}=m.value;let fe=$/M,ge=ae/M;const Me=z*Math.PI/180,yt=Math.cos(Me),_t=Math.sin(Me);fe=fe*yt+ge*_t,ge=ge*yt-$/M*_t;const nt={transform:`scale(${M}) rotate(${z}deg) translate(${fe}px, ${ge}px)`,transition:ce?"transform .3s":""};return y.value.name===e.CONTAIN.name&&(nt.maxWidth=nt.maxHeight="100%"),nt});function H(){L(),r("close")}function N(){const M=he._.throttle($=>{switch($.code){case J.EVENT_CODE.esc:i.closeOnPressEscape&&H();break;case J.EVENT_CODE.space:vt();break;case J.EVENT_CODE.left:it();break;case J.EVENT_CODE.up:_e("zoomIn");break;case J.EVENT_CODE.right:mt();break;case J.EVENT_CODE.down:_e("zoomOut");break}}),z=he._.throttle($=>{const ae=$.deltaY||$.deltaX;_e(ae<0?"zoomIn":"zoomOut",{zoomRate:i.zoomRate,enableTransition:!1})});g.run(()=>{Et(document,"keydown",M),Et(document,"wheel",z)})}function L(){g.stop()}function Y(){p.value=!1}function Z(M){p.value=!1,M.target.alt=s("el.image.error")}function ue(M){if(p.value||M.button!==0||!f.value)return;m.value.enableTransition=!1;const{offsetX:z,offsetY:$}=m.value,ae=M.pageX,ce=M.pageY,fe=he._.throttle(Me=>{m.value={...m.value,offsetX:z+Me.pageX-ae,offsetY:$+Me.pageY-ce}}),ge=Et(document,"mousemove",fe);Et(document,"mouseup",()=>{ge()}),M.preventDefault()}function pt(){m.value={scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}}function vt(){if(p.value)return;const M=t(e),z=Object.values(e),$=y.value.name,ce=((z==null?void 0:z.findIndex(fe=>fe.name===$))+1)%M.length;y.value=e[M[ce]],pt()}function tt(M){const z=i.urlList.length;v.value=(M+z)%z}function it(){w.value&&!i.infinite||tt(v.value-1)}function mt(){S.value&&!i.infinite||tt(v.value+1)}function _e(M,z={}){if(p.value)return;const{minScale:$,maxScale:ae}=i,{zoomRate:ce,rotateDeg:fe,enableTransition:ge}={zoomRate:i.zoomRate,rotateDeg:90,enableTransition:!0,...z};switch(M){case"zoomOut":m.value.scale>$&&(m.value.scale=Number.parseFloat((m.value.scale/ce).toFixed(3)));break;case"zoomIn":m.value.scale<ae&&(m.value.scale=Number.parseFloat((m.value.scale*ce).toFixed(3)));break;case"clockwise":m.value.deg+=fe,r("rotate",m.value.deg);break;case"anticlockwise":m.value.deg-=fe,r("rotate",m.value.deg);break}m.value.enableTransition=ge}return c.watch(E,()=>{c.nextTick(()=>{const M=h.value[0];M!=null&&M.complete||(p.value=!0)})}),c.watch(v,M=>{pt(),r("switch",M)}),c.onMounted(()=>{var M,z;N(),(z=(M=f.value)==null?void 0:M.focus)==null||z.call(M)}),o({setActiveItem:tt}),(M,z)=>(c.openBlock(),c.createBlock(c.Teleport,{to:"body"},[c.createVNode(c.Transition,{name:"viewer-fade",appear:""},{default:c.withCtx(()=>[c.createElementVNode("div",{ref_key:"wrapper",ref:f,tabindex:-1,class:c.normalizeClass(c.unref(l).e("wrapper")),style:c.normalizeStyle({zIndex:b.value})},[c.createElementVNode("div",{class:c.normalizeClass(c.unref(l).e("mask")),onClick:z[0]||(z[0]=c.withModifiers($=>M.hideOnClickModal&&H(),["self"]))},null,2),c.createCommentVNode(" CLOSE "),c.createElementVNode("span",{class:c.normalizeClass([c.unref(l).e("btn"),c.unref(l).e("close")]),onClick:H},[c.createVNode(c.unref(J.ElIcon),null,{default:c.withCtx(()=>[c.createVNode(c.unref(Vs))]),_:1})],2),c.createCommentVNode(" ARROW "),k.value?c.createCommentVNode("v-if",!0):(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[c.createElementVNode("span",{class:c.normalizeClass(P.value),onClick:it},[c.createVNode(c.unref(J.ElIcon),null,{default:c.withCtx(()=>[c.createVNode(c.unref(uu))]),_:1})],2),c.createElementVNode("span",{class:c.normalizeClass(A.value),onClick:mt},[c.createVNode(c.unref(J.ElIcon),null,{default:c.withCtx(()=>[c.createVNode(c.unref(fu))]),_:1})],2)],64)),c.createCommentVNode(" ACTIONS "),c.createElementVNode("div",{class:c.normalizeClass([c.unref(l).e("btn"),c.unref(l).e("actions")])},[c.createElementVNode("div",{class:c.normalizeClass(c.unref(l).e("actions__inner"))},[c.createVNode(c.unref(J.ElIcon),{onClick:z[1]||(z[1]=$=>_e("zoomOut"))},{default:c.withCtx(()=>[c.createVNode(c.unref(Tu))]),_:1}),c.createVNode(c.unref(J.ElIcon),{onClick:z[2]||(z[2]=$=>_e("zoomIn"))},{default:c.withCtx(()=>[c.createVNode(c.unref(bu))]),_:1}),c.createElementVNode("i",{class:c.normalizeClass(c.unref(l).e("actions__divider"))},null,2),c.createVNode(c.unref(J.ElIcon),{onClick:vt},{default:c.withCtx(()=>[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(y.value.icon)))]),_:1}),c.createElementVNode("i",{class:c.normalizeClass(c.unref(l).e("actions__divider"))},null,2),c.createVNode(c.unref(J.ElIcon),{onClick:z[3]||(z[3]=$=>_e("anticlockwise"))},{default:c.withCtx(()=>[c.createVNode(c.unref(vu))]),_:1}),c.createVNode(c.unref(J.ElIcon),{onClick:z[4]||(z[4]=$=>_e("clockwise"))},{default:c.withCtx(()=>[c.createVNode(c.unref(yu))]),_:1})],2)],2),c.createCommentVNode(" CANVAS "),c.createElementVNode("div",{class:c.normalizeClass(c.unref(l).e("canvas"))},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(M.urlList,($,ae)=>c.withDirectives((c.openBlock(),c.createElementBlock("img",{ref_for:!0,ref:ce=>h.value[ae]=ce,key:$,src:$,style:c.normalizeStyle(q.value),class:c.normalizeClass(c.unref(l).e("img")),crossorigin:M.crossorigin,onLoad:Y,onError:Z,onMousedown:ue},null,46,jf)),[[c.vShow,ae===v.value]])),128))],2),c.renderSlot(M.$slots,"default")],6)]),_:3})]))}}),Gf=Ee(qf);function ls(a,o){var n=Object.keys(a);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(a);o&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable})),n.push.apply(n,t)}return n}function X(a){for(var o=1;o<arguments.length;o++){var n=arguments[o]!=null?arguments[o]:{};o%2?ls(Object(n),!0).forEach(function(t){C(a,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(n)):ls(Object(n)).forEach(function(t){Object.defineProperty(a,t,Object.getOwnPropertyDescriptor(n,t))})}return a}function ie(a){"@babel/helpers - typeof";return ie=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},ie(a)}function x(a,o){if(!(a instanceof o))throw new TypeError("Cannot call a class as a function")}function us(a,o){for(var n=0;n<o.length;n++){var t=o[n];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(a,ol(t.key),t)}}function I(a,o,n){return o&&us(a.prototype,o),n&&us(a,n),Object.defineProperty(a,"prototype",{writable:!1}),a}function C(a,o,n){return o=ol(o),o in a?Object.defineProperty(a,o,{value:n,enumerable:!0,configurable:!0,writable:!0}):a[o]=n,a}function D(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&&pr(a,o)}function O(a){return O=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},O(a)}function pr(a,o){return pr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},pr(a,o)}function Wf(){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 _(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function Nr(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 _(a)}function R(a){var o=Wf();return function(){var t=O(a),e;if(o){var i=O(this).constructor;e=Reflect.construct(t,arguments,i)}else e=t.apply(this,arguments);return Nr(this,e)}}function Kf(a,o){for(;!Object.prototype.hasOwnProperty.call(a,o)&&(a=O(a),a!==null););return a}function F(){return typeof Reflect<"u"&&Reflect.get?F=Reflect.get.bind():F=function(o,n,t){var e=Kf(o,n);if(e){var i=Object.getOwnPropertyDescriptor(e,n);return i.get?i.get.call(arguments.length<3?o:t):i.value}},F.apply(this,arguments)}function de(a){return $f(a)||Yf(a)||Xf(a)||Zf()}function $f(a){if(Array.isArray(a))return vr(a)}function Yf(a){if(typeof Symbol<"u"&&a[Symbol.iterator]!=null||a["@@iterator"]!=null)return Array.from(a)}function Xf(a,o){if(a){if(typeof a=="string")return vr(a,o);var n=Object.prototype.toString.call(a).slice(8,-1);if(n==="Object"&&a.constructor&&(n=a.constructor.name),n==="Map"||n==="Set")return Array.from(a);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vr(a,o)}}function vr(a,o){(o==null||o>a.length)&&(o=a.length);for(var n=0,t=new Array(o);n<o;n++)t[n]=a[n];return t}function Zf(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
4
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jf(a,o){if(typeof a!="object"||a===null)return a;var n=a[Symbol.toPrimitive];if(n!==void 0){var t=n.call(a,o);if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(a)}function ol(a){var o=Jf(a,"string");return typeof o=="symbol"?o:String(o)}var Jn={exports:{}},cs;function Qf(){return cs||(cs=1,(function(a){var o=Object.prototype.hasOwnProperty,n="~";function t(){}Object.create&&(t.prototype=Object.create(null),new t().__proto__||(n=!1));function e(l,u,f){this.fn=l,this.context=u,this.once=f||!1}function i(l,u,f,h,g){if(typeof f!="function")throw new TypeError("The listener must be a function");var p=new e(f,h||l,g),v=n?n+u:u;return l._events[v]?l._events[v].fn?l._events[v]=[l._events[v],p]:l._events[v].push(p):(l._events[v]=p,l._eventsCount++),l}function r(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=[],f,h;if(this._eventsCount===0)return u;for(h in f=this._events)o.call(f,h)&&u.push(n?h.slice(1):h);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(f)):u},s.prototype.listeners=function(u){var f=n?n+u:u,h=this._events[f];if(!h)return[];if(h.fn)return[h.fn];for(var g=0,p=h.length,v=new Array(p);g<p;g++)v[g]=h[g].fn;return v},s.prototype.listenerCount=function(u){var f=n?n+u:u,h=this._events[f];return h?h.fn?1:h.length:0},s.prototype.emit=function(u,f,h,g,p,v){var y=n?n+u:u;if(!this._events[y])return!1;var m=this._events[y],b=arguments.length,k,w;if(m.fn){switch(m.once&&this.removeListener(u,m.fn,void 0,!0),b){case 1:return m.fn.call(m.context),!0;case 2:return m.fn.call(m.context,f),!0;case 3:return m.fn.call(m.context,f,h),!0;case 4:return m.fn.call(m.context,f,h,g),!0;case 5:return m.fn.call(m.context,f,h,g,p),!0;case 6:return m.fn.call(m.context,f,h,g,p,v),!0}for(w=1,k=new Array(b-1);w<b;w++)k[w-1]=arguments[w];m.fn.apply(m.context,k)}else{var S=m.length,E;for(w=0;w<S;w++)switch(m[w].once&&this.removeListener(u,m[w].fn,void 0,!0),b){case 1:m[w].fn.call(m[w].context);break;case 2:m[w].fn.call(m[w].context,f);break;case 3:m[w].fn.call(m[w].context,f,h);break;case 4:m[w].fn.call(m[w].context,f,h,g);break;default:if(!k)for(E=1,k=new Array(b-1);E<b;E++)k[E-1]=arguments[E];m[w].fn.apply(m[w].context,k)}}return!0},s.prototype.on=function(u,f,h){return i(this,u,f,h,!1)},s.prototype.once=function(u,f,h){return i(this,u,f,h,!0)},s.prototype.removeListener=function(u,f,h,g){var p=n?n+u:u;if(!this._events[p])return this;if(!f)return r(this,p),this;var v=this._events[p];if(v.fn)v.fn===f&&(!g||v.once)&&(!h||v.context===h)&&r(this,p);else{for(var y=0,m=[],b=v.length;y<b;y++)(v[y].fn!==f||g&&!v[y].once||h&&v[y].context!==h)&&m.push(v[y]);m.length?this._events[p]=m.length===1?m[0]:m:r(this,p)}return this},s.prototype.removeAllListeners=function(u){var f;return u?(f=n?n+u:u,this._events[f]&&r(this,f)):(this._events=new t,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,a.exports=s})(Jn)),Jn.exports}var sl=Qf();const ll=br(sl);var eh=typeof window<"u"&&window.location&&window.location.href.indexOf("xgplayerdebugger=1")>-1,Qn={info:"color: #525252; background-color: #90ee90;",error:"color: #525252; background-color: red;",warn:"color: #525252; background-color: yellow; "},er="%c[xgplayer]",V={config:{debug:eh?3:0},logInfo:function(o){for(var n,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&&(n=console).log.apply(n,[er,Qn.info,o].concat(e))},logWarn:function(o){for(var n,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&&(n=console).warn.apply(n,[er,Qn.warn,o].concat(e))},logError:function(o){var n;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),r=1;r<e;r++)i[r-1]=arguments[r];(n=console)[t].apply(n,[er,Qn.error,o].concat(i))}}};function th(a){a.logInfo=V.logInfo.bind(a),a.logWarn=V.logWarn.bind(a),a.logError=V.logError.bind(a)}var ih=(function(){function a(o){x(this,a),this.bufferedList=o}return I(a,[{key:"start",value:function(n){return this.bufferedList[n].start}},{key:"end",value:function(n){return this.bufferedList[n].end}},{key:"length",get:function(){return this.bufferedList.length}}]),a})(),d={};d.createDom=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"div",o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",n=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(n).forEach(function(i){var r=i,s=n[i];a==="video"||a==="audio"||a==="live-video"?s&&e.setAttribute(r,s):e.setAttribute(r,s)}),e};d.createDomFromHtml=function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=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],n&&d.addClass(e,n),o&&Object.keys(o).forEach(function(i){e.setAttribute(i,o[i])}),e):null}catch(i){return V.logError("util.createDomFromHtml",i),null}};d.hasClass=function(a,o){if(!a||!o)return!1;try{return Array.prototype.some.call(a.classList,function(t){return t===o})}catch{var n=a.className&&ie(a.className)==="object"?a.getAttribute("class"):a.className;return n&&!!n.match(new RegExp("(\\s|^)"+o+"(\\s|$)"))}};d.addClass=function(a,o){if(!(!a||!o))try{o.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach(function(n){n&&a.classList.add(n)})}catch{d.hasClass(a,o)||(a.className&&ie(a.className)==="object"?a.setAttribute("class",a.getAttribute("class")+" "+o):a.className+=" "+o)}};d.removeClass=function(a,o){if(!(!a||!o))try{o.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach(function(n){n&&a.classList.remove(n)})}catch{d.hasClass(a,o)&&o.split(/\s+/g).forEach(function(t){var e=new RegExp("(\\s|^)"+t+"(\\s|$)");a.className&&ie(a.className)==="object"?a.setAttribute("class",a.getAttribute("class").replace(e," ")):a.className=a.className.replace(e," ")})}};d.toggleClass=function(a,o){a&&o.split(/\s+/g).forEach(function(n){d.hasClass(a,n)?d.removeClass(a,n):d.addClass(a,n)})};d.classNames=function(){for(var a=arguments,o=[],n=function(i){d.typeOf(a[i])==="String"?o.push(a[i]):d.typeOf(a[i])==="Object"&&Object.keys(a[i]).map(function(r){a[i][r]&&o.push(r)})},t=0;t<arguments.length;t++)n(t);return o.join(" ")};d.findDom=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,o=arguments.length>1?arguments[1]:void 0,n;try{n=a.querySelector(o)}catch(t){V.logError("util.findDom",t),o.indexOf("#")===0&&(n=a.getElementById(o.slice(1)))}return n};d.getCss=function(a,o){return a.currentStyle?a.currentStyle[o]:document.defaultView.getComputedStyle(a,!1)[o]};d.padStart=function(a,o,n){for(var t=String(n),e=o>>0,i=Math.ceil(e/t.length),r=[],s=String(a);i--;)r.push(t);return r.join("").substring(0,e-s.length)+s};d.format=function(a){if(window.isNaN(a))return"";a=Math.round(a);var o=d.padStart(Math.floor(a/3600),2,0),n=d.padStart(Math.floor((a-o*3600)/60),2,0),t=d.padStart(Math.floor(a-o*3600-n*60),2,0);return(o==="00"?[n,t]:[o,n,t]).join(":")};d.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};d.typeOf=function(a){return Object.prototype.toString.call(a).match(/([^\s.*]+)(?=]$)/g)[0]};d.deepCopy=function(a,o){if(d.typeOf(o)==="Object"&&d.typeOf(a)==="Object")return Object.keys(o).forEach(function(n){d.typeOf(o[n])==="Object"&&!(o[n]instanceof Node)?a[n]===void 0||a[n]===void 0?a[n]=o[n]:d.deepCopy(a[n],o[n]):d.typeOf(o[n])==="Array"?a[n]=d.typeOf(a[n])==="Array"?a[n].concat(o[n]):o[n]:a[n]=o[n]}),a};d.deepMerge=function(a,o){return Object.keys(o).map(function(n){if(d.typeOf(o[n])==="Array"&&d.typeOf(a[n])==="Array"){if(d.typeOf(a[n])==="Array"){var t;(t=a[n]).push.apply(t,de(o[n]))}}else d.typeOf(a[n])===d.typeOf(o[n])&&a[n]!==null&&d.typeOf(a[n])==="Object"&&!(o[n]instanceof window.Node)?d.deepMerge(a[n],o[n]):o[n]!==null&&(a[n]=o[n])}),a};d.getBgImage=function(a){var o=(a.currentStyle||window.getComputedStyle(a,null)).backgroundImage;if(!o||o==="none")return"";var n=document.createElement("a");return n.href=o.replace(/url\("|"\)/g,""),n.href};d.copyDom=function(a){if(a&&a.nodeType===1){var o=document.createElement(a.tagName);return Array.prototype.forEach.call(a.attributes,function(n){o.setAttribute(n.name,n.value)}),a.innerHTML&&(o.innerHTML=a.innerHTML),o}else return""};d.setInterval=function(a,o,n,t){a._interval[o]||(a._interval[o]=window.setInterval(n.bind(a),t))};d.clearInterval=function(a,o){clearInterval(a._interval[o]),a._interval[o]=null};d.setTimeout=function(a,o,n){a._timers||(a._timers=[]);var t=setTimeout(function(){o(),d.clearTimeout(a,t)},n);return a._timers.push(t),t};d.clearTimeout=function(a,o){var n=a._timers;if(d.typeOf(n)==="Array"){for(var t=0;t<n.length;t++)if(n[t]===o){n.splice(t,1),clearTimeout(o);break}}else clearTimeout(o)};d.clearAllTimers=function(a){var o=a._timers;d.typeOf(o)==="Array"&&(o.map(function(n){clearTimeout(n)}),a._timerIds=[])};d.createImgBtn=function(a,o,n,t){var e=d.createDom("xg-".concat(a),"",{},"xgplayer-".concat(a,"-img"));if(e.style.backgroundImage='url("'.concat(o,'")'),n&&t){var i,r,s;["px","rem","em","pt","dp","vw","vh","vm","%"].every(function(l){return n.indexOf(l)>-1&&t.indexOf(l)>-1?(i=parseFloat(n.slice(0,n.indexOf(l)).trim()),r=parseFloat(t.slice(0,t.indexOf(l)).trim()),s=l,!1):!0}),e.style.width="".concat(i).concat(s),e.style.height="".concat(r).concat(s),e.style.backgroundSize="".concat(i).concat(s," ").concat(r).concat(s),a==="start"?e.style.margin="-".concat(r/2).concat(s," auto auto -").concat(i/2).concat(s):e.style.margin="auto 5px auto 5px"}return e};d.Hex2RGBA=function(a,o){var n=[];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){n.push(parseInt(e,16))}),"rgba(".concat(n.join(","),", ").concat(o,")")):"rgba(255, 255, 255, 0.1)"};d.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement};d.checkIsFunction=function(a){return a&&typeof a=="function"};d.checkIsObject=function(a){return a!==null&&ie(a)==="object"};d.hide=function(a){a.style.display="none"};d.show=function(a,o){a.style.display=o||"block"};d.isUndefined=function(a){if(typeof a>"u"||a===null)return!0};d.isNotNull=function(a){return a!=null};d.setStyleFromCsstext=function(a,o){if(o)if(d.typeOf(o)==="String"){var n=o.replace(/\s+/g,"").split(";");n.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 nh(a,o){for(var n=0,t=o.length;n<t;n++)if(a.indexOf(o[n])>-1)return!0;return!1}d.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"],n=a.style.cssText;if(!n)return{};var t=n.replace(/\s+/g,"").split(";"),e={},i={};return t.map(function(r){if(r){var s=r.split(":");s.length>1&&(nh(s[0],o)?e[s[0]]=s[1]:i[s[0]]=s[1])}}),a.setAttribute("style",""),Object.keys(i).map(function(r){a.style[r]=i[r]}),e};d.getStyleFromCsstext=function(a){var o=a.style.cssText;if(!o)return{};var n=o.replace(/\s+/g,"").split(";"),t={};return n.map(function(e){if(e){var i=e.split(":");i.length>1&&(t[i[0]]=i[1])}}),t};d.preloadImg=function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){},n=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,n&&n(e)},t.src=a}};d.stopPropagation=function(a){a&&a.stopPropagation()};d.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0};d.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0};d.checkTouchSupport=function(){return"ontouchstart"in window};d.getBuffered2=function(a){for(var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:.5,n=[],t=0;t<a.length;t++)n.push({start:a.start(t)<.5?0:a.start(t),end:a.end(t)});n.sort(function(l,u){var f=l.start-u.start;return f||u.end-l.end});var e=[];if(o)for(var i=0;i<n.length;i++){var r=e.length;if(r){var s=e[r-1].end;n[i].start-s<o?n[i].end>s&&(e[r-1].end=n[i].end):e.push(n[i])}else e.push(n[i])}else e=n;return new ih(e)};d.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}};d.requestAnimationFrame=function(a){var o=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(o)return o(a)};d.getHostFromUrl=function(a){if(d.typeOf(a)!=="String")return"";var o=a.split("/"),n="";return o.length>3&&o[2]&&(n=o[2]),n};d.cancelAnimationFrame=function(a){var o=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;o&&o(a)};d.isMSE=function(a){return a.media&&(a=a.media),!a||!(a instanceof HTMLMediaElement)?!1:/^blob/.test(a.currentSrc)||/^blob/.test(a.src)};d.isBlob=function(a){return typeof a=="string"&&/^blob/.test(a)};d.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 n="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 n};d.createEvent=function(a){var o;return typeof window.Event=="function"?o=new Event(a):(o=document.createEvent("Event"),o.initEvent(a,!0,!0)),o};d.adjustTimeByDuration=function(a,o,n){return!o||!a?a:a>o||n&&a<o?o:a};d.createPositionBar=function(a,o){var n=d.createDom("xg-bar","",{"data-index":-1},a);return o.appendChild(n),n};d.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]:"",n={scale:"".concat(a.scale||1),translate:"".concat(a.x||0,"%, ").concat(a.y||0,"%"),rotate:"".concat(a.rotate||0,"deg")},t=Object.keys(n);return t.forEach(function(e){var i=new RegExp("".concat(e,"\\([^\\(]+\\)"),"g"),r="".concat(e,"(").concat(n[e],")");i.test(o)?(i.lastIndex=-1,o=o.replace(i,r)):o+="".concat(r," ")}),o};d.convertDeg=function(a){return Math.abs(a)<=1?a*360:a%360};d.getIndexByTime=function(a,o){var n=o.length,t=-1;if(n<1)return t;if(a<=o[0].end||n<2)t=0;else if(a>o[n-1].end)t=n-1;else for(var e=1;e<n;e++)if(a>o[e-1].end&&a<=o[e].end){t=e;break}return t};d.getOffsetCurrentTime=function(a,o){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:-1,t=-1;if(n>=0&&n<o.length?t=n:t=d.getIndexByTime(a,o),t<0)return-1;var e=o.length,i=o[t],r=i.start,s=i.end,l=i.cTime,u=i.offset;return a<r?l:a>=r&&a<=s?a-u:a>s&&t>=e-1?s:-1};d.getCurrentTimeByOffset=function(a,o){var n=-1;if(!o||o.length<0)return a;for(var t=0;t<o.length;t++)if(a<=o[t].duration){n=t;break}if(n!==-1){var e=o[n].start;return n-1<0?e+a:e+(a-o[n-1].duration)}return a};function ul(a){var o=ie(a);return a!==null&&(o==="object"||o==="function")}function rh(a,o,n){var t,e,i,r,s,l,u=0,f=!1,h=!1,g=!0,p=!o&&o!==0&&typeof window.requestAnimationFrame=="function";if(typeof a!="function")throw new TypeError("Expected a function");o=+o||0,ul(n)&&(f=!!n.leading,h="maxWait"in n,i=h?Math.max(+n.maxWait||0,o):i,g="trailing"in n?!!n.trailing:g);function v(N){var L=t,Y=e;return t=e=void 0,u=N,r=a.apply(Y,L),r}function y(N,L){return p?(window.cancelAnimationFrame(s),window.requestAnimationFrame(N)):setTimeout(N,L)}function m(N){if(p)return window.cancelAnimationFrame(N);clearTimeout(N)}function b(N){return u=N,s=y(S,o),f?v(N):r}function k(N){var L=N-l,Y=N-u,Z=o-L;return h?Math.min(Z,i-Y):Z}function w(N){var L=N-l,Y=N-u;return l===void 0||L>=o||L<0||h&&Y>=i}function S(){var N=Date.now();if(w(N))return E(N);s=y(S,k(N))}function E(N){return s=void 0,g&&t?v(N):(t=e=void 0,r)}function P(){s!==void 0&&m(s),u=0,t=l=e=s=void 0}function A(){return s===void 0?r:E(Date.now())}function q(){return s!==void 0}function H(){for(var N=Date.now(),L=w(N),Y=arguments.length,Z=new Array(Y),ue=0;ue<Y;ue++)Z[ue]=arguments[ue];if(t=Z,e=this,l=N,L){if(s===void 0)return b(l);if(h)return s=y(S,o),v(l)}return s===void 0&&(s=y(S,o)),r}return H.cancel=P,H.flush=A,H.pending=q,H}function ah(a,o,n){var t=!0,e=!0;if(typeof a!="function")throw new TypeError("Expected a function");return ul(n)&&(t="leading"in n?!!n.leading:t,e="trailing"in n?!!n.trailing:e),rh(a,o,{leading:t,trailing:e,maxWait:o})}function oh(){var a=(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase();return a==="zh-cn"&&(a="zh"),a}function sh(a,o,n){if(a){var t=a.getAttribute(n);return!!(t&&t===o&&(a.tagName==="VIDEO"||a.tagName==="AUDIO"))}}var fs={android:/(Android)\s([\d.]+)/,ios:/(Version)\/([\d.]+)/},lh=["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","mp4v.20.8, mp4a.40.2","mp4v.20.240, mp4a.40.2"],B={get device(){var a=B.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(n){return o[n].test(a)}))[0]},get os(){if(typeof navigator>"u")return{};var a=navigator.userAgent,o=/(?:Windows Phone)/.test(a),n=/(?:SymbianOS)/.test(a)||o,t=/(?:Tizen)/ig.test(a),e=/(?:Web0S)/ig.test(a),i=/(?:Android)/.test(a),r=/(?:Firefox)/.test(a),s=/(?:iPad|PlayBook)/.test(a)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,l=s||i&&!/(?:Mobile)/.test(a)||r&&/(?:Tablet)/.test(a),u=/(?:iPhone)/.test(a)&&!l,f=!u&&!i&&!n&&!l;return{isTablet:l,isPhone:u,isIpad:s,isIos:u||s,isAndroid:i,isPc:f,isSymbian:n,isWindowsPhone:o,isFireFox:r,isTizen:t,isWebOS:e}},get osVersion(){if(typeof navigator>"u")return 0;var a=navigator.userAgent,o="";/(?:iPhone)|(?:iPad|PlayBook)/.test(a)?o=fs.ios:o=fs.android;var n=o?o.exec(a):[];if(n&&n.length>=3){var t=n[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 n=document.createElement("video");return typeof n.canPlayType=="function"&&lh.map(function(t){n.canPlayType('video/mp4; codecs="'.concat(t,'"'))==="probably"&&(o.isSupport=!0,o.mime+="||".concat(t))}),this.supportResult=o,n=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(n){return this._logger.error(o,n),!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 n={supported:!1,smooth:!1,powerEfficient:!1};if(!o||typeof navigator>"u")return Promise.resolve(n);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),r=MediaSource.isTypeSupported(e.contentType);return Promise.resolve({supported:i&&r,smooth:!1,powerEfficient:!1})}catch{return Promise.resolve(n)}}},mr="3.0.23",hs={1:"media",2:"media",3:"media",4:"media",5:"media",6:"media"},ds={1:5101,2:5102,3:5103,4:5104,5:5105,6:5106},Lt=I(function a(o){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null};x(this,a);var t=o&&o.i18n?o.i18n.ERROR_TYPES:null;if(o.media){var e=n.mediaError?n.mediaError:o.media.error||{},i=o.duration,r=o.currentTime,s=o.ended,l=o.src,u=o.currentSrc,f=o.media,h=f.readyState,g=f.networkState,p=n.errorCode||e.code;ds[p]&&(p=ds[p]);var v={playerVersion:mr,currentTime:r,duration:i,ended:s,readyState:h,networkState:g,src:l||u,errorType:n.errorType,errorCode:p,message:n.errorMessage||e.message,mediaError:e,originError:n.originError?n.originError.stack:"",host:d.getHostFromUrl(l||u)};return n.ext&&Object.keys(n.ext).map(function(k){v[k]=n.ext[k]}),v}else if(arguments.length>1){for(var y={playerVersion:mr,domain:document.domain},m=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"],b=0;b<arguments.length;b++)y[m[b]]=arguments[b];return y.ex=t?(t[arguments[0]]||{}).msg:"",y}}),le="play",Mr="playing",Ue="ended",et="pause",dt="error",$t="seeking",we="seeked",se="timeupdate",gt="waiting",be="canplay",uh="canplaythrough",Se="durationchange",cl="volumechange",Te="loadeddata",ch="loadedmetadata",fl="ratechange",hl="progress",Fr="loadstart",ze="emptied",fh="stalled",hh="suspend",dh="abort",gh="bufferedChange",Br="focus",dl="blur",Hr="ready",gl="urlNull",He="autoplay_started",Vr="autoplay_was_prevented",Yt="complete",Dt="replay",Ur="destroy",Xt="urlchange",yr="download_speed_change",pl="leaveplayer",vl="enterplayer",ml="loading",ke="fullscreen_change",Rt="cssFullscreen_change",Ot="mini_state_change",zr="definition_change",ph="before_definition_change",_r="after_definition_change",vh="SEI_PARSED",mh="retry",Re="video_resize",Cr="pip_change",yl="rotate",_l="screenShot",Nt="playnext",Cl="shortcut",kl="xglog",Mt="user_action",Zt="reset",bl="source_error",wl="source_success",yh="switch_subtitle",Tl=["play","playing","ended","pause","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","volumechange","loadeddata","loadedmetadata","ratechange","progress","loadstart","emptied","stalled","suspend","abort","lowdecode"],El={STATS_INFO:"stats_info",STATS_DOWNLOAD:"stats_download",STATS_RESET:"stats_reset"},Sl="fps_stuck";const _h=Object.freeze(Object.defineProperty({__proto__:null,ABORT:dh,AFTER_DEFINITION_CHANGE:_r,AUTOPLAY_PREVENTED:Vr,AUTOPLAY_STARTED:He,BEFORE_DEFINITION_CHANGE:ph,BUFFER_CHANGE:gh,CANPLAY:be,CANPLAY_THROUGH:uh,COMPLETE:Yt,CSS_FULLSCREEN_CHANGE:Rt,DEFINITION_CHANGE:zr,DESTROY:Ur,DOWNLOAD_SPEED_CHANGE:yr,DURATION_CHANGE:Se,EMPTIED:ze,ENDED:Ue,ENTER_PLAYER:vl,ERROR:dt,FPS_STUCK:Sl,FULLSCREEN_CHANGE:ke,LEAVE_PLAYER:pl,LOADED_DATA:Te,LOADED_METADATA:ch,LOADING:ml,LOAD_START:Fr,MINI_STATE_CHANGE:Ot,PAUSE:et,PIP_CHANGE:Cr,PLAY:le,PLAYER_BLUR:dl,PLAYER_FOCUS:Br,PLAYING:Mr,PLAYNEXT:Nt,PROGRESS:hl,RATE_CHANGE:fl,READY:Hr,REPLAY:Dt,RESET:Zt,RETRY:mh,ROTATE:yl,SCREEN_SHOT:_l,SEEKED:we,SEEKING:$t,SEI_PARSED:vh,SHORTCUT:Cl,SOURCE_ERROR:bl,SOURCE_SUCCESS:wl,STALLED:fh,STATS_EVENTS:El,SUSPEND:hh,SWITCH_SUBTITLE:yh,TIME_UPDATE:se,URL_CHANGE:Xt,URL_NULL:gl,USER_ACTION:Mt,VIDEO_EVENTS:Tl,VIDEO_RESIZE:Re,VOLUME_CHANGE:cl,WAITING:gt,XGLOG:kl},Symbol.toStringTag,{value:"Module"}));function tr(a,o){!this||!this.emit||(a==="error"?this.errorHandler(a,o.error):this.emit(a,o))}function Ch(a,o){return function(n,t){var e={player:o,eventName:a,originalEvent:n,detail:n.detail||{},timeStamp:n.timeStamp,currentTime:o.currentTime,duration:o.duration,paused:o.paused,ended:o.ended,isInternalOp:!!o._internalOp[n.type],muted:o.muted,volume:o.volume,host:d.getHostFromUrl(o.currentSrc),vtype:o.vtype};if(o.removeInnerOP(n.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 r=tr.bind(o,a,e);try{o.mediaEventMiddleware[a].call(o,e,r)}catch(s){throw tr.call(o,a,e),s}}else tr.call(o,a,e)}}var kh=(function(a){D(n,a);var o=R(n);function n(t){var e;x(this,n),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 B.isWeixin&&B.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=t.mediaEl instanceof HTMLMediaElement?t.mediaEl:typeof t.mediaEl=="function"?t.mediaEl(e.mediaConfig):d.createDom(e.mediaConfig.mediaType,"",e.mediaConfig,""),t.defaultPlaybackRate&&(e.media.defaultPlaybackRate=e.media.playbackRate=t.defaultPlaybackRate),d.typeOf(t.volume)==="Number"&&(e.volume=t.volume),t.autoplayMuted&&(e.media.muted=!0,e._lastMuted=!0),t.autoplay&&(e.media.autoplay=!0),t.playsinline&&(e.media.playsinline=!0),e._interval={},e.mediaEventMiddleware={},e.attachVideoEvents(),e}return I(n,[{key:"setEventsMiddleware",value:function(e){var i=this;Object.keys(e).map(function(r){i.mediaEventMiddleware[r]=e[r]})}},{key:"removeEventsMiddleware",value:function(e){var i=this;Object.keys(e).map(function(r){delete i.mediaEventMiddleware[r]})}},{key:"attachVideoEvents",value:function(){var e=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.media;this._evHandlers||(this._evHandlers=Tl.map(function(r){var s="on".concat(r.charAt(0).toUpperCase()).concat(r.slice(1));return typeof e[s]=="function"&&e.on(r,e[s]),C({},r,Ch(r,e))})),this._evHandlers.forEach(function(r){var s=Object.keys(r)[0];i.addEventListener(s,r[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(r){var s=Object.keys(r)[0];i.removeEventListener(s,r[s],!1)}),this._evHandlers.forEach(function(r){var s=Object.keys(r)[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 r=this;e.removeAttribute("src"),e.load(),i.forEach(function(h,g){r.media.appendChild(d.createDom("source","",{src:"".concat(h.src),type:"".concat(h.type||""),"data-index":g+1}))});var s=e.children;if(s){this._videoSourceCount=s.length,this._videoSourceIndex=s.length,this._vLoadeddata=function(h){r.emit(wl,{src:h.target.currentSrc,host:d.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 g=parseInt(h.target.getAttribute("data-index"),10);if(r._videoSourceIndex--,r._videoSourceIndex===0||g>=r._videoSourceCount){var p={code:4,message:"sources_load_error"};l?l.error(h,p):r.errorHandler("error",p)}var v=hs[4];r.emit(bl,new Lt(r,{errorType:v,errorCode:4,errorMessage:"sources_load_error",mediaError:{code:4,message:"sources_load_error"},src:h.target.src}))});for(var f=0;f<s.length;f++)s[f].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 r=0;r<i.length;r++)i[r].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 r=this.media.error||i,s=r.code?hs[r.code]:"other",l=r.message;this.media.currentSrc||this.media.srcObject||(l="empty_src",r={code:6,message:l}),this.emit(e,new Lt(this,{errorType:s,errorCode:r.code,errorMessage:r.message||"",mediaError:r}))}}},{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 r=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]<=r&&r<=i[1]));s++);return i[0]-r<=0&&r-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?d.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 r=0;r<i.length;r++)if((i.start(r)<=this.currentTime||i.start(r)<.1)&&i.end(r)>=this.currentTime)return{start:i.start(r),end:i.end(r)};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(Xt,e),this.emit(gt),this._currentTime=0,this._duration=0,d.isMSE(this.media)){this.onWaiting();return}this._detachSourceEvents(this.media),d.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 r,s=arguments.length,l=new Array(s>2?s-2:0),u=2;u<s;u++)l[u-2]=arguments[u];(r=F(O(n.prototype),"emit",this)).call.apply(r,[this,e,i].concat(l))}},{key:"on",value:function(e,i){for(var r,s=arguments.length,l=new Array(s>2?s-2:0),u=2;u<s;u++)l[u-2]=arguments[u];(r=F(O(n.prototype),"on",this)).call.apply(r,[this,e,i].concat(l))}},{key:"once",value:function(e,i){for(var r,s=arguments.length,l=new Array(s>2?s-2:0),u=2;u<s;u++)l[u-2]=arguments[u];(r=F(O(n.prototype),"once",this)).call.apply(r,[this,e,i].concat(l))}},{key:"off",value:function(e,i){for(var r,s=arguments.length,l=new Array(s>2?s-2:0),u=2;u<s;u++)l[u-2]=arguments[u];(r=F(O(n.prototype),"off",this)).call.apply(r,[this,e,i].concat(l))}},{key:"offAll",value:function(){F(O(n.prototype),"removeAllListeners",this).call(this)}}]),n})(ll),bh=(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"}};x(this,a),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=o}return I(a,[{key:"openDB",value:function(n){var t=this,e=this,i=this.myDB.version||1,r=e.indexedDB.open(e.myDB.name,i);r.onerror=function(s){},r.onsuccess=function(s){t.myDB.db=s.target.result,n.call(e)},r.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 n=this;n.indexedDB.deleteDatabase(this.myDB.name)}},{key:"closeDB",value:function(){this.myDB.db.close()}},{key:"addData",value:function(n,t){for(var e=this.myDB.db.transaction(n,"readwrite").objectStore(n),i,r=0;r<t.length;r++)i=e.add(t[r]),i.onerror=function(){},i.onsuccess=function(){}}},{key:"putData",value:function(n,t){for(var e=this.myDB.db.transaction(n,"readwrite").objectStore(n),i,r=0;r<t.length;r++)i=e.put(t[r]),i.onerror=function(){},i.onsuccess=function(){}}},{key:"getDataByKey",value:function(n,t,e){var i=this,r=this.myDB.db.transaction(n,"readwrite").objectStore(n),s=r.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(n,t){var e=this.myDB.db.transaction(n,"readwrite").objectStore(n);e.delete(t)}},{key:"clearData",value:function(n){var t=this.myDB.db.transaction(n,"readwrite").objectStore(n);t.clear()}}]),a})(),gs=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],ps=["requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen"],vs=["exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"],De="data-xgplayerid";function St(a,o,n){for(var t=arguments.length,e=new Array(t>3?t-3:0),i=3;i<t;i++)e[i-3]=arguments[i];var r=o.call.apply(o,[a].concat(e));!n||typeof n!="function"||(r&&r.then?r.then(function(){for(var s=arguments.length,l=new Array(s),u=0;u<s;u++)l[u]=arguments[u];n.call.apply(n,[a].concat(l))}):n.call.apply(n,[a].concat(e)))}function Ft(a,o){var n=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(n.pre)try{var i;(i=n.pre).call.apply(i,[this].concat(Array.prototype.slice.call(arguments)))}catch(s){throw s.message="[pluginName: ".concat(this.pluginName,":").concat(a,":pre error] >> ").concat(s.message),s}if(this.__hooks&&this.__hooks[a])try{var r=me.apply(void 0,[this,a,o].concat(Array.prototype.slice.call(arguments)));r?r.then?r.then(function(s){s!==!1&&St.apply(void 0,[e,o,n.next].concat(de(t)))}).catch(function(s){throw s}):St.apply(void 0,[this,o,n.next].concat(Array.prototype.slice.call(arguments))):r===void 0&&St.apply(void 0,[this,o,n.next].concat(Array.prototype.slice.call(arguments)))}catch(s){throw s.message="[pluginName: ".concat(this.pluginName,":").concat(a,"] >> ").concat(s.message),s}else St.apply(void 0,[this,o,n.next].concat(Array.prototype.slice.call(arguments)))}).bind(this)}function xl(a,o){var n=this.__hooks;if(!n||!Array.isArray(n[a]))return-1;for(var t=n[a],e=0;e<t.length;e++)if(t[e]===o)return e;return-1}function Bt(a,o){var n=this.__hooks;if(n)return n.hasOwnProperty(a)?(Array.isArray(n[a])||(n[a]=[]),xl.call(this,a,o)===-1&&n[a].push(o),!0):(console.warn("has no supported hook which name [".concat(a,"]")),!1)}function Ht(a,o){var n=this.__hooks;if(n)if(Array.isArray(n[a])){var t=n[a],e=xl.call(this,a,o);e!==-1&&t.splice(e,1)}else n[a]&&(n[a]=null)}function ms(a){if(!(!this.plugins||!this.plugins[a.toLowerCase()])){for(var o=this.plugins[a.toLowerCase()],n=arguments.length,t=new Array(n>1?n-1:0),e=1;e<n;e++)t[e-1]=arguments[e];return o.useHooks&&o.useHooks.apply(o,t)}}function ys(a){if(!(!this.plugins||!this.plugins[a.toLowerCase()])){var o=this.plugins[a.toLowerCase()];if(o){for(var n=arguments.length,t=new Array(n>1?n-1:0),e=1;e<n;e++)t[e-1]=arguments[e];return o.removeHooks&&o.removeHooks.apply(o,t)}}}function Il(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];a.__hooks={},o&&o.map(function(n){a.__hooks[n]=null}),Object.defineProperty(a,"hooks",{get:function(){return a.__hooks&&Object.keys(a.__hooks).map(function(t){if(a.__hooks[t])return t})}})}function Pl(a){a.__hooks=null}function me(a,o,n){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&&Array.isArray(a.__hooks[o])){var r=a.__hooks[o],s=-1,l=function u(f,h,g){for(var p=arguments.length,v=new Array(p>3?p-3:0),y=3;y<p;y++)v[y-3]=arguments[y];if(s++,r.length===0||s===r.length)return g.call.apply(g,[f,f].concat(v));var m=r[s],b=m.call.apply(m,[f,f].concat(v));if(b&&b.then)return b.then(function(k){return k===!1?null:u.apply(void 0,[f,h,g].concat(v))}).catch(function(k){console.warn("[runHooks]".concat(h," reject"),k.message)});if(b!==!1)return u.apply(void 0,[f,h,g].concat(v));if(b===!1)return!1};return l.apply(void 0,[a,o,n].concat(e))}else return n.call.apply(n,[a,a].concat(e))}function ir(a,o){V.logError("[".concat(a,"] event or callback cant be undefined or null when call ").concat(o))}var Oe=(function(){function a(o){x(this,a),d.checkIsFunction(this.beforeCreate)&&this.beforeCreate(o),Il(this),this.__args=o,this.__events={},this.__onceEvents={},this.config=o.config||{},this.player=null,this.playerConfig={},this.pluginName="",this.__init(o)}return I(a,[{key:"beforeCreate",value:function(n){}},{key:"afterCreate",value:function(){}},{key:"beforePlayerInit",value:function(){}},{key:"onPluginsReady",value:function(){}},{key:"afterPlayerInit",value:function(){}},{key:"destroy",value:function(){}},{key:"__init",value:function(n){this.player=n.player,this.playerConfig=n.player&&n.player.config,this.pluginName=n.pluginName?n.pluginName.toLowerCase():this.constructor.pluginName.toLowerCase(),this.logger=n.player&&n.player.logger}},{key:"updateLang",value:function(n){n||(n=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 n=d.checkTouchSupport()?"touch":"mouse";return this.playerConfig&&(this.playerConfig.domEventType==="touch"||this.playerConfig.domEventType==="mouse")&&(n=this.playerConfig.domEventType),n}},{key:"on",value:function(n,t){var e=this;if(!n||!t||!this.player){ir(this.pluginName,"plugin.on(event, callback)");return}typeof n=="string"?(this.__events[n]=t,this.player.on(n,t)):Array.isArray(n)&&n.forEach(function(i){e.__events[i]=t,e.player.on(i,t)})}},{key:"once",value:function(n,t){var e=this;if(!n||!t||!this.player){ir(this.pluginName,"plugin.once(event, callback)");return}typeof n=="string"?(this.__onceEvents[n]=t,this.player.once(n,t)):Array.isArray(n)&&n.forEach(function(i){e.__onceEvents[i]=t,e.player.once(n,t)})}},{key:"off",value:function(n,t){var e=this;if(!n||!t||!this.player){ir(this.pluginName,"plugin.off(event, callback)");return}typeof n=="string"?(delete this.__events[n],this.player.off(n,t)):Array.isArray(n)&&n.forEach(function(i){delete e.__events[n],e.player.off(i,t)})}},{key:"offAll",value:function(){var n=this;["__events","__onceEvents"].forEach(function(t){Object.keys(n[t]).forEach(function(e){n[t][e]&&n.off(e,n[t][e]),e&&delete n[t][e]})}),this.__events={},this.__onceEvents={}}},{key:"emit",value:function(n){var t;if(this.player){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];(t=this.player).emit.apply(t,[n].concat(i))}}},{key:"emitUserAction",value:function(n,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.player){var i=X(X({},e),{},{pluginName:this.pluginName});this.player.emitUserAction(n,t,i)}}},{key:"hook",value:function(n,t){return Ft.call.apply(Ft,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(n,t){for(var e=arguments.length,i=new Array(e>2?e-2:0),r=2;r<e;r++)i[r-2]=arguments[r];return Bt.call.apply(Bt,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(n,t){for(var e=arguments.length,i=new Array(e>2?e-2:0),r=2;r<e;r++)i[r-2]=arguments[r];return Ht.call.apply(Ht,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"registerPlugin",value:function(n){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:n,options:t})}},{key:"getPlugin",value:function(n){return this.player?this.player.getPlugin(n):null}},{key:"__destroy",value:function(){var n=this,t=this.player,e=this.pluginName;this.offAll(),d.clearAllTimers(this),d.checkIsFunction(this.destroy)&&this.destroy(),["player","playerConfig","pluginName","logger","__args","__hooks"].map(function(i){n[i]=null}),t.unRegisterPlugin(e),Pl(this)}}],[{key:"defineGetterOrSetter",value:function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&Object.defineProperty(n,e,t[e])}},{key:"defineMethod",value:function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&typeof t[e]=="function"&&Object.defineProperty(n,e,{configurable:!0,value:t[e]})}},{key:"defaultConfig",get:function(){return{}}},{key:"pluginName",get:function(){return"pluginName"}}]),a})(),nr,_s;function wh(){if(_s)return nr;_s=1;var a=9;if(typeof Element<"u"&&!Element.prototype.matches){var o=Element.prototype;o.matches=o.matchesSelector||o.mozMatchesSelector||o.msMatchesSelector||o.oMatchesSelector||o.webkitMatchesSelector}function n(t,e){for(;t&&t.nodeType!==a;){if(typeof t.matches=="function"&&t.matches(e))return t;t=t.parentNode}}return nr=n,nr}var rr,Cs;function Th(){if(Cs)return rr;Cs=1;var a=wh();function o(e,i,r,s,l){var u=t.apply(this,arguments);return e.addEventListener(r,u,l),{destroy:function(){e.removeEventListener(r,u,l)}}}function n(e,i,r,s,l){return typeof e.addEventListener=="function"?o.apply(null,arguments):typeof r=="function"?o.bind(null,document).apply(null,arguments):(typeof e=="string"&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,function(u){return o(u,i,r,s,l)}))}function t(e,i,r,s){return function(l){l.delegateTarget=a(l.target,i),l.delegateTarget&&s.call(e,l)}}return rr=n,rr}var Eh=Th();const ks=br(Eh);var Sh={CONTROLS:"controls",ROOT:"root"},K={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"},bs={ICON_DISABLE:"xg-icon-disable"};function ar(a){return a?a.indexOf&&/^(?:http|data:|\/)/.test(a):!1}function xh(a,o){return ie(a)==="object"&&a.class&&typeof a.class=="string"?"".concat(o," ").concat(a.class):o}function Ih(a,o){return ie(a)==="object"&&a.attr&&ie(a.attr)==="object"&&Object.keys(a.attr).map(function(n){o[n]=a.attr[n]}),o}function ws(a,o){var n=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 d.addClass(a,n),Object.keys(t).map(function(r){a.setAttribute(r,t[r])}),a;if(ar(a)||ar(a.url))return t.src=ar(a)?a:a.url||"",i=d.createDom(a.tag||"img","",t,"xg-img ".concat(n)),i;if(typeof a=="function")try{return i=a(),i instanceof window.Element?(d.addClass(i,n),Object.keys(t).map(function(r){i.setAttribute(r,t[r])}),i):(V.logWarn("warn>>icons.".concat(o," in config of plugin named [").concat(e,"] is a function mast return an Element Object")),null)}catch(r){return V.logError("Plugin named [".concat(e,"]:createIcon"),r),null}return typeof a=="string"?d.createDomFromHtml(a,t,n):(V.logWarn("warn>>icons.".concat(o," in config of plugin named [").concat(e,"] is invalid")),null)}function Ph(a,o){var n=o.config.icons||o.playerConfig.icons;Object.keys(a).map(function(t){var e=a[t],i=e&&e.class?e.class:"",r=e&&e.attr?e.attr:{},s=null;n&&n[t]&&(i=xh(n[t],i),r=Ih(n[t],r),s=ws(n[t],t,i,r,o.pluginName)),!s&&e&&(s=ws(e.icon?e.icon:e,r,i,{},o.pluginName)),o.icons[t]=s})}function Ah(a,o){Object.keys(a).map(function(n){Object.defineProperty(o.langText,n,{get:function(){var e=o.lang,i=o.i18n;return i[n]?i[n]:a[n]&&a[n][e]||""}})})}var j=(function(a){D(n,a);var o=R(n);function n(){var t,e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return x(this,n),t=o.call(this,e),t.__delegates=[],t}return I(n,[{key:"__init",value:function(e){if(F(O(n.prototype),"__init",this).call(this,e),!!e.root){var i=e.root,r=null;this.icons={},this.root=null,this.parent=null,this.extraEls=[];var s=this.registerIcons()||{};Ph(s,this),this.langText={};var l=this.registerLanguageTexts()||{};Ah(l,this);var u="";try{u=this.render()}catch(g){throw V.logError("Plugin:".concat(this.pluginName,":render"),g),new Error("Plugin:".concat(this.pluginName,":render:").concat(g.message))}if(u)r=n.insert(u,i,e.index),r.setAttribute("data-index",e.index);else if(e.tag)r=d.createDom(e.tag,"",e.attr,e.name),r.setAttribute("data-index",e.index),i.appendChild(r);else return;this.root=r,this.parent=i;var f=this.config.attr||{},h=this.config.style||{};this.setAttr(f),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&&ie(i)==="object"&&Object.keys(i).length>0&&Object.keys(i).map(function(r){var s=r,l=i[s],u={root:e.root},f,h;typeof l=="function"?(f=e.config[s]||{},h=l):ie(l)==="object"&&typeof l.plugin=="function"&&(f=l.options?d.deepCopy(e.config[s]||{},l.options):e.config[s]||{},h=l.plugin),u.config=f,f.index!==void 0&&(u.index=f.index),f.root&&(u.root=f.root),e.registerPlugin(h,u,s)})}}},{key:"updateLang",value:function(e){e||(e=this.lang);function i(u,f){for(var h=0;h<u.children.length;h++)u.children[h].children.length>0?i(u.children[h],f):f(u.children[h])}var r=this.root,s=this.i18n,l=this.langText;r&&i(r,function(u){var f=u.getAttribute&&u.getAttribute("lang-key");if(f){var h=s[f.toUpperCase()]||l[f];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]:"",r=this.i18n||{},s=this.langText;e.setAttribute&&e.setAttribute("lang-key",i);var l=r[i]||s[i]||"";l&&(e.innerHTML=l)}},{key:"plugins",value:function(){return this._children}},{key:"disable",value:function(){this.config.disable=!0,d.addClass(this.find(".xgplayer-icon"),bs.ICON_DISABLE)}},{key:"enable",value:function(){this.config.disable=!1,d.removeClass(this.find(".xgplayer-icon"),bs.ICON_DISABLE)}},{key:"children",value:function(){return{}}},{key:"registerPlugin",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";i.root=i.root||this.root;var s=F(O(n.prototype),"registerPlugin",this).call(this,e,i,r);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,r){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=n.delegate.call(this,this.root,e,i,r);this.__delegates=this.__delegates.concat(l)}}},{key:"unbind",value:function(e,i){var r=this;if(arguments.length<3&&typeof i=="function")Array.isArray(e)?e.forEach(function(u){r.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 r=this;if(this.root){if(d.typeOf(e)==="String")return this.root.style[e]=i;d.typeOf(e)==="Object"&&Object.keys(e).map(function(s){r.root.style[s]=e[s]})}}},{key:"setAttr",value:function(e,i){var r=this;if(this.root){if(d.typeOf(e)==="String")return this.root.setAttribute(e,i);d.typeOf(e)==="Object"&&Object.keys(e).map(function(s){r.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 r=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,r)}},{key:"unbindEL",value:function(e,i){var r=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,r)}},{key:"show",value:function(e){if(this.root){this.root.style.display=e!==void 0?e:"block";var i=window.getComputedStyle(this.root,null),r=i.getPropertyValue("display");if(r==="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(r){return V.logError("Plugin:appendChild",r),null}}},{key:"render",value:function(){return""}},{key:"destroy",value:function(){}},{key:"__destroy",value:function(){var e=this,i=this.player;this.__delegates.map(function(r){r.destroy()}),this.__delegates=[],this._children instanceof Array&&(this._children.map(function(r){i.unRegisterPlugin(r.pluginName)}),this._children=null),this.root&&(this.root.hasOwnProperty("remove")?this.root.remove():this.root.parentNode&&this.root.parentNode.removeChild(this.root)),F(O(n.prototype),"__destroy",this).call(this),this.icons={},["root","parent"].map(function(r){e[r]=null}),this.extraEls=[]}}],[{key:"insert",value:function(e,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=i.children.length,l=Number(r),u=e instanceof window.Node;if(s){for(var f=0,h=null,g="";f<s;f++){h=i.children[f];var p=Number(h.getAttribute("data-index"));if(p>=l){g="beforebegin";break}else p<l&&(g="afterend")}return u?g==="afterend"?i.appendChild(e):i.insertBefore(e,h):h.insertAdjacentHTML(g,e),g==="afterend"?i.children[i.children.length-1]:i.children[f]}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,r,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(r))r.forEach(function(h){var g=ks(e,i,h,s,l);g.key="".concat(i,"_").concat(h),u.push(g)});else{var f=ks(e,i,r,s,l);f.key="".concat(i,"_").concat(r),u.push(f)}return u}},{key:"ROOT_TYPES",get:function(){return Sh}},{key:"POSITIONS",get:function(){return K}}]),n})(Oe),Lh=(function(){function a(){var o=this;if(x(this,a),C(this,"__trigger",function(n){var t=new Date().getTime();o.timeStamp=t;for(var e=0;e<n.length;e++)o.__runHandler(n[e].target)}),this.__handlers=[],this.timeStamp=0,this.observer=null,!!window.ResizeObserver)try{this.observer=new window.ResizeObserver(ah(this.__trigger,100,{trailing:!0})),this.timeStamp=new Date().getTime()}catch(n){console.error(n)}}return I(a,[{key:"addObserver",value:function(n,t){if(this.observer){this.observer.observe(n);for(var e=n.getAttribute(De),i=this.__handlers,r=-1,s=0;s<i.length;s++)i[s]&&n===i[s].target&&(r=s);r>-1?this.__handlers[r].handler=t:this.__handlers.push({target:n,handler:t,playerId:e})}}},{key:"unObserver",value:function(n){var t=-1;this.__handlers.map(function(i,r){n===i.target&&(t=r)});try{var e;(e=this.observer)===null||e===void 0||e.unobserve(n)}catch{}t>-1&&this.__handlers.splice(t,1)}},{key:"destroyObserver",value:function(){var n;(n=this.observer)===null||n===void 0||n.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(n){for(var t=this.__handlers,e=0;e<t.length;e++)if(t[e]&&n===t[e].target){try{t[e].handler(n)}catch(i){console.error(i)}return!0}return!1}}]),a})(),lt=null;function Dh(a,o){return lt||(lt=new Lh),lt.addObserver(a,o),lt}function Rh(a,o){var n;(n=lt)===null||n===void 0||n.unObserver(a,o)}var ee={pluginGroup:{},init:function(o){var n=o._pluginInfoId;n||(n=new Date().getTime(),o._pluginInfoId=n),!o.config.closeResizeObserver&&Dh(o.root,function(){o.resize()}),this.pluginGroup[n]={_originalOptions:o.config||{},_plugins:{}}},formatPluginInfo:function(o,n){var t=null,e=null;return o.plugin&&typeof o.plugin=="function"?(t=o.plugin,e=o.options):(t=o,e={}),n&&(e.config=n||{}),{PLUFGIN:t,options:e}},checkPluginIfExits:function(o,n){for(var t=0;t<n.length;t++)if(o.toLowerCase()===n[t].pluginName.toLowerCase())return!0;return!1},getRootByConfig:function(o,n){for(var t=Object.keys(n),e=null,i=0;i<t.length;i++)if(o.toLowerCase()===t[i].toLowerCase()){e=n[t[i]];break}return d.typeOf(e)==="Object"?{root:e.root,position:e.position}:{}},lazyRegister:function(o,n){var t=this,e=n.timeout||1500;return Promise.race([n.loader().then(function(i){var r;i&&i.__esModule?r=i.default:r=i,t.register(o,r,i.options)}),new Promise(function(i,r){setTimeout(function(){r(new Error("timeout"))},e)})])},register:function(o,n){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!(!o||!n||typeof n!="function"||n.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,r=this.pluginGroup[e]._originalOptions;t.player=o;var s=t.pluginName||n.pluginName;if(!s)throw new Error("The property pluginName is necessary");if(n.isSupported&&!n.isSupported(o.config.mediaType,o.config.codecType)){console.warn("not supported plugin [".concat(s,"]"));return}t.config||(t.config={});for(var l=Object.keys(r),u=0;u<l.length;u++)if(s.toLowerCase()===l[u].toLowerCase()){var f=r[l[u]];d.typeOf(f)==="Object"?t.config=Object.assign({},t.config,r[l[u]]):d.typeOf(f)==="Boolean"&&(t.config.disable=!f);break}n.defaultConfig&&Object.keys(n.defaultConfig).forEach(function(g){typeof t.config[g]>"u"&&(t.config[g]=n.defaultConfig[g])}),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 n(t);return i[s.toLowerCase()]=h,i[s.toLowerCase()].func=n,h&&typeof h.afterCreate=="function"&&h.afterCreate(),h}catch(g){throw console.error(g),g}}}},unRegister:function(o,n){o._pluginInfoId&&(o=o._pluginInfoId),n=n.toLowerCase();try{var t=this.pluginGroup[o]._plugins[n];t&&(t.pluginName&&t.__destroy(),delete this.pluginGroup[o]._plugins[n])}catch(e){console.error("[unRegister:".concat(n,"] cgid:[").concat(o,"] error"),e)}},deletePlugin:function(o,n){var t=o._pluginInfoId;t&&this.pluginGroup[t]&&this.pluginGroup[t]._plugins&&delete this.pluginGroup[t]._plugins[n]},getPlugins:function(o){var n=o._pluginInfoId;return n&&this.pluginGroup[n]?this.pluginGroup[n]._plugins:{}},findPlugin:function(o,n){var t=o._pluginInfoId;if(!t||!this.pluginGroup[t])return null;var e=n.toLowerCase();return this.pluginGroup[t]._plugins[e]},beforeInit:function(o){var n=this;function t(e){return!e||!e.then?new Promise(function(i){i()}):e}return new Promise(function(e){if(n.pluginGroup){var i;return o._loadingPlugins&&o._loadingPlugins.length?i=Promise.all(o._loadingPlugins):i=Promise.resolve(),i.then(function(){var r=o._pluginInfoId;if(!n.pluginGroup[r]){e();return}var s=n.pluginGroup[r]._plugins,l=[];Object.keys(s).forEach(function(u){if(s[u]&&s[u].beforePlayerInit)try{var f=s[u].beforePlayerInit();l.push(t(f))}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 n=o._pluginInfoId;if(!(!n||!this.pluginGroup[n])){var t=this.pluginGroup[n]._plugins;Object.keys(t).forEach(function(e){t[e]&&t[e].afterPlayerInit&&t[e].afterPlayerInit()})}},setLang:function(o,n){var t=n._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 n=this,t=o._pluginInfoId;if(!(!t||!this.pluginGroup[t])){var e=[],i=this.pluginGroup[t]._plugins;Object.keys(i).forEach(function(r){r!=="controls"&&i[r]&&(e.push({plugin:i[r].func,options:i[r].__args}),n.unRegister(t,r))}),e.forEach(function(r){n.register(o,r.plugin,r.options)})}},onPluginsReady:function(o){var n=o._pluginInfoId;if(!(!n||!this.pluginGroup[n])){var t=this.pluginGroup[n]._plugins||{};Object.keys(t).forEach(function(e){t[e].onPluginsReady&&typeof t[e].onPluginsReady=="function"&&t[e].onPluginsReady()})}},destroy:function(o){var n=o._pluginInfoId;if(this.pluginGroup[n]){Rh(o.root);for(var t=this.pluginGroup[n]._plugins,e=0,i=Object.keys(t);e<i.length;e++){var r=i[e];this.unRegister(n,r)}delete this.pluginGroup[n],delete o._pluginInfoId}}},T={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 Ts(){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:oh(),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 Oh=function(o,n){var t,e,i;n.preset&&n.options?i=new n.preset(n.options,o.config):i=new n({},o.config);var r=i,s=r.plugins,l=s===void 0?[]:s,u=r.ignores,f=u===void 0?[]:u,h=r.icons,g=h===void 0?{}:h,p=r.i18n,v=p===void 0?[]:p;o.config.plugins||(o.config.plugins=[]),o.config.ignores||(o.config.ignores=[]),(t=o.config.plugins).push.apply(t,de(l)),(e=o.config.ignores).push.apply(e,de(f)),Object.keys(g).map(function(m){o.config.icons[m]||(o.config.icons[m]=g[m])});var y=o.config.i18n||[];v.push.apply(v,de(y)),o.config.i18n=v},Nh=(function(a){D(n,a);var o=R(n);function n(){var t;x(this,n);for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return t=o.call.apply(o,[this].concat(i)),C(_(t),"onMouseEnter",function(s){var l=_(t),u=l.player,f=l.playerConfig;f.closeControlsBlur&&u.focus({autoHide:!1})}),C(_(t),"onMouseLeave",function(s){var l=_(t),u=l.player;u.focus()}),t}return I(n,[{key:"beforeCreate",value:function(e){!e.config.mode&&B.device==="mobile"&&(e.config.mode="flex"),e.player.config.marginControls&&(e.config.autoHide=!1)}},{key:"afterCreate",value:function(){var e=this,i=this.config,r=i.disable,s=i.height,l=i.mode;if(!r){l==="flex"&&this.player.addClass(T.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(Ot,function(h){h?d.addClass(e.root,"mini-controls"):d.removeClass(e.root,"mini-controls")});var f=this.playerConfig.isMobileSimulateMode;B.device!=="mobile"&&f!=="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&&d.addClass(this.root,T.CONTROLS_AUTOHIDE)}},{key:"pauseAutoHide",value:function(){d.removeClass(this.root,T.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]:{},r=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 K.CONTROLS_LEFT:i.root=this.left;break;case K.CONTROLS_RIGHT:i.root=this.right;break;case K.CONTROLS_CENTER:i.root=this.center;break;case K.CONTROLS:i.root=this.root;break;default:i.root=this.left}return F(O(n.prototype),"registerPlugin",this).call(this,e,i,r)}}}},{key:"destroy",value:function(){B.device!=="mobile"&&(this.unbind("mouseenter",this.onMouseEnter),this.unbind("mouseleave",this.onMouseLeave)),this.left=null,this.center=null,this.right=null,this.innerRoot=null}},{key:"render",value:function(){var e=this.config,i=e.mode,r=e.autoHide,s=e.initShow,l=e.disable;if(!l){var u=d.classNames({"xgplayer-controls":!0},{"flex-controls":i==="flex"},{"bottom-controls":i==="bottom"},C({},T.CONTROLS_AUTOHIDE,r),{"xgplayer-controls-initshow":s||!r});return'<xg-controls class="'.concat(u,`" unselectable="on">
|
|
5
|
-
<xg-inner-controls class="xg-inner-controls xg-pos">
|
|
6
|
-
<xg-left-grid class="xg-left-grid">
|
|
7
|
-
</xg-left-grid>
|
|
8
|
-
<xg-center-grid class="xg-center-grid"></xg-center-grid>
|
|
9
|
-
<xg-right-grid class="xg-right-grid">
|
|
10
|
-
</xg-right-grid>
|
|
11
|
-
</xg-inner-controls>
|
|
12
|
-
</xg-controls>`)}}}],[{key:"pluginName",get:function(){return"controls"}},{key:"defaultConfig",get:function(){return{disable:!1,autoHide:!0,mode:"",initShow:!1}}}]),n})(j),Mh={LANG:"en",TEXT:{ERROR_TYPES:{network:{code:1,msg:"video download error"},mse:{code:2,msg:"stream append error"},parse:{code:3,msg:"parsing error"},format:{code:4,msg:"wrong format"},decoder:{code:5,msg:"decoding error"},runtime:{code:6,msg:"grammatical errors"},timeout:{code:7,msg:"play timeout"},other:{code:8,msg:"other errors"}},HAVE_NOTHING:"There is no information on whether audio/video is ready",HAVE_METADATA:"Audio/video metadata is ready ",HAVE_CURRENT_DATA:"Data about the current play location is available, but there is not enough data to play the next frame/millisecond",HAVE_FUTURE_DATA:"Current and at least one frame of data is available",HAVE_ENOUGH_DATA:"The available data is sufficient to start playing",NETWORK_EMPTY:"Audio/video has not been initialized",NETWORK_IDLE:"Audio/video is active and has been selected for resources, but no network is used",NETWORK_LOADING:"The browser is downloading the data",NETWORK_NO_SOURCE:"No audio/video source was found",MEDIA_ERR_ABORTED:"The fetch process is aborted by the user",MEDIA_ERR_NETWORK:"An error occurred while downloading",MEDIA_ERR_DECODE:"An error occurred while decoding",MEDIA_ERR_SRC_NOT_SUPPORTED:"Audio/video is not supported",REPLAY:"Replay",ERROR:"Network is offline",PLAY_TIPS:"Play",PAUSE_TIPS:"Pause",PLAYNEXT_TIPS:"Play next",DOWNLOAD_TIPS:"Download",ROTATE_TIPS:"Rotate",RELOAD_TIPS:"Reload",FULLSCREEN_TIPS:"Fullscreen",EXITFULLSCREEN_TIPS:"Exit fullscreen",CSSFULLSCREEN_TIPS:"Cssfullscreen",EXITCSSFULLSCREEN_TIPS:"Exit cssfullscreen",TEXTTRACK:"Caption",PIP:"PIP",SCREENSHOT:"Screenshot",LIVE:"LIVE",OFF:"Off",OPEN:"Open",MINI_DRAG:"Click and hold to drag",MINISCREEN:"Miniscreen",REFRESH_TIPS:"Please Try",REFRESH:"Refresh",FORWARD:"forward",LIVE_TIP:"Live"}},oe={lang:{},langKeys:[],textKeys:[]};function ct(a,o){return Object.keys(o).forEach(function(n){var t=d.typeOf(o[n]),e=d.typeOf(a[n]);if(t==="Array"){var i;e!=="Array"&&(a[n]=[]),(i=a[n]).push.apply(i,de(o[n]))}else t==="Object"?(e!=="Object"&&(a[n]={}),ct(a[n],o[n])):a[n]=o[n]}),a}function Al(){Object.keys(oe.lang.en).map(function(a){oe.textKeys[a]=a})}function Fh(a,o){var n=[];if(o||(o=oe),!!o.lang){d.typeOf(a)!=="Array"?n=Object.keys(a).map(function(i){var r=i==="zh"?"zh-cn":i;return{LANG:r,TEXT:a[i]}}):n=a;var t=o,e=t.lang;n.map(function(i){i.LANG==="zh"&&(i.LANG="zh-cn"),e[i.LANG]?ct(e[i.LANG]||{},i.TEXT||{}):jr(i,o)}),Al()}}function jr(a,o){var n=a.LANG;if(o||(o=oe),!!o.lang){var t=a.TEXT||{};n==="zh"&&(n="zh-cn"),o.lang[n]?ct(o.lang[n],t):(o.langKeys.push(n),o.lang[n]=t),Al()}}function Bh(a){var o,n={lang:{},langKeys:[],textKeys:{},pId:a};return ct(n.lang,oe.lang),(o=n.langKeys).push.apply(o,de(oe.langKeys)),ct(n.textKeys,oe.textKeys),n}jr(Mh);var Qe={get textKeys(){return oe.textKeys},get langKeys(){return oe.langKeys},get lang(){var a={};return oe.langKeys.map(function(o){a[o]=oe.lang[o]}),oe.lang["zh-cn"]&&(a.zh=oe.lang["zh-cn"]||{}),a},extend:Fh,use:jr,init:Bh},U={INITIAL:1,READY:2,ATTACHING:3,ATTACHED:4,NOTALLOW:5,RUNNING:6,ENDED:7},Es=["ERROR","INITIAL","READY","ATTACHING","ATTACHED","NOTALLOW","RUNNING","ENDED","DESTROYED"],re={},or=null,Ll=(function(a){D(n,a);var o=R(n);function n(){return x(this,n),o.apply(this,arguments)}return I(n,[{key:"add",value:function(e){e&&(re[e.playerId]=e,Object.keys(re).length===1&&this.setActive(e.playerId,!0))}},{key:"remove",value:function(e){e&&(e.isUserActive,delete re[e.playerId])}},{key:"_iterate",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;for(var r in re)if(Object.prototype.hasOwnProperty.call(re,r)){var s=re[r];if(i){if(e(s))break}else e(s)}}},{key:"forEach",value:function(e){this._iterate(e)}},{key:"find",value:function(e){var i=null;return this._iterate(function(r){var s=e(r);return s&&(i=r),s},!0),i}},{key:"findAll",value:function(e){var i=[];return this._iterate(function(r){e(r)&&i.push(r)}),i}},{key:"setActive",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(re[e])return i?this.forEach(function(r){e===r.playerId?(r.isUserActive=!0,r.isInstNext=!1):r.isUserActive=!1}):re[e].isUserActive=i,e}},{key:"getActiveId",value:function(){for(var e=Object.keys(re),i=0;i<e.length;i++){var r=re[e[i]];if(r&&r.isUserActive)return e[i]}return null}},{key:"setNext",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(re[e])return i?this.forEach(function(r){e===r.playerId?(r.isUserActive=!1,r.isInstNext=!0):r.isInstNext=!1}):re[e].isInstNext=i,e}}],[{key:"getInstance",value:function(){return or||(or=new n),or}}]),n})(sl.EventEmitter);function Hh(a){for(var o=Object.keys(re),n=0;n<o.length;n++){var t=re[o[n]];if(t.root===a)return t}return null}var Vh=["play","pause","replay","retry"],Ss=0,xs=0,Pe=null,Jt=(function(a){D(n,a);var o=R(n);function n(t){var e;x(this,n);var i=d.deepMerge(Ts(),t);e=o.call(this,i),C(_(e),"canPlayFunc",function(){if(e.config){var v=e.config,y=v.autoplay,m=v.defaultPlaybackRate;V.logInfo("player","canPlayFunc, startTime",e.__startTime),e._seekToStartTime(),e.playbackRate=m,(y||e._useAutoplay)&&e.mediaPlay(),e.off(be,e.canPlayFunc),e.removeClass(T.ENTER)}}),C(_(e),"onFullscreenChange",function(v,y){var m=function(){d.setTimeout(_(e),function(){e.resize()},100)},b=d.getFullScreenEl();e._fullActionFrom?e._fullActionFrom="":e.emit(Mt,{eventType:"system",action:"switch_fullscreen",pluginName:"player",currentTime:e.currentTime,duration:e.duration,props:[{prop:"fullscreen",from:!0,to:!1}]});var k=sh(b,e.playerId,De);if(y||b&&(b===e._fullscreenEl||k))m(),!e.config.closeFocusVideoFocus&&e.media.focus(),e.fullscreen=!0,e.changeFullStyle(e.root,b,T.FULLSCREEN),e.emit(ke,!0,e._fullScreenOffset),e.cssfullscreen&&e.exitCssFullscreen();else if(e.fullscreen){m();var w=_(e),S=w._fullScreenOffset,E=w.config;if(E.needFullscreenScroll?(window.scrollTo(S.left,S.top),d.setTimeout(_(e),function(){e.fullscreen=!1,e._fullScreenOffset=null},100)):(!e.config.closeFocusVideoFocus&&e.media.focus(),e.fullscreen=!1,e._fullScreenOffset=null),e.cssfullscreen)e.removeClass(T.FULLSCREEN);else{var P=e._fullscreenEl;!P&&(e.root.contains(v.target)||v.target===e.root)&&(P=v.target),e.recoverFullStyle(e.root,P,T.FULLSCREEN)}e._fullscreenEl=null,e.emit(ke,!1)}}),C(_(e),"_onWebkitbeginfullscreen",function(v){e._fullscreenEl=e.media,e.onFullscreenChange(v,!0)}),C(_(e),"_onWebkitendfullscreen",function(v){e.onFullscreenChange(v,!1)}),Il(_(e),Vh),e.config=i,e._pluginInfoId=d.generateSessionId(),th(_(e));var r=e.constructor.defaultPreset;if(e.config.presets.length){var s=e.config.presets.indexOf("default");s>=0&&r&&(e.config.presets[s]=r)}else r&&e.config.presets.push(r);e.userTimer=null,e.waitTimer=null,e.handleSource=!0,e._state=U.INITIAL,e.isAd=!1,e.isError=!1,e._hasStart=!1,e.isSeeking=!1,e.isCanplay=!1,e._useAutoplay=!1,e.__startTime=-1,e.rotateDeg=0,e.isActive=!1,e.fullscreen=!1,e.cssfullscreen=!1,e.isRotateFullscreen=!1,e._fullscreenEl=null,e.timeSegments=[],e._cssfullscreenEl=null,e.curDefinition=null,e._orgCss="",e._fullScreenOffset=null,e._videoHeight=0,e._videoWidth=0,e.videoPos={pi:1,scale:0,rotate:-1,x:0,y:0,h:-1,w:-1,vy:0,vx:0},e.sizeInfo={width:0,height:0,left:0,top:0},e._accPlayed={t:0,acc:0,loopAcc:0},e._offsetInfo={currentTime:-1,duration:0},e.innerContainer=null,e.controls=null,e.topBar=null,e.root=null,e.__i18n=Qe.init(e._pluginInfoId),B.os.isAndroid&&B.osVersion>0&&B.osVersion<6&&(e.config.autoplay=!1),e.database=new bh,e.isUserActive=!1,e._onceSeekCanplay=null,e._isPauseBeforeSeek=0,e.innerStates={isActiveLocked:!1},e.instManager=Pe;var l=e._initDOM();if(!l)return console.error(new Error("can't find the dom which id is ".concat(e.config.id," or this.config.el does not exist"))),Nr(e);var u=e.config,f=u.definition,h=f===void 0?{}:f,g=u.url;if(!g&&h.list&&h.list.length>0){var p=h.list.find(function(v){return v.definition&&v.definition===h.defaultDefinition});p||(h.defaultDefinition=h.list[0].definition,p=h.list[0]),e.config.url=p.url,e.curDefinition=p}return e._bindEvents(),e._registerPresets(),e._registerPlugins(),ee.onPluginsReady(_(e)),e.getInitDefinition(),e.setState(U.READY),d.setTimeout(_(e),function(){e.emit(Hr)},0),e.onReady&&e.onReady(),(e.config.videoInit||e.config.autoplay)&&(!e.hasStart||e.state<U.ATTACHED)&&e.start(),e}return I(n,[{key:"_initDOM",value:function(){var e,i=this;if(this.root=this.config.id?document.getElementById(this.config.id):null,!this.root){var r=this.config.el;if(r&&r.nodeType===1)this.root=r;else return this.emit(dt,new Lt("use",this.config.vid,{line:32,handle:"Constructor",msg:"container id can't be empty"})),console.error("this.confg.id or this.config.el can't be empty"),!1}var s=Hh(this.root);if(s&&(V.logWarn("The is an Player instance already exists in this.root, destroy it and reinitialize"),s.destroy()),this.root.setAttribute(De,this.playerId),this.media.setAttribute(De,this.playerId),(e=Pe)===null||e===void 0||e.add(this),ee.init(this),this._initBaseDoms(),this.config.controls){var l=this.config.controls.root||null,u=ee.register(this,Nh,{root:l});this.controls=u}var f=this.config.isMobileSimulateMode==="mobile"?"mobile":B.device;if(this.addClass("".concat(T.DEFAULT," ").concat(T.INACTIVE," xgplayer-").concat(f," ").concat(this.config.controls?"":T.NO_CONTROLS)),this.config.autoplay?this.addClass(T.ENTER):this.addClass(T.NO_START),this.config.fluid){var h=this.config,g=h.width,p=h.height;(typeof g!="number"||typeof p!="number")&&(g=600,p=337.5);var v={width:"100%",height:"0","max-width":"100%","padding-top":"".concat(p*100/g,"%")};Object.keys(v).forEach(function(S){i.root.style[S]=v[S]})}else["width","height"].forEach(function(S){i.config[S]&&(typeof i.config[S]!="number"?i.root.style[S]=i.config[S]:i.root.style[S]="".concat(i.config[S],"px"))});var y=this.root.getBoundingClientRect(),m=y.width,b=y.height,k=y.left,w=y.top;return this.sizeInfo.width=m,this.sizeInfo.height=b,this.sizeInfo.left=k,this.sizeInfo.top=w,!0}},{key:"_initBaseDoms",value:function(){this.topBar=null,this.leftBar=null,this.rightBar=null,this.config.marginControls&&(this.innerContainer=d.createDom("xg-video-container","",{"data-index":-1},"xg-video-container"),this.root.appendChild(this.innerContainer))}},{key:"_bindEvents",value:function(){var e=this;["focus","blur"].forEach(function(i){e.on(i,e["on"+i.charAt(0).toUpperCase()+i.slice(1)])}),gs.forEach(function(i){document&&document.addEventListener(i,e.onFullscreenChange)}),B.os.isIos&&(this.media.addEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.media.addEventListener("webkitendfullscreen",this._onWebkitendfullscreen)),this.once(Te,this.resize),this.playFunc=function(){e.config.closeFocusVideoFocus||e.media.focus()},this.once(le,this.playFunc)}},{key:"_unbindEvents",value:function(){var e=this;this.root.removeEventListener("mousemove",this.mousemoveFunc),gs.forEach(function(i){document.removeEventListener(i,e.onFullscreenChange)}),this.playFunc&&this.off(le,this.playFunc),this.off(be,this.canPlayFunc),this.media.removeEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.media.removeEventListener("webkitendfullscreen",this._onWebkitendfullscreen)}},{key:"_clearUserTimer",value:function(){this.userTimer&&(d.clearTimeout(this,this.userTimer),this.userTimer=null)}},{key:"_startInit",value:function(e){var i=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.media&&!((!e||e===""||d.typeOf(e)==="Array"&&e.length===0)&&(e="",this.emit(gl),V.logWarn("config.url is null, please get url and run player._startInit(url)"),this.config.nullUrlStart))){d.isNotNull(r.playSessionId)&&(this._playSessionId=r.playSessionId),this.handleSource&&(this._detachSourceEvents(this.media),d.typeOf(e)==="Array"&&e.length>0?this._attachSourceEvents(this.media,e):!this.media.src||this.media.src!==e?this.media.src=e:e||this.media.removeAttribute("src")),d.typeOf(this.config.volume)==="Number"&&(this.volume=this.config.volume);var s=this.innerContainer?this.innerContainer:this.root;this.media instanceof window.Element&&!s.contains(this.media)&&s.insertBefore(this.media,s.firstChild);var l=this.media.readyState;V.logInfo("_startInit readyState",l),this.config.autoplay&&(!d.isMSE(this.media)&&this.load(),(B.os.isIpad||B.os.isPhone)&&this.mediaPlay());var u=this.config.startTime;this.__startTime=u>0?u:-1,this.config.startTime=0,l>=2&&this.duration>0?this.canPlayFunc():this.on(be,this.canPlayFunc),(!this.hasStart||this.state<U.ATTACHED)&&ee.afterInit(this),this.hasStart=!0,this.setState(U.ATTACHED),d.setTimeout(this,function(){i.emit(Yt)},0)}}},{key:"_registerPlugins",value:function(){var e=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this._loadingPlugins=[];var r=this.config.ignores||[],s=this.config.plugins||[],l=this.config.i18n||[];i&&Qe.extend(l,this.__i18n);var u=r.join("||").toLowerCase().split("||"),f=this.plugins;s.forEach(function(h){try{var g=h.plugin?h.plugin.pluginName:h.pluginName;if(g&&u.indexOf(g.toLowerCase())>-1)return null;if(!i&&f[g.toLowerCase()])return;if(h.lazy&&h.loader){var p=ee.lazyRegister(e,h);h.forceBeforeInit&&(p.then(function(){e._loadingPlugins.splice(e._loadingPlugins.indexOf(p),1)}).catch(function(v){V.logError("_registerPlugins:loadingPlugin",v),e._loadingPlugins.splice(e._loadingPlugins.indexOf(p),1)}),e._loadingPlugins.push(p));return}return e.registerPlugin(h)}catch(v){V.logError("_registerPlugins:",v)}})}},{key:"_registerPresets",value:function(){var e=this;this.config.presets.forEach(function(i){Oh(e,i)})}},{key:"_getRootByPosition",value:function(e){var i=null;switch(e){case K.ROOT_RIGHT:this.rightBar||(this.rightBar=d.createPositionBar("xg-right-bar",this.root)),i=this.rightBar;break;case K.ROOT_LEFT:this.leftBar||(this.leftBar=d.createPositionBar("xg-left-bar",this.root)),i=this.leftBar;break;case K.ROOT_TOP:this.topBar||(this.topBar=d.createPositionBar("xg-top-bar",this.root),this.config.topBarAutoHide&&d.addClass(this.topBar,T.TOP_BAR_AUTOHIDE)),i=this.topBar;break;default:i=this.innerContainer||this.root;break}return i}},{key:"registerPlugin",value:function(e,i){var r=ee.formatPluginInfo(e,i),s=r.PLUFGIN,l=r.options,u=this.config.plugins,f=ee.checkPluginIfExits(s.pluginName,u);!f&&u.push(s);var h=ee.getRootByConfig(s.pluginName,this.config);h.root&&(l.root=h.root),h.position&&(l.position=h.position);var g=l.position?l.position:l.config&&l.config.position||s.defaultConfig&&s.defaultConfig.position;if(!l.root&&typeof g=="string"&&g.indexOf("controls")>-1){var p;return(p=this.controls)===null||p===void 0?void 0:p.registerPlugin(s,l,s.pluginName)}return l.root||(l.root=this._getRootByPosition(g)),ee.register(this,s,l)}},{key:"deregister",value:function(e){typeof e=="string"?ee.unRegister(this,e):e instanceof Oe&&ee.unRegister(this,e.pluginName)}},{key:"unRegisterPlugin",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;this.deregister(e),i&&this.removePluginFromConfig(e)}},{key:"removePluginFromConfig",value:function(e){var i;if(typeof e=="string"?i=e:e instanceof Oe&&(i=e.pluginName),!!i)for(var r=this.config.plugins.length-1;r>-1;r--){var s=this.config.plugins[r];if(s.pluginName.toLowerCase()===i.toLowerCase()){this.config.plugins.splice(r,1);break}}}},{key:"plugins",get:function(){return ee.getPlugins(this)}},{key:"getPlugin",value:function(e){var i=ee.findPlugin(this,e);return i&&i.pluginName?i:null}},{key:"addClass",value:function(e){this.root&&(d.hasClass(this.root,e)||d.addClass(this.root,e))}},{key:"removeClass",value:function(e){this.root&&d.removeClass(this.root,e)}},{key:"hasClass",value:function(e){if(this.root)return d.hasClass(this.root,e)}},{key:"setAttribute",value:function(e,i){this.root&&this.root.setAttribute(e,i)}},{key:"removeAttribute",value:function(e,i){this.root&&this.root.removeAttribute(e,i)}},{key:"start",value:function(e){var i=this;if(!(this.state>U.ATTACHING)){var r=this._playSessionId;return d.isNotNull(r)&&(this._playSessionId=void 0),!e&&!this.config.url&&this.getInitDefinition(),this.hasStart=!0,this.setState(U.ATTACHING),this._registerPlugins(!1),ee.beforeInit(this).then(function(){if(i.config){e||(e=i.url||i.config.url);var s=i.preProcessUrl(e),l=i._startInit(s.url,{playSessionId:r});return l}}).catch(function(s){throw s.fileName="player",s.lineNumber="236",V.logError("start:beforeInit:",s),s})}}},{key:"switchURL",value:function(e,i){var r=this,s=e;d.typeOf(e)==="Object"&&(s=e.url),s=this.preProcessUrl(s).url;var l=this.currentTime;this.__startTime=l;var u=this.paused&&!this.isError;return this.src=s,new Promise(function(f,h){var g=function(y){r.off("timeupdate",p),r.off("canplay",p),h(y)},p=function(){r._seekToStartTime(),u&&r.pause(),r.off("error",g),f(!0)};if(r.once("error",g),!s){r.errorHandler("error",{code:6,message:"empty_src"});return}B.os.isAndroid?r.once("timeupdate",p):r.once("canplay",p),r.play()})}},{key:"videoPlay",value:function(){this.mediaPlay()}},{key:"mediaPlay",value:function(){var e=this;if(!this.hasStart&&this.state<U.ATTACHED){this.removeClass(T.NO_START),this.addClass(T.ENTER),this.start(),this._useAutoplay=!0;return}this.state<U.RUNNING&&(this.removeClass(T.NO_START),!this.isCanplay&&this.addClass(T.ENTER));var i=F(O(n.prototype),"play",this).call(this);return i!==void 0&&i&&i.then?i.then(function(){e.removeClass(T.NOT_ALLOW_AUTOPLAY),e.addClass(T.PLAYING),e.state<U.RUNNING&&(V.logInfo(">>>>playPromise.then"),e.setState(U.RUNNING),e.emit(He))}).catch(function(r){if(V.logWarn(">>>>playPromise.catch",r.name),e.media&&e.media.error){e.onError(),e.removeClass(T.ENTER);return}r.name==="NotAllowedError"&&(e._errorTimer=d.setTimeout(e,function(){e._errorTimer=null,e.emit(Vr),e.addClass(T.NOT_ALLOW_AUTOPLAY),e.removeClass(T.ENTER),e.pause(),e.setState(U.NOTALLOW)},0))}):(V.logWarn("video.play not return promise"),this.state<U.RUNNING&&(this.setState(U.RUNNING),this.removeClass(T.NOT_ALLOW_AUTOPLAY),this.removeClass(T.NO_START),this.removeClass(T.ENTER),this.addClass(T.PLAYING),this.emit(He))),i}},{key:"mediaPause",value:function(){F(O(n.prototype),"pause",this).call(this)}},{key:"videoPause",value:function(){F(O(n.prototype),"pause",this).call(this)}},{key:"play",value:function(){var e=this;return this.removeClass(T.PAUSED),me(this,"play",function(){return e.mediaPlay()})}},{key:"pause",value:function(){var e=this;me(this,"pause",function(){F(O(n.prototype),"pause",e).call(e)})}},{key:"seek",value:function(e,i){var r=this;if(!(!this.media||Number.isNaN(Number(e))||!this.hasStart)){var s=this.config,l=s.isSeekedPlay,u=s.seekedStatus,f=i||(l?"play":u);e=e<0?0:e>this.duration?parseInt(this.duration,10):e,!this._isPauseBeforeSeek&&(this._isPauseBeforeSeek=this.paused?2:1),this._onceSeekCanplay&&this.off(we,this._onceSeekCanplay),this._onceSeekCanplay=function(){switch(r.removeClass(T.ENTER),r.isSeeking=!1,f){case"play":r.play();break;case"pause":r.pause();break;default:r._isPauseBeforeSeek>1||r.paused?r.pause():r.play()}r._isPauseBeforeSeek=0,r._onceSeekCanplay=null},this.once(we,this._onceSeekCanplay),this.state<U.RUNNING?(this.removeClass(T.NO_START),this.currentTime=e,this.play()):this.currentTime=e}}},{key:"getInitDefinition",value:function(){var e=this,i=this.config,r=i.definition,s=i.url;!s&&r&&r.list&&r.list.length>0&&r.defaultDefinition&&r.list.map(function(l){l.definition===r.defaultDefinition&&(e.config.url=l.url,e.curDefinition=l)})}},{key:"changeDefinition",value:function(e,i){var r=this,s=this.config.definition;if(Array.isArray(s==null?void 0:s.list)&&s.list.forEach(function(u){(e==null?void 0:e.definition)===u.definition&&(r.curDefinition=u)}),e!=null&&e.bitrate&&typeof e.bitrate!="number"&&(e.bitrate=parseInt(e.bitrate,10)||0),this.emit(zr,{from:i,to:e}),!this.hasStart){this.config.url=e.url;return}var l=this.switchURL(e.url,X({seamless:s.seamless!==!1&&typeof MediaSource<"u"&&typeof MediaSource.isTypeSupported=="function"},e));l&&l.then?l.then(function(){r.emit(_r,{from:i,to:e})}):this.emit(_r,{from:i,to:e})}},{key:"reload",value:function(){this.load(),this.reloadFunc=function(){this.play()},this.once(Te,this.reloadFunc)}},{key:"resetState",value:function(){var e=this,i=T.NOT_ALLOW_AUTOPLAY,r=T.PLAYING,s=T.NO_START,l=T.PAUSED,u=T.REPLAY,f=T.ENTER,h=T.ENDED,g=T.ERROR,p=T.LOADING,v=[i,r,s,l,u,f,h,g,p];this.hasStart=!1,this.isError=!1,this._useAutoplay=!1,this.mediaPause(),this._accPlayed.acc=0,this._accPlayed.t=0,this._accPlayed.loopAcc=0,v.forEach(function(y){e.removeClass(y)}),this.addClass(T.NO_START),this.emit(Zt)}},{key:"reset",value:function(){var e=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=arguments.length>1?arguments[1]:void 0;this.resetState();var s=this.plugins;if(s&&(i.map(function(u){e.deregister(u)}),r)){var l=Ts();Object.keys(this.config).forEach(function(u){e.config[u]!=="undefined"&&(u==="plugins"||u==="presets"||u==="el"||u==="id")&&(e.config[u]=l[u])})}}},{key:"destroy",value:function(){var e,i=this,r=this.innerContainer,s=this.root,l=this.media;if(!(!s||!l)){if(this.hasStart=!1,this._useAutoplay=!1,s.removeAttribute(De),l.removeAttribute(De),this.updateAcc("destroy"),this._unbindEvents(),this._detachSourceEvents(this.media),d.clearAllTimers(this),this.emit(Ur),(e=Pe)===null||e===void 0||e.remove(this),ee.destroy(this),Pl(this),F(O(n.prototype),"destroy",this).call(this),this.fullscreen&&this._fullscreenEl===this.root&&this.exitFullscreen(),r)for(var u=r.children,f=0;f<u.length;f++)r.removeChild(u[f]);!r&&l instanceof window.Node&&s.contains(l)&&!this.config.remainMediaAfterDestroy&&s.removeChild(l),["topBar","leftBar","rightBar","innerContainer"].map(function(g){i[g]&&s.removeChild(i[g]),i[g]=null});var h=s.className.split(" ");h.length>0?s.className=h.filter(function(g){return g.indexOf("xgplayer")<0}).join(" "):s.className="",this.removeAttribute("data-xgfill"),["isSeeking","isCanplay","isActive","cssfullscreen","fullscreen"].forEach(function(g){i[g]=!1})}}},{key:"replay",value:function(){var e=this;this.removeClass(T.ENDED),this.currentTime=0,this.isSeeking=!1,me(this,"replay",function(){e.once(we,function(){var i=e.mediaPlay();i&&i.catch&&i.catch(function(r){console.log(r)})}),e.emit(Dt),e.onPlay()})}},{key:"retry",value:function(){var e=this;this.removeClass(T.ERROR),this.addClass(T.LOADING),me(this,"retry",function(){var i=e.currentTime,r=e.config.url,s=d.isMSE(e.media)?{url:r}:e.preProcessUrl(r);e.src=s.url,!e.config.isLive&&(e.currentTime=i),e.once(be,function(){e.mediaPlay()})})}},{key:"changeFullStyle",value:function(e,i,r,s){e&&(s||(s=T.PARENT_FULLSCREEN),this._orgCss||(this._orgCss=d.filterStyleFromText(e)),d.addClass(e,r),i&&i!==e&&!this._orgPCss&&(this._orgPCss=d.filterStyleFromText(i),d.addClass(i,s),i.setAttribute(De,this.playerId)))}},{key:"recoverFullStyle",value:function(e,i,r,s){s||(s=T.PARENT_FULLSCREEN),this._orgCss&&(d.setStyleFromCsstext(e,this._orgCss),this._orgCss=""),d.removeClass(e,r),i&&i!==e&&this._orgPCss&&(d.setStyleFromCsstext(i,this._orgPCss),this._orgPCss="",d.removeClass(i,s),i.removeAttribute(De))}},{key:"getFullscreen",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.config.fullscreenTarget,i=this.root,r=this.media;(e==="video"||e==="media")&&(e=this[e]),e||(e=i),this._fullScreenOffset={top:d.scrollTop(),left:d.scrollLeft()},this._fullscreenEl=e,this._fullActionFrom="get";var s=d.getFullScreenEl();if(s===this._fullscreenEl)return this.onFullscreenChange(),Promise.resolve();try{for(var l=0;l<ps.length;l++){var u=ps[l];if(e[u]){var f=u==="webkitRequestFullscreen"?e.webkitRequestFullscreen(window.Element.ALLOW_KEYBOARD_INPUT):e[u]();return f&&f.then?f:Promise.resolve()}}return r.fullscreenEnabled||r.webkitSupportsFullscreen?(r.webkitEnterFullscreen(),Promise.resolve()):Promise.reject(new Error("call getFullscreen fail"))}catch{return Promise.reject(new Error("call getFullscreen fail"))}}},{key:"exitFullscreen",value:function(e){if(this.isRotateFullscreen&&this.exitRotateFullscreen(),!(!this._fullscreenEl&&!d.getFullScreenEl())){this.root;var i=this.media;this._fullActionFrom="exit";try{for(var r=0;r<vs.length;r++){var s=vs[r];if(document[s]){var l=document[s]();return l&&l.then?l:Promise.resolve()}}return i&&i.webkitSupportsFullscreen?(i.webkitExitFullScreen(),Promise.resolve()):Promise.reject(new Error("call exitFullscreen fail"))}catch{return Promise.reject(new Error("call exitFullscreen fail"))}}}},{key:"getCssFullscreen",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.config.fullscreenTarget;this.isRotateFullscreen?this.exitRotateFullscreen():this.fullscreen&&this.exitFullscreen();var i=e?"".concat(T.INNER_FULLSCREEN," ").concat(T.CSS_FULLSCREEN):T.CSS_FULLSCREEN;this.changeFullStyle(this.root,e,i);var r=this.config.fullscreen,s=r===void 0?{}:r,l=s.useCssFullscreen===!0||typeof s.useCssFullscreen=="function"&&s.useCssFullscreen();l&&(this.fullscreen=!0,this.emit(ke,!0)),this._cssfullscreenEl=e,this.cssfullscreen=!0,this.emit(Rt,!0)}},{key:"exitCssFullscreen",value:function(){var e=this._cssfullscreenEl?"".concat(T.INNER_FULLSCREEN," ").concat(T.CSS_FULLSCREEN):T.CSS_FULLSCREEN;if(!this.fullscreen)this.recoverFullStyle(this.root,this._cssfullscreenEl,e);else{var i=this.config.fullscreen,r=i===void 0?{}:i,s=r.useCssFullscreen===!0||typeof r.useCssFullscreen=="function"&&r.useCssFullscreen();s?(this.recoverFullStyle(this.root,this._cssfullscreenEl,e),this.fullscreen=!1,this.emit(ke,!1)):this.removeClass(e)}this._cssfullscreenEl=null,this.cssfullscreen=!1,this.emit(Rt,!1)}},{key:"getRotateFullscreen",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.config.fullscreenTarget;this.cssfullscreen&&this.exitCssFullscreen(e);var i=e?"".concat(T.INNER_FULLSCREEN," ").concat(T.ROTATE_FULLSCREEN):T.ROTATE_FULLSCREEN;this._fullscreenEl=e||this.root,this.changeFullStyle(this.root,e,i,T.PARENT_ROTATE_FULLSCREEN),this.isRotateFullscreen=!0,this.fullscreen=!0,this.setRotateDeg(90),this._rootStyle=this.root.getAttribute("style");var r=Math.abs(window.orientation)===90||Math.abs(screen.orientation.angle)===90;this.root.style.width=r?"".concat(window.innerWidth,"px"):"".concat(window.innerHeight,"px"),this.emit(ke,!0)}},{key:"exitRotateFullscreen",value:function(e){var i=this._fullscreenEl!==this.root?"".concat(T.INNER_FULLSCREEN," ").concat(T.ROTATE_FULLSCREEN):T.ROTATE_FULLSCREEN;this.recoverFullStyle(this.root,this._fullscreenEl,i,T.PARENT_ROTATE_FULLSCREEN),this.isRotateFullscreen=!1,this.fullscreen=!1,this.setRotateDeg(0),this.emit(ke,!1),this._rootStyle&&(this.root.style.style=this._rootStyle,this._rootStyle=!1)}},{key:"setRotateDeg",value:function(e){window.orientation===90||window.orientation===-90?this.rotateDeg=0:this.rotateDeg=e}},{key:"focus",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{autoHide:!this.config.closeDelayBlur,delay:this.config.inactive};if(this.isActive){this.onFocus(e);return}this.emit(Br,X({paused:this.paused,ended:this.ended},e))}},{key:"blur",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{ignorePaused:!1};if(!this.isActive){this.onBlur(e);return}this._clearUserTimer(),this.emit(dl,X({paused:this.paused,ended:this.ended},e))}},{key:"onFocus",value:function(){var e=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{autoHide:!0,delay:3e3},r=this.innerStates;if(this.isActive=!0,this.removeClass(T.INACTIVE),this._clearUserTimer(),i.isLock!==void 0&&(r.isActiveLocked=i.isLock),i.autoHide===!1||i.isLock===!0||r.isActiveLocked){this._clearUserTimer();return}var s=i&&i.delay?i.delay:this.config.inactive;this.userTimer=d.setTimeout(this,function(){e.userTimer=null,e.blur()},s)}},{key:"onBlur",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=e.ignorePaused,r=i===void 0?!1:i;if(!this.innerStates.isActiveLocked){var s=this.config.closePauseVideoFocus;this.isActive=!1,(r||s||!this.paused&&!this.ended)&&this.addClass(T.INACTIVE)}}},{key:"onEmptied",value:function(){this.updateAcc("emptied")}},{key:"onCanplay",value:function(){this.removeClass(T.ENTER),this.removeClass(T.ERROR),this.removeClass(T.LOADING),this.isCanplay=!0,this.waitTimer&&d.clearTimeout(this,this.waitTimer)}},{key:"onLoadeddata",value:function(){var e=this;this.isError=!1,this.isSeeking=!1,this.__startTime>0&&(this.duration>0?this._seekToStartTime():this.once(Se,function(){e._seekToStartTime()}))}},{key:"onLoadstart",value:function(){this.removeClass(T.ERROR),this.isCanplay=!1}},{key:"onPlay",value:function(){this.state===U.ENDED&&this.setState(U.RUNNING),this.removeClass(T.PAUSED),this.ended&&this.removeClass(T.ENDED),!this.config.closePlayVideoFocus&&this.focus()}},{key:"onPause",value:function(){this.addClass(T.PAUSED),this.updateAcc("pause"),this.config.closePauseVideoFocus||(this._clearUserTimer(),this.focus())}},{key:"onEnded",value:function(){this.updateAcc("ended"),this.addClass(T.ENDED),this.setState(U.ENDED)}},{key:"onError",value:function(){this.isError=!0,this.updateAcc("error"),this.removeClass(T.NOT_ALLOW_AUTOPLAY),this.removeClass(T.NO_START),this.removeClass(T.ENTER),this.removeClass(T.LOADING),this.addClass(T.ERROR)}},{key:"onSeeking",value:function(){this.isSeeking||this.updateAcc("seeking"),this.isSeeking=!0,this.addClass(T.SEEKING)}},{key:"onSeeked",value:function(){this.isSeeking=!1,this.waitTimer&&d.clearTimeout(this,this.waitTimer),this.removeClass(T.LOADING),this.removeClass(T.SEEKING)}},{key:"onWaiting",value:function(){var e=this;this.waitTimer&&d.clearTimeout(this,this.waitTimer),this.updateAcc("waiting"),this.waitTimer=d.setTimeout(this,function(){e.addClass(T.LOADING),e.emit(ml),d.clearTimeout(e,e.waitTimer),e.waitTimer=null},this.config.minWaitDelay)}},{key:"onPlaying",value:function(){var e=this;this.isError=!1;var i=T.NO_START,r=T.PAUSED,s=T.ENDED,l=T.ERROR,u=T.REPLAY,f=T.LOADING,h=[i,r,s,l,u,f];h.forEach(function(g){e.removeClass(g)}),!this._accPlayed.t&&!this.paused&&!this.ended&&(this._accPlayed.t=new Date().getTime())}},{key:"onTimeupdate",value:function(){!this._videoHeight&&this.media.videoHeight&&this.resize(),(this.waitTimer||this.hasClass(T.LOADING))&&this.media.readyState>2&&(this.removeClass(T.LOADING),d.clearTimeout(this,this.waitTimer),this.waitTimer=null),!this.paused&&this.state===U.NOTALLOW&&this.duration&&(this.setState(U.RUNNING),this.emit(He)),!this._accPlayed.t&&!this.paused&&!this.ended&&(this._accPlayed.t=new Date().getTime())}},{key:"onVolumechange",value:function(){d.typeOf(this.config.volume)==="Number"&&(this.config.volume=this.volume)}},{key:"onRatechange",value:function(){this.config.defaultPlaybackRate=this.playbackRate}},{key:"emitUserAction",value:function(e,i,r){if(!(!this.media||!i||!e)){var s=d.typeOf(e)==="String"?e:e.type||"";r.props&&d.typeOf(r.props)!=="Array"&&(r.props=[r.props]),this.emit(Mt,X({eventType:s,action:i,currentTime:this.currentTime,duration:this.duration,ended:this.ended,event:e},r))}}},{key:"updateAcc",value:function(e){if(this._accPlayed.t){var i=new Date().getTime()-this._accPlayed.t;this._accPlayed.acc+=i,this._accPlayed.t=0,(e==="ended"||this.ended)&&(this._accPlayed.loopAcc=this._accPlayed.acc)}}},{key:"checkBuffer",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{startDiff:0,endDiff:0},r=i||{},s=r.startDiff,l=s===void 0?0:s,u=r.endDiff,f=u===void 0?0:u,h=this.media.buffered;if(!h||h.length===0||!this.duration)return!0;for(var g=e||this.media.currentTime||.2,p=h.length,v=0;v<p;v++)if(h.start(v)+l<=g&&h.end(v)-f>g)return!0;return!1}},{key:"resizePosition",value:function(){var e=this,i=this.videoPos,r=i.vy,s=i.vx,l=i.h,u=i.w,f=this.videoPos.rotate;if(!(f<0&&l<0&&u<0)){var h=this.videoPos._pi;if(!h&&this.media.videoHeight&&(h=this.media.videoWidth/this.media.videoHeight*100),!!h){this.videoPos.pi=h,f=f<0?0:f;var g={rotate:f},p=0,v=0,y=1,m=Math.abs(f/90),b=this.root,k=this.innerContainer,w=b.offsetWidth,S=k?k.offsetHeight:b.offsetHeight,E={},P=S,A=w;if(m%2===0)y=l>0?100/l:u>0?100/u:1,g.scale=y,p=r>0?(100-l)/2-r:0,g.y=m===2?0-p:p,v=s>0?(100-u)/2-s:0,g.x=m===2?0-v:v,E.width="".concat(A,"px"),E.height="".concat(P,"px"),E.maxWidth="",E.maxHeight="";else if(m%2===1){A=S,P=w;var q=S-w;v=-q/2/A*100,g.x=m===3?v+r/2:v-r/2,p=q/2/P*100,g.y=m===3?p+s/2:p-s/2,g.scale=y,E.width="".concat(A,"px"),E.maxWidth="".concat(A,"px"),E.height="".concat(P,"px"),E.maxHeight="".concat(P,"px")}var H=d.getTransformStyle(g,this.media.style.transform||this.media.style.webkitTransform);E.transform=H,E.webkitTransform=H,Object.keys(E).map(function(N){e.media.style[N]=E[N]})}}}},{key:"position",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{h:0,y:0,x:0,w:0};if(!(!this.media||!e||!e.h)){var i=this.videoPos;i.h=e.h*100||0,i.w=e.w*100||0,i.vx=e.x*100||0,i.vy=e.y*100||0,this.resizePosition()}}},{key:"setConfig",value:function(e){var i=this;e&&Object.keys(e).map(function(r){if(r!=="plugins"){i.config[r]=e[r];var s=i.plugins[r.toLowerCase()];s&&d.typeOf(s.setConfig)==="Function"&&s.setConfig(e[r])}})}},{key:"playNext",value:function(e){var i=this;this.resetState(),this.setConfig(e),this._currentTime=0,this._duration=0,me(this,"playnext",function(){i.start(),i.emit(Nt,e)})}},{key:"resize",value:function(){var e=this;if(!(!this.media||!this.root)){var i=this.root.getBoundingClientRect();this.sizeInfo.width=i.width,this.sizeInfo.height=i.height,this.sizeInfo.left=i.left,this.sizeInfo.top=i.top;var r=this.media,s=r.videoWidth,l=r.videoHeight,u=this.config,f=u.fitVideoSize,h=u.videoFillMode;if((h==="fill"||h==="cover"||h==="contain")&&this.setAttribute("data-xgfill",h),!(!l||!s)){this._videoHeight=l,this._videoWidth=s;var g=this.controls&&this.innerContainer?this.controls.root.getBoundingClientRect().height:0,p=i.width,v=i.height-g,y=parseInt(s/l*1e3,10),m=parseInt(p/v*1e3,10),b=p,k=v,w={};f==="auto"&&m>y||f==="fixWidth"?(k=p/y*1e3,this.config.fluid?w.paddingTop="".concat(k*100/b,"%"):w.height="".concat(k+g,"px")):(f==="auto"&&m<y||f==="fixHeight")&&(b=y*v/1e3,w.width="".concat(b,"px")),!this.fullscreen&&!this.cssfullscreen&&Object.keys(w).forEach(function(E){e.root.style[E]=w[E]}),(h==="fillHeight"&&m<y||h==="fillWidth"&&m>y)&&this.setAttribute("data-xgfill","cover");var S={videoScale:y,vWidth:b,vHeight:k,cWidth:b,cHeight:k+g};this.resizePosition(),this.emit(Re,S)}}}},{key:"updateObjectPosition",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(this.media.updateObjectPosition){this.media.updateObjectPosition(e,i);return}this.media.style.objectPosition="".concat(e*100,"% ").concat(i*100,"%")}},{key:"setState",value:function(e){V.logInfo("setState","state from:".concat(Es[this.state]," to:").concat(Es[e])),this._state=e}},{key:"preProcessUrl",value:function(e,i){var r=this.config,s=r.preProcessUrl,l=r.preProcessUrlOptions,u=Object.assign({},l,i);return!d.isBlob(e)&&typeof s=="function"?s(e,u):{url:e}}},{key:"_seekToStartTime",value:function(){this.__startTime>0&&this.duration>0&&(this.currentTime=this.__startTime>this.duration?this.duration:this.__startTime,this.__startTime=-1)}},{key:"state",get:function(){return this._state}},{key:"isFullscreen",get:function(){return this.fullscreen}},{key:"isCssfullScreen",get:function(){return this.cssfullscreen}},{key:"hasStart",get:function(){return this._hasStart},set:function(e){typeof e=="boolean"&&(this._hasStart=e,e===!1&&this.setState(U.READY),this.emit("hasstart"))}},{key:"isPlaying",get:function(){return this._state===U.RUNNING||this._state===U.ENDED},set:function(e){e?this.setState(U.RUNNING):this._state>=U.RUNNING&&this.setState(U.ATTACHED)}},{key:"definitionList",get:function(){return!this.config||!this.config.definition?[]:this.config.definition.list||[]},set:function(e){var i=this,r=this.config.definition,s=null,l=null;r.list=e,this.emit("resourceReady",e),e.forEach(function(u){var f;((f=i.curDefinition)===null||f===void 0?void 0:f.definition)===u.definition&&(s=u),r.defaultDefinition===u.definition&&(l=u)}),!l&&e.length>0&&(l=e[0]),s?this.changeDefinition(s):l&&this.changeDefinition(l)}},{key:"videoFrameInfo",get:function(){var e={total:0,dropped:0,corrupted:0,droppedRate:0,droppedDuration:0};if(!this.media||!this.media.getVideoPlaybackQuality)return e;var i=this.media.getVideoPlaybackQuality();return e.dropped=i.droppedVideoFrames||0,e.total=i.totalVideoFrames||0,e.corrupted=i.corruptedVideoFrames||0,e.total>0&&(e.droppedRate=e.dropped/e.total*100,e.droppedDuration=parseInt(this.cumulateTime/e.total*e.dropped,0)),e}},{key:"lang",get:function(){return this.config.lang},set:function(e){var i=Qe.langKeys.filter(function(r){return r===e});if(i.length===0&&e!=="zh"){console.error("Sorry, set lang fail, because the language [".concat(e,"] is not supported now, list of all supported languages is [").concat(Qe.langKeys.join(),"] "));return}this.config.lang=e,ee.setLang(e,this)}},{key:"i18n",get:function(){var e=this.config.lang;return e==="zh"&&(e="zh-cn"),this.__i18n.lang[e]||this.__i18n.lang.en}},{key:"i18nKeys",get:function(){return this.__i18n.textKeys||{}}},{key:"version",get:function(){return mr}},{key:"playerId",get:function(){return this._pluginInfoId}},{key:"url",get:function(){return this.__url||this.config.url},set:function(e){this.__url=e}},{key:"poster",get:function(){return this.plugins.poster?this.plugins.poster.config.poster:this.config.poster},set:function(e){this.plugins.poster&&this.plugins.poster.update(e)}},{key:"readyState",get:function(){return F(O(n.prototype),"readyState",this)}},{key:"error",get:function(){var e=F(O(n.prototype),"error",this);return this.i18n[e]||e}},{key:"networkState",get:function(){return F(O(n.prototype),"networkState",this)}},{key:"fullscreenChanging",get:function(){return this._fullScreenOffset!==null}},{key:"cumulateTime",get:function(){var e=this._accPlayed,i=e.acc,r=e.t;return r?new Date().getTime()-r+i:i}},{key:"zoom",get:function(){return this.config.zoom},set:function(e){this.config.zoom=e}},{key:"videoRotateDeg",get:function(){return this.videoPos.rotate},set:function(e){e=d.convertDeg(e),!(e%90!==0||e===this.videoPos.rotate)&&(this.videoPos.rotate=e,this.resizePosition())}},{key:"avgSpeed",get:function(){return xs},set:function(e){xs=e}},{key:"realTimeSpeed",get:function(){return Ss},set:function(e){Ss=e}},{key:"offsetCurrentTime",get:function(){return this._offsetInfo.currentTime||0},set:function(e){this._offsetInfo.currentTime=e}},{key:"offsetDuration",get:function(){return this._offsetInfo.duration||0},set:function(e){this._offsetInfo.duration=e||0}},{key:"hook",value:function(e,i){return Ft.call.apply(Ft,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,i){return Bt.call.apply(Bt,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,i){return Ht.call.apply(Ht,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"usePluginHooks",value:function(e,i,r){for(var s=arguments.length,l=new Array(s>3?s-3:0),u=3;u<s;u++)l[u-3]=arguments[u];return ms.call.apply(ms,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removePluginHooks",value:function(e,i,r){for(var s=arguments.length,l=new Array(s>3?s-3:0),u=3;u<s;u++)l[u-3]=arguments[u];return ys.call.apply(ys,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"setUserActive",value:function(e,i){var r;typeof i=="boolean"&&i!==this.muted&&(this.addInnerOP("volumechange"),d.typeOf(i)===Boolean&&(this.muted=i)),(r=Pe)===null||r===void 0||r.setActive(this.playerId,e)}}],[{key:"debugger",get:function(){return V.config.debug},set:function(e){V.config.debug=e}},{key:"instManager",get:function(){return Pe},set:function(e){Pe=e}},{key:"getCurrentUserActivePlayerId",value:function(){var e;return(e=Pe)===null||e===void 0?void 0:e.getActiveId()}},{key:"setCurrentUserActive",value:function(e,i){var r;(r=Pe)===null||r===void 0||r.setActive(e,i)}},{key:"isHevcSupported",value:function(){return B.isHevcSupported()}},{key:"probeConfigSupported",value:function(e){return B.probeConfigSupported(e)}},{key:"install",value:function(e,i){n.plugins||(n.plugins={}),n.plugins[e]||(n.plugins[e]=i)}},{key:"use",value:function(e,i){n.plugins||(n.plugins={}),n.plugins[e]=i}}]),n})(kh);C(Jt,"defaultPreset",null);C(Jt,"XgVideoProxy",null);Jt.instManager=Ll.getInstance();function Ne(a,o,n){try{return' <div class="xg-tips '.concat(n?"hide":" ",'" lang-key="').concat(a.i18nKeys[o],`">
|
|
13
|
-
`).concat(a.i18n[o],`
|
|
14
|
-
</div>`)}catch{return'<div class="xg-tips hide"></div>'}}var je=(function(a){D(n,a);var o=R(n);function n(){var t;x(this,n);for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return t=o.call.apply(o,[this].concat(i)),C(_(t),"_onMouseenter",function(s){t.emit("icon_mouseenter",{pluginName:t.pluginName})}),C(_(t),"_onMouseLeave",function(s){t.emit("icon_mouseleave",{pluginName:t.pluginName})}),t}return I(n,[{key:"afterCreate",value:function(){this.bind("mouseenter",this._onMouseenter),this.bind("mouseleave",this._onMouseLeave),this.config.disable&&this.disable()}},{key:"destroy",value:function(){this.unbind("mouseenter",this._onMouseenter),this.unbind("mouseleave",this._onMouseLeave)}}]),n})(j);function Uh(){return new DOMParser().parseFromString(`<svg xmlns="http://www.w3.org/2000/svg" width="31" height="40" viewBox="0 -5 31 40">
|
|
15
|
-
<path fill="#fff" transform="scale(1.3, 1.3)" class='path_full' d="M9,10v1a.9.9,0,0,1-1,1,.9.9,0,0,1-1-1V9A.9.9,0,0,1,8,8h2a.9.9,0,0,1,1,1,.9.9,0,0,1-1,1Zm6,4V13a1,1,0,0,1,2,0v2a.9.9,0,0,1-1,1H14a1,1,0,0,1,0-2Zm3-7H6V17H18Zm2,0V17a2,2,0,0,1-2,2H6a2,2,0,0,1-2-2V7A2,2,0,0,1,6,5H18A2,2,0,0,1,20,7Z"></path>
|
|
16
|
-
</svg>
|
|
17
|
-
`,"image/svg+xml").firstChild}function zh(){return new DOMParser().parseFromString(`<svg xmlns="http://www.w3.org/2000/svg" width="31" height="40" viewBox="0 -5 31 40">
|
|
18
|
-
<path fill="#fff" transform="scale(1.3, 1.3)" d="M9,10V9a.9.9,0,0,1,1-1,.9.9,0,0,1,1,1v2a.9.9,0,0,1-1,1H8a.9.9,0,0,1-1-1,.9.9,0,0,1,1-1Zm6,4v1a1,1,0,0,1-2,0V13a.9.9,0,0,1,1-1h2a1,1,0,0,1,0,2Zm3-7H6V17H18Zm2,0V17a2,2,0,0,1-2,2H6a2,2,0,0,1-2-2V7A2,2,0,0,1,6,5H18A2,2,0,0,1,20,7Z"></path>
|
|
19
|
-
</svg>
|
|
20
|
-
`,"image/svg+xml").firstChild}var kr=(function(a){D(n,a);var o=R(n);function n(){return x(this,n),o.apply(this,arguments)}return I(n,[{key:"beforeCreate",value:function(e){typeof e.player.config.cssFullscreen=="boolean"&&(e.config.disable=!e.player.config.cssFullscreen)}},{key:"afterCreate",value:function(){var e=this;F(O(n.prototype),"afterCreate",this).call(this),!this.config.disable&&(this.config.target&&(this.playerConfig.fullscreenTarget=this.config.target),this.initIcons(),this.on(Rt,function(i){e.animate(i)}),this.btnClick=this.btnClick.bind(this),this.handleCssFullscreen=this.hook("cssFullscreen_change",this.btnClick,{pre:function(r){r.preventDefault(),r.stopPropagation()}}),this.bind(["click","touchend"],this.handleCssFullscreen))}},{key:"initIcons",value:function(){var e=this.icons,i=this.find(".xgplayer-icon");i.appendChild(e.cssFullscreen),i.appendChild(e.exitCssFullscreen)}},{key:"btnClick",value:function(e){e.preventDefault(),e.stopPropagation();var i=this.player.isCssfullScreen;this.emitUserAction(e,"switch_cssfullscreen",{cssfullscreen:i}),i?this.player.exitCssFullscreen():this.player.getCssFullscreen()}},{key:"animate",value:function(e){this.root&&(e?this.setAttr("data-state","full"):this.setAttr("data-state","normal"),this.switchTips(e))}},{key:"switchTips",value:function(e){var i=this.i18nKeys,r=this.find(".xg-tips");r&&this.changeLangTextKey(r,e?i.EXITCSSFULLSCREEN_TIPS:i.CSSFULLSCREEN_TIPS)}},{key:"registerIcons",value:function(){return{cssFullscreen:{icon:Uh,class:"xg-get-cssfull"},exitCssFullscreen:{icon:zh,class:"xg-exit-cssfull"}}}},{key:"destroy",value:function(){F(O(n.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.btnClick)}},{key:"render",value:function(){if(!this.config.disable)return`<xg-icon class='xgplayer-cssfullscreen'>
|
|
21
|
-
<div class="xgplayer-icon">
|
|
22
|
-
</div>
|
|
23
|
-
`.concat(Ne(this,"CSSFULLSCREEN_TIPS",this.playerConfig.isHideTips),`
|
|
24
|
-
</xg-icon>`)}}],[{key:"pluginName",get:function(){return"cssFullscreen"}},{key:"defaultConfig",get:function(){return{position:K.CONTROLS_RIGHT,index:1,disable:!1,target:null}}}]),n})(je);function jh(){return new DOMParser().parseFromString(`<svg width="32px" height="40px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
25
|
-
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
26
|
-
<path d="M11.2374369,14 L17.6187184,7.61871843 C17.9604272,7.27700968 17.9604272,6.72299032 17.6187184,6.38128157 C17.2770097,6.03957281 16.7229903,6.03957281 16.3812816,6.38128157 L9.38128157,13.3812816 C9.03957281,13.7229903 9.03957281,14.2770097 9.38128157,14.6187184 L16.3812816,21.6187184 C16.7229903,21.9604272 17.2770097,21.9604272 17.6187184,21.6187184 C17.9604272,21.2770097 17.9604272,20.7229903 17.6187184,20.3812816 L11.2374369,14 L11.2374369,14 Z" fill="#FFFFFF"></path>
|
|
27
|
-
</g>
|
|
28
|
-
</svg>`,"image/svg+xml").firstChild}var qh=(function(a){D(n,a);var o=R(n);function n(){return x(this,n),o.apply(this,arguments)}return I(n,[{key:"afterCreate",value:function(){var e=this;this.initIcons(),this.onClick=function(i){i.preventDefault(),i.stopPropagation(),e.config.onClick(i)},this.bind(["click","touchend"],this.onClick)}},{key:"registerIcons",value:function(){return{screenBack:{icon:jh,class:"xg-fullscreen-back"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(this.root,e.screenBack)}},{key:"show",value:function(){d.addClass(this.root,"show")}},{key:"hide",value:function(){d.removeClass(this.root,"show")}},{key:"render",value:function(){return`<xg-icon class="xgplayer-back">
|
|
29
|
-
</xg-icon>`}}],[{key:"pluginName",get:function(){return"topbackicon"}},{key:"defaultConfig",get:function(){return{position:K.ROOT_TOP,index:0}}}]),n})(j);function Gh(){return new DOMParser().parseFromString(`<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="2 -4 28 40">
|
|
30
|
-
<path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M598 214h212v212h-84v-128h-128v-84zM726 726v-128h84v212h-212v-84h128zM214 426v-212h212v84h-128v128h-84zM298 598v128h128v84h-212v-212h84z"></path>
|
|
31
|
-
</svg>
|
|
32
|
-
`,"image/svg+xml").firstChild}function Wh(){return new DOMParser().parseFromString(`<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="2 -4 28 40">
|
|
33
|
-
<path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M682 342h128v84h-212v-212h84v128zM598 810v-212h212v84h-128v128h-84zM342 342v-128h84v212h-212v-84h128zM214 682v-84h212v212h-84v-128h-128z"></path>
|
|
34
|
-
</svg>
|
|
35
|
-
`,"image/svg+xml").firstChild}var Dl=(function(a){D(n,a);var o=R(n);function n(){var t;x(this,n);for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return t=o.call.apply(o,[this].concat(i)),C(_(t),"_onOrientationChange",function(s){t.player.fullscreen&&t.config.rotateFullscreen&&(window.orientation===90||window.orientation===-90?t.player.setRotateDeg(0):t.player.setRotateDeg(90))}),t}return I(n,[{key:"afterCreate",value:function(){var e=this;F(O(n.prototype),"afterCreate",this).call(this);var i=this.config,r=this.playerConfig;if(!i.disable){i.target&&(this.playerConfig.fullscreenTarget=this.config.target);var s=d.getFullScreenEl();r.fullscreenTarget===s&&this.player.getFullscreen().catch(function(l){}),this.initIcons(),this.handleFullscreen=this.hook("fullscreenChange",this.toggleFullScreen,{pre:function(u){var f=e.player.fullscreen;e.emitUserAction(u,"switch_fullscreen",{prop:"fullscreen",from:f,to:!f})}}),this.bind(".xgplayer-fullscreen",["touchend","click"],this.handleFullscreen),this.on(ke,function(l){var u=e.find(".xg-tips");u&&e.changeLangTextKey(u,l?e.i18nKeys.EXITFULLSCREEN_TIPS:e.i18nKeys.FULLSCREEN_TIPS),e.animate(l)}),this.config.needBackIcon&&(this.topBackIcon=this.player.registerPlugin({plugin:qh,options:{config:{onClick:function(u){e.handleFullscreen(u)}}}})),B.device==="mobile"&&window.addEventListener("orientationchange",this._onOrientationChange)}}},{key:"registerIcons",value:function(){return{fullscreen:{icon:Gh,class:"xg-get-fullscreen"},exitFullscreen:{icon:Wh,class:"xg-exit-fullscreen"}}}},{key:"destroy",value:function(){F(O(n.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon",B.device==="mobile"?"touchend":"click",this.handleFullscreen),B.device==="mobile"&&window.removeEventListener("orientationchange",this._onOrientationChange)}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.fullscreen),this.appendChild(".xgplayer-icon",e.exitFullscreen)}},{key:"toggleFullScreen",value:function(e){e instanceof Event&&(e.preventDefault(),e.stopPropagation());var i=this.player,r=this.config,s=r.useCssFullscreen===!0||typeof r.useCssFullscreen=="function"&&r.useCssFullscreen();s?(i.fullscreen?i.exitCssFullscreen():i.getCssFullscreen(),this.animate(i.fullscreen)):r.rotateFullscreen?(i.fullscreen?i.exitRotateFullscreen():i.getRotateFullscreen(),this.animate(i.fullscreen)):r.switchCallback&&typeof r.switchCallback=="function"?r.switchCallback(i.fullscreen):i.fullscreen?(i.exitFullscreen(),r.useScreenOrientation&&this.unlockScreen()):(i.getFullscreen().catch(function(l){}),r.useScreenOrientation&&i.aspectRatio>1&&this.lockScreen(r.lockOrientationType))}},{key:"animate",value:function(e){e?this.setAttr("data-state","full"):this.setAttr("data-state","normal"),this.topBackIcon&&(e?(this.topBackIcon.show(),this.hide()):(this.topBackIcon.hide(),this.show()))}},{key:"render",value:function(){if(!this.config.disable){var e="FULLSCREEN_TIPS";return`<xg-icon class="xgplayer-fullscreen">
|
|
36
|
-
<div class="xgplayer-icon">
|
|
37
|
-
</div>
|
|
38
|
-
`.concat(Ne(this,e,this.playerConfig.isHideTips),`
|
|
39
|
-
</xg-icon>`)}}},{key:"lockScreen",value:function(e){try{screen.orientation.lock(e).catch(function(i){})}catch{}}},{key:"unlockScreen",value:function(){try{screen.orientation.unlock().catch(function(e){})}catch{}}}],[{key:"pluginName",get:function(){return"fullscreen"}},{key:"defaultConfig",get:function(){return{position:K.CONTROLS_RIGHT,index:0,useCssFullscreen:!1,rotateFullscreen:!1,useScreenOrientation:!1,lockOrientationType:"landscape",switchCallback:null,target:null,disable:!1,needBackIcon:!1}}}]),n})(je);function qr(){return new DOMParser().parseFromString(`<svg class="play" xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="3 -4 28 40">
|
|
40
|
-
<path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M576,363L810,512L576,661zM342,214L576,363L576,661L342,810z"></path>
|
|
41
|
-
</svg>
|
|
42
|
-
`,"image/svg+xml").firstChild}function Gr(){return new DOMParser().parseFromString(`<svg class="pause" xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="3 -4 28 40">
|
|
43
|
-
<path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M598,214h170v596h-170v-596zM256 810v-596h170v596h-170z"></path>
|
|
44
|
-
</svg>
|
|
45
|
-
`,"image/svg+xml").firstChild}var Rl=(function(a){D(n,a);var o=R(n);function n(){var t;x(this,n);for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return t=o.call.apply(o,[this].concat(i)),C(_(t),"btnClick",function(s){s.preventDefault(),s.stopPropagation();var l=_(t),u=l.player;return t.emitUserAction(s,"switch_play_pause",{prop:"paused",from:u.paused,to:!u.paused}),u.ended?u.replay():u.paused?(u.play(),t.animate(!1)):(u.pause(),t.animate(!0)),!1}),t}return I(n,[{key:"afterCreate",value:function(){F(O(n.prototype),"afterCreate",this).call(this);var e=this.config;e.disable||(this.initIcons(),this.bind(["touchend","click"],this.btnClick),this.listenEvents(),this.animate(!0))}},{key:"listenEvents",value:function(){var e=this,i=this.player;this.on([le,et,dt,ze],function(){e.animate(i.paused)})}},{key:"registerIcons",value:function(){return{play:{icon:qr,class:"xg-icon-play"},pause:{icon:Gr,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.play),this.appendChild(".xgplayer-icon",e.pause)}},{key:"animate",value:function(e){if(this.player){var i=this.i18nKeys,r=this.find(".xg-tips");e?(this.setAttr("data-state","pause"),r&&this.changeLangTextKey(r,i.PLAY_TIPS)):(this.setAttr("data-state","play"),r&&this.changeLangTextKey(r,i.PAUSE_TIPS))}}},{key:"destroy",value:function(){F(O(n.prototype),"destroy",this).call(this),this.unbind(["touchend","click"],this.btnClick)}},{key:"render",value:function(){if(!this.config.disable)return`<xg-icon class="xgplayer-play">
|
|
46
|
-
<div class="xgplayer-icon">
|
|
47
|
-
</div>
|
|
48
|
-
`.concat(Ne(this,"PLAY_TIPS",this.playerConfig.isHideTips),`
|
|
49
|
-
</xg-icon>`)}}],[{key:"pluginName",get:function(){return"play"}},{key:"defaultConfig",get:function(){return{position:K.CONTROLS_LEFT,index:0,disable:!1}}}]),n})(je),Kh=[{tag:"xg-cache",className:"xgplayer-progress-cache",styleKey:"cachedColor"},{tag:"xg-played",className:"xgplayer-progress-played",styleKey:"playedColor"}],$h=(function(){function a(o){x(this,a),this.fragments=o.fragments||[],this.fragments.length===0&&this.fragments.push({percent:1}),this._callBack=o.actionCallback,this.fragConfig={fragFocusClass:o.fragFocusClass||"inner-focus-point",fragAutoFocus:!!o.fragAutoFocus,fragClass:o.fragClass||""},this.style=o.style||{playedColor:"",cachedColor:"",progressColor:""},this.duration=0,this.cachedIndex=0,this.playedIndex=0,this.focusIndex=-1}return I(a,[{key:"updateDuration",value:function(n){var t=this;this.duration=n;var e=0,i=this.fragments;this.fragments=i.map(function(r){return r.start=parseInt(e,10),r.end=parseInt(e+r.percent*t.duration,10),r.duration=parseInt(r.percent*t.duration,10),e+=r.percent*t.duration,r})}},{key:"updateProgress",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"played",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{newIndex:0,curIndex:0,millisecond:0},e=this.progressList,i=this.fragments;if(!(e.length<1)){var r=t.newIndex,s=t.curIndex,l=t.millisecond;r!==s&&e.map(function(h,g){g<r?h[n].style.width="100%":g>r&&(h[n].style.width=0)});var u=i[r],f=l===0?0:(l-u.start)/u.duration;e[r][n].style.width=f<0?0:"".concat(f*100,"%")}}},{key:"updateFocus",value:function(n){if(!(!this.fragConfig.fragAutoFocus||this.fragments.length<2)){if(!n){if(this.focusIndex>-1){this.unHightLight(this.focusIndex);var t={index:-1,preIndex:this.focusIndex,fragment:null};this._callBack&&this._callBack(t),this.focusIndex=-1}return}var e=this.findIndex(n.currentTime*1e3,this.focusIndex);if(e>=0&&e!==this.focusIndex){this.focusIndex>-1&&this.unHightLight(this.focusIndex),this.setHightLight(e);var i={index:e,preIndex:this.focusIndex,fragment:this.fragments[this.focusIndex]};this.focusIndex=e,this._callBack&&this._callBack(i)}}}},{key:"update",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{cached:0,played:0},t=arguments.length>1?arguments[1]:void 0;if(!this.duration||parseInt(t*1e3,10)!==this.duration){if(!t&&t!==0)return;this.updateDuration(parseInt(t*1e3,10))}var e=this.playedIndex,i=this.cachedIndex;if(d.typeOf(n.played)!=="Undefined"){var r=this.findIndex(n.played*1e3,e);if(r<0)return;this.updateProgress("played",{newIndex:r,curIndex:e,millisecond:parseInt(n.played*1e3,10)}),this.playedIndex=r}if(d.typeOf(n.cached)!=="Undefined"){var s=this.findIndex(n.cached*1e3,i);if(s<0)return;this.updateProgress("cached",{newIndex:s,curIndex:i,millisecond:parseInt(n.cached*1e3,10)}),this.cachedIndex=s}}},{key:"findIndex",value:function(n,t){var e=this.fragments;if(!e||e.length===0)return-1;if(e.length===1)return 0;if(t>-1&&t<e.length&&n>e[t].start&&n<e[t].end)return t;if(n>e[e.length-1].start)return e.length-1;for(var i=0;i<e.length;i++)if(n>e[i].start&&n<=e[i].end){t=i;break}return t}},{key:"findHightLight",value:function(){for(var n=this.root.children,t=0;t<n.length;t++)if(d.hasClass(n[t],this.fragConfig.fragFocusClass))return{dom:n[t],pos:n[t].getBoundingClientRect()}}},{key:"findFragment",value:function(n){var t=this.root.children;return n<0||n>=t.length?null:{dom:t[n],pos:t[n].getBoundingClientRect()}}},{key:"unHightLight",value:function(){for(var n=this.root.children,t=0;t<n.length;t++)d.removeClass(n[t],this.fragConfig.fragFocusClass)}},{key:"setHightLight",value:function(n){var t=this.root.children;if(n<t.length)return d.addClass(t[n],this.fragConfig.fragFocusClass),{dom:t[n],pos:t[n].getBoundingClientRect()}}},{key:"destroy",value:function(){this.progressList=null,this.fragments=null,this.root.innerHTML=""}},{key:"reset",value:function(n){var t=this;if(Object.keys(this.fragConfig).forEach(function(i){n[i]!==void 0&&(t.fragConfig[i]=n[i])}),n.fragments){if(this.fragments=n.fragments.length===0?[{percent:1}]:n.fragments,this.updateDuration(this.duration),this.playedIndex=0,this.cachedIndex=0,this.root)for(var e=this.root.children;e.length>0;)this.root.removeChild(e[0]);this.render()}}},{key:"render",value:function(){var n=this,t=this.style.progressColor;if(this.root||(this.root=d.createDom("xg-inners","",{},"progress-list")),this.fragments){var e=this.fragConfig,i=e.fragClass,r=e.fragFocusClass;this.progressList=this.fragments.map(function(s){var l=d.createDom("xg-inner","",{style:t?"background:".concat(t,"; flex: ").concat(s.percent):"flex: ".concat(s.percent)},"".concat(s.isFocus?r:""," xgplayer-progress-inner ").concat(i));return n.root.appendChild(l),Kh.forEach(function(u){l.appendChild(d.createDom(u.tag,"",{style:u.styleKey?"background: ".concat(n.style[u.styleKey],"; width:0;"):"width:0;"},u.className))}),{cached:l.children[0],played:l.children[1]}})}return this.root}}]),a})(),Is={POINT:"inner-focus-point",HIGHLIGHT:"inner-focus-highlight"},Ol=(function(a){D(n,a);var o=R(n);function n(t){var e;return x(this,n),e=o.call(this,t),C(_(e),"onMoveOnly",function(i,r){var s=_(e),l=s.pos,u=s.config,f=s.player,h=r;if(i){d.event(i);var g=d.getEventPos(i,f.zoom),p=f.rotateDeg===90?g.clientY:g.clientX;if(l.moving&&Math.abs(l.x-p)<u.miniMoveStep)return;l.moving=!0,l.x=p,h=e.computeTime(i,p)}e.triggerCallbacks("dragmove",h,i),e._updateInnerFocus(h)}),C(_(e),"onBodyClick",function(i){e.pos.isLocked&&(e.pos.isLocked=!1,i.preventDefault(),i.stopPropagation())}),C(_(e),"_mouseDownHandler",function(i,r){e._state.time=r.currentTime,e.updateWidth(r.currentTime,r.seekTime,r.percent,0),e._updateInnerFocus(r)}),C(_(e),"_mouseUpHandler",function(i,r){var s=_(e),l=s.pos;l.moving&&e.updateWidth(r.currentTime,r.seekTime,r.percent,2)}),C(_(e),"_mouseMoveHandler",function(i,r){var s=_(e),l=s._state,u=s.pos,f=s.config,h=s.player;l.time<r.currentTime?r.forward=!0:r.forward=!1,l.time=r.currentTime,u.isDown&&!u.moving&&(u.moving=!0,f.isPauseMoving&&h.pause(),e.triggerCallbacks("dragstart",r,i),e.emitUserAction("drag","dragstart",r)),e.updateWidth(r.currentTime,r.seekTime,r.percent,1),e.triggerCallbacks("dragmove",r,i),e._updateInnerFocus(r)}),C(_(e),"onMouseDown",function(i){var r=_(e),s=r._state,l=r.player,u=r.pos,f=r.config,h=r.playerConfig,g=d.getEventPos(i,l.zoom),p=l.rotateDeg===90?g.clientY:g.clientX;if(!(l.isMini||f.closeMoveSeek||!h.allowSeekAfterEnded&&l.ended)){if(!l.duration&&!l.isPlaying){l.play();return}i.stopPropagation(),e.focus(),d.checkIsFunction(h.disableSwipeHandler)&&h.disableSwipeHandler(),d.checkIsFunction(f.onMoveStart)&&f.onMoveStart(),d.event(i),u.x=p,u.isDown=!0,u.moving=!1,s.prePlayTime=l.currentTime,l.focus({autoHide:!1}),e.isProgressMoving=!0,d.addClass(e.progressBtn,"active");var v=e.computeTime(i,p);v.prePlayTime=s.prePlayTime,e._mouseDownHandlerHook(i,v);var y=i.type;return y==="touchstart"?(e.root.addEventListener("touchmove",e.onMouseMove),e.root.addEventListener("touchend",e.onMouseUp),e.root.addEventListener("touchcancel",e.onMouseUp)):(e.unbind("mousemove",e.onMoveOnly),document.addEventListener("mousemove",e.onMouseMove,!1),document.addEventListener("mouseup",e.onMouseUp,!1)),!0}}),C(_(e),"onMouseUp",function(i){var r=_(e),s=r.player,l=r.config,u=r.pos,f=r.playerConfig,h=r._state;if(u){i.stopPropagation(),i.preventDefault(),d.checkIsFunction(f.enableSwipeHandler)&&f.enableSwipeHandler(),d.checkIsFunction(l.onMoveEnd)&&l.onMoveEnd(),d.event(i),d.removeClass(e.progressBtn,"active");var g=e.computeTime(i,u.x);g.prePlayTime=h.prePlayTime,u.moving?(e.triggerCallbacks("dragend",g,i),e.emitUserAction("drag","dragend",g)):(e.triggerCallbacks("click",g,i),e.emitUserAction("click","click",g)),e._mouseUpHandlerHook(i,g),u.moving=!1,u.isDown=!1,u.x=0,u.y=0,u.isLocked=!0,h.prePlayTime=0,h.time=0;var p=i.type;p==="touchend"||p==="touchcancel"?(e.root.removeEventListener("touchmove",e.onMouseMove),e.root.removeEventListener("touchend",e.onMouseUp),e.root.removeEventListener("touchcancel",e.onMouseUp),e.blur()):(document.removeEventListener("mousemove",e.onMouseMove,!1),document.removeEventListener("mouseup",e.onMouseUp,!1),u.isEnter?f.isMobileSimulateMode!=="mobile"&&e.bind("mousemove",e.onMoveOnly):e.onMouseLeave(i)),d.setTimeout(_(e),function(){e.resetSeekState()},1),s.focus()}}),C(_(e),"onMouseMove",function(i){var r=_(e),s=r._state,l=r.pos,u=r.player,f=r.config;d.checkTouchSupport()&&i.preventDefault(),d.event(i);var h=d.getEventPos(i,u.zoom),g=u.rotateDeg===90?h.clientY:h.clientX,p=Math.abs(l.x-g);if(!(l.moving&&p<f.miniMoveStep||!l.moving&&p<f.miniStartStep)){l.x=g;var v=e.computeTime(i,g);v.prePlayTime=s.prePlayTime,e._mouseMoveHandlerHook(i,v)}}),C(_(e),"onMouseOut",function(i){e.triggerCallbacks("mouseout",null,i)}),C(_(e),"onMouseOver",function(i){e.triggerCallbacks("mouseover",null,i)}),C(_(e),"onMouseEnter",function(i){var r=_(e),s=r.player,l=r.pos;if(!(l.isDown||l.isEnter||s.isMini||!s.config.allowSeekAfterEnded&&s.ended)){l.isEnter=!0,e.bind("mousemove",e.onMoveOnly),e.bind("mouseleave",e.onMouseLeave),d.event(i);var u=d.getEventPos(i,s.zoom),f=s.rotateDeg===90?u.clientY:u.clientX,h=e.computeTime(i,f);e.triggerCallbacks("mouseenter",h,i),e.focus()}}),C(_(e),"onMouseLeave",function(i){e.triggerCallbacks("mouseleave",null,i),e.unlock(),e._updateInnerFocus(null)}),C(_(e),"onVideoResize",function(){var i=e.pos,r=i.x,s=i.isDown,l=i.isEnter;if(l&&!s){var u=e.computeTime(null,r);e.onMoveOnly(null,u)}}),e.useable=!1,e.isProgressMoving=!1,e.__dragCallBacks=[],e._state={now:-1,direc:0,time:0,prePlayTime:-1},e._disableBlur=!1,typeof e.config.isDragingSeek=="boolean"&&(console.warn("[XGPLAYER] 'isDragingSeek' is deprecated, please use 'isDraggingSeek' instead"),e.config.isDraggingSeek=e.config.isDragingSeek),e}return I(n,[{key:"offsetDuration",get:function(){return this.playerConfig.customDuration||this.player.offsetDuration||this.player.duration}},{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"currentTime",get:function(){var e=this.player,i=e.offsetCurrentTime,r=e.currentTime;return i>=0?i:r+this.timeOffset}},{key:"changeState",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.useable=e}},{key:"show",value:function(e){this.root&&(this.root.style.display="flex")}},{key:"_initInner",value:function(){var e=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(!i||i.length===0)&&(i=[{percent:1}]);var s=X(X({fragments:i},r),{},{actionCallback:function(u){e.emitUserAction("fragment_focus","fragment_focus",u)}});this.innerList?this.innerList.reset(s):(this.innerList=new $h(s),this.outer.insertBefore(this.innerList.render(),this.outer.children[0]),["findHightLight","unHightLight","setHightLight","findFragment"].map(function(l){e[l]=e.innerList[l].bind(e.innerList)}))}},{key:"_updateInnerFocus",value:function(e){this.innerList&&this.innerList.updateFocus(e)}},{key:"afterCreate",value:function(){if(!(this.config.disable||this.playerConfig.isLive)){this.pos={x:0,y:0,moving:!1,isDown:!1,isEnter:!1,isLocked:!1},this.outer=this.find("xg-outer");var e=this.config,i=e.fragFocusClass,r=e.fragAutoFocus,s=e.fragClass;this._initInner(this.config.fragments,{fragFocusClass:i,fragAutoFocus:r,fragClass:s,style:this.playerConfig.commonStyle||{}}),B.device==="mobile"&&(this.config.isDraggingSeek=!1,this.isMobile=!0),this.progressBtn=this.find(".xgplayer-progress-btn"),this.listenEvents(),this.bindDomEvents(),this.initCustomStyle()}}},{key:"listenEvents",value:function(){var e=this;this.on(Se,function(){e.onMouseLeave()}),this.on(se,function(){e.onTimeupdate()}),this.on(we,function(){e.onTimeupdate(),e.onCacheUpdate()}),this.on(hl,function(){e.onCacheUpdate()}),this.on(Ue,function(){e.onCacheUpdate(!0),e.onTimeupdate(!0),e._state.now=0}),this.on(ze,function(){e.onReset()}),this.on(Re,function(){e.onVideoResize()})}},{key:"setConfig",value:function(e){var i=this,r=null;Object.keys(e).forEach(function(s){i.config[s]=e[s],s==="fragments"&&(r=e[s])}),r&&this._initInner(r,e)}},{key:"initCustomStyle",value:function(){var e=this.playerConfig||{},i=e.commonStyle,r=i.sliderBtnStyle,s=this.progressBtn;r&&(typeof r=="string"?s.style.boxShadow=r:ie(r)==="object"&&Object.keys(r).map(function(l){s.style[l]=r[l]}))}},{key:"triggerCallbacks",value:function(e,i,r){this.__dragCallBacks.length>0&&this.__dragCallBacks.map(function(s){if(s&&s.handler&&s.type===e)try{s.handler(i,r)}catch(l){console.error("[XGPLAYER][triggerCallbacks] ".concat(s," error"),l)}})}},{key:"addCallBack",value:function(e,i){i&&typeof i=="function"&&this.__dragCallBacks.push({type:e,handler:i})}},{key:"removeCallBack",value:function(e,i){var r=this.__dragCallBacks,s=-1;r.map(function(l,u){l&&l.type===e&&l.handler===i&&(s=u)}),s>-1&&r.splice(s,1)}},{key:"unlock",value:function(){var e=this.player,i=this.pos;if(i.isEnter=!1,i.isLocked=!1,!e.isMini){if(this.unbind("mousemove",this.onMoveOnly),i.isDown){this.unbind("mouseleave",this.onMouseLeave);return}this.blur()}}},{key:"bindDomEvents",value:function(){var e=this.player.config;this._mouseDownHandlerHook=this.hook("dragstart",this._mouseDownHandler),this._mouseUpHandlerHook=this.hook("dragend",this._mouseUpHandler),this._mouseMoveHandlerHook=this.hook("drag",this._mouseMoveHandler),(this.domEventType==="touch"||this.domEventType==="compatible")&&this.root.addEventListener("touchstart",this.onMouseDown),(this.domEventType==="mouse"||this.domEventType==="compatible")&&(this.bind("mousedown",this.onMouseDown),e.isMobileSimulateMode!=="mobile"&&this.bind("mouseenter",this.onMouseEnter),this.bind("mouseover",this.onMouseOver),this.bind("mouseout",this.onMouseOut),this.player.root.addEventListener("click",this.onBodyClick,!0))}},{key:"focus",value:function(){this.player.controls.pauseAutoHide(),d.addClass(this.root,"active")}},{key:"blur",value:function(){this._disableBlur||(this.player.controls.recoverAutoHide(),d.removeClass(this.root,"active"))}},{key:"disableBlur",value:function(){this._disableBlur=!0}},{key:"enableBlur",value:function(){this._disableBlur=!1}},{key:"updateWidth",value:function(e,i,r,s){var l=this.config,u=this.player;if(!(l.isCloseClickSeek&&s===0)){var f=i=i>=u.duration?u.duration-l.endedDiff:Number(i).toFixed(1);this.updatePercent(r),this.updateTime(e),!(s===1&&(!l.isDraggingSeek||u.config.mediaType==="audio"))&&(this._state.now=f,this._state.direc=f>u.currentTime?0:1,u.seek(f))}}},{key:"computeTime",value:function(e,i){var r=this.player,s=this.root.getBoundingClientRect(),l=s.width,u=s.height,f=s.top,h=s.left,g,p,v=i;r.rotateDeg===90?(g=u,p=f):(g=l,p=h);var y=v-p;y=y>g?g:y<0?0:y;var m=y/g;m=m<0?0:m>1?1:m,Number.isNaN(m)&&(m=this.player.currentTime/this.offsetDuration);var b=parseInt(m*this.offsetDuration*1e3,10)/1e3,k=d.getCurrentTimeByOffset(b,r.timeSegments);return{percent:m,currentTime:b,seekTime:k,offset:y,width:g,left:p,e}}},{key:"updateTime",value:function(e){var i=this.player,r=this.duration;e>r?e=r:e<0&&(e=0);var s=i.plugins.time;s&&s.updateTime(e)}},{key:"resetSeekState",value:function(){this.isProgressMoving=!1;var e=this.player.plugins.time;e&&e.resetActive()}},{key:"updatePercent",value:function(e,i){if(this.isProgressMoving=!0,!this.config.disable){e=e>1?1:e<0?0:e,this.progressBtn.style.left="".concat(e*100,"%"),this.innerList.update({played:e*this.offsetDuration},this.offsetDuration);var r=this.player.plugins.miniprogress;r&&r.update({played:e*this.offsetDuration},this.offsetDuration)}}},{key:"onTimeupdate",value:function(e){var i=this.player,r=this._state,s=this.offsetDuration;if(!(i.isSeeking&&i.media.seeking||this.isProgressMoving||!i.hasStart)){if(r.now>-1){var l=parseInt(r.now*1e3,10)-parseInt(i.currentTime*1e3,10);if(r.direc===0&&l>300||r.direc===1&&l>-300){r.now=-1;return}else r.now=-1}var u=this.currentTime;u=d.adjustTimeByDuration(u,s,e),this.innerList.update({played:u},s),this.progressBtn.style.left="".concat(u/s*100,"%")}}},{key:"onCacheUpdate",value:function(e){var i=this.player,r=this.duration;if(i){var s=i.bufferedPoint.end;s=d.adjustTimeByDuration(s,r,e),this.innerList.update({cached:s},r)}}},{key:"onReset",value:function(){this.innerList.update({played:0,cached:0},0),this.progressBtn.style.left="0%"}},{key:"destroy",value:function(){var e=this.player;this.thumbnailPlugin=null,this.innerList.destroy(),this.innerList=null;var i=this.domEventType;(i==="touch"||i==="compatible")&&(this.root.removeEventListener("touchstart",this.onMouseDown),this.root.removeEventListener("touchmove",this.onMouseMove),this.root.removeEventListener("touchend",this.onMouseUp),this.root.removeEventListener("touchcancel",this.onMouseUp)),(i==="mouse"||i==="compatible")&&(this.unbind("mousedown",this.onMouseDown),this.unbind("mouseenter",this.onMouseEnter),this.unbind("mousemove",this.onMoveOnly),this.unbind("mouseleave",this.onMouseLeave),document.removeEventListener("mousemove",this.onMouseMove,!1),document.removeEventListener("mouseup",this.onMouseUp,!1),e.root.removeEventListener("click",this.onBodyClick,!0))}},{key:"render",value:function(){if(!(this.config.disable||this.playerConfig.isLive)){var e=this.player.controls?this.player.controls.config.mode:"",i=e==="bottom"?"xgplayer-progress-bottom":"";return`
|
|
50
|
-
<xg-progress class="xgplayer-progress `.concat(i,`">
|
|
51
|
-
<xg-outer class="xgplayer-progress-outer">
|
|
52
|
-
<xg-progress-btn class="xgplayer-progress-btn"></xg-progress-btn>
|
|
53
|
-
</xg-outer>
|
|
54
|
-
</xg-progress>
|
|
55
|
-
`)}}}],[{key:"pluginName",get:function(){return"progress"}},{key:"defaultConfig",get:function(){return{position:K.CONTROLS_CENTER,index:0,disable:!1,isDraggingSeek:!0,closeMoveSeek:!1,isPauseMoving:!1,isCloseClickSeek:!1,fragments:[{percent:1}],fragFocusClass:Is.POINT,fragClass:"",fragAutoFocus:!1,miniMoveStep:5,miniStartStep:2,onMoveStart:function(){},onMoveEnd:function(){},endedDiff:.2}}},{key:"FRAGMENT_FOCUS_CLASS",get:function(){return Is}}]),n})(j),Nl=(function(a){D(n,a);var o=R(n);function n(t){var e;return x(this,n),e=o.call(this,t),e.isActiving=!1,e}return I(n,[{key:"duration",get:function(){var e=this.player,i=e.offsetDuration,r=e.duration;return this.playerConfig.customDuration||i||r}},{key:"currentTime",get:function(){var e=this.player,i=e.offsetCurrentTime,r=e.currentTime;return i>=0?i:r}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"afterCreate",value:function(){var e=this.player.controls.config.mode;this.mode=e==="flex"?"flex":"normal",!this.config.disable&&(this.mode==="flex"&&(this.createCenterTime(),this.root.style.display="none"),this.durationDom=this.find(".time-duration"),this.timeDom=this.find(".time-current"),this.listenEvents())}},{key:"listenEvents",value:function(){var e=this;this.on([Se,we,se],function(i){i.eventName==="durationchange"&&(e.isActiving=!1),e.onTimeUpdate()}),this.on(Ue,function(){e.onTimeUpdate(!0)}),this.on(ze,function(){e.onReset()})}},{key:"show",value:function(e){if(this.mode==="flex"){this.centerCurDom&&(this.centerCurDom.style.display="block"),this.centerDurDom&&(this.centerDurDom.style.display="block");return}this.root.style.display="block"}},{key:"hide",value:function(){if(this.mode==="flex"){this.centerCurDom&&(this.centerCurDom.style.display="none"),this.centerDurDom&&(this.centerDurDom.style.display="none");return}this.root.style.display="none"}},{key:"onTimeUpdate",value:function(e){var i=this.player,r=this.config,s=this.duration;if(!(r.disable||this.isActiving||!i.hasStart)){var l=this.currentTime+this.timeOffset;l=d.adjustTimeByDuration(l,s,e),this.mode==="flex"?(this.centerCurDom.innerHTML=this.minWidthTime(d.format(l)),s!==1/0&&s>0&&(this.centerDurDom.innerHTML=d.format(s))):(this.timeDom.innerHTML=this.minWidthTime(d.format(l)),s!==1/0&&s>0&&(this.durationDom.innerHTML=d.format(s)))}}},{key:"onReset",value:function(){this.mode==="flex"?(this.centerCurDom.innerHTML=this.minWidthTime(d.format(0)),this.centerDurDom.innerHTML=d.format(0)):(this.timeDom.innerHTML=this.minWidthTime(d.format(0)),this.durationDom.innerHTML=d.format(0))}},{key:"createCenterTime",value:function(){var e=this.player;if(!(!e.controls||!e.controls.center)){var i=e.controls.center;this.centerCurDom=d.createDom("xg-icon","00:00",{},"xgplayer-time xg-time-left"),this.centerDurDom=d.createDom("xg-icon","00:00",{},"xgplayer-time xg-time-right"),i.children.length>0?i.insertBefore(this.centerCurDom,i.children[0]):i.appendChild(this.centerCurDom),i.appendChild(this.centerDurDom),this.extraEls=[this.centerCurDom,this.centerDurDom]}}},{key:"afterPlayerInit",value:function(){var e=this.config;if(this.duration===1/0||this.playerConfig.isLive?(d.hide(this.durationDom),d.hide(this.timeDom),d.hide(this.find(".time-separator")),d.show(this.find(".time-live-tag"))):d.hide(this.find(".time-live-tag")),e.hide){this.hide();return}this.show()}},{key:"changeLiveState",value:function(e){e?(d.hide(this.durationDom),d.hide(this.timeDom),d.hide(this.find(".time-separator")),d.show(this.find(".time-live-tag"))):(d.hide(this.find(".time-live-tag")),d.show(this.find(".time-separator")),d.show(this.durationDom),d.show(this.timeDom))}},{key:"updateTime",value:function(e){if(this.isActiving=!0,!(!e&&e!==0||e>this.duration)){if(this.mode==="flex"){this.centerCurDom.innerHTML=this.minWidthTime(d.format(e));return}this.timeDom.innerHTML=this.minWidthTime(d.format(e))}}},{key:"minWidthTime",value:function(e){return e.split(":").map(function(i){return'<span class="time-min-width">'.concat(i,"</span>")}).join(":")}},{key:"resetActive",value:function(){var e=this,i=this.player,r=function(){e.isActiving=!1};this.off(we,r),i.isSeeking&&i.media.seeking?this.once(we,r):this.isActiving=!1}},{key:"destroy",value:function(){var e=this.player.controls.center;this.centerCurDom&&e.removeChild(this.centerCurDom),this.centerCurDom=null,this.centerDurDom&&e.removeChild(this.centerDurDom),this.centerDurDom=null}},{key:"render",value:function(){if(!this.config.disable)return`<xg-icon class="xgplayer-time">
|
|
56
|
-
<span class="time-current">00:00</span>
|
|
57
|
-
<span class="time-separator">/</span>
|
|
58
|
-
<span class="time-duration">00:00</span>
|
|
59
|
-
<span class="time-live-tag">`.concat(this.i18n.LIVE_TIP,`</span>
|
|
60
|
-
</xg-icon>`)}}],[{key:"pluginName",get:function(){return"time"}},{key:"defaultConfig",get:function(){return{position:K.CONTROLS_LEFT,index:2,disable:!1}}}]),n})(j);function Yh(){return new DOMParser().parseFromString(`<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="0 -10 28 40">
|
|
61
|
-
<path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M358.4 358.4h-204.8v307.2h204.8l256 256v-819.2l-256 256z"></path>
|
|
62
|
-
<path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M940.632 837.632l-72.192-72.192c65.114-64.745 105.412-154.386 105.412-253.44s-40.299-188.695-105.396-253.424l-0.016-0.016 72.192-72.192c83.639 83.197 135.401 198.37 135.401 325.632s-51.762 242.434-135.381 325.612l-0.020 0.020zM795.648 693.248l-72.704-72.704c27.756-27.789 44.921-66.162 44.921-108.544s-17.165-80.755-44.922-108.546l0.002 0.002 72.704-72.704c46.713 46.235 75.639 110.363 75.639 181.248s-28.926 135.013-75.617 181.227l-0.021 0.021z"></path>
|
|
63
|
-
</svg>
|
|
64
|
-
`,"image/svg+xml").firstChild}function Xh(){return new DOMParser().parseFromString(`<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="0 -10 28 40">
|
|
65
|
-
<path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M358.4 358.4h-204.8v307.2h204.8l256 256v-819.2l-256 256z"></path>
|
|
66
|
-
<path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M795.648 693.248l-72.704-72.704c27.756-27.789 44.921-66.162 44.921-108.544s-17.165-80.755-44.922-108.546l0.002 0.002 72.704-72.704c46.713 46.235 75.639 110.363 75.639 181.248s-28.926 135.013-75.617 181.227l-0.021 0.021zM795.648 693.248l-72.704-72.704c27.756-27.789 44.921-66.162 44.921-108.544s-17.165-80.755-44.922-108.546l0.002 0.002 72.704-72.704c46.713 46.235 75.639 110.363 75.639 181.248s-28.926 135.013-75.617 181.227l-0.021 0.021z"></path>
|
|
67
|
-
</svg>
|
|
68
|
-
`,"image/svg+xml").firstChild}function Zh(){return new DOMParser().parseFromString(`<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="0 -10 28 40">
|
|
69
|
-
<path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M358.4 358.4h-204.8v307.2h204.8l256 256v-819.2l-256 256z"></path>
|
|
70
|
-
<path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M920.4 439.808l-108.544-109.056-72.704 72.704 109.568 108.544-109.056 108.544 72.704 72.704 108.032-109.568 108.544 109.056 72.704-72.704-109.568-108.032 109.056-108.544-72.704-72.704-108.032 109.568z"></path>
|
|
71
|
-
</svg>
|
|
72
|
-
`,"image/svg+xml").firstChild}var Ml=(function(a){D(n,a);var o=R(n);function n(){var t;x(this,n);for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return t=o.call.apply(o,[this].concat(i)),C(_(t),"onBarMousedown",function(s){var l=_(t),u=l.player,f=t.find(".xgplayer-bar");d.event(s);var h=f.getBoundingClientRect(),g=d.getEventPos(s,u.zoom),p=h.height-(g.clientY-h.top);if(g.h=p,g.barH=h.height,t.pos=g,!(p<-2))return t.updateVolumePos(p,s),document.addEventListener("mouseup",t.onBarMouseUp),t._d.isStart=!0,!1}),C(_(t),"onBarMouseMove",function(s){var l=_(t),u=l._d;if(u.isStart){var f=_(t),h=f.pos,g=f.player;s.preventDefault(),s.stopPropagation(),d.event(s);var p=d.getEventPos(s,g.zoom);u.isMoving=!0;var v=h.h-p.clientY+h.clientY;v>h.barH||t.updateVolumePos(v,s)}}),C(_(t),"onBarMouseUp",function(s){d.event(s),document.removeEventListener("mouseup",t.onBarMouseUp);var l=_(t),u=l._d;u.isStart=!1,u.isMoving=!1}),C(_(t),"onMouseenter",function(s){t._d.isActive=!0,t.focus(),t.emit("icon_mouseenter",{pluginName:t.pluginName})}),C(_(t),"onMouseleave",function(s){t._d.isActive=!1,t.unFocus(100,!1,s),t.emit("icon_mouseleave",{pluginName:t.pluginName})}),C(_(t),"onVolumeChange",function(s){if(t.player){var l=t.player,u=l.muted,f=l.volume;t._d.isMoving||(t.find(".xgplayer-drag").style.height=u||f===0?"4px":"".concat(f*100,"%"),t.config.showValueLabel&&t.updateVolumeValue()),t.animate(u,f)}}),t}return I(n,[{key:"registerIcons",value:function(){return{volumeSmall:{icon:Xh,class:"xg-volume-small"},volumeLarge:{icon:Yh,class:"xg-volume"},volumeMuted:{icon:Zh,class:"xg-volume-mute"}}}},{key:"afterCreate",value:function(){var e=this;if(this._timerId=null,this._d={isStart:!1,isMoving:!1,isActive:!1},!this.config.disable){this.initIcons();var i=this.playerConfig,r=i.commonStyle,s=i.volume;r.volumeColor&&(this.find(".xgplayer-drag").style.backgroundColor=r.volumeColor),this.changeMutedHandler=this.hook("mutedChange",function(l){e.changeMuted(l)},{pre:function(u){u.preventDefault(),u.stopPropagation()}}),this._onMouseenterHandler=this.hook("mouseenter",this.onMouseenter),this._onMouseleaveHandler=this.hook("mouseleave",this.onMouseleave),B.device!=="mobile"&&this.playerConfig.isMobileSimulateMode!=="mobile"&&(this.bind("mouseenter",this._onMouseenterHandler),this.bind(["blur","mouseleave"],this._onMouseleaveHandler),this.bind(".xgplayer-slider","mousedown",this.onBarMousedown),this.bind(".xgplayer-slider","mousemove",this.onBarMouseMove),this.bind(".xgplayer-slider","mouseup",this.onBarMouseUp)),this.bind(".xgplayer-icon",["touchend","click"],this.changeMutedHandler),this.on(cl,this.onVolumeChange),this.once(Te,this.onVolumeChange),d.typeOf(s)!=="Number"&&(this.player.volume=this.config.default),this.onVolumeChange()}}},{key:"updateVolumePos",value:function(e,i){var r=this.player,s=this.find(".xgplayer-drag"),l=this.find(".xgplayer-bar");if(!(!l||!s)){var u=parseInt(e/l.getBoundingClientRect().height*1e3,10);s.style.height="".concat(e,"px");var f=Math.max(Math.min(u/1e3,1),0),h={volume:{from:r.volume,to:f}};r.muted&&(h.muted={from:!0,to:!1}),this.emitUserAction(i,"change_volume",{muted:r.muted,volume:r.volume,props:h}),r.volume=Math.max(Math.min(u/1e3,1),0),r.muted&&(r.muted=!1),this.config.showValueLabel&&this.updateVolumeValue()}}},{key:"updateVolumeValue",value:function(){var e=this.player,i=e.volume,r=e.muted,s=this.find(".xgplayer-value-label"),l=Math.max(Math.min(i,1),0);s.innerText=r?0:Math.round(l*100)}},{key:"focus",value:function(){var e=this.player;e.focus({autoHide:!1}),this._timerId&&(d.clearTimeout(this,this._timerId),this._timerId=null),d.addClass(this.root,"slide-show")}},{key:"unFocus",value:function(){var e=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:100,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,s=arguments.length>2?arguments[2]:void 0,l=this._d,u=this.player;l.isActive||(this._timerId&&(d.clearTimeout(this,this._timerId),this._timerId=null),this._timerId=d.setTimeout(this,function(){l.isActive||(r?u.blur():u.focus(),d.removeClass(e.root,"slide-show"),l.isStart&&e.onBarMouseUp(s)),e._timerId=null},i))}},{key:"changeMuted",value:function(e){e&&e.stopPropagation();var i=this.player,r=this._d;r.isStart&&this.onBarMouseUp(e),this.emitUserAction(e,"change_muted",{muted:i.muted,volume:i.volume,props:{muted:{from:i.muted,to:!i.muted}}}),i.volume>0&&(i.muted=!i.muted),i.volume<.01&&(i.volume=this.config.miniVolume)}},{key:"animate",value:function(e,i){e||i===0?this.setAttr("data-state","mute"):i<.5&&this.icons.volumeSmall?this.setAttr("data-state","small"):this.setAttr("data-state","normal")}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.volumeSmall),this.appendChild(".xgplayer-icon",e.volumeLarge),this.appendChild(".xgplayer-icon",e.volumeMuted)}},{key:"destroy",value:function(){this._timerId&&(d.clearTimeout(this,this._timerId),this._timerId=null),this.unbind("mouseenter",this.onMouseenter),this.unbind(["blur","mouseleave"],this.onMouseleave),this.unbind(".xgplayer-slider","mousedown",this.onBarMousedown),this.unbind(".xgplayer-slider","mousemove",this.onBarMouseMove),this.unbind(".xgplayer-slider","mouseup",this.onBarMouseUp),document.removeEventListener("mouseup",this.onBarMouseUp),this.unbind(".xgplayer-icon",B.device==="mobile"?"touchend":"click",this.changeMutedHandler)}},{key:"render",value:function(){if(!this.config.disable){var e=this.config.default||this.player.volume,i=this.config.showValueLabel;return`
|
|
73
|
-
<xg-icon class="xgplayer-volume" data-state="normal">
|
|
74
|
-
<div class="xgplayer-icon">
|
|
75
|
-
</div>
|
|
76
|
-
<xg-slider class="xgplayer-slider">
|
|
77
|
-
`.concat(i?'<div class="xgplayer-value-label">'.concat(e*100,"</div>"):"",`
|
|
78
|
-
<div class="xgplayer-bar">
|
|
79
|
-
<xg-drag class="xgplayer-drag" style="height: `).concat(e*100,`%"></xg-drag>
|
|
80
|
-
</div>
|
|
81
|
-
</xg-slider>
|
|
82
|
-
</xg-icon>`)}}}],[{key:"pluginName",get:function(){return"volume"}},{key:"defaultConfig",get:function(){return{position:K.CONTROLS_RIGHT,index:1,disable:!1,showValueLabel:!1,default:.6,miniVolume:.2}}}]),n})(j);function te(){return new Date().getTime()}var Ae={LOAD_START:"loadstart",LOADED_DATA:"loadeddata",FIRST_FRAME:"firstFrame",WAIT_START:"waitingStart",WAIT_END:"waitingEnd",SEEK_START:"seekStart",SEEK_END:"seekEnd"},Jh=(function(a){D(n,a);var o=R(n);function n(){var t;x(this,n);for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return t=o.call.apply(o,[this].concat(i)),C(_(t),"_onTimeupdate",function(){t._state.isTimeUpdate=!0,t._state.autoplayStart&&(V.logInfo("[xgLogger]".concat(t.player.playerId," _onTimeupdate")),t._sendFF("onTimeupdate"))}),C(_(t),"_onAutoplayStart",function(){V.logInfo("[xgLogger]".concat(t.player.playerId," _onAutoplayStart")),t._state.autoplayStart=!0,t.vt&&t._sendFF("onAutoplayStart")}),C(_(t),"_onReset",function(){t._state={autoplayStart:!1,isFFLoading:!1,isTimeUpdate:!1,isFFSend:!1,isLs:!1},t.vt=0,t.pt=0,t.fvt=0,t.newPointTime=te(),t.loadedCostTime=0,t.startCostTime=0,t._isSeeking=!1,t.seekingStart=0,t.waitingStart=0,t.fixedWaitingStart=0,t._isWaiting=!1,t._waitTimer&&d.clearTimeout(_(t),t._waitTimer),t._waittTimer&&d.clearTimeout(_(t),t._waittTimer),t._waitTimer=null,t._waittTimer=null,t._waitType=0}),C(_(t),"_onSeeking",function(){t.seekingStart||(t.suspendWaitingStatus("seek"),t.seekingStart=te(),t.emitLog(Ae.SEEK_START,{start:te()}))}),C(_(t),"_onSeeked",function(){t.suspendSeekingStatus("seeked")}),C(_(t),"_onWaitingLoadStart",function(){t._isWaiting||t.vt||(t._isWaiting=!0,t.waitingStart=te(),t.fixedWaitingStart=te(),t._waitType=1,t.emitLog(Ae.WAIT_START,{fixedStart:t.fixedWaitingStart,start:t.waitingStart,type:1,endType:"loadstart"}))}),C(_(t),"_onWaiting",function(){t._isWaiting||!t.vt||(t._isWaiting=!0,t.vt?t.seekingStart?t._waitType=2:t._waitType=0:t._waitType=1,t.fixedWaitingStart=te(),t._waitTimer=d.setTimeout(_(t),function(){t._isWaiting&&(t.waitingStart=te(),d.clearTimeout(_(t),t._waitTimer),t._waitTimer=null,t._startWaitTimeout(),t.emitLog(Ae.WAIT_START,{fixedStart:t.fixedWaitingStart,start:t.waitingStart,type:t._waitType,endType:t._waitType===2?"seek":"playing"}))},200))}),C(_(t),"_onError",function(){t.suspendSeekingStatus("error"),t.suspendWaitingStatus("error")}),C(_(t),"_onPlaying",function(){t._isWaiting&&t.suspendWaitingStatus("playing")}),t}return I(n,[{key:"afterCreate",value:function(){var e=this;this._onReset(),this._waitType="firstFrame",this._initOnceEvents(),this.newPointTime=te(),this.loadedCostTime=0,this.startCostTime=0,this.on(Fr,function(){var i=e._state,r=i.autoplayStart,s=i.isFFSend;e.startCostTime=te()-e.newPointTime,V.logInfo("[xgLogger]".concat(e.player.playerId," LOAD_START"),"autoplayStart:".concat(r," isFFSend:").concat(s," startCostTime:").concat(e.startCostTime," newPointTime").concat(e.newPointTime)),!s&&(!i.isLs&&e.emitLog(Ae.LOAD_START,{}),i.isLs=!0,i.isTimeUpdate=!1,i.isFFLoading=!0,e.pt=te(),e.vt=0,e.fvt=0,e._initOnceEvents(),e._onWaitingLoadStart())}),this.on(Te,function(){e.vt=te(),e.fvt=e.vt-e.pt,e.loadedCostTime=e.vt-e.newPointTime;var i=e._state,r=i.isTimeUpdate,s=i.isFFSend,l=i.autoplayStart;V.logInfo("[xgLogger]".concat(e.player.playerId," LOADED_DATA"),"fvt:".concat(e.fvt," isTimeUpdate:").concat(e._state.isTimeUpdate," loadedCostTime:").concat(e.loadedCostTime)),(r||l)&&e._sendFF("loadedData"),s||e.emitLog(Ae.LOADED_DATA,{}),e.suspendWaitingStatus("loadeddata")}),this.on($t,this._onSeeking),this.on(we,this._onSeeked),this.on(Ur,function(){e.endState("destroy")}),this.on(Xt,function(){e.endState("urlChange"),V.logInfo("[xgLogger]".concat(e.player.playerId," URL_CHANGE")),e._state.isFFSend&&e._onReset()}),this.on([Mr,be],this._onPlaying),this.on(gt,this._onWaiting),this.on(dt,this._onError),this.on(Zt,function(){V.logInfo("[xgLogger]".concat(e.player.playerId," RESET")),e.endState("reset"),e._initOnceEvents(),e._onReset()})}},{key:"_initOnceEvents",value:function(){this.off(He,this._onAutoplayStart),this.off(se,this._onTimeupdate),this.once(He,this._onAutoplayStart),this.once(se,this._onTimeupdate)}},{key:"_sendFF",value:function(e){this.s=te();var i=this._state,r=i.isFFLoading,s=i.isFFSend;V.logInfo("[xgLogger]".concat(this.player.playerId," _sendFF"),"".concat(e," fvt:").concat(this.fvt," isFFLoading:").concat(r," !isFFSend:").concat(!s)),this.vt>0&&r&&!s&&(V.logInfo("[xgLogger]".concat(this.player.playerId," emitLog_firstFrame"),e),this._state.isFFLoading=!1,this._state.isFFSend=!0,this.emitLog(Ae.FIRST_FRAME,{fvt:this.fvt,costTime:this.fvt,vt:this.vt,startCostTime:this.startCostTime,loadedCostTime:this.loadedCostTime}))}},{key:"_startWaitTimeout",value:function(){var e=this;this._waittTimer&&d.clearTimeout(this,this._waittTimer),this._waittTimer=d.setTimeout(this,function(){e.suspendWaitingStatus("timeout"),d.clearTimeout(e,e._waittTimer),e._waittTimer=null},this.config.waitTimeout)}},{key:"endState",value:function(e){this.suspendWaitingStatus(e),this.suspendSeekingStatus(e)}},{key:"suspendSeekingStatus",value:function(e){if(this.seekingStart){var i=te(),r=i-this.seekingStart;this.seekingStart=0,this.emitLog(Ae.SEEK_END,{end:i,costTime:r,endType:e})}}},{key:"suspendWaitingStatus",value:function(e){if(this._waitTimer&&(d.clearTimeout(this,this._waitTimer),this._waitTimer=null),this._waittTimer&&(d.clearTimeout(this,this._waittTimer),this._waittTimer=null),this._isWaiting=!1,!!this.waitingStart){var i=te(),r=i-this.waitingStart,s=i-this.fixedWaitingStart,l=this.config.waitTimeout;this._isWaiting=!1,this.waitingStart=0,this.fixedWaitingStart=0,this.emitLog(Ae.WAIT_END,{fixedCostTime:s>l?l:s,costTime:r>l?l:r,type:e==="loadeddata"?1:this._waitType,endType:this._waitType===2?"seek":e})}}},{key:"emitLog",value:function(e,i){var r=this.player;this.emit(kl,X({t:te(),host:d.getHostFromUrl(r.currentSrc),vtype:r.vtype,eventType:e,currentTime:this.player.currentTime,readyState:r.video.readyState,networkState:r.video.networkState},i))}}],[{key:"pluginName",get:function(){return"xgLogger"}},{key:"defaultConfig",get:function(){return{waitTimeout:1e4}}}]),n})(j);function Qh(){return new DOMParser().parseFromString(`<svg class="xgplayer-replay-svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 78 78" width="78" height="78">
|
|
83
|
-
<path fill="#fff" transform="translate(20, 20)" d="M8.22708362,13.8757234 L11.2677371,12.6472196 C11.7798067,12.4403301 12.3626381,12.6877273 12.5695276,13.1997969 L12.9441342,14.1269807 C13.1510237,14.6390502 12.9036264,15.2218816 12.3915569,15.4287712 L6.8284538,17.6764107 L5.90126995,18.0510173 C5.38920044,18.2579068 4.80636901,18.0105096 4.5994795,17.49844 L1.97723335,11.0081531 C1.77034384,10.4960836 2.0177411,9.91325213 2.52981061,9.70636262 L3.45699446,9.33175602 C3.96906396,9.12486652 4.5518954,9.37226378 4.75878491,9.88433329 L5.67885163,12.1615783 C7.99551726,6.6766934 13.3983951,3 19.5,3 C27.7842712,3 34.5,9.71572875 34.5,18 C34.5,26.2842712 27.7842712,33 19.5,33 C15.4573596,33 11.6658607,31.3912946 8.87004692,28.5831991 C8.28554571,27.9961303 8.28762719,27.0463851 8.87469603,26.4618839 C9.46176488,25.8773827 10.4115101,25.8794641 10.9960113,26.466533 C13.2344327,28.7147875 16.263503,30 19.5,30 C26.127417,30 31.5,24.627417 31.5,18 C31.5,11.372583 26.127417,6 19.5,6 C14.4183772,6 9.94214483,9.18783811 8.22708362,13.8757234 Z"></path>
|
|
84
|
-
</svg>
|
|
85
|
-
`,"image/svg+xml").firstChild}var ed=(function(a){D(n,a);var o=R(n);function n(){return x(this,n),o.apply(this,arguments)}return I(n,[{key:"registerIcons",value:function(){return{replay:Qh}}},{key:"afterCreate",value:function(){var e=this;j.insert(this.icons.replay,this.root,0),this.__handleReplay=this.hook("replayClick",function(){e.player.replay()},{pre:function(r){r.preventDefault(),r.stopPropagation()}}),this.bind(".xgplayer-replay",["click","touchend"],this.__handleReplay),this.on(Ue,function(){if(e.playerConfig.loop||d.addClass(e.player.root,"replay"),!e.config.disable){e.show();var i=e.root.querySelector("path");if(i){var r=window.getComputedStyle(i).getPropertyValue("transform");if(typeof r=="string"&&r.indexOf("none")>-1)return null;i.setAttribute("transform",r)}}}),this.on(le,function(){e.hide()})}},{key:"handleReplay",value:function(e){e.preventDefault(),e.stopPropagation(),this.player.replay(),d.removeClass(this.player.root,"replay")}},{key:"show",value:function(e){this.config.disable||(this.root.style.display="flex")}},{key:"enable",value:function(){this.config.disable=!1}},{key:"disable",value:function(){this.config.disable=!0,this.hide()}},{key:"destroy",value:function(){this.unbind(".xgplayer-replay",["click","touchend"],this.__handleReplay)}},{key:"render",value:function(){return`<xg-replay class="xgplayer-replay">
|
|
86
|
-
<xg-replay-txt class="xgplayer-replay-txt" lang-key="`.concat(this.i18nKeys.REPLAY,'">').concat(this.i18n.REPLAY,`</xg-replay-txt>
|
|
87
|
-
</xg-replay>`)}}],[{key:"pluginName",get:function(){return"replay"}},{key:"defaultConfig",get:function(){return{disable:!1}}}]),n})(j),td=(function(a){D(n,a);var o=R(n);function n(){return x(this,n),o.apply(this,arguments)}return I(n,[{key:"isEndedShow",get:function(){return this.config.isEndedShow},set:function(e){this.config.isEndedShow=e}},{key:"hide",value:function(){d.addClass(this.root,"hide")}},{key:"show",value:function(e){d.removeClass(this.root,"hide")}},{key:"beforeCreate",value:function(e){typeof e.player.config.poster=="string"&&(e.config.poster=e.player.config.poster)}},{key:"afterCreate",value:function(){var e=this;this.on(Ue,function(){e.isEndedShow&&d.removeClass(e.root,"hide")}),this.config.hideCanplay?(this.once(se,function(){e.onTimeUpdate()}),this.on(Xt,function(){d.removeClass(e.root,"hide"),d.addClass(e.root,"xg-showplay"),e.once(se,function(){e.onTimeUpdate()})})):this.on(le,function(){d.addClass(e.root,"hide")})}},{key:"setConfig",value:function(e){var i=this;Object.keys(e).forEach(function(s){i.config[s]=e[s]});var r=this.config.poster;this.update(r)}},{key:"onTimeUpdate",value:function(){var e=this;this.player.currentTime?d.removeClass(this.root,"xg-showplay"):this.once(se,function(){e.onTimeUpdate()})}},{key:"update",value:function(e){e&&(this.config.poster=e,this.root.style.backgroundImage="url(".concat(e,")"))}},{key:"getBgSize",value:function(e){var i="";switch(e){case"cover":i="cover";break;case"contain":i="contain";break;case"fixHeight":i="auto 100%";break;default:i=""}return i?"background-size: ".concat(i,";"):""}},{key:"render",value:function(){var e=this.config,i=e.poster,r=e.hideCanplay,s=e.fillMode,l=e.notHidden,u=this.getBgSize(s),f=i?"background-image:url(".concat(i,");").concat(u):u,h=l?"xg-not-hidden":r?"xg-showplay":"";return'<xg-poster class="xgplayer-poster '.concat(h,'" style="').concat(f,`">
|
|
88
|
-
</xg-poster>`)}}],[{key:"pluginName",get:function(){return"poster"}},{key:"defaultConfig",get:function(){return{isEndedShow:!0,hideCanplay:!1,notHidden:!1,poster:"",fillMode:"fixWidth"}}}]),n})(j),ve={};function id(a,o){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{start:null,end:null};return ve[a]&&window.clearTimeout(ve[a].id),ve[a]={},n.start&&n.start(),ve[a].id=window.setTimeout(function(){n.end&&n.end(),window.clearTimeout(ve[a].id),delete ve[a]},o),ve[a].id}function Ps(a){if(a){window.clearTimeout(a);return}Object.keys(ve).map(function(o){window.clearTimeout(ve[o].id),delete ve[o]})}var nd=(function(a){D(n,a);var o=R(n);function n(t){var e;return x(this,n),e=o.call(this,t),C(_(e),"onPlayerReset",function(){e.autoPlayStart=!1;var i=e.config.mode==="auto"?"auto-hide":"hide";e.setAttr("data-state","play"),d.removeClass(e.root,i),e.show()}),C(_(e),"onAutoplayStart",function(){if(!e.autoPlayStart){var i=e.config.mode==="auto"?"auto-hide":"hide";d.addClass(e.root,i),e.autoPlayStart=!0,e.toggleTo("play")}}),e.autoPlayStart=!1,e}return I(n,[{key:"afterCreate",value:function(){var e=this.playerConfig;this.initIcons(),this.listenEvents(),this.bindClickEvents(),e.autoplay||this.show()}},{key:"listenEvents",value:function(){var e=this,i=this.player,r=this.playerConfig;this.once(Hr,function(){r&&(r.lang&&r.lang==="en"?d.addClass(i.root,"lang-is-en"):r.lang==="jp"&&d.addClass(i.root,"lang-is-jp"))}),this.on(He,this.onAutoplayStart),this.on(Vr,function(){var s=e.config.mode==="auto"?"auto-hide":"hide";e.setAttr("data-state","play"),d.removeClass(e.root,s),e.show()}),this.on(le,function(){e.toggleTo("play")}),this.on(et,function(){e.toggleTo("pause")}),this.on(Zt,function(){e.onPlayerReset()})}},{key:"bindClickEvents",value:function(){var e=this;this.clickHandler=this.hook("startClick",this.switchPausePlay,{pre:function(r){r.cancelable&&r.preventDefault(),r.stopPropagation();var s=e.player.paused;e.emitUserAction(r,"switch_play_pause",{props:"paused",from:s,to:!s})}}),this.bind(["click","touchend"],this.clickHandler)}},{key:"registerIcons",value:function(){return{startPlay:{icon:qr,class:"xg-icon-play"},startPause:{icon:Gr,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild("xg-start-inner",e.startPlay),this.appendChild("xg-start-inner",e.startPause)}},{key:"hide",value:function(){d.addClass(this.root,"hide")}},{key:"show",value:function(e){d.removeClass(this.root,"hide")}},{key:"focusHide",value:function(){d.addClass(this.root,"focus-hide")}},{key:"recover",value:function(){d.removeClass(this.root,"focus-hide")}},{key:"switchStatus",value:function(e){e?this.setAttr("data-state",this.player.paused?"pause":"play"):this.setAttr("data-state",this.player.paused?"play":"pause")}},{key:"animate",value:function(e){var i=this;this._animateId=id("pauseplay",400,{start:function(){d.addClass(i.root,"interact"),i.show(),i.switchStatus(!0)},end:function(){d.removeClass(i.root,"interact"),!e&&i.hide(),i._animateId=null}})}},{key:"endAnimate",value:function(){d.removeClass(this.root,"interact"),Ps(this._animateId),this._animateId=null}},{key:"switchPausePlay",value:function(e){var i=this.player;if(e.cancelable&&e.preventDefault(),e.stopPropagation(),!(i.state<U.READY)){var r=this.player.paused;!r&&i.state===U.RUNNING?i.pause():i.play()}}},{key:"onPlayPause",value:function(e){this.toggleTo(e)}},{key:"toggleTo",value:function(e){var i=this.config,r=this.player;if(!(!r||r.state<U.RUNNING||!this.autoPlayStart)){if(i.mode==="show"){this.switchStatus(),this.show();return}if(i.mode==="auto"){this.switchStatus();return}if(i.isShowPause&&r.paused&&!r.ended||i.isShowEnd&&r.ended){this.switchStatus(),this.show(),this.endAnimate();return}if(i.disableAnimate){this.switchStatus(),this.hide();return}if(e==="play")this.autoPlayStart?this.animate():this.hide();else{if(!this.autoPlayStart||r.ended)return;this.animate()}}}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.clickHandler),Ps(this._animateId)}},{key:"render",value:function(){var e=this.playerConfig.autoplay?this.config.mode==="auto"?"auto-hide":"hide":"";return`
|
|
89
|
-
<xg-start class="xgplayer-start `.concat(e,`">
|
|
90
|
-
<xg-start-inner></xg-start-inner>
|
|
91
|
-
</xg-start>`)}}],[{key:"pluginName",get:function(){return"start"}},{key:"defaultConfig",get:function(){return{isShowPause:!1,isShowEnd:!1,disableAnimate:!1,mode:"hide"}}}]),n})(j),rd=(function(a){D(n,a);var o=R(n);function n(){return x(this,n),o.apply(this,arguments)}return I(n,[{key:"render",value:function(){var e=this.config.innerHtml,i=d.createDom("xg-enter","",{},"xgplayer-enter");if(e&&e instanceof window.HTMLElement)i.appendChild(e);else if(e&&typeof e=="string")i.innerHTML=e;else{for(var r="",s=1;s<=12;s++)r+='<div class="xgplayer-enter-bar'.concat(s,'"></div>');i.innerHTML='<div class="xgplayer-enter-spinner">'.concat(r,"</div>")}return i}}],[{key:"pluginName",get:function(){return"enter"}},{key:"defaultConfig",get:function(){return{innerHtml:"",logo:""}}}]),n})(j),As=(function(a){D(n,a);var o=R(n);function n(){return x(this,n),o.apply(this,arguments)}return I(n,[{key:"afterCreate",value:function(){this.getMini=this.getMini.bind(this),this.exitMini=this.exitMini.bind(this),this.bind("click",this.getMini)}},{key:"getMini",value:function(){this.config.onClick&&this.config.onClick()}},{key:"exitMini",value:function(){this.config.onClick&&this.config.onClick()}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.getMini)}},{key:"render",value:function(){var e="MINISCREEN";return`
|
|
92
|
-
<xg-icon class="xgplayer-miniicon">
|
|
93
|
-
<div class="xgplayer-icon btn-text"><span class="icon-text" lang-key="`.concat(this.i18nKeys[e],'">').concat(this.i18n[e],`</span></div>
|
|
94
|
-
</xg-icon>`)}}],[{key:"pluginName",get:function(){return"miniscreenIcon"}},{key:"defaultConfig",get:function(){return{position:K.CONTROLS_RIGHT,index:10}}}]),n})(j);function Ls(a){var o=parseFloat(a),n=a.indexOf("%")===-1&&!Number.isNaN(o);return n&&o}var Wr=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],Fl=Wr.length;function ad(){for(var a={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},o=0;o<Fl;o++){var n=Wr[o];a[n]=0}return a}function od(a){var o=window.getComputedStyle(a);return o}function Ds(a){if(typeof a=="string"&&(a=document.querySelector(a)),!(!a||ie(a)!=="object"||!a.nodeType)){var o=od(a);if(o.display==="none")return ad();var n={};n.width=a.offsetWidth,n.height=a.offsetHeight;for(var t=n.isBorderBox=o.boxSizing==="border-box",e=0;e<Fl;e++){var i=Wr[e],r=o[i],s=parseFloat(r);n[i]=Number.isNaN(s)?0:s}var l=n.paddingLeft+n.paddingRight,u=n.paddingTop+n.paddingBottom,f=n.marginLeft+n.marginRight,h=n.marginTop+n.marginBottom,g=n.borderLeftWidth+n.borderRightWidth,p=n.borderTopWidth+n.borderBottomWidth,v=t,y=Ls(o.width);y!==!1&&(n.width=y+(v?0:l+g));var m=Ls(o.height);return m!==!1&&(n.height=m+(v?0:u+p)),n.innerWidth=n.width-(l+g),n.innerHeight=n.height-(u+p),n.outerWidth=n.width+f,n.outerHeight=n.height+h,n}}function sr(a,o){for(var n=0;n<a.length;n++){var t=a[n];if(t.identifier===o)return t}}var lr={START:"dragStart",MOVE:"dragMove",ENDED:"dragEnded"},Rs={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]},sd=(function(a){D(n,a);var o=R(n);function n(t){var e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return x(this,n),e=o.call(this),e.isEnabled=!0,e.isDragging=!1,e.isDown=!1,e.position={},e.downPoint={},e.dragPoint={x:0,y:0},e.startPos={x:0,y:0},e._root=t instanceof Element?t:document.querySelector(t),e._handlerDom=i.handle instanceof Element?i.handle:document.querySelector(i.handle),!e._root||!e._handlerDom?Nr(e):(e._bindStartEvent(),e)}return I(n,[{key:"_bindStartEvent",value:function(){var e=this;"ontouchstart"in window?this._startKey="touchstart":this._startKey="mousedown",this["on".concat(this._startKey)]=this["on".concat(this._startKey)].bind(this),this._handlerDom.addEventListener(this._startKey,this["on".concat(this._startKey)]),Rs[this._startKey].map(function(i){e["on".concat(i)]=e["on".concat(i)].bind(e)})}},{key:"_unbindStartEvent",value:function(){this._handlerDom.removeEventListener(this._startKey,this["on".concat(this._startKey)])}},{key:"_bindPostStartEvents",value:function(e){var i=this;if(e){var r=Rs[this._startKey];r.map(function(s){window.addEventListener(s,i["on".concat(s)])}),this._boundPointerEvents=r}}},{key:"_unbindPostStartEvents",value:function(){var e=this;this._boundPointerEvents&&(this._boundPointerEvents.map(function(i){window.removeEventListener(i,e["on".concat(i)])}),delete this._boundPointerEvents)}},{key:"enable",value:function(){this.isEnabled=!0}},{key:"disable",value:function(){this.isEnabled=!1,this.isDragging&&this.onUp()}},{key:"onDocUp",value:function(e){this.onUp()}},{key:"animate",value:function(){var e=this;this.isDragging&&(this.positionDrag(),window.requestAnimationFrame(function(){e.animate()}))}},{key:"positionDrag",value:function(){var e="translate3d(".concat(this.dragPoint.x,"px, ").concat(this.dragPoint.y,"px, 0)");this._root.style.transform=e,this._root.style.webKitTransform=e}},{key:"setLeftTop",value:function(){this._root.style.left=this.position.x+"px",this._root.style.top=this.position.y+"px"}},{key:"onmousedown",value:function(e){this.dragStart(e,e)}},{key:"onmousemove",value:function(e){this.dragMove(e,e)}},{key:"onmouseup",value:function(e){this.dragEnd(e,e)}},{key:"ontouchstart",value:function(e){var i=e.changedTouches[0];this.dragStart(e,i),this.touchIdentifier=i.pointerId!==void 0?i.pointerId:i.identifier,e.preventDefault()}},{key:"ontouchmove",value:function(e){var i=sr(e.changedTouches,this.touchIdentifier);i&&this.dragMove(e,i)}},{key:"ontouchend",value:function(e){var i=sr(e.changedTouches,this.touchIdentifier);i&&this.dragEnd(e,i),e.preventDefault()}},{key:"ontouchcancel",value:function(e){var i=sr(e.changedTouches,this.touchIdentifier);i&&this.dragCancel(e,i)}},{key:"dragStart",value:function(e,i){if(!(!this._root||this.isDown||!this.isEnabled)){this.downPoint=i,this.dragPoint.x=0,this.dragPoint.y=0,this._getPosition();var r=Ds(this._root);this.startPos.x=this.position.x,this.startPos.y=this.position.y,this.startPos.maxY=window.innerHeight-r.height,this.startPos.maxX=window.innerWidth-r.width,this.setLeftTop(),this.isDown=!0,this._bindPostStartEvents(e)}}},{key:"dragRealStart",value:function(e,i){this.isDragging=!0,this.animate(),this.emit(lr.START,this.startPos)}},{key:"dragEnd",value:function(e,i){this._root&&(this._unbindPostStartEvents(),this.isDragging&&(this._root.style.transform="",this.setLeftTop(),this.emit(lr.ENDED)),this.presetInfo())}},{key:"_dragPointerMove",value:function(e,i){var r={x:i.pageX-this.downPoint.pageX,y:i.pageY-this.downPoint.pageY};return!this.isDragging&&this.hasDragStarted(r)&&this.dragRealStart(e,i),r}},{key:"dragMove",value:function(e,i){if(e=e||window.event,!!this.isDown){var r=this.startPos,s=r.x,l=r.y,u=this._dragPointerMove(e,i),f=u.x,h=u.y;f=this.checkContain("x",f,s),h=this.checkContain("y",h,l),this.position.x=s+f,this.position.y=l+h,this.dragPoint.x=f,this.dragPoint.y=h,this.emit(lr.MOVE,this.position)}}},{key:"dragCancel",value:function(e,i){this.dragEnd(e,i)}},{key:"presetInfo",value:function(){this.isDragging=!1,this.startPos={x:0,y:0},this.dragPoint={x:0,y:0},this.isDown=!1}},{key:"destroy",value:function(){this._unbindStartEvent(),this._unbindPostStartEvents(),this.isDragging&&this.dragEnd(),this.removeAllListeners(),this._handlerDom=null}},{key:"hasDragStarted",value:function(e){return Math.abs(e.x)>3||Math.abs(e.y)>3}},{key:"checkContain",value:function(e,i,r){return i+r<0?0-r:e==="x"&&i+r>this.startPos.maxX?this.startPos.maxX-r:e==="y"&&i+r>this.startPos.maxY?this.startPos.maxY-r:i}},{key:"_getPosition",value:function(){var e=window.getComputedStyle(this._root),i=this._getPositionCoord(e.left,"width"),r=this._getPositionCoord(e.top,"height");this.position.x=Number.isNaN(i)?0:i,this.position.y=Number.isNaN(r)?0:r,this._addTransformPosition(e)}},{key:"_addTransformPosition",value:function(e){var i=e.transform;if(i.indexOf("matrix")===0){var r=i.split(","),s=i.indexOf("matrix3d")===0?12:4,l=parseInt(r[s],10),u=parseInt(r[s+1],10);this.position.x+=l,this.position.y+=u}}},{key:"_getPositionCoord",value:function(e,i){if(e.indexOf("%")!==-1){var r=Ds(this._root.parentNode);return r?parseFloat(e)/100*r[i]:0}return parseInt(e,10)}}]),n})(ll),ld=(function(a){D(n,a);var o=R(n);function n(t){var e;x(this,n),e=o.call(this,t),C(_(e),"onCancelClick",function(s){e.exitMini(),e.isClose=!0}),C(_(e),"onCenterClick",function(s){var l=_(e),u=l.player;u.paused?u.play():u.pause()}),C(_(e),"onScroll",function(s){if(!(!window.scrollY&&window.scrollY!==0||Math.abs(window.scrollY-e.pos.scrollY)<50)){var l=parseInt(d.getCss(e.player.root,"height"));l+=e.config.scrollTop,e.pos.scrollY=window.scrollY,window.scrollY>l+5?!e.isMini&&!e.isClose&&e.getMini():window.scrollY<=l&&(e.isMini&&e.exitMini(),e.isClose=!1)}}),e.isMini=!1,e.isClose=!1;var i=_(e),r=i.config;return e.pos={left:r.left<0?window.innerWidth-r.width-20:r.left,top:r.top<0?window.innerHeight-r.height-20:r.top,height:e.config.height,width:e.config.width,scrollY:window.scrollY||0},e.lastStyle=null,e}return I(n,[{key:"beforeCreate",value:function(e){typeof e.player.config.mini=="boolean"&&(e.config.isShowIcon=e.player.config.mini)}},{key:"afterCreate",value:function(){var e=this;this.initIcons(),this.on(et,function(){e.setAttr("data-state","pause")}),this.on(le,function(){e.setAttr("data-state","play")})}},{key:"onPluginsReady",value:function(){var e=this,i=this.player,r=this.config;if(!r.disable){if(this.config.isShowIcon){var s={config:{onClick:function(){e.getMini()}}};i.controls.registerPlugin(As,s,As.pluginName)}var l=d.checkTouchSupport()?"touchend":"click";this.bind(".mini-cancel-btn",l,this.onCancelClick),this.bind(".play-icon",l,this.onCenterClick),this.config.disableDrag||(this._draggabilly=new sd(this.player.root,{handle:this.root})),this.config.isScrollSwitch&&window.addEventListener("scroll",this.onScroll)}}},{key:"registerIcons",value:function(){return{play:{icon:qr,class:"xg-icon-play"},pause:{icon:Gr,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".play-icon",e.play),this.appendChild(".play-icon",e.pause)}},{key:"getMini",value:function(){var e=this;if(!this.isMini){var i=this.player,r=this.playerConfig,s=this.config.target||this.player.root;this.lastStyle={},d.addClass(i.root,"xgplayer-mini"),["width","height","top","left"].map(function(l){e.lastStyle[l]=s.style[l],s.style[l]="".concat(e.pos[l],"px")}),r.fluid&&(s.style["padding-top"]=""),this.emit(Ot,!0),i.isMini=this.isMini=!0}}},{key:"exitMini",value:function(){var e=this;if(!this.isMini)return!1;var i=this.player,r=this.playerConfig,s=this.config.target||this.player.root;d.removeClass(i.root,"xgplayer-mini"),this.lastStyle&&Object.keys(this.lastStyle).map(function(l){s.style[l]=e.lastStyle[l]}),this.lastStyle=null,r.fluid&&(i.root.style.width="100%",i.root.style.height="0",i.root.style["padding-top"]="".concat(r.height*100/r.width,"%")),this.emit(Ot,!1),this.isMini=i.isMini=!1}},{key:"updatePos",value:function(e){this.pos=Object.assign(this.pos,e),this.isMini&&(this.player.root.style.left="".concat(this.pos.left,"px"),this.player.root.style.top="".concat(this.pos.top,"px"),this.player.root.style.width="".concat(this.pos.width,"px"),this.player.root.style.height="".concat(this.pos.height,"px"))}},{key:"destroy",value:function(){window.removeEventListener("scroll",this.onScroll);var e=d.checkTouchSupport()?"touchend":"click";this.unbind(".mini-cancel-btn",e,this.onCancelClick),this.unbind(".play-icon",e,this.onCenterClick),this._draggabilly&&this._draggabilly.destroy(),this._draggabilly=null,this.exitMini()}},{key:"render",value:function(){if(!this.config.disable)return`
|
|
95
|
-
<xg-mini-layer class="xg-mini-layer">
|
|
96
|
-
<xg-mini-header class="xgplayer-mini-header">
|
|
97
|
-
`.concat(Ne(this,"MINI_DRAG",this.playerConfig.isHideTips),`
|
|
98
|
-
</xg-mini-header>
|
|
99
|
-
<div class="mini-cancel-btn">
|
|
100
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
|
|
101
|
-
<path fill="#fff" fill-rule="evenodd" d="M3.99 3.49a1 1 0 0 1 1.414 0L10 8.085l4.596-4.595a1 1 0 1 1 1.414 1.414L11.414 9.5l4.596 4.596a1 1 0 0 1 .084 1.32l-.084.094a1 1 0 0 1-1.414 0L10 10.914 5.404 15.51a1 1 0 0 1-1.414-1.414L8.585 9.5 3.99 4.904a1 1 0 0 1-.084-1.32z"></path>
|
|
102
|
-
</svg>
|
|
103
|
-
</div>
|
|
104
|
-
<div class="play-icon">
|
|
105
|
-
</div>
|
|
106
|
-
</xg-mini-layer>`)}}],[{key:"pluginName",get:function(){return"miniscreen"}},{key:"defaultConfig",get:function(){return{index:10,disable:!1,width:320,height:180,left:-1,top:-1,isShowIcon:!1,isScrollSwitch:!1,scrollTop:0,disableDrag:!1}}}]),n})(j),xt={mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousemove:"onMouseMove"},ur=["videoClick","videoDbClick"],cr=(function(a){D(n,a);var o=R(n);function n(){var t;x(this,n);for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return t=o.call.apply(o,[this].concat(i)),C(_(t),"onMouseMove",function(s){var l=_(t),u=l.player,f=l.playerConfig;u.isActive||(u.focus({autoHide:!f.closeDelayBlur}),!f.closeFocusVideoFocus&&u.media.focus())}),C(_(t),"onMouseEnter",function(s){var l=_(t),u=l.playerConfig,f=l.player;!u.closeFocusVideoFocus&&f.media.focus(),u.closeDelayBlur?f.focus({autoHide:!1}):f.focus(),t.emit(vl)}),C(_(t),"onMouseLeave",function(s){var l=t.playerConfig,u=l.closePlayerBlur,f=l.leavePlayerTime,h=l.closeDelayBlur;!u&&!h&&(f?t.player.focus({autoHide:!0,delay:f}):t.player.blur({ignorePaused:!0})),t.emit(pl)}),C(_(t),"onVideoClick",function(s){var l=_(t),u=l.player,f=l.playerConfig;s.target&&f.closeVideoClick||(s.target===u.root||s.target===u.media||s.target===u.innerContainer||s.target===u.media.__canvas)&&(s.preventDefault(),f.closeVideoStopPropagation||s.stopPropagation(),t._clickCount++,t.clickTimer&&(clearTimeout(t.clickTimer),t.clickTimer=null),t.clickTimer=setTimeout(function(){t._clickCount&&(t._clickCount--,me(_(t),ur[0],function(h,g){t.switchPlayPause(g.e)},{e:s,paused:u.paused}),clearTimeout(t.clickTimer),t.clickTimer=null)},300))}),C(_(t),"onVideoDblClick",function(s){var l=_(t),u=l.player,f=l.playerConfig;if(!(f.closeVideoDblclick||!s.target||s.target!==u.media&&s.target!==u.media.__canvas)){if(!f.closeVideoClick&&t._clickCount<2){t._clickCount=0;return}t._clickCount=0,t.clickTimer&&(clearTimeout(t.clickTimer),t.clickTimer=null),s.preventDefault(),s.stopPropagation(),me(_(t),ur[1],function(h,g){t.emitUserAction(g.e,"switch_fullscreen",{props:"fullscreen",from:u.fullscreen,to:!u.fullscreen}),u.fullscreen?u.exitFullscreen():u.getFullscreen()},{e:s,fullscreen:u.fullscreen})}}),t}return I(n,[{key:"afterCreate",value:function(){var e=this;this._clickCount=0,ur.map(function(r){e.__hooks[r]=null});var i=this.playerConfig.isMobileSimulateMode;i==="mobile"||B.device==="mobile"&&!B.os.isIpad||this.initEvents()}},{key:"initEvents",value:function(){var e=this,i=this.player,r=i.media,s=i.root,l=this.playerConfig.enableContextmenu;s&&s.addEventListener("click",this.onVideoClick,!1),s&&s.addEventListener("dblclick",this.onVideoDblClick,!1),Object.keys(xt).map(function(u){s.addEventListener(u,e[xt[u]],!1)}),!l&&r&&r.addEventListener("contextmenu",this.onContextmenu,!1)}},{key:"switchPlayPause",value:function(e){var i=this.player;this.emitUserAction(e,"switch_play_pause",{props:"paused",from:i.paused,to:!i.paused}),i.ended?i.duration!==1/0&&i.duration>0&&i.replay():i.paused?i.play():i.pause()}},{key:"onContextmenu",value:function(e){e=e||window.event,e.preventDefault&&e.preventDefault(),e.stopPropagation?e.stopPropagation():(e.returnValue=!1,e.cancelBubble=!0)}},{key:"destroy",value:function(){var e=this,i=this.player,r=i.video,s=i.root;this.clickTimer&&clearTimeout(this.clickTimer),s.removeEventListener("click",this.onVideoClick,!1),s.removeEventListener("dblclick",this.onVideoDblClick,!1),r.removeEventListener("contextmenu",this.onContextmenu,!1),Object.keys(xt).map(function(l){s.removeEventListener(l,e[xt[l]],!1)})}}],[{key:"pluginName",get:function(){return"pc"}},{key:"defaultConfig",get:function(){return{}}}]),n})(Oe),Le={PRESS:"press",PRESS_END:"pressend",DOUBlE_CLICK:"doubleclick",CLICK:"click",TOUCH_MOVE:"touchmove",TOUCH_START:"touchstart",TOUCH_END:"touchend"},ud={start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},cd={start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"};function Os(a){return a&&a.length>0?a[a.length-1]:null}function fd(){return{pressDelay:600,dbClickDelay:200,disablePress:!1,disableDbClick:!1,miniStep:2,needPreventDefault:!0}}var hd=(function(){function a(o){var n=this,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{eventType:"touch"};x(this,a),C(this,"onTouchStart",function(e){var i=n._pos,r=n.root,s=Os(e.touches);i.x=s?parseInt(s.pageX,10):e.pageX,i.y=s?parseInt(s.pageX,10):e.pageX,i.start=!0,n.__setPress(e),r.addEventListener(n.events.end,n.onTouchEnd),r.addEventListener(n.events.cancel,n.onTouchCancel),r.addEventListener(n.events.move,n.onTouchMove),n.trigger(Le.TOUCH_START,e)}),C(this,"onTouchCancel",function(e){n.onTouchEnd(e)}),C(this,"onTouchEnd",function(e){var i=n._pos,r=n.root;n.__clearPress(),r.removeEventListener(n.events.cancel,n.onTouchCancel),r.removeEventListener(n.events.end,n.onTouchEnd),r.removeEventListener(n.events.move,n.onTouchMove),e.moving=i.moving,e.press=i.press,i.press&&n.trigger(Le.PRESS_END,e),n.trigger(Le.TOUCH_END,e),!i.press&&!i.moving&&n.__setDb(e),i.press=!1,i.start=!1,i.moving=!1}),C(this,"onTouchMove",function(e){var i=n._pos,r=n.config,s=Os(e.touches),l=s?parseInt(s.pageX,10):e.pageX,u=s?parseInt(s.pageY,10):e.pageX,f=l-i.x,h=u-i.y;Math.abs(h)<r.miniStep&&Math.abs(f)<r.miniStep||(n.__clearPress(),i.press&&n.trigger(Le.PRESS_END,e),i.press=!1,i.moving=!0,n.trigger(Le.TOUCH_MOVE,e))}),this._pos={moving:!1,start:!1,x:0,y:0},this.config=fd(),Object.keys(t).map(function(e){n.config[e]=t[e]}),this.root=o,this.events=t.eventType==="mouse"?cd:ud,this.pressIntrvalId=null,this.dbIntrvalId=null,this.__handlers={},this._initEvent()}return I(a,[{key:"_initEvent",value:function(){this.root.addEventListener(this.events.start,this.onTouchStart)}},{key:"__setPress",value:function(n){var t=this,e=this.config;this.pressIntrvalId&&this.__clearPress(),this.pressIntrvalId=setTimeout(function(){t.trigger(Le.PRESS,n),t._pos.press=!0,t.__clearPress()},e.pressDelay)}},{key:"__clearPress",value:function(){window.clearTimeout(this.pressIntrvalId),this.pressIntrvalId=null}},{key:"__setDb",value:function(n){var t=this,e=this.config;if(this.dbIntrvalId){this.__clearDb(),this.trigger(Le.DOUBlE_CLICK,n);return}this.dbIntrvalId=setTimeout(function(){t.__clearDb(),!t._pos.start&&!t._pos.press&&!t._pos.moving&&t.trigger(Le.CLICK,n)},e.dbClickDelay)}},{key:"__clearDb",value:function(){clearTimeout(this.dbIntrvalId),this.dbIntrvalId=null}},{key:"on",value:function(n,t){this.__handlers[n]||(this.__handlers[n]=[]),this.__handlers[n].push(t)}},{key:"off",value:function(n,t){if(this.__handlers[n]){for(var e=this.__handlers[n],i=-1,r=0;r<e.length;r++)if(e[r]===t){i=r;break}i>=0&&this.__handlers[n].splice(i,1)}}},{key:"trigger",value:function(n,t){this.__handlers[n]&&this.__handlers[n].map(function(e){try{e(t)}catch(i){console.error("trigger>>:".concat(n),i)}})}},{key:"destroy",value:function(){var n=this,t={touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"};Object.keys(t).forEach(function(e){n.root.removeEventListener(e,n[t[e]])})}}]),a})();function dd(){return new DOMParser().parseFromString(`<svg width="20" height="9" viewBox="0 0 8 9" fill="none" xmlns="http://www.w3.org/2000/svg"
|
|
107
|
-
xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
108
|
-
<path opacity="0.54"
|
|
109
|
-
d="M7.5 3.63397C8.16667 4.01887 8.16667 4.98113 7.5 5.36603L1.5 8.83013C0.833334 9.21503 0 8.7339 0 7.9641L0 1.0359C0 0.266098 0.833333 -0.215027 1.5 0.169873L7.5 3.63397Z"
|
|
110
|
-
fill="white" />
|
|
111
|
-
<path transform="translate(5 0)" d="M7.5 3.63397C8.16667 4.01887 8.16667 4.98113 7.5 5.36603L1.5 8.83013C0.833334 9.21503 0 8.7339 0 7.9641L0 1.0359C0 0.266098 0.833333 -0.215027 1.5 0.169873L7.5 3.63397Z" fill="white"/>
|
|
112
|
-
</svg>`,"image/svg+xml").firstChild}var Ke={AUTO:"auto",SEEKING:"seeking",PLAYBACK:"playbackrate"},fr=["videoClick","videoDbClick"],gd=(function(a){D(n,a);var o=R(n);function n(t){var e;return x(this,n),e=o.call(this,t),C(_(e),"onTouchStart",function(i){var r=_(e),s=r.player,l=r.config,u=r.pos,f=r.playerConfig,h=e.getTouche(i);if(h&&!l.disableGesture&&e.duration>0&&!s.ended){u.isStart=!0,e.timer&&clearTimeout(e.timer),d.checkIsFunction(f.disableSwipeHandler)&&f.disableSwipeHandler(),e.find(".xg-dur").innerHTML=d.format(e.duration);var g=e.root.getBoundingClientRect();s.rotateDeg===90?(u.top=g.left,u.left=g.top,u.width=g.height,u.height=g.width):(u.top=g.top,u.left=g.left,u.width=g.width,u.height=g.height);var p=parseInt(h.pageX-u.left,10),v=parseInt(h.pageY-u.top,10);u.x=s.rotateDeg===90?v:p,u.y=s.rotateDeg===90?p:v,u.scopeL=l.scopeL*u.width,u.scopeR=(1-l.scopeR)*u.width,u.scopeM1=u.width*(1-l.scopeM)/2,u.scopeM2=u.width-u.scopeM1}}),C(_(e),"onTouchMove",function(i){var r=e.getTouche(i),s=_(e),l=s.pos,u=s.config,f=s.player;if(!(!r||u.disableGesture||!e.duration||!l.isStart)){var h=u.miniMoveStep,g=u.hideControlsActive,p=parseInt(r.pageX-l.left,10),v=parseInt(r.pageY-l.top,10),y=f.rotateDeg===90?v:p,m=f.rotateDeg===90?p:v;if(Math.abs(y-l.x)>h||Math.abs(m-l.y)>h){var b=y-l.x,k=m-l.y,w=l.scope;if(w===-1&&(w=e.checkScope(y,m,b,k,l),w===0&&(g?f.blur():f.focus({autoHide:!1}),!l.time&&(l.time=parseInt(f.currentTime*1e3,10)+e.timeOffset*1e3)),l.scope=w),w===-1||w>0&&!u.gestureY||w===0&&!u.gestureX)return;e.executeMove(b,k,w,l.width,l.height),l.x=y,l.y=m}}}),C(_(e),"onTouchEnd",function(i){var r=_(e),s=r.player,l=r.pos,u=r.playerConfig;if(setTimeout(function(){s.getPlugin("progress")&&s.getPlugin("progress").resetSeekState()},10),!!l.isStart){l.scope>-1&&i.cancelable&&i.preventDefault();var f=e.config,h=f.disableGesture,g=f.gestureX;!h&&g?e.endLastMove(l.scope):l.time=0,l.scope=-1,e.resetPos(),d.checkIsFunction(u.enableSwipeHandler)&&u.enableSwipeHandler(),e.changeAction(Ke.AUTO)}}),C(_(e),"onRootTouchMove",function(i){e.config.disableGesture||!e.config.gestureX||e.checkIsRootTarget(i)&&(i.stopPropagation(),e.pos.isStart?e.onTouchMove(i):e.onTouchStart(i))}),C(_(e),"onRootTouchEnd",function(i){e.pos.scope>-1&&e.onTouchEnd(i)}),e.pos={isStart:!1,x:0,y:0,time:0,volume:0,rate:1,light:0,width:0,height:0,scopeL:0,scopeR:0,scopeM1:0,scopeM2:0,scope:-1},e.timer=null,e}return I(n,[{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"registerIcons",value:function(){return{seekTipIcon:{icon:dd,class:"xg-seek-pre"}}}},{key:"afterCreate",value:function(){var e=this;fr.map(function(g){e.__hooks[g]=null});var i=this.playerConfig,r=this.config,s=this.player;i.closeVideoDblclick===!0&&(r.closedbClick=!0),this.resetPos(),d.isUndefined(i.disableGesture)||(r.disableGesture=!!i.disableGesture),this.appendChild(".xg-seek-icon",this.icons.seekTipIcon),this.xgMask=d.createDom("xg-mask","",{},"xgmask"),s.root.appendChild(this.xgMask),this.initCustomStyle(),this.registerThumbnail();var l=this.domEventType==="mouse"?"mouse":"touch";this.touch=new hd(this.root,{eventType:l,needPreventDefault:!this.config.disableGesture}),this.root.addEventListener("contextmenu",function(g){g.preventDefault()}),s.root.addEventListener("touchmove",this.onRootTouchMove,!0),s.root.addEventListener("touchend",this.onRootTouchEnd,!0),s.root.addEventListener("touchcancel",this.onRootTouchEnd,!0);var u=this.player.controls;u&&u.center&&(u.center.addEventListener("touchmove",this.onRootTouchMove,!0),u.center.addEventListener("touchend",this.onRootTouchEnd,!0),u.center.addEventListener("touchcancel",this.onRootTouchEnd,!0)),this.on(Se,function(){var g=e.player,p=e.config;g.duration>0&&g.duration*1e3<p.moveDuration&&(p.moveDuration=g.duration*1e3)}),this.on([be,Ue],function(){var g=e.pos,p=g.time,v=g.isStart;!v&&p>0&&(e.pos.time=0)});var f={touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",press:"onPress",pressend:"onPressEnd",click:"onClick",doubleclick:"onDbClick"};if(Object.keys(f).map(function(g){e.touch.on(g,function(p){e[f[g]](p)})}),!r.disableActive){var h=s.plugins.progress;h&&(h.addCallBack("dragmove",function(g){e.activeSeekNote(g.currentTime,g.forward)}),["dragend","click"].forEach(function(g){h.addCallBack(g,function(){e.changeAction(Ke.AUTO)})}))}}},{key:"registerThumbnail",value:function(){var e=this.player,i=e.plugins.thumbnail;if(i&&i.usable){this.thumbnail=i.createThumbnail(null,"mobile-thumbnail");var r=this.find(".time-preview");r.insertBefore(this.thumbnail,r.children[0])}}},{key:"initCustomStyle",value:function(){var e=this.playerConfig||{},i=e.commonStyle,r=i.playedColor,s=i.progressColor,l=i.timePreviewStyle,u=i.curTimeColor,f=i.durationColor;if(r&&(this.find(".xg-curbar").style.backgroundColor=r),s&&(this.find(".xg-bar").style.backgroundColor=s),l){var h=this.find(".time-preview");Object.keys(l).forEach(function(v){h.style[v]=l[v]})}var g=u||r,p=f;g&&(this.find(".xg-cur").style.color=g),p&&(this.find(".xg-dur").style.color=p),this.config.disableTimeProgress&&d.addClass(this.find(".xg-timebar"),"hide")}},{key:"resetPos",value:function(){var e=this;this.pos?(this.pos.isStart=!1,this.pos.scope=-1,["x","y","width","height","scopeL","scopeR","scopeM1","scopeM2"].map(function(i){e.pos[i]=0})):this.pos={isStart:!1,x:0,y:0,volume:0,rate:1,light:0,width:0,height:0,scopeL:0,scopeR:0,scopeM1:0,scopeM2:0,scope:-1,time:0}}},{key:"changeAction",value:function(e){var i=this.player,r=this.root;r.setAttribute("data-xg-action",e);var s=i.plugins.start;s&&s.recover()}},{key:"getTouche",value:function(e){var i=this.player.rotateDeg,r=e.touches&&e.touches.length>0?e.touches[e.touches.length-1]:e;return i===0?{pageX:r.pageX,pageY:r.pageY}:{pageX:r.pageX,pageY:r.pageY}}},{key:"checkScope",value:function(e,i,r,s,l){var u=l.width,f=-1;if(e<0||e>u)return f;var h=Math.abs(s===0?r:r/s);return Math.abs(r)>0&&h>=1.73&&e>l.scopeM1&&e<l.scopeM2?f=0:(Math.abs(r)===0||h<=.57)&&(f=e<l.scopeL?1:e>l.scopeR?2:3),f}},{key:"executeMove",value:function(e,i,r,s,l){switch(r){case 0:this.updateTime(e/s*this.config.scopeM);break;case 1:this.updateBrightness(i/l);break;case 2:B.os.isIos||this.updateVolume(i/l);break}}},{key:"endLastMove",value:function(e){var i=this,r=this.pos,s=this.player,l=this.config,u=(r.time-this.timeOffset)/1e3;switch(e){case 0:s.seek(Number(u).toFixed(1)),l.hideControlsEnd?s.blur():s.focus(),this.timer=setTimeout(function(){i.pos.time=0},500);break}this.changeAction(Ke.AUTO)}},{key:"checkIsRootTarget",value:function(e){var i=this.player.plugins||{};return i.progress&&i.progress.root.contains(e.target)?!1:i.start&&i.start.root.contains(e.target)||i.controls&&i.controls.root.contains(e.target)}},{key:"sendUseAction",value:function(e){var i=this.player.paused;this.emitUserAction(e,"switch_play_pause",{prop:"paused",from:i,to:!i})}},{key:"clickHandler",value:function(e){var i=this.player,r=this.config,s=this.playerConfig;if(i.state<U.RUNNING){s.closeVideoClick||(this.sendUseAction(d.createEvent("click")),i.play());return}!r.closedbClick||s.closeVideoClick?i.isActive?i.blur():i.focus():s.closeVideoClick||((i.isActive||r.focusVideoClick)&&(this.sendUseAction(d.createEvent("click")),this.switchPlayPause()),i.focus())}},{key:"dbClickHandler",value:function(e){var i=this.config,r=this.player;!i.closedbClick&&r.state>=U.RUNNING&&(this.sendUseAction(d.createEvent("dblclick")),this.switchPlayPause())}},{key:"onClick",value:function(e){var i=this,r=this.player;me(this,fr[0],function(s,l){i.clickHandler(l.e)},{e,paused:r.paused})}},{key:"onDbClick",value:function(e){var i=this,r=this.player;me(this,fr[1],function(s,l){i.dbClickHandler(l.e)},{e,paused:r.paused})}},{key:"onPress",value:function(e){var i=this.pos,r=this.config,s=this.player;r.disablePress||(i.rate=this.player.playbackRate,this.emitUserAction("press","change_rate",{prop:"playbackRate",from:s.playbackRate,to:r.pressRate}),s.playbackRate=r.pressRate,this.changeAction(Ke.PLAYBACK))}},{key:"onPressEnd",value:function(e){var i=this.pos,r=this.config,s=this.player;r.disablePress||(this.emitUserAction("pressend","change_rate",{prop:"playbackRate",from:s.playbackRate,to:i.rate}),s.playbackRate=i.rate,i.rate=1,this.changeAction(Ke.AUTO))}},{key:"updateTime",value:function(e){var i=this.player,r=this.config,s=this.player.duration;e=Number(e.toFixed(4));var l=parseInt(e*r.moveDuration,10)+this.timeOffset;l+=this.pos.time,l=l<0?0:l>s*1e3?s*1e3-200:l,i.getPlugin("time")&&i.getPlugin("time").updateTime(l/1e3),i.getPlugin("progress")&&i.getPlugin("progress").updatePercent(l/1e3/this.duration,!0),this.activeSeekNote(l/1e3,e>0),r.isTouchingSeek&&i.seek(Number((l-this.timeOffset)/1e3).toFixed(1)),this.pos.time=l}},{key:"updateVolume",value:function(e){this.player.rotateDeg&&(e=-e);var i=this.player,r=this.pos;if(e=parseInt(e*100,10),r.volume+=e,!(Math.abs(r.volume)<10)){var s=parseInt(i.volume*10,10)-parseInt(r.volume/10,10);s=s>10?10:s<1?0:s,i.volume=s/10,r.volume=0}}},{key:"updateBrightness",value:function(e){var i=this.pos,r=this.config,s=this.xgMask;if(r.darkness){this.player.rotateDeg&&(e=-e);var l=i.light+.8*e;l=l>r.maxDarkness?r.maxDarkness:l<0?0:l,s&&(s.style.backgroundColor="rgba(0,0,0,".concat(l,")")),i.light=l}}},{key:"activeSeekNote",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this.player,s=this.config,l=!(this.duration!==1/0&&this.duration>0);if(!(!e||typeof e!="number"||l||s.disableActive)){e<0?e=0:e>r.duration&&(e=r.duration-.2),this.changeAction(Ke.SEEKING);var u=r.plugins.start;u&&u.focusHide(),this.find(".xg-dur").innerHTML=d.format(this.duration),this.find(".xg-cur").innerHTML=d.format(e),this.find(".xg-curbar").style.width="".concat(e/this.duration*100,"%"),i?d.removeClass(this.find(".xg-seek-show"),"xg-back"):d.addClass(this.find(".xg-seek-show"),"xg-back"),this.updateThumbnails(e)}}},{key:"updateThumbnails",value:function(e){var i=this.player,r=i.plugins.thumbnail;r&&r.usable&&this.thumbnail&&r.update(this.thumbnail,e,160,90)}},{key:"switchPlayPause",value:function(){var e=this.player;if(e.state<U.ATTACHED)return!1;e.ended||(e.paused?e.play():e.pause())}},{key:"disableGesture",value:function(){this.config.disableGesture=!0}},{key:"enableGesture",value:function(){this.config.disableGesture=!1}},{key:"destroy",value:function(){var e=this.player;this.timer&&clearTimeout(this.timer),this.thumbnail=null,e.root.removeChild(this.xgMask),this.xgMask=null,this.touch&&this.touch.destroy(),this.touch=null,e.root.removeEventListener("touchmove",this.onRootTouchMove,!0),e.root.removeEventListener("touchend",this.onRootTouchEnd,!0),e.root.removeEventListener("touchcancel",this.onRootTouchEnd,!0);var i=this.player.controls;i&&i.center&&(i.center.removeEventListener("touchmove",this.onRootTouchMove,!0),i.center.removeEventListener("touchend",this.onRootTouchEnd,!0),i.center.removeEventListener("touchcancel",this.onRootTouchEnd,!0))}},{key:"render",value:function(){var e=this.config.gradient!=="normal"?"gradient ".concat(this.config.gradient):"gradient";return`
|
|
113
|
-
<xg-trigger class="trigger">
|
|
114
|
-
<div class="`.concat(e,`"></div>
|
|
115
|
-
<div class="time-preview">
|
|
116
|
-
<div class="xg-seek-show `).concat(this.config.disableSeekIcon?" hide-seek-icon":"",`">
|
|
117
|
-
<i class="xg-seek-icon"></i>
|
|
118
|
-
<span class="xg-cur">00:00</span>
|
|
119
|
-
<span class="xg-separator">/</span>
|
|
120
|
-
<span class="xg-dur">00:00</span>
|
|
121
|
-
</div>
|
|
122
|
-
<div class="xg-bar xg-timebar">
|
|
123
|
-
<div class="xg-curbar"></div>
|
|
124
|
-
</div>
|
|
125
|
-
</div>
|
|
126
|
-
<div class="xg-playbackrate xg-top-note">
|
|
127
|
-
<span><i>`).concat(this.config.pressRate,"X</i>").concat(this.i18n.FORWARD,`</span>
|
|
128
|
-
</div>
|
|
129
|
-
</xg-trigger>
|
|
130
|
-
`)}}],[{key:"pluginName",get:function(){return"mobile"}},{key:"defaultConfig",get:function(){return{index:0,disableGesture:!1,gestureX:!0,gestureY:!0,gradient:"normal",isTouchingSeek:!1,miniMoveStep:5,miniYPer:5,scopeL:.25,scopeR:.25,scopeM:.9,pressRate:2,darkness:!0,maxDarkness:.8,disableActive:!1,disableTimeProgress:!1,hideControlsActive:!1,hideControlsEnd:!1,moveDuration:360*1e3,closedbClick:!1,disablePress:!0,disableSeekIcon:!1,focusVideoClick:!1}}}]),n})(j);function pd(a){a.preventDefault(),a.returnValue=!1}function Ns(a){var o=a.tagName;return!!(o==="INPUT"||o==="TEXTAREA"||a.isContentEditable)}var Ms=(function(a){D(n,a);var o=R(n);function n(){var t;x(this,n);for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return t=o.call.apply(o,[this].concat(i)),C(_(t),"onBodyKeyDown",function(s){if(t.player){var l=s||window.event,u=l.keyCode,f=_(t),h=f._keyState,g=f.player,p=t.config,v=p.disable,y=p.disableBodyTrigger,m=p.isIgnoreUserActive;if(v||y||!(g.isUserActive||m)||Ns(l.target)||!t.checkIsVisible()||l.metaKey||l.altKey||l.ctrlKey){h.isBodyKeyDown=!1;return}!s.repeat&&!h.isKeyDown&&((l.target===document.body||t.config.isGlobalTrigger&&!Ns(l.target))&&t.checkCode(u,!0)&&(h.isBodyKeyDown=!0),document.addEventListener("keyup",t.onBodyKeyUp)),h.isBodyKeyDown&&t.handleKeyDown(l)}}),C(_(t),"onBodyKeyUp",function(s){t.player&&(document.removeEventListener("keyup",t.onBodyKeyUp),t.handleKeyUp(s))}),C(_(t),"onKeydown",function(s){if(t.player){var l=s||window.event,u=_(t),f=u._keyState;if(!l.repeat){if(t.config.disable||t.config.disableRootTrigger||l.metaKey||l.altKey||l.ctrlKey)return;l&&(l.keyCode===37||t.checkCode(l.keyCode))&&(l.target===t.player.root||l.target===t.player.video||l.target===t.player.controls.el)&&(f.isKeyDown=!0),t.player.root.addEventListener("keyup",t.onKeyup)}f.isKeyDown&&t.handleKeyDown(l)}}),C(_(t),"onKeyup",function(s){t.player&&(t.player.root.removeEventListener("keyup",t.onKeyup),t.handleKeyUp(s))}),t}return I(n,[{key:"mergekeyCodeMap",value:function(){var e=this,i=this.config.keyCodeMap;i&&Object.keys(i).map(function(r){e.keyCodeMap[r]?["keyCode","action","disable","pressAction","disablePress","isBodyTarget"].map(function(s){i[r][s]&&(e.keyCodeMap[r][s]=i[r][s])}):e.keyCodeMap[r]=i[r]})}},{key:"afterCreate",value:function(){this.config.disable=!this.playerConfig.keyShortcut;var e=typeof this.config.seekStep=="function"?this.config.seekStep(this.player):this.config.seekStep;!e||typeof e!="number"||(this.seekStep=e),this.keyCodeMap={space:{keyCode:32,action:"playPause",disable:!1,disablePress:!1,noBodyTarget:!1},up:{keyCode:38,action:"upVolume",disable:!1,disablePress:!1,noBodyTarget:!0},down:{keyCode:40,action:"downVolume",disable:!1,disablePress:!1,noBodyTarget:!0},left:{keyCode:37,action:"seekBack",disablePress:!1,disable:!1},right:{keyCode:39,action:"seek",pressAction:"changePlaybackRate",disablePress:!1,disable:!1},esc:{keyCode:27,action:"exitFullscreen",disablePress:!0,disable:!1}},this.mergekeyCodeMap(),this._keyState={isKeyDown:!1,isBodyKeyDown:!1,isPress:!1,tt:0,playbackRate:0},this.player.root.addEventListener("keydown",this.onKeydown),document.addEventListener("keydown",this.onBodyKeyDown)}},{key:"setConfig",value:function(e){var i=this;Object.keys(e).forEach(function(r){i.config[r]=e[r]})}},{key:"checkIsVisible",value:function(){if(!this.config.checkVisible)return!0;var e=this.player.root.getBoundingClientRect(),i=e.height,r=e.top,s=e.bottom,l=window.innerHeight;return!(r<0&&r<0-i*.9||s>0&&s-l>i*.9)}},{key:"checkCode",value:function(e,i){var r=this,s=!1;return Object.keys(this.keyCodeMap).map(function(l){r.keyCodeMap[l]&&e===r.keyCodeMap[l].keyCode&&!r.keyCodeMap[l].disable&&(s=!i||i&&!r.keyCodeMap[l].noBodyTarget)}),s}},{key:"downVolume",value:function(e){var i=this.player;if(!(i.volume<=0)){var r=parseFloat((i.volume-.1).toFixed(1)),s={volume:{from:i.volume,to:r}};this.emitUserAction(e,"change_volume",{props:s}),r>=0?i.volume=r:i.volume=0}}},{key:"upVolume",value:function(e){var i=this.player;if(!(i.volume>=1)){var r=parseFloat((i.volume+.1).toFixed(1)),s={volume:{from:i.volume,to:r}};this.emitUserAction(e,"change_volume",{props:s}),r<=1?i.volume=r:i.volume=1}}},{key:"seek",value:function(e){var i=this.player,r=i.currentTime,s=i.offsetCurrentTime,l=i.duration,u=i.offsetDuration,f=i.timeSegments,h=s>-1?s:r,g=u||l,p=e.repeat&&this.seekStep>=4?parseInt(this.seekStep/2,10):this.seekStep;h+p<=g?h=h+p:h=g;var v=d.getCurrentTimeByOffset(h,f),y={currentTime:{from:r,to:v}};this.emitUserAction(e,"seek",{props:y}),this.player.currentTime=v}},{key:"seekBack",value:function(e){var i=this.player,r=i.currentTime,s=i.offsetCurrentTime,l=i.timeSegments,u=e.repeat?parseInt(this.seekStep/2,10):this.seekStep,f=s>-1?s:r,h=f-u;h<0&&(h=0),h=d.getCurrentTimeByOffset(h,l);var g={currentTime:{from:r,to:h}};this.emitUserAction(e,"seek",{props:g}),this.player.currentTime=h}},{key:"changePlaybackRate",value:function(e){var i=this._keyState,r=this.config,s=this.player;i.playbackRate===0&&(i.playbackRate=s.playbackRate,s.playbackRate=r.playbackRate)}},{key:"playPause",value:function(e){var i=this.player;i&&(this.emitUserAction(e,"switch_play_pause"),i.paused?i.play():i.pause())}},{key:"exitFullscreen",value:function(e){var i=this.player,r=i.fullscreen,s=i.cssfullscreen;r&&(this.emitUserAction("keyup","switch_fullscreen",{prop:"fullscreen",from:r,to:!r}),i.exitFullscreen()),s&&(this.emitUserAction("keyup","switch_css_fullscreen",{prop:"cssfullscreen",from:s,to:!s}),i.exitCssFullscreen())}},{key:"handleKeyDown",value:function(e){var i=this._keyState;if(e.repeat){i.isPress=!0;var r=Date.now();if(r-i.tt<200)return;i.tt=r}this.handleKeyCode(e.keyCode,e,i.isPress)}},{key:"handleKeyUp",value:function(e){var i=this._keyState;i.playbackRate>0&&(this.player.playbackRate=i.playbackRate,i.playbackRate=0),i.isKeyDown=!1,i.isPress=!1,i.tt=0}},{key:"handleKeyCode",value:function(e,i,r){for(var s=Object.keys(this.keyCodeMap),l=0;l<s.length;l++){var u=this.keyCodeMap[s[l]],f=u.action,h=u.keyCode,g=u.disable,p=u.pressAction,v=u.disablePress;if(h===e){if(!g&&!(r&&v)){var y=r&&p||f;typeof y=="function"?f(i,this.player,r):typeof y=="string"&&typeof this[y]=="function"&&this[y](i,this.player,r),this.emit(Cl,X({key:s[l],target:i.target,isPress:r},this.keyCodeMap[s[l]]))}pd(i),i.stopPropagation();break}}}},{key:"destroy",value:function(){this.player.root.removeEventListener("keydown",this.onKeydown),document.removeEventListener("keydown",this.onBodyKeyDown),this.player.root.removeEventListener("keyup",this.onKeyup),document.removeEventListener("keyup",this.onBodyKeyUp)}},{key:"disable",value:function(){this.config.disable=!0}},{key:"enable",value:function(){this.config.disable=!1}}],[{key:"pluginName",get:function(){return"keyboard"}},{key:"defaultConfig",get:function(){return{seekStep:10,checkVisible:!1,disableBodyTrigger:!1,disableRootTrigger:!1,isGlobalTrigger:!0,keyCodeMap:{},disable:!1,playbackRate:2,isIgnoreUserActive:!0}}}]),n})(Oe);function vd(){return new DOMParser().parseFromString(`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="-5 -5 110 110">
|
|
131
|
-
<path d="M100,50A50,50,0,1,1,50,0" stroke-width="5" stroke="#ddd" stroke-dasharray="236" fill="none"></path>
|
|
132
|
-
</svg>
|
|
133
|
-
`,"image/svg+xml").firstChild}var md=(function(a){D(n,a);var o=R(n);function n(){return x(this,n),o.apply(this,arguments)}return I(n,[{key:"registerIcons",value:function(){return{loadingIcon:vd}}},{key:"afterCreate",value:function(){this.appendChild("xg-loading-inner",this.icons.loadingIcon)}},{key:"render",value:function(){return`
|
|
134
|
-
<xg-loading class="xgplayer-loading">
|
|
135
|
-
<xg-loading-inner></xg-loading-inner>
|
|
136
|
-
</xg-loading>`}}],[{key:"pluginName",get:function(){return"loading"}},{key:"defaultConfig",get:function(){return{position:K.ROOT}}}]),n})(j),yd=(function(a){D(n,a);var o=R(n);function n(){var t;x(this,n);for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return t=o.call.apply(o,[this].concat(i)),C(_(t),"_onDurationChange",function(){t.updateSegments();var s=t.player,l=s.currentTime,u=s.timeSegments;if(t._checkIfEnabled(u)){var f=d.getIndexByTime(l,u),h=d.getOffsetCurrentTime(l,u,f);t.player.offsetCurrentTime=h,t.changeIndex(f,u)}}),C(_(t),"_onLoadedData",function(){var s=t.player.timeSegments;if(t._checkIfEnabled(s)){var l=d.getOffsetCurrentTime(0,s);t.player.offsetCurrentTime=l,t.changeIndex(0,s),t.curPos.start>0&&(t.player.currentTime=t.curPos.start)}}),C(_(t),"_onTimeupdate",function(){var s=t.player,l=s.currentTime,u=s.timeSegments;if(t._checkIfEnabled(u)){var f=u.length;t.lastCurrentTime=l;var h=d.getIndexByTime(l,u);h!==t.curIndex&&t.changeIndex(h,u);var g=d.getOffsetCurrentTime(l,u,h);if(t.player.offsetCurrentTime=g,!!t.curPos){var p=t.curPos,v=p.start,y=p.end;l<v?t.player.currentTime=v:l>y&&h>=f-1&&t.player.pause()}}}),C(_(t),"_onSeeking",function(){var s=t.player,l=s.currentTime,u=s.timeSegments;if(t._checkIfEnabled(u))if(l<u[0].start)t.player.currentTime=u[0].start;else if(l>u[u.length-1].end)t.player.currentTime=u[u.length-1].end;else{var f=d.getIndexByTime(l,u);if(f>=0){var h=t.getSeekTime(l,t.lastCurrentTime,f,u);h>=0&&(t.player.currentTime=h)}}}),C(_(t),"_onPlay",function(){var s=t.player,l=s.currentTime,u=s.timeSegments;t._checkIfEnabled(u)&&l>=u[u.length-1].end&&(t.player.currentTime=u[0].start)}),t}return I(n,[{key:"afterCreate",value:function(){this.curIndex=-1,this.curPos=null,this.lastCurrentTime=0,this.updateSegments(),this.on(Se,this._onDurationChange),this.on(Te,this._onLoadedData),this.on(se,this._onTimeupdate),this.on($t,this._onSeeking),this.on(le,this._onPlay)}},{key:"setConfig",value:function(e){var i=this;if(e){var r=Object.keys(e);r.length<1||(r.forEach(function(s){i.config[s]=e[s]}),this.updateSegments())}}},{key:"updateSegments",value:function(){var e=this.config,i=e.disable,r=e.segments,s=this.player;if(i||!r||r.length===0)s.timeSegments=[],s.offsetDuration=0,s.offsetCurrentTime=-1;else{var l=this.formatTimeSegments(r,s.duration);s.timeSegments=l,s.offsetDuration=l.length>0?l[l.length-1].duration:0}}},{key:"formatTimeSegments",value:function(e,i){var r=[];return e?(e.sort(function(s,l){return s.start-l.start}),e.forEach(function(s,l){var u={};if(u.start=s.start<0?0:s.start,u.end=i>0&&s.end>i?i:s.end,!(i>0&&u.start>i)){r.push(u);var f=u.end-u.start;if(l===0)u.offset=s.start,u.cTime=0,u.segDuration=f,u.duration=f;else{var h=r[l-1];u.offset=h.offset+(u.start-h.end),u.cTime=h.duration+h.cTime,u.segDuration=f,u.duration=h.duration+f}}}),r):[]}},{key:"getSeekTime",value:function(e,i,r,s){var l=-1,u=s[r],f=u.start,h=u.end;if(e>=f&&e<=h)return l;var g=e-i;if(g<0&&e<f){var p=i>f?i-f:0;return l=r-1>=0?s[r-1].end+g+p:0,l}return-1}},{key:"_checkIfEnabled",value:function(e){return!(!e||e.length<1)}},{key:"changeIndex",value:function(e,i){this.curIndex=e,e>=0&&i.length>0?this.curPos=i[e]:this.curPos=null}}],[{key:"pluginName",get:function(){return"TimeSegmentsControls"}},{key:"defaultConfig",get:function(){return{disable:!0,segments:[]}}}]),n})(Oe);function _d(){return new DOMParser().parseFromString(`<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="-4 -6 40 40" fill="none">
|
|
137
|
-
<g>
|
|
138
|
-
<path transform="scale(1.5 1.5)" d="M11.6665 9.16663H4.1665C2.78579 9.16663 1.6665 10.2859 1.6665 11.6666V15.8333C1.6665 17.214 2.78579 18.3333 4.1665 18.3333H11.6665C13.0472 18.3333 14.1665 17.214 14.1665 15.8333V11.6666C14.1665 10.2859 13.0472 9.16663 11.6665 9.16663Z" fill="white"/>
|
|
139
|
-
<path transform="scale(1.5 1.5)" fill-rule="evenodd" clip-rule="evenodd" d="M3.88148 4.06298C3.75371 4.21005 3.67667 4.40231 3.67749 4.61242C3.67847 4.87253 3.79852 5.10435 3.98581 5.25646L6.99111 8.05895C7.32771 8.37283 7.85502 8.35443 8.16891 8.01782C8.48279 7.68122 8.46437 7.15391 8.12778 6.84003L6.62061 5.43457L9.8198 5.4224C9.82848 5.42239 9.8372 5.42221 9.84591 5.4219C10.9714 5.38233 12.0885 5.6285 13.0931 6.13744C14.0976 6.64635 14.957 7.40148 15.5908 8.33234C16.2246 9.2632 16.6122 10.3394 16.7177 11.4606C16.823 12.5819 16.6427 13.7115 16.1934 14.7442C16.0098 15.1661 16.203 15.6571 16.6251 15.8408C17.0471 16.0243 17.5381 15.8311 17.7216 15.4091C18.2833 14.1183 18.5087 12.7063 18.3771 11.3047C18.2453 9.90318 17.7607 8.55792 16.9684 7.39433C16.1761 6.23073 15.1021 5.28683 13.8463 4.65065C12.5946 4.01651 11.203 3.70872 9.80072 3.75583L6.43415 3.76862L7.96326 2.12885C8.27715 1.79225 8.25872 1.26494 7.92213 0.951061C7.58553 0.63718 7.05822 0.655585 6.74433 0.99219L3.90268 4.0395C3.89545 4.04724 3.88841 4.05509 3.88154 4.06303L3.88148 4.06298Z" fill="white"/>
|
|
140
|
-
</g>
|
|
141
|
-
<defs>
|
|
142
|
-
<clipPath>
|
|
143
|
-
<rect width="40" height="40" fill="white"/>
|
|
144
|
-
</clipPath>
|
|
145
|
-
</defs>
|
|
146
|
-
</svg>
|
|
147
|
-
`,"image/svg+xml").firstChild}var Cd=(function(a){D(n,a);var o=R(n);function n(t){var e;return x(this,n),e=o.call(this,t),e.rotateDeg=e.config.rotateDeg||0,e}return I(n,[{key:"afterCreate",value:function(){var e=this;if(!this.config.disable){F(O(n.prototype),"afterCreate",this).call(this),this.appendChild(".xgplayer-icon",this.icons.rotate),this.onBtnClick=this.onBtnClick.bind(this),this.bind(".xgplayer-icon",["click","touchend"],this.onBtnClick),this.on(Re,function(){e.rotateDeg&&e.config.innerRotate&&d.setTimeout(e,function(){e.updateRotateDeg(e.rotateDeg,e.config.innerRotate)},100)});var i=this.player.root;this.rootWidth=i.style.width||i.offsetWidth||i.clientWidth,this.rootHeight=i.style.height||i.offsetHeight||i.clientHeight,this.rotateDeg&&this.updateRotateDeg(this.rotateDeg,this.config.innerRotate)}}},{key:"destroy",value:function(){F(O(n.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon",["click","touchend"],this.onBtnClick)}},{key:"onBtnClick",value:function(e){e.preventDefault(),e.stopPropagation(),this.emitUserAction(e,"rotate"),this.rotate(this.config.clockwise,this.config.innerRotate,1)}},{key:"updateRotateDeg",value:function(e,i){if(e||(e=0),i){this.player.videoRotateDeg=e;return}var r=this.player,s=this.rootWidth,l=this.rootHeight,u=r.root,f=r.innerContainer,h=r.media,g=u.offsetWidth,p=f&&i?f.offsetHeight:u.offsetHeight,v=s,y=l,m=0,b=0;(e===.75||e===.25)&&(v="".concat(p,"px"),y="".concat(g,"px"),m=-(p-g)/2,b=-(g-p)/2);var k="translate(".concat(m,"px,").concat(b,"px) rotate(").concat(e,"turn)"),w={transformOrigin:"center center",transform:k,webKitTransform:k,height:y,width:v},S=i?h:u,E=i?r.getPlugin("poster"):null;Object.keys(w).map(function(P){S.style[P]=w[P],E&&E.root&&(E.root.style[P]=w[P])})}},{key:"rotate",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,s=this.player;this.rotateDeg||(this.rotateDeg=0);var l=e?1:-1;this.rotateDeg=(this.rotateDeg+1+l*.25*r)%1,this.updateRotateDeg(this.rotateDeg,i),s.emit(yl,this.rotateDeg*360)}},{key:"registerIcons",value:function(){return{rotate:_d}}},{key:"render",value:function(){if(!this.config.disable)return`
|
|
148
|
-
<xg-icon class="xgplayer-rotate">
|
|
149
|
-
<div class="xgplayer-icon">
|
|
150
|
-
</div>
|
|
151
|
-
`.concat(Ne(this,"ROTATE_TIPS",this.playerConfig.isHideTips),`
|
|
152
|
-
</xg-icon>`)}}],[{key:"pluginName",get:function(){return"rotate"}},{key:"defaultConfig",get:function(){return{position:K.CONTROLS_RIGHT,index:6,innerRotate:!0,clockwise:!1,rotateDeg:0,disable:!1}}}]),n})(je);function kd(){return new DOMParser().parseFromString(`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
153
|
-
<path fill-rule="evenodd" clip-rule="evenodd"
|
|
154
|
-
d="M16.5 4.3H3.5C3.38954 4.3 3.3 4.38954 3.3 4.5V15.5C3.3 15.6105 3.38954 15.7 3.5 15.7H8.50005L8.50006 17.5H3.5C2.39543 17.5 1.5 16.6046 1.5 15.5V4.5C1.5 3.39543 2.39543 2.5 3.5 2.5H16.5C17.6046 2.5 18.5 3.39543 18.5 4.5V8.5H16.7V4.5C16.7 4.38954 16.6105 4.3 16.5 4.3ZM12 11.5C11.4477 11.5 11 11.9477 11 12.5L11 16.5C11 17.0523 11.4478 17.5 12 17.5H17.5C18.0523 17.5 18.5 17.0523 18.5 16.5L18.5 12.5C18.5 11.9477 18.0523 11.5 17.5 11.5H12Z"
|
|
155
|
-
fill="white" />
|
|
156
|
-
</svg>`,"image/svg+xml").firstChild}function bd(){return new DOMParser().parseFromString(`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
157
|
-
<path fill-rule="evenodd" clip-rule="evenodd"
|
|
158
|
-
d="M16.5 4.3H3.5C3.38954 4.3 3.3 4.38954 3.3 4.5V15.5C3.3 15.6105 3.38954 15.7 3.5 15.7H8.50005L8.50006 17.5H3.5C2.39543 17.5 1.5 16.6046 1.5 15.5V4.5C1.5 3.39543 2.39543 2.5 3.5 2.5H16.5C17.6046 2.5 18.5 3.39543 18.5 4.5V8.5H16.7V4.5C16.7 4.38954 16.6105 4.3 16.5 4.3ZM12 11.5C11.4477 11.5 11 11.9477 11 12.5L11 16.5C11 17.0523 11.4478 17.5 12 17.5H17.5C18.0523 17.5 18.5 17.0523 18.5 16.5L18.5 12.5C18.5 11.9477 18.0523 11.5 17.5 11.5H12Z"
|
|
159
|
-
fill="white" />
|
|
160
|
-
<path fill-rule="evenodd" clip-rule="evenodd"
|
|
161
|
-
d="M9.4998 7.7C9.77595 7.7 9.9998 7.47614 9.9998 7.2V6.5C9.9998 6.22386 9.77595 6 9.4998 6H5.5402L5.52754 6.00016H5.5C5.22386 6.00016 5 6.22401 5 6.50016V10.4598C5 10.7359 5.22386 10.9598 5.5 10.9598H6.2C6.47614 10.9598 6.7 10.7359 6.7 10.4598V8.83005L8.76983 10.9386C8.96327 11.1357 9.27984 11.1386 9.47691 10.9451L9.97645 10.4548C10.1735 10.2613 10.1764 9.94476 9.983 9.7477L7.97289 7.7H9.4998Z"
|
|
162
|
-
fill="white" />
|
|
163
|
-
</svg>`,"image/svg+xml").firstChild}var $e={PIP:"picture-in-picture",INLINE:"inline",FULLSCREEN:"fullscreen"},wd=(function(a){D(n,a);var o=R(n);function n(){var t;x(this,n);for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return t=o.call.apply(o,[this].concat(i)),C(_(t),"switchPIP",function(s){if(!t.isPIPAvailable())return!1;s.stopPropagation&&s.stopPropagation(),t.isPip?(t.exitPIP(),t.emitUserAction(s,"change_pip",{props:"pip",from:!0,to:!1}),t.setAttr("data-state","normal")):t.player.media.readyState===4&&(t.requestPIP(),t.emitUserAction(s,"change_pip",{props:"pip",from:!1,to:!0}),t.setAttr("data-state","pip"))}),t}return I(n,[{key:"beforeCreate",value:function(e){typeof e.player.config.pip=="boolean"&&(e.config.showIcon=e.player.config.pip)}},{key:"afterCreate",value:function(){var e=this;this.isPIPAvailable()&&(F(O(n.prototype),"afterCreate",this).call(this),this.pMode=$e.INLINE,this.initPipEvents(),this.config.showIcon&&this.initIcons(),this.once(Yt,function(){e.config.showIcon&&(d.removeClass(e.find(".xgplayer-icon"),"xg-icon-disable"),e.bind("click",e.switchPIP))}))}},{key:"registerIcons",value:function(){return{pipIcon:{icon:kd,class:"xg-get-pip"},pipIconExit:{icon:bd,class:"xg-exit-pip"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.pipIcon),this.appendChild(".xgplayer-icon",e.pipIconExit)}},{key:"initPipEvents",value:function(){var e=this,i=this.player;this.leavePIPCallback=function(){var r=i.paused;d.setTimeout(e,function(){!r&&i.mediaPlay()},0),!r&&i.mediaPlay(),e.setAttr("data-state","normal"),e.pipWindow=null,i.emit(Cr,!1)},this.enterPIPCallback=function(r){i.emit(Cr,!0),r!=null&&r.pictureInPictureWindow&&(e.pipWindow=r.pictureInPictureWindow),e.setAttr("data-state","pip")},this.onWebkitpresentationmodechanged=function(r){var s=i.media.webkitPresentationMode;e.pMode===$e.FULLSCREEN&&s!==$e.FULLSCREEN&&i.onFullscreenChange(null,!1),e.pMode=s,s===$e.PIP?e.enterPIPCallback(r):s===$e.INLINE&&e.leavePIPCallback(r)},i.media&&(i.media.addEventListener("enterpictureinpicture",this.enterPIPCallback),i.media.addEventListener("leavepictureinpicture",this.leavePIPCallback),n.checkWebkitSetPresentationMode(i.media)&&i.media.addEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged))}},{key:"copyStyleIntoPiPWindow",value:function(e){var i=de(document.styleSheets).map(function(s){try{return de(s.cssRules).map(function(u){return u.cssText}).join("")}catch{var l=document.createElement("link");l.rel="stylesheet",l.type=s.type,l.media=s.media,l.href=s.href,e.document.head.appendChild(l)}return""}).filter(Boolean).join(`
|
|
164
|
-
`),r=document.createElement("style");r.textContent=i,e.document.head.appendChild(r)}},{key:"requestPIP",value:function(){var e=this,i=this.player,r=this.playerConfig,s=this.config;if(!(!this.isPIPAvailable()||this.isPip))try{var l=r.poster;if(l&&(i.media.poster=d.typeOf(l)==="String"?l:l.poster),s.preferDocument&&this.isDocPIPAvailable()){var u={};if(s.width&&s.height)u.width=s.width,u.height=s.height;else{var f=i.root.getBoundingClientRect();u.width=f.width,u.height=f.height}documentPictureInPicture.requestWindow(u).then(function(h){var g=s.docPiPNode,p=s.docPiPStyle;e.enterPIPCallback();var v=g||i.root,y=v.parentElement,m=v.previousSibling,b=v.nextSibling;e.copyStyleIntoPiPWindow(h);var k=document.createElement("style");if(k.append("body{padding:0; margin:0;}"),p){var w="";typeof p=="string"?w=p:typeof p=="function"&&(w=p.call(s)),w&&k.append(w)}else v===i.root&&k.append(`
|
|
165
|
-
.xgplayer{width: 100%!important; height: 100%!important;}
|
|
166
|
-
`);h.document.head.append(k),h.document.body.append(v),h.addEventListener("pagehide",function(S){y&&(b?y.insertBefore(v,b):m?y.insertBefore(v,m.nextSibling):y.appendChild(v)),e.leavePIPCallback()},{once:!0})})}else n.checkWebkitSetPresentationMode(i.media)?i.media.webkitSetPresentationMode("picture-in-picture"):i.media.requestPictureInPicture();return!0}catch(h){return console.error("requestPiP",h),!1}}},{key:"exitPIP",value:function(){var e=this.player;try{if(this.isPIPAvailable()&&this.isPip){var i;this.isDocPIPAvailable()&&(i=documentPictureInPicture)!==null&&i!==void 0&&i.window?documentPictureInPicture.window.close():n.checkWebkitSetPresentationMode(e.media)?e.media.webkitSetPresentationMode("inline"):document.exitPictureInPicture()}return!0}catch(r){return console.error("exitPIP",r),!1}}},{key:"isPip",get:function(){var e,i=this.player;return!!(this.isDocPIPAvailable()&&(e=documentPictureInPicture)!==null&&e!==void 0&&e.window)||document.pictureInPictureElement&&document.pictureInPictureElement===i.media||i.media.webkitPresentationMode===$e.PIP}},{key:"isPIPAvailable",value:function(){var e=this.player.media,i=d.typeOf(document.pictureInPictureEnabled)==="Boolean"?document.pictureInPictureEnabled:!1;return i&&(d.typeOf(e.disablePictureInPicture)==="Boolean"&&!e.disablePictureInPicture||e.webkitSupportsPresentationMode&&d.typeOf(e.webkitSetPresentationMode)==="Function")||this.isDocPIPAvailable()}},{key:"isDocPIPAvailable",value:function(){return"documentPictureInPicture"in window&&/^(https|file)/.test(location.protocol)}},{key:"destroy",value:function(){F(O(n.prototype),"destroy",this).call(this);var e=this.player;e.media.removeEventListener("enterpictureinpicture",this.enterPIPCallback),e.media.removeEventListener("leavepictureinpicture",this.leavePIPCallback),n.checkWebkitSetPresentationMode(e.media)&&e.media.removeEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged),this.exitPIP(),this.unbind("click",this.btnClick)}},{key:"render",value:function(){if(!(!this.config.showIcon||!this.isPIPAvailable()))return`<xg-icon class="xgplayer-pip">
|
|
167
|
-
<div class="xgplayer-icon xg-icon-disable">
|
|
168
|
-
</div>
|
|
169
|
-
`.concat(Ne(this,"PIP",this.playerConfig.isHideTips),`
|
|
170
|
-
</xg-icon>`)}}],[{key:"pluginName",get:function(){return"pip"}},{key:"defaultConfig",get:function(){return{position:K.CONTROLS_RIGHT,index:6,showIcon:!1,preferDocument:!1,width:void 0,height:void 0,docPiPNode:void 0,docPiPStyle:void 0}}},{key:"checkWebkitSetPresentationMode",value:function(e){return typeof e.webkitSetPresentationMode=="function"}}]),n})(je);function Td(){return new DOMParser().parseFromString(`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="40" viewBox="10 0 24 40">
|
|
171
|
-
<path transform="scale(0.038 0.028)" d="M800 380v768h-128v-352l-320 320v-704l320 320v-352z"></path>
|
|
172
|
-
</svg>
|
|
173
|
-
`,"image/svg+xml").firstChild}var Ed=(function(a){D(n,a);var o=R(n);function n(t){var e;return x(this,n),e=o.call(this,t),C(_(e),"playNext",function(i){var r=_(e),s=r.player;i.preventDefault(),i.stopPropagation(),e.idx+1<e.config.urlList.length?(e.idx++,e.nextHandler(e.config.urlList[e.idx],e.idx),s.emit(Nt,e.idx+1)):(e.nextHandler(),s.emit(Nt))}),e.idx=-1,e}return I(n,[{key:"afterCreate",value:function(){!this.config.urlList||this.config.urlList.length===0||(this.appendChild(".xgplayer-icon",this.icons.playNext),this.initEvents())}},{key:"registerIcons",value:function(){return{playNext:Td}}},{key:"initEvents",value:function(){this.nextHandler=this.hook("nextClick",this.changeSrc);var e=B.device==="mobile"?"touchend":"click";this.bind(e,this.playNext),this.show()}},{key:"changeSrc",value:function(e){var i=this.player;e&&(i.pause(),i.currentTime=0,i.switchURL?i.switchURL(e):i.src=e,i.config.url=e,i.play())}},{key:"destroy",value:function(){this.unbind(["touchend","click"],this.playNext)}},{key:"render",value:function(){if(!(!this.config.urlList||this.config.urlList.length===0))return`
|
|
174
|
-
<xg-icon class="xgplayer-playnext">
|
|
175
|
-
<div class="xgplayer-icon">
|
|
176
|
-
</div>
|
|
177
|
-
`.concat(Ne(this,"PLAYNEXT_TIPS",this.playerConfig.isHideTips),`
|
|
178
|
-
</xg-icon>
|
|
179
|
-
`)}}],[{key:"pluginName",get:function(){return"playNext"}},{key:"defaultConfig",get:function(){return{position:K.CONTROLS_LEFT,index:1,url:null,urlList:[]}}}]),n})(j),At={exports:{}},Sd=At.exports,Fs;function xd(){return Fs||(Fs=1,(function(a,o){(function(n,t){a.exports=t()})(Sd,function(){return function n(t,e,i){var r=window,s="application/octet-stream",l=i||s,u=t,f=!e&&!i&&u,h=document.createElement("a"),g=function(A){return String(A)},p=r.Blob||r.MozBlob||r.WebKitBlob||g,v=e||"download",y,m;if(p=p.call?p.bind(r):Blob,String(this)==="true"&&(u=[u,l],l=u[0],u=u[1]),f&&f.length<2048&&(v=f.split("/").pop().split("?")[0],h.href=f,h.href.indexOf(f)!==-1)){var b=new XMLHttpRequest;return b.open("GET",f,!0),b.responseType="blob",b.onload=function(A){n(A.target.response,v,s)},setTimeout(function(){b.send()},0),b}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(u))if(u.length>1024*1024*1.999&&p!==g)u=E(u),l=u.type||s;else return navigator.msSaveBlob?navigator.msSaveBlob(E(u),v):P(u);else if(/([\x80-\xff])/.test(u)){var k=0,w=new Uint8Array(u.length),S=w.length;for(k;k<S;++k)w[k]=u.charCodeAt(k);u=new p([w],{type:l})}y=u instanceof p?u:new p([u],{type:l});function E(A){var q=A.split(/[:;,]/),H=q[1],N=q[2]=="base64"?atob:decodeURIComponent,L=N(q.pop()),Y=L.length,Z=0,ue=new Uint8Array(Y);for(Z;Z<Y;++Z)ue[Z]=L.charCodeAt(Z);return new p([ue],{type:H})}function P(A,q){if("download"in h)return h.href=A,h.setAttribute("download",v),h.className="download-js-link",h.innerHTML="downloading...",h.style.display="none",document.body.appendChild(h),setTimeout(function(){h.click(),document.body.removeChild(h),q===!0&&setTimeout(function(){r.URL.revokeObjectURL(h.href)},250)},66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(A)&&(A="data:"+A.replace(/^data:([\w\/\-\+]+)/,s)),window.open(A)||confirm(`Displaying New Document
|
|
180
|
-
|
|
181
|
-
Use Save As... to download, then click back to return to this page.`)&&(location.href=A),!0;var H=document.createElement("iframe");document.body.appendChild(H),!q&&/^data:/.test(A)&&(A="data:"+A.replace(/^data:([\w\/\-\+]+)/,s)),H.src=A,setTimeout(function(){document.body.removeChild(H)},333)}if(navigator.msSaveBlob)return navigator.msSaveBlob(y,v);if(r.URL)P(r.URL.createObjectURL(y),!0);else{if(typeof y=="string"||y.constructor===g)try{return P("data:"+l+";base64,"+r.btoa(y))}catch{return P("data:"+l+","+encodeURIComponent(y))}m=new FileReader,m.onload=function(A){P(this.result)},m.readAsDataURL(y)}return!0}})})(At)),At.exports}var Id=xd();const Pd=br(Id);function Ad(){return new DOMParser().parseFromString(`<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24">
|
|
182
|
-
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
183
|
-
<g transform="translate(-488.000000, -340.000000)" fill="#FFFFFF">
|
|
184
|
-
<g id="Group-2">
|
|
185
|
-
<g id="volme_big-copy" transform="translate(488.000000, 340.000000)">
|
|
186
|
-
<rect id="Rectangle-18" x="11" y="4" width="2" height="12" rx="1"></rect>
|
|
187
|
-
<rect id="Rectangle-2" x="3" y="18" width="18" height="2" rx="1"></rect>
|
|
188
|
-
<rect id="Rectangle-2" transform="translate(4.000000, 17.500000) rotate(90.000000) translate(-4.000000, -17.500000) " x="1.5" y="16.5" width="5" height="2" rx="1"></rect><rect id="Rectangle-2-Copy-3" transform="translate(20.000000, 17.500000) rotate(90.000000) translate(-20.000000, -17.500000) " x="17.5" y="16.5" width="5" height="2" rx="1"></rect>
|
|
189
|
-
<path d="M9.48791171,8.26502656 L9.48791171,14.2650266 C9.48791171,14.8173113 9.04019646,15.2650266 8.48791171,15.2650266 C7.93562696,15.2650266 7.48791171,14.8173113 7.48791171,14.2650266 L7.48791171,7.26502656 C7.48791171,6.71274181 7.93562696,6.26502656 8.48791171,6.26502656 L15.4879117,6.26502656 C16.0401965,6.26502656 16.4879117,6.71274181 16.4879117,7.26502656 C16.4879117,7.81731131 16.0401965,8.26502656 15.4879117,8.26502656 L9.48791171,8.26502656 Z" id="Combined-Shape" transform="translate(11.987912, 10.765027) scale(1, -1) rotate(45.000000) translate(-11.987912, -10.765027) "></path>
|
|
190
|
-
</g>
|
|
191
|
-
</g>
|
|
192
|
-
</g>
|
|
193
|
-
</g>
|
|
194
|
-
</svg>
|
|
195
|
-
`,"image/svg+xml").firstChild}var Ld=(function(a){D(n,a);var o=R(n);function n(t){var e;return x(this,n),e=o.call(this,t),C(_(e),"download",function(i){if(!e.isLock){e.emitUserAction(i,"download");var r=e.playerConfig.url,s="";d.typeOf(r)==="String"?s=r:d.typeOf(r)==="Array"&&r.length>0&&(s=r[0].src);var l=e.getAbsoluteURL(s);Pd(l),e.isLock=!0,e.timer=window.setTimeout(function(){e.isLock=!1,window.clearTimeout(e.timer),e.timer=null},300)}}),e.timer=null,e.isLock=!1,e}return I(n,[{key:"afterCreate",value:function(){F(O(n.prototype),"afterCreate",this).call(this),!this.config.disable&&(this.appendChild(".xgplayer-icon",this.icons.download),this._handler=this.hook("click",this.download,{pre:function(i){i.preventDefault(),i.stopPropagation()}}),this.bind(["click","touchend"],this._handler))}},{key:"registerIcons",value:function(){return{download:Ad}}},{key:"getAbsoluteURL",value:function(e){if(!e.match(/^https?:\/\//)){var i=document.createElement("div");i.innerHTML='<a href="'.concat(e,'">x</a>'),e=i.firstChild.href}return e}},{key:"destroy",value:function(){F(O(n.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.download),window.clearTimeout(this.timer),this.timer=null}},{key:"render",value:function(){if(!this.config.disable)return`<xg-icon class="xgplayer-download">
|
|
196
|
-
<div class="xgplayer-icon">
|
|
197
|
-
</div>
|
|
198
|
-
`.concat(Ne(this,"DOWNLOAD_TIPS",this.playerConfig.isHideTips),`
|
|
199
|
-
</xg-icon>`)}}],[{key:"pluginName",get:function(){return"download"}},{key:"defaultConfig",get:function(){return{position:K.CONTROLS_RIGHT,index:3,disable:!0}}}]),n})(je),Dd=(function(a){D(n,a);var o=R(n);function n(){return x(this,n),o.apply(this,arguments)}return I(n,[{key:"beforeCreate",value:function(e){typeof e.player.config.screenShot=="boolean"&&(e.config.disable=!e.player.config.screenShot)}},{key:"afterCreate",value:function(){F(O(n.prototype),"afterCreate",this).call(this),this.appendChild(".xgplayer-icon",this.icons.screenshotIcon);var e=this.config;this.initSize=function(i){e.fitVideo&&(e.width=i.vWidth,e.height=i.vHeight)},this.once(Re,this.initSize)}},{key:"onPluginsReady",value:function(){this.show(),this.onClickBtn=this.onClickBtn.bind(this),this.bind(["click","touchend"],this.onClickBtn)}},{key:"saveScreenShot",value:function(e,i){var r=document.createElement("a");r.href=e,r.download=i;var s;try{typeof MouseEvent<"u"?s=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}):(s=document.createEvent("MouseEvents"),s.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null))}catch(l){console.error("MouseEvent unsupported",l)}s&&r.dispatchEvent(s)}},{key:"createCanvas",value:function(e,i){var r=document.createElement("canvas"),s=r.getContext("2d");this.canvasCtx=s,this.canvas=r,r.width=e||this.config.width,r.height=i||this.config.height,s.imageSmoothingEnabled=!0,s.imageSmoothingEnabled&&(s.imageSmoothingQuality="high")}},{key:"onClickBtn",value:function(e){var i=this;e.preventDefault(),e.stopPropagation(),this.emitUserAction(e,"shot");var r=this.config;this.shot(r.width,r.height).then(function(s){i.emit(_l,s),r.saveImg&&i.saveScreenShot(s,r.name+r.format)})}},{key:"shot",value:function(e,i){var r=this,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{quality:.92,type:"image/png"},l=this.config,u=this.player,f=s.quality||l.quality,h=s.type||l.type;return new Promise(function(g,p){var v=null,y;if(u.media.canvas)v=u.media.canvas;else{r.canvas?(r.canvas.width=e||l.width,r.canvas.height=i||l.height):r.createCanvas(e,i),v=r.canvas,y=r.canvasCtx;var m=u.media.videoWidth/u.media.videoHeight,b=v.width/v.height,k=0,w=0,S=u.media.videoWidth,E=u.media.videoHeight,P,A,q,H;m>b?(q=v.width,H=v.width/m,P=0,A=Math.round((v.height-H)/2)):m===b?(q=v.width,H=v.height,P=0,A=0):m<b&&(q=v.height*m,H=v.height,P=Math.round((v.width-q)/2),A=0),y.drawImage(u.media,k,w,S,E,P,A,q,H)}var N=v.toDataURL(h,f).replace(h,"image/octet-stream");N=N.replace(/^data:image\/[^;]+/,"data:application/octet-stream"),g(N)})}},{key:"registerIcons",value:function(){return{screenshotIcon:null}}},{key:"destroy",value:function(){F(O(n.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.onClickBtn),this.off(Re,this.initSize)}},{key:"render",value:function(){if(!this.config.disable){var e=this.icons.screenshotIcon?"xgplayer-icon":"xgplayer-icon btn-text",i="SCREENSHOT";return`
|
|
200
|
-
<xg-icon class="xgplayer-shot">
|
|
201
|
-
<div class="`.concat(e,`">
|
|
202
|
-
`).concat(this.icons.screenshotIcon?"":'<span lang-key="'.concat(this.i18nKeys[i],'">').concat(this.i18n[i],"</span>"),`
|
|
203
|
-
</div>
|
|
204
|
-
</xg-icon>`)}}}],[{key:"pluginName",get:function(){return"screenShot"}},{key:"defaultConfig",get:function(){return{position:K.CONTROLS_RIGHT,index:5,quality:.92,type:"image/png",format:".png",width:600,height:337,saveImg:!0,fitVideo:!0,disable:!1,name:"screenshot"}}}]),n})(je),Rd=(function(){function a(o){x(this,a),this.config=o.config,this.parent=o.root,this.root=d.createDom("ul","",{},"xg-options-list xg-list-slide-scroll ".concat(this.config.className)),o.root.appendChild(this.root);var n=this.config.maxHeight;n&&this.setStyle({maxHeight:n}),this.onItemClick=this.onItemClick.bind(this),this.renderItemList();var t=this.config.domEventType==="touch"?"touchend":"click";this._delegates=j.delegate.call(this,this.root,"li",t,this.onItemClick)}return I(a,[{key:"renderItemList",value:function(n){var t=this,e=this.config,i=this.root;n?e.data=n:n=e.data,e.style&&Object.keys(e.style).map(function(r){i.style[r]=e[r]}),n.length>0&&(this.attrKeys=Object.keys(n[0])),this.root.innerHTML="",n.map(function(r,s){var l=r.selected?"option-item selected":"option-item";r["data-index"]=s,t.root.appendChild(d.createDom("li","<span>".concat(r.showText,"</span>"),r,l))})}},{key:"onItemClick",value:function(n){n.delegateTarget||(n.delegateTarget=n.target);var t=n.delegateTarget;if(t&&d.hasClass(t,"selected"))return!1;var e=typeof this.config.onItemClick=="function"?this.config.onItemClick:null,i=this.root.querySelector(".selected");d.addClass(t,"selected"),i&&d.removeClass(i,"selected"),e(n,{from:i?this.getAttrObj(i,this.attrKeys):null,to:this.getAttrObj(t,this.attrKeys)})}},{key:"getAttrObj",value:function(n,t){if(!n||!t)return{};var e={};t.map(function(r){e[r]=n.getAttribute(r)});var i=n.getAttribute("data-index");return i&&(e.index=Number(i)),e}},{key:"show",value:function(){d.removeClass(this.root,"hide"),d.addClass(this.root,"active")}},{key:"hide",value:function(){d.removeClass(this.root,"active"),d.addClass(this.root,"hide")}},{key:"setStyle",value:function(n){var t=this;Object.keys(n).forEach(function(e){t.root.style[e]=n[e]})}},{key:"destroy",value:function(){this._delegates&&(this._delegates.map(function(n){n.destroy&&n.destroy()}),this._delegates=null),this.root.innerHTML=null,this.parent.removeChild(this.root),this.root=null}}]),a})(),pe={SIDE:"side",MIDDLE:"middle",DEFAULT:"default"},Ye={CLICK:"click",HOVER:"hover"};function Od(a,o){return a===pe.SIDE?o===K.CONTROLS_LEFT?"xg-side-list xg-left-side":"xg-side-list xg-right-side":""}var Be=B.device==="mobile",Vt=(function(a){D(n,a);var o=R(n);function n(t){var e;return x(this,n),e=o.call(this,t),C(_(e),"onEnter",function(i){i.stopPropagation(),e.emit("icon_mouseenter",{pluginName:e.pluginName}),e.switchActiveState(i)}),C(_(e),"switchActiveState",function(i){i.stopPropagation();var r=e.config.toggleMode;r===Ye.CLICK?e.toggle(!e.isActive):e.toggle(!0)}),C(_(e),"onLeave",function(i){i.stopPropagation(),e.emit("icon_mouseleave",{pluginName:e.pluginName}),e.config.listType!==pe.SIDE&&e.isActive&&e.toggle(!1)}),C(_(e),"onListEnter",function(i){e.enterType=2}),C(_(e),"onListLeave",function(i){e.enterType=0,e.isActive&&e.toggle(!1)}),e.isIcons=!1,e.isActive=!1,e.curValue=null,e.curIndex=0,e}return I(n,[{key:"updateLang",value:function(e){this.renderItemList(this.config.list,this.curIndex)}},{key:"afterCreate",value:function(){var e=this,i=this.config;this.initIcons(),Be=Be||this.domEventType==="touch",Be&&B.device==="mobile"&&i.listType===pe.DEFAULT&&(i.listType=pe.SIDE),i.hidePortrait&&d.addClass(this.root,"portrait"),this.on([Re,ke],function(){e._resizeList()}),this.once(be,function(){i.list&&i.list.length>0&&(e.renderItemList(i.list),e.show())}),Be&&this.on(Br,function(){e.isActive&&(e.optionsList&&e.optionsList.hide(),e.isActive=!1)}),Be?(i.toggleMode=Ye.CLICK,this.activeEvent="touchend"):this.activeEvent=i.toggleMode===Ye.CLICK?"click":"mouseenter",i.toggleMode===Ye.CLICK?this.bind(this.activeEvent,this.switchActiveState):(this.bind(this.activeEvent,this.onEnter),this.bind("mouseleave",this.onLeave)),this.isIcons&&this.bind("click",this.onIconClick)}},{key:"initIcons",value:function(){var e=this,i=this.icons,r=Object.keys(i),s=!1;r.length>0&&(r.forEach(function(l){e.appendChild(".xgplayer-icon",i[l]),!s&&(s=i[l])}),this.isIcons=s),!s&&(this.appendChild(".xgplayer-icon",d.createDom("span","",{},"icon-text")),d.addClass(this.find(".xgplayer-icon"),"btn-text"))}},{key:"show",value:function(e){!this.config.list||this.config.list.length<2||d.addClass(this.root,"show")}},{key:"hide",value:function(){d.removeClass(this.root,"show")}},{key:"getTextByLang",value:function(e,i,r){if(e===void 0)return"";var s=this.config.list;!r&&(r=this.player.lang),i=!i||d.isUndefined(e[i])?"text":i,typeof e=="number"&&(e=s[e]);try{return ie(e[i])==="object"?e[i][r]||e[i].en:e[i]}catch(l){return console.warn(l),""}}},{key:"toggle",value:function(e){if(!(e===this.isActive||this.config.disable)){var i=this.player.controls,r=this.config.listType;e?(r===pe.SIDE?i.blur():i.focus(),this.optionsList&&this.optionsList.show()):(r===pe.SIDE?i.focus():i.focusAwhile(),this.optionsList&&this.optionsList.hide()),this.isActive=e}}},{key:"onItemClick",value:function(e,i){e.stopPropagation();var r=this.config,s=r.listType,l=r.list;this.curIndex=i.to.index,this.curItem=l[this.curIndex],this.changeCurrentText();var u=this.config.isItemClickHide;(u||Be||s===pe.SIDE)&&this.toggle(!1)}},{key:"onIconClick",value:function(e){}},{key:"changeCurrentText",value:function(){if(!this.isIcons){var e=this.config.list,i=this.curIndex<e.length?this.curIndex:0,r=e[i];r&&(this.find(".icon-text").innerHTML=this.getTextByLang(r,"iconText"))}}},{key:"renderItemList",value:function(e,i){var r=this,s=this.config,l=this.optionsList,u=this.player;if(typeof i=="number"&&(this.curIndex=i,this.curItem=s.list[i]),l){l.renderItemList(e),this.changeCurrentText();return}var f={config:{data:e||[],className:Od(s.listType,s.position),onItemClick:function(y,m){r.onItemClick(y,m)},domEventType:Be?"touch":"mouse"},root:s.listType===pe.SIDE?u.innerContainer||u.root:this.root};if(this.config.isShowIcon){var h=this.player.root.getBoundingClientRect(),g=h.height,p=s.listType===pe.MIDDLE?g-50:g;p&&s.heightLimit&&(f.config.maxHeight="".concat(p,"px")),this.optionsList=new Rd(f),this.changeCurrentText(),this.show()}this._resizeList()}},{key:"_resizeList",value:function(){if(this.config.heightLimit){var e=this.player.root.getBoundingClientRect(),i=e.height,r=this.config.listType===pe.MIDDLE?i-50:i;this.optionsList&&this.optionsList.setStyle({maxHeight:"".concat(r,"px")})}}},{key:"destroy",value:function(){var e=this.config;e.toggleMode===Ye.CLICK?this.unbind(this.activeEvent,this.switchActiveState):(this.unbind(this.activeEvent,this.onEnter),this.unbind("mouseleave",this.onLeave)),this.isIcons&&this.unbind("click",this.onIconClick),this.optionsList&&(this.optionsList.destroy(),this.optionsList=null)}},{key:"render",value:function(){if(this.config.isShowIcon)return'<xg-icon class="xg-options-icon '.concat(this.config.className||"",`">
|
|
205
|
-
<div class="xgplayer-icon">
|
|
206
|
-
</div>
|
|
207
|
-
</xg-icon>`)}}],[{key:"pluginName",get:function(){return"optionsIcon"}},{key:"defaultConfig",get:function(){return{position:K.CONTROLS_RIGHT,index:100,list:[],listType:"default",listStyle:{},hidePortrait:!0,isShowIcon:!1,isItemClickHide:!0,toggleMode:Ye.HOVER,heightLimit:!0}}}]),n})(j),Nd=(function(a){D(n,a);var o=R(n);function n(t){var e;return x(this,n),e=o.call(this,t),e.curTime=0,e.isPaused=!0,e}return I(n,[{key:"beforeCreate",value:function(e){var i=e.config.list;Array.isArray(i)&&i.length>0&&(e.config.list=i.map(function(r){return!r.text&&r.name&&(r.text=r.name),r.text||(r.text=r.definition),r}))}},{key:"afterCreate",value:function(){var e=this;F(O(n.prototype),"afterCreate",this).call(this),this.on("resourceReady",function(i){e.changeDefinitionList(i)}),this.on(zr,function(i){e.renderItemList(e.config.list,i.to)}),this.player.definitionList.length<2&&this.hide()}},{key:"show",value:function(e){!this.config.list||this.config.list.length<2||d.addClass(this.root,"show")}},{key:"initDefinition",value:function(){var e=this.config,i=e.list,r=e.defaultDefinition;if(i.length>0){var s=null;i.map(function(l){l.definition===r&&(s=l)}),s||(s=i[0]),this.changeDefinition(s)}}},{key:"renderItemList",value:function(){var e=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.config.list||[],r=arguments.length>1?arguments[1]:void 0,s=r&&r.definition?r.definition:this.config.defaultDefinition;r&&i.forEach(function(f){f.selected=!1});var l=0,u=i.map(function(f,h){var g=X(X({},f),{},{showText:e.getTextByLang(f)||f.definition,selected:!1});return(f.selected||f.definition&&f.definition==s)&&(g.selected=!0,l=h),g});F(O(n.prototype),"renderItemList",this).call(this,u,l)}},{key:"changeDefinitionList",value:function(e){Array.isArray(e)&&(this.config.list=e.map(function(i){return!i.text&&i.name&&(i.text=i.name),i.text||(i.text=i.definition),i}),this.renderItemList(),this.config.list.length<2?this.hide():this.show())}},{key:"changeDefinition",value:function(e,i){this.player.changeDefinition(e,i)}},{key:"onItemClick",value:function(e,i){var r=this.player.definitionList;F(O(n.prototype),"onItemClick",this).apply(this,arguments),this.emitUserAction(e,"change_definition",{from:i.from,to:i.to});for(var s=0;s<r.length;s++)i.to&&r[s].definition===i.to.definition&&(i.to.url=r[s].url),i.from&&r[s].definition===i.from.definition&&(i.from.url=r[s].url);this.player.changeDefinition(i.to,i.from)}}],[{key:"pluginName",get:function(){return"definition"}},{key:"defaultConfig",get:function(){return X(X({},Vt.defaultConfig),{},{position:K.CONTROLS_RIGHT,index:3,list:[],defaultDefinition:"",disable:!1,hidePortrait:!1,className:"xgplayer-definition",isShowIcon:!0})}}]),n})(Vt),Md=(function(a){D(n,a);var o=R(n);function n(t){var e;return x(this,n),e=o.call(this,t),e.curRate=1,e}return I(n,[{key:"beforeCreate",value:function(e){var i=e.player.config.playbackRate,r=i?Array.isArray(i)?i:e.config.list:[];Array.isArray(r)&&(e.config.list=r.map(function(s){return typeof s=="number"?s={rate:s,text:"".concat(s,"x")}:!s.text&&s.rate&&(s.text="".concat(s.rate,"x")),s}))}},{key:"afterCreate",value:function(){var e=this;F(O(n.prototype),"afterCreate",this).call(this),this.on(fl,function(){e.curValue!==e.player.playbackRate&&e.renderItemList()}),this.renderItemList()}},{key:"show",value:function(e){!this.config.list||this.config.list.length===0||F(O(n.prototype),"show",this).call(this)}},{key:"onItemClick",value:function(e,i){F(O(n.prototype),"onItemClick",this).call(this,e,i);var r=e.delegateTarget,s=Number(r.getAttribute("rate"));if(!s||s===this.curValue)return!1;var l={playbackRate:{from:this.player.playbackRate,to:s}};this.emitUserAction(e,"change_rate",{props:l}),this.curValue=s,this.player.playbackRate=s}},{key:"renderItemList",value:function(){var e=this,i=this.player.playbackRate||1;this.curValue=i;var r=-1,s=this.config.list.map(function(l,u){var f={rate:l.rate};return f.rate===i&&(f.selected=!0,r=u),f.showText=e.getTextByLang(l),f});F(O(n.prototype),"renderItemList",this).call(this,s,r)}},{key:"changeCurrentText",value:function(){if(!this.isIcons){var e=this.config.list,i=this.curIndex<e.length?this.curIndex:0,r=e[i],s="";!r||this.curIndex<0?s="".concat(this.player.playbackRate,"x"):s=this.getTextByLang(r,"iconText"),this.find(".icon-text").innerHTML=s}}},{key:"destroy",value:function(){F(O(n.prototype),"destroy",this).call(this)}}],[{key:"pluginName",get:function(){return"playbackRate"}},{key:"defaultConfig",get:function(){return X(X({},Vt.defaultConfig),{},{position:K.CONTROLS_RIGHT,index:4,list:[2,1.5,1,.75,.5],className:"xgplayer-playbackrate",isShowIcon:!0,hidePortrait:!1})}}]),n})(Vt),Fd=(function(a){D(n,a);var o=R(n);function n(){return x(this,n),o.apply(this,arguments)}return I(n,[{key:"afterCreate",value:function(){var e=this;this.clickHandler=this.hook("errorRetry",this.errorRetry,{pre:function(r){r.preventDefault(),r.stopPropagation()}}),this.onError=this.hook("showError",this.handleError),this.bind(".xgplayer-error-refresh","click",this.clickHandler),this.on(dt,function(i){e.onError(i)})}},{key:"errorRetry",value:function(e){this.emitUserAction(e,"error_retry",{}),this.player.retry()}},{key:"handleError",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=this.player,r=e.errorType,s=i.errorNote?this.i18n[i.errorNote]:"";if(!s)switch(r){case"decoder":s=this.i18n.MEDIA_ERR_DECODE;break;case"network":s=this.i18n.MEDIA_ERR_NETWORK;break;default:s=this.i18n.MEDIA_ERR_SRC_NOT_SUPPORTED}this.find(".xgplayer-error-text").innerHTML=s,this.find(".xgplayer-error-tips").innerHTML="".concat(this.i18n.REFRESH_TIPS,'<span class="xgplayer-error-refresh">').concat(this.i18n.REFRESH,"</span>")}},{key:"destroy",value:function(){this.unbind(".xgplayer-error-refresh","click",this.clickHandler)}},{key:"render",value:function(){return`<xg-error class="xgplayer-error">
|
|
208
|
-
<div class="xgplayer-errornote">
|
|
209
|
-
<span class="xgplayer-error-text"></span>
|
|
210
|
-
<span class="xgplayer-error-tips"><em class="xgplayer-error-refresh"></em></span>
|
|
211
|
-
</div>
|
|
212
|
-
</xg-error>`}}],[{key:"pluginName",get:function(){return"error"}}]),n})(j),Bd=(function(a){D(n,a);var o=R(n);function n(){return x(this,n),o.apply(this,arguments)}return I(n,[{key:"afterCreate",value:function(){var e=this;this.intervalId=0,this.customConfig=null,this.bind(".highlight",["click","touchend"],function(i){(e.config.onClick||e.customOnClick)&&(i.preventDefault(),i.stopPropagation(),e.customOnClick?e.customOnClick(i):e.config.onClick(i))}),this.player.showPrompt=function(){e.showPrompt.apply(e,arguments)},this.player.hidePrompt=function(){e.hide()}}},{key:"setStyle",value:function(e){var i=this;Object.keys(e).map(function(r){i.root.style[r]=e[r]})}},{key:"showPrompt",value:function(e){var i=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){};if(e){this.customOnClick=s;var l=this.config.interval;this.intervalId&&(clearTimeout(this.intervalId),this.intervalId=null),d.addClass(this.root,"show"),r.mode==="arrow"&&d.addClass(this.root,"arrow"),typeof e=="string"?this.find(".xgplayer-prompt-detail").innerHTML=e:this.find(".xgplayer-prompt-detail").innerHTML="".concat(e.text||"")+"".concat(e.highlight?'<i class="highlight">'.concat(e.highlight,"</i>"):""),r.style&&this.setStyle(r.style);var u=typeof r.autoHide=="boolean"?r.autoHide:this.config.autoHide;if(u){var f=r.interval||l;this.intervalId=setTimeout(function(){i.hide()},f)}}}},{key:"hide",value:function(){d.removeClass(this.root,"show"),d.removeClass(this.root,"arrow"),this.root.removeAttribute("style"),this.customOnClick=null}},{key:"render",value:function(){return'<xg-prompt class="xgplayer-prompt '.concat(T.CONTROLS_FOLLOW,`">
|
|
213
|
-
<span class="xgplayer-prompt-detail"></span>
|
|
214
|
-
</xg-prompt>`)}}],[{key:"pluginName",get:function(){return"prompt"}},{key:"defaultConfig",get:function(){return{interval:3e3,style:{},mode:"arrow",autoHide:!0,detail:{text:"",highlight:""},onClick:function(){}}}}]),n})(j),Bs={time:0,text:"",id:1,duration:1,color:"#fff",style:{},width:6,height:6};function Bl(a){Object.keys(Bs).map(function(o){a[o]===void 0&&(a[o]=Bs[o])})}var Hs={_updateDotDom:function(o,n){if(n){var t=this.calcuPosition(o.time,o.duration),e=o.style||{};e.left="".concat(t.left,"%"),e.width="".concat(t.width,"%"),n.setAttribute("data-text",o.text),n.setAttribute("data-time",o.time),t.isMini?d.addClass(n,"mini"):d.removeClass(n,"mini"),Object.keys(e).map(function(i){n.style[i]=e[i]})}},initDots:function(){var o=this;this._ispots.map(function(n){o.createDot(n,!1)}),this.ispotsInit=!0},createDot:function(o){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this.player.plugins.progress;if(t&&(n&&(Bl(o),this._ispots.push(o)),!(!this.ispotsInit&&n))){var e=this.calcuPosition(o.time,o.duration),i=o.style||{};i.left="".concat(e.left,"%"),i.width="".concat(e.width,"%");var r="xgspot_".concat(o.id," xgplayer-spot");e.isMini&&(r+=" mini");var s=o.template?'<div class="xgplayer-spot-pop">'.concat(o.template,"</div>"):"",l=d.createDom("xg-spot",s,{"data-text":o.text,"data-time":o.time,"data-id":o.id},r);Object.keys(i).map(function(u){l.style[u]=i[u]}),t.outer&&t.outer.appendChild(l),this.positionDot(l,o.id)}},findDot:function(o){if(this.player.plugins.progress){var n=this._ispots.filter(function(t,e){return t.id===o});return n.length>0?n[0]:null}},updateDot:function(o){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=this.player.plugins.progress;if(t){var e=this.findDot(o.id);if(e&&Object.keys(o).map(function(r){e[r]=o[r]}),!!this.ispotsInit){var i=t.find('xg-spot[data-id="'.concat(o.id,'"]'));i&&(this._updateDotDom(o,i),n&&this.showDot(o.id))}}},deleteDot:function(o){var n=this._ispots,t=this.player.plugins.progress;if(t){for(var e=[],i=0;i<n.length;i++)n[i].id===o&&e.push(i);for(var r=e.length,s=r-1;s>=0;s--)if(n.splice(e[s],1),this.ispotsInit){var l=t.find('xg-spot[data-id="'.concat(o,'"]'));l&&l.parentElement.removeChild(l)}}},deleteAllDots:function(){var o=this.player.plugins.progress;if(o){if(!this.ispotsInit){this._ispots=[];return}for(var n=o.root.getElementsByTagName("xg-spot"),t=n.length-1;t>=0;t--)o.outer.removeChild(n[t]);this._ispots=[]}},updateAllDots:function(){var o=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=this.player.plugins.progress;if(t){if(!this.ispotsInit){this._ispots=n;return}this._ispots=[];var e=t.root.getElementsByTagName("xg-spot"),i=e.length;if(i>n.length)for(var r=i-1;r>n.length-1;r--)t.outer.removeChild(e[r]);n.forEach(function(s,l){l<i?(e[l].setAttribute("data-id","".concat(s.id)),o._ispots.push(s),o.updateDot(s)):o.createDot(s)})}},positionDots:function(){var o=this,n=this._ispots,t=this.playerSize,e=this.player.sizeInfo,i=this.player.plugins.progress;!i||e.width===t.width||(t.width=e.width,t.left=e.left,n.forEach(function(r){var s=i.find('xg-spot[data-id="'.concat(r.id,'"]'));s&&o.positionDot(s,r.id)}))},positionDot:function(o,n){var t=d.findDom(o,".xgplayer-spot-pop");if(t){var e=this.playerSize,i=o.getBoundingClientRect(),r=t.getBoundingClientRect(),s=i.left-e.left,l=e.width-s-i.width/2;if(s<r.width/2||e.width<r.width){var u=r.width/2-s;t.style.left="".concat(u,"px")}else if(l<r.width/2){var f=l-r.width/2+i.width/2;t.style.left="".concat(f,"px")}else t.style.left="50%"}},updateDuration:function(){var o=this,n=this.player.plugins.progress;if(n){var t=this._ispots;t.forEach(function(e){var i=n.find('xg-spot[data-id="'.concat(e.id,'"]'));o._updateDotDom(e,i)})}},getAllDotsDom:function(){var o=this.player.plugins.progress;if(!o)return[];var n=o.root.getElementsByTagName("xg-spot");return n},getDotDom:function(o){var n=this.player.plugins.progress;if(n)return n.find('xg-spot[data-id="'.concat(o,'"]'))}};function Hd(a){var o=a.config,n=a.player;Object.keys(Hs).map(function(e){a[e]=Hs[e].bind(a)});var t=n.config.progressDot||o.ispots||[];a._ispots=t.map(function(e){return Bl(e),e}),a.ispotsInit=!1,a.playerSize={left:n.sizeInfo.left,width:n.sizeInfo.width},a.on(Se,function(){a.ispotsInit?a.updateDuration():a.initDots()}),a.on(Re,function(){a.positionDots()})}var Xe={dragmove:"onProgressMove",dragstart:"onProgressDragStart",dragend:"onProgressDragEnd",click:"onProgressClick",mouseover:"onProgressMouseOver",mouseenter:"onProgressMouseOver"},Vd=(function(a){D(n,a);var o=R(n);function n(t){var e;return x(this,n),e=o.call(this,t),C(_(e),"onMousemove",function(i){if(!e.config.disable){if(d.hasClass(i.target,"xg-spot-content")&&e.config.isHideThumbnailHover){e.player.plugins.progress.onMouseLeave(i);return}(e._state.f||d.hasClass(i.target,"xg-spot-content"))&&(d.event(i),i.stopPropagation())}}),C(_(e),"onMousedown",function(i){e.config.disable||(e._state.f||d.hasClass(i.target,"xg-spot-content"))&&(d.event(i),i.stopPropagation())}),C(_(e),"onMouseup",function(i){if(e.isDrag){var r=e.player.plugins.progress;r&&r.pos&&(r.onMouseUp(i),!r.pos.isEnter&&r.onMouseLeave(i))}}),C(_(e),"onDotMouseLeave",function(i){if(!e.config.disable){e._curDot.removeEventListener("mouseleave",e.onDotMouseLeave),e.blurDot(i.target),e._curDot=null;var r=e.player.plugins.progress;r&&r.enableBlur(),e.show()}}),C(_(e),"onProgressMouseOver",function(i,r){if(!e.config.disable&&d.hasClass(r.target,"xgplayer-spot")&&!e._curDot){e._curDot=r.target,e.focusDot(r.target),e._curDot.children.length>0&&e.hide();var s=e.player.plugins.progress;s&&s.disableBlur(),e._curDot.addEventListener("mouseleave",e.onDotMouseLeave)}}),e._ispots=[],e.videoPreview=null,e.videothumbnail=null,e.thumbnail=null,e.timeStr="",e._state={now:0,f:!1},e}return I(n,[{key:"beforeCreate",value:function(e){var i=e.player.plugins.progress;i&&(e.root=i.root)}},{key:"afterCreate",value:function(){var e=this;this._curDot=null,this.handlerSpotClick=this.hook("spotClick",function(i,r){r.seekTime&&e.player.seek(r.seekTime)}),this.transformTimeHook=this.hook("transformTime",function(i){e.setTimeContent(d.format(i))}),Hd(this),this.on(Se,function(){e.show()}),this.config.disable&&this.disable(),this.extTextRoot=this.find(".xg-spot-ext-text")}},{key:"setConfig",value:function(e){var i=this;e&&Object.keys(e).map(function(r){i.config[r]=e[r]})}},{key:"onPluginsReady",value:function(){var e=this.player;e.plugins.progress&&(this.previewLine=this.find(".xg-spot-line"),this.timePoint=this.find(".xgplayer-progress-point"),this.timeText=this.find(".xg-spot-time"),this.tipText=this.find(".spot-inner-text"),this._hasThumnail=!1,this.registerThumbnail(),this.bindEvents())}},{key:"bindEvents",value:function(){var e=this,i=this.player.plugins.progress;if(i&&(Object.keys(Xe).map(function(s){e[Xe[s]]=e[Xe[s]].bind(e),i.addCallBack(s,e[Xe[s]])}),B.device!=="mobile")){this.bind(".xg-spot-info","mousemove",this.onMousemove),this.bind(".xg-spot-info","mousedown",this.onMousedown),this.bind(".xg-spot-info","mouseup",this.onMouseup);var r=this.hook("previewClick",function(){});this.handlerPreviewClick=function(s){s.stopPropagation(),r(parseInt(e._state.now*1e3,10)/1e3,s),i&&i.onMouseUp(s)},this.bind(".xg-spot-content","mouseup",this.handlerPreviewClick)}}},{key:"onProgressMove",value:function(e,i){this.config.disable||!this.player.duration||this.updatePosition(e.offset,e.width,e.currentTime,e.e)}},{key:"onProgressDragStart",value:function(e){this.config.disable||!this.player.duration||(this.isDrag=!0,this.videoPreview&&d.addClass(this.videoPreview,"show"))}},{key:"onProgressDragEnd",value:function(e){this.config.disable||!this.player.duration||(this.isDrag=!1,this.videoPreview&&d.removeClass(this.videoPreview,"show"))}},{key:"onProgressClick",value:function(e,i){this.config.disable||d.hasClass(i.target,"xgplayer-spot")&&(i.stopPropagation(),i.preventDefault(),["time","id","text"].map(function(r){e[r]=i.target.getAttribute("data-".concat(r))}),e.time&&(e.time=Number(e.time)),this.handlerSpotClick(i,e))}},{key:"updateLinePos",value:function(e,i){var r=this.root,s=this.previewLine,l=this.player,u=this.config,f=l.controls.mode,h=f==="flex",g=r.getBoundingClientRect().width;if(!(!g&&this._hasThumnail)){g=this._hasThumnail&&g<u.width?u.width:g;var p=e-g/2,v;p<0&&!h?(p=0,v=e-g/2):p>i-g&&!h?(v=p-(i-g),p=i-g):v=0,v!==void 0&&(s.style.transform="translateX(".concat(v.toFixed(2),"px)")),r.style.transform="translateX(".concat(p.toFixed(2),"px) translateZ(0)")}}},{key:"updateTimeText",value:function(e){var i=this.timeText,r=this.timePoint;i.innerHTML=e,!this.thumbnail&&(r.innerHTML=e)}},{key:"updatePosition",value:function(e,i,r,s){var l=this.root,u=this.config,f=this._state;if(l){f.now=r,this.transformTimeHook(r);var h=this.timeStr;s&&s.target&&d.hasClass(s.target,"xgplayer-spot")?(this.showTips(s.target.getAttribute("data-text"),!1,h),this.focusDot(s.target),f.f=!0,u.isFocusDots&&f.f&&(f.now=parseInt(s.target.getAttribute("data-time"),10))):u.defaultText?(f.f=!1,this.showTips(u.defaultText,!0,h)):(f.f=!1,this.hideTips("")),this.updateTimeText(h),this.updateThumbnails(f.now),this.updateLinePos(e,i)}}},{key:"setTimeContent",value:function(e){this.timeStr=e}},{key:"updateThumbnails",value:function(e){var i=this.player,r=this.videoPreview,s=this.config,l=i.plugins.thumbnail;if(l&&l.usable){this.thumbnail&&l.update(this.thumbnail,e,s.width,s.height);var u=r&&r.getBoundingClientRect();this.videothumbnail&&l.update(this.videothumbnail,e,u.width,u.height)}}},{key:"registerThumbnail",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(B.device!=="mobile"){var i=this.player,r=this.config,s=i.getPlugin("thumbnail");if(s&&s.setConfig(e),!s||!s.usable||!r.isShowThumbnail){d.addClass(this.root,"short-line no-thumbnail");return}else d.removeClass(this.root,"short-line no-thumbnail");r.mode==="short"&&d.addClass(this.root,"short-line"),this._hasThumnail=!0;var l=this.find(".xg-spot-thumbnail");this.thumbnail=s.createThumbnail(l,"progress-thumbnail"),r.isShowCoverPreview&&(this.videoPreview=d.createDom("xg-video-preview","",{},"xgvideo-preview"),i.root.appendChild(this.videoPreview),this.videothumbnail=s.createThumbnail(this.videoPreview,"xgvideo-thumbnail")),this.updateThumbnails(0)}}},{key:"calcuPosition",value:function(e,i){var r=this.player.plugins.progress,s=this.player,l=r.root.getBoundingClientRect().width,u=s.duration/l*6;return e+i>s.duration&&(i=s.duration-e),e/s.duration*100,i/s.duration,{left:e/s.duration*100,width:i/s.duration*100,isMini:i<u}}},{key:"showDot",value:function(e){var i=this.findDot(e);if(i){var r=this.root.getBoundingClientRect(),s=r.width,l=i.time/this.player.duration*s;this.updatePosition(l,s,i.time)}}},{key:"focusDot",value:function(e,i){e&&(i||(i=e.getAttribute("data-id")),d.addClass(e,"active"),this._activeDotId=i)}},{key:"blurDot",value:function(e){if(!e){var i=this._activeDotId;e=this.getDotDom(i)}e&&(d.removeClass(e,"active"),this._activeDotId=null)}},{key:"showTips",value:function(e,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";d.addClass(this.root,"no-timepoint"),e&&(d.addClass(this.find(".xg-spot-content"),"show-text"),i&&this.config.mode==="production"?(d.addClass(this.root,"product"),this.tipText.textContent=e):(d.removeClass(this.root,"product"),this.tipText.textContent=this._hasThumnail?e:"".concat(r," ").concat(e)))}},{key:"hideTips",value:function(){d.removeClass(this.root,"no-timepoint"),this.tipText.textContent="",d.removeClass(this.find(".xg-spot-content"),"show-text"),d.removeClass(this.root,"product")}},{key:"hide",value:function(){d.addClass(this.root,"hide")}},{key:"show",value:function(e){d.removeClass(this.root,"hide")}},{key:"enable",value:function(){var e=this.config,i=this.playerConfig;this.config.disable=!1,this.show(),!this.thumbnail&&e.isShowThumbnail&&this.registerThumbnail(i.thumbnail||{})}},{key:"disable",value:function(){this.config.disable=!0,this.hide()}},{key:"destroy",value:function(){var e=this,i=this.player.plugins.progress;i&&Object.keys(Xe).map(function(r){i.removeCallBack(r,e[Xe[r]])}),this.videothumbnail=null,this.thumbnail=null,this.videoPreview&&this.player.root.removeChild(this.videoPreview),this.unbind(".xg-spot-info","mousemove",this.onMousemove),this.unbind(".xg-spot-info","mousedown",this.onMousedown),this.unbind(".xg-spot-info","mouseup",this.onMouseup),this.unbind(".xg-spot-content","mouseup",this.handlerPreviewClick)}},{key:"render",value:function(){return B.device==="mobile"||this.playerConfig.isMobileSimulateMode==="mobile"?"":'<div class="xg-spot-info hide '.concat(this.config.mode==="short"?"short-line":"",`">
|
|
215
|
-
<div class="xg-spot-content">
|
|
216
|
-
<div class="xg-spot-thumbnail">
|
|
217
|
-
<span class="xg-spot-time"></span>
|
|
218
|
-
</div>
|
|
219
|
-
<div class="xg-spot-text"><span class="spot-inner-text"></span></div>
|
|
220
|
-
</div>
|
|
221
|
-
<div class="xgplayer-progress-point">00:00</div>
|
|
222
|
-
<div class="xg-spot-ext-text"></div>
|
|
223
|
-
<div class="xg-spot-line"></div>
|
|
224
|
-
</div>`)}}],[{key:"pluginName",get:function(){return"progresspreview"}},{key:"defaultConfig",get:function(){return{index:1,miniWidth:6,ispots:[],defaultText:"",isFocusDots:!0,isHideThumbnailHover:!0,isShowThumbnail:!0,isShowCoverPreview:!1,mode:"",disable:!1,width:160,height:90}}}]),n})(j),Ud=(function(a){D(n,a);var o=R(n);function n(t){var e;return x(this,n),e=o.call(this,t),e.ratio=1,e.interval=null,e._preloadMark={},e}return I(n,[{key:"afterCreate",value:function(){var e=this;this.usable&&this.initThumbnail(),this.on([Se],function(){var i=e.config,r=i.pic_num,s=i.interval;e.usable&&(e.interval=s>0?s:Math.round(e.player.duration*1e3/r)/1e3)})}},{key:"setConfig",value:function(e){var i=this;if(e){var r=Object.keys(e);r.length<1||(r.forEach(function(s){i.config[s]=e[s]}),this.usable&&this.initThumbnail())}}},{key:"usable",get:function(){var e=this.config,i=e.urls,r=e.pic_num;return i&&i.length>0&&r>0}},{key:"initThumbnail",value:function(){var e=this.config,i=e.width,r=e.height,s=e.pic_num,l=e.interval;this.ratio=i/r*100,this.interval=l||Math.round(this.player.duration/s),this._preloadMark={}}},{key:"getUrlByIndex",value:function(e){return e>=0&&e<this.config.urls.length?this.config.urls[e]:""}},{key:"preload",value:function(e){var i=this;if(!this._preloadMark[e]){var r=this.config.urls,s=r.length,l=[];e>0&&l.push(e-1),l.push(e),e>0&&e<s-1&&l.push(e+1),l.map(function(u){!i._preloadMark[u]&&u>=0&&u<s&&(i._preloadMark[u]=1,d.preloadImg(r[u],function(){i._preloadMark[u]=2}))})}}},{key:"getPosition",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=this.config,l=s.pic_num,u=s.row,f=s.col,h=s.width,g=s.height;this.interval=Math.round(this.player.duration/l);var p=Math.ceil(e/this.interval);p=p>l?l:p;var v=p<u*f?0:Math.ceil(p/(u*f))-1,y=p-v*(f*u),m=y>0?Math.ceil(y/f)-1:0,b=y>0?y-m*f-1:0,k=0,w=0;if(i&&r){var S=i/r;S<h/g?(w=r,k=w*(h/g)):(k=i,w=k/(h/g))}else r?i||(w=r||g,k=w*(h/g)):(k=i||h,w=k/(h/g));var E=this.getUrlByIndex(v);return{urlIndex:v,rowIndex:m,colIndex:b,url:E,height:w,width:k,style:{backgroundImage:"url(".concat(E,")"),backgroundSize:"".concat(k*f,"px auto"),backgroundPosition:"-".concat(b*k,"px -").concat(m*w,"px"),width:"".concat(k,"px"),height:"".concat(w,"px")}}}},{key:"update",value:function(e,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"",u=this.config,f=u.pic_num,h=u.urls;if(!(f<=0||!h||h.length===0)){var g=this.getPosition(i,r,s);this.preload(g.urlIndex),Object.keys(g.style).map(function(p){e.style[p]=g.style[p]}),Object.keys(l).map(function(p){e.style[p]=l[p]})}}},{key:"changeConfig",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.setConfig(e)}},{key:"createThumbnail",value:function(e,i){var r=d.createDom("xg-thumbnail","",{},"thumbnail ".concat(i));return e&&e.appendChild(r),r}}],[{key:"pluginName",get:function(){return"thumbnail"}},{key:"defaultConfig",get:function(){return{isShow:!1,urls:[],pic_num:0,col:0,row:0,height:90,width:160,scale:1,className:"",hidePortrait:!1}}}]),n})(j);function hr(a){return a?"background:".concat(a,";"):""}var zd=(function(a){D(n,a);var o=R(n);function n(){var t;x(this,n);for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return t=o.call.apply(o,[this].concat(i)),C(_(t),"onTimeupdate",function(){var s=t.player.ended,l=_(t),u=l.offsetDuration,f=t.currentTime;f=d.adjustTimeByDuration(f,u,s),t.update({played:f},u)}),t}return I(n,[{key:"offsetDuration",get:function(){return this.playerConfig.customDuration||this.player.offsetDuration||this.player.duration}},{key:"currentTime",get:function(){var e=this.player,i=e.offsetCurrentTime,r=e.currentTime;return i>=0?i:r}},{key:"afterCreate",value:function(){var e=this;this.root&&(this.on(se,this.onTimeupdate),this.on(ze,function(){e.reset()}))}},{key:"reset",value:function(){this.update({played:0,cached:0},0)}},{key:"update",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{cached:0,played:0},i=arguments.length>1?arguments[1]:void 0;!i||!this.root||(e.cached&&(this.find("xg-mini-progress-cache").style.width="".concat(e.cached/i*100,"%")),e.played&&(this.find("xg-mini-progress-played").style.width="".concat(e.played/i*100,"%")))}},{key:"render",value:function(){var e=this.playerConfig,i=e.commonStyle,r=e.miniprogress;if(r){var s=this.config,l=s.mode,u=s.height,f={cached:hr(i.cachedColor),played:hr(i.playedColor),progress:hr(i.progressColor),height:u>0&&u!==2?"height: ".concat(u,"px;"):""},h=l==="show"?"xg-mini-progress-show":"";return'<xg-mini-progress class="xg-mini-progress '.concat(h,'" style="').concat(f.progress," ").concat(f.height,`">
|
|
225
|
-
<xg-mini-progress-cache class="xg-mini-progress-cache" style="`).concat(f.cached,`"></xg-mini-progress-cache>
|
|
226
|
-
<xg-mini-progress-played class="xg-mini-progress-played" style="`).concat(f.played,`"></xg-mini-progress-played>
|
|
227
|
-
</xg-mini-progress>`)}}}],[{key:"pluginName",get:function(){return"MiniProgress"}},{key:"defaultConfig",get:function(){return{mode:"auto",height:2}}}]),n})(j),Ze={REAL_TIME:"realtime",FIRST_FRAME:"firstframe",POSTER:"poster"};function jd(){try{return parseInt(window.performance.now(),10)}catch{return new Date().getTime()}}function qd(){try{var a=document.createElement("canvas").getContext;return!!a}catch{return!1}}var It=null,Gd=(function(a){D(n,a);var o=R(n);function n(){var t;x(this,n);for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return t=o.call.apply(o,[this].concat(i)),C(_(t),"onLoadedData",function(s){t.player&&(t._frameCount=t.config.startFrameCount,t.stop(),t.renderOnTimeupdate(s),t.off(se,t.renderOnTimeupdate),t.on(se,t.renderOnTimeupdate))}),C(_(t),"onVisibilitychange",function(s){document.visibilityState==="visible"?t._checkIfCanStart()&&t.start():document.visibilityState==="hidden"&&t.stop()}),C(_(t),"renderOnTimeupdate",function(s){if(t._frameCount>0)t.renderOnce(),t._frameCount--;else{t._isLoaded=!0,t.off(se,t.renderOnTimeupdate);var l=t.config.startInterval;!t.player.paused&&t._checkIfCanStart()&&t.start(0,l)}}),C(_(t),"start",function(s,l){var u=t.player.video,f=jd(),h=t.checkVideoIsSupport(u);!h||!t.canvasCtx||(l||(l=t.interval),t.stop(),u.videoWidth&&u.videoHeight&&(t.videoPI=u.videoHeight>0?parseInt(u.videoWidth/u.videoHeight*100,10):0,(t.config.mode===Ze.REAL_TIME||f-t.preTime>=l)&&(u&&u.videoWidth&&t.update(h,t.videoPI),t.preTime=f)),t.frameId=t._loopType==="timer"?d.setTimeout(_(t),t.start,l):d.requestAnimationFrame(t.start))}),C(_(t),"stop",function(){t.frameId&&(t._loopType==="timer"?d.clearTimeout(_(t),t.frameId):d.cancelAnimationFrame(t.frameId),t.frameId=null)}),t}return I(n,[{key:"afterCreate",value:function(){var e=this;this.playerConfig.dynamicBg===!0&&(this.config.disable=!1),n.isSupport||(this.config.disable=!0);var i=this.config,r=i.disable,s=i.mode,l=i.frameRate;r||(this._pos={width:0,height:0,rwidth:0,rheight:0,x:0,y:0,pi:0},this.isStart=!1,this._isLoaded=!1,this.videoPI=0,this.preTime=0,this.interval=parseInt(1e3/l,10),this.canvas=null,this.canvasCtx=null,this._frameCount=0,this._loopType=this.config.mode!==Ze.REAL_TIME&&this.interval>=1e3?"timer":"animation",this.once(Yt,function(){e.player&&(e.init(),e.renderByPoster(),e.player.paused||e.start())}),s!==Ze.POSTER&&(s!==Ze.FIRST_FRAME&&(this.on(ze,function(){e.stop()}),this.on(le,function(){var u=e.config.startInterval;e._checkIfCanStart()&&e.start(0,u)}),this.on(et,function(){e.stop()})),this.on(Te,this.onLoadedData),this.on(Fr,function(){e._isLoaded=!1,e.stop()}),document.addEventListener("visibilitychange",this.onVisibilitychange)))}},{key:"setConfig",value:function(e){var i=this;Object.keys(e).forEach(function(r){r==="root"&&e[r]!==i.config[r]?i.reRender(e[r]):r==="frameRate"?i.interval=parseInt(1e3/e[r],10):r==="disable"&&e[r]&&i.stop(),i.config[r]=e[r]})}},{key:"init",value:function(e){var i=this.player,r=this.config;this.canvasFilter=n.supportCanvasFilter();try{var s=e||r.root;s||(s=r.isInnerRender&&i.innerContainer||i.root),s.insertAdjacentHTML("afterbegin",'<div class="xgplayer-dynamic-bg" data-index="'.concat(r.index,`"><canvas>
|
|
228
|
-
</canvas><xgmask></xgmask></div>`)),this.root=s.children[0],this.canvas=this.find("canvas"),this.canvasFilter||(this.canvas.style.filter=r.filter,this.canvas.style.webkitFilter=r.filter),this.mask=this.find("xgmask"),r.addMask&&(this.mask.style.background=r.maskBg),this.canvasCtx=this.canvas.getContext("2d")}catch(l){V.logError("plugin:DynamicBg",l)}}},{key:"reRender",value:function(e){var i=this.config.disable;if(!(!i&&!this.root)){this.stop();var r=this.root?this.root.parentElement:null;if(r!==e&&r.removeChild(this.root),!e){this.root=null;return}this.init(e),this.renderOnce();var s=this.config.startInterval;this._checkIfCanStart()&&this.start(0,s)}}},{key:"checkVideoIsSupport",value:function(e){if(!e)return null;var i=e&&e instanceof window.HTMLVideoElement?e:e.canvas?e.canvas:e.flyVideo?e.flyVideo:null;if(i&&!(B.browser==="safari"&&d.isMSE(i)))return i;var r=i?i.tagName.toLowerCase():"";return r==="canvas"||r==="img"?i:null}},{key:"renderByPoster",value:function(){var e=this.playerConfig.poster;if(e){var i=d.typeOf(e)==="String"?e:d.typeOf(e.poster)==="String"?e.poster:null;this.updateImg(i)}}},{key:"_checkIfCanStart",value:function(){var e=this.config.mode;return this._isLoaded&&!this.player.paused&&e!==Ze.FIRST_FRAME&&e!==Ze.POSTER}},{key:"renderOnce",value:function(){var e=this.player.video;if(!(!e.videoWidth||!e.videoHeight)){this.videoPI=parseInt(e.videoWidth/e.videoHeight*100,10);var i=this.checkVideoIsSupport(e);i&&this.update(i,this.videoPI)}}},{key:"updateImg",value:function(e){var i=this;if(e){var r=this.canvas.getBoundingClientRect(),s=r.width,l=r.height,u=new window.Image;u.onload=function(){if(!(!i.canvas||i.frameId||i.isStart)){i.canvas.height=l,i.canvas.width=s;var f=parseInt(s/l*100,10);i.update(u,f),u=null}},u.src=e}}},{key:"update",value:function(e,i){if(!(!this.canvas||!this.canvasCtx||!i))try{var r=this._pos,s=this.config,l=this.canvas.getBoundingClientRect(),u=l.width,f=l.height;if(u!==r.width||f!==r.height||r.pi!==i){var h=parseInt(u/f*100,10);r.pi=i,r.width!==u&&(r.width=this.canvas.width=u),r.height!==f&&(r.height=this.canvas.height=f);var g=f,p=u;h<i?p=parseInt(f*i/100,10):h>i&&(g=parseInt(u*100/i,10)),r.rwidth=p*s.multiple,r.rheight=g*s.multiple,r.x=(u-r.rwidth)/2,r.y=(f-r.rheight)/2}this.canvasFilter&&(this.canvasCtx.filter=s.filter),this.canvasCtx.drawImage(e,r.x,r.y,r.rwidth,r.rheight)}catch(v){V.logError("plugin:DynamicBg",v)}}},{key:"destroy",value:function(){this.stop(),document.removeEventListener("visibilitychange",this.onVisibilitychange),this.canvasCtx=null,this.canvas=null}},{key:"render",value:function(){return""}}],[{key:"pluginName",get:function(){return"dynamicBg"}},{key:"defaultConfig",get:function(){return{isInnerRender:!1,disable:!0,index:-1,mode:"framerate",frameRate:10,filter:"blur(50px)",startFrameCount:2,startInterval:0,addMask:!0,multiple:1.2,maskBg:"rgba(0,0,0,0.7)"}}},{key:"isSupport",get:function(){return typeof It=="boolean"||(It=qd()),It}},{key:"supportCanvasFilter",value:function(){return!(B.browser==="safari"||B.browser==="firefox")}}]),n})(j),Wd={LANG:"zh-cn",TEXT:{ERROR_TYPES:{network:{code:1,msg:"视频下载错误"},mse:{code:2,msg:"流追加错误"},parse:{code:3,msg:"解析错误"},format:{code:4,msg:"格式错误"},decoder:{code:5,msg:"解码错误"},runtime:{code:6,msg:"语法错误"},timeout:{code:7,msg:"播放超时"},other:{code:8,msg:"其他错误"}},HAVE_NOTHING:"没有关于音频/视频是否就绪的信息",HAVE_METADATA:"音频/视频的元数据已就绪",HAVE_CURRENT_DATA:"关于当前播放位置的数据是可用的,但没有足够的数据来播放下一帧/毫秒",HAVE_FUTURE_DATA:"当前及至少下一帧的数据是可用的",HAVE_ENOUGH_DATA:"可用数据足以开始播放",NETWORK_EMPTY:"音频/视频尚未初始化",NETWORK_IDLE:"音频/视频是活动的且已选取资源,但并未使用网络",NETWORK_LOADING:"浏览器正在下载数据",NETWORK_NO_SOURCE:"未找到音频/视频来源",MEDIA_ERR_ABORTED:"取回过程被用户中止",MEDIA_ERR_NETWORK:"网络错误",MEDIA_ERR_DECODE:"解码错误",MEDIA_ERR_SRC_NOT_SUPPORTED:"不支持的音频/视频格式",REPLAY:"重播",ERROR:"网络连接似乎出现了问题",PLAY_TIPS:"播放",PAUSE_TIPS:"暂停",PLAYNEXT_TIPS:"下一集",DOWNLOAD_TIPS:"下载",ROTATE_TIPS:"旋转",RELOAD_TIPS:"重新载入",FULLSCREEN_TIPS:"进入全屏",EXITFULLSCREEN_TIPS:"退出全屏",CSSFULLSCREEN_TIPS:"进入样式全屏",EXITCSSFULLSCREEN_TIPS:"退出样式全屏",TEXTTRACK:"字幕",PIP:"画中画",SCREENSHOT:"截图",LIVE:"正在直播",OFF:"关闭",OPEN:"开启",MINI_DRAG:"点击按住可拖动视频",MINISCREEN:"小屏幕",REFRESH_TIPS:"请试试",REFRESH:"刷新",FORWARD:"快进中",LIVE_TIP:"直播"}},rt="info",dr=El,Kd=(function(a){D(n,a);var o=R(n);function n(){var t;x(this,n);for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return t=o.call.apply(o,[this].concat(i)),C(_(t),"_recordUserActions",function(s){var l=t._getTime(),u=Object.assign({},s,{msg:s.msg||s.action});t._stats[rt].push(X(X({type:"userAction"},l),{},{payload:u}))}),C(_(t),"_onReset",function(){t.reset()}),C(_(t),"_recordInfo",function(s){t.info(s)}),C(_(t),"_downloadStats",function(){var s=t.getStats(),l=new Blob([JSON.stringify(s)],{type:"application/json"}),u=window.URL.createObjectURL(l),f=document.createElement("a");f.style.display="none",f.href=u,f.download="player.txt",f.disabled=!1,f.click()}),t}return I(n,[{key:"_getTime",value:function(){return{timestamp:Date.now(),timeFormat:new Date().toISOString()}}},{key:"afterCreate",value:function(){this.reset(),this.on(Mt,this._recordUserActions),this.on(dr.STATS_INFO,this._recordInfo),this.on(dr.STATS_DOWNLOAD,this._downloadStats),this.on(dr.STATS_RESET,this._onReset)}},{key:"destroy",value:function(){this.offAll()}},{key:"downloadStats",value:function(){this._downloadStats()}},{key:"info",value:function(e){e.profile?this._infoProfile(e):this._info(e)}},{key:"_info",value:function(e){var i=this._getTime();this._stats[rt].push(X(X({},i),{},{payload:e}))}},{key:"_infoProfile",value:function(e){if(e&&e.startMs){var i=Date.now(),r=i-e.startMs,s=X({cat:"function",dur:r,name:e.name||e.msg,ph:"X",pid:0,tid:0,ts:e.startMs,profile:!0},e);this._info(s)}else console.warn("infoProfile need object data, include startMs")}},{key:"reset",value:function(){var e;this._stats=(e={},C(e,rt,[]),C(e,"media",{}),e)}},{key:"getStats",value:function(){for(var e=this.player,i=e.media,r=[],s=0;s<i.buffered.length;s++)r.push({start:i.buffered.start(s),end:i.buffered.end(s)});var l={currentTime:i.currentTime,readyState:i.readyState,buffered:r,paused:i.paused,ended:i.ended};return this._stats.media=l,{raw:this._stats,timestat:this._getTimeStats(),profile:this._getProfile()}}},{key:"_getTimeStats",value:function(){var e=this._stats[rt],i=e.map(function(r){var s=r.payload.data,l="";try{s instanceof Error?l=s.msg:s!==void 0&&(l=JSON.stringify(s))}catch(u){console.log("err",u)}return"[".concat(r.timeFormat,"] : ").concat(r.payload.msg," ").concat(l," ")});return i}},{key:"_getProfile",value:function(){var e={traceEvents:[]},i=this._stats[rt];return i.forEach(function(r){r.payload.profile&&e.traceEvents.push(r.payload)}),e}}],[{key:"pluginName",get:function(){return"stats"}},{key:"defaultConfig",get:function(){return{}}}]),n})(Oe),Hl=(function(a){D(n,a);var o=R(n);function n(){var t;x(this,n);for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return t=o.call.apply(o,[this].concat(i)),C(_(t),"onGapJump",function(){var s=_(t),l=s.player,u=s.config;if(l.media.readyState!==HTMLMediaElement.HAVE_NOTHING){if(l.media.seeking){if(!t.seekingEventReceived)return}else t.seekingEventReceived=!1;if(!(l.media.paused&&l.media.currentTime!==0&&t.hasPlayed)){var f=l.media.buffered,h=u.smallGapLimit||.5,g=u.gapDetectionThreshold||.3,p=l.media.currentTime,v=t._getIndex(f,p,g);if(!(v===null||v===0)){console.log("GapJump bufferRange ",f.start(v),f.end(v));var y=f.start(v)+.1,m=l.media.duration;if(!(y>m)){var b=y-p,k=b<=h;b<n.BROWSER_GAP_TOLERANCE||k&&(u.useGapJump!==!1&&(l.media.currentTime=t.isSafari?y+.1:y),t.player&&t.player.emit("detectGap"),console.log("gapJump gapIndex",v," isGapSamll:",k," currentTime:",l.media.currentTime," jumpSize:",p-l.media.currentTime),y!==.08&&l&&l.emit("log",{type:"oneevent",end_type:"gap",vid:l.config.vid,ext:{video_postion:Math.floor(y*1e3)}}))}}}}}),t}return I(n,[{key:"afterCreate",value:function(){var e=this,i=this.config.useGapJump;i!==!1&&(this.hasPlayed=!1,this.seekingEventReceived=!1,this.isSafari=/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),this.on(gt,this.onGapJump),this.on(le,function(){e.hasPlayed=!0}),this.on($t,function(){e.seekingEventReceived=!0}))}},{key:"_getIndex",value:function(e,i,r){if(!e||!e.length||e.length===1&&e.end(0)-e.start(0)<1e-6)return null;for(var s=this._getBuffered(e),l=null,u=0;u<s.length;u++){var f=s[u];if(f.start>i&&(u===0||s[u-1].end-i<=r)){l=u;break}}return l}},{key:"_getBuffered",value:function(e){if(!e)return[];for(var i=[],r=0;r<e.length;r++)i.push({start:e.start(r),end:e.end(r)});return i}}],[{key:"pluginName",get:function(){return"gapJump"}},{key:"defaultConfig",get:function(){return{useGapJump:!1,smallGapLimit:.5,gapDetectionThreshold:.3}}}]),n})(j);Hl.BROWSER_GAP_TOLERANCE=.001;var $d=(function(a){D(n,a);var o=R(n);function n(){var t;x(this,n);for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return t=o.call.apply(o,[this].concat(i)),C(_(t),"onWaiting",function(){var s=_(t),l=s.config;t.jumpCnt>l.jumpCntMax||t.timer||l.useWaitingTimeoutJump===!1||(t.timer=setTimeout(t.onJump,l.waitingTime*1e3))}),C(_(t),"onJump",function(){var s=_(t),l=s.player,u=s.config;if(clearTimeout(t.timer),t.timer=null,!(t.jumpCnt>u.jumpCntMax||u.useWaitingTimeoutJump===!1)&&!(l.media.paused&&l.media.currentTime!==0&&t.hasPlayed)){t.jumpSize=u.jumpSize*(t.jumpCnt+1),t.jumpCnt===u.jumpSize&&t.jumpSize<6&&(t.jumpSize=6);var f=l.currentTime+t.jumpSize,h=l.media.duration;f>h||(t.jumpCnt++,l.currentTime=f)}}),t}return I(n,[{key:"afterCreate",value:function(){var e=this,i=this.config,r=i.useWaitingTimeoutJump,s=i.jumpSize;r!==!1&&(this.hasPlayed=!1,this.jumpCnt=0,this.timer=null,this.jumpSize=s,this.on(gt,this.onWaiting),this.on([Mr,be],function(){clearTimeout(e.timer),e.timer=null,e.jumpSize=e.config.jumpSize}),this.on(le,function(){e.hasPlayed=!0}))}}],[{key:"pluginName",get:function(){return"waitingTimeoutJump"}},{key:"defaultConfig",get:function(){return{useWaitingTimeoutJump:!1,waitingTime:15,jumpSize:2,jumpCntMax:4}}}]),n})(j),Je="cdn",Pt=["cdn"],Yd=(function(a){D(n,a);var o=R(n);function n(){var t;x(this,n);for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return t=o.call.apply(o,[this].concat(i)),C(_(t),"getSpeed",function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Je;if(!t.speedListCache||!t.speedListCache[s]||t.speedListCache[s].length<=0)return 0;var l=0;return t.speedListCache[s].map(function(u){l+=u}),Math.floor(l/t.speedListCache[s].length)}),C(_(t),"startTimer",function(){d.isMSE(t.player.video)||(t.initSpeedList(),t.cnt=0,t.timer=setTimeout(t.testSpeed,t.config.testTimeStep))}),C(_(t),"initSpeedList",function(){t.speedListCache={},Pt.forEach(function(s){t.speedListCache[s]=[]})}),C(_(t),"_onRealSpeedChange",function(s){s.speed&&t.appendList(s.speed,s.type||Je)}),C(_(t),"testSpeed",function(){if(clearTimeout(t.timer),t.timer=null,!(!t.player||!t.config.openSpeed)){var s=t.config,l=s.url,u=s.loadSize,f=s.testCnt,h=s.testTimeStep,g=l+(l.indexOf("?")<0?"?testst=":"&testst=")+Date.now();if(!(t.cnt>=f)){t.cnt++;try{var p=new Date().getTime(),v=null,y=new XMLHttpRequest;t.xhr=y,y.open("GET",g);var m={},b=Math.floor(Math.random()*10);m.Range="bytes="+b+"-"+(u+b),m&&Object.keys(m).forEach(function(k){y.setRequestHeader(k,m[k])}),y.onreadystatechange=function(){if(y.readyState===4){t.xhr=null,v=new Date().getTime();var k=y.getResponseHeader("Content-Length")/1024*8,w=Math.round(k*1e3/(v-p));t.appendList(w),t.timer=setTimeout(t.testSpeed,h)}},y.send()}catch(k){console.error(k)}}}}),C(_(t),"appendList",function(s){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Je;if(!(!t.speedListCache||!t.speedListCache[l])){var u=t.config.saveSpeedMax;t.speedListCache[l].length>=u&&t.speedListCache[l].shift(),t.speedListCache[l].push(s);var f=_(t),h=f.player;h&&(l===Je?h.realTimeSpeed=s:h[t.getSpeedName("realTime",l)]=s),t.updateSpeed(l)}}),C(_(t),"updateSpeed",function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Je,l=t.getSpeed(s),u=_(t),f=u.player;if(f)if(s===Je)(!f.avgSpeed||l!==f.avgSpeed)&&(f.avgSpeed=l,f.emit(yr,{speed:l,realTimeSpeed:f.realTimeSpeed}));else{var h=t.getSpeedName("avg",s);(!f[h]||l!==f[h])&&(f[h]=l,f.emit(yr,{speed:l,realTimeSpeed:f.realTimeSpeed}))}}),t}return I(n,[{key:"afterCreate",value:function(){var e=this.config,i=e.openSpeed,r=e.addSpeedTypeList;(r==null?void 0:r.length)>0&&Pt.push.apply(Pt,de(r)),this.initSpeedList(),this.on("real_time_speed",this._onRealSpeedChange),this.timer=null,this.cnt=0,this.xhr=null,i&&this.on([Te,Dt],this.startTimer)}},{key:"getSpeedName",value:function(e,i){return e+"Speed"+i.toUpperCase()}},{key:"openSpeed",get:function(){return this.config.openSpeed},set:function(e){if(this.config.openSpeed=e,!e&&this.timer){clearTimeout(this.timer),this.timer=null;return}if(this.config.openSpeed){if(this.timer)return;this.timer=setTimeout(this.testSpeed,this.config.testTimeStep)}}},{key:"destroy",value:function(){var e=this;this.off("real_time_speed",this._onRealSpeedChange),this.off([Te,Dt],this.startTimer),Pt.forEach(function(i){e.speedListCache&&e.speedListCache[i]&&(e.speedListCache[i]=[])}),this.speedListCache&&(this.speedListCache={}),clearTimeout(this.timer),this.timer=null,this.xhr&&this.xhr.readyState!==4&&(this.xhr.cancel&&this.xhr.cancel(),this.xhr=null)}}],[{key:"pluginName",get:function(){return"testspeed"}},{key:"defaultConfig",get:function(){return{openSpeed:!1,testCnt:3,loadSize:200*1024,testTimeStep:3e3,url:"",saveSpeedMax:5,addSpeedTypeList:[]}}}]),n})(j),Xd=(function(a){D(n,a);var o=R(n);function n(){return x(this,n),o.apply(this,arguments)}return I(n,[{key:"afterCreate",value:function(){var e=this,i=this.player,r=this.config,s=i.media||i.video;if(this.timer=null,this._lastDecodedFrames=0,this._currentStuckCount=0,this._lastCheckPoint=null,this._payload=[],!r.disabled){var l=s.getVideoPlaybackQuality;l&&(this.on(le,function(){e._startTick()}),this.on(et,function(){e._stopTick()}),this.on(Ue,function(){e._stopTick()}),this.on(ze,function(){e._stopTick()}))}}},{key:"_startTick",value:function(){var e=this;this._stopTick(),this._timer=setTimeout(function(){e._checkDecodeFPS(),e._startTick()},this.config.tick)}},{key:"_stopTick",value:function(){clearTimeout(this._timer),this._timer=null}},{key:"_checkBuffer",value:function(e,i){for(var r=!1,s=[],l=0;l<i.length;l++){var u=i.start(l),f=i.end(l);if(s.push({start:u,end:f}),u<=e&&e<=f-1){r=!0;break}}return{enoughBuffer:r,buffers:s}}},{key:"_checkStuck",value:function(e,i,r,s){var l=this.player.media||this.player.video,u=document.hidden,f=l.paused,h=l.readyState,g=l.currentTime,p=l.buffered;if(!(u||f||h<4)){var v=this._checkBuffer(g,p),y=v.enoughBuffer,m=v.buffers;y&&(e<=this.config.reportFrame?(this._currentStuckCount++,this._payload.push({currentTime:g,buffers:m,curDecodedFrames:e,totalVideoFrames:i,droppedVideoFrames:r,checkInterval:s}),this._currentStuckCount>=this.config.stuckCount&&(this.emit(Sl,this._payload),this._reset())):this._reset())}}},{key:"_reset",value:function(){this._payload=[],this._currentStuckCount=0}},{key:"_checkDecodeFPS",value:function(){var e=this.player.media||this.player.video;if(e){var i=e.getVideoPlaybackQuality(),r=i.totalVideoFrames,s=i.droppedVideoFrames,l=performance.now();if(r&&this._lastCheckPoint){var u=r-this._lastDecodedFrames,f=l-this._lastCheckPoint;this._checkStuck(u,r,s,f)}this._lastDecodedFrames=r,this._lastCheckPoint=l}}},{key:"destroy",value:function(){this._stopTick()}}],[{key:"pluginName",get:function(){return"FpsDetect"}},{key:"defaultConfig",get:function(){return{disabled:!1,tick:1e3,stuckCount:3,reportFrame:0}}}]),n})(j);Qe.use(Wd);var Zd=I(function a(o,n){var t,e,i;x(this,a);var r=n&&n.isMobileSimulateMode==="mobile",s=n.isLive,l=s?[]:[yd,Ol,zd,Vd,Nl],u=[].concat(l,[Rl,Dl,Cd,Ed,Nd,Md,Ld,Dd,Ml,wd]),f=[ed,td,nd,md,rd,Fd,Bd,Ud,ld];this.plugins=[Kd,Jh].concat(de(u),f,[Hl,$d]);var h=r?"mobile":B.device;switch(h){case"pc":(t=this.plugins).push.apply(t,[Ms,cr,kr,Yd,Xd]);break;case"mobile":(e=this.plugins).push.apply(e,[gd]);break;default:(i=this.plugins).push.apply(i,[Ms,cr,kr])}(B.os.isIpad||h==="pc")&&this.plugins.push(Gd),B.os.isIpad&&this.plugins.push(cr),this.ignores=[],this.i18n=[]}),Q=(function(a){D(n,a);var o=R(n);function n(){return x(this,n),o.apply(this,arguments)}return I(n)})(Jt);C(Q,"defaultPreset",Zd);C(Q,"Util",d);C(Q,"Sniffer",B);C(Q,"Errors",Lt);C(Q,"Events",_h);C(Q,"Plugin",j);C(Q,"BasePlugin",Oe);C(Q,"I18N",Qe);C(Q,"STATE_CLASS",T);C(Q,"InstManager",Ll);C(Q,"PlayIcon",Rl);C(Q,"TimeIcon",Nl);C(Q,"Progress",Ol);C(Q,"FullscreenIcon",Dl);C(Q,"CssFullscreenIcon",kr);C(Q,"VolumeIcon",Ml);const Jd=["id"],Qd=c.defineComponent({name:"ElImageViewer",__name:"Player",props:c.mergeModels({url:{type:String,default:""},zIndex:{type:Number,default:200},config:{type:Object,default:()=>({})}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:c.mergeModels({close:()=>!0},["update:modelValue"]),setup(a,{emit:o}){let n=null;const t=a,{cLoadUrl:e}=Us(t),i=c.computed(()=>ut(e.value,t.url)),r={width:"100%",height:"100%",autoplay:!1,volume:.6,controls:!0,playbackRate:[.5,.75,1,1.5,2],crossOrigin:!0,preload:"auto",muted:!1,loop:!0,poster:"",lang:"zh-CN",screenShot:!0},s=c.computed(()=>({...r,...t.config})),l=o,u=c.useModel(a,"modelValue"),f=he.buildUUID(),h=J.useNamespace("image-viewer");function g(){l("close"),u.value=!1,n.destroy()}return c.watch(()=>u.value,p=>{p&&c.nextTick(()=>{n=new Q({id:f,url:i.value,...s.value})})}),(p,v)=>{const y=c.resolveComponent("el-icon");return u.value?(c.openBlock(),c.createBlock(c.Teleport,{key:0,to:"body"},[c.createVNode(c.Transition,{name:"viewer-fade",appear:""},{default:c.withCtx(()=>[c.createElementVNode("div",{ref:"wrapper",tabindex:-1,class:c.normalizeClass(c.unref(h).e("wrapper")),style:c.normalizeStyle({zIndex:a.zIndex})},[c.createElementVNode("div",{class:c.normalizeClass(c.unref(h).e("mask"))},null,2),c.createCommentVNode(" CANVAS "),c.createElementVNode("div",{class:c.normalizeClass(c.unref(h).e("canvas"))},[c.createElementVNode("div",{id:c.unref(f)},null,8,Jd),c.createCommentVNode(" CLOSE "),c.createElementVNode("span",{class:c.normalizeClass([c.unref(h).e("btn"),c.unref(h).e("close")]),onClick:g},[c.createVNode(y,{onClick:g},{default:c.withCtx(()=>[c.createVNode(c.unref(Vs))]),_:1})],2)],2),c.renderSlot(p.$slots,"default",{},void 0,!0)],6)]),_:3})])):c.createCommentVNode("v-if",!0)}}}),eg=Ut(Qd,[["__scopeId","data-v-b301aa7d"]]),tg=Ee(eg),ig={key:0,class:"preview-files"},ng={class:"flex",style:{width:"80%","align-items":"center"}},rg=["onClick"],ag=["title"],og={style:{color:"#b8c6d9"}},sg=["onClick"],lg={key:1,class:"flex preview-img"},ug=c.defineComponent({__name:"IkDetailPreviewFiles",props:{fileList:{type:Array,default:()=>[]},fileType:{type:String,default:"file"},fileWidth:{type:String,default:"100%"},loadUrl:{type:String,default:""},kkUrl:{required:!0,type:String,default:""}},setup(a){const o=a,n=c.ref(o.fileList);c.watch(()=>o.fileList,u=>{u&&(n.value=u)},{immediate:!0});const t=c.ref(!1),e=c.ref({}),i=u=>{e.value={url:u.url,name:u.name},t.value=!0},r=u=>{var f,h,g,p,v;return(f=u==null?void 0:u.suffix)!=null&&f.includes("pdf")?"iksvg_pdf":(h=u==null?void 0:u.suffix)!=null&&h.includes("doc")?"iksvg_word":(g=u==null?void 0:u.suffix)!=null&&g.includes("xls")?"iksvg_excel":(p=u==null?void 0:u.suffix)!=null&&p.includes("mov")?"iksvg_mov":(v=u==null?void 0:u.suffix)!=null&&v.includes("zip")?"iksvg_zip":"icon-jpg"},s=u=>{var f,h,g,p,v;return(f=u==null?void 0:u.suffix)!=null&&f.includes("pdf")?"#FA4E4E":(h=u==null?void 0:u.suffix)!=null&&h.includes("doc")?"#2c69e0":(g=u.suffix)!=null&&g.includes("xls")?"#39BFBF":(p=u.suffix)!=null&&p.includes("txt")?"#2c69e0":(v=u.suffix)!=null&&v.includes("zip")?"#FF9000":"#32CD79"},l=u=>{const f=document.createElement("a");f.href=he.ikUrl.assembleUrl(o.loadUrl,u.url),f.download=u.name,f.click()};return(u,f)=>{var g,p;const h=c.resolveComponent("el-image");return c.openBlock(),c.createElementBlock("div",null,[o.fileType==="file"?(c.openBlock(),c.createElementBlock("div",ig,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(n.value,(v,y)=>(c.openBlock(),c.createElementBlock("div",{key:y,class:"files-item",style:c.normalizeStyle({width:o.fileWidth,"margin-right":o.fileWidth==="100%"?"0px":""})},[c.createElementVNode("div",ng,[c.createVNode(c.unref(Ce),{name:r(v),style:c.normalizeStyle(`color:${s(v)}`),size:36},null,8,["name","style"]),c.createElementVNode("div",{class:"file-name",onClick:m=>l(v)},[c.createElementVNode("p",{title:v.name},c.toDisplayString(v.name),9,ag),c.createElementVNode("p",og,c.toDisplayString((v.size/1024).toFixed(2))+"KB",1)],8,rg)]),c.createElementVNode("div",{class:"file-preview",onClick:m=>i(v)},[c.createVNode(c.unref(Ce),{name:"iksvg_yulan"}),f[1]||(f[1]=c.createElementVNode("span",null,"预览",-1))],8,sg)],4))),128))])):c.createCommentVNode("v-if",!0),o.fileType==="img"?(c.openBlock(),c.createElementBlock("div",lg,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(n.value,(v,y)=>(c.openBlock(),c.createElementBlock("div",{key:y,class:"preview-img"},[c.createVNode(h,{class:"show-img",src:a.loadUrl+v.url,"preview-src-list":[a.loadUrl+v.url],fit:"cover"},null,8,["src","preview-src-list"])]))),128))])):c.createCommentVNode("v-if",!0),c.createVNode(c.unref(Bu),{modelValue:t.value,"onUpdate:modelValue":f[0]||(f[0]=v=>t.value=v),"load-url":o.loadUrl,url:(g=e.value)==null?void 0:g.url,"kk-url":a.kkUrl,"file-name":(p=e.value)==null?void 0:p.name},null,8,["modelValue","load-url","url","kk-url","file-name"])])}}}),cg=Ut(ug,[["__scopeId","data-v-8da56541"]]),Vl=Ee(cg);exports.IkDetailPreviewFiles=Vl;exports.default=Vl;
|