iobroker.agent-dvr 0.2.1 → 0.3.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.
package/README.de.md CHANGED
@@ -13,7 +13,7 @@ Verbindet ioBroker mit [AgentDVR](https://www.ispyconnect.com): erkennt automati
13
13
 
14
14
  - Automatische Erkennung aller AgentDVR-Kameras beim Start (Mikrofone ausgenommen)
15
15
  - Alle Geräteeigenschaften als Datenpunkte gespiegelt (aus der API flachgeklopft)
16
- - Schaltflächen pro Gerät: Aufnahme, Snapshot, Erkennung, Scharf/Unscharf, Ein/Aus, Objekterkennung, Bereinigen, …
16
+ - Schaltflächen pro Gerät: Aufnahme, Snapshot, Erkennung, Scharf/Unscharf, Ein/Aus, Objekterkennung, Zeitplan Ein/Aus, Detektor Ein/Aus, Empfindlichkeit (Min/Max/Gain), Bereinigen, …
17
17
  - Systemschaltflächen: Scharf/Unscharf, Alle Ein/Aus, Konfiguration neu laden, Speicherverwaltung, Neustart, …
18
18
  - **Profilauswahl** — beschreibbares Dropdown, das das aktuelle AgentDVR-Profil widerspiegelt (Zuhause / Weg / Nacht / eigene)
19
19
  - **Snapshot als Base64** — `snapshot_b64`-Zustand pro Kamera, per Schaltfläche oder automatisch bei jedem Poll aktualisierbar
@@ -26,8 +26,8 @@ Verbindet ioBroker mit [AgentDVR](https://www.ispyconnect.com): erkennt automati
26
26
  - Kameraindividuelle Stream-Auswahl: MJPEG, MP4/FLV mit Ton oder go2rtc WebRTC/MSE
27
27
  - Kamera-Filter-Badges zum Ein-/Ausblenden einzelner Kameras (Zustand im localStorage gespeichert)
28
28
  - Echtzeit-Bewegungs- und Alarm-Indikatoren (gelber / oranger Kachelrahmen) via Socket.io
29
- - Vollbildansicht mit PTZ-Overlay und Aufnahme-Schaltfläche
30
- - Aufnahmen-Tab mit Raster- und Timeline-Ansicht, Suche, Tag-Filter und Video-Player
29
+ - Vollbildansicht mit PTZ-Overlay, Aufnahme-, Ton- und **nativer Browser-Vollbild-Schaltfläche**; Header blendet sich nach 3 s Inaktivität aus
30
+ - Aufnahmen-Tab mit Raster- und Timeline-Ansicht, Suche, **ausklappbarem Tag-Filter** und Video-Player
31
31
  - Automatischer Reconnect für alle Stream-Typen nach Netzwerkunterbrechung oder Tab-Wechsel
32
32
  - Farbdesign vollständig über die Adapter-Konfiguration anpassbar
33
33
 
@@ -199,10 +199,10 @@ Das eingebaute Live-Dashboard ist erreichbar unter `http://<iobroker>:<webport>/
199
199
  **Funktionen:**
200
200
  - Kameraindividuelle Stream-Auswahl: MJPEG, MP4/FLV mit Ton (via flv.js) oder go2rtc WebRTC/MSE
201
201
  - Kamera-Filter-Badges — per Klick einzelne Kameras ein-/ausblenden; Zustand wird im localStorage gespeichert
202
- - Vollbildansicht mit PTZ-Overlay und Aufnahme-Schaltfläche
202
+ - Vollbildansicht mit PTZ-Overlay, Aufnahme-, Ton- und nativer Browser-Vollbild-Schaltfläche; Header blendet sich nach 3 s Inaktivität aus
203
203
  - Echtzeit-Bewegungs- (gelber Rahmen) und Alarm-Indikatoren (oranger Rahmen) via Socket.io
204
204
  - Automatischer Reconnect: MJPEG und FLV bei Fehler; go2rtc bei unerwartetem WebSocket-Close oder 10 s ohne Bild
205
- - Aufnahmen-Tab mit Raster- und Timeline-Ansicht, Suche und Tag-Filter, Video-Player mit Vor-/Zurück-Navigation
205
+ - Aufnahmen-Tab mit Raster- und Timeline-Ansicht, Suche und ausklappbarem Tag-Filter, Video-Player mit Vor-/Zurück-Navigation
206
206
  - Farbdesign über die Adapter-Konfiguration einstellbar
207
207
 
208
208
  ### go2rtc WebRTC-Streams
@@ -278,8 +278,15 @@ Das eingebaute Live-Dashboard ist erreichbar unter `http://<iobroker>:<webport>/
278
278
  | `<cam>.control.alertOff` | Taste | W | Alarme deaktivieren |
279
279
  | `<cam>.control.switchOn` | Taste | W | Kamera einschalten |
280
280
  | `<cam>.control.switchOff` | Taste | W | Kamera ausschalten |
281
- | `<cam>.control.objectDetectOn` | Taste | W | Objekterkennung einschalten |
282
- | `<cam>.control.objectDetectOff` | Taste | W | Objekterkennung ausschalten |
281
+ | `<cam>.control.objectDetectOn` | Taste | W | Objekterkennung einschalten *(nur Kameras)* |
282
+ | `<cam>.control.objectDetectOff` | Taste | W | Objekterkennung ausschalten *(nur Kameras)* |
283
+ | `<cam>.control.scheduleOn` | Taste | W | Gerätezeitplan aktivieren |
284
+ | `<cam>.control.scheduleOff` | Taste | W | Gerätezeitplan deaktivieren |
285
+ | `<cam>.control.detectorOn` | Taste | W | Bewegungsmelder aktivieren |
286
+ | `<cam>.control.detectorOff` | Taste | W | Bewegungsmelder deaktivieren |
287
+ | `<cam>.control.sensitivityMin` | Zahl 0–100 | R/W | Empfindlichkeit — untere Schwelle *(nur Kameras)* |
288
+ | `<cam>.control.sensitivityMax` | Zahl 0–100 | R/W | Empfindlichkeit — obere Schwelle *(nur Kameras)* |
289
+ | `<cam>.control.sensitivityGain` | Zahl 0–100 | R/W | Empfindlichkeit — Verstärkung *(nur Kameras)* |
283
290
  | `<cam>.control.recOnAlert` | Taste | W | „Bei Alarm aufnehmen" aktivieren |
284
291
  | `<cam>.control.recOnDetect` | Taste | W | „Bei Erkennung aufnehmen" aktivieren |
285
292
  | `<cam>.control.purge` | Taste | W | Alle Aufnahmen dieser Kamera löschen |
@@ -305,10 +312,12 @@ Das eingebaute Live-Dashboard ist erreichbar unter `http://<iobroker>:<webport>/
305
312
 
306
313
  | Datenpunkt | Typ | R/W | Beschreibung |
307
314
  |-----------|-----|-----|-------------|
308
- | `<cam>.urls.snapshot` | string | R | URL zum aktuellen JPEG-Snapshot |
309
- | `<cam>.urls.photo` | string | R | URL zum Foto-Endpoint |
310
- | `<cam>.urls.mjpeg` | string | R | URL zum MJPEG-Livestream |
311
- | `<cam>.urls.mp4` | string | R | URL zum MP4-Livestream |
315
+ | `<cam>.urls.snapshot` | string | R | URL zum aktuellen JPEG-Snapshot *(nur Kameras)* |
316
+ | `<cam>.urls.photo` | string | R | URL zum Foto-Endpoint *(nur Kameras)* |
317
+ | `<cam>.urls.mjpeg` | string | R | URL zum MJPEG-Livestream *(nur Kameras)* |
318
+ | `<cam>.urls.mp4` | string | R | URL zum MP4-Livestream *(nur Kameras)* |
319
+ | `<mic>.urls.audio_mp3` | string | R | URL zum MP3-Audiostream *(nur Mikrofone)* |
320
+ | `<mic>.urls.audio_ogg` | string | R | URL zum OGG-Audiostream *(nur Mikrofone)* |
312
321
 
313
322
  ### Ereignisse / Galerie
314
323
 
@@ -330,10 +339,27 @@ Das eingebaute Live-Dashboard ist erreichbar unter `http://<iobroker>:<webport>/
330
339
  Placeholder for the next version (at the beginning of the line):
331
340
  ### **WORK IN PROGRESS**
332
341
  -->
333
- ### **WORK IN PROGRESS**
342
+ ### 0.3.0 (2026-07-06)
343
+ * (ipod86) feat: Steuerbuttons scheduleOn/Off und detectorOn/Off für Kameras und Mikrofone
344
+ * (ipod86) feat: Empfindlichkeitszustände sensitivityMin, sensitivityMax, sensitivityGain für Kameras (0–100)
345
+ * (ipod86) feat: URL-Zustände audio_mp3 und audio_ogg für Mikrofone
346
+ * (ipod86) fix: objectDetectOn/Off und Snapshot-Schaltfläche auf Kameras (ot=2) beschränkt
347
+ * (ipod86) feat: flv.js in Dashboard-HTML eingebettet — keine externe Datei mehr nötig
348
+ * (ipod86) fix: FLV-Stream-Seitenverhältnis nach Tab-Wechsel korrekt beibehalten
349
+ * (ipod86) feat: ausklappbarer Tag-Filter in Aufnahmen- und Timeline-Ansicht
350
+ * (ipod86) feat: nativer Browser-Vollbild-Button im Live-View-Modal mit korrektem Seitenverhältnis
351
+ * (ipod86) feat: Header im Live-View-Modal blendet sich nach 3 s Inaktivität aus, erscheint bei Maus/Touch wieder
352
+ * (ipod86) fix: i18n-Keys fsEnter, fsExit, filterByLabel, timelineView, closePanel in allen 10 Sprachen
353
+
354
+ ### 0.2.2 (2026-07-04)
355
+ * (ipod86) fix: verbleibende deutsche Strings im DashboardPanel via I18n.t() übersetzt
356
+ * (ipod86) fix: i18n-Keys loadingCamerasAndStreams, cfgCameraColumn, cfgStreamSourceColumn, reload in allen 11 Sprachen ergänzt
357
+ * (ipod86) chore: POSIX mv durch plattformübergreifendes node rename im src-admin Build-Script ersetzt
358
+
359
+ ### 0.2.1 (2026-07-04)
334
360
  * (ipod86) fix: alle deutschen Benutzer-Strings und Fehlermeldungen auf Englisch übersetzt
335
361
  * (ipod86) fix: DashboardPanel zeigt i18n-fähige Meldungen bei fehlender IP und leerer Kameraliste
336
- * (ipod86) chore: .npmignore hinzugefügtsrc/ und src-admin/ werden nicht ans npm-Paket ausgeliefert
362
+ * (ipod86) chore: .npmignore entferntfiles-Feld in package.json steuert npm-Paketinhalt korrekt
337
363
 
338
364
  ### 0.2.0 (2026-07-04)
339
365
  * (ipod86) feat: Kamera-Filter-Badges im Dashboard mit localStorage-Persistenz
package/README.md CHANGED
@@ -18,7 +18,7 @@ Connects ioBroker to [AgentDVR](https://www.ispyconnect.com): auto-discovers all
18
18
 
19
19
  - Auto-discovery of all AgentDVR cameras on startup (microphones excluded)
20
20
  - All device properties mirrored as data points (flattened from the API)
21
- - Per-device control buttons: record, snapshot, detect, arm/disarm alerts, switch on/off, object detection, purge, …
21
+ - Per-device control buttons: record, snapshot, detect, arm/disarm alerts, switch on/off, object detection, schedule on/off, detector on/off, sensitivity (min/max/gain), purge, …
22
22
  - System-level buttons: arm, disarm, all on/off, reload, storage management, restart, …
23
23
  - **Profile selector** — writable dropdown reflecting the current AgentDVR profile (Home / Away / Night / custom)
24
24
  - **Snapshot as Base64** — `snapshot_b64` state per camera, writable via button or auto-updated every poll cycle
@@ -31,8 +31,8 @@ Connects ioBroker to [AgentDVR](https://www.ispyconnect.com): auto-discovers all
31
31
  - Per-camera stream selection: MJPEG, MP4/FLV with audio, or go2rtc WebRTC/MSE
32
32
  - Camera filter badges to show/hide individual cameras (state saved in localStorage)
33
33
  - Real-time motion and alert indicators (yellow / orange tile border) via Socket.io
34
- - Fullscreen view with PTZ overlay and record button
35
- - Recordings tab with grid and timeline view, search, tag filter, and video player
34
+ - Fullscreen view with PTZ overlay, record, mute, and native browser fullscreen button; header auto-hides
35
+ - Recordings tab with grid and timeline view, search, collapsible tag filter, and video player
36
36
  - Auto-reconnect for all stream types after network interruption or tab switch
37
37
  - Fully color-themeable via adapter config
38
38
 
@@ -204,10 +204,10 @@ The adapter ships a built-in live dashboard at `http://<iobroker>:<webport>/agen
204
204
  **Features:**
205
205
  - Per-camera stream selection: MJPEG, MP4/FLV with audio (via flv.js), or go2rtc WebRTC/MSE
206
206
  - Camera filter badges — click to show/hide individual cameras; state persisted in localStorage
207
- - Fullscreen view with PTZ overlay and record button
207
+ - Fullscreen view with PTZ overlay, record button, mute button, and **native browser fullscreen** (header auto-hides after 3 s of inactivity; reappears on mouse or touch)
208
208
  - Real-time motion (yellow border) and alert (orange border) indicators via Socket.io
209
209
  - Auto-reconnect: MJPEG and FLV reconnect after error; go2rtc reconnects after unexpected WebSocket close or 10 s stall
210
- - Recordings tab with grid and timeline view, search and tag filter, video player with prev/next navigation
210
+ - Recordings tab with grid and timeline view, search, **collapsible tag filter**, and video player with prev/next navigation
211
211
  - Color theming via adapter config
212
212
 
213
213
  ### go2rtc WebRTC Streams
@@ -283,8 +283,15 @@ The adapter ships a built-in live dashboard at `http://<iobroker>:<webport>/agen
283
283
  | `<cam>.control.alertOff` | button | W | Disarm alerts |
284
284
  | `<cam>.control.switchOn` | button | W | Switch camera on |
285
285
  | `<cam>.control.switchOff` | button | W | Switch camera off |
286
- | `<cam>.control.objectDetectOn` | button | W | Enable object detection |
287
- | `<cam>.control.objectDetectOff` | button | W | Disable object detection |
286
+ | `<cam>.control.objectDetectOn` | button | W | Enable object detection *(cameras only)* |
287
+ | `<cam>.control.objectDetectOff` | button | W | Disable object detection *(cameras only)* |
288
+ | `<cam>.control.scheduleOn` | button | W | Enable the device schedule |
289
+ | `<cam>.control.scheduleOff` | button | W | Disable the device schedule |
290
+ | `<cam>.control.detectorOn` | button | W | Enable the motion detector |
291
+ | `<cam>.control.detectorOff` | button | W | Disable the motion detector |
292
+ | `<cam>.control.sensitivityMin` | number 0–100 | R/W | Detector sensitivity — minimum threshold *(cameras only)* |
293
+ | `<cam>.control.sensitivityMax` | number 0–100 | R/W | Detector sensitivity — maximum threshold *(cameras only)* |
294
+ | `<cam>.control.sensitivityGain` | number 0–100 | R/W | Detector sensitivity — gain *(cameras only)* |
288
295
  | `<cam>.control.recOnAlert` | button | W | Enable "record on alert" |
289
296
  | `<cam>.control.recOnDetect` | button | W | Enable "record on detect" |
290
297
  | `<cam>.control.purge` | button | W | Delete all recordings for this camera |
@@ -310,10 +317,12 @@ The adapter ships a built-in live dashboard at `http://<iobroker>:<webport>/agen
310
317
 
311
318
  | Data point | Type | R/W | Description |
312
319
  |-----------|------|-----|-------------|
313
- | `<cam>.urls.snapshot` | string | R | URL to current JPEG snapshot |
314
- | `<cam>.urls.photo` | string | R | URL to photo endpoint |
315
- | `<cam>.urls.mjpeg` | string | R | URL to MJPEG live stream |
316
- | `<cam>.urls.mp4` | string | R | URL to MP4 live stream |
320
+ | `<cam>.urls.snapshot` | string | R | URL to current JPEG snapshot *(cameras only)* |
321
+ | `<cam>.urls.photo` | string | R | URL to photo endpoint *(cameras only)* |
322
+ | `<cam>.urls.mjpeg` | string | R | URL to MJPEG live stream *(cameras only)* |
323
+ | `<cam>.urls.mp4` | string | R | URL to MP4 live stream *(cameras only)* |
324
+ | `<mic>.urls.audio_mp3` | string | R | URL to MP3 audio stream *(microphones only)* |
325
+ | `<mic>.urls.audio_ogg` | string | R | URL to OGG audio stream *(microphones only)* |
317
326
 
318
327
  ### Events / Gallery *(cameras only)*
319
328
 
@@ -335,6 +344,23 @@ The adapter ships a built-in live dashboard at `http://<iobroker>:<webport>/agen
335
344
  Placeholder for the next version (at the beginning of the line):
336
345
  ### **WORK IN PROGRESS**
337
346
  -->
347
+ ### 0.3.0 (2026-07-06)
348
+ * (ipod86) feat: add scheduleOn/Off and detectorOn/Off control buttons for cameras and microphones
349
+ * (ipod86) feat: add sensitivityMin, sensitivityMax, sensitivityGain level states for cameras (0–100)
350
+ * (ipod86) feat: add audio_mp3 and audio_ogg URL states for microphones
351
+ * (ipod86) fix: restrict objectDetectOn/Off and snapshot buttons to cameras (ot=2) only
352
+ * (ipod86) feat: inline flv.js into dashboard HTML — no external file required
353
+ * (ipod86) fix: preserve FLV stream aspect ratio after tab visibility change (all three player call sites)
354
+ * (ipod86) feat: collapsible tag filter row on recordings and timeline pages
355
+ * (ipod86) feat: native browser fullscreen button in live view modal with correct aspect ratio
356
+ * (ipod86) feat: live view modal header auto-hides after 3 s of inactivity; reappears on mouse/touch
357
+ * (ipod86) fix: add fsEnter, fsExit, filterByLabel, timelineView, closePanel i18n keys in all 10 languages
358
+
359
+ ### 0.2.2 (2026-07-04)
360
+ * (ipod86) fix: translate remaining German strings in DashboardPanel to English via I18n.t()
361
+ * (ipod86) fix: add i18n keys loadingCamerasAndStreams, cfgCameraColumn, cfgStreamSourceColumn, reload in all 11 languages
362
+ * (ipod86) chore: replace POSIX mv with cross-platform node rename in src-admin build script
363
+
338
364
  ### 0.2.1 (2026-07-04)
339
365
  * (ipod86) fix: translate all German user-facing strings and error messages to English
340
366
  * (ipod86) fix: DashboardPanel shows i18n-aware messages for missing IP and empty camera list
@@ -364,16 +390,6 @@ The adapter ships a built-in live dashboard at `http://<iobroker>:<webport>/agen
364
390
  ### 0.0.6 (2026-07-01)
365
391
  * (ipod86) docs: add Live Dashboard and go2rtc WebRTC sections to README
366
392
 
367
- ### 0.0.5 (2026-07-01)
368
- * (ipod86) feat: go2rtc WebRTC stream integration — per-camera mapping table in admin, ioBroker WebSocket proxy to bypass browser cross-origin restrictions
369
- * (ipod86) feat: auto-delete camera/microphone data points when device is removed from AgentDVR
370
- * (ipod86) feat: dedicated `status.*` data points per camera
371
- * (ipod86) feat: dashboard — full color theming, configurable tag-badge corner position
372
- * (ipod86) feat: dashboard — record/stop button on camera tiles and in fullscreen panel
373
- * (ipod86) feat: dashboard — real-time motion and alert indicators via Socket.io
374
- * (ipod86) feat: dashboard — recording timeline view
375
- * (ipod86) feat: dashboard — PTZ and record buttons in fullscreen panel
376
-
377
393
  [Older changelog entries in CHANGELOG_OLD.md](CHANGELOG_OLD.md)
378
394
 
379
395
  ## License
@@ -682,4 +682,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
682
682
  cursor: pointer;
683
683
  }
684
684
  `),B.createElement(uK,null,this.getToolbar()),B.createElement(lK,null,this.renderHeader(),B.createElement($x,{style:$.tableDiv,ref:this.tableRef,onKeyDown:e=>this.navigateKeyPress(e)},e)),this.renderContextMenu(),this.renderAliasMenu(),this.renderToast(),this.renderColumnsEditCustomDialog(),this.renderColumnsSelectorDialog(),this.renderCustomDialog(),this.renderEditValueDialog(),this.renderEditObjectDialog(),this.renderViewObjectFileDialog(),this.renderAliasEditorDialog(),this.renderEditRoleDialog(),this.renderEnumDialog(),this.renderErrorDialog(),this.renderExportDialog(),this.renderRenameDialog(),this.renderInputJsonDialog(),this.state.modalNewObj&&this.props.modalNewObject&&this.props.modalNewObject(this),this.state.modalEditOfAccess&&this.state.modalEditOfAccessObjData&&this.props.modalEditOfAccessControl&&this.props.modalEditOfAccessControl(this,this.state.modalEditOfAccessObjData))}};TW()(rq),B.Component,B.Component;var iq=c(o(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self,n.Cropper=r())})(e,(function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function t(t){for(var n=1;n<arguments.length;n++){var r=arguments[n]==null?{}:arguments[n];n%2?e(Object(r),!0).forEach(function(e){c(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function n(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function r(e){var t=n(e,`string`);return typeof t==`symbol`?t:t+``}function i(e){"@babel/helpers - typeof";return i=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},i(e)}function a(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,`value`in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}function s(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e,t,n){return t=r(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e){return u(e)||d(e)||f(e)||m()}function u(e){if(Array.isArray(e))return p(e)}function d(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function f(e,t){if(e){if(typeof e==`string`)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}}function p(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function m(){throw TypeError(`Invalid attempt to spread non-iterable instance.
685
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var h=typeof window<`u`&&window.document!==void 0,g=h?window:{},_=h&&g.document.documentElement?`ontouchstart`in g.document.documentElement:!1,v=h?`PointerEvent`in g:!1,y=`cropper`,b=`all`,x=`crop`,S=`move`,C=`zoom`,w=`e`,T=`w`,E=`s`,D=`n`,O=`ne`,k=`nw`,A=`se`,j=`sw`,M=`${y}-crop`,N=`${y}-disabled`,P=`${y}-hidden`,F=`${y}-hide`,I=`${y}-invisible`,L=`${y}-modal`,ee=`${y}-move`,R=`${y}Action`,te=`${y}Preview`,ne=`crop`,re=`move`,z=`none`,ie=`crop`,ae=`cropend`,oe=`cropmove`,se=`cropstart`,ce=`dblclick`,le=_?`touchstart`:`mousedown`,ue=_?`touchmove`:`mousemove`,de=_?`touchend touchcancel`:`mouseup`,fe=v?`pointerdown`:le,pe=v?`pointermove`:ue,me=v?`pointerup pointercancel`:de,he=`ready`,ge=`resize`,_e=`wheel`,ve=`zoom`,ye=`image/jpeg`,be=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,xe=/^data:/,Se=/^data:image\/jpeg;base64,/,Ce=/^img|canvas$/i,we=200,Te=100,Ee={viewMode:0,dragMode:ne,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:``,responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:we,minContainerHeight:Te,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},De=`<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>`,Oe=Number.isNaN||g.isNaN;function ke(e){return typeof e==`number`&&!Oe(e)}var Ae=function(e){return e>0&&e<1/0};function je(e){return e===void 0}function Me(e){return i(e)===`object`&&e!==null}var Ne=Object.prototype.hasOwnProperty;function Pe(e){if(!Me(e))return!1;try{var t=e.constructor,n=t.prototype;return t&&n&&Ne.call(n,`isPrototypeOf`)}catch{return!1}}function Fe(e){return typeof e==`function`}var Ie=Array.prototype.slice;function Le(e){return Array.from?Array.from(e):Ie.call(e)}function Re(e,t){return e&&Fe(t)&&(Array.isArray(e)||ke(e.length)?Le(e).forEach(function(n,r){t.call(e,n,r,e)}):Me(e)&&Object.keys(e).forEach(function(n){t.call(e,e[n],n,e)})),e}var ze=Object.assign||function(e){var t=[...arguments].slice(1);return Me(e)&&t.length>0&&t.forEach(function(t){Me(t)&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e},Be=/\.\d*(?:0|9){12}\d*$/;function Ve(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Be.test(e)?Math.round(e*t)/t:e}var He=/^width|height|left|top|marginLeft|marginTop$/;function Ue(e,t){var n=e.style;Re(t,function(e,t){He.test(t)&&ke(e)&&(e=`${e}px`),n[t]=e})}function We(e,t){return e.classList?e.classList.contains(t):e.className.indexOf(t)>-1}function Ge(e,t){if(t){if(ke(e.length)){Re(e,function(e){Ge(e,t)});return}if(e.classList){e.classList.add(t);return}var n=e.className.trim();n?n.indexOf(t)<0&&(e.className=`${n} ${t}`):e.className=t}}function Ke(e,t){if(t){if(ke(e.length)){Re(e,function(e){Ke(e,t)});return}if(e.classList){e.classList.remove(t);return}e.className.indexOf(t)>=0&&(e.className=e.className.replace(t,``))}}function qe(e,t,n){if(t){if(ke(e.length)){Re(e,function(e){qe(e,t,n)});return}n?Ge(e,t):Ke(e,t)}}var Je=/([a-z\d])([A-Z])/g;function Ye(e){return e.replace(Je,`$1-$2`).toLowerCase()}function Xe(e,t){return Me(e[t])?e[t]:e.dataset?e.dataset[t]:e.getAttribute(`data-${Ye(t)}`)}function Ze(e,t,n){Me(n)?e[t]=n:e.dataset?e.dataset[t]=n:e.setAttribute(`data-${Ye(t)}`,n)}function Qe(e,t){if(Me(e[t]))try{delete e[t]}catch{e[t]=void 0}else if(e.dataset)try{delete e.dataset[t]}catch{e.dataset[t]=void 0}else e.removeAttribute(`data-${Ye(t)}`)}var $e=/\s\s*/,et=function(){var e=!1;if(h){var t=!1,n=function(){},r=Object.defineProperty({},"once",{get:function(){return e=!0,t},set:function(e){t=e}});g.addEventListener(`test`,n,r),g.removeEventListener(`test`,n,r)}return e}();function tt(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=n;t.trim().split($e).forEach(function(t){if(!et){var a=e.listeners;a&&a[t]&&a[t][n]&&(i=a[t][n],delete a[t][n],Object.keys(a[t]).length===0&&delete a[t],Object.keys(a).length===0&&delete e.listeners)}e.removeEventListener(t,i,r)})}function nt(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=n;t.trim().split($e).forEach(function(t){if(r.once&&!et){var a=e.listeners,o=a===void 0?{}:a;i=function(){delete o[t][n],e.removeEventListener(t,i,r);var a=[...arguments];n.apply(e,a)},o[t]||(o[t]={}),o[t][n]&&e.removeEventListener(t,o[t][n],r),o[t][n]=i,e.listeners=o}e.addEventListener(t,i,r)})}function rt(e,t,n){var r;return Fe(Event)&&Fe(CustomEvent)?r=new CustomEvent(t,{detail:n,bubbles:!0,cancelable:!0}):(r=document.createEvent(`CustomEvent`),r.initCustomEvent(t,!0,!0,n)),e.dispatchEvent(r)}function it(e){var t=e.getBoundingClientRect();return{left:t.left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}var at=g.location,ot=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function st(e){var t=e.match(ot);return t!==null&&(t[1]!==at.protocol||t[2]!==at.hostname||t[3]!==at.port)}function ct(e){var t=`timestamp=${new Date().getTime()}`;return e+(e.indexOf(`?`)===-1?`?`:`&`)+t}function lt(e){var t=e.rotate,n=e.scaleX,r=e.scaleY,i=e.translateX,a=e.translateY,o=[];ke(i)&&i!==0&&o.push(`translateX(${i}px)`),ke(a)&&a!==0&&o.push(`translateY(${a}px)`),ke(t)&&t!==0&&o.push(`rotate(${t}deg)`),ke(n)&&n!==1&&o.push(`scaleX(${n})`),ke(r)&&r!==1&&o.push(`scaleY(${r})`);var s=o.length?o.join(` `):`none`;return{WebkitTransform:s,msTransform:s,transform:s}}function ut(e){var n=t({},e),r=0;return Re(e,function(e,t){delete n[t],Re(n,function(t){var n=Math.abs(e.startX-t.startX),i=Math.abs(e.startY-t.startY),a=Math.abs(e.endX-t.endX),o=Math.abs(e.endY-t.endY),s=Math.sqrt(n*n+i*i),c=(Math.sqrt(a*a+o*o)-s)/s;Math.abs(c)>Math.abs(r)&&(r=c)})}),r}function dt(e,n){var r=e.pageX,i=e.pageY,a={endX:r,endY:i};return n?a:t({startX:r,startY:i},a)}function ft(e){var t=0,n=0,r=0;return Re(e,function(e){var i=e.startX,a=e.startY;t+=i,n+=a,r+=1}),t/=r,n/=r,{pageX:t,pageY:n}}function pt(e){var t=e.aspectRatio,n=e.height,r=e.width,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`contain`,a=Ae(r),o=Ae(n);if(a&&o){var s=n*t;i===`contain`&&s>r||i===`cover`&&s<r?n=r/t:r=n*t}else a?n=r/t:o&&(r=n*t);return{width:r,height:n}}function mt(e){var t=e.width,n=e.height,r=e.degree;if(r=Math.abs(r)%180,r===90)return{width:n,height:t};var i=r%90*Math.PI/180,a=Math.sin(i),o=Math.cos(i),s=t*o+n*a,c=t*a+n*o;return r>90?{width:c,height:s}:{width:s,height:c}}function ht(e,t,n,r){var i=t.aspectRatio,a=t.naturalWidth,o=t.naturalHeight,s=t.rotate,c=s===void 0?0:s,u=t.scaleX,d=u===void 0?1:u,f=t.scaleY,p=f===void 0?1:f,m=n.aspectRatio,h=n.naturalWidth,g=n.naturalHeight,_=r.fillColor,v=_===void 0?`transparent`:_,y=r.imageSmoothingEnabled,b=y===void 0?!0:y,x=r.imageSmoothingQuality,S=x===void 0?`low`:x,C=r.maxWidth,w=C===void 0?1/0:C,T=r.maxHeight,E=T===void 0?1/0:T,D=r.minWidth,O=D===void 0?0:D,k=r.minHeight,A=k===void 0?0:k,j=document.createElement(`canvas`),M=j.getContext(`2d`),N=pt({aspectRatio:m,width:w,height:E}),P=pt({aspectRatio:m,width:O,height:A},`cover`),F=Math.min(N.width,Math.max(P.width,h)),I=Math.min(N.height,Math.max(P.height,g)),L=pt({aspectRatio:i,width:w,height:E}),ee=pt({aspectRatio:i,width:O,height:A},`cover`),R=Math.min(L.width,Math.max(ee.width,a)),te=Math.min(L.height,Math.max(ee.height,o)),ne=[-R/2,-te/2,R,te];return j.width=Ve(F),j.height=Ve(I),M.fillStyle=v,M.fillRect(0,0,F,I),M.save(),M.translate(F/2,I/2),M.rotate(c*Math.PI/180),M.scale(d,p),M.imageSmoothingEnabled=b,M.imageSmoothingQuality=S,M.drawImage.apply(M,[e].concat(l(ne.map(function(e){return Math.floor(Ve(e))})))),M.restore(),j}var gt=String.fromCharCode;function B(e,t,n){var r=``;n+=t;for(var i=t;i<n;i+=1)r+=gt(e.getUint8(i));return r}var _t=/^data:.*,/;function vt(e){var t=e.replace(_t,``),n=atob(t),r=new ArrayBuffer(n.length),i=new Uint8Array(r);return Re(i,function(e,t){i[t]=n.charCodeAt(t)}),r}function yt(e,t){for(var n=[],r=8192,i=new Uint8Array(e);i.length>0;)n.push(gt.apply(null,Le(i.subarray(0,r)))),i=i.subarray(r);return`data:${t};base64,${btoa(n.join(``))}`}function bt(e){var t=new DataView(e),n;try{var r,i,a;if(t.getUint8(0)===255&&t.getUint8(1)===216)for(var o=t.byteLength,s=2;s+1<o;){if(t.getUint8(s)===255&&t.getUint8(s+1)===225){i=s;break}s+=1}if(i){var c=i+4,l=i+10;if(B(t,c,4)===`Exif`){var u=t.getUint16(l);if(r=u===18761,(r||u===19789)&&t.getUint16(l+2,r)===42){var d=t.getUint32(l+4,r);d>=8&&(a=l+d)}}}if(a){var f=t.getUint16(a,r),p,m;for(m=0;m<f;m+=1)if(p=a+m*12+2,t.getUint16(p,r)===274){p+=8,n=t.getUint16(p,r),t.setUint16(p,1,r);break}}}catch{n=1}return n}function xt(e){var t=0,n=1,r=1;switch(e){case 2:n=-1;break;case 3:t=-180;break;case 4:r=-1;break;case 5:t=90,r=-1;break;case 6:t=90;break;case 7:t=90,n=-1;break;case 8:t=-90;break}return{rotate:t,scaleX:n,scaleY:r}}var St={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var e=this.element,t=this.options,n=this.container,r=this.cropper,i=Number(t.minContainerWidth),a=Number(t.minContainerHeight);Ge(r,P),Ke(e,P);var o={width:Math.max(n.offsetWidth,i>=0?i:we),height:Math.max(n.offsetHeight,a>=0?a:Te)};this.containerData=o,Ue(r,{width:o.width,height:o.height}),Ge(e,P),Ke(r,P)},initCanvas:function(){var e=this.containerData,t=this.imageData,n=this.options.viewMode,r=Math.abs(t.rotate)%180==90,i=r?t.naturalHeight:t.naturalWidth,a=r?t.naturalWidth:t.naturalHeight,o=i/a,s=e.width,c=e.height;e.height*o>e.width?n===3?s=e.height*o:c=e.width/o:n===3?c=e.width/o:s=e.height*o;var l={aspectRatio:o,naturalWidth:i,naturalHeight:a,width:s,height:c};this.canvasData=l,this.limited=n===1||n===2,this.limitCanvas(!0,!0),l.width=Math.min(Math.max(l.width,l.minWidth),l.maxWidth),l.height=Math.min(Math.max(l.height,l.minHeight),l.maxHeight),l.left=(e.width-l.width)/2,l.top=(e.height-l.height)/2,l.oldLeft=l.left,l.oldTop=l.top,this.initialCanvasData=ze({},l)},limitCanvas:function(e,t){var n=this.options,r=this.containerData,i=this.canvasData,a=this.cropBoxData,o=n.viewMode,s=i.aspectRatio,c=this.cropped&&a;if(e){var l=Number(n.minCanvasWidth)||0,u=Number(n.minCanvasHeight)||0;o>1?(l=Math.max(l,r.width),u=Math.max(u,r.height),o===3&&(u*s>l?l=u*s:u=l/s)):o>0&&(l?l=Math.max(l,c?a.width:0):u?u=Math.max(u,c?a.height:0):c&&(l=a.width,u=a.height,u*s>l?l=u*s:u=l/s));var d=pt({aspectRatio:s,width:l,height:u});l=d.width,u=d.height,i.minWidth=l,i.minHeight=u,i.maxWidth=1/0,i.maxHeight=1/0}if(t)if(o>+!c){var f=r.width-i.width,p=r.height-i.height;i.minLeft=Math.min(0,f),i.minTop=Math.min(0,p),i.maxLeft=Math.max(0,f),i.maxTop=Math.max(0,p),c&&this.limited&&(i.minLeft=Math.min(a.left,a.left+(a.width-i.width)),i.minTop=Math.min(a.top,a.top+(a.height-i.height)),i.maxLeft=a.left,i.maxTop=a.top,o===2&&(i.width>=r.width&&(i.minLeft=Math.min(0,f),i.maxLeft=Math.max(0,f)),i.height>=r.height&&(i.minTop=Math.min(0,p),i.maxTop=Math.max(0,p))))}else i.minLeft=-i.width,i.minTop=-i.height,i.maxLeft=r.width,i.maxTop=r.height},renderCanvas:function(e,t){var n=this.canvasData,r=this.imageData;if(t){var i=mt({width:r.naturalWidth*Math.abs(r.scaleX||1),height:r.naturalHeight*Math.abs(r.scaleY||1),degree:r.rotate||0}),a=i.width,o=i.height,s=n.width*(a/n.naturalWidth),c=n.height*(o/n.naturalHeight);n.left-=(s-n.width)/2,n.top-=(c-n.height)/2,n.width=s,n.height=c,n.aspectRatio=a/o,n.naturalWidth=a,n.naturalHeight=o,this.limitCanvas(!0,!1)}(n.width>n.maxWidth||n.width<n.minWidth)&&(n.left=n.oldLeft),(n.height>n.maxHeight||n.height<n.minHeight)&&(n.top=n.oldTop),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),this.limitCanvas(!1,!0),n.left=Math.min(Math.max(n.left,n.minLeft),n.maxLeft),n.top=Math.min(Math.max(n.top,n.minTop),n.maxTop),n.oldLeft=n.left,n.oldTop=n.top,Ue(this.canvas,ze({width:n.width,height:n.height},lt({translateX:n.left,translateY:n.top}))),this.renderImage(e),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(e){var t=this.canvasData,n=this.imageData,r=n.naturalWidth*(t.width/t.naturalWidth),i=n.naturalHeight*(t.height/t.naturalHeight);ze(n,{width:r,height:i,left:(t.width-r)/2,top:(t.height-i)/2}),Ue(this.image,ze({width:n.width,height:n.height},lt(ze({translateX:n.left,translateY:n.top},n)))),e&&this.output()},initCropBox:function(){var e=this.options,t=this.canvasData,n=e.aspectRatio||e.initialAspectRatio,r=Number(e.autoCropArea)||.8,i={width:t.width,height:t.height};n&&(t.height*n>t.width?i.height=i.width/n:i.width=i.height*n),this.cropBoxData=i,this.limitCropBox(!0,!0),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),i.width=Math.max(i.minWidth,i.width*r),i.height=Math.max(i.minHeight,i.height*r),i.left=t.left+(t.width-i.width)/2,i.top=t.top+(t.height-i.height)/2,i.oldLeft=i.left,i.oldTop=i.top,this.initialCropBoxData=ze({},i)},limitCropBox:function(e,t){var n=this.options,r=this.containerData,i=this.canvasData,a=this.cropBoxData,o=this.limited,s=n.aspectRatio;if(e){var c=Number(n.minCropBoxWidth)||0,l=Number(n.minCropBoxHeight)||0,u=o?Math.min(r.width,i.width,i.width+i.left,r.width-i.left):r.width,d=o?Math.min(r.height,i.height,i.height+i.top,r.height-i.top):r.height;c=Math.min(c,r.width),l=Math.min(l,r.height),s&&(c&&l?l*s>c?l=c/s:c=l*s:c?l=c/s:l&&(c=l*s),d*s>u?d=u/s:u=d*s),a.minWidth=Math.min(c,u),a.minHeight=Math.min(l,d),a.maxWidth=u,a.maxHeight=d}t&&(o?(a.minLeft=Math.max(0,i.left),a.minTop=Math.max(0,i.top),a.maxLeft=Math.min(r.width,i.left+i.width)-a.width,a.maxTop=Math.min(r.height,i.top+i.height)-a.height):(a.minLeft=0,a.minTop=0,a.maxLeft=r.width-a.width,a.maxTop=r.height-a.height))},renderCropBox:function(){var e=this.options,t=this.containerData,n=this.cropBoxData;(n.width>n.maxWidth||n.width<n.minWidth)&&(n.left=n.oldLeft),(n.height>n.maxHeight||n.height<n.minHeight)&&(n.top=n.oldTop),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),this.limitCropBox(!1,!0),n.left=Math.min(Math.max(n.left,n.minLeft),n.maxLeft),n.top=Math.min(Math.max(n.top,n.minTop),n.maxTop),n.oldLeft=n.left,n.oldTop=n.top,e.movable&&e.cropBoxMovable&&Ze(this.face,R,n.width>=t.width&&n.height>=t.height?S:b),Ue(this.cropBox,ze({width:n.width,height:n.height},lt({translateX:n.left,translateY:n.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),rt(this.element,ie,this.getData())}},Ct={initPreview:function(){var e=this.element,t=this.crossOrigin,n=this.options.preview,r=t?this.crossOriginUrl:this.url,i=e.alt||`The image to preview`,a=document.createElement(`img`);if(t&&(a.crossOrigin=t),a.src=r,a.alt=i,this.viewBox.appendChild(a),this.viewBoxImage=a,n){var o=n;typeof n==`string`?o=e.ownerDocument.querySelectorAll(n):n.querySelector&&(o=[n]),this.previews=o,Re(o,function(e){var n=document.createElement(`img`);Ze(e,te,{width:e.offsetWidth,height:e.offsetHeight,html:e.innerHTML}),t&&(n.crossOrigin=t),n.src=r,n.alt=i,n.style.cssText=`display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"`,e.innerHTML=``,e.appendChild(n)})}},resetPreview:function(){Re(this.previews,function(e){var t=Xe(e,te);Ue(e,{width:t.width,height:t.height}),e.innerHTML=t.html,Qe(e,te)})},preview:function(){var e=this.imageData,t=this.canvasData,n=this.cropBoxData,r=n.width,i=n.height,a=e.width,o=e.height,s=n.left-t.left-e.left,c=n.top-t.top-e.top;!this.cropped||this.disabled||(Ue(this.viewBoxImage,ze({width:a,height:o},lt(ze({translateX:-s,translateY:-c},e)))),Re(this.previews,function(t){var n=Xe(t,te),l=n.width,u=n.height,d=l,f=u,p=1;r&&(p=l/r,f=i*p),i&&f>u&&(p=u/i,d=r*p,f=u),Ue(t,{width:d,height:f}),Ue(t.getElementsByTagName(`img`)[0],ze({width:a*p,height:o*p},lt(ze({translateX:-s*p,translateY:-c*p},e))))}))}},wt={bind:function(){var e=this.element,t=this.options,n=this.cropper;Fe(t.cropstart)&&nt(e,se,t.cropstart),Fe(t.cropmove)&&nt(e,oe,t.cropmove),Fe(t.cropend)&&nt(e,ae,t.cropend),Fe(t.crop)&&nt(e,ie,t.crop),Fe(t.zoom)&&nt(e,ve,t.zoom),nt(n,fe,this.onCropStart=this.cropStart.bind(this)),t.zoomable&&t.zoomOnWheel&&nt(n,_e,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&nt(n,ce,this.onDblclick=this.dblclick.bind(this)),nt(e.ownerDocument,pe,this.onCropMove=this.cropMove.bind(this)),nt(e.ownerDocument,me,this.onCropEnd=this.cropEnd.bind(this)),t.responsive&&nt(window,ge,this.onResize=this.resize.bind(this))},unbind:function(){var e=this.element,t=this.options,n=this.cropper;Fe(t.cropstart)&&tt(e,se,t.cropstart),Fe(t.cropmove)&&tt(e,oe,t.cropmove),Fe(t.cropend)&&tt(e,ae,t.cropend),Fe(t.crop)&&tt(e,ie,t.crop),Fe(t.zoom)&&tt(e,ve,t.zoom),tt(n,fe,this.onCropStart),t.zoomable&&t.zoomOnWheel&&tt(n,_e,this.onWheel,{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&tt(n,ce,this.onDblclick),tt(e.ownerDocument,pe,this.onCropMove),tt(e.ownerDocument,me,this.onCropEnd),t.responsive&&tt(window,ge,this.onResize)}},Tt={resize:function(){if(!this.disabled){var e=this.options,t=this.container,n=this.containerData,r=t.offsetWidth/n.width,i=t.offsetHeight/n.height,a=Math.abs(r-1)>Math.abs(i-1)?r:i;if(a!==1){var o,s;e.restore&&(o=this.getCanvasData(),s=this.getCropBoxData()),this.render(),e.restore&&(this.setCanvasData(Re(o,function(e,t){o[t]=e*a})),this.setCropBoxData(Re(s,function(e,t){s[t]=e*a})))}}},dblclick:function(){this.disabled||this.options.dragMode===z||this.setDragMode(We(this.dragBox,M)?re:ne)},wheel:function(e){var t=this,n=Number(this.options.wheelZoomRatio)||.1,r=1;this.disabled||(e.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){t.wheeling=!1},50),e.deltaY?r=e.deltaY>0?1:-1:e.wheelDelta?r=-e.wheelDelta/120:e.detail&&(r=e.detail>0?1:-1),this.zoom(-r*n,e)))},cropStart:function(e){var t=e.buttons,n=e.button;if(!(this.disabled||(e.type===`mousedown`||e.type===`pointerdown`&&e.pointerType===`mouse`)&&(ke(t)&&t!==1||ke(n)&&n!==0||e.ctrlKey))){var r=this.options,i=this.pointers,a;e.changedTouches?Re(e.changedTouches,function(e){i[e.identifier]=dt(e)}):i[e.pointerId||0]=dt(e),a=Object.keys(i).length>1&&r.zoomable&&r.zoomOnTouch?C:Xe(e.target,R),be.test(a)&&rt(this.element,se,{originalEvent:e,action:a})!==!1&&(e.preventDefault(),this.action=a,this.cropping=!1,a===x&&(this.cropping=!0,Ge(this.dragBox,L)))}},cropMove:function(e){var t=this.action;if(!(this.disabled||!t)){var n=this.pointers;e.preventDefault(),rt(this.element,oe,{originalEvent:e,action:t})!==!1&&(e.changedTouches?Re(e.changedTouches,function(e){ze(n[e.identifier]||{},dt(e,!0))}):ze(n[e.pointerId||0]||{},dt(e,!0)),this.change(e))}},cropEnd:function(e){if(!this.disabled){var t=this.action,n=this.pointers;e.changedTouches?Re(e.changedTouches,function(e){delete n[e.identifier]}):delete n[e.pointerId||0],t&&(e.preventDefault(),Object.keys(n).length||(this.action=``),this.cropping&&(this.cropping=!1,qe(this.dragBox,L,this.cropped&&this.options.modal)),rt(this.element,ae,{originalEvent:e,action:t}))}}},Et={change:function(e){var t=this.options,n=this.canvasData,r=this.containerData,i=this.cropBoxData,a=this.pointers,o=this.action,s=t.aspectRatio,c=i.left,l=i.top,u=i.width,d=i.height,f=c+u,p=l+d,m=0,h=0,g=r.width,_=r.height,v=!0,y;!s&&e.shiftKey&&(s=u&&d?u/d:1),this.limited&&(m=i.minLeft,h=i.minTop,g=m+Math.min(r.width,n.width,n.left+n.width),_=h+Math.min(r.height,n.height,n.top+n.height));var M=a[Object.keys(a)[0]],N={x:M.endX-M.startX,y:M.endY-M.startY},F=function(e){switch(e){case w:f+N.x>g&&(N.x=g-f);break;case T:c+N.x<m&&(N.x=m-c);break;case D:l+N.y<h&&(N.y=h-l);break;case E:p+N.y>_&&(N.y=_-p);break}};switch(o){case b:c+=N.x,l+=N.y;break;case w:if(N.x>=0&&(f>=g||s&&(l<=h||p>=_))){v=!1;break}F(w),u+=N.x,u<0&&(o=T,u=-u,c-=u),s&&(d=u/s,l+=(i.height-d)/2);break;case D:if(N.y<=0&&(l<=h||s&&(c<=m||f>=g))){v=!1;break}F(D),d-=N.y,l+=N.y,d<0&&(o=E,d=-d,l-=d),s&&(u=d*s,c+=(i.width-u)/2);break;case T:if(N.x<=0&&(c<=m||s&&(l<=h||p>=_))){v=!1;break}F(T),u-=N.x,c+=N.x,u<0&&(o=w,u=-u,c-=u),s&&(d=u/s,l+=(i.height-d)/2);break;case E:if(N.y>=0&&(p>=_||s&&(c<=m||f>=g))){v=!1;break}F(E),d+=N.y,d<0&&(o=D,d=-d,l-=d),s&&(u=d*s,c+=(i.width-u)/2);break;case O:if(s){if(N.y<=0&&(l<=h||f>=g)){v=!1;break}F(D),d-=N.y,l+=N.y,u=d*s}else F(D),F(w),N.x>=0?f<g?u+=N.x:N.y<=0&&l<=h&&(v=!1):u+=N.x,N.y<=0?l>h&&(d-=N.y,l+=N.y):(d-=N.y,l+=N.y);u<0&&d<0?(o=j,d=-d,u=-u,l-=d,c-=u):u<0?(o=k,u=-u,c-=u):d<0&&(o=A,d=-d,l-=d);break;case k:if(s){if(N.y<=0&&(l<=h||c<=m)){v=!1;break}F(D),d-=N.y,l+=N.y,u=d*s,c+=i.width-u}else F(D),F(T),N.x<=0?c>m?(u-=N.x,c+=N.x):N.y<=0&&l<=h&&(v=!1):(u-=N.x,c+=N.x),N.y<=0?l>h&&(d-=N.y,l+=N.y):(d-=N.y,l+=N.y);u<0&&d<0?(o=A,d=-d,u=-u,l-=d,c-=u):u<0?(o=O,u=-u,c-=u):d<0&&(o=j,d=-d,l-=d);break;case j:if(s){if(N.x<=0&&(c<=m||p>=_)){v=!1;break}F(T),u-=N.x,c+=N.x,d=u/s}else F(E),F(T),N.x<=0?c>m?(u-=N.x,c+=N.x):N.y>=0&&p>=_&&(v=!1):(u-=N.x,c+=N.x),N.y>=0?p<_&&(d+=N.y):d+=N.y;u<0&&d<0?(o=O,d=-d,u=-u,l-=d,c-=u):u<0?(o=A,u=-u,c-=u):d<0&&(o=k,d=-d,l-=d);break;case A:if(s){if(N.x>=0&&(f>=g||p>=_)){v=!1;break}F(w),u+=N.x,d=u/s}else F(E),F(w),N.x>=0?f<g?u+=N.x:N.y>=0&&p>=_&&(v=!1):u+=N.x,N.y>=0?p<_&&(d+=N.y):d+=N.y;u<0&&d<0?(o=k,d=-d,u=-u,l-=d,c-=u):u<0?(o=j,u=-u,c-=u):d<0&&(o=O,d=-d,l-=d);break;case S:this.move(N.x,N.y),v=!1;break;case C:this.zoom(ut(a),e),v=!1;break;case x:if(!N.x||!N.y){v=!1;break}y=it(this.cropper),c=M.startX-y.left,l=M.startY-y.top,u=i.minWidth,d=i.minHeight,N.x>0?o=N.y>0?A:O:N.x<0&&(c-=u,o=N.y>0?j:k),N.y<0&&(l-=d),this.cropped||(Ke(this.cropBox,P),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}v&&(i.width=u,i.height=d,i.left=c,i.top=l,this.action=o,this.renderCropBox()),Re(a,function(e){e.startX=e.endX,e.startY=e.endY})}},Dt={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&Ge(this.dragBox,L),Ke(this.cropBox,P),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=ze({},this.initialImageData),this.canvasData=ze({},this.initialCanvasData),this.cropBoxData=ze({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(ze(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),Ke(this.dragBox,L),Ge(this.cropBox,P)),this},replace:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&e&&(this.isImg&&(this.element.src=e),t?(this.url=e,this.image.src=e,this.ready&&(this.viewBoxImage.src=e,Re(this.previews,function(t){t.getElementsByTagName(`img`)[0].src=e}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(e))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,Ke(this.cropper,N)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,Ge(this.cropper,N)),this},destroy:function(){var e=this.element;return e[y]?(e[y]=void 0,this.isImg&&this.replaced&&(e.src=this.originalUrl),this.uncreate(),this):this},move:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=this.canvasData,r=n.left,i=n.top;return this.moveTo(je(e)?e:r+Number(e),je(t)?t:i+Number(t))},moveTo:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=this.canvasData,r=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.movable&&(ke(e)&&(n.left=e,r=!0),ke(t)&&(n.top=t,r=!0),r&&this.renderCanvas(!0)),this},zoom:function(e,t){var n=this.canvasData;return e=Number(e),e=e<0?1/(1-e):1+e,this.zoomTo(n.width*e/n.naturalWidth,null,t)},zoomTo:function(e,t,n){var r=this.options,i=this.canvasData,a=i.width,o=i.height,s=i.naturalWidth,c=i.naturalHeight;if(e=Number(e),e>=0&&this.ready&&!this.disabled&&r.zoomable){var l=s*e,u=c*e;if(rt(this.element,ve,{ratio:e,oldRatio:a/s,originalEvent:n})===!1)return this;if(n){var d=this.pointers,f=it(this.cropper),p=d&&Object.keys(d).length?ft(d):{pageX:n.pageX,pageY:n.pageY};i.left-=(l-a)*((p.pageX-f.left-i.left)/a),i.top-=(u-o)*((p.pageY-f.top-i.top)/o)}else Pe(t)&&ke(t.x)&&ke(t.y)?(i.left-=(l-a)*((t.x-i.left)/a),i.top-=(u-o)*((t.y-i.top)/o)):(i.left-=(l-a)/2,i.top-=(u-o)/2);i.width=l,i.height=u,this.renderCanvas(!0)}return this},rotate:function(e){return this.rotateTo((this.imageData.rotate||0)+Number(e))},rotateTo:function(e){return e=Number(e),ke(e)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=e%360,this.renderCanvas(!0,!0)),this},scaleX:function(e){var t=this.imageData.scaleY;return this.scale(e,ke(t)?t:1)},scaleY:function(e){var t=this.imageData.scaleX;return this.scale(ke(t)?t:1,e)},scale:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=this.imageData,r=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.scalable&&(ke(e)&&(n.scaleX=e,r=!0),ke(t)&&(n.scaleY=t,r=!0),r&&this.renderCanvas(!0,!0)),this},getData:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.options,n=this.imageData,r=this.canvasData,i=this.cropBoxData,a;if(this.ready&&this.cropped){a={x:i.left-r.left,y:i.top-r.top,width:i.width,height:i.height};var o=n.width/n.naturalWidth;if(Re(a,function(e,t){a[t]=e/o}),e){var s=Math.round(a.y+a.height),c=Math.round(a.x+a.width);a.x=Math.round(a.x),a.y=Math.round(a.y),a.width=c-a.x,a.height=s-a.y}}else a={x:0,y:0,width:0,height:0};return t.rotatable&&(a.rotate=n.rotate||0),t.scalable&&(a.scaleX=n.scaleX||1,a.scaleY=n.scaleY||1),a},setData:function(e){var t=this.options,n=this.imageData,r=this.canvasData,i={};if(this.ready&&!this.disabled&&Pe(e)){var a=!1;t.rotatable&&ke(e.rotate)&&e.rotate!==n.rotate&&(n.rotate=e.rotate,a=!0),t.scalable&&(ke(e.scaleX)&&e.scaleX!==n.scaleX&&(n.scaleX=e.scaleX,a=!0),ke(e.scaleY)&&e.scaleY!==n.scaleY&&(n.scaleY=e.scaleY,a=!0)),a&&this.renderCanvas(!0,!0);var o=n.width/n.naturalWidth;ke(e.x)&&(i.left=e.x*o+r.left),ke(e.y)&&(i.top=e.y*o+r.top),ke(e.width)&&(i.width=e.width*o),ke(e.height)&&(i.height=e.height*o),this.setCropBoxData(i)}return this},getContainerData:function(){return this.ready?ze({},this.containerData):{}},getImageData:function(){return this.sized?ze({},this.imageData):{}},getCanvasData:function(){var e=this.canvasData,t={};return this.ready&&Re([`left`,`top`,`width`,`height`,`naturalWidth`,`naturalHeight`],function(n){t[n]=e[n]}),t},setCanvasData:function(e){var t=this.canvasData,n=t.aspectRatio;return this.ready&&!this.disabled&&Pe(e)&&(ke(e.left)&&(t.left=e.left),ke(e.top)&&(t.top=e.top),ke(e.width)?(t.width=e.width,t.height=e.width/n):ke(e.height)&&(t.height=e.height,t.width=e.height*n),this.renderCanvas(!0)),this},getCropBoxData:function(){var e=this.cropBoxData,t;return this.ready&&this.cropped&&(t={left:e.left,top:e.top,width:e.width,height:e.height}),t||{}},setCropBoxData:function(e){var t=this.cropBoxData,n=this.options.aspectRatio,r,i;return this.ready&&this.cropped&&!this.disabled&&Pe(e)&&(ke(e.left)&&(t.left=e.left),ke(e.top)&&(t.top=e.top),ke(e.width)&&e.width!==t.width&&(r=!0,t.width=e.width),ke(e.height)&&e.height!==t.height&&(i=!0,t.height=e.height),n&&(r?t.height=t.width/n:i&&(t.width=t.height*n)),this.renderCropBox()),this},getCroppedCanvas:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var t=this.canvasData,n=ht(this.image,this.imageData,t,e);if(!this.cropped)return n;var r=this.getData(e.rounded),i=r.x,a=r.y,o=r.width,s=r.height,c=n.width/Math.floor(t.naturalWidth);c!==1&&(i*=c,a*=c,o*=c,s*=c);var u=o/s,d=pt({aspectRatio:u,width:e.maxWidth||1/0,height:e.maxHeight||1/0}),f=pt({aspectRatio:u,width:e.minWidth||0,height:e.minHeight||0},`cover`),p=pt({aspectRatio:u,width:e.width||(c===1?o:n.width),height:e.height||(c===1?s:n.height)}),m=p.width,h=p.height;m=Math.min(d.width,Math.max(f.width,m)),h=Math.min(d.height,Math.max(f.height,h));var g=document.createElement(`canvas`),_=g.getContext(`2d`);g.width=Ve(m),g.height=Ve(h),_.fillStyle=e.fillColor||`transparent`,_.fillRect(0,0,m,h);var v=e.imageSmoothingEnabled,y=v===void 0?!0:v,b=e.imageSmoothingQuality;_.imageSmoothingEnabled=y,b&&(_.imageSmoothingQuality=b);var x=n.width,S=n.height,C=i,w=a,T,E,D,O,k,A;C<=-o||C>x?(C=0,T=0,D=0,k=0):C<=0?(D=-C,C=0,T=Math.min(x,o+C),k=T):C<=x&&(D=0,T=Math.min(o,x-C),k=T),T<=0||w<=-s||w>S?(w=0,E=0,O=0,A=0):w<=0?(O=-w,w=0,E=Math.min(S,s+w),A=E):w<=S&&(O=0,E=Math.min(s,S-w),A=E);var j=[C,w,T,E];if(k>0&&A>0){var M=m/o;j.push(D*M,O*M,k*M,A*M)}return _.drawImage.apply(_,[n].concat(l(j.map(function(e){return Math.floor(Ve(e))})))),g},setAspectRatio:function(e){var t=this.options;return!this.disabled&&!je(e)&&(t.aspectRatio=Math.max(0,e)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(e){var t=this.options,n=this.dragBox,r=this.face;if(this.ready&&!this.disabled){var i=e===ne,a=t.movable&&e===re;e=i||a?e:z,t.dragMode=e,Ze(n,R,e),qe(n,M,i),qe(n,ee,a),t.cropBoxMovable||(Ze(r,R,e),qe(r,M,i),qe(r,ee,a))}return this}},Ot=g.Cropper,kt=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(a(this,e),!t||!Ce.test(t.tagName))throw Error(`The first argument is required and must be an <img> or <canvas> element.`);this.element=t,this.options=ze({},Ee,Pe(n)&&n),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return s(e,[{key:`init`,value:function(){var e=this.element,t=e.tagName.toLowerCase(),n;if(!e[y]){if(e[y]=this,t===`img`){if(this.isImg=!0,n=e.getAttribute(`src`)||``,this.originalUrl=n,!n)return;n=e.src}else t===`canvas`&&window.HTMLCanvasElement&&(n=e.toDataURL());this.load(n)}}},{key:`load`,value:function(e){var t=this;if(e){this.url=e,this.imageData={};var n=this.element,r=this.options;if(!r.rotatable&&!r.scalable&&(r.checkOrientation=!1),!r.checkOrientation||!window.ArrayBuffer){this.clone();return}if(xe.test(e)){Se.test(e)?this.read(vt(e)):this.clone();return}var i=new XMLHttpRequest,a=this.clone.bind(this);this.reloading=!0,this.xhr=i,i.onabort=a,i.onerror=a,i.ontimeout=a,i.onprogress=function(){i.getResponseHeader(`content-type`)!==ye&&i.abort()},i.onload=function(){t.read(i.response)},i.onloadend=function(){t.reloading=!1,t.xhr=null},r.checkCrossOrigin&&st(e)&&n.crossOrigin&&(e=ct(e)),i.open(`GET`,e,!0),i.responseType=`arraybuffer`,i.withCredentials=n.crossOrigin===`use-credentials`,i.send()}}},{key:`read`,value:function(e){var t=this.options,n=this.imageData,r=bt(e),i=0,a=1,o=1;if(r>1){this.url=yt(e,ye);var s=xt(r);i=s.rotate,a=s.scaleX,o=s.scaleY}t.rotatable&&(n.rotate=i),t.scalable&&(n.scaleX=a,n.scaleY=o),this.clone()}},{key:`clone`,value:function(){var e=this.element,t=this.url,n=e.crossOrigin,r=t;this.options.checkCrossOrigin&&st(t)&&(n||=`anonymous`,r=ct(t)),this.crossOrigin=n,this.crossOriginUrl=r;var i=document.createElement(`img`);n&&(i.crossOrigin=n),i.src=r||t,i.alt=e.alt||`The image to crop`,this.image=i,i.onload=this.start.bind(this),i.onerror=this.stop.bind(this),Ge(i,F),e.parentNode.insertBefore(i,e.nextSibling)}},{key:`start`,value:function(){var e=this,t=this.image;t.onload=null,t.onerror=null,this.sizing=!0;var n=g.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(g.navigator.userAgent),r=function(t,n){ze(e.imageData,{naturalWidth:t,naturalHeight:n,aspectRatio:t/n}),e.initialImageData=ze({},e.imageData),e.sizing=!1,e.sized=!0,e.build()};if(t.naturalWidth&&!n){r(t.naturalWidth,t.naturalHeight);return}var i=document.createElement(`img`),a=document.body||document.documentElement;this.sizingImage=i,i.onload=function(){r(i.width,i.height),n||a.removeChild(i)},i.src=t.src,n||(i.style.cssText=`left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;`,a.appendChild(i))}},{key:`stop`,value:function(){var e=this.image;e.onload=null,e.onerror=null,e.parentNode.removeChild(e),this.image=null}},{key:`build`,value:function(){if(!(!this.sized||this.ready)){var e=this.element,t=this.options,n=this.image,r=e.parentNode,i=document.createElement(`div`);i.innerHTML=De;var a=i.querySelector(`.${y}-container`),o=a.querySelector(`.${y}-canvas`),s=a.querySelector(`.${y}-drag-box`),c=a.querySelector(`.${y}-crop-box`),l=c.querySelector(`.${y}-face`);this.container=r,this.cropper=a,this.canvas=o,this.dragBox=s,this.cropBox=c,this.viewBox=a.querySelector(`.${y}-view-box`),this.face=l,o.appendChild(n),Ge(e,P),r.insertBefore(a,e.nextSibling),Ke(n,F),this.initPreview(),this.bind(),t.initialAspectRatio=Math.max(0,t.initialAspectRatio)||NaN,t.aspectRatio=Math.max(0,t.aspectRatio)||NaN,t.viewMode=Math.max(0,Math.min(3,Math.round(t.viewMode)))||0,Ge(c,P),t.guides||Ge(c.getElementsByClassName(`${y}-dashed`),P),t.center||Ge(c.getElementsByClassName(`${y}-center`),P),t.background&&Ge(a,`${y}-bg`),t.highlight||Ge(l,I),t.cropBoxMovable&&(Ge(l,ee),Ze(l,R,b)),t.cropBoxResizable||(Ge(c.getElementsByClassName(`${y}-line`),P),Ge(c.getElementsByClassName(`${y}-point`),P)),this.render(),this.ready=!0,this.setDragMode(t.dragMode),t.autoCrop&&this.crop(),this.setData(t.data),Fe(t.ready)&&nt(e,he,t.ready,{once:!0}),rt(e,he)}}},{key:`unbuild`,value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var e=this.cropper.parentNode;e&&e.removeChild(this.cropper),Ke(this.element,P)}}},{key:`uncreate`,value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:`noConflict`,value:function(){return window.Cropper=Ot,e}},{key:`setDefaults`,value:function(e){ze(Ee,Pe(e)&&e)}}])}();return ze(kt.prototype,St,Ct,wt,Tt,Et,Dt),kt}))}))()),aq=function(){return aq=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},aq.apply(this,arguments)};function oq(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}var sq=`aspectRatio.autoCrop.autoCropArea.background.center.checkCrossOrigin.checkOrientation.cropBoxMovable.cropBoxResizable.data.dragMode.guides.highlight.initialAspectRatio.minCanvasHeight.minCanvasWidth.minContainerHeight.minContainerWidth.minCropBoxHeight.minCropBoxWidth.modal.movable.preview.responsive.restore.rotatable.scalable.toggleDragModeOnDblclick.viewMode.wheelZoomRatio.zoomOnTouch.zoomOnWheel.zoomable.cropstart.cropmove.cropend.crop.zoom.ready`.split(`.`),cq={opacity:0,maxWidth:`100%`};B.forwardRef((function(e,t){var n=oq(e,[]),r=n.dragMode,i=r===void 0?`crop`:r,a=n.src,o=n.style,s=n.className,c=n.crossOrigin,l=n.scaleX,u=n.scaleY,d=n.enable,f=n.zoomTo,p=n.rotateTo,m=n.alt,h=m===void 0?`picture`:m,g=n.ready,_=n.onInitialized,v=oq(n,[`dragMode`,`src`,`style`,`className`,`crossOrigin`,`scaleX`,`scaleY`,`enable`,`zoomTo`,`rotateTo`,`alt`,`ready`,`onInitialized`]),y={scaleY:u,scaleX:l,enable:d,zoomTo:f,rotateTo:p},b=function(){var e=[...arguments],t=(0,B.useRef)(null);return B.useEffect((function(){e.forEach((function(e){e&&(typeof e==`function`?e(t.current):e.current=t.current)}))}),[e]),t}(t,(0,B.useRef)(null));(0,B.useEffect)((function(){var e;(e=b.current)!=null&&e.cropper&&typeof f==`number`&&b.current.cropper.zoomTo(f)}),[n.zoomTo]),(0,B.useEffect)((function(){var e;(e=b.current)!=null&&e.cropper&&a!==void 0&&b.current.cropper.reset().clear().replace(a)}),[a]),(0,B.useEffect)((function(){if(b.current!==null){var e=new iq.default(b.current,aq(aq({dragMode:i},v),{ready:function(e){e.currentTarget!==null&&function(e,t){t===void 0&&(t={});var n=t.enable,r=n===void 0||n,i=t.scaleX,a=i===void 0?1:i,o=t.scaleY,s=o===void 0?1:o,c=t.zoomTo,l=c===void 0?0:c,u=t.rotateTo;r?e.enable():e.disable(),e.scaleX(a),e.scaleY(s),u!==void 0&&e.rotateTo(u),l>0&&e.zoomTo(l)}(e.currentTarget.cropper,y),g&&g(e)}}));_&&_(e)}return function(){var e;(e=b.current?.cropper)==null||e.destroy()}}),[b]);var x=function(e){return sq.reduce((function(e,t){var n=e,r=t;return n[r],oq(n,[typeof r==`symbol`?r:r+``])}),e)}(aq(aq({},v),{crossOrigin:c,src:a,alt:h}));return B.createElement(`div`,{style:o,className:s},B.createElement(`img`,aq({},x,{style:cq,ref:b})))})),{seconds:`seconds`,minutes:`minutes`}.minutes,B.Component,B.Component,B.Component,B.Component,B.Component;var lq=e=>{let t=vA.t(e.labelKey),n=e.helpKey?vA.t(e.helpKey):``;return e.type===`checkbox`?(0,V.jsxs)(aw,{sx:{display:`block`,mb:1},children:[(0,V.jsx)(dw,{control:(0,V.jsx)(zS,{checked:!!e.value,onChange:t=>e.onChange(t.target.checked)}),label:t}),n&&(0,V.jsx)(_w,{sx:{ml:4,mt:-.5},children:n})]}):e.type===`select`?(0,V.jsxs)(aw,{size:`small`,fullWidth:!0,sx:{mb:2},children:[(0,V.jsx)($w,{children:t}),(0,V.jsx)(nD,{value:e.value??``,label:t,onChange:t=>e.onChange(t.target.value),children:e.options.map(e=>(0,V.jsx)(bE,{value:e.value,children:vA.t(e.labelKey)},e.value))}),n&&(0,V.jsx)(_w,{children:n})]}):e.type===`number`?(0,V.jsx)(ZO,{label:t,type:`number`,value:e.value??``,size:`small`,fullWidth:!0,sx:{mb:2},inputProps:{min:e.min,max:e.max},onChange:t=>{let n=parseFloat(t.target.value);isNaN(n)||e.onChange(n)},helperText:n||` `}):(0,V.jsx)(ZO,{label:t,type:e.type===`password`?`password`:`text`,value:e.value??``,size:`small`,fullWidth:!0,sx:{mb:2},onChange:t=>e.onChange(t.target.value),helperText:n||` `})},uq=({textKey:e})=>(0,V.jsx)(Kv,{variant:`h6`,sx:{mt:2,mb:1,borderBottom:`1px solid`,borderColor:`divider`,pb:.5},children:vA.t(e)}),dq=({labelKey:e,helpKey:t,value:n,onChange:r})=>(0,V.jsxs)($x,{sx:{mb:2},children:[(0,V.jsx)(Kv,{variant:`caption`,display:`block`,sx:{mb:.5},children:vA.t(e)}),(0,V.jsxs)($x,{sx:{display:`flex`,alignItems:`center`,gap:1},children:[(0,V.jsx)(`input`,{type:`color`,value:n||`#888888`,onChange:e=>r(e.target.value),style:{width:48,height:32,cursor:`pointer`,border:`none`}}),(0,V.jsx)(ZO,{value:n??``,size:`small`,sx:{flex:1},onChange:e=>r(e.target.value),placeholder:`rgba(...) or #hex`})]}),t&&(0,V.jsx)(_w,{children:vA.t(t)})]}),fq=({native:e,onChange:t})=>(0,V.jsxs)(X,{container:!0,spacing:2,children:[(0,V.jsx)(X,{item:!0,xs:12,sm:12,md:6,lg:4,children:(0,V.jsx)(lq,{type:`text`,labelKey:`cfgIp`,value:e.ip??``,onChange:e=>t(`ip`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(lq,{type:`number`,labelKey:`cfgPort`,value:e.port??8090,min:1,max:65535,onChange:e=>t(`port`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(lq,{type:`text`,labelKey:`cfgUser`,value:e.user??``,onChange:e=>t(`user`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(lq,{type:`password`,labelKey:`cfgPass`,value:e.pass??``,onChange:e=>t(`pass`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(lq,{type:`number`,labelKey:`cfgPollSeconds`,helpKey:`cfgPollSeconds`,value:e.pollSeconds??30,min:5,max:3600,onChange:e=>t(`pollSeconds`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(lq,{type:`number`,labelKey:`cfgHttpTimeoutMs`,value:e.httpTimeoutMs??8e3,min:1e3,max:3e4,onChange:e=>t(`httpTimeoutMs`,e)})})]}),pq=({native:e,onChange:t})=>(0,V.jsxs)(`div`,{children:[(0,V.jsx)(uq,{textKey:`hdrControls`}),(0,V.jsxs)(X,{container:!0,spacing:1,children:[(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`checkbox`,labelKey:`cfgEnableSystemControls`,helpKey:`cfgEnableSystemControls_tt`,value:e.enableSystemControls,onChange:e=>t(`enableSystemControls`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`checkbox`,labelKey:`cfgEnablePtz`,helpKey:`cfgEnablePtz_tt`,value:e.enablePtz,onChange:e=>t(`enablePtz`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`checkbox`,labelKey:`cfgEnableUrls`,helpKey:`cfgEnableUrls_tt`,value:e.enableUrls,onChange:e=>t(`enableUrls`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`checkbox`,labelKey:`cfgEnableSnapshotB64`,helpKey:`cfgEnableSnapshotB64_tt`,value:e.enableSnapshotB64,onChange:e=>t(`enableSnapshotB64`,e)})})]}),(0,V.jsx)(uq,{textKey:`hdrEvents`}),(0,V.jsxs)(X,{container:!0,spacing:1,children:[(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`checkbox`,labelKey:`cfgEnableEventDps`,helpKey:`cfgEnableEventDps_tt`,value:e.enableEventDps,onChange:e=>t(`enableEventDps`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`checkbox`,labelKey:`cfgEnablePush`,helpKey:`cfgEnablePush_tt`,value:e.enablePush,onChange:e=>t(`enablePush`,e)})})]}),(0,V.jsx)(uq,{textKey:`hdrDisplay`}),(0,V.jsx)(X,{container:!0,spacing:1,children:(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`checkbox`,labelKey:`cfgEnableOverview`,helpKey:`cfgEnableOverview_tt`,value:e.enableOverview,onChange:e=>t(`enableOverview`,e)})})}),(0,V.jsx)(uq,{textKey:`hdrDebug`}),(0,V.jsx)(X,{container:!0,spacing:1,children:(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`checkbox`,labelKey:`cfgStoreRawJson`,helpKey:`cfgStoreRawJson_tt`,value:e.storeRawJson,onChange:e=>t(`storeRawJson`,e)})})})]}),mq=({native:e,onChange:t})=>(0,V.jsxs)(`div`,{children:[(0,V.jsx)(uq,{textKey:`hdrWidgetGeneral`}),(0,V.jsxs)(X,{container:!0,spacing:2,children:[(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`checkbox`,labelKey:`cfgEnableWidget`,helpKey:`cfgEnableWidget_tt`,value:e.enableWidget,onChange:e=>t(`enableWidget`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:6,lg:5,children:(0,V.jsx)(lq,{type:`select`,labelKey:`cfgWidgetMode`,helpKey:`cfgWidgetMode_tt`,value:e.widgetMode??`nojs`,onChange:e=>t(`widgetMode`,e),options:[{value:`nojs`,labelKey:`cfgWidgetModeNojs`},{value:`js`,labelKey:`cfgWidgetModeJs`}]})})]}),(0,V.jsx)(uq,{textKey:`hdrWidgetLayout`}),(0,V.jsxs)(X,{container:!0,spacing:2,children:[(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(lq,{type:`number`,labelKey:`cfgWidgetAnzahl`,helpKey:`cfgWidgetAnzahl_tt`,value:e.widgetAnzahl??20,min:1,max:500,onChange:e=>t(`widgetAnzahl`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(lq,{type:`number`,labelKey:`cfgWidgetMinCol`,helpKey:`cfgWidgetMinCol_tt`,value:e.widgetMinCol??150,min:80,max:600,onChange:e=>t(`widgetMinCol`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(lq,{type:`number`,labelKey:`cfgWidgetMaxModalWidth`,helpKey:`cfgWidgetMaxModalWidth_tt`,value:e.widgetMaxModalWidth??900,min:300,max:2e3,onChange:e=>t(`widgetMaxModalWidth`,e)})})]}),(0,V.jsx)(uq,{textKey:`hdrWidgetTags`}),(0,V.jsxs)(X,{container:!0,spacing:2,children:[(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`checkbox`,labelKey:`cfgWidgetShowTags`,helpKey:`cfgWidgetShowTags_tt`,value:e.widgetShowTags,onChange:e=>t(`widgetShowTags`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`select`,labelKey:`cfgWidgetTagPosition`,helpKey:`cfgWidgetTagPosition_tt`,value:e.widgetTagPosition??`bottom-left`,onChange:e=>t(`widgetTagPosition`,e),options:[{value:`top-left`,labelKey:`cfgTagPosTopLeft`},{value:`top-right`,labelKey:`cfgTagPosTopRight`},{value:`bottom-left`,labelKey:`cfgTagPosBotLeft`},{value:`bottom-right`,labelKey:`cfgTagPosBotRight`}]})})]}),(0,V.jsx)(uq,{textKey:`hdrWidgetFilter`}),(0,V.jsxs)(X,{container:!0,spacing:2,children:[(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`checkbox`,labelKey:`cfgWidgetSortNewest`,helpKey:`cfgWidgetSortNewest_tt`,value:e.widgetSortNewest!==!1,onChange:e=>t(`widgetSortNewest`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`checkbox`,labelKey:`cfgWidgetShowSearch`,helpKey:`cfgWidgetShowSearch_tt`,value:e.widgetShowSearch,onChange:e=>t(`widgetShowSearch`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`checkbox`,labelKey:`cfgWidgetCompact`,helpKey:`cfgWidgetCompact_tt`,value:e.widgetCompact,onChange:e=>t(`widgetCompact`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(lq,{type:`text`,labelKey:`cfgWidgetDefaultTag`,helpKey:`cfgWidgetDefaultTag_tt`,value:e.widgetDefaultTag??``,onChange:e=>t(`widgetDefaultTag`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(lq,{type:`select`,labelKey:`cfgWidgetThumbSize`,helpKey:`cfgWidgetThumbSize_tt`,value:e.widgetThumbSize??`medium`,onChange:e=>t(`widgetThumbSize`,e),options:[{value:`small`,labelKey:`cfgWidgetThumbSmall`},{value:`medium`,labelKey:`cfgWidgetThumbMedium`},{value:`large`,labelKey:`cfgWidgetThumbLarge`}]})})]}),(0,V.jsx)(uq,{textKey:`hdrWidgetPlayer`}),(0,V.jsxs)(X,{container:!0,spacing:2,children:[(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(lq,{type:`text`,labelKey:`cfgWidgetLiveAspect`,helpKey:`cfgWidgetLiveAspect_tt`,value:e.widgetLiveAspect??``,onChange:e=>t(`widgetLiveAspect`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:12,md:8,children:(0,V.jsx)(lq,{type:`text`,labelKey:`cfgWidgetPlayerUrl`,helpKey:`cfgWidgetPlayerUrl_tt`,value:e.widgetPlayerUrl??``,onChange:e=>t(`widgetPlayerUrl`,e)})})]}),(0,V.jsx)(uq,{textKey:`hdrWidgetTheme`}),(0,V.jsxs)(X,{container:!0,spacing:2,children:[(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:3,lg:2,children:(0,V.jsx)(dq,{labelKey:`cfgWidgetColorCardBg`,helpKey:`cfgWidgetColorCardBg_tt`,value:e.widgetColorCardBg??``,onChange:e=>t(`widgetColorCardBg`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:3,lg:2,children:(0,V.jsx)(dq,{labelKey:`cfgWidgetColorTagBg`,helpKey:`cfgWidgetColorTagBg_tt`,value:e.widgetColorTagBg??``,onChange:e=>t(`widgetColorTagBg`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:3,lg:2,children:(0,V.jsx)(dq,{labelKey:`cfgWidgetColorTagText`,helpKey:`cfgWidgetColorTagText_tt`,value:e.widgetColorTagText??``,onChange:e=>t(`widgetColorTagText`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:3,lg:2,children:(0,V.jsx)(dq,{labelKey:`cfgWidgetColorAccent`,helpKey:`cfgWidgetColorAccent_tt`,value:e.widgetColorAccent??``,onChange:e=>t(`widgetColorAccent`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:3,lg:2,children:(0,V.jsx)(dq,{labelKey:`cfgWidgetColorModalBg`,helpKey:`cfgWidgetColorModalBg_tt`,value:e.widgetColorModalBg??``,onChange:e=>t(`widgetColorModalBg`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:3,lg:2,children:(0,V.jsx)(lq,{type:`number`,labelKey:`cfgWidgetBorderRadius`,helpKey:`cfgWidgetBorderRadius_tt`,value:e.widgetBorderRadius??4,min:0,max:32,onChange:e=>t(`widgetBorderRadius`,e)})})]})]});function hq(e){let t=Array.isArray(e?.objectList)?e.objectList:[],n=[];for(let e of t){if(!e||typeof e!=`object`)continue;let t=e.id??e.oid;if(t==null)continue;let r=typeof e.name==`string`?e.name:`obj_${t}`;if((e.typeID??e.ot??e.objectTypeID??e.type)!==2)continue;let i=`cam_${String(t).replace(/[\s.[\]*?"'`,;:/\\]+/g,`_`).replace(/[^A-Za-z0-9_-]/g,`_`)}_${r.replace(/[\s.[\]*?"'`,;:/\\]+/g,`_`).replace(/[^A-Za-z0-9_-]/g,`_`).replace(/_+/g,`_`).replace(/^_+|_+$/g,``)||`x`}`;n.push({key:i,name:r})}return n.sort((e,t)=>e.name.localeCompare(t.name)),n}function gq(e){return!e||typeof e!=`object`?[]:Object.keys(e).sort()}var _q=({native:e,onChange:t,socket:n,instance:r})=>{let[i,a]=(0,B.useState)(null),[o,s]=(0,B.useState)([]),[c,l]=(0,B.useState)(null),[u,d]=(0,B.useState)(!1),f=e.cameraStreams||{},p=Object.values(f).some(e=>e&&e!==`mjpeg`&&e!==`mp4`);function m(e){return f[e]??`mjpeg`}function h(e,n){t(`cameraStreams`,{...f,[e]:n})}let g=(0,B.useCallback)(async()=>{let t=(e.ip||``).trim(),i=e.port||8090,o=(e.go2rtcUrl||``).trim();if(o=o.replace(/^https:\/\//i,`http://`),o&&!o.startsWith(`http://`)&&(o=`http://${o}`),!t){a([]),l(vA.t(`cfgIpMissing`));return}d(!0),l(null);try{let c=[],u=[],d=new AbortController,f=setTimeout(()=>d.abort(),4e3);try{let n=await fetch(`http://${t}:${i}/command/getObjects`,{signal:d.signal,headers:e.user?{Authorization:`Basic ${btoa(`${e.user}:${e.pass??``}`)}`}:{}});n.ok?c=hq(await n.json()):l(`AgentDVR: HTTP ${n.status}`)}catch(e){if(e?.name===`AbortError`)l(`AgentDVR: Timeout (4 s)`);else try{let t=await Promise.race([n.sendTo(`agent-dvr.${r}`,`getAgentDvrCameras`,null),new Promise(e=>setTimeout(()=>e(null),5e3))]);t?.cameras?.length?c=t.cameras:l(`AgentDVR: ${e?.message||e}`)}catch{l(`AgentDVR: ${e?.message||e}`)}}if(clearTimeout(f),o){let e=!1;try{let t=new AbortController,n=setTimeout(()=>t.abort(),4e3),r=await fetch(`${o}/api/streams`,{signal:t.signal});clearTimeout(n),r.ok&&(u=gq(await r.json()),e=!0)}catch{}if(!e)try{let e=await Promise.race([n.sendTo(`agent-dvr.${r}`,`getGo2rtcStreams`,{url:o}),new Promise(e=>setTimeout(()=>e({_timeout:!0}),6e3))]);e?._timeout?l(e=>`${e?`${e} | `:``}go2rtc: Timeout`):Array.isArray(e?.streams)&&(u=e.streams,u.length===0&&e.error&&l(t=>(t?`${t} | `:``)+e.error))}catch{}}a(c),s(u)}finally{d(!1)}},[e.ip,e.port,e.go2rtcUrl,e.user,e.pass,n,r]);return(0,B.useEffect)(()=>{let e=setTimeout(()=>void g(),600);return()=>clearTimeout(e)},[e.ip,e.port,e.go2rtcUrl,e.user,e.pass,g]),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(uq,{textKey:`hdrDashView`}),(0,V.jsxs)(X,{container:!0,spacing:2,children:[(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(lq,{type:`select`,labelKey:`cfgDashDefaultView`,helpKey:`cfgDashDefaultView_tt`,value:e.dashDefaultView??`live`,onChange:e=>t(`dashDefaultView`,e),options:[{value:`live`,labelKey:`cfgDashViewLive`},{value:`recordings`,labelKey:`cfgDashViewRec`}]})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`checkbox`,labelKey:`cfgDashShowOffline`,helpKey:`cfgDashShowOffline_tt`,value:e.dashShowOffline,onChange:e=>t(`dashShowOffline`,e)})})]}),(0,V.jsx)(uq,{textKey:`hdrDashGrid`}),(0,V.jsxs)(X,{container:!0,spacing:2,children:[(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:3,lg:2,children:(0,V.jsx)(lq,{type:`number`,labelKey:`cfgDashGridCols`,helpKey:`cfgDashGridCols_tt`,value:e.dashGridCols??0,min:0,max:8,onChange:e=>t(`dashGridCols`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`checkbox`,labelKey:`cfgDashBtnsVisible`,helpKey:`cfgDashBtnsVisible_tt`,value:e.dashBtnsVisible,onChange:e=>t(`dashBtnsVisible`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`select`,labelKey:`cfgDashTagPosition`,helpKey:`cfgDashTagPosition_tt`,value:e.dashTagPosition??`bottom-right`,onChange:e=>t(`dashTagPosition`,e),options:[{value:`top-left`,labelKey:`cfgTagPosTopLeft`},{value:`top-right`,labelKey:`cfgTagPosTopRight`},{value:`bottom-left`,labelKey:`cfgTagPosBotLeft`},{value:`bottom-right`,labelKey:`cfgTagPosBotRight`}]})})]}),(0,V.jsx)(uq,{textKey:`hdrDashStream`}),(0,V.jsxs)(X,{container:!0,spacing:2,children:[(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(lq,{type:`number`,labelKey:`cfgDashRefreshSec`,helpKey:`cfgDashRefreshSec_tt`,value:e.dashRefreshSec??60,min:10,max:600,onChange:e=>t(`dashRefreshSec`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`checkbox`,labelKey:`cfgDashStreamReconnect`,helpKey:`cfgDashStreamReconnect_tt`,value:e.dashStreamReconnect!==!1,onChange:e=>t(`dashStreamReconnect`,e)})})]}),(0,V.jsx)(uq,{textKey:`hdrDashTheme`}),(0,V.jsx)(X,{container:!0,spacing:2,children:[`dashColorBg`,`dashColorSurface`,`dashColorAccent`,`dashColorText`,`dashColorBorder`,`dashColorOnline`,`dashColorOffline`].map(n=>(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:3,lg:2,children:(0,V.jsx)(dq,{labelKey:`cfg${n.charAt(0).toUpperCase()}${n.slice(1)}`,helpKey:`cfg${n.charAt(0).toUpperCase()}${n.slice(1)}_tt`,value:e[n]??``,onChange:e=>t(n,e)})},n))}),(0,V.jsx)(uq,{textKey:`hdrCameraStreams`}),(0,V.jsxs)($x,{sx:{mb:1,display:`flex`,alignItems:`center`,gap:1},children:[(0,V.jsx)(Kv,{variant:`subtitle2`,color:`text.secondary`,sx:{flex:1},children:vA.t(`cfgGo2rtcMapping_tt`)}),(0,V.jsx)(TD,{title:`Neu laden`,children:(0,V.jsx)(Ev,{size:`small`,onClick:()=>void g(),disabled:u,children:u?(0,V.jsx)(bv,{size:18}):(0,V.jsx)(Rk,{})})})]}),c&&(0,V.jsx)(Rv,{severity:`warning`,sx:{mb:1},children:c}),u&&(0,V.jsxs)($x,{sx:{display:`flex`,alignItems:`center`,gap:1,mb:2},children:[(0,V.jsx)(bv,{size:16}),(0,V.jsx)(Kv,{variant:`caption`,children:`Lade Kameras und Streams…`})]}),i!==null&&i.length===0&&!u&&(0,V.jsx)(Rv,{severity:`info`,sx:{mb:2},children:vA.t(`cfgNoCamerasFound`)}),i!==null&&i.length>0&&(0,V.jsx)(oO,{component:z_,variant:`outlined`,sx:{mb:2},children:(0,V.jsxs)(WD,{size:`small`,children:[(0,V.jsx)(fO,{children:(0,V.jsxs)(wO,{children:[(0,V.jsx)(nO,{children:(0,V.jsx)(`strong`,{children:`AgentDVR Kamera`})}),(0,V.jsx)(nO,{children:(0,V.jsx)(`strong`,{children:`Stream-Quelle`})})]})}),(0,V.jsx)(ZD,{children:i.map(e=>(0,V.jsxs)(wO,{hover:!0,children:[(0,V.jsx)(nO,{children:(0,V.jsxs)($x,{children:[(0,V.jsx)(Kv,{variant:`body2`,children:e.name}),(0,V.jsx)(Kv,{variant:`caption`,color:`text.secondary`,sx:{fontFamily:`monospace`},children:e.key})]})}),(0,V.jsx)(nO,{sx:{minWidth:240},children:(0,V.jsx)(aw,{size:`small`,fullWidth:!0,children:(0,V.jsxs)(nD,{value:m(e.key),onChange:t=>h(e.key,t.target.value),children:[(0,V.jsx)(bE,{value:`mjpeg`,children:(0,V.jsxs)($x,{sx:{display:`flex`,alignItems:`center`,gap:1},children:[`MJPEG`,(0,V.jsx)(ox,{label:`AgentDVR`,size:`small`,variant:`outlined`})]})}),(0,V.jsx)(bE,{value:`mp4`,children:(0,V.jsxs)($x,{sx:{display:`flex`,alignItems:`center`,gap:1},children:[`MP4 / FLV (mit Ton)`,(0,V.jsx)(ox,{label:`AgentDVR`,size:`small`,variant:`outlined`})]})}),o.length>0&&(0,V.jsx)(KC,{}),o.map(e=>(0,V.jsx)(bE,{value:e,children:(0,V.jsxs)($x,{sx:{display:`flex`,alignItems:`center`,gap:1},children:[e,(0,V.jsx)(ox,{label:`go2rtc`,size:`small`,color:`primary`,variant:`outlined`})]})},e))]})})})]},e.key))})]})}),p&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(uq,{textKey:`hdrGo2rtc`}),(0,V.jsx)(X,{container:!0,spacing:2,children:(0,V.jsx)(X,{item:!0,xs:12,sm:8,md:6,lg:5,children:(0,V.jsx)(lq,{type:`text`,labelKey:`cfgGo2rtcUrl`,helpKey:`cfgGo2rtcUrl_tt`,value:e.go2rtcUrl??``,onChange:e=>t(`go2rtcUrl`,e)})})})]})]})},vq=({native:e,onChange:t})=>(0,V.jsxs)(X,{container:!0,spacing:2,children:[(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(lq,{type:`number`,labelKey:`cfgMaxDepth`,value:e.maxDepth??6,min:1,max:10,onChange:e=>t(`maxDepth`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(lq,{type:`number`,labelKey:`cfgMaxArray`,value:e.maxArray??30,min:1,max:500,onChange:e=>t(`maxArray`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`checkbox`,labelKey:`cfgEventTagsDynamic`,value:e.eventTagsDynamic,onChange:e=>t(`eventTagsDynamic`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:6,lg:4,children:(0,V.jsx)(lq,{type:`text`,labelKey:`cfgEventTagsIgnore`,value:e.eventTagsIgnore??``,onChange:e=>t(`eventTagsIgnore`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:6,lg:4,children:(0,V.jsx)(lq,{type:`text`,labelKey:`cfgEventTags`,value:e.eventTags??``,onChange:e=>t(`eventTags`,e)})})]}),yq={"agent-dvr adapter settings":`Agent DVR Adapter Settings`,tabConnection:`Connection`,tabFeatures:`Features`,tabWidget:`Widget`,tabAdvanced:`Advanced`,cfgIp:`AgentDVR IP Address`,cfgPort:`Port`,cfgUser:`Username (optional)`,cfgPass:`Password (optional)`,cfgPollSeconds:`Poll interval (seconds)`,cfgHttpTimeoutMs:`HTTP timeout (ms)`,cfgEnableSystemControls:`System control buttons`,cfgEnablePtz:`PTZ control buttons`,cfgEnableUrls:`Generate stream URLs`,cfgEnableEventDps:`Event data points`,cfgEnablePush:`Real-time push trigger`,cfgEnableOverview:`Overview widget (all cameras)`,cfgStoreRawJson:`Store raw API JSON`,cfgEnableWidget:`Gallery widget per camera`,cfgWidgetMode:`Widget mode`,cfgWidgetModeNojs:`Pure HTML/CSS (no JavaScript, compatible everywhere)`,cfgWidgetModeJs:`Full JS (search + tag filter, requires script execution)`,cfgWidgetAnzahl:`Max. recordings in gallery`,cfgWidgetMinCol:`Min. column width (px)`,cfgWidgetShowTags:`Show event tags`,cfgWidgetLiveAspect:`Live tile aspect ratio (e.g. 16/9, leave empty for auto)`,cfgWidgetTagPosition:`Tag badge position`,cfgTagPosTopLeft:`Top left`,cfgTagPosTopRight:`Top right`,cfgTagPosBotLeft:`Bottom left`,cfgTagPosBotRight:`Bottom right`,cfgWidgetMaxModalWidth:`Max. player width (px)`,cfgWidgetPlayerUrl:`External player URL (leave empty for built-in player)`,cfgMaxDepth:`Max. object flatten depth`,cfgMaxArray:`Max. array length to expand`,cfgEventTagsDynamic:`Auto-detect event tags from recordings`,cfgEventTagsIgnore:`Event tags to ignore (comma-separated)`,cfgEventTags:`Fixed event tags to always create (comma-separated)`,cfgEnableSnapshotB64:`Snapshot as Base64`,hdrControls:`Control Buttons`,hdrEvents:`Events & Push`,hdrDisplay:`Display`,hdrDebug:`Debug`,hdrWidgetGeneral:`Gallery Widget`,hdrWidgetLayout:`Layout`,hdrWidgetTags:`Tags`,hdrWidgetPlayer:`Livestream & Player`,cfgEnableSystemControls_tt:`Arm/Disarm/Restart buttons, profile selector and all system-wide control commands`,cfgEnablePtz_tt:`Hold switches for PTZ (left/right/up/down/zoom) per camera`,cfgEnableUrls_tt:`URL states for snapshot, MJPEG and MP4 stream per camera`,cfgEnableSnapshotB64_tt:`Save camera image as Base64 on every poll (photo.jpg, full resolution). Refresh button always present.`,cfgEnableEventDps_tt:`Mirror metadata of the last recording (filename, date, duration, tags)`,cfgEnablePush_tt:`Push trigger state is updated immediately when AgentDVR reports a new recording`,cfgEnableOverview_tt:`HTML state with all cameras as tile grid (for visualizations, dashboards etc.)`,cfgStoreRawJson_tt:`Write full getObjects response to system.raw_getObjects (useful for debugging)`,cfgEnableWidget_tt:`HTML gallery with the latest recordings per camera (for visualizations, dashboards etc.)`,cfgWidgetMode_tt:`Pure HTML/CSS compatible everywhere. Full JS with search field and tag filter (requires script execution).`,cfgWidgetAnzahl_tt:`Maximum number of recordings in the gallery per camera`,cfgWidgetMinCol_tt:`Minimum column width of the gallery grid in pixels`,cfgWidgetMaxModalWidth_tt:`Maximum width of the video player in the modal dialog in pixels`,cfgWidgetShowTags_tt:`Show event tags as colored badge labels on gallery tiles`,cfgWidgetTagPosition_tt:`Corner of the image where the tag badge appears`,cfgWidgetLiveAspect_tt:`Aspect ratio of the livestream tile e.g. 16/9. Leave empty for automatic.`,cfgWidgetPlayerUrl_tt:`URL of an external video player. Leave empty for built-in player.`,hdrWidgetFilter:`Filter & Sort`,cfgWidgetSortNewest:`Newest first`,cfgWidgetSortNewest_tt:`Sort recordings by date, newest first`,cfgWidgetShowSearch:`Show search field (JS mode only)`,cfgWidgetShowSearch_tt:`Show text search over date, tag and filename in JS mode`,cfgWidgetCompact:`Compact layout`,cfgWidgetCompact_tt:`Smaller spacing and font – more entries at a glance (works in both modes)`,cfgWidgetDefaultTag:`Default tag filter (empty = all)`,cfgWidgetDefaultTag_tt:`This tag is pre-selected on first load (JS mode only)`,cfgWidgetThumbSize:`Thumbnail size`,cfgWidgetThumbSize_tt:`Width of preview images in the gallery (overrides min. column width)`,cfgWidgetThumbSmall:`Small (120 px)`,cfgWidgetThumbMedium:`Medium (180 px)`,cfgWidgetThumbLarge:`Large (240 px)`,tabDashboard:`Live Dashboard`,hdrDashView:`View`,cfgDashDefaultView:`Default view on open`,cfgDashDefaultView_tt:`Which tab is active when the dashboard opens`,cfgDashViewLive:`Live view`,cfgDashViewRec:`Recordings`,cfgDashShowOffline:`Show offline cameras`,cfgDashShowOffline_tt:`Include cameras that are currently offline in the live grid`,hdrDashGrid:`Camera grid`,cfgDashGridCols:`Column count (0 = automatic)`,cfgDashGridCols_tt:`Force a fixed number of camera columns. 0 = optimal count is calculated automatically.`,hdrDashStream:`Stream & Refresh`,cfgDashRefreshSec:`Reload camera list every (seconds)`,cfgDashRefreshSec_tt:`How often the camera list is reloaded from the server (0 = no automatic reload)`,cfgDashStreamReconnect:`Auto-reconnect stream on error`,cfgDashStreamReconnect_tt:`Automatically restart the MJPEG stream after a connection drop`,hdrWidgetTheme:`Colors & Design`,cfgWidgetColorCardBg:`Tile background`,cfgWidgetColorCardBg_tt:`Background color of thumbnail tiles – rgba(r,g,b,a) or #hex`,cfgWidgetColorTagBg:`Tag badge background`,cfgWidgetColorTagBg_tt:`Background color of the tag badge`,cfgWidgetColorTagText:`Tag badge text color`,cfgWidgetColorTagText_tt:`Text color of the tag badge`,cfgWidgetColorAccent:`Accent color`,cfgWidgetColorAccent_tt:`Accent color for links and buttons in the widget`,cfgWidgetColorModalBg:`Modal background`,cfgWidgetColorModalBg_tt:`Background color of the video player dialog`,cfgWidgetBorderRadius:`Border radius (px)`,cfgWidgetBorderRadius_tt:`Corner radius of thumbnail tiles in pixels (0 = square)`,hdrDashTheme:`Colors & Design`,cfgDashColorBg:`Background`,cfgDashColorBg_tt:`Main background color of the dashboard`,cfgDashColorSurface:`Surface / Cards`,cfgDashColorSurface_tt:`Background color of tiles and cards`,cfgDashColorAccent:`Accent color`,cfgDashColorAccent_tt:`Main accent color (buttons, active elements, borders)`,cfgDashColorText:`Text color`,cfgDashColorText_tt:`Primary text color`,cfgDashColorBorder:`Border color`,cfgDashColorBorder_tt:`Color of dividers and borders`,cfgDashColorOnline:`Online color`,cfgDashColorOnline_tt:`Color of the online status indicator`,cfgDashColorOffline:`Offline color`,cfgDashColorOffline_tt:`Color of the offline status indicator`,cfgDashTagPosition:`Tag badge position`,cfgDashTagPosition_tt:`Corner of the recording tile where the tag badge appears`,cfgDashBtnsVisible:`Buttons always visible`,cfgDashBtnsVisible_tt:`Always show record and PTZ buttons on camera tile (otherwise only visible on hover)`,hdrCameraStreams:`Stream Assignment`,hdrGo2rtc:`go2rtc WebRTC Streams`,cfgGo2rtcUrl:`go2rtc URL`,cfgGo2rtcUrl_tt:`Base URL of the go2rtc server, e.g. http://192.168.1.1:1984`,cfgGo2rtcMapping_tt:`Select the stream source per camera: MJPEG or MP4/FLV (via AgentDVR) or a go2rtc stream.`,cfgIpMissing:`AgentDVR IP address is required`,cfgNoCamerasFound:`No cameras found — is the adapter configured and has it polled at least once?`},bq={"agent-dvr adapter settings":`Agent DVR Adapter-Einstellungen`,tabConnection:`Verbindung`,tabFeatures:`Funktionen`,tabWidget:`Widget`,tabAdvanced:`Erweitert`,cfgIp:`AgentDVR IP-Adresse`,cfgPort:`Port`,cfgUser:`Benutzername (optional)`,cfgPass:`Passwort (optional)`,cfgPollSeconds:`Abfrageintervall (Sekunden)`,cfgHttpTimeoutMs:`HTTP-Timeout (ms)`,cfgEnableSystemControls:`Systemsteuerungs-Schaltflächen`,cfgEnablePtz:`PTZ-Steuerungs-Schaltflächen`,cfgEnableUrls:`Stream-URLs generieren`,cfgEnableEventDps:`Ereignis-Datenpunkte`,cfgEnablePush:`Echtzeit-Push-Trigger`,cfgEnableOverview:`Übersichts-Widget (alle Kameras)`,cfgStoreRawJson:`Rohes API-JSON speichern`,cfgEnableWidget:`Galerie-Widget pro Kamera`,cfgWidgetMode:`Widget-Modus`,cfgWidgetModeNojs:`Reines HTML/CSS (kein JavaScript, überall kompatibel)`,cfgWidgetModeJs:`Vollständiges JS (Suche + Tag-Filter, erfordert Skriptausführung)`,cfgWidgetAnzahl:`Max. Aufnahmen in der Galerie`,cfgWidgetMinCol:`Min. Spaltenbreite (px)`,cfgWidgetShowTags:`Ereignis-Tags anzeigen`,cfgWidgetLiveAspect:`Seitenverhältnis Live-Kachel (z.B. 16/9, leer lassen für automatisch)`,cfgWidgetTagPosition:`Tag-Badge-Position`,cfgTagPosTopLeft:`Oben links`,cfgTagPosTopRight:`Oben rechts`,cfgTagPosBotLeft:`Unten links`,cfgTagPosBotRight:`Unten rechts`,cfgWidgetMaxModalWidth:`Max. Player-Breite (px)`,cfgWidgetPlayerUrl:`Externer Player-URL (leer lassen für eingebauten Player)`,cfgMaxDepth:`Max. Objekt-Abflachungstiefe`,cfgMaxArray:`Max. Array-Länge zum Erweitern`,cfgEventTagsDynamic:`Ereignis-Tags automatisch aus Aufnahmen erkennen`,cfgEventTagsIgnore:`Zu ignorierende Ereignis-Tags (kommagetrennt)`,cfgEventTags:`Feste Ereignis-Tags, die immer erstellt werden (kommagetrennt)`,cfgEnableSnapshotB64:`Snapshot als Base64`,hdrControls:`Steuerbuttons`,hdrEvents:`Ereignisse & Push`,hdrDisplay:`Darstellung`,hdrDebug:`Debug`,hdrWidgetGeneral:`Galerie-Widget`,hdrWidgetLayout:`Layout`,hdrWidgetTags:`Tags`,hdrWidgetPlayer:`Livestream & Player`,cfgEnableSystemControls_tt:`Arm/Disarm/Neustart-Buttons, Profil-Selektor und alle systemweiten Steuerbefehle`,cfgEnablePtz_tt:`Hold-Switches für PTZ (links/rechts/oben/unten/Zoom) pro Kamera`,cfgEnableUrls_tt:`URL-States für Snapshot, MJPEG und MP4-Stream pro Kamera`,cfgEnableSnapshotB64_tt:`Kamerabild als Base64 bei jedem Poll speichern (photo.jpg, volle Auflösung). Refresh-Button immer vorhanden.`,cfgEnableEventDps_tt:`Metadaten der letzten Aufnahme spiegeln (Dateiname, Datum, Dauer, Tags)`,cfgEnablePush_tt:`Push-Trigger-State wird sofort aktualisiert wenn AgentDVR eine neue Aufnahme meldet`,cfgEnableOverview_tt:`HTML-State mit allen Kameras als Kachelraster (für Visualisierungen, Dashboards etc.)`,cfgStoreRawJson_tt:`Vollständige getObjects-Antwort in system.raw_getObjects schreiben (nützlich für Debugging)`,cfgEnableWidget_tt:`HTML-Galerie mit den letzten Aufnahmen pro Kamera (für Visualisierungen, Dashboards etc.)`,cfgWidgetMode_tt:`Pure HTML/CSS überall kompatibel. Full JS mit Suchfeld und Tag-Filter (benötigt Script-Ausführung).`,cfgWidgetAnzahl_tt:`Maximale Anzahl Aufnahmen in der Galerie pro Kamera`,cfgWidgetMinCol_tt:`Minimale Spaltenbreite des Galerie-Grids in Pixeln`,cfgWidgetMaxModalWidth_tt:`Maximale Breite des Video-Players im Modal-Dialog in Pixeln`,cfgWidgetShowTags_tt:`Event-Tags als farbige Badge-Labels auf den Galerie-Kacheln anzeigen`,cfgWidgetTagPosition_tt:`Ecke des Bildes wo der Tag-Badge erscheint`,cfgWidgetLiveAspect_tt:`Seitenverhältnis der Livestream-Kachel z.B. 16/9. Leer lassen für automatisch.`,cfgWidgetPlayerUrl_tt:`URL eines externen Video-Players. Leer lassen für eingebauten Player.`,hdrWidgetFilter:`Filter & Sortierung`,cfgWidgetSortNewest:`Neueste zuerst`,cfgWidgetSortNewest_tt:`Aufnahmen nach Datum sortieren, neueste zuerst`,cfgWidgetShowSearch:`Suchfeld anzeigen (nur JS-Modus)`,cfgWidgetShowSearch_tt:`Textsuche über Datum, Tag und Dateiname im JS-Modus einblenden`,cfgWidgetCompact:`Kompaktes Layout`,cfgWidgetCompact_tt:`Kleinere Abstände und Schrift – mehr Einträge auf einen Blick (wirkt in beiden Modi)`,cfgWidgetDefaultTag:`Standard-Tag-Filter (leer = alle)`,cfgWidgetDefaultTag_tt:`Dieser Tag ist beim ersten Laden vorausgewählt (nur JS-Modus)`,cfgWidgetThumbSize:`Thumbnail-Größe`,cfgWidgetThumbSize_tt:`Breite der Vorschaubilder in der Galerie (überschreibt Min. Spaltenbreite)`,cfgWidgetThumbSmall:`Klein (120 px)`,cfgWidgetThumbMedium:`Mittel (180 px)`,cfgWidgetThumbLarge:`Groß (240 px)`,tabDashboard:`Live-Dashboard`,hdrDashView:`Ansicht`,cfgDashDefaultView:`Standard-Ansicht beim Öffnen`,cfgDashDefaultView_tt:`Welcher Tab beim Öffnen des Dashboards aktiv ist`,cfgDashViewLive:`Live-Ansicht`,cfgDashViewRec:`Aufnahmen`,cfgDashShowOffline:`Offline-Kameras anzeigen`,cfgDashShowOffline_tt:`Kameras die gerade offline sind trotzdem im Live-Grid einblenden`,hdrDashGrid:`Kamera-Grid`,cfgDashGridCols:`Spaltenanzahl (0 = automatisch)`,cfgDashGridCols_tt:`Anzahl Kamera-Spalten fest vorgeben. 0 = optimale Anzahl wird automatisch berechnet.`,hdrDashStream:`Stream & Aktualisierung`,cfgDashRefreshSec:`Kameraliste neu laden alle (Sekunden)`,cfgDashRefreshSec_tt:`Wie oft die Kameraliste vom Server neu geladen wird (0 = kein automatischer Reload)`,cfgDashStreamReconnect:`Stream bei Fehler automatisch neu verbinden`,cfgDashStreamReconnect_tt:`MJPEG-Stream wird nach einem Verbindungsabbruch automatisch neu gestartet`,hdrWidgetTheme:`Farben & Design`,cfgWidgetColorCardBg:`Kachel-Hintergrund`,cfgWidgetColorCardBg_tt:`Hintergrundfarbe der Vorschaukacheln – rgba(r,g,b,a) oder #hex`,cfgWidgetColorTagBg:`Tag-Badge-Hintergrund`,cfgWidgetColorTagBg_tt:`Hintergrundfarbe des Tag-Badges`,cfgWidgetColorTagText:`Tag-Badge-Textfarbe`,cfgWidgetColorTagText_tt:`Textfarbe des Tag-Badges`,cfgWidgetColorAccent:`Akzentfarbe`,cfgWidgetColorAccent_tt:`Akzentfarbe für Links und Buttons im Widget`,cfgWidgetColorModalBg:`Modal-Hintergrund`,cfgWidgetColorModalBg_tt:`Hintergrundfarbe des Video-Player-Dialogs`,cfgWidgetBorderRadius:`Eckenradius (px)`,cfgWidgetBorderRadius_tt:`Abrundungsradius der Vorschaukacheln in Pixeln (0 = eckig)`,hdrDashTheme:`Farben & Design`,cfgDashColorBg:`Hintergrund`,cfgDashColorBg_tt:`Haupthintergrundfarbe des Dashboards`,cfgDashColorSurface:`Oberfläche / Karten`,cfgDashColorSurface_tt:`Hintergrundfarbe von Kacheln und Karten`,cfgDashColorAccent:`Akzentfarbe`,cfgDashColorAccent_tt:`Hauptakzentfarbe (Buttons, aktive Elemente, Rahmen)`,cfgDashColorText:`Textfarbe`,cfgDashColorText_tt:`Primäre Textfarbe`,cfgDashColorBorder:`Rahmenfarbe`,cfgDashColorBorder_tt:`Farbe von Trennlinien und Rahmen`,cfgDashColorOnline:`Online-Farbe`,cfgDashColorOnline_tt:`Farbe des Online-Status-Indikators`,cfgDashColorOffline:`Offline-Farbe`,cfgDashColorOffline_tt:`Farbe des Offline-Status-Indikators`,cfgDashTagPosition:`Tag-Badge-Position`,cfgDashTagPosition_tt:`Ecke der Aufnahme-Kachel, in der der Tag-Badge erscheint`,cfgDashBtnsVisible:`Buttons immer sichtbar`,cfgDashBtnsVisible_tt:`Aufnahme- und PTZ-Button immer anzeigen (sonst nur bei Hover)`,hdrCameraStreams:`Stream-Zuweisung`,hdrGo2rtc:`go2rtc WebRTC-Streams`,cfgGo2rtcUrl:`go2rtc URL`,cfgGo2rtcUrl_tt:`Basis-URL des go2rtc-Servers, z. B. http://192.168.1.1:1984`,cfgGo2rtcMapping_tt:`Wähle die Stream-Quelle je Kamera: MJPEG oder MP4/FLV (über AgentDVR) oder ein go2rtc-Stream.`,cfgIpMissing:`AgentDVR-IP-Adresse ist erforderlich`,cfgNoCamerasFound:`Keine Kameras gefunden — Adapter konfiguriert und mindestens einmal gepollt?`},xq=class extends NA{constructor(e){super(e,{encryptedFields:[`pass`],Connection:Gs,translations:{en:yq,de:bq}})}render(){if(!this.state.loaded)return super.render();let e=this.state.tab??0,t=this.state.native,n=(e,n)=>{this.setState({native:{...t,[e]:n},changed:this.getIsChanged({...t,[e]:n})})};return(0,V.jsx)(en,{injectFirst:!0,children:(0,V.jsx)(Ts,{theme:this.state.theme,children:(0,V.jsxs)($x,{sx:{display:`flex`,flexDirection:`column`,height:`100%`,overflow:`hidden`,bgcolor:`background.default`,color:`text.primary`},children:[(0,V.jsx)($x,{sx:{borderBottom:1,borderColor:`divider`,px:2},children:(0,V.jsxs)(KO,{value:e,onChange:(e,t)=>this.setState({tab:t}),children:[(0,V.jsx)(RD,{label:vA.t(`tabConnection`)}),(0,V.jsx)(RD,{label:vA.t(`tabFeatures`)}),(0,V.jsx)(RD,{label:vA.t(`tabWidget`)}),(0,V.jsx)(RD,{label:vA.t(`tabDashboard`)}),(0,V.jsx)(RD,{label:vA.t(`tabAdvanced`)})]})}),(0,V.jsxs)($x,{sx:{flex:1,overflowY:`auto`,p:2,pb:12},children:[e===0&&(0,V.jsx)(fq,{native:t,onChange:n}),e===1&&(0,V.jsx)(pq,{native:t,onChange:n}),e===2&&(0,V.jsx)(mq,{native:t,onChange:n}),e===3&&(0,V.jsx)(_q,{native:t,onChange:n,socket:this.socket,instance:this.instance??0}),e===4&&(0,V.jsx)(vq,{native:t,onChange:n})]}),this.renderError(),this.renderSaveCloseButtons()]})})})}};window.adapterName=`agent-dvr`,window.sentryDSN=``;var Sq=document.getElementById(`root`);Sq&&(0,Es.createRoot)(Sq).render((0,V.jsx)(xq,{}));
685
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var h=typeof window<`u`&&window.document!==void 0,g=h?window:{},_=h&&g.document.documentElement?`ontouchstart`in g.document.documentElement:!1,v=h?`PointerEvent`in g:!1,y=`cropper`,b=`all`,x=`crop`,S=`move`,C=`zoom`,w=`e`,T=`w`,E=`s`,D=`n`,O=`ne`,k=`nw`,A=`se`,j=`sw`,M=`${y}-crop`,N=`${y}-disabled`,P=`${y}-hidden`,F=`${y}-hide`,I=`${y}-invisible`,L=`${y}-modal`,ee=`${y}-move`,R=`${y}Action`,te=`${y}Preview`,ne=`crop`,re=`move`,z=`none`,ie=`crop`,ae=`cropend`,oe=`cropmove`,se=`cropstart`,ce=`dblclick`,le=_?`touchstart`:`mousedown`,ue=_?`touchmove`:`mousemove`,de=_?`touchend touchcancel`:`mouseup`,fe=v?`pointerdown`:le,pe=v?`pointermove`:ue,me=v?`pointerup pointercancel`:de,he=`ready`,ge=`resize`,_e=`wheel`,ve=`zoom`,ye=`image/jpeg`,be=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,xe=/^data:/,Se=/^data:image\/jpeg;base64,/,Ce=/^img|canvas$/i,we=200,Te=100,Ee={viewMode:0,dragMode:ne,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:``,responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:we,minContainerHeight:Te,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},De=`<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>`,Oe=Number.isNaN||g.isNaN;function ke(e){return typeof e==`number`&&!Oe(e)}var Ae=function(e){return e>0&&e<1/0};function je(e){return e===void 0}function Me(e){return i(e)===`object`&&e!==null}var Ne=Object.prototype.hasOwnProperty;function Pe(e){if(!Me(e))return!1;try{var t=e.constructor,n=t.prototype;return t&&n&&Ne.call(n,`isPrototypeOf`)}catch{return!1}}function Fe(e){return typeof e==`function`}var Ie=Array.prototype.slice;function Le(e){return Array.from?Array.from(e):Ie.call(e)}function Re(e,t){return e&&Fe(t)&&(Array.isArray(e)||ke(e.length)?Le(e).forEach(function(n,r){t.call(e,n,r,e)}):Me(e)&&Object.keys(e).forEach(function(n){t.call(e,e[n],n,e)})),e}var ze=Object.assign||function(e){var t=[...arguments].slice(1);return Me(e)&&t.length>0&&t.forEach(function(t){Me(t)&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e},Be=/\.\d*(?:0|9){12}\d*$/;function Ve(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Be.test(e)?Math.round(e*t)/t:e}var He=/^width|height|left|top|marginLeft|marginTop$/;function Ue(e,t){var n=e.style;Re(t,function(e,t){He.test(t)&&ke(e)&&(e=`${e}px`),n[t]=e})}function We(e,t){return e.classList?e.classList.contains(t):e.className.indexOf(t)>-1}function Ge(e,t){if(t){if(ke(e.length)){Re(e,function(e){Ge(e,t)});return}if(e.classList){e.classList.add(t);return}var n=e.className.trim();n?n.indexOf(t)<0&&(e.className=`${n} ${t}`):e.className=t}}function Ke(e,t){if(t){if(ke(e.length)){Re(e,function(e){Ke(e,t)});return}if(e.classList){e.classList.remove(t);return}e.className.indexOf(t)>=0&&(e.className=e.className.replace(t,``))}}function qe(e,t,n){if(t){if(ke(e.length)){Re(e,function(e){qe(e,t,n)});return}n?Ge(e,t):Ke(e,t)}}var Je=/([a-z\d])([A-Z])/g;function Ye(e){return e.replace(Je,`$1-$2`).toLowerCase()}function Xe(e,t){return Me(e[t])?e[t]:e.dataset?e.dataset[t]:e.getAttribute(`data-${Ye(t)}`)}function Ze(e,t,n){Me(n)?e[t]=n:e.dataset?e.dataset[t]=n:e.setAttribute(`data-${Ye(t)}`,n)}function Qe(e,t){if(Me(e[t]))try{delete e[t]}catch{e[t]=void 0}else if(e.dataset)try{delete e.dataset[t]}catch{e.dataset[t]=void 0}else e.removeAttribute(`data-${Ye(t)}`)}var $e=/\s\s*/,et=function(){var e=!1;if(h){var t=!1,n=function(){},r=Object.defineProperty({},"once",{get:function(){return e=!0,t},set:function(e){t=e}});g.addEventListener(`test`,n,r),g.removeEventListener(`test`,n,r)}return e}();function tt(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=n;t.trim().split($e).forEach(function(t){if(!et){var a=e.listeners;a&&a[t]&&a[t][n]&&(i=a[t][n],delete a[t][n],Object.keys(a[t]).length===0&&delete a[t],Object.keys(a).length===0&&delete e.listeners)}e.removeEventListener(t,i,r)})}function nt(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=n;t.trim().split($e).forEach(function(t){if(r.once&&!et){var a=e.listeners,o=a===void 0?{}:a;i=function(){delete o[t][n],e.removeEventListener(t,i,r);var a=[...arguments];n.apply(e,a)},o[t]||(o[t]={}),o[t][n]&&e.removeEventListener(t,o[t][n],r),o[t][n]=i,e.listeners=o}e.addEventListener(t,i,r)})}function rt(e,t,n){var r;return Fe(Event)&&Fe(CustomEvent)?r=new CustomEvent(t,{detail:n,bubbles:!0,cancelable:!0}):(r=document.createEvent(`CustomEvent`),r.initCustomEvent(t,!0,!0,n)),e.dispatchEvent(r)}function it(e){var t=e.getBoundingClientRect();return{left:t.left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}var at=g.location,ot=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function st(e){var t=e.match(ot);return t!==null&&(t[1]!==at.protocol||t[2]!==at.hostname||t[3]!==at.port)}function ct(e){var t=`timestamp=${new Date().getTime()}`;return e+(e.indexOf(`?`)===-1?`?`:`&`)+t}function lt(e){var t=e.rotate,n=e.scaleX,r=e.scaleY,i=e.translateX,a=e.translateY,o=[];ke(i)&&i!==0&&o.push(`translateX(${i}px)`),ke(a)&&a!==0&&o.push(`translateY(${a}px)`),ke(t)&&t!==0&&o.push(`rotate(${t}deg)`),ke(n)&&n!==1&&o.push(`scaleX(${n})`),ke(r)&&r!==1&&o.push(`scaleY(${r})`);var s=o.length?o.join(` `):`none`;return{WebkitTransform:s,msTransform:s,transform:s}}function ut(e){var n=t({},e),r=0;return Re(e,function(e,t){delete n[t],Re(n,function(t){var n=Math.abs(e.startX-t.startX),i=Math.abs(e.startY-t.startY),a=Math.abs(e.endX-t.endX),o=Math.abs(e.endY-t.endY),s=Math.sqrt(n*n+i*i),c=(Math.sqrt(a*a+o*o)-s)/s;Math.abs(c)>Math.abs(r)&&(r=c)})}),r}function dt(e,n){var r=e.pageX,i=e.pageY,a={endX:r,endY:i};return n?a:t({startX:r,startY:i},a)}function ft(e){var t=0,n=0,r=0;return Re(e,function(e){var i=e.startX,a=e.startY;t+=i,n+=a,r+=1}),t/=r,n/=r,{pageX:t,pageY:n}}function pt(e){var t=e.aspectRatio,n=e.height,r=e.width,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`contain`,a=Ae(r),o=Ae(n);if(a&&o){var s=n*t;i===`contain`&&s>r||i===`cover`&&s<r?n=r/t:r=n*t}else a?n=r/t:o&&(r=n*t);return{width:r,height:n}}function mt(e){var t=e.width,n=e.height,r=e.degree;if(r=Math.abs(r)%180,r===90)return{width:n,height:t};var i=r%90*Math.PI/180,a=Math.sin(i),o=Math.cos(i),s=t*o+n*a,c=t*a+n*o;return r>90?{width:c,height:s}:{width:s,height:c}}function ht(e,t,n,r){var i=t.aspectRatio,a=t.naturalWidth,o=t.naturalHeight,s=t.rotate,c=s===void 0?0:s,u=t.scaleX,d=u===void 0?1:u,f=t.scaleY,p=f===void 0?1:f,m=n.aspectRatio,h=n.naturalWidth,g=n.naturalHeight,_=r.fillColor,v=_===void 0?`transparent`:_,y=r.imageSmoothingEnabled,b=y===void 0?!0:y,x=r.imageSmoothingQuality,S=x===void 0?`low`:x,C=r.maxWidth,w=C===void 0?1/0:C,T=r.maxHeight,E=T===void 0?1/0:T,D=r.minWidth,O=D===void 0?0:D,k=r.minHeight,A=k===void 0?0:k,j=document.createElement(`canvas`),M=j.getContext(`2d`),N=pt({aspectRatio:m,width:w,height:E}),P=pt({aspectRatio:m,width:O,height:A},`cover`),F=Math.min(N.width,Math.max(P.width,h)),I=Math.min(N.height,Math.max(P.height,g)),L=pt({aspectRatio:i,width:w,height:E}),ee=pt({aspectRatio:i,width:O,height:A},`cover`),R=Math.min(L.width,Math.max(ee.width,a)),te=Math.min(L.height,Math.max(ee.height,o)),ne=[-R/2,-te/2,R,te];return j.width=Ve(F),j.height=Ve(I),M.fillStyle=v,M.fillRect(0,0,F,I),M.save(),M.translate(F/2,I/2),M.rotate(c*Math.PI/180),M.scale(d,p),M.imageSmoothingEnabled=b,M.imageSmoothingQuality=S,M.drawImage.apply(M,[e].concat(l(ne.map(function(e){return Math.floor(Ve(e))})))),M.restore(),j}var gt=String.fromCharCode;function B(e,t,n){var r=``;n+=t;for(var i=t;i<n;i+=1)r+=gt(e.getUint8(i));return r}var _t=/^data:.*,/;function vt(e){var t=e.replace(_t,``),n=atob(t),r=new ArrayBuffer(n.length),i=new Uint8Array(r);return Re(i,function(e,t){i[t]=n.charCodeAt(t)}),r}function yt(e,t){for(var n=[],r=8192,i=new Uint8Array(e);i.length>0;)n.push(gt.apply(null,Le(i.subarray(0,r)))),i=i.subarray(r);return`data:${t};base64,${btoa(n.join(``))}`}function bt(e){var t=new DataView(e),n;try{var r,i,a;if(t.getUint8(0)===255&&t.getUint8(1)===216)for(var o=t.byteLength,s=2;s+1<o;){if(t.getUint8(s)===255&&t.getUint8(s+1)===225){i=s;break}s+=1}if(i){var c=i+4,l=i+10;if(B(t,c,4)===`Exif`){var u=t.getUint16(l);if(r=u===18761,(r||u===19789)&&t.getUint16(l+2,r)===42){var d=t.getUint32(l+4,r);d>=8&&(a=l+d)}}}if(a){var f=t.getUint16(a,r),p,m;for(m=0;m<f;m+=1)if(p=a+m*12+2,t.getUint16(p,r)===274){p+=8,n=t.getUint16(p,r),t.setUint16(p,1,r);break}}}catch{n=1}return n}function xt(e){var t=0,n=1,r=1;switch(e){case 2:n=-1;break;case 3:t=-180;break;case 4:r=-1;break;case 5:t=90,r=-1;break;case 6:t=90;break;case 7:t=90,n=-1;break;case 8:t=-90;break}return{rotate:t,scaleX:n,scaleY:r}}var St={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var e=this.element,t=this.options,n=this.container,r=this.cropper,i=Number(t.minContainerWidth),a=Number(t.minContainerHeight);Ge(r,P),Ke(e,P);var o={width:Math.max(n.offsetWidth,i>=0?i:we),height:Math.max(n.offsetHeight,a>=0?a:Te)};this.containerData=o,Ue(r,{width:o.width,height:o.height}),Ge(e,P),Ke(r,P)},initCanvas:function(){var e=this.containerData,t=this.imageData,n=this.options.viewMode,r=Math.abs(t.rotate)%180==90,i=r?t.naturalHeight:t.naturalWidth,a=r?t.naturalWidth:t.naturalHeight,o=i/a,s=e.width,c=e.height;e.height*o>e.width?n===3?s=e.height*o:c=e.width/o:n===3?c=e.width/o:s=e.height*o;var l={aspectRatio:o,naturalWidth:i,naturalHeight:a,width:s,height:c};this.canvasData=l,this.limited=n===1||n===2,this.limitCanvas(!0,!0),l.width=Math.min(Math.max(l.width,l.minWidth),l.maxWidth),l.height=Math.min(Math.max(l.height,l.minHeight),l.maxHeight),l.left=(e.width-l.width)/2,l.top=(e.height-l.height)/2,l.oldLeft=l.left,l.oldTop=l.top,this.initialCanvasData=ze({},l)},limitCanvas:function(e,t){var n=this.options,r=this.containerData,i=this.canvasData,a=this.cropBoxData,o=n.viewMode,s=i.aspectRatio,c=this.cropped&&a;if(e){var l=Number(n.minCanvasWidth)||0,u=Number(n.minCanvasHeight)||0;o>1?(l=Math.max(l,r.width),u=Math.max(u,r.height),o===3&&(u*s>l?l=u*s:u=l/s)):o>0&&(l?l=Math.max(l,c?a.width:0):u?u=Math.max(u,c?a.height:0):c&&(l=a.width,u=a.height,u*s>l?l=u*s:u=l/s));var d=pt({aspectRatio:s,width:l,height:u});l=d.width,u=d.height,i.minWidth=l,i.minHeight=u,i.maxWidth=1/0,i.maxHeight=1/0}if(t)if(o>+!c){var f=r.width-i.width,p=r.height-i.height;i.minLeft=Math.min(0,f),i.minTop=Math.min(0,p),i.maxLeft=Math.max(0,f),i.maxTop=Math.max(0,p),c&&this.limited&&(i.minLeft=Math.min(a.left,a.left+(a.width-i.width)),i.minTop=Math.min(a.top,a.top+(a.height-i.height)),i.maxLeft=a.left,i.maxTop=a.top,o===2&&(i.width>=r.width&&(i.minLeft=Math.min(0,f),i.maxLeft=Math.max(0,f)),i.height>=r.height&&(i.minTop=Math.min(0,p),i.maxTop=Math.max(0,p))))}else i.minLeft=-i.width,i.minTop=-i.height,i.maxLeft=r.width,i.maxTop=r.height},renderCanvas:function(e,t){var n=this.canvasData,r=this.imageData;if(t){var i=mt({width:r.naturalWidth*Math.abs(r.scaleX||1),height:r.naturalHeight*Math.abs(r.scaleY||1),degree:r.rotate||0}),a=i.width,o=i.height,s=n.width*(a/n.naturalWidth),c=n.height*(o/n.naturalHeight);n.left-=(s-n.width)/2,n.top-=(c-n.height)/2,n.width=s,n.height=c,n.aspectRatio=a/o,n.naturalWidth=a,n.naturalHeight=o,this.limitCanvas(!0,!1)}(n.width>n.maxWidth||n.width<n.minWidth)&&(n.left=n.oldLeft),(n.height>n.maxHeight||n.height<n.minHeight)&&(n.top=n.oldTop),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),this.limitCanvas(!1,!0),n.left=Math.min(Math.max(n.left,n.minLeft),n.maxLeft),n.top=Math.min(Math.max(n.top,n.minTop),n.maxTop),n.oldLeft=n.left,n.oldTop=n.top,Ue(this.canvas,ze({width:n.width,height:n.height},lt({translateX:n.left,translateY:n.top}))),this.renderImage(e),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(e){var t=this.canvasData,n=this.imageData,r=n.naturalWidth*(t.width/t.naturalWidth),i=n.naturalHeight*(t.height/t.naturalHeight);ze(n,{width:r,height:i,left:(t.width-r)/2,top:(t.height-i)/2}),Ue(this.image,ze({width:n.width,height:n.height},lt(ze({translateX:n.left,translateY:n.top},n)))),e&&this.output()},initCropBox:function(){var e=this.options,t=this.canvasData,n=e.aspectRatio||e.initialAspectRatio,r=Number(e.autoCropArea)||.8,i={width:t.width,height:t.height};n&&(t.height*n>t.width?i.height=i.width/n:i.width=i.height*n),this.cropBoxData=i,this.limitCropBox(!0,!0),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),i.width=Math.max(i.minWidth,i.width*r),i.height=Math.max(i.minHeight,i.height*r),i.left=t.left+(t.width-i.width)/2,i.top=t.top+(t.height-i.height)/2,i.oldLeft=i.left,i.oldTop=i.top,this.initialCropBoxData=ze({},i)},limitCropBox:function(e,t){var n=this.options,r=this.containerData,i=this.canvasData,a=this.cropBoxData,o=this.limited,s=n.aspectRatio;if(e){var c=Number(n.minCropBoxWidth)||0,l=Number(n.minCropBoxHeight)||0,u=o?Math.min(r.width,i.width,i.width+i.left,r.width-i.left):r.width,d=o?Math.min(r.height,i.height,i.height+i.top,r.height-i.top):r.height;c=Math.min(c,r.width),l=Math.min(l,r.height),s&&(c&&l?l*s>c?l=c/s:c=l*s:c?l=c/s:l&&(c=l*s),d*s>u?d=u/s:u=d*s),a.minWidth=Math.min(c,u),a.minHeight=Math.min(l,d),a.maxWidth=u,a.maxHeight=d}t&&(o?(a.minLeft=Math.max(0,i.left),a.minTop=Math.max(0,i.top),a.maxLeft=Math.min(r.width,i.left+i.width)-a.width,a.maxTop=Math.min(r.height,i.top+i.height)-a.height):(a.minLeft=0,a.minTop=0,a.maxLeft=r.width-a.width,a.maxTop=r.height-a.height))},renderCropBox:function(){var e=this.options,t=this.containerData,n=this.cropBoxData;(n.width>n.maxWidth||n.width<n.minWidth)&&(n.left=n.oldLeft),(n.height>n.maxHeight||n.height<n.minHeight)&&(n.top=n.oldTop),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),this.limitCropBox(!1,!0),n.left=Math.min(Math.max(n.left,n.minLeft),n.maxLeft),n.top=Math.min(Math.max(n.top,n.minTop),n.maxTop),n.oldLeft=n.left,n.oldTop=n.top,e.movable&&e.cropBoxMovable&&Ze(this.face,R,n.width>=t.width&&n.height>=t.height?S:b),Ue(this.cropBox,ze({width:n.width,height:n.height},lt({translateX:n.left,translateY:n.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),rt(this.element,ie,this.getData())}},Ct={initPreview:function(){var e=this.element,t=this.crossOrigin,n=this.options.preview,r=t?this.crossOriginUrl:this.url,i=e.alt||`The image to preview`,a=document.createElement(`img`);if(t&&(a.crossOrigin=t),a.src=r,a.alt=i,this.viewBox.appendChild(a),this.viewBoxImage=a,n){var o=n;typeof n==`string`?o=e.ownerDocument.querySelectorAll(n):n.querySelector&&(o=[n]),this.previews=o,Re(o,function(e){var n=document.createElement(`img`);Ze(e,te,{width:e.offsetWidth,height:e.offsetHeight,html:e.innerHTML}),t&&(n.crossOrigin=t),n.src=r,n.alt=i,n.style.cssText=`display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"`,e.innerHTML=``,e.appendChild(n)})}},resetPreview:function(){Re(this.previews,function(e){var t=Xe(e,te);Ue(e,{width:t.width,height:t.height}),e.innerHTML=t.html,Qe(e,te)})},preview:function(){var e=this.imageData,t=this.canvasData,n=this.cropBoxData,r=n.width,i=n.height,a=e.width,o=e.height,s=n.left-t.left-e.left,c=n.top-t.top-e.top;!this.cropped||this.disabled||(Ue(this.viewBoxImage,ze({width:a,height:o},lt(ze({translateX:-s,translateY:-c},e)))),Re(this.previews,function(t){var n=Xe(t,te),l=n.width,u=n.height,d=l,f=u,p=1;r&&(p=l/r,f=i*p),i&&f>u&&(p=u/i,d=r*p,f=u),Ue(t,{width:d,height:f}),Ue(t.getElementsByTagName(`img`)[0],ze({width:a*p,height:o*p},lt(ze({translateX:-s*p,translateY:-c*p},e))))}))}},wt={bind:function(){var e=this.element,t=this.options,n=this.cropper;Fe(t.cropstart)&&nt(e,se,t.cropstart),Fe(t.cropmove)&&nt(e,oe,t.cropmove),Fe(t.cropend)&&nt(e,ae,t.cropend),Fe(t.crop)&&nt(e,ie,t.crop),Fe(t.zoom)&&nt(e,ve,t.zoom),nt(n,fe,this.onCropStart=this.cropStart.bind(this)),t.zoomable&&t.zoomOnWheel&&nt(n,_e,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&nt(n,ce,this.onDblclick=this.dblclick.bind(this)),nt(e.ownerDocument,pe,this.onCropMove=this.cropMove.bind(this)),nt(e.ownerDocument,me,this.onCropEnd=this.cropEnd.bind(this)),t.responsive&&nt(window,ge,this.onResize=this.resize.bind(this))},unbind:function(){var e=this.element,t=this.options,n=this.cropper;Fe(t.cropstart)&&tt(e,se,t.cropstart),Fe(t.cropmove)&&tt(e,oe,t.cropmove),Fe(t.cropend)&&tt(e,ae,t.cropend),Fe(t.crop)&&tt(e,ie,t.crop),Fe(t.zoom)&&tt(e,ve,t.zoom),tt(n,fe,this.onCropStart),t.zoomable&&t.zoomOnWheel&&tt(n,_e,this.onWheel,{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&tt(n,ce,this.onDblclick),tt(e.ownerDocument,pe,this.onCropMove),tt(e.ownerDocument,me,this.onCropEnd),t.responsive&&tt(window,ge,this.onResize)}},Tt={resize:function(){if(!this.disabled){var e=this.options,t=this.container,n=this.containerData,r=t.offsetWidth/n.width,i=t.offsetHeight/n.height,a=Math.abs(r-1)>Math.abs(i-1)?r:i;if(a!==1){var o,s;e.restore&&(o=this.getCanvasData(),s=this.getCropBoxData()),this.render(),e.restore&&(this.setCanvasData(Re(o,function(e,t){o[t]=e*a})),this.setCropBoxData(Re(s,function(e,t){s[t]=e*a})))}}},dblclick:function(){this.disabled||this.options.dragMode===z||this.setDragMode(We(this.dragBox,M)?re:ne)},wheel:function(e){var t=this,n=Number(this.options.wheelZoomRatio)||.1,r=1;this.disabled||(e.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){t.wheeling=!1},50),e.deltaY?r=e.deltaY>0?1:-1:e.wheelDelta?r=-e.wheelDelta/120:e.detail&&(r=e.detail>0?1:-1),this.zoom(-r*n,e)))},cropStart:function(e){var t=e.buttons,n=e.button;if(!(this.disabled||(e.type===`mousedown`||e.type===`pointerdown`&&e.pointerType===`mouse`)&&(ke(t)&&t!==1||ke(n)&&n!==0||e.ctrlKey))){var r=this.options,i=this.pointers,a;e.changedTouches?Re(e.changedTouches,function(e){i[e.identifier]=dt(e)}):i[e.pointerId||0]=dt(e),a=Object.keys(i).length>1&&r.zoomable&&r.zoomOnTouch?C:Xe(e.target,R),be.test(a)&&rt(this.element,se,{originalEvent:e,action:a})!==!1&&(e.preventDefault(),this.action=a,this.cropping=!1,a===x&&(this.cropping=!0,Ge(this.dragBox,L)))}},cropMove:function(e){var t=this.action;if(!(this.disabled||!t)){var n=this.pointers;e.preventDefault(),rt(this.element,oe,{originalEvent:e,action:t})!==!1&&(e.changedTouches?Re(e.changedTouches,function(e){ze(n[e.identifier]||{},dt(e,!0))}):ze(n[e.pointerId||0]||{},dt(e,!0)),this.change(e))}},cropEnd:function(e){if(!this.disabled){var t=this.action,n=this.pointers;e.changedTouches?Re(e.changedTouches,function(e){delete n[e.identifier]}):delete n[e.pointerId||0],t&&(e.preventDefault(),Object.keys(n).length||(this.action=``),this.cropping&&(this.cropping=!1,qe(this.dragBox,L,this.cropped&&this.options.modal)),rt(this.element,ae,{originalEvent:e,action:t}))}}},Et={change:function(e){var t=this.options,n=this.canvasData,r=this.containerData,i=this.cropBoxData,a=this.pointers,o=this.action,s=t.aspectRatio,c=i.left,l=i.top,u=i.width,d=i.height,f=c+u,p=l+d,m=0,h=0,g=r.width,_=r.height,v=!0,y;!s&&e.shiftKey&&(s=u&&d?u/d:1),this.limited&&(m=i.minLeft,h=i.minTop,g=m+Math.min(r.width,n.width,n.left+n.width),_=h+Math.min(r.height,n.height,n.top+n.height));var M=a[Object.keys(a)[0]],N={x:M.endX-M.startX,y:M.endY-M.startY},F=function(e){switch(e){case w:f+N.x>g&&(N.x=g-f);break;case T:c+N.x<m&&(N.x=m-c);break;case D:l+N.y<h&&(N.y=h-l);break;case E:p+N.y>_&&(N.y=_-p);break}};switch(o){case b:c+=N.x,l+=N.y;break;case w:if(N.x>=0&&(f>=g||s&&(l<=h||p>=_))){v=!1;break}F(w),u+=N.x,u<0&&(o=T,u=-u,c-=u),s&&(d=u/s,l+=(i.height-d)/2);break;case D:if(N.y<=0&&(l<=h||s&&(c<=m||f>=g))){v=!1;break}F(D),d-=N.y,l+=N.y,d<0&&(o=E,d=-d,l-=d),s&&(u=d*s,c+=(i.width-u)/2);break;case T:if(N.x<=0&&(c<=m||s&&(l<=h||p>=_))){v=!1;break}F(T),u-=N.x,c+=N.x,u<0&&(o=w,u=-u,c-=u),s&&(d=u/s,l+=(i.height-d)/2);break;case E:if(N.y>=0&&(p>=_||s&&(c<=m||f>=g))){v=!1;break}F(E),d+=N.y,d<0&&(o=D,d=-d,l-=d),s&&(u=d*s,c+=(i.width-u)/2);break;case O:if(s){if(N.y<=0&&(l<=h||f>=g)){v=!1;break}F(D),d-=N.y,l+=N.y,u=d*s}else F(D),F(w),N.x>=0?f<g?u+=N.x:N.y<=0&&l<=h&&(v=!1):u+=N.x,N.y<=0?l>h&&(d-=N.y,l+=N.y):(d-=N.y,l+=N.y);u<0&&d<0?(o=j,d=-d,u=-u,l-=d,c-=u):u<0?(o=k,u=-u,c-=u):d<0&&(o=A,d=-d,l-=d);break;case k:if(s){if(N.y<=0&&(l<=h||c<=m)){v=!1;break}F(D),d-=N.y,l+=N.y,u=d*s,c+=i.width-u}else F(D),F(T),N.x<=0?c>m?(u-=N.x,c+=N.x):N.y<=0&&l<=h&&(v=!1):(u-=N.x,c+=N.x),N.y<=0?l>h&&(d-=N.y,l+=N.y):(d-=N.y,l+=N.y);u<0&&d<0?(o=A,d=-d,u=-u,l-=d,c-=u):u<0?(o=O,u=-u,c-=u):d<0&&(o=j,d=-d,l-=d);break;case j:if(s){if(N.x<=0&&(c<=m||p>=_)){v=!1;break}F(T),u-=N.x,c+=N.x,d=u/s}else F(E),F(T),N.x<=0?c>m?(u-=N.x,c+=N.x):N.y>=0&&p>=_&&(v=!1):(u-=N.x,c+=N.x),N.y>=0?p<_&&(d+=N.y):d+=N.y;u<0&&d<0?(o=O,d=-d,u=-u,l-=d,c-=u):u<0?(o=A,u=-u,c-=u):d<0&&(o=k,d=-d,l-=d);break;case A:if(s){if(N.x>=0&&(f>=g||p>=_)){v=!1;break}F(w),u+=N.x,d=u/s}else F(E),F(w),N.x>=0?f<g?u+=N.x:N.y>=0&&p>=_&&(v=!1):u+=N.x,N.y>=0?p<_&&(d+=N.y):d+=N.y;u<0&&d<0?(o=k,d=-d,u=-u,l-=d,c-=u):u<0?(o=j,u=-u,c-=u):d<0&&(o=O,d=-d,l-=d);break;case S:this.move(N.x,N.y),v=!1;break;case C:this.zoom(ut(a),e),v=!1;break;case x:if(!N.x||!N.y){v=!1;break}y=it(this.cropper),c=M.startX-y.left,l=M.startY-y.top,u=i.minWidth,d=i.minHeight,N.x>0?o=N.y>0?A:O:N.x<0&&(c-=u,o=N.y>0?j:k),N.y<0&&(l-=d),this.cropped||(Ke(this.cropBox,P),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}v&&(i.width=u,i.height=d,i.left=c,i.top=l,this.action=o,this.renderCropBox()),Re(a,function(e){e.startX=e.endX,e.startY=e.endY})}},Dt={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&Ge(this.dragBox,L),Ke(this.cropBox,P),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=ze({},this.initialImageData),this.canvasData=ze({},this.initialCanvasData),this.cropBoxData=ze({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(ze(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),Ke(this.dragBox,L),Ge(this.cropBox,P)),this},replace:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&e&&(this.isImg&&(this.element.src=e),t?(this.url=e,this.image.src=e,this.ready&&(this.viewBoxImage.src=e,Re(this.previews,function(t){t.getElementsByTagName(`img`)[0].src=e}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(e))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,Ke(this.cropper,N)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,Ge(this.cropper,N)),this},destroy:function(){var e=this.element;return e[y]?(e[y]=void 0,this.isImg&&this.replaced&&(e.src=this.originalUrl),this.uncreate(),this):this},move:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=this.canvasData,r=n.left,i=n.top;return this.moveTo(je(e)?e:r+Number(e),je(t)?t:i+Number(t))},moveTo:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=this.canvasData,r=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.movable&&(ke(e)&&(n.left=e,r=!0),ke(t)&&(n.top=t,r=!0),r&&this.renderCanvas(!0)),this},zoom:function(e,t){var n=this.canvasData;return e=Number(e),e=e<0?1/(1-e):1+e,this.zoomTo(n.width*e/n.naturalWidth,null,t)},zoomTo:function(e,t,n){var r=this.options,i=this.canvasData,a=i.width,o=i.height,s=i.naturalWidth,c=i.naturalHeight;if(e=Number(e),e>=0&&this.ready&&!this.disabled&&r.zoomable){var l=s*e,u=c*e;if(rt(this.element,ve,{ratio:e,oldRatio:a/s,originalEvent:n})===!1)return this;if(n){var d=this.pointers,f=it(this.cropper),p=d&&Object.keys(d).length?ft(d):{pageX:n.pageX,pageY:n.pageY};i.left-=(l-a)*((p.pageX-f.left-i.left)/a),i.top-=(u-o)*((p.pageY-f.top-i.top)/o)}else Pe(t)&&ke(t.x)&&ke(t.y)?(i.left-=(l-a)*((t.x-i.left)/a),i.top-=(u-o)*((t.y-i.top)/o)):(i.left-=(l-a)/2,i.top-=(u-o)/2);i.width=l,i.height=u,this.renderCanvas(!0)}return this},rotate:function(e){return this.rotateTo((this.imageData.rotate||0)+Number(e))},rotateTo:function(e){return e=Number(e),ke(e)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=e%360,this.renderCanvas(!0,!0)),this},scaleX:function(e){var t=this.imageData.scaleY;return this.scale(e,ke(t)?t:1)},scaleY:function(e){var t=this.imageData.scaleX;return this.scale(ke(t)?t:1,e)},scale:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=this.imageData,r=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.scalable&&(ke(e)&&(n.scaleX=e,r=!0),ke(t)&&(n.scaleY=t,r=!0),r&&this.renderCanvas(!0,!0)),this},getData:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.options,n=this.imageData,r=this.canvasData,i=this.cropBoxData,a;if(this.ready&&this.cropped){a={x:i.left-r.left,y:i.top-r.top,width:i.width,height:i.height};var o=n.width/n.naturalWidth;if(Re(a,function(e,t){a[t]=e/o}),e){var s=Math.round(a.y+a.height),c=Math.round(a.x+a.width);a.x=Math.round(a.x),a.y=Math.round(a.y),a.width=c-a.x,a.height=s-a.y}}else a={x:0,y:0,width:0,height:0};return t.rotatable&&(a.rotate=n.rotate||0),t.scalable&&(a.scaleX=n.scaleX||1,a.scaleY=n.scaleY||1),a},setData:function(e){var t=this.options,n=this.imageData,r=this.canvasData,i={};if(this.ready&&!this.disabled&&Pe(e)){var a=!1;t.rotatable&&ke(e.rotate)&&e.rotate!==n.rotate&&(n.rotate=e.rotate,a=!0),t.scalable&&(ke(e.scaleX)&&e.scaleX!==n.scaleX&&(n.scaleX=e.scaleX,a=!0),ke(e.scaleY)&&e.scaleY!==n.scaleY&&(n.scaleY=e.scaleY,a=!0)),a&&this.renderCanvas(!0,!0);var o=n.width/n.naturalWidth;ke(e.x)&&(i.left=e.x*o+r.left),ke(e.y)&&(i.top=e.y*o+r.top),ke(e.width)&&(i.width=e.width*o),ke(e.height)&&(i.height=e.height*o),this.setCropBoxData(i)}return this},getContainerData:function(){return this.ready?ze({},this.containerData):{}},getImageData:function(){return this.sized?ze({},this.imageData):{}},getCanvasData:function(){var e=this.canvasData,t={};return this.ready&&Re([`left`,`top`,`width`,`height`,`naturalWidth`,`naturalHeight`],function(n){t[n]=e[n]}),t},setCanvasData:function(e){var t=this.canvasData,n=t.aspectRatio;return this.ready&&!this.disabled&&Pe(e)&&(ke(e.left)&&(t.left=e.left),ke(e.top)&&(t.top=e.top),ke(e.width)?(t.width=e.width,t.height=e.width/n):ke(e.height)&&(t.height=e.height,t.width=e.height*n),this.renderCanvas(!0)),this},getCropBoxData:function(){var e=this.cropBoxData,t;return this.ready&&this.cropped&&(t={left:e.left,top:e.top,width:e.width,height:e.height}),t||{}},setCropBoxData:function(e){var t=this.cropBoxData,n=this.options.aspectRatio,r,i;return this.ready&&this.cropped&&!this.disabled&&Pe(e)&&(ke(e.left)&&(t.left=e.left),ke(e.top)&&(t.top=e.top),ke(e.width)&&e.width!==t.width&&(r=!0,t.width=e.width),ke(e.height)&&e.height!==t.height&&(i=!0,t.height=e.height),n&&(r?t.height=t.width/n:i&&(t.width=t.height*n)),this.renderCropBox()),this},getCroppedCanvas:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var t=this.canvasData,n=ht(this.image,this.imageData,t,e);if(!this.cropped)return n;var r=this.getData(e.rounded),i=r.x,a=r.y,o=r.width,s=r.height,c=n.width/Math.floor(t.naturalWidth);c!==1&&(i*=c,a*=c,o*=c,s*=c);var u=o/s,d=pt({aspectRatio:u,width:e.maxWidth||1/0,height:e.maxHeight||1/0}),f=pt({aspectRatio:u,width:e.minWidth||0,height:e.minHeight||0},`cover`),p=pt({aspectRatio:u,width:e.width||(c===1?o:n.width),height:e.height||(c===1?s:n.height)}),m=p.width,h=p.height;m=Math.min(d.width,Math.max(f.width,m)),h=Math.min(d.height,Math.max(f.height,h));var g=document.createElement(`canvas`),_=g.getContext(`2d`);g.width=Ve(m),g.height=Ve(h),_.fillStyle=e.fillColor||`transparent`,_.fillRect(0,0,m,h);var v=e.imageSmoothingEnabled,y=v===void 0?!0:v,b=e.imageSmoothingQuality;_.imageSmoothingEnabled=y,b&&(_.imageSmoothingQuality=b);var x=n.width,S=n.height,C=i,w=a,T,E,D,O,k,A;C<=-o||C>x?(C=0,T=0,D=0,k=0):C<=0?(D=-C,C=0,T=Math.min(x,o+C),k=T):C<=x&&(D=0,T=Math.min(o,x-C),k=T),T<=0||w<=-s||w>S?(w=0,E=0,O=0,A=0):w<=0?(O=-w,w=0,E=Math.min(S,s+w),A=E):w<=S&&(O=0,E=Math.min(s,S-w),A=E);var j=[C,w,T,E];if(k>0&&A>0){var M=m/o;j.push(D*M,O*M,k*M,A*M)}return _.drawImage.apply(_,[n].concat(l(j.map(function(e){return Math.floor(Ve(e))})))),g},setAspectRatio:function(e){var t=this.options;return!this.disabled&&!je(e)&&(t.aspectRatio=Math.max(0,e)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(e){var t=this.options,n=this.dragBox,r=this.face;if(this.ready&&!this.disabled){var i=e===ne,a=t.movable&&e===re;e=i||a?e:z,t.dragMode=e,Ze(n,R,e),qe(n,M,i),qe(n,ee,a),t.cropBoxMovable||(Ze(r,R,e),qe(r,M,i),qe(r,ee,a))}return this}},Ot=g.Cropper,kt=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(a(this,e),!t||!Ce.test(t.tagName))throw Error(`The first argument is required and must be an <img> or <canvas> element.`);this.element=t,this.options=ze({},Ee,Pe(n)&&n),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return s(e,[{key:`init`,value:function(){var e=this.element,t=e.tagName.toLowerCase(),n;if(!e[y]){if(e[y]=this,t===`img`){if(this.isImg=!0,n=e.getAttribute(`src`)||``,this.originalUrl=n,!n)return;n=e.src}else t===`canvas`&&window.HTMLCanvasElement&&(n=e.toDataURL());this.load(n)}}},{key:`load`,value:function(e){var t=this;if(e){this.url=e,this.imageData={};var n=this.element,r=this.options;if(!r.rotatable&&!r.scalable&&(r.checkOrientation=!1),!r.checkOrientation||!window.ArrayBuffer){this.clone();return}if(xe.test(e)){Se.test(e)?this.read(vt(e)):this.clone();return}var i=new XMLHttpRequest,a=this.clone.bind(this);this.reloading=!0,this.xhr=i,i.onabort=a,i.onerror=a,i.ontimeout=a,i.onprogress=function(){i.getResponseHeader(`content-type`)!==ye&&i.abort()},i.onload=function(){t.read(i.response)},i.onloadend=function(){t.reloading=!1,t.xhr=null},r.checkCrossOrigin&&st(e)&&n.crossOrigin&&(e=ct(e)),i.open(`GET`,e,!0),i.responseType=`arraybuffer`,i.withCredentials=n.crossOrigin===`use-credentials`,i.send()}}},{key:`read`,value:function(e){var t=this.options,n=this.imageData,r=bt(e),i=0,a=1,o=1;if(r>1){this.url=yt(e,ye);var s=xt(r);i=s.rotate,a=s.scaleX,o=s.scaleY}t.rotatable&&(n.rotate=i),t.scalable&&(n.scaleX=a,n.scaleY=o),this.clone()}},{key:`clone`,value:function(){var e=this.element,t=this.url,n=e.crossOrigin,r=t;this.options.checkCrossOrigin&&st(t)&&(n||=`anonymous`,r=ct(t)),this.crossOrigin=n,this.crossOriginUrl=r;var i=document.createElement(`img`);n&&(i.crossOrigin=n),i.src=r||t,i.alt=e.alt||`The image to crop`,this.image=i,i.onload=this.start.bind(this),i.onerror=this.stop.bind(this),Ge(i,F),e.parentNode.insertBefore(i,e.nextSibling)}},{key:`start`,value:function(){var e=this,t=this.image;t.onload=null,t.onerror=null,this.sizing=!0;var n=g.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(g.navigator.userAgent),r=function(t,n){ze(e.imageData,{naturalWidth:t,naturalHeight:n,aspectRatio:t/n}),e.initialImageData=ze({},e.imageData),e.sizing=!1,e.sized=!0,e.build()};if(t.naturalWidth&&!n){r(t.naturalWidth,t.naturalHeight);return}var i=document.createElement(`img`),a=document.body||document.documentElement;this.sizingImage=i,i.onload=function(){r(i.width,i.height),n||a.removeChild(i)},i.src=t.src,n||(i.style.cssText=`left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;`,a.appendChild(i))}},{key:`stop`,value:function(){var e=this.image;e.onload=null,e.onerror=null,e.parentNode.removeChild(e),this.image=null}},{key:`build`,value:function(){if(!(!this.sized||this.ready)){var e=this.element,t=this.options,n=this.image,r=e.parentNode,i=document.createElement(`div`);i.innerHTML=De;var a=i.querySelector(`.${y}-container`),o=a.querySelector(`.${y}-canvas`),s=a.querySelector(`.${y}-drag-box`),c=a.querySelector(`.${y}-crop-box`),l=c.querySelector(`.${y}-face`);this.container=r,this.cropper=a,this.canvas=o,this.dragBox=s,this.cropBox=c,this.viewBox=a.querySelector(`.${y}-view-box`),this.face=l,o.appendChild(n),Ge(e,P),r.insertBefore(a,e.nextSibling),Ke(n,F),this.initPreview(),this.bind(),t.initialAspectRatio=Math.max(0,t.initialAspectRatio)||NaN,t.aspectRatio=Math.max(0,t.aspectRatio)||NaN,t.viewMode=Math.max(0,Math.min(3,Math.round(t.viewMode)))||0,Ge(c,P),t.guides||Ge(c.getElementsByClassName(`${y}-dashed`),P),t.center||Ge(c.getElementsByClassName(`${y}-center`),P),t.background&&Ge(a,`${y}-bg`),t.highlight||Ge(l,I),t.cropBoxMovable&&(Ge(l,ee),Ze(l,R,b)),t.cropBoxResizable||(Ge(c.getElementsByClassName(`${y}-line`),P),Ge(c.getElementsByClassName(`${y}-point`),P)),this.render(),this.ready=!0,this.setDragMode(t.dragMode),t.autoCrop&&this.crop(),this.setData(t.data),Fe(t.ready)&&nt(e,he,t.ready,{once:!0}),rt(e,he)}}},{key:`unbuild`,value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var e=this.cropper.parentNode;e&&e.removeChild(this.cropper),Ke(this.element,P)}}},{key:`uncreate`,value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:`noConflict`,value:function(){return window.Cropper=Ot,e}},{key:`setDefaults`,value:function(e){ze(Ee,Pe(e)&&e)}}])}();return ze(kt.prototype,St,Ct,wt,Tt,Et,Dt),kt}))}))()),aq=function(){return aq=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},aq.apply(this,arguments)};function oq(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}var sq=`aspectRatio.autoCrop.autoCropArea.background.center.checkCrossOrigin.checkOrientation.cropBoxMovable.cropBoxResizable.data.dragMode.guides.highlight.initialAspectRatio.minCanvasHeight.minCanvasWidth.minContainerHeight.minContainerWidth.minCropBoxHeight.minCropBoxWidth.modal.movable.preview.responsive.restore.rotatable.scalable.toggleDragModeOnDblclick.viewMode.wheelZoomRatio.zoomOnTouch.zoomOnWheel.zoomable.cropstart.cropmove.cropend.crop.zoom.ready`.split(`.`),cq={opacity:0,maxWidth:`100%`};B.forwardRef((function(e,t){var n=oq(e,[]),r=n.dragMode,i=r===void 0?`crop`:r,a=n.src,o=n.style,s=n.className,c=n.crossOrigin,l=n.scaleX,u=n.scaleY,d=n.enable,f=n.zoomTo,p=n.rotateTo,m=n.alt,h=m===void 0?`picture`:m,g=n.ready,_=n.onInitialized,v=oq(n,[`dragMode`,`src`,`style`,`className`,`crossOrigin`,`scaleX`,`scaleY`,`enable`,`zoomTo`,`rotateTo`,`alt`,`ready`,`onInitialized`]),y={scaleY:u,scaleX:l,enable:d,zoomTo:f,rotateTo:p},b=function(){var e=[...arguments],t=(0,B.useRef)(null);return B.useEffect((function(){e.forEach((function(e){e&&(typeof e==`function`?e(t.current):e.current=t.current)}))}),[e]),t}(t,(0,B.useRef)(null));(0,B.useEffect)((function(){var e;(e=b.current)!=null&&e.cropper&&typeof f==`number`&&b.current.cropper.zoomTo(f)}),[n.zoomTo]),(0,B.useEffect)((function(){var e;(e=b.current)!=null&&e.cropper&&a!==void 0&&b.current.cropper.reset().clear().replace(a)}),[a]),(0,B.useEffect)((function(){if(b.current!==null){var e=new iq.default(b.current,aq(aq({dragMode:i},v),{ready:function(e){e.currentTarget!==null&&function(e,t){t===void 0&&(t={});var n=t.enable,r=n===void 0||n,i=t.scaleX,a=i===void 0?1:i,o=t.scaleY,s=o===void 0?1:o,c=t.zoomTo,l=c===void 0?0:c,u=t.rotateTo;r?e.enable():e.disable(),e.scaleX(a),e.scaleY(s),u!==void 0&&e.rotateTo(u),l>0&&e.zoomTo(l)}(e.currentTarget.cropper,y),g&&g(e)}}));_&&_(e)}return function(){var e;(e=b.current?.cropper)==null||e.destroy()}}),[b]);var x=function(e){return sq.reduce((function(e,t){var n=e,r=t;return n[r],oq(n,[typeof r==`symbol`?r:r+``])}),e)}(aq(aq({},v),{crossOrigin:c,src:a,alt:h}));return B.createElement(`div`,{style:o,className:s},B.createElement(`img`,aq({},x,{style:cq,ref:b})))})),{seconds:`seconds`,minutes:`minutes`}.minutes,B.Component,B.Component,B.Component,B.Component,B.Component;var lq=e=>{let t=vA.t(e.labelKey),n=e.helpKey?vA.t(e.helpKey):``;return e.type===`checkbox`?(0,V.jsxs)(aw,{sx:{display:`block`,mb:1},children:[(0,V.jsx)(dw,{control:(0,V.jsx)(zS,{checked:!!e.value,onChange:t=>e.onChange(t.target.checked)}),label:t}),n&&(0,V.jsx)(_w,{sx:{ml:4,mt:-.5},children:n})]}):e.type===`select`?(0,V.jsxs)(aw,{size:`small`,fullWidth:!0,sx:{mb:2},children:[(0,V.jsx)($w,{children:t}),(0,V.jsx)(nD,{value:e.value??``,label:t,onChange:t=>e.onChange(t.target.value),children:e.options.map(e=>(0,V.jsx)(bE,{value:e.value,children:vA.t(e.labelKey)},e.value))}),n&&(0,V.jsx)(_w,{children:n})]}):e.type===`number`?(0,V.jsx)(ZO,{label:t,type:`number`,value:e.value??``,size:`small`,fullWidth:!0,sx:{mb:2},inputProps:{min:e.min,max:e.max},onChange:t=>{let n=parseFloat(t.target.value);isNaN(n)||e.onChange(n)},helperText:n||` `}):(0,V.jsx)(ZO,{label:t,type:e.type===`password`?`password`:`text`,value:e.value??``,size:`small`,fullWidth:!0,sx:{mb:2},onChange:t=>e.onChange(t.target.value),helperText:n||` `})},uq=({textKey:e})=>(0,V.jsx)(Kv,{variant:`h6`,sx:{mt:2,mb:1,borderBottom:`1px solid`,borderColor:`divider`,pb:.5},children:vA.t(e)}),dq=({labelKey:e,helpKey:t,value:n,onChange:r})=>(0,V.jsxs)($x,{sx:{mb:2},children:[(0,V.jsx)(Kv,{variant:`caption`,display:`block`,sx:{mb:.5},children:vA.t(e)}),(0,V.jsxs)($x,{sx:{display:`flex`,alignItems:`center`,gap:1},children:[(0,V.jsx)(`input`,{type:`color`,value:n||`#888888`,onChange:e=>r(e.target.value),style:{width:48,height:32,cursor:`pointer`,border:`none`}}),(0,V.jsx)(ZO,{value:n??``,size:`small`,sx:{flex:1},onChange:e=>r(e.target.value),placeholder:`rgba(...) or #hex`})]}),t&&(0,V.jsx)(_w,{children:vA.t(t)})]}),fq=({native:e,onChange:t})=>(0,V.jsxs)(X,{container:!0,spacing:2,children:[(0,V.jsx)(X,{item:!0,xs:12,sm:12,md:6,lg:4,children:(0,V.jsx)(lq,{type:`text`,labelKey:`cfgIp`,value:e.ip??``,onChange:e=>t(`ip`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(lq,{type:`number`,labelKey:`cfgPort`,value:e.port??8090,min:1,max:65535,onChange:e=>t(`port`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(lq,{type:`text`,labelKey:`cfgUser`,value:e.user??``,onChange:e=>t(`user`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(lq,{type:`password`,labelKey:`cfgPass`,value:e.pass??``,onChange:e=>t(`pass`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(lq,{type:`number`,labelKey:`cfgPollSeconds`,helpKey:`cfgPollSeconds`,value:e.pollSeconds??30,min:5,max:3600,onChange:e=>t(`pollSeconds`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(lq,{type:`number`,labelKey:`cfgHttpTimeoutMs`,value:e.httpTimeoutMs??8e3,min:1e3,max:3e4,onChange:e=>t(`httpTimeoutMs`,e)})})]}),pq=({native:e,onChange:t})=>(0,V.jsxs)(`div`,{children:[(0,V.jsx)(uq,{textKey:`hdrControls`}),(0,V.jsxs)(X,{container:!0,spacing:1,children:[(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`checkbox`,labelKey:`cfgEnableSystemControls`,helpKey:`cfgEnableSystemControls_tt`,value:e.enableSystemControls,onChange:e=>t(`enableSystemControls`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`checkbox`,labelKey:`cfgEnablePtz`,helpKey:`cfgEnablePtz_tt`,value:e.enablePtz,onChange:e=>t(`enablePtz`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`checkbox`,labelKey:`cfgEnableUrls`,helpKey:`cfgEnableUrls_tt`,value:e.enableUrls,onChange:e=>t(`enableUrls`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`checkbox`,labelKey:`cfgEnableSnapshotB64`,helpKey:`cfgEnableSnapshotB64_tt`,value:e.enableSnapshotB64,onChange:e=>t(`enableSnapshotB64`,e)})})]}),(0,V.jsx)(uq,{textKey:`hdrEvents`}),(0,V.jsxs)(X,{container:!0,spacing:1,children:[(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`checkbox`,labelKey:`cfgEnableEventDps`,helpKey:`cfgEnableEventDps_tt`,value:e.enableEventDps,onChange:e=>t(`enableEventDps`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`checkbox`,labelKey:`cfgEnablePush`,helpKey:`cfgEnablePush_tt`,value:e.enablePush,onChange:e=>t(`enablePush`,e)})})]}),(0,V.jsx)(uq,{textKey:`hdrDisplay`}),(0,V.jsx)(X,{container:!0,spacing:1,children:(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`checkbox`,labelKey:`cfgEnableOverview`,helpKey:`cfgEnableOverview_tt`,value:e.enableOverview,onChange:e=>t(`enableOverview`,e)})})}),(0,V.jsx)(uq,{textKey:`hdrDebug`}),(0,V.jsx)(X,{container:!0,spacing:1,children:(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`checkbox`,labelKey:`cfgStoreRawJson`,helpKey:`cfgStoreRawJson_tt`,value:e.storeRawJson,onChange:e=>t(`storeRawJson`,e)})})})]}),mq=({native:e,onChange:t})=>(0,V.jsxs)(`div`,{children:[(0,V.jsx)(uq,{textKey:`hdrWidgetGeneral`}),(0,V.jsxs)(X,{container:!0,spacing:2,children:[(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`checkbox`,labelKey:`cfgEnableWidget`,helpKey:`cfgEnableWidget_tt`,value:e.enableWidget,onChange:e=>t(`enableWidget`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:6,lg:5,children:(0,V.jsx)(lq,{type:`select`,labelKey:`cfgWidgetMode`,helpKey:`cfgWidgetMode_tt`,value:e.widgetMode??`nojs`,onChange:e=>t(`widgetMode`,e),options:[{value:`nojs`,labelKey:`cfgWidgetModeNojs`},{value:`js`,labelKey:`cfgWidgetModeJs`}]})})]}),(0,V.jsx)(uq,{textKey:`hdrWidgetLayout`}),(0,V.jsxs)(X,{container:!0,spacing:2,children:[(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(lq,{type:`number`,labelKey:`cfgWidgetAnzahl`,helpKey:`cfgWidgetAnzahl_tt`,value:e.widgetAnzahl??20,min:1,max:500,onChange:e=>t(`widgetAnzahl`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(lq,{type:`number`,labelKey:`cfgWidgetMinCol`,helpKey:`cfgWidgetMinCol_tt`,value:e.widgetMinCol??150,min:80,max:600,onChange:e=>t(`widgetMinCol`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(lq,{type:`number`,labelKey:`cfgWidgetMaxModalWidth`,helpKey:`cfgWidgetMaxModalWidth_tt`,value:e.widgetMaxModalWidth??900,min:300,max:2e3,onChange:e=>t(`widgetMaxModalWidth`,e)})})]}),(0,V.jsx)(uq,{textKey:`hdrWidgetTags`}),(0,V.jsxs)(X,{container:!0,spacing:2,children:[(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`checkbox`,labelKey:`cfgWidgetShowTags`,helpKey:`cfgWidgetShowTags_tt`,value:e.widgetShowTags,onChange:e=>t(`widgetShowTags`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`select`,labelKey:`cfgWidgetTagPosition`,helpKey:`cfgWidgetTagPosition_tt`,value:e.widgetTagPosition??`bottom-left`,onChange:e=>t(`widgetTagPosition`,e),options:[{value:`top-left`,labelKey:`cfgTagPosTopLeft`},{value:`top-right`,labelKey:`cfgTagPosTopRight`},{value:`bottom-left`,labelKey:`cfgTagPosBotLeft`},{value:`bottom-right`,labelKey:`cfgTagPosBotRight`}]})})]}),(0,V.jsx)(uq,{textKey:`hdrWidgetFilter`}),(0,V.jsxs)(X,{container:!0,spacing:2,children:[(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`checkbox`,labelKey:`cfgWidgetSortNewest`,helpKey:`cfgWidgetSortNewest_tt`,value:e.widgetSortNewest!==!1,onChange:e=>t(`widgetSortNewest`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`checkbox`,labelKey:`cfgWidgetShowSearch`,helpKey:`cfgWidgetShowSearch_tt`,value:e.widgetShowSearch,onChange:e=>t(`widgetShowSearch`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`checkbox`,labelKey:`cfgWidgetCompact`,helpKey:`cfgWidgetCompact_tt`,value:e.widgetCompact,onChange:e=>t(`widgetCompact`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(lq,{type:`text`,labelKey:`cfgWidgetDefaultTag`,helpKey:`cfgWidgetDefaultTag_tt`,value:e.widgetDefaultTag??``,onChange:e=>t(`widgetDefaultTag`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(lq,{type:`select`,labelKey:`cfgWidgetThumbSize`,helpKey:`cfgWidgetThumbSize_tt`,value:e.widgetThumbSize??`medium`,onChange:e=>t(`widgetThumbSize`,e),options:[{value:`small`,labelKey:`cfgWidgetThumbSmall`},{value:`medium`,labelKey:`cfgWidgetThumbMedium`},{value:`large`,labelKey:`cfgWidgetThumbLarge`}]})})]}),(0,V.jsx)(uq,{textKey:`hdrWidgetPlayer`}),(0,V.jsxs)(X,{container:!0,spacing:2,children:[(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(lq,{type:`text`,labelKey:`cfgWidgetLiveAspect`,helpKey:`cfgWidgetLiveAspect_tt`,value:e.widgetLiveAspect??``,onChange:e=>t(`widgetLiveAspect`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:12,md:8,children:(0,V.jsx)(lq,{type:`text`,labelKey:`cfgWidgetPlayerUrl`,helpKey:`cfgWidgetPlayerUrl_tt`,value:e.widgetPlayerUrl??``,onChange:e=>t(`widgetPlayerUrl`,e)})})]}),(0,V.jsx)(uq,{textKey:`hdrWidgetTheme`}),(0,V.jsxs)(X,{container:!0,spacing:2,children:[(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:3,lg:2,children:(0,V.jsx)(dq,{labelKey:`cfgWidgetColorCardBg`,helpKey:`cfgWidgetColorCardBg_tt`,value:e.widgetColorCardBg??``,onChange:e=>t(`widgetColorCardBg`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:3,lg:2,children:(0,V.jsx)(dq,{labelKey:`cfgWidgetColorTagBg`,helpKey:`cfgWidgetColorTagBg_tt`,value:e.widgetColorTagBg??``,onChange:e=>t(`widgetColorTagBg`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:3,lg:2,children:(0,V.jsx)(dq,{labelKey:`cfgWidgetColorTagText`,helpKey:`cfgWidgetColorTagText_tt`,value:e.widgetColorTagText??``,onChange:e=>t(`widgetColorTagText`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:3,lg:2,children:(0,V.jsx)(dq,{labelKey:`cfgWidgetColorAccent`,helpKey:`cfgWidgetColorAccent_tt`,value:e.widgetColorAccent??``,onChange:e=>t(`widgetColorAccent`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:3,lg:2,children:(0,V.jsx)(dq,{labelKey:`cfgWidgetColorModalBg`,helpKey:`cfgWidgetColorModalBg_tt`,value:e.widgetColorModalBg??``,onChange:e=>t(`widgetColorModalBg`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:3,lg:2,children:(0,V.jsx)(lq,{type:`number`,labelKey:`cfgWidgetBorderRadius`,helpKey:`cfgWidgetBorderRadius_tt`,value:e.widgetBorderRadius??4,min:0,max:32,onChange:e=>t(`widgetBorderRadius`,e)})})]})]});function hq(e){let t=Array.isArray(e?.objectList)?e.objectList:[],n=[];for(let e of t){if(!e||typeof e!=`object`)continue;let t=e.id??e.oid;if(t==null)continue;let r=typeof e.name==`string`?e.name:`obj_${t}`;if((e.typeID??e.ot??e.objectTypeID??e.type)!==2)continue;let i=`cam_${String(t).replace(/[\s.[\]*?"'`,;:/\\]+/g,`_`).replace(/[^A-Za-z0-9_-]/g,`_`)}_${r.replace(/[\s.[\]*?"'`,;:/\\]+/g,`_`).replace(/[^A-Za-z0-9_-]/g,`_`).replace(/_+/g,`_`).replace(/^_+|_+$/g,``)||`x`}`;n.push({key:i,name:r})}return n.sort((e,t)=>e.name.localeCompare(t.name)),n}function gq(e){return!e||typeof e!=`object`?[]:Object.keys(e).sort()}var _q=({native:e,onChange:t,socket:n,instance:r})=>{let[i,a]=(0,B.useState)(null),[o,s]=(0,B.useState)([]),[c,l]=(0,B.useState)(null),[u,d]=(0,B.useState)(!1),f=e.cameraStreams||{},p=Object.values(f).some(e=>e&&e!==`mjpeg`&&e!==`mp4`);function m(e){return f[e]??`mjpeg`}function h(e,n){t(`cameraStreams`,{...f,[e]:n})}let g=(0,B.useCallback)(async()=>{let t=(e.ip||``).trim(),i=e.port||8090,o=(e.go2rtcUrl||``).trim();if(o=o.replace(/^https:\/\//i,`http://`),o&&!o.startsWith(`http://`)&&(o=`http://${o}`),!t){a([]),l(vA.t(`cfgIpMissing`));return}d(!0),l(null);try{let c=[],u=[],d=new AbortController,f=setTimeout(()=>d.abort(),4e3);try{let n=await fetch(`http://${t}:${i}/command/getObjects`,{signal:d.signal,headers:e.user?{Authorization:`Basic ${btoa(`${e.user}:${e.pass??``}`)}`}:{}});n.ok?c=hq(await n.json()):l(`AgentDVR: HTTP ${n.status}`)}catch(e){if(e?.name===`AbortError`)l(`AgentDVR: Timeout (4 s)`);else try{let t=await Promise.race([n.sendTo(`agent-dvr.${r}`,`getAgentDvrCameras`,null),new Promise(e=>setTimeout(()=>e(null),5e3))]);t?.cameras?.length?c=t.cameras:l(`AgentDVR: ${e?.message||e}`)}catch{l(`AgentDVR: ${e?.message||e}`)}}if(clearTimeout(f),o){let e=!1;try{let t=new AbortController,n=setTimeout(()=>t.abort(),4e3),r=await fetch(`${o}/api/streams`,{signal:t.signal});clearTimeout(n),r.ok&&(u=gq(await r.json()),e=!0)}catch{}if(!e)try{let e=await Promise.race([n.sendTo(`agent-dvr.${r}`,`getGo2rtcStreams`,{url:o}),new Promise(e=>setTimeout(()=>e({_timeout:!0}),6e3))]);e?._timeout?l(e=>`${e?`${e} | `:``}go2rtc: Timeout`):Array.isArray(e?.streams)&&(u=e.streams,u.length===0&&e.error&&l(t=>(t?`${t} | `:``)+e.error))}catch{}}a(c),s(u)}finally{d(!1)}},[e.ip,e.port,e.go2rtcUrl,e.user,e.pass,n,r]);return(0,B.useEffect)(()=>{let e=setTimeout(()=>void g(),600);return()=>clearTimeout(e)},[e.ip,e.port,e.go2rtcUrl,e.user,e.pass,g]),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(uq,{textKey:`hdrDashView`}),(0,V.jsxs)(X,{container:!0,spacing:2,children:[(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(lq,{type:`select`,labelKey:`cfgDashDefaultView`,helpKey:`cfgDashDefaultView_tt`,value:e.dashDefaultView??`live`,onChange:e=>t(`dashDefaultView`,e),options:[{value:`live`,labelKey:`cfgDashViewLive`},{value:`recordings`,labelKey:`cfgDashViewRec`}]})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`checkbox`,labelKey:`cfgDashShowOffline`,helpKey:`cfgDashShowOffline_tt`,value:e.dashShowOffline,onChange:e=>t(`dashShowOffline`,e)})})]}),(0,V.jsx)(uq,{textKey:`hdrDashGrid`}),(0,V.jsxs)(X,{container:!0,spacing:2,children:[(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:3,lg:2,children:(0,V.jsx)(lq,{type:`number`,labelKey:`cfgDashGridCols`,helpKey:`cfgDashGridCols_tt`,value:e.dashGridCols??0,min:0,max:8,onChange:e=>t(`dashGridCols`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`checkbox`,labelKey:`cfgDashBtnsVisible`,helpKey:`cfgDashBtnsVisible_tt`,value:e.dashBtnsVisible,onChange:e=>t(`dashBtnsVisible`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`select`,labelKey:`cfgDashTagPosition`,helpKey:`cfgDashTagPosition_tt`,value:e.dashTagPosition??`bottom-right`,onChange:e=>t(`dashTagPosition`,e),options:[{value:`top-left`,labelKey:`cfgTagPosTopLeft`},{value:`top-right`,labelKey:`cfgTagPosTopRight`},{value:`bottom-left`,labelKey:`cfgTagPosBotLeft`},{value:`bottom-right`,labelKey:`cfgTagPosBotRight`}]})})]}),(0,V.jsx)(uq,{textKey:`hdrDashStream`}),(0,V.jsxs)(X,{container:!0,spacing:2,children:[(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(lq,{type:`number`,labelKey:`cfgDashRefreshSec`,helpKey:`cfgDashRefreshSec_tt`,value:e.dashRefreshSec??60,min:10,max:600,onChange:e=>t(`dashRefreshSec`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`checkbox`,labelKey:`cfgDashStreamReconnect`,helpKey:`cfgDashStreamReconnect_tt`,value:e.dashStreamReconnect!==!1,onChange:e=>t(`dashStreamReconnect`,e)})})]}),(0,V.jsx)(uq,{textKey:`hdrDashTheme`}),(0,V.jsx)(X,{container:!0,spacing:2,children:[`dashColorBg`,`dashColorSurface`,`dashColorAccent`,`dashColorText`,`dashColorBorder`,`dashColorOnline`,`dashColorOffline`].map(n=>(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:3,lg:2,children:(0,V.jsx)(dq,{labelKey:`cfg${n.charAt(0).toUpperCase()}${n.slice(1)}`,helpKey:`cfg${n.charAt(0).toUpperCase()}${n.slice(1)}_tt`,value:e[n]??``,onChange:e=>t(n,e)})},n))}),(0,V.jsx)(uq,{textKey:`hdrCameraStreams`}),(0,V.jsxs)($x,{sx:{mb:1,display:`flex`,alignItems:`center`,gap:1},children:[(0,V.jsx)(Kv,{variant:`subtitle2`,color:`text.secondary`,sx:{flex:1},children:vA.t(`cfgGo2rtcMapping_tt`)}),(0,V.jsx)(TD,{title:vA.t(`reload`),children:(0,V.jsx)(Ev,{size:`small`,onClick:()=>void g(),disabled:u,children:u?(0,V.jsx)(bv,{size:18}):(0,V.jsx)(Rk,{})})})]}),c&&(0,V.jsx)(Rv,{severity:`warning`,sx:{mb:1},children:c}),u&&(0,V.jsxs)($x,{sx:{display:`flex`,alignItems:`center`,gap:1,mb:2},children:[(0,V.jsx)(bv,{size:16}),(0,V.jsx)(Kv,{variant:`caption`,children:vA.t(`loadingCamerasAndStreams`)})]}),i!==null&&i.length===0&&!u&&(0,V.jsx)(Rv,{severity:`info`,sx:{mb:2},children:vA.t(`cfgNoCamerasFound`)}),i!==null&&i.length>0&&(0,V.jsx)(oO,{component:z_,variant:`outlined`,sx:{mb:2},children:(0,V.jsxs)(WD,{size:`small`,children:[(0,V.jsx)(fO,{children:(0,V.jsxs)(wO,{children:[(0,V.jsx)(nO,{children:(0,V.jsx)(`strong`,{children:vA.t(`cfgCameraColumn`)})}),(0,V.jsx)(nO,{children:(0,V.jsx)(`strong`,{children:vA.t(`cfgStreamSourceColumn`)})})]})}),(0,V.jsx)(ZD,{children:i.map(e=>(0,V.jsxs)(wO,{hover:!0,children:[(0,V.jsx)(nO,{children:(0,V.jsxs)($x,{children:[(0,V.jsx)(Kv,{variant:`body2`,children:e.name}),(0,V.jsx)(Kv,{variant:`caption`,color:`text.secondary`,sx:{fontFamily:`monospace`},children:e.key})]})}),(0,V.jsx)(nO,{sx:{minWidth:240},children:(0,V.jsx)(aw,{size:`small`,fullWidth:!0,children:(0,V.jsxs)(nD,{value:m(e.key),onChange:t=>h(e.key,t.target.value),children:[(0,V.jsx)(bE,{value:`mjpeg`,children:(0,V.jsxs)($x,{sx:{display:`flex`,alignItems:`center`,gap:1},children:[`MJPEG`,(0,V.jsx)(ox,{label:`AgentDVR`,size:`small`,variant:`outlined`})]})}),(0,V.jsx)(bE,{value:`mp4`,children:(0,V.jsxs)($x,{sx:{display:`flex`,alignItems:`center`,gap:1},children:[`MP4 / FLV (mit Ton)`,(0,V.jsx)(ox,{label:`AgentDVR`,size:`small`,variant:`outlined`})]})}),o.length>0&&(0,V.jsx)(KC,{}),o.map(e=>(0,V.jsx)(bE,{value:e,children:(0,V.jsxs)($x,{sx:{display:`flex`,alignItems:`center`,gap:1},children:[e,(0,V.jsx)(ox,{label:`go2rtc`,size:`small`,color:`primary`,variant:`outlined`})]})},e))]})})})]},e.key))})]})}),p&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(uq,{textKey:`hdrGo2rtc`}),(0,V.jsx)(X,{container:!0,spacing:2,children:(0,V.jsx)(X,{item:!0,xs:12,sm:8,md:6,lg:5,children:(0,V.jsx)(lq,{type:`text`,labelKey:`cfgGo2rtcUrl`,helpKey:`cfgGo2rtcUrl_tt`,value:e.go2rtcUrl??``,onChange:e=>t(`go2rtcUrl`,e)})})})]})]})},vq=({native:e,onChange:t})=>(0,V.jsxs)(X,{container:!0,spacing:2,children:[(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(lq,{type:`number`,labelKey:`cfgMaxDepth`,value:e.maxDepth??6,min:1,max:10,onChange:e=>t(`maxDepth`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(lq,{type:`number`,labelKey:`cfgMaxArray`,value:e.maxArray??30,min:1,max:500,onChange:e=>t(`maxArray`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(lq,{type:`checkbox`,labelKey:`cfgEventTagsDynamic`,value:e.eventTagsDynamic,onChange:e=>t(`eventTagsDynamic`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:6,lg:4,children:(0,V.jsx)(lq,{type:`text`,labelKey:`cfgEventTagsIgnore`,value:e.eventTagsIgnore??``,onChange:e=>t(`eventTagsIgnore`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:6,lg:4,children:(0,V.jsx)(lq,{type:`text`,labelKey:`cfgEventTags`,value:e.eventTags??``,onChange:e=>t(`eventTags`,e)})})]}),yq={"agent-dvr adapter settings":`Agent DVR Adapter Settings`,tabConnection:`Connection`,tabFeatures:`Features`,tabWidget:`Widget`,tabAdvanced:`Advanced`,cfgIp:`AgentDVR IP Address`,cfgPort:`Port`,cfgUser:`Username (optional)`,cfgPass:`Password (optional)`,cfgPollSeconds:`Poll interval (seconds)`,cfgHttpTimeoutMs:`HTTP timeout (ms)`,cfgEnableSystemControls:`System control buttons`,cfgEnablePtz:`PTZ control buttons`,cfgEnableUrls:`Generate stream URLs`,cfgEnableEventDps:`Event data points`,cfgEnablePush:`Real-time push trigger`,cfgEnableOverview:`Overview widget (all cameras)`,cfgStoreRawJson:`Store raw API JSON`,cfgEnableWidget:`Gallery widget per camera`,cfgWidgetMode:`Widget mode`,cfgWidgetModeNojs:`Pure HTML/CSS (no JavaScript, compatible everywhere)`,cfgWidgetModeJs:`Full JS (search + tag filter, requires script execution)`,cfgWidgetAnzahl:`Max. recordings in gallery`,cfgWidgetMinCol:`Min. column width (px)`,cfgWidgetShowTags:`Show event tags`,cfgWidgetLiveAspect:`Live tile aspect ratio (e.g. 16/9, leave empty for auto)`,cfgWidgetTagPosition:`Tag badge position`,cfgTagPosTopLeft:`Top left`,cfgTagPosTopRight:`Top right`,cfgTagPosBotLeft:`Bottom left`,cfgTagPosBotRight:`Bottom right`,cfgWidgetMaxModalWidth:`Max. player width (px)`,cfgWidgetPlayerUrl:`External player URL (leave empty for built-in player)`,cfgMaxDepth:`Max. object flatten depth`,cfgMaxArray:`Max. array length to expand`,cfgEventTagsDynamic:`Auto-detect event tags from recordings`,cfgEventTagsIgnore:`Event tags to ignore (comma-separated)`,cfgEventTags:`Fixed event tags to always create (comma-separated)`,cfgEnableSnapshotB64:`Snapshot as Base64`,hdrControls:`Control Buttons`,hdrEvents:`Events & Push`,hdrDisplay:`Display`,hdrDebug:`Debug`,hdrWidgetGeneral:`Gallery Widget`,hdrWidgetLayout:`Layout`,hdrWidgetTags:`Tags`,hdrWidgetPlayer:`Livestream & Player`,cfgEnableSystemControls_tt:`Arm/Disarm/Restart buttons, profile selector and all system-wide control commands`,cfgEnablePtz_tt:`Hold switches for PTZ (left/right/up/down/zoom) per camera`,cfgEnableUrls_tt:`URL states for snapshot, MJPEG and MP4 stream per camera`,cfgEnableSnapshotB64_tt:`Save camera image as Base64 on every poll (photo.jpg, full resolution). Refresh button always present.`,cfgEnableEventDps_tt:`Mirror metadata of the last recording (filename, date, duration, tags)`,cfgEnablePush_tt:`Push trigger state is updated immediately when AgentDVR reports a new recording`,cfgEnableOverview_tt:`HTML state with all cameras as tile grid (for visualizations, dashboards etc.)`,cfgStoreRawJson_tt:`Write full getObjects response to system.raw_getObjects (useful for debugging)`,cfgEnableWidget_tt:`HTML gallery with the latest recordings per camera (for visualizations, dashboards etc.)`,cfgWidgetMode_tt:`Pure HTML/CSS compatible everywhere. Full JS with search field and tag filter (requires script execution).`,cfgWidgetAnzahl_tt:`Maximum number of recordings in the gallery per camera`,cfgWidgetMinCol_tt:`Minimum column width of the gallery grid in pixels`,cfgWidgetMaxModalWidth_tt:`Maximum width of the video player in the modal dialog in pixels`,cfgWidgetShowTags_tt:`Show event tags as colored badge labels on gallery tiles`,cfgWidgetTagPosition_tt:`Corner of the image where the tag badge appears`,cfgWidgetLiveAspect_tt:`Aspect ratio of the livestream tile e.g. 16/9. Leave empty for automatic.`,cfgWidgetPlayerUrl_tt:`URL of an external video player. Leave empty for built-in player.`,hdrWidgetFilter:`Filter & Sort`,cfgWidgetSortNewest:`Newest first`,cfgWidgetSortNewest_tt:`Sort recordings by date, newest first`,cfgWidgetShowSearch:`Show search field (JS mode only)`,cfgWidgetShowSearch_tt:`Show text search over date, tag and filename in JS mode`,cfgWidgetCompact:`Compact layout`,cfgWidgetCompact_tt:`Smaller spacing and font – more entries at a glance (works in both modes)`,cfgWidgetDefaultTag:`Default tag filter (empty = all)`,cfgWidgetDefaultTag_tt:`This tag is pre-selected on first load (JS mode only)`,cfgWidgetThumbSize:`Thumbnail size`,cfgWidgetThumbSize_tt:`Width of preview images in the gallery (overrides min. column width)`,cfgWidgetThumbSmall:`Small (120 px)`,cfgWidgetThumbMedium:`Medium (180 px)`,cfgWidgetThumbLarge:`Large (240 px)`,tabDashboard:`Live Dashboard`,hdrDashView:`View`,cfgDashDefaultView:`Default view on open`,cfgDashDefaultView_tt:`Which tab is active when the dashboard opens`,cfgDashViewLive:`Live view`,cfgDashViewRec:`Recordings`,cfgDashShowOffline:`Show offline cameras`,cfgDashShowOffline_tt:`Include cameras that are currently offline in the live grid`,hdrDashGrid:`Camera grid`,cfgDashGridCols:`Column count (0 = automatic)`,cfgDashGridCols_tt:`Force a fixed number of camera columns. 0 = optimal count is calculated automatically.`,hdrDashStream:`Stream & Refresh`,cfgDashRefreshSec:`Reload camera list every (seconds)`,cfgDashRefreshSec_tt:`How often the camera list is reloaded from the server (0 = no automatic reload)`,cfgDashStreamReconnect:`Auto-reconnect stream on error`,cfgDashStreamReconnect_tt:`Automatically restart the MJPEG stream after a connection drop`,hdrWidgetTheme:`Colors & Design`,cfgWidgetColorCardBg:`Tile background`,cfgWidgetColorCardBg_tt:`Background color of thumbnail tiles – rgba(r,g,b,a) or #hex`,cfgWidgetColorTagBg:`Tag badge background`,cfgWidgetColorTagBg_tt:`Background color of the tag badge`,cfgWidgetColorTagText:`Tag badge text color`,cfgWidgetColorTagText_tt:`Text color of the tag badge`,cfgWidgetColorAccent:`Accent color`,cfgWidgetColorAccent_tt:`Accent color for links and buttons in the widget`,cfgWidgetColorModalBg:`Modal background`,cfgWidgetColorModalBg_tt:`Background color of the video player dialog`,cfgWidgetBorderRadius:`Border radius (px)`,cfgWidgetBorderRadius_tt:`Corner radius of thumbnail tiles in pixels (0 = square)`,hdrDashTheme:`Colors & Design`,cfgDashColorBg:`Background`,cfgDashColorBg_tt:`Main background color of the dashboard`,cfgDashColorSurface:`Surface / Cards`,cfgDashColorSurface_tt:`Background color of tiles and cards`,cfgDashColorAccent:`Accent color`,cfgDashColorAccent_tt:`Main accent color (buttons, active elements, borders)`,cfgDashColorText:`Text color`,cfgDashColorText_tt:`Primary text color`,cfgDashColorBorder:`Border color`,cfgDashColorBorder_tt:`Color of dividers and borders`,cfgDashColorOnline:`Online color`,cfgDashColorOnline_tt:`Color of the online status indicator`,cfgDashColorOffline:`Offline color`,cfgDashColorOffline_tt:`Color of the offline status indicator`,cfgDashTagPosition:`Tag badge position`,cfgDashTagPosition_tt:`Corner of the recording tile where the tag badge appears`,cfgDashBtnsVisible:`Buttons always visible`,cfgDashBtnsVisible_tt:`Always show record and PTZ buttons on camera tile (otherwise only visible on hover)`,hdrCameraStreams:`Stream Assignment`,hdrGo2rtc:`go2rtc WebRTC Streams`,cfgGo2rtcUrl:`go2rtc URL`,cfgGo2rtcUrl_tt:`Base URL of the go2rtc server, e.g. http://192.168.1.1:1984`,cfgGo2rtcMapping_tt:`Select the stream source per camera: MJPEG or MP4/FLV (via AgentDVR) or a go2rtc stream.`,cfgIpMissing:`AgentDVR IP address is required`,cfgNoCamerasFound:`No cameras found — is the adapter configured and has it polled at least once?`,loadingCamerasAndStreams:`Loading cameras and streams…`,cfgCameraColumn:`AgentDVR Camera`,cfgStreamSourceColumn:`Stream Source`,reload:`Reload`},bq={"agent-dvr adapter settings":`Agent DVR Adapter-Einstellungen`,tabConnection:`Verbindung`,tabFeatures:`Funktionen`,tabWidget:`Widget`,tabAdvanced:`Erweitert`,cfgIp:`AgentDVR IP-Adresse`,cfgPort:`Port`,cfgUser:`Benutzername (optional)`,cfgPass:`Passwort (optional)`,cfgPollSeconds:`Abfrageintervall (Sekunden)`,cfgHttpTimeoutMs:`HTTP-Timeout (ms)`,cfgEnableSystemControls:`Systemsteuerungs-Schaltflächen`,cfgEnablePtz:`PTZ-Steuerungs-Schaltflächen`,cfgEnableUrls:`Stream-URLs generieren`,cfgEnableEventDps:`Ereignis-Datenpunkte`,cfgEnablePush:`Echtzeit-Push-Trigger`,cfgEnableOverview:`Übersichts-Widget (alle Kameras)`,cfgStoreRawJson:`Rohes API-JSON speichern`,cfgEnableWidget:`Galerie-Widget pro Kamera`,cfgWidgetMode:`Widget-Modus`,cfgWidgetModeNojs:`Reines HTML/CSS (kein JavaScript, überall kompatibel)`,cfgWidgetModeJs:`Vollständiges JS (Suche + Tag-Filter, erfordert Skriptausführung)`,cfgWidgetAnzahl:`Max. Aufnahmen in der Galerie`,cfgWidgetMinCol:`Min. Spaltenbreite (px)`,cfgWidgetShowTags:`Ereignis-Tags anzeigen`,cfgWidgetLiveAspect:`Seitenverhältnis Live-Kachel (z.B. 16/9, leer lassen für automatisch)`,cfgWidgetTagPosition:`Tag-Badge-Position`,cfgTagPosTopLeft:`Oben links`,cfgTagPosTopRight:`Oben rechts`,cfgTagPosBotLeft:`Unten links`,cfgTagPosBotRight:`Unten rechts`,cfgWidgetMaxModalWidth:`Max. Player-Breite (px)`,cfgWidgetPlayerUrl:`Externer Player-URL (leer lassen für eingebauten Player)`,cfgMaxDepth:`Max. Objekt-Abflachungstiefe`,cfgMaxArray:`Max. Array-Länge zum Erweitern`,cfgEventTagsDynamic:`Ereignis-Tags automatisch aus Aufnahmen erkennen`,cfgEventTagsIgnore:`Zu ignorierende Ereignis-Tags (kommagetrennt)`,cfgEventTags:`Feste Ereignis-Tags, die immer erstellt werden (kommagetrennt)`,cfgEnableSnapshotB64:`Snapshot als Base64`,hdrControls:`Steuerbuttons`,hdrEvents:`Ereignisse & Push`,hdrDisplay:`Darstellung`,hdrDebug:`Debug`,hdrWidgetGeneral:`Galerie-Widget`,hdrWidgetLayout:`Layout`,hdrWidgetTags:`Tags`,hdrWidgetPlayer:`Livestream & Player`,cfgEnableSystemControls_tt:`Arm/Disarm/Neustart-Buttons, Profil-Selektor und alle systemweiten Steuerbefehle`,cfgEnablePtz_tt:`Hold-Switches für PTZ (links/rechts/oben/unten/Zoom) pro Kamera`,cfgEnableUrls_tt:`URL-States für Snapshot, MJPEG und MP4-Stream pro Kamera`,cfgEnableSnapshotB64_tt:`Kamerabild als Base64 bei jedem Poll speichern (photo.jpg, volle Auflösung). Refresh-Button immer vorhanden.`,cfgEnableEventDps_tt:`Metadaten der letzten Aufnahme spiegeln (Dateiname, Datum, Dauer, Tags)`,cfgEnablePush_tt:`Push-Trigger-State wird sofort aktualisiert wenn AgentDVR eine neue Aufnahme meldet`,cfgEnableOverview_tt:`HTML-State mit allen Kameras als Kachelraster (für Visualisierungen, Dashboards etc.)`,cfgStoreRawJson_tt:`Vollständige getObjects-Antwort in system.raw_getObjects schreiben (nützlich für Debugging)`,cfgEnableWidget_tt:`HTML-Galerie mit den letzten Aufnahmen pro Kamera (für Visualisierungen, Dashboards etc.)`,cfgWidgetMode_tt:`Pure HTML/CSS überall kompatibel. Full JS mit Suchfeld und Tag-Filter (benötigt Script-Ausführung).`,cfgWidgetAnzahl_tt:`Maximale Anzahl Aufnahmen in der Galerie pro Kamera`,cfgWidgetMinCol_tt:`Minimale Spaltenbreite des Galerie-Grids in Pixeln`,cfgWidgetMaxModalWidth_tt:`Maximale Breite des Video-Players im Modal-Dialog in Pixeln`,cfgWidgetShowTags_tt:`Event-Tags als farbige Badge-Labels auf den Galerie-Kacheln anzeigen`,cfgWidgetTagPosition_tt:`Ecke des Bildes wo der Tag-Badge erscheint`,cfgWidgetLiveAspect_tt:`Seitenverhältnis der Livestream-Kachel z.B. 16/9. Leer lassen für automatisch.`,cfgWidgetPlayerUrl_tt:`URL eines externen Video-Players. Leer lassen für eingebauten Player.`,hdrWidgetFilter:`Filter & Sortierung`,cfgWidgetSortNewest:`Neueste zuerst`,cfgWidgetSortNewest_tt:`Aufnahmen nach Datum sortieren, neueste zuerst`,cfgWidgetShowSearch:`Suchfeld anzeigen (nur JS-Modus)`,cfgWidgetShowSearch_tt:`Textsuche über Datum, Tag und Dateiname im JS-Modus einblenden`,cfgWidgetCompact:`Kompaktes Layout`,cfgWidgetCompact_tt:`Kleinere Abstände und Schrift – mehr Einträge auf einen Blick (wirkt in beiden Modi)`,cfgWidgetDefaultTag:`Standard-Tag-Filter (leer = alle)`,cfgWidgetDefaultTag_tt:`Dieser Tag ist beim ersten Laden vorausgewählt (nur JS-Modus)`,cfgWidgetThumbSize:`Thumbnail-Größe`,cfgWidgetThumbSize_tt:`Breite der Vorschaubilder in der Galerie (überschreibt Min. Spaltenbreite)`,cfgWidgetThumbSmall:`Klein (120 px)`,cfgWidgetThumbMedium:`Mittel (180 px)`,cfgWidgetThumbLarge:`Groß (240 px)`,tabDashboard:`Live-Dashboard`,hdrDashView:`Ansicht`,cfgDashDefaultView:`Standard-Ansicht beim Öffnen`,cfgDashDefaultView_tt:`Welcher Tab beim Öffnen des Dashboards aktiv ist`,cfgDashViewLive:`Live-Ansicht`,cfgDashViewRec:`Aufnahmen`,cfgDashShowOffline:`Offline-Kameras anzeigen`,cfgDashShowOffline_tt:`Kameras die gerade offline sind trotzdem im Live-Grid einblenden`,hdrDashGrid:`Kamera-Grid`,cfgDashGridCols:`Spaltenanzahl (0 = automatisch)`,cfgDashGridCols_tt:`Anzahl Kamera-Spalten fest vorgeben. 0 = optimale Anzahl wird automatisch berechnet.`,hdrDashStream:`Stream & Aktualisierung`,cfgDashRefreshSec:`Kameraliste neu laden alle (Sekunden)`,cfgDashRefreshSec_tt:`Wie oft die Kameraliste vom Server neu geladen wird (0 = kein automatischer Reload)`,cfgDashStreamReconnect:`Stream bei Fehler automatisch neu verbinden`,cfgDashStreamReconnect_tt:`MJPEG-Stream wird nach einem Verbindungsabbruch automatisch neu gestartet`,hdrWidgetTheme:`Farben & Design`,cfgWidgetColorCardBg:`Kachel-Hintergrund`,cfgWidgetColorCardBg_tt:`Hintergrundfarbe der Vorschaukacheln – rgba(r,g,b,a) oder #hex`,cfgWidgetColorTagBg:`Tag-Badge-Hintergrund`,cfgWidgetColorTagBg_tt:`Hintergrundfarbe des Tag-Badges`,cfgWidgetColorTagText:`Tag-Badge-Textfarbe`,cfgWidgetColorTagText_tt:`Textfarbe des Tag-Badges`,cfgWidgetColorAccent:`Akzentfarbe`,cfgWidgetColorAccent_tt:`Akzentfarbe für Links und Buttons im Widget`,cfgWidgetColorModalBg:`Modal-Hintergrund`,cfgWidgetColorModalBg_tt:`Hintergrundfarbe des Video-Player-Dialogs`,cfgWidgetBorderRadius:`Eckenradius (px)`,cfgWidgetBorderRadius_tt:`Abrundungsradius der Vorschaukacheln in Pixeln (0 = eckig)`,hdrDashTheme:`Farben & Design`,cfgDashColorBg:`Hintergrund`,cfgDashColorBg_tt:`Haupthintergrundfarbe des Dashboards`,cfgDashColorSurface:`Oberfläche / Karten`,cfgDashColorSurface_tt:`Hintergrundfarbe von Kacheln und Karten`,cfgDashColorAccent:`Akzentfarbe`,cfgDashColorAccent_tt:`Hauptakzentfarbe (Buttons, aktive Elemente, Rahmen)`,cfgDashColorText:`Textfarbe`,cfgDashColorText_tt:`Primäre Textfarbe`,cfgDashColorBorder:`Rahmenfarbe`,cfgDashColorBorder_tt:`Farbe von Trennlinien und Rahmen`,cfgDashColorOnline:`Online-Farbe`,cfgDashColorOnline_tt:`Farbe des Online-Status-Indikators`,cfgDashColorOffline:`Offline-Farbe`,cfgDashColorOffline_tt:`Farbe des Offline-Status-Indikators`,cfgDashTagPosition:`Tag-Badge-Position`,cfgDashTagPosition_tt:`Ecke der Aufnahme-Kachel, in der der Tag-Badge erscheint`,cfgDashBtnsVisible:`Buttons immer sichtbar`,cfgDashBtnsVisible_tt:`Aufnahme- und PTZ-Button immer anzeigen (sonst nur bei Hover)`,hdrCameraStreams:`Stream-Zuweisung`,hdrGo2rtc:`go2rtc WebRTC-Streams`,cfgGo2rtcUrl:`go2rtc URL`,cfgGo2rtcUrl_tt:`Basis-URL des go2rtc-Servers, z. B. http://192.168.1.1:1984`,cfgGo2rtcMapping_tt:`Wähle die Stream-Quelle je Kamera: MJPEG oder MP4/FLV (über AgentDVR) oder ein go2rtc-Stream.`,cfgIpMissing:`AgentDVR-IP-Adresse ist erforderlich`,cfgNoCamerasFound:`Keine Kameras gefunden — Adapter konfiguriert und mindestens einmal gepollt?`,loadingCamerasAndStreams:`Lade Kameras und Streams…`,cfgCameraColumn:`AgentDVR Kamera`,cfgStreamSourceColumn:`Stream-Quelle`,reload:`Neu laden`},xq=class extends NA{constructor(e){super(e,{encryptedFields:[`pass`],Connection:Gs,translations:{en:yq,de:bq}})}render(){if(!this.state.loaded)return super.render();let e=this.state.tab??0,t=this.state.native,n=(e,n)=>{this.setState({native:{...t,[e]:n},changed:this.getIsChanged({...t,[e]:n})})};return(0,V.jsx)(en,{injectFirst:!0,children:(0,V.jsx)(Ts,{theme:this.state.theme,children:(0,V.jsxs)($x,{sx:{display:`flex`,flexDirection:`column`,height:`100%`,overflow:`hidden`,bgcolor:`background.default`,color:`text.primary`},children:[(0,V.jsx)($x,{sx:{borderBottom:1,borderColor:`divider`,px:2},children:(0,V.jsxs)(KO,{value:e,onChange:(e,t)=>this.setState({tab:t}),children:[(0,V.jsx)(RD,{label:vA.t(`tabConnection`)}),(0,V.jsx)(RD,{label:vA.t(`tabFeatures`)}),(0,V.jsx)(RD,{label:vA.t(`tabWidget`)}),(0,V.jsx)(RD,{label:vA.t(`tabDashboard`)}),(0,V.jsx)(RD,{label:vA.t(`tabAdvanced`)})]})}),(0,V.jsxs)($x,{sx:{flex:1,overflowY:`auto`,p:2,pb:12},children:[e===0&&(0,V.jsx)(fq,{native:t,onChange:n}),e===1&&(0,V.jsx)(pq,{native:t,onChange:n}),e===2&&(0,V.jsx)(mq,{native:t,onChange:n}),e===3&&(0,V.jsx)(_q,{native:t,onChange:n,socket:this.socket,instance:this.instance??0}),e===4&&(0,V.jsx)(vq,{native:t,onChange:n})]}),this.renderError(),this.renderSaveCloseButtons()]})})})}};window.adapterName=`agent-dvr`,window.sentryDSN=``;var Sq=document.getElementById(`root`);Sq&&(0,Es.createRoot)(Sq).render((0,V.jsx)(xq,{}));
@@ -131,5 +131,9 @@
131
131
  "cfgGo2rtcUrl_tt": "Basis-URL des go2rtc-Servers, z. B. http://192.168.1.1:1984",
132
132
  "cfgGo2rtcMapping_tt": "Wähle die Stream-Quelle je Kamera: MJPEG oder MP4/FLV (über AgentDVR) oder ein go2rtc-Stream.",
133
133
  "cfgIpMissing": "AgentDVR-IP-Adresse ist erforderlich",
134
- "cfgNoCamerasFound": "Keine Kameras gefunden — Adapter konfiguriert und mindestens einmal gepollt?"
135
- }
134
+ "cfgNoCamerasFound": "Keine Kameras gefunden — Adapter konfiguriert und mindestens einmal gepollt?",
135
+ "loadingCamerasAndStreams": "Lade Kameras und Streams…",
136
+ "cfgCameraColumn": "AgentDVR Kamera",
137
+ "cfgStreamSourceColumn": "Stream-Quelle",
138
+ "reload": "Neu laden"
139
+ }
@@ -131,5 +131,9 @@
131
131
  "cfgGo2rtcUrl_tt": "Base URL of the go2rtc server, e.g. http://192.168.1.1:1984",
132
132
  "cfgGo2rtcMapping_tt": "Select the stream source per camera: MJPEG or MP4/FLV (via AgentDVR) or a go2rtc stream.",
133
133
  "cfgIpMissing": "AgentDVR IP address is required",
134
- "cfgNoCamerasFound": "No cameras found — is the adapter configured and has it polled at least once?"
135
- }
134
+ "cfgNoCamerasFound": "No cameras found — is the adapter configured and has it polled at least once?",
135
+ "loadingCamerasAndStreams": "Loading cameras and streams…",
136
+ "cfgCameraColumn": "AgentDVR Camera",
137
+ "cfgStreamSourceColumn": "Stream Source",
138
+ "reload": "Reload"
139
+ }