@micromag/core 0.4.69 → 0.4.74
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.
- package/assets/css/styles.css +0 -1
- package/assets/css/vendor.css +2 -3
- package/es/components.d.ts +99 -56
- package/es/components.js +5098 -2330
- package/es/contexts.d.ts +139 -67
- package/es/contexts.js +2183 -1240
- package/es/hooks.d.ts +29 -73
- package/es/hooks.js +2522 -2155
- package/es/index.d.ts +51 -8
- package/es/index.js +1284 -1525
- package/es/styles.css +0 -1
- package/es/utils.d.ts +157 -15
- package/es/utils.js +748 -882
- package/package.json +36 -40
- package/lib/components.js +0 -3404
- package/lib/contexts.js +0 -1763
- package/lib/hooks.js +0 -2535
- package/lib/index.js +0 -1713
- package/lib/styles.css +0 -35
- package/lib/utils.js +0 -1284
package/es/contexts.js
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { c } from 'react/compiler-runtime';
|
|
2
2
|
import isString from 'lodash/isString';
|
|
3
|
-
import React, {
|
|
3
|
+
import React, { createContext, use, useState, useEffect, useContext, useRef, useMemo } from 'react';
|
|
4
4
|
import { ComponentsManager, FieldsManager, ScreensManager, ColorsParser, Tracking } from '@micromag/core';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
|
-
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
7
6
|
import JSCookie from 'js-cookie';
|
|
8
7
|
import { defineMessages, useIntl } from 'react-intl';
|
|
9
|
-
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
10
|
-
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
11
8
|
import uniqBy from 'lodash/uniqBy';
|
|
12
9
|
import { getJSON } from '@folklore/fetch';
|
|
13
10
|
import isObject from 'lodash/isObject';
|
|
14
11
|
import { loadGoogleApi, loadGoogleMaps } from '@folklore/services';
|
|
15
|
-
import { getDisplayName, getScreenExtraField } from '@micromag/core/utils';
|
|
12
|
+
import { getDisplayName, getMediaIsPlaying, getMediaSrc, getMediaHasAudio, getMediaFilename, getMediaDuration, getScreenExtraField } from '@micromag/core/utils';
|
|
13
|
+
import createDebug from 'debug';
|
|
16
14
|
import { useUrlGenerator } from '@folklore/routes';
|
|
17
15
|
export { RoutesContext, RoutesProvider, useRoutes, useUrlGenerator } from '@folklore/routes';
|
|
18
16
|
import { TrackingContainer, TrackingContext } from '@folklore/tracking';
|
|
@@ -20,115 +18,131 @@ export { TrackingContext } from '@folklore/tracking';
|
|
|
20
18
|
import EventEmitter from 'wolfy87-eventemitter';
|
|
21
19
|
import { useLocation } from 'wouter';
|
|
22
20
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
const MODALS_NAMESPACE = 'modals';
|
|
22
|
+
const FIELDS_NAMESPACE = 'fields';
|
|
23
|
+
const FORMS_NAMESPACE = 'forms';
|
|
24
|
+
const SCREENS_NAMESPACE = 'screens';
|
|
25
|
+
const ELEMENTS_NAMESPACE = 'elements';
|
|
26
|
+
const ComponentsContext = /*#__PURE__*/createContext(null);
|
|
27
|
+
const emptyComponents = {};
|
|
30
28
|
|
|
31
29
|
/**
|
|
32
30
|
* Hooks
|
|
33
31
|
*/
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
var finalManager = useMemo(function () {
|
|
38
|
-
return namespace !== null ? new ComponentsManager(manager.getComponents(namespace)) : manager;
|
|
39
|
-
}, [manager, namespace]);
|
|
40
|
-
return finalManager;
|
|
32
|
+
const useComponentsManager = (namespace = null) => {
|
|
33
|
+
const manager = use(ComponentsContext);
|
|
34
|
+
return namespace !== null ? new ComponentsManager(manager?.getComponents(namespace)) : manager;
|
|
41
35
|
};
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
36
|
+
const useComponents = (t0, t1) => {
|
|
37
|
+
const $ = c(4);
|
|
38
|
+
const namespace = t0 === undefined ? null : t0;
|
|
39
|
+
const defaultComponents = t1 === undefined ? emptyComponents : t1;
|
|
40
|
+
const manager = useComponentsManager();
|
|
41
|
+
let t2;
|
|
42
|
+
if ($[0] !== defaultComponents || $[1] !== manager || $[2] !== namespace) {
|
|
43
|
+
t2 = manager?.getComponents(namespace) || defaultComponents;
|
|
44
|
+
$[0] = defaultComponents;
|
|
45
|
+
$[1] = manager;
|
|
46
|
+
$[2] = namespace;
|
|
47
|
+
$[3] = t2;
|
|
48
|
+
} else {
|
|
49
|
+
t2 = $[3];
|
|
50
|
+
}
|
|
51
|
+
return t2;
|
|
47
52
|
};
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
const useComponent = (name, t0, t1) => {
|
|
54
|
+
const $ = c(4);
|
|
55
|
+
const defaultComponent = t0 === undefined ? null : t0;
|
|
56
|
+
const namespace = t1 === undefined ? null : t1;
|
|
57
|
+
const manager = useComponentsManager(namespace);
|
|
58
|
+
if (!isString(name)) {
|
|
59
|
+
return name || defaultComponent;
|
|
60
|
+
}
|
|
61
|
+
let t2;
|
|
62
|
+
if ($[0] !== defaultComponent || $[1] !== manager || $[2] !== name) {
|
|
63
|
+
t2 = manager?.getComponent(name) || defaultComponent;
|
|
64
|
+
$[0] = defaultComponent;
|
|
65
|
+
$[1] = manager;
|
|
66
|
+
$[2] = name;
|
|
67
|
+
$[3] = t2;
|
|
68
|
+
} else {
|
|
69
|
+
t2 = $[3];
|
|
70
|
+
}
|
|
71
|
+
return t2;
|
|
58
72
|
};
|
|
59
73
|
|
|
60
74
|
/**
|
|
61
75
|
* Fields hooks
|
|
62
76
|
*/
|
|
63
|
-
|
|
77
|
+
const useFieldsComponentsManager = () => {
|
|
64
78
|
return useComponentsManager(FIELDS_NAMESPACE);
|
|
65
79
|
};
|
|
66
|
-
|
|
67
|
-
|
|
80
|
+
const useFieldsComponents = t0 => {
|
|
81
|
+
const defaultComponents = t0 === undefined ? emptyComponents : t0;
|
|
68
82
|
return useComponents(FIELDS_NAMESPACE, defaultComponents);
|
|
69
83
|
};
|
|
70
|
-
|
|
71
|
-
|
|
84
|
+
const useFieldComponent = (name, t0) => {
|
|
85
|
+
const defaultComponent = t0 === undefined ? null : t0;
|
|
72
86
|
return useComponent(name, defaultComponent, FIELDS_NAMESPACE);
|
|
73
87
|
};
|
|
74
88
|
|
|
75
89
|
/**
|
|
76
90
|
* Screens hooks
|
|
77
91
|
*/
|
|
78
|
-
|
|
92
|
+
const useScreensComponentsManager = () => {
|
|
79
93
|
return useComponentsManager(SCREENS_NAMESPACE);
|
|
80
94
|
};
|
|
81
|
-
|
|
82
|
-
|
|
95
|
+
const useScreensComponents = t0 => {
|
|
96
|
+
const defaultComponents = t0 === undefined ? emptyComponents : t0;
|
|
83
97
|
return useComponents(SCREENS_NAMESPACE, defaultComponents);
|
|
84
98
|
};
|
|
85
|
-
|
|
86
|
-
|
|
99
|
+
const useScreenComponent = (name, t0) => {
|
|
100
|
+
const defaultComponent = t0 === undefined ? null : t0;
|
|
87
101
|
return useComponent(name, defaultComponent, SCREENS_NAMESPACE);
|
|
88
102
|
};
|
|
89
103
|
|
|
90
104
|
/**
|
|
91
105
|
* Forms hooks
|
|
92
106
|
*/
|
|
93
|
-
|
|
107
|
+
const useFormsComponentsManager = () => {
|
|
94
108
|
return useComponentsManager(FORMS_NAMESPACE);
|
|
95
109
|
};
|
|
96
|
-
|
|
97
|
-
|
|
110
|
+
const useFormsComponents = t0 => {
|
|
111
|
+
const defaultComponents = t0 === undefined ? emptyComponents : t0;
|
|
98
112
|
return useComponents(FORMS_NAMESPACE, defaultComponents);
|
|
99
113
|
};
|
|
100
|
-
|
|
101
|
-
|
|
114
|
+
const useFormComponent = (name, t0) => {
|
|
115
|
+
const defaultComponent = t0 === undefined ? null : t0;
|
|
102
116
|
return useComponent(name, defaultComponent, FORMS_NAMESPACE);
|
|
103
117
|
};
|
|
104
118
|
|
|
105
119
|
/**
|
|
106
120
|
* Modals hooks
|
|
107
121
|
*/
|
|
108
|
-
|
|
122
|
+
const useModalsComponentsManager = () => {
|
|
109
123
|
return useComponentsManager(MODALS_NAMESPACE);
|
|
110
124
|
};
|
|
111
|
-
|
|
112
|
-
|
|
125
|
+
const useModalsComponents = t0 => {
|
|
126
|
+
const defaultComponents = t0 === undefined ? emptyComponents : t0;
|
|
113
127
|
return useComponents(MODALS_NAMESPACE, defaultComponents);
|
|
114
128
|
};
|
|
115
|
-
|
|
116
|
-
|
|
129
|
+
const useModalComponent = (name, t0) => {
|
|
130
|
+
const defaultComponent = t0 === undefined ? null : t0;
|
|
117
131
|
return useComponent(name, defaultComponent, MODALS_NAMESPACE);
|
|
118
132
|
};
|
|
119
133
|
|
|
120
134
|
/**
|
|
121
135
|
* Elements hooks
|
|
122
136
|
*/
|
|
123
|
-
|
|
137
|
+
const useElementsComponentsManager = () => {
|
|
124
138
|
return useComponentsManager(ELEMENTS_NAMESPACE);
|
|
125
139
|
};
|
|
126
|
-
|
|
127
|
-
|
|
140
|
+
const useElementsComponents = t0 => {
|
|
141
|
+
const defaultComponents = t0 === undefined ? emptyComponents : t0;
|
|
128
142
|
return useComponents(ELEMENTS_NAMESPACE, defaultComponents);
|
|
129
143
|
};
|
|
130
|
-
|
|
131
|
-
|
|
144
|
+
const useElementComponent = (name, t0) => {
|
|
145
|
+
const defaultComponent = t0 === undefined ? null : t0;
|
|
132
146
|
return useComponent(name, defaultComponent, ELEMENTS_NAMESPACE);
|
|
133
147
|
};
|
|
134
148
|
|
|
@@ -136,125 +150,108 @@ var useElementComponent = function useElementComponent(name) {
|
|
|
136
150
|
* Provider
|
|
137
151
|
*/
|
|
138
152
|
|
|
139
|
-
function ComponentsProvider(
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
manager
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
function ComponentsProvider(t0) {
|
|
154
|
+
const $ = c(8);
|
|
155
|
+
const {
|
|
156
|
+
components: t1,
|
|
157
|
+
manager: t2,
|
|
158
|
+
namespace: t3,
|
|
159
|
+
children
|
|
160
|
+
} = t0;
|
|
161
|
+
const components = t1 === undefined ? emptyComponents : t1;
|
|
162
|
+
const manager = t2 === undefined ? null : t2;
|
|
163
|
+
const namespace = t3 === undefined ? null : t3;
|
|
164
|
+
const previousManager = useComponentsManager() || null;
|
|
165
|
+
let t4;
|
|
166
|
+
if ($[0] !== components || $[1] !== manager || $[2] !== namespace || $[3] !== previousManager) {
|
|
167
|
+
t4 = new ComponentsManager({
|
|
168
|
+
...(previousManager !== null ? previousManager.getComponents() : null),
|
|
169
|
+
...(manager !== null ? manager.getComponents() : null),
|
|
170
|
+
...new ComponentsManager(components).addNamespace(namespace).getComponents()
|
|
171
|
+
});
|
|
172
|
+
$[0] = components;
|
|
173
|
+
$[1] = manager;
|
|
174
|
+
$[2] = namespace;
|
|
175
|
+
$[3] = previousManager;
|
|
176
|
+
$[4] = t4;
|
|
177
|
+
} else {
|
|
178
|
+
t4 = $[4];
|
|
179
|
+
}
|
|
180
|
+
const finalManager = t4;
|
|
181
|
+
let t5;
|
|
182
|
+
if ($[5] !== children || $[6] !== finalManager) {
|
|
183
|
+
t5 = /*#__PURE__*/jsx(ComponentsContext, {
|
|
184
|
+
value: finalManager,
|
|
185
|
+
children: children
|
|
186
|
+
});
|
|
187
|
+
$[5] = children;
|
|
188
|
+
$[6] = finalManager;
|
|
189
|
+
$[7] = t5;
|
|
190
|
+
} else {
|
|
191
|
+
t5 = $[7];
|
|
192
|
+
}
|
|
193
|
+
return t5;
|
|
155
194
|
}
|
|
156
195
|
|
|
157
|
-
|
|
196
|
+
const messages = defineMessages({
|
|
158
197
|
functionality_title: {
|
|
159
198
|
id: "consent.functionality_title",
|
|
160
|
-
defaultMessage:
|
|
161
|
-
"type": 0,
|
|
162
|
-
"value": "Functionnal"
|
|
163
|
-
}]
|
|
199
|
+
defaultMessage: "Functionnal"
|
|
164
200
|
},
|
|
165
201
|
functionality_description: {
|
|
166
202
|
id: "consent.functionality_description",
|
|
167
|
-
defaultMessage:
|
|
168
|
-
"type": 0,
|
|
169
|
-
"value": "Cookies required for the site to function properly."
|
|
170
|
-
}]
|
|
203
|
+
defaultMessage: "Cookies required for the site to function properly."
|
|
171
204
|
},
|
|
172
205
|
analytics_title: {
|
|
173
206
|
id: "consent.analytics_title",
|
|
174
|
-
defaultMessage:
|
|
175
|
-
"type": 0,
|
|
176
|
-
"value": "Analytics"
|
|
177
|
-
}]
|
|
207
|
+
defaultMessage: "Analytics"
|
|
178
208
|
},
|
|
179
209
|
analytics_description: {
|
|
180
210
|
id: "consent.analytics_description",
|
|
181
|
-
defaultMessage:
|
|
182
|
-
"type": 0,
|
|
183
|
-
"value": "Cookies used to measure user behavior."
|
|
184
|
-
}]
|
|
211
|
+
defaultMessage: "Cookies used to measure user behavior."
|
|
185
212
|
},
|
|
186
213
|
ad_storage_title: {
|
|
187
214
|
id: "consent.ad_storage_title",
|
|
188
|
-
defaultMessage:
|
|
189
|
-
"type": 0,
|
|
190
|
-
"value": "Ad Storage"
|
|
191
|
-
}]
|
|
215
|
+
defaultMessage: "Ad Storage"
|
|
192
216
|
},
|
|
193
217
|
ad_storage_description: {
|
|
194
218
|
id: "consent.ad_storage_description",
|
|
195
|
-
defaultMessage:
|
|
196
|
-
"type": 0,
|
|
197
|
-
"value": "Cookies used for advertising purposes."
|
|
198
|
-
}]
|
|
219
|
+
defaultMessage: "Cookies used for advertising purposes."
|
|
199
220
|
},
|
|
200
221
|
ad_personalization_title: {
|
|
201
222
|
id: "consent.ad_personalization_title",
|
|
202
|
-
defaultMessage:
|
|
203
|
-
"type": 0,
|
|
204
|
-
"value": "Ad Personalization"
|
|
205
|
-
}]
|
|
223
|
+
defaultMessage: "Ad Personalization"
|
|
206
224
|
},
|
|
207
225
|
ad_personalization_description: {
|
|
208
226
|
id: "consent.ad_personalization_description",
|
|
209
|
-
defaultMessage:
|
|
210
|
-
"type": 0,
|
|
211
|
-
"value": "Cookies used for ad targeting."
|
|
212
|
-
}]
|
|
227
|
+
defaultMessage: "Cookies used for ad targeting."
|
|
213
228
|
},
|
|
214
229
|
ad_user_data_title: {
|
|
215
230
|
id: "consent.ad_user_data_title",
|
|
216
|
-
defaultMessage:
|
|
217
|
-
"type": 0,
|
|
218
|
-
"value": "User Ad Data"
|
|
219
|
-
}]
|
|
231
|
+
defaultMessage: "User Ad Data"
|
|
220
232
|
},
|
|
221
233
|
ad_user_data_description: {
|
|
222
234
|
id: "consent.ad_user_data_description",
|
|
223
|
-
defaultMessage:
|
|
224
|
-
"type": 0,
|
|
225
|
-
"value": "Cookies used for user-specific ad data."
|
|
226
|
-
}]
|
|
235
|
+
defaultMessage: "Cookies used for user-specific ad data."
|
|
227
236
|
},
|
|
228
237
|
personalization_storage_title: {
|
|
229
238
|
id: "consent.personalization_storage_title",
|
|
230
|
-
defaultMessage:
|
|
231
|
-
"type": 0,
|
|
232
|
-
"value": "Personalization Storage"
|
|
233
|
-
}]
|
|
239
|
+
defaultMessage: "Personalization Storage"
|
|
234
240
|
},
|
|
235
241
|
personalization_storage_description: {
|
|
236
242
|
id: "consent.personalization_storage_description",
|
|
237
|
-
defaultMessage:
|
|
238
|
-
"type": 0,
|
|
239
|
-
"value": "Cookies used for personalizing user experience."
|
|
240
|
-
}]
|
|
243
|
+
defaultMessage: "Cookies used for personalizing user experience."
|
|
241
244
|
},
|
|
242
245
|
security_storage_title: {
|
|
243
246
|
id: "consent.security_storage_title",
|
|
244
|
-
defaultMessage:
|
|
245
|
-
"type": 0,
|
|
246
|
-
"value": "Security Storage"
|
|
247
|
-
}]
|
|
247
|
+
defaultMessage: "Security Storage"
|
|
248
248
|
},
|
|
249
249
|
security_storage_description: {
|
|
250
250
|
id: "consent.security_storage_description",
|
|
251
|
-
defaultMessage:
|
|
252
|
-
"type": 0,
|
|
253
|
-
"value": "Cookies used for security purposes."
|
|
254
|
-
}]
|
|
251
|
+
defaultMessage: "Cookies used for security purposes."
|
|
255
252
|
}
|
|
256
253
|
});
|
|
257
|
-
|
|
254
|
+
const consentStates = [{
|
|
258
255
|
id: 'functionality_storage',
|
|
259
256
|
label: messages.functionality_title,
|
|
260
257
|
description: messages.functionality_description,
|
|
@@ -291,730 +288,1275 @@ var consentStates = [{
|
|
|
291
288
|
description: messages.ad_user_data_description,
|
|
292
289
|
value: false
|
|
293
290
|
}];
|
|
294
|
-
|
|
291
|
+
const ConsentContext = /*#__PURE__*/React.createContext({
|
|
295
292
|
consent: null,
|
|
296
|
-
setConsent:
|
|
293
|
+
setConsent: () => {}
|
|
297
294
|
});
|
|
298
|
-
|
|
295
|
+
const useConsent = () => {
|
|
299
296
|
return useContext(ConsentContext);
|
|
300
297
|
};
|
|
301
|
-
|
|
302
|
-
function ConsentProvider(
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
// The consent state itself
|
|
333
|
-
var baseConsent = useMemo(function () {
|
|
334
|
-
return (providedConsent || consentStates || []).map(function (item) {
|
|
335
|
-
if (isString(item)) {
|
|
336
|
-
return (consentStates || []).find(function (it) {
|
|
337
|
-
return it.id === item;
|
|
338
|
-
}) || null;
|
|
339
|
-
}
|
|
340
|
-
return item || null;
|
|
341
|
-
}).filter(function (it) {
|
|
342
|
-
return it !== null;
|
|
343
|
-
}).map(function (it) {
|
|
344
|
-
return _objectSpread(_objectSpread({}, it), {}, {
|
|
345
|
-
value:
|
|
346
|
-
// eslint-disable-next-line no-nested-ternary
|
|
347
|
-
JSCookie.get(it.id) === 'granted' ? true : JSCookie.get(it.id) === 'denied' ? false : it.value
|
|
298
|
+
const defaultValues = ['functionality_storage', 'analytics_storage', 'ad_storage', 'ad_personalization', 'ad_user_data'];
|
|
299
|
+
function ConsentProvider(t0) {
|
|
300
|
+
const $ = c(23);
|
|
301
|
+
const {
|
|
302
|
+
consent: t1,
|
|
303
|
+
consented: t2,
|
|
304
|
+
expiration: t3,
|
|
305
|
+
children
|
|
306
|
+
} = t0;
|
|
307
|
+
const providedConsent = t1 === undefined ? defaultValues : t1;
|
|
308
|
+
const initialConsented = t2 === undefined ? null : t2;
|
|
309
|
+
const expiration = t3 === undefined ? 182 : t3;
|
|
310
|
+
let t4;
|
|
311
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
312
|
+
t4 = JSCookie.get("has_consented");
|
|
313
|
+
$[0] = t4;
|
|
314
|
+
} else {
|
|
315
|
+
t4 = $[0];
|
|
316
|
+
}
|
|
317
|
+
const initialCookieConsented = t4 === "true";
|
|
318
|
+
const baseConsented = initialConsented || initialCookieConsented;
|
|
319
|
+
const [consented, setConsentedState] = useState(baseConsented);
|
|
320
|
+
let t5;
|
|
321
|
+
if ($[1] !== expiration) {
|
|
322
|
+
t5 = t6 => {
|
|
323
|
+
const accept = t6 === undefined ? null : t6;
|
|
324
|
+
const hasConsented = accept || false;
|
|
325
|
+
JSCookie.set("has_consented", hasConsented, {
|
|
326
|
+
secure: true,
|
|
327
|
+
expires: expiration
|
|
348
328
|
});
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
});
|
|
364
|
-
acc[it.id] = 'granted';
|
|
365
|
-
} else if (it.value === false) {
|
|
366
|
-
JSCookie.set(it.id, 'denied', {
|
|
367
|
-
secure: true,
|
|
368
|
-
expires: expiration
|
|
369
|
-
});
|
|
370
|
-
acc[it.id] = 'denied';
|
|
371
|
-
} else {
|
|
372
|
-
JSCookie.remove(it.id);
|
|
373
|
-
acc[it.id] = 'denied';
|
|
329
|
+
setConsentedState(hasConsented);
|
|
330
|
+
};
|
|
331
|
+
$[1] = expiration;
|
|
332
|
+
$[2] = t5;
|
|
333
|
+
} else {
|
|
334
|
+
t5 = $[2];
|
|
335
|
+
}
|
|
336
|
+
const setConsented = t5;
|
|
337
|
+
let t6;
|
|
338
|
+
let t7;
|
|
339
|
+
if ($[3] !== initialConsented || $[4] !== setConsented) {
|
|
340
|
+
t6 = () => {
|
|
341
|
+
if (initialConsented === true || initialConsented === false) {
|
|
342
|
+
setConsented(initialConsented);
|
|
374
343
|
}
|
|
375
|
-
return acc;
|
|
376
|
-
}, {});
|
|
377
|
-
if (typeof window !== 'undefined' && typeof window.gtag === 'function') {
|
|
378
|
-
window.gtag('consent', initial === true ? 'default' : 'update', tagManagerConsent);
|
|
379
|
-
window.gtag('event', initial === true ? 'consent_default' : 'consent_update', tagManagerConsent);
|
|
380
|
-
console.log('consent', initial === true ? 'default' : 'update', tagManagerConsent);
|
|
381
|
-
}
|
|
382
|
-
setConsentState(values);
|
|
383
|
-
}, [setConsentState, expiration]);
|
|
384
|
-
useEffect(function () {
|
|
385
|
-
if (baseConsent !== null && baseConsent.length > 0) {
|
|
386
|
-
setConsent(baseConsent);
|
|
387
|
-
}
|
|
388
|
-
}, [baseConsent, setConsent]);
|
|
389
|
-
var value = useMemo(function () {
|
|
390
|
-
return {
|
|
391
|
-
consent: consent,
|
|
392
|
-
setConsent: setConsent,
|
|
393
|
-
consented: consented,
|
|
394
|
-
setConsented: setConsented
|
|
395
344
|
};
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
345
|
+
t7 = [initialConsented, setConsented];
|
|
346
|
+
$[3] = initialConsented;
|
|
347
|
+
$[4] = setConsented;
|
|
348
|
+
$[5] = t6;
|
|
349
|
+
$[6] = t7;
|
|
350
|
+
} else {
|
|
351
|
+
t6 = $[5];
|
|
352
|
+
t7 = $[6];
|
|
353
|
+
}
|
|
354
|
+
useEffect(t6, t7);
|
|
355
|
+
let t8;
|
|
356
|
+
if ($[7] !== providedConsent) {
|
|
357
|
+
t8 = (providedConsent || consentStates || []).map(_temp$4).filter(_temp2$2).map(_temp3$2);
|
|
358
|
+
$[7] = providedConsent;
|
|
359
|
+
$[8] = t8;
|
|
360
|
+
} else {
|
|
361
|
+
t8 = $[8];
|
|
362
|
+
}
|
|
363
|
+
const baseConsent = t8;
|
|
364
|
+
const [consent, setConsentState] = useState(null);
|
|
365
|
+
let t9;
|
|
366
|
+
if ($[9] !== expiration) {
|
|
367
|
+
t9 = (t10, t11) => {
|
|
368
|
+
const values = t10 === undefined ? null : t10;
|
|
369
|
+
const initial = t11 === undefined ? false : t11;
|
|
370
|
+
const tagManagerConsent = (values || []).reduce((acc, it_2) => {
|
|
371
|
+
if (it_2.value === true) {
|
|
372
|
+
JSCookie.set(it_2.id, "granted", {
|
|
373
|
+
secure: true,
|
|
374
|
+
expires: expiration
|
|
375
|
+
});
|
|
376
|
+
acc[it_2.id] = "granted";
|
|
377
|
+
} else {
|
|
378
|
+
if (it_2.value === false) {
|
|
379
|
+
JSCookie.set(it_2.id, "denied", {
|
|
380
|
+
secure: true,
|
|
381
|
+
expires: expiration
|
|
382
|
+
});
|
|
383
|
+
acc[it_2.id] = "denied";
|
|
384
|
+
} else {
|
|
385
|
+
JSCookie.remove(it_2.id);
|
|
386
|
+
acc[it_2.id] = "denied";
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
return acc;
|
|
390
|
+
}, {});
|
|
391
|
+
if (typeof window !== "undefined" && typeof window.gtag === "function") {
|
|
392
|
+
window.gtag("consent", initial === true ? "default" : "update", tagManagerConsent);
|
|
393
|
+
window.gtag("event", initial === true ? "consent_default" : "consent_update", tagManagerConsent);
|
|
394
|
+
console.log("consent", initial === true ? "default" : "update", tagManagerConsent);
|
|
395
|
+
}
|
|
396
|
+
setConsentState(values);
|
|
397
|
+
};
|
|
398
|
+
$[9] = expiration;
|
|
399
|
+
$[10] = t9;
|
|
400
|
+
} else {
|
|
401
|
+
t9 = $[10];
|
|
402
|
+
}
|
|
403
|
+
const setConsent = t9;
|
|
404
|
+
let t10;
|
|
405
|
+
let t11;
|
|
406
|
+
if ($[11] !== baseConsent || $[12] !== setConsent) {
|
|
407
|
+
t10 = () => {
|
|
408
|
+
if (baseConsent !== null && baseConsent.length > 0) {
|
|
409
|
+
setConsent(baseConsent);
|
|
410
|
+
}
|
|
411
|
+
};
|
|
412
|
+
t11 = [baseConsent, setConsent];
|
|
413
|
+
$[11] = baseConsent;
|
|
414
|
+
$[12] = setConsent;
|
|
415
|
+
$[13] = t10;
|
|
416
|
+
$[14] = t11;
|
|
417
|
+
} else {
|
|
418
|
+
t10 = $[13];
|
|
419
|
+
t11 = $[14];
|
|
420
|
+
}
|
|
421
|
+
useEffect(t10, t11);
|
|
422
|
+
let t12;
|
|
423
|
+
if ($[15] !== consent || $[16] !== consented || $[17] !== setConsent || $[18] !== setConsented) {
|
|
424
|
+
t12 = {
|
|
425
|
+
consent,
|
|
426
|
+
setConsent,
|
|
427
|
+
consented,
|
|
428
|
+
setConsented
|
|
429
|
+
};
|
|
430
|
+
$[15] = consent;
|
|
431
|
+
$[16] = consented;
|
|
432
|
+
$[17] = setConsent;
|
|
433
|
+
$[18] = setConsented;
|
|
434
|
+
$[19] = t12;
|
|
435
|
+
} else {
|
|
436
|
+
t12 = $[19];
|
|
437
|
+
}
|
|
438
|
+
const value = t12;
|
|
439
|
+
let t13;
|
|
440
|
+
if ($[20] !== children || $[21] !== value) {
|
|
441
|
+
t13 = /*#__PURE__*/jsx(ConsentContext.Provider, {
|
|
442
|
+
value: value,
|
|
443
|
+
children: children
|
|
444
|
+
});
|
|
445
|
+
$[20] = children;
|
|
446
|
+
$[21] = value;
|
|
447
|
+
$[22] = t13;
|
|
448
|
+
} else {
|
|
449
|
+
t13 = $[22];
|
|
450
|
+
}
|
|
451
|
+
return t13;
|
|
452
|
+
}
|
|
453
|
+
function _temp3$2(it_1) {
|
|
454
|
+
return {
|
|
455
|
+
...it_1,
|
|
456
|
+
value: JSCookie.get(it_1.id) === "granted" ? true : JSCookie.get(it_1.id) === "denied" ? false : it_1.value
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
function _temp2$2(it_0) {
|
|
460
|
+
return it_0 !== null;
|
|
461
|
+
}
|
|
462
|
+
function _temp$4(item) {
|
|
463
|
+
if (isString(item)) {
|
|
464
|
+
return (consentStates || []).find(it => it.id === item) || null;
|
|
465
|
+
}
|
|
466
|
+
return item || null;
|
|
401
467
|
}
|
|
402
468
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
469
|
+
const FieldsContext = /*#__PURE__*/createContext(null);
|
|
470
|
+
const useFieldsManager = () => use(FieldsContext);
|
|
471
|
+
const useFieldDefinition = id => {
|
|
472
|
+
const $ = c(3);
|
|
473
|
+
const manager = useFieldsManager();
|
|
474
|
+
let t0;
|
|
475
|
+
if ($[0] !== id || $[1] !== manager) {
|
|
476
|
+
t0 = manager?.getDefinition(id);
|
|
477
|
+
$[0] = id;
|
|
478
|
+
$[1] = manager;
|
|
479
|
+
$[2] = t0;
|
|
480
|
+
} else {
|
|
481
|
+
t0 = $[2];
|
|
482
|
+
}
|
|
483
|
+
return t0;
|
|
410
484
|
};
|
|
411
|
-
function FieldsProvider(
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
manager
|
|
416
|
-
children
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
return isString(component) ? map :
|
|
485
|
+
function FieldsProvider(t0) {
|
|
486
|
+
const $ = c(11);
|
|
487
|
+
const {
|
|
488
|
+
fields: t1,
|
|
489
|
+
manager: t2,
|
|
490
|
+
children
|
|
491
|
+
} = t0;
|
|
492
|
+
const fields = t1 === undefined ? null : t1;
|
|
493
|
+
const manager = t2 === undefined ? null : t2;
|
|
494
|
+
const previousManager = useFieldsManager() || null;
|
|
495
|
+
let finalManager;
|
|
496
|
+
let t3;
|
|
497
|
+
if ($[0] !== fields || $[1] !== manager || $[2] !== previousManager) {
|
|
498
|
+
const newFields = uniqBy([...(fields || []), ...(manager !== null ? manager.getDefinitions() : []), ...(previousManager !== null ? previousManager.getDefinitions() : [])], _temp$3).reverse();
|
|
499
|
+
finalManager = new FieldsManager(newFields);
|
|
500
|
+
const newComponents = finalManager.getComponents();
|
|
501
|
+
t3 = Object.keys(newComponents).reduce((map, id_0) => {
|
|
502
|
+
const component = newComponents[id_0];
|
|
503
|
+
return isString(component) ? map : {
|
|
504
|
+
...map,
|
|
505
|
+
[id_0]: component
|
|
506
|
+
};
|
|
430
507
|
}, {});
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
508
|
+
$[0] = fields;
|
|
509
|
+
$[1] = manager;
|
|
510
|
+
$[2] = previousManager;
|
|
511
|
+
$[3] = finalManager;
|
|
512
|
+
$[4] = t3;
|
|
513
|
+
} else {
|
|
514
|
+
finalManager = $[3];
|
|
515
|
+
t3 = $[4];
|
|
516
|
+
}
|
|
517
|
+
const components = t3;
|
|
518
|
+
let t4;
|
|
519
|
+
if ($[5] !== children || $[6] !== components) {
|
|
520
|
+
t4 = /*#__PURE__*/jsx(ComponentsProvider, {
|
|
435
521
|
namespace: FIELDS_NAMESPACE,
|
|
436
522
|
components: components,
|
|
437
523
|
children: children
|
|
438
|
-
})
|
|
439
|
-
|
|
524
|
+
});
|
|
525
|
+
$[5] = children;
|
|
526
|
+
$[6] = components;
|
|
527
|
+
$[7] = t4;
|
|
528
|
+
} else {
|
|
529
|
+
t4 = $[7];
|
|
530
|
+
}
|
|
531
|
+
let t5;
|
|
532
|
+
if ($[8] !== finalManager || $[9] !== t4) {
|
|
533
|
+
t5 = /*#__PURE__*/jsx(FieldsContext, {
|
|
534
|
+
value: finalManager,
|
|
535
|
+
children: t4
|
|
536
|
+
});
|
|
537
|
+
$[8] = finalManager;
|
|
538
|
+
$[9] = t4;
|
|
539
|
+
$[10] = t5;
|
|
540
|
+
} else {
|
|
541
|
+
t5 = $[10];
|
|
542
|
+
}
|
|
543
|
+
return t5;
|
|
544
|
+
}
|
|
545
|
+
function _temp$3(t0) {
|
|
546
|
+
const {
|
|
547
|
+
id
|
|
548
|
+
} = t0;
|
|
549
|
+
return id;
|
|
440
550
|
}
|
|
441
551
|
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
}, [finalManager]);
|
|
476
|
-
var _useState = useState(initialComponents),
|
|
477
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
478
|
-
components = _useState2[0],
|
|
479
|
-
setComponents = _useState2[1];
|
|
480
|
-
useEffect(function () {
|
|
481
|
-
var onChange = function onChange() {
|
|
482
|
-
return setComponents(finalManager.getComponents());
|
|
552
|
+
const ScreensContext = /*#__PURE__*/createContext(null);
|
|
553
|
+
const useScreensManager = () => use(ScreensContext);
|
|
554
|
+
function ScreensProvider(t0) {
|
|
555
|
+
const $ = c(17);
|
|
556
|
+
const {
|
|
557
|
+
screens: t1,
|
|
558
|
+
namespaces: t2,
|
|
559
|
+
filterNamespaces: t3,
|
|
560
|
+
manager: t4,
|
|
561
|
+
children
|
|
562
|
+
} = t0;
|
|
563
|
+
const screens = t1 === undefined ? null : t1;
|
|
564
|
+
const namespaces = t2 === undefined ? null : t2;
|
|
565
|
+
const filterNamespaces = t3 === undefined ? false : t3;
|
|
566
|
+
const manager = t4 === undefined ? null : t4;
|
|
567
|
+
const previousManager = useScreensManager();
|
|
568
|
+
let t5;
|
|
569
|
+
if ($[0] !== filterNamespaces || $[1] !== manager || $[2] !== namespaces || $[3] !== previousManager || $[4] !== screens) {
|
|
570
|
+
t5 = () => {
|
|
571
|
+
let newManager = manager !== null ? manager : new ScreensManager(screens);
|
|
572
|
+
if ((previousManager || null) !== null) {
|
|
573
|
+
newManager = previousManager.merge(newManager);
|
|
574
|
+
}
|
|
575
|
+
if (filterNamespaces) {
|
|
576
|
+
newManager = newManager.filter(t6 => {
|
|
577
|
+
const {
|
|
578
|
+
namespaces: t7
|
|
579
|
+
} = t6;
|
|
580
|
+
const screenGroups = t7 === undefined ? null : t7;
|
|
581
|
+
return screenGroups === null || namespaces !== null && screenGroups.reduce((acc, id) => acc || namespaces.indexOf(id) !== -1, false);
|
|
582
|
+
});
|
|
583
|
+
}
|
|
584
|
+
return newManager;
|
|
483
585
|
};
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
586
|
+
$[0] = filterNamespaces;
|
|
587
|
+
$[1] = manager;
|
|
588
|
+
$[2] = namespaces;
|
|
589
|
+
$[3] = previousManager;
|
|
590
|
+
$[4] = screens;
|
|
591
|
+
$[5] = t5;
|
|
592
|
+
} else {
|
|
593
|
+
t5 = $[5];
|
|
594
|
+
}
|
|
595
|
+
const [finalManager] = useState(t5);
|
|
596
|
+
let t6;
|
|
597
|
+
if ($[6] !== finalManager) {
|
|
598
|
+
t6 = () => finalManager.getComponents();
|
|
599
|
+
$[6] = finalManager;
|
|
600
|
+
$[7] = t6;
|
|
601
|
+
} else {
|
|
602
|
+
t6 = $[7];
|
|
603
|
+
}
|
|
604
|
+
const [components, setComponents] = useState(t6);
|
|
605
|
+
let t7;
|
|
606
|
+
let t8;
|
|
607
|
+
if ($[8] !== finalManager) {
|
|
608
|
+
t7 = () => {
|
|
609
|
+
const onChange = () => setComponents(finalManager.getComponents());
|
|
610
|
+
finalManager.on("change", onChange);
|
|
611
|
+
return () => {
|
|
612
|
+
finalManager.off("change", onChange);
|
|
613
|
+
};
|
|
487
614
|
};
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
615
|
+
t8 = [finalManager, setComponents];
|
|
616
|
+
$[8] = finalManager;
|
|
617
|
+
$[9] = t7;
|
|
618
|
+
$[10] = t8;
|
|
619
|
+
} else {
|
|
620
|
+
t7 = $[9];
|
|
621
|
+
t8 = $[10];
|
|
622
|
+
}
|
|
623
|
+
useEffect(t7, t8);
|
|
624
|
+
let t9;
|
|
625
|
+
if ($[11] !== children || $[12] !== components) {
|
|
626
|
+
t9 = /*#__PURE__*/jsx(ComponentsProvider, {
|
|
492
627
|
namespace: SCREENS_NAMESPACE,
|
|
493
628
|
components: components,
|
|
494
629
|
children: children
|
|
495
|
-
})
|
|
496
|
-
|
|
630
|
+
});
|
|
631
|
+
$[11] = children;
|
|
632
|
+
$[12] = components;
|
|
633
|
+
$[13] = t9;
|
|
634
|
+
} else {
|
|
635
|
+
t9 = $[13];
|
|
636
|
+
}
|
|
637
|
+
let t10;
|
|
638
|
+
if ($[14] !== finalManager || $[15] !== t9) {
|
|
639
|
+
t10 = /*#__PURE__*/jsx(ScreensContext, {
|
|
640
|
+
value: finalManager,
|
|
641
|
+
children: t9
|
|
642
|
+
});
|
|
643
|
+
$[14] = finalManager;
|
|
644
|
+
$[15] = t9;
|
|
645
|
+
$[16] = t10;
|
|
646
|
+
} else {
|
|
647
|
+
t10 = $[16];
|
|
648
|
+
}
|
|
649
|
+
return t10;
|
|
497
650
|
}
|
|
498
651
|
|
|
499
|
-
|
|
500
|
-
|
|
652
|
+
const StoryContext = /*#__PURE__*/createContext(null);
|
|
653
|
+
const useStoryContext = () => {
|
|
501
654
|
return useContext(StoryContext);
|
|
502
655
|
};
|
|
503
|
-
|
|
504
|
-
|
|
656
|
+
const useStory = () => {
|
|
657
|
+
const story = useStoryContext();
|
|
505
658
|
return story;
|
|
506
659
|
};
|
|
507
|
-
function StoryProvider(
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
660
|
+
function StoryProvider(t0) {
|
|
661
|
+
const $ = c(3);
|
|
662
|
+
const {
|
|
663
|
+
story: t1,
|
|
664
|
+
children
|
|
665
|
+
} = t0;
|
|
666
|
+
const story = t1 === undefined ? null : t1;
|
|
667
|
+
let t2;
|
|
668
|
+
if ($[0] !== children || $[1] !== story) {
|
|
669
|
+
t2 = /*#__PURE__*/jsx(StoryContext.Provider, {
|
|
670
|
+
value: story,
|
|
671
|
+
children: children
|
|
672
|
+
});
|
|
673
|
+
$[0] = children;
|
|
674
|
+
$[1] = story;
|
|
675
|
+
$[2] = t2;
|
|
676
|
+
} else {
|
|
677
|
+
t2 = $[2];
|
|
678
|
+
}
|
|
679
|
+
return t2;
|
|
515
680
|
}
|
|
516
681
|
|
|
517
|
-
|
|
518
|
-
|
|
682
|
+
const EditorContext = /*#__PURE__*/React.createContext(null);
|
|
683
|
+
const useEditor = () => {
|
|
519
684
|
return useContext(EditorContext);
|
|
520
685
|
};
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
getColors
|
|
525
|
-
|
|
526
|
-
|
|
686
|
+
const useGetColors = () => {
|
|
687
|
+
const $ = c(2);
|
|
688
|
+
const {
|
|
689
|
+
getColors: t0
|
|
690
|
+
} = useEditor() || {};
|
|
691
|
+
let t1;
|
|
692
|
+
if ($[0] !== t0) {
|
|
693
|
+
t1 = t0 === undefined ? _temp$2 : t0;
|
|
694
|
+
$[0] = t0;
|
|
695
|
+
$[1] = t1;
|
|
696
|
+
} else {
|
|
697
|
+
t1 = $[1];
|
|
698
|
+
}
|
|
699
|
+
const getColors = t1;
|
|
527
700
|
return getColors;
|
|
528
701
|
};
|
|
529
|
-
function EditorProvider(
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
702
|
+
function EditorProvider(t0) {
|
|
703
|
+
const $ = c(13);
|
|
704
|
+
const {
|
|
705
|
+
children
|
|
706
|
+
} = t0;
|
|
707
|
+
const story = useStory();
|
|
708
|
+
const screensManager = useScreensManager();
|
|
709
|
+
const fieldsManager = useFieldsManager();
|
|
710
|
+
let t1;
|
|
711
|
+
if ($[0] !== fieldsManager || $[1] !== screensManager) {
|
|
712
|
+
t1 = new ColorsParser({
|
|
713
|
+
screensManager,
|
|
714
|
+
fieldsManager
|
|
538
715
|
});
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
}
|
|
716
|
+
$[0] = fieldsManager;
|
|
717
|
+
$[1] = screensManager;
|
|
718
|
+
$[2] = t1;
|
|
719
|
+
} else {
|
|
720
|
+
t1 = $[2];
|
|
721
|
+
}
|
|
722
|
+
const parser = t1;
|
|
723
|
+
let t2;
|
|
724
|
+
if ($[3] !== parser) {
|
|
725
|
+
t2 = currentStory => parser.parse(currentStory);
|
|
726
|
+
$[3] = parser;
|
|
727
|
+
$[4] = t2;
|
|
728
|
+
} else {
|
|
729
|
+
t2 = $[4];
|
|
730
|
+
}
|
|
731
|
+
const parse = t2;
|
|
732
|
+
let t3;
|
|
733
|
+
if ($[5] !== parse || $[6] !== story) {
|
|
734
|
+
t3 = () => parse(story);
|
|
735
|
+
$[5] = parse;
|
|
736
|
+
$[6] = story;
|
|
737
|
+
$[7] = t3;
|
|
738
|
+
} else {
|
|
739
|
+
t3 = $[7];
|
|
740
|
+
}
|
|
741
|
+
const getColors = t3;
|
|
742
|
+
let t4;
|
|
743
|
+
if ($[8] !== getColors) {
|
|
744
|
+
t4 = {
|
|
745
|
+
getColors
|
|
746
|
+
};
|
|
747
|
+
$[8] = getColors;
|
|
748
|
+
$[9] = t4;
|
|
749
|
+
} else {
|
|
750
|
+
t4 = $[9];
|
|
751
|
+
}
|
|
752
|
+
let t5;
|
|
753
|
+
if ($[10] !== children || $[11] !== t4) {
|
|
754
|
+
t5 = /*#__PURE__*/jsx(EditorContext.Provider, {
|
|
755
|
+
value: t4,
|
|
756
|
+
children: children
|
|
757
|
+
});
|
|
758
|
+
$[10] = children;
|
|
759
|
+
$[11] = t4;
|
|
760
|
+
$[12] = t5;
|
|
761
|
+
} else {
|
|
762
|
+
t5 = $[12];
|
|
763
|
+
}
|
|
764
|
+
return t5;
|
|
765
|
+
}
|
|
766
|
+
function _temp$2() {
|
|
767
|
+
return [];
|
|
554
768
|
}
|
|
555
769
|
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
var useFieldsValue = function useFieldsValue() {
|
|
770
|
+
const FieldsValueContext = /*#__PURE__*/React.createContext(null);
|
|
771
|
+
const useFieldsValue = () => {
|
|
559
772
|
return useContext(FieldsValueContext);
|
|
560
773
|
};
|
|
561
|
-
function FieldsValueContextProvider(
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
774
|
+
function FieldsValueContextProvider(t0) {
|
|
775
|
+
const $ = c(3);
|
|
776
|
+
const {
|
|
777
|
+
value: t1,
|
|
778
|
+
children
|
|
779
|
+
} = t0;
|
|
780
|
+
const value = t1 === undefined ? null : t1;
|
|
781
|
+
let t2;
|
|
782
|
+
if ($[0] !== children || $[1] !== value) {
|
|
783
|
+
t2 = /*#__PURE__*/jsx(FieldsValueContext.Provider, {
|
|
784
|
+
value: value,
|
|
785
|
+
children: children
|
|
786
|
+
});
|
|
787
|
+
$[0] = children;
|
|
788
|
+
$[1] = value;
|
|
789
|
+
$[2] = t2;
|
|
790
|
+
} else {
|
|
791
|
+
t2 = $[2];
|
|
792
|
+
}
|
|
793
|
+
return t2;
|
|
569
794
|
}
|
|
570
795
|
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
var useFieldContext = function useFieldContext() {
|
|
796
|
+
const FieldContext = /*#__PURE__*/React.createContext(null);
|
|
797
|
+
const useFieldContext = () => {
|
|
574
798
|
return useContext(FieldContext);
|
|
575
799
|
};
|
|
576
|
-
function FieldContextProvider(
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
800
|
+
function FieldContextProvider(t0) {
|
|
801
|
+
const $ = c(3);
|
|
802
|
+
const {
|
|
803
|
+
context: t1,
|
|
804
|
+
children
|
|
805
|
+
} = t0;
|
|
806
|
+
const context = t1 === undefined ? null : t1;
|
|
807
|
+
let t2;
|
|
808
|
+
if ($[0] !== children || $[1] !== context) {
|
|
809
|
+
t2 = /*#__PURE__*/jsx(FieldContext.Provider, {
|
|
810
|
+
value: context,
|
|
811
|
+
children: children
|
|
812
|
+
});
|
|
813
|
+
$[0] = children;
|
|
814
|
+
$[1] = context;
|
|
815
|
+
$[2] = t2;
|
|
816
|
+
} else {
|
|
817
|
+
t2 = $[2];
|
|
818
|
+
}
|
|
819
|
+
return t2;
|
|
584
820
|
}
|
|
585
821
|
|
|
586
|
-
|
|
587
|
-
|
|
822
|
+
const SettingsContext = /*#__PURE__*/React.createContext({});
|
|
823
|
+
const useSettings = () => {
|
|
588
824
|
return useContext(SettingsContext);
|
|
589
825
|
};
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
value = _ref$key === void 0 ? defaultValue : _ref$key;
|
|
826
|
+
const useSetting = (key, defaultValue = null) => {
|
|
827
|
+
const settings = useSettings();
|
|
828
|
+
const {
|
|
829
|
+
[key]: value = defaultValue
|
|
830
|
+
} = settings || {};
|
|
596
831
|
return value;
|
|
597
832
|
};
|
|
598
|
-
function SettingsProvider(
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
833
|
+
function SettingsProvider(t0) {
|
|
834
|
+
const $ = c(6);
|
|
835
|
+
const {
|
|
836
|
+
children,
|
|
837
|
+
settings: t1
|
|
838
|
+
} = t0;
|
|
839
|
+
const settings = t1 === undefined ? null : t1;
|
|
840
|
+
const previousSettings = useSettings();
|
|
841
|
+
let t2;
|
|
842
|
+
if ($[0] !== previousSettings || $[1] !== settings) {
|
|
843
|
+
t2 = {
|
|
844
|
+
...previousSettings,
|
|
845
|
+
...settings
|
|
846
|
+
};
|
|
847
|
+
$[0] = previousSettings;
|
|
848
|
+
$[1] = settings;
|
|
849
|
+
$[2] = t2;
|
|
850
|
+
} else {
|
|
851
|
+
t2 = $[2];
|
|
852
|
+
}
|
|
853
|
+
const value = t2;
|
|
854
|
+
let t3;
|
|
855
|
+
if ($[3] !== children || $[4] !== value) {
|
|
856
|
+
t3 = /*#__PURE__*/jsx(SettingsContext.Provider, {
|
|
857
|
+
value: value,
|
|
858
|
+
children: children
|
|
859
|
+
});
|
|
860
|
+
$[3] = children;
|
|
861
|
+
$[4] = value;
|
|
862
|
+
$[5] = t3;
|
|
863
|
+
} else {
|
|
864
|
+
t3 = $[5];
|
|
865
|
+
}
|
|
866
|
+
return t3;
|
|
610
867
|
}
|
|
611
868
|
|
|
612
|
-
|
|
613
|
-
var GoogleKeysContext = /*#__PURE__*/React.createContext({
|
|
869
|
+
const GoogleKeysContext = /*#__PURE__*/createContext({
|
|
614
870
|
apiKey: null
|
|
615
871
|
});
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
872
|
+
const useGoogleKeys = () => use(GoogleKeysContext);
|
|
873
|
+
function GoogleKeysProvider(t0) {
|
|
874
|
+
const $ = c(5);
|
|
875
|
+
const {
|
|
876
|
+
children,
|
|
877
|
+
apiKey: t1
|
|
878
|
+
} = t0;
|
|
879
|
+
const apiKey = t1 === undefined ? null : t1;
|
|
880
|
+
const {
|
|
881
|
+
apiKey: previousApiKey
|
|
882
|
+
} = useGoogleKeys();
|
|
883
|
+
const settingApiKey = useSetting("googleApiKey");
|
|
884
|
+
const t2 = apiKey || previousApiKey || settingApiKey;
|
|
885
|
+
let t3;
|
|
886
|
+
if ($[0] !== t2) {
|
|
887
|
+
t3 = {
|
|
888
|
+
apiKey: t2
|
|
629
889
|
};
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
}
|
|
890
|
+
$[0] = t2;
|
|
891
|
+
$[1] = t3;
|
|
892
|
+
} else {
|
|
893
|
+
t3 = $[1];
|
|
894
|
+
}
|
|
895
|
+
const value = t3;
|
|
896
|
+
let t4;
|
|
897
|
+
if ($[2] !== children || $[3] !== value) {
|
|
898
|
+
t4 = /*#__PURE__*/jsx(GoogleKeysContext, {
|
|
899
|
+
value: value,
|
|
900
|
+
children: children
|
|
901
|
+
});
|
|
902
|
+
$[2] = children;
|
|
903
|
+
$[3] = value;
|
|
904
|
+
$[4] = t4;
|
|
905
|
+
} else {
|
|
906
|
+
t4 = $[4];
|
|
907
|
+
}
|
|
908
|
+
return t4;
|
|
635
909
|
}
|
|
636
910
|
|
|
637
|
-
|
|
911
|
+
const FontsContext = /*#__PURE__*/React.createContext({
|
|
638
912
|
systemFonts: null,
|
|
639
913
|
googleFonts: null,
|
|
640
914
|
customFonts: null
|
|
641
915
|
});
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
916
|
+
const useGoogleFonts = t0 => {
|
|
917
|
+
const $ = c(7);
|
|
918
|
+
const options = t0 === undefined ? null : t0;
|
|
919
|
+
let t1;
|
|
920
|
+
if ($[0] !== options) {
|
|
921
|
+
t1 = options || {};
|
|
922
|
+
$[0] = options;
|
|
923
|
+
$[1] = t1;
|
|
924
|
+
} else {
|
|
925
|
+
t1 = $[1];
|
|
926
|
+
}
|
|
927
|
+
const {
|
|
928
|
+
disabled: t2,
|
|
929
|
+
setFonts: t3
|
|
930
|
+
} = t1;
|
|
931
|
+
const disabled = t2 === undefined ? false : t2;
|
|
932
|
+
const setFonts = t3 === undefined ? null : t3;
|
|
933
|
+
const {
|
|
934
|
+
apiKey
|
|
935
|
+
} = useGoogleKeys();
|
|
936
|
+
const [googleFonts, setGoogleFonts] = useState(null);
|
|
937
|
+
let t4;
|
|
938
|
+
let t5;
|
|
939
|
+
if ($[2] !== apiKey || $[3] !== disabled || $[4] !== setFonts) {
|
|
940
|
+
t4 = () => {
|
|
941
|
+
let canceled = false;
|
|
942
|
+
if (apiKey !== null && !disabled) {
|
|
943
|
+
getJSON(`https://www.googleapis.com/webfonts/v1/webfonts?key=${apiKey}&sort=popularity`).then(t6 => {
|
|
944
|
+
const {
|
|
945
|
+
items: t7
|
|
946
|
+
} = t6;
|
|
947
|
+
const items = t7 === undefined ? [] : t7;
|
|
948
|
+
if (!canceled) {
|
|
949
|
+
const newFonts = items.map(_temp$1);
|
|
950
|
+
if (setFonts !== null) {
|
|
951
|
+
setFonts(newFonts);
|
|
952
|
+
} else {
|
|
953
|
+
setGoogleFonts(newFonts);
|
|
954
|
+
}
|
|
673
955
|
}
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
956
|
+
});
|
|
957
|
+
}
|
|
958
|
+
return () => {
|
|
959
|
+
canceled = true;
|
|
960
|
+
};
|
|
679
961
|
};
|
|
680
|
-
|
|
962
|
+
t5 = [apiKey, disabled, setFonts, setGoogleFonts];
|
|
963
|
+
$[2] = apiKey;
|
|
964
|
+
$[3] = disabled;
|
|
965
|
+
$[4] = setFonts;
|
|
966
|
+
$[5] = t4;
|
|
967
|
+
$[6] = t5;
|
|
968
|
+
} else {
|
|
969
|
+
t4 = $[5];
|
|
970
|
+
t5 = $[6];
|
|
971
|
+
}
|
|
972
|
+
useEffect(t4, t5);
|
|
681
973
|
return googleFonts;
|
|
682
974
|
};
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
975
|
+
const useFonts = t0 => {
|
|
976
|
+
const $ = c(9);
|
|
977
|
+
const options = t0 === undefined ? null : t0;
|
|
978
|
+
let t1;
|
|
979
|
+
if ($[0] !== options) {
|
|
980
|
+
t1 = options || {};
|
|
981
|
+
$[0] = options;
|
|
982
|
+
$[1] = t1;
|
|
983
|
+
} else {
|
|
984
|
+
t1 = $[1];
|
|
985
|
+
}
|
|
986
|
+
const {
|
|
987
|
+
withoutGoogleFonts: t2
|
|
988
|
+
} = t1;
|
|
989
|
+
const withoutGoogleFonts = t2 === undefined ? false : t2;
|
|
990
|
+
const {
|
|
991
|
+
setGoogleFonts: t3,
|
|
992
|
+
systemFonts: t4,
|
|
993
|
+
googleFonts: t5,
|
|
994
|
+
customFonts: t6
|
|
995
|
+
} = useContext(FontsContext);
|
|
996
|
+
const setGoogleFonts = t3 === undefined ? null : t3;
|
|
997
|
+
const systemFonts = t4 === undefined ? null : t4;
|
|
998
|
+
const googleFonts = t5 === undefined ? null : t5;
|
|
999
|
+
const customFonts = t6 === undefined ? null : t6;
|
|
1000
|
+
const t7 = withoutGoogleFonts || googleFonts !== null && googleFonts.length > 0;
|
|
1001
|
+
let t8;
|
|
1002
|
+
if ($[2] !== setGoogleFonts || $[3] !== t7) {
|
|
1003
|
+
t8 = {
|
|
1004
|
+
disabled: t7,
|
|
1005
|
+
setFonts: setGoogleFonts
|
|
1006
|
+
};
|
|
1007
|
+
$[2] = setGoogleFonts;
|
|
1008
|
+
$[3] = t7;
|
|
1009
|
+
$[4] = t8;
|
|
1010
|
+
} else {
|
|
1011
|
+
t8 = $[4];
|
|
1012
|
+
}
|
|
1013
|
+
useGoogleFonts(t8);
|
|
1014
|
+
let t9;
|
|
1015
|
+
if ($[5] !== customFonts || $[6] !== googleFonts || $[7] !== systemFonts) {
|
|
1016
|
+
t9 = {
|
|
1017
|
+
systemFonts,
|
|
1018
|
+
googleFonts,
|
|
1019
|
+
customFonts
|
|
706
1020
|
};
|
|
707
|
-
|
|
1021
|
+
$[5] = customFonts;
|
|
1022
|
+
$[6] = googleFonts;
|
|
1023
|
+
$[7] = systemFonts;
|
|
1024
|
+
$[8] = t9;
|
|
1025
|
+
} else {
|
|
1026
|
+
t9 = $[8];
|
|
1027
|
+
}
|
|
1028
|
+
const fonts = t9;
|
|
708
1029
|
return fonts;
|
|
709
1030
|
};
|
|
710
|
-
function FontsProvider(
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
customFonts
|
|
715
|
-
children
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
1031
|
+
function FontsProvider(t0) {
|
|
1032
|
+
const $ = c(18);
|
|
1033
|
+
const {
|
|
1034
|
+
systemFonts: t1,
|
|
1035
|
+
customFonts: t2,
|
|
1036
|
+
children
|
|
1037
|
+
} = t0;
|
|
1038
|
+
let t3;
|
|
1039
|
+
if ($[0] !== t1) {
|
|
1040
|
+
t3 = t1 === undefined ? ["Arial", "Courier New", "Georgia", "Times New Roman", "Verdana"] : t1;
|
|
1041
|
+
$[0] = t1;
|
|
1042
|
+
$[1] = t3;
|
|
1043
|
+
} else {
|
|
1044
|
+
t3 = $[1];
|
|
1045
|
+
}
|
|
1046
|
+
const systemFonts = t3;
|
|
1047
|
+
const customFonts = t2 === undefined ? null : t2;
|
|
1048
|
+
const {
|
|
1049
|
+
systemFonts: t4,
|
|
1050
|
+
googleFonts: t5,
|
|
1051
|
+
customFonts: previousCustomFonts
|
|
1052
|
+
} = useFonts();
|
|
1053
|
+
const previousSystemFonts = t4 === undefined ? null : t4;
|
|
1054
|
+
const previousGoogleFonts = t5 === undefined ? null : t5;
|
|
1055
|
+
const [googleFonts, setGoogleFonts] = useState(null);
|
|
1056
|
+
let t6;
|
|
1057
|
+
if ($[2] !== previousSystemFonts || $[3] !== systemFonts) {
|
|
1058
|
+
t6 = uniqBy([...(previousSystemFonts || []), ...(systemFonts || [])], _temp2$1);
|
|
1059
|
+
$[2] = previousSystemFonts;
|
|
1060
|
+
$[3] = systemFonts;
|
|
1061
|
+
$[4] = t6;
|
|
1062
|
+
} else {
|
|
1063
|
+
t6 = $[4];
|
|
1064
|
+
}
|
|
1065
|
+
let t7;
|
|
1066
|
+
if ($[5] !== googleFonts || $[6] !== previousGoogleFonts) {
|
|
1067
|
+
t7 = uniqBy([...(previousGoogleFonts || []), ...(googleFonts || [])], _temp3$1);
|
|
1068
|
+
$[5] = googleFonts;
|
|
1069
|
+
$[6] = previousGoogleFonts;
|
|
1070
|
+
$[7] = t7;
|
|
1071
|
+
} else {
|
|
1072
|
+
t7 = $[7];
|
|
1073
|
+
}
|
|
1074
|
+
let t8;
|
|
1075
|
+
if ($[8] !== customFonts || $[9] !== previousCustomFonts) {
|
|
1076
|
+
t8 = uniqBy([...(previousCustomFonts || []), ...(customFonts || [])], _temp4$1);
|
|
1077
|
+
$[8] = customFonts;
|
|
1078
|
+
$[9] = previousCustomFonts;
|
|
1079
|
+
$[10] = t8;
|
|
1080
|
+
} else {
|
|
1081
|
+
t8 = $[10];
|
|
1082
|
+
}
|
|
1083
|
+
let t9;
|
|
1084
|
+
if ($[11] !== t6 || $[12] !== t7 || $[13] !== t8) {
|
|
1085
|
+
t9 = {
|
|
1086
|
+
systemFonts: t6,
|
|
1087
|
+
googleFonts: t7,
|
|
1088
|
+
customFonts: t8,
|
|
1089
|
+
setGoogleFonts
|
|
738
1090
|
};
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
}
|
|
1091
|
+
$[11] = t6;
|
|
1092
|
+
$[12] = t7;
|
|
1093
|
+
$[13] = t8;
|
|
1094
|
+
$[14] = t9;
|
|
1095
|
+
} else {
|
|
1096
|
+
t9 = $[14];
|
|
1097
|
+
}
|
|
1098
|
+
const fonts = t9;
|
|
1099
|
+
let t10;
|
|
1100
|
+
if ($[15] !== children || $[16] !== fonts) {
|
|
1101
|
+
t10 = /*#__PURE__*/jsx(FontsContext.Provider, {
|
|
1102
|
+
value: fonts,
|
|
1103
|
+
children: children
|
|
1104
|
+
});
|
|
1105
|
+
$[15] = children;
|
|
1106
|
+
$[16] = fonts;
|
|
1107
|
+
$[17] = t10;
|
|
1108
|
+
} else {
|
|
1109
|
+
t10 = $[17];
|
|
1110
|
+
}
|
|
1111
|
+
return t10;
|
|
1112
|
+
}
|
|
1113
|
+
function _temp4$1(font_1) {
|
|
1114
|
+
return isObject(font_1) ? font_1.name : font_1;
|
|
1115
|
+
}
|
|
1116
|
+
function _temp3$1(font_0) {
|
|
1117
|
+
return isObject(font_0) ? font_0.name : font_0;
|
|
1118
|
+
}
|
|
1119
|
+
function _temp2$1(font) {
|
|
1120
|
+
return isObject(font) ? font.name : font;
|
|
1121
|
+
}
|
|
1122
|
+
function _temp$1(it) {
|
|
1123
|
+
return {
|
|
1124
|
+
type: "google",
|
|
1125
|
+
name: it.family,
|
|
1126
|
+
variants: it.variants
|
|
1127
|
+
};
|
|
744
1128
|
}
|
|
745
1129
|
|
|
746
|
-
|
|
747
|
-
|
|
1130
|
+
const GoogleApiClientContext = /*#__PURE__*/React.createContext(null);
|
|
1131
|
+
const useGoogleApiClient = () => {
|
|
748
1132
|
return useContext(GoogleApiClientContext);
|
|
749
1133
|
};
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
name = _ref$name === void 0 ? null : _ref$name;
|
|
756
|
-
return displayName || name || 'Component';
|
|
757
|
-
};
|
|
1134
|
+
const withGoogleApiClient = WrappedComponent => {
|
|
1135
|
+
const getDisplayName = ({
|
|
1136
|
+
displayName = null,
|
|
1137
|
+
name = null
|
|
1138
|
+
}) => displayName || name || 'Component';
|
|
758
1139
|
function WithGoogleApiClientComponent(props) {
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
1140
|
+
const $ = c(2);
|
|
1141
|
+
let t0;
|
|
1142
|
+
if ($[0] !== props) {
|
|
1143
|
+
t0 = /*#__PURE__*/jsx(GoogleApiClientContext.Consumer, {
|
|
1144
|
+
children: client => /*#__PURE__*/jsx(WrappedComponent, {
|
|
1145
|
+
googleApiClient: client,
|
|
1146
|
+
...props
|
|
1147
|
+
})
|
|
1148
|
+
});
|
|
1149
|
+
$[0] = props;
|
|
1150
|
+
$[1] = t0;
|
|
1151
|
+
} else {
|
|
1152
|
+
t0 = $[1];
|
|
1153
|
+
}
|
|
1154
|
+
return t0;
|
|
766
1155
|
}
|
|
767
|
-
WithGoogleApiClientComponent.displayName =
|
|
1156
|
+
WithGoogleApiClientComponent.displayName = `WithGoogleApiClient(${getDisplayName(WrappedComponent)})`;
|
|
768
1157
|
return WithGoogleApiClientComponent;
|
|
769
1158
|
};
|
|
770
|
-
function GoogleApiClientProvider(
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
1159
|
+
function GoogleApiClientProvider(t0) {
|
|
1160
|
+
const $ = c(6);
|
|
1161
|
+
const {
|
|
1162
|
+
children
|
|
1163
|
+
} = t0;
|
|
1164
|
+
const {
|
|
1165
|
+
apiKey
|
|
1166
|
+
} = useGoogleKeys();
|
|
1167
|
+
const [client, setClient] = useState(null);
|
|
1168
|
+
let t1;
|
|
1169
|
+
let t2;
|
|
1170
|
+
if ($[0] !== apiKey) {
|
|
1171
|
+
t1 = () => {
|
|
1172
|
+
loadGoogleApi().then(gapi => gapi.client.init({
|
|
1173
|
+
apiKey
|
|
1174
|
+
}).then(() => gapi)).then(gapi_0 => setClient(gapi_0));
|
|
1175
|
+
};
|
|
1176
|
+
t2 = [apiKey, setClient];
|
|
1177
|
+
$[0] = apiKey;
|
|
1178
|
+
$[1] = t1;
|
|
1179
|
+
$[2] = t2;
|
|
1180
|
+
} else {
|
|
1181
|
+
t1 = $[1];
|
|
1182
|
+
t2 = $[2];
|
|
1183
|
+
}
|
|
1184
|
+
useEffect(t1, t2);
|
|
1185
|
+
let t3;
|
|
1186
|
+
if ($[3] !== children || $[4] !== client) {
|
|
1187
|
+
t3 = /*#__PURE__*/jsx(GoogleApiClientContext.Provider, {
|
|
1188
|
+
value: client,
|
|
1189
|
+
children: children
|
|
787
1190
|
});
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
1191
|
+
$[3] = children;
|
|
1192
|
+
$[4] = client;
|
|
1193
|
+
$[5] = t3;
|
|
1194
|
+
} else {
|
|
1195
|
+
t3 = $[5];
|
|
1196
|
+
}
|
|
1197
|
+
return t3;
|
|
793
1198
|
}
|
|
794
1199
|
|
|
795
|
-
|
|
796
|
-
|
|
1200
|
+
const GoogleMapsClientContext = /*#__PURE__*/React.createContext(null);
|
|
1201
|
+
const useGoogleMapsClient = () => {
|
|
797
1202
|
return useContext(GoogleMapsClientContext);
|
|
798
1203
|
};
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
name = _ref$name === void 0 ? null : _ref$name;
|
|
805
|
-
return displayName || name || 'Component';
|
|
806
|
-
};
|
|
1204
|
+
const withGoogleMapsClient = WrappedComponent => {
|
|
1205
|
+
const getDisplayName = ({
|
|
1206
|
+
displayName = null,
|
|
1207
|
+
name = null
|
|
1208
|
+
}) => displayName || name || 'Component';
|
|
807
1209
|
function WithGoogleMapsClientComponent(props) {
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
1210
|
+
const $ = c(2);
|
|
1211
|
+
let t0;
|
|
1212
|
+
if ($[0] !== props) {
|
|
1213
|
+
t0 = /*#__PURE__*/jsx(GoogleMapsClientContext.Consumer, {
|
|
1214
|
+
children: client => /*#__PURE__*/jsx(WrappedComponent, {
|
|
1215
|
+
googleApiClient: client,
|
|
1216
|
+
...props
|
|
1217
|
+
})
|
|
1218
|
+
});
|
|
1219
|
+
$[0] = props;
|
|
1220
|
+
$[1] = t0;
|
|
1221
|
+
} else {
|
|
1222
|
+
t0 = $[1];
|
|
1223
|
+
}
|
|
1224
|
+
return t0;
|
|
815
1225
|
}
|
|
816
|
-
WithGoogleMapsClientComponent.displayName =
|
|
1226
|
+
WithGoogleMapsClientComponent.displayName = `WithGoogleMapsClient(${getDisplayName(WrappedComponent)})`;
|
|
817
1227
|
return WithGoogleMapsClientComponent;
|
|
818
1228
|
};
|
|
819
|
-
function GoogleMapsClientProvider(
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
libraries
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
1229
|
+
function GoogleMapsClientProvider(t0) {
|
|
1230
|
+
const $ = c(9);
|
|
1231
|
+
const {
|
|
1232
|
+
children,
|
|
1233
|
+
locale: t1,
|
|
1234
|
+
libraries: t2
|
|
1235
|
+
} = t0;
|
|
1236
|
+
const locale = t1 === undefined ? "fr" : t1;
|
|
1237
|
+
const libraries = t2 === undefined ? null : t2;
|
|
1238
|
+
const {
|
|
1239
|
+
apiKey
|
|
1240
|
+
} = useGoogleKeys();
|
|
1241
|
+
const exisitingClient = useGoogleMapsClient();
|
|
1242
|
+
const [client, setClient] = useState(exisitingClient);
|
|
1243
|
+
let t3;
|
|
1244
|
+
let t4;
|
|
1245
|
+
if ($[0] !== apiKey || $[1] !== exisitingClient || $[2] !== libraries || $[3] !== locale) {
|
|
1246
|
+
t3 = () => {
|
|
1247
|
+
if (exisitingClient === null) {
|
|
1248
|
+
loadGoogleMaps({
|
|
1249
|
+
apiKey,
|
|
1250
|
+
locale,
|
|
1251
|
+
libraries
|
|
1252
|
+
}).then(newClient => {
|
|
1253
|
+
setClient(newClient);
|
|
1254
|
+
});
|
|
1255
|
+
}
|
|
1256
|
+
};
|
|
1257
|
+
t4 = [apiKey, locale, libraries, setClient, exisitingClient];
|
|
1258
|
+
$[0] = apiKey;
|
|
1259
|
+
$[1] = exisitingClient;
|
|
1260
|
+
$[2] = libraries;
|
|
1261
|
+
$[3] = locale;
|
|
1262
|
+
$[4] = t3;
|
|
1263
|
+
$[5] = t4;
|
|
1264
|
+
} else {
|
|
1265
|
+
t3 = $[4];
|
|
1266
|
+
t4 = $[5];
|
|
1267
|
+
}
|
|
1268
|
+
useEffect(t3, t4);
|
|
1269
|
+
let t5;
|
|
1270
|
+
if ($[6] !== children || $[7] !== client) {
|
|
1271
|
+
t5 = /*#__PURE__*/jsx(GoogleMapsClientContext.Provider, {
|
|
1272
|
+
value: client,
|
|
1273
|
+
children: children
|
|
1274
|
+
});
|
|
1275
|
+
$[6] = children;
|
|
1276
|
+
$[7] = client;
|
|
1277
|
+
$[8] = t5;
|
|
1278
|
+
} else {
|
|
1279
|
+
t5 = $[8];
|
|
1280
|
+
}
|
|
1281
|
+
return t5;
|
|
847
1282
|
}
|
|
848
1283
|
|
|
849
|
-
|
|
1284
|
+
const ModalsContext = /*#__PURE__*/React.createContext({
|
|
850
1285
|
container: null
|
|
851
1286
|
});
|
|
852
|
-
|
|
1287
|
+
const useModals = () => {
|
|
853
1288
|
return useContext(ModalsContext) || {};
|
|
854
1289
|
};
|
|
855
|
-
|
|
1290
|
+
const withModals = WrappedComponent => {
|
|
856
1291
|
function WithModalsComponent(props) {
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
1292
|
+
const $ = c(2);
|
|
1293
|
+
let t0;
|
|
1294
|
+
if ($[0] !== props) {
|
|
1295
|
+
t0 = /*#__PURE__*/jsx(ModalsContext.Consumer, {
|
|
1296
|
+
children: t1 => {
|
|
1297
|
+
const {
|
|
1298
|
+
modals,
|
|
1299
|
+
container,
|
|
1300
|
+
setContainer,
|
|
1301
|
+
register,
|
|
1302
|
+
unregister
|
|
1303
|
+
} = t1;
|
|
1304
|
+
return /*#__PURE__*/jsx(WrappedComponent, {
|
|
1305
|
+
modalsContainer: container,
|
|
1306
|
+
setModalsContainer: setContainer,
|
|
1307
|
+
modals: modals,
|
|
1308
|
+
registerModal: register,
|
|
1309
|
+
unregisterModal: unregister,
|
|
1310
|
+
...props
|
|
1311
|
+
});
|
|
1312
|
+
}
|
|
1313
|
+
});
|
|
1314
|
+
$[0] = props;
|
|
1315
|
+
$[1] = t0;
|
|
1316
|
+
} else {
|
|
1317
|
+
t0 = $[1];
|
|
1318
|
+
}
|
|
1319
|
+
return t0;
|
|
873
1320
|
}
|
|
874
|
-
WithModalsComponent.displayName =
|
|
1321
|
+
WithModalsComponent.displayName = `WithModals(${getDisplayName(WrappedComponent)})`;
|
|
875
1322
|
return WithModalsComponent;
|
|
876
1323
|
};
|
|
877
|
-
function ModalsProvider(
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
if (foundIndex !== -1) {
|
|
906
|
-
var newModals = currentModals.filter(function (_ref4) {
|
|
907
|
-
var modalId = _ref4.id;
|
|
908
|
-
return modalId !== id;
|
|
909
|
-
});
|
|
1324
|
+
function ModalsProvider(t0) {
|
|
1325
|
+
const $ = c(9);
|
|
1326
|
+
const {
|
|
1327
|
+
children,
|
|
1328
|
+
container: t1
|
|
1329
|
+
} = t0;
|
|
1330
|
+
const initialContainer = t1 === undefined ? null : t1;
|
|
1331
|
+
const [container, setContainer] = useState(initialContainer);
|
|
1332
|
+
let t2;
|
|
1333
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1334
|
+
t2 = [];
|
|
1335
|
+
$[0] = t2;
|
|
1336
|
+
} else {
|
|
1337
|
+
t2 = $[0];
|
|
1338
|
+
}
|
|
1339
|
+
const [modals, setModals] = useState(t2);
|
|
1340
|
+
const modalsRef = useRef(modals);
|
|
1341
|
+
let t3;
|
|
1342
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1343
|
+
t3 = (id, t4) => {
|
|
1344
|
+
const data = t4 === undefined ? null : t4;
|
|
1345
|
+
const {
|
|
1346
|
+
current: currentModals
|
|
1347
|
+
} = modalsRef;
|
|
1348
|
+
const newModals = [...currentModals, {
|
|
1349
|
+
id,
|
|
1350
|
+
...data
|
|
1351
|
+
}];
|
|
910
1352
|
setModals(newModals);
|
|
911
1353
|
modalsRef.current = newModals;
|
|
912
|
-
}
|
|
913
|
-
}, [modals, setModals]);
|
|
914
|
-
var value = useMemo(function () {
|
|
915
|
-
return {
|
|
916
|
-
modals: modals,
|
|
917
|
-
container: container,
|
|
918
|
-
setContainer: setContainer,
|
|
919
|
-
register: register,
|
|
920
|
-
unregister: unregister
|
|
921
1354
|
};
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
1355
|
+
$[1] = t3;
|
|
1356
|
+
} else {
|
|
1357
|
+
t3 = $[1];
|
|
1358
|
+
}
|
|
1359
|
+
const register = t3;
|
|
1360
|
+
let t4;
|
|
1361
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1362
|
+
t4 = id_0 => {
|
|
1363
|
+
const {
|
|
1364
|
+
current: currentModals_0
|
|
1365
|
+
} = modalsRef;
|
|
1366
|
+
const foundIndex = currentModals_0.findIndex(t5 => {
|
|
1367
|
+
const {
|
|
1368
|
+
id: modalId
|
|
1369
|
+
} = t5;
|
|
1370
|
+
return modalId === id_0;
|
|
1371
|
+
});
|
|
1372
|
+
if (foundIndex !== -1) {
|
|
1373
|
+
const newModals_0 = currentModals_0.filter(t6 => {
|
|
1374
|
+
const {
|
|
1375
|
+
id: modalId_0
|
|
1376
|
+
} = t6;
|
|
1377
|
+
return modalId_0 !== id_0;
|
|
1378
|
+
});
|
|
1379
|
+
setModals(newModals_0);
|
|
1380
|
+
modalsRef.current = newModals_0;
|
|
1381
|
+
}
|
|
1382
|
+
};
|
|
1383
|
+
$[2] = t4;
|
|
1384
|
+
} else {
|
|
1385
|
+
t4 = $[2];
|
|
1386
|
+
}
|
|
1387
|
+
const unregister = t4;
|
|
1388
|
+
let t5;
|
|
1389
|
+
if ($[3] !== container || $[4] !== modals) {
|
|
1390
|
+
t5 = {
|
|
1391
|
+
modals,
|
|
1392
|
+
container,
|
|
1393
|
+
setContainer,
|
|
1394
|
+
register,
|
|
1395
|
+
unregister
|
|
1396
|
+
};
|
|
1397
|
+
$[3] = container;
|
|
1398
|
+
$[4] = modals;
|
|
1399
|
+
$[5] = t5;
|
|
1400
|
+
} else {
|
|
1401
|
+
t5 = $[5];
|
|
1402
|
+
}
|
|
1403
|
+
const value = t5;
|
|
1404
|
+
let t6;
|
|
1405
|
+
if ($[6] !== children || $[7] !== value) {
|
|
1406
|
+
t6 = /*#__PURE__*/jsx(ModalsContext.Provider, {
|
|
1407
|
+
value: value,
|
|
1408
|
+
children: children
|
|
1409
|
+
});
|
|
1410
|
+
$[6] = children;
|
|
1411
|
+
$[7] = value;
|
|
1412
|
+
$[8] = t6;
|
|
1413
|
+
} else {
|
|
1414
|
+
t6 = $[8];
|
|
1415
|
+
}
|
|
1416
|
+
return t6;
|
|
927
1417
|
}
|
|
928
1418
|
|
|
929
|
-
|
|
1419
|
+
const PanelsContext = /*#__PURE__*/React.createContext({
|
|
930
1420
|
container: null
|
|
931
1421
|
});
|
|
932
|
-
|
|
1422
|
+
const usePanels = () => {
|
|
933
1423
|
return useContext(PanelsContext) || {};
|
|
934
1424
|
};
|
|
935
|
-
|
|
1425
|
+
const withPanels = WrappedComponent => {
|
|
936
1426
|
function WithPanelsComponent(props) {
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
1427
|
+
const $ = c(2);
|
|
1428
|
+
let t0;
|
|
1429
|
+
if ($[0] !== props) {
|
|
1430
|
+
t0 = /*#__PURE__*/jsx(PanelsContext.Consumer, {
|
|
1431
|
+
children: t1 => {
|
|
1432
|
+
const {
|
|
1433
|
+
panels,
|
|
1434
|
+
setContainer,
|
|
1435
|
+
container,
|
|
1436
|
+
register,
|
|
1437
|
+
unregister
|
|
1438
|
+
} = t1;
|
|
1439
|
+
return /*#__PURE__*/jsx(WrappedComponent, {
|
|
1440
|
+
panelsContainer: container,
|
|
1441
|
+
setPanelsContainer: setContainer,
|
|
1442
|
+
panels: panels,
|
|
1443
|
+
registerPanel: register,
|
|
1444
|
+
unregisterPanel: unregister,
|
|
1445
|
+
...props
|
|
1446
|
+
});
|
|
1447
|
+
}
|
|
1448
|
+
});
|
|
1449
|
+
$[0] = props;
|
|
1450
|
+
$[1] = t0;
|
|
1451
|
+
} else {
|
|
1452
|
+
t0 = $[1];
|
|
1453
|
+
}
|
|
1454
|
+
return t0;
|
|
953
1455
|
}
|
|
954
|
-
WithPanelsComponent.displayName =
|
|
1456
|
+
WithPanelsComponent.displayName = `WithPanels(${getDisplayName(WrappedComponent)})`;
|
|
955
1457
|
return WithPanelsComponent;
|
|
956
1458
|
};
|
|
957
|
-
function PanelsProvider(
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
if (foundIndex !== -1) {
|
|
986
|
-
var newPanels = currentPanels.filter(function (_ref4) {
|
|
987
|
-
var modalId = _ref4.id;
|
|
988
|
-
return modalId !== id;
|
|
989
|
-
});
|
|
1459
|
+
function PanelsProvider(t0) {
|
|
1460
|
+
const $ = c(9);
|
|
1461
|
+
const {
|
|
1462
|
+
children,
|
|
1463
|
+
container: t1
|
|
1464
|
+
} = t0;
|
|
1465
|
+
const initialContainer = t1 === undefined ? null : t1;
|
|
1466
|
+
const [container, setContainer] = useState(initialContainer);
|
|
1467
|
+
let t2;
|
|
1468
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1469
|
+
t2 = [];
|
|
1470
|
+
$[0] = t2;
|
|
1471
|
+
} else {
|
|
1472
|
+
t2 = $[0];
|
|
1473
|
+
}
|
|
1474
|
+
const [panels, setPanels] = useState(t2);
|
|
1475
|
+
const panelsRef = useRef(panels);
|
|
1476
|
+
let t3;
|
|
1477
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1478
|
+
t3 = (id, t4) => {
|
|
1479
|
+
const data = t4 === undefined ? null : t4;
|
|
1480
|
+
const {
|
|
1481
|
+
current: currentPanels
|
|
1482
|
+
} = panelsRef;
|
|
1483
|
+
const newPanels = [...currentPanels, {
|
|
1484
|
+
id,
|
|
1485
|
+
...data
|
|
1486
|
+
}];
|
|
990
1487
|
setPanels(newPanels);
|
|
991
1488
|
panelsRef.current = newPanels;
|
|
992
|
-
}
|
|
993
|
-
}, [panels, setPanels]);
|
|
994
|
-
var value = useMemo(function () {
|
|
995
|
-
return {
|
|
996
|
-
panels: panels,
|
|
997
|
-
setContainer: setContainer,
|
|
998
|
-
container: container,
|
|
999
|
-
register: register,
|
|
1000
|
-
unregister: unregister
|
|
1001
1489
|
};
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1490
|
+
$[1] = t3;
|
|
1491
|
+
} else {
|
|
1492
|
+
t3 = $[1];
|
|
1493
|
+
}
|
|
1494
|
+
const register = t3;
|
|
1495
|
+
let t4;
|
|
1496
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1497
|
+
t4 = id_0 => {
|
|
1498
|
+
const {
|
|
1499
|
+
current: currentPanels_0
|
|
1500
|
+
} = panelsRef;
|
|
1501
|
+
const foundIndex = currentPanels_0.findIndex(t5 => {
|
|
1502
|
+
const {
|
|
1503
|
+
id: modalId
|
|
1504
|
+
} = t5;
|
|
1505
|
+
return modalId === id_0;
|
|
1506
|
+
});
|
|
1507
|
+
if (foundIndex !== -1) {
|
|
1508
|
+
const newPanels_0 = currentPanels_0.filter(t6 => {
|
|
1509
|
+
const {
|
|
1510
|
+
id: modalId_0
|
|
1511
|
+
} = t6;
|
|
1512
|
+
return modalId_0 !== id_0;
|
|
1513
|
+
});
|
|
1514
|
+
setPanels(newPanels_0);
|
|
1515
|
+
panelsRef.current = newPanels_0;
|
|
1516
|
+
}
|
|
1517
|
+
};
|
|
1518
|
+
$[2] = t4;
|
|
1519
|
+
} else {
|
|
1520
|
+
t4 = $[2];
|
|
1521
|
+
}
|
|
1522
|
+
const unregister = t4;
|
|
1523
|
+
let t5;
|
|
1524
|
+
if ($[3] !== container || $[4] !== panels) {
|
|
1525
|
+
t5 = {
|
|
1526
|
+
panels,
|
|
1527
|
+
setContainer,
|
|
1528
|
+
container,
|
|
1529
|
+
register,
|
|
1530
|
+
unregister
|
|
1531
|
+
};
|
|
1532
|
+
$[3] = container;
|
|
1533
|
+
$[4] = panels;
|
|
1534
|
+
$[5] = t5;
|
|
1535
|
+
} else {
|
|
1536
|
+
t5 = $[5];
|
|
1537
|
+
}
|
|
1538
|
+
const value = t5;
|
|
1539
|
+
let t6;
|
|
1540
|
+
if ($[6] !== children || $[7] !== value) {
|
|
1541
|
+
t6 = /*#__PURE__*/jsx(PanelsContext.Provider, {
|
|
1542
|
+
value: value,
|
|
1543
|
+
children: children
|
|
1544
|
+
});
|
|
1545
|
+
$[6] = children;
|
|
1546
|
+
$[7] = value;
|
|
1547
|
+
$[8] = t6;
|
|
1548
|
+
} else {
|
|
1549
|
+
t6 = $[8];
|
|
1550
|
+
}
|
|
1551
|
+
return t6;
|
|
1007
1552
|
}
|
|
1008
1553
|
|
|
1009
|
-
|
|
1010
|
-
return media !== null && !!(media.currentTime > 0 && !media.paused && !media.ended && media.readyState > 2);
|
|
1011
|
-
}
|
|
1012
|
-
var defaultControlsThemeValue = {
|
|
1554
|
+
const defaultControlsThemeValue = {
|
|
1013
1555
|
seekBarOnly: false,
|
|
1014
1556
|
color: null,
|
|
1015
1557
|
progressColor: null
|
|
1016
1558
|
};
|
|
1017
|
-
|
|
1559
|
+
const PlaybackContext = /*#__PURE__*/createContext({
|
|
1018
1560
|
playing: false,
|
|
1019
1561
|
completed: false,
|
|
1020
1562
|
muted: true,
|
|
@@ -1024,359 +1566,578 @@ var PlaybackContext = /*#__PURE__*/createContext({
|
|
|
1024
1566
|
hasAudio: false,
|
|
1025
1567
|
isBackground: false,
|
|
1026
1568
|
media: null,
|
|
1569
|
+
mediaSrc: null,
|
|
1027
1570
|
controlsTheme: defaultControlsThemeValue,
|
|
1028
1571
|
currentQualityLevel: null,
|
|
1029
|
-
setMuted:
|
|
1030
|
-
setPlaying:
|
|
1031
|
-
setControls:
|
|
1032
|
-
setControlsVisible:
|
|
1033
|
-
setControlsTheme:
|
|
1034
|
-
showControls:
|
|
1035
|
-
hideControls:
|
|
1036
|
-
setMedia:
|
|
1037
|
-
setCurrentQualityLevel:
|
|
1038
|
-
setIsBackground:
|
|
1572
|
+
setMuted: () => {},
|
|
1573
|
+
setPlaying: () => {},
|
|
1574
|
+
setControls: () => {},
|
|
1575
|
+
setControlsVisible: () => {},
|
|
1576
|
+
setControlsTheme: () => {},
|
|
1577
|
+
showControls: () => {},
|
|
1578
|
+
hideControls: () => {},
|
|
1579
|
+
setMedia: () => {},
|
|
1580
|
+
setCurrentQualityLevel: () => {},
|
|
1581
|
+
setIsBackground: () => {},
|
|
1582
|
+
seekByProgress: () => {},
|
|
1583
|
+
seek: () => {}
|
|
1039
1584
|
});
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1585
|
+
const usePlaybackContext = () => use(PlaybackContext);
|
|
1586
|
+
const usePlaybackMediaRef = (t0, t1, t2) => {
|
|
1587
|
+
const $ = c(26);
|
|
1588
|
+
const active = t0 === undefined ? false : t0;
|
|
1589
|
+
const background = t1 === undefined ? false : t1;
|
|
1590
|
+
const updateKey = t2 === undefined ? null : t2;
|
|
1591
|
+
const {
|
|
1592
|
+
setMedia,
|
|
1593
|
+
setIsBackground,
|
|
1594
|
+
media,
|
|
1595
|
+
isBackground
|
|
1596
|
+
} = usePlaybackContext();
|
|
1597
|
+
const mediaRef = useRef(null);
|
|
1598
|
+
let t3;
|
|
1599
|
+
if ($[0] !== active || $[1] !== setIsBackground || $[2] !== setMedia) {
|
|
1600
|
+
t3 = () => {
|
|
1601
|
+
const {
|
|
1602
|
+
current: t4
|
|
1603
|
+
} = mediaRef;
|
|
1604
|
+
const currentMedia = t4 === undefined ? null : t4;
|
|
1605
|
+
return () => {
|
|
1606
|
+
if (active) {
|
|
1607
|
+
const shouldPause = currentMedia !== null && getMediaIsPlaying(currentMedia);
|
|
1608
|
+
setMedia(null);
|
|
1609
|
+
setIsBackground(false);
|
|
1610
|
+
if (shouldPause) {
|
|
1611
|
+
currentMedia.pause();
|
|
1612
|
+
}
|
|
1068
1613
|
}
|
|
1614
|
+
};
|
|
1615
|
+
};
|
|
1616
|
+
$[0] = active;
|
|
1617
|
+
$[1] = setIsBackground;
|
|
1618
|
+
$[2] = setMedia;
|
|
1619
|
+
$[3] = t3;
|
|
1620
|
+
} else {
|
|
1621
|
+
t3 = $[3];
|
|
1622
|
+
}
|
|
1623
|
+
let t4;
|
|
1624
|
+
if ($[4] !== active || $[5] !== setIsBackground || $[6] !== setMedia || $[7] !== updateKey) {
|
|
1625
|
+
t4 = [active, setMedia, setIsBackground, updateKey];
|
|
1626
|
+
$[4] = active;
|
|
1627
|
+
$[5] = setIsBackground;
|
|
1628
|
+
$[6] = setMedia;
|
|
1629
|
+
$[7] = updateKey;
|
|
1630
|
+
$[8] = t4;
|
|
1631
|
+
} else {
|
|
1632
|
+
t4 = $[8];
|
|
1633
|
+
}
|
|
1634
|
+
useEffect(t3, t4);
|
|
1635
|
+
let t5;
|
|
1636
|
+
if ($[9] !== active || $[10] !== background || $[11] !== isBackground || $[12] !== media || $[13] !== setIsBackground || $[14] !== setMedia) {
|
|
1637
|
+
t5 = () => {
|
|
1638
|
+
if (!active || mediaRef.current === media && background === isBackground) {
|
|
1639
|
+
return;
|
|
1069
1640
|
}
|
|
1641
|
+
setIsBackground(background);
|
|
1642
|
+
setMedia(mediaRef.current);
|
|
1070
1643
|
};
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1644
|
+
$[9] = active;
|
|
1645
|
+
$[10] = background;
|
|
1646
|
+
$[11] = isBackground;
|
|
1647
|
+
$[12] = media;
|
|
1648
|
+
$[13] = setIsBackground;
|
|
1649
|
+
$[14] = setMedia;
|
|
1650
|
+
$[15] = t5;
|
|
1651
|
+
} else {
|
|
1652
|
+
t5 = $[15];
|
|
1080
1653
|
}
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1654
|
+
let t6;
|
|
1655
|
+
if ($[16] !== active || $[17] !== background || $[18] !== isBackground || $[19] !== media || $[20] !== setIsBackground || $[21] !== setMedia || $[22] !== updateKey) {
|
|
1656
|
+
t6 = [active, background, media, updateKey, setMedia, setIsBackground, isBackground];
|
|
1657
|
+
$[16] = active;
|
|
1658
|
+
$[17] = background;
|
|
1659
|
+
$[18] = isBackground;
|
|
1660
|
+
$[19] = media;
|
|
1661
|
+
$[20] = setIsBackground;
|
|
1662
|
+
$[21] = setMedia;
|
|
1663
|
+
$[22] = updateKey;
|
|
1664
|
+
$[23] = t6;
|
|
1665
|
+
} else {
|
|
1666
|
+
t6 = $[23];
|
|
1667
|
+
}
|
|
1668
|
+
useEffect(t5, t6);
|
|
1669
|
+
let t7;
|
|
1670
|
+
if ($[24] !== active) {
|
|
1671
|
+
t7 = {
|
|
1672
|
+
ref: mediaRef,
|
|
1673
|
+
isCurrent: active
|
|
1674
|
+
};
|
|
1675
|
+
$[24] = active;
|
|
1676
|
+
$[25] = t7;
|
|
1677
|
+
} else {
|
|
1678
|
+
t7 = $[25];
|
|
1679
|
+
}
|
|
1680
|
+
return t7;
|
|
1094
1681
|
};
|
|
1095
|
-
function
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
children
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1682
|
+
function seekMedia(media, time) {
|
|
1683
|
+
if (media !== null) {
|
|
1684
|
+
media.currentTime = time;
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
const debug = createDebug('micromag:media:playback-provider');
|
|
1688
|
+
function PlaybackProvider(t0) {
|
|
1689
|
+
const $ = c(34);
|
|
1690
|
+
const {
|
|
1691
|
+
muted: t1,
|
|
1692
|
+
playing: t2,
|
|
1693
|
+
paused: t3,
|
|
1694
|
+
controls: t4,
|
|
1695
|
+
controlsSuggestPlay: t5,
|
|
1696
|
+
controlsVisible: t6,
|
|
1697
|
+
controlsTheme: t7,
|
|
1698
|
+
currentQualityLevel: t8,
|
|
1699
|
+
children
|
|
1700
|
+
} = t0;
|
|
1701
|
+
const initialMuted = t1 === undefined ? true : t1;
|
|
1702
|
+
const initialPlaying = t2 === undefined ? false : t2;
|
|
1703
|
+
const paused = t3 === undefined ? false : t3;
|
|
1704
|
+
const initialControls = t4 === undefined ? false : t4;
|
|
1705
|
+
const initialControlsSuggestPlay = t5 === undefined ? false : t5;
|
|
1706
|
+
const initialControlsVisible = t6 === undefined ? false : t6;
|
|
1707
|
+
const initialControlsTheme = t7 === undefined ? defaultControlsThemeValue : t7;
|
|
1708
|
+
const initialCurrentQualityLevel = t8 === undefined ? null : t8;
|
|
1709
|
+
const [muted, setMuted] = useState(initialMuted);
|
|
1710
|
+
const [playing, setPlaying] = useState(initialPlaying);
|
|
1711
|
+
const [media, setMedia] = useState(null);
|
|
1712
|
+
const [mediaSrc, setMediaSrc] = useState(null);
|
|
1713
|
+
const [hasAudio, setHasAudio] = useState(null);
|
|
1714
|
+
const [isBackground, setIsBackground] = useState(false);
|
|
1715
|
+
const [controls, setControls] = useState(initialControls);
|
|
1716
|
+
const [controlsSuggestPlay, setControlsSuggestPlay] = useState(initialControlsSuggestPlay);
|
|
1717
|
+
const [controlsVisible, setControlsVisible] = useState(initialControlsVisible);
|
|
1718
|
+
const [controlsTheme, setControlsTheme] = useState(initialControlsTheme);
|
|
1719
|
+
const [currentQualityLevel, setCurrentQualityLevel] = useState(initialCurrentQualityLevel);
|
|
1720
|
+
let t9;
|
|
1721
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1722
|
+
t9 = newControls => {
|
|
1723
|
+
debug("Set controls: %s", newControls);
|
|
1724
|
+
if (newControls) {
|
|
1725
|
+
setControls(true);
|
|
1726
|
+
setControlsVisible(true);
|
|
1727
|
+
setControlsSuggestPlay(false);
|
|
1728
|
+
} else {
|
|
1729
|
+
setControls(false);
|
|
1730
|
+
setControlsVisible(false);
|
|
1731
|
+
setControlsSuggestPlay(false);
|
|
1732
|
+
}
|
|
1733
|
+
};
|
|
1734
|
+
$[0] = t9;
|
|
1735
|
+
} else {
|
|
1736
|
+
t9 = $[0];
|
|
1737
|
+
}
|
|
1738
|
+
const finalSetControls = t9;
|
|
1739
|
+
let t10;
|
|
1740
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1741
|
+
t10 = newTheme => {
|
|
1742
|
+
debug("Set controls theme: %o", newTheme);
|
|
1743
|
+
setControlsTheme({
|
|
1744
|
+
...defaultControlsThemeValue,
|
|
1745
|
+
...newTheme
|
|
1746
|
+
});
|
|
1747
|
+
};
|
|
1748
|
+
$[1] = t10;
|
|
1749
|
+
} else {
|
|
1750
|
+
t10 = $[1];
|
|
1751
|
+
}
|
|
1752
|
+
const finalSetControlsTheme = t10;
|
|
1753
|
+
let t11;
|
|
1754
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1755
|
+
t11 = newMedia => {
|
|
1756
|
+
const newSrc = getMediaSrc(newMedia);
|
|
1757
|
+
const newHasAudio = getMediaHasAudio(newMedia);
|
|
1758
|
+
if (newMedia !== null) {
|
|
1759
|
+
debug("Set current media: %s %o", getMediaFilename(newSrc), {
|
|
1760
|
+
hasAudio: newHasAudio
|
|
1761
|
+
});
|
|
1762
|
+
} else {
|
|
1763
|
+
debug("Unset current media");
|
|
1764
|
+
}
|
|
1765
|
+
setMedia(newMedia);
|
|
1766
|
+
setCurrentQualityLevel(null);
|
|
1767
|
+
setMediaSrc(newSrc);
|
|
1768
|
+
setHasAudio(newHasAudio);
|
|
1769
|
+
};
|
|
1770
|
+
$[2] = t11;
|
|
1771
|
+
} else {
|
|
1772
|
+
t11 = $[2];
|
|
1773
|
+
}
|
|
1774
|
+
const finalSetMedia = t11;
|
|
1775
|
+
let t12;
|
|
1776
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1777
|
+
t12 = value => {
|
|
1778
|
+
if (value) {
|
|
1779
|
+
setControlsSuggestPlay(false);
|
|
1780
|
+
}
|
|
1781
|
+
setPlaying(value);
|
|
1782
|
+
debug("Set playing: %s", value);
|
|
1783
|
+
};
|
|
1784
|
+
$[3] = t12;
|
|
1785
|
+
} else {
|
|
1786
|
+
t12 = $[3];
|
|
1787
|
+
}
|
|
1788
|
+
const finalSetPlaying = t12;
|
|
1789
|
+
const [completed, setCompleted] = useState(false);
|
|
1790
|
+
let t13;
|
|
1791
|
+
let t14;
|
|
1792
|
+
if ($[4] !== media) {
|
|
1793
|
+
t13 = () => {
|
|
1794
|
+
const onMediaCompleted = () => setCompleted(true);
|
|
1795
|
+
if (media !== null) {
|
|
1796
|
+
media.addEventListener("ended", onMediaCompleted);
|
|
1797
|
+
}
|
|
1798
|
+
return () => {
|
|
1799
|
+
if (media !== null) {
|
|
1800
|
+
media.removeEventListener("ended", onMediaCompleted);
|
|
1801
|
+
}
|
|
1802
|
+
setCompleted(false);
|
|
1803
|
+
};
|
|
1804
|
+
};
|
|
1805
|
+
t14 = [media, setCompleted];
|
|
1806
|
+
$[4] = media;
|
|
1807
|
+
$[5] = t13;
|
|
1808
|
+
$[6] = t14;
|
|
1809
|
+
} else {
|
|
1810
|
+
t13 = $[5];
|
|
1811
|
+
t14 = $[6];
|
|
1812
|
+
}
|
|
1813
|
+
useEffect(t13, t14);
|
|
1814
|
+
let t15;
|
|
1815
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1816
|
+
t15 = () => {
|
|
1152
1817
|
setControlsVisible(true);
|
|
1153
|
-
|
|
1154
|
-
}
|
|
1155
|
-
|
|
1818
|
+
debug("Show controls");
|
|
1819
|
+
};
|
|
1820
|
+
$[7] = t15;
|
|
1821
|
+
} else {
|
|
1822
|
+
t15 = $[7];
|
|
1823
|
+
}
|
|
1824
|
+
const showControls = t15;
|
|
1825
|
+
let t16;
|
|
1826
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1827
|
+
t16 = () => {
|
|
1156
1828
|
setControlsVisible(false);
|
|
1157
|
-
|
|
1158
|
-
}
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
}
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
return setCompleted(true);
|
|
1182
|
-
}, [setCompleted]);
|
|
1183
|
-
useEffect(function () {
|
|
1184
|
-
if (media !== null) {
|
|
1185
|
-
media.addEventListener('ended', onMediaCompleted);
|
|
1186
|
-
}
|
|
1187
|
-
return function () {
|
|
1829
|
+
debug("Hide controls");
|
|
1830
|
+
};
|
|
1831
|
+
$[8] = t16;
|
|
1832
|
+
} else {
|
|
1833
|
+
t16 = $[8];
|
|
1834
|
+
}
|
|
1835
|
+
const hideControls = t16;
|
|
1836
|
+
let t17;
|
|
1837
|
+
if ($[9] !== media) {
|
|
1838
|
+
t17 = progress => {
|
|
1839
|
+
const duration = getMediaDuration(media);
|
|
1840
|
+
if (media !== null && duration > 0) {
|
|
1841
|
+
seekMedia(media, progress * duration);
|
|
1842
|
+
}
|
|
1843
|
+
};
|
|
1844
|
+
$[9] = media;
|
|
1845
|
+
$[10] = t17;
|
|
1846
|
+
} else {
|
|
1847
|
+
t17 = $[10];
|
|
1848
|
+
}
|
|
1849
|
+
const seekByProgress = t17;
|
|
1850
|
+
let t18;
|
|
1851
|
+
if ($[11] !== media) {
|
|
1852
|
+
t18 = time => {
|
|
1188
1853
|
if (media !== null) {
|
|
1189
|
-
media
|
|
1854
|
+
seekMedia(media, time);
|
|
1190
1855
|
}
|
|
1191
|
-
setCompleted(false);
|
|
1192
1856
|
};
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
}
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
}
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
isBackground
|
|
1857
|
+
$[11] = media;
|
|
1858
|
+
$[12] = t18;
|
|
1859
|
+
} else {
|
|
1860
|
+
t18 = $[12];
|
|
1861
|
+
}
|
|
1862
|
+
const seek = t18;
|
|
1863
|
+
let t19;
|
|
1864
|
+
if ($[13] !== media) {
|
|
1865
|
+
t19 = (level, t20) => {
|
|
1866
|
+
const fromRef = t20 === undefined ? null : t20;
|
|
1867
|
+
if (fromRef === null || media === null || fromRef === media) {
|
|
1868
|
+
setCurrentQualityLevel(level);
|
|
1869
|
+
}
|
|
1870
|
+
};
|
|
1871
|
+
$[13] = media;
|
|
1872
|
+
$[14] = t19;
|
|
1873
|
+
} else {
|
|
1874
|
+
t19 = $[14];
|
|
1875
|
+
}
|
|
1876
|
+
const finalSetCurrentQualityLevel = t19;
|
|
1877
|
+
const t20 = playing && !paused;
|
|
1878
|
+
let t21;
|
|
1879
|
+
if ($[15] !== completed || $[16] !== controls || $[17] !== controlsSuggestPlay || $[18] !== controlsTheme || $[19] !== controlsVisible || $[20] !== currentQualityLevel || $[21] !== finalSetCurrentQualityLevel || $[22] !== hasAudio || $[23] !== isBackground || $[24] !== media || $[25] !== mediaSrc || $[26] !== muted || $[27] !== seek || $[28] !== seekByProgress || $[29] !== t20) {
|
|
1880
|
+
t21 = {
|
|
1881
|
+
muted,
|
|
1882
|
+
playing: t20,
|
|
1883
|
+
completed,
|
|
1884
|
+
controls,
|
|
1885
|
+
controlsSuggestPlay,
|
|
1886
|
+
controlsVisible,
|
|
1887
|
+
media,
|
|
1888
|
+
mediaSrc,
|
|
1889
|
+
hasAudio,
|
|
1890
|
+
controlsTheme,
|
|
1891
|
+
currentQualityLevel,
|
|
1892
|
+
setMuted,
|
|
1893
|
+
setIsBackground,
|
|
1894
|
+
seekByProgress,
|
|
1895
|
+
seek,
|
|
1896
|
+
isBackground,
|
|
1233
1897
|
setPlaying: finalSetPlaying,
|
|
1234
1898
|
setControls: finalSetControls,
|
|
1235
|
-
setControlsSuggestPlay
|
|
1236
|
-
setControlsVisible
|
|
1899
|
+
setControlsSuggestPlay,
|
|
1900
|
+
setControlsVisible,
|
|
1237
1901
|
setControlsTheme: finalSetControlsTheme,
|
|
1238
|
-
showControls
|
|
1239
|
-
hideControls
|
|
1240
|
-
setMedia:
|
|
1902
|
+
showControls,
|
|
1903
|
+
hideControls,
|
|
1904
|
+
setMedia: finalSetMedia,
|
|
1241
1905
|
setCurrentQualityLevel: finalSetCurrentQualityLevel
|
|
1242
1906
|
};
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1907
|
+
$[15] = completed;
|
|
1908
|
+
$[16] = controls;
|
|
1909
|
+
$[17] = controlsSuggestPlay;
|
|
1910
|
+
$[18] = controlsTheme;
|
|
1911
|
+
$[19] = controlsVisible;
|
|
1912
|
+
$[20] = currentQualityLevel;
|
|
1913
|
+
$[21] = finalSetCurrentQualityLevel;
|
|
1914
|
+
$[22] = hasAudio;
|
|
1915
|
+
$[23] = isBackground;
|
|
1916
|
+
$[24] = media;
|
|
1917
|
+
$[25] = mediaSrc;
|
|
1918
|
+
$[26] = muted;
|
|
1919
|
+
$[27] = seek;
|
|
1920
|
+
$[28] = seekByProgress;
|
|
1921
|
+
$[29] = t20;
|
|
1922
|
+
$[30] = t21;
|
|
1923
|
+
} else {
|
|
1924
|
+
t21 = $[30];
|
|
1925
|
+
}
|
|
1926
|
+
const value_0 = t21;
|
|
1927
|
+
let t22;
|
|
1928
|
+
if ($[31] !== children || $[32] !== value_0) {
|
|
1929
|
+
t22 = /*#__PURE__*/jsx(PlaybackContext, {
|
|
1930
|
+
value: value_0,
|
|
1931
|
+
children: children
|
|
1932
|
+
});
|
|
1933
|
+
$[31] = children;
|
|
1934
|
+
$[32] = value_0;
|
|
1935
|
+
$[33] = t22;
|
|
1936
|
+
} else {
|
|
1937
|
+
t22 = $[33];
|
|
1938
|
+
}
|
|
1939
|
+
return t22;
|
|
1248
1940
|
}
|
|
1249
1941
|
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
args
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
search =
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1942
|
+
const useRoutePush = () => {
|
|
1943
|
+
const $ = c(3);
|
|
1944
|
+
const url = useUrlGenerator();
|
|
1945
|
+
const [, navigate] = useLocation();
|
|
1946
|
+
let t0;
|
|
1947
|
+
if ($[0] !== navigate || $[1] !== url) {
|
|
1948
|
+
t0 = (route, data, ...t1) => {
|
|
1949
|
+
const args = t1;
|
|
1950
|
+
if (isString(route)) {
|
|
1951
|
+
navigate(url(route, data), ...args);
|
|
1952
|
+
} else {
|
|
1953
|
+
const {
|
|
1954
|
+
pathname: t2,
|
|
1955
|
+
search: t3
|
|
1956
|
+
} = route || {};
|
|
1957
|
+
const pathname = t2 === undefined ? null : t2;
|
|
1958
|
+
const search = t3 === undefined ? null : t3;
|
|
1959
|
+
navigate(`${url(pathname, data)}${search !== null ? `?${search}` : ""}`, ...args);
|
|
1960
|
+
}
|
|
1961
|
+
};
|
|
1962
|
+
$[0] = navigate;
|
|
1963
|
+
$[1] = url;
|
|
1964
|
+
$[2] = t0;
|
|
1965
|
+
} else {
|
|
1966
|
+
t0 = $[2];
|
|
1967
|
+
}
|
|
1968
|
+
const push = t0;
|
|
1270
1969
|
return push;
|
|
1271
1970
|
};
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1971
|
+
const useRouteBack = () => {
|
|
1972
|
+
const $ = c(2);
|
|
1973
|
+
useUrlGenerator();
|
|
1974
|
+
const [, navigate] = useLocation();
|
|
1975
|
+
let t0;
|
|
1976
|
+
if ($[0] !== navigate) {
|
|
1977
|
+
t0 = () => navigate(-1);
|
|
1978
|
+
$[0] = navigate;
|
|
1979
|
+
$[1] = t0;
|
|
1980
|
+
} else {
|
|
1981
|
+
t0 = $[1];
|
|
1982
|
+
}
|
|
1983
|
+
const back = t0;
|
|
1280
1984
|
return back;
|
|
1281
1985
|
};
|
|
1282
1986
|
|
|
1283
|
-
|
|
1987
|
+
const ScreenContext = /*#__PURE__*/React.createContext({
|
|
1284
1988
|
data: null,
|
|
1285
1989
|
definition: null,
|
|
1286
1990
|
renderContext: null
|
|
1287
1991
|
});
|
|
1288
|
-
|
|
1992
|
+
const useScreen = () => {
|
|
1289
1993
|
return useContext(ScreenContext);
|
|
1290
1994
|
};
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
return _objectSpread(_objectSpread({}, definition), {}, {
|
|
1995
|
+
const useScreenDefinition = () => {
|
|
1996
|
+
const intl = useIntl();
|
|
1997
|
+
const {
|
|
1998
|
+
definition = null
|
|
1999
|
+
} = useScreen() || {};
|
|
2000
|
+
const {
|
|
2001
|
+
fields = null
|
|
2002
|
+
} = definition || {};
|
|
2003
|
+
const finalFields = useMemo(() => fields !== null ? [...fields, getScreenExtraField(intl)] : null, [fields]);
|
|
2004
|
+
return {
|
|
2005
|
+
...definition,
|
|
1303
2006
|
fields: finalFields
|
|
1304
|
-
}
|
|
2007
|
+
};
|
|
1305
2008
|
};
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
data
|
|
2009
|
+
const useScreenData = () => {
|
|
2010
|
+
const {
|
|
2011
|
+
data
|
|
2012
|
+
} = useScreen() || {};
|
|
1309
2013
|
return data;
|
|
1310
2014
|
};
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
renderContext
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
2015
|
+
const useScreenRenderContext = () => {
|
|
2016
|
+
const $ = c(8);
|
|
2017
|
+
const {
|
|
2018
|
+
renderContext: t0
|
|
2019
|
+
} = useScreen() || {};
|
|
2020
|
+
const renderContext = t0 === undefined ? "view" : t0;
|
|
2021
|
+
const isPlaceholder = renderContext === "placeholder";
|
|
2022
|
+
const isPreview = renderContext === "preview";
|
|
2023
|
+
const isEdit = renderContext === "edit";
|
|
2024
|
+
const isView = renderContext === "view";
|
|
2025
|
+
const isStatic = renderContext === "static";
|
|
2026
|
+
const isCapture = renderContext === "capture";
|
|
2027
|
+
const t1 = isView || isStatic || isCapture;
|
|
2028
|
+
let t2;
|
|
2029
|
+
if ($[0] !== isCapture || $[1] !== isEdit || $[2] !== isPlaceholder || $[3] !== isPreview || $[4] !== isStatic || $[5] !== renderContext || $[6] !== t1) {
|
|
2030
|
+
t2 = {
|
|
2031
|
+
renderContext,
|
|
2032
|
+
isPlaceholder,
|
|
2033
|
+
isPreview,
|
|
2034
|
+
isEdit,
|
|
2035
|
+
isView: t1,
|
|
2036
|
+
isStatic,
|
|
2037
|
+
isCapture
|
|
2038
|
+
};
|
|
2039
|
+
$[0] = isCapture;
|
|
2040
|
+
$[1] = isEdit;
|
|
2041
|
+
$[2] = isPlaceholder;
|
|
2042
|
+
$[3] = isPreview;
|
|
2043
|
+
$[4] = isStatic;
|
|
2044
|
+
$[5] = renderContext;
|
|
2045
|
+
$[6] = t1;
|
|
2046
|
+
$[7] = t2;
|
|
2047
|
+
} else {
|
|
2048
|
+
t2 = $[7];
|
|
2049
|
+
}
|
|
2050
|
+
return t2;
|
|
1330
2051
|
};
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
screenState
|
|
2052
|
+
const useScreenState = () => {
|
|
2053
|
+
const {
|
|
2054
|
+
screenState
|
|
2055
|
+
} = useScreen() || {};
|
|
1334
2056
|
return screenState;
|
|
1335
2057
|
};
|
|
1336
|
-
function ScreenProvider(
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
definition
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
2058
|
+
function ScreenProvider(t0) {
|
|
2059
|
+
const $ = c(13);
|
|
2060
|
+
const {
|
|
2061
|
+
data: t1,
|
|
2062
|
+
definition: t2,
|
|
2063
|
+
renderContext: t3,
|
|
2064
|
+
screenState: t4,
|
|
2065
|
+
children
|
|
2066
|
+
} = t0;
|
|
2067
|
+
const data = t1 === undefined ? null : t1;
|
|
2068
|
+
const definition = t2 === undefined ? null : t2;
|
|
2069
|
+
const renderContext = t3 === undefined ? null : t3;
|
|
2070
|
+
const screenState = t4 === undefined ? null : t4;
|
|
2071
|
+
const {
|
|
2072
|
+
data: t5,
|
|
2073
|
+
definition: t6,
|
|
2074
|
+
renderContext: t7,
|
|
2075
|
+
screenState: t8
|
|
2076
|
+
} = useScreen() || {};
|
|
2077
|
+
const previousData = t5 === undefined ? null : t5;
|
|
2078
|
+
const previousDefinition = t6 === undefined ? null : t6;
|
|
2079
|
+
const previousContext = t7 === undefined ? null : t7;
|
|
2080
|
+
const previousScreenState = t8 === undefined ? null : t8;
|
|
2081
|
+
const finalData = data || previousData || null;
|
|
2082
|
+
let t9;
|
|
2083
|
+
if ($[0] !== finalData) {
|
|
2084
|
+
t9 = finalData || {};
|
|
2085
|
+
$[0] = finalData;
|
|
2086
|
+
$[1] = t9;
|
|
2087
|
+
} else {
|
|
2088
|
+
t9 = $[1];
|
|
2089
|
+
}
|
|
2090
|
+
const {
|
|
2091
|
+
type: t10
|
|
2092
|
+
} = t9;
|
|
2093
|
+
const type = t10 === undefined ? null : t10;
|
|
2094
|
+
const screensManager = useScreensManager();
|
|
2095
|
+
let t11;
|
|
2096
|
+
if ($[2] !== screensManager || $[3] !== type) {
|
|
2097
|
+
t11 = screensManager !== null ? screensManager.getDefinition(type) : null;
|
|
2098
|
+
$[2] = screensManager;
|
|
2099
|
+
$[3] = type;
|
|
2100
|
+
$[4] = t11;
|
|
2101
|
+
} else {
|
|
2102
|
+
t11 = $[4];
|
|
2103
|
+
}
|
|
2104
|
+
const contextDefinition = t11;
|
|
2105
|
+
const finalDefinition = definition || contextDefinition || previousDefinition;
|
|
2106
|
+
const finalRenderContext = renderContext || previousContext || "view";
|
|
2107
|
+
const finalScreenState = screenState || previousScreenState || null;
|
|
2108
|
+
let t12;
|
|
2109
|
+
if ($[5] !== finalData || $[6] !== finalDefinition || $[7] !== finalRenderContext || $[8] !== finalScreenState) {
|
|
2110
|
+
t12 = {
|
|
1366
2111
|
data: finalData,
|
|
1367
2112
|
definition: finalDefinition,
|
|
1368
2113
|
renderContext: finalRenderContext,
|
|
1369
2114
|
screenState: finalScreenState
|
|
1370
2115
|
};
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
2116
|
+
$[5] = finalData;
|
|
2117
|
+
$[6] = finalDefinition;
|
|
2118
|
+
$[7] = finalRenderContext;
|
|
2119
|
+
$[8] = finalScreenState;
|
|
2120
|
+
$[9] = t12;
|
|
2121
|
+
} else {
|
|
2122
|
+
t12 = $[9];
|
|
2123
|
+
}
|
|
2124
|
+
const value = t12;
|
|
2125
|
+
let t13;
|
|
2126
|
+
if ($[10] !== children || $[11] !== value) {
|
|
2127
|
+
t13 = /*#__PURE__*/jsx(ScreenContext.Provider, {
|
|
2128
|
+
value: value,
|
|
2129
|
+
children: children
|
|
2130
|
+
});
|
|
2131
|
+
$[10] = children;
|
|
2132
|
+
$[11] = value;
|
|
2133
|
+
$[12] = t13;
|
|
2134
|
+
} else {
|
|
2135
|
+
t13 = $[12];
|
|
2136
|
+
}
|
|
2137
|
+
return t13;
|
|
1376
2138
|
}
|
|
1377
2139
|
|
|
1378
|
-
|
|
1379
|
-
var ScreenSizeContext = /*#__PURE__*/React.createContext({
|
|
2140
|
+
const ScreenSizeContext = /*#__PURE__*/React.createContext({
|
|
1380
2141
|
screen: null,
|
|
1381
2142
|
screens: [],
|
|
1382
2143
|
width: 0,
|
|
@@ -1384,54 +2145,77 @@ var ScreenSizeContext = /*#__PURE__*/React.createContext({
|
|
|
1384
2145
|
resolution: 1,
|
|
1385
2146
|
landscape: false
|
|
1386
2147
|
});
|
|
1387
|
-
|
|
2148
|
+
const useScreenSize = () => {
|
|
1388
2149
|
return useContext(ScreenSizeContext);
|
|
1389
2150
|
};
|
|
1390
2151
|
|
|
1391
2152
|
// Note: this is done to avoid excessive renders on the screens that use the context
|
|
1392
2153
|
|
|
1393
|
-
function ScreenSizeProvider(
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
2154
|
+
function ScreenSizeProvider(t0) {
|
|
2155
|
+
const $ = c(5);
|
|
2156
|
+
const {
|
|
2157
|
+
size: t1,
|
|
2158
|
+
children
|
|
2159
|
+
} = t0;
|
|
2160
|
+
let t2;
|
|
2161
|
+
if ($[0] !== t1) {
|
|
2162
|
+
t2 = t1 === undefined ? {} : t1;
|
|
2163
|
+
$[0] = t1;
|
|
2164
|
+
$[1] = t2;
|
|
2165
|
+
} else {
|
|
2166
|
+
t2 = $[1];
|
|
2167
|
+
}
|
|
2168
|
+
const size = t2;
|
|
2169
|
+
const {
|
|
2170
|
+
screen: nextScreen,
|
|
2171
|
+
width: nextWidth,
|
|
2172
|
+
height: nextHeight,
|
|
2173
|
+
resolution: nextResolution
|
|
2174
|
+
} = size;
|
|
2175
|
+
const currentSize = size;
|
|
2176
|
+
let t3;
|
|
2177
|
+
if ($[2] !== children || $[3] !== currentSize) {
|
|
2178
|
+
t3 = /*#__PURE__*/jsx(ScreenSizeContext.Provider, {
|
|
2179
|
+
value: currentSize,
|
|
2180
|
+
children: children
|
|
2181
|
+
});
|
|
2182
|
+
$[2] = children;
|
|
2183
|
+
$[3] = currentSize;
|
|
2184
|
+
$[4] = t3;
|
|
2185
|
+
} else {
|
|
2186
|
+
t3 = $[4];
|
|
2187
|
+
}
|
|
2188
|
+
return t3;
|
|
1408
2189
|
}
|
|
1409
2190
|
|
|
1410
|
-
|
|
2191
|
+
/* eslint-disable react/jsx-props-no-spreading */
|
|
2192
|
+
const useTracking = () => {
|
|
1411
2193
|
return useContext(TrackingContext);
|
|
1412
2194
|
};
|
|
1413
|
-
function TrackingProvider() {
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
children = _ref$children === void 0 ? null : _ref$children;
|
|
1424
|
-
var contextTracking = useTracking() || null;
|
|
1425
|
-
var refTracking = useRef(null);
|
|
1426
|
-
var tracking = useMemo(function () {
|
|
2195
|
+
function TrackingProvider(options = null) {
|
|
2196
|
+
const {
|
|
2197
|
+
variables = null,
|
|
2198
|
+
disabled = false,
|
|
2199
|
+
paused = false,
|
|
2200
|
+
children = null
|
|
2201
|
+
} = options || {};
|
|
2202
|
+
const contextTracking = useTracking() || null;
|
|
2203
|
+
const refTracking = useRef(null);
|
|
2204
|
+
const tracking = useMemo(() => {
|
|
1427
2205
|
if (refTracking.current === null) {
|
|
1428
2206
|
refTracking.current = new Tracking({
|
|
1429
|
-
variables:
|
|
1430
|
-
|
|
1431
|
-
|
|
2207
|
+
variables: {
|
|
2208
|
+
...(contextTracking !== null ? contextTracking.getVariables() : null),
|
|
2209
|
+
...variables
|
|
2210
|
+
},
|
|
2211
|
+
disabled,
|
|
2212
|
+
paused
|
|
1432
2213
|
});
|
|
1433
2214
|
} else {
|
|
1434
|
-
refTracking.current.setVariables(
|
|
2215
|
+
refTracking.current.setVariables({
|
|
2216
|
+
...refTracking.current.getVariables(),
|
|
2217
|
+
...variables
|
|
2218
|
+
});
|
|
1435
2219
|
refTracking.current.setDisabled(disabled);
|
|
1436
2220
|
refTracking.current.setPaused(paused);
|
|
1437
2221
|
}
|
|
@@ -1443,193 +2227,352 @@ function TrackingProvider() {
|
|
|
1443
2227
|
});
|
|
1444
2228
|
}
|
|
1445
2229
|
|
|
1446
|
-
|
|
2230
|
+
const defaultValue = {
|
|
1447
2231
|
events: new EventEmitter(),
|
|
1448
2232
|
menuVisible: false,
|
|
1449
2233
|
menuOverScreen: false,
|
|
2234
|
+
activityDetected: false,
|
|
2235
|
+
width: null,
|
|
2236
|
+
height: null,
|
|
1450
2237
|
topHeight: 0,
|
|
1451
2238
|
bottomHeight: 0,
|
|
1452
2239
|
bottomSidesWidth: 0,
|
|
1453
|
-
gotoNextScreen:
|
|
1454
|
-
gotoPreviousScreen:
|
|
1455
|
-
disableInteraction:
|
|
1456
|
-
enableInteraction:
|
|
2240
|
+
gotoNextScreen: () => {},
|
|
2241
|
+
gotoPreviousScreen: () => {},
|
|
2242
|
+
disableInteraction: () => {},
|
|
2243
|
+
enableInteraction: () => {}
|
|
1457
2244
|
};
|
|
1458
|
-
|
|
2245
|
+
const ViewerContext = /*#__PURE__*/createContext({
|
|
2246
|
+
...defaultValue,
|
|
1459
2247
|
webView: null,
|
|
1460
|
-
setWebView:
|
|
1461
|
-
})
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
2248
|
+
setWebView: () => {}
|
|
2249
|
+
});
|
|
2250
|
+
const useViewerContext = () => use(ViewerContext);
|
|
2251
|
+
const useViewerSize = () => {
|
|
2252
|
+
const $ = c(3);
|
|
2253
|
+
const {
|
|
2254
|
+
width,
|
|
2255
|
+
height
|
|
2256
|
+
} = useViewerContext();
|
|
2257
|
+
let t0;
|
|
2258
|
+
if ($[0] !== height || $[1] !== width) {
|
|
2259
|
+
t0 = {
|
|
2260
|
+
width,
|
|
2261
|
+
height
|
|
2262
|
+
};
|
|
2263
|
+
$[0] = height;
|
|
2264
|
+
$[1] = width;
|
|
2265
|
+
$[2] = t0;
|
|
2266
|
+
} else {
|
|
2267
|
+
t0 = $[2];
|
|
2268
|
+
}
|
|
2269
|
+
return t0;
|
|
1473
2270
|
};
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
2271
|
+
const useViewerNavigation = () => {
|
|
2272
|
+
const $ = c(3);
|
|
2273
|
+
const {
|
|
2274
|
+
gotoNextScreen,
|
|
2275
|
+
gotoPreviousScreen
|
|
2276
|
+
} = useViewerContext();
|
|
2277
|
+
let t0;
|
|
2278
|
+
if ($[0] !== gotoNextScreen || $[1] !== gotoPreviousScreen) {
|
|
2279
|
+
t0 = {
|
|
2280
|
+
gotoNextScreen,
|
|
2281
|
+
gotoPreviousScreen
|
|
2282
|
+
};
|
|
2283
|
+
$[0] = gotoNextScreen;
|
|
2284
|
+
$[1] = gotoPreviousScreen;
|
|
2285
|
+
$[2] = t0;
|
|
2286
|
+
} else {
|
|
2287
|
+
t0 = $[2];
|
|
2288
|
+
}
|
|
2289
|
+
return t0;
|
|
1482
2290
|
};
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
events
|
|
2291
|
+
const useViewerEvents = () => {
|
|
2292
|
+
const {
|
|
2293
|
+
events
|
|
2294
|
+
} = useViewerContext();
|
|
1486
2295
|
return events;
|
|
1487
2296
|
};
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
2297
|
+
const useViewerActivityDetected = () => {
|
|
2298
|
+
const {
|
|
2299
|
+
activityDetected: t0
|
|
2300
|
+
} = useViewerContext();
|
|
2301
|
+
const activityDetected = t0 === undefined ? false : t0;
|
|
2302
|
+
return activityDetected;
|
|
1493
2303
|
};
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
2304
|
+
const useViewerInteraction = () => {
|
|
2305
|
+
const $ = c(3);
|
|
2306
|
+
const {
|
|
2307
|
+
disableInteraction,
|
|
2308
|
+
enableInteraction
|
|
2309
|
+
} = useViewerContext();
|
|
2310
|
+
let t0;
|
|
2311
|
+
if ($[0] !== disableInteraction || $[1] !== enableInteraction) {
|
|
2312
|
+
t0 = {
|
|
2313
|
+
disableInteraction,
|
|
2314
|
+
enableInteraction
|
|
2315
|
+
};
|
|
2316
|
+
$[0] = disableInteraction;
|
|
2317
|
+
$[1] = enableInteraction;
|
|
2318
|
+
$[2] = t0;
|
|
2319
|
+
} else {
|
|
2320
|
+
t0 = $[2];
|
|
2321
|
+
}
|
|
2322
|
+
return t0;
|
|
1502
2323
|
};
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
2324
|
+
const useViewerWebView = () => {
|
|
2325
|
+
const $ = c(12);
|
|
2326
|
+
const {
|
|
2327
|
+
webView,
|
|
2328
|
+
setWebView
|
|
2329
|
+
} = useViewerContext();
|
|
2330
|
+
const t0 = webView !== null;
|
|
2331
|
+
let t1;
|
|
2332
|
+
let t2;
|
|
2333
|
+
if ($[0] !== setWebView) {
|
|
2334
|
+
t1 = newWebView => setWebView(isString(newWebView) ? {
|
|
2335
|
+
url: newWebView
|
|
2336
|
+
} : newWebView);
|
|
2337
|
+
t2 = () => setWebView(null);
|
|
2338
|
+
$[0] = setWebView;
|
|
2339
|
+
$[1] = t1;
|
|
2340
|
+
$[2] = t2;
|
|
2341
|
+
} else {
|
|
2342
|
+
t1 = $[1];
|
|
2343
|
+
t2 = $[2];
|
|
2344
|
+
}
|
|
2345
|
+
let t3;
|
|
2346
|
+
if ($[3] !== setWebView || $[4] !== webView) {
|
|
2347
|
+
t3 = newWebView_0 => setWebView({
|
|
2348
|
+
...webView,
|
|
2349
|
+
...newWebView_0
|
|
1521
2350
|
});
|
|
1522
|
-
|
|
2351
|
+
$[3] = setWebView;
|
|
2352
|
+
$[4] = webView;
|
|
2353
|
+
$[5] = t3;
|
|
2354
|
+
} else {
|
|
2355
|
+
t3 = $[5];
|
|
2356
|
+
}
|
|
2357
|
+
let t4;
|
|
2358
|
+
if ($[6] !== t0 || $[7] !== t1 || $[8] !== t2 || $[9] !== t3 || $[10] !== webView) {
|
|
2359
|
+
t4 = {
|
|
2360
|
+
...webView,
|
|
2361
|
+
opened: t0,
|
|
2362
|
+
open: t1,
|
|
2363
|
+
close: t2,
|
|
2364
|
+
update: t3
|
|
2365
|
+
};
|
|
2366
|
+
$[6] = t0;
|
|
2367
|
+
$[7] = t1;
|
|
2368
|
+
$[8] = t2;
|
|
2369
|
+
$[9] = t3;
|
|
2370
|
+
$[10] = webView;
|
|
2371
|
+
$[11] = t4;
|
|
2372
|
+
} else {
|
|
2373
|
+
t4 = $[11];
|
|
2374
|
+
}
|
|
2375
|
+
const value = t4;
|
|
1523
2376
|
return value;
|
|
1524
2377
|
};
|
|
1525
|
-
function ViewerProvider(
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
events
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
events
|
|
1558
|
-
menuVisible
|
|
1559
|
-
menuOverScreen
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
2378
|
+
function ViewerProvider(t0) {
|
|
2379
|
+
const $ = c(18);
|
|
2380
|
+
const {
|
|
2381
|
+
children,
|
|
2382
|
+
events,
|
|
2383
|
+
menuVisible: t1,
|
|
2384
|
+
menuOverScreen: t2,
|
|
2385
|
+
activityDetected: t3,
|
|
2386
|
+
width,
|
|
2387
|
+
height,
|
|
2388
|
+
topHeight: t4,
|
|
2389
|
+
bottomHeight: t5,
|
|
2390
|
+
bottomSidesWidth: t6,
|
|
2391
|
+
gotoNextScreen: t7,
|
|
2392
|
+
gotoPreviousScreen: t8,
|
|
2393
|
+
disableInteraction: t9,
|
|
2394
|
+
enableInteraction: t10
|
|
2395
|
+
} = t0;
|
|
2396
|
+
const menuVisible = t1 === undefined ? false : t1;
|
|
2397
|
+
const menuOverScreen = t2 === undefined ? false : t2;
|
|
2398
|
+
const activityDetected = t3 === undefined ? false : t3;
|
|
2399
|
+
const topHeight = t4 === undefined ? 0 : t4;
|
|
2400
|
+
const bottomHeight = t5 === undefined ? 0 : t5;
|
|
2401
|
+
const bottomSidesWidth = t6 === undefined ? 0 : t6;
|
|
2402
|
+
const gotoNextScreen = t7 === undefined ? _temp : t7;
|
|
2403
|
+
const gotoPreviousScreen = t8 === undefined ? _temp2 : t8;
|
|
2404
|
+
const disableInteraction = t9 === undefined ? _temp3 : t9;
|
|
2405
|
+
const enableInteraction = t10 === undefined ? _temp4 : t10;
|
|
2406
|
+
const [webView, setWebView] = useState(null);
|
|
2407
|
+
let t11;
|
|
2408
|
+
if ($[0] !== activityDetected || $[1] !== bottomHeight || $[2] !== bottomSidesWidth || $[3] !== disableInteraction || $[4] !== enableInteraction || $[5] !== events || $[6] !== gotoNextScreen || $[7] !== gotoPreviousScreen || $[8] !== height || $[9] !== menuOverScreen || $[10] !== menuVisible || $[11] !== topHeight || $[12] !== webView || $[13] !== width) {
|
|
2409
|
+
t11 = {
|
|
2410
|
+
events,
|
|
2411
|
+
menuVisible,
|
|
2412
|
+
menuOverScreen,
|
|
2413
|
+
activityDetected,
|
|
2414
|
+
width,
|
|
2415
|
+
height,
|
|
2416
|
+
topHeight,
|
|
2417
|
+
bottomHeight,
|
|
2418
|
+
bottomSidesWidth,
|
|
2419
|
+
gotoNextScreen,
|
|
2420
|
+
gotoPreviousScreen,
|
|
2421
|
+
disableInteraction,
|
|
2422
|
+
enableInteraction,
|
|
2423
|
+
webView,
|
|
2424
|
+
setWebView
|
|
1571
2425
|
};
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
2426
|
+
$[0] = activityDetected;
|
|
2427
|
+
$[1] = bottomHeight;
|
|
2428
|
+
$[2] = bottomSidesWidth;
|
|
2429
|
+
$[3] = disableInteraction;
|
|
2430
|
+
$[4] = enableInteraction;
|
|
2431
|
+
$[5] = events;
|
|
2432
|
+
$[6] = gotoNextScreen;
|
|
2433
|
+
$[7] = gotoPreviousScreen;
|
|
2434
|
+
$[8] = height;
|
|
2435
|
+
$[9] = menuOverScreen;
|
|
2436
|
+
$[10] = menuVisible;
|
|
2437
|
+
$[11] = topHeight;
|
|
2438
|
+
$[12] = webView;
|
|
2439
|
+
$[13] = width;
|
|
2440
|
+
$[14] = t11;
|
|
2441
|
+
} else {
|
|
2442
|
+
t11 = $[14];
|
|
2443
|
+
}
|
|
2444
|
+
const value = t11;
|
|
2445
|
+
let t12;
|
|
2446
|
+
if ($[15] !== children || $[16] !== value) {
|
|
2447
|
+
t12 = /*#__PURE__*/jsx(ViewerContext, {
|
|
2448
|
+
value: value,
|
|
2449
|
+
children: children
|
|
2450
|
+
});
|
|
2451
|
+
$[15] = children;
|
|
2452
|
+
$[16] = value;
|
|
2453
|
+
$[17] = t12;
|
|
2454
|
+
} else {
|
|
2455
|
+
t12 = $[17];
|
|
2456
|
+
}
|
|
2457
|
+
return t12;
|
|
1577
2458
|
}
|
|
2459
|
+
function _temp4() {}
|
|
2460
|
+
function _temp3() {}
|
|
2461
|
+
function _temp2() {}
|
|
2462
|
+
function _temp() {}
|
|
1578
2463
|
|
|
1579
|
-
|
|
2464
|
+
const VisitorContext = /*#__PURE__*/createContext({
|
|
1580
2465
|
visitor: null,
|
|
1581
|
-
setVisitor:
|
|
2466
|
+
setVisitor: () => {}
|
|
1582
2467
|
});
|
|
1583
2468
|
function useVisitorContext() {
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
2469
|
+
const $ = c(3);
|
|
2470
|
+
const {
|
|
2471
|
+
visitor,
|
|
2472
|
+
setVisitor
|
|
2473
|
+
} = useContext(VisitorContext);
|
|
2474
|
+
let t0;
|
|
2475
|
+
if ($[0] !== setVisitor || $[1] !== visitor) {
|
|
2476
|
+
t0 = {
|
|
2477
|
+
visitor,
|
|
2478
|
+
setVisitor
|
|
2479
|
+
};
|
|
2480
|
+
$[0] = setVisitor;
|
|
2481
|
+
$[1] = visitor;
|
|
2482
|
+
$[2] = t0;
|
|
2483
|
+
} else {
|
|
2484
|
+
t0 = $[2];
|
|
2485
|
+
}
|
|
2486
|
+
return t0;
|
|
1591
2487
|
}
|
|
1592
2488
|
function useVisitor() {
|
|
1593
|
-
|
|
1594
|
-
visitor
|
|
2489
|
+
const {
|
|
2490
|
+
visitor
|
|
2491
|
+
} = useContext(VisitorContext);
|
|
1595
2492
|
return visitor;
|
|
1596
2493
|
}
|
|
1597
2494
|
function useSetVisitor() {
|
|
1598
|
-
|
|
1599
|
-
setVisitor
|
|
2495
|
+
const {
|
|
2496
|
+
setVisitor
|
|
2497
|
+
} = useContext(VisitorContext);
|
|
1600
2498
|
return setVisitor;
|
|
1601
2499
|
}
|
|
1602
|
-
function VisitorProvider(
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
2500
|
+
function VisitorProvider(t0) {
|
|
2501
|
+
const $ = c(13);
|
|
2502
|
+
const {
|
|
2503
|
+
visitor: t1,
|
|
2504
|
+
children
|
|
2505
|
+
} = t0;
|
|
2506
|
+
const providedVisitor = t1 === undefined ? null : t1;
|
|
2507
|
+
let t2;
|
|
2508
|
+
if ($[0] !== providedVisitor) {
|
|
2509
|
+
t2 = isString(providedVisitor) ? {
|
|
1607
2510
|
id: providedVisitor
|
|
1608
|
-
} : providedVisitor
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
setVisitor: function setVisitor(newVisitor) {
|
|
1623
|
-
return _setVisitor(isString(newVisitor) ? {
|
|
1624
|
-
id: newVisitor
|
|
1625
|
-
} : newVisitor);
|
|
2511
|
+
} : providedVisitor;
|
|
2512
|
+
$[0] = providedVisitor;
|
|
2513
|
+
$[1] = t2;
|
|
2514
|
+
} else {
|
|
2515
|
+
t2 = $[1];
|
|
2516
|
+
}
|
|
2517
|
+
const [visitor, setVisitor] = useState(t2);
|
|
2518
|
+
let t3;
|
|
2519
|
+
if ($[2] !== providedVisitor || $[3] !== visitor) {
|
|
2520
|
+
t3 = () => {
|
|
2521
|
+
if (providedVisitor !== visitor) {
|
|
2522
|
+
setVisitor(isString(providedVisitor) ? {
|
|
2523
|
+
id: providedVisitor
|
|
2524
|
+
} : providedVisitor);
|
|
1626
2525
|
}
|
|
1627
2526
|
};
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
2527
|
+
$[2] = providedVisitor;
|
|
2528
|
+
$[3] = visitor;
|
|
2529
|
+
$[4] = t3;
|
|
2530
|
+
} else {
|
|
2531
|
+
t3 = $[4];
|
|
2532
|
+
}
|
|
2533
|
+
let t4;
|
|
2534
|
+
if ($[5] !== providedVisitor) {
|
|
2535
|
+
t4 = [providedVisitor, setVisitor];
|
|
2536
|
+
$[5] = providedVisitor;
|
|
2537
|
+
$[6] = t4;
|
|
2538
|
+
} else {
|
|
2539
|
+
t4 = $[6];
|
|
2540
|
+
}
|
|
2541
|
+
useEffect(t3, t4);
|
|
2542
|
+
let t5;
|
|
2543
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2544
|
+
t5 = newVisitor => setVisitor(isString(newVisitor) ? {
|
|
2545
|
+
id: newVisitor
|
|
2546
|
+
} : newVisitor);
|
|
2547
|
+
$[7] = t5;
|
|
2548
|
+
} else {
|
|
2549
|
+
t5 = $[7];
|
|
2550
|
+
}
|
|
2551
|
+
let t6;
|
|
2552
|
+
if ($[8] !== visitor) {
|
|
2553
|
+
t6 = {
|
|
2554
|
+
visitor,
|
|
2555
|
+
setVisitor: t5
|
|
2556
|
+
};
|
|
2557
|
+
$[8] = visitor;
|
|
2558
|
+
$[9] = t6;
|
|
2559
|
+
} else {
|
|
2560
|
+
t6 = $[9];
|
|
2561
|
+
}
|
|
2562
|
+
const value = t6;
|
|
2563
|
+
let t7;
|
|
2564
|
+
if ($[10] !== children || $[11] !== value) {
|
|
2565
|
+
t7 = /*#__PURE__*/jsx(VisitorContext.Provider, {
|
|
2566
|
+
value: value,
|
|
2567
|
+
children: children
|
|
2568
|
+
});
|
|
2569
|
+
$[10] = children;
|
|
2570
|
+
$[11] = value;
|
|
2571
|
+
$[12] = t7;
|
|
2572
|
+
} else {
|
|
2573
|
+
t7 = $[12];
|
|
2574
|
+
}
|
|
2575
|
+
return t7;
|
|
1633
2576
|
}
|
|
1634
2577
|
|
|
1635
|
-
export { ComponentsContext, ComponentsProvider, ConsentContext, ConsentProvider, ELEMENTS_NAMESPACE, EditorContext, EditorProvider, FIELDS_NAMESPACE, FORMS_NAMESPACE, FieldContext, FieldContextProvider, FieldsContext, FieldsProvider, FieldsValueContext, FieldsValueContextProvider, FontsContext, FontsProvider, GoogleApiClientContext, GoogleApiClientProvider, GoogleKeysContext, GoogleKeysProvider, GoogleMapsClientContext, GoogleMapsClientProvider, MODALS_NAMESPACE, ModalsContext, ModalsProvider, PanelsContext, PanelsProvider, PlaybackContext, PlaybackProvider, SCREENS_NAMESPACE, ScreenContext, ScreenProvider, ScreenSizeContext, ScreenSizeProvider, ScreensContext, ScreensProvider, SettingsContext, SettingsProvider, StoryContext, StoryProvider, TrackingProvider, ViewerContext, ViewerProvider, VisitorContext, VisitorProvider,
|
|
2578
|
+
export { ComponentsContext, ComponentsProvider, ConsentContext, ConsentProvider, ELEMENTS_NAMESPACE, EditorContext, EditorProvider, FIELDS_NAMESPACE, FORMS_NAMESPACE, FieldContext, FieldContextProvider, FieldsContext, FieldsProvider, FieldsValueContext, FieldsValueContextProvider, FontsContext, FontsProvider, GoogleApiClientContext, GoogleApiClientProvider, GoogleKeysContext, GoogleKeysProvider, GoogleMapsClientContext, GoogleMapsClientProvider, MODALS_NAMESPACE, ModalsContext, ModalsProvider, PanelsContext, PanelsProvider, PlaybackContext, PlaybackProvider, SCREENS_NAMESPACE, ScreenContext, ScreenProvider, ScreenSizeContext, ScreenSizeProvider, ScreensContext, ScreensProvider, SettingsContext, SettingsProvider, StoryContext, StoryProvider, TrackingProvider, ViewerContext, ViewerProvider, VisitorContext, VisitorProvider, useComponent, useComponents, useComponentsManager, useConsent, useEditor, useElementComponent, useElementsComponents, useElementsComponentsManager, useFieldComponent, useFieldContext, useFieldDefinition, useFieldsComponents, useFieldsComponentsManager, useFieldsManager, useFieldsValue, useFonts, useFormComponent, useFormsComponents, useFormsComponentsManager, useGetColors, useGoogleApiClient, useGoogleFonts, useGoogleKeys, useGoogleMapsClient, useModalComponent, useModals, useModalsComponents, useModalsComponentsManager, usePanels, usePlaybackContext, usePlaybackMediaRef, useRouteBack, useRoutePush, useScreen, useScreenComponent, useScreenData, useScreenDefinition, useScreenRenderContext, useScreenSize, useScreenState, useScreensComponents, useScreensComponentsManager, useScreensManager, useSetVisitor, useSetting, useSettings, useStory, useStoryContext, useTracking, useViewerActivityDetected, useViewerContext, useViewerEvents, useViewerInteraction, useViewerNavigation, useViewerSize, useViewerWebView, useVisitor, useVisitorContext, withGoogleApiClient, withGoogleMapsClient, withModals, withPanels };
|