@wix/patterns-fields-utils 1.0.0

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 (96) hide show
  1. package/@wix/patterns-fields-bundled-cm-media-utils/dist/cjs/index.d.ts +176 -0
  2. package/@wix/patterns-fields-bundled-cm-media-utils/dist/cjs/index.js +7103 -0
  3. package/@wix/patterns-fields-bundled-cm-media-utils/dist/cjs/index.js.map +1 -0
  4. package/@wix/patterns-fields-bundled-cm-media-utils/dist/esm/index.d.mts +176 -0
  5. package/@wix/patterns-fields-bundled-cm-media-utils/dist/esm/index.mjs +7118 -0
  6. package/@wix/patterns-fields-bundled-cm-media-utils/dist/esm/index.mjs.map +1 -0
  7. package/@wix/patterns-fields-bundled-cm-media-utils/package.json +37 -0
  8. package/@wix/patterns-fields-bundled-organize-media/dist/cjs/index.css.map +1 -0
  9. package/@wix/patterns-fields-bundled-organize-media/dist/cjs/index.d.ts +115 -0
  10. package/@wix/patterns-fields-bundled-organize-media/dist/cjs/index.global.css +1536 -0
  11. package/@wix/patterns-fields-bundled-organize-media/dist/cjs/index.js +76375 -0
  12. package/@wix/patterns-fields-bundled-organize-media/dist/cjs/index.js.map +1 -0
  13. package/@wix/patterns-fields-bundled-organize-media/dist/cjs/move-POMANKZG.svg +3 -0
  14. package/@wix/patterns-fields-bundled-organize-media/dist/esm/chunk-ANOFRNLZ.mjs +302 -0
  15. package/@wix/patterns-fields-bundled-organize-media/dist/esm/chunk-ANOFRNLZ.mjs.map +1 -0
  16. package/@wix/patterns-fields-bundled-organize-media/dist/esm/chunk-D3Y2XBAR.mjs +9573 -0
  17. package/@wix/patterns-fields-bundled-organize-media/dist/esm/chunk-D3Y2XBAR.mjs.map +1 -0
  18. package/@wix/patterns-fields-bundled-organize-media/dist/esm/chunk-FOPGQED5.mjs +60 -0
  19. package/@wix/patterns-fields-bundled-organize-media/dist/esm/chunk-FOPGQED5.mjs.map +1 -0
  20. package/@wix/patterns-fields-bundled-organize-media/dist/esm/chunk-KK6IAXDC.mjs +61 -0
  21. package/@wix/patterns-fields-bundled-organize-media/dist/esm/chunk-KK6IAXDC.mjs.map +1 -0
  22. package/@wix/patterns-fields-bundled-organize-media/dist/esm/chunk-LSMTMMMM.mjs +999 -0
  23. package/@wix/patterns-fields-bundled-organize-media/dist/esm/chunk-LSMTMMMM.mjs.map +1 -0
  24. package/@wix/patterns-fields-bundled-organize-media/dist/esm/hls-X7Z2O2CI.mjs +32977 -0
  25. package/@wix/patterns-fields-bundled-organize-media/dist/esm/hls-X7Z2O2CI.mjs.map +1 -0
  26. package/@wix/patterns-fields-bundled-organize-media/dist/esm/html2canvas.esm-26SHFSHQ.mjs +7813 -0
  27. package/@wix/patterns-fields-bundled-organize-media/dist/esm/html2canvas.esm-26SHFSHQ.mjs.map +1 -0
  28. package/@wix/patterns-fields-bundled-organize-media/dist/esm/index.css.map +1 -0
  29. package/@wix/patterns-fields-bundled-organize-media/dist/esm/index.d.mts +115 -0
  30. package/@wix/patterns-fields-bundled-organize-media/dist/esm/index.global.css +1537 -0
  31. package/@wix/patterns-fields-bundled-organize-media/dist/esm/index.mjs +23054 -0
  32. package/@wix/patterns-fields-bundled-organize-media/dist/esm/index.mjs.map +1 -0
  33. package/@wix/patterns-fields-bundled-organize-media/dist/esm/lib-INOZ3X5B.mjs +6427 -0
  34. package/@wix/patterns-fields-bundled-organize-media/dist/esm/lib-INOZ3X5B.mjs.map +1 -0
  35. package/@wix/patterns-fields-bundled-organize-media/dist/esm/move-POMANKZG.svg +3 -0
  36. package/@wix/patterns-fields-bundled-organize-media/dist/esm/player.es-EHCCDTX6.mjs +1600 -0
  37. package/@wix/patterns-fields-bundled-organize-media/dist/esm/player.es-EHCCDTX6.mjs.map +1 -0
  38. package/@wix/patterns-fields-bundled-organize-media/dist/esm/validateTypes-OWSYRJSG.mjs +85 -0
  39. package/@wix/patterns-fields-bundled-organize-media/dist/esm/validateTypes-OWSYRJSG.mjs.map +1 -0
  40. package/@wix/patterns-fields-bundled-organize-media/dist/esm/videoItem-QVVYW7GT.mjs +311 -0
  41. package/@wix/patterns-fields-bundled-organize-media/dist/esm/videoItem-QVVYW7GT.mjs.map +1 -0
  42. package/@wix/patterns-fields-bundled-organize-media/dist/esm/videoScrollHelper-HX35Z6JI.mjs +307 -0
  43. package/@wix/patterns-fields-bundled-organize-media/dist/esm/videoScrollHelper-HX35Z6JI.mjs.map +1 -0
  44. package/@wix/patterns-fields-bundled-organize-media/package.json +70 -0
  45. package/@wix/wix-data-schema-types/.nvmrc +1 -0
  46. package/@wix/wix-data-schema-types/index.d.ts +1 -0
  47. package/@wix/wix-data-schema-types/lib/capabilities.d.ts +18 -0
  48. package/@wix/wix-data-schema-types/lib/capabilities.js +3 -0
  49. package/@wix/wix-data-schema-types/lib/capabilities.js.map +1 -0
  50. package/@wix/wix-data-schema-types/lib/defaultMaxPageSize.d.ts +4 -0
  51. package/@wix/wix-data-schema-types/lib/defaultMaxPageSize.js +9 -0
  52. package/@wix/wix-data-schema-types/lib/defaultMaxPageSize.js.map +1 -0
  53. package/@wix/wix-data-schema-types/lib/field.d.ts +350 -0
  54. package/@wix/wix-data-schema-types/lib/field.js +173 -0
  55. package/@wix/wix-data-schema-types/lib/field.js.map +1 -0
  56. package/@wix/wix-data-schema-types/lib/fieldPlugins.d.ts +23 -0
  57. package/@wix/wix-data-schema-types/lib/fieldPlugins.js +8 -0
  58. package/@wix/wix-data-schema-types/lib/fieldPlugins.js.map +1 -0
  59. package/@wix/wix-data-schema-types/lib/filter.d.ts +261 -0
  60. package/@wix/wix-data-schema-types/lib/filter.js +41 -0
  61. package/@wix/wix-data-schema-types/lib/filter.js.map +1 -0
  62. package/@wix/wix-data-schema-types/lib/index.d.ts +9 -0
  63. package/@wix/wix-data-schema-types/lib/index.js +26 -0
  64. package/@wix/wix-data-schema-types/lib/index.js.map +1 -0
  65. package/@wix/wix-data-schema-types/lib/order.d.ts +24 -0
  66. package/@wix/wix-data-schema-types/lib/order.js +9 -0
  67. package/@wix/wix-data-schema-types/lib/order.js.map +1 -0
  68. package/@wix/wix-data-schema-types/lib/pagingMode.d.ts +4 -0
  69. package/@wix/wix-data-schema-types/lib/pagingMode.js +9 -0
  70. package/@wix/wix-data-schema-types/lib/pagingMode.js.map +1 -0
  71. package/@wix/wix-data-schema-types/lib/plugins.d.ts +76 -0
  72. package/@wix/wix-data-schema-types/lib/plugins.js +27 -0
  73. package/@wix/wix-data-schema-types/lib/plugins.js.map +1 -0
  74. package/@wix/wix-data-schema-types/lib/schema.d.ts +202 -0
  75. package/@wix/wix-data-schema-types/lib/schema.js +106 -0
  76. package/@wix/wix-data-schema-types/lib/schema.js.map +1 -0
  77. package/@wix/wix-data-schema-types/package.json +45 -0
  78. package/@wix/wix-data-schema-types/src/capabilities.ts +19 -0
  79. package/@wix/wix-data-schema-types/src/defaultMaxPageSize.ts +6 -0
  80. package/@wix/wix-data-schema-types/src/field.ts +355 -0
  81. package/@wix/wix-data-schema-types/src/fieldPlugins.ts +28 -0
  82. package/@wix/wix-data-schema-types/src/filter.ts +280 -0
  83. package/@wix/wix-data-schema-types/src/index.ts +9 -0
  84. package/@wix/wix-data-schema-types/src/order.ts +26 -0
  85. package/@wix/wix-data-schema-types/src/pagingMode.ts +4 -0
  86. package/@wix/wix-data-schema-types/src/plugins.ts +97 -0
  87. package/@wix/wix-data-schema-types/src/schema.ts +222 -0
  88. package/@wix/wix-data-schema-types/tsconfig.json +18 -0
  89. package/@wix/wix-data-schema-types/tslint.json +3 -0
  90. package/dist/cjs/index.js +4 -0
  91. package/dist/cjs/index.js.map +1 -0
  92. package/dist/esm/index.js +12 -0
  93. package/dist/esm/index.js.map +1 -0
  94. package/dist/types/index.d.ts +12 -0
  95. package/dist/types/index.d.ts.map +1 -0
  96. package/package.json +87 -0
