@schukai/monster 3.111.0 → 3.112.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/package.json +1 -1
  3. package/source/components/content/camera.mjs +339 -329
  4. package/source/components/content/stylesheet/camera-capture.mjs +13 -6
  5. package/source/components/datatable/status.mjs +175 -177
  6. package/source/components/form/reload.mjs +1 -2
  7. package/source/components/form/util/fetch.mjs +5 -2
  8. package/source/components/layout/popper.mjs +1 -1
  9. package/source/components/layout/slider.mjs +1 -1
  10. package/source/components/time/month-calendar.mjs +819 -0
  11. package/source/components/time/style/month-calendar.pcss +100 -0
  12. package/source/components/time/stylesheet/month-calendar.mjs +31 -0
  13. package/source/components/time/timeline/collection.mjs +205 -0
  14. package/source/components/time/timeline/item.mjs +184 -0
  15. package/source/components/time/timeline/segment.mjs +169 -0
  16. package/source/components/time/timeline/style/segment.pcss +18 -0
  17. package/source/components/time/timeline/stylesheet/segment.mjs +38 -0
  18. package/source/data/datasource/server/restapi/data-fetch-error.mjs +3 -3
  19. package/source/data/datasource/server/restapi.mjs +1 -1
  20. package/source/data/transformer.mjs +60 -0
  21. package/source/monster.mjs +4 -0
  22. package/source/text/bracketed-key-value-hash.mjs +187 -187
  23. package/source/types/base.mjs +6 -5
  24. package/source/types/basewithoptions.mjs +4 -1
  25. package/source/types/internal.mjs +1 -1
  26. package/source/types/version.mjs +1 -1
  27. package/test/cases/monster.mjs +1 -1
  28. package/test/web/test.html +2 -2
  29. package/test/web/tests.js +1135 -976
@@ -12,23 +12,21 @@
12
12
  * SPDX-License-Identifier: AGPL-3.0
13
13
  */
14
14
 
15
- import {instanceSymbol} from "../../constants.mjs";
15
+ import { instanceSymbol } from "../../constants.mjs";
16
+ import { ATTRIBUTE_ROLE } from "../../dom/constants.mjs";
17
+ import { CustomElement } from "../../dom/customelement.mjs";
16
18
  import {
17
- ATTRIBUTE_ROLE,
18
- } from "../../dom/constants.mjs";
19
- import {CustomElement} from "../../dom/customelement.mjs";
20
- import {
21
- assembleMethodSymbol,
22
- registerCustomElement,
19
+ assembleMethodSymbol,
20
+ registerCustomElement,
23
21
  } from "../../dom/customelement.mjs";
24
- import {CameraCaptureStyleSheet} from "./stylesheet/camera-capture.mjs";
22
+ import { CameraCaptureStyleSheet } from "./stylesheet/camera-capture.mjs";
25
23
  import "../form/button.mjs";
26
24
  import "../state/state.mjs";
27
- import {getLocaleOfDocument} from "../../dom/locale.mjs";
28
- import {addErrorAttribute} from "../../dom/error.mjs";
29
- import {Queue} from "../../types/queue.mjs";
25
+ import { getLocaleOfDocument } from "../../dom/locale.mjs";
26
+ import { addErrorAttribute } from "../../dom/error.mjs";
27
+ import { Queue } from "../../types/queue.mjs";
30
28
 
31
- export {CameraCapture};
29
+ export { CameraCapture };
32
30
 
33
31
  /**
34
32
  * @private
@@ -78,176 +76,178 @@ const emptyHistoryStateElementSymbol = Symbol("emptyHistoryStateElement");
78
76
  * @summary A simple but powerful camera capture component. It can be used to capture images from the camera.
79
77
  */
