@webitel/ui-sdk 26.6.34 → 26.6.36

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 (182) 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-DFOWyAAb.js +5395 -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 +34567 -4
  30. package/dist/ui-sdk.umd.cjs +7748 -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-D3SBme6f.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-DagfTTIq.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-CltYZA9D.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-028o8xRF.js +104 -0
  105. package/dist/wt-vidstack-player-B-WSB_Be.js +7440 -0
  106. package/package.json +5 -5
  107. package/src/components/wt-multi-select/wt-multi-select.vue +3 -0
  108. package/src/components/wt-single-select/wt-single-select.vue +5 -0
  109. package/src/components/wt-table-column-select/__tests__/WtTableColumnSelect.spec.js +3 -3
  110. package/src/plugins/primevue/theme/components/multi-select/multi-select.js +4 -0
  111. package/src/plugins/primevue/theme/components/single-select/single-select.js +4 -0
  112. package/types/plugins/primevue/theme/components/multi-select/multi-select.d.ts +2 -0
  113. package/types/plugins/primevue/theme/components/single-select/single-select.d.ts +2 -0
  114. package/dist/contacts-DzLKP4GQ.js +0 -49654
  115. package/dist/displayText-Cbh4IOfM.js +0 -5
  116. package/dist/engineCallFileType-yaadA7-2.js +0 -8
  117. package/dist/errors-CTL-RV3B.js +0 -70
  118. package/dist/index-BgLoxAyu.js +0 -50
  119. package/dist/install-Cm-8fwtB.js +0 -53489
  120. package/dist/isObject-BSIwu4UO.js +0 -28
  121. package/dist/prod-BoQuiIB3.js +0 -973
  122. package/dist/srt-parser-CsN7bp5E.js +0 -26
  123. package/dist/ssa-parser-BJOOPeQF.js +0 -200
  124. package/dist/useExpansion-BrQ40HiR.js +0 -24
  125. package/dist/useVidstackSrc-DKXY5f7v.js +0 -1341
  126. package/dist/vidstack-Bq6c3Bam-BHF-0bv4.js +0 -426
  127. package/dist/vidstack-D2pY00kU-B8Mhvp0m.js +0 -136
  128. package/dist/vidstack-DDXt6fpN-D0eou9h7.js +0 -51
  129. package/dist/vidstack-D_-9AA6_-DYAfclN7.js +0 -21
  130. package/dist/vidstack-Dm1xEU9Q-CXHNvShT.js +0 -30
  131. package/dist/vidstack-DqAw8m9J-b5BHkhrw.js +0 -22
  132. package/dist/vidstack-audio-CPu_TbjK.js +0 -28
  133. package/dist/vidstack-dash-VYriMjws.js +0 -393
  134. package/dist/vidstack-google-cast-Byp1cemB.js +0 -383
  135. package/dist/vidstack-hls-DdUQcmEx.js +0 -310
  136. package/dist/vidstack-krOAtKMi-C50BTxmn.js +0 -28
  137. package/dist/vidstack-video-BpSKQ3wb.js +0 -164
  138. package/dist/vidstack-vimeo-CgVJJm06.js +0 -452
  139. package/dist/vidstack-youtube-DuES80MV.js +0 -233
  140. package/dist/wt-action-bar-TMuck-q1.js +0 -102
  141. package/dist/wt-button-select-D1NP5Xw9.js +0 -105
  142. package/dist/wt-call-media-action-BsepfSVy.js +0 -60
  143. package/dist/wt-chat-emoji-B00dUXbP.js +0 -2909
  144. package/dist/wt-confirm-dialog-1hO851Da.js +0 -92
  145. package/dist/wt-context-menu-BrzRmoDw.js +0 -104
  146. package/dist/wt-copy-action-CEMOiYzN.js +0 -60
  147. package/dist/wt-datepicker-DHqZIkg2.js +0 -5660
  148. package/dist/wt-display-chip-items-D7kEAcOo.js +0 -47
  149. package/dist/wt-dual-panel-DEWR3-k-.js +0 -66
  150. package/dist/wt-dummy-DfgxciHw.js +0 -104
  151. package/dist/wt-error-page-DUSVxkXq.js +0 -89
  152. package/dist/wt-expansion-card-B8JKBMLa.js +0 -56
  153. package/dist/wt-expansion-panel-DL3eoj_b.js +0 -54
  154. package/dist/wt-filters-panel-wrapper-CGXQiRvh.js +0 -75
  155. package/dist/wt-galleria-Bahv6Mgq.js +0 -323
  156. package/dist/wt-inline-add-panel-B4RjHVDI.js +0 -49
  157. package/dist/wt-navigation-menu-DqCXAV8E.js +0 -159
  158. package/dist/wt-notifications-bar-CRIKdVai.js +0 -79
  159. package/dist/wt-page-header-DdsnoLgd.js +0 -115
  160. package/dist/wt-pagination-C_b3WmH1.js +0 -144
  161. package/dist/wt-player-B4GWEqdu.js +0 -291
  162. package/dist/wt-popover-Di-7_rDL.js +0 -4
  163. package/dist/wt-popover.vue_vue_type_style_index_0_lang-DMDTlCgv.js +0 -81
  164. package/dist/wt-screen-recordings-action-B4OpN5kl.js +0 -54
  165. package/dist/wt-search-bar-B_0_YwCn.js +0 -144
  166. package/dist/wt-selection-popup-Boyw9_V_.js +0 -109
  167. package/dist/wt-send-message-popup-0C23Zocu.js +0 -579
  168. package/dist/wt-slider-BEkw4KGp.js +0 -4
  169. package/dist/wt-slider.vue_vue_type_script_setup_true_lang-DlaRDHxo.js +0 -55
  170. package/dist/wt-start-page-HQMIG05a.js +0 -99
  171. package/dist/wt-status-select-H_me1xwA.js +0 -138
  172. package/dist/wt-stepper-hJxqyiyo.js +0 -65
  173. package/dist/wt-table-Du6mtkPw.js +0 -426
  174. package/dist/wt-table-actions-ah_H6LY9.js +0 -79
  175. package/dist/wt-table-column-select-C2Nbic5-.js +0 -128
  176. package/dist/wt-tabs-D4aGEd_t.js +0 -74
  177. package/dist/wt-time-input-DYiW0ijt.js +0 -42
  178. package/dist/wt-timepicker-BE8POMhF.js +0 -118
  179. package/dist/wt-tree-table-BJxaXqKl.js +0 -285
  180. package/dist/wt-tree-u0Zp8nb5.js +0 -2777
  181. package/dist/wt-type-extension-value-input-C1VlNa4K.js +0 -121
  182. package/dist/wt-vidstack-player-C1eyCEzP.js +0 -9094
