iobroker.agent-dvr 0.6.0 → 0.7.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
@@ -408,7 +408,7 @@ Kamera-ID anhängen, damit der Adapter weiß, welche Kamera ausgelöst hat:
408
408
  GET http://<iobroker>:<webport>/agent-dvr.0/webhook?oid={ID}&ot={OT}
409
409
  ```
410
410
 
411
- `{ID}` und `{OT}` sind AgentDVR-Tags und werden von AgentDVR ersetzt. Der Adapter setzt dann **sofort** `<cam>.events.webhook` kurz auf `true` — noch bevor Daten abgeholt werden — und fragt danach alles ab. Die Action auf *Bewegung erkannt* legen. Mit aktivierten Alarmfotos wird das Foto sofort gespeichert — den passenden Trigger zeigt [Bilder für VIS und Skripte](#bilder-für-vis-und-skripte). AgentDVR ruft die Action oft mehrfach pro Bewegung auf; weitere Aufrufe derselben Kamera innerhalb von 20 s aktualisieren nur die Daten und lösen nicht erneut aus.
411
+ `{ID}` und `{OT}` sind AgentDVR-Tags und werden von AgentDVR ersetzt. Der Adapter setzt dann **sofort** `<cam>.events.webhook` kurz auf `true` — noch bevor Daten abgeholt werden — und fragt danach alles ab. Die Action auf *Bewegung erkannt* legen. Mit aktivierten Alarmfotos wird das Foto sofort gespeichert — den passenden Trigger zeigt [Bilder für VIS und Skripte](#bilder-für-vis-und-skripte). AgentDVR ruft die Action oft mehrfach pro Bewegung auf; weitere Aufrufe derselben Kamera innerhalb von 20 s aktualisieren nur die Daten und lösen nicht erneut aus. `<cam>.events.webhookParams` enthält alle Parameter des letzten Aufrufs als JSON (plus `ts`), geschrieben vor dem Puls und auch während der Sperrzeit — beliebige AgentDVR-Tags an die URL hängen (z. B. `&ai={AI}&zone={ZONE}&name={NAME}`) und im eigenen Skript auswerten.
412
412
 
413
413
  Ohne `oid` löst der Webhook nur einen vollständigen Poll aus. URL-Parameter landen auf Debug-Ebene im Log der Web-Instanz.
414
414
 
@@ -421,6 +421,7 @@ Mit **Alarmfotos speichern** (Standard: an) legt jeder Webhook-Aufruf mit `?oid=
421
421
  | Datenpunkt | Inhalt |
422
422
  |---|---|
423
423
  | `<cam>.alertPhotos.grab1` … `grab3` | Absoluter Dateipfad des Fotos (`grab1` = neuestes) |
424
+ | `<cam>.alertPhotos.url1` … `url3` | http(s)-Link über die Web-Instanz, z. B. `http://192.168.1.10:8082/agent-dvr.0/photos/cam_8_Reolink/grab1.jpg` — für TV-, Kiosk- oder andere Apps, die nur Web-Links annehmen |
424
425
  | `<cam>.alertPhotos.uri1` … `uri3` | ioBroker-Datei-URI, z. B. `iobfile://agent-dvr.0/cam_8_Reolink/grab1.jpg` |
425
426
  | `<cam>.alertPhotos.ts1` … `ts3` | Zeitpunkt des Fotos |
426
427
 
@@ -479,7 +480,7 @@ Die Datei selbst im Skript lesen: `readFile('agent-dvr.0', 'cam_8_Reolink/grab1.
479
480
 
480
481
  ### VIS / Dashboards
481
482
 
482
- Die Alarmfotos liefert die Web-Instanz aus:
483
+ Die Alarmfotos liefert die Web-Instanz aus — der fertige Link steht in `<cam>.alertPhotos.url1` … `url3`. Der Adapter nimmt eine aktive Web-Instanz (bevorzugt `http`, weil TV-Apps selbst signierte Zertifikate oft ablehnen) und die IPv4-Adresse des Hosts. Die Web-Instanz lässt sich in den Einstellungen auch fest wählen (*Funktionen → Web-Instanz für Foto-Links*). Ändert sich eine Web-Instanz (Port, https, Bind-Adresse, aktiviert) oder die Host-Adresse, werden die Links automatisch neu geschrieben. Die Links bleiben bei jedem neuen Foto gleich und können einmal in einer App eingetragen werden:
483
484
 
484
485
  ```
485
486
  http://<iobroker>:<webport>/agent-dvr.0/photos/<cam>/grab1.jpg