80
78
  class CameraCapture extends CustomElement {
81
-
82
-
83
- /**
84
- * Constructor for the CameraCapture class.
85
- * Calls the parent class constructor.
86
- */
87
- constructor() {
88
- super();
89
-
90
- this[queueSymbol] = new Queue();
91
- }
92
-
93
- /**
94
- * This method is called by the `instanceof` operator.
95
- * @return {symbol}
96
- */
97
- static get [instanceSymbol]() {
98
- return Symbol.for("@schukai/monster/components/content/camera-capture@instance");
99
- }
100
-
101
- /**
102
- *
103
- * @return {Components.Content.Copy
104
- */
105
- [assembleMethodSymbol]() {
106
- super[assembleMethodSymbol]();
107
- initControlReferences.call(this);
108
- initEventHandler.call(this);
109
- initCameraControl.call(this);
110
- return this;
111
- }
112
-
113
- /**
114
- * This method is called when the element is connected to the dom.
115
- *
116
- * @return {void}
117
- */
118
- connectedCallback() {
119
- super.connectedCallback();
120
-
121
- // const document = getDocument();
122
- //
123
- // for (const [, type] of Object.entries(["click", "touch"])) {
124
- // // close on outside ui-events
125
- // document.addEventListener(type, this[closeEventHandler]);
126
- // }
127
- //
128
- // updatePopper.call(this);
129
- // attachResizeObserver.call(this);
130
- }
131
-
132
- /**
133
- * This method is called when the element is disconnected from the dom.
134
- *
135
- * @return {void}
136
- */
137
- disconnectedCallback() {
138
- super.disconnectedCallback();
139
-
140
- // // close on outside ui-events
141
- // for (const [, type] of Object.entries(["click", "touch"])) {
142
- // document.removeEventListener(type, this[closeEventHandler]);
143
- // }
144
-
145
-
146
- }
147
-
148
- /**
149
- * To set the options via the HTML Tag, the attribute `data-monster-options` must be used.
150
- * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
151
- *
152
- * The individual configuration values can be found in the table.
153
- *
154
- * @property {Object} templates Template definitions
155
- * @property {string} templates.main Main template
156
- * @property {Object} actions Callbacks
157
- * @property {string} actions.click="throw Error" Callback when clicked
158
- * @property {Object} features Features
159
- * @property {boolean} features.stripTags=true Strip tags from the copied text
160
- * @property {boolean} features.preventOpenEventSent=false Prevent open event from being sent
161
- * @property {Object} popper Popper configuration
162
- * @property {string} popper.placement="top" Popper placement
163
- * @property {string[]} popper.middleware=["autoPlacement", "shift", "offset:15", "arrow"] Popper middleware
164
- * @property {boolean} disabled=false Disabled state
165
- */
166
- get defaults() {
167
- return Object.assign({}, super.defaults, {
168
-
169
- templates: {
170
- main: getTemplate(),
171
- },
172
-
173
- disabled: false,
174
- features: {},
175
-
176
- labels: getTranslations(),
177
- });
178
- }
179
-
180
- /**
181
- * @return {string}
182
- */
183
- static getTag() {
184
- return "monster-camera-capture";
185
- }
186
-
187
- /**
188
- * @return {CSSStyleSheet[]}
189
- */
190
- static getCSSStyleSheet() {
191
- return [CameraCaptureStyleSheet];
192
- }
193
-
194
-
195
- /**
196
- * Retrieve the next image from the queue.
197
- * If the queue is empty, it returns `null`.
198
- * @returns {string|null}
199
- */
200
- getNextImage() {
201
- if (!this[queueSymbol].isEmpty()) {
202
- const next = this[queueSymbol].poll();
203
- if (!next) {
204
- return null;
205
- }
206
- return next;
207
- }
208
- return null;
209
- }
210
-
211
- /**
212
- * Capture an image from the camera and add it to the queue.
213
- * The image is returned as a data URL.
214
- * @returns {string}
215
- */
216
- capture() {
217
-
218
- this[canvasElementSymbol].width = this[videoElementSymbol].videoWidth;
219
- this[canvasElementSymbol].height = this[videoElementSymbol].videoHeight;
220
- const ctx = this[canvasElementSymbol].getContext('2d');
221
- ctx.drawImage(this[videoElementSymbol], 0, 0, this[canvasElementSymbol].width, this[canvasElementSymbol].height);
222
- const dataURL = this[canvasElementSymbol].toDataURL('image/png');
223
- this[queueSymbol].add(dataURL);
224
- return dataURL;
225
-
226
- }
227
-
79
+ /**
80
+ * Constructor for the CameraCapture class.
81
+ * Calls the parent class constructor.
82
+ */
83
+ constructor() {
84
+ super();
85
+
86
+ this[queueSymbol] = new Queue();
87
+ }
88
+
89
+ /**
90
+ * This method is called by the `instanceof` operator.
91
+ * @return {symbol}
92
+ */
93
+ static get [instanceSymbol]() {
94
+ return Symbol.for(
95
+ "@schukai/monster/components/content/camera-capture@instance",
96
+ );
97
+ }
98
+
99
+ /**
100
+ *
101
+ * @return {Components.Content.Copy
102
+ */
103
+ [assembleMethodSymbol]() {
104
+ super[assembleMethodSymbol]();
105
+ initControlReferences.call(this);
106
+ initEventHandler.call(this);
107
+ initCameraControl.call(this);
108
+ return this;
109
+ }
110
+
111
+ /**
112
+ * This method is called when the element is connected to the dom.
113
+ *
114
+ * @return {void}
115
+ */
116
+ connectedCallback() {
117
+ super.connectedCallback();
118
+
119
+ // const document = getDocument();
120
+ //
121
+ // for (const [, type] of Object.entries(["click", "touch"])) {
122
+ // // close on outside ui-events
123
+ // document.addEventListener(type, this[closeEventHandler]);
124
+ // }
125
+ //
126
+ // updatePopper.call(this);
127
+ // attachResizeObserver.call(this);
128
+ }
129
+
130
+ /**
131
+ * This method is called when the element is disconnected from the dom.
132
+ *
133
+ * @return {void}
134
+ */
135
+ disconnectedCallback() {
136
+ super.disconnectedCallback();
137
+
138
+ // // close on outside ui-events
139
+ // for (const [, type] of Object.entries(["click", "touch"])) {
140
+ // document.removeEventListener(type, this[closeEventHandler]);
141
+ // }
142
+ }
143
+
144
+ /**
145
+ * To set the options via the HTML Tag, the attribute `data-monster-options` must be used.
146
+ * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
147
+ *
148
+ * The individual configuration values can be found in the table.
149
+ *
150
+ * @property {Object} templates Template definitions
151
+ * @property {string} templates.main Main template
152
+ * @property {Object} actions Callbacks
153
+ * @property {string} actions.click="throw Error" Callback when clicked
154
+ * @property {Object} features Features
155
+ * @property {boolean} features.stripTags=true Strip tags from the copied text
156
+ * @property {boolean} features.preventOpenEventSent=false Prevent open event from being sent
157
+ * @property {Object} popper Popper configuration
158
+ * @property {string} popper.placement="top" Popper placement
159
+ * @property {string[]} popper.middleware=["autoPlacement", "shift", "offset:15", "arrow"] Popper middleware
160
+ * @property {boolean} disabled=false Disabled state
161
+ */
162
+ get defaults() {
163
+ return Object.assign({}, super.defaults, {
164
+ templates: {
165
+ main: getTemplate(),
166
+ },
167
+
168
+ disabled: false,
169
+ features: {},
170
+
171
+ labels: getTranslations(),
172
+ });
173
+ }
174
+
175
+ /**
176
+ * @return {string}
177
+ */
178
+ static getTag() {
179
+ return "monster-camera-capture";
180
+ }
181
+
182
+ /**
183
+ * @return {CSSStyleSheet[]}
184
+ */
185
+ static getCSSStyleSheet() {
186
+ return [CameraCaptureStyleSheet];
187
+ }
188
+
189
+ /**
190
+ * Retrieve the next image from the queue.
191
+ * If the queue is empty, it returns `null`.
192
+ * @returns {string|null}
193
+ */
194
+ getNextImage() {
195
+ if (!this[queueSymbol].isEmpty()) {
196
+ const next = this[queueSymbol].poll();
197
+ if (!next) {
198
+ return null;
199
+ }
200
+ return next;
201
+ }
202
+ return null;
203
+ }
204
+
205
+ /**
206
+ * Capture an image from the camera and add it to the queue.
207
+ * The image is returned as a data URL.
208
+ * @returns {string}
209
+ */
210
+ capture() {
211
+ this[canvasElementSymbol].width = this[videoElementSymbol].videoWidth;
212
+ this[canvasElementSymbol].height = this[videoElementSymbol].videoHeight;
213
+ const ctx = this[canvasElementSymbol].getContext("2d");
214
+ ctx.drawImage(
215
+ this[videoElementSymbol],
216
+ 0,
217
+ 0,
218
+ this[canvasElementSymbol].width,
219
+ this[canvasElementSymbol].height,
220
+ );
221
+ const dataURL = this[canvasElementSymbol].toDataURL("image/png");
222
+ this[queueSymbol].add(dataURL);
223
+ return dataURL;
224
+ }
228
225
  }
