@webitel/ui-sdk 26.6.33 → 26.6.35

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 (177) hide show
  1. package/dist/AgentStatus.enum-C3IGHtvR.js +9 -0
  2. package/dist/_plugin-vue_export-helper-B3ysoDQm.js +8 -0
  3. package/dist/caseConverters-DXegZoCt.js +27 -0
  4. package/dist/chunk-CY3AvKd6.js +20 -0
  5. package/dist/clients-A6MHYfOX.js +36118 -0
  6. package/dist/components-B4aAS7wB.js +5391 -0
  7. package/dist/composables-DnDH-KUv.js +263 -0
  8. package/dist/convertDuration-1K7fuEpO.js +8 -0
  9. package/dist/debounce-DrmECuJ2.js +128 -0
  10. package/dist/deep-copy-CQw5yeEH.js +41 -0
  11. package/dist/displayText-CtaxzaBz.js +3 -0
  12. package/dist/dist-05Bf47Wg.js +87 -0
  13. package/dist/dist-BYiYpK00.js +7 -0
  14. package/dist/dist-Dz55hlwp.js +1371 -0
  15. package/dist/engineCallFileType-D7QVFOac.js +11 -0
  16. package/dist/enums-pbYAJNeb.js +158 -0
  17. package/dist/errors-SUXKojVW.js +69 -0
  18. package/dist/floating-ui.dom-n2j9PKCB.js +842 -0
  19. package/dist/generateInstance-ppTIeLX4.js +2582 -0
  20. package/dist/isObject-Dgs_L5xI.js +11 -0
  21. package/dist/logger-hl3ueNok.js +47 -0
  22. package/dist/prod-Cp0BjuxI.js +775 -0
  23. package/dist/prod-DSuxcp5t.js +2 -0
  24. package/dist/side-channel-Cyte-MzW.js +833 -0
  25. package/dist/sortQueryAdapters-CyYXvnDN.js +14 -0
  26. package/dist/srt-parser-DdH5U08c.js +21 -0
  27. package/dist/ssa-parser-Bjs7yDD1.js +184 -0
  28. package/dist/ui-sdk.css +2 -1
  29. package/dist/ui-sdk.js +34541 -4
  30. package/dist/ui-sdk.umd.cjs +7740 -7606
  31. package/dist/useExpansion-DVdIpoOn.js +24 -0
  32. package/dist/useValidation-DG0tifBv.js +37 -0
  33. package/dist/useVidstackSrc-DfNrFbOO.js +155 -0
  34. package/dist/useWtTable-tqmVOvve.js +12 -0
  35. package/dist/vidstack-B01xzxC4-DeYSgDZy.js +7 -0
  36. package/dist/vidstack-BGSTndAW-CyKM_CM4.js +957 -0
  37. package/dist/vidstack-BQlOPwOu-ChhdffAJ.js +43 -0
  38. package/dist/vidstack-Bq6c3Bam-3dCf_D36.js +398 -0
  39. package/dist/vidstack-C2US-gSO-DeIgENrW.js +127 -0
  40. package/dist/vidstack-C9vIqaYT-C1EgPq17.js +9 -0
  41. package/dist/vidstack-CTojmhKq-D7sZJxgm.js +30 -0
  42. package/dist/vidstack-ChQTHmIQ-nTO94M6P.js +51 -0
  43. package/dist/vidstack-Ci54COQW-CAAXpwzv.js +208 -0
  44. package/dist/vidstack-D2pY00kU-DoW028io.js +70 -0
  45. package/dist/vidstack-D5EzK014-DOe01V3H.js +14 -0
  46. package/dist/vidstack-DDXt6fpN-Don_e6LS.js +42 -0
  47. package/dist/vidstack-D_-9AA6_-Dq3APB0-.js +19 -0
  48. package/dist/vidstack-Dihypf8P-ibWMCHK-.js +12 -0
  49. package/dist/vidstack-Dm1xEU9Q-VlefmrP8.js +31 -0
  50. package/dist/vidstack-DqAw8m9J-Dk1GT3Oe.js +22 -0
  51. package/dist/vidstack-audio-B58bvsna.js +23 -0
  52. package/dist/vidstack-dash-CX-LTHx3.js +332 -0
  53. package/dist/vidstack-google-cast-Co5Q_rfL.js +361 -0
  54. package/dist/vidstack-hls-CLzdTFu6.js +269 -0
  55. package/dist/vidstack-krOAtKMi-DN1WZC3p.js +30 -0
  56. package/dist/vidstack-video-XtP8iTBc.js +151 -0
  57. package/dist/vidstack-vimeo-EzzPpggD.js +386 -0
  58. package/dist/vidstack-youtube-C1_NAfWa.js +205 -0
  59. package/dist/vue-i18n-B8Px6VcD.js +2201 -0
  60. package/dist/wt-action-bar-Ba1ZJjE_.js +85 -0
  61. package/dist/wt-button-DENbrKdy.js +785 -0
  62. package/dist/wt-button-select-BnRHgJ4i.js +80 -0
  63. package/dist/wt-call-media-action-Bkyppnsm.js +42 -0
  64. package/dist/wt-chat-emoji-wdBt1XzD.js +2208 -0
  65. package/dist/wt-confirm-dialog-DCUitG2v.js +70 -0
  66. package/dist/wt-context-menu-yW52oF-2.js +89 -0
  67. package/dist/wt-copy-action-d9gVzAsB.js +38 -0
  68. package/dist/wt-datepicker-Cnbarx_j.js +5774 -0
  69. package/dist/wt-display-chip-items-CvMM8WMk.js +34 -0
  70. package/dist/wt-dual-panel-DAhTYFS_.js +49 -0
  71. package/dist/wt-dummy-CLjhRWZ6.js +59 -0
  72. package/dist/wt-error-page-vhu4lIyF.js +62 -0
  73. package/dist/wt-expand-transition-C2p9bR4j.js +39 -0
  74. package/dist/wt-expansion-card-qsxvbtZm.js +47 -0
  75. package/dist/wt-expansion-panel-C_EXvx1d.js +40 -0
  76. package/dist/wt-filters-panel-wrapper-Cc9b3aci.js +51 -0
  77. package/dist/wt-galleria-CWXKuZTD.js +224 -0
  78. package/dist/wt-icon-action-CQlZHMDB.js +100 -0
  79. package/dist/wt-icon-btn-CjjI4cgE.js +107 -0
  80. package/dist/wt-icon-pxO7IjwV.js +1026 -0
  81. package/dist/wt-inline-add-panel-B0E4Vk2l.js +43 -0
  82. package/dist/wt-navigation-menu-CenQi_-T.js +126 -0
  83. package/dist/wt-notifications-bar-Ep1QuFZi.js +52 -0
  84. package/dist/wt-page-header-CDbd4aOh.js +59 -0
  85. package/dist/wt-pagination-BA_PZPIE.js +94 -0
  86. package/dist/wt-player-uidPXSTe.js +287 -0
  87. package/dist/wt-popover-CJZH3wMl.js +98 -0
  88. package/dist/wt-screen-recordings-action-Dg7Ts2Jt.js +37 -0
  89. package/dist/wt-search-bar-CWZdvAOf.js +123 -0
  90. package/dist/wt-selection-popup-B77UY7Yu.js +79 -0
  91. package/dist/wt-send-message-popup-D0GJMGni.js +77 -0
  92. package/dist/wt-slider-BS3SoGht.js +68 -0
  93. package/dist/wt-start-page-eN1PEokc.js +86 -0
  94. package/dist/wt-status-select-A5t6Vjm4.js +101 -0
  95. package/dist/wt-stepper-B6zpd1Uh.js +41 -0
  96. package/dist/wt-table-D0FynxIE.js +364 -0
  97. package/dist/wt-table-actions-4-peSVkc.js +63 -0
  98. package/dist/wt-table-column-select-DFF6z3a3.js +100 -0
  99. package/dist/wt-tabs-DuOgj-lZ.js +60 -0
  100. package/dist/wt-time-input-CO2cop3y.js +62 -0
  101. package/dist/wt-timepicker-BltFF1QD.js +145 -0
  102. package/dist/wt-tree-ZyoPrNOl.js +1206 -0
  103. package/dist/wt-tree-table-MLET4gIv.js +221 -0
  104. package/dist/wt-type-extension-value-input-fnNxJLsq.js +104 -0
  105. package/dist/wt-vidstack-player-DLTA9mBK.js +7440 -0
  106. package/package.json +5 -5
  107. package/src/components/wt-table-column-select/__tests__/WtTableColumnSelect.spec.js +3 -3
  108. package/src/components/wt-vidstack-player/wt-vidstack-player.vue +2 -2
  109. package/dist/contacts-C-FnP7wP.js +0 -49654
  110. package/dist/displayText-Cbh4IOfM.js +0 -5
  111. package/dist/engineCallFileType-yaadA7-2.js +0 -8
  112. package/dist/errors-CTL-RV3B.js +0 -70
  113. package/dist/index-BBLSS-t1.js +0 -50
  114. package/dist/install-DOSuNFtE.js +0 -53489
  115. package/dist/isObject-CMQJaQIp.js +0 -28
  116. package/dist/prod-BoQuiIB3.js +0 -973
  117. package/dist/srt-parser-CsN7bp5E.js +0 -26
  118. package/dist/ssa-parser-BJOOPeQF.js +0 -200
  119. package/dist/useExpansion-BrQ40HiR.js +0 -24
  120. package/dist/useVidstackSrc-MfWBq7Ef.js +0 -1341
  121. package/dist/vidstack-Bq6c3Bam-C_T8PkmG.js +0 -426
  122. package/dist/vidstack-D2pY00kU-CphVKcJq.js +0 -136
  123. package/dist/vidstack-DDXt6fpN-2lNfj8Ca.js +0 -51
  124. package/dist/vidstack-D_-9AA6_-Cyl8HzDm.js +0 -21
  125. package/dist/vidstack-Dm1xEU9Q-CXHNvShT.js +0 -30
  126. package/dist/vidstack-DqAw8m9J-C2p9K7Db.js +0 -22
  127. package/dist/vidstack-audio-BL-Sa_Ap.js +0 -28
  128. package/dist/vidstack-dash-mKhgfurw.js +0 -393
  129. package/dist/vidstack-google-cast-BGqSw2iP.js +0 -383
  130. package/dist/vidstack-hls-U5fTV3hj.js +0 -310
  131. package/dist/vidstack-krOAtKMi-C50BTxmn.js +0 -28
  132. package/dist/vidstack-video-Bxf7KDne.js +0 -164
  133. package/dist/vidstack-vimeo-MngSXtDR.js +0 -452
  134. package/dist/vidstack-youtube-Ctg91VeX.js +0 -233
  135. package/dist/wt-action-bar-DaDcqA4n.js +0 -102
  136. package/dist/wt-button-select-q_BITVhH.js +0 -105
  137. package/dist/wt-call-media-action-BkBcZN17.js +0 -60
  138. package/dist/wt-chat-emoji-BGuSgYi3.js +0 -2909
  139. package/dist/wt-confirm-dialog-C7-74ROm.js +0 -92
  140. package/dist/wt-context-menu-CzAHMaOj.js +0 -104
  141. package/dist/wt-copy-action-BpckAObd.js +0 -60
  142. package/dist/wt-datepicker-DauMnf2r.js +0 -5660
  143. package/dist/wt-display-chip-items-zcqxH89_.js +0 -47
  144. package/dist/wt-dual-panel-Cj79kJpk.js +0 -66
  145. package/dist/wt-dummy-BUHYAcsk.js +0 -104
  146. package/dist/wt-error-page-CNSqDA-o.js +0 -89
  147. package/dist/wt-expansion-card-CtcuXg6f.js +0 -56
  148. package/dist/wt-expansion-panel-BU2Hb-N2.js +0 -54
  149. package/dist/wt-filters-panel-wrapper-BlLlAixc.js +0 -75
  150. package/dist/wt-galleria-BQzGD6-3.js +0 -323
  151. package/dist/wt-inline-add-panel-fG58a6T3.js +0 -49
  152. package/dist/wt-navigation-menu-2ggfyrM_.js +0 -159
  153. package/dist/wt-notifications-bar-Epn_SA_R.js +0 -79
  154. package/dist/wt-page-header-DdsnoLgd.js +0 -115
  155. package/dist/wt-pagination-Byg79HfY.js +0 -144
  156. package/dist/wt-player-kjdJYVi3.js +0 -291
  157. package/dist/wt-popover-Di-7_rDL.js +0 -4
  158. package/dist/wt-popover.vue_vue_type_style_index_0_lang-DMDTlCgv.js +0 -81
  159. package/dist/wt-screen-recordings-action-Z3x-gI0n.js +0 -54
  160. package/dist/wt-search-bar-CxwSi-Xo.js +0 -144
  161. package/dist/wt-selection-popup-MdCfrgcd.js +0 -109
  162. package/dist/wt-send-message-popup-DklTgoGj.js +0 -579
  163. package/dist/wt-slider-BEkw4KGp.js +0 -4
  164. package/dist/wt-slider.vue_vue_type_script_setup_true_lang-DlaRDHxo.js +0 -55
  165. package/dist/wt-start-page-B59KbWqX.js +0 -99
  166. package/dist/wt-status-select-hOAr_xBg.js +0 -138
  167. package/dist/wt-stepper-CMeW3d6N.js +0 -65
  168. package/dist/wt-table-C5CLtnK5.js +0 -426
  169. package/dist/wt-table-actions-DgAfy-dd.js +0 -79
  170. package/dist/wt-table-column-select-BK5rozpI.js +0 -128
  171. package/dist/wt-tabs-Bn6rSg0s.js +0 -74
  172. package/dist/wt-time-input-DYiW0ijt.js +0 -42
  173. package/dist/wt-timepicker-CkjoLwXC.js +0 -118
  174. package/dist/wt-tree-CCvr4TTF.js +0 -2777
  175. package/dist/wt-tree-table-BWmGF3rE.js +0 -285
  176. package/dist/wt-type-extension-value-input-q5286OSO.js +0 -121
  177. package/dist/wt-vidstack-player-CTWna35Q.js +0 -9093
