@hopeplayer/core 1.0.4 → 1.0.5

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 (63) hide show
  1. package/dist/HopePlayerElement.d.ts +53 -0
  2. package/dist/HopePlayerElement.d.ts.map +1 -1
  3. package/dist/chunks/{hls-CfP6MPo0.js → hls-BOHE_fg_.js} +10685 -10557
  4. package/dist/chunks/hls-BOHE_fg_.js.map +1 -0
  5. package/dist/chunks/{index-Z7Jmls0c.js → index-7IBf8Y-R.js} +31 -21
  6. package/dist/chunks/index-7IBf8Y-R.js.map +1 -0
  7. package/dist/chunks/{index-CoUeJvsG.js → index-B5z7RvlD.js} +2 -2
  8. package/dist/chunks/{index-CoUeJvsG.js.map → index-B5z7RvlD.js.map} +1 -1
  9. package/dist/chunks/{index-DSOoIVgQ.js → index-B8qJxIhK.js} +2 -2
  10. package/dist/chunks/{index-DSOoIVgQ.js.map → index-B8qJxIhK.js.map} +1 -1
  11. package/dist/chunks/index-BM6ZsBhs.js +2535 -0
  12. package/dist/chunks/index-BM6ZsBhs.js.map +1 -0
  13. package/dist/chunks/{index-DXgJitsr.js → index-C3qu4Vy5.js} +2 -2
  14. package/dist/chunks/{index-DXgJitsr.js.map → index-C3qu4Vy5.js.map} +1 -1
  15. package/dist/chunks/index-C5oGMHF_.js +92 -0
  16. package/dist/chunks/index-C5oGMHF_.js.map +1 -0
  17. package/dist/chunks/{index-C2LLloqz.js → index-CKpSJktz.js} +5 -5
  18. package/dist/chunks/index-CKpSJktz.js.map +1 -0
  19. package/dist/chunks/{index-DrFrsAJ-.js → index-Chzol4wz.js} +2 -2
  20. package/dist/chunks/{index-DrFrsAJ-.js.map → index-Chzol4wz.js.map} +1 -1
  21. package/dist/chunks/index-DGtpFgHV.js +70 -0
  22. package/dist/chunks/index-DGtpFgHV.js.map +1 -0
  23. package/dist/controls/ContextMenu.d.ts +22 -0
  24. package/dist/controls/ContextMenu.d.ts.map +1 -0
  25. package/dist/controls/ControlBar.d.ts +7 -0
  26. package/dist/controls/ControlBar.d.ts.map +1 -1
  27. package/dist/controls/SeekBar.d.ts +7 -0
  28. package/dist/controls/SeekBar.d.ts.map +1 -1
  29. package/dist/hls/SourceManager.d.ts +49 -3
  30. package/dist/hls/SourceManager.d.ts.map +1 -1
  31. package/dist/hope-player.js +3 -2
  32. package/dist/i18n/locales/en.d.ts.map +1 -1
  33. package/dist/i18n/locales/tr.d.ts.map +1 -1
  34. package/dist/i18n/types.d.ts +15 -0
  35. package/dist/i18n/types.d.ts.map +1 -1
  36. package/dist/index.d.ts +3 -3
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/plugins/live/LiveWallClock.d.ts +11 -2
  39. package/dist/plugins/live/LiveWallClock.d.ts.map +1 -1
  40. package/dist/plugins/stats/StatsPanel.d.ts +49 -0
  41. package/dist/plugins/stats/StatsPanel.d.ts.map +1 -0
  42. package/dist/plugins/stats/index.d.ts +5 -0
  43. package/dist/plugins/stats/index.d.ts.map +1 -0
  44. package/dist/plugins/story/HopeStory.d.ts.map +1 -1
  45. package/dist/plugins/tap-gestures/TapGestures.d.ts +38 -0
  46. package/dist/plugins/tap-gestures/TapGestures.d.ts.map +1 -0
  47. package/dist/plugins/tap-gestures/index.d.ts +6 -0
  48. package/dist/plugins/tap-gestures/index.d.ts.map +1 -0
  49. package/dist/screens/ErrorScreen.d.ts +9 -0
  50. package/dist/screens/ErrorScreen.d.ts.map +1 -1
  51. package/dist/subtitles/CaptionRenderer.d.ts.map +1 -1
  52. package/dist/subtitles/attachTracks.d.ts +8 -1
  53. package/dist/subtitles/attachTracks.d.ts.map +1 -1
  54. package/dist/types/index.d.ts +41 -0
  55. package/dist/types/index.d.ts.map +1 -1
  56. package/dist/utils/seek-by.d.ts +3 -0
  57. package/dist/utils/seek-by.d.ts.map +1 -0
  58. package/package.json +2 -2
  59. package/dist/chunks/hls-CfP6MPo0.js.map +0 -1
  60. package/dist/chunks/index-C2LLloqz.js.map +0 -1
  61. package/dist/chunks/index-QJhB8dCl.js +0 -2137
  62. package/dist/chunks/index-QJhB8dCl.js.map +0 -1
  63. package/dist/chunks/index-Z7Jmls0c.js.map +0 -1