229
226
 
230
227
  function initCameraControl() {
231
- const self = this;
232
-
233
- if (!navigator || !navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) {
234
- addErrorAttribute(self, "Browser not supported");
235
- return;
236
- }
237
-
238
- navigator.mediaDevices.getUserMedia({video: true})
239
- .then(function (stream) {
240
-
241
- self[takePictureButtonElementSymbol].style.display = "block";
242
- self[videoElementSymbol].style.display = "block";
243
- self[emptyHistoryStateElementSymbol].style.display = "none";
244
-
245
- self[videoElementSymbol].srcObject = stream;
246
- })
247
- .catch(function (e) {
248
- addErrorAttribute(self, e);
249
- });
250
-
228
+ const self = this;
229
+
230
+ if (
231
+ !navigator ||
232
+ !navigator.mediaDevices ||
233
+ !navigator.mediaDevices.getUserMedia
234
+ ) {
235
+ addErrorAttribute(self, "Browser not supported");
236
+ return;
237
+ }
238
+
239
+ navigator.mediaDevices
240
+ .getUserMedia({ video: true })
241
+ .then(function (stream) {
242
+ self[takePictureButtonElementSymbol].style.display = "block";
243
+ self[videoElementSymbol].style.display = "block";
244
+ self[emptyHistoryStateElementSymbol].style.display = "none";
245
+
246
+ self[videoElementSymbol].srcObject = stream;
247
+ })
248
+ .catch(function (e) {
249
+ addErrorAttribute(self, e);
250
+ });
251
251
  }