@@ -0,0 +1,1600 @@
1
+ var global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {};
2
+ import {
3
+ init_define_process_env
4
+ } from "./chunk-FOPGQED5.mjs";
5
+
6
+ // ../../node_modules/@vimeo/player/dist/player.es.js
7
+ init_define_process_env();
8
+ function _classCallCheck(instance, Constructor) {
9
+ if (!(instance instanceof Constructor)) {
10
+ throw new TypeError("Cannot call a class as a function");
11
+ }
12
+ }
13
+ function _defineProperties(target, props) {
14
+ for (var i = 0; i < props.length; i++) {
15
+ var descriptor = props[i];
16
+ descriptor.enumerable = descriptor.enumerable || false;
17
+ descriptor.configurable = true;
18
+ if ("value" in descriptor) descriptor.writable = true;
19
+ Object.defineProperty(target, descriptor.key, descriptor);
20
+ }
21
+ }
22
+ function _createClass(Constructor, protoProps, staticProps) {
23
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
24
+ if (staticProps) _defineProperties(Constructor, staticProps);
25
+ return Constructor;
26
+ }
27
+ var isNode = typeof global !== "undefined" && {}.toString.call(global) === "[object global]";
28
+ function getMethodName(prop, type) {
29
+ if (prop.indexOf(type.toLowerCase()) === 0) {
30
+ return prop;
31
+ }
32
+ return "".concat(type.toLowerCase()).concat(prop.substr(0, 1).toUpperCase()).concat(prop.substr(1));
33
+ }
34
+ function isDomElement(element) {
35
+ return Boolean(element && element.nodeType === 1 && "nodeName" in element && element.ownerDocument && element.ownerDocument.defaultView);
36
+ }
37
+ function isInteger(value) {
38
+ return !isNaN(parseFloat(value)) && isFinite(value) && Math.floor(value) == value;
39
+ }
40
+ function isVimeoUrl(url) {
41
+ return /^(https?:)?\/\/((player|www)\.)?vimeo\.com(?=$|\/)/.test(url);
42
+ }
43
+ function getVimeoUrl() {
44
+ var oEmbedParameters2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
45
+ var id = oEmbedParameters2.id;
46
+ var url = oEmbedParameters2.url;
47
+ var idOrUrl = id || url;
48
+ if (!idOrUrl) {
49
+ throw new Error("An id or url must be passed, either in an options object or as a data-vimeo-id or data-vimeo-url attribute.");
50
+ }
51
+ if (isInteger(idOrUrl)) {
52
+ return "https://vimeo.com/".concat(idOrUrl);
53
+ }
54
+ if (isVimeoUrl(idOrUrl)) {
55
+ return idOrUrl.replace("http:", "https:");
56
+ }
57
+ if (id) {
58
+ throw new TypeError("\u201C".concat(id, "\u201D is not a valid video id."));
59
+ }
60
+ throw new TypeError("\u201C".concat(idOrUrl, "\u201D is not a vimeo.com url."));
61
+ }
62
+ var arrayIndexOfSupport = typeof Array.prototype.indexOf !== "undefined";
63
+ var postMessageSupport = typeof window !== "undefined" && typeof window.postMessage !== "undefined";
64
+ if (!isNode && (!arrayIndexOfSupport || !postMessageSupport)) {
65
+ throw new Error("Sorry, the Vimeo Player API is not available in this browser.");
66
+ }
67
+ var commonjsGlobal = typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
68
+ function createCommonjsModule(fn, module) {
69
+ return module = { exports: {} }, fn(module, module.exports), module.exports;
70
+ }
71
+ (function(self2) {
72
+ if (self2.WeakMap) {
73
+ return;
74
+ }
75
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
76
+ var defineProperty = function(object, name, value) {
77
+ if (Object.defineProperty) {
78
+ Object.defineProperty(object, name, {
79
+ configurable: true,
80
+ writable: true,
81
+ value
82
+ });
83
+ } else {
84
+ object[name] = value;
85
+ }
86
+ };
87
+ self2.WeakMap = function() {
88
+ function WeakMap2() {
89
+ if (this === void 0) {
90
+ throw new TypeError("Constructor WeakMap requires 'new'");
91
+ }
92
+ defineProperty(this, "_id", genId("_WeakMap"));
93
+ if (arguments.length > 0) {
94
+ throw new TypeError("WeakMap iterable is not supported");
95
+ }
96
+ }
97
+ defineProperty(WeakMap2.prototype, "delete", function(key) {
98
+ checkInstance(this, "delete");
99
+ if (!isObject(key)) {
100
+ return false;
101
+ }
102
+ var entry = key[this._id];
103
+ if (entry && entry[0] === key) {
104
+ delete key[this._id];
105
+ return true;
106
+ }
107
+ return false;
108
+ });
109
+ defineProperty(WeakMap2.prototype, "get", function(key) {
110
+ checkInstance(this, "get");
111
+ if (!isObject(key)) {
112
+ return void 0;
113
+ }
114
+ var entry = key[this._id];
115
+ if (entry && entry[0] === key) {
116
+ return entry[1];
117
+ }
118
+ return void 0;
119
+ });
120
+ defineProperty(WeakMap2.prototype, "has", function(key) {
121
+ checkInstance(this, "has");
122
+ if (!isObject(key)) {
123
+ return false;
124
+ }
125
+ var entry = key[this._id];
126
+ if (entry && entry[0] === key) {
127
+ return true;
128
+ }
129
+ return false;
130
+ });
131
+ defineProperty(WeakMap2.prototype, "set", function(key, value) {
132
+ checkInstance(this, "set");
133
+ if (!isObject(key)) {
134
+ throw new TypeError("Invalid value used as weak map key");
135
+ }
136
+ var entry = key[this._id];
137
+ if (entry && entry[0] === key) {
138
+ entry[1] = value;
139
+ return this;
140
+ }
141
+ defineProperty(key, this._id, [key, value]);
142
+ return this;
143
+ });
144
+ function checkInstance(x, methodName) {
145
+ if (!isObject(x) || !hasOwnProperty.call(x, "_id")) {
146
+ throw new TypeError(methodName + " method called on incompatible receiver " + typeof x);
147
+ }
148
+ }
149
+ function genId(prefix) {
150
+ return prefix + "_" + rand() + "." + rand();
151
+ }
152
+ function rand() {
153
+ return Math.random().toString().substring(2);
154
+ }
155
+ defineProperty(WeakMap2, "_polyfill", true);
156
+ return WeakMap2;
157
+ }();
158
+ function isObject(x) {
159
+ return Object(x) === x;
160
+ }
161
+ })(typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof commonjsGlobal !== "undefined" ? commonjsGlobal : commonjsGlobal);
162
+ var npo_src = createCommonjsModule(function(module) {
163
+ (function UMD(name, context, definition) {
164
+ context[name] = context[name] || definition();
165
+ if (module.exports) {
166
+ module.exports = context[name];
167
+ }
168
+ })("Promise", typeof commonjsGlobal != "undefined" ? commonjsGlobal : commonjsGlobal, function DEF() {
169
+ var builtInProp, cycle, scheduling_queue, ToString = Object.prototype.toString, timer = typeof setImmediate != "undefined" ? function timer2(fn) {
170
+ return setImmediate(fn);
171
+ } : setTimeout;
172
+ try {
173
+ Object.defineProperty({}, "x", {});
174
+ builtInProp = function builtInProp2(obj, name, val, config) {
175
+ return Object.defineProperty(obj, name, {
176
+ value: val,
177
+ writable: true,
178
+ configurable: config !== false
179
+ });
180
+ };
181
+ } catch (err) {
182
+ builtInProp = function builtInProp2(obj, name, val) {
183
+ obj[name] = val;
184
+ return obj;
185
+ };
186
+ }
187
+ scheduling_queue = /* @__PURE__ */ function Queue() {
188
+ var first, last, item;
189
+ function Item(fn, self2) {
190
+ this.fn = fn;
191
+ this.self = self2;
192
+ this.next = void 0;
193
+ }
194
+ return {
195
+ add: function add(fn, self2) {
196
+ item = new Item(fn, self2);
197
+ if (last) {
198
+ last.next = item;
199
+ } else {
200
+ first = item;
201
+ }
202
+ last = item;
203
+ item = void 0;
204
+ },
205
+ drain: function drain() {
206
+ var f = first;
207
+ first = last = cycle = void 0;
208
+ while (f) {
209
+ f.fn.call(f.self);
210
+ f = f.next;
211
+ }
212
+ }
213
+ };
214
+ }();
215
+ function schedule(fn, self2) {
216
+ scheduling_queue.add(fn, self2);
217
+ if (!cycle) {
218
+ cycle = timer(scheduling_queue.drain);
219
+ }
220
+ }
221
+ function isThenable(o) {
222
+ var _then, o_type = typeof o;
223
+ if (o != null && (o_type == "object" || o_type == "function")) {
224
+ _then = o.then;
225
+ }
226
+ return typeof _then == "function" ? _then : false;
227
+ }
228
+ function notify() {
229
+ for (var i = 0; i < this.chain.length; i++) {
230
+ notifyIsolated(this, this.state === 1 ? this.chain[i].success : this.chain[i].failure, this.chain[i]);
231
+ }
232
+ this.chain.length = 0;
233
+ }
234
+ function notifyIsolated(self2, cb, chain) {
235
+ var ret, _then;
236
+ try {
237
+ if (cb === false) {
238
+ chain.reject(self2.msg);
239
+ } else {
240
+ if (cb === true) {
241
+ ret = self2.msg;
242
+ } else {
243
+ ret = cb.call(void 0, self2.msg);
244
+ }
245
+ if (ret === chain.promise) {
246
+ chain.reject(TypeError("Promise-chain cycle"));
247
+ } else if (_then = isThenable(ret)) {
248
+ _then.call(ret, chain.resolve, chain.reject);
249
+ } else {
250
+ chain.resolve(ret);
251
+ }
252
+ }
253
+ } catch (err) {
254
+ chain.reject(err);
255
+ }
256
+ }
257
+ function resolve(msg) {
258
+ var _then, self2 = this;
259
+ if (self2.triggered) {
260
+ return;
261
+ }
262
+ self2.triggered = true;
263
+ if (self2.def) {
264
+ self2 = self2.def;
265
+ }
266
+ try {
267
+ if (_then = isThenable(msg)) {
268
+ schedule(function() {
269
+ var def_wrapper = new MakeDefWrapper(self2);
270
+ try {
271
+ _then.call(msg, function $resolve$() {
272
+ resolve.apply(def_wrapper, arguments);
273
+ }, function $reject$() {
274
+ reject.apply(def_wrapper, arguments);
275
+ });
276
+ } catch (err) {
277
+ reject.call(def_wrapper, err);
278
+ }
279
+ });
280
+ } else {
281
+ self2.msg = msg;
282
+ self2.state = 1;
283
+ if (self2.chain.length > 0) {
284
+ schedule(notify, self2);
285
+ }
286
+ }
287
+ } catch (err) {
288
+ reject.call(new MakeDefWrapper(self2), err);
289
+ }
290
+ }
291
+ function reject(msg) {
292
+ var self2 = this;
293
+ if (self2.triggered) {
294
+ return;
295
+ }
296
+ self2.triggered = true;
297
+ if (self2.def) {
298
+ self2 = self2.def;
299
+ }
300
+ self2.msg = msg;
301
+ self2.state = 2;
302
+ if (self2.chain.length > 0) {
303
+ schedule(notify, self2);
304
+ }
305
+ }
306
+ function iteratePromises(Constructor, arr, resolver, rejecter) {
307
+ for (var idx = 0; idx < arr.length; idx++) {
308
+ (function IIFE(idx2) {
309
+ Constructor.resolve(arr[idx2]).then(function $resolver$(msg) {
310
+ resolver(idx2, msg);
311
+ }, rejecter);
312
+ })(idx);
313
+ }
314
+ }
315
+ function MakeDefWrapper(self2) {
316
+ this.def = self2;
317
+ this.triggered = false;
318
+ }
319
+ function MakeDef(self2) {
320
+ this.promise = self2;
321
+ this.state = 0;
322
+ this.triggered = false;
323
+ this.chain = [];
324
+ this.msg = void 0;
325
+ }
326
+ function Promise2(executor) {
327
+ if (typeof executor != "function") {
328
+ throw TypeError("Not a function");
329
+ }
330
+ if (this.__NPO__ !== 0) {
331
+ throw TypeError("Not a promise");
332
+ }
333
+ this.__NPO__ = 1;
334
+ var def = new MakeDef(this);
335
+ this["then"] = function then(success, failure) {
336
+ var o = {
337
+ success: typeof success == "function" ? success : true,
338
+ failure: typeof failure == "function" ? failure : false
339
+ };
340
+ o.promise = new this.constructor(function extractChain(resolve2, reject2) {
341
+ if (typeof resolve2 != "function" || typeof reject2 != "function") {
342
+ throw TypeError("Not a function");
343
+ }
344
+ o.resolve = resolve2;
345
+ o.reject = reject2;
346
+ });
347
+ def.chain.push(o);
348
+ if (def.state !== 0) {
349
+ schedule(notify, def);
350
+ }
351
+ return o.promise;
352
+ };
353
+ this["catch"] = function $catch$(failure) {
354
+ return this.then(void 0, failure);
355
+ };
356
+ try {
357
+ executor.call(void 0, function publicResolve(msg) {
358
+ resolve.call(def, msg);
359
+ }, function publicReject(msg) {
360
+ reject.call(def, msg);
361
+ });
362
+ } catch (err) {
363
+ reject.call(def, err);
364
+ }
365
+ }
366
+ var PromisePrototype = builtInProp(
367
+ {},
368
+ "constructor",
369
+ Promise2,
370
+ /*configurable=*/
371
+ false
372
+ );
373
+ Promise2.prototype = PromisePrototype;
374
+ builtInProp(
375
+ PromisePrototype,
376
+ "__NPO__",
377
+ 0,
378
+ /*configurable=*/
379
+ false
380
+ );
381
+ builtInProp(Promise2, "resolve", function Promise$resolve(msg) {
382
+ var Constructor = this;
383
+ if (msg && typeof msg == "object" && msg.__NPO__ === 1) {
384
+ return msg;
385
+ }
386
+ return new Constructor(function executor(resolve2, reject2) {
387
+ if (typeof resolve2 != "function" || typeof reject2 != "function") {
388
+ throw TypeError("Not a function");
389
+ }
390
+ resolve2(msg);
391
+ });
392
+ });
393
+ builtInProp(Promise2, "reject", function Promise$reject(msg) {
394
+ return new this(function executor(resolve2, reject2) {
395
+ if (typeof resolve2 != "function" || typeof reject2 != "function") {
396
+ throw TypeError("Not a function");
397
+ }
398
+ reject2(msg);
399
+ });
400
+ });
401
+ builtInProp(Promise2, "all", function Promise$all(arr) {
402
+ var Constructor = this;
403
+ if (ToString.call(arr) != "[object Array]") {
404
+ return Constructor.reject(TypeError("Not an array"));
405
+ }
406
+ if (arr.length === 0) {
407
+ return Constructor.resolve([]);
408
+ }
409
+ return new Constructor(function executor(resolve2, reject2) {
410
+ if (typeof resolve2 != "function" || typeof reject2 != "function") {
411
+ throw TypeError("Not a function");
412
+ }
413
+ var len = arr.length, msgs = Array(len), count = 0;
414
+ iteratePromises(Constructor, arr, function resolver(idx, msg) {
415
+ msgs[idx] = msg;
416
+ if (++count === len) {
417
+ resolve2(msgs);
418
+ }
419
+ }, reject2);
420
+ });
421
+ });
422
+ builtInProp(Promise2, "race", function Promise$race(arr) {
423
+ var Constructor = this;
424
+ if (ToString.call(arr) != "[object Array]") {
425
+ return Constructor.reject(TypeError("Not an array"));
426
+ }
427
+ return new Constructor(function executor(resolve2, reject2) {
428
+ if (typeof resolve2 != "function" || typeof reject2 != "function") {
429
+ throw TypeError("Not a function");
430
+ }
431
+ iteratePromises(Constructor, arr, function resolver(idx, msg) {
432
+ resolve2(msg);
433
+ }, reject2);
434
+ });
435
+ });
436
+ return Promise2;
437
+ });
438
+ });
439
+ var callbackMap = /* @__PURE__ */ new WeakMap();
440
+ function storeCallback(player, name, callback) {
441
+ var playerCallbacks = callbackMap.get(player.element) || {};
442
+ if (!(name in playerCallbacks)) {
443
+ playerCallbacks[name] = [];
444
+ }
445
+ playerCallbacks[name].push(callback);
446
+ callbackMap.set(player.element, playerCallbacks);
447
+ }
448
+ function getCallbacks(player, name) {
449
+ var playerCallbacks = callbackMap.get(player.element) || {};
450
+ return playerCallbacks[name] || [];
451
+ }
452
+ function removeCallback(player, name, callback) {
453
+ var playerCallbacks = callbackMap.get(player.element) || {};
454
+ if (!playerCallbacks[name]) {
455
+ return true;
456
+ }
457
+ if (!callback) {
458
+ playerCallbacks[name] = [];
459
+ callbackMap.set(player.element, playerCallbacks);
460
+ return true;
461
+ }
462
+ var index = playerCallbacks[name].indexOf(callback);
463
+ if (index !== -1) {
464
+ playerCallbacks[name].splice(index, 1);
465
+ }
466
+ callbackMap.set(player.element, playerCallbacks);
467
+ return playerCallbacks[name] && playerCallbacks[name].length === 0;
468
+ }
469
+ function shiftCallbacks(player, name) {
470
+ var playerCallbacks = getCallbacks(player, name);
471
+ if (playerCallbacks.length < 1) {
472
+ return false;
473
+ }
474
+ var callback = playerCallbacks.shift();
475
+ removeCallback(player, name, callback);
476
+ return callback;
477
+ }
478
+ function swapCallbacks(oldElement, newElement) {
479
+ var playerCallbacks = callbackMap.get(oldElement);
480
+ callbackMap.set(newElement, playerCallbacks);
481
+ callbackMap.delete(oldElement);
482
+ }
483
+ var oEmbedParameters = ["autopause", "autoplay", "background", "byline", "color", "dnt", "height", "id", "loop", "maxheight", "maxwidth", "muted", "playsinline", "portrait", "responsive", "speed", "title", "transparent", "url", "width"];
484
+ function getOEmbedParameters(element) {
485
+ var defaults = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
486
+ return oEmbedParameters.reduce(function(params, param) {
487
+ var value = element.getAttribute("data-vimeo-".concat(param));
488
+ if (value || value === "") {
489
+ params[param] = value === "" ? 1 : value;
490
+ }
491
+ return params;
492
+ }, defaults);
493
+ }
494
+ function createEmbed(_ref, element) {
495
+ var html = _ref.html;
496
+ if (!element) {
497
+ throw new TypeError("An element must be provided");
498
+ }
499
+ if (element.getAttribute("data-vimeo-initialized") !== null) {
500
+ return element.querySelector("iframe");
501
+ }
502
+ var div = document.createElement("div");
503
+ div.innerHTML = html;
504
+ element.appendChild(div.firstChild);
505
+ element.setAttribute("data-vimeo-initialized", "true");
506
+ return element.querySelector("iframe");
507
+ }
508
+ function getOEmbedData(videoUrl) {
509
+ var params = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
510
+ var element = arguments.length > 2 ? arguments[2] : void 0;
511
+ return new Promise(function(resolve, reject) {
512
+ if (!isVimeoUrl(videoUrl)) {
513
+ throw new TypeError("\u201C".concat(videoUrl, "\u201D is not a vimeo.com url."));
514
+ }
515
+ var url = "https://vimeo.com/api/oembed.json?url=".concat(encodeURIComponent(videoUrl), "&domain=").concat(window.location.hostname);
516
+ for (var param in params) {
517
+ if (params.hasOwnProperty(param)) {
518
+ url += "&".concat(param, "=").concat(encodeURIComponent(params[param]));
519
+ }
520
+ }
521
+ var xhr = "XDomainRequest" in window ? new XDomainRequest() : new XMLHttpRequest();
522
+ xhr.open("GET", url, true);
523
+ xhr.onload = function() {
524
+ if (xhr.status === 404) {
525
+ reject(new Error("\u201C".concat(videoUrl, "\u201D was not found.")));
526
+ return;
527
+ }
528
+ if (xhr.status === 403) {
529
+ reject(new Error("\u201C".concat(videoUrl, "\u201D is not embeddable.")));
530
+ return;
531
+ }
532
+ try {
533
+ var json = JSON.parse(xhr.responseText);
534
+ if (json.domain_status_code === 403) {
535
+ createEmbed(json, element);
536
+ reject(new Error("\u201C".concat(videoUrl, "\u201D is not embeddable.")));
537
+ return;
538
+ }
539
+ resolve(json);
540
+ } catch (error) {
541
+ reject(error);
542
+ }
543
+ };
544
+ xhr.onerror = function() {
545
+ var status = xhr.status ? " (".concat(xhr.status, ")") : "";
546
+ reject(new Error("There was an error fetching the embed code from Vimeo".concat(status, ".")));
547
+ };
548
+ xhr.send();
549
+ });
550
+ }
551
+ function initializeEmbeds() {
552
+ var parent = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : document;
553
+ var elements = [].slice.call(parent.querySelectorAll("[data-vimeo-id], [data-vimeo-url]"));
554
+ var handleError = function handleError2(error) {
555
+ if ("console" in window && console.error) {
556
+ console.error("There was an error creating an embed: ".concat(error));
557
+ }
558
+ };
559
+ elements.forEach(function(element) {
560
+ try {
561
+ if (element.getAttribute("data-vimeo-defer") !== null) {
562
+ return;
563
+ }
564
+ var params = getOEmbedParameters(element);
565
+ var url = getVimeoUrl(params);
566
+ getOEmbedData(url, params, element).then(function(data) {
567
+ return createEmbed(data, element);
568
+ }).catch(handleError);
569
+ } catch (error) {
570
+ handleError(error);
571
+ }
572
+ });
573
+ }
574
+ function resizeEmbeds() {
575
+ var parent = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : document;
576
+ if (window.VimeoPlayerResizeEmbeds_) {
577
+ return;
578
+ }
579
+ window.VimeoPlayerResizeEmbeds_ = true;
580
+ var onMessage = function onMessage2(event) {
581
+ if (!isVimeoUrl(event.origin)) {
582
+ return;
583
+ }
584
+ if (!event.data || event.data.event !== "spacechange") {
585
+ return;
586
+ }
587
+ var iframes = parent.querySelectorAll("iframe");
588
+ for (var i = 0; i < iframes.length; i++) {
589
+ if (iframes[i].contentWindow !== event.source) {
590
+ continue;
591
+ }
592
+ var space = iframes[i].parentElement;
593
+ space.style.paddingBottom = "".concat(event.data.data[0].bottom, "px");
594
+ break;
595
+ }
596
+ };
597
+ if (window.addEventListener) {
598
+ window.addEventListener("message", onMessage, false);
599
+ } else if (window.attachEvent) {
600
+ window.attachEvent("onmessage", onMessage);
601
+ }
602
+ }
603
+ function parseMessageData(data) {
604
+ if (typeof data === "string") {
605
+ try {
606
+ data = JSON.parse(data);
607
+ } catch (error) {
608
+ console.warn(error);
609
+ return {};
610
+ }
611
+ }
612
+ return data;
613
+ }
614
+ function postMessage(player, method, params) {
615
+ if (!player.element.contentWindow || !player.element.contentWindow.postMessage) {
616
+ return;
617
+ }
618
+ var message = {
619
+ method
620
+ };
621
+ if (params !== void 0) {
622
+ message.value = params;
623
+ }
624
+ var ieVersion = parseFloat(navigator.userAgent.toLowerCase().replace(/^.*msie (\d+).*$/, "$1"));
625
+ if (ieVersion >= 8 && ieVersion < 10) {
626
+ message = JSON.stringify(message);
627
+ }
628
+ player.element.contentWindow.postMessage(message, player.origin);
629
+ }
630
+ function processData(player, data) {
631
+ data = parseMessageData(data);
632
+ var callbacks = [];
633
+ var param;
634
+ if (data.event) {
635
+ if (data.event === "error") {
636
+ var promises = getCallbacks(player, data.data.method);
637
+ promises.forEach(function(promise) {
638
+ var error = new Error(data.data.message);
639
+ error.name = data.data.name;
640
+ promise.reject(error);
641
+ removeCallback(player, data.data.method, promise);
642
+ });
643
+ }
644
+ callbacks = getCallbacks(player, "event:".concat(data.event));
645
+ param = data.data;
646
+ } else if (data.method) {
647
+ var callback = shiftCallbacks(player, data.method);
648
+ if (callback) {
649
+ callbacks.push(callback);
650
+ param = data.value;
651
+ }
652
+ }
653
+ callbacks.forEach(function(callback2) {
654
+ try {
655
+ if (typeof callback2 === "function") {
656
+ callback2.call(player, param);
657
+ return;
658
+ }
659
+ callback2.resolve(param);
660
+ } catch (e) {
661
+ }
662
+ });
663
+ }
664
+ var playerMap = /* @__PURE__ */ new WeakMap();
665
+ var readyMap = /* @__PURE__ */ new WeakMap();
666
+ var Player = /* @__PURE__ */ function() {
667
+ function Player2(element) {
668
+ var _this = this;
669
+ var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
670
+ _classCallCheck(this, Player2);
671
+ if (window.jQuery && element instanceof jQuery) {
672
+ if (element.length > 1 && window.console && console.warn) {
673
+ console.warn("A jQuery object with multiple elements was passed, using the first element.");
674
+ }
675
+ element = element[0];
676
+ }
677
+ if (typeof document !== "undefined" && typeof element === "string") {
678
+ element = document.getElementById(element);
679
+ }
680
+ if (!isDomElement(element)) {
681
+ throw new TypeError("You must pass either a valid element or a valid id.");
682
+ }
683
+ var win = element.ownerDocument.defaultView;
684
+ if (element.nodeName !== "IFRAME") {
685
+ var iframe = element.querySelector("iframe");
686
+ if (iframe) {
687
+ element = iframe;
688
+ }
689
+ }
690
+ if (element.nodeName === "IFRAME" && !isVimeoUrl(element.getAttribute("src") || "")) {
691
+ throw new Error("The player element passed isn\u2019t a Vimeo embed.");
692
+ }
693
+ if (playerMap.has(element)) {
694
+ return playerMap.get(element);
695
+ }
696
+ this.element = element;
697
+ this.origin = "*";
698
+ var readyPromise = new npo_src(function(resolve, reject) {
699
+ var onMessage = function onMessage2(event) {
700
+ if (!isVimeoUrl(event.origin) || _this.element.contentWindow !== event.source) {
701
+ return;
702
+ }
703
+ if (_this.origin === "*") {
704
+ _this.origin = event.origin;
705
+ }
706
+ var data = parseMessageData(event.data);
707
+ var isError = data && data.event === "error";
708
+ var isReadyError = isError && data.data && data.data.method === "ready";
709
+ if (isReadyError) {
710
+ var error = new Error(data.data.message);
711
+ error.name = data.data.name;
712
+ reject(error);
713
+ return;
714
+ }
715
+ var isReadyEvent = data && data.event === "ready";
716
+ var isPingResponse = data && data.method === "ping";
717
+ if (isReadyEvent || isPingResponse) {
718
+ _this.element.setAttribute("data-ready", "true");
719
+ resolve();
720
+ return;
721
+ }
722
+ processData(_this, data);
723
+ };
724
+ if (win.addEventListener) {
725
+ win.addEventListener("message", onMessage, false);
726
+ } else if (win.attachEvent) {
727
+ win.attachEvent("onmessage", onMessage);
728
+ }
729
+ if (_this.element.nodeName !== "IFRAME") {
730
+ var params = getOEmbedParameters(element, options);
731
+ var url = getVimeoUrl(params);
732
+ getOEmbedData(url, params, element).then(function(data) {
733
+ var iframe2 = createEmbed(data, element);
734
+ _this.element = iframe2;
735
+ _this._originalElement = element;
736
+ swapCallbacks(element, iframe2);
737
+ playerMap.set(_this.element, _this);
738
+ return data;
739
+ }).catch(reject);
740
+ }
741
+ });
742
+ readyMap.set(this, readyPromise);
743
+ playerMap.set(this.element, this);
744
+ if (this.element.nodeName === "IFRAME") {
745
+ postMessage(this, "ping");
746
+ }
747
+ return this;
748
+ }
749
+ _createClass(Player2, [{
750
+ key: "callMethod",
751
+ value: function callMethod(name) {
752
+ var _this2 = this;
753
+ var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
754
+ return new npo_src(function(resolve, reject) {
755
+ return _this2.ready().then(function() {
756
+ storeCallback(_this2, name, {
757
+ resolve,
758
+ reject
759
+ });
760
+ postMessage(_this2, name, args);
761
+ }).catch(reject);
762
+ });
763
+ }
764
+ /**
765
+ * Get a promise for the value of a player property.
766
+ *
767
+ * @param {string} name The property name
768
+ * @return {Promise}
769
+ */
770
+ }, {
771
+ key: "get",
772
+ value: function get(name) {
773
+ var _this3 = this;
774
+ return new npo_src(function(resolve, reject) {
775
+ name = getMethodName(name, "get");
776
+ return _this3.ready().then(function() {
777
+ storeCallback(_this3, name, {
778
+ resolve,
779
+ reject
780
+ });
781
+ postMessage(_this3, name);
782
+ }).catch(reject);
783
+ });
784
+ }
785
+ /**
786
+ * Get a promise for setting the value of a player property.
787
+ *
788
+ * @param {string} name The API method to call.
789
+ * @param {mixed} value The value to set.
790
+ * @return {Promise}
791
+ */
792
+ }, {
793
+ key: "set",
794
+ value: function set(name, value) {
795
+ var _this4 = this;
796
+ return new npo_src(function(resolve, reject) {
797
+ name = getMethodName(name, "set");
798
+ if (value === void 0 || value === null) {
799
+ throw new TypeError("There must be a value to set.");
800
+ }
801
+ return _this4.ready().then(function() {
802
+ storeCallback(_this4, name, {
803
+ resolve,
804
+ reject
805
+ });
806
+ postMessage(_this4, name, value);
807
+ }).catch(reject);
808
+ });
809
+ }
810
+ /**
811
+ * Add an event listener for the specified event. Will call the
812
+ * callback with a single parameter, `data`, that contains the data for
813
+ * that event.
814
+ *
815
+ * @param {string} eventName The name of the event.
816
+ * @param {function(*)} callback The function to call when the event fires.
817
+ * @return {void}
818
+ */
819
+ }, {
820
+ key: "on",
821
+ value: function on(eventName, callback) {
822
+ if (!eventName) {
823
+ throw new TypeError("You must pass an event name.");
824
+ }
825
+ if (!callback) {
826
+ throw new TypeError("You must pass a callback function.");
827
+ }
828
+ if (typeof callback !== "function") {
829
+ throw new TypeError("The callback must be a function.");
830
+ }
831
+ var callbacks = getCallbacks(this, "event:".concat(eventName));
832
+ if (callbacks.length === 0) {
833
+ this.callMethod("addEventListener", eventName).catch(function() {
834
+ });
835
+ }
836
+ storeCallback(this, "event:".concat(eventName), callback);
837
+ }
838
+ /**
839
+ * Remove an event listener for the specified event. Will remove all
840
+ * listeners for that event if a `callback` isn’t passed, or only that
841
+ * specific callback if it is passed.
842
+ *
843
+ * @param {string} eventName The name of the event.
844
+ * @param {function} [callback] The specific callback to remove.
845
+ * @return {void}
846
+ */
847
+ }, {
848
+ key: "off",
849
+ value: function off(eventName, callback) {
850
+ if (!eventName) {
851
+ throw new TypeError("You must pass an event name.");
852
+ }
853
+ if (callback && typeof callback !== "function") {
854
+ throw new TypeError("The callback must be a function.");
855
+ }
856
+ var lastCallback = removeCallback(this, "event:".concat(eventName), callback);
857
+ if (lastCallback) {
858
+ this.callMethod("removeEventListener", eventName).catch(function(e) {
859
+ });
860
+ }
861
+ }
862
+ /**
863
+ * A promise to load a new video.
864
+ *
865
+ * @promise LoadVideoPromise
866
+ * @fulfill {number} The video with this id successfully loaded.
867
+ * @reject {TypeError} The id was not a number.
868
+ */
869
+ /**
870
+ * Load a new video into this embed. The promise will be resolved if
871
+ * the video is successfully loaded, or it will be rejected if it could
872
+ * not be loaded.
873
+ *
874
+ * @param {number|object} options The id of the video or an object with embed options.
875
+ * @return {LoadVideoPromise}
876
+ */
877
+ }, {
878
+ key: "loadVideo",
879
+ value: function loadVideo(options) {
880
+ return this.callMethod("loadVideo", options);
881
+ }
882
+ /**
883
+ * A promise to perform an action when the Player is ready.
884
+ *
885
+ * @todo document errors
886
+ * @promise LoadVideoPromise
887
+ * @fulfill {void}
888
+ */
889
+ /**
890
+ * Trigger a function when the player iframe has initialized. You do not
891
+ * need to wait for `ready` to trigger to begin adding event listeners
892
+ * or calling other methods.
893
+ *
894
+ * @return {ReadyPromise}
895
+ */
896
+ }, {
897
+ key: "ready",
898
+ value: function ready() {
899
+ var readyPromise = readyMap.get(this) || new npo_src(function(resolve, reject) {
900
+ reject(new Error("Unknown player. Probably unloaded."));
901
+ });
902
+ return npo_src.resolve(readyPromise);
903
+ }
904
+ /**
905
+ * A promise to add a cue point to the player.
906
+ *
907
+ * @promise AddCuePointPromise
908
+ * @fulfill {string} The id of the cue point to use for removeCuePoint.
909
+ * @reject {RangeError} the time was less than 0 or greater than the
910
+ * video’s duration.
911
+ * @reject {UnsupportedError} Cue points are not supported with the current
912
+ * player or browser.
913
+ */
914
+ /**
915
+ * Add a cue point to the player.
916
+ *
917
+ * @param {number} time The time for the cue point.
918
+ * @param {object} [data] Arbitrary data to be returned with the cue point.
919
+ * @return {AddCuePointPromise}
920
+ */
921
+ }, {
922
+ key: "addCuePoint",
923
+ value: function addCuePoint(time) {
924
+ var data = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
925
+ return this.callMethod("addCuePoint", {
926
+ time,
927
+ data
928
+ });
929
+ }
930
+ /**
931
+ * A promise to remove a cue point from the player.
932
+ *
933
+ * @promise AddCuePointPromise
934
+ * @fulfill {string} The id of the cue point that was removed.
935
+ * @reject {InvalidCuePoint} The cue point with the specified id was not
936
+ * found.
937
+ * @reject {UnsupportedError} Cue points are not supported with the current
938
+ * player or browser.
939
+ */
940
+ /**
941
+ * Remove a cue point from the video.
942
+ *
943
+ * @param {string} id The id of the cue point to remove.
944
+ * @return {RemoveCuePointPromise}
945
+ */
946
+ }, {
947
+ key: "removeCuePoint",
948
+ value: function removeCuePoint(id) {
949
+ return this.callMethod("removeCuePoint", id);
950
+ }
951
+ /**
952
+ * A representation of a text track on a video.
953
+ *
954
+ * @typedef {Object} VimeoTextTrack
955
+ * @property {string} language The ISO language code.
956
+ * @property {string} kind The kind of track it is (captions or subtitles).
957
+ * @property {string} label The human‐readable label for the track.
958
+ */
959
+ /**
960
+ * A promise to enable a text track.
961
+ *
962
+ * @promise EnableTextTrackPromise
963
+ * @fulfill {VimeoTextTrack} The text track that was enabled.
964
+ * @reject {InvalidTrackLanguageError} No track was available with the
965
+ * specified language.
966
+ * @reject {InvalidTrackError} No track was available with the specified
967
+ * language and kind.
968
+ */
969
+ /**
970
+ * Enable the text track with the specified language, and optionally the
971
+ * specified kind (captions or subtitles).
972
+ *
973
+ * When set via the API, the track language will not change the viewer’s
974
+ * stored preference.
975
+ *
976
+ * @param {string} language The two‐letter language code.
977
+ * @param {string} [kind] The kind of track to enable (captions or subtitles).
978
+ * @return {EnableTextTrackPromise}
979
+ */
980
+ }, {
981
+ key: "enableTextTrack",
982
+ value: function enableTextTrack(language, kind) {
983
+ if (!language) {
984
+ throw new TypeError("You must pass a language.");
985
+ }
986
+ return this.callMethod("enableTextTrack", {
987
+ language,
988
+ kind
989
+ });
990
+ }
991
+ /**
992
+ * A promise to disable the active text track.
993
+ *
994
+ * @promise DisableTextTrackPromise
995
+ * @fulfill {void} The track was disabled.
996
+ */
997
+ /**
998
+ * Disable the currently-active text track.
999
+ *
1000
+ * @return {DisableTextTrackPromise}
1001
+ */
1002
+ }, {
1003
+ key: "disableTextTrack",
1004
+ value: function disableTextTrack() {
1005
+ return this.callMethod("disableTextTrack");
1006
+ }
1007
+ /**
1008
+ * A promise to pause the video.
1009
+ *
1010
+ * @promise PausePromise
1011
+ * @fulfill {void} The video was paused.
1012
+ */
1013
+ /**
1014
+ * Pause the video if it’s playing.
1015
+ *
1016
+ * @return {PausePromise}
1017
+ */
1018
+ }, {
1019
+ key: "pause",
1020
+ value: function pause() {
1021
+ return this.callMethod("pause");
1022
+ }
1023
+ /**
1024
+ * A promise to play the video.
1025
+ *
1026
+ * @promise PlayPromise
1027
+ * @fulfill {void} The video was played.
1028
+ */
1029
+ /**
1030
+ * Play the video if it’s paused. **Note:** on iOS and some other
1031
+ * mobile devices, you cannot programmatically trigger play. Once the
1032
+ * viewer has tapped on the play button in the player, however, you
1033
+ * will be able to use this function.
1034
+ *
1035
+ * @return {PlayPromise}
1036
+ */
1037
+ }, {
1038
+ key: "play",
1039
+ value: function play() {
1040
+ return this.callMethod("play");
1041
+ }
1042
+ /**
1043
+ * A promise to unload the video.
1044
+ *
1045
+ * @promise UnloadPromise
1046
+ * @fulfill {void} The video was unloaded.
1047
+ */
1048
+ /**
1049
+ * Return the player to its initial state.
1050
+ *
1051
+ * @return {UnloadPromise}
1052
+ */
1053
+ }, {
1054
+ key: "unload",
1055
+ value: function unload() {
1056
+ return this.callMethod("unload");
1057
+ }
1058
+ /**
1059
+ * Cleanup the player and remove it from the DOM
1060
+ *
1061
+ * It won't be usable and a new one should be constructed
1062
+ * in order to do any operations.
1063
+ *
1064
+ * @return {Promise}
1065
+ */
1066
+ }, {
1067
+ key: "destroy",
1068
+ value: function destroy() {
1069
+ var _this5 = this;
1070
+ return new npo_src(function(resolve) {
1071
+ readyMap.delete(_this5);
1072
+ playerMap.delete(_this5.element);
1073
+ if (_this5._originalElement) {
1074
+ playerMap.delete(_this5._originalElement);
1075
+ _this5._originalElement.removeAttribute("data-vimeo-initialized");
1076
+ }
1077
+ if (_this5.element && _this5.element.nodeName === "IFRAME" && _this5.element.parentNode) {
1078
+ _this5.element.parentNode.removeChild(_this5.element);
1079
+ }
1080
+ resolve();
1081
+ });
1082
+ }
1083
+ /**
1084
+ * A promise to get the autopause behavior of the video.
1085
+ *
1086
+ * @promise GetAutopausePromise
1087
+ * @fulfill {boolean} Whether autopause is turned on or off.
1088
+ * @reject {UnsupportedError} Autopause is not supported with the current
1089
+ * player or browser.
1090
+ */
1091
+ /**
1092
+ * Get the autopause behavior for this player.
1093
+ *
1094
+ * @return {GetAutopausePromise}
1095
+ */
1096
+ }, {
1097
+ key: "getAutopause",
1098
+ value: function getAutopause() {
1099
+ return this.get("autopause");
1100
+ }
1101
+ /**
1102
+ * A promise to set the autopause behavior of the video.
1103
+ *
1104
+ * @promise SetAutopausePromise
1105
+ * @fulfill {boolean} Whether autopause is turned on or off.
1106
+ * @reject {UnsupportedError} Autopause is not supported with the current
1107
+ * player or browser.
1108
+ */
1109
+ /**
1110
+ * Enable or disable the autopause behavior of this player.
1111
+ *
1112
+ * By default, when another video is played in the same browser, this
1113
+ * player will automatically pause. Unless you have a specific reason
1114
+ * for doing so, we recommend that you leave autopause set to the
1115
+ * default (`true`).
1116
+ *
1117
+ * @param {boolean} autopause
1118
+ * @return {SetAutopausePromise}
1119
+ */
1120
+ }, {
1121
+ key: "setAutopause",
1122
+ value: function setAutopause(autopause) {
1123
+ return this.set("autopause", autopause);
1124
+ }
1125
+ /**
1126
+ * A promise to get the buffered property of the video.
1127
+ *
1128
+ * @promise GetBufferedPromise
1129
+ * @fulfill {Array} Buffered Timeranges converted to an Array.
1130
+ */
1131
+ /**
1132
+ * Get the buffered property of the video.
1133
+ *
1134
+ * @return {GetBufferedPromise}
1135
+ */
1136
+ }, {
1137
+ key: "getBuffered",
1138
+ value: function getBuffered() {
1139
+ return this.get("buffered");
1140
+ }
1141
+ /**
1142
+ * A promise to get the color of the player.
1143
+ *
1144
+ * @promise GetColorPromise
1145
+ * @fulfill {string} The hex color of the player.
1146
+ */
1147
+ /**
1148
+ * Get the color for this player.
1149
+ *
1150
+ * @return {GetColorPromise}
1151
+ */
1152
+ }, {
1153
+ key: "getColor",
1154
+ value: function getColor() {
1155
+ return this.get("color");
1156
+ }
1157
+ /**
1158
+ * A promise to set the color of the player.
1159
+ *
1160
+ * @promise SetColorPromise
1161
+ * @fulfill {string} The color was successfully set.
1162
+ * @reject {TypeError} The string was not a valid hex or rgb color.
1163
+ * @reject {ContrastError} The color was set, but the contrast is
1164
+ * outside of the acceptable range.
1165
+ * @reject {EmbedSettingsError} The owner of the player has chosen to
1166
+ * use a specific color.
1167
+ */
1168
+ /**
1169
+ * Set the color of this player to a hex or rgb string. Setting the
1170
+ * color may fail if the owner of the video has set their embed
1171
+ * preferences to force a specific color.
1172
+ *
1173
+ * @param {string} color The hex or rgb color string to set.
1174
+ * @return {SetColorPromise}
1175
+ */
1176
+ }, {
1177
+ key: "setColor",
1178
+ value: function setColor(color) {
1179
+ return this.set("color", color);
1180
+ }
1181
+ /**
1182
+ * A representation of a cue point.
1183
+ *
1184
+ * @typedef {Object} VimeoCuePoint
1185
+ * @property {number} time The time of the cue point.
1186
+ * @property {object} data The data passed when adding the cue point.
1187
+ * @property {string} id The unique id for use with removeCuePoint.
1188
+ */
1189
+ /**
1190
+ * A promise to get the cue points of a video.
1191
+ *
1192
+ * @promise GetCuePointsPromise
1193
+ * @fulfill {VimeoCuePoint[]} The cue points added to the video.
1194
+ * @reject {UnsupportedError} Cue points are not supported with the current
1195
+ * player or browser.
1196
+ */
1197
+ /**
1198
+ * Get an array of the cue points added to the video.
1199
+ *
1200
+ * @return {GetCuePointsPromise}
1201
+ */
1202
+ }, {
1203
+ key: "getCuePoints",
1204
+ value: function getCuePoints() {
1205
+ return this.get("cuePoints");
1206
+ }
1207
+ /**
1208
+ * A promise to get the current time of the video.
1209
+ *
1210
+ * @promise GetCurrentTimePromise
1211
+ * @fulfill {number} The current time in seconds.
1212
+ */
1213
+ /**
1214
+ * Get the current playback position in seconds.
1215
+ *
1216
+ * @return {GetCurrentTimePromise}
1217
+ */
1218
+ }, {
1219
+ key: "getCurrentTime",
1220
+ value: function getCurrentTime() {
1221
+ return this.get("currentTime");
1222
+ }
1223
+ /**
1224
+ * A promise to set the current time of the video.
1225
+ *
1226
+ * @promise SetCurrentTimePromise
1227
+ * @fulfill {number} The actual current time that was set.
1228
+ * @reject {RangeError} the time was less than 0 or greater than the
1229
+ * video’s duration.
1230
+ */
1231
+ /**
1232
+ * Set the current playback position in seconds. If the player was
1233
+ * paused, it will remain paused. Likewise, if the player was playing,
1234
+ * it will resume playing once the video has buffered.
1235
+ *
1236
+ * You can provide an accurate time and the player will attempt to seek
1237
+ * to as close to that time as possible. The exact time will be the
1238
+ * fulfilled value of the promise.
1239
+ *
1240
+ * @param {number} currentTime
1241
+ * @return {SetCurrentTimePromise}
1242
+ */
1243
+ }, {
1244
+ key: "setCurrentTime",
1245
+ value: function setCurrentTime(currentTime) {
1246
+ return this.set("currentTime", currentTime);
1247
+ }
1248
+ /**
1249
+ * A promise to get the duration of the video.
1250
+ *
1251
+ * @promise GetDurationPromise
1252
+ * @fulfill {number} The duration in seconds.
1253
+ */
1254
+ /**
1255
+ * Get the duration of the video in seconds. It will be rounded to the
1256
+ * nearest second before playback begins, and to the nearest thousandth
1257
+ * of a second after playback begins.
1258
+ *
1259
+ * @return {GetDurationPromise}
1260
+ */
1261
+ }, {
1262
+ key: "getDuration",
1263
+ value: function getDuration() {
1264
+ return this.get("duration");
1265
+ }
1266
+ /**
1267
+ * A promise to get the ended state of the video.
1268
+ *
1269
+ * @promise GetEndedPromise
1270
+ * @fulfill {boolean} Whether or not the video has ended.
1271
+ */
1272
+ /**
1273
+ * Get the ended state of the video. The video has ended if
1274
+ * `currentTime === duration`.
1275
+ *
1276
+ * @return {GetEndedPromise}
1277
+ */
1278
+ }, {
1279
+ key: "getEnded",
1280
+ value: function getEnded() {
1281
+ return this.get("ended");
1282
+ }
1283
+ /**
1284
+ * A promise to get the loop state of the player.
1285
+ *
1286
+ * @promise GetLoopPromise
1287
+ * @fulfill {boolean} Whether or not the player is set to loop.
1288
+ */
1289
+ /**
1290
+ * Get the loop state of the player.
1291
+ *
1292
+ * @return {GetLoopPromise}
1293
+ */
1294
+ }, {
1295
+ key: "getLoop",
1296
+ value: function getLoop() {
1297
+ return this.get("loop");
1298
+ }
1299
+ /**
1300
+ * A promise to set the loop state of the player.
1301
+ *
1302
+ * @promise SetLoopPromise
1303
+ * @fulfill {boolean} The loop state that was set.
1304
+ */
1305
+ /**
1306
+ * Set the loop state of the player. When set to `true`, the player
1307
+ * will start over immediately once playback ends.
1308
+ *
1309
+ * @param {boolean} loop
1310
+ * @return {SetLoopPromise}
1311
+ */
1312
+ }, {
1313
+ key: "setLoop",
1314
+ value: function setLoop(loop) {
1315
+ return this.set("loop", loop);
1316
+ }
1317
+ /**
1318
+ * A promise to get the paused state of the player.
1319
+ *
1320
+ * @promise GetLoopPromise
1321
+ * @fulfill {boolean} Whether or not the video is paused.
1322
+ */
1323
+ /**
1324
+ * Get the paused state of the player.
1325
+ *
1326
+ * @return {GetLoopPromise}
1327
+ */
1328
+ }, {
1329
+ key: "getPaused",
1330
+ value: function getPaused() {
1331
+ return this.get("paused");
1332
+ }
1333
+ /**
1334
+ * A promise to get the playback rate of the player.
1335
+ *
1336
+ * @promise GetPlaybackRatePromise
1337
+ * @fulfill {number} The playback rate of the player on a scale from 0.5 to 2.
1338
+ */
1339
+ /**
1340
+ * Get the playback rate of the player on a scale from `0.5` to `2`.
1341
+ *
1342
+ * @return {GetPlaybackRatePromise}
1343
+ */
1344
+ }, {
1345
+ key: "getPlaybackRate",
1346
+ value: function getPlaybackRate() {
1347
+ return this.get("playbackRate");
1348
+ }
1349
+ /**
1350
+ * A promise to set the playbackrate of the player.
1351
+ *
1352
+ * @promise SetPlaybackRatePromise
1353
+ * @fulfill {number} The playback rate was set.
1354
+ * @reject {RangeError} The playback rate was less than 0.5 or greater than 2.
1355
+ */
1356
+ /**
1357
+ * Set the playback rate of the player on a scale from `0.5` to `2`. When set
1358
+ * via the API, the playback rate will not be synchronized to other
1359
+ * players or stored as the viewer's preference.
1360
+ *
1361
+ * @param {number} playbackRate
1362
+ * @return {SetPlaybackRatePromise}
1363
+ */
1364
+ }, {
1365
+ key: "setPlaybackRate",
1366
+ value: function setPlaybackRate(playbackRate) {
1367
+ return this.set("playbackRate", playbackRate);
1368
+ }
1369
+ /**
1370
+ * A promise to get the played property of the video.
1371
+ *
1372
+ * @promise GetPlayedPromise
1373
+ * @fulfill {Array} Played Timeranges converted to an Array.
1374
+ */
1375
+ /**
1376
+ * Get the played property of the video.
1377
+ *
1378
+ * @return {GetPlayedPromise}
1379
+ */
1380
+ }, {
1381
+ key: "getPlayed",
1382
+ value: function getPlayed() {
1383
+ return this.get("played");
1384
+ }
1385
+ /**
1386
+ * A promise to get the seekable property of the video.
1387
+ *
1388
+ * @promise GetSeekablePromise
1389
+ * @fulfill {Array} Seekable Timeranges converted to an Array.
1390
+ */
1391
+ /**
1392
+ * Get the seekable property of the video.
1393
+ *
1394
+ * @return {GetSeekablePromise}
1395
+ */
1396
+ }, {
1397
+ key: "getSeekable",
1398
+ value: function getSeekable() {
1399
+ return this.get("seekable");
1400
+ }
1401
+ /**
1402
+ * A promise to get the seeking property of the player.
1403
+ *
1404
+ * @promise GetSeekingPromise
1405
+ * @fulfill {boolean} Whether or not the player is currently seeking.
1406
+ */
1407
+ /**
1408
+ * Get if the player is currently seeking.
1409
+ *
1410
+ * @return {GetSeekingPromise}
1411
+ */
1412
+ }, {
1413
+ key: "getSeeking",
1414
+ value: function getSeeking() {
1415
+ return this.get("seeking");
1416
+ }
1417
+ /**
1418
+ * A promise to get the text tracks of a video.
1419
+ *
1420
+ * @promise GetTextTracksPromise
1421
+ * @fulfill {VimeoTextTrack[]} The text tracks associated with the video.
1422
+ */
1423
+ /**
1424
+ * Get an array of the text tracks that exist for the video.
1425
+ *
1426
+ * @return {GetTextTracksPromise}
1427
+ */
1428
+ }, {
1429
+ key: "getTextTracks",
1430
+ value: function getTextTracks() {
1431
+ return this.get("textTracks");
1432
+ }
1433
+ /**
1434
+ * A promise to get the embed code for the video.
1435
+ *
1436
+ * @promise GetVideoEmbedCodePromise
1437
+ * @fulfill {string} The `<iframe>` embed code for the video.
1438
+ */
1439
+ /**
1440
+ * Get the `<iframe>` embed code for the video.
1441
+ *
1442
+ * @return {GetVideoEmbedCodePromise}
1443
+ */
1444
+ }, {
1445
+ key: "getVideoEmbedCode",
1446
+ value: function getVideoEmbedCode() {
1447
+ return this.get("videoEmbedCode");
1448
+ }
1449
+ /**
1450
+ * A promise to get the id of the video.
1451
+ *
1452
+ * @promise GetVideoIdPromise
1453
+ * @fulfill {number} The id of the video.
1454
+ */
1455
+ /**
1456
+ * Get the id of the video.
1457
+ *
1458
+ * @return {GetVideoIdPromise}
1459
+ */
1460
+ }, {
1461
+ key: "getVideoId",
1462
+ value: function getVideoId() {
1463
+ return this.get("videoId");
1464
+ }
1465
+ /**
1466
+ * A promise to get the title of the video.
1467
+ *
1468
+ * @promise GetVideoTitlePromise
1469
+ * @fulfill {number} The title of the video.
1470
+ */
1471
+ /**
1472
+ * Get the title of the video.
1473
+ *
1474
+ * @return {GetVideoTitlePromise}
1475
+ */
1476
+ }, {
1477
+ key: "getVideoTitle",
1478
+ value: function getVideoTitle() {
1479
+ return this.get("videoTitle");
1480
+ }
1481
+ /**
1482
+ * A promise to get the native width of the video.
1483
+ *
1484
+ * @promise GetVideoWidthPromise
1485
+ * @fulfill {number} The native width of the video.
1486
+ */
1487
+ /**
1488
+ * Get the native width of the currently‐playing video. The width of
1489
+ * the highest‐resolution available will be used before playback begins.
1490
+ *
1491
+ * @return {GetVideoWidthPromise}
1492
+ */
1493
+ }, {
1494
+ key: "getVideoWidth",
1495
+ value: function getVideoWidth() {
1496
+ return this.get("videoWidth");
1497
+ }
1498
+ /**
1499
+ * A promise to get the native height of the video.
1500
+ *
1501
+ * @promise GetVideoHeightPromise
1502
+ * @fulfill {number} The native height of the video.
1503
+ */
1504
+ /**
1505
+ * Get the native height of the currently‐playing video. The height of
1506
+ * the highest‐resolution available will be used before playback begins.
1507
+ *
1508
+ * @return {GetVideoHeightPromise}
1509
+ */
1510
+ }, {
1511
+ key: "getVideoHeight",
1512
+ value: function getVideoHeight() {
1513
+ return this.get("videoHeight");
1514
+ }
1515
+ /**
1516
+ * A promise to get the vimeo.com url for the video.
1517
+ *
1518
+ * @promise GetVideoUrlPromise
1519
+ * @fulfill {number} The vimeo.com url for the video.
1520
+ * @reject {PrivacyError} The url isn’t available because of the video’s privacy setting.
1521
+ */
1522
+ /**
1523
+ * Get the vimeo.com url for the video.
1524
+ *
1525
+ * @return {GetVideoUrlPromise}
1526
+ */
1527
+ }, {
1528
+ key: "getVideoUrl",
1529
+ value: function getVideoUrl() {
1530
+ return this.get("videoUrl");
1531
+ }
1532
+ /**
1533
+ * A promise to get the volume level of the player.
1534
+ *
1535
+ * @promise GetVolumePromise
1536
+ * @fulfill {number} The volume level of the player on a scale from 0 to 1.
1537
+ */
1538
+ /**
1539
+ * Get the current volume level of the player on a scale from `0` to `1`.
1540
+ *
1541
+ * Most mobile devices do not support an independent volume from the
1542
+ * system volume. In those cases, this method will always return `1`.
1543
+ *
1544
+ * @return {GetVolumePromise}
1545
+ */
1546
+ }, {
1547
+ key: "getVolume",
1548
+ value: function getVolume() {
1549
+ return this.get("volume");
1550
+ }
1551
+ /**
1552
+ * A promise to set the volume level of the player.
1553
+ *
1554
+ * @promise SetVolumePromise
1555
+ * @fulfill {number} The volume was set.
1556
+ * @reject {RangeError} The volume was less than 0 or greater than 1.
1557
+ */
1558
+ /**
1559
+ * Set the volume of the player on a scale from `0` to `1`. When set
1560
+ * via the API, the volume level will not be synchronized to other
1561
+ * players or stored as the viewer’s preference.
1562
+ *
1563
+ * Most mobile devices do not support setting the volume. An error will
1564
+ * *not* be triggered in that situation.
1565
+ *
1566
+ * @param {number} volume
1567
+ * @return {SetVolumePromise}
1568
+ */
1569
+ }, {
1570
+ key: "setVolume",
1571
+ value: function setVolume(volume) {
1572
+ return this.set("volume", volume);
1573
+ }
1574
+ }]);
1575
+ return Player2;
1576
+ }();
1577
+ if (!isNode) {
1578
+ initializeEmbeds();
1579
+ resizeEmbeds();
1580
+ }
1581
+ var player_es_default = Player;
1582
+ export {
1583
+ player_es_default as default
1584
+ };
1585
+ /*! Bundled license information:
1586
+
1587
+ @vimeo/player/dist/player.es.js:
1588
+ (*! @vimeo/player v2.8.2 | (c) 2019 Vimeo | MIT License | https://github.com/vimeo/player.js *)
1589
+ (*!
1590
+ * weakmap-polyfill v2.0.0 - ECMAScript6 WeakMap polyfill
1591
+ * https://github.com/polygonplanet/weakmap-polyfill
1592
+ * Copyright (c) 2015-2016 polygon planet <polygon.planet.aqua@gmail.com>
1593
+ * @license MIT
1594
+ *)
1595
+ (*! Native Promise Only
1596
+ v0.8.1 (c) Kyle Simpson
1597
+ MIT License: http://getify.mit-license.org
1598
+ *)
1599
+ */
1600
+ //# sourceMappingURL=player.es-EHCCDTX6.mjs.map