@@ -1,2137 +0,0 @@
1
- var ee = Object.defineProperty;
2
- var te = (n, e, t) => e in n ? ee(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var r = (n, e, t) => te(n, typeof e != "symbol" ? e + "" : e, t);
4
- const ie = '/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial}}}@layer theme{:root,:host{--hp-font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--hp-font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--hp-color-black:#000;--hp-color-white:#fff;--hp-spacing:.25rem;--hp-container-xs:20rem;--hp-text-xs:.75rem;--hp-text-xs--line-height:calc(1 / .75);--hp-text-sm:.875rem;--hp-text-sm--line-height:calc(1.25 / .875);--hp-text-base:1rem;--hp-text-base--line-height: 1.5 ;--hp-text-lg:1.125rem;--hp-text-lg--line-height:calc(1.75 / 1.125);--hp-text-xl:1.25rem;--hp-text-xl--line-height:calc(1.75 / 1.25);--hp-text-2xl:1.5rem;--hp-text-2xl--line-height:calc(2 / 1.5);--hp-font-weight-medium:500;--hp-font-weight-semibold:600;--hp-radius-lg:.5rem;--hp-animate-spin:spin 1s linear infinite;--hp-aspect-video:16 / 9;--hp-default-transition-duration:.15s;--hp-default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--hp-default-font-family:var(--hp-font-sans);--hp-default-mono-font-family:var(--hp-font-mono);--hp-color-accent:#fff;--hp-color-on-accent:#0a0a0a;--hp-color-surface:#0a0a0a;--hp-color-surface-elev:#1a1a1a;--hp-color-on-surface:#fff;--hp-color-on-surface-muted:#a3a3a3}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--hp-default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--hp-default-font-feature-settings,normal);font-variation-settings:var(--hp-default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--hp-default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--hp-default-mono-font-feature-settings,normal);font-variation-settings:var(--hp-default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.hp\\:pointer-events-auto{pointer-events:auto}.hp\\:pointer-events-none{pointer-events:none}.hp\\:absolute{position:absolute}.hp\\:relative{position:relative}.hp\\:sticky{position:sticky}.hp\\:inset-0{top:0;right:0;bottom:0;left:0}.hp\\:inset-x-0{inset-inline:0}.hp\\:inset-y-0{inset-block:0}.hp\\:top-0{top:0}.hp\\:top-1{top:var(--hp-spacing)}.hp\\:top-1\\/2{top:50%}.hp\\:top-2{top:calc(var(--hp-spacing) * 2)}.hp\\:right-0{right:0}.hp\\:right-1{right:var(--hp-spacing)}.hp\\:right-2{right:calc(var(--hp-spacing) * 2)}.hp\\:bottom-0{bottom:0}.hp\\:bottom-full{bottom:100%}.hp\\:left-1\\/2{left:50%}.hp\\:z-10{z-index:10}.hp\\:z-20{z-index:20}.hp\\:z-30{z-index:30}.hp\\:z-40{z-index:40}.hp\\:m-0{margin:0}.hp\\:mt-0\\.5{margin-top:calc(var(--hp-spacing) * .5)}.hp\\:mt-1{margin-top:var(--hp-spacing)}.hp\\:mt-2{margin-top:calc(var(--hp-spacing) * 2)}.hp\\:mt-8{margin-top:calc(var(--hp-spacing) * 8)}.hp\\:mb-1{margin-bottom:var(--hp-spacing)}.hp\\:mb-2{margin-bottom:calc(var(--hp-spacing) * 2)}.hp\\:mb-16{margin-bottom:calc(var(--hp-spacing) * 16)}.hp\\:ml-1{margin-left:var(--hp-spacing)}.hp\\:block{display:block}.hp\\:flex{display:flex}.hp\\:grid{display:grid}.hp\\:hidden{display:none}.hp\\:aspect-\\[9\\/16\\]{aspect-ratio:9/16}.hp\\:aspect-video{aspect-ratio:var(--hp-aspect-video)}.hp\\:h-0\\.5{height:calc(var(--hp-spacing) * .5)}.hp\\:h-1{height:var(--hp-spacing)}.hp\\:h-1\\/3{height:33.3333%}.hp\\:h-6{height:calc(var(--hp-spacing) * 6)}.hp\\:h-7{height:calc(var(--hp-spacing) * 7)}.hp\\:h-8{height:calc(var(--hp-spacing) * 8)}.hp\\:h-10{height:calc(var(--hp-spacing) * 10)}.hp\\:h-16{height:calc(var(--hp-spacing) * 16)}.hp\\:h-20{height:calc(var(--hp-spacing) * 20)}.hp\\:h-\\[var\\(--hp-ctrl-btn-size\\)\\]{height:var(--hp-ctrl-btn-size)}.hp\\:h-\\[var\\(--hp-seek-hit-h\\)\\]{height:var(--hp-seek-hit-h)}.hp\\:h-\\[var\\(--hp-seek-track-h\\)\\]{height:var(--hp-seek-track-h)}.hp\\:h-full{height:100%}.hp\\:max-h-64{max-height:calc(var(--hp-spacing) * 64)}.hp\\:max-h-80{max-height:calc(var(--hp-spacing) * 80)}.hp\\:w-0{width:0}.hp\\:w-0\\.5{width:calc(var(--hp-spacing) * .5)}.hp\\:w-1{width:var(--hp-spacing)}.hp\\:w-1\\.5{width:calc(var(--hp-spacing) * 1.5)}.hp\\:w-6{width:calc(var(--hp-spacing) * 6)}.hp\\:w-7{width:calc(var(--hp-spacing) * 7)}.hp\\:w-8{width:calc(var(--hp-spacing) * 8)}.hp\\:w-10{width:calc(var(--hp-spacing) * 10)}.hp\\:w-14{width:calc(var(--hp-spacing) * 14)}.hp\\:w-16{width:calc(var(--hp-spacing) * 16)}.hp\\:w-48{width:calc(var(--hp-spacing) * 48)}.hp\\:w-72{width:calc(var(--hp-spacing) * 72)}.hp\\:w-\\[var\\(--hp-ctrl-btn-size\\)\\]{width:var(--hp-ctrl-btn-size)}.hp\\:w-full{width:100%}.hp\\:max-w-\\[50\\%\\]{max-width:50%}.hp\\:max-w-\\[80\\%\\]{max-width:80%}.hp\\:max-w-\\[85\\%\\]{max-width:85%}.hp\\:max-w-full{max-width:100%}.hp\\:max-w-xs{max-width:var(--hp-container-xs)}.hp\\:min-w-0{min-width:0}.hp\\:flex-1{flex:1}.hp\\:flex-shrink-0,.hp\\:shrink-0{flex-shrink:0}.hp\\:animate-spin{animation:var(--hp-animate-spin)}.hp\\:cursor-pointer{cursor:pointer}.hp\\:touch-none{touch-action:none}.hp\\:list-none{list-style-type:none}.hp\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.hp\\:flex-col{flex-direction:column}.hp\\:flex-wrap{flex-wrap:wrap}.hp\\:items-center{align-items:center}.hp\\:items-end{align-items:flex-end}.hp\\:justify-between{justify-content:space-between}.hp\\:justify-center{justify-content:center}.hp\\:gap-0\\.5{gap:calc(var(--hp-spacing) * .5)}.hp\\:gap-1{gap:var(--hp-spacing)}.hp\\:gap-1\\.5{gap:calc(var(--hp-spacing) * 1.5)}.hp\\:gap-2{gap:calc(var(--hp-spacing) * 2)}.hp\\:gap-3{gap:calc(var(--hp-spacing) * 3)}.hp\\:self-end{align-self:flex-end}.hp\\:truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.hp\\:overflow-hidden{overflow:hidden}.hp\\:overflow-y-auto{overflow-y:auto}.hp\\:rounded{border-radius:.25rem}.hp\\:rounded-full{border-radius:3.40282e38px}.hp\\:rounded-lg{border-radius:var(--hp-radius-lg)}.hp\\:border{border-style:var(--tw-border-style);border-width:1px}.hp\\:border-0{border-style:var(--tw-border-style);border-width:0}.hp\\:border-2{border-style:var(--tw-border-style);border-width:2px}.hp\\:border-\\[3px\\]{border-style:var(--tw-border-style);border-width:3px}.hp\\:border-on-surface\\/20{border-color:var(--hp-color-on-surface)}@supports (color:color-mix(in lab,red,red)){.hp\\:border-on-surface\\/20{border-color:color-mix(in oklab,var(--hp-color-on-surface) 20%,transparent)}}.hp\\:border-on-surface\\/30{border-color:var(--hp-color-on-surface)}@supports (color:color-mix(in lab,red,red)){.hp\\:border-on-surface\\/30{border-color:color-mix(in oklab,var(--hp-color-on-surface) 30%,transparent)}}.hp\\:border-t-accent{border-top-color:var(--hp-color-accent)}.hp\\:bg-accent,.hp\\:bg-accent\\/15{background-color:var(--hp-color-accent)}@supports (color:color-mix(in lab,red,red)){.hp\\:bg-accent\\/15{background-color:color-mix(in oklab,var(--hp-color-accent) 15%,transparent)}}.hp\\:bg-black,.hp\\:bg-black\\/30{background-color:var(--hp-color-black)}@supports (color:color-mix(in lab,red,red)){.hp\\:bg-black\\/30{background-color:color-mix(in oklab,var(--hp-color-black) 30%,transparent)}}.hp\\:bg-black\\/40{background-color:var(--hp-color-black)}@supports (color:color-mix(in lab,red,red)){.hp\\:bg-black\\/40{background-color:color-mix(in oklab,var(--hp-color-black) 40%,transparent)}}.hp\\:bg-black\\/60{background-color:var(--hp-color-black)}@supports (color:color-mix(in lab,red,red)){.hp\\:bg-black\\/60{background-color:color-mix(in oklab,var(--hp-color-black) 60%,transparent)}}.hp\\:bg-black\\/70{background-color:var(--hp-color-black)}@supports (color:color-mix(in lab,red,red)){.hp\\:bg-black\\/70{background-color:color-mix(in oklab,var(--hp-color-black) 70%,transparent)}}.hp\\:bg-black\\/85{background-color:var(--hp-color-black)}@supports (color:color-mix(in lab,red,red)){.hp\\:bg-black\\/85{background-color:color-mix(in oklab,var(--hp-color-black) 85%,transparent)}}.hp\\:bg-on-surface,.hp\\:bg-on-surface\\/20{background-color:var(--hp-color-on-surface)}@supports (color:color-mix(in lab,red,red)){.hp\\:bg-on-surface\\/20{background-color:color-mix(in oklab,var(--hp-color-on-surface) 20%,transparent)}}.hp\\:bg-on-surface\\/25{background-color:var(--hp-color-on-surface)}@supports (color:color-mix(in lab,red,red)){.hp\\:bg-on-surface\\/25{background-color:color-mix(in oklab,var(--hp-color-on-surface) 25%,transparent)}}.hp\\:bg-on-surface\\/40{background-color:var(--hp-color-on-surface)}@supports (color:color-mix(in lab,red,red)){.hp\\:bg-on-surface\\/40{background-color:color-mix(in oklab,var(--hp-color-on-surface) 40%,transparent)}}.hp\\:bg-surface{background-color:var(--hp-color-surface)}.hp\\:bg-surface-elev{background-color:var(--hp-color-surface-elev)}.hp\\:bg-transparent{background-color:#0000}.hp\\:bg-white,.hp\\:bg-white\\/15{background-color:var(--hp-color-white)}@supports (color:color-mix(in lab,red,red)){.hp\\:bg-white\\/15{background-color:color-mix(in oklab,var(--hp-color-white) 15%,transparent)}}.hp\\:bg-white\\/30{background-color:var(--hp-color-white)}@supports (color:color-mix(in lab,red,red)){.hp\\:bg-white\\/30{background-color:color-mix(in oklab,var(--hp-color-white) 30%,transparent)}}.hp\\:bg-white\\/40{background-color:var(--hp-color-white)}@supports (color:color-mix(in lab,red,red)){.hp\\:bg-white\\/40{background-color:color-mix(in oklab,var(--hp-color-white) 40%,transparent)}}.hp\\:bg-gradient-to-t{--tw-gradient-position:to top in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.hp\\:from-black\\/80{--tw-gradient-from:var(--hp-color-black)}@supports (color:color-mix(in lab,red,red)){.hp\\:from-black\\/80{--tw-gradient-from:color-mix(in oklab, var(--hp-color-black) 80%, transparent)}}.hp\\:from-black\\/80{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hp\\:to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hp\\:bg-cover{background-size:cover}.hp\\:bg-center{background-position:50%}.hp\\:object-cover{object-fit:cover}.hp\\:p-0{padding:0}.hp\\:p-1\\.5{padding:calc(var(--hp-spacing) * 1.5)}.hp\\:p-2{padding:calc(var(--hp-spacing) * 2)}.hp\\:p-3{padding:calc(var(--hp-spacing) * 3)}.hp\\:p-4{padding:calc(var(--hp-spacing) * 4)}.hp\\:px-1{padding-inline:var(--hp-spacing)}.hp\\:px-1\\.5{padding-inline:calc(var(--hp-spacing) * 1.5)}.hp\\:px-2{padding-inline:calc(var(--hp-spacing) * 2)}.hp\\:px-3{padding-inline:calc(var(--hp-spacing) * 3)}.hp\\:px-4{padding-inline:calc(var(--hp-spacing) * 4)}.hp\\:py-1{padding-block:var(--hp-spacing)}.hp\\:py-1\\.5{padding-block:calc(var(--hp-spacing) * 1.5)}.hp\\:py-2{padding-block:calc(var(--hp-spacing) * 2)}.hp\\:pt-6{padding-top:calc(var(--hp-spacing) * 6)}.hp\\:pb-2{padding-bottom:calc(var(--hp-spacing) * 2)}.hp\\:text-center{text-align:center}.hp\\:text-left{text-align:left}.hp\\:font-mono{font-family:var(--hp-font-mono)}.hp\\:text-2xl{font-size:var(--hp-text-2xl);line-height:var(--tw-leading,var(--hp-text-2xl--line-height))}.hp\\:text-base{font-size:var(--hp-text-base);line-height:var(--tw-leading,var(--hp-text-base--line-height))}.hp\\:text-lg{font-size:var(--hp-text-lg);line-height:var(--tw-leading,var(--hp-text-lg--line-height))}.hp\\:text-sm{font-size:var(--hp-text-sm);line-height:var(--tw-leading,var(--hp-text-sm--line-height))}.hp\\:text-xl{font-size:var(--hp-text-xl);line-height:var(--tw-leading,var(--hp-text-xl--line-height))}.hp\\:text-xs{font-size:var(--hp-text-xs);line-height:var(--tw-leading,var(--hp-text-xs--line-height))}.hp\\:text-\\[length\\:var\\(--hp-ctrl-icon-size\\)\\]{font-size:var(--hp-ctrl-icon-size)}.hp\\:leading-none{--tw-leading:1;line-height:1}.hp\\:font-medium{--tw-font-weight:var(--hp-font-weight-medium);font-weight:var(--hp-font-weight-medium)}.hp\\:font-semibold{--tw-font-weight:var(--hp-font-weight-semibold);font-weight:var(--hp-font-weight-semibold)}.hp\\:whitespace-nowrap{white-space:nowrap}.hp\\:text-accent{color:var(--hp-color-accent)}.hp\\:text-on-accent{color:var(--hp-color-on-accent)}.hp\\:text-on-surface{color:var(--hp-color-on-surface)}.hp\\:text-on-surface-muted{color:var(--hp-color-on-surface-muted)}.hp\\:text-white{color:var(--hp-color-white)}.hp\\:tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.hp\\:no-underline{text-decoration-line:none}.hp\\:underline{text-decoration-line:underline}.hp\\:opacity-0{opacity:0}.hp\\:opacity-60{opacity:.6}.hp\\:opacity-70{opacity:.7}.hp\\:opacity-80{opacity:.8}.hp\\:opacity-90{opacity:.9}.hp\\:shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hp\\:shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hp\\:drop-shadow{--tw-drop-shadow-size:drop-shadow(0 1px 2px var(--tw-drop-shadow-color,#0000001a)) drop-shadow(0 1px 1px var(--tw-drop-shadow-color,#0000000f));--tw-drop-shadow:drop-shadow(0 1px 2px #0000001a) drop-shadow(0 1px 1px #0000000f);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.hp\\:transition-\\[height\\]{transition-property:height;transition-timing-function:var(--tw-ease,var(--hp-default-transition-timing-function));transition-duration:var(--tw-duration,var(--hp-default-transition-duration))}.hp\\:transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--hp-default-transition-timing-function));transition-duration:var(--tw-duration,var(--hp-default-transition-duration))}.hp\\:transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--hp-default-transition-timing-function));transition-duration:var(--tw-duration,var(--hp-default-transition-duration))}.hp\\:duration-100{--tw-duration:.1s;transition-duration:.1s}.hp\\:duration-150{--tw-duration:.15s;transition-duration:.15s}.hp\\:duration-200{--tw-duration:.2s;transition-duration:.2s}.hp\\:duration-300{--tw-duration:.3s;transition-duration:.3s}.hp\\:will-change-\\[opacity\\]{will-change:opacity}.hp\\:select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.hp\\:group-hover\\:h-\\[var\\(--hp-seek-track-h-hover\\)\\]:is(:where(.hp\\:group):hover *){height:var(--hp-seek-track-h-hover)}.hp\\:hover\\:bg-on-surface\\/5:hover{background-color:var(--hp-color-on-surface)}@supports (color:color-mix(in lab,red,red)){.hp\\:hover\\:bg-on-surface\\/5:hover{background-color:color-mix(in oklab,var(--hp-color-on-surface) 5%,transparent)}}.hp\\:hover\\:bg-on-surface\\/10:hover{background-color:var(--hp-color-on-surface)}@supports (color:color-mix(in lab,red,red)){.hp\\:hover\\:bg-on-surface\\/10:hover{background-color:color-mix(in oklab,var(--hp-color-on-surface) 10%,transparent)}}.hp\\:hover\\:opacity-80:hover{opacity:.8}}.hp\\:focus-visible\\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hp\\:focus-visible\\:ring-accent:focus-visible{--tw-ring-color:var(--hp-color-accent)}.hp\\:focus-visible\\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.hp\\:data-\\[active\\=true\\]\\:bg-accent\\/15[data-active=true]{background-color:var(--hp-color-accent)}@supports (color:color-mix(in lab,red,red)){.hp\\:data-\\[active\\=true\\]\\:bg-accent\\/15[data-active=true]{background-color:color-mix(in oklab,var(--hp-color-accent) 15%,transparent)}}.hp\\:data-\\[active\\=true\\]\\:text-on-surface[data-active=true]{color:var(--hp-color-on-surface)}}.hp-icon{font-variant:normal;text-transform:none;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:hope-icons;font-style:normal;font-weight:400;line-height:1}.hp-icon-check:before{content:""}.hp-icon-chevron-left:before{content:""}.hp-icon-close:before{content:""}.hp-icon-fullscreen-enter:before{content:""}.hp-icon-fullscreen-exit:before{content:""}.hp-icon-loop:before{content:""}.hp-icon-pause:before{content:""}.hp-icon-pip:before{content:""}.hp-icon-play:before{content:""}.hp-icon-settings:before{content:""}.hp-icon-skip-back:before{content:""}.hp-icon-skip-forward:before{content:""}.hp-icon-volume-high:before{content:""}.hp-icon-volume-low:before{content:""}.hp-icon-volume-muted:before{content:""}.hp-icon-warning:before{content:""}:host{--hp-radius:8px;--hp-chip-bg:#ffffff14;--hp-chip-bg-hover:#ffffff2e;--hp-chip-bg-active:#ffffff42;--hp-chip-border:#ffffff29;--hp-chip-border-hover:#ffffff4d;--hp-chip-blur:14px;--hp-chip-shadow:0 4px 18px #00000047, inset 0 1px 0 #ffffff12;--hp-chip-radius:10px;--hp-chip-text:var(--hp-color-on-surface,#fff);--hp-panel-bg:#ffffffb8;--hp-panel-blur:26px;--hp-panel-border:#0f11171a;--hp-panel-text:#15171c;--hp-panel-text-muted:#5b6270;--hp-panel-text-shadow:none;--hp-ctrl-btn-size:32px;--hp-ctrl-icon-size:16px;--hp-seek-hit-h:16px;--hp-seek-track-h:4px;--hp-seek-track-h-hover:6px;--hp-seek-thumb-size:12px;--hp-tooltip-bg:#ffffffe6;--hp-tooltip-text:#15171c;--hp-tooltip-key-bg:#0f11171a;--hp-tooltip-key-text:#15171c;--hp-caption-font-size:16px;--hp-caption-bg:#000000bf;--hp-caption-text:#fff;--hp-caption-radius:4px;background:var(--hp-color-surface,#0a0a0a);width:100%;color:var(--hp-color-on-surface,#fff);border-radius:var(--hp-radius);font-family:system-ui,-apple-system,sans-serif;line-height:1;display:block}.hp-chip{background:var(--hp-chip-bg);border:1px solid var(--hp-chip-border);border-radius:var(--hp-chip-radius);-webkit-backdrop-filter:blur(var(--hp-chip-blur)) saturate(160%);box-shadow:var(--hp-chip-shadow);color:var(--hp-chip-text);transition:background-color .16s,border-color .16s,box-shadow .16s,transform .12s}.hp-chip:hover{background:var(--hp-chip-bg-hover);border-color:var(--hp-chip-border-hover)}button.hp-chip:active{background:var(--hp-chip-bg-active);transform:scale(.94)}.hp-chip:focus-visible{outline:2px solid var(--hp-color-accent,#fff);outline-offset:2px}.hp-chip-panel,.hp-chip-panel:hover{background:var(--hp-panel-bg);border-color:var(--hp-panel-border);-webkit-backdrop-filter:blur(var(--hp-panel-blur)) saturate(160%);text-shadow:var(--hp-panel-text-shadow,none)}.hp-chip-panel{--hp-color-on-surface:var(--hp-panel-text);--hp-color-on-surface-muted:var(--hp-panel-text-muted);color:var(--hp-panel-text)}.hp-tooltip{background:var(--hp-tooltip-bg);color:var(--hp-tooltip-text);border-radius:calc(var(--hp-radius) * .75);-webkit-backdrop-filter:blur(12px)saturate(160%);font-weight:500;box-shadow:0 4px 14px #00000059}.hp-tooltip-key{background:var(--hp-tooltip-key-bg);min-width:16px;height:16px;color:var(--hp-tooltip-key-text);text-transform:uppercase;border-radius:4px;justify-content:center;align-items:center;padding:0 4px;font-size:10px;font-weight:700;line-height:16px;display:inline-flex}.hp-group{background:var(--hp-chip-bg);border:1px solid var(--hp-chip-border);-webkit-backdrop-filter:blur(var(--hp-chip-blur)) saturate(160%);box-shadow:var(--hp-chip-shadow);border-radius:9999px}.hp-group button.hp-chip{box-shadow:none;-webkit-backdrop-filter:none;background:0 0;border-color:#0000}.hp-group button.hp-chip:hover{background:var(--hp-chip-bg-hover)}.hp-group button.hp-chip:active{background:var(--hp-chip-bg-active)}:host([data-theme=glass-dark]),:host([data-theme=neo-dark]),:host([data-theme=mono]){--hp-panel-bg:#0a0a0e8c;--hp-panel-border:#ffffff1a;--hp-panel-text:#fff;--hp-panel-text-muted:#a3a3a3;--hp-panel-text-shadow:0 1px 3px #000000a6;--hp-tooltip-bg:#0a0a0aeb;--hp-tooltip-text:#fff;--hp-tooltip-key-bg:#ffffff2e;--hp-tooltip-key-text:#fff}:host([data-theme=glass-dark]){--hp-chip-bg:#0a0a0e73;--hp-chip-bg-hover:#0a0a0e9e;--hp-chip-bg-active:#0a0a0ebf;--hp-chip-border:#ffffff14;--hp-chip-border-hover:#ffffff29;--hp-chip-shadow:0 4px 18px #0006, inset 0 1px 0 #ffffff0a;--hp-panel-bg:#08080cb8}:host([data-theme=neo-dark]){--hp-chip-bg:#24242a;--hp-chip-bg-hover:#2a2a31;--hp-chip-bg-active:#1e1e23;--hp-chip-border:transparent;--hp-chip-border-hover:transparent;--hp-chip-blur:0px;--hp-chip-shadow:5px 5px 10px #00000080, -4px -4px 9px #ffffff09;--hp-chip-radius:12px;--hp-color-surface:#1b1b20;--hp-panel-bg:#1e1e23;--hp-panel-text-shadow:none}:host([data-theme=neo-dark]) button.hp-chip:active{box-shadow:inset 3px 3px 6px #00000080,inset -2px -2px 5px #ffffff08}:host([data-theme=mono]){--hp-chip-bg:#ffffff0a;--hp-chip-bg-hover:#ffffff1a;--hp-chip-border:#ffffff14;--hp-chip-border-hover:#ffffff24;--hp-chip-blur:0px;--hp-chip-shadow:none;--hp-panel-bg:#0a0a0aeb;--hp-panel-text-shadow:none}@media(pointer:coarse){:host{--hp-ctrl-btn-size:40px;--hp-ctrl-icon-size:18px;--hp-seek-hit-h:22px;--hp-seek-track-h:5px;--hp-seek-track-h-hover:7px;--hp-seek-thumb-size:14px;--hp-caption-font-size:19px}}:host(:fullscreen),:host(:-webkit-full-screen){--hp-ctrl-btn-size:44px;--hp-ctrl-icon-size:20px;--hp-seek-hit-h:26px;--hp-seek-track-h:6px;--hp-seek-track-h-hover:8px;--hp-seek-thumb-size:18px;--hp-caption-font-size:22px}:host(:fullscreen) [part=control-bar],:host(:-webkit-full-screen) [part=control-bar]{padding:28px 20px 18px}.video-area{aspect-ratio:16/9;border-radius:var(--hp-radius);background:var(--hp-color-surface,#0a0a0a);width:100%;position:relative;overflow:hidden}.video-area[data-compact]{--hp-caption-font-size:13px}.video-area[data-story]{aspect-ratio:9/16;max-width:49.5vh;max-height:88vh;margin:0 auto}:host(:fullscreen),:host(:-webkit-full-screen){background:#000;border-radius:0}:host(:fullscreen) .hp-root,:host(:-webkit-full-screen) .hp-root{height:100%}:host(:fullscreen) .video-area,:host(:-webkit-full-screen) .video-area{aspect-ratio:auto;background:#000;border-radius:0;width:100%;height:100%}:host(:fullscreen) .video-area[data-story],:host(:-webkit-full-screen) .video-area[data-story]{aspect-ratio:9/16;width:auto;max-width:100%;height:100%;max-height:none;margin:0 auto}.media-layer{position:absolute;top:0;right:0;bottom:0;left:0}.media-layer video{object-fit:contain;background:#000;width:100%;height:100%}.hp-center-x{transform:translate(-50%)}.hp-center-y{transform:translateY(-50%)}.hp-chip-panel[data-drop]{margin-top:8px;margin-bottom:0;top:100%;bottom:auto}.hp-top-bar{pointer-events:none;display:flex;position:absolute;top:8px;right:8px}.hp-top-bar>*{pointer-events:auto}.hp-unmute-badge{z-index:25;background:var(--hp-tooltip-bg);color:var(--hp-tooltip-text);-webkit-backdrop-filter:blur(12px)saturate(160%);font:inherit;cursor:pointer;border:0;border-radius:9999px;align-items:center;gap:6px;padding:6px 12px 6px 10px;font-size:13px;font-weight:600;display:none;position:absolute;top:10px;left:10px;box-shadow:0 4px 14px #00000059}@media(hover:none)and (pointer:coarse){.hp-volume{display:none!important}.hp-unmute-badge[data-visible]{display:inline-flex}}.hp-error-screen{z-index:30;background:var(--hp-color-surface);justify-content:center;align-items:center;padding:12px;display:none;position:absolute;top:0;right:0;bottom:0;left:0}@supports (color:color-mix(in lab,red,red)){.hp-error-screen{background:color-mix(in srgb,var(--hp-color-surface) 94%,transparent)}}.hp-error-screen{-webkit-backdrop-filter:blur(16px)saturate(140%);color:var(--hp-color-on-surface);text-align:center;container-type:size}.hp-error-screen[data-visible]{animation:.22s hp-error-in;display:flex}@keyframes hp-error-in{0%{opacity:0}}.hp-error-card{flex-direction:column;align-items:center;gap:10px;max-width:340px;display:flex}.hp-error-icon{border:1px solid var(--hp-color-on-surface);border-radius:9999px;place-items:center;width:48px;height:48px;display:grid}@supports (color:color-mix(in lab,red,red)){.hp-error-icon{border:1px solid color-mix(in srgb,var(--hp-color-on-surface) 18%,transparent)}}.hp-error-icon{background:var(--hp-color-on-surface)}@supports (color:color-mix(in lab,red,red)){.hp-error-icon{background:color-mix(in srgb,var(--hp-color-on-surface) 8%,transparent)}}.hp-error-icon{margin-bottom:2px;font-size:22px}.hp-error-message{margin:0;font-size:14px;font-weight:600;line-height:1.45}.hp-error-code{color:var(--hp-color-on-surface-muted);font-variant-numeric:tabular-nums;margin:-4px 0 0;font-size:12px}.hp-error-retry{border:1px solid var(--hp-chip-border);background:var(--hp-chip-bg);color:var(--hp-color-on-surface);font:inherit;cursor:pointer;border-radius:9999px;align-items:center;gap:6px;margin-top:6px;padding:7px 14px 7px 12px;font-size:13px;font-weight:600;transition:background-color .15s,border-color .15s;display:inline-flex}.hp-error-retry:hover{background:var(--hp-chip-bg-hover);border-color:var(--hp-chip-border-hover)}.hp-error-retry:focus-visible{outline:2px solid var(--hp-color-accent);outline-offset:2px}@container (max-height:240px){.hp-error-card{gap:6px}.hp-error-icon{width:36px;height:36px;margin-bottom:0;font-size:16px}.hp-error-message{font-size:13px}.hp-error-code{margin-top:-2px;font-size:11px}.hp-error-retry{margin-top:2px;padding:5px 12px 5px 10px;font-size:12px}}.hp-seek-fb{z-index:8;border:1px solid var(--hp-chip-border);background:var(--hp-chip-bg);-webkit-backdrop-filter:blur(var(--hp-chip-blur)) saturate(160%);box-shadow:var(--hp-chip-shadow);color:var(--hp-chip-text);pointer-events:none;opacity:0;border-radius:9999px;align-items:center;gap:10px;padding:12px 20px 12px 16px;transition:opacity .18s,translate .22s cubic-bezier(.2,.8,.2,1);display:flex;position:absolute;top:50%}.hp-seek-fb[data-side=forward]{right:7%;translate:14px -50%}.hp-seek-fb[data-side=back]{flex-direction:row-reverse;padding:12px 16px 12px 20px;left:7%;translate:-14px -50%}.hp-seek-fb[data-visible]{opacity:1;translate:0 -50%}.hp-seek-fb-chevrons{display:flex}.hp-seek-fb-chevrons svg{fill:currentColor;opacity:.25;width:16px;height:16px;margin:0 -3px;animation:.9s ease-in-out infinite hp-seek-fb-chevron}.hp-seek-fb[data-side=back] .hp-seek-fb-chevrons{transform:scaleX(-1)}.hp-seek-fb-chevrons svg:nth-child(2){animation-delay:.15s}.hp-seek-fb-chevrons svg:nth-child(3){animation-delay:.3s}@keyframes hp-seek-fb-chevron{0%,to{opacity:.25}40%{opacity:1}}.hp-seek-fb-value{white-space:nowrap;align-items:baseline;gap:3px;display:flex}.hp-seek-fb-num{font-variant-numeric:tabular-nums;font-size:20px;font-weight:700;line-height:1;display:inline-block}.hp-seek-fb-unit{opacity:.75;font-size:12px;font-weight:600}.hp-seek-fb-bump{animation:.26s cubic-bezier(.2,.8,.2,1) hp-seek-fb-bump}@keyframes hp-seek-fb-bump{0%{transform:scale(1.25)}to{transform:scale(1)}}.video-area[data-compact] .hp-seek-fb{padding:8px 12px}.video-area[data-compact] .hp-seek-fb[data-side=forward]{right:4%}.video-area[data-compact] .hp-seek-fb[data-side=back]{padding:8px 12px;left:4%}.video-area[data-compact] .hp-seek-fb-chevrons{display:none}.video-area[data-compact] .hp-seek-fb-num{font-size:16px}.hp-sr-only{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}@media(prefers-reduced-motion:reduce){.hp-seek-fb,.hp-seek-fb-chevrons svg,.hp-seek-fb-bump{transition:none;animation:none}.hp-seek-fb-chevrons svg{opacity:.8}}.hp-skip-btn{position:relative}.hp-skip-btn>.hp-icon{font-size:calc(var(--hp-ctrl-icon-size) * 1.45)}.hp-skip-num{padding-top:calc(var(--hp-ctrl-icon-size) * .14);font-size:calc(var(--hp-ctrl-icon-size) * .56);letter-spacing:-.02em;font-variant-numeric:tabular-nums;pointer-events:none;justify-content:center;align-items:center;font-weight:700;line-height:1;display:flex;position:absolute;top:0;right:0;bottom:0;left:0}.hp-skip-num[data-long]{font-size:calc(var(--hp-ctrl-icon-size) * .42)}.hp-skip-btn:disabled{opacity:.4;cursor:default}.hp-center-play>.hp-chip{z-index:7;position:relative}.video-area[data-pause-ad-ready]>:is(.media-layer,.hp-chrome,.hp-center-play,.hp-caption-layer,.hp-error-screen,.hp-mini-progress){right:var(--hp-pause-ad-w,0px);transition:right .38s cubic-bezier(.2,.8,.2,1),opacity .2s}.video-area[data-pause-ad] .media-layer video{object-fit:cover}.hp-pause-ad{z-index:25;width:var(--hp-pause-ad-panel-w,332px);box-sizing:border-box;background:var(--hp-color-surface,#0a0a0a);color:var(--hp-color-on-surface,#fff);visibility:hidden;flex-direction:column;justify-content:center;gap:10px;padding:12px 16px;transition:transform .38s cubic-bezier(.2,.8,.2,1),visibility 0s linear .38s;display:flex;position:absolute;top:0;bottom:0;right:0;transform:translate(100%)}.hp-pause-ad[data-open]{visibility:visible;transition:transform .38s cubic-bezier(.2,.8,.2,1);transform:none}.hp-pause-ad-header{justify-content:space-between;align-items:center;gap:8px;display:flex}.hp-pause-ad-label{color:var(--hp-color-on-surface-muted,#ffffffb3);font-size:13px;font-weight:600}.hp-pause-ad-close{width:28px;height:28px;color:var(--hp-color-on-surface,#fff);cursor:pointer;background:0 0;border:0;border-radius:9999px;justify-content:center;align-items:center;padding:0;transition:background-color .15s;display:inline-flex}.hp-pause-ad-close:hover{background:var(--hp-chip-bg-hover)}.hp-pause-ad-body{border-radius:8px;justify-content:center;display:flex;overflow:hidden}.hp-pause-ad-resume{border:1px solid var(--hp-chip-border);background:var(--hp-chip-bg);color:var(--hp-color-on-surface,#fff);font:inherit;cursor:pointer;border-radius:9999px;align-self:stretch;padding:9px 14px;font-size:13px;font-weight:600;transition:background-color .15s,border-color .15s}.hp-pause-ad-resume:hover{background:var(--hp-chip-bg-hover);border-color:var(--hp-chip-border-hover)}.hp-pause-ad-close:focus-visible,.hp-pause-ad-resume:focus-visible{outline:2px solid var(--hp-color-accent);outline-offset:2px}@media(prefers-reduced-motion:reduce){.video-area[data-pause-ad-ready]>:is(.media-layer,.hp-chrome,.hp-center-play,.hp-caption-layer,.hp-error-screen,.hp-mini-progress),.hp-pause-ad,.hp-pause-ad[data-open]{transition:none}}.hp-seek-thumb{width:var(--hp-seek-thumb-size);height:var(--hp-seek-thumb-size);background:var(--hp-color-accent);will-change:translate,scale;pointer-events:none;z-index:2;border-radius:9999px;transition:scale .15s;position:absolute;left:0;scale:.5}.hp-seekbar:hover .hp-seek-thumb,.hp-seekbar:active .hp-seek-thumb,.hp-seekbar:focus-visible .hp-seek-thumb{scale:1}.hp-seekbar[data-no-duration] .hp-seek-thumb{display:none}.hp-seek-hover-dot{width:var(--hp-seek-track-h-hover);height:var(--hp-seek-track-h-hover);background:var(--hp-color-on-surface);opacity:0;pointer-events:none;z-index:1;border-radius:9999px;transition:opacity .12s;position:absolute;top:50%;left:0;box-shadow:0 0 0 1px #00000073}.hp-seek-hover-dot[data-visible]{opacity:.9}.hp-mini-progress{z-index:6;pointer-events:none;background:var(--hp-color-on-surface);height:1px;position:absolute;bottom:0;left:0;right:0}@supports (color:color-mix(in lab,red,red)){.hp-mini-progress{background:color-mix(in srgb,var(--hp-color-on-surface) 25%,transparent)}}.hp-mini-progress{opacity:0;transition:opacity .2s}.hp-mini-progress[data-visible]:not([data-disabled]){opacity:1}.hp-mini-progress-fill{transform-origin:0;will-change:transform;position:absolute;top:0;right:0;bottom:0;left:0;transform:scaleX(0)}.hp-mini-progress-buffered{background:var(--hp-color-on-surface)}@supports (color:color-mix(in lab,red,red)){.hp-mini-progress-buffered{background:color-mix(in srgb,var(--hp-color-on-surface) 40%,transparent)}}.hp-mini-progress-played{background:var(--hp-color-accent)}.hp-seek-time{border-radius:calc(var(--hp-radius) * .75);background:var(--hp-tooltip-bg);color:var(--hp-tooltip-text);-webkit-backdrop-filter:blur(12px)saturate(160%);font-variant-numeric:tabular-nums;white-space:nowrap;pointer-events:none;visibility:hidden;z-index:20;padding:3px 7px;font-size:12px;font-weight:500;position:absolute;bottom:calc(100% + 8px);left:0;box-shadow:0 4px 14px #00000059}.hp-seek-time[data-visible]{visibility:visible}.hp-sprite-tooltip{pointer-events:none;visibility:hidden;z-index:20;flex-direction:column;align-items:center;gap:4px;display:flex;position:absolute;bottom:calc(100% + 8px);left:0}.hp-sprite-tooltip[data-visible]{visibility:visible}.hp-sprite-image{border-radius:calc(var(--hp-radius) * .75);border:2px solid var(--hp-color-on-surface)}@supports (color:color-mix(in lab,red,red)){.hp-sprite-image{border:2px solid color-mix(in srgb,var(--hp-color-on-surface) 85%,transparent)}}.hp-sprite-image{background-color:#000;background-repeat:no-repeat;box-shadow:0 4px 14px #00000059}.hp-sprite-time{background:var(--hp-tooltip-bg);color:var(--hp-tooltip-text);font-variant-numeric:tabular-nums;white-space:nowrap;border-radius:4px;padding:2px 6px;font-size:12px}.hp-live-badge{height:var(--hp-ctrl-btn-size);color:var(--hp-color-on-surface);font:inherit;letter-spacing:.04em;white-space:nowrap;cursor:pointer;background:0 0;border:0;border-radius:9999px;align-items:center;gap:6px;padding:0 8px;font-size:12px;font-weight:600;display:inline-flex}.hp-live-badge:hover{background:var(--hp-chip-bg-hover)}.hp-live-badge:focus-visible{outline:2px solid var(--hp-color-accent);outline-offset:2px}.hp-live-dot{background:var(--hp-live-color,red);border-radius:50%;width:8px;height:8px;transition:background-color .16s}.hp-live-badge[data-behind]{color:var(--hp-color-on-surface-muted)}.hp-live-badge[data-behind] .hp-live-dot{background:var(--hp-color-on-surface)}@supports (color:color-mix(in lab,red,red)){.hp-live-badge[data-behind] .hp-live-dot{background:color-mix(in srgb,var(--hp-color-on-surface) 45%,transparent)}}.hp-chapters{pointer-events:none;inset-inline:0;align-items:center;gap:2px;display:flex;position:absolute;top:0;bottom:0}.hp-chapter{min-width:1px;height:var(--hp-seek-track-h);background:var(--hp-color-on-surface);border-radius:1px;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.hp-chapter{background:color-mix(in srgb,var(--hp-color-on-surface) 25%,transparent)}}.hp-chapter{transition:height .15s}.hp-seekbar:hover .hp-chapter{height:var(--hp-seek-track-h-hover)}.hp-seekbar .hp-chapter[data-hover]{height:calc(var(--hp-seek-track-h-hover) * 1.6)}.hp-chapter-fill{transform-origin:0;will-change:transform;position:absolute;top:0;right:0;bottom:0;left:0;transform:scaleX(0)}.hp-chapter-buffered{background:var(--hp-color-on-surface)}@supports (color:color-mix(in lab,red,red)){.hp-chapter-buffered{background:color-mix(in srgb,var(--hp-color-on-surface) 40%,transparent)}}.hp-chapter-played{background:var(--hp-color-accent)}.hp-chapter-tooltip{background:var(--hp-tooltip-bg);max-width:240px;color:var(--hp-tooltip-text);border-radius:calc(var(--hp-radius) * .75);-webkit-backdrop-filter:blur(12px)saturate(160%);text-align:center;pointer-events:none;white-space:nowrap;visibility:hidden;z-index:40;flex-direction:column;align-items:center;gap:2px;padding:4px 8px;font-size:12px;line-height:1.3;display:flex;position:absolute;bottom:calc(100% + 6px);left:0;box-shadow:0 4px 14px #00000059}.hp-chapter-tooltip[data-visible]{visibility:visible}.hp-chapter-tooltip-title{text-overflow:ellipsis;max-width:100%;font-weight:600;overflow:hidden}.hp-chapter-tooltip-time{opacity:.75;font-variant-numeric:tabular-nums}:host([data-sticky]){z-index:2147483000;border-radius:var(--hp-radius);box-shadow:0 8px 28px #00000073;aspect-ratio:16/9!important;width:min(360px,92vw)!important;position:fixed!important}:host([data-sticky][data-sticky-corner=br]){inset:auto 16px 16px auto}:host([data-sticky][data-sticky-corner=bl]){inset:auto auto 16px 16px}:host([data-sticky][data-sticky-corner=tr]){inset:16px 16px auto auto}:host([data-sticky][data-sticky-corner=tl]){inset:16px auto auto 16px}.hp-caption-layer{z-index:5;pointer-events:none;position:absolute;top:0;right:0;bottom:0;left:0}.hp-caption-bubble{background:var(--hp-caption-bg);width:max-content;max-width:86%;color:var(--hp-caption-text);border-radius:var(--hp-caption-radius);font-size:calc(var(--hp-caption-font-size) * var(--hp-caption-size-multiplier,1));text-align:center;white-space:pre-line;cursor:grab;pointer-events:auto;touch-action:none;-webkit-user-select:none;user-select:none;padding:.3em .6em;line-height:1.4;transition:transform .18s;display:none;position:absolute;bottom:0;left:50%;transform:translate(-50%)}.hp-caption-bubble.hp-caption-visible{display:inline-block}.hp-caption-bubble.hp-caption-dragging,.hp-caption-bubble.hp-caption-no-transition{transition:none}.hp-caption-bubble.hp-caption-dragging{cursor:grabbing}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}';
5
- function F() {
6
- if (typeof navigator > "u") return !1;
7
- const n = navigator.userAgent, e = /iP(hone|od|ad)/.test(n) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1, t = /^((?!chrome|chromium|android|crios|fxios|edg|opr).)*safari/i.test(n);
8
- return e || t;
9
- }
10
- function O() {
11
- const n = window;
12
- return typeof n.MediaSource < "u" || typeof n.ManagedMediaSource < "u";
13
- }
14
- function re(n, e) {
15
- var i;
16
- const t = (i = e == null ? void 0 : e.split(";")[0]) == null ? void 0 : i.trim().toLowerCase();
17
- return t === "application/vnd.apple.mpegurl" || t === "application/x-mpegurl" || /\.m3u8(?:$|[?#])/i.test(n) ? "hls" : t === "video/mp4" || /\.mp4(?:$|[?#])/i.test(n) ? "mp4" : "unknown";
18
- }
19
- class se {
20
- constructor(e, t) {
21
- r(this, "hls", null);
22
- r(this, "video");
23
- /** Son yüklenen kaynak — `reload()` (hata ekranındaki "Tekrar dene") için. */
24
- r(this, "last", null);
25
- /** Native HLS denemesi sürerken (ilk loadedmetadata'ya kadar) — başarısız olursa hls.js'e geçilir. */
26
- r(this, "nativeHlsProbe", null);
27
- r(this, "engineInfo", { engine: "native" });
28
- r(this, "onLevelsChanged");
29
- this.video = e, this.onLevelsChanged = t;
30
- }
31
- async load(e, t) {
32
- this.last = { src: e, type: t }, this.destroy(), this.video.pause();
33
- const i = re(e, t);
34
- if (this.onLevelsChanged([], -1), i !== "hls") {
35
- this.engineInfo = { engine: "native" }, this.video.src = e;
36
- return;
37
- }
38
- if (this.video.canPlayType("application/vnd.apple.mpegurl") !== "" && (F() || !O())) {
39
- this.loadNativeHls(e, F() ? "apple-native" : "no-mse");
40
- return;
41
- }
42
- await this.attachHlsJs(e);
43
- }
44
- /** Şu anki oynatma yolu — docs demosu/entegratör teşhisi için (ör. CORS yüzünden native'e düşüldü mü). */
45
- get engine() {
46
- return this.engineInfo;
47
- }
48
- loadNativeHls(e, t) {
49
- this.engineInfo = { engine: "native-hls", reason: t }, this.probeNativeHls(e), this.video.src = e;
50
- }
51
- /** Native HLS denemesi sürüyor mu — ErrorScreen bu sırada gelen hatayı göstermez (hls.js'e geçilecek). */
52
- isRecovering() {
53
- return this.nativeHlsProbe !== null;
54
- }
55
- /**
56
- * Bazı ortamlar canPlayType'a "maybe" deyip HLS'i native oynatamıyor (bazı Android tarayıcıları/WebView'lar).
57
- * İlk metadata'dan önce kod 4 gelirse ve MSE varsa hls.js'e geç.
58
- */
59
- probeNativeHls(e) {
60
- if (!O() || this.engineInfo.reason === "hlsjs-failed") return;
61
- const t = () => s(), i = () => {
62
- var a;
63
- const o = ((a = this.video.error) == null ? void 0 : a.code) === 4;
64
- s(), o && this.attachHlsJs(e);
65
- }, s = () => {
66
- this.video.removeEventListener("loadedmetadata", t), this.video.removeEventListener("error", i), this.nativeHlsProbe = null;
67
- };
68
- this.video.addEventListener("loadedmetadata", t), this.video.addEventListener("error", i), this.nativeHlsProbe = s;
69
- }
70
- async attachHlsJs(e) {
71
- var o;
72
- const { default: t } = await import("./hls-CfP6MPo0.js");
73
- if (((o = this.last) == null ? void 0 : o.src) !== e) return;
74
- if (!t.isSupported()) {
75
- this.engineInfo = { engine: "native-hls", reason: "no-mse" }, this.video.src = e;
76
- return;
77
- }
78
- const i = new t({
79
- enableWorker: !0
80
- });
81
- this.hls = i, this.engineInfo = { engine: "hls.js" };
82
- let s = !1;
83
- i.on(t.Events.ERROR, (a, h) => {
84
- !h.fatal || s || this.hls !== i || ![t.ErrorDetails.MANIFEST_LOAD_ERROR, t.ErrorDetails.MANIFEST_LOAD_TIMEOUT].includes(h.details) || this.video.canPlayType("application/vnd.apple.mpegurl") !== "" && (i.destroy(), this.hls = null, this.loadNativeHls(e, "hlsjs-failed"));
85
- }), i.on(t.Events.MANIFEST_PARSED, () => {
86
- s = !0;
87
- const a = i.levels.map(
88
- (h, d) => ({
89
- index: d,
90
- height: h.height,
91
- bitrate: h.bitrate
92
- })
93
- );
94
- this.onLevelsChanged(a, i.currentLevel);
95
- }), i.on(t.Events.LEVEL_SWITCHED, (a, h) => {
96
- const d = i.levels.map(
97
- (l, p) => ({
98
- index: p,
99
- height: l.height,
100
- bitrate: l.bitrate
101
- })
102
- );
103
- this.onLevelsChanged(d, i.autoLevelEnabled ? -1 : h.level);
104
- }), i.attachMedia(this.video), i.loadSource(e);
105
- }
106
- /** Son kaynağı baştan yükler — hls.js ile oynayan kaynakta da çalışır (çıplak video.load() blob'u yeniden açamaz). */
107
- reload() {
108
- return this.last ? this.load(this.last.src, this.last.type) : Promise.resolve();
109
- }
110
- /** -1 = otomatik kalite (ABR). */
111
- setLevel(e) {
112
- this.hls && (this.hls.currentLevel = e);
113
- }
114
- destroy() {
115
- var e;
116
- (e = this.nativeHlsProbe) == null || e.call(this), this.hls && (this.hls.destroy(), this.hls = null);
117
- }
118
- }
119
- function E(n) {
120
- if (!Number.isFinite(n) || n < 0) return "0:00";
121
- const e = Math.floor(n), t = Math.floor(e / 3600), i = Math.floor(e % 3600 / 60), s = e % 60, o = t > 0 ? String(i).padStart(2, "0") : String(i), a = String(s).padStart(2, "0");
122
- return t > 0 ? `${t}:${o}:${a}` : `${o}:${a}`;
123
- }
124
- class oe {
125
- constructor(e, t) {
126
- r(this, "el");
127
- r(this, "trackEl");
128
- r(this, "chaptersEl", null);
129
- r(this, "chapters", []);
130
- /** İmlecin üstündeki zaman (varsayılan, plugin gerektirmez) — kendi zamanını gösteren plugin'ler `suppressHoverTime` ile gizler. */
131
- r(this, "hoverTimeEl");
132
- r(this, "hoverTimeSuppressors", /* @__PURE__ */ new Set());
133
- r(this, "playedEl");
134
- r(this, "bufferedEl");
135
- r(this, "thumbEl");
136
- r(this, "hoverDotEl");
137
- r(this, "video");
138
- r(this, "labels");
139
- r(this, "dragging", !1);
140
- r(this, "markerEls", []);
141
- r(this, "trackWidth", 0);
142
- r(this, "resizeObserver");
143
- r(this, "rafId", null);
144
- r(this, "onHoverMove", (e) => {
145
- const t = this.video.duration, i = Number.isFinite(t) && t > 0, s = this.ratioAtClientX(e.clientX);
146
- if (i && !this.dragging ? (this.hoverDotEl.style.transform = `translate(${this.xAtRatio(s)}px, -50%) translateX(-50%)`, this.hoverDotEl.setAttribute("data-visible", "")) : this.hoverDotEl.removeAttribute("data-visible"), this.hoverTimeSuppressors.size || !i) {
147
- this.hoverTimeEl.removeAttribute("data-visible");
148
- return;
149
- }
150
- this.hoverTimeEl.textContent = E(s * t), this.hoverTimeEl.setAttribute("data-visible", "");
151
- const o = this.el.getBoundingClientRect(), a = this.hoverTimeEl.offsetWidth, h = Math.min(Math.max(e.clientX - o.left - a / 2, 0), Math.max(o.width - a, 0));
152
- this.hoverTimeEl.style.transform = `translateX(${h}px)`;
153
- });
154
- r(this, "onHoverLeave", () => {
155
- this.hoverTimeEl.removeAttribute("data-visible"), this.hoverDotEl.removeAttribute("data-visible");
156
- });
157
- r(this, "onPointerDown", (e) => {
158
- this.dragging = !0, this.hoverDotEl.removeAttribute("data-visible"), this.el.setPointerCapture(e.pointerId), this.seekToRatio(this.ratioFromEvent(e)), this.el.addEventListener("pointermove", this.onPointerMove), this.el.addEventListener("pointerup", this.onPointerUp);
159
- });
160
- r(this, "onPointerMove", (e) => {
161
- this.dragging && this.seekToRatio(this.ratioFromEvent(e));
162
- });
163
- r(this, "onPointerUp", (e) => {
164
- this.dragging = !1, this.el.releasePointerCapture(e.pointerId), this.el.removeEventListener("pointermove", this.onPointerMove), this.el.removeEventListener("pointerup", this.onPointerUp);
165
- });
166
- /** Odaktayken ←/→ sarma süresi (sn) — player'ın klavye kısayoluyla aynı (options.keyboardSeekStep). */
167
- r(this, "keyboardStep", 5);
168
- /** Odaktayken ok tuşuyla sarıldığında (sn, negatif = geri) — sarma bildirimi için. */
169
- r(this, "onKeyboardSeek", null);
170
- r(this, "onKeyDown", (e) => {
171
- var i, s;
172
- const t = this.video.duration || 0;
173
- !Number.isFinite(t) || t <= 0 || (e.key === "ArrowRight" ? (this.video.currentTime = Math.min(t, this.video.currentTime + this.keyboardStep), (i = this.onKeyboardSeek) == null || i.call(this, this.keyboardStep), e.preventDefault()) : e.key === "ArrowLeft" && (this.video.currentTime = Math.max(0, this.video.currentTime - this.keyboardStep), (s = this.onKeyboardSeek) == null || s.call(this, -this.keyboardStep), e.preventDefault()));
174
- });
175
- r(this, "startLoop", () => {
176
- if (this.rafId !== null) return;
177
- const e = () => {
178
- this.render(), this.rafId = requestAnimationFrame(e);
179
- };
180
- this.rafId = requestAnimationFrame(e);
181
- });
182
- r(this, "stopLoop", () => {
183
- this.rafId !== null && (cancelAnimationFrame(this.rafId), this.rafId = null), this.render();
184
- });
185
- r(this, "render", () => {
186
- const e = this.video.duration;
187
- if (this.el.toggleAttribute("data-no-duration", !Number.isFinite(e) || e <= 0), !Number.isFinite(e) || e <= 0) {
188
- this.playedEl.style.transform = "scaleX(0)", this.thumbEl.style.translate = "-50% 0", this.bufferedEl.style.transform = "scaleX(0)";
189
- return;
190
- }
191
- const t = this.video.currentTime / e;
192
- this.thumbEl.style.translate = `calc(${this.xAtRatio(t)}px - 50%) 0`;
193
- let i = 0;
194
- for (let o = 0; o < this.video.buffered.length; o++)
195
- this.video.buffered.start(o) <= this.video.currentTime && (i = Math.max(i, this.video.buffered.end(o)));
196
- const s = i / e;
197
- if (this.chapters.length)
198
- for (const o of this.chapters) {
199
- const a = o.end - o.start, h = (d) => a > 0 ? Math.min(1, Math.max(0, (d - o.start) / a)) : 0;
200
- o.playedEl.style.transform = `scaleX(${h(t)})`, o.bufferedEl.style.transform = `scaleX(${h(s)})`;
201
- }
202
- else
203
- this.playedEl.style.transform = `scaleX(${t})`, this.bufferedEl.style.transform = `scaleX(${s})`;
204
- this.el.setAttribute("aria-valuemax", String(Math.floor(e))), this.el.setAttribute("aria-valuenow", String(Math.floor(this.video.currentTime)));
205
- });
206
- this.video = e, this.labels = t, this.el = document.createElement("div"), this.el.setAttribute("part", "seek-bar"), this.el.className = "hp-seekbar hp:relative hp:h-[var(--hp-seek-hit-h)] hp:flex hp:items-center hp:cursor-pointer hp:group hp:touch-none", this.el.setAttribute("role", "slider"), this.el.setAttribute("tabindex", "0"), this.el.setAttribute("aria-label", t.seekBar), this.el.setAttribute("aria-valuemin", "0");
207
- const i = document.createElement("div");
208
- i.className = "hp:absolute hp:inset-x-0 hp:h-[var(--hp-seek-track-h)] hp:rounded-full hp:bg-on-surface/25 hp:group-hover:h-[var(--hp-seek-track-h-hover)] hp:transition-[height] hp:duration-150", this.el.appendChild(i), this.trackEl = i, this.bufferedEl = document.createElement("div"), this.bufferedEl.className = "hp:absolute hp:inset-0 hp:rounded-full hp:bg-on-surface/40", this.bufferedEl.style.transformOrigin = "left", this.bufferedEl.style.willChange = "transform", i.appendChild(this.bufferedEl), this.playedEl = document.createElement("div"), this.playedEl.className = "hp:absolute hp:inset-0 hp:rounded-full hp:bg-accent", this.playedEl.style.transformOrigin = "left", this.playedEl.style.willChange = "transform", i.appendChild(this.playedEl), this.thumbEl = document.createElement("div"), this.thumbEl.className = "hp-seek-thumb", this.thumbEl.setAttribute("part", "seek-thumb"), this.el.appendChild(this.thumbEl), this.hoverDotEl = document.createElement("div"), this.hoverDotEl.className = "hp-seek-hover-dot", this.hoverDotEl.setAttribute("part", "seek-hover-dot"), this.el.appendChild(this.hoverDotEl), this.hoverTimeEl = document.createElement("div"), this.hoverTimeEl.className = "hp-seek-time", this.hoverTimeEl.setAttribute("part", "seek-time"), this.el.appendChild(this.hoverTimeEl), this.el.addEventListener("pointerdown", this.onPointerDown), this.el.addEventListener("pointermove", this.onHoverMove), this.el.addEventListener("pointerleave", this.onHoverLeave), this.el.addEventListener("keydown", this.onKeyDown), e.addEventListener("play", this.startLoop), e.addEventListener("pause", this.stopLoop), e.addEventListener("ended", this.stopLoop), e.addEventListener("timeupdate", this.render), e.addEventListener("progress", this.render), e.addEventListener("loadedmetadata", this.render), e.paused || this.startLoop(), this.resizeObserver = new ResizeObserver(() => {
209
- this.trackWidth = this.el.getBoundingClientRect().width, this.measureChapters(), this.render();
210
- }), this.resizeObserver.observe(this.el), this.trackWidth = this.el.getBoundingClientRect().width;
211
- }
212
- /** Kendi zamanını gösteren plugin'ler (sprite/segments) varsayılan hover zamanını gizler — keyed set. */
213
- suppressHoverTime(e, t) {
214
- t ? this.hoverTimeSuppressors.add(e) : this.hoverTimeSuppressors.delete(e), t && this.hoverTimeEl.removeAttribute("data-visible");
215
- }
216
- ratioFromEvent(e) {
217
- return this.ratioAtClientX(e.clientX);
218
- }
219
- /** Ekran x koordinatını 0–1 zaman oranına çevirir — chapter modunda parça boşluklarını hesaba katar (segments plugin'inin hover popup'ı da bunu kullanıyor). */
220
- ratioAtClientX(e) {
221
- const t = this.el.getBoundingClientRect(), i = e - t.left;
222
- if (!this.chapters.length) return Math.min(1, Math.max(0, i / t.width));
223
- for (let s = 0; s < this.chapters.length; s++) {
224
- const o = this.chapters[s], a = this.chapters[s + 1], h = a ? a.left : 1 / 0;
225
- if (i < h || !a) {
226
- const d = o.width > 0 ? Math.min(1, Math.max(0, (i - o.left) / o.width)) : 0;
227
- return o.start + d * (o.end - o.start);
228
- }
229
- }
230
- return 1;
231
- }
232
- /** 0–1 zaman oranının seek bar üzerindeki px konumu (thumb için). */
233
- xAtRatio(e) {
234
- if (!this.chapters.length) return e * this.trackWidth;
235
- const t = this.chapters.find((o) => e < o.end) ?? this.chapters[this.chapters.length - 1], i = t.end - t.start, s = i > 0 ? Math.min(1, Math.max(0, (e - t.start) / i)) : 0;
236
- return t.left + s * t.width;
237
- }
238
- /** Track'i sıralı, 0→1'i kesintisiz kapsayan oran aralıklarına göre ayrı parçalara böler. */
239
- setChapters(e) {
240
- if (this.clearChapters(), !e.length) return [];
241
- const t = document.createElement("div");
242
- return t.className = "hp-chapters", this.chapters = e.map((i) => {
243
- const s = document.createElement("div");
244
- s.className = "hp-chapter", s.setAttribute("part", "segment-band"), s.style.flex = `${Math.max(i.end - i.start, 0)} 1 0px`;
245
- const o = document.createElement("div");
246
- o.className = "hp-chapter-fill hp-chapter-buffered";
247
- const a = document.createElement("div");
248
- return a.className = "hp-chapter-fill hp-chapter-played", i.color && (a.style.background = i.color), s.append(o, a), t.appendChild(s), { ...i, el: s, bufferedEl: o, playedEl: a, left: 0, width: 0 };
249
- }), this.trackEl.style.display = "none", this.trackEl.after(t), this.chaptersEl = t, this.measureChapters(), this.render(), this.chapters.map((i) => i.el);
250
- }
251
- clearChapters() {
252
- var e;
253
- (e = this.chaptersEl) == null || e.remove(), this.chaptersEl = null, this.chapters = [], this.trackEl.style.display = "", this.render();
254
- }
255
- measureChapters() {
256
- if (!this.chapters.length) return;
257
- const e = this.el.getBoundingClientRect().left;
258
- for (const t of this.chapters) {
259
- const i = t.el.getBoundingClientRect();
260
- t.left = i.left - e, t.width = i.width;
261
- }
262
- }
263
- seekToRatio(e) {
264
- const t = this.video.duration;
265
- !Number.isFinite(t) || t <= 0 || (this.video.currentTime = e * t, this.render());
266
- }
267
- /** 0–1 arası oranda, seek bar üzerine ince bir işaret çizgisi ekler (ör. loop A/B noktaları). */
268
- addMarker(e, t = "") {
269
- const i = document.createElement("div");
270
- return i.className = `hp:absolute hp:top-0 hp:bottom-0 hp:w-0.5 hp:bg-on-surface hp:pointer-events-none ${t}`, i.style.left = `${Math.min(1, Math.max(0, e)) * 100}%`, this.el.appendChild(i), this.markerEls.push(i), i;
271
- }
272
- clearMarkers() {
273
- this.markerEls.forEach((e) => e.remove()), this.markerEls.length = 0;
274
- }
275
- refreshLabels() {
276
- this.el.setAttribute("aria-label", this.labels.seekBar);
277
- }
278
- destroy() {
279
- var e;
280
- this.rafId !== null && cancelAnimationFrame(this.rafId), this.resizeObserver.disconnect(), this.el.removeEventListener("pointermove", this.onHoverMove), this.el.removeEventListener("pointerleave", this.onHoverLeave), this.video.removeEventListener("play", this.startLoop), this.video.removeEventListener("pause", this.stopLoop), this.video.removeEventListener("ended", this.stopLoop), this.video.removeEventListener("timeupdate", this.render), this.video.removeEventListener("progress", this.render), this.video.removeEventListener("loadedmetadata", this.render), this.clearMarkers(), (e = this.chaptersEl) == null || e.remove();
281
- }
282
- }
283
- function g(n, e = "") {
284
- const t = document.createElement("i");
285
- return t.className = `hp-icon hp-icon-${n}${e ? ` ${e}` : ""}`, t.setAttribute("aria-hidden", "true"), t;
286
- }
287
- function A(n, e) {
288
- n.className = n.className.replace(/hp-icon-[\w-]+/, `hp-icon-${e}`);
289
- }
290
- const T = 0.05, ne = 150;
291
- class ae {
292
- constructor(e, t, i) {
293
- r(this, "el");
294
- /** Dokunmatikte ses butonu gizli; sessiz oynarken görünen "Sesi aç" rozeti (chrome dışında monte edilir, otomatik gizlenmez). */
295
- r(this, "unmuteBadge");
296
- r(this, "unmuteText");
297
- r(this, "button");
298
- r(this, "iconEl");
299
- r(this, "slider");
300
- r(this, "sliderFill");
301
- r(this, "video");
302
- r(this, "labels");
303
- r(this, "adHooks");
304
- r(this, "dragging", !1);
305
- r(this, "hideTimer", null);
306
- r(this, "openNow", () => {
307
- this.hideTimer && (clearTimeout(this.hideTimer), this.hideTimer = null), this.slider.style.opacity = "1", this.slider.style.pointerEvents = "auto";
308
- });
309
- r(this, "scheduleHide", () => {
310
- this.hideTimer && clearTimeout(this.hideTimer), this.hideTimer = setTimeout(() => {
311
- this.hideTimer = null, this.slider.style.opacity = "0", this.slider.style.pointerEvents = "none";
312
- }, ne);
313
- });
314
- r(this, "onWheel", (e) => {
315
- if (e.preventDefault(), this.adHooks.isAdActive()) {
316
- const s = this.adHooks.getVolume();
317
- this.adHooks.setVolume(Math.min(1, Math.max(0, s + (e.deltaY < 0 ? T : -T)))), this.render();
318
- return;
319
- }
320
- const t = this.video.muted ? 0 : this.video.volume, i = Math.min(1, Math.max(0, t + (e.deltaY < 0 ? T : -T)));
321
- this.video.volume = i, this.video.muted = i === 0;
322
- });
323
- r(this, "onToggleMute", () => {
324
- if (this.adHooks.isAdActive()) {
325
- this.adHooks.toggleMute(), this.render();
326
- return;
327
- }
328
- this.video.muted = !this.video.muted, !this.video.muted && this.video.volume === 0 && (this.video.volume = 0.5);
329
- });
330
- r(this, "onSliderPointerDown", (e) => {
331
- this.dragging = !0, this.slider.setPointerCapture(e.pointerId), this.setFromClientY(e.clientY), this.slider.addEventListener("pointermove", this.onSliderPointerMove), this.slider.addEventListener("pointerup", this.onSliderPointerUp);
332
- });
333
- r(this, "onSliderPointerMove", (e) => {
334
- this.dragging && this.setFromClientY(e.clientY);
335
- });
336
- r(this, "onSliderPointerUp", (e) => {
337
- this.dragging = !1, this.slider.releasePointerCapture(e.pointerId), this.slider.removeEventListener("pointermove", this.onSliderPointerMove), this.slider.removeEventListener("pointerup", this.onSliderPointerUp);
338
- });
339
- r(this, "onSliderKeyDown", (e) => {
340
- if (this.adHooks.isAdActive()) {
341
- if (e.key === "ArrowUp")
342
- this.adHooks.setVolume(Math.min(1, this.adHooks.getVolume() + 0.1)), e.preventDefault();
343
- else if (e.key === "ArrowDown")
344
- this.adHooks.setVolume(Math.max(0, this.adHooks.getVolume() - 0.1)), e.preventDefault();
345
- else
346
- return;
347
- this.render();
348
- return;
349
- }
350
- e.key === "ArrowUp" ? (this.video.volume = Math.min(1, this.video.volume + 0.1), this.video.muted = !1, e.preventDefault()) : e.key === "ArrowDown" && (this.video.volume = Math.max(0, this.video.volume - 0.1), e.preventDefault());
351
- });
352
- r(this, "render", () => {
353
- const e = this.adHooks.isAdActive() ? this.adHooks.getVolume() : this.video.muted ? 0 : this.video.volume;
354
- this.sliderFill.style.height = `${e * 100}%`, this.slider.setAttribute("aria-valuenow", String(Math.round(e * 100)));
355
- const t = e === 0 ? this.labels.unmute : this.labels.mute;
356
- this.button.setAttribute("aria-label", t);
357
- const i = this.adHooks.isAdActive() || !this.video.paused;
358
- this.unmuteBadge.toggleAttribute("data-visible", e === 0 && i), this.unmuteText.textContent = this.labels.unmute, e === 0 ? A(this.iconEl, "volume-muted") : e < 0.5 ? A(this.iconEl, "volume-low") : A(this.iconEl, "volume-high");
359
- });
360
- this.video = e, this.labels = t, this.adHooks = i, this.el = document.createElement("div"), this.el.className = "hp-volume hp:relative hp:flex hp:items-center", this.unmuteBadge = document.createElement("button"), this.unmuteBadge.type = "button", this.unmuteBadge.className = "hp-unmute-badge", this.unmuteBadge.setAttribute("part", "unmute-badge"), this.unmuteBadge.appendChild(g("volume-muted", "hp:text-base")), this.unmuteText = document.createElement("span"), this.unmuteText.textContent = t.unmute, this.unmuteBadge.appendChild(this.unmuteText), this.unmuteBadge.addEventListener("pointerdown", (o) => o.stopPropagation()), this.unmuteBadge.addEventListener("click", (o) => {
361
- o.stopPropagation(), this.unmute();
362
- }), this.button = document.createElement("button"), this.button.type = "button", this.button.setAttribute("part", "volume-button"), this.button.className = "hp-chip hp:flex hp:items-center hp:justify-center hp:w-[var(--hp-ctrl-btn-size)] hp:h-[var(--hp-ctrl-btn-size)] hp:cursor-pointer", this.button.setAttribute("aria-label", t.mute), this.button.dataset.shortcut = "M", this.iconEl = g("volume-high", "hp:text-[length:var(--hp-ctrl-icon-size)]"), this.button.appendChild(this.iconEl), this.el.appendChild(this.button), this.slider = document.createElement("div"), this.slider.setAttribute("part", "volume-slider"), this.slider.className = "hp-chip hp:absolute hp:bottom-full hp:left-1/2 hp-center-x hp:mb-2 hp:w-7 hp:h-20 hp:rounded-full hp:cursor-pointer hp:flex hp:items-end hp:justify-center hp:p-1.5 hp:pointer-events-none hp:transition-opacity hp:duration-150 hp:will-change-[opacity]", this.slider.style.opacity = "0", this.slider.style.borderRadius = "9999px", this.slider.setAttribute("role", "slider"), this.slider.setAttribute("tabindex", "0"), this.slider.setAttribute("aria-label", t.volume), this.slider.setAttribute("aria-orientation", "vertical"), this.slider.setAttribute("aria-valuemin", "0"), this.slider.setAttribute("aria-valuemax", "100");
363
- const s = document.createElement("div");
364
- s.className = "hp:relative hp:w-1.5 hp:h-full hp:rounded-full hp:bg-on-surface/25 hp:overflow-hidden", this.slider.appendChild(s), this.sliderFill = document.createElement("div"), this.sliderFill.className = "hp:absolute hp:inset-x-0 hp:bottom-0 hp:bg-accent", s.appendChild(this.sliderFill), this.el.appendChild(this.slider), this.button.addEventListener("click", this.onToggleMute), this.slider.addEventListener("pointerdown", this.onSliderPointerDown), this.slider.addEventListener("keydown", this.onSliderKeyDown), this.el.addEventListener("mouseenter", this.openNow), this.el.addEventListener("mouseleave", this.scheduleHide), this.el.addEventListener("focusin", this.openNow), this.el.addEventListener("focusout", this.scheduleHide), this.el.addEventListener("wheel", this.onWheel, { passive: !1 }), e.addEventListener("volumechange", this.render), e.addEventListener("play", this.render), e.addEventListener("pause", this.render), this.render();
365
- }
366
- /** "Sesi aç" rozeti: yalnızca AÇAR (toggle değil) — reklam sırasında reklamın sesini. */
367
- unmute() {
368
- if (this.adHooks.isAdActive()) {
369
- this.adHooks.getVolume() === 0 && this.adHooks.toggleMute(), this.render();
370
- return;
371
- }
372
- this.video.muted = !1, this.video.volume === 0 && (this.video.volume = 0.5);
373
- }
374
- /** Dikey çubukta: üst = tam ses (1), alt = sessiz (0) — Y ekseni ters çevrilir. */
375
- setFromClientY(e) {
376
- const t = this.slider.getBoundingClientRect(), i = t.height > 0 ? 1 - Math.min(1, Math.max(0, (e - t.top) / t.height)) : 0;
377
- if (this.adHooks.isAdActive()) {
378
- this.adHooks.setVolume(i), this.render();
379
- return;
380
- }
381
- this.video.volume = i, this.video.muted = i === 0;
382
- }
383
- refreshLabels() {
384
- this.slider.setAttribute("aria-label", this.labels.volume), this.render();
385
- }
386
- /** Reklam modu açılıp/kapanınca (`ControlBar.setAdMode`) görüntüyü hemen ad/içerik ses kaynağına göre tazeler — `volumechange` event'i beklemeden. */
387
- refreshForAdMode() {
388
- this.render();
389
- }
390
- setIconColor(e) {
391
- this.iconEl.style.color = e;
392
- }
393
- setSliderFillColor(e) {
394
- this.sliderFill.style.background = e;
395
- }
396
- destroy() {
397
- this.hideTimer && clearTimeout(this.hideTimer), this.el.removeEventListener("mouseenter", this.openNow), this.el.removeEventListener("mouseleave", this.scheduleHide), this.el.removeEventListener("focusin", this.openNow), this.el.removeEventListener("focusout", this.scheduleHide), this.el.removeEventListener("wheel", this.onWheel), this.video.removeEventListener("volumechange", this.render), this.video.removeEventListener("play", this.render), this.video.removeEventListener("pause", this.render), this.unmuteBadge.remove();
398
- }
399
- }
400
- const le = 8, L = 8, he = 100, N = 256;
401
- class pe {
402
- constructor(e, t, i) {
403
- r(this, "el");
404
- r(this, "button");
405
- r(this, "panel");
406
- r(this, "video");
407
- r(this, "playbackRates");
408
- r(this, "labels");
409
- r(this, "qualities", []);
410
- r(this, "activeQualityLabel");
411
- r(this, "captions", []);
412
- r(this, "activeCaptionLabel");
413
- r(this, "captionAppearance", null);
414
- r(this, "qrResumeToggle", null);
415
- r(this, "open", !1);
416
- /** Menü açılıp kapanınca — HopePlayerElement açıkken kontrolleri otomatik gizlemez. */
417
- r(this, "onOpenChange", null);
418
- r(this, "panelObserver");
419
- r(this, "currentPanel", "main");
420
- r(this, "submenus", []);
421
- /**
422
- * Yön + yükseklik player'a göre: kompakt düzende (buton üst bardaysa) aşağı açılır; her iki yönde de
423
- * yükseklik player içinde kalan alanla sınırlı — küçük player'da menü dışarı taşmaz, kendi içinde kayar.
424
- */
425
- r(this, "fitToPlayer", () => {
426
- if (!this.open) return;
427
- const e = this.el.closest(".video-area");
428
- if (!e) return;
429
- const t = e.getBoundingClientRect(), i = this.button.getBoundingClientRect(), s = this.el.getBoundingClientRect(), o = !!this.el.closest(".hp-top-bar");
430
- this.panel.toggleAttribute("data-drop", o), Object.assign(this.panel.style, { top: "", bottom: "", marginTop: "", marginBottom: "" });
431
- const a = this.panel.scrollHeight, h = (o ? t.bottom - i.bottom : i.top - t.top) - le - L;
432
- if (a <= h || h >= he) {
433
- this.panel.style.maxHeight = `${Math.min(N, h)}px`;
434
- return;
435
- }
436
- this.panel.style.maxHeight = `${Math.min(N, t.height - 2 * L)}px`, o ? Object.assign(this.panel.style, { top: `${t.top + L - s.top}px`, marginTop: "0" }) : Object.assign(this.panel.style, { bottom: `${s.bottom - (t.bottom - L)}px`, marginBottom: "0" });
437
- });
438
- r(this, "onDocumentClick", (e) => {
439
- this.open && !e.composedPath().includes(this.el) && this.close();
440
- });
441
- this.video = e, this.playbackRates = t, this.labels = i, this.activeQualityLabel = i.autoQuality, this.activeCaptionLabel = i.captionsOff, this.el = document.createElement("div"), this.el.className = "hp:relative", this.button = document.createElement("button"), this.button.type = "button", this.button.setAttribute("aria-label", i.settings), this.button.className = "hp-chip hp:flex hp:items-center hp:justify-center hp:w-[var(--hp-ctrl-btn-size)] hp:h-[var(--hp-ctrl-btn-size)] hp:cursor-pointer", this.button.appendChild(g("settings", "hp:text-[length:var(--hp-ctrl-icon-size)]")), this.panel = document.createElement("div"), this.panel.className = "hp-chip hp-chip-panel hp:hidden hp:absolute hp:bottom-full hp:right-0 hp:mb-2 hp:w-48 hp:max-h-64 hp:overflow-y-auto hp:text-sm hp:py-1", this.panelObserver = new MutationObserver(this.fitToPlayer), this.panelObserver.observe(this.panel, { childList: !0 }), this.el.appendChild(this.button), this.el.appendChild(this.panel), this.button.addEventListener("click", (s) => {
442
- s.stopPropagation(), this.toggle();
443
- }), document.addEventListener("click", this.onDocumentClick, !0), this.renderMain();
444
- }
445
- setQualities(e, t) {
446
- this.qualities = e, this.activeQualityLabel = t, (this.currentPanel === "main" || this.currentPanel === "quality") && this.render();
447
- }
448
- setCaptions(e, t) {
449
- this.captions = e, this.activeCaptionLabel = t, (this.currentPanel === "main" || this.currentPanel === "captions") && this.render();
450
- }
451
- /** Seçili altyazıyı dışarıdan günceller (ör. iOS native tam ekranda yapılan seçim) — seçenekler aynı kalır. */
452
- setActiveCaption(e) {
453
- this.activeCaptionLabel !== e && (this.activeCaptionLabel = e, (this.currentPanel === "main" || this.currentPanel === "captions") && this.render());
454
- }
455
- /** Altyazı AÇIKKEN "Altyazı" alt menüsüne eklenecek Boyut/Renk/Konum satırları — `null` kaldırır. */
456
- setCaptionAppearance(e) {
457
- this.captionAppearance = e, (this.currentPanel === "captions" || this.currentPanel === "captions-size" || this.currentPanel === "captions-bg" || this.currentPanel === "captions-text") && this.render();
458
- }
459
- /** Ana menüye tek aç/kapa satırı ekler (ör. QrResume). */
460
- setQrResumeToggle(e) {
461
- this.qrResumeToggle = e, this.currentPanel === "main" && this.renderMain();
462
- }
463
- /** Plugin'lerin (ör. dubbing) ana menüye kendi satır + alt menüsünü eklemesi için. */
464
- registerSubmenu(e) {
465
- this.submenus = this.submenus.filter((t) => t.key !== e.key), this.submenus.push(e), this.currentPanel === "main" && this.renderMain();
466
- }
467
- unregisterSubmenu(e) {
468
- this.submenus = this.submenus.filter((t) => t.key !== e), this.currentPanel === "main" ? this.renderMain() : this.currentPanel === `custom:${e}` && this.renderMain();
469
- }
470
- toggle() {
471
- this.open ? this.close() : this.openMenu();
472
- }
473
- openMenu() {
474
- var e;
475
- this.open = !0, this.currentPanel = "main", this.panel.classList.remove("hp:hidden"), this.renderMain(), this.fitToPlayer(), (e = this.onOpenChange) == null || e.call(this, !0);
476
- }
477
- get isOpen() {
478
- return this.open;
479
- }
480
- /** Açıksa menü panelinin ekran dikdörtgeni (tooltip çakışma kontrolü için). */
481
- get panelRect() {
482
- return this.open ? this.panel.getBoundingClientRect() : null;
483
- }
484
- /** Düzen değişince (ör. kompakt ↔ normal) açık menüyü kapat — eski konumunda asılı kalmasın. */
485
- closeMenu() {
486
- this.open && this.close();
487
- }
488
- close() {
489
- var e;
490
- this.open = !1, this.panel.classList.add("hp:hidden"), (e = this.onOpenChange) == null || e.call(this, !1);
491
- }
492
- row(e, t, i) {
493
- const s = document.createElement("button");
494
- return s.type = "button", s.className = "hp:flex hp:items-center hp:justify-between hp:w-full hp:px-3 hp:py-2 hp:text-left hp:bg-transparent hp:border-0 hp:cursor-pointer hp:text-on-surface hp:hover:bg-on-surface/10", s.innerHTML = `<span>${e}</span><span class="hp:text-on-surface-muted hp:text-xs hp:flex hp:items-center hp:gap-1">${t}</span>`, s.addEventListener("click", i), s;
495
- }
496
- backRow(e, t) {
497
- const i = document.createElement("button");
498
- i.type = "button", i.className = "hp:flex hp:items-center hp:gap-2 hp:w-full hp:px-3 hp:py-2 hp:text-left hp:bg-transparent hp:border-0 hp:cursor-pointer hp:text-on-surface hp:font-medium hp:hover:bg-on-surface/10", i.appendChild(g("chevron-left", "hp:text-sm"));
499
- const s = document.createElement("span");
500
- return s.textContent = e, i.appendChild(s), i.addEventListener("click", t), i;
501
- }
502
- render() {
503
- if (this.currentPanel === "main") this.renderMain();
504
- else if (this.currentPanel === "speed") this.renderSpeed();
505
- else if (this.currentPanel === "quality") this.renderQuality();
506
- else if (this.currentPanel === "captions") this.renderCaptions();
507
- else if (this.currentPanel === "captions-size") this.renderCaptionsSize();
508
- else if (this.currentPanel === "captions-bg") this.renderCaptionColorPanel("bg");
509
- else if (this.currentPanel === "captions-text") this.renderCaptionColorPanel("text");
510
- else {
511
- const e = this.currentPanel.slice(7), t = this.submenus.find((i) => i.key === e);
512
- t ? this.renderSubmenu(t) : this.renderMain();
513
- }
514
- }
515
- renderMain() {
516
- this.currentPanel = "main", this.panel.innerHTML = "", this.panel.appendChild(
517
- this.row(this.labels.playbackSpeed, this.video.playbackRate === 1 ? this.labels.normal : `${this.video.playbackRate}x`, () => {
518
- this.currentPanel = "speed", this.renderSpeed();
519
- })
520
- ), this.qualities.length > 0 && this.panel.appendChild(
521
- this.row(this.labels.quality, this.activeQualityLabel, () => {
522
- this.currentPanel = "quality", this.renderQuality();
523
- })
524
- ), this.captions.length > 0 && this.panel.appendChild(
525
- this.row(this.labels.captions, this.activeCaptionLabel, () => {
526
- this.currentPanel = "captions", this.renderCaptions();
527
- })
528
- );
529
- for (const e of this.submenus)
530
- this.panel.appendChild(
531
- this.row(e.title, e.getValueLabel(), () => {
532
- this.currentPanel = `custom:${e.key}`, this.renderSubmenu(e);
533
- })
534
- );
535
- if (this.qrResumeToggle) {
536
- const e = this.qrResumeToggle;
537
- this.panel.appendChild(
538
- this.row(e.label, e.getValueLabel(), () => {
539
- e.onToggle(), this.renderMain();
540
- })
541
- );
542
- }
543
- }
544
- renderSubmenu(e) {
545
- this.panel.innerHTML = "", this.panel.appendChild(this.backRow(e.title, () => this.renderMain()));
546
- for (const t of e.getItems())
547
- this.panel.appendChild(
548
- this.row(t.label, t.active ? '<i class="hp-icon hp-icon-check"></i>' : "", () => {
549
- t.onSelect(), this.close();
550
- })
551
- );
552
- }
553
- renderSpeed() {
554
- this.panel.innerHTML = "", this.panel.appendChild(this.backRow(this.labels.playbackSpeed, () => this.renderMain()));
555
- for (const e of this.playbackRates) {
556
- const t = this.video.playbackRate === e, i = this.row(e === 1 ? this.labels.normal : `${e}x`, t ? '<i class="hp-icon hp-icon-check"></i>' : "", () => {
557
- this.video.playbackRate = e, this.close();
558
- });
559
- this.panel.appendChild(i);
560
- }
561
- }
562
- renderQuality() {
563
- this.panel.innerHTML = "", this.panel.appendChild(this.backRow(this.labels.quality, () => this.renderMain()));
564
- for (const e of this.qualities) {
565
- const t = e.label === this.activeQualityLabel;
566
- this.panel.appendChild(
567
- this.row(e.label, t ? '<i class="hp-icon hp-icon-check"></i>' : "", () => {
568
- e.onSelect(), this.close();
569
- })
570
- );
571
- }
572
- }
573
- renderCaptions() {
574
- this.panel.innerHTML = "", this.panel.appendChild(this.backRow(this.labels.captions, () => this.renderMain()));
575
- for (const e of this.captions) {
576
- const t = e.label === this.activeCaptionLabel;
577
- this.panel.appendChild(
578
- this.row(e.label, t ? '<i class="hp-icon hp-icon-check"></i>' : "", () => {
579
- e.onSelect(), this.close();
580
- })
581
- );
582
- }
583
- if (this.captionAppearance && this.activeCaptionLabel !== this.labels.captionsOff) {
584
- const e = this.captionAppearance;
585
- this.panel.appendChild(
586
- this.row(e.sizeLabel, "", () => {
587
- this.currentPanel = "captions-size", this.renderCaptionsSize();
588
- })
589
- ), this.panel.appendChild(
590
- this.row(e.bgColorLabel, "", () => {
591
- this.currentPanel = "captions-bg", this.renderCaptionColorPanel("bg");
592
- })
593
- ), this.panel.appendChild(
594
- this.row(e.textColorLabel, "", () => {
595
- this.currentPanel = "captions-text", this.renderCaptionColorPanel("text");
596
- })
597
- ), this.panel.appendChild(
598
- this.row(e.resetPositionLabel, "", () => {
599
- e.onResetPosition(), this.close();
600
- })
601
- );
602
- }
603
- }
604
- renderCaptionsSize() {
605
- this.panel.innerHTML = "";
606
- const e = this.captionAppearance;
607
- if (this.panel.appendChild(this.backRow((e == null ? void 0 : e.sizeLabel) ?? this.labels.captionSize, () => this.renderCaptions())), !!e)
608
- for (const t of e.getSizeOptions())
609
- this.panel.appendChild(
610
- this.row(t.label, t.active ? '<i class="hp-icon hp-icon-check"></i>' : "", () => {
611
- t.onSelect(), this.close();
612
- })
613
- );
614
- }
615
- /** "Arka Plan Rengi" / "Yazı Rengi" — düz metin satırları yerine renkli swatch grid'i (YouTube'un kendi altyazı renk seçici deseni). */
616
- renderCaptionColorPanel(e) {
617
- this.panel.innerHTML = "";
618
- const t = this.captionAppearance, i = e === "bg" ? (t == null ? void 0 : t.bgColorLabel) ?? this.labels.captionBgColor : (t == null ? void 0 : t.textColorLabel) ?? this.labels.captionTextColor;
619
- if (this.panel.appendChild(this.backRow(i, () => this.renderCaptions())), !t) return;
620
- const s = document.createElement("div");
621
- s.className = "hp:flex hp:flex-wrap hp:gap-2 hp:px-3 hp:py-2";
622
- const o = e === "bg" ? t.getBgColorOptions() : t.getTextColorOptions();
623
- for (const a of o) {
624
- const h = document.createElement("button");
625
- h.type = "button", h.setAttribute("aria-label", a.ariaLabel), h.className = "hp:w-7 hp:h-7 hp:rounded-full hp:cursor-pointer hp:flex-shrink-0 hp:border hp:border-on-surface/20", h.style.background = a.value, h.style.outline = a.active ? "2px solid currentColor" : "2px solid transparent", h.style.outlineOffset = "2px", h.addEventListener("click", () => {
626
- a.onSelect(), this.render();
627
- }), s.appendChild(h);
628
- }
629
- this.panel.appendChild(s);
630
- }
631
- /** Dil sonradan değişince statik buton etiketini tazeler + mevcut panel zaten güncel `this.labels`'ı okuyarak yeniden render edilir. */
632
- refreshLabels() {
633
- this.button.setAttribute("aria-label", this.labels.settings), this.render();
634
- }
635
- destroy() {
636
- document.removeEventListener("click", this.onDocumentClick, !0), this.panelObserver.disconnect();
637
- }
638
- }
639
- const ce = 15, de = 480;
640
- function I(n, e) {
641
- const { btn: t } = C("", `skip-${n}`);
642
- t.classList.add("hp-skip-btn"), t.setAttribute("part", e);
643
- const i = document.createElement("span");
644
- return i.className = "hp-skip-num", i.setAttribute("aria-hidden", "true"), t.appendChild(i), t.style.display = "none", { btn: t, num: i };
645
- }
646
- function f(n, e) {
647
- n.setAttribute("aria-label", e);
648
- }
649
- function C(n, e, t) {
650
- const i = document.createElement("button");
651
- i.type = "button", f(i, n), t && (i.dataset.shortcut = t), i.className = "hp-chip hp:flex hp:items-center hp:justify-center hp:w-[var(--hp-ctrl-btn-size)] hp:h-[var(--hp-ctrl-btn-size)] hp:cursor-pointer hp:shrink-0";
652
- const s = g(e, "hp:text-[length:var(--hp-ctrl-icon-size)]");
653
- return i.appendChild(s), { btn: i, icon: s };
654
- }
655
- class ue {
656
- constructor(e, t, i, s) {
657
- r(this, "el");
658
- r(this, "seekBar");
659
- r(this, "volumePanel");
660
- r(this, "settingsMenu");
661
- r(this, "video");
662
- r(this, "labels");
663
- r(this, "playButton");
664
- r(this, "playIcon");
665
- r(this, "pipButton");
666
- r(this, "skipBack");
667
- r(this, "skipForward");
668
- /** Etkin sarma süreleri (sn); null = buton gizli. */
669
- r(this, "skipSeconds", { back: null, forward: null });
670
- r(this, "seekingEnabled", !0);
671
- /** Sarma butonuyla sarıldığında (sn, negatif = geri) — sarma bildirimi için. */
672
- r(this, "onSkip", null);
673
- r(this, "fullscreenButton");
674
- r(this, "fullscreenIcon");
675
- r(this, "timeLabel");
676
- r(this, "showRemaining", !1);
677
- /** Kompakt düzende (player < 480px) sağ grubun taşındığı üst bar; tam ekran altta kalır. */
678
- r(this, "topEl");
679
- r(this, "bottomRow");
680
- r(this, "rightGroup");
681
- r(this, "fullscreenSlot");
682
- r(this, "compact", !1);
683
- r(this, "resizeObserver");
684
- r(this, "liveBadge");
685
- r(this, "liveText");
686
- r(this, "adMode", !1);
687
- r(this, "callbacks");
688
- r(this, "row");
689
- r(this, "extraButtonAnchor");
690
- /** Süre etiketine tıklama: geçen süre ↔ kalan süre. */
691
- r(this, "onTimeClick", (e) => {
692
- e.stopPropagation(), this.toggleTimeMode();
693
- });
694
- r(this, "renderPlayState", () => {
695
- const e = this.callbacks.isAdActive() ? this.callbacks.adIsPaused() : this.video.paused;
696
- A(this.playIcon, e ? "play" : "pause"), f(this.playButton, e ? this.labels.play : this.labels.pause);
697
- });
698
- r(this, "renderTime", () => {
699
- const e = this.video.duration === 1 / 0;
700
- if (this.timeLabel.style.display = this.adMode || e ? "none" : "", this.liveBadge.style.display = !this.adMode && e ? "" : "none", !e) {
701
- const s = this.video.duration, o = this.video.currentTime;
702
- if (this.showRemaining) {
703
- const a = Number.isFinite(s) ? Math.floor(s) : 0, h = Math.max(0, a - Math.floor(o));
704
- this.timeLabel.textContent = `-${E(h)} / ${E(s)}`;
705
- } else
706
- this.timeLabel.textContent = `${E(o)} / ${E(s)}`;
707
- return;
708
- }
709
- const t = this.liveEdge(), i = t !== null && t - this.video.currentTime > ce;
710
- this.liveBadge.toggleAttribute("data-behind", i);
711
- });
712
- r(this, "goToLive", () => {
713
- const e = this.liveEdge();
714
- e !== null && (this.video.currentTime = Math.max(0, e - 1), this.video.paused && this.video.play().catch(() => {
715
- }), this.renderTime());
716
- });
717
- this.video = e, this.callbacks = i, this.labels = s, this.el = document.createElement("div"), this.el.setAttribute("part", "control-bar"), this.el.className = "hp:absolute hp:inset-x-0 hp:bottom-0 hp:flex hp:flex-col hp:gap-1 hp:px-3 hp:pb-2 hp:pt-6 hp:pointer-events-none hp:transition-opacity hp:duration-200", this.seekBar = new oe(e, s), this.seekBar.el.classList.add("hp:pointer-events-auto"), this.el.appendChild(this.seekBar.el);
718
- const o = document.createElement("div");
719
- o.className = "hp:flex hp:items-center hp:gap-2", this.el.appendChild(o), this.bottomRow = o;
720
- const a = document.createElement("div");
721
- a.className = "hp-group hp:flex hp:items-center hp:gap-1 hp:px-1.5 hp:py-1 hp:shrink-0 hp:pointer-events-auto", o.appendChild(a);
722
- const h = C(s.play, "play", "K");
723
- this.playButton = h.btn, this.playIcon = h.icon, this.playButton.setAttribute("part", "play-pause-button"), this.playButton.addEventListener("click", () => this.togglePlay()), a.appendChild(this.playButton), this.skipBack = I("back", "skip-back-button"), this.skipBack.btn.addEventListener("click", () => this.skip(-(this.skipSeconds.back ?? 0))), this.skipForward = I("forward", "skip-forward-button"), this.skipForward.btn.addEventListener("click", () => this.skip(this.skipSeconds.forward ?? 0)), a.append(this.skipBack.btn, this.skipForward.btn), this.volumePanel = new ae(e, s, i.adVolume), a.appendChild(this.volumePanel.el), this.timeLabel = document.createElement("button"), this.timeLabel.type = "button", this.timeLabel.setAttribute("part", "time-display"), this.timeLabel.className = "hp:text-xs hp:text-on-surface hp:tabular-nums hp:whitespace-nowrap hp:px-1 hp:bg-transparent hp:border-0 hp:cursor-pointer hp:select-none hp:p-0 hp:hover:opacity-80 hp:transition-opacity hp:focus-visible:outline-none hp:focus-visible:ring-1 hp:focus-visible:ring-accent hp:rounded", this.timeLabel.textContent = "0:00 / 0:00", this.timeLabel.addEventListener("click", this.onTimeClick), a.appendChild(this.timeLabel), this.liveBadge = document.createElement("button"), this.liveBadge.type = "button", this.liveBadge.className = "hp-live-badge", this.liveBadge.setAttribute("part", "live-badge"), this.liveBadge.setAttribute("aria-label", s.goToLive);
724
- const d = document.createElement("span");
725
- d.className = "hp-live-dot", this.liveText = document.createElement("span"), this.liveText.textContent = s.live, this.liveBadge.append(d, this.liveText), this.liveBadge.style.display = "none", this.liveBadge.addEventListener("click", this.goToLive), a.appendChild(this.liveBadge);
726
- const l = document.createElement("div");
727
- l.className = "hp:flex-1", o.appendChild(l);
728
- const p = document.createElement("div");
729
- p.className = "hp-group hp:flex hp:items-center hp:gap-1 hp:px-1.5 hp:py-1 hp:shrink-0 hp:pointer-events-auto", o.appendChild(p), this.rightGroup = p, this.settingsMenu = new pe(e, t, s), p.appendChild(this.settingsMenu.el), this.extraButtonAnchor = this.settingsMenu.el, this.row = p;
730
- const c = C(s.pip, "pip");
731
- this.pipButton = c.btn, this.pipButton.addEventListener("click", () => this.togglePip()), document.pictureInPictureEnabled || (this.pipButton.style.display = "none"), p.appendChild(this.pipButton);
732
- const u = C(s.fullscreenEnter, "fullscreen-enter", "F");
733
- this.fullscreenButton = u.btn, this.fullscreenIcon = u.icon, this.fullscreenButton.addEventListener("click", () => this.toggleFullscreen()), p.appendChild(this.fullscreenButton), this.topEl = document.createElement("div"), this.topEl.className = "hp-top-bar", this.topEl.setAttribute("part", "top-bar"), this.fullscreenSlot = document.createElement("div"), this.fullscreenSlot.className = "hp-group hp:items-center hp:px-1.5 hp:py-1 hp:shrink-0 hp:pointer-events-auto", this.fullscreenSlot.style.display = "none", o.appendChild(this.fullscreenSlot), this.resizeObserver = new ResizeObserver(() => this.updateLayout()), this.resizeObserver.observe(this.el), e.addEventListener("play", this.renderPlayState), e.addEventListener("pause", this.renderPlayState), e.addEventListener("timeupdate", this.renderTime), e.addEventListener("loadedmetadata", this.renderTime), e.addEventListener("durationchange", this.renderTime), e.addEventListener("progress", this.renderTime), this.renderPlayState(), this.renderTime();
734
- }
735
- /** Player genişliğine göre normal / kompakt (mobil) düzen arasında geçiş — yalnızca eşik geçilince DOM taşınır. */
736
- updateLayout() {
737
- var i;
738
- const e = this.el.getBoundingClientRect().width;
739
- if (e === 0) return;
740
- const t = e < de;
741
- t !== this.compact && (this.compact = t, this.settingsMenu.closeMenu(), this.el.toggleAttribute("data-compact", t), (i = this.el.closest(".video-area")) == null || i.toggleAttribute("data-compact", t), t ? (this.fullscreenSlot.appendChild(this.fullscreenButton), this.fullscreenSlot.style.display = this.adMode ? "none" : "flex", this.topEl.appendChild(this.rightGroup)) : (this.rightGroup.appendChild(this.fullscreenButton), this.bottomRow.insertBefore(this.rightGroup, this.fullscreenSlot), this.fullscreenSlot.style.display = "none"));
742
- }
743
- setFullscreenState(e) {
744
- A(this.fullscreenIcon, e ? "fullscreen-exit" : "fullscreen-enter"), f(this.fullscreenButton, e ? this.labels.fullscreenExit : this.labels.fullscreenEnter);
745
- }
746
- /** Dil sonradan değişince (`options.locale`/`labels`) statik (reaktif olarak yeniden render edilmeyen) etiketleri tazeler. */
747
- /** Geri/ileri sarma butonları — `null` süre o butonu gizler. */
748
- setSkipButtons(e, t) {
749
- this.skipSeconds = { back: e, forward: t }, this.renderSkipButtons();
750
- }
751
- /** DAI reklam arasında seek kapalıyken sarma butonları da devre dışı. */
752
- setSeekingEnabled(e) {
753
- this.seekingEnabled = e, this.skipBack.btn.disabled = !e, this.skipForward.btn.disabled = !e;
754
- }
755
- renderSkipButtons() {
756
- const e = (t, i, s) => {
757
- t.btn.style.display = i === null || this.adMode ? "none" : "", i !== null && (t.num.textContent = String(i), t.num.toggleAttribute("data-long", String(i).length > 2), f(t.btn, s(i)));
758
- };
759
- e(this.skipBack, this.skipSeconds.back, this.labels.skipBack), e(this.skipForward, this.skipSeconds.forward, this.labels.skipForward);
760
- }
761
- skip(e) {
762
- var o;
763
- if (!e || !this.seekingEnabled) return;
764
- const t = this.video, i = t.seekable.length ? t.seekable.start(0) : 0, s = Number.isFinite(t.duration) ? t.duration : t.seekable.length ? t.seekable.end(t.seekable.length - 1) : t.currentTime;
765
- t.currentTime = Math.max(i, Math.min(s, t.currentTime + e)), (o = this.onSkip) == null || o.call(this, e);
766
- }
767
- refreshLabels() {
768
- this.renderPlayState(), this.renderSkipButtons(), f(this.pipButton, this.labels.pip), f(this.liveBadge, this.labels.goToLive), this.liveText.textContent = this.labels.live, this.setFullscreenState(this.callbacks.isFullscreen()), this.seekBar.refreshLabels(), this.volumePanel.refreshLabels(), this.settingsMenu.refreshLabels();
769
- }
770
- /** Reklam modu: seek bar, süre ve sağ grup gizlenir; oynat/duraklat + ses kalır. */
771
- setAdMode(e) {
772
- const t = e ? "none" : "";
773
- this.adMode = e, this.renderSkipButtons(), this.seekBar.el.style.display = t, this.row.style.display = t, this.compact && (this.fullscreenSlot.style.display = e ? "none" : "flex"), this.renderTime();
774
- const i = e ? "#202020" : "";
775
- this.playIcon.style.color = i, this.volumePanel.setIconColor(i), this.volumePanel.setSliderFillColor(i), this.renderPlayState(), this.volumePanel.refreshForAdMode();
776
- }
777
- /** `AdsController`'ın IMA'nın KENDİ UI'ı üzerinden (ör. reklam video'suna tıklama) gelen PAUSED/RESUMED event'leri için — oynat/duraklat ikonunu tazeler. */
778
- refreshAdPlayState() {
779
- this.renderPlayState();
780
- }
781
- setQualities(e, t) {
782
- this.settingsMenu.setQualities(e, t);
783
- }
784
- setCaptions(e, t) {
785
- this.settingsMenu.setCaptions(e, t);
786
- }
787
- /** Plugin'lerin (loop-section vb.) kontrol çubuğuna kendi butonlarını eklemesi için — ayarlar menüsünden önce yerleştirilir. */
788
- addButton(e, t, i) {
789
- const { btn: s, icon: o } = C(e, t);
790
- return s.addEventListener("click", i), this.row.insertBefore(s, this.extraButtonAnchor), { btn: s, icon: o };
791
- }
792
- toggleTimeMode() {
793
- this.showRemaining = !this.showRemaining, this.renderTime();
794
- }
795
- setShowRemaining(e) {
796
- this.showRemaining !== e && (this.showRemaining = e, this.renderTime());
797
- }
798
- getShowRemaining() {
799
- return this.showRemaining;
800
- }
801
- /** Plugin'lerin (live-wall-clock vb.) kontrol çubuğuna buton olmayan bir element (ör. saat göstergesi) eklemesi için. */
802
- addElement(e) {
803
- this.row.insertBefore(e, this.extraButtonAnchor);
804
- }
805
- togglePlay() {
806
- if (this.callbacks.isAdActive()) {
807
- this.callbacks.adTogglePlay(), this.renderPlayState();
808
- return;
809
- }
810
- this.video.paused ? this.video.play() : this.video.pause();
811
- }
812
- async togglePip() {
813
- try {
814
- document.pictureInPictureElement ? await document.exitPictureInPicture() : await this.video.requestPictureInPicture();
815
- } catch {
816
- }
817
- }
818
- toggleFullscreen() {
819
- this.callbacks.isFullscreen() ? this.callbacks.onExitFullscreen() : this.callbacks.onRequestFullscreen();
820
- }
821
- /** Canlı uç (media-time) — seekable sonu; native HLS'te DVR'sız canlıda seekable boş kalabildiği için buffered sonu (bkz. LiveWallClock.isLive notu). */
822
- liveEdge() {
823
- const { seekable: e, buffered: t } = this.video;
824
- return e.length ? e.end(e.length - 1) : t.length ? t.end(t.length - 1) : null;
825
- }
826
- destroy() {
827
- this.timeLabel.removeEventListener("click", this.onTimeClick), this.video.removeEventListener("play", this.renderPlayState), this.video.removeEventListener("pause", this.renderPlayState), this.video.removeEventListener("timeupdate", this.renderTime), this.video.removeEventListener("loadedmetadata", this.renderTime), this.video.removeEventListener("durationchange", this.renderTime), this.video.removeEventListener("progress", this.renderTime), this.resizeObserver.disconnect(), this.topEl.remove(), this.seekBar.destroy(), this.settingsMenu.destroy();
828
- }
829
- }
830
- const be = 450, me = 60, D = 8, M = 6, ve = /* @__PURE__ */ new Set(["seek-bar", "time-display"]);
831
- function ge() {
832
- return typeof window.matchMedia != "function" || window.matchMedia("(hover: hover)").matches;
833
- }
834
- class fe {
835
- constructor(e) {
836
- r(this, "el");
837
- r(this, "labelEl");
838
- r(this, "keyEl");
839
- r(this, "showTimer", null);
840
- r(this, "hideTimer", null);
841
- r(this, "currentTarget", null);
842
- r(this, "isOccluded", null);
843
- /** Gösterim gecikmesi (SHOW_DELAY_MS) içinde bekleyen hedef — `currentTarget` yalnızca gerçekten gösterilince set ediliyor. */
844
- r(this, "pendingTarget", null);
845
- r(this, "onMouseOver", (e) => {
846
- const t = this.matchTarget(e.target);
847
- !t || t === this.currentTarget || this.scheduleShow(t);
848
- });
849
- r(this, "onMouseOut", (e) => {
850
- const t = this.matchTarget(e.target);
851
- if (!t || t !== this.currentTarget && t !== this.pendingTarget) return;
852
- const i = e.relatedTarget;
853
- i && t.contains(i) || this.scheduleHide();
854
- });
855
- r(this, "onFocusIn", (e) => {
856
- const t = this.matchTarget(e.target);
857
- t && this.show(t);
858
- });
859
- r(this, "onFocusOut", (e) => {
860
- const t = this.matchTarget(e.target);
861
- !t || t !== this.currentTarget || this.hideNow();
862
- });
863
- r(this, "hideNow", () => {
864
- this.showTimer && (clearTimeout(this.showTimer), this.showTimer = null), this.pendingTarget = null, this.hideTimer && (clearTimeout(this.hideTimer), this.hideTimer = null), this.currentTarget && (this.currentTarget = null, this.el.style.opacity = "0", this.el.style.visibility = "hidden");
865
- });
866
- this.mountEl = e, this.el = document.createElement("div"), this.el.setAttribute("part", "tooltip"), this.el.setAttribute("role", "tooltip"), this.el.className = "hp-tooltip hp:absolute hp:z-40 hp:flex hp:items-center hp:gap-1.5 hp:px-2 hp:py-1 hp:rounded hp:text-xs hp:whitespace-nowrap hp:pointer-events-none hp:opacity-0 hp:transition-opacity hp:duration-100", this.el.style.visibility = "hidden", this.labelEl = document.createElement("span"), this.el.appendChild(this.labelEl), this.keyEl = document.createElement("span"), this.keyEl.className = "hp-tooltip-key", this.el.appendChild(this.keyEl), e.appendChild(this.el), e.addEventListener("mouseover", this.onMouseOver), e.addEventListener("mouseout", this.onMouseOut), e.addEventListener("focusin", this.onFocusIn), e.addEventListener("focusout", this.onFocusOut), e.addEventListener("pointerdown", this.hideNow);
867
- }
868
- destroy() {
869
- this.showTimer && clearTimeout(this.showTimer), this.hideTimer && clearTimeout(this.hideTimer), this.mountEl.removeEventListener("mouseover", this.onMouseOver), this.mountEl.removeEventListener("mouseout", this.onMouseOut), this.mountEl.removeEventListener("focusin", this.onFocusIn), this.mountEl.removeEventListener("focusout", this.onFocusOut), this.mountEl.removeEventListener("pointerdown", this.hideNow), this.el.remove();
870
- }
871
- /**
872
- * Tooltip'i örten bir katman (ör. açık ayarlar menüsü) varsa çakışan tooltip gösterilmez — menü kontrol katmanının
873
- * (z-20) içinde olduğundan tooltip'i z-index ile menünün altına almak mümkün değil.
874
- */
875
- setOcclusionCheck(e) {
876
- this.isOccluded = e, this.recheckOcclusion();
877
- }
878
- /** Örten katman açıldı/kapandı — görünen tooltip artık çakışıyorsa gizle. */
879
- recheckOcclusion() {
880
- var e;
881
- this.currentTarget && this.el.style.visibility === "visible" && ((e = this.isOccluded) != null && e.call(this, this.el.getBoundingClientRect())) && this.hideNow();
882
- }
883
- matchTarget(e) {
884
- var o;
885
- const t = e, i = (o = t == null ? void 0 : t.closest) == null ? void 0 : o.call(t, 'button[aria-label], [role="slider"][aria-label]');
886
- if (!i) return null;
887
- const s = i.getAttribute("part");
888
- return s && ve.has(s) || i.offsetParent === null && i !== document.activeElement ? null : i;
889
- }
890
- scheduleShow(e) {
891
- this.hideTimer && (clearTimeout(this.hideTimer), this.hideTimer = null), this.showTimer && clearTimeout(this.showTimer), this.pendingTarget = e, this.showTimer = setTimeout(() => {
892
- this.showTimer = null, this.pendingTarget = null, this.show(e);
893
- }, be);
894
- }
895
- scheduleHide() {
896
- this.showTimer && (clearTimeout(this.showTimer), this.showTimer = null), this.pendingTarget = null, this.hideTimer && clearTimeout(this.hideTimer), this.hideTimer = setTimeout(() => this.hideNow(), me);
897
- }
898
- show(e) {
899
- if (!ge()) return;
900
- const t = e.getAttribute("aria-label");
901
- if (!t) return;
902
- this.currentTarget = e, this.labelEl.textContent = t;
903
- const i = e.dataset.shortcut;
904
- i ? (this.keyEl.textContent = i, this.keyEl.style.display = "") : (this.keyEl.textContent = "", this.keyEl.style.display = "none"), this.el.style.visibility = "hidden", this.el.style.opacity = "0", this.el.style.left = "0px", this.el.style.top = "0px", requestAnimationFrame(() => {
905
- var s;
906
- this.currentTarget === e && (this.position(e), !((s = this.isOccluded) != null && s.call(this, this.el.getBoundingClientRect())) && (this.el.style.visibility = "visible", this.el.style.opacity = "1"));
907
- });
908
- }
909
- position(e) {
910
- const t = this.mountEl.getBoundingClientRect(), i = e.getBoundingClientRect(), s = this.el.getBoundingClientRect();
911
- let o = i.top - t.top - s.height - D;
912
- o < M && (o = i.bottom - t.top + D);
913
- let a = i.left - t.left + i.width / 2 - s.width / 2;
914
- const h = t.width - s.width - M;
915
- a = Math.max(M, Math.min(a, h)), this.el.style.top = `${o}px`, this.el.style.left = `${a}px`;
916
- }
917
- }
918
- class ye {
919
- constructor(e, t, i) {
920
- r(this, "host");
921
- r(this, "video");
922
- r(this, "toggleFullscreen");
923
- /** ←/→ ve J/L ile sarma süresi (sn) — options.keyboardSeekStep. */
924
- r(this, "seekStep", 5);
925
- /** Klavyeyle sarıldığında (sn, negatif = geri) — sarma bildirimi için. */
926
- r(this, "onSeek", null);
927
- r(this, "onKeyDown", (e) => {
928
- var s, o;
929
- if (e.defaultPrevented) return;
930
- const t = e.composedPath()[0];
931
- if ((e.key === " " || e.key === "Enter") && t instanceof HTMLButtonElement) return;
932
- const i = this.video.duration;
933
- switch (e.key) {
934
- case " ":
935
- case "k":
936
- this.video.paused ? this.video.play() : this.video.pause(), e.preventDefault();
937
- break;
938
- case "ArrowRight":
939
- case "l":
940
- Number.isFinite(i) && (this.video.currentTime = Math.min(i, this.video.currentTime + this.seekStep), (s = this.onSeek) == null || s.call(this, this.seekStep)), e.preventDefault();
941
- break;
942
- case "ArrowLeft":
943
- case "j":
944
- this.video.currentTime = Math.max(0, this.video.currentTime - this.seekStep), (o = this.onSeek) == null || o.call(this, -this.seekStep), e.preventDefault();
945
- break;
946
- case "ArrowUp":
947
- this.video.volume = Math.min(1, this.video.volume + 0.1), this.video.muted = !1, e.preventDefault();
948
- break;
949
- case "ArrowDown":
950
- this.video.volume = Math.max(0, this.video.volume - 0.1), e.preventDefault();
951
- break;
952
- case "m":
953
- this.video.muted = !this.video.muted, e.preventDefault();
954
- break;
955
- case "f":
956
- this.toggleFullscreen(), e.preventDefault();
957
- break;
958
- }
959
- });
960
- this.host = e, this.video = t, this.toggleFullscreen = i, this.host.addEventListener("keydown", this.onKeyDown);
961
- }
962
- destroy() {
963
- this.host.removeEventListener("keydown", this.onKeyDown);
964
- }
965
- }
966
- class we {
967
- constructor(e) {
968
- r(this, "el");
969
- r(this, "video");
970
- r(this, "show", () => this.el.classList.remove("hp:hidden"));
971
- r(this, "hide", () => this.el.classList.add("hp:hidden"));
972
- this.video = e, this.el = document.createElement("div"), this.el.className = "hp:absolute hp:inset-0 hp:flex hp:items-center hp:justify-center hp:pointer-events-none hp:hidden", this.el.innerHTML = '<div class="hp:w-10 hp:h-10 hp:border-[3px] hp:border-on-surface/30 hp:border-t-accent hp:rounded-full hp:animate-spin"></div>', e.addEventListener("waiting", this.show), e.addEventListener("playing", this.hide), e.addEventListener("canplay", this.hide), e.addEventListener("pause", this.hide);
973
- }
974
- destroy() {
975
- this.video.removeEventListener("waiting", this.show), this.video.removeEventListener("playing", this.hide), this.video.removeEventListener("canplay", this.hide), this.video.removeEventListener("pause", this.hide);
976
- }
977
- }
978
- const ke = '<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 11a8 8 0 1 0-2.3 5.7"/><path d="M20 4v7h-7"/></svg>';
979
- class xe {
980
- constructor(e, t) {
981
- r(this, "el");
982
- r(this, "video");
983
- r(this, "labels");
984
- r(this, "messageEl");
985
- r(this, "codeEl");
986
- r(this, "retryBtn");
987
- r(this, "retryText");
988
- r(this, "onRetry", null);
989
- r(this, "shouldShow", () => !0);
990
- r(this, "show", () => {
991
- !this.video.getAttribute("src") && !this.video.querySelector("source") || this.shouldShow() && (this.render(), this.el.setAttribute("data-visible", ""));
992
- });
993
- this.video = e, this.labels = t, this.el = document.createElement("div"), this.el.setAttribute("part", "error-screen"), this.el.setAttribute("role", "alert"), this.el.className = "hp-error-screen";
994
- const i = document.createElement("div");
995
- i.className = "hp-error-card";
996
- const s = document.createElement("div");
997
- s.className = "hp-error-icon", s.appendChild(g("warning")), i.appendChild(s), this.messageEl = document.createElement("p"), this.messageEl.className = "hp-error-message", i.appendChild(this.messageEl), this.codeEl = document.createElement("p"), this.codeEl.className = "hp-error-code", i.appendChild(this.codeEl), this.retryBtn = document.createElement("button"), this.retryBtn.type = "button", this.retryBtn.className = "hp-error-retry", this.retryBtn.innerHTML = ke, this.retryText = document.createElement("span"), this.retryText.textContent = t.retry, this.retryBtn.appendChild(this.retryText), this.retryBtn.addEventListener("click", () => {
998
- var o;
999
- this.hide(), (o = this.onRetry) == null || o.call(this);
1000
- }), i.appendChild(this.retryBtn), this.el.appendChild(i), e.addEventListener("error", this.show);
1001
- }
1002
- setOnRetry(e) {
1003
- this.onRetry = e;
1004
- }
1005
- /** false dönerse hata gösterilmez (ör. SourceManager native HLS'ten hls.js'e geçerken). */
1006
- setShouldShow(e) {
1007
- this.shouldShow = e;
1008
- }
1009
- get visible() {
1010
- return this.el.hasAttribute("data-visible");
1011
- }
1012
- refreshLabels() {
1013
- this.retryText.textContent = this.labels.retry, this.visible && this.render();
1014
- }
1015
- render() {
1016
- var i;
1017
- const e = ((i = this.video.error) == null ? void 0 : i.code) ?? 0, t = {
1018
- 1: this.labels.errorAborted,
1019
- 2: this.labels.errorNetwork,
1020
- 3: this.labels.errorDecode,
1021
- 4: this.labels.errorSrcNotSupported
1022
- };
1023
- this.messageEl.textContent = t[e] ?? this.labels.errorGeneric, this.codeEl.textContent = e ? `${this.labels.errorCode} ${e}` : "", this.codeEl.style.display = e ? "" : "none";
1024
- }
1025
- hide() {
1026
- this.el.removeAttribute("data-visible");
1027
- }
1028
- destroy() {
1029
- this.video.removeEventListener("error", this.show);
1030
- }
1031
- }
1032
- const R = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakMap();
1033
- function Ee(n, e) {
1034
- n.querySelectorAll("track").forEach((o) => o.remove()), X(n);
1035
- const t = B.get(n);
1036
- let i = R.get(n);
1037
- i || R.set(n, i = /* @__PURE__ */ new Map());
1038
- const s = [];
1039
- for (const o of e) {
1040
- const a = `${o.label}\0${o.srclang}`;
1041
- let h = i.get(a);
1042
- h || (h = n.addTextTrack("subtitles", o.label, o.srclang), i.set(a, h)), h.mode = o.default ? "hidden" : "disabled", s.push({ label: o.label, track: h }), Ae(n, h, o.src, t);
1043
- }
1044
- return s;
1045
- }
1046
- function X(n) {
1047
- var e;
1048
- B.set(n, (B.get(n) ?? 0) + 1);
1049
- for (const t of ((e = R.get(n)) == null ? void 0 : e.values()) ?? []) {
1050
- t.mode = "hidden";
1051
- for (const i of Array.from(t.cues ?? [])) t.removeCue(i);
1052
- t.mode = "disabled";
1053
- }
1054
- }
1055
- function Ce(n, e) {
1056
- let t = null;
1057
- for (const { label: i, track: s } of n) {
1058
- const o = i === e;
1059
- s.mode = o ? "hidden" : "disabled", o && (t = s);
1060
- }
1061
- return t;
1062
- }
1063
- async function Ae(n, e, t, i) {
1064
- let s;
1065
- try {
1066
- const o = await fetch(t);
1067
- if (!o.ok) throw new Error(`HTTP ${o.status}`);
1068
- s = await o.text();
1069
- } catch (o) {
1070
- console.warn("[HopePlayer] altyazı yüklenemedi:", t, o);
1071
- return;
1072
- }
1073
- if (!(B.get(n) !== i || typeof VTTCue != "function"))
1074
- for (const o of Te(s)) {
1075
- const a = new VTTCue(o.start, o.end, o.text);
1076
- Le(a, o.settings), e.addCue(a);
1077
- }
1078
- }
1079
- const H = "(?:\\d+:)?\\d{1,2}:\\d{2}(?:[.,]\\d{1,3})?", Se = new RegExp(`^(${H})\\s+-->\\s+(${H})(.*)$`);
1080
- function V(n) {
1081
- return n.replace(",", ".").split(":").reduce((e, t) => e * 60 + Number(t), 0);
1082
- }
1083
- function Te(n) {
1084
- const e = [], t = n.replace(/^/, "").replace(/\r\n?/g, `
1085
- `).split(/\n{2,}/);
1086
- for (const i of t) {
1087
- const s = i.split(`
1088
- `), o = s.findIndex((d) => d.includes("-->"));
1089
- if (o < 0) continue;
1090
- const a = Se.exec(s[o].trim());
1091
- if (!a) continue;
1092
- const h = s.slice(o + 1).join(`
1093
- `);
1094
- h.trim() && e.push({ start: V(a[1]), end: V(a[2]), settings: a[3].trim(), text: h });
1095
- }
1096
- return e;
1097
- }
1098
- function Le(n, e) {
1099
- for (const t of e.split(/\s+/)) {
1100
- const [i, s] = t.split(":");
1101
- if (!i || !s) continue;
1102
- const [o] = s.split(",");
1103
- try {
1104
- i === "align" ? n.align = o : i === "vertical" ? n.vertical = o : i === "size" ? n.size = parseFloat(o) : i === "position" ? n.position = parseFloat(o) : i === "line" && (n.snapToLines = !o.endsWith("%"), n.line = parseFloat(o));
1105
- } catch {
1106
- }
1107
- }
1108
- }
1109
- const P = 6, Pe = 20, Be = 14, Me = 6, Re = 10, ze = 3, W = "hope-caption-row", $ = "hope-caption-font-size", q = "hope-caption-bg-color", j = "hope-caption-text-color", Fe = {
1110
- small: 0.78,
1111
- normal: 1,
1112
- large: 1.35
1113
- }, G = [
1114
- "rgba(0, 0, 0, 0.75)",
1115
- "rgba(0, 0, 0, 0)",
1116
- "rgba(255, 255, 255, 0.85)",
1117
- "rgba(183, 28, 28, 0.8)",
1118
- "rgba(13, 71, 161, 0.8)",
1119
- "rgba(27, 94, 32, 0.8)"
1120
- ], U = ["#ffffff", "#000000", "#ffeb3b", "#ff5252", "#18ffff", "#69f0ae"];
1121
- function Oe() {
1122
- try {
1123
- const n = window.localStorage.getItem(W), e = n === null ? 0 : Number(n);
1124
- return Number.isFinite(e) && e >= 0 && e < P ? e : 0;
1125
- } catch {
1126
- return 0;
1127
- }
1128
- }
1129
- function Ne() {
1130
- try {
1131
- const n = window.localStorage.getItem($);
1132
- return n === "small" || n === "normal" || n === "large" ? n : "normal";
1133
- } catch {
1134
- return "normal";
1135
- }
1136
- }
1137
- function _(n, e) {
1138
- const t = e[0] ?? "";
1139
- try {
1140
- const i = window.localStorage.getItem(n);
1141
- return i !== null && e.includes(i) ? i : t;
1142
- } catch {
1143
- return t;
1144
- }
1145
- }
1146
- class S {
1147
- constructor(e, t, i, s) {
1148
- r(this, "layerEl");
1149
- r(this, "bubbleEl");
1150
- r(this, "videoArea");
1151
- r(this, "seekBarEl");
1152
- r(this, "labels");
1153
- r(this, "activeTrack", null);
1154
- r(this, "fontSize", Ne());
1155
- r(this, "bgColor", _(q, G));
1156
- r(this, "textColor", _(j, U));
1157
- r(this, "rowIndex", Oe());
1158
- r(this, "dragging", !1);
1159
- /** Kontrol çubuğu görünür mü — görünürken altyazı seek bar'ın üstünde, değilken en altta. */
1160
- r(this, "chromeVisible", !0);
1161
- r(this, "dragStartClientY", 0);
1162
- r(this, "dragStartBottomPx", 0);
1163
- r(this, "dragMoved", !1);
1164
- r(this, "rafId", null);
1165
- r(this, "pendingDeltaPx", 0);
1166
- r(this, "resizeObserver");
1167
- r(this, "onCueChange", () => {
1168
- var t;
1169
- const e = (t = this.activeTrack) == null ? void 0 : t.activeCues;
1170
- if (!this.activeTrack || !e || e.length === 0) {
1171
- this.bubbleEl.classList.remove("hp-caption-visible"), this.bubbleEl.textContent = "";
1172
- return;
1173
- }
1174
- this.bubbleEl.textContent = "";
1175
- for (let i = 0; i < e.length; i++) {
1176
- i > 0 && this.bubbleEl.appendChild(document.createElement("br"));
1177
- const s = e[i];
1178
- typeof s.getCueAsHTML == "function" ? this.bubbleEl.appendChild(s.getCueAsHTML()) : this.bubbleEl.appendChild(document.createTextNode(s.text ?? ""));
1179
- }
1180
- this.bubbleEl.classList.add("hp-caption-visible");
1181
- });
1182
- r(this, "onPointerDown", (e) => {
1183
- e.button !== 0 && e.pointerType === "mouse" || (e.preventDefault(), this.dragging = !0, this.dragMoved = !1, this.dragStartClientY = e.clientY, this.dragStartBottomPx = this.pxForRow(this.rowIndex), this.bubbleEl.setPointerCapture(e.pointerId), this.bubbleEl.classList.add("hp-caption-dragging"), this.bubbleEl.addEventListener("pointermove", this.onPointerMove), this.bubbleEl.addEventListener("pointerup", this.onPointerUp), this.bubbleEl.addEventListener("pointercancel", this.onPointerUp));
1184
- });
1185
- r(this, "onPointerMove", (e) => {
1186
- this.dragging && (this.pendingDeltaPx = e.clientY - this.dragStartClientY, Math.abs(this.pendingDeltaPx) > ze && (this.dragMoved = !0), this.rafId === null && (this.rafId = requestAnimationFrame(this.applyPendingDrag)));
1187
- });
1188
- r(this, "applyPendingDrag", () => {
1189
- if (this.rafId = null, !this.dragging) return;
1190
- const { min: e, max: t } = this.bounds(), i = Math.min(t, Math.max(e, this.dragStartBottomPx - this.pendingDeltaPx)), s = this.dragStartBottomPx - i;
1191
- this.bubbleEl.style.transform = `translateX(-50%) translateY(${s}px)`;
1192
- });
1193
- r(this, "onPointerUp", (e) => {
1194
- if (!this.dragging || (this.dragging = !1, this.bubbleEl.releasePointerCapture(e.pointerId), this.bubbleEl.removeEventListener("pointermove", this.onPointerMove), this.bubbleEl.removeEventListener("pointerup", this.onPointerUp), this.bubbleEl.removeEventListener("pointercancel", this.onPointerUp), this.rafId !== null && (cancelAnimationFrame(this.rafId), this.rafId = null), this.bubbleEl.classList.remove("hp-caption-dragging"), !this.dragMoved)) return;
1195
- const { min: t, max: i } = this.bounds(), s = Math.min(i, Math.max(t, this.dragStartBottomPx - this.pendingDeltaPx)), o = i > t ? (s - t) / (i - t) : 0, a = Math.round(o * (P - 1));
1196
- this.setRowIndex(a, !0, s);
1197
- });
1198
- this.videoArea = t, this.seekBarEl = i, this.labels = s, this.layerEl = document.createElement("div"), this.layerEl.className = "hp-caption-layer", this.layerEl.setAttribute("part", "caption-layer"), this.bubbleEl = document.createElement("div"), this.bubbleEl.className = "hp-caption-bubble", this.bubbleEl.setAttribute("part", "caption-bubble"), this.bubbleEl.setAttribute("role", "note"), this.bubbleEl.setAttribute("aria-label", s.captionDragHandle), this.bubbleEl.tabIndex = -1, this.applyFontSizeVar(), this.bubbleEl.style.setProperty("--hp-caption-bg", this.bgColor), this.bubbleEl.style.setProperty("--hp-caption-text", this.textColor), this.layerEl.appendChild(this.bubbleEl), this.bubbleEl.addEventListener("pointerdown", this.onPointerDown), this.resizeObserver = new ResizeObserver(() => this.recomputePosition()), this.resizeObserver.observe(this.videoArea), this.recomputePosition();
1199
- }
1200
- /** `applyOptions()`'tan — hangi track aktif (ya da null = kapalı). */
1201
- setActiveTrack(e) {
1202
- this.activeTrack && this.activeTrack.removeEventListener("cuechange", this.onCueChange), this.activeTrack = e, this.activeTrack && this.activeTrack.addEventListener("cuechange", this.onCueChange), this.onCueChange();
1203
- }
1204
- getFontSize() {
1205
- return this.fontSize;
1206
- }
1207
- setFontSize(e) {
1208
- this.fontSize = e, this.applyFontSizeVar(), this.recomputePosition();
1209
- try {
1210
- window.localStorage.setItem($, e);
1211
- } catch {
1212
- }
1213
- }
1214
- getBgColor() {
1215
- return this.bgColor;
1216
- }
1217
- setBgColor(e) {
1218
- this.bgColor = e, this.bubbleEl.style.setProperty("--hp-caption-bg", e);
1219
- try {
1220
- window.localStorage.setItem(q, e);
1221
- } catch {
1222
- }
1223
- }
1224
- getTextColor() {
1225
- return this.textColor;
1226
- }
1227
- setTextColor(e) {
1228
- this.textColor = e, this.bubbleEl.style.setProperty("--hp-caption-text", e);
1229
- try {
1230
- window.localStorage.setItem(j, e);
1231
- } catch {
1232
- }
1233
- }
1234
- /** Ayarlar menüsündeki "Konumu sıfırla". */
1235
- resetPosition() {
1236
- this.setRowIndex(0, !0);
1237
- }
1238
- /** Dil sonradan değişince aria-label'ı tazeler. */
1239
- refreshLabels(e) {
1240
- this.labels = e, this.bubbleEl.setAttribute("aria-label", e.captionDragHandle);
1241
- }
1242
- applyFontSizeVar() {
1243
- this.bubbleEl.style.setProperty("--hp-caption-size-multiplier", String(Fe[this.fontSize]));
1244
- }
1245
- bounds() {
1246
- const e = this.videoArea.getBoundingClientRect(), t = this.seekBarEl.getBoundingClientRect(), s = (this.bubbleEl.getBoundingClientRect().height || 32) + Pe, o = Math.max(Re, Math.round(e.height * 0.04)), a = this.chromeVisible && t.height > 0 ? Math.max(0, Math.round(e.bottom - t.top + (this.videoArea.hasAttribute("data-compact") ? Me : Be))) : o, h = Math.max(a, Math.round(e.height - s));
1247
- return { min: a, max: h };
1248
- }
1249
- pxForRow(e) {
1250
- const { min: t, max: i } = this.bounds(), s = e / (P - 1);
1251
- return Math.round(t + s * (i - t));
1252
- }
1253
- /** FLIP: bottom anında yazılır, yalnızca transform animasyonlanır — bottom'u animasyonlamak bırakınca zıplatıyordu. */
1254
- setRowIndex(e, t, i) {
1255
- this.rowIndex = Math.min(P - 1, Math.max(0, e));
1256
- const s = this.pxForRow(this.rowIndex), o = i ?? parseFloat(this.bubbleEl.style.bottom || `${s}`);
1257
- t && o !== s ? (this.bubbleEl.classList.add("hp-caption-no-transition"), this.bubbleEl.style.bottom = `${s}px`, this.bubbleEl.style.transform = `translateX(-50%) translateY(${o - s}px)`, this.bubbleEl.offsetHeight, this.bubbleEl.classList.remove("hp-caption-no-transition"), this.bubbleEl.style.transform = "translateX(-50%)") : (this.bubbleEl.style.transform = "translateX(-50%)", this.bubbleEl.style.bottom = `${s}px`);
1258
- try {
1259
- window.localStorage.setItem(W, String(this.rowIndex));
1260
- } catch {
1261
- }
1262
- }
1263
- /** Boyut değişimi (ör. fullscreen'e giriş) sonrası AYNI satıra, YENİ sınırlara göre yeniden konumlan — animasyonsuz (boyut değişimi anlık olmalı). */
1264
- /** HopePlayerElement.setChromeOpacity'den — kontroller açılıp kapanınca balon yumuşakça yukarı/aşağı kayar (satır korunur). */
1265
- setChromeVisible(e) {
1266
- e !== this.chromeVisible && (this.chromeVisible = e, this.dragging || this.setRowIndex(this.rowIndex, !0));
1267
- }
1268
- recomputePosition() {
1269
- this.dragging || this.setRowIndex(this.rowIndex, !1);
1270
- }
1271
- destroy() {
1272
- this.activeTrack && this.activeTrack.removeEventListener("cuechange", this.onCueChange), this.resizeObserver.disconnect(), this.rafId !== null && cancelAnimationFrame(this.rafId), this.bubbleEl.removeEventListener("pointerdown", this.onPointerDown);
1273
- }
1274
- }
1275
- r(S, "BG_COLOR_PRESETS", G), r(S, "TEXT_COLOR_PRESETS", U);
1276
- class Ie {
1277
- constructor(e) {
1278
- r(this, "el");
1279
- r(this, "bufferedEl");
1280
- r(this, "playedEl");
1281
- r(this, "visible", !1);
1282
- r(this, "rafId", null);
1283
- r(this, "sync", () => {
1284
- this.render(), this.visible && !this.video.paused ? this.start() : this.stop();
1285
- });
1286
- r(this, "render", () => {
1287
- const e = this.video.duration, t = Number.isFinite(e) && e > 0;
1288
- if (this.el.toggleAttribute("data-disabled", !t), !this.visible || !t) return;
1289
- this.playedEl.style.transform = `scaleX(${Math.min(1, this.video.currentTime / e)})`;
1290
- const { buffered: i } = this.video;
1291
- let s = 0;
1292
- for (let o = 0; o < i.length; o++)
1293
- i.start(o) <= this.video.currentTime && (s = Math.max(s, i.end(o)));
1294
- this.bufferedEl.style.transform = `scaleX(${Math.min(1, s / e)})`;
1295
- });
1296
- this.video = e, this.el = document.createElement("div"), this.el.className = "hp-mini-progress", this.el.setAttribute("part", "mini-progress"), this.el.setAttribute("aria-hidden", "true"), this.bufferedEl = document.createElement("div"), this.bufferedEl.className = "hp-mini-progress-fill hp-mini-progress-buffered", this.playedEl = document.createElement("div"), this.playedEl.className = "hp-mini-progress-fill hp-mini-progress-played", this.el.append(this.bufferedEl, this.playedEl), e.addEventListener("play", this.sync), e.addEventListener("pause", this.sync), e.addEventListener("timeupdate", this.render), e.addEventListener("progress", this.render), e.addEventListener("durationchange", this.render);
1297
- }
1298
- setVisible(e) {
1299
- e !== this.visible && (this.visible = e, this.el.toggleAttribute("data-visible", e), this.sync());
1300
- }
1301
- destroy() {
1302
- this.stop(), this.video.removeEventListener("play", this.sync), this.video.removeEventListener("pause", this.sync), this.video.removeEventListener("timeupdate", this.render), this.video.removeEventListener("progress", this.render), this.video.removeEventListener("durationchange", this.render), this.el.remove();
1303
- }
1304
- start() {
1305
- if (this.rafId !== null) return;
1306
- const e = () => {
1307
- this.render(), this.rafId = requestAnimationFrame(e);
1308
- };
1309
- this.rafId = requestAnimationFrame(e);
1310
- }
1311
- stop() {
1312
- this.rafId !== null && cancelAnimationFrame(this.rafId), this.rafId = null;
1313
- }
1314
- }
1315
- const De = 1e3, He = 800, Ve = '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M9.3 5.3a1.2 1.2 0 0 1 1.7 0l5.8 5.8a1.2 1.2 0 0 1 0 1.8l-5.8 5.8a1.2 1.2 0 0 1-1.7-1.7l4.9-5-4.9-5a1.2 1.2 0 0 1 0-1.7z"/></svg>';
1316
- class qe {
1317
- constructor(e) {
1318
- r(this, "el");
1319
- r(this, "valueEl");
1320
- r(this, "unitEl");
1321
- r(this, "liveEl");
1322
- r(this, "total", 0);
1323
- r(this, "lastAt", 0);
1324
- r(this, "hideTimer", null);
1325
- this.labels = e, this.el = document.createElement("div"), this.el.className = "hp-seek-fb", this.el.setAttribute("part", "seek-feedback");
1326
- const t = document.createElement("span");
1327
- t.className = "hp-seek-fb-chevrons", t.innerHTML = Ve.repeat(3);
1328
- const i = document.createElement("span");
1329
- i.className = "hp-seek-fb-value", this.valueEl = document.createElement("span"), this.valueEl.className = "hp-seek-fb-num", this.unitEl = document.createElement("span"), this.unitEl.className = "hp-seek-fb-unit", i.append(this.valueEl, this.unitEl), this.liveEl = document.createElement("span"), this.liveEl.className = "hp-sr-only", this.liveEl.setAttribute("aria-live", "polite"), this.el.append(t, i, this.liveEl);
1330
- }
1331
- /** `delta` saniye sarıldı (negatif = geri). */
1332
- show(e) {
1333
- if (!e) return;
1334
- const t = Date.now(), i = Math.sign(e) === Math.sign(this.total);
1335
- this.total = i && t - this.lastAt < De ? this.total + e : e, this.lastAt = t;
1336
- const s = Math.round(Math.abs(this.total) * 10) / 10, o = this.total > 0;
1337
- this.el.dataset.side = o ? "forward" : "back", this.valueEl.textContent = `${o ? "+" : "−"}${s}`, this.unitEl.textContent = this.labels.secondsShort, this.liveEl.textContent = (o ? this.labels.skipForward : this.labels.skipBack)(s), this.valueEl.classList.remove("hp-seek-fb-bump"), this.valueEl.offsetWidth, this.valueEl.classList.add("hp-seek-fb-bump"), this.el.setAttribute("data-visible", ""), this.hideTimer && clearTimeout(this.hideTimer), this.hideTimer = setTimeout(() => {
1338
- this.el.removeAttribute("data-visible"), this.total = 0;
1339
- }, He);
1340
- }
1341
- destroy() {
1342
- this.hideTimer && clearTimeout(this.hideTimer), this.el.remove();
1343
- }
1344
- }
1345
- const je = '@font-face{font-family:hope-icons;src:url(data:font/woff2;base64,d09GMgABAAAAAAoYAAsAAAAAHzwAAAnLAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHFQGYACEQgqvEKhRATYCJANECyQABCAFhC4HgWEbExtRlFBWJJnOA9t50gAEH8po+Uo1LQQpKfWbrOB+Gw/f7/e/tc+997m2j3ko4o0hMV2TavwRy5RAyHjSyBBpZ4ZK/n6/Zf70oqIQ5qo8mdJV9YQdyh3L8GD2iouWkSrCJgCG3k3/DnKBJnS1uyStBxK8BqFULA0TD5ptTCg1B/bchec+8d8n/tfaq6UC0isYF9Z1cunDHoQYrxfaIMhOFYEEZgUoHLAjVK0wFTbuC+97v5/zOBob50DFjZvq9dWVCLQcdnT99P3rB3rXtSRcKbGeQZg7rgensXvyUhbkDg2hJnrU+BtvVMTptWuAc+4L/4+lTZKqwM7qgr0bxW9GPon3W78Oxp/j7ZWDPSdUKLBfMp+4Wxx0HRs+3+/KLZ68WftQpVKQT7b+IcOmcu+MkBRK1em/eXUNTS1tHV09fQOihskdGPwreUCGCYIMEhkUZFCSQUUGNTKok0GDDJpk0CKDNhl0yKBLBj0y6JPJIwpDu+AG3ACa54n3N2zUJrlSiKSJiYGC8LADSuWDmOFFWZ4CgTGLGeXiK0II+AjE3TlXX+9vaBBfagsIAjaHVXm9BK+BgLW6a5FrMpK9qaTRl0hhNoFhOFvehnglQWadHBUxRBMmEv1Goj1WVKHOCJatmeA1gxBEkm3xdDvt6MH9iyR5PAUiIb5IghQzIAtSLGCmymRgsjGZRSBPk+i2abCAMQADmTpigGydDEwywRoglIBtkgk2AVnAgggEKT1VDi09QeOSYqDLpyM4OYlBV9C2pERVMOoKmpCqXuCAp1dl2pEAn4cI5On6aaiJJ+t6GEkGAYxnO67XO5DYYVV0IgJ4jdn7pimJjhUjyhYjmuPSPKN3QxY9ERQ2ckLTkIcxpUQFkhIYY+MmwTAZWcqPhNwoG+6Z5GEX9oBROkLlJKGkRqIwbgQImGURMCCkugFFWO/1OzmOwRImY51cpJNjcA4uhenTQsjztTwPuRoOx9bykbU85BAjxqdlWUJkQljexeNYmUTKhOURI8anAQBjAWNAqgkuV53i7GK7xC5/gelQqMvTXF9fV+d3dypKR0e3t6WhobGx1eMWhGptnscjy655Pl9tbc0wr1PEt3s07ZIhjSpLrRj3tIS47UHCINm6tl7fMFbH1xMOS8prJ2mP4JfKvBtGqhrKJbEn1aihms50yQYxPeAIacwXe3eYUPjnquUn2cwgrLwSB2PcsvFBfG3NydiqTu/+QJuGTr2t2qQ7Ff7Vu6y3Rjpw2zy6MMbGlPI0AHVjvw8ScwwCSY61wjAfhQ/Lnnd4/JvZbcrwtkzXO+9rxh3asoA4JR6jLTEtwiGaRLRYRo/FFZIdpeWQNqxnolpIRrSsRKIZfTiiyO+8iTiB4RaaCOOaw/VMegLWd599gYZe2QuczI/fRBNFy/IzKTKNnIr4sKyWeNZltKx0gSNxssUil4g453LEAZGjm+JEJD0BV6z97TdgFFxERNGiuq6m3xIhrGiqrkc1Bf/+b6QWQvnnOjYnszwGDLrjX/+N1EQlCoFV/2daMtxR1tOvomVpKEbTsSFJpkORLbz27EAHj8nypjyO4qxGDVQTGec17CwJXXR8zFV1LprRtBieYEdTlrOqPa+T0YSJZRFHjduXu2GIFnHR6jTwQdBXhf4gYN1jEW/EEa/4saJyxSe+T2w6wkpA1QejAUlCtOQIRgd1NRjE/bwRUmB2QMH+PahDEkYUloZUrT2fUIcPD1RRbCsHkMpRAJSbVDWoScgRYY7L0LxD79cubXd1BazJQwXano9Q5jOOl4sVEoJKRBnKKdmdHqARZRTURypeUQsGVbevLjbxlYpHvG/dW2B8MDCKffrAK5fWdq0yxk6//NFX7K88evnpY8aqrtrS9znvfDmiXA6x/TRn2+mio0r4OPY+0M1jFOW0i+LSbFtWtJv4dUi7IDNPgVu9VguRAiqt5/KPTBUSIYmipFCicHxC8jmdVgMSsVjBNy+by/nK9vbMrkebKiru6zGbHa+EMGUO/1zMmyk1bgu0mduKhQoTVd9SVSU2DX5y6ZJYVUW31JrKLv24uS1gi6vT8sseCMfj0CsOMwt4YGWFSMSu9vbKGhZb3fLvpPwaZHGFV6wYHc3nFk85ZTGXHx1dsSLsqlutvHsE/t9WmCUvDL3ZufKL4aI0k9u5jXsweJdrYs/SEesL6xtOPLT80uLnu955eLTkhvUtN/yVvLm4azmtEBX2Ew1bKXTdRgSD/xbNgXeLFQ7kqEh0qKYmSOZRlWgyxcD/gV3Fm5N/3dCy/oaS0Yff2fV58dLlh05sWP+C9cjSngnXXcEHuW07czNScfiLlZ1vDr1AZgsbO6qFBpBtZwt2aOrOb4YodS1AbS1pUk0i6C8jbjKpUUWT4cQ0MLCbNrvs9lyb+5ZdZ5w52FFoKteHmzjs3samwmDHmWfs0pvbcna7y0yzU0pkaqbHb7P5e+Tpc5WPxE2rPcs8q88bmNwIGkUjhB2TjghisHRgvbPMSE1FtFQ7dz12zTHHTE2vWdPj89kYss094edmeuqYY6655f2UcbHuFkwmwa1fbKTeb13EfoCDaJIDcjo69hlfOz0//6Mh0v996baQR5kVt1DeXMcpA06ae4zA3rSxPKIODqqR5ca9zlVOmqKCgexiSarkdjYQpCjauerBTRQvaYvWRU3ilzhJW7IuaVJlSdvdlOTQ2qMIRds1h6TVgeKnicDJ/58CAAAAPgx7AQAApuCENvEKmOj5DDzGnfgETE88AaYmfglndnYlXA/A//vgt/A6jf8uIp8PNo/Turbr1RkY/GniBzAP4OE9AeDc2btnR1nvr1Zx2wk83/HIDxjbDdaQFxT85TZG6/rzMPyhbMpk7ktgGMddaoq39Fi2wEIGvvYrB5eFAUn9xIAXvjoE63LwGiptO6Cm5TCCkH0mcPS2sasbomwKE481SHpeQGHirXU5+B1UZj5CzcRvaLmIf++pbWdce87UC4ZTfSPXRV0S5cjTfFGpgZNqP3g440E8UKKihRqVXan83I1FrBov3KoVnIRiZLVYeEpG+l4kTw61jl/+0n3DLTw4g3qCASdUvOGqQxehS2GV6aJfuFpQER6bro44aChk/SAnwWW1gJrLv4QV1D3M4TB2HwILdQ0F3EKdrUcgISKCj/Jt/u6mIANBn6+RkDEZ6HVZUbnfs9ru1JWgwm7mMFIUUUYVtahHI5rRinZ0ohu96McghjFSXfZkZof2j5sXTr1IVrZM5EqntouxmkKUepSEyknipi2DbEbmvJV1V2kjh7yZo17tVhIJydW9Ogu5962bpf5ZWS4LXZqDOceupZ4Pzu+fYiIvDmmGthNqdkrxVN8TAA==) format("woff2");font-weight:400;font-style:normal;font-display:block}', K = "hope-player-icon-font";
1346
- function Ge() {
1347
- if (typeof document > "u" || document.getElementById(K)) return;
1348
- const n = document.createElement("style");
1349
- n.id = K, n.textContent = je, document.head.appendChild(n);
1350
- }
1351
- const Z = {
1352
- play: "Oynat",
1353
- pause: "Duraklat",
1354
- mute: "Sessize al",
1355
- unmute: "Sesi aç",
1356
- volume: "Ses seviyesi",
1357
- seekBar: "Video konumu",
1358
- settings: "Ayarlar",
1359
- pip: "Resim içinde resim",
1360
- skipBack: (n) => `${n} saniye geri`,
1361
- skipForward: (n) => `${n} saniye ileri`,
1362
- secondsShort: "sn",
1363
- fullscreenEnter: "Tam ekran",
1364
- fullscreenExit: "Tam ekrandan çık",
1365
- playbackSpeed: "Oynatma Hızı",
1366
- normal: "Normal",
1367
- quality: "Kalite",
1368
- captions: "Altyazı",
1369
- captionsOff: "Kapalı",
1370
- captionSize: "Yazı Boyutu",
1371
- captionSizeSmall: "Küçük",
1372
- captionSizeNormal: "Normal",
1373
- captionSizeLarge: "Büyük",
1374
- captionResetPosition: "Konumu sıfırla",
1375
- captionBgColor: "Arka Plan Rengi",
1376
- captionTextColor: "Yazı Rengi",
1377
- captionDragHandle: "Altyazı konumu — tutup sürükleyin",
1378
- autoQuality: "Oto",
1379
- loop: "Döngü",
1380
- close: "Kapat",
1381
- retry: "Tekrar Dene",
1382
- errorAborted: "Video yüklemesi iptal edildi.",
1383
- errorNetwork: "Ağ hatası — video yüklenemedi.",
1384
- errorDecode: "Video kodu çözülemedi.",
1385
- errorSrcNotSupported: "Bu video kaynağı desteklenmiyor.",
1386
- errorGeneric: "Video oynatılırken bir hata oluştu.",
1387
- errorCode: "Hata kodu",
1388
- countdownRemaining: "Kalan süre",
1389
- geoDefaultWarning: "Erişim engellendi.",
1390
- geoUnknownCountry: "Ülke bilgisi bulunamadı.",
1391
- redirectCancel: "İptal",
1392
- redirectPlayNow: "Şimdi Oynat",
1393
- redirectCountdown: (n) => `Sıradaki video ${n} saniye içinde oynatılacak.`,
1394
- redirectNowPlaying: "Video oynatılıyor...",
1395
- qrResumeTitle: "Devam etmek için kodu telefonunuzla okutun",
1396
- qrResumeDontShowAgain: "Bir daha gösterme",
1397
- qrResumeContinue: "Devam Et",
1398
- qrResumeMenuLabel: "QR ile Devam Et",
1399
- qrResumeOn: "Açık",
1400
- qrResumeOff: "Kapalı",
1401
- pauseAdLabel: "Sponsorlu",
1402
- pauseAdClose: "Reklamı kapat",
1403
- pauseAdResume: "Videoya devam et",
1404
- markerLearnMore: "Daha fazla bilgi",
1405
- markerContinue: "Devam et",
1406
- playlistTitle: "Oynatma Listesi",
1407
- playlistPrev: "Önceki",
1408
- playlistNext: "Sonraki",
1409
- videoFallbackTitle: (n) => `Video ${n + 1}`,
1410
- storyPrev: "Önceki video",
1411
- storyNext: "Sonraki video",
1412
- storyAllVideos: "Tüm videolar",
1413
- dubbingTitle: "Ses / Dil",
1414
- liveClock: "Canlı saat",
1415
- live: "CANLI",
1416
- goToLive: "Canlıya git"
1417
- }, Ue = {
1418
- play: "Play",
1419
- pause: "Pause",
1420
- mute: "Mute",
1421
- unmute: "Unmute",
1422
- volume: "Volume",
1423
- seekBar: "Seek",
1424
- settings: "Settings",
1425
- pip: "Picture-in-picture",
1426
- skipBack: (n) => `Back ${n} seconds`,
1427
- skipForward: (n) => `Forward ${n} seconds`,
1428
- secondsShort: "s",
1429
- fullscreenEnter: "Fullscreen",
1430
- fullscreenExit: "Exit fullscreen",
1431
- playbackSpeed: "Playback speed",
1432
- normal: "Normal",
1433
- quality: "Quality",
1434
- captions: "Captions",
1435
- captionsOff: "Off",
1436
- captionSize: "Font Size",
1437
- captionSizeSmall: "Small",
1438
- captionSizeNormal: "Normal",
1439
- captionSizeLarge: "Large",
1440
- captionResetPosition: "Reset position",
1441
- captionBgColor: "Background Color",
1442
- captionTextColor: "Text Color",
1443
- captionDragHandle: "Caption position — drag to move",
1444
- autoQuality: "Auto",
1445
- loop: "Loop",
1446
- close: "Close",
1447
- retry: "Retry",
1448
- errorAborted: "Video loading was aborted.",
1449
- errorNetwork: "Network error — the video could not load.",
1450
- errorDecode: "The video could not be decoded.",
1451
- errorSrcNotSupported: "This video source is not supported.",
1452
- errorGeneric: "An error occurred while playing the video.",
1453
- errorCode: "Error code",
1454
- countdownRemaining: "Time remaining",
1455
- geoDefaultWarning: "Access denied.",
1456
- geoUnknownCountry: "No country information found.",
1457
- redirectCancel: "Cancel",
1458
- redirectPlayNow: "Play now",
1459
- redirectCountdown: (n) => `Next video will play in ${n} seconds.`,
1460
- redirectNowPlaying: "Now playing...",
1461
- qrResumeTitle: "Scan to continue watching on your phone",
1462
- qrResumeDontShowAgain: "Don't show again",
1463
- qrResumeContinue: "Continue",
1464
- qrResumeMenuLabel: "Continue via QR",
1465
- qrResumeOn: "On",
1466
- qrResumeOff: "Off",
1467
- pauseAdLabel: "Sponsored",
1468
- pauseAdClose: "Close ad",
1469
- pauseAdResume: "Resume video",
1470
- markerLearnMore: "Learn more",
1471
- markerContinue: "Continue",
1472
- playlistTitle: "Playlist",
1473
- playlistPrev: "Previous",
1474
- playlistNext: "Next",
1475
- videoFallbackTitle: (n) => `Video ${n + 1}`,
1476
- storyPrev: "Previous video",
1477
- storyNext: "Next video",
1478
- storyAllVideos: "All videos",
1479
- dubbingTitle: "Audio / Language",
1480
- liveClock: "Live clock",
1481
- live: "LIVE",
1482
- goToLive: "Go to live"
1483
- }, _e = { tr: Z, en: Ue };
1484
- function J(n, e) {
1485
- return { ..._e[n ?? "tr"] ?? Z, ...e };
1486
- }
1487
- function Ke(n, e, t) {
1488
- Object.assign(n, J(e, t));
1489
- }
1490
- const Qe = [0.5, 0.75, 1, 1.25, 1.5, 2], Q = 1200, Ye = 10, Y = 10, Xe = 5, We = (
1491
- /* html */
1492
- `
1493
- <div class="video-area">
1494
- <div class="media-layer">
1495
- <video part="video" playsinline webkit-playsinline preload="metadata"></video>
1496
- <div part="ad-layer" class="hp:absolute hp:inset-0 hp:z-10 hp:hidden"></div>
1497
- </div>
1498
- </div>
1499
- `
1500
- );
1501
- class $e extends HTMLElement {
1502
- constructor() {
1503
- super();
1504
- r(this, "root");
1505
- r(this, "videoArea");
1506
- r(this, "videoEl");
1507
- r(this, "adLayerEl");
1508
- r(this, "chromeEl");
1509
- r(this, "centerPlayButton");
1510
- r(this, "captionRenderer");
1511
- /** options.miniProgress açıkken kurulur. */
1512
- r(this, "miniProgress", null);
1513
- r(this, "chromeVisible", !0);
1514
- r(this, "sourceManager");
1515
- r(this, "controlBar");
1516
- r(this, "tooltip");
1517
- r(this, "keyboard");
1518
- r(this, "loadingSpinner");
1519
- r(this, "errorScreen");
1520
- /** İleri/geri sarmada sağda/solda beliren anlık bildirim. */
1521
- r(this, "seekFeedback");
1522
- r(this, "adsController", null);
1523
- r(this, "gestureControls", null);
1524
- r(this, "loopSection", null);
1525
- r(this, "inViewAutoplay", null);
1526
- r(this, "unregisterSticky", null);
1527
- r(this, "playlistRunner", null);
1528
- r(this, "hopeStory", null);
1529
- r(this, "markProgress", null);
1530
- r(this, "segments", null);
1531
- r(this, "spriteThumbnails", null);
1532
- r(this, "countdownScreen", null);
1533
- r(this, "geoChecker", null);
1534
- r(this, "redirectScreen", null);
1535
- r(this, "qrResume", null);
1536
- r(this, "pauseAd", null);
1537
- r(this, "dubbing", null);
1538
- r(this, "liveWallClock", null);
1539
- r(this, "daiController", null);
1540
- r(this, "instanceKey");
1541
- r(this, "subtitleTracks", []);
1542
- /** Altyazı seçiminin tek giriş noktası — iOS native tam ekrandan dönüşte de kullanılır. */
1543
- r(this, "selectCaption", null);
1544
- /** `applyOptions()`'ta aktif bir altyazı track'i seçiliyken `true` — dil değişince Boyut/Konum görünümünü tazelemek için. */
1545
- r(this, "captionTrackActive", !1);
1546
- /**
1547
- * countdownScreen varken gerçek init (kaynak + içerik plugin'leri) ertelenir; en güncel options snapshot'ı.
1548
- * onComplete kaydı tek sefer yapılır (bkz. playbackInitRegistered) — init birden fazla kez tetiklenmesin.
1549
- */
1550
- r(this, "pendingPlaybackOptions", null);
1551
- r(this, "playbackInitRegistered", !1);
1552
- /**
1553
- * countdownScreen gibi alanlar yalnızca .options ile gelir. connectedCallback'teki ilk (options'suz) geçiş chrome'u
1554
- * bir an açıp player'ı gösteriyordu; 'boot' bloklayıcısı gerçek options gelene kadar bekletir.
1555
- */
1556
- r(this, "bootResolved", !1);
1557
- r(this, "bootGraceTimer", null);
1558
- r(this, "_options", {});
1559
- r(this, "hideTimer", null);
1560
- /** Fare kontrollerin (buton/seek bar) üzerinde mi — üzerindeyken otomatik gizlenmez; videonun üstünde hareketsizse gizlenir. */
1561
- r(this, "pointerOverControls", !1);
1562
- /** Kalite menüsünde şu an HLS seviyeleri mi var (kaynak değişince temizlemek için). */
1563
- r(this, "hlsQualitiesShown", !1);
1564
- /** Son uygulanan options.showRemainingTime — bkz. applyOptions. */
1565
- r(this, "appliedShowRemaining");
1566
- r(this, "autoHideDelayMs", Q);
1567
- r(this, "tapCandidate", !1);
1568
- r(this, "tapStartX", 0);
1569
- r(this, "tapStartY", 0);
1570
- /** Tüm UI'ın paylaştığı tek, mutable sözlük — dil değişince referans değil alanlar güncellenir. */
1571
- r(this, "i18n", J("tr"));
1572
- /** IMA SDK'nın kendi ad-UI dili (skip butonu/sayaç metni) de aynı dili takip etsin diye — bkz. plugins/ads/AdsController. */
1573
- r(this, "localeCode", "tr");
1574
- /** Playlist panelinin monte edileceği, .video-area'nın ALTINDAKİ (shadow root içi) kapsayıcı — ilk ihtiyaçta oluşturulur. */
1575
- r(this, "panelContainer", null);
1576
- r(this, "onHlsLevelsChanged", (t, i) => {
1577
- if (t.length === 0 && this.hlsQualitiesShown) {
1578
- this.hlsQualitiesShown = !1, this.controlBar.setQualities([], "");
1579
- return;
1580
- }
1581
- if (t.length <= 1) return;
1582
- this.hlsQualitiesShown = !0;
1583
- const s = (o) => `${o.height}p`;
1584
- this.controlBar.setQualities(
1585
- [
1586
- { label: this.i18n.autoQuality, onSelect: () => this.sourceManager.setLevel(-1) },
1587
- // Yüksekten düşüğe (hls.js artan sıralıyor) — l.index hls.js'teki gerçek seviye numarası, sıradan bağımsız.
1588
- ...[...t].sort((o, a) => a.height - o.height).map((o) => ({ label: s(o), onSelect: () => this.sourceManager.setLevel(o.index) }))
1589
- ],
1590
- i === -1 ? this.i18n.autoQuality : s(t[i])
1591
- );
1592
- });
1593
- r(this, "onFullscreenChange", (t) => {
1594
- this.controlBar.setFullscreenState(this.isFullscreenActive()), (t == null ? void 0 : t.type) === "webkitbeginfullscreen" ? this.showCaptionsNatively() : (t == null ? void 0 : t.type) === "webkitendfullscreen" && this.syncCaptionsFromNative();
1595
- });
1596
- // ── Oynatma durumuna göre merkez buton + otomatik gizlenme ──
1597
- // Değer: 'hidden' (tamamen gizle — countdown/geo) ya da 'reduced' (yalnızca oynat/duraklat + ses — ads).
1598
- r(this, "chromeBlockers", /* @__PURE__ */ new Map());
1599
- r(this, "onPlay", () => {
1600
- this.isChromeBlocked || (this.centerPlayButton.style.opacity = "0", this.centerPlayButton.style.pointerEvents = "none", this.scheduleAutoHide()), this.dispatchEvent(new CustomEvent("hp:play"));
1601
- });
1602
- r(this, "onPause", () => {
1603
- this.hideTimer && clearTimeout(this.hideTimer), this.isChromeBlocked || (this.centerPlayButton.style.opacity = "1", this.centerPlayButton.style.pointerEvents = "auto", this.showChrome()), this.dispatchEvent(new CustomEvent("hp:pause"));
1604
- });
1605
- r(this, "onPointerDownFocus", () => {
1606
- var t;
1607
- this.focus(), (t = this.adsController) == null || t.initializeDisplayContainerOnce();
1608
- });
1609
- r(this, "onVideoPressStart", (t) => {
1610
- this.tapCandidate = !0;
1611
- const i = "touches" in t ? t.touches[0] : t;
1612
- i && (this.tapStartX = i.clientX, this.tapStartY = i.clientY);
1613
- });
1614
- r(this, "onVideoPressEnd", (t) => {
1615
- var s;
1616
- if (!this.tapCandidate || (this.tapCandidate = !1, this.isChromeBlocked) || (s = this.gestureControls) != null && s.isCurrentlyHolding()) return;
1617
- const i = "changedTouches" in t ? t.changedTouches[0] : t;
1618
- i && Math.hypot(i.clientX - this.tapStartX, i.clientY - this.tapStartY) > Ye || (this.videoEl.paused ? this.videoEl.play().catch(() => {
1619
- }) : this.videoEl.pause());
1620
- });
1621
- r(this, "onVideoPressCancel", () => {
1622
- this.tapCandidate = !1;
1623
- });
1624
- r(this, "onPointerMove", (t) => {
1625
- this.pointerOverControls = t.pointerType === "mouse" && t.composedPath().includes(this.chromeEl), this.scheduleAutoHide();
1626
- });
1627
- r(this, "onPointerLeave", (t) => {
1628
- t.pointerType === "mouse" && (this.pointerOverControls = !1, this.scheduleAutoHide());
1629
- });
1630
- r(this, "scheduleAutoHide", () => {
1631
- this.showChrome(), this.hideTimer && clearTimeout(this.hideTimer), !this.videoEl.paused && (this.hideTimer = setTimeout(() => {
1632
- this.videoEl.paused || this.pointerOverControls || this.controlBar.settingsMenu.isOpen || this.setChromeOpacity("0");
1633
- }, this.autoHideDelayMs));
1634
- });
1635
- Ge(), this.root = this.attachShadow({ mode: "open" });
1636
- const t = document.createElement("style");
1637
- t.textContent = ie, this.root.appendChild(t);
1638
- const i = document.createElement("div");
1639
- i.className = "hp-root", i.innerHTML = We, this.root.appendChild(i), this.videoArea = this.root.querySelector(".video-area"), this.videoEl = this.root.querySelector("video"), this.adLayerEl = this.root.querySelector('[part="ad-layer"]'), this.instanceKey = `hp-${Math.random().toString(36).slice(2, 10)}`, this.loadingSpinner = new we(this.videoEl), this.root.querySelector(".media-layer").appendChild(this.loadingSpinner.el), this.errorScreen = new xe(this.videoEl, this.i18n), this.errorScreen.setOnRetry(() => void this.sourceManager.reload()), this.videoArea.appendChild(this.errorScreen.el), this.centerPlayButton = document.createElement("button"), this.centerPlayButton.type = "button", this.centerPlayButton.setAttribute("part", "center-play-button"), this.centerPlayButton.setAttribute("aria-label", this.i18n.play), this.centerPlayButton.className = "hp-center-play hp:absolute hp:inset-0 hp:flex hp:items-center hp:justify-center hp:bg-transparent hp:border-0 hp:cursor-pointer hp:text-on-surface hp:transition-opacity";
1640
- const s = document.createElement("span");
1641
- s.className = "hp-chip hp:flex hp:items-center hp:justify-center hp:w-16 hp:h-16", s.style.borderRadius = "9999px", s.appendChild(g("play", "hp:text-2xl")), this.centerPlayButton.appendChild(s), this.centerPlayButton.addEventListener("click", () => {
1642
- this.videoEl.paused && this.videoEl.play();
1643
- }), this.videoArea.appendChild(this.centerPlayButton), this.chromeEl = document.createElement("div"), this.chromeEl.className = "hp-chrome hp:absolute hp:inset-0 hp:z-20 hp:pointer-events-none", this.videoArea.appendChild(this.chromeEl), this.sourceManager = new se(this.videoEl, this.onHlsLevelsChanged), this.errorScreen.setShouldShow(() => !this.sourceManager.isRecovering()), this.controlBar = new ue(
1644
- this.videoEl,
1645
- Qe,
1646
- {
1647
- onRequestFullscreen: () => this.requestFullscreenCompat(),
1648
- onExitFullscreen: () => this.exitFullscreenCompat(),
1649
- isFullscreen: () => this.isFullscreenActive(),
1650
- // adsController sonradan kurulur — closure'lar her çağrıda güncel this.adsController'ı okur.
1651
- isAdActive: () => this.isAdPlaying(),
1652
- adTogglePlay: () => {
1653
- var o;
1654
- return (o = this.adsController) == null ? void 0 : o.toggleAdPlayPause();
1655
- },
1656
- adIsPaused: () => {
1657
- var o;
1658
- return ((o = this.adsController) == null ? void 0 : o.isAdPaused()) ?? !0;
1659
- },
1660
- adVolume: {
1661
- isAdActive: () => this.isAdPlaying(),
1662
- getVolume: () => {
1663
- var o;
1664
- return ((o = this.adsController) == null ? void 0 : o.getAdVolume()) ?? 1;
1665
- },
1666
- setVolume: (o) => {
1667
- var a;
1668
- return (a = this.adsController) == null ? void 0 : a.setAdVolume(o);
1669
- },
1670
- toggleMute: () => {
1671
- var o;
1672
- return (o = this.adsController) == null ? void 0 : o.toggleAdMute();
1673
- }
1674
- }
1675
- },
1676
- this.i18n
1677
- ), this.chromeEl.appendChild(this.controlBar.el), this.chromeEl.appendChild(this.controlBar.topEl), this.videoArea.appendChild(this.controlBar.volumePanel.unmuteBadge), this.captionRenderer = new S(this.videoEl, this.videoArea, this.controlBar.seekBar.el, this.i18n), this.videoArea.appendChild(this.captionRenderer.layerEl), this.keyboard = new ye(
1678
- this,
1679
- this.videoEl,
1680
- () => this.isFullscreenActive() ? this.exitFullscreenCompat() : this.requestFullscreenCompat()
1681
- ), this.tooltip = new fe(this.videoArea), this.seekFeedback = new qe(this.i18n), this.videoArea.appendChild(this.seekFeedback.el), this.controlBar.onSkip = (o) => this.seekFeedback.show(o), this.keyboard.onSeek = (o) => this.seekFeedback.show(o), this.controlBar.seekBar.onKeyboardSeek = (o) => this.seekFeedback.show(o), this.blockChrome("boot");
1682
- }
1683
- static get observedAttributes() {
1684
- return ["src", "poster", "autoplay", "muted", "loop", "theme", "locale"];
1685
- }
1686
- connectedCallback() {
1687
- this.tabIndex = this.tabIndex || 0, this.syncFromAttributes(), this.bootResolved || (this.bootGraceTimer = setTimeout(() => {
1688
- this.bootGraceTimer = null, this.bootResolved || (this.bootResolved = !0, this.syncFromAttributes());
1689
- }, 80)), this.videoEl.addEventListener("play", this.onPlay), this.videoEl.addEventListener("pause", this.onPause), this.addEventListener("pointermove", this.onPointerMove), this.addEventListener("pointerleave", this.onPointerLeave), this.addEventListener("pointerdown", this.onPointerDownFocus), document.addEventListener("fullscreenchange", this.onFullscreenChange), document.addEventListener("webkitfullscreenchange", this.onFullscreenChange), this.videoEl.addEventListener("webkitbeginfullscreen", this.onFullscreenChange), this.videoEl.addEventListener("webkitendfullscreen", this.onFullscreenChange), this.controlBar.settingsMenu.onOpenChange = (t) => {
1690
- t && this.hideTimer && clearTimeout(this.hideTimer), t || this.scheduleAutoHide(), this.tooltip.recheckOcclusion();
1691
- }, this.tooltip.setOcclusionCheck((t) => {
1692
- const i = this.controlBar.settingsMenu.panelRect;
1693
- return !!i && t.left < i.right && t.right > i.left && t.top < i.bottom && t.bottom > i.top;
1694
- }), this.videoEl.addEventListener("mousedown", this.onVideoPressStart), this.videoEl.addEventListener("mouseup", this.onVideoPressEnd), this.videoEl.addEventListener("mouseleave", this.onVideoPressCancel), this.videoEl.addEventListener("touchstart", this.onVideoPressStart, { passive: !0 }), this.videoEl.addEventListener("touchend", this.onVideoPressEnd), this.videoEl.addEventListener("touchcancel", this.onVideoPressCancel), this.dispatchEvent(new CustomEvent("hp:ready"));
1695
- }
1696
- disconnectedCallback() {
1697
- var t, i, s, o, a, h, d, l, p, c, u, m, y, w, k, v, x, b, z;
1698
- (t = this.miniProgress) == null || t.destroy(), this.miniProgress = null, this.videoEl.removeEventListener("play", this.onPlay), this.videoEl.removeEventListener("pause", this.onPause), this.removeEventListener("pointermove", this.onPointerMove), this.removeEventListener("pointerleave", this.onPointerLeave), this.removeEventListener("pointerdown", this.onPointerDownFocus), this.controlBar.settingsMenu.onOpenChange = null, document.removeEventListener("fullscreenchange", this.onFullscreenChange), document.removeEventListener("webkitfullscreenchange", this.onFullscreenChange), this.videoEl.removeEventListener("webkitbeginfullscreen", this.onFullscreenChange), this.videoEl.removeEventListener("webkitendfullscreen", this.onFullscreenChange), this.videoEl.removeEventListener("mousedown", this.onVideoPressStart), this.videoEl.removeEventListener("mouseup", this.onVideoPressEnd), this.videoEl.removeEventListener("mouseleave", this.onVideoPressCancel), this.videoEl.removeEventListener("touchstart", this.onVideoPressStart), this.videoEl.removeEventListener("touchend", this.onVideoPressEnd), this.videoEl.removeEventListener("touchcancel", this.onVideoPressCancel), this.controlBar.destroy(), this.captionRenderer.destroy(), this.keyboard.destroy(), this.tooltip.destroy(), this.loadingSpinner.destroy(), this.errorScreen.destroy(), this.seekFeedback.destroy(), this.sourceManager.destroy(), (i = this.adsController) == null || i.destroy(), (s = this.gestureControls) == null || s.destroy(), (o = this.loopSection) == null || o.destroy(), (a = this.inViewAutoplay) == null || a.destroy(), (h = this.unregisterSticky) == null || h.call(this), (d = this.playlistRunner) == null || d.destroy(), (l = this.hopeStory) == null || l.destroy(), (p = this.markProgress) == null || p.destroy(), (c = this.segments) == null || c.destroy(), (u = this.spriteThumbnails) == null || u.destroy(), (m = this.countdownScreen) == null || m.destroy(), (y = this.geoChecker) == null || y.destroy(), (w = this.redirectScreen) == null || w.destroy(), (k = this.qrResume) == null || k.destroy(), (v = this.pauseAd) == null || v.destroy(), this.pauseAd = null, (x = this.dubbing) == null || x.destroy(), (b = this.liveWallClock) == null || b.destroy(), (z = this.daiController) == null || z.destroy(), this.hideTimer && clearTimeout(this.hideTimer), this.bootGraceTimer && clearTimeout(this.bootGraceTimer);
1699
- }
1700
- /** Reklam/consent-farkında plugin'lerin (gesture/sticky/in-view-autoplay) ortak sorgusu. */
1701
- isAdPlaying() {
1702
- return this.chromeBlockers.has("ads");
1703
- }
1704
- attributeChangedCallback() {
1705
- this.syncFromAttributes();
1706
- }
1707
- get options() {
1708
- return this._options;
1709
- }
1710
- set options(t) {
1711
- this._options = t ?? {}, this.bootGraceTimer && (clearTimeout(this.bootGraceTimer), this.bootGraceTimer = null), this.bootResolved = !0, this.syncFromAttributes();
1712
- }
1713
- play() {
1714
- return this.videoEl.play();
1715
- }
1716
- pause() {
1717
- this.videoEl.pause();
1718
- }
1719
- /** Şu anki oynatma yolu: `native` (MP4/WebM), `native-hls` (tarayıcının HLS'i) ya da `hls.js` — teşhis için. */
1720
- get playbackEngine() {
1721
- return this.sourceManager.engine;
1722
- }
1723
- /** `options.qrResume` kuruluysa "telefonundan devam et" QR ekranını manuel göster (ör. entegratörün kendi "telefona gönder" butonu) — otomatik gösterim kuralları (minElapsed/minRemaining) burada uygulanmaz. */
1724
- showQrResume() {
1725
- var t;
1726
- (t = this.qrResume) == null || t.show();
1727
- }
1728
- get showRemainingTime() {
1729
- return this.controlBar.getShowRemaining();
1730
- }
1731
- set showRemainingTime(t) {
1732
- this.controlBar.setShowRemaining(t);
1733
- }
1734
- toggleTimeDisplay() {
1735
- this.controlBar.toggleTimeMode();
1736
- }
1737
- syncFromAttributes() {
1738
- const t = {
1739
- src: this.getAttribute("src") ?? void 0,
1740
- poster: this.getAttribute("poster") ?? void 0,
1741
- autoplay: this.hasAttribute("autoplay"),
1742
- muted: this.hasAttribute("muted"),
1743
- loop: this.hasAttribute("loop"),
1744
- theme: this.getAttribute("theme") ?? void 0,
1745
- locale: this.getAttribute("locale") ?? void 0
1746
- };
1747
- this.applyOptions({ ...t, ...this._options });
1748
- }
1749
- async applyOptions(t) {
1750
- var a, h, d, l, p, c, u, m, y, w, k, v, x;
1751
- t.poster && (this.videoEl.poster = t.poster), this.videoEl.autoplay = !!t.autoplay, this.videoEl.muted = !!t.muted, this.videoEl.loop = !!t.loop, this.videoEl.preload = t.preload ?? "metadata", this.videoEl.playsInline = !0, this.videoEl.setAttribute("webkit-playsinline", ""), this.autoHideDelayMs = t.autoHideDelayMs ?? Q, t.miniProgress && !this.miniProgress ? (this.miniProgress = new Ie(this.videoEl), this.videoArea.appendChild(this.miniProgress.el), this.updateMiniProgress()) : !t.miniProgress && this.miniProgress && (this.miniProgress.destroy(), this.miniProgress = null);
1752
- const i = t.keyboardSeekStep && t.keyboardSeekStep > 0 ? t.keyboardSeekStep : Xe;
1753
- this.keyboard.seekStep = i, this.controlBar.seekBar.keyboardStep = i;
1754
- const s = t.skipButtons === !0 ? {} : t.skipButtons || null;
1755
- if (this.controlBar.setSkipButtons(
1756
- s && s.back !== !1 ? s.back ?? Y : null,
1757
- s && s.forward !== !1 ? s.forward ?? Y : null
1758
- ), t.showRemainingTime !== void 0 && t.showRemainingTime !== this.appliedShowRemaining && (this.appliedShowRemaining = t.showRemainingTime, this.controlBar.setShowRemaining(t.showRemainingTime)), t.theme ? this.setAttribute("data-theme", t.theme) : this.removeAttribute("data-theme"), this.localeCode = t.locale ?? "tr", Ke(this.i18n, t.locale, t.labels), this.centerPlayButton.setAttribute("aria-label", this.i18n.play), this.controlBar.refreshLabels(), this.captionRenderer.refreshLabels(this.i18n), this.captionTrackActive && this.controlBar.settingsMenu.setCaptionAppearance(this.buildCaptionAppearance()), this.errorScreen.refreshLabels(), (a = this.playlistRunner) == null || a.refreshLabels(), (h = this.hopeStory) == null || h.refreshLabels(), (d = this.countdownScreen) == null || d.refreshLabels(), (l = this.geoChecker) == null || l.refreshLabels(), (p = this.redirectScreen) == null || p.refreshLabels(), (c = this.qrResume) == null || c.refreshLabels(), (u = this.pauseAd) == null || u.refreshLabels(), (m = this.dubbing) == null || m.refreshLabels(), (y = this.liveWallClock) == null || y.refreshLabels(), (w = this.loopSection) == null || w.refreshLabels(), (k = this.markProgress) == null || k.refreshLabels(), (x = (v = this.unregisterSticky) == null ? void 0 : v.refreshLabels) == null || x.call(v), !this.bootResolved)
1759
- return;
1760
- const o = () => ({
1761
- videoEl: this.videoEl,
1762
- overlayContainerEl: this.videoArea,
1763
- blockChrome: () => this.blockChrome("countdown-geo"),
1764
- unblockChrome: () => this.unblockChrome("countdown-geo"),
1765
- i18n: this.i18n
1766
- });
1767
- if (t.countdownScreen && !this.countdownScreen) {
1768
- const { installCountdownScreen: b } = await import("./index-rENB3n9O.js");
1769
- this.countdownScreen = b(o(), t.countdownScreen);
1770
- }
1771
- if (t.geoChecker && !this.geoChecker) {
1772
- const { installGeoChecker: b } = await import("./index-BBmuCtKu.js");
1773
- this.geoChecker = b(o(), t.geoChecker);
1774
- }
1775
- this.unblockChrome("boot"), this.countdownScreen && !this.countdownScreen.isComplete() ? (this.pendingPlaybackOptions = t, this.playbackInitRegistered || (this.playbackInitRegistered = !0, this.countdownScreen.onComplete(() => {
1776
- const b = this.pendingPlaybackOptions;
1777
- this.pendingPlaybackOptions = null, b && this.initPlayback(b);
1778
- }))) : await this.initPlayback(t);
1779
- }
1780
- async initPlayback(t) {
1781
- var s, o, a, h, d;
1782
- const i = (s = t.sources) != null && s.length ? t.sources : t.src ? [{ src: t.src, label: this.i18n.autoQuality }] : [];
1783
- if (i.length <= 1 && (this.controlBar.setQualities([], ""), this.hlsQualitiesShown = !1), i.length > 0) {
1784
- const l = i.find((p) => p.selected) ?? i[0];
1785
- await this.sourceManager.load(l.src, l.type), t.autoplay && this.videoEl.play().catch(() => {
1786
- });
1787
- }
1788
- if (i.length > 1 && this.controlBar.setQualities(
1789
- i.map((l) => ({
1790
- label: l.label,
1791
- onSelect: () => void this.switchQualitySource(l)
1792
- })),
1793
- ((o = i.find((l) => l.selected)) == null ? void 0 : o.label) ?? i[0].label
1794
- ), t.ads && !this.adsController) {
1795
- const l = t.ads === !0 ? {} : t.ads, { installAds: p } = await import("./index-glxDu2eJ.js");
1796
- this.adsController = await p(
1797
- {
1798
- videoEl: this.videoEl,
1799
- hostEl: this,
1800
- adLayerEl: this.adLayerEl,
1801
- hideChrome: () => this.blockChrome("ads", "reduced"),
1802
- showChrome: () => this.unblockChrome("ads"),
1803
- // IMA'nın KENDİ UI'ı üzerinden (ör. reklam video'suna
1804
- // tıklama) duraklatılır/devam ettirilirse toolbar'ımızın
1805
- // ikonu da senkron kalsın diye.
1806
- onAdPlayStateChange: () => this.controlBar.refreshAdPlayState(),
1807
- locale: this.localeCode
1808
- },
1809
- l
1810
- );
1811
- }
1812
- if (t.gesture && !this.gestureControls) {
1813
- const l = t.gesture === !0 ? {} : t.gesture, { installGesture: p } = await import("./index-Ca8hocby.js");
1814
- this.gestureControls = p(
1815
- { videoEl: this.videoEl, overlayContainerEl: this.videoArea, isAdActive: () => this.isAdPlaying() },
1816
- l
1817
- );
1818
- }
1819
- if (t.loopSection && !this.loopSection) {
1820
- const l = t.loopSection === !0 ? {} : t.loopSection, { installLoopSection: p } = await import("./index-f0vSgRIK.js");
1821
- this.loopSection = p(
1822
- {
1823
- videoEl: this.videoEl,
1824
- seekBarEl: this.controlBar.seekBar.el,
1825
- markers: this.controlBar.seekBar,
1826
- addControlButton: (c, u, m) => this.controlBar.addButton(c, u, m),
1827
- i18n: this.i18n
1828
- },
1829
- l
1830
- );
1831
- }
1832
- if (t.inViewAutoplay && !this.inViewAutoplay) {
1833
- const l = t.inViewAutoplay === !0 ? {} : t.inViewAutoplay, { installInViewAutoplay: p } = await import("./index-3QALpwsf.js");
1834
- this.inViewAutoplay = p(
1835
- { videoEl: this.videoEl, observeEl: this, isAdActive: () => this.isAdPlaying() },
1836
- l
1837
- );
1838
- }
1839
- if (t.sticky && !this.unregisterSticky) {
1840
- const l = t.sticky === !0 ? {} : t.sticky, { installSticky: p } = await import("./index-CDDke5rz.js");
1841
- this.unregisterSticky = p(
1842
- {
1843
- key: this.instanceKey,
1844
- videoEl: this.videoEl,
1845
- hostEl: this,
1846
- wrapperEl: this,
1847
- closeButtonMountEl: this.videoArea,
1848
- isAdActive: () => this.isAdPlaying(),
1849
- i18n: this.i18n
1850
- },
1851
- l
1852
- );
1853
- }
1854
- if (t.playlist && !this.playlistRunner) {
1855
- const { installPlaylist: l } = await import("./index-DrFrsAJ-.js");
1856
- this.playlistRunner = l(
1857
- {
1858
- videoEl: this.videoEl,
1859
- hostEl: this,
1860
- panelEl: this.getOrCreatePanelContainer(),
1861
- loadSource: (p, c) => this.sourceManager.load(p, c),
1862
- setPoster: (p) => {
1863
- this.videoEl.poster = p;
1864
- },
1865
- requestFreshAd: (p) => {
1866
- var c;
1867
- return (c = this.adsController) == null ? void 0 : c.resetForNewItem(p);
1868
- },
1869
- i18n: this.i18n
1870
- },
1871
- t.playlist
1872
- );
1873
- }
1874
- if (t.story && !this.hopeStory) {
1875
- const { installStory: l } = await import("./index-C2LLloqz.js");
1876
- this.hopeStory = l(
1877
- {
1878
- videoEl: this.videoEl,
1879
- hostEl: this,
1880
- videoAreaEl: this.videoArea,
1881
- playerBodyEls: [this.root.querySelector(".media-layer"), this.chromeEl, this.centerPlayButton],
1882
- loadSource: (p, c) => this.sourceManager.load(p, c),
1883
- setPoster: (p) => {
1884
- this.videoEl.poster = p;
1885
- },
1886
- requestFreshAd: (p) => {
1887
- var c;
1888
- return (c = this.adsController) == null ? void 0 : c.resetForNewItem(p);
1889
- },
1890
- i18n: this.i18n
1891
- },
1892
- t.story
1893
- );
1894
- }
1895
- if (t.markers && !this.markProgress) {
1896
- const { installMarkers: l } = await import("./index-CoUeJvsG.js");
1897
- this.markProgress = l(
1898
- {
1899
- videoEl: this.videoEl,
1900
- overlayContainerEl: this.videoArea,
1901
- addSeekBarMarker: (p, c) => this.controlBar.seekBar.addMarker(p, c),
1902
- i18n: this.i18n
1903
- },
1904
- t.markers
1905
- );
1906
- }
1907
- if ((a = t.segments) != null && a.length && !this.segments) {
1908
- const { installSegments: l } = await import("./index-DXgJitsr.js");
1909
- this.segments = l({ videoEl: this.videoEl, seekBar: this.controlBar.seekBar }, t.segments);
1910
- }
1911
- if (t.spriteThumbnails && !this.spriteThumbnails) {
1912
- const { installSpriteThumbnails: l } = await import("./index-DSOoIVgQ.js");
1913
- this.spriteThumbnails = l(
1914
- {
1915
- videoEl: this.videoEl,
1916
- seekBar: this.controlBar.seekBar,
1917
- playerWidth: () => this.videoArea.clientWidth
1918
- },
1919
- t.spriteThumbnails
1920
- );
1921
- }
1922
- if (t.redirectScreen && !this.redirectScreen) {
1923
- const { installRedirectScreen: l } = await import("./index-D6r-BGAV.js");
1924
- this.redirectScreen = l(
1925
- { videoEl: this.videoEl, overlayContainerEl: this.videoArea, isAdActive: () => this.isAdPlaying(), i18n: this.i18n },
1926
- t.redirectScreen
1927
- );
1928
- }
1929
- if (t.qrResume && !this.qrResume) {
1930
- const { installQrResume: l } = await import("./index-DT8-oMPm.js");
1931
- this.qrResume = l({ videoEl: this.videoEl, overlayContainerEl: this.videoArea, i18n: this.i18n }, t.qrResume);
1932
- }
1933
- if (this.qrResume) {
1934
- const l = this.qrResume;
1935
- this.controlBar.settingsMenu.setQrResumeToggle({
1936
- label: this.i18n.qrResumeMenuLabel,
1937
- getValueLabel: () => l.isEnabled() ? this.i18n.qrResumeOn : this.i18n.qrResumeOff,
1938
- onToggle: () => l.setEnabled(!l.isEnabled())
1939
- });
1940
- }
1941
- if ((h = t.pauseAd) != null && h.adUnitPath && !this.pauseAd) {
1942
- const { installPauseAd: l } = await import("./index-CaMVTgh0.js");
1943
- this.pauseAd = l(
1944
- { videoEl: this.videoEl, hostEl: this, videoArea: this.videoArea, i18n: this.i18n, isBlocked: () => this.isChromeBlocked },
1945
- t.pauseAd
1946
- );
1947
- }
1948
- if (t.dubbing && !this.dubbing) {
1949
- const { installDubbing: l } = await import("./index-DXWK4EFa.js");
1950
- this.dubbing = l(
1951
- {
1952
- videoEl: this.videoEl,
1953
- loadSource: (p, c) => this.sourceManager.load(p, c),
1954
- registerSubmenu: (p) => this.controlBar.settingsMenu.registerSubmenu(p),
1955
- unregisterSubmenu: (p) => this.controlBar.settingsMenu.unregisterSubmenu(p),
1956
- i18n: this.i18n
1957
- },
1958
- t.dubbing
1959
- );
1960
- }
1961
- if (t.liveWallClock && !this.liveWallClock) {
1962
- const l = t.liveWallClock === !0 ? {} : t.liveWallClock, { installLiveWallClock: p } = await import("./index-Z7Jmls0c.js");
1963
- this.liveWallClock = p(
1964
- {
1965
- videoEl: this.videoEl,
1966
- seekBarEl: this.controlBar.seekBar.el,
1967
- addControlElement: (c) => this.controlBar.addElement(c),
1968
- i18n: this.i18n
1969
- },
1970
- l
1971
- );
1972
- }
1973
- if (t.dai && !this.daiController) {
1974
- const { installDai: l } = await import("./index-Q8FMOHj0.js");
1975
- this.daiController = await l(
1976
- {
1977
- videoEl: this.videoEl,
1978
- hostEl: this,
1979
- adUiEl: this.adLayerEl,
1980
- loadStreamUrl: (p) => this.sourceManager.load(p),
1981
- disableSeeking: () => this.disableSeeking(),
1982
- enableSeeking: () => this.enableSeeking()
1983
- },
1984
- t.dai
1985
- );
1986
- }
1987
- if ((d = t.subtitles) != null && d.length) {
1988
- this.subtitleTracks = Ee(this.videoEl, t.subtitles);
1989
- const l = t.subtitles.find((c) => c.default), p = (c) => {
1990
- const u = Ce(this.subtitleTracks, c);
1991
- this.captionRenderer.setActiveTrack(u), this.captionTrackActive = u !== null, this.controlBar.settingsMenu.setActiveCaption(c ?? this.i18n.captionsOff), this.controlBar.settingsMenu.setCaptionAppearance(u !== null ? this.buildCaptionAppearance() : null);
1992
- };
1993
- this.selectCaption = p, this.controlBar.setCaptions(
1994
- [
1995
- { label: this.i18n.captionsOff, onSelect: () => p(null) },
1996
- ...this.subtitleTracks.map(({ label: c }) => ({
1997
- label: c,
1998
- onSelect: () => p(c)
1999
- }))
2000
- ],
2001
- (l == null ? void 0 : l.label) ?? this.i18n.captionsOff
2002
- ), p((l == null ? void 0 : l.label) ?? null);
2003
- } else
2004
- X(this.videoEl), this.subtitleTracks = [], this.selectCaption = null, this.captionRenderer.setActiveTrack(null), this.captionTrackActive = !1, this.controlBar.settingsMenu.setCaptionAppearance(null);
2005
- }
2006
- /** Ayarlar menüsünün "Altyazı" alt menüsüne eklenen Boyut/Renk/Konum satırları — her zaman GÜNCEL `this.i18n`'i okur (dil sonradan değişse bile). */
2007
- buildCaptionAppearance() {
2008
- const t = ["small", "normal", "large"], i = (s, o, a, h) => s.map((d, l) => ({
2009
- value: d,
2010
- active: o() === d,
2011
- ariaLabel: `${h} ${l + 1}`,
2012
- onSelect: () => a(d)
2013
- }));
2014
- return {
2015
- sizeLabel: this.i18n.captionSize,
2016
- getSizeOptions: () => t.map((s) => ({
2017
- label: s === "small" ? this.i18n.captionSizeSmall : s === "large" ? this.i18n.captionSizeLarge : this.i18n.captionSizeNormal,
2018
- active: this.captionRenderer.getFontSize() === s,
2019
- onSelect: () => this.captionRenderer.setFontSize(s)
2020
- })),
2021
- bgColorLabel: this.i18n.captionBgColor,
2022
- getBgColorOptions: () => i(
2023
- S.BG_COLOR_PRESETS,
2024
- () => this.captionRenderer.getBgColor(),
2025
- (s) => this.captionRenderer.setBgColor(s),
2026
- this.i18n.captionBgColor
2027
- ),
2028
- textColorLabel: this.i18n.captionTextColor,
2029
- getTextColorOptions: () => i(
2030
- S.TEXT_COLOR_PRESETS,
2031
- () => this.captionRenderer.getTextColor(),
2032
- (s) => this.captionRenderer.setTextColor(s),
2033
- this.i18n.captionTextColor
2034
- ),
2035
- resetPositionLabel: this.i18n.captionResetPosition,
2036
- onResetPosition: () => this.captionRenderer.resetPosition()
2037
- };
2038
- }
2039
- getOrCreatePanelContainer() {
2040
- return this.panelContainer || (this.panelContainer = document.createElement("div"), this.root.appendChild(this.panelContainer)), this.panelContainer;
2041
- }
2042
- /** Kalite değişirken oynatma konumunu ve play/pause durumunu korur. */
2043
- async switchQualitySource(t) {
2044
- const i = this.videoEl.currentTime, s = !this.videoEl.paused;
2045
- await this.sourceManager.load(t.src, t.type), this.videoEl.currentTime = i, s && this.videoEl.play().catch(() => {
2046
- }), this.dispatchEvent(new CustomEvent("hp:qualitychange", { detail: { label: t.label } }));
2047
- }
2048
- // ── Fullscreen (vendor-prefix uyumlu) ───────────────────────────────
2049
- /** iPhone Safari element tam ekranını desteklemiyor — yalnızca <video>'nun kendi (native kontrollü) tam ekranı. */
2050
- get iosVideo() {
2051
- return this.videoEl;
2052
- }
2053
- requestFullscreenCompat() {
2054
- const t = this, i = () => {
2055
- var s, o;
2056
- return (o = (s = this.iosVideo).webkitEnterFullscreen) == null ? void 0 : o.call(s);
2057
- };
2058
- t.requestFullscreen ? t.requestFullscreen().catch(i) : t.webkitRequestFullscreen ? t.webkitRequestFullscreen() : i();
2059
- }
2060
- exitFullscreenCompat() {
2061
- var i, s;
2062
- if (this.iosVideo.webkitDisplayingFullscreen) {
2063
- (s = (i = this.iosVideo).webkitExitFullscreen) == null || s.call(i);
2064
- return;
2065
- }
2066
- const t = document;
2067
- document.exitFullscreen ? document.exitFullscreen() : t.webkitExitFullscreen && t.webkitExitFullscreen();
2068
- }
2069
- isFullscreenActive() {
2070
- const t = document;
2071
- return document.fullscreenElement === this || t.webkitFullscreenElement === this || !!this.iosVideo.webkitDisplayingFullscreen;
2072
- }
2073
- /**
2074
- * iPhone native tam ekranında bizim altyazı katmanımız görünmez — seçili izi 'showing' yapıp iOS'un çizmesine bırakırız.
2075
- */
2076
- showCaptionsNatively() {
2077
- for (const { track: t } of this.subtitleTracks) t.mode === "hidden" && (t.mode = "showing");
2078
- }
2079
- /**
2080
- * Native tam ekrandan dönüş: iOS menüsünde seçilen iz 'showing' kalır ve kendi katmanımızla çift altyazı çizilir.
2081
- * Seçimi bizim tarafa aktarıp izi tekrar 'hidden' yaparız (hiçbiri showing değilse kullanıcı kapatmıştır).
2082
- */
2083
- syncCaptionsFromNative() {
2084
- if (!this.selectCaption) return;
2085
- const t = this.subtitleTracks.find(({ track: i }) => i.mode === "showing");
2086
- this.selectCaption((t == null ? void 0 : t.label) ?? null);
2087
- }
2088
- get isChromeBlocked() {
2089
- return this.chromeBlockers.size > 0;
2090
- }
2091
- get isChromeFullyHidden() {
2092
- for (const t of this.chromeBlockers.values()) if (t === "hidden") return !0;
2093
- return !1;
2094
- }
2095
- showChrome() {
2096
- this.setChromeOpacity("1");
2097
- }
2098
- /** Chrome görünürlüğünün tek giriş noktası — altyazı da haberdar olur (kontroller gizlenince en alta iner). */
2099
- setChromeOpacity(t) {
2100
- var i;
2101
- this.chromeEl.style.opacity = t, this.chromeVisible = t === "1", (i = this.captionRenderer) == null || i.setChromeVisible(this.chromeVisible), this.updateMiniProgress();
2102
- }
2103
- /** İnce ilerleme çizgisi: yalnızca kontroller gizliyken; reklam/giriş ekranı (chrome bloklu) sırasında değil. */
2104
- updateMiniProgress() {
2105
- var t;
2106
- (t = this.miniProgress) == null || t.setVisible(!this.chromeVisible && !this.isChromeBlocked);
2107
- }
2108
- /**
2109
- * Plugin (ads/countdown/geo) chrome'u kendi key'iyle gizler; unblockChrome aynı key'le açar.
2110
- * 'reduced' (ads): yalnızca oynat/duraklat + ses kalır. Merkez buton her modda gizli.
2111
- */
2112
- blockChrome(t, i = "hidden") {
2113
- this.chromeBlockers.set(t, i), this.updateMiniProgress(), this.hideTimer && clearTimeout(this.hideTimer), this.centerPlayButton.style.opacity = "0", this.centerPlayButton.style.pointerEvents = "none", this.isChromeFullyHidden ? (this.setChromeOpacity("0"), this.chromeEl.style.pointerEvents = "none") : this.setChromeOpacity("1"), this.controlBar.setAdMode(this.chromeBlockers.get("ads") === "reduced");
2114
- }
2115
- /** Bloklayan plugin işini bitirince çağırır — başka bir blocker hâlâ aktifse chrome açılmaz. */
2116
- unblockChrome(t) {
2117
- if (this.chromeBlockers.delete(t), this.updateMiniProgress(), this.controlBar.setAdMode(this.chromeBlockers.get("ads") === "reduced"), this.isChromeBlocked) {
2118
- this.isChromeFullyHidden ? (this.setChromeOpacity("0"), this.chromeEl.style.pointerEvents = "none") : (this.setChromeOpacity("1"), this.chromeEl.style.pointerEvents = "");
2119
- return;
2120
- }
2121
- this.chromeEl.style.pointerEvents = "", this.videoEl.paused ? (this.centerPlayButton.style.opacity = "1", this.centerPlayButton.style.pointerEvents = "auto", this.showChrome()) : this.scheduleAutoHide();
2122
- }
2123
- /** DAI reklam arası boyunca kullanıcı reklamın İÇİNE seek edemesin diye (sunucu taraflı eklenen reklamlar seekable aralığın parçası). */
2124
- disableSeeking() {
2125
- this.controlBar.setSeekingEnabled(!1), this.controlBar.seekBar.el.style.pointerEvents = "none", this.controlBar.seekBar.el.style.opacity = "0.5";
2126
- }
2127
- enableSeeking() {
2128
- this.controlBar.setSeekingEnabled(!0), this.controlBar.seekBar.el.style.pointerEvents = "", this.controlBar.seekBar.el.style.opacity = "";
2129
- }
2130
- }
2131
- typeof window < "u" && !customElements.get("hope-player") && customElements.define("hope-player", $e);
2132
- export {
2133
- $e as H,
2134
- g as c,
2135
- E as f
2136
- };
2137
- //# sourceMappingURL=index-QJhB8dCl.js.map