252
252
 
253
253
  /**
@@ -255,129 +255,147 @@ function initCameraControl() {
255
255
  * @returns {{takePicture: string}}
256
256
  */
257
257
  function getTranslations() {
258
- const locale = getLocaleOfDocument();
259
- switch (locale.language) {
260
- case "de":
261
- return {
262
- takePicture: "Bild aufnehmen",
263
- cameraNotSupportedOrNotAllowed: "Die Kamera wird nicht unterstützt oder die Berechtigung wurde nicht erteilt.",
264
- };
265
-
266
- case "es":
267
- return {
268
- takePicture: "Tomar una foto",
269
- cameraNotSupportedOrNotAllowed: "La cámara no es compatible o no se ha otorgado permiso.",
270
- }
271
-
272
- case "zh":
273
- return {
274
- takePicture: "拍照",
275
- cameraNotSupportedOrNotAllowed: "相机不受支持或未授予权限。",
276
- }
277
-
278
- case "hi":
279
- return {
280
- takePicture: "तस्वीर खींचें",
281
- cameraNotSupportedOrNotAllowed: "कैमरा समर्थित नहीं है या अनुमति नहीं दी गई है।",
282
- }
283
-
284
- case "bn":
285
- return {
286
- takePicture: "ছবি তুলুন",
287
- cameraNotSupportedOrNotAllowed: "ক্যামেরা সমর্থিত নয় বা অনুমতি দেয়া হয়নি।",
288
- }
289
-
290
- case "pt":
291
- return {
292
- takePicture: "Tirar uma foto",
293
- cameraNotSupportedOrNotAllowed: "A câmera não é suportada ou a permissão não foi concedida.",
294
- }
295
-
296
- case "ru":
297
- return {
298
- takePicture: "Сделать фото",
299
- cameraNotSupportedOrNotAllowed: "Камера не поддерживается или разрешение не предоставлено.",
300
- }
301
-
302
- case "ja":
303
- return {
304
- takePicture: "写真を撮る",
305
- cameraNotSupportedOrNotAllowed: "カメラがサポートされていないか、許可が付与されていません。",
306
- }
307
-
308
- case "pa":
309
- return {
310
- takePicture: "ਤਸਵੀਰ ਖਿੱਚੋ",
311
- cameraNotSupportedOrNotAllowed: "ਕੈਮਰਾ ਦਾ ਸਮਰਥਨ ਨਹੀਂ ਹੈ ਜਾਂ ਅਨੁਮਤੀ ਨਹੀਂ ਦਿੱਤੀ ਗਈ ਹੈ।",
312
- }
313
-
314
- case "mr":
315
- return {
316
- takePicture: "फोटो घ्या",
317
- cameraNotSupportedOrNotAllowed: "कॅमेरा समर्थित नाही किंवा परवानगी दिलेली नाही.",
318
- }
319
-
320
- case "fr":
321
- return {
322
- takePicture: "Prendre une photo",
323
- cameraNotSupportedOrNotAllowed: "La caméra n'est pas prise en charge ou l'autorisation n'a pas été accordée.",
324
- }
325
-
326
- case "it":
327
- return {
328
- takePicture: "Scattare una foto",
329
- cameraNotSupportedOrNotAllowed: "La fotocamera non è supportata o l'autorizzazione non è stata concessa.",
330
- }
331
-
332
- case "nl":
333
- return {
334
- takePicture: "Maak een foto",
335
- cameraNotSupportedOrNotAllowed: "De camera wordt niet ondersteund of er is geen toestemming verleend.",
336
- }
337
-
338
- case "sv":
339
- return {
340
- takePicture: "Ta ett foto",
341
- cameraNotSupportedOrNotAllowed: "Kameran stöds inte eller tillståndet har inte beviljats.",
342
- }
343
-
344
- case "pl":
345
- return {
346
- takePicture: "Zrób zdjęcie",
347
- cameraNotSupportedOrNotAllowed: "Kamera nie jest obsługiwana lub nie udzielono zgody.",
348
- }
349
-
350
- case "da":
351
- return {
352
- takePicture: "Tag et billede",
353
- cameraNotSupportedOrNotAllowed: "Kameraen understøttes ikke eller tilladelsen er ikke givet.",
354
- }
355
-
356
- case "fi":
357
- return {
358
- takePicture: "Ota kuva",
359
- cameraNotSupportedOrNotAllowed: "Kameraa ei tueta tai lupaa ei ole myönnetty.",
360
- }
361
-
362
- case "no":
363
- return {
364
- takePicture: "Ta et bilde",
365
- cameraNotSupportedOrNotAllowed: "Kameraen støttes ikke eller tillatelsen er ikke gitt.",
366
- }
367
-
368
- case "cs":
369
- return {
370
- takePicture: "Vyfotit",
371
- cameraNotSupportedOrNotAllowed: "Fotoaparát není podporován nebo povolení nebylo uděleno.",
372
- }
373
-
374
- case "en":
375
- default:
376
- return {
377
- takePicture: "Take a picture",
378
- cameraNotSupportedOrNotAllowed: "The camera is not supported or permission has not been granted.",
379
- };
380
- }
258
+ const locale = getLocaleOfDocument();
259
+ switch (locale.language) {
260
+ case "de":
261
+ return {
262
+ takePicture: "Bild aufnehmen",
263
+ cameraNotSupportedOrNotAllowed:
264
+ "Die Kamera wird nicht unterstützt oder die Berechtigung wurde nicht erteilt.",
265
+ };
266
+
267
+ case "es":
268
+ return {
269
+ takePicture: "Tomar una foto",
270
+ cameraNotSupportedOrNotAllowed:
271
+ "La cámara no es compatible o no se ha otorgado permiso.",
272
+ };
273
+
274
+ case "zh":
275
+ return {
276
+ takePicture: "拍照",
277
+ cameraNotSupportedOrNotAllowed: "相机不受支持或未授予权限。",
278
+ };
279
+
280
+ case "hi":
281
+ return {
282
+ takePicture: "तस्वीर खींचें",
283
+ cameraNotSupportedOrNotAllowed:
284
+ "कैमरा समर्थित नहीं है या अनुमति नहीं दी गई है।",
285
+ };
286
+
287
+ case "bn":
288
+ return {
289
+ takePicture: "ছবি তুলুন",
290
+ cameraNotSupportedOrNotAllowed: "ক্যামেরা সমর্থিত নয় বা অনুমতি দেয়া হয়নি।",
291
+ };
292
+
293
+ case "pt":
294
+ return {
295
+ takePicture: "Tirar uma foto",
296
+ cameraNotSupportedOrNotAllowed:
297
+ "A câmera não é suportada ou a permissão não foi concedida.",
298
+ };
299
+
300
+ case "ru":
301
+ return {
302
+ takePicture: "Сделать фото",
303
+ cameraNotSupportedOrNotAllowed:
304
+ "Камера не поддерживается или разрешение не предоставлено.",
305
+ };
306
+
307
+ case "ja":
308
+ return {
309
+ takePicture: "写真を撮る",
310
+ cameraNotSupportedOrNotAllowed:
311
+ "カメラがサポートされていないか、許可が付与されていません。",
312
+ };
313
+
314
+ case "pa":
315
+ return {
316
+ takePicture: "ਤਸਵੀਰ ਖਿੱਚੋ",
317
+ cameraNotSupportedOrNotAllowed:
318
+ "ਕੈਮਰਾ ਦਾ ਸਮਰਥਨ ਨਹੀਂ ਹੈ ਜਾਂ ਅਨੁਮਤੀ ਨਹੀਂ ਦਿੱਤੀ ਗਈ ਹੈ।",
319
+ };
320
+
321
+ case "mr":
322
+ return {
323
+ takePicture: "फोटो घ्या",
324
+ cameraNotSupportedOrNotAllowed:
325
+ "कॅमेरा समर्थित नाही किंवा परवानगी दिलेली नाही.",
326
+ };
327
+
328
+ case "fr":
329
+ return {
330
+ takePicture: "Prendre une photo",
331
+ cameraNotSupportedOrNotAllowed:
332
+ "La caméra n'est pas prise en charge ou l'autorisation n'a pas été accordée.",
333
+ };
334
+
335
+ case "it":
336
+ return {
337
+ takePicture: "Scattare una foto",
338
+ cameraNotSupportedOrNotAllowed:
339
+ "La fotocamera non è supportata o l'autorizzazione non è stata concessa.",
340
+ };
341
+
342
+ case "nl":
343
+ return {
344
+ takePicture: "Maak een foto",
345
+ cameraNotSupportedOrNotAllowed:
346
+ "De camera wordt niet ondersteund of er is geen toestemming verleend.",
347
+ };
348
+
349
+ case "sv":
350
+ return {
351
+ takePicture: "Ta ett foto",
352
+ cameraNotSupportedOrNotAllowed:
353
+ "Kameran stöds inte eller tillståndet har inte beviljats.",
354
+ };
355
+
356
+ case "pl":
357
+ return {
358
+ takePicture: "Zrób zdjęcie",
359
+ cameraNotSupportedOrNotAllowed:
360
+ "Kamera nie jest obsługiwana lub nie udzielono zgody.",
361
+ };
362
+
363
+ case "da":
364
+ return {
365
+ takePicture: "Tag et billede",
366
+ cameraNotSupportedOrNotAllowed:
367
+ "Kameraen understøttes ikke eller tilladelsen er ikke givet.",
368
+ };
369
+
370
+ case "fi":
371
+ return {
372
+ takePicture: "Ota kuva",
373
+ cameraNotSupportedOrNotAllowed:
374
+ "Kameraa ei tueta tai lupaa ei ole myönnetty.",
375
+ };
376
+
377
+ case "no":
378
+ return {
379
+ takePicture: "Ta et bilde",
380
+ cameraNotSupportedOrNotAllowed:
381
+ "Kameraen støttes ikke eller tillatelsen er ikke gitt.",
382
+ };
383
+
384
+ case "cs":
385
+ return {
386
+ takePicture: "Vyfotit",
387
+ cameraNotSupportedOrNotAllowed:
388
+ "Fotoaparát není podporován nebo povolení nebylo uděleno.",
389
+ };
390
+
391
+ case "en":
392
+ default:
393
+ return {
394
+ takePicture: "Take a picture",
395
+ cameraNotSupportedOrNotAllowed:
396
+ "The camera is not supported or permission has not been granted.",
397
+ };
398
+ }
381
399
  }