@@ -493,6 +494,11 @@ z. B. `http://192.168.1.10:8082/agent-dvr.0/photos/cam_8_Reolink/grab1.jpg` (ebe
493
494
  Placeholder for the next version (at the beginning of the line):
494
495
  ### **WORK IN PROGRESS**
495
496
  -->
497
+ ### 0.7.0 (2026-10-29)
498
+ * (ipod86) feat: `alertPhotos.url1–3` mit festem http(s)-Link zu jedem Foto, für TV-/Kiosk-Apps, die nur Web-Links annehmen; Web-Instanz wählbar, Links folgen Änderungen an den Web-Instanzen
499
+ * (ipod86) feat: `<cam>.events.webhookParams` mit allen Parametern des letzten Webhook-Aufrufs als JSON
500
+
501
+ <!-- markdownlint-disable-next-line MD024 -->
496
502
  ### 0.6.0 (2026-10-29)
497
503
  * (ipod86) fix: `events.detected_*` wird jetzt auch gesetzt, wenn AgentDVR den KI-Tag (z. B. `people`) erst nachträglich zur Aufnahme hinzufügt
498
504
  * (ipod86) feat: Webhook mit `?oid={ID}&ot={OT}` setzt sofort `<cam>.events.webhook` (20 s Sperrzeit pro Kamera) für das schnellstmögliche Alarmfoto
package/README.md CHANGED
@@ -413,7 +413,7 @@ Append the camera ID so the adapter knows which camera fired:
413
413
  GET http://<iobroker>:<webport>/agent-dvr.0/webhook?oid={ID}&ot={OT}
414
414
  ```
415
415
 
416
- `{ID}` and `{OT}` are AgentDVR tags and are filled in by AgentDVR. The adapter then pulses `<cam>.events.webhook` **immediately** — before any data is fetched — and polls afterwards. Use the action on *motion detected*. With alert photos enabled the photo is stored right away — see [Getting images for VIS and scripts](#getting-images-for-vis-and-scripts) for the right trigger. AgentDVR often calls the action several times per motion; further calls for the same camera within 20 s only refresh the data and do not pulse again.
416
+ `{ID}` and `{OT}` are AgentDVR tags and are filled in by AgentDVR. The adapter then pulses `<cam>.events.webhook` **immediately** — before any data is fetched — and polls afterwards. Use the action on *motion detected*. With alert photos enabled the photo is stored right away — see [Getting images for VIS and scripts](#getting-images-for-vis-and-scripts) for the right trigger. AgentDVR often calls the action several times per motion; further calls for the same camera within 20 s only refresh the data and do not pulse again. `<cam>.events.webhookParams` holds all parameters of the latest call as JSON (plus `ts`), written before the pulse and also during the cooldown — add any AgentDVR tags you need to the URL (e.g. `&ai={AI}&zone={ZONE}&name={NAME}`) and evaluate them in your own script.
417
417
 
418
418
  Without `oid` the webhook only triggers a full poll. Query parameters are written to the web instance log at debug level.
419
419
 
@@ -426,6 +426,7 @@ With **Save alert photos** enabled (default), every webhook call with `?oid={ID}
426
426
  | Data point | Content |
427
427
  |---|---|
428
428
  | `<cam>.alertPhotos.grab1` … `grab3` | Absolute file path of the photo (`grab1` = newest) |
429
+ | `<cam>.alertPhotos.url1` … `url3` | http(s) URL via the web instance, e.g. `http://192.168.1.10:8082/agent-dvr.0/photos/cam_8_Reolink/grab1.jpg` — for TV, kiosk or other apps that only accept web links |
429
430
  | `<cam>.alertPhotos.uri1` … `uri3` | ioBroker file URI, e.g. `iobfile://agent-dvr.0/cam_8_Reolink/grab1.jpg` |
430
431
  | `<cam>.alertPhotos.ts1` … `ts3` | Time of the photo |
431
432
 
@@ -484,7 +485,7 @@ Reading the file itself in a script: `readFile('agent-dvr.0', 'cam_8_Reolink/gra
484
485
 
485
486
  ### VIS / dashboards
486
487
 
487
- The alert photos are served by the web instance:
488
+ The alert photos are served by the web instance — the ready-made link is in `<cam>.alertPhotos.url1` … `url3`. The adapter picks an enabled web instance (plain `http` preferred, since TV apps often reject self-signed certificates) and the host's IPv4 address. The web instance can also be chosen in the settings (*Features → Web instance for photo links*). When a web instance changes (port, https, bind address, enabled) or the host address changes, the links are rewritten automatically. The links stay the same for every new photo, so you can enter them once in an app:
488
489
 
489
490
  ```
490
491
  http://<iobroker>:<webport>/agent-dvr.0/photos/<cam>/grab1.jpg
@@ -493,6 +494,11 @@ http://<iobroker>:<webport>/agent-dvr.0/photos/<cam>/grab1.jpg
493
494
  e.g. `http://192.168.1.10:8082/agent-dvr.0/photos/cam_8_Reolink/grab1.jpg` (also `grab2.jpg`, `grab3.jpg`). Use it in an image widget and refresh it on changes of `alertPhotos.ts1`. For a live image use `urls.snapshot` or `urls.photo` with a refresh interval.
494
495
 
495
496
  ## Changelog
497
+ ### 0.7.0 (2026-10-29)
498
+ * (ipod86) feat: `alertPhotos.url1–3` with a fixed http(s) link to each photo, for TV/kiosk apps that only accept web links; web instance selectable, links follow changes of the web instances
499
+ * (ipod86) feat: `<cam>.events.webhookParams` with all parameters of the latest webhook call as JSON
500
+
501
+ <!-- markdownlint-disable-next-line MD024 -->
496
502
  ### 0.6.0 (2026-10-29)
497
503
  * (ipod86) chore: clearer adapter title ("Agent DVR – Cameras & Recordings") and keywords
498
504
  * (ipod86) fix: `events.detected_*` now also fires when AgentDVR adds the AI tag (e.g. `people`) to a recording after it was first listed
@@ -521,9 +527,6 @@ e.g. `http://192.168.1.10:8082/agent-dvr.0/photos/cam_8_Reolink/grab1.jpg` (also
521
527
  ### 0.5.3 (2026-10-04)
522
528
  * (ipod86) fix: clear ensuredFolders cache on object deletion to prevent stale "no existing object" warnings for rediscovered drives/cameras
523
529
 
524
- ### 0.5.2 (2026-08-05)
525
- * (ipod86) feat: rename `overview` DP to `widget_live_overview` for consistent naming
526
-
527
530
  [Older changelog entries in CHANGELOG_OLD.md](CHANGELOG_OLD.md)
528
531
 
529
532
  ## 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(dK,null,this.getToolbar()),B.createElement(uK,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))}};EW()(iq),B.Component,B.Component;var aq=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}))}))()),oq=function(){return oq=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},oq.apply(this,arguments)};function sq(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 cq=`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(`.`),lq={opacity:0,maxWidth:`100%`};B.forwardRef((function(e,t){var n=sq(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=sq(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 aq.default(b.current,oq(oq({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 cq.reduce((function(e,t){var n=e,r=t;return n[r],sq(n,[typeof r==`symbol`?r:r+``])}),e)}(oq(oq({},v),{crossOrigin:c,src:a,alt:h}));return B.createElement(`div`,{style:o,className:s},B.createElement(`img`,oq({},x,{style:lq,ref:b})))})),{seconds:`seconds`,minutes:`minutes`}.minutes,B.Component,B.Component,B.Component,B.Component,B.Component;var uq=e=>{let t=yA.t(e.labelKey),n=e.helpKey?yA.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:yA.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||` `})},dq=({textKey:e,level:t=`category`})=>t===`sub`?(0,V.jsx)(Kv,{variant:`subtitle2`,sx:{mt:1.5,mb:.5,ml:.5,color:`text.secondary`,fontWeight:600},children:yA.t(e)}):(0,V.jsx)(Kv,{variant:`h6`,sx:{mt:2,mb:1,borderBottom:`1px solid`,borderColor:`divider`,pb:.5},children:yA.t(e)}),fq=({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:yA.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:yA.t(t)})]}),pq=({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)(uq,{type:`text`,labelKey:`cfgIp`,value:e.serverIp??``,onChange:e=>t(`serverIp`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(uq,{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)(uq,{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)(uq,{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)(uq,{type:`number`,labelKey:`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)(uq,{type:`number`,labelKey:`cfgHttpTimeoutMs`,value:e.httpTimeoutMs??8e3,min:1e3,max:3e4,onChange:e=>t(`httpTimeoutMs`,e)})})]}),mq=({native:e,onChange:t})=>(0,V.jsxs)(`div`,{children:[(0,V.jsx)(dq,{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)(uq,{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)(uq,{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)(uq,{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)(uq,{type:`checkbox`,labelKey:`cfgEnableSnapshotB64`,helpKey:`cfgEnableSnapshotB64_tt`,value:e.enableSnapshotB64,onChange:e=>t(`enableSnapshotB64`,e)})})]}),(0,V.jsx)(dq,{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)(uq,{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)(uq,{type:`checkbox`,labelKey:`cfgEnableAlertPhotos`,helpKey:`cfgEnableAlertPhotos_tt`,value:e.enableAlertPhotos??!0,onChange:e=>t(`enableAlertPhotos`,e)})})]}),(0,V.jsx)(dq,{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)(uq,{type:`checkbox`,labelKey:`cfgEnableOverview`,helpKey:`cfgEnableOverview_tt`,value:e.enableOverview,onChange:e=>t(`enableOverview`,e)})})}),(0,V.jsx)(dq,{textKey:`hdrProxy`}),(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)(uq,{type:`checkbox`,labelKey:`cfgEnableStreamProxy`,helpKey:`cfgEnableStreamProxy_tt`,value:e.enableStreamProxy,onChange:e=>t(`enableStreamProxy`,e)})})}),(0,V.jsx)(dq,{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)(uq,{type:`checkbox`,labelKey:`cfgStoreRawJson`,helpKey:`cfgStoreRawJson_tt`,value:e.storeRawJson,onChange:e=>t(`storeRawJson`,e)})})})]}),hq=({native:e,onChange:t})=>(0,V.jsxs)(`div`,{children:[(0,V.jsx)(dq,{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)(uq,{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:4,lg:3,children:(0,V.jsx)(uq,{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)(uq,{type:`number`,labelKey:`cfgWidgetMaxModalWidth`,helpKey:`cfgWidgetMaxModalWidth_tt`,value:e.widgetMaxModalWidth??900,min:300,max:2e3,onChange:e=>t(`widgetMaxModalWidth`,e)})})]}),(0,V.jsx)(dq,{textKey:`hdrWidgetRecordings`}),(0,V.jsxs)(X,{container:!0,spacing:2,children:[(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:6,lg:5,children:(0,V.jsx)(uq,{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)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(uq,{type:`number`,labelKey:`cfgWidgetAnzahl`,helpKey:`cfgWidgetAnzahl_tt`,value:e.widgetAnzahl??50,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)(uq,{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)(dq,{textKey:`hdrWidgetTags`,level:`sub`}),(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)(uq,{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)(uq,{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)(dq,{textKey:`hdrWidgetFilter`,level:`sub`}),(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)(uq,{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)(uq,{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)(uq,{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)(uq,{type:`text`,labelKey:`cfgWidgetDefaultTag`,helpKey:`cfgWidgetDefaultTag_tt`,value:e.widgetDefaultTag??``,onChange:e=>t(`widgetDefaultTag`,e)})})]}),(0,V.jsx)(dq,{textKey:`hdrWidgetPlayer`,level:`sub`}),(0,V.jsx)(X,{container:!0,spacing:2,children:(0,V.jsx)(X,{item:!0,xs:12,sm:12,md:8,children:(0,V.jsx)(uq,{type:`text`,labelKey:`cfgWidgetPlayerUrl`,helpKey:`cfgWidgetPlayerUrl_tt`,value:e.widgetPlayerUrl??``,onChange:e=>t(`widgetPlayerUrl`,e)})})}),(0,V.jsx)(dq,{textKey:`hdrWidgetLive`}),(0,V.jsxs)(X,{container:!0,spacing:2,children:[(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:6,lg:5,children:(0,V.jsx)(uq,{type:`select`,labelKey:`cfgWidgetLiveMode`,helpKey:`cfgWidgetLiveMode_tt`,value:e.widgetLiveMode??`nojs`,onChange:e=>t(`widgetLiveMode`,e),options:[{value:`nojs`,labelKey:`cfgWidgetLiveModeNojs`},{value:`js`,labelKey:`cfgWidgetLiveModeJs`}]})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(uq,{type:`text`,labelKey:`cfgWidgetLiveAspect`,helpKey:`cfgWidgetLiveAspect_tt`,value:e.widgetLiveAspect??``,onChange:e=>t(`widgetLiveAspect`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(uq,{type:`number`,labelKey:`cfgWidgetLiveRefreshSec`,helpKey:`cfgWidgetLiveRefreshSec_tt`,value:e.widgetLiveRefreshSec??0,min:0,max:3600,onChange:e=>t(`widgetLiveRefreshSec`,e)})})]}),(0,V.jsx)(dq,{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)(fq,{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)(fq,{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)(fq,{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)(fq,{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)(fq,{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)(uq,{type:`number`,labelKey:`cfgWidgetBorderRadius`,helpKey:`cfgWidgetBorderRadius_tt`,value:e.widgetBorderRadius??8,min:0,max:32,onChange:e=>t(`widgetBorderRadius`,e)})})]})]});function gq(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 _q(e){return!e||typeof e!=`object`?[]:Object.keys(e).sort()}var vq=({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||{};function p(e){return f[e]??`mjpeg`}function m(e,n){t(`cameraStreams`,{...f,[e]:n})}let h=(0,B.useCallback)(async()=>{let t=(e.serverIp||``).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(yA.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=gq(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),e.go2rtcEnabled&&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=_q(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.serverIp,e.port,e.go2rtcUrl,e.user,e.pass,n,r]);return(0,B.useEffect)(()=>{let e=setTimeout(()=>void h(),600);return()=>clearTimeout(e)},[e.serverIp,e.port,e.go2rtcUrl,e.user,e.pass,h]),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(dq,{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)(uq,{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)(uq,{type:`checkbox`,labelKey:`cfgDashShowOffline`,helpKey:`cfgDashShowOffline_tt`,value:e.dashShowOffline,onChange:e=>t(`dashShowOffline`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(uq,{type:`checkbox`,labelKey:`cfgDashEnableRecordings`,helpKey:`cfgDashEnableRecordings_tt`,value:e.dashEnableRecordings!==!1,onChange:e=>t(`dashEnableRecordings`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(uq,{type:`number`,labelKey:`cfgDashMaxRec`,helpKey:`cfgDashMaxRec_tt`,value:e.dashMaxRec??200,min:10,max:5e3,onChange:e=>t(`dashMaxRec`,e)})})]}),(0,V.jsx)(dq,{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)(uq,{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:3,lg:2,children:(0,V.jsx)(uq,{type:`select`,labelKey:`cfgDashTileAspect`,helpKey:`cfgDashTileAspect_tt`,value:e.dashTileAspect??`16/9`,onChange:e=>t(`dashTileAspect`,e),options:[{value:`16/9`,labelKey:`cfgTileAspect169`},{value:`4/3`,labelKey:`cfgTileAspect43`}]})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(uq,{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)(uq,{type:`select`,labelKey:`cfgDashTagPosition`,helpKey:`cfgDashTagPosition_tt`,value:e.dashTagPosition??`top-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)(dq,{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)(uq,{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)(uq,{type:`checkbox`,labelKey:`cfgDashStreamReconnect`,helpKey:`cfgDashStreamReconnect_tt`,value:e.dashStreamReconnect!==!1,onChange:e=>t(`dashStreamReconnect`,e)})})]}),(0,V.jsx)(dq,{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)(fq,{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)($x,{sx:{mt:1},children:(0,V.jsx)(TD,{title:yA.t(`cfgResetColors_tt`),children:(0,V.jsx)(CS,{size:`small`,variant:`outlined`,color:`warning`,startIcon:(0,V.jsx)(Ek,{}),onClick:()=>{Object.entries({dashColorBg:`#080b0f`,dashColorSurface:`#0d1117`,dashColorAccent:`#2563eb`,dashColorText:`#dde4ef`,dashColorBorder:`#1e2a38`,dashColorOnline:`#22c55e`,dashColorOffline:`#ef4444`}).forEach(([e,n])=>t(e,n))},children:yA.t(`cfgResetColors`)})})}),(0,V.jsx)(dq,{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:yA.t(`cfgGo2rtcMapping_tt`)}),(0,V.jsx)(TD,{title:yA.t(`reload`),children:(0,V.jsx)(Ev,{size:`small`,onClick:()=>void h(),disabled:u,children:u?(0,V.jsx)(bv,{size:18}):(0,V.jsx)(zk,{})})})]}),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:yA.t(`loadingCamerasAndStreams`)})]}),i!==null&&i.length===0&&!u&&(0,V.jsx)(Rv,{severity:`info`,sx:{mb:2},children:yA.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:yA.t(`cfgCameraColumn`)})}),(0,V.jsx)(nO,{children:(0,V.jsx)(`strong`,{children:yA.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:p(e.key),onChange:t=>m(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:[yA.t(`cfgDashStreamMp4`),(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))})]})}),(0,V.jsx)(dq,{textKey:`hdrGo2rtc`}),(0,V.jsx)(X,{container:!0,spacing:2,children:(0,V.jsx)(X,{item:!0,xs:12,sm:12,md:6,lg:4,children:(0,V.jsx)(uq,{type:`checkbox`,labelKey:`cfgGo2rtcEnabled`,helpKey:`cfgGo2rtcEnabled_tt`,value:e.go2rtcEnabled??!1,onChange:e=>t(`go2rtcEnabled`,e)})})}),e.go2rtcEnabled&&(0,V.jsxs)(X,{container:!0,spacing:2,children:[(0,V.jsx)(X,{item:!0,xs:12,sm:8,md:6,lg:5,children:(0,V.jsx)(uq,{type:`text`,labelKey:`cfgGo2rtcUrl`,helpKey:`cfgGo2rtcUrl_tt`,value:e.go2rtcUrl??``,onChange:e=>t(`go2rtcUrl`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:12,md:12,lg:12,children:(0,V.jsx)(Kv,{variant:`caption`,color:`text.secondary`,children:yA.t(`cfgGo2rtcEnabled_tt`)})})]})]})},yq=({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)(uq,{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)(uq,{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)(uq,{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)(uq,{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)(uq,{type:`text`,labelKey:`cfgEventTags`,value:e.eventTags??``,onChange:e=>t(`eventTags`,e)})})]}),bq={cfgCameraColumn:`AgentDVR Camera`,cfgDashBtnsVisible:`Buttons always visible`,cfgDashBtnsVisible_tt:`Always show record and PTZ buttons on camera tile (otherwise only visible on hover)`,cfgDashColorAccent:`Accent color`,cfgDashColorAccent_tt:`Main accent color (buttons, active elements, borders)`,cfgDashColorBg:`Background`,cfgDashColorBg_tt:`Main background color of the dashboard`,cfgDashColorBorder:`Border color`,cfgDashColorBorder_tt:`Color of dividers and borders`,cfgDashColorOffline:`Offline color`,cfgDashColorOffline_tt:`Color of the offline status indicator`,cfgDashColorOnline:`Online color`,cfgDashColorOnline_tt:`Color of the online status indicator`,cfgDashColorSurface:`Surface / Cards`,cfgDashColorSurface_tt:`Background color of tiles and cards`,cfgDashColorText:`Text color`,cfgDashColorText_tt:`Primary text color`,cfgDashDefaultView:`Default view on open`,cfgDashDefaultView_tt:`Which tab is active when the dashboard opens`,cfgDashEnableRecordings:`Show recordings tab`,cfgDashEnableRecordings_tt:`Show the recordings tab in the dashboard navigation. Disable to hide the tab completely.`,cfgDashMaxRec:`Max. recordings total`,cfgDashMaxRec_tt:`Maximum total number of recordings shown in the dashboard across all cameras (newest first).`,cfgDashGridCols:`Column count (0 = automatic)`,cfgDashGridCols_tt:`Force a fixed number of camera columns. 0 = optimal count is calculated automatically.`,cfgDashRefreshSec:`Reload camera list every (seconds)`,cfgDashRefreshSec_tt:`How often the camera list is reloaded from the server (0 = no automatic reload)`,cfgDashShowOffline:`Show offline cameras`,cfgDashShowOffline_tt:`Include cameras that are currently offline in the live grid`,cfgDashStreamMp4:`MP4 / FLV (with audio)`,cfgDashStreamReconnect:`Auto-reconnect stream on error`,cfgDashStreamReconnect_tt:`Automatically restart the MJPEG stream after a connection drop`,cfgDashTagPosition:`Tag badge position`,cfgDashTagPosition_tt:`Corner of the recording tile where the tag badge appears`,cfgDashTileAspect:`Tile aspect ratio`,cfgDashTileAspect_tt:`Aspect ratio of camera tiles in the live grid. 16:9 = widescreen (letterbox bars for portrait cameras). 4:3 = squarer (pillarbox bars for widescreen cameras).`,cfgDashViewLive:`Live view`,cfgDashViewRec:`Recordings`,cfgEnableEventDps:`Event data points`,cfgEnableEventDps_tt:`Mirror metadata of the last recording (filename, date, duration, tags)`,cfgEnableAlertPhotos:`Save alert photos`,cfgEnableAlertPhotos_tt:`On a webhook call with ?oid={ID}, store the current full-resolution photo in the ioBroker file storage (last 3 per camera: grab1–grab3, timestamps ts1–ts3)`,cfgEnableOverview:`Overview widget (all cameras)`,cfgEnableOverview_tt:`HTML state with all cameras as tile grid (for visualizations, dashboards etc.)`,cfgEnablePtz:`PTZ control buttons`,cfgEnablePtz_tt:`Hold switches for PTZ (left/right/up/down/zoom) per camera`,cfgEnableSnapshotB64:`Snapshot as Base64`,cfgEnableSnapshotB64_tt:`Save camera image as Base64 on every poll (photo.jpg, full resolution). Refresh button always present.`,cfgEnableStreamProxy:`Media proxy`,cfgEnableStreamProxy_tt:`Route MJPEG streams, snapshots, recording thumbnails and videos through ioBroker — use when AgentDVR is not directly reachable from the browser. FLV and go2rtc always run through ioBroker for technical reasons (browser cross-origin restriction).`,cfgEnableSystemControls:`System control buttons`,cfgEnableSystemControls_tt:`Arm/Disarm/Restart buttons, profile selector and all system-wide control commands`,cfgEnableUrls:`Generate stream URLs`,cfgEnableUrls_tt:`URL states for snapshot, MJPEG and MP4 stream per camera`,cfgEnableWidget:`Gallery widget per camera`,cfgEnableWidget_tt:`HTML gallery with the latest recordings per camera (for visualizations, dashboards etc.)`,cfgEventTags:`Fixed event tags to always create (comma-separated)`,cfgEventTagsDynamic:`Auto-detect event tags from recordings`,cfgEventTagsIgnore:`Event tags to ignore (comma-separated)`,cfgGo2rtcEnabled:`Enable go2rtc WebRTC streams`,cfgGo2rtcEnabled_tt:`Integrates a go2rtc server. After saving, a go2rtc stream can be selected per camera.`,cfgGo2rtcMapping_tt:`Select the stream source per camera: MJPEG or MP4/FLV (via AgentDVR) or a go2rtc stream.`,cfgGo2rtcUrl:`go2rtc URL`,cfgGo2rtcUrl_tt:`Base URL of the go2rtc server, e.g. http://192.168.1.1:1984`,cfgHttpTimeoutMs:`HTTP timeout (ms)`,cfgIp:`AgentDVR IP Address`,cfgIpMissing:`AgentDVR IP address is required`,cfgMaxArray:`Max. array length to expand`,cfgMaxDepth:`Max. object flatten depth`,cfgNoCamerasFound:`No cameras found — is the adapter configured and has it polled at least once?`,cfgPass:`Password (optional)`,cfgPollSeconds:`Poll interval (seconds)`,cfgPort:`Port`,cfgStoreRawJson:`Store raw API JSON`,cfgStoreRawJson_tt:`Write full getObjects response to system.raw_getObjects (useful for debugging)`,cfgStreamSourceColumn:`Stream Source`,cfgTagPosBotLeft:`Bottom left`,cfgTagPosBotRight:`Bottom right`,cfgTagPosTopLeft:`Top left`,cfgTagPosTopRight:`Top right`,cfgTileAspect169:`16:9 – Widescreen`,cfgTileAspect43:`4:3 – Square`,cfgUser:`Username (optional)`,cfgWidgetAnzahl:`Max. recordings in gallery`,cfgWidgetAnzahl_tt:`Maximum number of recordings in the gallery per camera`,cfgWidgetBorderRadius:`Border radius (px)`,cfgWidgetBorderRadius_tt:`Corner radius of thumbnail tiles in pixels (0 = square)`,cfgWidgetColorAccent:`Accent color`,cfgWidgetColorAccent_tt:`Accent color for links and buttons in the widget`,cfgWidgetColorCardBg:`Tile background`,cfgWidgetColorCardBg_tt:`Background color of thumbnail tiles – rgba(r,g,b,a) or #hex`,cfgWidgetColorModalBg:`Modal background`,cfgWidgetColorModalBg_tt:`Background color of the video player dialog`,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`,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)`,cfgWidgetLiveAspect:`Live tile aspect ratio (e.g. 16/9, leave empty for auto)`,cfgWidgetLiveAspect_tt:`Aspect ratio of the livestream tile e.g. 16/9. Leave empty for automatic.`,cfgWidgetMaxModalWidth:`Max. player width (px)`,cfgWidgetMaxModalWidth_tt:`Maximum width of the video player in the modal dialog in pixels`,cfgWidgetMinCol:`Min. column width (px)`,cfgWidgetMinCol_tt:`Minimum column width of the gallery grid in pixels`,cfgWidgetMode:`Widget mode`,cfgWidgetModeJs:`Full JS (search + tag filter, requires script execution)`,cfgWidgetModeNojs:`Pure HTML/CSS (no JavaScript, compatible everywhere)`,cfgWidgetMode_tt:`Pure HTML/CSS compatible everywhere. Full JS with search field and tag filter (requires script execution).`,cfgWidgetPlayerUrl:`External player URL (leave empty for built-in player)`,cfgWidgetPlayerUrl_tt:`URL of an external video player. Leave empty for built-in player.`,cfgWidgetShowSearch:`Show search field (JS mode only)`,cfgWidgetShowSearch_tt:`Show text search over date, tag and filename in JS mode`,cfgWidgetShowTags:`Show event tags`,cfgWidgetShowTags_tt:`Show event tags as colored badge labels on gallery tiles`,cfgWidgetSortNewest:`Newest first`,cfgWidgetSortNewest_tt:`Sort recordings by date, newest first`,cfgWidgetTagPosition:`Tag badge position`,cfgWidgetTagPosition_tt:`Corner of the image where the tag badge appears`,cfgWidgetThumbLarge:`Large (240 px)`,cfgWidgetThumbMedium:`Medium (180 px)`,cfgWidgetThumbSize:`Thumbnail size`,cfgWidgetThumbSize_tt:`Width of preview images in the gallery (overrides min. column width)`,cfgWidgetThumbSmall:`Small (120 px)`,hdrCameraStreams:`Stream Assignment`,hdrControls:`Control Buttons`,hdrDashGrid:`Camera grid`,hdrDashStream:`Stream & Refresh`,hdrDashTheme:`Colors & Design`,hdrDashView:`View`,hdrDebug:`Debug`,hdrDisplay:`Display`,hdrEvents:`Events & Push`,hdrGo2rtc:`go2rtc WebRTC Streams`,hdrProxy:`Proxy`,hdrWidgetFilter:`Filter & Sort`,hdrWidgetGeneral:`General`,hdrWidgetLayout:`Layout`,hdrWidgetPlayer:`Player`,hdrWidgetTags:`Tags`,hdrWidgetTheme:`Colors & Design`,loadingCamerasAndStreams:`Loading cameras and streams…`,reload:`Reload`,tabAdvanced:`Advanced`,tabConnection:`Connection`,tabDashboard:`Live Dashboard`,tabFeatures:`Features`,tabWidget:`Widget`,cfgResetColors:`Reset colors to defaults`,cfgResetColors_tt:`Resets all dashboard colors to the built-in dark theme defaults`,hdrWidgetRecordings:`Recordings Widget`,hdrWidgetLive:`Live Widget`,cfgWidgetLiveRefreshSec:`Live tile refresh interval (seconds, 0 = never after creation)`,cfgWidgetLiveRefreshSec_tt:`HTML only mode: how often the live tile's HTML state is rewritten (refreshing its snapshot). 0 = only once when created - an open video modal then never closes on its own, but the snapshot goes stale. A higher value refreshes more often, but rewriting the state can close an open video modal. Full JS mode: how often the image refreshes in the browser; 0 disables the automatic refresh.`,cfgWidgetLiveMode:`Live widget mode`,cfgWidgetLiveMode_tt:`'HTML only' refreshes the snapshot by rewriting the whole widget state at the interval below (0 = only once - an open video modal then never closes on its own, but the snapshot goes stale). 'Full JS' refreshes only the image in the browser via a small script, so the state is written once and an open modal never closes, regardless of the interval - requires script execution, which some hosts embedding this widget do not allow.`,cfgWidgetLiveModeNojs:`HTML only (interval below controls full widget refresh)`,cfgWidgetLiveModeJs:`Full JS (refreshes only the image, modal never closes, requires script execution)`},xq={cfgCameraColumn:`AgentDVR Kamera`,cfgDashBtnsVisible:`Buttons immer sichtbar`,cfgDashBtnsVisible_tt:`Aufnahme- und PTZ-Button immer anzeigen (sonst nur bei Hover)`,cfgDashColorAccent:`Akzentfarbe`,cfgDashColorAccent_tt:`Hauptakzentfarbe (Buttons, aktive Elemente, Rahmen)`,cfgDashColorBg:`Hintergrund`,cfgDashColorBg_tt:`Haupthintergrundfarbe des Dashboards`,cfgDashColorBorder:`Rahmenfarbe`,cfgDashColorBorder_tt:`Farbe von Trennlinien und Rahmen`,cfgDashColorOffline:`Offline-Farbe`,cfgDashColorOffline_tt:`Farbe des Offline-Status-Indikators`,cfgDashColorOnline:`Online-Farbe`,cfgDashColorOnline_tt:`Farbe des Online-Status-Indikators`,cfgDashColorSurface:`Oberfläche / Karten`,cfgDashColorSurface_tt:`Hintergrundfarbe von Kacheln und Karten`,cfgDashColorText:`Textfarbe`,cfgDashColorText_tt:`Primäre Textfarbe`,cfgDashDefaultView:`Standard-Ansicht beim Öffnen`,cfgDashDefaultView_tt:`Welcher Tab beim Öffnen des Dashboards aktiv ist`,cfgDashEnableRecordings:`Aufnahmen-Tab anzeigen`,cfgDashEnableRecordings_tt:`Den Aufnahmen-Tab in der Dashboard-Navigation anzeigen. Deaktivieren um den Tab vollständig auszublenden.`,cfgDashMaxRec:`Max. Aufnahmen gesamt`,cfgDashMaxRec_tt:`Maximale Gesamtanzahl der im Dashboard angezeigten Aufnahmen über alle Kameras (neueste zuerst).`,cfgDashGridCols:`Spaltenanzahl (0 = automatisch)`,cfgDashGridCols_tt:`Anzahl Kamera-Spalten fest vorgeben. 0 = optimale Anzahl wird automatisch berechnet.`,cfgDashRefreshSec:`Kameraliste neu laden alle (Sekunden)`,cfgDashRefreshSec_tt:`Wie oft die Kameraliste vom Server neu geladen wird (0 = kein automatischer Reload)`,cfgDashShowOffline:`Offline-Kameras anzeigen`,cfgDashShowOffline_tt:`Kameras die gerade offline sind trotzdem im Live-Grid einblenden`,cfgDashStreamMp4:`MP4 / FLV (mit Ton)`,cfgDashStreamReconnect:`Stream bei Fehler automatisch neu verbinden`,cfgDashStreamReconnect_tt:`MJPEG-Stream wird nach einem Verbindungsabbruch automatisch neu gestartet`,cfgDashTagPosition:`Tag-Badge-Position`,cfgDashTagPosition_tt:`Ecke der Aufnahme-Kachel, in der der Tag-Badge erscheint`,cfgDashTileAspect:`Kachel-Seitenverhältnis`,cfgDashTileAspect_tt:`Seitenverhältnis der Kamera-Kacheln im Live-Grid. 16:9 = Querformat (schwarze Balken bei Hochformat-Kameras). 4:3 = quadratischer (schwarze Balken bei Breitbild-Kameras).`,cfgDashViewLive:`Live-Ansicht`,cfgDashViewRec:`Aufnahmen`,cfgEnableEventDps:`Ereignis-Datenpunkte`,cfgEnableEventDps_tt:`Metadaten der letzten Aufnahme spiegeln (Dateiname, Datum, Dauer, Tags)`,cfgEnableAlertPhotos:`Alarmfotos speichern`,cfgEnableAlertPhotos_tt:`Bei einem Webhook-Aufruf mit ?oid={ID} das aktuelle Foto in voller Auflösung im ioBroker-Dateispeicher ablegen (letzte 3 pro Kamera: grab1–grab3, Zeitstempel ts1–ts3)`,cfgEnableOverview:`Übersichts-Widget (alle Kameras)`,cfgEnableOverview_tt:`HTML-State mit allen Kameras als Kachelraster (für Visualisierungen, Dashboards etc.)`,cfgEnablePtz:`PTZ-Steuerungs-Schaltflächen`,cfgEnablePtz_tt:`Hold-Switches für PTZ (links/rechts/oben/unten/Zoom) pro Kamera`,cfgEnableSnapshotB64:`Snapshot als Base64`,cfgEnableSnapshotB64_tt:`Kamerabild als Base64 bei jedem Poll speichern (photo.jpg, volle Auflösung). Refresh-Button immer vorhanden.`,cfgEnableStreamProxy:`Medien-Proxy`,cfgEnableStreamProxy_tt:`MJPEG-Streams, Snapshots, Aufnahmen-Vorschaubilder und Videos über ioBroker leiten — verwenden wenn AgentDVR vom Browser aus nicht direkt erreichbar ist. FLV und go2rtc laufen technisch immer über ioBroker (Browser-Cross-Origin-Beschränkung).`,cfgEnableSystemControls:`Systemsteuerungs-Schaltflächen`,cfgEnableSystemControls_tt:`Arm/Disarm/Neustart-Buttons, Profil-Selektor und alle systemweiten Steuerbefehle`,cfgEnableUrls:`Stream-URLs generieren`,cfgEnableUrls_tt:`URL-States für Snapshot, MJPEG und MP4-Stream pro Kamera`,cfgEnableWidget:`Galerie-Widget pro Kamera`,cfgEnableWidget_tt:`HTML-Galerie mit den letzten Aufnahmen pro Kamera (für Visualisierungen, Dashboards etc.)`,cfgEventTags:`Feste Ereignis-Tags, die immer erstellt werden (kommagetrennt)`,cfgEventTagsDynamic:`Ereignis-Tags automatisch aus Aufnahmen erkennen`,cfgEventTagsIgnore:`Zu ignorierende Ereignis-Tags (kommagetrennt)`,cfgGo2rtcEnabled:`go2rtc WebRTC-Streams aktivieren`,cfgGo2rtcEnabled_tt:`Bindet einen go2rtc-Server ein. Nach dem Speichern kann je Kamera ein go2rtc-Stream ausgewählt werden.`,cfgGo2rtcMapping_tt:`Wähle die Stream-Quelle je Kamera: MJPEG oder MP4/FLV (über AgentDVR) oder ein go2rtc-Stream.`,cfgGo2rtcUrl:`go2rtc URL`,cfgGo2rtcUrl_tt:`Basis-URL des go2rtc-Servers, z. B. http://192.168.1.1:1984`,cfgHttpTimeoutMs:`HTTP-Timeout (ms)`,cfgIp:`AgentDVR IP-Adresse`,cfgIpMissing:`AgentDVR-IP-Adresse ist erforderlich`,cfgMaxArray:`Max. Array-Länge zum Erweitern`,cfgMaxDepth:`Max. Objekt-Abflachungstiefe`,cfgNoCamerasFound:`Keine Kameras gefunden — Adapter konfiguriert und mindestens einmal gepollt?`,cfgPass:`Passwort (optional)`,cfgPollSeconds:`Abfrageintervall (Sekunden)`,cfgPort:`Port`,cfgStoreRawJson:`Rohes API-JSON speichern`,cfgStoreRawJson_tt:`Vollständige getObjects-Antwort in system.raw_getObjects schreiben (nützlich für Debugging)`,cfgStreamSourceColumn:`Stream-Quelle`,cfgTagPosBotLeft:`Unten links`,cfgTagPosBotRight:`Unten rechts`,cfgTagPosTopLeft:`Oben links`,cfgTagPosTopRight:`Oben rechts`,cfgTileAspect169:`16:9 – Breitbild`,cfgTileAspect43:`4:3 – Quadratisch`,cfgUser:`Benutzername (optional)`,cfgWidgetAnzahl:`Max. Aufnahmen in der Galerie`,cfgWidgetAnzahl_tt:`Maximale Anzahl Aufnahmen in der Galerie pro Kamera`,cfgWidgetBorderRadius:`Eckenradius (px)`,cfgWidgetBorderRadius_tt:`Abrundungsradius der Vorschaukacheln in Pixeln (0 = eckig)`,cfgWidgetColorAccent:`Akzentfarbe`,cfgWidgetColorAccent_tt:`Akzentfarbe für Links und Buttons im Widget`,cfgWidgetColorCardBg:`Kachel-Hintergrund`,cfgWidgetColorCardBg_tt:`Hintergrundfarbe der Vorschaukacheln – rgba(r,g,b,a) oder #hex`,cfgWidgetColorModalBg:`Modal-Hintergrund`,cfgWidgetColorModalBg_tt:`Hintergrundfarbe des Video-Player-Dialogs`,cfgWidgetColorTagBg:`Tag-Badge-Hintergrund`,cfgWidgetColorTagBg_tt:`Hintergrundfarbe des Tag-Badges`,cfgWidgetColorTagText:`Tag-Badge-Textfarbe`,cfgWidgetColorTagText_tt:`Textfarbe des Tag-Badges`,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)`,cfgWidgetLiveAspect:`Seitenverhältnis Live-Kachel (z.B. 16/9, leer lassen für automatisch)`,cfgWidgetLiveAspect_tt:`Seitenverhältnis der Livestream-Kachel z.B. 16/9. Leer lassen für automatisch.`,cfgWidgetMaxModalWidth:`Max. Player-Breite (px)`,cfgWidgetMaxModalWidth_tt:`Maximale Breite des Video-Players im Modal-Dialog in Pixeln`,cfgWidgetMinCol:`Min. Spaltenbreite (px)`,cfgWidgetMinCol_tt:`Minimale Spaltenbreite des Galerie-Grids in Pixeln`,cfgWidgetMode:`Widget-Modus`,cfgWidgetModeJs:`Vollständiges JS (Suche + Tag-Filter, erfordert Skriptausführung)`,cfgWidgetModeNojs:`Reines HTML/CSS (kein JavaScript, überall kompatibel)`,cfgWidgetMode_tt:`Pure HTML/CSS überall kompatibel. Full JS mit Suchfeld und Tag-Filter (benötigt Script-Ausführung).`,cfgWidgetPlayerUrl:`Externer Player-URL (leer lassen für eingebauten Player)`,cfgWidgetPlayerUrl_tt:`URL eines externen Video-Players. Leer lassen für eingebauten Player.`,cfgWidgetShowSearch:`Suchfeld anzeigen (nur JS-Modus)`,cfgWidgetShowSearch_tt:`Textsuche über Datum, Tag und Dateiname im JS-Modus einblenden`,cfgWidgetShowTags:`Ereignis-Tags anzeigen`,cfgWidgetShowTags_tt:`Event-Tags als farbige Badge-Labels auf den Galerie-Kacheln anzeigen`,cfgWidgetSortNewest:`Neueste zuerst`,cfgWidgetSortNewest_tt:`Aufnahmen nach Datum sortieren, neueste zuerst`,cfgWidgetTagPosition:`Tag-Badge-Position`,cfgWidgetTagPosition_tt:`Ecke des Bildes wo der Tag-Badge erscheint`,cfgWidgetThumbLarge:`Groß (240 px)`,cfgWidgetThumbMedium:`Mittel (180 px)`,cfgWidgetThumbSize:`Thumbnail-Größe`,cfgWidgetThumbSize_tt:`Breite der Vorschaubilder in der Galerie (überschreibt Min. Spaltenbreite)`,cfgWidgetThumbSmall:`Klein (120 px)`,hdrCameraStreams:`Stream-Zuweisung`,hdrControls:`Steuerbuttons`,hdrDashGrid:`Kamera-Grid`,hdrDashStream:`Stream & Aktualisierung`,hdrDashTheme:`Farben & Design`,hdrDashView:`Ansicht`,hdrDebug:`Debug`,hdrDisplay:`Darstellung`,hdrEvents:`Ereignisse & Push`,hdrGo2rtc:`go2rtc WebRTC-Streams`,hdrProxy:`Proxy`,hdrWidgetFilter:`Filter & Sortierung`,hdrWidgetGeneral:`Allgemein`,hdrWidgetLayout:`Layout`,hdrWidgetPlayer:`Player`,hdrWidgetTags:`Tags`,hdrWidgetTheme:`Farben & Design`,loadingCamerasAndStreams:`Lade Kameras und Streams…`,reload:`Neu laden`,tabAdvanced:`Erweitert`,tabConnection:`Verbindung`,tabDashboard:`Live-Dashboard`,tabFeatures:`Funktionen`,tabWidget:`Widget`,cfgResetColors:`Farben auf Werkseinstellung`,cfgResetColors_tt:`Setzt alle Dashboard-Farben auf die eingebauten Standardwerte zurück`,hdrWidgetRecordings:`Aufnahmen-Widget`,hdrWidgetLive:`Live-Widget`,cfgWidgetLiveRefreshSec:`Aktualisierungsintervall Live-Kachel (Sekunden, 0 = nie nach Erstellung)`,cfgWidgetLiveRefreshSec_tt:`Modus "Nur HTML": wie oft der HTML-State der Live-Kachel neu geschrieben wird (aktualisiert den Schnappschuss). 0 = nur einmal bei Erstellung - ein offenes Video-Modal schließt sich dann nie von selbst, das Vorschaubild bleibt aber unverändert. Ein höherer Wert aktualisiert häufiger, kann aber ein offenes Modal schließen. Modus "Vollständiges JS": wie oft sich das Bild im Browser aktualisiert; 0 deaktiviert die automatische Aktualisierung.`,cfgWidgetLiveMode:`Live-Widget-Modus`,cfgWidgetLiveMode_tt:`"Nur HTML" aktualisiert den Schnappschuss, indem der komplette Widget-State im unten eingestellten Intervall neu geschrieben wird (0 = nur einmal - ein offenes Video-Modal schließt sich dann nie von selbst, das Vorschaubild bleibt aber unverändert). "Vollständiges JS" aktualisiert nur das Bild im Browser per kleinem Skript, der State wird nur einmal geschrieben und ein offenes Modal schließt sich nie, unabhängig vom Intervall - erfordert Skriptausführung, die manche Einbindungen dieses Widgets nicht erlauben.`,cfgWidgetLiveModeNojs:`Nur HTML (Intervall unten steuert kompletten Widget-Refresh)`,cfgWidgetLiveModeJs:`Vollständiges JS (aktualisiert nur das Bild, Modal schließt nie, erfordert Skriptausführung)`},Sq=class extends PA{constructor(e){super(e,{encryptedFields:[`pass`],Connection:Gs,translations:{en:bq,de:xq}})}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:yA.t(`tabConnection`)}),(0,V.jsx)(RD,{label:yA.t(`tabFeatures`)}),(0,V.jsx)(RD,{label:yA.t(`tabWidget`)}),(0,V.jsx)(RD,{label:yA.t(`tabDashboard`)}),(0,V.jsx)(RD,{label:yA.t(`tabAdvanced`)})]})}),(0,V.jsxs)($x,{sx:{flex:1,overflowY:`auto`,p:2,pb:12},children:[e===0&&(0,V.jsx)(pq,{native:t,onChange:n}),e===1&&(0,V.jsx)(mq,{native:t,onChange:n}),e===2&&(0,V.jsx)(hq,{native:t,onChange:n}),e===3&&(0,V.jsx)(vq,{native:t,onChange:n,socket:this.socket,instance:this.instance??0}),e===4&&(0,V.jsx)(yq,{native:t,onChange:n})]}),this.renderError(),this.renderSaveCloseButtons()]})})})}};window.adapterName=`agent-dvr`,window.sentryDSN=``;var Cq=document.getElementById(`root`);Cq&&(0,Es.createRoot)(Cq).render((0,V.jsx)(Sq,{}));
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}))}))()),oq=function(){return oq=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},oq.apply(this,arguments)};function sq(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 cq=`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(`.`),lq={opacity:0,maxWidth:`100%`};B.forwardRef((function(e,t){var n=sq(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=sq(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 aq.default(b.current,oq(oq({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 cq.reduce((function(e,t){var n=e,r=t;return n[r],sq(n,[typeof r==`symbol`?r:r+``])}),e)}(oq(oq({},v),{crossOrigin:c,src:a,alt:h}));return B.createElement(`div`,{style:o,className:s},B.createElement(`img`,oq({},x,{style:lq,ref:b})))})),{seconds:`seconds`,minutes:`minutes`}.minutes,B.Component,B.Component,B.Component,B.Component,B.Component;var uq=e=>{let t=yA.t(e.labelKey),n=e.helpKey?yA.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:yA.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||` `})},dq=({textKey:e,level:t=`category`})=>t===`sub`?(0,V.jsx)(Kv,{variant:`subtitle2`,sx:{mt:1.5,mb:.5,ml:.5,color:`text.secondary`,fontWeight:600},children:yA.t(e)}):(0,V.jsx)(Kv,{variant:`h6`,sx:{mt:2,mb:1,borderBottom:`1px solid`,borderColor:`divider`,pb:.5},children:yA.t(e)}),fq=({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:yA.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:yA.t(t)})]}),pq=({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)(uq,{type:`text`,labelKey:`cfgIp`,value:e.serverIp??``,onChange:e=>t(`serverIp`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(uq,{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)(uq,{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)(uq,{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)(uq,{type:`number`,labelKey:`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)(uq,{type:`number`,labelKey:`cfgHttpTimeoutMs`,value:e.httpTimeoutMs??8e3,min:1e3,max:3e4,onChange:e=>t(`httpTimeoutMs`,e)})})]}),mq=({native:e,onChange:t,socket:n})=>{let[r,i]=(0,B.useState)([]);return(0,B.useEffect)(()=>{n?.getAdapterInstances(`web`).then(e=>i(e.map(e=>{let t=e._id.replace(`system.adapter.`,``);return{value:t,labelKey:`${t} (${e.native?.secure?`https`:`http`} :${e.native?.port})`}}))).catch(()=>i([]))},[n]),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(dq,{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)(uq,{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)(uq,{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)(uq,{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)(uq,{type:`checkbox`,labelKey:`cfgEnableSnapshotB64`,helpKey:`cfgEnableSnapshotB64_tt`,value:e.enableSnapshotB64,onChange:e=>t(`enableSnapshotB64`,e)})})]}),(0,V.jsx)(dq,{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)(uq,{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)(uq,{type:`checkbox`,labelKey:`cfgEnableAlertPhotos`,helpKey:`cfgEnableAlertPhotos_tt`,value:e.enableAlertPhotos??!0,onChange:e=>t(`enableAlertPhotos`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(uq,{type:`select`,labelKey:`cfgPhotoWebInstance`,helpKey:`cfgPhotoWebInstance_tt`,value:e.photoWebInstance??``,onChange:e=>t(`photoWebInstance`,e),options:[{value:``,labelKey:`cfgPhotoWebAuto`},...r]})})]}),(0,V.jsx)(dq,{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)(uq,{type:`checkbox`,labelKey:`cfgEnableOverview`,helpKey:`cfgEnableOverview_tt`,value:e.enableOverview,onChange:e=>t(`enableOverview`,e)})})}),(0,V.jsx)(dq,{textKey:`hdrProxy`}),(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)(uq,{type:`checkbox`,labelKey:`cfgEnableStreamProxy`,helpKey:`cfgEnableStreamProxy_tt`,value:e.enableStreamProxy,onChange:e=>t(`enableStreamProxy`,e)})})}),(0,V.jsx)(dq,{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)(uq,{type:`checkbox`,labelKey:`cfgStoreRawJson`,helpKey:`cfgStoreRawJson_tt`,value:e.storeRawJson,onChange:e=>t(`storeRawJson`,e)})})})]})},hq=({native:e,onChange:t})=>(0,V.jsxs)(`div`,{children:[(0,V.jsx)(dq,{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)(uq,{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:4,lg:3,children:(0,V.jsx)(uq,{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)(uq,{type:`number`,labelKey:`cfgWidgetMaxModalWidth`,helpKey:`cfgWidgetMaxModalWidth_tt`,value:e.widgetMaxModalWidth??900,min:300,max:2e3,onChange:e=>t(`widgetMaxModalWidth`,e)})})]}),(0,V.jsx)(dq,{textKey:`hdrWidgetRecordings`}),(0,V.jsxs)(X,{container:!0,spacing:2,children:[(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:6,lg:5,children:(0,V.jsx)(uq,{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)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(uq,{type:`number`,labelKey:`cfgWidgetAnzahl`,helpKey:`cfgWidgetAnzahl_tt`,value:e.widgetAnzahl??50,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)(uq,{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)(dq,{textKey:`hdrWidgetTags`,level:`sub`}),(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)(uq,{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)(uq,{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)(dq,{textKey:`hdrWidgetFilter`,level:`sub`}),(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)(uq,{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)(uq,{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)(uq,{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)(uq,{type:`text`,labelKey:`cfgWidgetDefaultTag`,helpKey:`cfgWidgetDefaultTag_tt`,value:e.widgetDefaultTag??``,onChange:e=>t(`widgetDefaultTag`,e)})})]}),(0,V.jsx)(dq,{textKey:`hdrWidgetPlayer`,level:`sub`}),(0,V.jsx)(X,{container:!0,spacing:2,children:(0,V.jsx)(X,{item:!0,xs:12,sm:12,md:8,children:(0,V.jsx)(uq,{type:`text`,labelKey:`cfgWidgetPlayerUrl`,helpKey:`cfgWidgetPlayerUrl_tt`,value:e.widgetPlayerUrl??``,onChange:e=>t(`widgetPlayerUrl`,e)})})}),(0,V.jsx)(dq,{textKey:`hdrWidgetLive`}),(0,V.jsxs)(X,{container:!0,spacing:2,children:[(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:6,lg:5,children:(0,V.jsx)(uq,{type:`select`,labelKey:`cfgWidgetLiveMode`,helpKey:`cfgWidgetLiveMode_tt`,value:e.widgetLiveMode??`nojs`,onChange:e=>t(`widgetLiveMode`,e),options:[{value:`nojs`,labelKey:`cfgWidgetLiveModeNojs`},{value:`js`,labelKey:`cfgWidgetLiveModeJs`}]})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(uq,{type:`text`,labelKey:`cfgWidgetLiveAspect`,helpKey:`cfgWidgetLiveAspect_tt`,value:e.widgetLiveAspect??``,onChange:e=>t(`widgetLiveAspect`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(uq,{type:`number`,labelKey:`cfgWidgetLiveRefreshSec`,helpKey:`cfgWidgetLiveRefreshSec_tt`,value:e.widgetLiveRefreshSec??0,min:0,max:3600,onChange:e=>t(`widgetLiveRefreshSec`,e)})})]}),(0,V.jsx)(dq,{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)(fq,{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)(fq,{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)(fq,{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)(fq,{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)(fq,{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)(uq,{type:`number`,labelKey:`cfgWidgetBorderRadius`,helpKey:`cfgWidgetBorderRadius_tt`,value:e.widgetBorderRadius??8,min:0,max:32,onChange:e=>t(`widgetBorderRadius`,e)})})]})]});function gq(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 _q(e){return!e||typeof e!=`object`?[]:Object.keys(e).sort()}var vq=({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||{};function p(e){return f[e]??`mjpeg`}function m(e,n){t(`cameraStreams`,{...f,[e]:n})}let h=(0,B.useCallback)(async()=>{let t=(e.serverIp||``).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(yA.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=gq(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),e.go2rtcEnabled&&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=_q(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.serverIp,e.port,e.go2rtcUrl,e.user,e.pass,n,r]);return(0,B.useEffect)(()=>{let e=setTimeout(()=>void h(),600);return()=>clearTimeout(e)},[e.serverIp,e.port,e.go2rtcUrl,e.user,e.pass,h]),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(dq,{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)(uq,{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)(uq,{type:`checkbox`,labelKey:`cfgDashShowOffline`,helpKey:`cfgDashShowOffline_tt`,value:e.dashShowOffline,onChange:e=>t(`dashShowOffline`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(uq,{type:`checkbox`,labelKey:`cfgDashEnableRecordings`,helpKey:`cfgDashEnableRecordings_tt`,value:e.dashEnableRecordings!==!1,onChange:e=>t(`dashEnableRecordings`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,V.jsx)(uq,{type:`number`,labelKey:`cfgDashMaxRec`,helpKey:`cfgDashMaxRec_tt`,value:e.dashMaxRec??200,min:10,max:5e3,onChange:e=>t(`dashMaxRec`,e)})})]}),(0,V.jsx)(dq,{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)(uq,{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:3,lg:2,children:(0,V.jsx)(uq,{type:`select`,labelKey:`cfgDashTileAspect`,helpKey:`cfgDashTileAspect_tt`,value:e.dashTileAspect??`16/9`,onChange:e=>t(`dashTileAspect`,e),options:[{value:`16/9`,labelKey:`cfgTileAspect169`},{value:`4/3`,labelKey:`cfgTileAspect43`}]})}),(0,V.jsx)(X,{item:!0,xs:12,sm:6,md:4,children:(0,V.jsx)(uq,{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)(uq,{type:`select`,labelKey:`cfgDashTagPosition`,helpKey:`cfgDashTagPosition_tt`,value:e.dashTagPosition??`top-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)(dq,{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)(uq,{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)(uq,{type:`checkbox`,labelKey:`cfgDashStreamReconnect`,helpKey:`cfgDashStreamReconnect_tt`,value:e.dashStreamReconnect!==!1,onChange:e=>t(`dashStreamReconnect`,e)})})]}),(0,V.jsx)(dq,{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)(fq,{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)($x,{sx:{mt:1},children:(0,V.jsx)(TD,{title:yA.t(`cfgResetColors_tt`),children:(0,V.jsx)(CS,{size:`small`,variant:`outlined`,color:`warning`,startIcon:(0,V.jsx)(Ek,{}),onClick:()=>{Object.entries({dashColorBg:`#080b0f`,dashColorSurface:`#0d1117`,dashColorAccent:`#2563eb`,dashColorText:`#dde4ef`,dashColorBorder:`#1e2a38`,dashColorOnline:`#22c55e`,dashColorOffline:`#ef4444`}).forEach(([e,n])=>t(e,n))},children:yA.t(`cfgResetColors`)})})}),(0,V.jsx)(dq,{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:yA.t(`cfgGo2rtcMapping_tt`)}),(0,V.jsx)(TD,{title:yA.t(`reload`),children:(0,V.jsx)(Ev,{size:`small`,onClick:()=>void h(),disabled:u,children:u?(0,V.jsx)(bv,{size:18}):(0,V.jsx)(zk,{})})})]}),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:yA.t(`loadingCamerasAndStreams`)})]}),i!==null&&i.length===0&&!u&&(0,V.jsx)(Rv,{severity:`info`,sx:{mb:2},children:yA.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:yA.t(`cfgCameraColumn`)})}),(0,V.jsx)(nO,{children:(0,V.jsx)(`strong`,{children:yA.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:p(e.key),onChange:t=>m(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:[yA.t(`cfgDashStreamMp4`),(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))})]})}),(0,V.jsx)(dq,{textKey:`hdrGo2rtc`}),(0,V.jsx)(X,{container:!0,spacing:2,children:(0,V.jsx)(X,{item:!0,xs:12,sm:12,md:6,lg:4,children:(0,V.jsx)(uq,{type:`checkbox`,labelKey:`cfgGo2rtcEnabled`,helpKey:`cfgGo2rtcEnabled_tt`,value:e.go2rtcEnabled??!1,onChange:e=>t(`go2rtcEnabled`,e)})})}),e.go2rtcEnabled&&(0,V.jsxs)(X,{container:!0,spacing:2,children:[(0,V.jsx)(X,{item:!0,xs:12,sm:8,md:6,lg:5,children:(0,V.jsx)(uq,{type:`text`,labelKey:`cfgGo2rtcUrl`,helpKey:`cfgGo2rtcUrl_tt`,value:e.go2rtcUrl??``,onChange:e=>t(`go2rtcUrl`,e)})}),(0,V.jsx)(X,{item:!0,xs:12,sm:12,md:12,lg:12,children:(0,V.jsx)(Kv,{variant:`caption`,color:`text.secondary`,children:yA.t(`cfgGo2rtcEnabled_tt`)})})]})]})},yq=({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)(uq,{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)(uq,{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)(uq,{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)(uq,{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)(uq,{type:`text`,labelKey:`cfgEventTags`,value:e.eventTags??``,onChange:e=>t(`eventTags`,e)})})]}),bq={cfgCameraColumn:`AgentDVR Camera`,cfgDashBtnsVisible:`Buttons always visible`,cfgDashBtnsVisible_tt:`Always show record and PTZ buttons on camera tile (otherwise only visible on hover)`,cfgDashColorAccent:`Accent color`,cfgDashColorAccent_tt:`Main accent color (buttons, active elements, borders)`,cfgDashColorBg:`Background`,cfgDashColorBg_tt:`Main background color of the dashboard`,cfgDashColorBorder:`Border color`,cfgDashColorBorder_tt:`Color of dividers and borders`,cfgDashColorOffline:`Offline color`,cfgDashColorOffline_tt:`Color of the offline status indicator`,cfgDashColorOnline:`Online color`,cfgDashColorOnline_tt:`Color of the online status indicator`,cfgDashColorSurface:`Surface / Cards`,cfgDashColorSurface_tt:`Background color of tiles and cards`,cfgDashColorText:`Text color`,cfgDashColorText_tt:`Primary text color`,cfgDashDefaultView:`Default view on open`,cfgDashDefaultView_tt:`Which tab is active when the dashboard opens`,cfgDashEnableRecordings:`Show recordings tab`,cfgDashEnableRecordings_tt:`Show the recordings tab in the dashboard navigation. Disable to hide the tab completely.`,cfgDashMaxRec:`Max. recordings total`,cfgDashMaxRec_tt:`Maximum total number of recordings shown in the dashboard across all cameras (newest first).`,cfgDashGridCols:`Column count (0 = automatic)`,cfgDashGridCols_tt:`Force a fixed number of camera columns. 0 = optimal count is calculated automatically.`,cfgDashRefreshSec:`Reload camera list every (seconds)`,cfgDashRefreshSec_tt:`How often the camera list is reloaded from the server (0 = no automatic reload)`,cfgDashShowOffline:`Show offline cameras`,cfgDashShowOffline_tt:`Include cameras that are currently offline in the live grid`,cfgDashStreamMp4:`MP4 / FLV (with audio)`,cfgDashStreamReconnect:`Auto-reconnect stream on error`,cfgDashStreamReconnect_tt:`Automatically restart the MJPEG stream after a connection drop`,cfgDashTagPosition:`Tag badge position`,cfgDashTagPosition_tt:`Corner of the recording tile where the tag badge appears`,cfgDashTileAspect:`Tile aspect ratio`,cfgDashTileAspect_tt:`Aspect ratio of camera tiles in the live grid. 16:9 = widescreen (letterbox bars for portrait cameras). 4:3 = squarer (pillarbox bars for widescreen cameras).`,cfgDashViewLive:`Live view`,cfgDashViewRec:`Recordings`,cfgEnableEventDps:`Event data points`,cfgEnableEventDps_tt:`Mirror metadata of the last recording (filename, date, duration, tags)`,cfgEnableAlertPhotos:`Save alert photos`,cfgEnableAlertPhotos_tt:`On a webhook call with ?oid={ID}, store the current full-resolution photo in the ioBroker file storage (last 3 per camera: grab1–grab3, timestamps ts1–ts3)`,cfgPhotoWebInstance:`Web instance for photo links`,cfgPhotoWebInstance_tt:`Which web instance the links in alertPhotos.url1–3 point to. Automatic prefers plain http.`,cfgPhotoWebAuto:`Automatic`,cfgEnableOverview:`Overview widget (all cameras)`,cfgEnableOverview_tt:`HTML state with all cameras as tile grid (for visualizations, dashboards etc.)`,cfgEnablePtz:`PTZ control buttons`,cfgEnablePtz_tt:`Hold switches for PTZ (left/right/up/down/zoom) per camera`,cfgEnableSnapshotB64:`Snapshot as Base64`,cfgEnableSnapshotB64_tt:`Save camera image as Base64 on every poll (photo.jpg, full resolution). Refresh button always present.`,cfgEnableStreamProxy:`Media proxy`,cfgEnableStreamProxy_tt:`Route MJPEG streams, snapshots, recording thumbnails and videos through ioBroker — use when AgentDVR is not directly reachable from the browser. FLV and go2rtc always run through ioBroker for technical reasons (browser cross-origin restriction).`,cfgEnableSystemControls:`System control buttons`,cfgEnableSystemControls_tt:`Arm/Disarm/Restart buttons, profile selector and all system-wide control commands`,cfgEnableUrls:`Generate stream URLs`,cfgEnableUrls_tt:`URL states for snapshot, MJPEG and MP4 stream per camera`,cfgEnableWidget:`Gallery widget per camera`,cfgEnableWidget_tt:`HTML gallery with the latest recordings per camera (for visualizations, dashboards etc.)`,cfgEventTags:`Fixed event tags to always create (comma-separated)`,cfgEventTagsDynamic:`Auto-detect event tags from recordings`,cfgEventTagsIgnore:`Event tags to ignore (comma-separated)`,cfgGo2rtcEnabled:`Enable go2rtc WebRTC streams`,cfgGo2rtcEnabled_tt:`Integrates a go2rtc server. After saving, a go2rtc stream can be selected per camera.`,cfgGo2rtcMapping_tt:`Select the stream source per camera: MJPEG or MP4/FLV (via AgentDVR) or a go2rtc stream.`,cfgGo2rtcUrl:`go2rtc URL`,cfgGo2rtcUrl_tt:`Base URL of the go2rtc server, e.g. http://192.168.1.1:1984`,cfgHttpTimeoutMs:`HTTP timeout (ms)`,cfgIp:`AgentDVR IP Address`,cfgIpMissing:`AgentDVR IP address is required`,cfgMaxArray:`Max. array length to expand`,cfgMaxDepth:`Max. object flatten depth`,cfgNoCamerasFound:`No cameras found — is the adapter configured and has it polled at least once?`,cfgPass:`Password (optional)`,cfgPollSeconds:`Poll interval (seconds)`,cfgPort:`Port`,cfgStoreRawJson:`Store raw API JSON`,cfgStoreRawJson_tt:`Write full getObjects response to system.raw_getObjects (useful for debugging)`,cfgStreamSourceColumn:`Stream Source`,cfgTagPosBotLeft:`Bottom left`,cfgTagPosBotRight:`Bottom right`,cfgTagPosTopLeft:`Top left`,cfgTagPosTopRight:`Top right`,cfgTileAspect169:`16:9 – Widescreen`,cfgTileAspect43:`4:3 – Square`,cfgUser:`Username (optional)`,cfgWidgetAnzahl:`Max. recordings in gallery`,cfgWidgetAnzahl_tt:`Maximum number of recordings in the gallery per camera`,cfgWidgetBorderRadius:`Border radius (px)`,cfgWidgetBorderRadius_tt:`Corner radius of thumbnail tiles in pixels (0 = square)`,cfgWidgetColorAccent:`Accent color`,cfgWidgetColorAccent_tt:`Accent color for links and buttons in the widget`,cfgWidgetColorCardBg:`Tile background`,cfgWidgetColorCardBg_tt:`Background color of thumbnail tiles – rgba(r,g,b,a) or #hex`,cfgWidgetColorModalBg:`Modal background`,cfgWidgetColorModalBg_tt:`Background color of the video player dialog`,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`,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)`,cfgWidgetLiveAspect:`Live tile aspect ratio (e.g. 16/9, leave empty for auto)`,cfgWidgetLiveAspect_tt:`Aspect ratio of the livestream tile e.g. 16/9. Leave empty for automatic.`,cfgWidgetMaxModalWidth:`Max. player width (px)`,cfgWidgetMaxModalWidth_tt:`Maximum width of the video player in the modal dialog in pixels`,cfgWidgetMinCol:`Min. column width (px)`,cfgWidgetMinCol_tt:`Minimum column width of the gallery grid in pixels`,cfgWidgetMode:`Widget mode`,cfgWidgetModeJs:`Full JS (search + tag filter, requires script execution)`,cfgWidgetModeNojs:`Pure HTML/CSS (no JavaScript, compatible everywhere)`,cfgWidgetMode_tt:`Pure HTML/CSS compatible everywhere. Full JS with search field and tag filter (requires script execution).`,cfgWidgetPlayerUrl:`External player URL (leave empty for built-in player)`,cfgWidgetPlayerUrl_tt:`URL of an external video player. Leave empty for built-in player.`,cfgWidgetShowSearch:`Show search field (JS mode only)`,cfgWidgetShowSearch_tt:`Show text search over date, tag and filename in JS mode`,cfgWidgetShowTags:`Show event tags`,cfgWidgetShowTags_tt:`Show event tags as colored badge labels on gallery tiles`,cfgWidgetSortNewest:`Newest first`,cfgWidgetSortNewest_tt:`Sort recordings by date, newest first`,cfgWidgetTagPosition:`Tag badge position`,cfgWidgetTagPosition_tt:`Corner of the image where the tag badge appears`,cfgWidgetThumbLarge:`Large (240 px)`,cfgWidgetThumbMedium:`Medium (180 px)`,cfgWidgetThumbSize:`Thumbnail size`,cfgWidgetThumbSize_tt:`Width of preview images in the gallery (overrides min. column width)`,cfgWidgetThumbSmall:`Small (120 px)`,hdrCameraStreams:`Stream Assignment`,hdrControls:`Control Buttons`,hdrDashGrid:`Camera grid`,hdrDashStream:`Stream & Refresh`,hdrDashTheme:`Colors & Design`,hdrDashView:`View`,hdrDebug:`Debug`,hdrDisplay:`Display`,hdrEvents:`Events & Push`,hdrGo2rtc:`go2rtc WebRTC Streams`,hdrProxy:`Proxy`,hdrWidgetFilter:`Filter & Sort`,hdrWidgetGeneral:`General`,hdrWidgetLayout:`Layout`,hdrWidgetPlayer:`Player`,hdrWidgetTags:`Tags`,hdrWidgetTheme:`Colors & Design`,loadingCamerasAndStreams:`Loading cameras and streams…`,reload:`Reload`,tabAdvanced:`Advanced`,tabConnection:`Connection`,tabDashboard:`Live Dashboard`,tabFeatures:`Features`,tabWidget:`Widget`,cfgResetColors:`Reset colors to defaults`,cfgResetColors_tt:`Resets all dashboard colors to the built-in dark theme defaults`,hdrWidgetRecordings:`Recordings Widget`,hdrWidgetLive:`Live Widget`,cfgWidgetLiveRefreshSec:`Live tile refresh interval (seconds, 0 = never after creation)`,cfgWidgetLiveRefreshSec_tt:`HTML only mode: how often the live tile's HTML state is rewritten (refreshing its snapshot). 0 = only once when created - an open video modal then never closes on its own, but the snapshot goes stale. A higher value refreshes more often, but rewriting the state can close an open video modal. Full JS mode: how often the image refreshes in the browser; 0 disables the automatic refresh.`,cfgWidgetLiveMode:`Live widget mode`,cfgWidgetLiveMode_tt:`'HTML only' refreshes the snapshot by rewriting the whole widget state at the interval below (0 = only once - an open video modal then never closes on its own, but the snapshot goes stale). 'Full JS' refreshes only the image in the browser via a small script, so the state is written once and an open modal never closes, regardless of the interval - requires script execution, which some hosts embedding this widget do not allow.`,cfgWidgetLiveModeNojs:`HTML only (interval below controls full widget refresh)`,cfgWidgetLiveModeJs:`Full JS (refreshes only the image, modal never closes, requires script execution)`},xq={cfgCameraColumn:`AgentDVR Kamera`,cfgDashBtnsVisible:`Buttons immer sichtbar`,cfgDashBtnsVisible_tt:`Aufnahme- und PTZ-Button immer anzeigen (sonst nur bei Hover)`,cfgDashColorAccent:`Akzentfarbe`,cfgDashColorAccent_tt:`Hauptakzentfarbe (Buttons, aktive Elemente, Rahmen)`,cfgDashColorBg:`Hintergrund`,cfgDashColorBg_tt:`Haupthintergrundfarbe des Dashboards`,cfgDashColorBorder:`Rahmenfarbe`,cfgDashColorBorder_tt:`Farbe von Trennlinien und Rahmen`,cfgDashColorOffline:`Offline-Farbe`,cfgDashColorOffline_tt:`Farbe des Offline-Status-Indikators`,cfgDashColorOnline:`Online-Farbe`,cfgDashColorOnline_tt:`Farbe des Online-Status-Indikators`,cfgDashColorSurface:`Oberfläche / Karten`,cfgDashColorSurface_tt:`Hintergrundfarbe von Kacheln und Karten`,cfgDashColorText:`Textfarbe`,cfgDashColorText_tt:`Primäre Textfarbe`,cfgDashDefaultView:`Standard-Ansicht beim Öffnen`,cfgDashDefaultView_tt:`Welcher Tab beim Öffnen des Dashboards aktiv ist`,cfgDashEnableRecordings:`Aufnahmen-Tab anzeigen`,cfgDashEnableRecordings_tt:`Den Aufnahmen-Tab in der Dashboard-Navigation anzeigen. Deaktivieren um den Tab vollständig auszublenden.`,cfgDashMaxRec:`Max. Aufnahmen gesamt`,cfgDashMaxRec_tt:`Maximale Gesamtanzahl der im Dashboard angezeigten Aufnahmen über alle Kameras (neueste zuerst).`,cfgDashGridCols:`Spaltenanzahl (0 = automatisch)`,cfgDashGridCols_tt:`Anzahl Kamera-Spalten fest vorgeben. 0 = optimale Anzahl wird automatisch berechnet.`,cfgDashRefreshSec:`Kameraliste neu laden alle (Sekunden)`,cfgDashRefreshSec_tt:`Wie oft die Kameraliste vom Server neu geladen wird (0 = kein automatischer Reload)`,cfgDashShowOffline:`Offline-Kameras anzeigen`,cfgDashShowOffline_tt:`Kameras die gerade offline sind trotzdem im Live-Grid einblenden`,cfgDashStreamMp4:`MP4 / FLV (mit Ton)`,cfgDashStreamReconnect:`Stream bei Fehler automatisch neu verbinden`,cfgDashStreamReconnect_tt:`MJPEG-Stream wird nach einem Verbindungsabbruch automatisch neu gestartet`,cfgDashTagPosition:`Tag-Badge-Position`,cfgDashTagPosition_tt:`Ecke der Aufnahme-Kachel, in der der Tag-Badge erscheint`,cfgDashTileAspect:`Kachel-Seitenverhältnis`,cfgDashTileAspect_tt:`Seitenverhältnis der Kamera-Kacheln im Live-Grid. 16:9 = Querformat (schwarze Balken bei Hochformat-Kameras). 4:3 = quadratischer (schwarze Balken bei Breitbild-Kameras).`,cfgDashViewLive:`Live-Ansicht`,cfgDashViewRec:`Aufnahmen`,cfgEnableEventDps:`Ereignis-Datenpunkte`,cfgEnableEventDps_tt:`Metadaten der letzten Aufnahme spiegeln (Dateiname, Datum, Dauer, Tags)`,cfgEnableAlertPhotos:`Alarmfotos speichern`,cfgEnableAlertPhotos_tt:`Bei einem Webhook-Aufruf mit ?oid={ID} das aktuelle Foto in voller Auflösung im ioBroker-Dateispeicher ablegen (letzte 3 pro Kamera: grab1–grab3, Zeitstempel ts1–ts3)`,cfgPhotoWebInstance:`Web-Instanz für Foto-Links`,cfgPhotoWebInstance_tt:`Auf welche Web-Instanz die Links in alertPhotos.url1–3 zeigen. Automatisch bevorzugt http.`,cfgPhotoWebAuto:`Automatisch`,cfgEnableOverview:`Übersichts-Widget (alle Kameras)`,cfgEnableOverview_tt:`HTML-State mit allen Kameras als Kachelraster (für Visualisierungen, Dashboards etc.)`,cfgEnablePtz:`PTZ-Steuerungs-Schaltflächen`,cfgEnablePtz_tt:`Hold-Switches für PTZ (links/rechts/oben/unten/Zoom) pro Kamera`,cfgEnableSnapshotB64:`Snapshot als Base64`,cfgEnableSnapshotB64_tt:`Kamerabild als Base64 bei jedem Poll speichern (photo.jpg, volle Auflösung). Refresh-Button immer vorhanden.`,cfgEnableStreamProxy:`Medien-Proxy`,cfgEnableStreamProxy_tt:`MJPEG-Streams, Snapshots, Aufnahmen-Vorschaubilder und Videos über ioBroker leiten — verwenden wenn AgentDVR vom Browser aus nicht direkt erreichbar ist. FLV und go2rtc laufen technisch immer über ioBroker (Browser-Cross-Origin-Beschränkung).`,cfgEnableSystemControls:`Systemsteuerungs-Schaltflächen`,cfgEnableSystemControls_tt:`Arm/Disarm/Neustart-Buttons, Profil-Selektor und alle systemweiten Steuerbefehle`,cfgEnableUrls:`Stream-URLs generieren`,cfgEnableUrls_tt:`URL-States für Snapshot, MJPEG und MP4-Stream pro Kamera`,cfgEnableWidget:`Galerie-Widget pro Kamera`,cfgEnableWidget_tt:`HTML-Galerie mit den letzten Aufnahmen pro Kamera (für Visualisierungen, Dashboards etc.)`,cfgEventTags:`Feste Ereignis-Tags, die immer erstellt werden (kommagetrennt)`,cfgEventTagsDynamic:`Ereignis-Tags automatisch aus Aufnahmen erkennen`,cfgEventTagsIgnore:`Zu ignorierende Ereignis-Tags (kommagetrennt)`,cfgGo2rtcEnabled:`go2rtc WebRTC-Streams aktivieren`,cfgGo2rtcEnabled_tt:`Bindet einen go2rtc-Server ein. Nach dem Speichern kann je Kamera ein go2rtc-Stream ausgewählt werden.`,cfgGo2rtcMapping_tt:`Wähle die Stream-Quelle je Kamera: MJPEG oder MP4/FLV (über AgentDVR) oder ein go2rtc-Stream.`,cfgGo2rtcUrl:`go2rtc URL`,cfgGo2rtcUrl_tt:`Basis-URL des go2rtc-Servers, z. B. http://192.168.1.1:1984`,cfgHttpTimeoutMs:`HTTP-Timeout (ms)`,cfgIp:`AgentDVR IP-Adresse`,cfgIpMissing:`AgentDVR-IP-Adresse ist erforderlich`,cfgMaxArray:`Max. Array-Länge zum Erweitern`,cfgMaxDepth:`Max. Objekt-Abflachungstiefe`,cfgNoCamerasFound:`Keine Kameras gefunden — Adapter konfiguriert und mindestens einmal gepollt?`,cfgPass:`Passwort (optional)`,cfgPollSeconds:`Abfrageintervall (Sekunden)`,cfgPort:`Port`,cfgStoreRawJson:`Rohes API-JSON speichern`,cfgStoreRawJson_tt:`Vollständige getObjects-Antwort in system.raw_getObjects schreiben (nützlich für Debugging)`,cfgStreamSourceColumn:`Stream-Quelle`,cfgTagPosBotLeft:`Unten links`,cfgTagPosBotRight:`Unten rechts`,cfgTagPosTopLeft:`Oben links`,cfgTagPosTopRight:`Oben rechts`,cfgTileAspect169:`16:9 – Breitbild`,cfgTileAspect43:`4:3 – Quadratisch`,cfgUser:`Benutzername (optional)`,cfgWidgetAnzahl:`Max. Aufnahmen in der Galerie`,cfgWidgetAnzahl_tt:`Maximale Anzahl Aufnahmen in der Galerie pro Kamera`,cfgWidgetBorderRadius:`Eckenradius (px)`,cfgWidgetBorderRadius_tt:`Abrundungsradius der Vorschaukacheln in Pixeln (0 = eckig)`,cfgWidgetColorAccent:`Akzentfarbe`,cfgWidgetColorAccent_tt:`Akzentfarbe für Links und Buttons im Widget`,cfgWidgetColorCardBg:`Kachel-Hintergrund`,cfgWidgetColorCardBg_tt:`Hintergrundfarbe der Vorschaukacheln – rgba(r,g,b,a) oder #hex`,cfgWidgetColorModalBg:`Modal-Hintergrund`,cfgWidgetColorModalBg_tt:`Hintergrundfarbe des Video-Player-Dialogs`,cfgWidgetColorTagBg:`Tag-Badge-Hintergrund`,cfgWidgetColorTagBg_tt:`Hintergrundfarbe des Tag-Badges`,cfgWidgetColorTagText:`Tag-Badge-Textfarbe`,cfgWidgetColorTagText_tt:`Textfarbe des Tag-Badges`,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)`,cfgWidgetLiveAspect:`Seitenverhältnis Live-Kachel (z.B. 16/9, leer lassen für automatisch)`,cfgWidgetLiveAspect_tt:`Seitenverhältnis der Livestream-Kachel z.B. 16/9. Leer lassen für automatisch.`,cfgWidgetMaxModalWidth:`Max. Player-Breite (px)`,cfgWidgetMaxModalWidth_tt:`Maximale Breite des Video-Players im Modal-Dialog in Pixeln`,cfgWidgetMinCol:`Min. Spaltenbreite (px)`,cfgWidgetMinCol_tt:`Minimale Spaltenbreite des Galerie-Grids in Pixeln`,cfgWidgetMode:`Widget-Modus`,cfgWidgetModeJs:`Vollständiges JS (Suche + Tag-Filter, erfordert Skriptausführung)`,cfgWidgetModeNojs:`Reines HTML/CSS (kein JavaScript, überall kompatibel)`,cfgWidgetMode_tt:`Pure HTML/CSS überall kompatibel. Full JS mit Suchfeld und Tag-Filter (benötigt Script-Ausführung).`,cfgWidgetPlayerUrl:`Externer Player-URL (leer lassen für eingebauten Player)`,cfgWidgetPlayerUrl_tt:`URL eines externen Video-Players. Leer lassen für eingebauten Player.`,cfgWidgetShowSearch:`Suchfeld anzeigen (nur JS-Modus)`,cfgWidgetShowSearch_tt:`Textsuche über Datum, Tag und Dateiname im JS-Modus einblenden`,cfgWidgetShowTags:`Ereignis-Tags anzeigen`,cfgWidgetShowTags_tt:`Event-Tags als farbige Badge-Labels auf den Galerie-Kacheln anzeigen`,cfgWidgetSortNewest:`Neueste zuerst`,cfgWidgetSortNewest_tt:`Aufnahmen nach Datum sortieren, neueste zuerst`,cfgWidgetTagPosition:`Tag-Badge-Position`,cfgWidgetTagPosition_tt:`Ecke des Bildes wo der Tag-Badge erscheint`,cfgWidgetThumbLarge:`Groß (240 px)`,cfgWidgetThumbMedium:`Mittel (180 px)`,cfgWidgetThumbSize:`Thumbnail-Größe`,cfgWidgetThumbSize_tt:`Breite der Vorschaubilder in der Galerie (überschreibt Min. Spaltenbreite)`,cfgWidgetThumbSmall:`Klein (120 px)`,hdrCameraStreams:`Stream-Zuweisung`,hdrControls:`Steuerbuttons`,hdrDashGrid:`Kamera-Grid`,hdrDashStream:`Stream & Aktualisierung`,hdrDashTheme:`Farben & Design`,hdrDashView:`Ansicht`,hdrDebug:`Debug`,hdrDisplay:`Darstellung`,hdrEvents:`Ereignisse & Push`,hdrGo2rtc:`go2rtc WebRTC-Streams`,hdrProxy:`Proxy`,hdrWidgetFilter:`Filter & Sortierung`,hdrWidgetGeneral:`Allgemein`,hdrWidgetLayout:`Layout`,hdrWidgetPlayer:`Player`,hdrWidgetTags:`Tags`,hdrWidgetTheme:`Farben & Design`,loadingCamerasAndStreams:`Lade Kameras und Streams…`,reload:`Neu laden`,tabAdvanced:`Erweitert`,tabConnection:`Verbindung`,tabDashboard:`Live-Dashboard`,tabFeatures:`Funktionen`,tabWidget:`Widget`,cfgResetColors:`Farben auf Werkseinstellung`,cfgResetColors_tt:`Setzt alle Dashboard-Farben auf die eingebauten Standardwerte zurück`,hdrWidgetRecordings:`Aufnahmen-Widget`,hdrWidgetLive:`Live-Widget`,cfgWidgetLiveRefreshSec:`Aktualisierungsintervall Live-Kachel (Sekunden, 0 = nie nach Erstellung)`,cfgWidgetLiveRefreshSec_tt:`Modus "Nur HTML": wie oft der HTML-State der Live-Kachel neu geschrieben wird (aktualisiert den Schnappschuss). 0 = nur einmal bei Erstellung - ein offenes Video-Modal schließt sich dann nie von selbst, das Vorschaubild bleibt aber unverändert. Ein höherer Wert aktualisiert häufiger, kann aber ein offenes Modal schließen. Modus "Vollständiges JS": wie oft sich das Bild im Browser aktualisiert; 0 deaktiviert die automatische Aktualisierung.`,cfgWidgetLiveMode:`Live-Widget-Modus`,cfgWidgetLiveMode_tt:`"Nur HTML" aktualisiert den Schnappschuss, indem der komplette Widget-State im unten eingestellten Intervall neu geschrieben wird (0 = nur einmal - ein offenes Video-Modal schließt sich dann nie von selbst, das Vorschaubild bleibt aber unverändert). "Vollständiges JS" aktualisiert nur das Bild im Browser per kleinem Skript, der State wird nur einmal geschrieben und ein offenes Modal schließt sich nie, unabhängig vom Intervall - erfordert Skriptausführung, die manche Einbindungen dieses Widgets nicht erlauben.`,cfgWidgetLiveModeNojs:`Nur HTML (Intervall unten steuert kompletten Widget-Refresh)`,cfgWidgetLiveModeJs:`Vollständiges JS (aktualisiert nur das Bild, Modal schließt nie, erfordert Skriptausführung)`},Sq=class extends PA{constructor(e){super(e,{encryptedFields:[`pass`],Connection:Gs,translations:{en:bq,de:xq}})}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:yA.t(`tabConnection`)}),(0,V.jsx)(RD,{label:yA.t(`tabFeatures`)}),(0,V.jsx)(RD,{label:yA.t(`tabWidget`)}),(0,V.jsx)(RD,{label:yA.t(`tabDashboard`)}),(0,V.jsx)(RD,{label:yA.t(`tabAdvanced`)})]})}),(0,V.jsxs)($x,{sx:{flex:1,overflowY:`auto`,p:2,pb:12},children:[e===0&&(0,V.jsx)(pq,{native:t,onChange:n}),e===1&&(0,V.jsx)(mq,{native:t,onChange:n,socket:this.socket}),e===2&&(0,V.jsx)(hq,{native:t,onChange:n}),e===3&&(0,V.jsx)(vq,{native:t,onChange:n,socket:this.socket,instance:this.instance??0}),e===4&&(0,V.jsx)(yq,{native:t,onChange:n})]}),this.renderError(),this.renderSaveCloseButtons()]})})})}};window.adapterName=`agent-dvr`,window.sentryDSN=``;var Cq=document.getElementById(`root`);Cq&&(0,Es.createRoot)(Cq).render((0,V.jsx)(Sq,{}));
@@ -41,6 +41,9 @@
41
41
  "cfgEnableEventDps_tt": "Metadaten der letzten Aufnahme spiegeln (Dateiname, Datum, Dauer, Tags)",
42
42
  "cfgEnableAlertPhotos": "Alarmfotos speichern",
43
43
  "cfgEnableAlertPhotos_tt": "Bei einem Webhook-Aufruf mit ?oid={ID} das aktuelle Foto in voller Auflösung im ioBroker-Dateispeicher ablegen (letzte 3 pro Kamera: grab1–grab3, Zeitstempel ts1–ts3)",
44
+ "cfgPhotoWebInstance": "Web-Instanz für Foto-Links",
45
+ "cfgPhotoWebInstance_tt": "Auf welche Web-Instanz die Links in alertPhotos.url1–3 zeigen. Automatisch bevorzugt http.",
46
+ "cfgPhotoWebAuto": "Automatisch",
44
47
  "cfgEnableOverview": "Übersichts-Widget (alle Kameras)",
45
48
  "cfgEnableOverview_tt": "HTML-State mit allen Kameras als Kachelraster (für Visualisierungen, Dashboards etc.)",
46
49
  "cfgEnablePtz": "PTZ-Steuerungs-Schaltflächen",
@@ -41,6 +41,9 @@
41
41
  "cfgEnableEventDps_tt": "Mirror metadata of the last recording (filename, date, duration, tags)",
42
42
  "cfgEnableAlertPhotos": "Save alert photos",
43
43
  "cfgEnableAlertPhotos_tt": "On a webhook call with ?oid={ID}, store the current full-resolution photo in the ioBroker file storage (last 3 per camera: grab1–grab3, timestamps ts1–ts3)",
44
+ "cfgPhotoWebInstance": "Web instance for photo links",
45
+ "cfgPhotoWebInstance_tt": "Which web instance the links in alertPhotos.url1–3 point to. Automatic prefers plain http.",
46
+ "cfgPhotoWebAuto": "Automatic",
44
47
  "cfgEnableOverview": "Overview widget (all cameras)",
45
48
  "cfgEnableOverview_tt": "HTML state with all cameras as tile grid (for visualizations, dashboards etc.)",
46
49
  "cfgEnablePtz": "PTZ control buttons",
@@ -41,6 +41,9 @@
41
41
  "cfgEnableEventDps_tt": "Reflejar metadatos de la última grabación (nombre de archivo, fecha, duración, etiquetas)",
42
42
  "cfgEnableAlertPhotos": "Guardar fotos de alarma",
43
43
  "cfgEnableAlertPhotos_tt": "En cada llamada al webhook con ?oid={ID}, guardar la foto actual en resolución completa en el almacenamiento de archivos de ioBroker (últimas 3 por cámara: grab1–grab3, marcas de tiempo ts1–ts3)",
44
+ "cfgPhotoWebInstance": "Instancia web para los enlaces de fotos",
45
+ "cfgPhotoWebInstance_tt": "A qué instancia web apuntan los enlaces de alertPhotos.url1–3. Automático prefiere http.",
46
+ "cfgPhotoWebAuto": "Automático",
44
47
  "cfgEnableOverview": "Widget de resumen (todas las cámaras)",
45
48
  "cfgEnableOverview_tt": "Estado HTML con todas las cámaras como cuadrícula (para visualizaciones, paneles, etc.)",
46
49
  "cfgEnablePtz": "Botones de control PTZ",
@@ -41,6 +41,9 @@
41
41
  "cfgEnableEventDps_tt": "Refléter les métadonnées du dernier enregistrement (nom de fichier, date, durée, étiquettes)",
42
42
  "cfgEnableAlertPhotos": "Enregistrer les photos d'alerte",
43
43
  "cfgEnableAlertPhotos_tt": "Lors d'un appel du webhook avec ?oid={ID}, enregistrer la photo actuelle en pleine résolution dans le stockage de fichiers ioBroker (3 dernières par caméra : grab1–grab3, horodatages ts1–ts3)",
44
+ "cfgPhotoWebInstance": "Instance web pour les liens photo",
45
+ "cfgPhotoWebInstance_tt": "Instance web vers laquelle pointent les liens de alertPhotos.url1–3. Automatique privilégie http.",
46
+ "cfgPhotoWebAuto": "Automatique",
44
47
  "cfgEnableOverview": "Widget de vue d'ensemble (toutes les caméras)",
45
48
  "cfgEnableOverview_tt": "État HTML avec toutes les caméras en grille (pour visualisations, tableaux de bord, etc.)",
46
49
  "cfgEnablePtz": "Boutons de contrôle PTZ",
@@ -41,6 +41,9 @@
41
41
  "cfgEnableEventDps_tt": "Rispecchia i metadati dell'ultima registrazione (nome file, data, durata, etichette)",
42
42
  "cfgEnableAlertPhotos": "Salva foto di allarme",
43
43
  "cfgEnableAlertPhotos_tt": "A ogni chiamata del webhook con ?oid={ID}, salva la foto attuale a piena risoluzione nell'archivio file di ioBroker (ultime 3 per telecamera: grab1–grab3, timestamp ts1–ts3)",
44
+ "cfgPhotoWebInstance": "Istanza web per i link alle foto",
45
+ "cfgPhotoWebInstance_tt": "A quale istanza web puntano i link in alertPhotos.url1–3. Automatico preferisce http.",
46
+ "cfgPhotoWebAuto": "Automatico",
44
47
  "cfgEnableOverview": "Widget panoramica (tutte le telecamere)",
45
48
  "cfgEnableOverview_tt": "Stato HTML con tutte le telecamere come griglia (per visualizzazioni, dashboard, ecc.)",
46
49
  "cfgEnablePtz": "Pulsanti di controllo PTZ",
@@ -41,6 +41,9 @@
41
41
  "cfgEnableEventDps_tt": "Metagegevens van de laatste opname spiegelen (bestandsnaam, datum, duur, tags)",
42
42
  "cfgEnableAlertPhotos": "Alarmfoto's opslaan",
43
43
  "cfgEnableAlertPhotos_tt": "Bij een webhook-aanroep met ?oid={ID} de huidige foto in volledige resolutie opslaan in de ioBroker-bestandsopslag (laatste 3 per camera: grab1–grab3, tijdstempels ts1–ts3)",
44
+ "cfgPhotoWebInstance": "Webinstantie voor fotolinks",
45
+ "cfgPhotoWebInstance_tt": "Naar welke webinstantie de links in alertPhotos.url1–3 verwijzen. Automatisch geeft voorkeur aan http.",
46
+ "cfgPhotoWebAuto": "Automatisch",
44
47
  "cfgEnableOverview": "Overzichtswidget (alle camera's)",
45
48
  "cfgEnableOverview_tt": "HTML-status met alle camera's als tegelraster (voor visualisaties, dashboards, enz.)",
46
49
  "cfgEnablePtz": "PTZ-bedieningsknoppen",
@@ -41,6 +41,9 @@
41
41
  "cfgEnableEventDps_tt": "Odzwierciedlaj metadane ostatniego nagrania (nazwa pliku, data, czas trwania, tagi)",
42
42
  "cfgEnableAlertPhotos": "Zapisuj zdjęcia alarmowe",
43
43
  "cfgEnableAlertPhotos_tt": "Przy wywołaniu webhooka z ?oid={ID} zapisz bieżące zdjęcie w pełnej rozdzielczości w magazynie plików ioBroker (ostatnie 3 na kamerę: grab1–grab3, znaczniki czasu ts1–ts3)",
44
+ "cfgPhotoWebInstance": "Instancja web dla linków do zdjęć",
45
+ "cfgPhotoWebInstance_tt": "Na którą instancję web wskazują linki w alertPhotos.url1–3. Automatycznie preferuje http.",
46
+ "cfgPhotoWebAuto": "Automatycznie",
44
47
  "cfgEnableOverview": "Widget przeglądu (wszystkie kamery)",
45
48
  "cfgEnableOverview_tt": "Stan HTML ze wszystkimi kamerami jako siatka kafelków (do wizualizacji, pulpitów itp.)",
46
49
  "cfgEnablePtz": "Przyciski sterowania PTZ",
@@ -41,6 +41,9 @@
41
41
  "cfgEnableEventDps_tt": "Espelhar metadados da última gravação (nome do arquivo, data, duração, etiquetas)",
42
42
  "cfgEnableAlertPhotos": "Guardar fotos de alarme",
43
43
  "cfgEnableAlertPhotos_tt": "Numa chamada do webhook com ?oid={ID}, guardar a foto atual em resolução total no armazenamento de ficheiros do ioBroker (últimas 3 por câmara: grab1–grab3, carimbos de tempo ts1–ts3)",
44
+ "cfgPhotoWebInstance": "Instância web para links de fotos",
45
+ "cfgPhotoWebInstance_tt": "Para que instância web apontam os links em alertPhotos.url1–3. Automático prefere http.",
46
+ "cfgPhotoWebAuto": "Automático",
44
47
  "cfgEnableOverview": "Widget de visão geral (todas as câmeras)",
45
48
  "cfgEnableOverview_tt": "Estado HTML com todas as câmeras em grade (para visualizações, painéis, etc.)",
46
49
  "cfgEnablePtz": "Botões de controlo PTZ",