iking-web-ui-pro 1.0.48 → 1.0.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (284) hide show
  1. package/dist/Demo/ik.index.cjs.js +1 -0
  2. package/dist/Demo/ik.index.es.js +1 -0
  3. package/dist/Demo/package.json +7 -0
  4. package/dist/IkApprovalProcess/ik.index.cjs.js +1 -0
  5. package/dist/IkApprovalProcess/ik.index.es.js +281 -277
  6. package/dist/IkApprovalProcess/package.json +5 -0
  7. package/dist/IkApprovalProcessDetail/ik.index.cjs.js +228 -0
  8. package/dist/IkApprovalProcessDetail/ik.index.es.js +5 -1
  9. package/dist/IkApprovalProcessDetail/package.json +5 -0
  10. package/dist/IkAutoCard/ik.index.cjs.js +1 -0
  11. package/dist/IkAutoCard/package.json +5 -0
  12. package/dist/IkBaseDialog/ik.index.cjs.js +3 -0
  13. package/dist/IkBaseDialog/package.json +5 -0
  14. package/dist/IkBottomOperate/ik.index.cjs.js +1 -0
  15. package/dist/IkBottomOperate/package.json +5 -0
  16. package/dist/IkBtnContent/ik.index.cjs.js +1 -0
  17. package/dist/IkBtnContent/package.json +5 -0
  18. package/dist/IkBtnSetting/ik.index.cjs.js +1 -0
  19. package/dist/IkBtnSetting/package.json +5 -0
  20. package/dist/IkCalendar/ik.index.cjs.js +1 -0
  21. package/dist/IkCalendar/ik.index.es.js +6 -2
  22. package/dist/IkCalendar/iking-web-ui-pro.css +1 -1
  23. package/dist/IkCalendar/package.json +5 -0
  24. package/dist/IkCollapseCard/ik.index.cjs.js +1 -0
  25. package/dist/IkCollapseCard/package.json +5 -0
  26. package/dist/IkCurrencyInput/ik.index.cjs.js +1 -0
  27. package/dist/IkCurrencyInput/package.json +5 -0
  28. package/dist/IkDescription/ik.index.cjs.js +228 -0
  29. package/dist/IkDescription/ik.index.es.js +466 -457
  30. package/dist/IkDescription/iking-web-ui-pro.css +1 -1
  31. package/dist/IkDescription/package.json +5 -0
  32. package/dist/IkDetailPreviewFiles/ik.index.cjs.js +228 -0
  33. package/dist/IkDetailPreviewFiles/ik.index.es.js +5 -1
  34. package/dist/IkDetailPreviewFiles/package.json +5 -0
  35. package/dist/IkDragList/ik.index.cjs.js +1 -0
  36. package/dist/IkDragList/package.json +5 -0
  37. package/dist/IkEmpty/ik.index.cjs.js +1 -0
  38. package/dist/IkEmpty/package.json +5 -0
  39. package/dist/IkExpandCollapse/ik.index.cjs.js +1 -0
  40. package/dist/IkExpandCollapse/package.json +5 -0
  41. package/dist/IkFileIcon/ik.index.cjs.js +1 -0
  42. package/dist/IkFileIcon/package.json +5 -0
  43. package/dist/IkHorizontalStepBar/ik.index.cjs.js +1 -0
  44. package/dist/IkHorizontalStepBar/package.json +7 -0
  45. package/dist/IkIconPicker/ik.index.cjs.js +1 -0
  46. package/dist/IkIconPicker/package.json +5 -0
  47. package/dist/IkImageEditor/ik.index.cjs.js +1 -0
  48. package/dist/IkImageEditor/ik.index.es.js +13 -12
  49. package/dist/IkImageEditor/package.json +5 -0
  50. package/dist/IkImageUploadEditor/ik.index.cjs.js +33 -0
  51. package/dist/IkImageUploadEditor/ik.index.es.js +1 -1
  52. package/dist/IkImageUploadEditor/iking-web-ui-pro.css +2 -2
  53. package/dist/IkImageUploadEditor/package.json +5 -0
  54. package/dist/IkImageViewer/ik.index.cjs.js +1 -0
  55. package/dist/IkImageViewer/package.json +5 -0
  56. package/dist/IkMonacoEditor/ik.index.cjs.js +11 -0
  57. package/dist/IkMonacoEditor/package.json +5 -0
  58. package/dist/IkOnlyOffice/ik.index.cjs.js +1 -0
  59. package/dist/IkOnlyOffice/package.json +5 -0
  60. package/dist/IkPage/ik.index.cjs.js +1 -0
  61. package/dist/IkPage/package.json +5 -0
  62. package/dist/IkPageFull/ik.index.cjs.js +17 -0
  63. package/dist/IkPageFull/ik.index.es.js +5 -1
  64. package/dist/IkPageFull/package.json +5 -0
  65. package/dist/IkPageTabs/ik.index.cjs.js +1 -0
  66. package/dist/IkPageTabs/package.json +5 -0
  67. package/dist/IkPickerUser/ik.index.cjs.js +1 -0
  68. package/dist/IkPickerUser/ik.index.es.js +249 -245
  69. package/dist/IkPickerUser/package.json +5 -0
  70. package/dist/IkPlayer/ik.index.cjs.js +226 -0
  71. package/dist/IkPlayer/ik.index.es.js +5 -1
  72. package/dist/IkPlayer/package.json +5 -0
  73. package/dist/IkPreviewFile/ik.index.cjs.js +228 -0
  74. package/dist/IkPreviewFile/ik.index.es.js +5 -1
  75. package/dist/IkPreviewFile/package.json +5 -0
  76. package/dist/IkPreviewFileDialog/ik.index.cjs.js +228 -0
  77. package/dist/IkPreviewFileDialog/ik.index.es.js +5 -1
  78. package/dist/IkPreviewFileDialog/package.json +5 -0
  79. package/dist/IkPrint/html2canvas.esm-C4Mnoizn.js +22 -0
  80. package/dist/IkPrint/ik.index.cjs.js +145 -0
  81. package/dist/IkPrint/index.es-BMhBUwqb.js +18 -0
  82. package/dist/IkPrint/jspdf.es.min-BH6PQjtb.js +193 -0
  83. package/dist/IkPrint/package.json +5 -0
  84. package/dist/IkPrint/purify.es-8WZbZdhR.js +2 -0
  85. package/dist/IkPrintConfig/ik.index.cjs.js +1 -0
  86. package/dist/IkPrintConfig/package.json +5 -0
  87. package/dist/IkPrintView/ik.index.cjs.js +1 -0
  88. package/dist/IkPrintView/package.json +5 -0
  89. package/dist/IkRadioGroup/ik.index.cjs.js +1 -0
  90. package/dist/IkRadioGroup/package.json +5 -0
  91. package/dist/IkSearch/ik.index.cjs.js +26 -0
  92. package/dist/IkSearch/ik.index.es.js +46 -42
  93. package/dist/IkSearch/package.json +5 -0
  94. package/dist/IkSearchHead/ik.index.cjs.js +1 -0
  95. package/dist/IkSearchHead/package.json +5 -0
  96. package/dist/IkSelectTag/ik.index.cjs.js +1 -0
  97. package/dist/IkSelectTag/package.json +5 -0
  98. package/dist/IkSideText/ik.index.cjs.js +1 -0
  99. package/dist/IkSideText/package.json +5 -0
  100. package/dist/IkStatu/ik.index.cjs.js +1 -0
  101. package/dist/IkStatu/package.json +5 -0
  102. package/dist/IkStatuOver/ik.index.cjs.js +1 -0
  103. package/dist/IkStatuOver/package.json +5 -0
  104. package/dist/IkSvgIcon/ik.index.cjs.js +1 -0
  105. package/dist/IkSvgIcon/package.json +5 -0
  106. package/dist/IkTemplateOfficeConfig/ik.index.cjs.js +1 -0
  107. package/dist/IkTemplateOfficeConfig/package.json +5 -0
  108. package/dist/IkTinymce/ik.index.cjs.js +102 -0
  109. package/dist/IkTinymce/package.json +5 -0
  110. package/dist/IkTooltip/ik.index.cjs.js +1 -0
  111. package/dist/IkTooltip/package.json +5 -0
  112. package/dist/IkTree/ik.index.cjs.js +1 -0
  113. package/dist/IkTree/package.json +5 -0
  114. package/dist/IkUploadFile/ik.index.cjs.js +228 -0
  115. package/dist/IkUploadFile/ik.index.es.js +6 -2
  116. package/dist/IkUploadFile/iking-web-ui-pro.css +1 -1
  117. package/dist/IkUploadFile/package.json +5 -0
  118. package/dist/IkUploadImage/ik.index.cjs.js +1 -0
  119. package/dist/IkUploadImage/package.json +5 -0
  120. package/dist/IkVerticalStepBar/ik.index.cjs.js +1 -0
  121. package/dist/IkVerticalStepBar/ik.index.es.js +1 -1
  122. package/dist/IkVerticalStepBar/iking-web-ui-pro.css +1 -1
  123. package/dist/IkVerticalStepBar/package.json +7 -0
  124. package/dist/Provider/ik.index.cjs.js +1 -0
  125. package/dist/Provider/package.json +5 -0
  126. package/dist/html2canvas.esm-C4Mnoizn.js +22 -0
  127. package/dist/iking-web-ui-pro.css +2 -2
  128. package/dist/{index-B7k0MBYs.mjs → index-Ead_HYDP.mjs} +2311 -2302
  129. package/dist/index-WKZ7ZkxJ.js +556 -0
  130. package/dist/index.cjs.js +1 -0
  131. package/dist/{index.es-x4V15FUC.mjs → index.es-B7kIaWOa.mjs} +2 -2
  132. package/dist/index.es-CFaOiLhV.js +18 -0
  133. package/dist/index.es.js +1 -1
  134. package/dist/jspdf.es.min-ByZc3B2w.js +193 -0
  135. package/dist/{jspdf.es.min-Dw0HwXiw.mjs → jspdf.es.min-qkJb9M2W.mjs} +1 -1
  136. package/dist/purify.es-8WZbZdhR.js +2 -0
  137. package/dist/{src → types/src}/utils/index.d.ts +1 -0
  138. package/dist/types/src/utils/use-cleanup.d.ts +12 -0
  139. package/dist/types/src/utils/use-provider.d.ts +15 -0
  140. package/package.json +14 -7
  141. package/dist/index.umd.js +0 -787
  142. package/dist/src/utils/use-provider.d.ts +0 -9
  143. package/dist/{src → types/src}/components/Demo/index.d.ts +0 -0
  144. package/dist/{src → types/src}/components/IkApprovalProcess/index.d.ts +0 -0
  145. package/dist/{src → types/src}/components/IkApprovalProcess/src/IkApprovalProcess.vue.d.ts +0 -0
  146. package/dist/{src → types/src}/components/IkApprovalProcessDetail/index.d.ts +0 -0
  147. package/dist/{src → types/src}/components/IkApprovalProcessDetail/src/IkApprovalProcessDetail.vue.d.ts +0 -0
  148. package/dist/{src → types/src}/components/IkAutoCard/index.d.ts +0 -0
  149. package/dist/{src → types/src}/components/IkAutoCard/src/IkAutoCard.vue.d.ts +0 -0
  150. package/dist/{src → types/src}/components/IkBaseDialog/index.d.ts +0 -0
  151. package/dist/{src → types/src}/components/IkBaseDialog/src/CloseIcon.vue.d.ts +0 -0
  152. package/dist/{src → types/src}/components/IkBaseDialog/src/IkBaseDialog.vue.d.ts +0 -0
  153. package/dist/{src → types/src}/components/IkBottomOperate/index.d.ts +0 -0
  154. package/dist/{src → types/src}/components/IkBottomOperate/src/IkBottomOperate.vue.d.ts +0 -0
  155. package/dist/{src → types/src}/components/IkBtnContent/index.d.ts +0 -0
  156. package/dist/{src → types/src}/components/IkBtnContent/src/index.d.ts +0 -0
  157. package/dist/{src → types/src}/components/IkBtnSetting/index.d.ts +0 -0
  158. package/dist/{src → types/src}/components/IkBtnSetting/src/IkBtnSetting.vue.d.ts +0 -0
  159. package/dist/{src → types/src}/components/IkCalendar/event-utils.d.ts +0 -0
  160. package/dist/{src → types/src}/components/IkCalendar/index.d.ts +0 -0
  161. package/dist/{src → types/src}/components/IkCalendar/src/IkCalendar.vue.d.ts +0 -0
  162. package/dist/{src → types/src}/components/IkCollapseCard/index.d.ts +0 -0
  163. package/dist/{src → types/src}/components/IkCollapseCard/src/index.vue.d.ts +0 -0
  164. package/dist/{src → types/src}/components/IkCurrencyInput/index.d.ts +0 -0
  165. package/dist/{src → types/src}/components/IkCurrencyInput/src/IkCurrencyInput.vue.d.ts +0 -0
  166. package/dist/{src → types/src}/components/IkDescription/index.d.ts +0 -0
  167. package/dist/{src → types/src}/components/IkDescription/src/IkDescription.vue.d.ts +0 -0
  168. package/dist/{src → types/src}/components/IkDetailPreviewFiles/index.d.ts +0 -0
  169. package/dist/{src → types/src}/components/IkDetailPreviewFiles/src/IkDetailPreviewFiles.vue.d.ts +0 -0
  170. package/dist/{src → types/src}/components/IkDragList/index.d.ts +0 -0
  171. package/dist/{src → types/src}/components/IkDragList/src/IkDragList.vue.d.ts +0 -0
  172. package/dist/{src → types/src}/components/IkDragList/src/default-props.d.ts +0 -0
  173. package/dist/{src → types/src}/components/IkEmpty/index.d.ts +0 -0
  174. package/dist/{src → types/src}/components/IkEmpty/src/index.vue.d.ts +0 -0
  175. package/dist/{src → types/src}/components/IkExpandCollapse/index.d.ts +0 -0
  176. package/dist/{src → types/src}/components/IkExpandCollapse/src/IkExpandCollapse.vue.d.ts +0 -0
  177. package/dist/{src → types/src}/components/IkFileIcon/index.d.ts +0 -0
  178. package/dist/{src → types/src}/components/IkFileIcon/src/IkFileIcon.vue.d.ts +0 -0
  179. package/dist/{src → types/src}/components/IkHorizontalStepBar/index.d.ts +0 -0
  180. package/dist/{src → types/src}/components/IkHorizontalStepBar/src/IkHorizontalStepBar.vue.d.ts +0 -0
  181. package/dist/{src → types/src}/components/IkIconPicker/index.d.ts +0 -0
  182. package/dist/{src → types/src}/components/IkIconPicker/src/index.vue.d.ts +0 -0
  183. package/dist/{src → types/src}/components/IkImageEditor/index.d.ts +0 -0
  184. package/dist/{src → types/src}/components/IkImageUploadEditor/index.d.ts +0 -0
  185. package/dist/{src → types/src}/components/IkImageUploadEditor/src/IkImageUploadEditor.vue.d.ts +0 -0
  186. package/dist/{src → types/src}/components/IkImageViewer/index.d.ts +0 -0
  187. package/dist/{src → types/src}/components/IkImageViewer/src/IkImageViewer.vue.d.ts +0 -0
  188. package/dist/{src → types/src}/components/IkImageViewer/src/image-viewer.d.ts +0 -0
  189. package/dist/{src → types/src}/components/IkMonacoEditor/index.d.ts +0 -0
  190. package/dist/{src → types/src}/components/IkMonacoEditor/src/editor-config.d.ts +0 -0
  191. package/dist/{src → types/src}/components/IkMonacoEditor/src/index.vue.d.ts +0 -0
  192. package/dist/{src → types/src}/components/IkOnlyOffice/index.d.ts +0 -0
  193. package/dist/{src → types/src}/components/IkOnlyOffice/src/IkOnlyOffice.vue.d.ts +0 -0
  194. package/dist/{src → types/src}/components/IkPage/index.d.ts +0 -0
  195. package/dist/{src → types/src}/components/IkPageFull/index.d.ts +0 -0
  196. package/dist/{src → types/src}/components/IkPageFull/src/IkDialog.d.ts +0 -0
  197. package/dist/{src → types/src}/components/IkPageFull/src/IkPage.vue.d.ts +0 -0
  198. package/dist/{src → types/src}/components/IkPageFull/src/IkPageHead.vue.d.ts +0 -0
  199. package/dist/{src → types/src}/components/IkPageFull/src/IkPageTable.vue.d.ts +0 -0
  200. package/dist/{src → types/src}/components/IkPageFull/src/IkSearchAuto.d.ts +0 -0
  201. package/dist/{src → types/src}/components/IkPageFull/src/index.vue.d.ts +0 -0
  202. package/dist/{src → types/src}/components/IkPageFull/src/props.d.ts +0 -0
  203. package/dist/{src → types/src}/components/IkPageFull/src/search.d.ts +0 -0
  204. package/dist/{src → types/src}/components/IkPageTabs/index.d.ts +0 -0
  205. package/dist/{src → types/src}/components/IkPageTabs/src/IkPageTabs.vue.d.ts +0 -0
  206. package/dist/{src → types/src}/components/IkPickerUser/index.d.ts +0 -0
  207. package/dist/{src → types/src}/components/IkPickerUser/src/avatar/Avatar.vue.d.ts +0 -0
  208. package/dist/{src → types/src}/components/IkPickerUser/src/default.d.ts +0 -0
  209. package/dist/{src → types/src}/components/IkPickerUser/src/list/GroupList.vue.d.ts +0 -0
  210. package/dist/{src → types/src}/components/IkPickerUser/src/list/PostList.vue.d.ts +0 -0
  211. package/dist/{src → types/src}/components/IkPickerUser/src/list/RoleList.vue.d.ts +0 -0
  212. package/dist/{src → types/src}/components/IkPickerUser/src/list/props.d.ts +0 -0
  213. package/dist/{src → types/src}/components/IkPickerUser/src/list/utils.d.ts +0 -0
  214. package/dist/{src → types/src}/components/IkPickerUser/src/picker.vue.d.ts +0 -0
  215. package/dist/{src → types/src}/components/IkPickerUser/src/svg/close_svg.vue.d.ts +0 -0
  216. package/dist/{src → types/src}/components/IkPickerUser/src/svg/group_svg.vue.d.ts +0 -0
  217. package/dist/{src → types/src}/components/IkPickerUser/src/svg/post_svg.vue.d.ts +0 -0
  218. package/dist/{src → types/src}/components/IkPickerUser/src/svg/role_svg.vue.d.ts +0 -0
  219. package/dist/{src → types/src}/components/IkPickerUser/src/svg/search_svg.vue.d.ts +0 -0
  220. package/dist/{src → types/src}/components/IkPickerUser/src/use-picker-data.d.ts +0 -0
  221. package/dist/{src → types/src}/components/IkPickerUser/types.d.ts +0 -0
  222. package/dist/{src → types/src}/components/IkPlayer/index.d.ts +0 -0
  223. package/dist/{src → types/src}/components/IkPlayer/src/Player.vue.d.ts +0 -0
  224. package/dist/{src → types/src}/components/IkPreviewFile/index.d.ts +0 -0
  225. package/dist/{src → types/src}/components/IkPreviewFile/src/IkPreviewFile.vue.d.ts +0 -0
  226. package/dist/{src → types/src}/components/IkPreviewFileDialog/index.d.ts +0 -0
  227. package/dist/{src → types/src}/components/IkPreviewFileDialog/src/IkPreviewFileDialog.vue.d.ts +0 -0
  228. package/dist/{src → types/src}/components/IkPrint/IkPrint.vue.d.ts +0 -0
  229. package/dist/{src → types/src}/components/IkPrint/index.d.ts +0 -0
  230. package/dist/{src → types/src}/components/IkPrintConfig/index.d.ts +0 -0
  231. package/dist/{src → types/src}/components/IkPrintConfig/src/IkPrintConfig.vue.d.ts +0 -0
  232. package/dist/{src → types/src}/components/IkPrintView/index.d.ts +0 -0
  233. package/dist/{src → types/src}/components/IkRadioGroup/index.d.ts +0 -0
  234. package/dist/{src → types/src}/components/IkRadioGroup/src/index.vue.d.ts +0 -0
  235. package/dist/{src → types/src}/components/IkSearch/index.d.ts +0 -0
  236. package/dist/{src → types/src}/components/IkSearch/src/IkSearch.vue.d.ts +0 -0
  237. package/dist/{src → types/src}/components/IkSearch/src/IkSearchAuto.d.ts +0 -0
  238. package/dist/{src → types/src}/components/IkSearch/src/index.d.ts +0 -0
  239. package/dist/{src → types/src}/components/IkSearchHead/index.d.ts +0 -0
  240. package/dist/{src → types/src}/components/IkSearchHead/src/IkSearchHead.vue.d.ts +0 -0
  241. package/dist/{src → types/src}/components/IkSelectTag/index.d.ts +0 -0
  242. package/dist/{src → types/src}/components/IkSelectTag/src/index.vue.d.ts +0 -0
  243. package/dist/{src → types/src}/components/IkSideText/IkLinearIcon.vue.d.ts +0 -0
  244. package/dist/{src → types/src}/components/IkSideText/IkSideText.vue.d.ts +0 -0
  245. package/dist/{src → types/src}/components/IkSideText/index.d.ts +0 -0
  246. package/dist/{src → types/src}/components/IkSideText/useLinear.d.ts +0 -0
  247. package/dist/{src → types/src}/components/IkStatu/index.d.ts +0 -0
  248. package/dist/{src → types/src}/components/IkStatu/src/index.vue.d.ts +0 -0
  249. package/dist/{src → types/src}/components/IkStatuOver/index.d.ts +0 -0
  250. package/dist/{src → types/src}/components/IkStatuOver/src/index.vue.d.ts +0 -0
  251. package/dist/{src → types/src}/components/IkSvgIcon/index.d.ts +0 -0
  252. package/dist/{src → types/src}/components/IkSvgIcon/src/index.vue.d.ts +0 -0
  253. package/dist/{src → types/src}/components/IkTemplateOfficeConfig/index.d.ts +0 -0
  254. package/dist/{src → types/src}/components/IkTemplateOfficeConfig/src/IkTemplateOfficeConfig.vue.d.ts +0 -0
  255. package/dist/{src → types/src}/components/IkTemplateOfficeConfig/src/templateOfficeData.vue.d.ts +0 -0
  256. package/dist/{src → types/src}/components/IkTinymce/index.d.ts +0 -0
  257. package/dist/{src → types/src}/components/IkTinymce/src/index.vue.d.ts +0 -0
  258. package/dist/{src → types/src}/components/IkTooltip/index.d.ts +0 -0
  259. package/dist/{src → types/src}/components/IkTooltip/src/index.vue.d.ts +0 -0
  260. package/dist/{src → types/src}/components/IkTree/IkTree.vue.d.ts +0 -0
  261. package/dist/{src → types/src}/components/IkTree/index.d.ts +0 -0
  262. package/dist/{src → types/src}/components/IkUploadFile/index.d.ts +3 -3
  263. package/dist/{src → types/src}/components/IkUploadFile/src/index.vue.d.ts +1 -1
  264. package/dist/{src → types/src}/components/IkUploadFile/src/utils.d.ts +0 -0
  265. package/dist/{src → types/src}/components/IkUploadImage/index.d.ts +3 -3
  266. package/dist/{src → types/src}/components/IkUploadImage/src/index.vue.d.ts +1 -1
  267. package/dist/{src → types/src}/components/IkUploadImage/src/loading.vue.d.ts +0 -0
  268. package/dist/{src → types/src}/components/IkVerticalStepBar/index.d.ts +0 -0
  269. package/dist/{src → types/src}/components/IkVerticalStepBar/src/IkVerticalStepBar.vue.d.ts +0 -0
  270. package/dist/{src → types/src}/components/Provider/ProviderConfig.vue.d.ts +1 -1
  271. package/dist/{src → types/src}/components/Provider/index.d.ts +3 -3
  272. /package/dist/{src → types/src}/components/index.d.ts +0 -0
  273. /package/dist/{src → types/src}/enum/search.d.ts +0 -0
  274. /package/dist/{src → types/src}/iking-ui/component.d.ts +0 -0
  275. /package/dist/{src → types/src}/iking-ui/defaults.d.ts +0 -0
  276. /package/dist/{src → types/src}/iking-ui/index.d.ts +0 -0
  277. /package/dist/{src → types/src}/iking-ui/make-installer.d.ts +0 -0
  278. /package/dist/{src → types/src}/utils/approval.d.ts +0 -0
  279. /package/dist/{src → types/src}/utils/file.d.ts +0 -0
  280. /package/dist/{src → types/src}/utils/install.d.ts +0 -0
  281. /package/dist/{src → types/src}/utils/math.d.ts +0 -0
  282. /package/dist/{src → types/src}/utils/object.d.ts +0 -0
  283. /package/dist/{src → types/src}/utils/theme.d.ts +0 -0
  284. /package/dist/{src → types/src}/utils/typescript.d.ts +0 -0