382
400
 
383
401
  /**
@@ -385,15 +403,13 @@ function getTranslations() {
385
403
  * @return {initEventHandler}
386
404
  */
387
405
  function initEventHandler() {
388
- const self = this;
389
-
406
+ const self = this;
390
407
 
391
- this[takePictureButtonElementSymbol].setOption("actions.click", function () {
392
- self.capture();
393
- });
408
+ this[takePictureButtonElementSymbol].setOption("actions.click", function () {
409
+ self.capture();
410
+ });
394
411
 
395
-
396
- return this;
412
+ return this;
397
413
  }
398
414
 
399
415
  /**
@@ -401,28 +417,22 @@ function initEventHandler() {
401
417
  * @return {void}
402
418
  */
403
419
  function initControlReferences() {
404
- this[controlElementSymbol] = this.shadowRoot.querySelector(
405
- `[${ATTRIBUTE_ROLE}="control"]`,
406
- );
407
-
408
- this[takePictureButtonElementSymbol] = this.shadowRoot.querySelector(
409
- `[data-monster-role="takePicture"]`,
410
- );
411
-
412
- this[videoElementSymbol] = this.shadowRoot.querySelector(
413
- `video`,
414
- );
420
+ this[controlElementSymbol] = this.shadowRoot.querySelector(
421
+ `[${ATTRIBUTE_ROLE}="control"]`,
422
+ );
415
423
 
416
- this[canvasElementSymbol] = this.shadowRoot.querySelector(
417
- `canvas`,
418
- );
424
+ this[takePictureButtonElementSymbol] = this.shadowRoot.querySelector(
425
+ `[data-monster-role="takePicture"]`,
426
+ );
419
427
 
420
- // data-monster-role="emptyHistoryState"
421
- this[emptyHistoryStateElementSymbol] = this.shadowRoot.querySelector(
422
- `[data-monster-role="emptyHistoryState"]`,
423
- );
428
+ this[videoElementSymbol] = this.shadowRoot.querySelector(`video`);
424
429
 
430
+ this[canvasElementSymbol] = this.shadowRoot.querySelector(`canvas`);
425
431
 
432
+ // data-monster-role="emptyHistoryState"
433
+ this[emptyHistoryStateElementSymbol] = this.shadowRoot.querySelector(
434
+ `[data-monster-role="emptyHistoryState"]`,
435
+ );
426
436
  }
427
437
 
428
438
  /**
@@ -430,8 +440,8 @@ function initControlReferences() {
430
440
  * @return {string}
431
441
  */
432
442
  function getTemplate() {
433
- // language=HTML
434
- return `
443
+ // language=HTML
444
+ return `
435
445
  <div data-monster-role="control" part="control">
436
446
  <monster-state data-monster-role="emptyHistoryState">
437
447
  <svg slot="visual" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"