@@ -1,164 +0,0 @@
1
- import { s as l, an as o, ao as u, ap as p, o as h, l as P, D as f, n as g } from "./useVidstackSrc-DKXY5f7v.js";
2
- import { H as k, a as m } from "./vidstack-Bq6c3Bam-BHF-0bv4.js";
3
- import { T as x, b as n } from "./wt-vidstack-player-C1eyCEzP.js";
4
- class T {
5
- #t;
6
- #i;
7
- constructor(t, e) {
8
- this.#t = t, this.#i = e, t.textTracks.onaddtrack = this.#e.bind(this), h(this.#s.bind(this));
9
- }
10
- #e(t) {
11
- const e = t.track;
12
- if (!e || y(this.#t, e)) return;
13
- const i = new x({
14
- id: e.id,
15
- kind: e.kind,
16
- label: e.label ?? "",
17
- language: e.language,
18
- type: "vtt"
19
- });
20
- i[n.native] = { track: e }, i[n.readyState] = 2, i[n.nativeHLS] = !0;
21
- let a = 0;
22
- const c = (d) => {
23
- if (e.cues)
24
- for (let r = a; r < e.cues.length; r++)
25
- i.addCue(e.cues[r], d), a++;
26
- };
27
- c(t), e.oncuechange = c, this.#i.textTracks.add(i, t), i.setMode(e.mode, t);
28
- }
29
- #s() {
30
- this.#t.textTracks.onaddtrack = null;
31
- for (const t of this.#i.textTracks) {
32
- const e = t[n.native]?.track;
33
- e?.oncuechange && (e.oncuechange = null);
34
- }
35
- }
36
- }
37
- function y(s, t) {
38
- return Array.from(s.children).find((e) => e.track === t);
39
- }
40
- class v {
41
- #t;
42
- #i;
43
- constructor(t, e) {
44
- this.#t = t, this.#i = e, new g(t).add("enterpictureinpicture", this.#e.bind(this)).add("leavepictureinpicture", this.#s.bind(this));
45
- }
46
- get active() {
47
- return document.pictureInPictureElement === this.#t;
48
- }
49
- get supported() {
50
- return u(this.#t);
51
- }
52
- async enter() {
53
- return this.#t.requestPictureInPicture();
54
- }
55
- exit() {
56
- return document.exitPictureInPicture();
57
- }
58
- #e(t) {
59
- this.#n(!0, t);
60
- }
61
- #s(t) {
62
- this.#n(!1, t);
63
- }
64
- #n = (t, e) => {
65
- this.#i.notify("picture-in-picture-change", t, e);
66
- };
67
- }
68
- class M {
69
- #t;
70
- #i;
71
- #e = "inline";
72
- get mode() {
73
- return this.#e;
74
- }
75
- constructor(t, e) {
76
- this.#t = t, this.#i = e, P(t, "webkitpresentationmodechanged", this.#s.bind(this));
77
- }
78
- get supported() {
79
- return o(this.#t);
80
- }
81
- async setPresentationMode(t) {
82
- this.#e !== t && this.#t.webkitSetPresentationMode(t);
83
- }
84
- #s(t) {
85
- const e = this.#e;
86
- this.#e = this.#t.webkitPresentationMode, this.#i.player?.dispatch(
87
- new f("video-presentation-change", {
88
- detail: this.#e,
89
- trigger: t
90
- })
91
- ), ["fullscreen", "picture-in-picture"].forEach((i) => {
92
- (this.#e === i || e === i) && this.#i.notify(`${i}-change`, this.#e === i, t);
93
- });
94
- }
95
- }
96
- class b {
97
- #t;
98
- get active() {
99
- return this.#t.mode === "fullscreen";
100
- }
101
- get supported() {
102
- return this.#t.supported;
103
- }
104
- constructor(t) {
105
- this.#t = t;
106
- }
107
- async enter() {
108
- this.#t.setPresentationMode("fullscreen");
109
- }
110
- async exit() {
111
- this.#t.setPresentationMode("inline");
112
- }
113
- }
114
- class w {
115
- #t;
116
- get active() {
117
- return this.#t.mode === "picture-in-picture";
118
- }
119
- get supported() {
120
- return this.#t.supported;
121
- }
122
- constructor(t) {
123
- this.#t = t;
124
- }
125
- async enter() {
126
- this.#t.setPresentationMode("picture-in-picture");
127
- }
128
- async exit() {
129
- this.#t.setPresentationMode("inline");
130
- }
131
- }
132
- class A extends k {
133
- $$PROVIDER_TYPE = "VIDEO";
134
- get type() {
135
- return "video";
136
- }
137
- airPlay;
138
- fullscreen;
139
- pictureInPicture;
140
- constructor(t, e) {
141
- super(t, e), l(() => {
142
- if (this.airPlay = new m(t, e), o(t)) {
143
- const i = new M(t, e);
144
- this.fullscreen = new b(i), this.pictureInPicture = new w(i);
145
- } else u(t) && (this.pictureInPicture = new v(t, e));
146
- }, this.scope);
147
- }
148
- setup() {
149
- super.setup(), p(this.video) && new T(this.video, this.ctx), this.ctx.textRenderers.attachVideo(this.video), h(() => {
150
- this.ctx.textRenderers.attachVideo(null);
151
- }), this.type === "video" && this.ctx.notify("provider-setup", this);
152
- }
153
- /**
154
- * The native HTML `<video>` element.
155
- *
156
- * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement}
157
- */
158
- get video() {
159
- return this.media;
160
- }
161
- }
162
- export {
163
- A as VideoProvider
164
- };
@@ -1,452 +0,0 @@
1
- import { ab as y, v as u, m as c, x as l, d as b, f as d, l as v, i as k } from "./useVidstackSrc-DKXY5f7v.js";
2
- import { e as o, p as m, L as r, T as w, Q as f } from "./wt-vidstack-player-C1eyCEzP.js";
3
- import { R as P } from "./vidstack-DqAw8m9J-b5BHkhrw.js";
4
- import { E as T } from "./vidstack-DDXt6fpN-D0eou9h7.js";
5
- import { resolveVimeoVideoId as C, getVimeoVideoInfo as g } from "./vidstack-krOAtKMi-C50BTxmn.js";
6
- const $ = [
7
- "bufferend",
8
- "bufferstart",
9
- // 'cuechange',
10
- "durationchange",
11
- "ended",
12
- "enterpictureinpicture",
13
- "error",
14
- "fullscreenchange",
15
- "leavepictureinpicture",
16
- "loaded",
17
- // 'loadeddata',
18
- // 'loadedmetadata',
19
- // 'loadstart',
20
- "playProgress",
21
- "loadProgress",
22
- "pause",
23
- "play",
24
- "playbackratechange",
25
- // 'progress',
26
- "qualitychange",
27
- "seeked",
28
- "seeking",
29
- // 'texttrackchange',
30
- "timeupdate",
31
- "volumechange",
32
- "waiting"
33
- // 'adstarted',
34
- // 'adcompleted',
35
- // 'aderror',
36
- // 'adskipped',
37
- // 'adallcompleted',
38
- // 'adclicked',
39
- // 'chapterchange',
40
- // 'chromecastconnected',
41
- // 'remoteplaybackavailabilitychange',
42
- // 'remoteplaybackconnecting',
43
- // 'remoteplaybackconnect',
44
- // 'remoteplaybackdisconnect',
45
- // 'liveeventended',
46
- // 'liveeventstarted',
47
- // 'livestreamoffline',
48
- // 'livestreamonline',
49
- ];
50
- class M extends T {
51
- $$PROVIDER_TYPE = "VIMEO";
52
- scope = y();
53
- fullscreen;
54
- #e;
55
- #s = u("");
56
- #i = u(!1);
57
- #o = null;
58
- #c = null;
59
- #d = !1;
60
- #n = new o(0, 0);
61
- #l = new P(this.#g.bind(this));
62
- #w = null;
63
- #r = null;
64
- #a = /* @__PURE__ */ new Map();
65
- #u = null;
66
- constructor(e, t) {
67
- super(e), this.#e = t;
68
- const s = this;
69
- this.fullscreen = {
70
- get active() {
71
- return s.#d;
72
- },
73
- supported: !0,
74
- enter: () => this.#t("requestFullscreen"),
75
- exit: () => this.#t("exitFullscreen")
76
- };
77
- }
78
- /**
79
- * Whether tracking session data should be enabled on the embed, including cookies and analytics.
80
- * This is turned off by default to be GDPR-compliant.
81
- *
82
- * @defaultValue `false`
83
- */
84
- cookies = !1;
85
- title = !0;
86
- byline = !0;
87
- portrait = !0;
88
- color = "00ADEF";
89
- get type() {
90
- return "vimeo";
91
- }
92
- get currentSrc() {
93
- return this.#c;
94
- }
95
- get videoId() {
96
- return this.#s();
97
- }
98
- get hash() {
99
- return this.#o;
100
- }
101
- get isPro() {
102
- return this.#i();
103
- }
104
- preconnect() {
105
- m(this.getOrigin());
106
- }
107
- setup() {
108
- super.setup(), c(this.#P.bind(this)), c(this.#T.bind(this)), c(this.#C.bind(this)), this.#e.notify("provider-setup", this);
109
- }
110
- destroy() {
111
- this.#k(), this.fullscreen = void 0;
112
- const e = "provider destroyed";
113
- for (const t of this.#a.values())
114
- for (const { reject: s } of t) s(e);
115
- this.#a.clear(), this.#t("destroy");
116
- }
117
- async play() {
118
- return this.#t("play");
119
- }
120
- async pause() {
121
- return this.#t("pause");
122
- }
123
- setMuted(e) {
124
- this.#t("setMuted", e);
125
- }
126
- setCurrentTime(e) {
127
- this.#t("seekTo", e), this.#e.notify("seeking", e);
128
- }
129
- setVolume(e) {
130
- this.#t("setVolume", e), this.#t("setMuted", l(this.#e.$state.muted));
131
- }
132
- setPlaybackRate(e) {
133
- this.#t("setPlaybackRate", e);
134
- }
135
- async loadSource(e) {
136
- if (!b(e.src)) {
137
- this.#c = null, this.#o = null, this.#s.set("");
138
- return;
139
- }
140
- const { videoId: t, hash: s } = C(e.src);
141
- this.#s.set(t ?? ""), this.#o = s ?? null, this.#c = e;
142
- }
143
- #P() {
144
- this.#k();
145
- const e = this.#s();
146
- if (!e) {
147
- this.src.set("");
148
- return;
149
- }
150
- this.src.set(`${this.getOrigin()}/video/${e}`), this.#e.notify("load-start");
151
- }
152
- #T() {
153
- const e = this.#s();
154
- if (!e) return;
155
- const t = d(), s = new AbortController();
156
- return this.#u = t, g(e, s, this.#o).then((i) => {
157
- t.resolve(i);
158
- }).catch((i) => {
159
- t.reject();
160
- }), () => {
161
- t.reject(), s.abort();
162
- };
163
- }
164
- #C() {
165
- const e = this.#i(), { $state: t, qualities: s } = this.#e;
166
- if (t.canSetPlaybackRate.set(e), s[r.setReadonly](!e), e)
167
- return v(s, "change", () => {
168
- if (s.auto) return;
169
- const i = s.selected?.id;
170
- i && this.#t("setQuality", i);
171
- });
172
- }
173
- getOrigin() {
174
- return "https://player.vimeo.com";
175
- }
176
- buildParams() {
177
- const { keyDisabled: e } = this.#e.$props, { playsInline: t, nativeControls: s } = this.#e.$state, i = s();
178
- return {
179
- title: this.title,
180
- byline: this.byline,
181
- color: this.color,
182
- portrait: this.portrait,
183
- controls: i,
184
- h: this.hash,
185
- keyboard: i && !e(),
186
- transparent: !0,
187
- playsinline: t(),
188
- dnt: !this.cookies
189
- };
190
- }
191
- #g() {
192
- this.#t("getCurrentTime");
193
- }
194
- // Embed will sometimes dispatch 0 at end of playback.
195
- #h = !1;
196
- #$(e, t) {
197
- if (this.#h && e === 0) return;
198
- const { realCurrentTime: s, paused: i, bufferedEnd: n, seekableEnd: a, live: h } = this.#e.$state;
199
- if (s() === e) return;
200
- const p = s();
201
- this.#e.notify("time-change", e, t), Math.abs(p - e) > 1.5 && (this.#e.notify("seeking", e, t), !i() && n() < e && this.#e.notify("waiting", void 0, t)), !h() && a() - e < 0.01 && (this.#e.notify("end", void 0, t), this.#h = !0, setTimeout(() => {
202
- this.#h = !1;
203
- }, 500));
204
- }
205
- #E(e, t) {
206
- this.#e.notify("seeked", e, t);
207
- }
208
- #V(e) {
209
- const t = this.#s();
210
- this.#u?.promise.then((s) => {
211
- if (!s) return;
212
- const { title: i, poster: n, duration: a, pro: h } = s;
213
- this.#i.set(h), this.#e.notify("title-change", i, e), this.#e.notify("poster-change", n, e), this.#e.notify("duration-change", a, e), this.#f(a, e);
214
- }).catch(() => {
215
- t === this.#s() && (this.#t("getVideoTitle"), this.#t("getDuration"));
216
- });
217
- }
218
- #f(e, t) {
219
- const { nativeControls: s } = this.#e.$state, i = s();
220
- this.#n = new o(0, e);
221
- const n = {
222
- buffered: new o(0, 0),
223
- seekable: this.#n,
224
- duration: e
225
- };
226
- this.#e.delegate.ready(n, t), i || this.#t("_hideOverlay"), this.#t("getQualities"), this.#t("getChapters");
227
- }
228
- #I(e, t, s) {
229
- switch (e) {
230
- case "getVideoTitle":
231
- const i = t;
232
- this.#e.notify("title-change", i, s);
233
- break;
234
- case "getDuration":
235
- const n = t;
236
- this.#e.$state.canPlay() ? this.#e.notify("duration-change", n, s) : this.#f(n, s);
237
- break;
238
- case "getCurrentTime":
239
- this.#$(t, s);
240
- break;
241
- case "getBuffered":
242
- k(t) && t.length && this.#p(t[t.length - 1][1], s);
243
- break;
244
- case "setMuted":
245
- this.#y(l(this.#e.$state.volume), t, s);
246
- break;
247
- // case 'getTextTracks':
248
- // this.#onTextTracksChange(data as VimeoTextTrack[], trigger);
249
- // break;
250
- case "getChapters":
251
- this.#L(t);
252
- break;
253
- case "getQualities":
254
- this.#F(t, s);
255
- break;
256
- }
257
- this.#m(e)?.resolve();
258
- }
259
- #R() {
260
- for (const e of $)
261
- this.#t("addEventListener", e);
262
- }
263
- #x(e) {
264
- this.#l.stop(), this.#e.notify("pause", void 0, e);
265
- }
266
- #A(e) {
267
- this.#l.start(), this.#e.notify("play", void 0, e);
268
- }
269
- #M(e) {
270
- const { paused: t } = this.#e.$state;
271
- !t() && !this.#h && this.#e.notify("playing", void 0, e);
272
- }
273
- #p(e, t) {
274
- const s = {
275
- buffered: new o(0, e),
276
- seekable: this.#n
277
- };
278
- this.#e.notify("progress", s, t);
279
- }
280
- #S(e) {
281
- this.#e.notify("waiting", void 0, e);
282
- }
283
- #q(e) {
284
- const { paused: t } = this.#e.$state;
285
- t() || this.#e.notify("playing", void 0, e);
286
- }
287
- #Q(e) {
288
- const { paused: t } = this.#e.$state;
289
- t() && this.#e.notify("play", void 0, e), this.#e.notify("waiting", void 0, e);
290
- }
291
- #y(e, t, s) {
292
- const i = { volume: e, muted: t };
293
- this.#e.notify("volume-change", i, s);
294
- }
295
- // #onTextTrackChange(track: VimeoTextTrack, trigger: Event) {
296
- // const textTrack = this.#ctx.textTracks.toArray().find((t) => t.language === track.language);
297
- // if (textTrack) textTrack.mode = track.mode;
298
- // }
299
- // #onTextTracksChange(tracks: VimeoTextTrack[], trigger: Event) {
300
- // for (const init of tracks) {
301
- // const textTrack = new TextTrack({
302
- // ...init,
303
- // label: init.label.replace('auto-generated', 'auto'),
304
- // });
305
- // textTrack[TextTrackSymbol.readyState] = 2;
306
- // this.#ctx.textTracks.add(textTrack, trigger);
307
- // textTrack.setMode(init.mode, trigger);
308
- // }
309
- // }
310
- // #onCueChange(cue: VimeoTextCue, trigger: Event) {
311
- // const { textTracks, $state } = this.#ctx,
312
- // { currentTime } = $state,
313
- // track = textTracks.selected;
314
- // if (this.#currentCue) track?.removeCue(this.#currentCue, trigger);
315
- // this.#currentCue = new window.VTTCue(currentTime(), Number.MAX_SAFE_INTEGER, cue.text);
316
- // track?.addCue(this.#currentCue, trigger);
317
- // }
318
- #L(e) {
319
- if (this.#b(), !e.length) return;
320
- const t = new w({
321
- kind: "chapters",
322
- default: !0
323
- }), { seekableEnd: s } = this.#e.$state;
324
- for (let i = 0; i < e.length; i++) {
325
- const n = e[i], a = e[i + 1];
326
- t.addCue(
327
- new window.VTTCue(
328
- n.startTime,
329
- a?.startTime ?? s(),
330
- n.title
331
- )
332
- );
333
- }
334
- this.#r = t, this.#e.textTracks.add(t);
335
- }
336
- #b() {
337
- this.#r && (this.#e.textTracks.remove(this.#r), this.#r = null);
338
- }
339
- #F(e, t) {
340
- this.#e.qualities[f.enableAuto] = e.some((s) => s.id === "auto") ? () => this.#t("setQuality", "auto") : void 0;
341
- for (const s of e) {
342
- if (s.id === "auto") continue;
343
- const i = +s.id.slice(0, -1);
344
- isNaN(i) || this.#e.qualities[r.add](
345
- {
346
- id: s.id,
347
- width: i * (16 / 9),
348
- height: i,
349
- codec: "avc1,h.264",
350
- bitrate: -1
351
- },
352
- t
353
- );
354
- }
355
- this.#v(
356
- e.find((s) => s.active),
357
- t
358
- );
359
- }
360
- #v({ id: e } = {}, t) {
361
- if (!e) return;
362
- const s = e === "auto", i = this.#e.qualities.getById(e);
363
- s ? (this.#e.qualities[f.setAuto](s, t), this.#e.qualities[r.select](void 0, !0, t)) : this.#e.qualities[r.select](i ?? void 0, !0, t);
364
- }
365
- #O(e, t, s) {
366
- switch (e) {
367
- case "ready":
368
- this.#R();
369
- break;
370
- case "loaded":
371
- this.#V(s);
372
- break;
373
- case "play":
374
- this.#A(s);
375
- break;
376
- case "playProgress":
377
- this.#M(s);
378
- break;
379
- case "pause":
380
- this.#x(s);
381
- break;
382
- case "loadProgress":
383
- this.#p(t.seconds, s);
384
- break;
385
- case "waiting":
386
- this.#Q(s);
387
- break;
388
- case "bufferstart":
389
- this.#S(s);
390
- break;
391
- case "bufferend":
392
- this.#q(s);
393
- break;
394
- case "volumechange":
395
- this.#y(t.volume, l(this.#e.$state.muted), s);
396
- break;
397
- case "durationchange":
398
- this.#n = new o(0, t.duration), this.#e.notify("duration-change", t.duration, s);
399
- break;
400
- case "playbackratechange":
401
- this.#e.notify("rate-change", t.playbackRate, s);
402
- break;
403
- case "qualitychange":
404
- this.#v(t, s);
405
- break;
406
- case "fullscreenchange":
407
- this.#d = t.fullscreen, this.#e.notify("fullscreen-change", t.fullscreen, s);
408
- break;
409
- case "enterpictureinpicture":
410
- this.#e.notify("picture-in-picture-change", !0, s);
411
- break;
412
- case "leavepictureinpicture":
413
- this.#e.notify("picture-in-picture-change", !1, s);
414
- break;
415
- case "ended":
416
- this.#e.notify("end", void 0, s);
417
- break;
418
- case "error":
419
- this.#D(t, s);
420
- break;
421
- case "seek":
422
- case "seeked":
423
- this.#E(t.seconds, s);
424
- break;
425
- }
426
- }
427
- #D(e, t) {
428
- const { message: s, method: i } = e;
429
- i === "setPlaybackRate" && this.#i.set(!1), i && this.#m(i)?.reject(s);
430
- }
431
- onMessage(e, t) {
432
- e.event ? this.#O(e.event, e.data, t) : e.method && this.#I(e.method, e.value, t);
433
- }
434
- onLoad() {
435
- }
436
- async #t(e, t) {
437
- let s = d(), i = this.#a.get(e);
438
- return i || this.#a.set(e, i = []), i.push(s), this.postMessage({
439
- method: e,
440
- value: t
441
- }), s.promise;
442
- }
443
- #k() {
444
- this.#l.stop(), this.#n = new o(0, 0), this.#u = null, this.#w = null, this.#i.set(!1), this.#b();
445
- }
446
- #m(e) {
447
- return this.#a.get(e)?.shift();
448
- }
449
- }
450
- export {
451
- M as VimeoProvider
452
- };