@@ -0,0 +1,228 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("vue"),Ae=require("iking-utils-pro"),J=require("element-plus"),Je=(s,a)=>(s.install=n=>{for(const t of[s,...Object.values({})])n.component(t.name,t)},s),cr=(s,a)=>{if(!a)return"";const n=/(\/api\/server\/oss\/download\?fileUrl=)(.*)(\/api\/server\/oss\/download\?fileUrl=)/;return a.startsWith("http")?a.replace(n,"$1$2"):`${s||location.origin}${a}`.replace(n,"$1$2")},$r=(s,a)=>{var i,r,o,u;const n=(i=s==null?void 0:s.response)!=null&&i.data?Yr((o=(r=s==null?void 0:s.response)==null?void 0:r.data)==null?void 0:o.suffix):((u=s.raw)==null?void 0:u.type)||Yr(s[a.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 l in e)if(typeof t=="string"&&(t.includes(l)||t===l))return e[l];return"unknown"},qu={".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"},Yr=s=>{const a=s==null?void 0:s.toLocaleLowerCase(),n=a!=null&&a.startsWith(".")?a:`.${a}`;return n&&qu[n]||"unknow"},zu=s=>{let a="",n=["doc","docx"],t=["xls","xlsx"],e=["ppt","pptx"],i=["pdf"];return n.includes(s)&&(a="word"),t.includes(s)&&(a="cell"),e.includes(s)&&(a="slide"),i.includes(s)&&(a="text-pdf"),a};/*! Element Plus Icons Vue v2.3.1 */var Gu=d.defineComponent({name:"ArrowLeft",__name:"arrow-left",setup(s){return(a,n)=>(d.openBlock(),d.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d.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"})]))}}),Wu=Gu,Ku=d.defineComponent({name:"ArrowRight",__name:"arrow-right",setup(s){return(a,n)=>(d.openBlock(),d.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d.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"})]))}}),$u=Ku,Yu=d.defineComponent({name:"Close",__name:"close",setup(s){return(a,n)=>(d.openBlock(),d.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d.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"})]))}}),Fo=Yu,Xu=d.defineComponent({name:"FullScreen",__name:"full-screen",setup(s){return(a,n)=>(d.openBlock(),d.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d.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"})]))}}),Zu=Xu,Ju=d.defineComponent({name:"RefreshLeft",__name:"refresh-left",setup(s){return(a,n)=>(d.openBlock(),d.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d.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"})]))}}),Qu=Ju,el=d.defineComponent({name:"RefreshRight",__name:"refresh-right",setup(s){return(a,n)=>(d.openBlock(),d.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d.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"})]))}}),tl=el,il=d.defineComponent({name:"ScaleToOriginal",__name:"scale-to-original",setup(s){return(a,n)=>(d.openBlock(),d.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d.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"})]))}}),nl=il,rl=d.defineComponent({name:"ZoomIn",__name:"zoom-in",setup(s){return(a,n)=>(d.openBlock(),d.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d.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"})]))}}),al=rl,sl=d.defineComponent({name:"ZoomOut",__name:"zoom-out",setup(s){return(a,n)=>(d.openBlock(),d.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d.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"})]))}}),ol=sl;const yr=(s,a)=>{const n=s.__vccOpts||s;for(const[t,e]of a)n[t]=e;return n},Xr=["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"],ul=s=>{const a=d.inject("loadUrl"),n=d.computed(()=>s.loadUrl||s.fileUrl||(a==null?void 0:a.value)),t=d.inject("uploadUrl"),e=d.computed(()=>s.action||s.uploadUrl||(t==null?void 0:t.value)),i=d.inject("token"),r=d.computed(()=>s.token||(i==null?void 0:i.value)),o=d.inject("onlyofficeConfig"),u=d.computed(()=>s.onlyofficeConfig||(o==null?void 0:o.value)),l=d.inject("userInfo"),c=d.computed(()=>s.userInfo||(l==null?void 0:l.value)),f=[...Xr,...Xr.map(g=>g.toLocaleUpperCase())];return{cLoadUrl:n,cUploadUrl:e,cToken:r,cOnlyofficeConfig:u,cUserInfo:c,cOnlyofficePreviewType:f}};function _r(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}const ll={key:1,class:"h-[1em] w-[1em]","aria-hidden":"true"},cl=["xlink:href"],fl=["src"],hl={key:1,class:"h-[1em] w-[1em]","aria-hidden":"true"},dl=["xlink:href"],gl=["src"],pl=d.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(s,{emit:a}){const n=s,t=d.computed(()=>n),e=d.computed(()=>{const{name:f}=t.value;return/^http?:\/\//.test(f)?"img":/i-[^:]+:[^:]+/.test(f)?"unocss":f!=null&&f.startsWith("iksig")?"iksig":f!=null&&f.includes(":")?"iconify":f!=null&&f.startsWith("iksvg")?"svg":"i"}),i=d.computed(()=>{const f=[];if(t.value.flip)switch(t.value.flip){case"horizontal":f.push("rotateY(180deg)");break;case"vertical":f.push("rotateX(180deg)");break;case"both":f.push("rotateX(180deg)"),f.push("rotateY(180deg)");break}t.value.rotate&&f.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},...f.length&&{transform:f.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||Ae.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=a,o=f=>{r("click",f)},u=f=>{r("mouseenter",f)},l=f=>{r("mouseleave",f)},c=f=>{r("dblclick",f)};return(f,g)=>{const p=d.resolveComponent("el-tooltip"),v=d.resolveComponent("el-button");return d.openBlock(),d.createElementBlock("i",{class:d.normalizeClass(["ik-svg-icon ik-icon relative h-[1em] w-[1em] inline-flex items-center justify-center fill-current leading-[1em] transition",{[s.iconClass]:!0,[s.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:s.success||t.value.type==="success",error:t.value.error||t.value.type==="error",active:t.value.active,disabled:t.value.disabled}]),style:d.normalizeStyle(i.value),onClick:o,onDblclick:c,onMouseenter:u,onMouseleave:l},[t.value.tableIconType==="icon"||!t.value.tableIconType?(d.openBlock(),d.createElementBlock(d.Fragment,{key:0},[t.value.notip||!t.value.title?(d.openBlock(),d.createElementBlock(d.Fragment,{key:0},[e.value==="iksig"?(d.openBlock(),d.createElementBlock("i",{key:0,class:d.normalizeClass(`iksig ${t.value.name}`)},null,2)):e.value==="svg"?(d.openBlock(),d.createElementBlock("svg",ll,[d.createElementVNode("use",{"xlink:href":`#${t.value.name}`},null,8,cl)])):e.value==="img"?(d.openBlock(),d.createElementBlock("img",{key:2,src:t.value.name,class:"h-[1em] w-[1em]"},null,8,fl)):(d.openBlock(),d.createElementBlock("i",{key:3,class:d.normalizeClass(t.value.name)},null,2))],64)):(d.openBlock(),d.createBlock(p,{key:1,content:t.value.title,placement:"top","popper-class":"ik-svg-icon-tooltip","hide-after":0},{default:d.withCtx(()=>[e.value==="iksig"?(d.openBlock(),d.createElementBlock("i",{key:0,class:d.normalizeClass(`iksig ${t.value.name}`)},null,2)):e.value==="svg"?(d.openBlock(),d.createElementBlock("svg",hl,[d.createElementVNode("use",{"xlink:href":`#${t.value.name}`},null,8,dl)])):e.value==="img"?(d.openBlock(),d.createElementBlock("img",{key:2,src:t.value.name,class:"h-[1em] w-[1em]"},null,8,gl)):(d.openBlock(),d.createElementBlock("i",{key:3,class:d.normalizeClass(t.value.name)},null,2))]),_:1},8,["content"]))],64)):(d.openBlock(),d.createBlock(v,d.mergeProps({key:1},f.$attrs,{type:["warning","error"].includes(t.value.type)?"danger":""}),{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(t.value.title),1)]),_:1},16,["type"]))],38)}}}),vl=yr(pl,[["__scopeId","data-v-d5c74053"]]),ml=Je(vl),yl=d.defineComponent({__name:"CloseIcon",props:{showBg:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1}},setup(s){return(a,n)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass({"exit-main-page-maximize":s.showBg&&s.fullscreen})},[d.createVNode(d.unref(ml),{name:"iksvg_guanbidanchuang",error:"",title:"关闭",size:20})],2))}}),_l=yr(yl,[["__scopeId","data-v-22f2afe8"]]),Cl={class:"base-header"},bl=d.defineComponent({__name:"IkBaseDialog",props:d.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(s){const a=s,n=d.useModel(s,"modelValue"),t=d.ref(a.fullscreen),e=d.defineComponent({setup(){return()=>d.h(_l,{showBg:a.showCloseBg,fullscreen:a.fullscreen})}});return(i,r)=>{const o=d.resolveComponent("el-dialog");return d.openBlock(),d.createBlock(o,d.mergeProps({modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=u=>n.value=u),"align-center":""},i.$attrs,{"close-icon":d.unref(e),class:`ik-base-dialog ${s.noHeader?"no-header":""} ${s.noFooter?"no-footer":""}`,fullscreen:t.value,"modal-class":"baseDialog"}),d.createSlots({icon:d.withCtx(()=>[d.renderSlot(i.$slots,"title",{},()=>[d.createTextVNode(d.toDisplayString(s.title),1)])]),header:d.withCtx(()=>[d.createElementVNode("div",Cl,[d.renderSlot(i.$slots,"header",{},()=>[d.createTextVNode(d.toDisplayString(s.title),1)])]),d.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:d.withCtx(()=>[d.renderSlot(i.$slots,"default")]),_:2},[i.$slots.footer?{name:"footer",fn:d.withCtx(()=>[d.renderSlot(i.$slots,"footer")]),key:"0"}:void 0]),1040,["modelValue","close-icon","class","fullscreen"])}}}),kl=Je(bl);function Tl(s,a,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 o(c){try{l(t.next(c))}catch(f){r(f)}}function u(c){try{l(t.throw(c))}catch(f){r(f)}}function l(c){c.done?i(c.value):e(c.value).then(o,u)}l((t=t.apply(s,[])).next())})}function wl(s,a){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=o(0),r.throw=o(1),r.return=o(2),typeof Symbol=="function"&&(r[Symbol.iterator]=function(){return this}),r;function o(l){return function(c){return u([l,c])}}function u(l){if(t)throw new TypeError("Generator is already executing.");for(;r&&(r=0,l[0]&&(n=0)),n;)try{if(t=1,e&&(i=l[0]&2?e.return:l[0]?e.throw||((i=e.return)&&i.call(e),0):e.next)&&!(i=i.call(e,l[1])).done)return i;switch(e=0,i&&(l=[l[0]&2,i.value]),l[0]){case 0:case 1:i=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,e=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]<i[3])){n.label=l[1];break}if(l[0]===6&&n.label<i[1]){n.label=i[1],i=l;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(l);break}i[2]&&n.ops.pop(),n.trys.pop();continue}l=a.call(s,n)}catch(c){l=[6,c],e=0}finally{t=i=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var El=function(s,a){return Tl(void 0,void 0,void 0,function(){return wl(this,function(n){return[2,new Promise(function(t,e){try{if(window.DocsAPI)return t(null);var i=document.getElementById(a);if(i)var r=setInterval(function(){var u=i.getAttribute("loading");if(!u){if(clearInterval(r),window.DocsAPI)return t(null);var l=Zr(a,s,t,e);i.remove(),document.body.appendChild(l)}},500);else{var o=Zr(a,s,t,e);document.body.appendChild(o)}}catch(u){console.error(u)}})]})})},Zr=function(s,a,n,t){var e=document.createElement("script");return e.id=s,e.type="text/javascript",e.src=a,e.async=!0,e.onload=function(){e.removeAttribute("loading"),n(null)},e.onerror=function(i){e.removeAttribute("loading"),t(i)},e.setAttribute("loading",""),e},kt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Sl(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Xt,Jr;function xl(){if(Jr)return Xt;Jr=1;function s(){this.__data__=[],this.size=0}return Xt=s,Xt}var Zt,Qr;function Bo(){if(Qr)return Zt;Qr=1;function s(a,n){return a===n||a!==a&&n!==n}return Zt=s,Zt}var Jt,ea;function Ht(){if(ea)return Jt;ea=1;var s=Bo();function a(n,t){for(var e=n.length;e--;)if(s(n[e][0],t))return e;return-1}return Jt=a,Jt}var Qt,ta;function Il(){if(ta)return Qt;ta=1;var s=Ht(),a=Array.prototype,n=a.splice;function t(e){var i=this.__data__,r=s(i,e);if(r<0)return!1;var o=i.length-1;return r==o?i.pop():n.call(i,r,1),--this.size,!0}return Qt=t,Qt}var ei,ia;function Pl(){if(ia)return ei;ia=1;var s=Ht();function a(n){var t=this.__data__,e=s(t,n);return e<0?void 0:t[e][1]}return ei=a,ei}var ti,na;function Al(){if(na)return ti;na=1;var s=Ht();function a(n){return s(this.__data__,n)>-1}return ti=a,ti}var ii,ra;function Ll(){if(ra)return ii;ra=1;var s=Ht();function a(n,t){var e=this.__data__,i=s(e,n);return i<0?(++this.size,e.push([n,t])):e[i][1]=t,this}return ii=a,ii}var ni,aa;function Ut(){if(aa)return ni;aa=1;var s=xl(),a=Il(),n=Pl(),t=Al(),e=Ll();function i(r){var o=-1,u=r==null?0:r.length;for(this.clear();++o<u;){var l=r[o];this.set(l[0],l[1])}}return i.prototype.clear=s,i.prototype.delete=a,i.prototype.get=n,i.prototype.has=t,i.prototype.set=e,ni=i,ni}var ri,sa;function Dl(){if(sa)return ri;sa=1;var s=Ut();function a(){this.__data__=new s,this.size=0}return ri=a,ri}var ai,oa;function Rl(){if(oa)return ai;oa=1;function s(a){var n=this.__data__,t=n.delete(a);return this.size=n.size,t}return ai=s,ai}var si,ua;function Ol(){if(ua)return si;ua=1;function s(a){return this.__data__.get(a)}return si=s,si}var oi,la;function Ml(){if(la)return oi;la=1;function s(a){return this.__data__.has(a)}return oi=s,oi}var ui,ca;function Ho(){if(ca)return ui;ca=1;var s=typeof kt=="object"&&kt&&kt.Object===Object&&kt;return ui=s,ui}var li,fa;function me(){if(fa)return li;fa=1;var s=Ho(),a=typeof self=="object"&&self&&self.Object===Object&&self,n=s||a||Function("return this")();return li=n,li}var ci,ha;function Cr(){if(ha)return ci;ha=1;var s=me(),a=s.Symbol;return ci=a,ci}var fi,da;function Nl(){if(da)return fi;da=1;var s=Cr(),a=Object.prototype,n=a.hasOwnProperty,t=a.toString,e=s?s.toStringTag:void 0;function i(r){var o=n.call(r,e),u=r[e];try{r[e]=void 0;var l=!0}catch{}var c=t.call(r);return l&&(o?r[e]=u:delete r[e]),c}return fi=i,fi}var hi,ga;function Fl(){if(ga)return hi;ga=1;var s=Object.prototype,a=s.toString;function n(t){return a.call(t)}return hi=n,hi}var di,pa;function jt(){if(pa)return di;pa=1;var s=Cr(),a=Nl(),n=Fl(),t="[object Null]",e="[object Undefined]",i=s?s.toStringTag:void 0;function r(o){return o==null?o===void 0?e:t:i&&i in Object(o)?a(o):n(o)}return di=r,di}var gi,va;function lt(){if(va)return gi;va=1;function s(a){var n=typeof a;return a!=null&&(n=="object"||n=="function")}return gi=s,gi}var pi,ma;function Uo(){if(ma)return pi;ma=1;var s=jt(),a=lt(),n="[object AsyncFunction]",t="[object Function]",e="[object GeneratorFunction]",i="[object Proxy]";function r(o){if(!a(o))return!1;var u=s(o);return u==t||u==e||u==n||u==i}return pi=r,pi}var vi,ya;function Bl(){if(ya)return vi;ya=1;var s=me(),a=s["__core-js_shared__"];return vi=a,vi}var mi,_a;function Hl(){if(_a)return mi;_a=1;var s=Bl(),a=(function(){var t=/[^.]+$/.exec(s&&s.keys&&s.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function n(t){return!!a&&a in t}return mi=n,mi}var yi,Ca;function jo(){if(Ca)return yi;Ca=1;var s=Function.prototype,a=s.toString;function n(t){if(t!=null){try{return a.call(t)}catch{}try{return t+""}catch{}}return""}return yi=n,yi}var _i,ba;function Ul(){if(ba)return _i;ba=1;var s=Uo(),a=Hl(),n=lt(),t=jo(),e=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,r=Function.prototype,o=Object.prototype,u=r.toString,l=o.hasOwnProperty,c=RegExp("^"+u.call(l).replace(e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f(g){if(!n(g)||a(g))return!1;var p=s(g)?c:i;return p.test(t(g))}return _i=f,_i}var Ci,ka;function jl(){if(ka)return Ci;ka=1;function s(a,n){return a==null?void 0:a[n]}return Ci=s,Ci}var bi,Ta;function Be(){if(Ta)return bi;Ta=1;var s=Ul(),a=jl();function n(t,e){var i=a(t,e);return s(i)?i:void 0}return bi=n,bi}var ki,wa;function br(){if(wa)return ki;wa=1;var s=Be(),a=me(),n=s(a,"Map");return ki=n,ki}var Ti,Ea;function Vt(){if(Ea)return Ti;Ea=1;var s=Be(),a=s(Object,"create");return Ti=a,Ti}var wi,Sa;function Vl(){if(Sa)return wi;Sa=1;var s=Vt();function a(){this.__data__=s?s(null):{},this.size=0}return wi=a,wi}var Ei,xa;function ql(){if(xa)return Ei;xa=1;function s(a){var n=this.has(a)&&delete this.__data__[a];return this.size-=n?1:0,n}return Ei=s,Ei}var Si,Ia;function zl(){if(Ia)return Si;Ia=1;var s=Vt(),a="__lodash_hash_undefined__",n=Object.prototype,t=n.hasOwnProperty;function e(i){var r=this.__data__;if(s){var o=r[i];return o===a?void 0:o}return t.call(r,i)?r[i]:void 0}return Si=e,Si}var xi,Pa;function Gl(){if(Pa)return xi;Pa=1;var s=Vt(),a=Object.prototype,n=a.hasOwnProperty;function t(e){var i=this.__data__;return s?i[e]!==void 0:n.call(i,e)}return xi=t,xi}var Ii,Aa;function Wl(){if(Aa)return Ii;Aa=1;var s=Vt(),a="__lodash_hash_undefined__";function n(t,e){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=s&&e===void 0?a:e,this}return Ii=n,Ii}var Pi,La;function Kl(){if(La)return Pi;La=1;var s=Vl(),a=ql(),n=zl(),t=Gl(),e=Wl();function i(r){var o=-1,u=r==null?0:r.length;for(this.clear();++o<u;){var l=r[o];this.set(l[0],l[1])}}return i.prototype.clear=s,i.prototype.delete=a,i.prototype.get=n,i.prototype.has=t,i.prototype.set=e,Pi=i,Pi}var Ai,Da;function $l(){if(Da)return Ai;Da=1;var s=Kl(),a=Ut(),n=br();function t(){this.size=0,this.__data__={hash:new s,map:new(n||a),string:new s}}return Ai=t,Ai}var Li,Ra;function Yl(){if(Ra)return Li;Ra=1;function s(a){var n=typeof a;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?a!=="__proto__":a===null}return Li=s,Li}var Di,Oa;function qt(){if(Oa)return Di;Oa=1;var s=Yl();function a(n,t){var e=n.__data__;return s(t)?e[typeof t=="string"?"string":"hash"]:e.map}return Di=a,Di}var Ri,Ma;function Xl(){if(Ma)return Ri;Ma=1;var s=qt();function a(n){var t=s(this,n).delete(n);return this.size-=t?1:0,t}return Ri=a,Ri}var Oi,Na;function Zl(){if(Na)return Oi;Na=1;var s=qt();function a(n){return s(this,n).get(n)}return Oi=a,Oi}var Mi,Fa;function Jl(){if(Fa)return Mi;Fa=1;var s=qt();function a(n){return s(this,n).has(n)}return Mi=a,Mi}var Ni,Ba;function Ql(){if(Ba)return Ni;Ba=1;var s=qt();function a(n,t){var e=s(this,n),i=e.size;return e.set(n,t),this.size+=e.size==i?0:1,this}return Ni=a,Ni}var Fi,Ha;function ec(){if(Ha)return Fi;Ha=1;var s=$l(),a=Xl(),n=Zl(),t=Jl(),e=Ql();function i(r){var o=-1,u=r==null?0:r.length;for(this.clear();++o<u;){var l=r[o];this.set(l[0],l[1])}}return i.prototype.clear=s,i.prototype.delete=a,i.prototype.get=n,i.prototype.has=t,i.prototype.set=e,Fi=i,Fi}var Bi,Ua;function tc(){if(Ua)return Bi;Ua=1;var s=Ut(),a=br(),n=ec(),t=200;function e(i,r){var o=this.__data__;if(o instanceof s){var u=o.__data__;if(!a||u.length<t-1)return u.push([i,r]),this.size=++o.size,this;o=this.__data__=new n(u)}return o.set(i,r),this.size=o.size,this}return Bi=e,Bi}var Hi,ja;function ic(){if(ja)return Hi;ja=1;var s=Ut(),a=Dl(),n=Rl(),t=Ol(),e=Ml(),i=tc();function r(o){var u=this.__data__=new s(o);this.size=u.size}return r.prototype.clear=a,r.prototype.delete=n,r.prototype.get=t,r.prototype.has=e,r.prototype.set=i,Hi=r,Hi}var Ui,Va;function nc(){if(Va)return Ui;Va=1;function s(a,n){for(var t=-1,e=a==null?0:a.length;++t<e&&n(a[t],t,a)!==!1;);return a}return Ui=s,Ui}var ji,qa;function rc(){if(qa)return ji;qa=1;var s=Be(),a=(function(){try{var n=s(Object,"defineProperty");return n({},"",{}),n}catch{}})();return ji=a,ji}var Vi,za;function Vo(){if(za)return Vi;za=1;var s=rc();function a(n,t,e){t=="__proto__"&&s?s(n,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):n[t]=e}return Vi=a,Vi}var qi,Ga;function qo(){if(Ga)return qi;Ga=1;var s=Vo(),a=Bo(),n=Object.prototype,t=n.hasOwnProperty;function e(i,r,o){var u=i[r];(!(t.call(i,r)&&a(u,o))||o===void 0&&!(r in i))&&s(i,r,o)}return qi=e,qi}var zi,Wa;function zt(){if(Wa)return zi;Wa=1;var s=qo(),a=Vo();function n(t,e,i,r){var o=!i;i||(i={});for(var u=-1,l=e.length;++u<l;){var c=e[u],f=r?r(i[c],t[c],c,i,t):void 0;f===void 0&&(f=t[c]),o?a(i,c,f):s(i,c,f)}return i}return zi=n,zi}var Gi,Ka;function ac(){if(Ka)return Gi;Ka=1;function s(a,n){for(var t=-1,e=Array(a);++t<a;)e[t]=n(t);return e}return Gi=s,Gi}var Wi,$a;function ct(){if($a)return Wi;$a=1;function s(a){return a!=null&&typeof a=="object"}return Wi=s,Wi}var Ki,Ya;function sc(){if(Ya)return Ki;Ya=1;var s=jt(),a=ct(),n="[object Arguments]";function t(e){return a(e)&&s(e)==n}return Ki=t,Ki}var $i,Xa;function oc(){if(Xa)return $i;Xa=1;var s=sc(),a=ct(),n=Object.prototype,t=n.hasOwnProperty,e=n.propertyIsEnumerable,i=s((function(){return arguments})())?s:function(r){return a(r)&&t.call(r,"callee")&&!e.call(r,"callee")};return $i=i,$i}var Yi,Za;function kr(){if(Za)return Yi;Za=1;var s=Array.isArray;return Yi=s,Yi}var rt={exports:{}},Xi,Ja;function uc(){if(Ja)return Xi;Ja=1;function s(){return!1}return Xi=s,Xi}rt.exports;var Qa;function zo(){return Qa||(Qa=1,(function(s,a){var n=me(),t=uc(),e=a&&!a.nodeType&&a,i=e&&!0&&s&&!s.nodeType&&s,r=i&&i.exports===e,o=r?n.Buffer:void 0,u=o?o.isBuffer:void 0,l=u||t;s.exports=l})(rt,rt.exports)),rt.exports}var Zi,es;function lc(){if(es)return Zi;es=1;var s=9007199254740991,a=/^(?:0|[1-9]\d*)$/;function n(t,e){var i=typeof t;return e=e??s,!!e&&(i=="number"||i!="symbol"&&a.test(t))&&t>-1&&t%1==0&&t<e}return Zi=n,Zi}var Ji,ts;function Go(){if(ts)return Ji;ts=1;var s=9007199254740991;function a(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=s}return Ji=a,Ji}var Qi,is;function cc(){if(is)return Qi;is=1;var s=jt(),a=Go(),n=ct(),t="[object Arguments]",e="[object Array]",i="[object Boolean]",r="[object Date]",o="[object Error]",u="[object Function]",l="[object Map]",c="[object Number]",f="[object Object]",g="[object RegExp]",p="[object Set]",v="[object String]",y="[object WeakMap]",m="[object ArrayBuffer]",T="[object DataView]",b="[object Float32Array]",k="[object Float64Array]",E="[object Int8Array]",I="[object Int16Array]",R="[object Int32Array]",O="[object Uint8Array]",G="[object Uint8ClampedArray]",H="[object Uint16Array]",M="[object Uint32Array]",P={};P[b]=P[k]=P[E]=P[I]=P[R]=P[O]=P[G]=P[H]=P[M]=!0,P[t]=P[e]=P[m]=P[i]=P[T]=P[r]=P[o]=P[u]=P[l]=P[c]=P[f]=P[g]=P[p]=P[v]=P[y]=!1;function Y(Z){return n(Z)&&a(Z.length)&&!!P[s(Z)]}return Qi=Y,Qi}var en,ns;function Tr(){if(ns)return en;ns=1;function s(a){return function(n){return a(n)}}return en=s,en}var at={exports:{}};at.exports;var rs;function wr(){return rs||(rs=1,(function(s,a){var n=Ho(),t=a&&!a.nodeType&&a,e=t&&!0&&s&&!s.nodeType&&s,i=e&&e.exports===t,r=i&&n.process,o=(function(){try{var u=e&&e.require&&e.require("util").types;return u||r&&r.binding&&r.binding("util")}catch{}})();s.exports=o})(at,at.exports)),at.exports}var tn,as;function fc(){if(as)return tn;as=1;var s=cc(),a=Tr(),n=wr(),t=n&&n.isTypedArray,e=t?a(t):s;return tn=e,tn}var nn,ss;function Wo(){if(ss)return nn;ss=1;var s=ac(),a=oc(),n=kr(),t=zo(),e=lc(),i=fc(),r=Object.prototype,o=r.hasOwnProperty;function u(l,c){var f=n(l),g=!f&&a(l),p=!f&&!g&&t(l),v=!f&&!g&&!p&&i(l),y=f||g||p||v,m=y?s(l.length,String):[],T=m.length;for(var b in l)(c||o.call(l,b))&&!(y&&(b=="length"||p&&(b=="offset"||b=="parent")||v&&(b=="buffer"||b=="byteLength"||b=="byteOffset")||e(b,T)))&&m.push(b);return m}return nn=u,nn}var rn,os;function Er(){if(os)return rn;os=1;var s=Object.prototype;function a(n){var t=n&&n.constructor,e=typeof t=="function"&&t.prototype||s;return n===e}return rn=a,rn}var an,us;function Ko(){if(us)return an;us=1;function s(a,n){return function(t){return a(n(t))}}return an=s,an}var sn,ls;function hc(){if(ls)return sn;ls=1;var s=Ko(),a=s(Object.keys,Object);return sn=a,sn}var on,cs;function dc(){if(cs)return on;cs=1;var s=Er(),a=hc(),n=Object.prototype,t=n.hasOwnProperty;function e(i){if(!s(i))return a(i);var r=[];for(var o in Object(i))t.call(i,o)&&o!="constructor"&&r.push(o);return r}return on=e,on}var un,fs;function $o(){if(fs)return un;fs=1;var s=Uo(),a=Go();function n(t){return t!=null&&a(t.length)&&!s(t)}return un=n,un}var ln,hs;function Sr(){if(hs)return ln;hs=1;var s=Wo(),a=dc(),n=$o();function t(e){return n(e)?s(e):a(e)}return ln=t,ln}var cn,ds;function gc(){if(ds)return cn;ds=1;var s=zt(),a=Sr();function n(t,e){return t&&s(e,a(e),t)}return cn=n,cn}var fn,gs;function pc(){if(gs)return fn;gs=1;function s(a){var n=[];if(a!=null)for(var t in Object(a))n.push(t);return n}return fn=s,fn}var hn,ps;function vc(){if(ps)return hn;ps=1;var s=lt(),a=Er(),n=pc(),t=Object.prototype,e=t.hasOwnProperty;function i(r){if(!s(r))return n(r);var o=a(r),u=[];for(var l in r)l=="constructor"&&(o||!e.call(r,l))||u.push(l);return u}return hn=i,hn}var dn,vs;function xr(){if(vs)return dn;vs=1;var s=Wo(),a=vc(),n=$o();function t(e){return n(e)?s(e,!0):a(e)}return dn=t,dn}var gn,ms;function mc(){if(ms)return gn;ms=1;var s=zt(),a=xr();function n(t,e){return t&&s(e,a(e),t)}return gn=n,gn}var st={exports:{}};st.exports;var ys;function yc(){return ys||(ys=1,(function(s,a){var n=me(),t=a&&!a.nodeType&&a,e=t&&!0&&s&&!s.nodeType&&s,i=e&&e.exports===t,r=i?n.Buffer:void 0,o=r?r.allocUnsafe:void 0;function u(l,c){if(c)return l.slice();var f=l.length,g=o?o(f):new l.constructor(f);return l.copy(g),g}s.exports=u})(st,st.exports)),st.exports}var pn,_s;function _c(){if(_s)return pn;_s=1;function s(a,n){var t=-1,e=a.length;for(n||(n=Array(e));++t<e;)n[t]=a[t];return n}return pn=s,pn}var vn,Cs;function Cc(){if(Cs)return vn;Cs=1;function s(a,n){for(var t=-1,e=a==null?0:a.length,i=0,r=[];++t<e;){var o=a[t];n(o,t,a)&&(r[i++]=o)}return r}return vn=s,vn}var mn,bs;function Yo(){if(bs)return mn;bs=1;function s(){return[]}return mn=s,mn}var yn,ks;function Ir(){if(ks)return yn;ks=1;var s=Cc(),a=Yo(),n=Object.prototype,t=n.propertyIsEnumerable,e=Object.getOwnPropertySymbols,i=e?function(r){return r==null?[]:(r=Object(r),s(e(r),function(o){return t.call(r,o)}))}:a;return yn=i,yn}var _n,Ts;function bc(){if(Ts)return _n;Ts=1;var s=zt(),a=Ir();function n(t,e){return s(t,a(t),e)}return _n=n,_n}var Cn,ws;function Xo(){if(ws)return Cn;ws=1;function s(a,n){for(var t=-1,e=n.length,i=a.length;++t<e;)a[i+t]=n[t];return a}return Cn=s,Cn}var bn,Es;function Zo(){if(Es)return bn;Es=1;var s=Ko(),a=s(Object.getPrototypeOf,Object);return bn=a,bn}var kn,Ss;function Jo(){if(Ss)return kn;Ss=1;var s=Xo(),a=Zo(),n=Ir(),t=Yo(),e=Object.getOwnPropertySymbols,i=e?function(r){for(var o=[];r;)s(o,n(r)),r=a(r);return o}:t;return kn=i,kn}var Tn,xs;function kc(){if(xs)return Tn;xs=1;var s=zt(),a=Jo();function n(t,e){return s(t,a(t),e)}return Tn=n,Tn}var wn,Is;function Qo(){if(Is)return wn;Is=1;var s=Xo(),a=kr();function n(t,e,i){var r=e(t);return a(t)?r:s(r,i(t))}return wn=n,wn}var En,Ps;function Tc(){if(Ps)return En;Ps=1;var s=Qo(),a=Ir(),n=Sr();function t(e){return s(e,n,a)}return En=t,En}var Sn,As;function wc(){if(As)return Sn;As=1;var s=Qo(),a=Jo(),n=xr();function t(e){return s(e,n,a)}return Sn=t,Sn}var xn,Ls;function Ec(){if(Ls)return xn;Ls=1;var s=Be(),a=me(),n=s(a,"DataView");return xn=n,xn}var In,Ds;function Sc(){if(Ds)return In;Ds=1;var s=Be(),a=me(),n=s(a,"Promise");return In=n,In}var Pn,Rs;function xc(){if(Rs)return Pn;Rs=1;var s=Be(),a=me(),n=s(a,"Set");return Pn=n,Pn}var An,Os;function Ic(){if(Os)return An;Os=1;var s=Be(),a=me(),n=s(a,"WeakMap");return An=n,An}var Ln,Ms;function Pr(){if(Ms)return Ln;Ms=1;var s=Ec(),a=br(),n=Sc(),t=xc(),e=Ic(),i=jt(),r=jo(),o="[object Map]",u="[object Object]",l="[object Promise]",c="[object Set]",f="[object WeakMap]",g="[object DataView]",p=r(s),v=r(a),y=r(n),m=r(t),T=r(e),b=i;return(s&&b(new s(new ArrayBuffer(1)))!=g||a&&b(new a)!=o||n&&b(n.resolve())!=l||t&&b(new t)!=c||e&&b(new e)!=f)&&(b=function(k){var E=i(k),I=E==u?k.constructor:void 0,R=I?r(I):"";if(R)switch(R){case p:return g;case v:return o;case y:return l;case m:return c;case T:return f}return E}),Ln=b,Ln}var Dn,Ns;function Pc(){if(Ns)return Dn;Ns=1;var s=Object.prototype,a=s.hasOwnProperty;function n(t){var e=t.length,i=new t.constructor(e);return e&&typeof t[0]=="string"&&a.call(t,"index")&&(i.index=t.index,i.input=t.input),i}return Dn=n,Dn}var Rn,Fs;function Ac(){if(Fs)return Rn;Fs=1;var s=me(),a=s.Uint8Array;return Rn=a,Rn}var On,Bs;function Ar(){if(Bs)return On;Bs=1;var s=Ac();function a(n){var t=new n.constructor(n.byteLength);return new s(t).set(new s(n)),t}return On=a,On}var Mn,Hs;function Lc(){if(Hs)return Mn;Hs=1;var s=Ar();function a(n,t){var e=t?s(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.byteLength)}return Mn=a,Mn}var Nn,Us;function Dc(){if(Us)return Nn;Us=1;var s=/\w*$/;function a(n){var t=new n.constructor(n.source,s.exec(n));return t.lastIndex=n.lastIndex,t}return Nn=a,Nn}var Fn,js;function Rc(){if(js)return Fn;js=1;var s=Cr(),a=s?s.prototype:void 0,n=a?a.valueOf:void 0;function t(e){return n?Object(n.call(e)):{}}return Fn=t,Fn}var Bn,Vs;function Oc(){if(Vs)return Bn;Vs=1;var s=Ar();function a(n,t){var e=t?s(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.length)}return Bn=a,Bn}var Hn,qs;function Mc(){if(qs)return Hn;qs=1;var s=Ar(),a=Lc(),n=Dc(),t=Rc(),e=Oc(),i="[object Boolean]",r="[object Date]",o="[object Map]",u="[object Number]",l="[object RegExp]",c="[object Set]",f="[object String]",g="[object Symbol]",p="[object ArrayBuffer]",v="[object DataView]",y="[object Float32Array]",m="[object Float64Array]",T="[object Int8Array]",b="[object Int16Array]",k="[object Int32Array]",E="[object Uint8Array]",I="[object Uint8ClampedArray]",R="[object Uint16Array]",O="[object Uint32Array]";function G(H,M,P){var Y=H.constructor;switch(M){case p:return s(H);case i:case r:return new Y(+H);case v:return a(H,P);case y:case m:case T:case b:case k:case E:case I:case R:case O:return e(H,P);case o:return new Y;case u:case f:return new Y(H);case l:return n(H);case c:return new Y;case g:return t(H)}}return Hn=G,Hn}var Un,zs;function Nc(){if(zs)return Un;zs=1;var s=lt(),a=Object.create,n=(function(){function t(){}return function(e){if(!s(e))return{};if(a)return a(e);t.prototype=e;var i=new t;return t.prototype=void 0,i}})();return Un=n,Un}var jn,Gs;function Fc(){if(Gs)return jn;Gs=1;var s=Nc(),a=Zo(),n=Er();function t(e){return typeof e.constructor=="function"&&!n(e)?s(a(e)):{}}return jn=t,jn}var Vn,Ws;function Bc(){if(Ws)return Vn;Ws=1;var s=Pr(),a=ct(),n="[object Map]";function t(e){return a(e)&&s(e)==n}return Vn=t,Vn}var qn,Ks;function Hc(){if(Ks)return qn;Ks=1;var s=Bc(),a=Tr(),n=wr(),t=n&&n.isMap,e=t?a(t):s;return qn=e,qn}var zn,$s;function Uc(){if($s)return zn;$s=1;var s=Pr(),a=ct(),n="[object Set]";function t(e){return a(e)&&s(e)==n}return zn=t,zn}var Gn,Ys;function jc(){if(Ys)return Gn;Ys=1;var s=Uc(),a=Tr(),n=wr(),t=n&&n.isSet,e=t?a(t):s;return Gn=e,Gn}var Wn,Xs;function Vc(){if(Xs)return Wn;Xs=1;var s=ic(),a=nc(),n=qo(),t=gc(),e=mc(),i=yc(),r=_c(),o=bc(),u=kc(),l=Tc(),c=wc(),f=Pr(),g=Pc(),p=Mc(),v=Fc(),y=kr(),m=zo(),T=Hc(),b=lt(),k=jc(),E=Sr(),I=xr(),R=1,O=2,G=4,H="[object Arguments]",M="[object Array]",P="[object Boolean]",Y="[object Date]",Z="[object Error]",le="[object Function]",dt="[object GeneratorFunction]",gt="[object Map]",et="[object Number]",tt="[object Object]",pt="[object RegExp]",ye="[object Set]",N="[object String]",V="[object Symbol]",$="[object WeakMap]",ae="[object ArrayBuffer]",ce="[object DataView]",fe="[object Float32Array]",de="[object Float64Array]",Oe="[object Int8Array]",vt="[object Int16Array]",mt="[object Int32Array]",it="[object Uint8Array]",Fu="[object Uint8ClampedArray]",Bu="[object Uint16Array]",Hu="[object Uint32Array]",W={};W[H]=W[M]=W[ae]=W[ce]=W[P]=W[Y]=W[fe]=W[de]=W[Oe]=W[vt]=W[mt]=W[gt]=W[et]=W[tt]=W[pt]=W[ye]=W[N]=W[V]=W[it]=W[Fu]=W[Bu]=W[Hu]=!0,W[Z]=W[le]=W[$]=!1;function yt(z,Ve,qe,Uu,_t,we){var ne,Ct=Ve&R,bt=Ve&O,ju=Ve&G;if(qe&&(ne=_t?qe(z,Uu,_t,we):qe(z)),ne!==void 0)return ne;if(!b(z))return z;var zr=y(z);if(zr){if(ne=g(z),!Ct)return r(z,ne)}else{var ze=f(z),Gr=ze==le||ze==dt;if(m(z))return i(z,Ct);if(ze==tt||ze==H||Gr&&!_t){if(ne=bt||Gr?{}:v(z),!Ct)return bt?u(z,e(ne,z)):o(z,t(ne,z))}else{if(!W[ze])return _t?z:{};ne=p(z,ze,Ct)}}we||(we=new s);var Wr=we.get(z);if(Wr)return Wr;we.set(z,ne),k(z)?z.forEach(function(Ee){ne.add(yt(Ee,Ve,qe,Ee,z,we))}):T(z)&&z.forEach(function(Ee,Me){ne.set(Me,yt(Ee,Ve,qe,Me,z,we))});var Vu=ju?bt?c:l:bt?I:E,Kr=zr?void 0:Vu(z);return a(Kr||z,function(Ee,Me){Kr&&(Me=Ee,Ee=z[Me]),n(ne,Me,yt(Ee,Ve,qe,Me,z,we))}),ne}return Wn=yt,Wn}var Kn,Zs;function qc(){if(Zs)return Kn;Zs=1;var s=Vc(),a=1,n=4;function t(e){return s(e,a|n)}return Kn=t,Kn}var zc=qc(),Gc=Sl(zc),Lr=d.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 s=this,a,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((a=this.config.document)===null||a===void 0?void 0:a.key):t+="?shardkey=".concat(this.shardkey)),El(t,"onlyoffice-api-script").then(function(){return s.onLoad()}).catch(function(){s.onError(-2)})},unmounted:function(){var s,a=this.id||"";!((s=window==null?void 0:window.DocEditor)===null||s===void 0)&&s.instances[a]&&(window.DocEditor.instances[a].destroyEditor(),window.DocEditor.instances[a]=void 0)},watch:{config:{handler:function(s,a){this.onChangeProps()},deep:!0},document_fileType:function(s,a){this.onChangeProps()},document_title:function(s,a){this.onChangeProps()},documentType:function(s,a){this.onChangeProps()},editorConfig_lang:function(s,a){this.onChangeProps()},height:function(s,a){this.onChangeProps()},type:function(s,a){this.onChangeProps()},width:function(s,a){this.onChangeProps()}},methods:{onLoad:function(){var s,a;try{var n=this.id||"";if(window.DocsAPI||this.onError(-3),!((s=window==null?void 0:window.DocEditor)===null||s===void 0)&&s.instances[n]){console.log("Skip loading. Instance already exists",n);return}!((a=window==null?void 0:window.DocEditor)===null||a===void 0)&&a.instances||(window.DocEditor={instances:{}});var t=Gc(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 o=Object.assign(e,t||{}),u=window.DocsAPI.DocEditor(n,o);window.DocEditor.instances[n]=u}catch(l){console.error(l),this.onError(-1)}},getDocument:function(){var s=null;return this.document_fileType&&(s=s||{},s.fileType=this.document_fileType),this.document_title&&(s=s||{},s.document_title=this.document_title),s},getEditorConfig:function(){var s=null;return this.editorConfig_lang&&(s=s||{},s.lang=this.editorConfig_lang),s},onError:function(s){var a;switch(s){case-2:a="Error load DocsAPI from "+this.documentServerUrl;break;case-3:a="DocsAPI is not defined";break;default:a="Unknown error loading component",s=-1}typeof this.onLoadComponentError>"u"?console.error(a):this.onLoadComponentError(s,a)},onAppReady:function(){var s=this.id||"";this.events_onAppReady(window.DocEditor.instances[s])},onChangeProps:function(){var s,a=this.id||"";!((s=window==null?void 0:window.DocEditor)===null||s===void 0)&&s.instances[a]&&(window.DocEditor.instances[a].destroyEditor(),window.DocEditor.instances[a]=void 0,console.log("Important props have been changed. Load new Editor."),this.onLoad())}}});const Wc=["id"];function Kc(s,a,n,t,e,i){return d.openBlock(),d.createElementBlock("div",{id:s.id},null,8,Wc)}Lr.render=Kc;Lr.__file="src/components/DocumentEditor.vue";const $c=d.defineComponent({__name:"IkOnlyOffice",props:{documentServerUrl:{type:String,default:""},configOptions:{type:Object,default:()=>{}},officeHeight:{type:String,default:"100%"}},setup(s){const a=s,n=d.ref({width:"100%",height:"100%",...a.configOptions||{},...a.configOptions}),t=()=>{console.info("文档加载完成",n.value)};return(e,i)=>(d.openBlock(),d.createElementBlock("div",{style:d.normalizeStyle({height:a.officeHeight})},[d.createVNode(d.unref(Lr),{id:`${new Date().getTime()}`,ref:"editorRef","document-server-url":s.documentServerUrl,config:n.value,events_onDocumentReady:t},null,8,["id","document-server-url","config"])],4))}}),Yc=Je($c);var Js;const eu=typeof window<"u",Xc=s=>typeof s=="string",Zc=()=>{};eu&&((Js=window==null?void 0:window.navigator)!=null&&Js.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function tu(s){return typeof s=="function"?s():d.unref(s)}function Jc(s){return s}function Qc(s){return d.getCurrentScope()?(d.onScopeDispose(s),!0):!1}function ef(s){var a;const n=tu(s);return(a=n==null?void 0:n.$el)!=null?a:n}const tf=eu?window:void 0;function Tt(...s){let a,n,t,e;if(Xc(s[0])||Array.isArray(s[0])?([n,t,e]=s,a=tf):[a,n,t,e]=s,!a)return Zc;Array.isArray(n)||(n=[n]),Array.isArray(t)||(t=[t]);const i=[],r=()=>{i.forEach(c=>c()),i.length=0},o=(c,f,g,p)=>(c.addEventListener(f,g,p),()=>c.removeEventListener(f,g,p)),u=d.watch(()=>[ef(a),tu(e)],([c,f])=>{r(),c&&i.push(...n.flatMap(g=>t.map(p=>o(c,g,p,f))))},{immediate:!0,flush:"post"}),l=()=>{u(),r()};return Qc(l),l}const Qs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},eo="__vueuse_ssr_handlers__";Qs[eo]=Qs[eo]||{};var to;(function(s){s.UP="UP",s.RIGHT="RIGHT",s.DOWN="DOWN",s.LEFT="LEFT",s.NONE="NONE"})(to||(to={}));var nf=Object.defineProperty,io=Object.getOwnPropertySymbols,rf=Object.prototype.hasOwnProperty,af=Object.prototype.propertyIsEnumerable,no=(s,a,n)=>a in s?nf(s,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):s[a]=n,sf=(s,a)=>{for(var n in a||(a={}))rf.call(a,n)&&no(s,n,a[n]);if(io)for(var n of io(a))af.call(a,n)&&no(s,n,a[n]);return s};const of={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]};sf({linear:Jc},of);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",""]}},lf={close:()=>!0,switch:s=>Ae.paramType.isNumber(s),rotate:s=>Ae.paramType.isNumber(s)},cf=["src","crossorigin"],ff=d.defineComponent({name:"ElImageViewer",__name:"IkImageViewer",props:uf,emits:lf,setup(s,{expose:a,emit:n}){const t=N=>Object.keys(N),e={CONTAIN:{name:"contain",icon:d.markRaw(Zu)},ORIGINAL:{name:"original",icon:d.markRaw(nl)}},i=s,r=n,{t:o}=J.useLocale(),u=J.useNamespace("image-viewer"),{nextZIndex:l}=J.useZIndex(),c=d.ref(),f=d.ref([]),g=d.effectScope(),p=d.ref(!0),v=d.ref(i.initialIndex),y=d.shallowRef(e.CONTAIN),m=d.ref({scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}),T=d.ref(i.zIndex??l()),b=d.computed(()=>{const{urlList:N}=i;return N.length<=1}),k=d.computed(()=>v.value===0),E=d.computed(()=>v.value===i.urlList.length-1),I=d.computed(()=>i.urlList[v.value]),R=d.computed(()=>[u.e("btn"),u.e("prev"),u.is("disabled",!i.infinite&&k.value)]),O=d.computed(()=>[u.e("btn"),u.e("next"),u.is("disabled",!i.infinite&&E.value)]),G=d.computed(()=>{const{scale:N,deg:V,offsetX:$,offsetY:ae,enableTransition:ce}=m.value;let fe=$/N,de=ae/N;const Oe=V*Math.PI/180,vt=Math.cos(Oe),mt=Math.sin(Oe);fe=fe*vt+de*mt,de=de*vt-$/N*mt;const it={transform:`scale(${N}) rotate(${V}deg) translate(${fe}px, ${de}px)`,transition:ce?"transform .3s":""};return y.value.name===e.CONTAIN.name&&(it.maxWidth=it.maxHeight="100%"),it});function H(){P(),r("close")}function M(){const N=Ae._.throttle($=>{switch($.code){case J.EVENT_CODE.esc:i.closeOnPressEscape&&H();break;case J.EVENT_CODE.space:gt();break;case J.EVENT_CODE.left:tt();break;case J.EVENT_CODE.up:ye("zoomIn");break;case J.EVENT_CODE.right:pt();break;case J.EVENT_CODE.down:ye("zoomOut");break}}),V=Ae._.throttle($=>{const ae=$.deltaY||$.deltaX;ye(ae<0?"zoomIn":"zoomOut",{zoomRate:i.zoomRate,enableTransition:!1})});g.run(()=>{Tt(document,"keydown",N),Tt(document,"wheel",V)})}function P(){g.stop()}function Y(){p.value=!1}function Z(N){p.value=!1,N.target.alt=o("el.image.error")}function le(N){if(p.value||N.button!==0||!c.value)return;m.value.enableTransition=!1;const{offsetX:V,offsetY:$}=m.value,ae=N.pageX,ce=N.pageY,fe=Ae._.throttle(Oe=>{m.value={...m.value,offsetX:V+Oe.pageX-ae,offsetY:$+Oe.pageY-ce}}),de=Tt(document,"mousemove",fe);Tt(document,"mouseup",()=>{de()}),N.preventDefault()}function dt(){m.value={scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}}function gt(){if(p.value)return;const N=t(e),V=Object.values(e),$=y.value.name,ce=((V==null?void 0:V.findIndex(fe=>fe.name===$))+1)%N.length;y.value=e[N[ce]],dt()}function et(N){const V=i.urlList.length;v.value=(N+V)%V}function tt(){k.value&&!i.infinite||et(v.value-1)}function pt(){E.value&&!i.infinite||et(v.value+1)}function ye(N,V={}){if(p.value)return;const{minScale:$,maxScale:ae}=i,{zoomRate:ce,rotateDeg:fe,enableTransition:de}={zoomRate:i.zoomRate,rotateDeg:90,enableTransition:!0,...V};switch(N){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=de}return d.watch(I,()=>{d.nextTick(()=>{const N=f.value[0];N!=null&&N.complete||(p.value=!0)})}),d.watch(v,N=>{dt(),r("switch",N)}),d.onMounted(()=>{var N,V;M(),(V=(N=c.value)==null?void 0:N.focus)==null||V.call(N)}),a({setActiveItem:et}),(N,V)=>(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[d.createVNode(d.Transition,{name:"viewer-fade",appear:""},{default:d.withCtx(()=>[d.createElementVNode("div",{ref_key:"wrapper",ref:c,tabindex:-1,class:d.normalizeClass(d.unref(u).e("wrapper")),style:d.normalizeStyle({zIndex:T.value})},[d.createElementVNode("div",{class:d.normalizeClass(d.unref(u).e("mask")),onClick:V[0]||(V[0]=d.withModifiers($=>N.hideOnClickModal&&H(),["self"]))},null,2),d.createCommentVNode(" CLOSE "),d.createElementVNode("span",{class:d.normalizeClass([d.unref(u).e("btn"),d.unref(u).e("close")]),onClick:H},[d.createVNode(d.unref(J.ElIcon),null,{default:d.withCtx(()=>[d.createVNode(d.unref(Fo))]),_:1})],2),d.createCommentVNode(" ARROW "),b.value?d.createCommentVNode("v-if",!0):(d.openBlock(),d.createElementBlock(d.Fragment,{key:0},[d.createElementVNode("span",{class:d.normalizeClass(R.value),onClick:tt},[d.createVNode(d.unref(J.ElIcon),null,{default:d.withCtx(()=>[d.createVNode(d.unref(Wu))]),_:1})],2),d.createElementVNode("span",{class:d.normalizeClass(O.value),onClick:pt},[d.createVNode(d.unref(J.ElIcon),null,{default:d.withCtx(()=>[d.createVNode(d.unref($u))]),_:1})],2)],64)),d.createCommentVNode(" ACTIONS "),d.createElementVNode("div",{class:d.normalizeClass([d.unref(u).e("btn"),d.unref(u).e("actions")])},[d.createElementVNode("div",{class:d.normalizeClass(d.unref(u).e("actions__inner"))},[d.createVNode(d.unref(J.ElIcon),{onClick:V[1]||(V[1]=$=>ye("zoomOut"))},{default:d.withCtx(()=>[d.createVNode(d.unref(ol))]),_:1}),d.createVNode(d.unref(J.ElIcon),{onClick:V[2]||(V[2]=$=>ye("zoomIn"))},{default:d.withCtx(()=>[d.createVNode(d.unref(al))]),_:1}),d.createElementVNode("i",{class:d.normalizeClass(d.unref(u).e("actions__divider"))},null,2),d.createVNode(d.unref(J.ElIcon),{onClick:gt},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(y.value.icon)))]),_:1}),d.createElementVNode("i",{class:d.normalizeClass(d.unref(u).e("actions__divider"))},null,2),d.createVNode(d.unref(J.ElIcon),{onClick:V[3]||(V[3]=$=>ye("anticlockwise"))},{default:d.withCtx(()=>[d.createVNode(d.unref(Qu))]),_:1}),d.createVNode(d.unref(J.ElIcon),{onClick:V[4]||(V[4]=$=>ye("clockwise"))},{default:d.withCtx(()=>[d.createVNode(d.unref(tl))]),_:1})],2)],2),d.createCommentVNode(" CANVAS "),d.createElementVNode("div",{class:d.normalizeClass(d.unref(u).e("canvas"))},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(N.urlList,($,ae)=>d.withDirectives((d.openBlock(),d.createElementBlock("img",{ref_for:!0,ref:ce=>f.value[ae]=ce,key:$,src:$,style:d.normalizeStyle(G.value),class:d.normalizeClass(d.unref(u).e("img")),crossorigin:N.crossorigin,onLoad:Y,onError:Z,onMousedown:le},null,46,cf)),[[d.vShow,ae===v.value]])),128))],2),d.renderSlot(N.$slots,"default")],6)]),_:3})]))}}),hf=Je(ff);function ro(s,a){var n=Object.keys(s);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(s);a&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(s,e).enumerable})),n.push.apply(n,t)}return n}function X(s){for(var a=1;a<arguments.length;a++){var n=arguments[a]!=null?arguments[a]:{};a%2?ro(Object(n),!0).forEach(function(t){C(s,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(n)):ro(Object(n)).forEach(function(t){Object.defineProperty(s,t,Object.getOwnPropertyDescriptor(n,t))})}return s}function ie(s){"@babel/helpers - typeof";return ie=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},ie(s)}function S(s,a){if(!(s instanceof a))throw new TypeError("Cannot call a class as a function")}function ao(s,a){for(var n=0;n<a.length;n++){var t=a[n];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(s,iu(t.key),t)}}function x(s,a,n){return a&&ao(s.prototype,a),n&&ao(s,n),Object.defineProperty(s,"prototype",{writable:!1}),s}function C(s,a,n){return a=iu(a),a in s?Object.defineProperty(s,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):s[a]=n,s}function A(s,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(a&&a.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),Object.defineProperty(s,"prototype",{writable:!1}),a&&fr(s,a)}function D(s){return D=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},D(s)}function fr(s,a){return fr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},fr(s,a)}function df(){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 _(s){if(s===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s}function Dr(s,a){if(a&&(typeof a=="object"||typeof a=="function"))return a;if(a!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _(s)}function L(s){var a=df();return function(){var t=D(s),e;if(a){var i=D(this).constructor;e=Reflect.construct(t,arguments,i)}else e=t.apply(this,arguments);return Dr(this,e)}}function gf(s,a){for(;!Object.prototype.hasOwnProperty.call(s,a)&&(s=D(s),s!==null););return s}function F(){return typeof Reflect<"u"&&Reflect.get?F=Reflect.get.bind():F=function(a,n,t){var e=gf(a,n);if(e){var i=Object.getOwnPropertyDescriptor(e,n);return i.get?i.get.call(arguments.length<3?a:t):i.value}},F.apply(this,arguments)}function he(s){return pf(s)||vf(s)||mf(s)||yf()}function pf(s){if(Array.isArray(s))return hr(s)}function vf(s){if(typeof Symbol<"u"&&s[Symbol.iterator]!=null||s["@@iterator"]!=null)return Array.from(s)}function mf(s,a){if(s){if(typeof s=="string")return hr(s,a);var n=Object.prototype.toString.call(s).slice(8,-1);if(n==="Object"&&s.constructor&&(n=s.constructor.name),n==="Map"||n==="Set")return Array.from(s);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hr(s,a)}}function hr(s,a){(a==null||a>s.length)&&(a=s.length);for(var n=0,t=new Array(a);n<a;n++)t[n]=s[n];return t}function yf(){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 _f(s,a){if(typeof s!="object"||s===null)return s;var n=s[Symbol.toPrimitive];if(n!==void 0){var t=n.call(s,a);if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(s)}function iu(s){var a=_f(s,"string");return typeof a=="symbol"?a:String(a)}var $n={exports:{}},so;function Cf(){return so||(so=1,(function(s){var a=Object.prototype.hasOwnProperty,n="~";function t(){}Object.create&&(t.prototype=Object.create(null),new t().__proto__||(n=!1));function e(u,l,c){this.fn=u,this.context=l,this.once=c||!1}function i(u,l,c,f,g){if(typeof c!="function")throw new TypeError("The listener must be a function");var p=new e(c,f||u,g),v=n?n+l:l;return u._events[v]?u._events[v].fn?u._events[v]=[u._events[v],p]:u._events[v].push(p):(u._events[v]=p,u._eventsCount++),u}function r(u,l){--u._eventsCount===0?u._events=new t:delete u._events[l]}function o(){this._events=new t,this._eventsCount=0}o.prototype.eventNames=function(){var l=[],c,f;if(this._eventsCount===0)return l;for(f in c=this._events)a.call(c,f)&&l.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},o.prototype.listeners=function(l){var c=n?n+l:l,f=this._events[c];if(!f)return[];if(f.fn)return[f.fn];for(var g=0,p=f.length,v=new Array(p);g<p;g++)v[g]=f[g].fn;return v},o.prototype.listenerCount=function(l){var c=n?n+l:l,f=this._events[c];return f?f.fn?1:f.length:0},o.prototype.emit=function(l,c,f,g,p,v){var y=n?n+l:l;if(!this._events[y])return!1;var m=this._events[y],T=arguments.length,b,k;if(m.fn){switch(m.once&&this.removeListener(l,m.fn,void 0,!0),T){case 1:return m.fn.call(m.context),!0;case 2:return m.fn.call(m.context,c),!0;case 3:return m.fn.call(m.context,c,f),!0;case 4:return m.fn.call(m.context,c,f,g),!0;case 5:return m.fn.call(m.context,c,f,g,p),!0;case 6:return m.fn.call(m.context,c,f,g,p,v),!0}for(k=1,b=new Array(T-1);k<T;k++)b[k-1]=arguments[k];m.fn.apply(m.context,b)}else{var E=m.length,I;for(k=0;k<E;k++)switch(m[k].once&&this.removeListener(l,m[k].fn,void 0,!0),T){case 1:m[k].fn.call(m[k].context);break;case 2:m[k].fn.call(m[k].context,c);break;case 3:m[k].fn.call(m[k].context,c,f);break;case 4:m[k].fn.call(m[k].context,c,f,g);break;default:if(!b)for(I=1,b=new Array(T-1);I<T;I++)b[I-1]=arguments[I];m[k].fn.apply(m[k].context,b)}}return!0},o.prototype.on=function(l,c,f){return i(this,l,c,f,!1)},o.prototype.once=function(l,c,f){return i(this,l,c,f,!0)},o.prototype.removeListener=function(l,c,f,g){var p=n?n+l:l;if(!this._events[p])return this;if(!c)return r(this,p),this;var v=this._events[p];if(v.fn)v.fn===c&&(!g||v.once)&&(!f||v.context===f)&&r(this,p);else{for(var y=0,m=[],T=v.length;y<T;y++)(v[y].fn!==c||g&&!v[y].once||f&&v[y].context!==f)&&m.push(v[y]);m.length?this._events[p]=m.length===1?m[0]:m:r(this,p)}return this},o.prototype.removeAllListeners=function(l){var c;return l?(c=n?n+l:l,this._events[c]&&r(this,c)):(this._events=new t,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=n,o.EventEmitter=o,s.exports=o})($n)),$n.exports}var nu=Cf();const ru=_r(nu);var bf=typeof window<"u"&&window.location&&window.location.href.indexOf("xgplayerdebugger=1")>-1,Yn={info:"color: #525252; background-color: #90ee90;",error:"color: #525252; background-color: red;",warn:"color: #525252; background-color: yellow; "},Xn="%c[xgplayer]",U={config:{debug:bf?3:0},logInfo:function(a){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,[Xn,Yn.info,a].concat(e))},logWarn:function(a){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,[Xn,Yn.warn,a].concat(e))},logError:function(a){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,[Xn,Yn.error,a].concat(i))}}};function kf(s){s.logInfo=U.logInfo.bind(s),s.logWarn=U.logWarn.bind(s),s.logError=U.logError.bind(s)}var Tf=(function(){function s(a){S(this,s),this.bufferedList=a}return x(s,[{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}}]),s})(),h={};h.createDom=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"div",a=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(s);return e.className=t,e.innerHTML=a,Object.keys(n).forEach(function(i){var r=i,o=n[i];s==="video"||s==="audio"||s==="live-video"?o&&e.setAttribute(r,o):e.setAttribute(r,o)}),e};h.createDomFromHtml=function(s){var a=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=s;var e=t.children;return t=null,e.length>0?(e=e[0],n&&h.addClass(e,n),a&&Object.keys(a).forEach(function(i){e.setAttribute(i,a[i])}),e):null}catch(i){return U.logError("util.createDomFromHtml",i),null}};h.hasClass=function(s,a){if(!s||!a)return!1;try{return Array.prototype.some.call(s.classList,function(t){return t===a})}catch{var n=s.className&&ie(s.className)==="object"?s.getAttribute("class"):s.className;return n&&!!n.match(new RegExp("(\\s|^)"+a+"(\\s|$)"))}};h.addClass=function(s,a){if(!(!s||!a))try{a.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach(function(n){n&&s.classList.add(n)})}catch{h.hasClass(s,a)||(s.className&&ie(s.className)==="object"?s.setAttribute("class",s.getAttribute("class")+" "+a):s.className+=" "+a)}};h.removeClass=function(s,a){if(!(!s||!a))try{a.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach(function(n){n&&s.classList.remove(n)})}catch{h.hasClass(s,a)&&a.split(/\s+/g).forEach(function(t){var e=new RegExp("(\\s|^)"+t+"(\\s|$)");s.className&&ie(s.className)==="object"?s.setAttribute("class",s.getAttribute("class").replace(e," ")):s.className=s.className.replace(e," ")})}};h.toggleClass=function(s,a){s&&a.split(/\s+/g).forEach(function(n){h.hasClass(s,n)?h.removeClass(s,n):h.addClass(s,n)})};h.classNames=function(){for(var s=arguments,a=[],n=function(i){h.typeOf(s[i])==="String"?a.push(s[i]):h.typeOf(s[i])==="Object"&&Object.keys(s[i]).map(function(r){s[i][r]&&a.push(r)})},t=0;t<arguments.length;t++)n(t);return a.join(" ")};h.findDom=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,a=arguments.length>1?arguments[1]:void 0,n;try{n=s.querySelector(a)}catch(t){U.logError("util.findDom",t),a.indexOf("#")===0&&(n=s.getElementById(a.slice(1)))}return n};h.getCss=function(s,a){return s.currentStyle?s.currentStyle[a]:document.defaultView.getComputedStyle(s,!1)[a]};h.padStart=function(s,a,n){for(var t=String(n),e=a>>0,i=Math.ceil(e/t.length),r=[],o=String(s);i--;)r.push(t);return r.join("").substring(0,e-o.length)+o};h.format=function(s){if(window.isNaN(s))return"";s=Math.round(s);var a=h.padStart(Math.floor(s/3600),2,0),n=h.padStart(Math.floor((s-a*3600)/60),2,0),t=h.padStart(Math.floor(s-a*3600-n*60),2,0);return(a==="00"?[n,t]:[a,n,t]).join(":")};h.event=function(s){if(s.touches){var a=s.touches[0]||s.changedTouches[0];s.clientX=a.clientX||0,s.clientY=a.clientY||0,s.offsetX=a.pageX-a.target.offsetLeft,s.offsetY=a.pageY-a.target.offsetTop}s._target=s.target||s.srcElement};h.typeOf=function(s){return Object.prototype.toString.call(s).match(/([^\s.*]+)(?=]$)/g)[0]};h.deepCopy=function(s,a){if(h.typeOf(a)==="Object"&&h.typeOf(s)==="Object")return Object.keys(a).forEach(function(n){h.typeOf(a[n])==="Object"&&!(a[n]instanceof Node)?s[n]===void 0||s[n]===void 0?s[n]=a[n]:h.deepCopy(s[n],a[n]):h.typeOf(a[n])==="Array"?s[n]=h.typeOf(s[n])==="Array"?s[n].concat(a[n]):a[n]:s[n]=a[n]}),s};h.deepMerge=function(s,a){return Object.keys(a).map(function(n){if(h.typeOf(a[n])==="Array"&&h.typeOf(s[n])==="Array"){if(h.typeOf(s[n])==="Array"){var t;(t=s[n]).push.apply(t,he(a[n]))}}else h.typeOf(s[n])===h.typeOf(a[n])&&s[n]!==null&&h.typeOf(s[n])==="Object"&&!(a[n]instanceof window.Node)?h.deepMerge(s[n],a[n]):a[n]!==null&&(s[n]=a[n])}),s};h.getBgImage=function(s){var a=(s.currentStyle||window.getComputedStyle(s,null)).backgroundImage;if(!a||a==="none")return"";var n=document.createElement("a");return n.href=a.replace(/url\("|"\)/g,""),n.href};h.copyDom=function(s){if(s&&s.nodeType===1){var a=document.createElement(s.tagName);return Array.prototype.forEach.call(s.attributes,function(n){a.setAttribute(n.name,n.value)}),s.innerHTML&&(a.innerHTML=s.innerHTML),a}else return""};h.setInterval=function(s,a,n,t){s._interval[a]||(s._interval[a]=window.setInterval(n.bind(s),t))};h.clearInterval=function(s,a){clearInterval(s._interval[a]),s._interval[a]=null};h.setTimeout=function(s,a,n){s._timers||(s._timers=[]);var t=setTimeout(function(){a(),h.clearTimeout(s,t)},n);return s._timers.push(t),t};h.clearTimeout=function(s,a){var n=s._timers;if(h.typeOf(n)==="Array"){for(var t=0;t<n.length;t++)if(n[t]===a){n.splice(t,1),clearTimeout(a);break}}else clearTimeout(a)};h.clearAllTimers=function(s){var a=s._timers;h.typeOf(a)==="Array"&&(a.map(function(n){clearTimeout(n)}),s._timerIds=[])};h.createImgBtn=function(s,a,n,t){var e=h.createDom("xg-".concat(s),"",{},"xgplayer-".concat(s,"-img"));if(e.style.backgroundImage='url("'.concat(a,'")'),n&&t){var i,r,o;["px","rem","em","pt","dp","vw","vh","vm","%"].every(function(u){return n.indexOf(u)>-1&&t.indexOf(u)>-1?(i=parseFloat(n.slice(0,n.indexOf(u)).trim()),r=parseFloat(t.slice(0,t.indexOf(u)).trim()),o=u,!1):!0}),e.style.width="".concat(i).concat(o),e.style.height="".concat(r).concat(o),e.style.backgroundSize="".concat(i).concat(o," ").concat(r).concat(o),s==="start"?e.style.margin="-".concat(r/2).concat(o," auto auto -").concat(i/2).concat(o):e.style.margin="auto 5px auto 5px"}return e};h.Hex2RGBA=function(s,a){var n=[];if(/^\#[0-9A-F]{3}$/i.test(s)){var t="#";s.replace(/[0-9A-F]/ig,function(e){t+=e+e}),s=t}return/^#[0-9A-F]{6}$/i.test(s)?(s.replace(/[0-9A-F]{2}/ig,function(e){n.push(parseInt(e,16))}),"rgba(".concat(n.join(","),", ").concat(a,")")):"rgba(255, 255, 255, 0.1)"};h.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement};h.checkIsFunction=function(s){return s&&typeof s=="function"};h.checkIsObject=function(s){return s!==null&&ie(s)==="object"};h.hide=function(s){s.style.display="none"};h.show=function(s,a){s.style.display=a||"block"};h.isUndefined=function(s){if(typeof s>"u"||s===null)return!0};h.isNotNull=function(s){return s!=null};h.setStyleFromCsstext=function(s,a){if(a)if(h.typeOf(a)==="String"){var n=a.replace(/\s+/g,"").split(";");n.map(function(t){if(t){var e=t.split(":");e.length>1&&(s.style[e[0]]=e[1])}})}else Object.keys(a).map(function(t){s.style[t]=a[t]})};function wf(s,a){for(var n=0,t=a.length;n<t;n++)if(s.indexOf(a[n])>-1)return!0;return!1}h.filterStyleFromText=function(s){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["width","height","top","left","bottom","right","position","z-index","padding","margin","transform"],n=s.style.cssText;if(!n)return{};var t=n.replace(/\s+/g,"").split(";"),e={},i={};return t.map(function(r){if(r){var o=r.split(":");o.length>1&&(wf(o[0],a)?e[o[0]]=o[1]:i[o[0]]=o[1])}}),s.setAttribute("style",""),Object.keys(i).map(function(r){s.style[r]=i[r]}),e};h.getStyleFromCsstext=function(s){var a=s.style.cssText;if(!a)return{};var n=a.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};h.preloadImg=function(s){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){};if(s){var t=new window.Image;t.onload=function(e){t=null,a&&a(e)},t.onerror=function(e){t=null,n&&n(e)},t.src=s}};h.stopPropagation=function(s){s&&s.stopPropagation()};h.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0};h.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0};h.checkTouchSupport=function(){return"ontouchstart"in window};h.getBuffered2=function(s){for(var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:.5,n=[],t=0;t<s.length;t++)n.push({start:s.start(t)<.5?0:s.start(t),end:s.end(t)});n.sort(function(u,l){var c=u.start-l.start;return c||l.end-u.end});var e=[];if(a)for(var i=0;i<n.length;i++){var r=e.length;if(r){var o=e[r-1].end;n[i].start-o<a?n[i].end>o&&(e[r-1].end=n[i].end):e.push(n[i])}else e.push(n[i])}else e=n;return new Tf(e)};h.getEventPos=function(s){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return s.touches&&s.touches.length>0&&(s=s.touches[0]),{x:s.x/a,y:s.y/a,clientX:s.clientX/a,clientY:s.clientY/a,offsetX:s.offsetX/a,offsetY:s.offsetY/a,pageX:s.pageX/a,pageY:s.pageY/a}};h.requestAnimationFrame=function(s){var a=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(a)return a(s)};h.getHostFromUrl=function(s){if(h.typeOf(s)!=="String")return"";var a=s.split("/"),n="";return a.length>3&&a[2]&&(n=a[2]),n};h.cancelAnimationFrame=function(s){var a=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;a&&a(s)};h.isMSE=function(s){return s.media&&(s=s.media),!s||!(s instanceof HTMLMediaElement)?!1:/^blob/.test(s.currentSrc)||/^blob/.test(s.src)};h.isBlob=function(s){return typeof s=="string"&&/^blob/.test(s)};h.generateSessionId=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,a=new Date().getTime();try{s=parseInt(s)}catch{s=0}a+=s,window.performance&&typeof window.performance.now=="function"&&(a+=parseInt(window.performance.now()));var n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=(a+Math.random()*16)%16|0;return a=Math.floor(a/16),(t==="x"?e:e&3|8).toString(16)});return n};h.createEvent=function(s){var a;return typeof window.Event=="function"?a=new Event(s):(a=document.createEvent("Event"),a.initEvent(s,!0,!0)),a};h.adjustTimeByDuration=function(s,a,n){return!a||!s?s:s>a||n&&s<a?a:s};h.createPositionBar=function(s,a){var n=h.createDom("xg-bar","",{"data-index":-1},s);return a.appendChild(n),n};h.getTransformStyle=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{x:0,y:0,scale:1,rotate:0},a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",n={scale:"".concat(s.scale||1),translate:"".concat(s.x||0,"%, ").concat(s.y||0,"%"),rotate:"".concat(s.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(a)?(i.lastIndex=-1,a=a.replace(i,r)):a+="".concat(r," ")}),a};h.convertDeg=function(s){return Math.abs(s)<=1?s*360:s%360};h.getIndexByTime=function(s,a){var n=a.length,t=-1;if(n<1)return t;if(s<=a[0].end||n<2)t=0;else if(s>a[n-1].end)t=n-1;else for(var e=1;e<n;e++)if(s>a[e-1].end&&s<=a[e].end){t=e;break}return t};h.getOffsetCurrentTime=function(s,a){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:-1,t=-1;if(n>=0&&n<a.length?t=n:t=h.getIndexByTime(s,a),t<0)return-1;var e=a.length,i=a[t],r=i.start,o=i.end,u=i.cTime,l=i.offset;return s<r?u:s>=r&&s<=o?s-l:s>o&&t>=e-1?o:-1};h.getCurrentTimeByOffset=function(s,a){var n=-1;if(!a||a.length<0)return s;for(var t=0;t<a.length;t++)if(s<=a[t].duration){n=t;break}if(n!==-1){var e=a[n].start;return n-1<0?e+s:e+(s-a[n-1].duration)}return s};function au(s){var a=ie(s);return s!==null&&(a==="object"||a==="function")}function Ef(s,a,n){var t,e,i,r,o,u,l=0,c=!1,f=!1,g=!0,p=!a&&a!==0&&typeof window.requestAnimationFrame=="function";if(typeof s!="function")throw new TypeError("Expected a function");a=+a||0,au(n)&&(c=!!n.leading,f="maxWait"in n,i=f?Math.max(+n.maxWait||0,a):i,g="trailing"in n?!!n.trailing:g);function v(M){var P=t,Y=e;return t=e=void 0,l=M,r=s.apply(Y,P),r}function y(M,P){return p?(window.cancelAnimationFrame(o),window.requestAnimationFrame(M)):setTimeout(M,P)}function m(M){if(p)return window.cancelAnimationFrame(M);clearTimeout(M)}function T(M){return l=M,o=y(E,a),c?v(M):r}function b(M){var P=M-u,Y=M-l,Z=a-P;return f?Math.min(Z,i-Y):Z}function k(M){var P=M-u,Y=M-l;return u===void 0||P>=a||P<0||f&&Y>=i}function E(){var M=Date.now();if(k(M))return I(M);o=y(E,b(M))}function I(M){return o=void 0,g&&t?v(M):(t=e=void 0,r)}function R(){o!==void 0&&m(o),l=0,t=u=e=o=void 0}function O(){return o===void 0?r:I(Date.now())}function G(){return o!==void 0}function H(){for(var M=Date.now(),P=k(M),Y=arguments.length,Z=new Array(Y),le=0;le<Y;le++)Z[le]=arguments[le];if(t=Z,e=this,u=M,P){if(o===void 0)return T(u);if(f)return o=y(E,a),v(u)}return o===void 0&&(o=y(E,a)),r}return H.cancel=R,H.flush=O,H.pending=G,H}function Sf(s,a,n){var t=!0,e=!0;if(typeof s!="function")throw new TypeError("Expected a function");return au(n)&&(t="leading"in n?!!n.leading:t,e="trailing"in n?!!n.trailing:e),Ef(s,a,{leading:t,trailing:e,maxWait:a})}function xf(){var s=(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase();return s==="zh-cn"&&(s="zh"),s}function If(s,a,n){if(s){var t=s.getAttribute(n);return!!(t&&t===a&&(s.tagName==="VIDEO"||s.tagName==="AUDIO"))}}var oo={android:/(Android)\s([\d.]+)/,ios:/(Version)\/([\d.]+)/},Pf=["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 s=B.os;return s.isPc?"pc":"mobile"},get browser(){if(typeof navigator>"u")return"";var s=navigator.userAgent.toLowerCase(),a={ie:/rv:([\d.]+)\) like gecko/,firefox:/firefox\/([\d.]+)/,chrome:/chrome\/([\d.]+)/,opera:/opera.([\d.]+)/,safari:/version\/([\d.]+).*safari/};return[].concat(Object.keys(a).filter(function(n){return a[n].test(s)}))[0]},get os(){if(typeof navigator>"u")return{};var s=navigator.userAgent,a=/(?:Windows Phone)/.test(s),n=/(?:SymbianOS)/.test(s)||a,t=/(?:Tizen)/ig.test(s),e=/(?:Web0S)/ig.test(s),i=/(?:Android)/.test(s),r=/(?:Firefox)/.test(s),o=/(?:iPad|PlayBook)/.test(s)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,u=o||i&&!/(?:Mobile)/.test(s)||r&&/(?:Tablet)/.test(s),l=/(?:iPhone)/.test(s)&&!u,c=!l&&!i&&!n&&!u;return{isTablet:u,isPhone:l,isIpad:o,isIos:l||o,isAndroid:i,isPc:c,isSymbian:n,isWindowsPhone:a,isFireFox:r,isTizen:t,isWebOS:e}},get osVersion(){if(typeof navigator>"u")return 0;var s=navigator.userAgent,a="";/(?:iPhone)|(?:iPad|PlayBook)/.test(s)?a=oo.ios:a=oo.android;var n=a?a.exec(s):[];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 s=/(micromessenger)\/([\d.]+)/,a=s.exec(navigator.userAgent.toLocaleLowerCase());return!!a},isSupportMP4:function(){var a={isSupport:!1,mime:""};if(typeof document>"u")return a;if(this.supportResult)return this.supportResult;var n=document.createElement("video");return typeof n.canPlayType=="function"&&Pf.map(function(t){n.canPlayType('video/mp4; codecs="'.concat(t,'"'))==="probably"&&(a.isSupport=!0,a.mime+="||".concat(t))}),this.supportResult=a,n=null,a},isMSESupport:function(){var a=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(a)}catch(n){return this._logger.error(a,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(a){var n={supported:!1,smooth:!1,powerEfficient:!1};if(!a||typeof navigator>"u")return Promise.resolve(n);if(navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo)return navigator.mediaCapabilities.decodingInfo(a);var t=a.video||{},e=a.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)}}},dr="3.0.23",uo={1:"media",2:"media",3:"media",4:"media",5:"media",6:"media"},lo={1:5101,2:5102,3:5103,4:5104,5:5105,6:5106},Pt=x(function s(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null};S(this,s);var t=a&&a.i18n?a.i18n.ERROR_TYPES:null;if(a.media){var e=n.mediaError?n.mediaError:a.media.error||{},i=a.duration,r=a.currentTime,o=a.ended,u=a.src,l=a.currentSrc,c=a.media,f=c.readyState,g=c.networkState,p=n.errorCode||e.code;lo[p]&&(p=lo[p]);var v={playerVersion:dr,currentTime:r,duration:i,ended:o,readyState:f,networkState:g,src:u||l,errorType:n.errorType,errorCode:p,message:n.errorMessage||e.message,mediaError:e,originError:n.originError?n.originError.stack:"",host:h.getHostFromUrl(u||l)};return n.ext&&Object.keys(n.ext).map(function(b){v[b]=n.ext[b]}),v}else if(arguments.length>1){for(var y={playerVersion:dr,domain:document.domain},m=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"],T=0;T<arguments.length;T++)y[m[T]]=arguments[T];return y.ex=t?(t[arguments[0]]||{}).msg:"",y}}),ue="play",Rr="playing",He="ended",Qe="pause",ft="error",Gt="seeking",be="seeked",oe="timeupdate",ht="waiting",Ce="canplay",Af="canplaythrough",Te="durationchange",su="volumechange",ke="loadeddata",Lf="loadedmetadata",ou="ratechange",uu="progress",Or="loadstart",Ue="emptied",Df="stalled",Rf="suspend",Of="abort",Mf="bufferedChange",Mr="focus",lu="blur",Nr="ready",cu="urlNull",Fe="autoplay_started",Fr="autoplay_was_prevented",Wt="complete",At="replay",Br="destroy",Kt="urlchange",gr="download_speed_change",fu="leaveplayer",hu="enterplayer",du="loading",_e="fullscreen_change",Lt="cssFullscreen_change",Dt="mini_state_change",Hr="definition_change",Nf="before_definition_change",pr="after_definition_change",Ff="SEI_PARSED",Bf="retry",Le="video_resize",vr="pip_change",gu="rotate",pu="screenShot",Rt="playnext",vu="shortcut",mu="xglog",Ot="user_action",$t="reset",yu="source_error",_u="source_success",Hf="switch_subtitle",Cu=["play","playing","ended","pause","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","volumechange","loadeddata","loadedmetadata","ratechange","progress","loadstart","emptied","stalled","suspend","abort","lowdecode"],bu={STATS_INFO:"stats_info",STATS_DOWNLOAD:"stats_download",STATS_RESET:"stats_reset"},ku="fps_stuck";const Uf=Object.freeze(Object.defineProperty({__proto__:null,ABORT:Of,AFTER_DEFINITION_CHANGE:pr,AUTOPLAY_PREVENTED:Fr,AUTOPLAY_STARTED:Fe,BEFORE_DEFINITION_CHANGE:Nf,BUFFER_CHANGE:Mf,CANPLAY:Ce,CANPLAY_THROUGH:Af,COMPLETE:Wt,CSS_FULLSCREEN_CHANGE:Lt,DEFINITION_CHANGE:Hr,DESTROY:Br,DOWNLOAD_SPEED_CHANGE:gr,DURATION_CHANGE:Te,EMPTIED:Ue,ENDED:He,ENTER_PLAYER:hu,ERROR:ft,FPS_STUCK:ku,FULLSCREEN_CHANGE:_e,LEAVE_PLAYER:fu,LOADED_DATA:ke,LOADED_METADATA:Lf,LOADING:du,LOAD_START:Or,MINI_STATE_CHANGE:Dt,PAUSE:Qe,PIP_CHANGE:vr,PLAY:ue,PLAYER_BLUR:lu,PLAYER_FOCUS:Mr,PLAYING:Rr,PLAYNEXT:Rt,PROGRESS:uu,RATE_CHANGE:ou,READY:Nr,REPLAY:At,RESET:$t,RETRY:Bf,ROTATE:gu,SCREEN_SHOT:pu,SEEKED:be,SEEKING:Gt,SEI_PARSED:Ff,SHORTCUT:vu,SOURCE_ERROR:yu,SOURCE_SUCCESS:_u,STALLED:Df,STATS_EVENTS:bu,SUSPEND:Rf,SWITCH_SUBTITLE:Hf,TIME_UPDATE:oe,URL_CHANGE:Kt,URL_NULL:cu,USER_ACTION:Ot,VIDEO_EVENTS:Cu,VIDEO_RESIZE:Le,VOLUME_CHANGE:su,WAITING:ht,XGLOG:mu},Symbol.toStringTag,{value:"Module"}));function Zn(s,a){!this||!this.emit||(s==="error"?this.errorHandler(s,a.error):this.emit(s,a))}function jf(s,a){return function(n,t){var e={player:a,eventName:s,originalEvent:n,detail:n.detail||{},timeStamp:n.timeStamp,currentTime:a.currentTime,duration:a.duration,paused:a.paused,ended:a.ended,isInternalOp:!!a._internalOp[n.type],muted:a.muted,volume:a.volume,host:h.getHostFromUrl(a.currentSrc),vtype:a.vtype};if(a.removeInnerOP(n.type),s==="timeupdate"&&(a._currentTime=a.media&&a.media.currentTime),s==="ratechange"){var i=a.media?a.media.playbackRate:0;if(i&&a._rate===i)return;a._rate=a.media&&a.media.playbackRate}if(s==="durationchange"&&(a._duration=a.media.duration),s==="volumechange"&&(e.isMutedChange=a._lastMuted!==a.muted,a._lastMuted=a.muted),s==="error"&&(e.error=t||a.video.error),a.mediaEventMiddleware[s]){var r=Zn.bind(a,s,e);try{a.mediaEventMiddleware[s].call(a,e,r)}catch(o){throw Zn.call(a,s,e),o}}else Zn.call(a,s,e)}}var Vf=(function(s){A(n,s);var a=L(n);function n(t){var e;S(this,n),e=a.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):h.createDom(e.mediaConfig.mediaType,"",e.mediaConfig,""),t.defaultPlaybackRate&&(e.media.defaultPlaybackRate=e.media.playbackRate=t.defaultPlaybackRate),h.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 x(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=Cu.map(function(r){var o="on".concat(r.charAt(0).toUpperCase()).concat(r.slice(1));return typeof e[o]=="function"&&e.on(r,e[o]),C({},r,jf(r,e))})),this._evHandlers.forEach(function(r){var o=Object.keys(r)[0];i.addEventListener(o,r[o],!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 o=Object.keys(r)[0];i.removeEventListener(o,r[o],!1)}),this._evHandlers.forEach(function(r){var o=Object.keys(r)[0],u="on".concat(o.charAt(0).toUpperCase()).concat(o.slice(1));typeof e[u]=="function"&&e.off(o,e[u])}),this._evHandlers=null}},{key:"_attachSourceEvents",value:function(e,i){var r=this;e.removeAttribute("src"),e.load(),i.forEach(function(f,g){r.media.appendChild(h.createDom("source","",{src:"".concat(f.src),type:"".concat(f.type||""),"data-index":g+1}))});var o=e.children;if(o){this._videoSourceCount=o.length,this._videoSourceIndex=o.length,this._vLoadeddata=function(f){r.emit(_u,{src:f.target.currentSrc,host:h.getHostFromUrl(f.target.currentSrc)})};for(var u=null,l=0;l<this._evHandlers.length;l++)if(Object.keys(this._evHandlers[l])[0]==="error"){u=this._evHandlers[l];break}!this._sourceError&&(this._sourceError=function(f){var g=parseInt(f.target.getAttribute("data-index"),10);if(r._videoSourceIndex--,r._videoSourceIndex===0||g>=r._videoSourceCount){var p={code:4,message:"sources_load_error"};u?u.error(f,p):r.errorHandler("error",p)}var v=uo[4];r.emit(yu,new Pt(r,{errorType:v,errorCode:4,errorMessage:"sources_load_error",mediaError:{code:4,message:"sources_load_error"},src:f.target.src}))});for(var c=0;c<o.length;c++)o[c].addEventListener("error",this._sourceError);e.addEventListener("loadeddata",this._vLoadeddata)}}},{key:"_detachSourceEvents",value:function(e){var i=e.children;if(!(!i||i.length===0||!this._sourceError)){for(var 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,o=r.code?uo[r.code]:"other",u=r.message;this.media.currentSrc||this.media.srcObject||(u="empty_src",r={code:6,message:u}),this.emit(e,new Pt(this,{errorType:o,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 o=0,u=e.length;o<u&&(i[0]=e.start(o),i[1]=e.end(o),!(i[0]<=r&&r<=i[1]));o++);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?h.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(Kt,e),this.emit(ht),this._currentTime=0,this._duration=0,h.isMSE(this.media)){this.onWaiting();return}this._detachSourceEvents(this.media),h.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,o=arguments.length,u=new Array(o>2?o-2:0),l=2;l<o;l++)u[l-2]=arguments[l];(r=F(D(n.prototype),"emit",this)).call.apply(r,[this,e,i].concat(u))}},{key:"on",value:function(e,i){for(var r,o=arguments.length,u=new Array(o>2?o-2:0),l=2;l<o;l++)u[l-2]=arguments[l];(r=F(D(n.prototype),"on",this)).call.apply(r,[this,e,i].concat(u))}},{key:"once",value:function(e,i){for(var r,o=arguments.length,u=new Array(o>2?o-2:0),l=2;l<o;l++)u[l-2]=arguments[l];(r=F(D(n.prototype),"once",this)).call.apply(r,[this,e,i].concat(u))}},{key:"off",value:function(e,i){for(var r,o=arguments.length,u=new Array(o>2?o-2:0),l=2;l<o;l++)u[l-2]=arguments[l];(r=F(D(n.prototype),"off",this)).call.apply(r,[this,e,i].concat(u))}},{key:"offAll",value:function(){F(D(n.prototype),"removeAllListeners",this).call(this)}}]),n})(ru),qf=(function(){function s(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{name:"xgplayer",version:1,db:null,ojstore:{name:"xg-m4a",keypath:"vid"}};S(this,s),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=a}return x(s,[{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(o){},r.onsuccess=function(o){t.myDB.db=o.target.result,n.call(e)},r.onupgradeneeded=function(o){var u=o.target.result;o.target.transaction,u.objectStoreNames.contains(e.myDB.ojstore.name)||u.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),o=r.get(t);o.onerror=function(){e.call(i,null)},o.onsuccess=function(u){var l=u.target.result;e.call(i,l)}}},{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()}}]),s})(),co=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],fo=["requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen"],ho=["exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"],Pe="data-xgplayerid";function wt(s,a,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=a.call.apply(a,[s].concat(e));!n||typeof n!="function"||(r&&r.then?r.then(function(){for(var o=arguments.length,u=new Array(o),l=0;l<o;l++)u[l]=arguments[l];n.call.apply(n,[s].concat(u))}):n.call.apply(n,[s].concat(e)))}function Mt(s,a){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{pre:null,next:null};return this.__hooks||(this.__hooks={}),!this.__hooks[s]&&(this.__hooks[s]=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(o){throw o.message="[pluginName: ".concat(this.pluginName,":").concat(s,":pre error] >> ").concat(o.message),o}if(this.__hooks&&this.__hooks[s])try{var r=ve.apply(void 0,[this,s,a].concat(Array.prototype.slice.call(arguments)));r?r.then?r.then(function(o){o!==!1&&wt.apply(void 0,[e,a,n.next].concat(he(t)))}).catch(function(o){throw o}):wt.apply(void 0,[this,a,n.next].concat(Array.prototype.slice.call(arguments))):r===void 0&&wt.apply(void 0,[this,a,n.next].concat(Array.prototype.slice.call(arguments)))}catch(o){throw o.message="[pluginName: ".concat(this.pluginName,":").concat(s,"] >> ").concat(o.message),o}else wt.apply(void 0,[this,a,n.next].concat(Array.prototype.slice.call(arguments)))}).bind(this)}function Tu(s,a){var n=this.__hooks;if(!n||!Array.isArray(n[s]))return-1;for(var t=n[s],e=0;e<t.length;e++)if(t[e]===a)return e;return-1}function Nt(s,a){var n=this.__hooks;if(n)return n.hasOwnProperty(s)?(Array.isArray(n[s])||(n[s]=[]),Tu.call(this,s,a)===-1&&n[s].push(a),!0):(console.warn("has no supported hook which name [".concat(s,"]")),!1)}function Ft(s,a){var n=this.__hooks;if(n)if(Array.isArray(n[s])){var t=n[s],e=Tu.call(this,s,a);e!==-1&&t.splice(e,1)}else n[s]&&(n[s]=null)}function go(s){if(!(!this.plugins||!this.plugins[s.toLowerCase()])){for(var a=this.plugins[s.toLowerCase()],n=arguments.length,t=new Array(n>1?n-1:0),e=1;e<n;e++)t[e-1]=arguments[e];return a.useHooks&&a.useHooks.apply(a,t)}}function po(s){if(!(!this.plugins||!this.plugins[s.toLowerCase()])){var a=this.plugins[s.toLowerCase()];if(a){for(var n=arguments.length,t=new Array(n>1?n-1:0),e=1;e<n;e++)t[e-1]=arguments[e];return a.removeHooks&&a.removeHooks.apply(a,t)}}}function wu(s){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];s.__hooks={},a&&a.map(function(n){s.__hooks[n]=null}),Object.defineProperty(s,"hooks",{get:function(){return s.__hooks&&Object.keys(s.__hooks).map(function(t){if(s.__hooks[t])return t})}})}function Eu(s){s.__hooks=null}function ve(s,a,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(s.__hooks&&Array.isArray(s.__hooks[a])){var r=s.__hooks[a],o=-1,u=function l(c,f,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(o++,r.length===0||o===r.length)return g.call.apply(g,[c,c].concat(v));var m=r[o],T=m.call.apply(m,[c,c].concat(v));if(T&&T.then)return T.then(function(b){return b===!1?null:l.apply(void 0,[c,f,g].concat(v))}).catch(function(b){console.warn("[runHooks]".concat(f," reject"),b.message)});if(T!==!1)return l.apply(void 0,[c,f,g].concat(v));if(T===!1)return!1};return u.apply(void 0,[s,a,n].concat(e))}else return n.call.apply(n,[s,s].concat(e))}function Jn(s,a){U.logError("[".concat(s,"] event or callback cant be undefined or null when call ").concat(a))}var De=(function(){function s(a){S(this,s),h.checkIsFunction(this.beforeCreate)&&this.beforeCreate(a),wu(this),this.__args=a,this.__events={},this.__onceEvents={},this.config=a.config||{},this.player=null,this.playerConfig={},this.pluginName="",this.__init(a)}return x(s,[{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=h.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){Jn(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){Jn(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){Jn(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 Mt.call.apply(Mt,[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 Nt.call.apply(Nt,[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 Ft.call.apply(Ft,[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(),h.clearAllTimers(this),h.checkIsFunction(this.destroy)&&this.destroy(),["player","playerConfig","pluginName","logger","__args","__hooks"].map(function(i){n[i]=null}),t.unRegisterPlugin(e),Eu(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"}}]),s})(),Qn,vo;function zf(){if(vo)return Qn;vo=1;var s=9;if(typeof Element<"u"&&!Element.prototype.matches){var a=Element.prototype;a.matches=a.matchesSelector||a.mozMatchesSelector||a.msMatchesSelector||a.oMatchesSelector||a.webkitMatchesSelector}function n(t,e){for(;t&&t.nodeType!==s;){if(typeof t.matches=="function"&&t.matches(e))return t;t=t.parentNode}}return Qn=n,Qn}var er,mo;function Gf(){if(mo)return er;mo=1;var s=zf();function a(e,i,r,o,u){var l=t.apply(this,arguments);return e.addEventListener(r,l,u),{destroy:function(){e.removeEventListener(r,l,u)}}}function n(e,i,r,o,u){return typeof e.addEventListener=="function"?a.apply(null,arguments):typeof r=="function"?a.bind(null,document).apply(null,arguments):(typeof e=="string"&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,function(l){return a(l,i,r,o,u)}))}function t(e,i,r,o){return function(u){u.delegateTarget=s(u.target,i),u.delegateTarget&&o.call(e,u)}}return er=n,er}var Wf=Gf();const yo=_r(Wf);var Kf={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"},_o={ICON_DISABLE:"xg-icon-disable"};function tr(s){return s?s.indexOf&&/^(?:http|data:|\/)/.test(s):!1}function $f(s,a){return ie(s)==="object"&&s.class&&typeof s.class=="string"?"".concat(a," ").concat(s.class):a}function Yf(s,a){return ie(s)==="object"&&s.attr&&ie(s.attr)==="object"&&Object.keys(s.attr).map(function(n){a[n]=s.attr[n]}),a}function Co(s,a){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(s instanceof window.Element)return h.addClass(s,n),Object.keys(t).map(function(r){s.setAttribute(r,t[r])}),s;if(tr(s)||tr(s.url))return t.src=tr(s)?s:s.url||"",i=h.createDom(s.tag||"img","",t,"xg-img ".concat(n)),i;if(typeof s=="function")try{return i=s(),i instanceof window.Element?(h.addClass(i,n),Object.keys(t).map(function(r){i.setAttribute(r,t[r])}),i):(U.logWarn("warn>>icons.".concat(a," in config of plugin named [").concat(e,"] is a function mast return an Element Object")),null)}catch(r){return U.logError("Plugin named [".concat(e,"]:createIcon"),r),null}return typeof s=="string"?h.createDomFromHtml(s,t,n):(U.logWarn("warn>>icons.".concat(a," in config of plugin named [").concat(e,"] is invalid")),null)}function Xf(s,a){var n=a.config.icons||a.playerConfig.icons;Object.keys(s).map(function(t){var e=s[t],i=e&&e.class?e.class:"",r=e&&e.attr?e.attr:{},o=null;n&&n[t]&&(i=$f(n[t],i),r=Yf(n[t],r),o=Co(n[t],t,i,r,a.pluginName)),!o&&e&&(o=Co(e.icon?e.icon:e,r,i,{},a.pluginName)),a.icons[t]=o})}function Zf(s,a){Object.keys(s).map(function(n){Object.defineProperty(a.langText,n,{get:function(){var e=a.lang,i=a.i18n;return i[n]?i[n]:s[n]&&s[n][e]||""}})})}var q=(function(s){A(n,s);var a=L(n);function n(){var t,e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return S(this,n),t=a.call(this,e),t.__delegates=[],t}return x(n,[{key:"__init",value:function(e){if(F(D(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 o=this.registerIcons()||{};Xf(o,this),this.langText={};var u=this.registerLanguageTexts()||{};Zf(u,this);var l="";try{l=this.render()}catch(g){throw U.logError("Plugin:".concat(this.pluginName,":render"),g),new Error("Plugin:".concat(this.pluginName,":render:").concat(g.message))}if(l)r=n.insert(l,i,e.index),r.setAttribute("data-index",e.index);else if(e.tag)r=h.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 c=this.config.attr||{},f=this.config.style||{};this.setAttr(c),this.setStyle(f),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 o=r,u=i[o],l={root:e.root},c,f;typeof u=="function"?(c=e.config[o]||{},f=u):ie(u)==="object"&&typeof u.plugin=="function"&&(c=u.options?h.deepCopy(e.config[o]||{},u.options):e.config[o]||{},f=u.plugin),l.config=c,c.index!==void 0&&(l.index=c.index),c.root&&(l.root=c.root),e.registerPlugin(f,l,o)})}}},{key:"updateLang",value:function(e){e||(e=this.lang);function i(l,c){for(var f=0;f<l.children.length;f++)l.children[f].children.length>0?i(l.children[f],c):c(l.children[f])}var r=this.root,o=this.i18n,u=this.langText;r&&i(r,function(l){var c=l.getAttribute&&l.getAttribute("lang-key");if(c){var f=o[c.toUpperCase()]||u[c];f&&(l.innerHTML=typeof f=="function"?f(e):f)}})}},{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||{},o=this.langText;e.setAttribute&&e.setAttribute("lang-key",i);var u=r[i]||o[i]||"";u&&(e.innerHTML=u)}},{key:"plugins",value:function(){return this._children}},{key:"disable",value:function(){this.config.disable=!0,h.addClass(this.find(".xgplayer-icon"),_o.ICON_DISABLE)}},{key:"enable",value:function(){this.config.disable=!1,h.removeClass(this.find(".xgplayer-icon"),_o.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 o=F(D(n.prototype),"registerPlugin",this).call(this,e,i,r);return this._children.push(o),o}},{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 o=this;if(arguments.length<3&&typeof i=="function")Array.isArray(e)?e.forEach(function(l){o.bindEL(l,i)}):this.bindEL(e,i);else{var u=n.delegate.call(this,this.root,e,i,r);this.__delegates=this.__delegates.concat(u)}}},{key:"unbind",value:function(e,i){var r=this;if(arguments.length<3&&typeof i=="function")Array.isArray(e)?e.forEach(function(l){r.unbindEL(l,i)}):this.unbindEL(e,i);else for(var o="".concat(e,"_").concat(i),u=0;u<this.__delegates.length;u++)if(this.__delegates[u].key===o){this.__delegates[u].destroy(),this.__delegates.splice(u,1);break}}},{key:"setStyle",value:function(e,i){var r=this;if(this.root){if(h.typeOf(e)==="String")return this.root.style[e]=i;h.typeOf(e)==="Object"&&Object.keys(e).map(function(o){r.root.style[o]=e[o]})}}},{key:"setAttr",value:function(e,i){var r=this;if(this.root){if(h.typeOf(e)==="String")return this.root.setAttribute(e,i);h.typeOf(e)==="Object"&&Object.keys(e).map(function(o){r.root.setAttribute(o,e[o])})}}},{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 U.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(D(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,o=i.children.length,u=Number(r),l=e instanceof window.Node;if(o){for(var c=0,f=null,g="";c<o;c++){f=i.children[c];var p=Number(f.getAttribute("data-index"));if(p>=u){g="beforebegin";break}else p<u&&(g="afterend")}return l?g==="afterend"?i.appendChild(e):i.insertBefore(e,f):f.insertAdjacentHTML(g,e),g==="afterend"?i.children[i.children.length-1]:i.children[c]}else return l?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,o){var u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,l=[];if(e instanceof window.Node&&typeof o=="function")if(Array.isArray(r))r.forEach(function(f){var g=yo(e,i,f,o,u);g.key="".concat(i,"_").concat(f),l.push(g)});else{var c=yo(e,i,r,o,u);c.key="".concat(i,"_").concat(r),l.push(c)}return l}},{key:"ROOT_TYPES",get:function(){return Kf}},{key:"POSITIONS",get:function(){return K}}]),n})(De),Jf=(function(){function s(){var a=this;if(S(this,s),C(this,"__trigger",function(n){var t=new Date().getTime();a.timeStamp=t;for(var e=0;e<n.length;e++)a.__runHandler(n[e].target)}),this.__handlers=[],this.timeStamp=0,this.observer=null,!!window.ResizeObserver)try{this.observer=new window.ResizeObserver(Sf(this.__trigger,100,{trailing:!0})),this.timeStamp=new Date().getTime()}catch(n){console.error(n)}}return x(s,[{key:"addObserver",value:function(n,t){if(this.observer){this.observer.observe(n);for(var e=n.getAttribute(Pe),i=this.__handlers,r=-1,o=0;o<i.length;o++)i[o]&&n===i[o].target&&(r=o);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}}]),s})(),ot=null;function Qf(s,a){return ot||(ot=new Jf),ot.addObserver(s,a),ot}function eh(s,a){var n;(n=ot)===null||n===void 0||n.unObserver(s,a)}var ee={pluginGroup:{},init:function(a){var n=a._pluginInfoId;n||(n=new Date().getTime(),a._pluginInfoId=n),!a.config.closeResizeObserver&&Qf(a.root,function(){a.resize()}),this.pluginGroup[n]={_originalOptions:a.config||{},_plugins:{}}},formatPluginInfo:function(a,n){var t=null,e=null;return a.plugin&&typeof a.plugin=="function"?(t=a.plugin,e=a.options):(t=a,e={}),n&&(e.config=n||{}),{PLUFGIN:t,options:e}},checkPluginIfExits:function(a,n){for(var t=0;t<n.length;t++)if(a.toLowerCase()===n[t].pluginName.toLowerCase())return!0;return!1},getRootByConfig:function(a,n){for(var t=Object.keys(n),e=null,i=0;i<t.length;i++)if(a.toLowerCase()===t[i].toLowerCase()){e=n[t[i]];break}return h.typeOf(e)==="Object"?{root:e.root,position:e.position}:{}},lazyRegister:function(a,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(a,r,i.options)}),new Promise(function(i,r){setTimeout(function(){r(new Error("timeout"))},e)})])},register:function(a,n){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!(!a||!n||typeof n!="function"||n.prototype===void 0)){var e=a._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=a;var o=t.pluginName||n.pluginName;if(!o)throw new Error("The property pluginName is necessary");if(n.isSupported&&!n.isSupported(a.config.mediaType,a.config.codecType)){console.warn("not supported plugin [".concat(o,"]"));return}t.config||(t.config={});for(var u=Object.keys(r),l=0;l<u.length;l++)if(o.toLowerCase()===u[l].toLowerCase()){var c=r[u[l]];h.typeOf(c)==="Object"?t.config=Object.assign({},t.config,r[u[l]]):h.typeOf(c)==="Boolean"&&(t.config.disable=!c);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=a[t.root]):t.root=a.root,t.index=t.config.index||0;try{i[o.toLowerCase()]&&(this.unRegister(e,o.toLowerCase()),console.warn("the is one plugin with same pluginName [".concat(o,"] exist, destroy the old instance")));var f=new n(t);return i[o.toLowerCase()]=f,i[o.toLowerCase()].func=n,f&&typeof f.afterCreate=="function"&&f.afterCreate(),f}catch(g){throw console.error(g),g}}}},unRegister:function(a,n){a._pluginInfoId&&(a=a._pluginInfoId),n=n.toLowerCase();try{var t=this.pluginGroup[a]._plugins[n];t&&(t.pluginName&&t.__destroy(),delete this.pluginGroup[a]._plugins[n])}catch(e){console.error("[unRegister:".concat(n,"] cgid:[").concat(a,"] error"),e)}},deletePlugin:function(a,n){var t=a._pluginInfoId;t&&this.pluginGroup[t]&&this.pluginGroup[t]._plugins&&delete this.pluginGroup[t]._plugins[n]},getPlugins:function(a){var n=a._pluginInfoId;return n&&this.pluginGroup[n]?this.pluginGroup[n]._plugins:{}},findPlugin:function(a,n){var t=a._pluginInfoId;if(!t||!this.pluginGroup[t])return null;var e=n.toLowerCase();return this.pluginGroup[t]._plugins[e]},beforeInit:function(a){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 a._loadingPlugins&&a._loadingPlugins.length?i=Promise.all(a._loadingPlugins):i=Promise.resolve(),i.then(function(){var r=a._pluginInfoId;if(!n.pluginGroup[r]){e();return}var o=n.pluginGroup[r]._plugins,u=[];Object.keys(o).forEach(function(l){if(o[l]&&o[l].beforePlayerInit)try{var c=o[l].beforePlayerInit();u.push(t(c))}catch(f){throw u.push(t(null)),f}}),Promise.all([].concat(u)).then(function(){e()}).catch(function(l){console.error(l),e()})})}})},afterInit:function(a){var n=a._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(a,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(a);else try{e[i].lang=a}catch{console.warn("".concat(i," setLang"))}})}},reRender:function(a){var n=this,t=a._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(a,r.plugin,r.options)})}},onPluginsReady:function(a){var n=a._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(a){var n=a._pluginInfoId;if(this.pluginGroup[n]){eh(a.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 a._pluginInfoId}}},w={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 bo(){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:xf(),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 th=function(a,n){var t,e,i;n.preset&&n.options?i=new n.preset(n.options,a.config):i=new n({},a.config);var r=i,o=r.plugins,u=o===void 0?[]:o,l=r.ignores,c=l===void 0?[]:l,f=r.icons,g=f===void 0?{}:f,p=r.i18n,v=p===void 0?[]:p;a.config.plugins||(a.config.plugins=[]),a.config.ignores||(a.config.ignores=[]),(t=a.config.plugins).push.apply(t,he(u)),(e=a.config.ignores).push.apply(e,he(c)),Object.keys(g).map(function(m){a.config.icons[m]||(a.config.icons[m]=g[m])});var y=a.config.i18n||[];v.push.apply(v,he(y)),a.config.i18n=v},ih=(function(s){A(n,s);var a=L(n);function n(){var t;S(this,n);for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return t=a.call.apply(a,[this].concat(i)),C(_(t),"onMouseEnter",function(o){var u=_(t),l=u.player,c=u.playerConfig;c.closeControlsBlur&&l.focus({autoHide:!1})}),C(_(t),"onMouseLeave",function(o){var u=_(t),l=u.player;l.focus()}),t}return x(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,o=i.height,u=i.mode;if(!r){u==="flex"&&this.player.addClass(w.FLEX_CONTROLS);var l={height:"".concat(o,"px")};Object.keys(l).map(function(f){e.root.style[f]=l[f]}),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(Dt,function(f){f?h.addClass(e.root,"mini-controls"):h.removeClass(e.root,"mini-controls")});var c=this.playerConfig.isMobileSimulateMode;B.device!=="mobile"&&c!=="mobile"&&(this.bind("mouseenter",this.onMouseEnter),this.bind("mouseleave",this.onMouseLeave))}}},{key:"focus",value:function(){this.player.focus({autoHide:!1})}},{key:"focusAwhile",value:function(){this.player.focus({autoHide:!0})}},{key:"blur",value:function(){this.player.blur({ignorePaused:!0})}},{key:"recoverAutoHide",value:function(){this.config.autoHide&&h.addClass(this.root,w.CONTROLS_AUTOHIDE)}},{key:"pauseAutoHide",value:function(){h.removeClass(this.root,w.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 o=e.defaultConfig||{};if(!i.root){var u=i.position?i.position:i.config&&i.config.position?i.config.position:o.position;switch(u){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(D(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,o=e.initShow,u=e.disable;if(!u){var l=h.classNames({"xgplayer-controls":!0},{"flex-controls":i==="flex"},{"bottom-controls":i==="bottom"},C({},w.CONTROLS_AUTOHIDE,r),{"xgplayer-controls-initshow":o||!r});return'<xg-controls class="'.concat(l,`" 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})(q),nh={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"}},se={lang:{},langKeys:[],textKeys:[]};function ut(s,a){return Object.keys(a).forEach(function(n){var t=h.typeOf(a[n]),e=h.typeOf(s[n]);if(t==="Array"){var i;e!=="Array"&&(s[n]=[]),(i=s[n]).push.apply(i,he(a[n]))}else t==="Object"?(e!=="Object"&&(s[n]={}),ut(s[n],a[n])):s[n]=a[n]}),s}function Su(){Object.keys(se.lang.en).map(function(s){se.textKeys[s]=s})}function rh(s,a){var n=[];if(a||(a=se),!!a.lang){h.typeOf(s)!=="Array"?n=Object.keys(s).map(function(i){var r=i==="zh"?"zh-cn":i;return{LANG:r,TEXT:s[i]}}):n=s;var t=a,e=t.lang;n.map(function(i){i.LANG==="zh"&&(i.LANG="zh-cn"),e[i.LANG]?ut(e[i.LANG]||{},i.TEXT||{}):Ur(i,a)}),Su()}}function Ur(s,a){var n=s.LANG;if(a||(a=se),!!a.lang){var t=s.TEXT||{};n==="zh"&&(n="zh-cn"),a.lang[n]?ut(a.lang[n],t):(a.langKeys.push(n),a.lang[n]=t),Su()}}function ah(s){var a,n={lang:{},langKeys:[],textKeys:{},pId:s};return ut(n.lang,se.lang),(a=n.langKeys).push.apply(a,he(se.langKeys)),ut(n.textKeys,se.textKeys),n}Ur(nh);var Ze={get textKeys(){return se.textKeys},get langKeys(){return se.langKeys},get lang(){var s={};return se.langKeys.map(function(a){s[a]=se.lang[a]}),se.lang["zh-cn"]&&(s.zh=se.lang["zh-cn"]||{}),s},extend:rh,use:Ur,init:ah},j={INITIAL:1,READY:2,ATTACHING:3,ATTACHED:4,NOTALLOW:5,RUNNING:6,ENDED:7},ko=["ERROR","INITIAL","READY","ATTACHING","ATTACHED","NOTALLOW","RUNNING","ENDED","DESTROYED"],re={},ir=null,xu=(function(s){A(n,s);var a=L(n);function n(){return S(this,n),a.apply(this,arguments)}return x(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 o=re[r];if(i){if(e(o))break}else e(o)}}},{key:"forEach",value:function(e){this._iterate(e)}},{key:"find",value:function(e){var i=null;return this._iterate(function(r){var o=e(r);return o&&(i=r),o},!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 ir||(ir=new n),ir}}]),n})(nu.EventEmitter);function sh(s){for(var a=Object.keys(re),n=0;n<a.length;n++){var t=re[a[n]];if(t.root===s)return t}return null}var oh=["play","pause","replay","retry"],To=0,wo=0,Se=null,Yt=(function(s){A(n,s);var a=L(n);function n(t){var e;S(this,n);var i=h.deepMerge(bo(),t);e=a.call(this,i),C(_(e),"canPlayFunc",function(){if(e.config){var v=e.config,y=v.autoplay,m=v.defaultPlaybackRate;U.logInfo("player","canPlayFunc, startTime",e.__startTime),e._seekToStartTime(),e.playbackRate=m,(y||e._useAutoplay)&&e.mediaPlay(),e.off(Ce,e.canPlayFunc),e.removeClass(w.ENTER)}}),C(_(e),"onFullscreenChange",function(v,y){var m=function(){h.setTimeout(_(e),function(){e.resize()},100)},T=h.getFullScreenEl();e._fullActionFrom?e._fullActionFrom="":e.emit(Ot,{eventType:"system",action:"switch_fullscreen",pluginName:"player",currentTime:e.currentTime,duration:e.duration,props:[{prop:"fullscreen",from:!0,to:!1}]});var b=If(T,e.playerId,Pe);if(y||T&&(T===e._fullscreenEl||b))m(),!e.config.closeFocusVideoFocus&&e.media.focus(),e.fullscreen=!0,e.changeFullStyle(e.root,T,w.FULLSCREEN),e.emit(_e,!0,e._fullScreenOffset),e.cssfullscreen&&e.exitCssFullscreen();else if(e.fullscreen){m();var k=_(e),E=k._fullScreenOffset,I=k.config;if(I.needFullscreenScroll?(window.scrollTo(E.left,E.top),h.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(w.FULLSCREEN);else{var R=e._fullscreenEl;!R&&(e.root.contains(v.target)||v.target===e.root)&&(R=v.target),e.recoverFullStyle(e.root,R,w.FULLSCREEN)}e._fullscreenEl=null,e.emit(_e,!1)}}),C(_(e),"_onWebkitbeginfullscreen",function(v){e._fullscreenEl=e.media,e.onFullscreenChange(v,!0)}),C(_(e),"_onWebkitendfullscreen",function(v){e.onFullscreenChange(v,!1)}),wu(_(e),oh),e.config=i,e._pluginInfoId=h.generateSessionId(),kf(_(e));var r=e.constructor.defaultPreset;if(e.config.presets.length){var o=e.config.presets.indexOf("default");o>=0&&r&&(e.config.presets[o]=r)}else r&&e.config.presets.push(r);e.userTimer=null,e.waitTimer=null,e.handleSource=!0,e._state=j.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=Ze.init(e._pluginInfoId),B.os.isAndroid&&B.osVersion>0&&B.osVersion<6&&(e.config.autoplay=!1),e.database=new qf,e.isUserActive=!1,e._onceSeekCanplay=null,e._isPauseBeforeSeek=0,e.innerStates={isActiveLocked:!1},e.instManager=Se;var u=e._initDOM();if(!u)return console.error(new Error("can't find the dom which id is ".concat(e.config.id," or this.config.el does not exist"))),Dr(e);var l=e.config,c=l.definition,f=c===void 0?{}:c,g=l.url;if(!g&&f.list&&f.list.length>0){var p=f.list.find(function(v){return v.definition&&v.definition===f.defaultDefinition});p||(f.defaultDefinition=f.list[0].definition,p=f.list[0]),e.config.url=p.url,e.curDefinition=p}return e._bindEvents(),e._registerPresets(),e._registerPlugins(),ee.onPluginsReady(_(e)),e.getInitDefinition(),e.setState(j.READY),h.setTimeout(_(e),function(){e.emit(Nr)},0),e.onReady&&e.onReady(),(e.config.videoInit||e.config.autoplay)&&(!e.hasStart||e.state<j.ATTACHED)&&e.start(),e}return x(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(ft,new Pt("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 o=sh(this.root);if(o&&(U.logWarn("The is an Player instance already exists in this.root, destroy it and reinitialize"),o.destroy()),this.root.setAttribute(Pe,this.playerId),this.media.setAttribute(Pe,this.playerId),(e=Se)===null||e===void 0||e.add(this),ee.init(this),this._initBaseDoms(),this.config.controls){var u=this.config.controls.root||null,l=ee.register(this,ih,{root:u});this.controls=l}var c=this.config.isMobileSimulateMode==="mobile"?"mobile":B.device;if(this.addClass("".concat(w.DEFAULT," ").concat(w.INACTIVE," xgplayer-").concat(c," ").concat(this.config.controls?"":w.NO_CONTROLS)),this.config.autoplay?this.addClass(w.ENTER):this.addClass(w.NO_START),this.config.fluid){var f=this.config,g=f.width,p=f.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(E){i.root.style[E]=v[E]})}else["width","height"].forEach(function(E){i.config[E]&&(typeof i.config[E]!="number"?i.root.style[E]=i.config[E]:i.root.style[E]="".concat(i.config[E],"px"))});var y=this.root.getBoundingClientRect(),m=y.width,T=y.height,b=y.left,k=y.top;return this.sizeInfo.width=m,this.sizeInfo.height=T,this.sizeInfo.left=b,this.sizeInfo.top=k,!0}},{key:"_initBaseDoms",value:function(){this.topBar=null,this.leftBar=null,this.rightBar=null,this.config.marginControls&&(this.innerContainer=h.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)])}),co.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(ke,this.resize),this.playFunc=function(){e.config.closeFocusVideoFocus||e.media.focus()},this.once(ue,this.playFunc)}},{key:"_unbindEvents",value:function(){var e=this;this.root.removeEventListener("mousemove",this.mousemoveFunc),co.forEach(function(i){document.removeEventListener(i,e.onFullscreenChange)}),this.playFunc&&this.off(ue,this.playFunc),this.off(Ce,this.canPlayFunc),this.media.removeEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.media.removeEventListener("webkitendfullscreen",this._onWebkitendfullscreen)}},{key:"_clearUserTimer",value:function(){this.userTimer&&(h.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===""||h.typeOf(e)==="Array"&&e.length===0)&&(e="",this.emit(cu),U.logWarn("config.url is null, please get url and run player._startInit(url)"),this.config.nullUrlStart))){h.isNotNull(r.playSessionId)&&(this._playSessionId=r.playSessionId),this.handleSource&&(this._detachSourceEvents(this.media),h.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")),h.typeOf(this.config.volume)==="Number"&&(this.volume=this.config.volume);var o=this.innerContainer?this.innerContainer:this.root;this.media instanceof window.Element&&!o.contains(this.media)&&o.insertBefore(this.media,o.firstChild);var u=this.media.readyState;U.logInfo("_startInit readyState",u),this.config.autoplay&&(!h.isMSE(this.media)&&this.load(),(B.os.isIpad||B.os.isPhone)&&this.mediaPlay());var l=this.config.startTime;this.__startTime=l>0?l:-1,this.config.startTime=0,u>=2&&this.duration>0?this.canPlayFunc():this.on(Ce,this.canPlayFunc),(!this.hasStart||this.state<j.ATTACHED)&&ee.afterInit(this),this.hasStart=!0,this.setState(j.ATTACHED),h.setTimeout(this,function(){i.emit(Wt)},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||[],o=this.config.plugins||[],u=this.config.i18n||[];i&&Ze.extend(u,this.__i18n);var l=r.join("||").toLowerCase().split("||"),c=this.plugins;o.forEach(function(f){try{var g=f.plugin?f.plugin.pluginName:f.pluginName;if(g&&l.indexOf(g.toLowerCase())>-1)return null;if(!i&&c[g.toLowerCase()])return;if(f.lazy&&f.loader){var p=ee.lazyRegister(e,f);f.forceBeforeInit&&(p.then(function(){e._loadingPlugins.splice(e._loadingPlugins.indexOf(p),1)}).catch(function(v){U.logError("_registerPlugins:loadingPlugin",v),e._loadingPlugins.splice(e._loadingPlugins.indexOf(p),1)}),e._loadingPlugins.push(p));return}return e.registerPlugin(f)}catch(v){U.logError("_registerPlugins:",v)}})}},{key:"_registerPresets",value:function(){var e=this;this.config.presets.forEach(function(i){th(e,i)})}},{key:"_getRootByPosition",value:function(e){var i=null;switch(e){case K.ROOT_RIGHT:this.rightBar||(this.rightBar=h.createPositionBar("xg-right-bar",this.root)),i=this.rightBar;break;case K.ROOT_LEFT:this.leftBar||(this.leftBar=h.createPositionBar("xg-left-bar",this.root)),i=this.leftBar;break;case K.ROOT_TOP:this.topBar||(this.topBar=h.createPositionBar("xg-top-bar",this.root),this.config.topBarAutoHide&&h.addClass(this.topBar,w.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),o=r.PLUFGIN,u=r.options,l=this.config.plugins,c=ee.checkPluginIfExits(o.pluginName,l);!c&&l.push(o);var f=ee.getRootByConfig(o.pluginName,this.config);f.root&&(u.root=f.root),f.position&&(u.position=f.position);var g=u.position?u.position:u.config&&u.config.position||o.defaultConfig&&o.defaultConfig.position;if(!u.root&&typeof g=="string"&&g.indexOf("controls")>-1){var p;return(p=this.controls)===null||p===void 0?void 0:p.registerPlugin(o,u,o.pluginName)}return u.root||(u.root=this._getRootByPosition(g)),ee.register(this,o,u)}},{key:"deregister",value:function(e){typeof e=="string"?ee.unRegister(this,e):e instanceof De&&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 De&&(i=e.pluginName),!!i)for(var r=this.config.plugins.length-1;r>-1;r--){var o=this.config.plugins[r];if(o.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&&(h.hasClass(this.root,e)||h.addClass(this.root,e))}},{key:"removeClass",value:function(e){this.root&&h.removeClass(this.root,e)}},{key:"hasClass",value:function(e){if(this.root)return h.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>j.ATTACHING)){var r=this._playSessionId;return h.isNotNull(r)&&(this._playSessionId=void 0),!e&&!this.config.url&&this.getInitDefinition(),this.hasStart=!0,this.setState(j.ATTACHING),this._registerPlugins(!1),ee.beforeInit(this).then(function(){if(i.config){e||(e=i.url||i.config.url);var o=i.preProcessUrl(e),u=i._startInit(o.url,{playSessionId:r});return u}}).catch(function(o){throw o.fileName="player",o.lineNumber="236",U.logError("start:beforeInit:",o),o})}}},{key:"switchURL",value:function(e,i){var r=this,o=e;h.typeOf(e)==="Object"&&(o=e.url),o=this.preProcessUrl(o).url;var u=this.currentTime;this.__startTime=u;var l=this.paused&&!this.isError;return this.src=o,new Promise(function(c,f){var g=function(y){r.off("timeupdate",p),r.off("canplay",p),f(y)},p=function(){r._seekToStartTime(),l&&r.pause(),r.off("error",g),c(!0)};if(r.once("error",g),!o){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<j.ATTACHED){this.removeClass(w.NO_START),this.addClass(w.ENTER),this.start(),this._useAutoplay=!0;return}this.state<j.RUNNING&&(this.removeClass(w.NO_START),!this.isCanplay&&this.addClass(w.ENTER));var i=F(D(n.prototype),"play",this).call(this);return i!==void 0&&i&&i.then?i.then(function(){e.removeClass(w.NOT_ALLOW_AUTOPLAY),e.addClass(w.PLAYING),e.state<j.RUNNING&&(U.logInfo(">>>>playPromise.then"),e.setState(j.RUNNING),e.emit(Fe))}).catch(function(r){if(U.logWarn(">>>>playPromise.catch",r.name),e.media&&e.media.error){e.onError(),e.removeClass(w.ENTER);return}r.name==="NotAllowedError"&&(e._errorTimer=h.setTimeout(e,function(){e._errorTimer=null,e.emit(Fr),e.addClass(w.NOT_ALLOW_AUTOPLAY),e.removeClass(w.ENTER),e.pause(),e.setState(j.NOTALLOW)},0))}):(U.logWarn("video.play not return promise"),this.state<j.RUNNING&&(this.setState(j.RUNNING),this.removeClass(w.NOT_ALLOW_AUTOPLAY),this.removeClass(w.NO_START),this.removeClass(w.ENTER),this.addClass(w.PLAYING),this.emit(Fe))),i}},{key:"mediaPause",value:function(){F(D(n.prototype),"pause",this).call(this)}},{key:"videoPause",value:function(){F(D(n.prototype),"pause",this).call(this)}},{key:"play",value:function(){var e=this;return this.removeClass(w.PAUSED),ve(this,"play",function(){return e.mediaPlay()})}},{key:"pause",value:function(){var e=this;ve(this,"pause",function(){F(D(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 o=this.config,u=o.isSeekedPlay,l=o.seekedStatus,c=i||(u?"play":l);e=e<0?0:e>this.duration?parseInt(this.duration,10):e,!this._isPauseBeforeSeek&&(this._isPauseBeforeSeek=this.paused?2:1),this._onceSeekCanplay&&this.off(be,this._onceSeekCanplay),this._onceSeekCanplay=function(){switch(r.removeClass(w.ENTER),r.isSeeking=!1,c){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(be,this._onceSeekCanplay),this.state<j.RUNNING?(this.removeClass(w.NO_START),this.currentTime=e,this.play()):this.currentTime=e}}},{key:"getInitDefinition",value:function(){var e=this,i=this.config,r=i.definition,o=i.url;!o&&r&&r.list&&r.list.length>0&&r.defaultDefinition&&r.list.map(function(u){u.definition===r.defaultDefinition&&(e.config.url=u.url,e.curDefinition=u)})}},{key:"changeDefinition",value:function(e,i){var r=this,o=this.config.definition;if(Array.isArray(o==null?void 0:o.list)&&o.list.forEach(function(l){(e==null?void 0:e.definition)===l.definition&&(r.curDefinition=l)}),e!=null&&e.bitrate&&typeof e.bitrate!="number"&&(e.bitrate=parseInt(e.bitrate,10)||0),this.emit(Hr,{from:i,to:e}),!this.hasStart){this.config.url=e.url;return}var u=this.switchURL(e.url,X({seamless:o.seamless!==!1&&typeof MediaSource<"u"&&typeof MediaSource.isTypeSupported=="function"},e));u&&u.then?u.then(function(){r.emit(pr,{from:i,to:e})}):this.emit(pr,{from:i,to:e})}},{key:"reload",value:function(){this.load(),this.reloadFunc=function(){this.play()},this.once(ke,this.reloadFunc)}},{key:"resetState",value:function(){var e=this,i=w.NOT_ALLOW_AUTOPLAY,r=w.PLAYING,o=w.NO_START,u=w.PAUSED,l=w.REPLAY,c=w.ENTER,f=w.ENDED,g=w.ERROR,p=w.LOADING,v=[i,r,o,u,l,c,f,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(w.NO_START),this.emit($t)}},{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 o=this.plugins;if(o&&(i.map(function(l){e.deregister(l)}),r)){var u=bo();Object.keys(this.config).forEach(function(l){e.config[l]!=="undefined"&&(l==="plugins"||l==="presets"||l==="el"||l==="id")&&(e.config[l]=u[l])})}}},{key:"destroy",value:function(){var e,i=this,r=this.innerContainer,o=this.root,u=this.media;if(!(!o||!u)){if(this.hasStart=!1,this._useAutoplay=!1,o.removeAttribute(Pe),u.removeAttribute(Pe),this.updateAcc("destroy"),this._unbindEvents(),this._detachSourceEvents(this.media),h.clearAllTimers(this),this.emit(Br),(e=Se)===null||e===void 0||e.remove(this),ee.destroy(this),Eu(this),F(D(n.prototype),"destroy",this).call(this),this.fullscreen&&this._fullscreenEl===this.root&&this.exitFullscreen(),r)for(var l=r.children,c=0;c<l.length;c++)r.removeChild(l[c]);!r&&u instanceof window.Node&&o.contains(u)&&!this.config.remainMediaAfterDestroy&&o.removeChild(u),["topBar","leftBar","rightBar","innerContainer"].map(function(g){i[g]&&o.removeChild(i[g]),i[g]=null});var f=o.className.split(" ");f.length>0?o.className=f.filter(function(g){return g.indexOf("xgplayer")<0}).join(" "):o.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(w.ENDED),this.currentTime=0,this.isSeeking=!1,ve(this,"replay",function(){e.once(be,function(){var i=e.mediaPlay();i&&i.catch&&i.catch(function(r){console.log(r)})}),e.emit(At),e.onPlay()})}},{key:"retry",value:function(){var e=this;this.removeClass(w.ERROR),this.addClass(w.LOADING),ve(this,"retry",function(){var i=e.currentTime,r=e.config.url,o=h.isMSE(e.media)?{url:r}:e.preProcessUrl(r);e.src=o.url,!e.config.isLive&&(e.currentTime=i),e.once(Ce,function(){e.mediaPlay()})})}},{key:"changeFullStyle",value:function(e,i,r,o){e&&(o||(o=w.PARENT_FULLSCREEN),this._orgCss||(this._orgCss=h.filterStyleFromText(e)),h.addClass(e,r),i&&i!==e&&!this._orgPCss&&(this._orgPCss=h.filterStyleFromText(i),h.addClass(i,o),i.setAttribute(Pe,this.playerId)))}},{key:"recoverFullStyle",value:function(e,i,r,o){o||(o=w.PARENT_FULLSCREEN),this._orgCss&&(h.setStyleFromCsstext(e,this._orgCss),this._orgCss=""),h.removeClass(e,r),i&&i!==e&&this._orgPCss&&(h.setStyleFromCsstext(i,this._orgPCss),this._orgPCss="",h.removeClass(i,o),i.removeAttribute(Pe))}},{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:h.scrollTop(),left:h.scrollLeft()},this._fullscreenEl=e,this._fullActionFrom="get";var o=h.getFullScreenEl();if(o===this._fullscreenEl)return this.onFullscreenChange(),Promise.resolve();try{for(var u=0;u<fo.length;u++){var l=fo[u];if(e[l]){var c=l==="webkitRequestFullscreen"?e.webkitRequestFullscreen(window.Element.ALLOW_KEYBOARD_INPUT):e[l]();return c&&c.then?c: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&&!h.getFullScreenEl())){this.root;var i=this.media;this._fullActionFrom="exit";try{for(var r=0;r<ho.length;r++){var o=ho[r];if(document[o]){var u=document[o]();return u&&u.then?u: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(w.INNER_FULLSCREEN," ").concat(w.CSS_FULLSCREEN):w.CSS_FULLSCREEN;this.changeFullStyle(this.root,e,i);var r=this.config.fullscreen,o=r===void 0?{}:r,u=o.useCssFullscreen===!0||typeof o.useCssFullscreen=="function"&&o.useCssFullscreen();u&&(this.fullscreen=!0,this.emit(_e,!0)),this._cssfullscreenEl=e,this.cssfullscreen=!0,this.emit(Lt,!0)}},{key:"exitCssFullscreen",value:function(){var e=this._cssfullscreenEl?"".concat(w.INNER_FULLSCREEN," ").concat(w.CSS_FULLSCREEN):w.CSS_FULLSCREEN;if(!this.fullscreen)this.recoverFullStyle(this.root,this._cssfullscreenEl,e);else{var i=this.config.fullscreen,r=i===void 0?{}:i,o=r.useCssFullscreen===!0||typeof r.useCssFullscreen=="function"&&r.useCssFullscreen();o?(this.recoverFullStyle(this.root,this._cssfullscreenEl,e),this.fullscreen=!1,this.emit(_e,!1)):this.removeClass(e)}this._cssfullscreenEl=null,this.cssfullscreen=!1,this.emit(Lt,!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(w.INNER_FULLSCREEN," ").concat(w.ROTATE_FULLSCREEN):w.ROTATE_FULLSCREEN;this._fullscreenEl=e||this.root,this.changeFullStyle(this.root,e,i,w.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(_e,!0)}},{key:"exitRotateFullscreen",value:function(e){var i=this._fullscreenEl!==this.root?"".concat(w.INNER_FULLSCREEN," ").concat(w.ROTATE_FULLSCREEN):w.ROTATE_FULLSCREEN;this.recoverFullStyle(this.root,this._fullscreenEl,i,w.PARENT_ROTATE_FULLSCREEN),this.isRotateFullscreen=!1,this.fullscreen=!1,this.setRotateDeg(0),this.emit(_e,!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(Mr,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(lu,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(w.INACTIVE),this._clearUserTimer(),i.isLock!==void 0&&(r.isActiveLocked=i.isLock),i.autoHide===!1||i.isLock===!0||r.isActiveLocked){this._clearUserTimer();return}var o=i&&i.delay?i.delay:this.config.inactive;this.userTimer=h.setTimeout(this,function(){e.userTimer=null,e.blur()},o)}},{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 o=this.config.closePauseVideoFocus;this.isActive=!1,(r||o||!this.paused&&!this.ended)&&this.addClass(w.INACTIVE)}}},{key:"onEmptied",value:function(){this.updateAcc("emptied")}},{key:"onCanplay",value:function(){this.removeClass(w.ENTER),this.removeClass(w.ERROR),this.removeClass(w.LOADING),this.isCanplay=!0,this.waitTimer&&h.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(Te,function(){e._seekToStartTime()}))}},{key:"onLoadstart",value:function(){this.removeClass(w.ERROR),this.isCanplay=!1}},{key:"onPlay",value:function(){this.state===j.ENDED&&this.setState(j.RUNNING),this.removeClass(w.PAUSED),this.ended&&this.removeClass(w.ENDED),!this.config.closePlayVideoFocus&&this.focus()}},{key:"onPause",value:function(){this.addClass(w.PAUSED),this.updateAcc("pause"),this.config.closePauseVideoFocus||(this._clearUserTimer(),this.focus())}},{key:"onEnded",value:function(){this.updateAcc("ended"),this.addClass(w.ENDED),this.setState(j.ENDED)}},{key:"onError",value:function(){this.isError=!0,this.updateAcc("error"),this.removeClass(w.NOT_ALLOW_AUTOPLAY),this.removeClass(w.NO_START),this.removeClass(w.ENTER),this.removeClass(w.LOADING),this.addClass(w.ERROR)}},{key:"onSeeking",value:function(){this.isSeeking||this.updateAcc("seeking"),this.isSeeking=!0,this.addClass(w.SEEKING)}},{key:"onSeeked",value:function(){this.isSeeking=!1,this.waitTimer&&h.clearTimeout(this,this.waitTimer),this.removeClass(w.LOADING),this.removeClass(w.SEEKING)}},{key:"onWaiting",value:function(){var e=this;this.waitTimer&&h.clearTimeout(this,this.waitTimer),this.updateAcc("waiting"),this.waitTimer=h.setTimeout(this,function(){e.addClass(w.LOADING),e.emit(du),h.clearTimeout(e,e.waitTimer),e.waitTimer=null},this.config.minWaitDelay)}},{key:"onPlaying",value:function(){var e=this;this.isError=!1;var i=w.NO_START,r=w.PAUSED,o=w.ENDED,u=w.ERROR,l=w.REPLAY,c=w.LOADING,f=[i,r,o,u,l,c];f.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(w.LOADING))&&this.media.readyState>2&&(this.removeClass(w.LOADING),h.clearTimeout(this,this.waitTimer),this.waitTimer=null),!this.paused&&this.state===j.NOTALLOW&&this.duration&&(this.setState(j.RUNNING),this.emit(Fe)),!this._accPlayed.t&&!this.paused&&!this.ended&&(this._accPlayed.t=new Date().getTime())}},{key:"onVolumechange",value:function(){h.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 o=h.typeOf(e)==="String"?e:e.type||"";r.props&&h.typeOf(r.props)!=="Array"&&(r.props=[r.props]),this.emit(Ot,X({eventType:o,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||{},o=r.startDiff,u=o===void 0?0:o,l=r.endDiff,c=l===void 0?0:l,f=this.media.buffered;if(!f||f.length===0||!this.duration)return!0;for(var g=e||this.media.currentTime||.2,p=f.length,v=0;v<p;v++)if(f.start(v)+u<=g&&f.end(v)-c>g)return!0;return!1}},{key:"resizePosition",value:function(){var e=this,i=this.videoPos,r=i.vy,o=i.vx,u=i.h,l=i.w,c=this.videoPos.rotate;if(!(c<0&&u<0&&l<0)){var f=this.videoPos._pi;if(!f&&this.media.videoHeight&&(f=this.media.videoWidth/this.media.videoHeight*100),!!f){this.videoPos.pi=f,c=c<0?0:c;var g={rotate:c},p=0,v=0,y=1,m=Math.abs(c/90),T=this.root,b=this.innerContainer,k=T.offsetWidth,E=b?b.offsetHeight:T.offsetHeight,I={},R=E,O=k;if(m%2===0)y=u>0?100/u:l>0?100/l:1,g.scale=y,p=r>0?(100-u)/2-r:0,g.y=m===2?0-p:p,v=o>0?(100-l)/2-o:0,g.x=m===2?0-v:v,I.width="".concat(O,"px"),I.height="".concat(R,"px"),I.maxWidth="",I.maxHeight="";else if(m%2===1){O=E,R=k;var G=E-k;v=-G/2/O*100,g.x=m===3?v+r/2:v-r/2,p=G/2/R*100,g.y=m===3?p+o/2:p-o/2,g.scale=y,I.width="".concat(O,"px"),I.maxWidth="".concat(O,"px"),I.height="".concat(R,"px"),I.maxHeight="".concat(R,"px")}var H=h.getTransformStyle(g,this.media.style.transform||this.media.style.webkitTransform);I.transform=H,I.webkitTransform=H,Object.keys(I).map(function(M){e.media.style[M]=I[M]})}}}},{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 o=i.plugins[r.toLowerCase()];o&&h.typeOf(o.setConfig)==="Function"&&o.setConfig(e[r])}})}},{key:"playNext",value:function(e){var i=this;this.resetState(),this.setConfig(e),this._currentTime=0,this._duration=0,ve(this,"playnext",function(){i.start(),i.emit(Rt,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,o=r.videoWidth,u=r.videoHeight,l=this.config,c=l.fitVideoSize,f=l.videoFillMode;if((f==="fill"||f==="cover"||f==="contain")&&this.setAttribute("data-xgfill",f),!(!u||!o)){this._videoHeight=u,this._videoWidth=o;var g=this.controls&&this.innerContainer?this.controls.root.getBoundingClientRect().height:0,p=i.width,v=i.height-g,y=parseInt(o/u*1e3,10),m=parseInt(p/v*1e3,10),T=p,b=v,k={};c==="auto"&&m>y||c==="fixWidth"?(b=p/y*1e3,this.config.fluid?k.paddingTop="".concat(b*100/T,"%"):k.height="".concat(b+g,"px")):(c==="auto"&&m<y||c==="fixHeight")&&(T=y*v/1e3,k.width="".concat(T,"px")),!this.fullscreen&&!this.cssfullscreen&&Object.keys(k).forEach(function(I){e.root.style[I]=k[I]}),(f==="fillHeight"&&m<y||f==="fillWidth"&&m>y)&&this.setAttribute("data-xgfill","cover");var E={videoScale:y,vWidth:T,vHeight:b,cWidth:T,cHeight:b+g};this.resizePosition(),this.emit(Le,E)}}}},{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){U.logInfo("setState","state from:".concat(ko[this.state]," to:").concat(ko[e])),this._state=e}},{key:"preProcessUrl",value:function(e,i){var r=this.config,o=r.preProcessUrl,u=r.preProcessUrlOptions,l=Object.assign({},u,i);return!h.isBlob(e)&&typeof o=="function"?o(e,l):{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(j.READY),this.emit("hasstart"))}},{key:"isPlaying",get:function(){return this._state===j.RUNNING||this._state===j.ENDED},set:function(e){e?this.setState(j.RUNNING):this._state>=j.RUNNING&&this.setState(j.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,o=null,u=null;r.list=e,this.emit("resourceReady",e),e.forEach(function(l){var c;((c=i.curDefinition)===null||c===void 0?void 0:c.definition)===l.definition&&(o=l),r.defaultDefinition===l.definition&&(u=l)}),!u&&e.length>0&&(u=e[0]),o?this.changeDefinition(o):u&&this.changeDefinition(u)}},{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=Ze.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(Ze.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 dr}},{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(D(n.prototype),"readyState",this)}},{key:"error",get:function(){var e=F(D(n.prototype),"error",this);return this.i18n[e]||e}},{key:"networkState",get:function(){return F(D(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=h.convertDeg(e),!(e%90!==0||e===this.videoPos.rotate)&&(this.videoPos.rotate=e,this.resizePosition())}},{key:"avgSpeed",get:function(){return wo},set:function(e){wo=e}},{key:"realTimeSpeed",get:function(){return To},set:function(e){To=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 Mt.call.apply(Mt,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,i){return Nt.call.apply(Nt,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,i){return Ft.call.apply(Ft,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"usePluginHooks",value:function(e,i,r){for(var o=arguments.length,u=new Array(o>3?o-3:0),l=3;l<o;l++)u[l-3]=arguments[l];return go.call.apply(go,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removePluginHooks",value:function(e,i,r){for(var o=arguments.length,u=new Array(o>3?o-3:0),l=3;l<o;l++)u[l-3]=arguments[l];return po.call.apply(po,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"setUserActive",value:function(e,i){var r;typeof i=="boolean"&&i!==this.muted&&(this.addInnerOP("volumechange"),h.typeOf(i)===Boolean&&(this.muted=i)),(r=Se)===null||r===void 0||r.setActive(this.playerId,e)}}],[{key:"debugger",get:function(){return U.config.debug},set:function(e){U.config.debug=e}},{key:"instManager",get:function(){return Se},set:function(e){Se=e}},{key:"getCurrentUserActivePlayerId",value:function(){var e;return(e=Se)===null||e===void 0?void 0:e.getActiveId()}},{key:"setCurrentUserActive",value:function(e,i){var r;(r=Se)===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})(Vf);C(Yt,"defaultPreset",null);C(Yt,"XgVideoProxy",null);Yt.instManager=xu.getInstance();function Re(s,a,n){try{return' <div class="xg-tips '.concat(n?"hide":" ",'" lang-key="').concat(s.i18nKeys[a],`">
13
+ `).concat(s.i18n[a],`
14
+ </div>`)}catch{return'<div class="xg-tips hide"></div>'}}var je=(function(s){A(n,s);var a=L(n);function n(){var t;S(this,n);for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return t=a.call.apply(a,[this].concat(i)),C(_(t),"_onMouseenter",function(o){t.emit("icon_mouseenter",{pluginName:t.pluginName})}),C(_(t),"_onMouseLeave",function(o){t.emit("icon_mouseleave",{pluginName:t.pluginName})}),t}return x(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})(q);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 lh(){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 mr=(function(s){A(n,s);var a=L(n);function n(){return S(this,n),a.apply(this,arguments)}return x(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(D(n.prototype),"afterCreate",this).call(this),!this.config.disable&&(this.config.target&&(this.playerConfig.fullscreenTarget=this.config.target),this.initIcons(),this.on(Lt,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:lh,class:"xg-exit-cssfull"}}}},{key:"destroy",value:function(){F(D(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(Re(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 ch(){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 fh=(function(s){A(n,s);var a=L(n);function n(){return S(this,n),a.apply(this,arguments)}return x(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:ch,class:"xg-fullscreen-back"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(this.root,e.screenBack)}},{key:"show",value:function(){h.addClass(this.root,"show")}},{key:"hide",value:function(){h.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})(q);function hh(){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 dh(){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 Iu=(function(s){A(n,s);var a=L(n);function n(){var t;S(this,n);for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return t=a.call.apply(a,[this].concat(i)),C(_(t),"_onOrientationChange",function(o){t.player.fullscreen&&t.config.rotateFullscreen&&(window.orientation===90||window.orientation===-90?t.player.setRotateDeg(0):t.player.setRotateDeg(90))}),t}return x(n,[{key:"afterCreate",value:function(){var e=this;F(D(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 o=h.getFullScreenEl();r.fullscreenTarget===o&&this.player.getFullscreen().catch(function(u){}),this.initIcons(),this.handleFullscreen=this.hook("fullscreenChange",this.toggleFullScreen,{pre:function(l){var c=e.player.fullscreen;e.emitUserAction(l,"switch_fullscreen",{prop:"fullscreen",from:c,to:!c})}}),this.bind(".xgplayer-fullscreen",["touchend","click"],this.handleFullscreen),this.on(_e,function(u){var l=e.find(".xg-tips");l&&e.changeLangTextKey(l,u?e.i18nKeys.EXITFULLSCREEN_TIPS:e.i18nKeys.FULLSCREEN_TIPS),e.animate(u)}),this.config.needBackIcon&&(this.topBackIcon=this.player.registerPlugin({plugin:fh,options:{config:{onClick:function(l){e.handleFullscreen(l)}}}})),B.device==="mobile"&&window.addEventListener("orientationchange",this._onOrientationChange)}}},{key:"registerIcons",value:function(){return{fullscreen:{icon:hh,class:"xg-get-fullscreen"},exitFullscreen:{icon:dh,class:"xg-exit-fullscreen"}}}},{key:"destroy",value:function(){F(D(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,o=r.useCssFullscreen===!0||typeof r.useCssFullscreen=="function"&&r.useCssFullscreen();o?(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(u){}),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(Re(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 jr(){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 Vr(){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 Pu=(function(s){A(n,s);var a=L(n);function n(){var t;S(this,n);for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return t=a.call.apply(a,[this].concat(i)),C(_(t),"btnClick",function(o){o.preventDefault(),o.stopPropagation();var u=_(t),l=u.player;return t.emitUserAction(o,"switch_play_pause",{prop:"paused",from:l.paused,to:!l.paused}),l.ended?l.replay():l.paused?(l.play(),t.animate(!1)):(l.pause(),t.animate(!0)),!1}),t}return x(n,[{key:"afterCreate",value:function(){F(D(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([ue,Qe,ft,Ue],function(){e.animate(i.paused)})}},{key:"registerIcons",value:function(){return{play:{icon:jr,class:"xg-icon-play"},pause:{icon:Vr,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(D(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(Re(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),gh=[{tag:"xg-cache",className:"xgplayer-progress-cache",styleKey:"cachedColor"},{tag:"xg-played",className:"xgplayer-progress-played",styleKey:"playedColor"}],ph=(function(){function s(a){S(this,s),this.fragments=a.fragments||[],this.fragments.length===0&&this.fragments.push({percent:1}),this._callBack=a.actionCallback,this.fragConfig={fragFocusClass:a.fragFocusClass||"inner-focus-point",fragAutoFocus:!!a.fragAutoFocus,fragClass:a.fragClass||""},this.style=a.style||{playedColor:"",cachedColor:"",progressColor:""},this.duration=0,this.cachedIndex=0,this.playedIndex=0,this.focusIndex=-1}return x(s,[{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,o=t.curIndex,u=t.millisecond;r!==o&&e.map(function(f,g){g<r?f[n].style.width="100%":g>r&&(f[n].style.width=0)});var l=i[r],c=u===0?0:(u-l.start)/l.duration;e[r][n].style.width=c<0?0:"".concat(c*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(h.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(h.typeOf(n.cached)!=="Undefined"){var o=this.findIndex(n.cached*1e3,i);if(o<0)return;this.updateProgress("cached",{newIndex:o,curIndex:i,millisecond:parseInt(n.cached*1e3,10)}),this.cachedIndex=o}}},{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(h.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++)h.removeClass(n[t],this.fragConfig.fragFocusClass)}},{key:"setHightLight",value:function(n){var t=this.root.children;if(n<t.length)return h.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=h.createDom("xg-inners","",{},"progress-list")),this.fragments){var e=this.fragConfig,i=e.fragClass,r=e.fragFocusClass;this.progressList=this.fragments.map(function(o){var u=h.createDom("xg-inner","",{style:t?"background:".concat(t,"; flex: ").concat(o.percent):"flex: ".concat(o.percent)},"".concat(o.isFocus?r:""," xgplayer-progress-inner ").concat(i));return n.root.appendChild(u),gh.forEach(function(l){u.appendChild(h.createDom(l.tag,"",{style:l.styleKey?"background: ".concat(n.style[l.styleKey],"; width:0;"):"width:0;"},l.className))}),{cached:u.children[0],played:u.children[1]}})}return this.root}}]),s})(),Eo={POINT:"inner-focus-point",HIGHLIGHT:"inner-focus-highlight"},Au=(function(s){A(n,s);var a=L(n);function n(t){var e;return S(this,n),e=a.call(this,t),C(_(e),"onMoveOnly",function(i,r){var o=_(e),u=o.pos,l=o.config,c=o.player,f=r;if(i){h.event(i);var g=h.getEventPos(i,c.zoom),p=c.rotateDeg===90?g.clientY:g.clientX;if(u.moving&&Math.abs(u.x-p)<l.miniMoveStep)return;u.moving=!0,u.x=p,f=e.computeTime(i,p)}e.triggerCallbacks("dragmove",f,i),e._updateInnerFocus(f)}),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 o=_(e),u=o.pos;u.moving&&e.updateWidth(r.currentTime,r.seekTime,r.percent,2)}),C(_(e),"_mouseMoveHandler",function(i,r){var o=_(e),u=o._state,l=o.pos,c=o.config,f=o.player;u.time<r.currentTime?r.forward=!0:r.forward=!1,u.time=r.currentTime,l.isDown&&!l.moving&&(l.moving=!0,c.isPauseMoving&&f.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),o=r._state,u=r.player,l=r.pos,c=r.config,f=r.playerConfig,g=h.getEventPos(i,u.zoom),p=u.rotateDeg===90?g.clientY:g.clientX;if(!(u.isMini||c.closeMoveSeek||!f.allowSeekAfterEnded&&u.ended)){if(!u.duration&&!u.isPlaying){u.play();return}i.stopPropagation(),e.focus(),h.checkIsFunction(f.disableSwipeHandler)&&f.disableSwipeHandler(),h.checkIsFunction(c.onMoveStart)&&c.onMoveStart(),h.event(i),l.x=p,l.isDown=!0,l.moving=!1,o.prePlayTime=u.currentTime,u.focus({autoHide:!1}),e.isProgressMoving=!0,h.addClass(e.progressBtn,"active");var v=e.computeTime(i,p);v.prePlayTime=o.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),o=r.player,u=r.config,l=r.pos,c=r.playerConfig,f=r._state;if(l){i.stopPropagation(),i.preventDefault(),h.checkIsFunction(c.enableSwipeHandler)&&c.enableSwipeHandler(),h.checkIsFunction(u.onMoveEnd)&&u.onMoveEnd(),h.event(i),h.removeClass(e.progressBtn,"active");var g=e.computeTime(i,l.x);g.prePlayTime=f.prePlayTime,l.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),l.moving=!1,l.isDown=!1,l.x=0,l.y=0,l.isLocked=!0,f.prePlayTime=0,f.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),l.isEnter?c.isMobileSimulateMode!=="mobile"&&e.bind("mousemove",e.onMoveOnly):e.onMouseLeave(i)),h.setTimeout(_(e),function(){e.resetSeekState()},1),o.focus()}}),C(_(e),"onMouseMove",function(i){var r=_(e),o=r._state,u=r.pos,l=r.player,c=r.config;h.checkTouchSupport()&&i.preventDefault(),h.event(i);var f=h.getEventPos(i,l.zoom),g=l.rotateDeg===90?f.clientY:f.clientX,p=Math.abs(u.x-g);if(!(u.moving&&p<c.miniMoveStep||!u.moving&&p<c.miniStartStep)){u.x=g;var v=e.computeTime(i,g);v.prePlayTime=o.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),o=r.player,u=r.pos;if(!(u.isDown||u.isEnter||o.isMini||!o.config.allowSeekAfterEnded&&o.ended)){u.isEnter=!0,e.bind("mousemove",e.onMoveOnly),e.bind("mouseleave",e.onMouseLeave),h.event(i);var l=h.getEventPos(i,o.zoom),c=o.rotateDeg===90?l.clientY:l.clientX,f=e.computeTime(i,c);e.triggerCallbacks("mouseenter",f,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,o=i.isDown,u=i.isEnter;if(u&&!o){var l=e.computeTime(null,r);e.onMoveOnly(null,l)}}),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 x(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 o=X(X({fragments:i},r),{},{actionCallback:function(l){e.emitUserAction("fragment_focus","fragment_focus",l)}});this.innerList?this.innerList.reset(o):(this.innerList=new ph(o),this.outer.insertBefore(this.innerList.render(),this.outer.children[0]),["findHightLight","unHightLight","setHightLight","findFragment"].map(function(u){e[u]=e.innerList[u].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,o=e.fragClass;this._initInner(this.config.fragments,{fragFocusClass:i,fragAutoFocus:r,fragClass:o,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(Te,function(){e.onMouseLeave()}),this.on(oe,function(){e.onTimeupdate()}),this.on(be,function(){e.onTimeupdate(),e.onCacheUpdate()}),this.on(uu,function(){e.onCacheUpdate()}),this.on(He,function(){e.onCacheUpdate(!0),e.onTimeupdate(!0),e._state.now=0}),this.on(Ue,function(){e.onReset()}),this.on(Le,function(){e.onVideoResize()})}},{key:"setConfig",value:function(e){var i=this,r=null;Object.keys(e).forEach(function(o){i.config[o]=e[o],o==="fragments"&&(r=e[o])}),r&&this._initInner(r,e)}},{key:"initCustomStyle",value:function(){var e=this.playerConfig||{},i=e.commonStyle,r=i.sliderBtnStyle,o=this.progressBtn;r&&(typeof r=="string"?o.style.boxShadow=r:ie(r)==="object"&&Object.keys(r).map(function(u){o.style[u]=r[u]}))}},{key:"triggerCallbacks",value:function(e,i,r){this.__dragCallBacks.length>0&&this.__dragCallBacks.map(function(o){if(o&&o.handler&&o.type===e)try{o.handler(i,r)}catch(u){console.error("[XGPLAYER][triggerCallbacks] ".concat(o," error"),u)}})}},{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,o=-1;r.map(function(u,l){u&&u.type===e&&u.handler===i&&(o=l)}),o>-1&&r.splice(o,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(),h.addClass(this.root,"active")}},{key:"blur",value:function(){this._disableBlur||(this.player.controls.recoverAutoHide(),h.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,o){var u=this.config,l=this.player;if(!(u.isCloseClickSeek&&o===0)){var c=i=i>=l.duration?l.duration-u.endedDiff:Number(i).toFixed(1);this.updatePercent(r),this.updateTime(e),!(o===1&&(!u.isDraggingSeek||l.config.mediaType==="audio"))&&(this._state.now=c,this._state.direc=c>l.currentTime?0:1,l.seek(c))}}},{key:"computeTime",value:function(e,i){var r=this.player,o=this.root.getBoundingClientRect(),u=o.width,l=o.height,c=o.top,f=o.left,g,p,v=i;r.rotateDeg===90?(g=l,p=c):(g=u,p=f);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 T=parseInt(m*this.offsetDuration*1e3,10)/1e3,b=h.getCurrentTimeByOffset(T,r.timeSegments);return{percent:m,currentTime:T,seekTime:b,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 o=i.plugins.time;o&&o.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,o=this.offsetDuration;if(!(i.isSeeking&&i.media.seeking||this.isProgressMoving||!i.hasStart)){if(r.now>-1){var u=parseInt(r.now*1e3,10)-parseInt(i.currentTime*1e3,10);if(r.direc===0&&u>300||r.direc===1&&u>-300){r.now=-1;return}else r.now=-1}var l=this.currentTime;l=h.adjustTimeByDuration(l,o,e),this.innerList.update({played:l},o),this.progressBtn.style.left="".concat(l/o*100,"%")}}},{key:"onCacheUpdate",value:function(e){var i=this.player,r=this.duration;if(i){var o=i.bufferedPoint.end;o=h.adjustTimeByDuration(o,r,e),this.innerList.update({cached:o},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:Eo.POINT,fragClass:"",fragAutoFocus:!1,miniMoveStep:5,miniStartStep:2,onMoveStart:function(){},onMoveEnd:function(){},endedDiff:.2}}},{key:"FRAGMENT_FOCUS_CLASS",get:function(){return Eo}}]),n})(q),Lu=(function(s){A(n,s);var a=L(n);function n(t){var e;return S(this,n),e=a.call(this,t),e.isActiving=!1,e}return x(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([Te,be,oe],function(i){i.eventName==="durationchange"&&(e.isActiving=!1),e.onTimeUpdate()}),this.on(He,function(){e.onTimeUpdate(!0)}),this.on(Ue,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,o=this.duration;if(!(r.disable||this.isActiving||!i.hasStart)){var u=this.currentTime+this.timeOffset;u=h.adjustTimeByDuration(u,o,e),this.mode==="flex"?(this.centerCurDom.innerHTML=this.minWidthTime(h.format(u)),o!==1/0&&o>0&&(this.centerDurDom.innerHTML=h.format(o))):(this.timeDom.innerHTML=this.minWidthTime(h.format(u)),o!==1/0&&o>0&&(this.durationDom.innerHTML=h.format(o)))}}},{key:"onReset",value:function(){this.mode==="flex"?(this.centerCurDom.innerHTML=this.minWidthTime(h.format(0)),this.centerDurDom.innerHTML=h.format(0)):(this.timeDom.innerHTML=this.minWidthTime(h.format(0)),this.durationDom.innerHTML=h.format(0))}},{key:"createCenterTime",value:function(){var e=this.player;if(!(!e.controls||!e.controls.center)){var i=e.controls.center;this.centerCurDom=h.createDom("xg-icon","00:00",{},"xgplayer-time xg-time-left"),this.centerDurDom=h.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?(h.hide(this.durationDom),h.hide(this.timeDom),h.hide(this.find(".time-separator")),h.show(this.find(".time-live-tag"))):h.hide(this.find(".time-live-tag")),e.hide){this.hide();return}this.show()}},{key:"changeLiveState",value:function(e){e?(h.hide(this.durationDom),h.hide(this.timeDom),h.hide(this.find(".time-separator")),h.show(this.find(".time-live-tag"))):(h.hide(this.find(".time-live-tag")),h.show(this.find(".time-separator")),h.show(this.durationDom),h.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(h.format(e));return}this.timeDom.innerHTML=this.minWidthTime(h.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(be,r),i.isSeeking&&i.media.seeking?this.once(be,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})(q);function vh(){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 mh(){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 yh(){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 Du=(function(s){A(n,s);var a=L(n);function n(){var t;S(this,n);for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return t=a.call.apply(a,[this].concat(i)),C(_(t),"onBarMousedown",function(o){var u=_(t),l=u.player,c=t.find(".xgplayer-bar");h.event(o);var f=c.getBoundingClientRect(),g=h.getEventPos(o,l.zoom),p=f.height-(g.clientY-f.top);if(g.h=p,g.barH=f.height,t.pos=g,!(p<-2))return t.updateVolumePos(p,o),document.addEventListener("mouseup",t.onBarMouseUp),t._d.isStart=!0,!1}),C(_(t),"onBarMouseMove",function(o){var u=_(t),l=u._d;if(l.isStart){var c=_(t),f=c.pos,g=c.player;o.preventDefault(),o.stopPropagation(),h.event(o);var p=h.getEventPos(o,g.zoom);l.isMoving=!0;var v=f.h-p.clientY+f.clientY;v>f.barH||t.updateVolumePos(v,o)}}),C(_(t),"onBarMouseUp",function(o){h.event(o),document.removeEventListener("mouseup",t.onBarMouseUp);var u=_(t),l=u._d;l.isStart=!1,l.isMoving=!1}),C(_(t),"onMouseenter",function(o){t._d.isActive=!0,t.focus(),t.emit("icon_mouseenter",{pluginName:t.pluginName})}),C(_(t),"onMouseleave",function(o){t._d.isActive=!1,t.unFocus(100,!1,o),t.emit("icon_mouseleave",{pluginName:t.pluginName})}),C(_(t),"onVolumeChange",function(o){if(t.player){var u=t.player,l=u.muted,c=u.volume;t._d.isMoving||(t.find(".xgplayer-drag").style.height=l||c===0?"4px":"".concat(c*100,"%"),t.config.showValueLabel&&t.updateVolumeValue()),t.animate(l,c)}}),t}return x(n,[{key:"registerIcons",value:function(){return{volumeSmall:{icon:mh,class:"xg-volume-small"},volumeLarge:{icon:vh,class:"xg-volume"},volumeMuted:{icon:yh,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,o=i.volume;r.volumeColor&&(this.find(".xgplayer-drag").style.backgroundColor=r.volumeColor),this.changeMutedHandler=this.hook("mutedChange",function(u){e.changeMuted(u)},{pre:function(l){l.preventDefault(),l.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(su,this.onVolumeChange),this.once(ke,this.onVolumeChange),h.typeOf(o)!=="Number"&&(this.player.volume=this.config.default),this.onVolumeChange()}}},{key:"updateVolumePos",value:function(e,i){var r=this.player,o=this.find(".xgplayer-drag"),u=this.find(".xgplayer-bar");if(!(!u||!o)){var l=parseInt(e/u.getBoundingClientRect().height*1e3,10);o.style.height="".concat(e,"px");var c=Math.max(Math.min(l/1e3,1),0),f={volume:{from:r.volume,to:c}};r.muted&&(f.muted={from:!0,to:!1}),this.emitUserAction(i,"change_volume",{muted:r.muted,volume:r.volume,props:f}),r.volume=Math.max(Math.min(l/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,o=this.find(".xgplayer-value-label"),u=Math.max(Math.min(i,1),0);o.innerText=r?0:Math.round(u*100)}},{key:"focus",value:function(){var e=this.player;e.focus({autoHide:!1}),this._timerId&&(h.clearTimeout(this,this._timerId),this._timerId=null),h.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,o=arguments.length>2?arguments[2]:void 0,u=this._d,l=this.player;u.isActive||(this._timerId&&(h.clearTimeout(this,this._timerId),this._timerId=null),this._timerId=h.setTimeout(this,function(){u.isActive||(r?l.blur():l.focus(),h.removeClass(e.root,"slide-show"),u.isStart&&e.onBarMouseUp(o)),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&&(h.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})(q);function te(){return new Date().getTime()}var xe={LOAD_START:"loadstart",LOADED_DATA:"loadeddata",FIRST_FRAME:"firstFrame",WAIT_START:"waitingStart",WAIT_END:"waitingEnd",SEEK_START:"seekStart",SEEK_END:"seekEnd"},_h=(function(s){A(n,s);var a=L(n);function n(){var t;S(this,n);for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return t=a.call.apply(a,[this].concat(i)),C(_(t),"_onTimeupdate",function(){t._state.isTimeUpdate=!0,t._state.autoplayStart&&(U.logInfo("[xgLogger]".concat(t.player.playerId," _onTimeupdate")),t._sendFF("onTimeupdate"))}),C(_(t),"_onAutoplayStart",function(){U.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&&h.clearTimeout(_(t),t._waitTimer),t._waittTimer&&h.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(xe.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(xe.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=h.setTimeout(_(t),function(){t._isWaiting&&(t.waitingStart=te(),h.clearTimeout(_(t),t._waitTimer),t._waitTimer=null,t._startWaitTimeout(),t.emitLog(xe.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 x(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(Or,function(){var i=e._state,r=i.autoplayStart,o=i.isFFSend;e.startCostTime=te()-e.newPointTime,U.logInfo("[xgLogger]".concat(e.player.playerId," LOAD_START"),"autoplayStart:".concat(r," isFFSend:").concat(o," startCostTime:").concat(e.startCostTime," newPointTime").concat(e.newPointTime)),!o&&(!i.isLs&&e.emitLog(xe.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(ke,function(){e.vt=te(),e.fvt=e.vt-e.pt,e.loadedCostTime=e.vt-e.newPointTime;var i=e._state,r=i.isTimeUpdate,o=i.isFFSend,u=i.autoplayStart;U.logInfo("[xgLogger]".concat(e.player.playerId," LOADED_DATA"),"fvt:".concat(e.fvt," isTimeUpdate:").concat(e._state.isTimeUpdate," loadedCostTime:").concat(e.loadedCostTime)),(r||u)&&e._sendFF("loadedData"),o||e.emitLog(xe.LOADED_DATA,{}),e.suspendWaitingStatus("loadeddata")}),this.on(Gt,this._onSeeking),this.on(be,this._onSeeked),this.on(Br,function(){e.endState("destroy")}),this.on(Kt,function(){e.endState("urlChange"),U.logInfo("[xgLogger]".concat(e.player.playerId," URL_CHANGE")),e._state.isFFSend&&e._onReset()}),this.on([Rr,Ce],this._onPlaying),this.on(ht,this._onWaiting),this.on(ft,this._onError),this.on($t,function(){U.logInfo("[xgLogger]".concat(e.player.playerId," RESET")),e.endState("reset"),e._initOnceEvents(),e._onReset()})}},{key:"_initOnceEvents",value:function(){this.off(Fe,this._onAutoplayStart),this.off(oe,this._onTimeupdate),this.once(Fe,this._onAutoplayStart),this.once(oe,this._onTimeupdate)}},{key:"_sendFF",value:function(e){this.s=te();var i=this._state,r=i.isFFLoading,o=i.isFFSend;U.logInfo("[xgLogger]".concat(this.player.playerId," _sendFF"),"".concat(e," fvt:").concat(this.fvt," isFFLoading:").concat(r," !isFFSend:").concat(!o)),this.vt>0&&r&&!o&&(U.logInfo("[xgLogger]".concat(this.player.playerId," emitLog_firstFrame"),e),this._state.isFFLoading=!1,this._state.isFFSend=!0,this.emitLog(xe.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&&h.clearTimeout(this,this._waittTimer),this._waittTimer=h.setTimeout(this,function(){e.suspendWaitingStatus("timeout"),h.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(xe.SEEK_END,{end:i,costTime:r,endType:e})}}},{key:"suspendWaitingStatus",value:function(e){if(this._waitTimer&&(h.clearTimeout(this,this._waitTimer),this._waitTimer=null),this._waittTimer&&(h.clearTimeout(this,this._waittTimer),this._waittTimer=null),this._isWaiting=!1,!!this.waitingStart){var i=te(),r=i-this.waitingStart,o=i-this.fixedWaitingStart,u=this.config.waitTimeout;this._isWaiting=!1,this.waitingStart=0,this.fixedWaitingStart=0,this.emitLog(xe.WAIT_END,{fixedCostTime:o>u?u:o,costTime:r>u?u: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(mu,X({t:te(),host:h.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})(q);function Ch(){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 bh=(function(s){A(n,s);var a=L(n);function n(){return S(this,n),a.apply(this,arguments)}return x(n,[{key:"registerIcons",value:function(){return{replay:Ch}}},{key:"afterCreate",value:function(){var e=this;q.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(He,function(){if(e.playerConfig.loop||h.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(ue,function(){e.hide()})}},{key:"handleReplay",value:function(e){e.preventDefault(),e.stopPropagation(),this.player.replay(),h.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})(q),kh=(function(s){A(n,s);var a=L(n);function n(){return S(this,n),a.apply(this,arguments)}return x(n,[{key:"isEndedShow",get:function(){return this.config.isEndedShow},set:function(e){this.config.isEndedShow=e}},{key:"hide",value:function(){h.addClass(this.root,"hide")}},{key:"show",value:function(e){h.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(He,function(){e.isEndedShow&&h.removeClass(e.root,"hide")}),this.config.hideCanplay?(this.once(oe,function(){e.onTimeUpdate()}),this.on(Kt,function(){h.removeClass(e.root,"hide"),h.addClass(e.root,"xg-showplay"),e.once(oe,function(){e.onTimeUpdate()})})):this.on(ue,function(){h.addClass(e.root,"hide")})}},{key:"setConfig",value:function(e){var i=this;Object.keys(e).forEach(function(o){i.config[o]=e[o]});var r=this.config.poster;this.update(r)}},{key:"onTimeUpdate",value:function(){var e=this;this.player.currentTime?h.removeClass(this.root,"xg-showplay"):this.once(oe,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,o=e.fillMode,u=e.notHidden,l=this.getBgSize(o),c=i?"background-image:url(".concat(i,");").concat(l):l,f=u?"xg-not-hidden":r?"xg-showplay":"";return'<xg-poster class="xgplayer-poster '.concat(f,'" style="').concat(c,`">
88
+ </xg-poster>`)}}],[{key:"pluginName",get:function(){return"poster"}},{key:"defaultConfig",get:function(){return{isEndedShow:!0,hideCanplay:!1,notHidden:!1,poster:"",fillMode:"fixWidth"}}}]),n})(q),pe={};function Th(s,a){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{start:null,end:null};return pe[s]&&window.clearTimeout(pe[s].id),pe[s]={},n.start&&n.start(),pe[s].id=window.setTimeout(function(){n.end&&n.end(),window.clearTimeout(pe[s].id),delete pe[s]},a),pe[s].id}function So(s){if(s){window.clearTimeout(s);return}Object.keys(pe).map(function(a){window.clearTimeout(pe[a].id),delete pe[a]})}var wh=(function(s){A(n,s);var a=L(n);function n(t){var e;return S(this,n),e=a.call(this,t),C(_(e),"onPlayerReset",function(){e.autoPlayStart=!1;var i=e.config.mode==="auto"?"auto-hide":"hide";e.setAttr("data-state","play"),h.removeClass(e.root,i),e.show()}),C(_(e),"onAutoplayStart",function(){if(!e.autoPlayStart){var i=e.config.mode==="auto"?"auto-hide":"hide";h.addClass(e.root,i),e.autoPlayStart=!0,e.toggleTo("play")}}),e.autoPlayStart=!1,e}return x(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(Nr,function(){r&&(r.lang&&r.lang==="en"?h.addClass(i.root,"lang-is-en"):r.lang==="jp"&&h.addClass(i.root,"lang-is-jp"))}),this.on(Fe,this.onAutoplayStart),this.on(Fr,function(){var o=e.config.mode==="auto"?"auto-hide":"hide";e.setAttr("data-state","play"),h.removeClass(e.root,o),e.show()}),this.on(ue,function(){e.toggleTo("play")}),this.on(Qe,function(){e.toggleTo("pause")}),this.on($t,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 o=e.player.paused;e.emitUserAction(r,"switch_play_pause",{props:"paused",from:o,to:!o})}}),this.bind(["click","touchend"],this.clickHandler)}},{key:"registerIcons",value:function(){return{startPlay:{icon:jr,class:"xg-icon-play"},startPause:{icon:Vr,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(){h.addClass(this.root,"hide")}},{key:"show",value:function(e){h.removeClass(this.root,"hide")}},{key:"focusHide",value:function(){h.addClass(this.root,"focus-hide")}},{key:"recover",value:function(){h.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=Th("pauseplay",400,{start:function(){h.addClass(i.root,"interact"),i.show(),i.switchStatus(!0)},end:function(){h.removeClass(i.root,"interact"),!e&&i.hide(),i._animateId=null}})}},{key:"endAnimate",value:function(){h.removeClass(this.root,"interact"),So(this._animateId),this._animateId=null}},{key:"switchPausePlay",value:function(e){var i=this.player;if(e.cancelable&&e.preventDefault(),e.stopPropagation(),!(i.state<j.READY)){var r=this.player.paused;!r&&i.state===j.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<j.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),So(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})(q),Eh=(function(s){A(n,s);var a=L(n);function n(){return S(this,n),a.apply(this,arguments)}return x(n,[{key:"render",value:function(){var e=this.config.innerHtml,i=h.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="",o=1;o<=12;o++)r+='<div class="xgplayer-enter-bar'.concat(o,'"></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})(q),xo=(function(s){A(n,s);var a=L(n);function n(){return S(this,n),a.apply(this,arguments)}return x(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})(q);function Io(s){var a=parseFloat(s),n=s.indexOf("%")===-1&&!Number.isNaN(a);return n&&a}var qr=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],Ru=qr.length;function Sh(){for(var s={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},a=0;a<Ru;a++){var n=qr[a];s[n]=0}return s}function xh(s){var a=window.getComputedStyle(s);return a}function Po(s){if(typeof s=="string"&&(s=document.querySelector(s)),!(!s||ie(s)!=="object"||!s.nodeType)){var a=xh(s);if(a.display==="none")return Sh();var n={};n.width=s.offsetWidth,n.height=s.offsetHeight;for(var t=n.isBorderBox=a.boxSizing==="border-box",e=0;e<Ru;e++){var i=qr[e],r=a[i],o=parseFloat(r);n[i]=Number.isNaN(o)?0:o}var u=n.paddingLeft+n.paddingRight,l=n.paddingTop+n.paddingBottom,c=n.marginLeft+n.marginRight,f=n.marginTop+n.marginBottom,g=n.borderLeftWidth+n.borderRightWidth,p=n.borderTopWidth+n.borderBottomWidth,v=t,y=Io(a.width);y!==!1&&(n.width=y+(v?0:u+g));var m=Io(a.height);return m!==!1&&(n.height=m+(v?0:l+p)),n.innerWidth=n.width-(u+g),n.innerHeight=n.height-(l+p),n.outerWidth=n.width+c,n.outerHeight=n.height+f,n}}function nr(s,a){for(var n=0;n<s.length;n++){var t=s[n];if(t.identifier===a)return t}}var rr={START:"dragStart",MOVE:"dragMove",ENDED:"dragEnded"},Ao={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]},Ih=(function(s){A(n,s);var a=L(n);function n(t){var e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return S(this,n),e=a.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?Dr(e):(e._bindStartEvent(),e)}return x(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)]),Ao[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=Ao[this._startKey];r.map(function(o){window.addEventListener(o,i["on".concat(o)])}),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=nr(e.changedTouches,this.touchIdentifier);i&&this.dragMove(e,i)}},{key:"ontouchend",value:function(e){var i=nr(e.changedTouches,this.touchIdentifier);i&&this.dragEnd(e,i),e.preventDefault()}},{key:"ontouchcancel",value:function(e){var i=nr(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=Po(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(rr.START,this.startPos)}},{key:"dragEnd",value:function(e,i){this._root&&(this._unbindPostStartEvents(),this.isDragging&&(this._root.style.transform="",this.setLeftTop(),this.emit(rr.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,o=r.x,u=r.y,l=this._dragPointerMove(e,i),c=l.x,f=l.y;c=this.checkContain("x",c,o),f=this.checkContain("y",f,u),this.position.x=o+c,this.position.y=u+f,this.dragPoint.x=c,this.dragPoint.y=f,this.emit(rr.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(","),o=i.indexOf("matrix3d")===0?12:4,u=parseInt(r[o],10),l=parseInt(r[o+1],10);this.position.x+=u,this.position.y+=l}}},{key:"_getPositionCoord",value:function(e,i){if(e.indexOf("%")!==-1){var r=Po(this._root.parentNode);return r?parseFloat(e)/100*r[i]:0}return parseInt(e,10)}}]),n})(ru),Ph=(function(s){A(n,s);var a=L(n);function n(t){var e;S(this,n),e=a.call(this,t),C(_(e),"onCancelClick",function(o){e.exitMini(),e.isClose=!0}),C(_(e),"onCenterClick",function(o){var u=_(e),l=u.player;l.paused?l.play():l.pause()}),C(_(e),"onScroll",function(o){if(!(!window.scrollY&&window.scrollY!==0||Math.abs(window.scrollY-e.pos.scrollY)<50)){var u=parseInt(h.getCss(e.player.root,"height"));u+=e.config.scrollTop,e.pos.scrollY=window.scrollY,window.scrollY>u+5?!e.isMini&&!e.isClose&&e.getMini():window.scrollY<=u&&(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 x(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(Qe,function(){e.setAttr("data-state","pause")}),this.on(ue,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 o={config:{onClick:function(){e.getMini()}}};i.controls.registerPlugin(xo,o,xo.pluginName)}var u=h.checkTouchSupport()?"touchend":"click";this.bind(".mini-cancel-btn",u,this.onCancelClick),this.bind(".play-icon",u,this.onCenterClick),this.config.disableDrag||(this._draggabilly=new Ih(this.player.root,{handle:this.root})),this.config.isScrollSwitch&&window.addEventListener("scroll",this.onScroll)}}},{key:"registerIcons",value:function(){return{play:{icon:jr,class:"xg-icon-play"},pause:{icon:Vr,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,o=this.config.target||this.player.root;this.lastStyle={},h.addClass(i.root,"xgplayer-mini"),["width","height","top","left"].map(function(u){e.lastStyle[u]=o.style[u],o.style[u]="".concat(e.pos[u],"px")}),r.fluid&&(o.style["padding-top"]=""),this.emit(Dt,!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,o=this.config.target||this.player.root;h.removeClass(i.root,"xgplayer-mini"),this.lastStyle&&Object.keys(this.lastStyle).map(function(u){o.style[u]=e.lastStyle[u]}),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(Dt,!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=h.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(Re(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})(q),Et={mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousemove:"onMouseMove"},ar=["videoClick","videoDbClick"],sr=(function(s){A(n,s);var a=L(n);function n(){var t;S(this,n);for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return t=a.call.apply(a,[this].concat(i)),C(_(t),"onMouseMove",function(o){var u=_(t),l=u.player,c=u.playerConfig;l.isActive||(l.focus({autoHide:!c.closeDelayBlur}),!c.closeFocusVideoFocus&&l.media.focus())}),C(_(t),"onMouseEnter",function(o){var u=_(t),l=u.playerConfig,c=u.player;!l.closeFocusVideoFocus&&c.media.focus(),l.closeDelayBlur?c.focus({autoHide:!1}):c.focus(),t.emit(hu)}),C(_(t),"onMouseLeave",function(o){var u=t.playerConfig,l=u.closePlayerBlur,c=u.leavePlayerTime,f=u.closeDelayBlur;!l&&!f&&(c?t.player.focus({autoHide:!0,delay:c}):t.player.blur({ignorePaused:!0})),t.emit(fu)}),C(_(t),"onVideoClick",function(o){var u=_(t),l=u.player,c=u.playerConfig;o.target&&c.closeVideoClick||(o.target===l.root||o.target===l.media||o.target===l.innerContainer||o.target===l.media.__canvas)&&(o.preventDefault(),c.closeVideoStopPropagation||o.stopPropagation(),t._clickCount++,t.clickTimer&&(clearTimeout(t.clickTimer),t.clickTimer=null),t.clickTimer=setTimeout(function(){t._clickCount&&(t._clickCount--,ve(_(t),ar[0],function(f,g){t.switchPlayPause(g.e)},{e:o,paused:l.paused}),clearTimeout(t.clickTimer),t.clickTimer=null)},300))}),C(_(t),"onVideoDblClick",function(o){var u=_(t),l=u.player,c=u.playerConfig;if(!(c.closeVideoDblclick||!o.target||o.target!==l.media&&o.target!==l.media.__canvas)){if(!c.closeVideoClick&&t._clickCount<2){t._clickCount=0;return}t._clickCount=0,t.clickTimer&&(clearTimeout(t.clickTimer),t.clickTimer=null),o.preventDefault(),o.stopPropagation(),ve(_(t),ar[1],function(f,g){t.emitUserAction(g.e,"switch_fullscreen",{props:"fullscreen",from:l.fullscreen,to:!l.fullscreen}),l.fullscreen?l.exitFullscreen():l.getFullscreen()},{e:o,fullscreen:l.fullscreen})}}),t}return x(n,[{key:"afterCreate",value:function(){var e=this;this._clickCount=0,ar.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,o=i.root,u=this.playerConfig.enableContextmenu;o&&o.addEventListener("click",this.onVideoClick,!1),o&&o.addEventListener("dblclick",this.onVideoDblClick,!1),Object.keys(Et).map(function(l){o.addEventListener(l,e[Et[l]],!1)}),!u&&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,o=i.root;this.clickTimer&&clearTimeout(this.clickTimer),o.removeEventListener("click",this.onVideoClick,!1),o.removeEventListener("dblclick",this.onVideoDblClick,!1),r.removeEventListener("contextmenu",this.onContextmenu,!1),Object.keys(Et).map(function(u){o.removeEventListener(u,e[Et[u]],!1)})}}],[{key:"pluginName",get:function(){return"pc"}},{key:"defaultConfig",get:function(){return{}}}]),n})(De),Ie={PRESS:"press",PRESS_END:"pressend",DOUBlE_CLICK:"doubleclick",CLICK:"click",TOUCH_MOVE:"touchmove",TOUCH_START:"touchstart",TOUCH_END:"touchend"},Ah={start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},Lh={start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"};function Lo(s){return s&&s.length>0?s[s.length-1]:null}function Dh(){return{pressDelay:600,dbClickDelay:200,disablePress:!1,disableDbClick:!1,miniStep:2,needPreventDefault:!0}}var Rh=(function(){function s(a){var n=this,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{eventType:"touch"};S(this,s),C(this,"onTouchStart",function(e){var i=n._pos,r=n.root,o=Lo(e.touches);i.x=o?parseInt(o.pageX,10):e.pageX,i.y=o?parseInt(o.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(Ie.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(Ie.PRESS_END,e),n.trigger(Ie.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,o=Lo(e.touches),u=o?parseInt(o.pageX,10):e.pageX,l=o?parseInt(o.pageY,10):e.pageX,c=u-i.x,f=l-i.y;Math.abs(f)<r.miniStep&&Math.abs(c)<r.miniStep||(n.__clearPress(),i.press&&n.trigger(Ie.PRESS_END,e),i.press=!1,i.moving=!0,n.trigger(Ie.TOUCH_MOVE,e))}),this._pos={moving:!1,start:!1,x:0,y:0},this.config=Dh(),Object.keys(t).map(function(e){n.config[e]=t[e]}),this.root=a,this.events=t.eventType==="mouse"?Lh:Ah,this.pressIntrvalId=null,this.dbIntrvalId=null,this.__handlers={},this._initEvent()}return x(s,[{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(Ie.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(Ie.DOUBlE_CLICK,n);return}this.dbIntrvalId=setTimeout(function(){t.__clearDb(),!t._pos.start&&!t._pos.press&&!t._pos.moving&&t.trigger(Ie.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]])})}}]),s})();function Oh(){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 Ge={AUTO:"auto",SEEKING:"seeking",PLAYBACK:"playbackrate"},or=["videoClick","videoDbClick"],Mh=(function(s){A(n,s);var a=L(n);function n(t){var e;return S(this,n),e=a.call(this,t),C(_(e),"onTouchStart",function(i){var r=_(e),o=r.player,u=r.config,l=r.pos,c=r.playerConfig,f=e.getTouche(i);if(f&&!u.disableGesture&&e.duration>0&&!o.ended){l.isStart=!0,e.timer&&clearTimeout(e.timer),h.checkIsFunction(c.disableSwipeHandler)&&c.disableSwipeHandler(),e.find(".xg-dur").innerHTML=h.format(e.duration);var g=e.root.getBoundingClientRect();o.rotateDeg===90?(l.top=g.left,l.left=g.top,l.width=g.height,l.height=g.width):(l.top=g.top,l.left=g.left,l.width=g.width,l.height=g.height);var p=parseInt(f.pageX-l.left,10),v=parseInt(f.pageY-l.top,10);l.x=o.rotateDeg===90?v:p,l.y=o.rotateDeg===90?p:v,l.scopeL=u.scopeL*l.width,l.scopeR=(1-u.scopeR)*l.width,l.scopeM1=l.width*(1-u.scopeM)/2,l.scopeM2=l.width-l.scopeM1}}),C(_(e),"onTouchMove",function(i){var r=e.getTouche(i),o=_(e),u=o.pos,l=o.config,c=o.player;if(!(!r||l.disableGesture||!e.duration||!u.isStart)){var f=l.miniMoveStep,g=l.hideControlsActive,p=parseInt(r.pageX-u.left,10),v=parseInt(r.pageY-u.top,10),y=c.rotateDeg===90?v:p,m=c.rotateDeg===90?p:v;if(Math.abs(y-u.x)>f||Math.abs(m-u.y)>f){var T=y-u.x,b=m-u.y,k=u.scope;if(k===-1&&(k=e.checkScope(y,m,T,b,u),k===0&&(g?c.blur():c.focus({autoHide:!1}),!u.time&&(u.time=parseInt(c.currentTime*1e3,10)+e.timeOffset*1e3)),u.scope=k),k===-1||k>0&&!l.gestureY||k===0&&!l.gestureX)return;e.executeMove(T,b,k,u.width,u.height),u.x=y,u.y=m}}}),C(_(e),"onTouchEnd",function(i){var r=_(e),o=r.player,u=r.pos,l=r.playerConfig;if(setTimeout(function(){o.getPlugin("progress")&&o.getPlugin("progress").resetSeekState()},10),!!u.isStart){u.scope>-1&&i.cancelable&&i.preventDefault();var c=e.config,f=c.disableGesture,g=c.gestureX;!f&&g?e.endLastMove(u.scope):u.time=0,u.scope=-1,e.resetPos(),h.checkIsFunction(l.enableSwipeHandler)&&l.enableSwipeHandler(),e.changeAction(Ge.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 x(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:Oh,class:"xg-seek-pre"}}}},{key:"afterCreate",value:function(){var e=this;or.map(function(g){e.__hooks[g]=null});var i=this.playerConfig,r=this.config,o=this.player;i.closeVideoDblclick===!0&&(r.closedbClick=!0),this.resetPos(),h.isUndefined(i.disableGesture)||(r.disableGesture=!!i.disableGesture),this.appendChild(".xg-seek-icon",this.icons.seekTipIcon),this.xgMask=h.createDom("xg-mask","",{},"xgmask"),o.root.appendChild(this.xgMask),this.initCustomStyle(),this.registerThumbnail();var u=this.domEventType==="mouse"?"mouse":"touch";this.touch=new Rh(this.root,{eventType:u,needPreventDefault:!this.config.disableGesture}),this.root.addEventListener("contextmenu",function(g){g.preventDefault()}),o.root.addEventListener("touchmove",this.onRootTouchMove,!0),o.root.addEventListener("touchend",this.onRootTouchEnd,!0),o.root.addEventListener("touchcancel",this.onRootTouchEnd,!0);var l=this.player.controls;l&&l.center&&(l.center.addEventListener("touchmove",this.onRootTouchMove,!0),l.center.addEventListener("touchend",this.onRootTouchEnd,!0),l.center.addEventListener("touchcancel",this.onRootTouchEnd,!0)),this.on(Te,function(){var g=e.player,p=e.config;g.duration>0&&g.duration*1e3<p.moveDuration&&(p.moveDuration=g.duration*1e3)}),this.on([Ce,He],function(){var g=e.pos,p=g.time,v=g.isStart;!v&&p>0&&(e.pos.time=0)});var c={touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",press:"onPress",pressend:"onPressEnd",click:"onClick",doubleclick:"onDbClick"};if(Object.keys(c).map(function(g){e.touch.on(g,function(p){e[c[g]](p)})}),!r.disableActive){var f=o.plugins.progress;f&&(f.addCallBack("dragmove",function(g){e.activeSeekNote(g.currentTime,g.forward)}),["dragend","click"].forEach(function(g){f.addCallBack(g,function(){e.changeAction(Ge.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,o=i.progressColor,u=i.timePreviewStyle,l=i.curTimeColor,c=i.durationColor;if(r&&(this.find(".xg-curbar").style.backgroundColor=r),o&&(this.find(".xg-bar").style.backgroundColor=o),u){var f=this.find(".time-preview");Object.keys(u).forEach(function(v){f.style[v]=u[v]})}var g=l||r,p=c;g&&(this.find(".xg-cur").style.color=g),p&&(this.find(".xg-dur").style.color=p),this.config.disableTimeProgress&&h.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 o=i.plugins.start;o&&o.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,o,u){var l=u.width,c=-1;if(e<0||e>l)return c;var f=Math.abs(o===0?r:r/o);return Math.abs(r)>0&&f>=1.73&&e>u.scopeM1&&e<u.scopeM2?c=0:(Math.abs(r)===0||f<=.57)&&(c=e<u.scopeL?1:e>u.scopeR?2:3),c}},{key:"executeMove",value:function(e,i,r,o,u){switch(r){case 0:this.updateTime(e/o*this.config.scopeM);break;case 1:this.updateBrightness(i/u);break;case 2:B.os.isIos||this.updateVolume(i/u);break}}},{key:"endLastMove",value:function(e){var i=this,r=this.pos,o=this.player,u=this.config,l=(r.time-this.timeOffset)/1e3;switch(e){case 0:o.seek(Number(l).toFixed(1)),u.hideControlsEnd?o.blur():o.focus(),this.timer=setTimeout(function(){i.pos.time=0},500);break}this.changeAction(Ge.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,o=this.playerConfig;if(i.state<j.RUNNING){o.closeVideoClick||(this.sendUseAction(h.createEvent("click")),i.play());return}!r.closedbClick||o.closeVideoClick?i.isActive?i.blur():i.focus():o.closeVideoClick||((i.isActive||r.focusVideoClick)&&(this.sendUseAction(h.createEvent("click")),this.switchPlayPause()),i.focus())}},{key:"dbClickHandler",value:function(e){var i=this.config,r=this.player;!i.closedbClick&&r.state>=j.RUNNING&&(this.sendUseAction(h.createEvent("dblclick")),this.switchPlayPause())}},{key:"onClick",value:function(e){var i=this,r=this.player;ve(this,or[0],function(o,u){i.clickHandler(u.e)},{e,paused:r.paused})}},{key:"onDbClick",value:function(e){var i=this,r=this.player;ve(this,or[1],function(o,u){i.dbClickHandler(u.e)},{e,paused:r.paused})}},{key:"onPress",value:function(e){var i=this.pos,r=this.config,o=this.player;r.disablePress||(i.rate=this.player.playbackRate,this.emitUserAction("press","change_rate",{prop:"playbackRate",from:o.playbackRate,to:r.pressRate}),o.playbackRate=r.pressRate,this.changeAction(Ge.PLAYBACK))}},{key:"onPressEnd",value:function(e){var i=this.pos,r=this.config,o=this.player;r.disablePress||(this.emitUserAction("pressend","change_rate",{prop:"playbackRate",from:o.playbackRate,to:i.rate}),o.playbackRate=i.rate,i.rate=1,this.changeAction(Ge.AUTO))}},{key:"updateTime",value:function(e){var i=this.player,r=this.config,o=this.player.duration;e=Number(e.toFixed(4));var u=parseInt(e*r.moveDuration,10)+this.timeOffset;u+=this.pos.time,u=u<0?0:u>o*1e3?o*1e3-200:u,i.getPlugin("time")&&i.getPlugin("time").updateTime(u/1e3),i.getPlugin("progress")&&i.getPlugin("progress").updatePercent(u/1e3/this.duration,!0),this.activeSeekNote(u/1e3,e>0),r.isTouchingSeek&&i.seek(Number((u-this.timeOffset)/1e3).toFixed(1)),this.pos.time=u}},{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 o=parseInt(i.volume*10,10)-parseInt(r.volume/10,10);o=o>10?10:o<1?0:o,i.volume=o/10,r.volume=0}}},{key:"updateBrightness",value:function(e){var i=this.pos,r=this.config,o=this.xgMask;if(r.darkness){this.player.rotateDeg&&(e=-e);var u=i.light+.8*e;u=u>r.maxDarkness?r.maxDarkness:u<0?0:u,o&&(o.style.backgroundColor="rgba(0,0,0,".concat(u,")")),i.light=u}}},{key:"activeSeekNote",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this.player,o=this.config,u=!(this.duration!==1/0&&this.duration>0);if(!(!e||typeof e!="number"||u||o.disableActive)){e<0?e=0:e>r.duration&&(e=r.duration-.2),this.changeAction(Ge.SEEKING);var l=r.plugins.start;l&&l.focusHide(),this.find(".xg-dur").innerHTML=h.format(this.duration),this.find(".xg-cur").innerHTML=h.format(e),this.find(".xg-curbar").style.width="".concat(e/this.duration*100,"%"),i?h.removeClass(this.find(".xg-seek-show"),"xg-back"):h.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<j.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})(q);function Nh(s){s.preventDefault(),s.returnValue=!1}function Do(s){var a=s.tagName;return!!(a==="INPUT"||a==="TEXTAREA"||s.isContentEditable)}var Ro=(function(s){A(n,s);var a=L(n);function n(){var t;S(this,n);for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return t=a.call.apply(a,[this].concat(i)),C(_(t),"onBodyKeyDown",function(o){if(t.player){var u=o||window.event,l=u.keyCode,c=_(t),f=c._keyState,g=c.player,p=t.config,v=p.disable,y=p.disableBodyTrigger,m=p.isIgnoreUserActive;if(v||y||!(g.isUserActive||m)||Do(u.target)||!t.checkIsVisible()||u.metaKey||u.altKey||u.ctrlKey){f.isBodyKeyDown=!1;return}!o.repeat&&!f.isKeyDown&&((u.target===document.body||t.config.isGlobalTrigger&&!Do(u.target))&&t.checkCode(l,!0)&&(f.isBodyKeyDown=!0),document.addEventListener("keyup",t.onBodyKeyUp)),f.isBodyKeyDown&&t.handleKeyDown(u)}}),C(_(t),"onBodyKeyUp",function(o){t.player&&(document.removeEventListener("keyup",t.onBodyKeyUp),t.handleKeyUp(o))}),C(_(t),"onKeydown",function(o){if(t.player){var u=o||window.event,l=_(t),c=l._keyState;if(!u.repeat){if(t.config.disable||t.config.disableRootTrigger||u.metaKey||u.altKey||u.ctrlKey)return;u&&(u.keyCode===37||t.checkCode(u.keyCode))&&(u.target===t.player.root||u.target===t.player.video||u.target===t.player.controls.el)&&(c.isKeyDown=!0),t.player.root.addEventListener("keyup",t.onKeyup)}c.isKeyDown&&t.handleKeyDown(u)}}),C(_(t),"onKeyup",function(o){t.player&&(t.player.root.removeEventListener("keyup",t.onKeyup),t.handleKeyUp(o))}),t}return x(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(o){i[r][o]&&(e.keyCodeMap[r][o]=i[r][o])}):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,o=e.bottom,u=window.innerHeight;return!(r<0&&r<0-i*.9||o>0&&o-u>i*.9)}},{key:"checkCode",value:function(e,i){var r=this,o=!1;return Object.keys(this.keyCodeMap).map(function(u){r.keyCodeMap[u]&&e===r.keyCodeMap[u].keyCode&&!r.keyCodeMap[u].disable&&(o=!i||i&&!r.keyCodeMap[u].noBodyTarget)}),o}},{key:"downVolume",value:function(e){var i=this.player;if(!(i.volume<=0)){var r=parseFloat((i.volume-.1).toFixed(1)),o={volume:{from:i.volume,to:r}};this.emitUserAction(e,"change_volume",{props:o}),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)),o={volume:{from:i.volume,to:r}};this.emitUserAction(e,"change_volume",{props:o}),r<=1?i.volume=r:i.volume=1}}},{key:"seek",value:function(e){var i=this.player,r=i.currentTime,o=i.offsetCurrentTime,u=i.duration,l=i.offsetDuration,c=i.timeSegments,f=o>-1?o:r,g=l||u,p=e.repeat&&this.seekStep>=4?parseInt(this.seekStep/2,10):this.seekStep;f+p<=g?f=f+p:f=g;var v=h.getCurrentTimeByOffset(f,c),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,o=i.offsetCurrentTime,u=i.timeSegments,l=e.repeat?parseInt(this.seekStep/2,10):this.seekStep,c=o>-1?o:r,f=c-l;f<0&&(f=0),f=h.getCurrentTimeByOffset(f,u);var g={currentTime:{from:r,to:f}};this.emitUserAction(e,"seek",{props:g}),this.player.currentTime=f}},{key:"changePlaybackRate",value:function(e){var i=this._keyState,r=this.config,o=this.player;i.playbackRate===0&&(i.playbackRate=o.playbackRate,o.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,o=i.cssfullscreen;r&&(this.emitUserAction("keyup","switch_fullscreen",{prop:"fullscreen",from:r,to:!r}),i.exitFullscreen()),o&&(this.emitUserAction("keyup","switch_css_fullscreen",{prop:"cssfullscreen",from:o,to:!o}),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 o=Object.keys(this.keyCodeMap),u=0;u<o.length;u++){var l=this.keyCodeMap[o[u]],c=l.action,f=l.keyCode,g=l.disable,p=l.pressAction,v=l.disablePress;if(f===e){if(!g&&!(r&&v)){var y=r&&p||c;typeof y=="function"?c(i,this.player,r):typeof y=="string"&&typeof this[y]=="function"&&this[y](i,this.player,r),this.emit(vu,X({key:o[u],target:i.target,isPress:r},this.keyCodeMap[o[u]]))}Nh(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})(De);function Fh(){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 Bh=(function(s){A(n,s);var a=L(n);function n(){return S(this,n),a.apply(this,arguments)}return x(n,[{key:"registerIcons",value:function(){return{loadingIcon:Fh}}},{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})(q),Hh=(function(s){A(n,s);var a=L(n);function n(){var t;S(this,n);for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return t=a.call.apply(a,[this].concat(i)),C(_(t),"_onDurationChange",function(){t.updateSegments();var o=t.player,u=o.currentTime,l=o.timeSegments;if(t._checkIfEnabled(l)){var c=h.getIndexByTime(u,l),f=h.getOffsetCurrentTime(u,l,c);t.player.offsetCurrentTime=f,t.changeIndex(c,l)}}),C(_(t),"_onLoadedData",function(){var o=t.player.timeSegments;if(t._checkIfEnabled(o)){var u=h.getOffsetCurrentTime(0,o);t.player.offsetCurrentTime=u,t.changeIndex(0,o),t.curPos.start>0&&(t.player.currentTime=t.curPos.start)}}),C(_(t),"_onTimeupdate",function(){var o=t.player,u=o.currentTime,l=o.timeSegments;if(t._checkIfEnabled(l)){var c=l.length;t.lastCurrentTime=u;var f=h.getIndexByTime(u,l);f!==t.curIndex&&t.changeIndex(f,l);var g=h.getOffsetCurrentTime(u,l,f);if(t.player.offsetCurrentTime=g,!!t.curPos){var p=t.curPos,v=p.start,y=p.end;u<v?t.player.currentTime=v:u>y&&f>=c-1&&t.player.pause()}}}),C(_(t),"_onSeeking",function(){var o=t.player,u=o.currentTime,l=o.timeSegments;if(t._checkIfEnabled(l))if(u<l[0].start)t.player.currentTime=l[0].start;else if(u>l[l.length-1].end)t.player.currentTime=l[l.length-1].end;else{var c=h.getIndexByTime(u,l);if(c>=0){var f=t.getSeekTime(u,t.lastCurrentTime,c,l);f>=0&&(t.player.currentTime=f)}}}),C(_(t),"_onPlay",function(){var o=t.player,u=o.currentTime,l=o.timeSegments;t._checkIfEnabled(l)&&u>=l[l.length-1].end&&(t.player.currentTime=l[0].start)}),t}return x(n,[{key:"afterCreate",value:function(){this.curIndex=-1,this.curPos=null,this.lastCurrentTime=0,this.updateSegments(),this.on(Te,this._onDurationChange),this.on(ke,this._onLoadedData),this.on(oe,this._onTimeupdate),this.on(Gt,this._onSeeking),this.on(ue,this._onPlay)}},{key:"setConfig",value:function(e){var i=this;if(e){var r=Object.keys(e);r.length<1||(r.forEach(function(o){i.config[o]=e[o]}),this.updateSegments())}}},{key:"updateSegments",value:function(){var e=this.config,i=e.disable,r=e.segments,o=this.player;if(i||!r||r.length===0)o.timeSegments=[],o.offsetDuration=0,o.offsetCurrentTime=-1;else{var u=this.formatTimeSegments(r,o.duration);o.timeSegments=u,o.offsetDuration=u.length>0?u[u.length-1].duration:0}}},{key:"formatTimeSegments",value:function(e,i){var r=[];return e?(e.sort(function(o,u){return o.start-u.start}),e.forEach(function(o,u){var l={};if(l.start=o.start<0?0:o.start,l.end=i>0&&o.end>i?i:o.end,!(i>0&&l.start>i)){r.push(l);var c=l.end-l.start;if(u===0)l.offset=o.start,l.cTime=0,l.segDuration=c,l.duration=c;else{var f=r[u-1];l.offset=f.offset+(l.start-f.end),l.cTime=f.duration+f.cTime,l.segDuration=c,l.duration=f.duration+c}}}),r):[]}},{key:"getSeekTime",value:function(e,i,r,o){var u=-1,l=o[r],c=l.start,f=l.end;if(e>=c&&e<=f)return u;var g=e-i;if(g<0&&e<c){var p=i>c?i-c:0;return u=r-1>=0?o[r-1].end+g+p:0,u}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})(De);function Uh(){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 jh=(function(s){A(n,s);var a=L(n);function n(t){var e;return S(this,n),e=a.call(this,t),e.rotateDeg=e.config.rotateDeg||0,e}return x(n,[{key:"afterCreate",value:function(){var e=this;if(!this.config.disable){F(D(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(Le,function(){e.rotateDeg&&e.config.innerRotate&&h.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(D(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,o=this.rootWidth,u=this.rootHeight,l=r.root,c=r.innerContainer,f=r.media,g=l.offsetWidth,p=c&&i?c.offsetHeight:l.offsetHeight,v=o,y=u,m=0,T=0;(e===.75||e===.25)&&(v="".concat(p,"px"),y="".concat(g,"px"),m=-(p-g)/2,T=-(g-p)/2);var b="translate(".concat(m,"px,").concat(T,"px) rotate(").concat(e,"turn)"),k={transformOrigin:"center center",transform:b,webKitTransform:b,height:y,width:v},E=i?f:l,I=i?r.getPlugin("poster"):null;Object.keys(k).map(function(R){E.style[R]=k[R],I&&I.root&&(I.root.style[R]=k[R])})}},{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,o=this.player;this.rotateDeg||(this.rotateDeg=0);var u=e?1:-1;this.rotateDeg=(this.rotateDeg+1+u*.25*r)%1,this.updateRotateDeg(this.rotateDeg,i),o.emit(gu,this.rotateDeg*360)}},{key:"registerIcons",value:function(){return{rotate:Uh}}},{key:"render",value:function(){if(!this.config.disable)return`
148
+ <xg-icon class="xgplayer-rotate">
149
+ <div class="xgplayer-icon">
150
+ </div>
151
+ `.concat(Re(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 Vh(){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 qh(){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 We={PIP:"picture-in-picture",INLINE:"inline",FULLSCREEN:"fullscreen"},zh=(function(s){A(n,s);var a=L(n);function n(){var t;S(this,n);for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return t=a.call.apply(a,[this].concat(i)),C(_(t),"switchPIP",function(o){if(!t.isPIPAvailable())return!1;o.stopPropagation&&o.stopPropagation(),t.isPip?(t.exitPIP(),t.emitUserAction(o,"change_pip",{props:"pip",from:!0,to:!1}),t.setAttr("data-state","normal")):t.player.media.readyState===4&&(t.requestPIP(),t.emitUserAction(o,"change_pip",{props:"pip",from:!1,to:!0}),t.setAttr("data-state","pip"))}),t}return x(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(D(n.prototype),"afterCreate",this).call(this),this.pMode=We.INLINE,this.initPipEvents(),this.config.showIcon&&this.initIcons(),this.once(Wt,function(){e.config.showIcon&&(h.removeClass(e.find(".xgplayer-icon"),"xg-icon-disable"),e.bind("click",e.switchPIP))}))}},{key:"registerIcons",value:function(){return{pipIcon:{icon:Vh,class:"xg-get-pip"},pipIconExit:{icon:qh,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;h.setTimeout(e,function(){!r&&i.mediaPlay()},0),!r&&i.mediaPlay(),e.setAttr("data-state","normal"),e.pipWindow=null,i.emit(vr,!1)},this.enterPIPCallback=function(r){i.emit(vr,!0),r!=null&&r.pictureInPictureWindow&&(e.pipWindow=r.pictureInPictureWindow),e.setAttr("data-state","pip")},this.onWebkitpresentationmodechanged=function(r){var o=i.media.webkitPresentationMode;e.pMode===We.FULLSCREEN&&o!==We.FULLSCREEN&&i.onFullscreenChange(null,!1),e.pMode=o,o===We.PIP?e.enterPIPCallback(r):o===We.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=he(document.styleSheets).map(function(o){try{return he(o.cssRules).map(function(l){return l.cssText}).join("")}catch{var u=document.createElement("link");u.rel="stylesheet",u.type=o.type,u.media=o.media,u.href=o.href,e.document.head.appendChild(u)}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,o=this.config;if(!(!this.isPIPAvailable()||this.isPip))try{var u=r.poster;if(u&&(i.media.poster=h.typeOf(u)==="String"?u:u.poster),o.preferDocument&&this.isDocPIPAvailable()){var l={};if(o.width&&o.height)l.width=o.width,l.height=o.height;else{var c=i.root.getBoundingClientRect();l.width=c.width,l.height=c.height}documentPictureInPicture.requestWindow(l).then(function(f){var g=o.docPiPNode,p=o.docPiPStyle;e.enterPIPCallback();var v=g||i.root,y=v.parentElement,m=v.previousSibling,T=v.nextSibling;e.copyStyleIntoPiPWindow(f);var b=document.createElement("style");if(b.append("body{padding:0; margin:0;}"),p){var k="";typeof p=="string"?k=p:typeof p=="function"&&(k=p.call(o)),k&&b.append(k)}else v===i.root&&b.append(`
165
+ .xgplayer{width: 100%!important; height: 100%!important;}
166
+ `);f.document.head.append(b),f.document.body.append(v),f.addEventListener("pagehide",function(E){y&&(T?y.insertBefore(v,T):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(f){return console.error("requestPiP",f),!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===We.PIP}},{key:"isPIPAvailable",value:function(){var e=this.player.media,i=h.typeOf(document.pictureInPictureEnabled)==="Boolean"?document.pictureInPictureEnabled:!1;return i&&(h.typeOf(e.disablePictureInPicture)==="Boolean"&&!e.disablePictureInPicture||e.webkitSupportsPresentationMode&&h.typeOf(e.webkitSetPresentationMode)==="Function")||this.isDocPIPAvailable()}},{key:"isDocPIPAvailable",value:function(){return"documentPictureInPicture"in window&&/^(https|file)/.test(location.protocol)}},{key:"destroy",value:function(){F(D(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(Re(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 Gh(){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 Wh=(function(s){A(n,s);var a=L(n);function n(t){var e;return S(this,n),e=a.call(this,t),C(_(e),"playNext",function(i){var r=_(e),o=r.player;i.preventDefault(),i.stopPropagation(),e.idx+1<e.config.urlList.length?(e.idx++,e.nextHandler(e.config.urlList[e.idx],e.idx),o.emit(Rt,e.idx+1)):(e.nextHandler(),o.emit(Rt))}),e.idx=-1,e}return x(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:Gh}}},{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(Re(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})(q),It={exports:{}},Kh=It.exports,Oo;function $h(){return Oo||(Oo=1,(function(s,a){(function(n,t){s.exports=t()})(Kh,function(){return function n(t,e,i){var r=window,o="application/octet-stream",u=i||o,l=t,c=!e&&!i&&l,f=document.createElement("a"),g=function(O){return String(O)},p=r.Blob||r.MozBlob||r.WebKitBlob||g,v=e||"download",y,m;if(p=p.call?p.bind(r):Blob,String(this)==="true"&&(l=[l,u],u=l[0],l=l[1]),c&&c.length<2048&&(v=c.split("/").pop().split("?")[0],f.href=c,f.href.indexOf(c)!==-1)){var T=new XMLHttpRequest;return T.open("GET",c,!0),T.responseType="blob",T.onload=function(O){n(O.target.response,v,o)},setTimeout(function(){T.send()},0),T}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(l))if(l.length>1024*1024*1.999&&p!==g)l=I(l),u=l.type||o;else return navigator.msSaveBlob?navigator.msSaveBlob(I(l),v):R(l);else if(/([\x80-\xff])/.test(l)){var b=0,k=new Uint8Array(l.length),E=k.length;for(b;b<E;++b)k[b]=l.charCodeAt(b);l=new p([k],{type:u})}y=l instanceof p?l:new p([l],{type:u});function I(O){var G=O.split(/[:;,]/),H=G[1],M=G[2]=="base64"?atob:decodeURIComponent,P=M(G.pop()),Y=P.length,Z=0,le=new Uint8Array(Y);for(Z;Z<Y;++Z)le[Z]=P.charCodeAt(Z);return new p([le],{type:H})}function R(O,G){if("download"in f)return f.href=O,f.setAttribute("download",v),f.className="download-js-link",f.innerHTML="downloading...",f.style.display="none",document.body.appendChild(f),setTimeout(function(){f.click(),document.body.removeChild(f),G===!0&&setTimeout(function(){r.URL.revokeObjectURL(f.href)},250)},66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(O)&&(O="data:"+O.replace(/^data:([\w\/\-\+]+)/,o)),window.open(O)||confirm(`Displaying New Document
180
+
181
+ Use Save As... to download, then click back to return to this page.`)&&(location.href=O),!0;var H=document.createElement("iframe");document.body.appendChild(H),!G&&/^data:/.test(O)&&(O="data:"+O.replace(/^data:([\w\/\-\+]+)/,o)),H.src=O,setTimeout(function(){document.body.removeChild(H)},333)}if(navigator.msSaveBlob)return navigator.msSaveBlob(y,v);if(r.URL)R(r.URL.createObjectURL(y),!0);else{if(typeof y=="string"||y.constructor===g)try{return R("data:"+u+";base64,"+r.btoa(y))}catch{return R("data:"+u+","+encodeURIComponent(y))}m=new FileReader,m.onload=function(O){R(this.result)},m.readAsDataURL(y)}return!0}})})(It)),It.exports}var Yh=$h();const Xh=_r(Yh);function Zh(){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 Jh=(function(s){A(n,s);var a=L(n);function n(t){var e;return S(this,n),e=a.call(this,t),C(_(e),"download",function(i){if(!e.isLock){e.emitUserAction(i,"download");var r=e.playerConfig.url,o="";h.typeOf(r)==="String"?o=r:h.typeOf(r)==="Array"&&r.length>0&&(o=r[0].src);var u=e.getAbsoluteURL(o);Xh(u),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 x(n,[{key:"afterCreate",value:function(){F(D(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:Zh}}},{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(D(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(Re(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),Qh=(function(s){A(n,s);var a=L(n);function n(){return S(this,n),a.apply(this,arguments)}return x(n,[{key:"beforeCreate",value:function(e){typeof e.player.config.screenShot=="boolean"&&(e.config.disable=!e.player.config.screenShot)}},{key:"afterCreate",value:function(){F(D(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(Le,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 o;try{typeof MouseEvent<"u"?o=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}):(o=document.createEvent("MouseEvents"),o.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null))}catch(u){console.error("MouseEvent unsupported",u)}o&&r.dispatchEvent(o)}},{key:"createCanvas",value:function(e,i){var r=document.createElement("canvas"),o=r.getContext("2d");this.canvasCtx=o,this.canvas=r,r.width=e||this.config.width,r.height=i||this.config.height,o.imageSmoothingEnabled=!0,o.imageSmoothingEnabled&&(o.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(o){i.emit(pu,o),r.saveImg&&i.saveScreenShot(o,r.name+r.format)})}},{key:"shot",value:function(e,i){var r=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{quality:.92,type:"image/png"},u=this.config,l=this.player,c=o.quality||u.quality,f=o.type||u.type;return new Promise(function(g,p){var v=null,y;if(l.media.canvas)v=l.media.canvas;else{r.canvas?(r.canvas.width=e||u.width,r.canvas.height=i||u.height):r.createCanvas(e,i),v=r.canvas,y=r.canvasCtx;var m=l.media.videoWidth/l.media.videoHeight,T=v.width/v.height,b=0,k=0,E=l.media.videoWidth,I=l.media.videoHeight,R,O,G,H;m>T?(G=v.width,H=v.width/m,R=0,O=Math.round((v.height-H)/2)):m===T?(G=v.width,H=v.height,R=0,O=0):m<T&&(G=v.height*m,H=v.height,R=Math.round((v.width-G)/2),O=0),y.drawImage(l.media,b,k,E,I,R,O,G,H)}var M=v.toDataURL(f,c).replace(f,"image/octet-stream");M=M.replace(/^data:image\/[^;]+/,"data:application/octet-stream"),g(M)})}},{key:"registerIcons",value:function(){return{screenshotIcon:null}}},{key:"destroy",value:function(){F(D(n.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.onClickBtn),this.off(Le,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),ed=(function(){function s(a){S(this,s),this.config=a.config,this.parent=a.root,this.root=h.createDom("ul","",{},"xg-options-list xg-list-slide-scroll ".concat(this.config.className)),a.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=q.delegate.call(this,this.root,"li",t,this.onItemClick)}return x(s,[{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,o){var u=r.selected?"option-item selected":"option-item";r["data-index"]=o,t.root.appendChild(h.createDom("li","<span>".concat(r.showText,"</span>"),r,u))})}},{key:"onItemClick",value:function(n){n.delegateTarget||(n.delegateTarget=n.target);var t=n.delegateTarget;if(t&&h.hasClass(t,"selected"))return!1;var e=typeof this.config.onItemClick=="function"?this.config.onItemClick:null,i=this.root.querySelector(".selected");h.addClass(t,"selected"),i&&h.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(){h.removeClass(this.root,"hide"),h.addClass(this.root,"active")}},{key:"hide",value:function(){h.removeClass(this.root,"active"),h.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}}]),s})(),ge={SIDE:"side",MIDDLE:"middle",DEFAULT:"default"},Ke={CLICK:"click",HOVER:"hover"};function td(s,a){return s===ge.SIDE?a===K.CONTROLS_LEFT?"xg-side-list xg-left-side":"xg-side-list xg-right-side":""}var Ne=B.device==="mobile",Bt=(function(s){A(n,s);var a=L(n);function n(t){var e;return S(this,n),e=a.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===Ke.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!==ge.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 x(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(),Ne=Ne||this.domEventType==="touch",Ne&&B.device==="mobile"&&i.listType===ge.DEFAULT&&(i.listType=ge.SIDE),i.hidePortrait&&h.addClass(this.root,"portrait"),this.on([Le,_e],function(){e._resizeList()}),this.once(Ce,function(){i.list&&i.list.length>0&&(e.renderItemList(i.list),e.show())}),Ne&&this.on(Mr,function(){e.isActive&&(e.optionsList&&e.optionsList.hide(),e.isActive=!1)}),Ne?(i.toggleMode=Ke.CLICK,this.activeEvent="touchend"):this.activeEvent=i.toggleMode===Ke.CLICK?"click":"mouseenter",i.toggleMode===Ke.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),o=!1;r.length>0&&(r.forEach(function(u){e.appendChild(".xgplayer-icon",i[u]),!o&&(o=i[u])}),this.isIcons=o),!o&&(this.appendChild(".xgplayer-icon",h.createDom("span","",{},"icon-text")),h.addClass(this.find(".xgplayer-icon"),"btn-text"))}},{key:"show",value:function(e){!this.config.list||this.config.list.length<2||h.addClass(this.root,"show")}},{key:"hide",value:function(){h.removeClass(this.root,"show")}},{key:"getTextByLang",value:function(e,i,r){if(e===void 0)return"";var o=this.config.list;!r&&(r=this.player.lang),i=!i||h.isUndefined(e[i])?"text":i,typeof e=="number"&&(e=o[e]);try{return ie(e[i])==="object"?e[i][r]||e[i].en:e[i]}catch(u){return console.warn(u),""}}},{key:"toggle",value:function(e){if(!(e===this.isActive||this.config.disable)){var i=this.player.controls,r=this.config.listType;e?(r===ge.SIDE?i.blur():i.focus(),this.optionsList&&this.optionsList.show()):(r===ge.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,o=r.listType,u=r.list;this.curIndex=i.to.index,this.curItem=u[this.curIndex],this.changeCurrentText();var l=this.config.isItemClickHide;(l||Ne||o===ge.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,o=this.config,u=this.optionsList,l=this.player;if(typeof i=="number"&&(this.curIndex=i,this.curItem=o.list[i]),u){u.renderItemList(e),this.changeCurrentText();return}var c={config:{data:e||[],className:td(o.listType,o.position),onItemClick:function(y,m){r.onItemClick(y,m)},domEventType:Ne?"touch":"mouse"},root:o.listType===ge.SIDE?l.innerContainer||l.root:this.root};if(this.config.isShowIcon){var f=this.player.root.getBoundingClientRect(),g=f.height,p=o.listType===ge.MIDDLE?g-50:g;p&&o.heightLimit&&(c.config.maxHeight="".concat(p,"px")),this.optionsList=new ed(c),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===ge.MIDDLE?i-50:i;this.optionsList&&this.optionsList.setStyle({maxHeight:"".concat(r,"px")})}}},{key:"destroy",value:function(){var e=this.config;e.toggleMode===Ke.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:Ke.HOVER,heightLimit:!0}}}]),n})(q),id=(function(s){A(n,s);var a=L(n);function n(t){var e;return S(this,n),e=a.call(this,t),e.curTime=0,e.isPaused=!0,e}return x(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(D(n.prototype),"afterCreate",this).call(this),this.on("resourceReady",function(i){e.changeDefinitionList(i)}),this.on(Hr,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||h.addClass(this.root,"show")}},{key:"initDefinition",value:function(){var e=this.config,i=e.list,r=e.defaultDefinition;if(i.length>0){var o=null;i.map(function(u){u.definition===r&&(o=u)}),o||(o=i[0]),this.changeDefinition(o)}}},{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,o=r&&r.definition?r.definition:this.config.defaultDefinition;r&&i.forEach(function(c){c.selected=!1});var u=0,l=i.map(function(c,f){var g=X(X({},c),{},{showText:e.getTextByLang(c)||c.definition,selected:!1});return(c.selected||c.definition&&c.definition==o)&&(g.selected=!0,u=f),g});F(D(n.prototype),"renderItemList",this).call(this,l,u)}},{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(D(n.prototype),"onItemClick",this).apply(this,arguments),this.emitUserAction(e,"change_definition",{from:i.from,to:i.to});for(var o=0;o<r.length;o++)i.to&&r[o].definition===i.to.definition&&(i.to.url=r[o].url),i.from&&r[o].definition===i.from.definition&&(i.from.url=r[o].url);this.player.changeDefinition(i.to,i.from)}}],[{key:"pluginName",get:function(){return"definition"}},{key:"defaultConfig",get:function(){return X(X({},Bt.defaultConfig),{},{position:K.CONTROLS_RIGHT,index:3,list:[],defaultDefinition:"",disable:!1,hidePortrait:!1,className:"xgplayer-definition",isShowIcon:!0})}}]),n})(Bt),nd=(function(s){A(n,s);var a=L(n);function n(t){var e;return S(this,n),e=a.call(this,t),e.curRate=1,e}return x(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(o){return typeof o=="number"?o={rate:o,text:"".concat(o,"x")}:!o.text&&o.rate&&(o.text="".concat(o.rate,"x")),o}))}},{key:"afterCreate",value:function(){var e=this;F(D(n.prototype),"afterCreate",this).call(this),this.on(ou,function(){e.curValue!==e.player.playbackRate&&e.renderItemList()}),this.renderItemList()}},{key:"show",value:function(e){!this.config.list||this.config.list.length===0||F(D(n.prototype),"show",this).call(this)}},{key:"onItemClick",value:function(e,i){F(D(n.prototype),"onItemClick",this).call(this,e,i);var r=e.delegateTarget,o=Number(r.getAttribute("rate"));if(!o||o===this.curValue)return!1;var u={playbackRate:{from:this.player.playbackRate,to:o}};this.emitUserAction(e,"change_rate",{props:u}),this.curValue=o,this.player.playbackRate=o}},{key:"renderItemList",value:function(){var e=this,i=this.player.playbackRate||1;this.curValue=i;var r=-1,o=this.config.list.map(function(u,l){var c={rate:u.rate};return c.rate===i&&(c.selected=!0,r=l),c.showText=e.getTextByLang(u),c});F(D(n.prototype),"renderItemList",this).call(this,o,r)}},{key:"changeCurrentText",value:function(){if(!this.isIcons){var e=this.config.list,i=this.curIndex<e.length?this.curIndex:0,r=e[i],o="";!r||this.curIndex<0?o="".concat(this.player.playbackRate,"x"):o=this.getTextByLang(r,"iconText"),this.find(".icon-text").innerHTML=o}}},{key:"destroy",value:function(){F(D(n.prototype),"destroy",this).call(this)}}],[{key:"pluginName",get:function(){return"playbackRate"}},{key:"defaultConfig",get:function(){return X(X({},Bt.defaultConfig),{},{position:K.CONTROLS_RIGHT,index:4,list:[2,1.5,1,.75,.5],className:"xgplayer-playbackrate",isShowIcon:!0,hidePortrait:!1})}}]),n})(Bt),rd=(function(s){A(n,s);var a=L(n);function n(){return S(this,n),a.apply(this,arguments)}return x(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(ft,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,o=i.errorNote?this.i18n[i.errorNote]:"";if(!o)switch(r){case"decoder":o=this.i18n.MEDIA_ERR_DECODE;break;case"network":o=this.i18n.MEDIA_ERR_NETWORK;break;default:o=this.i18n.MEDIA_ERR_SRC_NOT_SUPPORTED}this.find(".xgplayer-error-text").innerHTML=o,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})(q),ad=(function(s){A(n,s);var a=L(n);function n(){return S(this,n),a.apply(this,arguments)}return x(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]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){};if(e){this.customOnClick=o;var u=this.config.interval;this.intervalId&&(clearTimeout(this.intervalId),this.intervalId=null),h.addClass(this.root,"show"),r.mode==="arrow"&&h.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 l=typeof r.autoHide=="boolean"?r.autoHide:this.config.autoHide;if(l){var c=r.interval||u;this.intervalId=setTimeout(function(){i.hide()},c)}}}},{key:"hide",value:function(){h.removeClass(this.root,"show"),h.removeClass(this.root,"arrow"),this.root.removeAttribute("style"),this.customOnClick=null}},{key:"render",value:function(){return'<xg-prompt class="xgplayer-prompt '.concat(w.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})(q),Mo={time:0,text:"",id:1,duration:1,color:"#fff",style:{},width:6,height:6};function Ou(s){Object.keys(Mo).map(function(a){s[a]===void 0&&(s[a]=Mo[a])})}var No={_updateDotDom:function(a,n){if(n){var t=this.calcuPosition(a.time,a.duration),e=a.style||{};e.left="".concat(t.left,"%"),e.width="".concat(t.width,"%"),n.setAttribute("data-text",a.text),n.setAttribute("data-time",a.time),t.isMini?h.addClass(n,"mini"):h.removeClass(n,"mini"),Object.keys(e).map(function(i){n.style[i]=e[i]})}},initDots:function(){var a=this;this._ispots.map(function(n){a.createDot(n,!1)}),this.ispotsInit=!0},createDot:function(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this.player.plugins.progress;if(t&&(n&&(Ou(a),this._ispots.push(a)),!(!this.ispotsInit&&n))){var e=this.calcuPosition(a.time,a.duration),i=a.style||{};i.left="".concat(e.left,"%"),i.width="".concat(e.width,"%");var r="xgspot_".concat(a.id," xgplayer-spot");e.isMini&&(r+=" mini");var o=a.template?'<div class="xgplayer-spot-pop">'.concat(a.template,"</div>"):"",u=h.createDom("xg-spot",o,{"data-text":a.text,"data-time":a.time,"data-id":a.id},r);Object.keys(i).map(function(l){u.style[l]=i[l]}),t.outer&&t.outer.appendChild(u),this.positionDot(u,a.id)}},findDot:function(a){if(this.player.plugins.progress){var n=this._ispots.filter(function(t,e){return t.id===a});return n.length>0?n[0]:null}},updateDot:function(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=this.player.plugins.progress;if(t){var e=this.findDot(a.id);if(e&&Object.keys(a).map(function(r){e[r]=a[r]}),!!this.ispotsInit){var i=t.find('xg-spot[data-id="'.concat(a.id,'"]'));i&&(this._updateDotDom(a,i),n&&this.showDot(a.id))}}},deleteDot:function(a){var n=this._ispots,t=this.player.plugins.progress;if(t){for(var e=[],i=0;i<n.length;i++)n[i].id===a&&e.push(i);for(var r=e.length,o=r-1;o>=0;o--)if(n.splice(e[o],1),this.ispotsInit){var u=t.find('xg-spot[data-id="'.concat(a,'"]'));u&&u.parentElement.removeChild(u)}}},deleteAllDots:function(){var a=this.player.plugins.progress;if(a){if(!this.ispotsInit){this._ispots=[];return}for(var n=a.root.getElementsByTagName("xg-spot"),t=n.length-1;t>=0;t--)a.outer.removeChild(n[t]);this._ispots=[]}},updateAllDots:function(){var a=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(o,u){u<i?(e[u].setAttribute("data-id","".concat(o.id)),a._ispots.push(o),a.updateDot(o)):a.createDot(o)})}},positionDots:function(){var a=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 o=i.find('xg-spot[data-id="'.concat(r.id,'"]'));o&&a.positionDot(o,r.id)}))},positionDot:function(a,n){var t=h.findDom(a,".xgplayer-spot-pop");if(t){var e=this.playerSize,i=a.getBoundingClientRect(),r=t.getBoundingClientRect(),o=i.left-e.left,u=e.width-o-i.width/2;if(o<r.width/2||e.width<r.width){var l=r.width/2-o;t.style.left="".concat(l,"px")}else if(u<r.width/2){var c=u-r.width/2+i.width/2;t.style.left="".concat(c,"px")}else t.style.left="50%"}},updateDuration:function(){var a=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,'"]'));a._updateDotDom(e,i)})}},getAllDotsDom:function(){var a=this.player.plugins.progress;if(!a)return[];var n=a.root.getElementsByTagName("xg-spot");return n},getDotDom:function(a){var n=this.player.plugins.progress;if(n)return n.find('xg-spot[data-id="'.concat(a,'"]'))}};function sd(s){var a=s.config,n=s.player;Object.keys(No).map(function(e){s[e]=No[e].bind(s)});var t=n.config.progressDot||a.ispots||[];s._ispots=t.map(function(e){return Ou(e),e}),s.ispotsInit=!1,s.playerSize={left:n.sizeInfo.left,width:n.sizeInfo.width},s.on(Te,function(){s.ispotsInit?s.updateDuration():s.initDots()}),s.on(Le,function(){s.positionDots()})}var $e={dragmove:"onProgressMove",dragstart:"onProgressDragStart",dragend:"onProgressDragEnd",click:"onProgressClick",mouseover:"onProgressMouseOver",mouseenter:"onProgressMouseOver"},od=(function(s){A(n,s);var a=L(n);function n(t){var e;return S(this,n),e=a.call(this,t),C(_(e),"onMousemove",function(i){if(!e.config.disable){if(h.hasClass(i.target,"xg-spot-content")&&e.config.isHideThumbnailHover){e.player.plugins.progress.onMouseLeave(i);return}(e._state.f||h.hasClass(i.target,"xg-spot-content"))&&(h.event(i),i.stopPropagation())}}),C(_(e),"onMousedown",function(i){e.config.disable||(e._state.f||h.hasClass(i.target,"xg-spot-content"))&&(h.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&&h.hasClass(r.target,"xgplayer-spot")&&!e._curDot){e._curDot=r.target,e.focusDot(r.target),e._curDot.children.length>0&&e.hide();var o=e.player.plugins.progress;o&&o.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 x(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(h.format(i))}),sd(this),this.on(Te,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($e).map(function(o){e[$e[o]]=e[$e[o]].bind(e),i.addCallBack(o,e[$e[o]])}),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(o){o.stopPropagation(),r(parseInt(e._state.now*1e3,10)/1e3,o),i&&i.onMouseUp(o)},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&&h.addClass(this.videoPreview,"show"))}},{key:"onProgressDragEnd",value:function(e){this.config.disable||!this.player.duration||(this.isDrag=!1,this.videoPreview&&h.removeClass(this.videoPreview,"show"))}},{key:"onProgressClick",value:function(e,i){this.config.disable||h.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,o=this.previewLine,u=this.player,l=this.config,c=u.controls.mode,f=c==="flex",g=r.getBoundingClientRect().width;if(!(!g&&this._hasThumnail)){g=this._hasThumnail&&g<l.width?l.width:g;var p=e-g/2,v;p<0&&!f?(p=0,v=e-g/2):p>i-g&&!f?(v=p-(i-g),p=i-g):v=0,v!==void 0&&(o.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,o){var u=this.root,l=this.config,c=this._state;if(u){c.now=r,this.transformTimeHook(r);var f=this.timeStr;o&&o.target&&h.hasClass(o.target,"xgplayer-spot")?(this.showTips(o.target.getAttribute("data-text"),!1,f),this.focusDot(o.target),c.f=!0,l.isFocusDots&&c.f&&(c.now=parseInt(o.target.getAttribute("data-time"),10))):l.defaultText?(c.f=!1,this.showTips(l.defaultText,!0,f)):(c.f=!1,this.hideTips("")),this.updateTimeText(f),this.updateThumbnails(c.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,o=this.config,u=i.plugins.thumbnail;if(u&&u.usable){this.thumbnail&&u.update(this.thumbnail,e,o.width,o.height);var l=r&&r.getBoundingClientRect();this.videothumbnail&&u.update(this.videothumbnail,e,l.width,l.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,o=i.getPlugin("thumbnail");if(o&&o.setConfig(e),!o||!o.usable||!r.isShowThumbnail){h.addClass(this.root,"short-line no-thumbnail");return}else h.removeClass(this.root,"short-line no-thumbnail");r.mode==="short"&&h.addClass(this.root,"short-line"),this._hasThumnail=!0;var u=this.find(".xg-spot-thumbnail");this.thumbnail=o.createThumbnail(u,"progress-thumbnail"),r.isShowCoverPreview&&(this.videoPreview=h.createDom("xg-video-preview","",{},"xgvideo-preview"),i.root.appendChild(this.videoPreview),this.videothumbnail=o.createThumbnail(this.videoPreview,"xgvideo-thumbnail")),this.updateThumbnails(0)}}},{key:"calcuPosition",value:function(e,i){var r=this.player.plugins.progress,o=this.player,u=r.root.getBoundingClientRect().width,l=o.duration/u*6;return e+i>o.duration&&(i=o.duration-e),e/o.duration*100,i/o.duration,{left:e/o.duration*100,width:i/o.duration*100,isMini:i<l}}},{key:"showDot",value:function(e){var i=this.findDot(e);if(i){var r=this.root.getBoundingClientRect(),o=r.width,u=i.time/this.player.duration*o;this.updatePosition(u,o,i.time)}}},{key:"focusDot",value:function(e,i){e&&(i||(i=e.getAttribute("data-id")),h.addClass(e,"active"),this._activeDotId=i)}},{key:"blurDot",value:function(e){if(!e){var i=this._activeDotId;e=this.getDotDom(i)}e&&(h.removeClass(e,"active"),this._activeDotId=null)}},{key:"showTips",value:function(e,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";h.addClass(this.root,"no-timepoint"),e&&(h.addClass(this.find(".xg-spot-content"),"show-text"),i&&this.config.mode==="production"?(h.addClass(this.root,"product"),this.tipText.textContent=e):(h.removeClass(this.root,"product"),this.tipText.textContent=this._hasThumnail?e:"".concat(r," ").concat(e)))}},{key:"hideTips",value:function(){h.removeClass(this.root,"no-timepoint"),this.tipText.textContent="",h.removeClass(this.find(".xg-spot-content"),"show-text"),h.removeClass(this.root,"product")}},{key:"hide",value:function(){h.addClass(this.root,"hide")}},{key:"show",value:function(e){h.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($e).map(function(r){i.removeCallBack(r,e[$e[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})(q),ud=(function(s){A(n,s);var a=L(n);function n(t){var e;return S(this,n),e=a.call(this,t),e.ratio=1,e.interval=null,e._preloadMark={},e}return x(n,[{key:"afterCreate",value:function(){var e=this;this.usable&&this.initThumbnail(),this.on([Te],function(){var i=e.config,r=i.pic_num,o=i.interval;e.usable&&(e.interval=o>0?o: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(o){i.config[o]=e[o]}),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,o=e.pic_num,u=e.interval;this.ratio=i/r*100,this.interval=u||Math.round(this.player.duration/o),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,o=r.length,u=[];e>0&&u.push(e-1),u.push(e),e>0&&e<o-1&&u.push(e+1),u.map(function(l){!i._preloadMark[l]&&l>=0&&l<o&&(i._preloadMark[l]=1,h.preloadImg(r[l],function(){i._preloadMark[l]=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,o=this.config,u=o.pic_num,l=o.row,c=o.col,f=o.width,g=o.height;this.interval=Math.round(this.player.duration/u);var p=Math.ceil(e/this.interval);p=p>u?u:p;var v=p<l*c?0:Math.ceil(p/(l*c))-1,y=p-v*(c*l),m=y>0?Math.ceil(y/c)-1:0,T=y>0?y-m*c-1:0,b=0,k=0;if(i&&r){var E=i/r;E<f/g?(k=r,b=k*(f/g)):(b=i,k=b/(f/g))}else r?i||(k=r||g,b=k*(f/g)):(b=i||f,k=b/(f/g));var I=this.getUrlByIndex(v);return{urlIndex:v,rowIndex:m,colIndex:T,url:I,height:k,width:b,style:{backgroundImage:"url(".concat(I,")"),backgroundSize:"".concat(b*c,"px auto"),backgroundPosition:"-".concat(T*b,"px -").concat(m*k,"px"),width:"".concat(b,"px"),height:"".concat(k,"px")}}}},{key:"update",value:function(e,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"",l=this.config,c=l.pic_num,f=l.urls;if(!(c<=0||!f||f.length===0)){var g=this.getPosition(i,r,o);this.preload(g.urlIndex),Object.keys(g.style).map(function(p){e.style[p]=g.style[p]}),Object.keys(u).map(function(p){e.style[p]=u[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=h.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})(q);function ur(s){return s?"background:".concat(s,";"):""}var ld=(function(s){A(n,s);var a=L(n);function n(){var t;S(this,n);for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return t=a.call.apply(a,[this].concat(i)),C(_(t),"onTimeupdate",function(){var o=t.player.ended,u=_(t),l=u.offsetDuration,c=t.currentTime;c=h.adjustTimeByDuration(c,l,o),t.update({played:c},l)}),t}return x(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(oe,this.onTimeupdate),this.on(Ue,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 o=this.config,u=o.mode,l=o.height,c={cached:ur(i.cachedColor),played:ur(i.playedColor),progress:ur(i.progressColor),height:l>0&&l!==2?"height: ".concat(l,"px;"):""},f=u==="show"?"xg-mini-progress-show":"";return'<xg-mini-progress class="xg-mini-progress '.concat(f,'" style="').concat(c.progress," ").concat(c.height,`">
225
+ <xg-mini-progress-cache class="xg-mini-progress-cache" style="`).concat(c.cached,`"></xg-mini-progress-cache>
226
+ <xg-mini-progress-played class="xg-mini-progress-played" style="`).concat(c.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})(q),Ye={REAL_TIME:"realtime",FIRST_FRAME:"firstframe",POSTER:"poster"};function cd(){try{return parseInt(window.performance.now(),10)}catch{return new Date().getTime()}}function fd(){try{var s=document.createElement("canvas").getContext;return!!s}catch{return!1}}var St=null,hd=(function(s){A(n,s);var a=L(n);function n(){var t;S(this,n);for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return t=a.call.apply(a,[this].concat(i)),C(_(t),"onLoadedData",function(o){t.player&&(t._frameCount=t.config.startFrameCount,t.stop(),t.renderOnTimeupdate(o),t.off(oe,t.renderOnTimeupdate),t.on(oe,t.renderOnTimeupdate))}),C(_(t),"onVisibilitychange",function(o){document.visibilityState==="visible"?t._checkIfCanStart()&&t.start():document.visibilityState==="hidden"&&t.stop()}),C(_(t),"renderOnTimeupdate",function(o){if(t._frameCount>0)t.renderOnce(),t._frameCount--;else{t._isLoaded=!0,t.off(oe,t.renderOnTimeupdate);var u=t.config.startInterval;!t.player.paused&&t._checkIfCanStart()&&t.start(0,u)}}),C(_(t),"start",function(o,u){var l=t.player.video,c=cd(),f=t.checkVideoIsSupport(l);!f||!t.canvasCtx||(u||(u=t.interval),t.stop(),l.videoWidth&&l.videoHeight&&(t.videoPI=l.videoHeight>0?parseInt(l.videoWidth/l.videoHeight*100,10):0,(t.config.mode===Ye.REAL_TIME||c-t.preTime>=u)&&(l&&l.videoWidth&&t.update(f,t.videoPI),t.preTime=c)),t.frameId=t._loopType==="timer"?h.setTimeout(_(t),t.start,u):h.requestAnimationFrame(t.start))}),C(_(t),"stop",function(){t.frameId&&(t._loopType==="timer"?h.clearTimeout(_(t),t.frameId):h.cancelAnimationFrame(t.frameId),t.frameId=null)}),t}return x(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,o=i.mode,u=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/u,10),this.canvas=null,this.canvasCtx=null,this._frameCount=0,this._loopType=this.config.mode!==Ye.REAL_TIME&&this.interval>=1e3?"timer":"animation",this.once(Wt,function(){e.player&&(e.init(),e.renderByPoster(),e.player.paused||e.start())}),o!==Ye.POSTER&&(o!==Ye.FIRST_FRAME&&(this.on(Ue,function(){e.stop()}),this.on(ue,function(){var l=e.config.startInterval;e._checkIfCanStart()&&e.start(0,l)}),this.on(Qe,function(){e.stop()})),this.on(ke,this.onLoadedData),this.on(Or,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 o=e||r.root;o||(o=r.isInnerRender&&i.innerContainer||i.root),o.insertAdjacentHTML("afterbegin",'<div class="xgplayer-dynamic-bg" data-index="'.concat(r.index,`"><canvas>
228
+ </canvas><xgmask></xgmask></div>`)),this.root=o.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(u){U.logError("plugin:DynamicBg",u)}}},{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 o=this.config.startInterval;this._checkIfCanStart()&&this.start(0,o)}}},{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"&&h.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=h.typeOf(e)==="String"?e:h.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!==Ye.FIRST_FRAME&&e!==Ye.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(),o=r.width,u=r.height,l=new window.Image;l.onload=function(){if(!(!i.canvas||i.frameId||i.isStart)){i.canvas.height=u,i.canvas.width=o;var c=parseInt(o/u*100,10);i.update(l,c),l=null}},l.src=e}}},{key:"update",value:function(e,i){if(!(!this.canvas||!this.canvasCtx||!i))try{var r=this._pos,o=this.config,u=this.canvas.getBoundingClientRect(),l=u.width,c=u.height;if(l!==r.width||c!==r.height||r.pi!==i){var f=parseInt(l/c*100,10);r.pi=i,r.width!==l&&(r.width=this.canvas.width=l),r.height!==c&&(r.height=this.canvas.height=c);var g=c,p=l;f<i?p=parseInt(c*i/100,10):f>i&&(g=parseInt(l*100/i,10)),r.rwidth=p*o.multiple,r.rheight=g*o.multiple,r.x=(l-r.rwidth)/2,r.y=(c-r.rheight)/2}this.canvasFilter&&(this.canvasCtx.filter=o.filter),this.canvasCtx.drawImage(e,r.x,r.y,r.rwidth,r.rheight)}catch(v){U.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 St=="boolean"||(St=fd()),St}},{key:"supportCanvasFilter",value:function(){return!(B.browser==="safari"||B.browser==="firefox")}}]),n})(q),dd={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:"直播"}},nt="info",lr=bu,gd=(function(s){A(n,s);var a=L(n);function n(){var t;S(this,n);for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return t=a.call.apply(a,[this].concat(i)),C(_(t),"_recordUserActions",function(o){var u=t._getTime(),l=Object.assign({},o,{msg:o.msg||o.action});t._stats[nt].push(X(X({type:"userAction"},u),{},{payload:l}))}),C(_(t),"_onReset",function(){t.reset()}),C(_(t),"_recordInfo",function(o){t.info(o)}),C(_(t),"_downloadStats",function(){var o=t.getStats(),u=new Blob([JSON.stringify(o)],{type:"application/json"}),l=window.URL.createObjectURL(u),c=document.createElement("a");c.style.display="none",c.href=l,c.download="player.txt",c.disabled=!1,c.click()}),t}return x(n,[{key:"_getTime",value:function(){return{timestamp:Date.now(),timeFormat:new Date().toISOString()}}},{key:"afterCreate",value:function(){this.reset(),this.on(Ot,this._recordUserActions),this.on(lr.STATS_INFO,this._recordInfo),this.on(lr.STATS_DOWNLOAD,this._downloadStats),this.on(lr.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[nt].push(X(X({},i),{},{payload:e}))}},{key:"_infoProfile",value:function(e){if(e&&e.startMs){var i=Date.now(),r=i-e.startMs,o=X({cat:"function",dur:r,name:e.name||e.msg,ph:"X",pid:0,tid:0,ts:e.startMs,profile:!0},e);this._info(o)}else console.warn("infoProfile need object data, include startMs")}},{key:"reset",value:function(){var e;this._stats=(e={},C(e,nt,[]),C(e,"media",{}),e)}},{key:"getStats",value:function(){for(var e=this.player,i=e.media,r=[],o=0;o<i.buffered.length;o++)r.push({start:i.buffered.start(o),end:i.buffered.end(o)});var u={currentTime:i.currentTime,readyState:i.readyState,buffered:r,paused:i.paused,ended:i.ended};return this._stats.media=u,{raw:this._stats,timestat:this._getTimeStats(),profile:this._getProfile()}}},{key:"_getTimeStats",value:function(){var e=this._stats[nt],i=e.map(function(r){var o=r.payload.data,u="";try{o instanceof Error?u=o.msg:o!==void 0&&(u=JSON.stringify(o))}catch(l){console.log("err",l)}return"[".concat(r.timeFormat,"] : ").concat(r.payload.msg," ").concat(u," ")});return i}},{key:"_getProfile",value:function(){var e={traceEvents:[]},i=this._stats[nt];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})(De),Mu=(function(s){A(n,s);var a=L(n);function n(){var t;S(this,n);for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return t=a.call.apply(a,[this].concat(i)),C(_(t),"onGapJump",function(){var o=_(t),u=o.player,l=o.config;if(u.media.readyState!==HTMLMediaElement.HAVE_NOTHING){if(u.media.seeking){if(!t.seekingEventReceived)return}else t.seekingEventReceived=!1;if(!(u.media.paused&&u.media.currentTime!==0&&t.hasPlayed)){var c=u.media.buffered,f=l.smallGapLimit||.5,g=l.gapDetectionThreshold||.3,p=u.media.currentTime,v=t._getIndex(c,p,g);if(!(v===null||v===0)){console.log("GapJump bufferRange ",c.start(v),c.end(v));var y=c.start(v)+.1,m=u.media.duration;if(!(y>m)){var T=y-p,b=T<=f;T<n.BROWSER_GAP_TOLERANCE||b&&(l.useGapJump!==!1&&(u.media.currentTime=t.isSafari?y+.1:y),t.player&&t.player.emit("detectGap"),console.log("gapJump gapIndex",v," isGapSamll:",b," currentTime:",u.media.currentTime," jumpSize:",p-u.media.currentTime),y!==.08&&u&&u.emit("log",{type:"oneevent",end_type:"gap",vid:u.config.vid,ext:{video_postion:Math.floor(y*1e3)}}))}}}}}),t}return x(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(ht,this.onGapJump),this.on(ue,function(){e.hasPlayed=!0}),this.on(Gt,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 o=this._getBuffered(e),u=null,l=0;l<o.length;l++){var c=o[l];if(c.start>i&&(l===0||o[l-1].end-i<=r)){u=l;break}}return u}},{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})(q);Mu.BROWSER_GAP_TOLERANCE=.001;var pd=(function(s){A(n,s);var a=L(n);function n(){var t;S(this,n);for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return t=a.call.apply(a,[this].concat(i)),C(_(t),"onWaiting",function(){var o=_(t),u=o.config;t.jumpCnt>u.jumpCntMax||t.timer||u.useWaitingTimeoutJump===!1||(t.timer=setTimeout(t.onJump,u.waitingTime*1e3))}),C(_(t),"onJump",function(){var o=_(t),u=o.player,l=o.config;if(clearTimeout(t.timer),t.timer=null,!(t.jumpCnt>l.jumpCntMax||l.useWaitingTimeoutJump===!1)&&!(u.media.paused&&u.media.currentTime!==0&&t.hasPlayed)){t.jumpSize=l.jumpSize*(t.jumpCnt+1),t.jumpCnt===l.jumpSize&&t.jumpSize<6&&(t.jumpSize=6);var c=u.currentTime+t.jumpSize,f=u.media.duration;c>f||(t.jumpCnt++,u.currentTime=c)}}),t}return x(n,[{key:"afterCreate",value:function(){var e=this,i=this.config,r=i.useWaitingTimeoutJump,o=i.jumpSize;r!==!1&&(this.hasPlayed=!1,this.jumpCnt=0,this.timer=null,this.jumpSize=o,this.on(ht,this.onWaiting),this.on([Rr,Ce],function(){clearTimeout(e.timer),e.timer=null,e.jumpSize=e.config.jumpSize}),this.on(ue,function(){e.hasPlayed=!0}))}}],[{key:"pluginName",get:function(){return"waitingTimeoutJump"}},{key:"defaultConfig",get:function(){return{useWaitingTimeoutJump:!1,waitingTime:15,jumpSize:2,jumpCntMax:4}}}]),n})(q),Xe="cdn",xt=["cdn"],vd=(function(s){A(n,s);var a=L(n);function n(){var t;S(this,n);for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return t=a.call.apply(a,[this].concat(i)),C(_(t),"getSpeed",function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Xe;if(!t.speedListCache||!t.speedListCache[o]||t.speedListCache[o].length<=0)return 0;var u=0;return t.speedListCache[o].map(function(l){u+=l}),Math.floor(u/t.speedListCache[o].length)}),C(_(t),"startTimer",function(){h.isMSE(t.player.video)||(t.initSpeedList(),t.cnt=0,t.timer=setTimeout(t.testSpeed,t.config.testTimeStep))}),C(_(t),"initSpeedList",function(){t.speedListCache={},xt.forEach(function(o){t.speedListCache[o]=[]})}),C(_(t),"_onRealSpeedChange",function(o){o.speed&&t.appendList(o.speed,o.type||Xe)}),C(_(t),"testSpeed",function(){if(clearTimeout(t.timer),t.timer=null,!(!t.player||!t.config.openSpeed)){var o=t.config,u=o.url,l=o.loadSize,c=o.testCnt,f=o.testTimeStep,g=u+(u.indexOf("?")<0?"?testst=":"&testst=")+Date.now();if(!(t.cnt>=c)){t.cnt++;try{var p=new Date().getTime(),v=null,y=new XMLHttpRequest;t.xhr=y,y.open("GET",g);var m={},T=Math.floor(Math.random()*10);m.Range="bytes="+T+"-"+(l+T),m&&Object.keys(m).forEach(function(b){y.setRequestHeader(b,m[b])}),y.onreadystatechange=function(){if(y.readyState===4){t.xhr=null,v=new Date().getTime();var b=y.getResponseHeader("Content-Length")/1024*8,k=Math.round(b*1e3/(v-p));t.appendList(k),t.timer=setTimeout(t.testSpeed,f)}},y.send()}catch(b){console.error(b)}}}}),C(_(t),"appendList",function(o){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Xe;if(!(!t.speedListCache||!t.speedListCache[u])){var l=t.config.saveSpeedMax;t.speedListCache[u].length>=l&&t.speedListCache[u].shift(),t.speedListCache[u].push(o);var c=_(t),f=c.player;f&&(u===Xe?f.realTimeSpeed=o:f[t.getSpeedName("realTime",u)]=o),t.updateSpeed(u)}}),C(_(t),"updateSpeed",function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Xe,u=t.getSpeed(o),l=_(t),c=l.player;if(c)if(o===Xe)(!c.avgSpeed||u!==c.avgSpeed)&&(c.avgSpeed=u,c.emit(gr,{speed:u,realTimeSpeed:c.realTimeSpeed}));else{var f=t.getSpeedName("avg",o);(!c[f]||u!==c[f])&&(c[f]=u,c.emit(gr,{speed:u,realTimeSpeed:c.realTimeSpeed}))}}),t}return x(n,[{key:"afterCreate",value:function(){var e=this.config,i=e.openSpeed,r=e.addSpeedTypeList;(r==null?void 0:r.length)>0&&xt.push.apply(xt,he(r)),this.initSpeedList(),this.on("real_time_speed",this._onRealSpeedChange),this.timer=null,this.cnt=0,this.xhr=null,i&&this.on([ke,At],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([ke,At],this.startTimer),xt.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})(q),md=(function(s){A(n,s);var a=L(n);function n(){return S(this,n),a.apply(this,arguments)}return x(n,[{key:"afterCreate",value:function(){var e=this,i=this.player,r=this.config,o=i.media||i.video;if(this.timer=null,this._lastDecodedFrames=0,this._currentStuckCount=0,this._lastCheckPoint=null,this._payload=[],!r.disabled){var u=o.getVideoPlaybackQuality;u&&(this.on(ue,function(){e._startTick()}),this.on(Qe,function(){e._stopTick()}),this.on(He,function(){e._stopTick()}),this.on(Ue,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,o=[],u=0;u<i.length;u++){var l=i.start(u),c=i.end(u);if(o.push({start:l,end:c}),l<=e&&e<=c-1){r=!0;break}}return{enoughBuffer:r,buffers:o}}},{key:"_checkStuck",value:function(e,i,r,o){var u=this.player.media||this.player.video,l=document.hidden,c=u.paused,f=u.readyState,g=u.currentTime,p=u.buffered;if(!(l||c||f<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:o}),this._currentStuckCount>=this.config.stuckCount&&(this.emit(ku,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,o=i.droppedVideoFrames,u=performance.now();if(r&&this._lastCheckPoint){var l=r-this._lastDecodedFrames,c=u-this._lastCheckPoint;this._checkStuck(l,r,o,c)}this._lastDecodedFrames=r,this._lastCheckPoint=u}}},{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})(q);Ze.use(dd);var yd=x(function s(a,n){var t,e,i;S(this,s);var r=n&&n.isMobileSimulateMode==="mobile",o=n.isLive,u=o?[]:[Hh,Au,ld,od,Lu],l=[].concat(u,[Pu,Iu,jh,Wh,id,nd,Jh,Qh,Du,zh]),c=[bh,kh,wh,Bh,Eh,rd,ad,ud,Ph];this.plugins=[gd,_h].concat(he(l),c,[Mu,pd]);var f=r?"mobile":B.device;switch(f){case"pc":(t=this.plugins).push.apply(t,[Ro,sr,mr,vd,md]);break;case"mobile":(e=this.plugins).push.apply(e,[Mh]);break;default:(i=this.plugins).push.apply(i,[Ro,sr,mr])}(B.os.isIpad||f==="pc")&&this.plugins.push(hd),B.os.isIpad&&this.plugins.push(sr),this.ignores=[],this.i18n=[]}),Q=(function(s){A(n,s);var a=L(n);function n(){return S(this,n),a.apply(this,arguments)}return x(n)})(Yt);C(Q,"defaultPreset",yd);C(Q,"Util",h);C(Q,"Sniffer",B);C(Q,"Errors",Pt);C(Q,"Events",Uf);C(Q,"Plugin",q);C(Q,"BasePlugin",De);C(Q,"I18N",Ze);C(Q,"STATE_CLASS",w);C(Q,"InstManager",xu);C(Q,"PlayIcon",Pu);C(Q,"TimeIcon",Lu);C(Q,"Progress",Au);C(Q,"FullscreenIcon",Iu);C(Q,"CssFullscreenIcon",mr);C(Q,"VolumeIcon",Du);const _d=["id"],Cd=d.defineComponent({name:"ElImageViewer",__name:"Player",props:d.mergeModels({url:{type:String,default:""},zIndex:{type:Number,default:200},config:{type:Object,default:()=>({})}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:d.mergeModels({close:()=>!0},["update:modelValue"]),setup(s,{emit:a}){let n=null;const t=s,{cLoadUrl:e}=ul(t),i=d.computed(()=>cr(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},o=d.computed(()=>({...r,...t.config})),u=a,l=d.useModel(s,"modelValue"),c=Ae.buildUUID(),f=J.useNamespace("image-viewer");function g(){u("close"),l.value=!1,n.destroy()}return d.watch(()=>l.value,p=>{p&&d.nextTick(()=>{n=new Q({id:c,url:i.value,...o.value})})}),(p,v)=>{const y=d.resolveComponent("el-icon");return l.value?(d.openBlock(),d.createBlock(d.Teleport,{key:0,to:"body"},[d.createVNode(d.Transition,{name:"viewer-fade",appear:""},{default:d.withCtx(()=>[d.createElementVNode("div",{ref:"wrapper",tabindex:-1,class:d.normalizeClass(d.unref(f).e("wrapper")),style:d.normalizeStyle({zIndex:s.zIndex})},[d.createElementVNode("div",{class:d.normalizeClass(d.unref(f).e("mask"))},null,2),d.createCommentVNode(" CANVAS "),d.createElementVNode("div",{class:d.normalizeClass(d.unref(f).e("canvas"))},[d.createElementVNode("div",{id:d.unref(c)},null,8,_d),d.createCommentVNode(" CLOSE "),d.createElementVNode("span",{class:d.normalizeClass([d.unref(f).e("btn"),d.unref(f).e("close")]),onClick:g},[d.createVNode(y,{onClick:g},{default:d.withCtx(()=>[d.createVNode(d.unref(Fo))]),_:1})],2)],2),d.renderSlot(p.$slots,"default",{},void 0,!0)],6)]),_:3})])):d.createCommentVNode("v-if",!0)}}}),bd=yr(Cd,[["__scopeId","data-v-b301aa7d"]]),kd=Je(bd),Td={class:"head-logo"},wd=["src"],Ed=d.defineComponent({__name:"IkPreviewFileDialog",props:d.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:d.mergeModels(["close"],["update:show"]),setup(s,{emit:a}){const n=s,t=a,e=d.useModel(s,"show"),i=d.computed(()=>({name:"name",url:"url",suffix:"suffix",size:"fileSize",...n.field})),r=d.ref(null),o=d.ref(null),u=d.reactive({image:!1,office:!1,video:!1}),l=g=>{var p,v,y,m,T,b,k;try{const E=((p=g==null?void 0:g.response)==null?void 0:p.data)||g,I=E[i.value.url]||(E==null?void 0:E.id)||E.attachmentId,R=(v=E[i.value.suffix]||E.attachmentSuffix)==null?void 0:v.toLowerCase(),O=E[i.value.name]||(E==null?void 0:E.attachmentName)||(E==null?void 0:E.originName);if(o.value={...g,name:g[i.value.name],url:cr(n.loadUrl,I)},g&&$r(g,i.value)==="image"){u.image=!0;return}else if(g&&$r(g,i.value)==="video"){u.video=!0;return}else if((((y=n.onlyOfficeConfig)==null?void 0:y.accept)||n.onlyOfficeAccept).includes(R)){u.office=!0,r.value={...n.onlyOfficeConfig,editorConfig:{...((m=n.onlyOfficeConfig)==null?void 0:m.editorConfig)||{},customization:{...((b=(T=n.onlyOfficeConfig)==null?void 0:T.editorConfig)==null?void 0:b.customization)||{},review:{reviewDisplay:"final"}}},document:{key:(g==null?void 0:g.key)||Ae.buildUUID(),title:O,url:cr(n.loadUrl,I),fileType:R,...((k=n.onlyOfficeConfig)==null?void 0:k.document)||{}},documentType:zu(R)},console.log("config",r.value);return}}catch(E){console.info("预览错误: ",E)}};d.watch([e,n.file],([g,p])=>{g&&d.nextTick(()=>{l(n.file)})});const c=()=>{t("close",{file:(o==null?void 0:o.value)||null,config:(r==null?void 0:r.value)||null}),e.value=!1,u.office=!1,u.image=!1,u.video=!1,o.value=null},f=()=>{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?(d.openBlock(),d.createElementBlock(d.Fragment,{key:0},[(v=o.value)!=null&&v.url&&u.image?(d.openBlock(),d.createBlock(d.unref(hf),{key:0,onClose:p[0]||(p[0]=T=>c()),ref:"previewImgRef","url-list":[(y=o.value)==null?void 0:y.url],teleported:"","z-index":9999},null,8,["url-list"])):d.createCommentVNode("v-if",!0),d.createCommentVNode(' <IkPreviewVideo :file="fileData" v-model:show="modal.video" />'),d.createCommentVNode(" 文档类 "),d.createVNode(d.unref(kd),{modelValue:u.video,"onUpdate:modelValue":p[1]||(p[1]=T=>u.video=T),url:(m=o.value)==null?void 0:m.url,onClose:c},null,8,["modelValue","url"]),d.createVNode(d.unref(kl),{modelValue:u.office,"onUpdate:modelValue":p[2]||(p[2]=T=>u.office=T),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:c,"modal-class":"ik-only-preview-dialog"},{default:d.withCtx(()=>{var T,b,k;return[d.createElementVNode("div",Td,[d.createElementVNode("img",{src:(b=(T=r.value.editorConfig.customization)==null?void 0:T.logo)==null?void 0:b.image,onClick:f,alt:""},null,8,wd)]),d.createVNode(d.unref(Yc),{"config-options":r.value,"document-server-url":((k=s.onlyOfficeConfig)==null?void 0:k.serverUrl)||s.onlyofficeServer},null,8,["config-options","document-server-url"])]}),_:1},8,["modelValue"])],64)):d.createCommentVNode("v-if",!0)}}}),Nu=Je(Ed);exports.IkPreviewFileDialog=Nu;exports.default=Nu;