@@ -1,383 +0,0 @@
1
- import { ab as g, aq as l, o as k, D as u, x as h, l as m, m as y, O as p } from "./useVidstackSrc-MfWBq7Ef.js";
2
- import { e as n, L as C } from "./wt-vidstack-player-CTWna35Q.js";
3
- import { R as E } from "./vidstack-DqAw8m9J-C2p9K7Db.js";
4
- import { g as v, a as L, b as f, h as T, l as S, c as A } from "./vidstack-D2pY00kU-CphVKcJq.js";
5
- class I {
6
- #t;
7
- constructor(t) {
8
- this.#t = new chrome.cast.media.MediaInfo(t.src, t.type);
9
- }
10
- build() {
11
- return this.#t;
12
- }
13
- setStreamType(t) {
14
- return t.includes("live") ? this.#t.streamType = chrome.cast.media.StreamType.LIVE : this.#t.streamType = chrome.cast.media.StreamType.BUFFERED, this;
15
- }
16
- setTracks(t) {
17
- return this.#t.tracks = t.map(this.#e), this;
18
- }
19
- setMetadata(t, e) {
20
- return this.#t.metadata = new chrome.cast.media.GenericMediaMetadata(), this.#t.metadata.title = t, this.#t.metadata.images = [{ url: e }], this;
21
- }
22
- #e(t, e) {
23
- const s = new chrome.cast.media.Track(e, chrome.cast.media.TrackType.TEXT);
24
- return s.name = t.label, s.trackContentId = t.src, s.trackContentType = "text/vtt", s.language = t.language, s.subtype = t.kind.toUpperCase(), s;
25
- }
26
- }
27
- class b {
28
- #t;
29
- #e;
30
- #i;
31
- constructor(t, e, s) {
32
- this.#t = t, this.#e = e, this.#i = s;
33
- }
34
- setup() {
35
- const t = this.syncRemoteActiveIds.bind(this);
36
- m(this.#e.audioTracks, "change", t), m(this.#e.textTracks, "mode-change", t), y(this.#o.bind(this));
37
- }
38
- getLocalTextTracks() {
39
- return this.#e.$state.textTracks().filter((t) => t.src && t.type === "vtt");
40
- }
41
- #a() {
42
- return this.#e.$state.audioTracks();
43
- }
44
- #r(t) {
45
- const e = this.#t.mediaInfo?.tracks ?? [];
46
- return t ? e.filter((s) => s.type === t) : e;
47
- }
48
- #l() {
49
- const t = [], e = this.#a().find((i) => i.selected), s = this.getLocalTextTracks().filter((i) => i.mode === "showing");
50
- if (e) {
51
- const i = this.#r(chrome.cast.media.TrackType.AUDIO), r = this.#d(i, e);
52
- r && t.push(r.trackId);
53
- }
54
- if (s?.length) {
55
- const i = this.#r(chrome.cast.media.TrackType.TEXT);
56
- if (i.length)
57
- for (const r of s) {
58
- const a = this.#d(i, r);
59
- a && t.push(a.trackId);
60
- }
61
- }
62
- return t;
63
- }
64
- #o() {
65
- const t = this.getLocalTextTracks();
66
- if (!this.#t.isMediaLoaded) return;
67
- const e = this.#r(chrome.cast.media.TrackType.TEXT);
68
- for (const s of t)
69
- if (!this.#d(e, s)) {
70
- p(() => this.#i?.());
71
- break;
72
- }
73
- }
74
- syncRemoteTracks(t) {
75
- if (!this.#t.isMediaLoaded) return;
76
- const e = this.#a(), s = this.getLocalTextTracks(), i = this.#r(chrome.cast.media.TrackType.AUDIO), r = this.#r(chrome.cast.media.TrackType.TEXT);
77
- for (const a of i) {
78
- if (this.#h(e, a)) continue;
79
- const o = {
80
- id: a.trackId.toString(),
81
- label: a.name,
82
- language: a.language,
83
- kind: a.subtype ?? "main",
84
- selected: !1
85
- };
86
- this.#e.audioTracks[C.add](o, t);
87
- }
88
- for (const a of r) {
89
- if (this.#h(s, a)) continue;
90
- const o = {
91
- id: a.trackId.toString(),
92
- src: a.trackContentId,
93
- label: a.name,
94
- language: a.language,
95
- kind: a.subtype.toLowerCase()
96
- };
97
- this.#e.textTracks.add(o, t);
98
- }
99
- }
100
- syncRemoteActiveIds(t) {
101
- if (!this.#t.isMediaLoaded) return;
102
- const e = this.#l(), s = new chrome.cast.media.EditTracksInfoRequest(e);
103
- this.#c(s).catch((i) => {
104
- });
105
- }
106
- #c(t) {
107
- const e = f();
108
- return new Promise((s, i) => e?.editTracksInfo(t, s, i));
109
- }
110
- #h(t, e) {
111
- return t.find((s) => this.#s(s, e));
112
- }
113
- #d(t, e) {
114
- return t.find((s) => this.#s(e, s));
115
- }
116
- // Note: we can't rely on id matching because they will differ between local/remote. A local
117
- // track id might not even exist.
118
- #s(t, e) {
119
- return e.name === t.label && e.language === t.language && e.subtype.toLowerCase() === t.kind.toLowerCase();
120
- }
121
- }
122
- class N {
123
- $$PROVIDER_TYPE = "GOOGLE_CAST";
124
- scope = g();
125
- #t;
126
- #e;
127
- #i;
128
- #a = null;
129
- #r = "disconnected";
130
- #l = 0;
131
- #o = 0;
132
- #c = new n(0, 0);
133
- #h = new E(this.#b.bind(this));
134
- #d;
135
- #s = null;
136
- #u = !1;
137
- constructor(t, e) {
138
- this.#t = t, this.#e = e, this.#i = new b(t, e, this.#G.bind(this));
139
- }
140
- get type() {
141
- return "google-cast";
142
- }
143
- get currentSrc() {
144
- return this.#a;
145
- }
146
- /**
147
- * The Google Cast remote player.
148
- *
149
- * @see {@link https://developers.google.com/cast/docs/reference/web_sender/cast.framework.RemotePlayer}
150
- */
151
- get player() {
152
- return this.#t;
153
- }
154
- /**
155
- * @see {@link https://developers.google.com/cast/docs/reference/web_sender/cast.framework.CastContext}
156
- */
157
- get cast() {
158
- return v();
159
- }
160
- /**
161
- * @see {@link https://developers.google.com/cast/docs/reference/web_sender/cast.framework.CastSession}
162
- */
163
- get session() {
164
- return L();
165
- }
166
- /**
167
- * @see {@link https://developers.google.com/cast/docs/reference/web_sender/chrome.cast.media.Media}
168
- */
169
- get media() {
170
- return f();
171
- }
172
- /**
173
- * Whether the current Google Cast session belongs to this provider.
174
- */
175
- get hasActiveSession() {
176
- return T(this.#a);
177
- }
178
- setup() {
179
- this.#L(), this.#S(), this.#i.setup(), this.#e.notify("provider-setup", this);
180
- }
181
- #L() {
182
- S(
183
- cast.framework.CastContextEventType.CAST_STATE_CHANGED,
184
- this.#f.bind(this)
185
- );
186
- }
187
- #S() {
188
- const t = cast.framework.RemotePlayerEventType, e = {
189
- [t.IS_CONNECTED_CHANGED]: this.#f,
190
- [t.IS_MEDIA_LOADED_CHANGED]: this.#g,
191
- [t.CAN_CONTROL_VOLUME_CHANGED]: this.#k,
192
- [t.CAN_SEEK_CHANGED]: this.#y,
193
- [t.DURATION_CHANGED]: this.#D,
194
- [t.IS_MUTED_CHANGED]: this.#p,
195
- [t.VOLUME_LEVEL_CHANGED]: this.#p,
196
- [t.IS_PAUSED_CHANGED]: this.#N,
197
- [t.LIVE_SEEKABLE_RANGE_CHANGED]: this.#C,
198
- [t.PLAYER_STATE_CHANGED]: this.#x
199
- };
200
- this.#d = e;
201
- const s = this.#R.bind(this);
202
- for (const i of l(e))
203
- this.#t.controller.addEventListener(i, s);
204
- k(() => {
205
- for (const i of l(e))
206
- this.#t.controller.removeEventListener(i, s);
207
- });
208
- }
209
- async play() {
210
- if (!(!this.#t.isPaused && !this.#u)) {
211
- if (this.#u) {
212
- await this.#v(!1, 0);
213
- return;
214
- }
215
- this.#t.controller?.playOrPause();
216
- }
217
- }
218
- async pause() {
219
- this.#t.isPaused || this.#t.controller?.playOrPause();
220
- }
221
- getMediaStatus(t) {
222
- return new Promise((e, s) => {
223
- this.media?.getStatus(t, e, s);
224
- });
225
- }
226
- setMuted(t) {
227
- (t && !this.#t.isMuted || !t && this.#t.isMuted) && this.#t.controller?.muteOrUnmute();
228
- }
229
- setCurrentTime(t) {
230
- this.#t.currentTime = t, this.#e.notify("seeking", t), this.#t.controller?.seek();
231
- }
232
- setVolume(t) {
233
- this.#t.volumeLevel = t, this.#t.controller?.setVolumeLevel();
234
- }
235
- async loadSource(t) {
236
- if (this.#s?.src !== t && (this.#s = null), T(t)) {
237
- this.#A(), this.#a = t;
238
- return;
239
- }
240
- this.#e.notify("load-start");
241
- const e = this.#_(t), s = await this.session.loadMedia(e);
242
- if (s) {
243
- this.#a = null, this.#e.notify("error", Error(A(s)));
244
- return;
245
- }
246
- this.#a = t;
247
- }
248
- destroy() {
249
- this.#m(), this.#T();
250
- }
251
- #m() {
252
- this.#s || (this.#o = 0, this.#c = new n(0, 0)), this.#h.stop(), this.#l = 0, this.#s = null;
253
- }
254
- #A() {
255
- const t = new u("resume-session", { detail: this.session });
256
- this.#g(t);
257
- const { muted: e, volume: s, savedState: i } = this.#e.$state, r = i();
258
- this.setCurrentTime(Math.max(this.#t.currentTime, r?.currentTime ?? 0)), this.setMuted(e()), this.setVolume(s()), r?.paused === !1 && this.play();
259
- }
260
- #T() {
261
- this.cast.endCurrentSession(!0);
262
- const { remotePlaybackLoader: t } = this.#e.$state;
263
- t.set(null);
264
- }
265
- #I() {
266
- const { savedState: t } = this.#e.$state;
267
- t.set({
268
- paused: this.#t.isPaused,
269
- currentTime: this.#t.currentTime
270
- }), this.#T();
271
- }
272
- #b() {
273
- this.#M();
274
- }
275
- #R(t) {
276
- this.#d[t.type].call(this, t);
277
- }
278
- #f(t) {
279
- const e = this.cast.getCastState(), s = e === cast.framework.CastState.CONNECTED ? "connected" : e === cast.framework.CastState.CONNECTING ? "connecting" : "disconnected";
280
- if (this.#r === s) return;
281
- const i = { type: "google-cast", state: s }, r = this.#n(t);
282
- this.#r = s, this.#e.notify("remote-playback-change", i, r), s === "disconnected" && this.#I();
283
- }
284
- #g(t) {
285
- if (!!!this.#t.isMediaLoaded) return;
286
- const s = h(this.#e.$state.source);
287
- Promise.resolve().then(() => {
288
- if (s !== h(this.#e.$state.source) || !this.#t.isMediaLoaded) return;
289
- this.#m();
290
- const i = this.#t.duration;
291
- this.#c = new n(0, i);
292
- const r = {
293
- provider: this,
294
- duration: i,
295
- buffered: new n(0, 0),
296
- seekable: this.#E()
297
- }, a = this.#n(t);
298
- this.#e.notify("loaded-metadata", void 0, a), this.#e.notify("loaded-data", void 0, a), this.#e.notify("can-play", r, a), this.#k(), this.#y(t);
299
- const { volume: c, muted: o } = this.#e.$state;
300
- this.setVolume(c()), this.setMuted(o()), this.#h.start(), this.#i.syncRemoteTracks(a), this.#i.syncRemoteActiveIds(a);
301
- });
302
- }
303
- #k() {
304
- this.#e.$state.canSetVolume.set(this.#t.canControlVolume);
305
- }
306
- #y(t) {
307
- const e = this.#n(t);
308
- this.#e.notify("stream-type-change", this.#w(), e);
309
- }
310
- #w() {
311
- return this.#t.mediaInfo?.streamType === chrome.cast.media.StreamType.LIVE ? this.#t.canSeek ? "live:dvr" : "live" : "on-demand";
312
- }
313
- #M() {
314
- if (this.#s) return;
315
- const t = this.#t.currentTime;
316
- t !== this.#l && (this.#e.notify("time-change", t), t > this.#o && (this.#o = t, this.#C()), this.#e.$state.seeking() && this.#e.notify("seeked", t), this.#l = t);
317
- }
318
- #D(t) {
319
- if (!this.#t.isMediaLoaded || this.#s) return;
320
- const e = this.#t.duration, s = this.#n(t);
321
- this.#c = new n(0, e), this.#e.notify("duration-change", e, s);
322
- }
323
- #p(t) {
324
- if (!this.#t.isMediaLoaded) return;
325
- const e = {
326
- muted: this.#t.isMuted,
327
- volume: this.#t.volumeLevel
328
- }, s = this.#n(t);
329
- this.#e.notify("volume-change", e, s);
330
- }
331
- #N(t) {
332
- const e = this.#n(t);
333
- this.#t.isPaused ? this.#e.notify("pause", void 0, e) : this.#e.notify("play", void 0, e);
334
- }
335
- #C(t) {
336
- const e = {
337
- seekable: this.#E(),
338
- buffered: new n(0, this.#o)
339
- }, s = t ? this.#n(t) : void 0;
340
- this.#e.notify("progress", e, s);
341
- }
342
- #x(t) {
343
- const e = this.#t.playerState, s = chrome.cast.media.PlayerState;
344
- if (this.#u = e === s.IDLE, e === s.PAUSED) return;
345
- const i = this.#n(t);
346
- switch (e) {
347
- case s.PLAYING:
348
- this.#e.notify("playing", void 0, i);
349
- break;
350
- case s.BUFFERING:
351
- this.#e.notify("waiting", void 0, i);
352
- break;
353
- case s.IDLE:
354
- this.#h.stop(), this.#e.notify("pause"), this.#e.notify("end");
355
- break;
356
- }
357
- }
358
- #E() {
359
- return this.#t.liveSeekableRange ? new n(this.#t.liveSeekableRange.start, this.#t.liveSeekableRange.end) : this.#c;
360
- }
361
- #n(t) {
362
- return t instanceof Event ? t : new u(t.type, { detail: t });
363
- }
364
- #P(t) {
365
- const { streamType: e, title: s, poster: i } = this.#e.$state;
366
- return new I(t).setMetadata(s(), i()).setStreamType(e()).setTracks(this.#i.getLocalTextTracks()).build();
367
- }
368
- #_(t) {
369
- const e = this.#P(t), s = new chrome.cast.media.LoadRequest(e), i = this.#e.$state.savedState();
370
- return s.autoplay = (this.#s?.paused ?? i?.paused) === !1, s.currentTime = this.#s?.time ?? i?.currentTime ?? 0, s;
371
- }
372
- async #v(t, e) {
373
- const s = h(this.#e.$state.source);
374
- this.#s = { src: s, paused: t, time: e }, await this.loadSource(s);
375
- }
376
- #G() {
377
- this.#v(this.#t.isPaused, this.#t.currentTime).catch((t) => {
378
- });
379
- }
380
- }
381
- export {
382
- N as GoogleCastProvider
383
- };
@@ -1,310 +0,0 @@
1
- import { p as S, Q as v, T as E, b as y, L as u, d as b, l as T } from "./wt-vidstack-player-CTWna35Q.js";
2
- import { H as m, d as l, x as f, l as g, m as k, D as d, B as w, R as x, b as L, j as D } from "./useVidstackSrc-MfWBq7Ef.js";
3
- import { VideoProvider as C } from "./vidstack-video-Bxf7KDne.js";
4
- import { R as H } from "./vidstack-DqAw8m9J-C2p9K7Db.js";
5
- const I = (r) => w(r);
6
- class A {
7
- #e;
8
- #t;
9
- #i = null;
10
- #n = null;
11
- config = {};
12
- #r = /* @__PURE__ */ new Set();
13
- get instance() {
14
- return this.#i;
15
- }
16
- constructor(t, i) {
17
- this.#e = t, this.#t = i;
18
- }
19
- setup(t) {
20
- const { streamType: i } = this.#t.$state, e = f(i).includes("live"), s = f(i).includes("ll-");
21
- this.#i = new t({
22
- lowLatencyMode: s,
23
- backBufferLength: s ? 4 : e ? 8 : void 0,
24
- renderTextTracksNatively: !1,
25
- ...this.config
26
- });
27
- const o = this.#h.bind(this);
28
- for (const n of Object.values(t.Events)) this.#i.on(n, o);
29
- this.#i.on(t.Events.ERROR, this.#v.bind(this));
30
- for (const n of this.#r) n(this.#i);
31
- this.#t.player.dispatch("hls-instance", {
32
- detail: this.#i
33
- }), this.#i.attachMedia(this.#e), this.#i.on(t.Events.AUDIO_TRACK_SWITCHED, this.#l.bind(this)), this.#i.on(t.Events.LEVEL_SWITCHED, this.#u.bind(this)), this.#i.on(t.Events.LEVEL_LOADED, this.#f.bind(this)), this.#i.on(t.Events.LEVEL_UPDATED, this.#p.bind(this)), this.#i.on(t.Events.NON_NATIVE_TEXT_TRACKS_FOUND, this.#c.bind(this)), this.#i.on(t.Events.CUES_PARSED, this.#d.bind(this)), this.#t.qualities[v.enableAuto] = this.#g.bind(this), g(this.#t.qualities, "change", this.#L.bind(this)), g(this.#t.audioTracks, "change", this.#S.bind(this)), this.#n = k(this.#o.bind(this));
34
- }
35
- #s(t, i) {
36
- return new d(I(t), { detail: i });
37
- }
38
- #o() {
39
- if (!this.#t.$state.live()) return;
40
- const t = new H(this.#a.bind(this));
41
- return t.start(), t.stop.bind(t);
42
- }
43
- #a() {
44
- this.#t.$state.liveSyncPosition.set(this.#i?.liveSyncPosition ?? 1 / 0);
45
- }
46
- #h(t, i) {
47
- this.#t.player?.dispatch(this.#s(t, i));
48
- }
49
- #c(t, i) {
50
- const e = this.#s(t, i);
51
- let s = -1;
52
- for (let o = 0; o < i.tracks.length; o++) {
53
- const n = i.tracks[o], h = n.subtitleTrack ?? n.closedCaptions, c = new E({
54
- id: `hls-${n.kind}-${o}`,
55
- src: h?.url,
56
- label: n.label,
57
- language: h?.lang,
58
- kind: n.kind,
59
- default: n.default
60
- });
61
- c[y.readyState] = 2, c[y.onModeChange] = () => {
62
- c.mode === "showing" ? (this.#i.subtitleTrack = o, s = o) : s === o && (this.#i.subtitleTrack = -1, s = -1);
63
- }, this.#t.textTracks.add(c, e);
64
- }
65
- }
66
- #d(t, i) {
67
- const e = this.#i?.subtitleTrack, s = this.#t.textTracks.getById(`hls-${i.type}-${e}`);
68
- if (!s) return;
69
- const o = this.#s(t, i);
70
- for (const n of i.cues)
71
- n.positionAlign = "auto", s.addCue(n, o);
72
- }
73
- #l(t, i) {
74
- const e = this.#t.audioTracks[i.id];
75
- if (e) {
76
- const s = this.#s(t, i);
77
- this.#t.audioTracks[u.select](e, !0, s);
78
- }
79
- }
80
- #u(t, i) {
81
- const e = this.#t.qualities[i.level];
82
- if (e) {
83
- const s = this.#s(t, i);
84
- this.#t.qualities[u.select](e, !0, s);
85
- }
86
- }
87
- #p(t, i) {
88
- i.details.totalduration > 0 && this.#t.$state.inferredLiveDVRWindow.set(i.details.totalduration);
89
- }
90
- #f(t, i) {
91
- if (this.#t.$state.canPlay()) return;
92
- const { type: e, live: s, totalduration: o, targetduration: n } = i.details, h = this.#s(t, i);
93
- this.#t.notify(
94
- "stream-type-change",
95
- s ? e === "EVENT" && Number.isFinite(o) && n >= 10 ? "live:dvr" : "live" : "on-demand",
96
- h
97
- ), this.#t.notify("duration-change", o, h);
98
- const c = this.#i.media;
99
- this.#i.currentLevel === -1 && this.#t.qualities[v.setAuto](!0, h);
100
- for (const a of this.#i.audioTracks) {
101
- const p = {
102
- id: a.id.toString(),
103
- label: a.name,
104
- language: a.lang || "",
105
- kind: "main"
106
- };
107
- this.#t.audioTracks[u.add](p, h);
108
- }
109
- for (const a of this.#i.levels) {
110
- const p = {
111
- id: a.id?.toString() ?? a.height + "p",
112
- width: a.width,
113
- height: a.height,
114
- codec: a.codecSet,
115
- bitrate: a.bitrate
116
- };
117
- this.#t.qualities[u.add](p, h);
118
- }
119
- c.dispatchEvent(new d("canplay", { trigger: h }));
120
- }
121
- #v(t, i) {
122
- i.fatal && (i.type === "mediaError" ? this.#i?.recoverMediaError() : this.#y(i.error));
123
- }
124
- #y(t) {
125
- this.#t.notify("error", {
126
- message: t.message,
127
- code: 1,
128
- error: t
129
- });
130
- }
131
- #g() {
132
- this.#i && (this.#i.currentLevel = -1);
133
- }
134
- #L() {
135
- const { qualities: t } = this.#t;
136
- !this.#i || t.auto || (this.#i[t.switch + "Level"] = t.selectedIndex, x && (this.#e.currentTime = this.#e.currentTime));
137
- }
138
- #S() {
139
- const { audioTracks: t } = this.#t;
140
- this.#i && this.#i.audioTrack !== t.selectedIndex && (this.#i.audioTrack = t.selectedIndex);
141
- }
142
- onInstance(t) {
143
- return this.#r.add(t), () => this.#r.delete(t);
144
- }
145
- loadSource(t) {
146
- l(t.src) && this.#i?.loadSource(t.src);
147
- }
148
- destroy() {
149
- this.#i?.destroy(), this.#i = null, this.#n?.(), this.#n = null;
150
- }
151
- }
152
- class R {
153
- #e;
154
- #t;
155
- #i;
156
- constructor(t, i, e) {
157
- this.#e = t, this.#t = i, this.#i = e, this.#n();
158
- }
159
- async #n() {
160
- const t = {
161
- onLoadStart: this.#r.bind(this),
162
- onLoaded: this.#s.bind(this),
163
- onLoadError: this.#o.bind(this)
164
- };
165
- let i = await $(this.#e, t);
166
- if (L(i) && !l(this.#e) && (i = await _(this.#e, t)), !i) return null;
167
- if (!i.isSupported()) {
168
- const e = "[vidstack] `hls.js` is not supported in this environment";
169
- return this.#t.player.dispatch(new d("hls-unsupported")), this.#t.notify("error", { message: e, code: 4 }), null;
170
- }
171
- return i;
172
- }
173
- #r() {
174
- this.#t.player.dispatch(new d("hls-lib-load-start"));
175
- }
176
- #s(t) {
177
- this.#t.player.dispatch(
178
- new d("hls-lib-loaded", {
179
- detail: t
180
- })
181
- ), this.#i(t);
182
- }
183
- #o(t) {
184
- const i = b(t);
185
- this.#t.player.dispatch(
186
- new d("hls-lib-load-error", {
187
- detail: i
188
- })
189
- ), this.#t.notify("error", {
190
- message: i.message,
191
- code: 4,
192
- error: i
193
- });
194
- }
195
- }
196
- async function _(r, t = {}) {
197
- if (!L(r)) {
198
- if (t.onLoadStart?.(), r.prototype && r.prototype !== Function)
199
- return t.onLoaded?.(r), r;
200
- try {
201
- const i = (await r())?.default;
202
- if (i && i.isSupported)
203
- t.onLoaded?.(i);
204
- else
205
- throw Error(
206
- ""
207
- );
208
- return i;
209
- } catch (i) {
210
- t.onLoadError?.(i);
211
- }
212
- }
213
- }
214
- async function $(r, t = {}) {
215
- if (l(r)) {
216
- t.onLoadStart?.();
217
- try {
218
- if (await T(r), !D(window.Hls))
219
- throw Error(
220
- ""
221
- );
222
- const i = window.Hls;
223
- return t.onLoaded?.(i), i;
224
- } catch (i) {
225
- t.onLoadError?.(i);
226
- }
227
- }
228
- }
229
- const O = "https://cdn.jsdelivr.net";
230
- class q extends C {
231
- $$PROVIDER_TYPE = "HLS";
232
- #e = null;
233
- #t = new A(this.video, this.ctx);
234
- /**
235
- * The `hls.js` constructor.
236
- */
237
- get ctor() {
238
- return this.#e;
239
- }
240
- /**
241
- * The current `hls.js` instance.
242
- */
243
- get instance() {
244
- return this.#t.instance;
245
- }
246
- /**
247
- * Whether `hls.js` is supported in this environment.
248
- */
249
- static supported = m();
250
- get type() {
251
- return "hls";
252
- }
253
- get canLiveSync() {
254
- return !0;
255
- }
256
- #i = `${O}/npm/hls.js@^1.5.0/dist/hls.min.js`;
257
- /**
258
- * The `hls.js` configuration object.
259
- *
260
- * @see {@link https://github.com/video-dev/hls.js/blob/master/docs/API.md#fine-tuning}
261
- */
262
- get config() {
263
- return this.#t.config;
264
- }
265
- set config(t) {
266
- this.#t.config = t;
267
- }
268
- /**
269
- * The `hls.js` constructor (supports dynamic imports) or a URL of where it can be found.
270
- *
271
- * @defaultValue `https://cdn.jsdelivr.net/npm/hls.js@^1.0.0/dist/hls.min.js`
272
- */
273
- get library() {
274
- return this.#i;
275
- }
276
- set library(t) {
277
- this.#i = t;
278
- }
279
- preconnect() {
280
- l(this.#i) && S(this.#i);
281
- }
282
- setup() {
283
- super.setup(), new R(this.#i, this.ctx, (t) => {
284
- this.#e = t, this.#t.setup(t), this.ctx.notify("provider-setup", this);
285
- const i = f(this.ctx.$state.source);
286
- i && this.loadSource(i);
287
- });
288
- }
289
- async loadSource(t, i) {
290
- if (!l(t.src)) {
291
- this.removeSource();
292
- return;
293
- }
294
- this.media.preload = i || "", this.appendSource(t, "application/x-mpegurl"), this.#t.loadSource(t), this.currentSrc = t;
295
- }
296
- /**
297
- * The given callback is invoked when a new `hls.js` instance is created and right before it's
298
- * attached to media.
299
- */
300
- onInstance(t) {
301
- const i = this.#t.instance;
302
- return i && t(i), this.#t.onInstance(t);
303
- }
304
- destroy() {
305
- this.#t.destroy();
306
- }
307
- }
308
- export {
309
- q as HLSProvider
310
- };
@@ -1,28 +0,0 @@
1
- const p = /(?:https:\/\/)?(?:player\.)?vimeo(?:\.com)?\/(?:video\/)?(\d+)(?:(?:\?hash=|\?h=|\/)(.*))?/, c = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
2
- function u(e) {
3
- const n = e.match(p);
4
- return { videoId: n?.[1], hash: n?.[2] };
5
- }
6
- async function f(e, n, s) {
7
- if (c.has(e)) return c.get(e);
8
- if (o.has(e)) return o.get(e);
9
- let i = `https://vimeo.com/api/oembed.json?url=https://player.vimeo.com/video/${e}`;
10
- s && (i = i.concat(`?h=${s}`));
11
- const r = window.fetch(i, {
12
- mode: "cors",
13
- signal: n.signal
14
- }).then((t) => t.json()).then((t) => {
15
- const a = /vimeocdn.com\/video\/(.*)?_/, h = t?.thumbnail_url?.match(a)?.[1], l = h ? `https://i.vimeocdn.com/video/${h}_1920x1080.webp` : "", m = {
16
- title: t?.title ?? "",
17
- duration: t?.duration ?? 0,
18
- poster: l,
19
- pro: t.account_type !== "basic"
20
- };
21
- return c.set(e, m), m;
22
- }).finally(() => o.delete(e));
23
- return o.set(e, r), r;
24
- }
25
- export {
26
- f as getVimeoVideoInfo,
27
- u as resolveVimeoVideoId
28
- };