bedrock-agentcore 0.2.0 → 0.2.3
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.md +12 -4
- package/dist/src/identity/client.d.ts +1 -1
- package/dist/src/identity/client.d.ts.map +1 -1
- package/dist/src/identity/client.js +6 -2
- package/dist/src/identity/client.js.map +1 -1
- package/dist/src/identity/types.d.ts +10 -2
- package/dist/src/identity/types.d.ts.map +1 -1
- package/dist/src/identity/wrappers.d.ts.map +1 -1
- package/dist/src/identity/wrappers.js +2 -0
- package/dist/src/identity/wrappers.js.map +1 -1
- package/dist/src/runtime/app.d.ts +11 -0
- package/dist/src/runtime/app.d.ts.map +1 -1
- package/dist/src/runtime/app.js +70 -14
- package/dist/src/runtime/app.js.map +1 -1
- package/dist/src/runtime/types.d.ts +2 -2
- package/dist/src/tools/browser/client.d.ts +19 -0
- package/dist/src/tools/browser/client.d.ts.map +1 -1
- package/dist/src/tools/browser/client.js +56 -0
- package/dist/src/tools/browser/client.js.map +1 -1
- package/dist/src/tools/browser/index.d.ts +1 -1
- package/dist/src/tools/browser/index.d.ts.map +1 -1
- package/dist/src/tools/browser/index.js.map +1 -1
- package/dist/src/tools/browser/live-view/BrowserLiveView.d.ts +10 -0
- package/dist/src/tools/browser/live-view/BrowserLiveView.d.ts.map +1 -0
- package/dist/src/tools/browser/live-view/BrowserLiveView.js +183 -0
- package/dist/src/tools/browser/live-view/BrowserLiveView.js.map +1 -0
- package/dist/src/tools/browser/live-view/index.d.ts +4 -0
- package/dist/src/tools/browser/live-view/index.d.ts.map +1 -0
- package/dist/src/tools/browser/live-view/index.js +3 -0
- package/dist/src/tools/browser/live-view/index.js.map +1 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/README.md +26 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcv-ui/EULA.txt +403 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcv-ui/README.md +57 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcv-ui/dcv-ui.js +7 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcv-ui/third-party-licenses.txt +145 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-esm/EULA.txt +403 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-esm/README.md +50 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-esm/dcv/broadwayh264decoder-worker.js +1 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-esm/dcv/jsmpegdecoder-worker.js +1 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-esm/dcv/lz4decoder-worker.js +1 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-esm/dcv/microphoneprocessor.js +1 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-esm/dcv.js +33 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-esm/lib/broadway/Decoder.js +850 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-esm/lib/jsmpeg/jsmpeg.min.js +1 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-esm/lib/lz4/lz4_decoder.js +12 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-esm/third-party-licenses.txt +1068 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-umd/EULA.txt +403 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-umd/README.md +50 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-umd/dcv/broadwayh264decoder-worker.js +1 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-umd/dcv/jsmpegdecoder-worker.js +1 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-umd/dcv/lz4decoder-worker.js +1 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-umd/dcv/microphoneprocessor.js +1 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-umd/dcv.js +33 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-umd/lib/broadway/Decoder.js +850 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-umd/lib/jsmpeg/jsmpeg.min.js +1 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-umd/lib/lz4/lz4_decoder.js +12 -0
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-umd/third-party-licenses.txt +1068 -0
- package/dist/src/tools/browser/live-view/scaling.d.ts +9 -0
- package/dist/src/tools/browser/live-view/scaling.d.ts.map +1 -0
- package/dist/src/tools/browser/live-view/scaling.js +13 -0
- package/dist/src/tools/browser/live-view/scaling.js.map +1 -0
- package/dist/src/tools/browser/types.d.ts +152 -0
- package/dist/src/tools/browser/types.d.ts.map +1 -1
- package/package.json +32 -11
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Amazon DCV Web UI SDK
|
|
2
|
+
|
|
3
|
+
The Amazon DCV Web UI SDK is a JavaScript library exposing a single
|
|
4
|
+
React component that provides the user interface to interact with
|
|
5
|
+
the Amazon DCV Web Client in-session experience.
|
|
6
|
+
Users are still responsible for the authentication against the Amazon DCV Server,
|
|
7
|
+
before connecting to a Amazon DCV session and use the `DCVViewer` React component.
|
|
8
|
+
|
|
9
|
+
## Prerequisites
|
|
10
|
+
|
|
11
|
+
Before you start working with the Amazon DCV Web UI SDK, ensure
|
|
12
|
+
that you're familiar with Amazon DCV and Amazon DCV sessions. For more
|
|
13
|
+
information, see the [Amazon DCV Administrator Guide](https://docs.aws.amazon.com/dcv/latest/adminguide).
|
|
14
|
+
|
|
15
|
+
The Amazon DCV Web UI SDK supports Amazon DCV server version 2020
|
|
16
|
+
and later.
|
|
17
|
+
|
|
18
|
+
## Browser Support
|
|
19
|
+
|
|
20
|
+
The Amazon DCV Web UI SDK supports JavaScript (ES6) and it can
|
|
21
|
+
be used from JavaScript or TypeScript applications.
|
|
22
|
+
|
|
23
|
+
The Amazon DCV Web UI SDK supports the following web browsers:
|
|
24
|
+
* Google Chrome - Latest three major versions
|
|
25
|
+
* Mozilla Firefox - Latest three major versions
|
|
26
|
+
* Microsoft Edge - Latest three major versions
|
|
27
|
+
* Apple Safari for macOS - Latest three major versions
|
|
28
|
+
|
|
29
|
+
Even if the SDK is designed to work with latest browsers versions,
|
|
30
|
+
it can be transpiled to ES5 code and used with older browser. In
|
|
31
|
+
this case some features or functionalities may be not available.
|
|
32
|
+
|
|
33
|
+
## Versioning
|
|
34
|
+
|
|
35
|
+
The Amazon DCV Web UI SDK follows the semantic versioning model.
|
|
36
|
+
Version has the following format: major.minor.patch. A change in
|
|
37
|
+
the major version, such as from 1.x.x to 2.x.x, indicates that breaking
|
|
38
|
+
changes that might require code changes and a planned deployment
|
|
39
|
+
have been introduced. A change in the minor version, such as from
|
|
40
|
+
1.1.x to 1.2.x, is backwards compatible, but might include
|
|
41
|
+
deprecated elements.
|
|
42
|
+
|
|
43
|
+
## How to use the library
|
|
44
|
+
|
|
45
|
+
The SDK reference, and some examples are available in the
|
|
46
|
+
[official documentation website](https://docs.aws.amazon.com/dcv/latest/websdkguide).
|
|
47
|
+
|
|
48
|
+
## License
|
|
49
|
+
|
|
50
|
+
For the license see the file EULA.txt.
|
|
51
|
+
For the Third party notices see the file third-party-licenses.txt.
|
|
52
|
+
|
|
53
|
+
Please beware that the `DCVViewer` React component expects these two files
|
|
54
|
+
to be present in the URL path for the embedded web server.
|
|
55
|
+
The third-party-licenses.txt should be modified to include the content of the
|
|
56
|
+
corresponding file from Amazon DCV Web SDK package and possibly any other license
|
|
57
|
+
information from the libraries used by the consuming application.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import*as e from"react";import t,{memo as n,useEffect as r,useRef as o,useState as i,useCallback as a,useMemo as s}from"react";import c from"prop-types";import l from"dcv";import{Popover as u,StatusIndicator as d,Button as m,Modal as p,Box as f,SpaceBetween as h,Textarea as g,Grid as b,Link as v,Tabs as y,RadioGroup as w,Alert as E,Select as S,ColumnLayout as x,Toggle as k,ButtonDropdown as C,Header as O,LineChart as M,Pagination as R,BreadcrumbGroup as T,Table as I,Icon as A,Input as D,Container as F,Badge as B,ProgressBar as N,Spinner as _}from"@cloudscape-design/components";import{applyMode as P,Mode as L,applyDensity as $,Density as j}from"@cloudscape-design/global-styles";import{colorChartsPaletteCategorical1 as W,colorChartsPaletteCategorical2 as z,colorChartsPaletteCategorical3 as U,colorBorderDividerDefault as V,colorBackgroundContainerHeader as H,colorBackgroundContainerContent as q,colorTextBodyDefault as G}from"@cloudscape-design/design-tokens";import K from"@babel/runtime/helpers/extends";import Q from"react-dom";var Y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Z(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var J,X={exports:{}};var ee,te,ne,re=(J||(J=1,te=X.exports,ne=function(){var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"],o={},i=null;function a(e,t){var n=e[t];if("function"==typeof n.bind)return n.bind(e);try{return Function.prototype.bind.call(n,e)}catch(t){return function(){return Function.prototype.apply.apply(n,[e,arguments])}}}function s(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(){for(var n=this.getLevel(),o=0;o<r.length;o++){var i=r[o];this[i]=o<n?e:this.methodFactory(i,n,this.name)}if(this.log=this.debug,typeof console===t&&n<this.levels.SILENT)return"No console available for logging"}function l(e){return function(){typeof console!==t&&(c.call(this),this[e].apply(this,arguments))}}function u(r,o,i){return function(r){return"debug"===r&&(r="log"),typeof console!==t&&("trace"===r&&n?s:void 0!==console[r]?a(console,r):void 0!==console.log?a(console,"log"):e)}(r)||l.apply(this,arguments)}function d(e,n){var a,s,l,d=this,m="loglevel";function p(){var e;if(typeof window!==t&&m){try{e=window.localStorage[m]}catch(e){}if(typeof e===t)try{var n=window.document.cookie,r=encodeURIComponent(m),o=n.indexOf(r+"=");-1!==o&&(e=/^([^;]+)/.exec(n.slice(o+r.length+1))[1])}catch(e){}return void 0===d.levels[e]&&(e=void 0),e}}function f(e){var t=e;if("string"==typeof t&&void 0!==d.levels[t.toUpperCase()]&&(t=d.levels[t.toUpperCase()]),"number"==typeof t&&t>=0&&t<=d.levels.SILENT)return t;throw new TypeError("log.setLevel() called with invalid level: "+e)}"string"==typeof e?m+=":"+e:"symbol"==typeof e&&(m=void 0),d.name=e,d.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},d.methodFactory=n||u,d.getLevel=function(){return null!=l?l:null!=s?s:a},d.setLevel=function(e,n){return l=f(e),!1!==n&&function(e){var n=(r[e]||"silent").toUpperCase();if(typeof window!==t&&m){try{return void(window.localStorage[m]=n)}catch(e){}try{window.document.cookie=encodeURIComponent(m)+"="+n+";"}catch(e){}}}(l),c.call(d)},d.setDefaultLevel=function(e){s=f(e),p()||d.setLevel(e,!1)},d.resetLevel=function(){l=null,function(){if(typeof window!==t&&m){try{window.localStorage.removeItem(m)}catch(e){}try{window.document.cookie=encodeURIComponent(m)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}(),c.call(d)},d.enableAll=function(e){d.setLevel(d.levels.TRACE,e)},d.disableAll=function(e){d.setLevel(d.levels.SILENT,e)},d.rebuild=function(){if(i!==d&&(a=f(i.getLevel())),c.call(d),i===d)for(var e in o)o[e].rebuild()},a=f(i?i.getLevel():"WARN");var h=p();null!=h&&(l=f(h)),c.call(d)}(i=new d).getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=o[e];return t||(t=o[e]=new d(e,i.methodFactory)),t};var m=typeof window!==t?window.log:void 0;return i.noConflict=function(){return typeof window!==t&&window.log===i&&(window.log=m),i},i.getLoggers=function(){return o},i.default=i,i},(ee=X).exports?ee.exports=ne():te.log=ne()),X.exports),oe=Z(re);const ie=oe.getLogger("DCV-web-sdk-UI");class ae{constructor(e){this.name=e,this.dateObject=new Date}trace(e){const t=this.dateObject;t.setTime(Date.now()),ie.trace(`${t.toISOString()} - [UI][${this.name}] TRACE ${e}`)}debug(e){const t=this.dateObject;t.setTime(Date.now()),ie.debug(`${t.toISOString()} - [UI][${this.name}] DEBUG ${e}`)}info(e){const t=this.dateObject;t.setTime(Date.now()),ie.info(`${t.toISOString()} - [UI][${this.name}] INFO ${e}`)}warn(e){const t=this.dateObject;t.setTime(Date.now()),ie.warn(`${t.toISOString()} - [UI][${this.name}] WARN ${e}`)}error(e){const t=this.dateObject;t.setTime(Date.now()),ie.error(`${t.toISOString()} - [UI][${this.name}] ERROR ${e}`)}}function se(e){return new ae(e)}var ce,le,ue={};function de(){if(le)return ce;le=1;var e=function(e){return e&&e.Math==Math&&e};return ce=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof Y&&Y)||function(){return this}()||Function("return this")()}var me,pe,fe,he,ge,be,ve,ye,we={};function Ee(){return pe?me:(pe=1,me=function(e){try{return!!e()}catch(e){return!0}})}function Se(){if(he)return fe;he=1;var e=Ee();return fe=!e(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})}function xe(){if(be)return ge;be=1;var e=Ee();return ge=!e(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})}function ke(){if(ye)return ve;ye=1;var e=xe(),t=Function.prototype.call;return ve=e?t.bind(t):function(){return t.apply(t,arguments)},ve}var Ce,Oe,Me,Re,Te,Ie,Ae,De,Fe,Be,Ne,_e,Pe,Le,$e,je,We,ze,Ue,Ve,He,qe,Ge,Ke,Qe,Ye,Ze,Je,Xe,et,tt,nt,rt,ot,it,at,st,ct,lt,ut={};function dt(){return Me?Oe:(Me=1,Oe=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}})}function mt(){if(Te)return Re;Te=1;var e=xe(),t=Function.prototype,n=t.bind,r=t.call,o=e&&n.bind(r,r);return Re=e?function(e){return e&&o(e)}:function(e){return e&&function(){return r.apply(e,arguments)}},Re}function pt(){if(Ae)return Ie;Ae=1;var e=mt(),t=e({}.toString),n=e("".slice);return Ie=function(e){return n(t(e),8,-1)}}function ft(){if(Ne)return Be;Ne=1;var e=de().TypeError;return Be=function(t){if(null==t)throw e("Can't call method on "+t);return t}}function ht(){if(Pe)return _e;Pe=1;var e=function(){if(Fe)return De;Fe=1;var e=de(),t=mt(),n=Ee(),r=pt(),o=e.Object,i=t("".split);return De=n(function(){return!o("z").propertyIsEnumerable(0)})?function(e){return"String"==r(e)?i(e,""):o(e)}:o}(),t=ft();return _e=function(n){return e(t(n))}}function gt(){return $e?Le:($e=1,Le=function(e){return"function"==typeof e})}function bt(){if(We)return je;We=1;var e=gt();return je=function(t){return"object"==typeof t?null!==t:e(t)}}function vt(){if(Ue)return ze;Ue=1;var e=de(),t=gt();return ze=function(n,r){return arguments.length<2?(o=e[n],t(o)?o:void 0):e[n]&&e[n][r];var o},ze}function yt(){if(He)return Ve;He=1;var e=mt();return Ve=e({}.isPrototypeOf)}function wt(){if(Qe)return Ke;Qe=1;var e,t,n=de(),r=function(){if(Ge)return qe;Ge=1;var e=vt();return qe=e("navigator","userAgent")||""}(),o=n.process,i=n.Deno,a=o&&o.versions||i&&i.version,s=a&&a.v8;return s&&(t=(e=s.split("."))[0]>0&&e[0]<4?1:+(e[0]+e[1])),!t&&r&&(!(e=r.match(/Edge\/(\d+)/))||e[1]>=74)&&(e=r.match(/Chrome\/(\d+)/))&&(t=+e[1]),Ke=t}function Et(){if(Ze)return Ye;Ze=1;var e=wt(),t=Ee();return Ye=!!Object.getOwnPropertySymbols&&!t(function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&e<41})}function St(){if(Xe)return Je;Xe=1;var e=Et();return Je=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function xt(){if(tt)return et;tt=1;var e=de(),t=vt(),n=gt(),r=yt(),o=St(),i=e.Object;return et=o?function(e){return"symbol"==typeof e}:function(e){var o=t("Symbol");return n(o)&&r(o.prototype,i(e))}}function kt(){if(rt)return nt;rt=1;var e=de().String;return nt=function(t){try{return e(t)}catch(e){return"Object"}}}function Ct(){if(it)return ot;it=1;var e=de(),t=gt(),n=kt(),r=e.TypeError;return ot=function(e){if(t(e))return e;throw r(n(e)+" is not a function")}}function Ot(){if(st)return at;st=1;var e=Ct();return at=function(t,n){var r=t[n];return null==r?void 0:e(r)}}function Mt(){if(lt)return ct;lt=1;var e=de(),t=ke(),n=gt(),r=bt(),o=e.TypeError;return ct=function(e,i){var a,s;if("string"===i&&n(a=e.toString)&&!r(s=t(a,e)))return s;if(n(a=e.valueOf)&&!r(s=t(a,e)))return s;if("string"!==i&&n(a=e.toString)&&!r(s=t(a,e)))return s;throw o("Can't convert object to primitive value")}}var Rt,Tt,It,At,Dt,Ft,Bt,Nt,_t,Pt,Lt,$t,jt,Wt,zt,Ut,Vt,Ht,qt,Gt,Kt,Qt,Yt,Zt,Jt={exports:{}};function Xt(){return Tt?Rt:(Tt=1,Rt=!1)}function en(){if(At)return It;At=1;var e=de(),t=Object.defineProperty;return It=function(n,r){try{t(e,n,{value:r,configurable:!0,writable:!0})}catch(t){e[n]=r}return r}}function tn(){if(Ft)return Dt;Ft=1;var e=de(),t=en(),n="__core-js_shared__",r=e[n]||t(n,{});return Dt=r}function nn(){if(Bt)return Jt.exports;Bt=1;var e=Xt(),t=tn();return(Jt.exports=function(e,n){return t[e]||(t[e]=void 0!==n?n:{})})("versions",[]).push({version:"3.20.3",mode:e?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.20.3/LICENSE",source:"https://github.com/zloirock/core-js"}),Jt.exports}function rn(){if(_t)return Nt;_t=1;var e=de(),t=ft(),n=e.Object;return Nt=function(e){return n(t(e))}}function on(){if(Lt)return Pt;Lt=1;var e=mt(),t=rn(),n=e({}.hasOwnProperty);return Pt=Object.hasOwn||function(e,r){return n(t(e),r)}}function an(){if(jt)return $t;jt=1;var e=mt(),t=0,n=Math.random(),r=e(1..toString);return $t=function(e){return"Symbol("+(void 0===e?"":e)+")_"+r(++t+n,36)}}function sn(){if(zt)return Wt;zt=1;var e=de(),t=nn(),n=on(),r=an(),o=Et(),i=St(),a=t("wks"),s=e.Symbol,c=s&&s.for,l=i?s:s&&s.withoutSetter||r;return Wt=function(e){if(!n(a,e)||!o&&"string"!=typeof a[e]){var t="Symbol."+e;o&&n(s,e)?a[e]=s[e]:a[e]=i&&c?c(t):l(t)}return a[e]}}function cn(){if(Vt)return Ut;Vt=1;var e=de(),t=ke(),n=bt(),r=xt(),o=Ot(),i=Mt(),a=sn(),s=e.TypeError,c=a("toPrimitive");return Ut=function(e,a){if(!n(e)||r(e))return e;var l,u=o(e,c);if(u){if(void 0===a&&(a="default"),l=t(u,e,a),!n(l)||r(l))return l;throw s("Can't convert object to primitive value")}return void 0===a&&(a="number"),i(e,a)}}function ln(){if(qt)return Ht;qt=1;var e=cn(),t=xt();return Ht=function(n){var r=e(n,"string");return t(r)?r:r+""}}function un(){if(Kt)return Gt;Kt=1;var e=de(),t=bt(),n=e.document,r=t(n)&&t(n.createElement);return Gt=function(e){return r?n.createElement(e):{}}}function dn(){if(Yt)return Qt;Yt=1;var e=Se(),t=Ee(),n=un();return Qt=!e&&!t(function(){return 7!=Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a})}function mn(){if(Zt)return we;Zt=1;var e=Se(),t=ke(),n=function(){if(Ce)return ut;Ce=1;var e={}.propertyIsEnumerable,t=Object.getOwnPropertyDescriptor,n=t&&!e.call({1:2},1);return ut.f=n?function(e){var n=t(this,e);return!!n&&n.enumerable}:e,ut}(),r=dt(),o=ht(),i=ln(),a=on(),s=dn(),c=Object.getOwnPropertyDescriptor;return we.f=e?c:function(e,l){if(e=o(e),l=i(l),s)try{return c(e,l)}catch(e){}if(a(e,l))return r(!t(n.f,e,l),e[l])},we}var pn,fn,hn,gn,bn,vn,yn,wn={};function En(){if(fn)return pn;fn=1;var e=Se(),t=Ee();return pn=e&&t(function(){return 42!=Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})}function Sn(){if(gn)return hn;gn=1;var e=de(),t=bt(),n=e.String,r=e.TypeError;return hn=function(e){if(t(e))return e;throw r(n(e)+" is not an object")}}function xn(){if(bn)return wn;bn=1;var e=de(),t=Se(),n=dn(),r=En(),o=Sn(),i=ln(),a=e.TypeError,s=Object.defineProperty,c=Object.getOwnPropertyDescriptor,l="enumerable",u="configurable",d="writable";return wn.f=t?r?function(e,t,n){if(o(e),t=i(t),o(n),"function"==typeof e&&"prototype"===t&&"value"in n&&d in n&&!n[d]){var r=c(e,t);r&&r[d]&&(e[t]=n.value,n={configurable:u in n?n[u]:r[u],enumerable:l in n?n[l]:r[l],writable:!1})}return s(e,t,n)}:s:function(e,t,r){if(o(e),t=i(t),o(r),n)try{return s(e,t,r)}catch(e){}if("get"in r||"set"in r)throw a("Accessors not supported");return"value"in r&&(e[t]=r.value),e},wn}function kn(){if(yn)return vn;yn=1;var e=Se(),t=xn(),n=dt();return vn=e?function(e,r,o){return t.f(e,r,n(1,o))}:function(e,t,n){return e[t]=n,e}}var Cn,On,Mn,Rn,Tn,In,An,Dn,Fn,Bn,Nn,_n,Pn,Ln={exports:{}};function $n(){if(On)return Cn;On=1;var e=mt(),t=gt(),n=tn(),r=e(Function.toString);return t(n.inspectSource)||(n.inspectSource=function(e){return r(e)}),Cn=n.inspectSource}function jn(){if(In)return Tn;In=1;var e=nn(),t=an(),n=e("keys");return Tn=function(e){return n[e]||(n[e]=t(e))}}function Wn(){return Dn?An:(Dn=1,An={})}function zn(){if(Bn)return Fn;Bn=1;var e,t,n,r=function(){if(Rn)return Mn;Rn=1;var e=de(),t=gt(),n=$n(),r=e.WeakMap;return Mn=t(r)&&/native code/.test(n(r))}(),o=de(),i=mt(),a=bt(),s=kn(),c=on(),l=tn(),u=jn(),d=Wn(),m="Object already initialized",p=o.TypeError,f=o.WeakMap;if(r||l.state){var h=l.state||(l.state=new f),g=i(h.get),b=i(h.has),v=i(h.set);e=function(e,t){if(b(h,e))throw new p(m);return t.facade=e,v(h,e,t),t},t=function(e){return g(h,e)||{}},n=function(e){return b(h,e)}}else{var y=u("state");d[y]=!0,e=function(e,t){if(c(e,y))throw new p(m);return t.facade=e,s(e,y,t),t},t=function(e){return c(e,y)?e[y]:{}},n=function(e){return c(e,y)}}return Fn={set:e,get:t,has:n,enforce:function(r){return n(r)?t(r):e(r,{})},getterFor:function(e){return function(n){var r;if(!a(n)||(r=t(n)).type!==e)throw p("Incompatible receiver, "+e+" required");return r}}}}function Un(){if(Pn)return Ln.exports;Pn=1;var e=de(),t=gt(),n=on(),r=kn(),o=en(),i=$n(),a=zn(),s=function(){if(_n)return Nn;_n=1;var e=Se(),t=on(),n=Function.prototype,r=e&&Object.getOwnPropertyDescriptor,o=t(n,"name"),i=o&&"something"===function(){}.name,a=o&&(!e||e&&r(n,"name").configurable);return Nn={EXISTS:o,PROPER:i,CONFIGURABLE:a}}().CONFIGURABLE,c=a.get,l=a.enforce,u=String(String).split("String");return(Ln.exports=function(i,a,c,d){var m,p=!!d&&!!d.unsafe,f=!!d&&!!d.enumerable,h=!!d&&!!d.noTargetGet,g=d&&void 0!==d.name?d.name:a;t(c)&&("Symbol("===String(g).slice(0,7)&&(g="["+String(g).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!n(c,"name")||s&&c.name!==g)&&r(c,"name",g),(m=l(c)).source||(m.source=u.join("string"==typeof g?g:""))),i!==e?(p?!h&&i[a]&&(f=!0):delete i[a],f?i[a]=c:r(i,a,c)):f?i[a]=c:o(a,c)})(Function.prototype,"toString",function(){return t(this)&&c(this).source||i(this)}),Ln.exports}var Vn,Hn,qn,Gn,Kn,Qn,Yn,Zn,Jn,Xn,er,tr,nr,rr,or,ir={};function ar(){if(Hn)return Vn;Hn=1;var e=Math.ceil,t=Math.floor;return Vn=function(n){var r=+n;return r!=r||0===r?0:(r>0?t:e)(r)}}function sr(){if(Gn)return qn;Gn=1;var e=ar(),t=Math.max,n=Math.min;return qn=function(r,o){var i=e(r);return i<0?t(i+o,0):n(i,o)}}function cr(){if(Qn)return Kn;Qn=1;var e=ar(),t=Math.min;return Kn=function(n){return n>0?t(e(n),9007199254740991):0}}function lr(){if(Zn)return Yn;Zn=1;var e=cr();return Yn=function(t){return e(t.length)}}function ur(){if(tr)return er;tr=1;var e=mt(),t=on(),n=ht(),r=function(){if(Xn)return Jn;Xn=1;var e=ht(),t=sr(),n=lr(),r=function(r){return function(o,i,a){var s,c=e(o),l=n(c),u=t(a,l);if(r&&i!=i){for(;l>u;)if((s=c[u++])!=s)return!0}else for(;l>u;u++)if((r||u in c)&&c[u]===i)return r||u||0;return!r&&-1}};return Jn={includes:r(!0),indexOf:r(!1)}}().indexOf,o=Wn(),i=e([].push);return er=function(e,a){var s,c=n(e),l=0,u=[];for(s in c)!t(o,s)&&t(c,s)&&i(u,s);for(;a.length>l;)t(c,s=a[l++])&&(~r(u,s)||i(u,s));return u},er}function dr(){return rr?nr:(rr=1,nr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}var mr,pr,fr,hr,gr,br,vr,yr,wr,Er,Sr,xr={};function kr(){if(fr)return pr;fr=1;var e=vt(),t=mt(),n=function(){if(or)return ir;or=1;var e=ur(),t=dr().concat("length","prototype");return ir.f=Object.getOwnPropertyNames||function(n){return e(n,t)},ir}(),r=(mr||(mr=1,xr.f=Object.getOwnPropertySymbols),xr),o=Sn(),i=t([].concat);return pr=e("Reflect","ownKeys")||function(e){var t=n.f(o(e)),a=r.f;return a?i(t,a(e)):t}}function Cr(){if(gr)return hr;gr=1;var e=on(),t=kr(),n=mn(),r=xn();return hr=function(o,i,a){for(var s=t(i),c=r.f,l=n.f,u=0;u<s.length;u++){var d=s[u];e(o,d)||a&&e(a,d)||c(o,d,l(i,d))}},hr}function Or(){if(wr)return yr;wr=1;var e=de(),t=mn().f,n=kn(),r=Un(),o=en(),i=Cr(),a=function(){if(vr)return br;vr=1;var e=Ee(),t=gt(),n=/#|\.prototype\./,r=function(n,r){var c=i[o(n)];return c==s||c!=a&&(t(r)?e(r):!!r)},o=r.normalize=function(e){return String(e).replace(n,".").toLowerCase()},i=r.data={},a=r.NATIVE="N",s=r.POLYFILL="P";return br=r}();return yr=function(s,c){var l,u,d,m,p,f=s.target,h=s.global,g=s.stat;if(l=h?e:g?e[f]||o(f,{}):(e[f]||{}).prototype)for(u in c){if(m=c[u],d=s.noTargetGet?(p=t(l,u))&&p.value:l[u],!a(h?u:f+(g?".":"#")+u,s.forced)&&void 0!==d){if(typeof m==typeof d)continue;i(m,d)}(s.sham||d&&d.sham)&&n(m,"sham",!0),r(l,u,m,s)}}}function Mr(){if(Sr)return Er;Sr=1;var e=de(),t=yt(),n=e.TypeError;return Er=function(e,r){if(t(r,e))return e;throw n("Incorrect invocation")}}var Rr,Tr,Ir,Ar,Dr,Fr,Br,Nr,_r,Pr,Lr,$r,jr,Wr,zr={};function Ur(){if(Tr)return Rr;Tr=1;var e=ur(),t=dr();return Rr=Object.keys||function(n){return e(n,t)}}function Vr(){if(Dr)return Ar;Dr=1;var e=vt();return Ar=e("document","documentElement")}function Hr(){if(Br)return Fr;Br=1;var e,t=Sn(),n=function(){if(Ir)return zr;Ir=1;var e=Se(),t=En(),n=xn(),r=Sn(),o=ht(),i=Ur();return zr.f=e&&!t?Object.defineProperties:function(e,t){r(e);for(var a,s=o(t),c=i(t),l=c.length,u=0;l>u;)n.f(e,a=c[u++],s[a]);return e},zr}(),r=dr(),o=Wn(),i=Vr(),a=un(),s=jn(),c="prototype",l="script",u=s("IE_PROTO"),d=function(){},m=function(e){return"<"+l+">"+e+"</"+l+">"},p=function(e){e.write(m("")),e.close();var t=e.parentWindow.Object;return e=null,t},f=function(){try{e=new ActiveXObject("htmlfile")}catch(e){}var t,n,o;f="undefined"!=typeof document?document.domain&&e?p(e):(n=a("iframe"),o="java"+l+":",n.style.display="none",i.appendChild(n),n.src=String(o),(t=n.contentWindow.document).open(),t.write(m("document.F=Object")),t.close(),t.F):p(e);for(var s=r.length;s--;)delete f[c][r[s]];return f()};return o[u]=!0,Fr=Object.create||function(e,r){var o;return null!==e?(d[c]=t(e),o=new d,d[c]=null,o[u]=e):o=f(),void 0===r?o:n.f(o,r)}}function qr(){if(_r)return Nr;_r=1;var e=Ee();return Nr=!e(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})}function Gr(){if(Lr)return Pr;Lr=1;var e=de(),t=on(),n=gt(),r=rn(),o=jn(),i=qr(),a=o("IE_PROTO"),s=e.Object,c=s.prototype;return Pr=i?s.getPrototypeOf:function(e){var o=r(e);if(t(o,a))return o[a];var i=o.constructor;return n(i)&&o instanceof i?i.prototype:o instanceof s?c:null}}function Kr(){if(jr)return $r;jr=1;var e,t,n,r=Ee(),o=gt(),i=Hr(),a=Gr(),s=Un(),c=sn(),l=Xt(),u=c("iterator"),d=!1;return[].keys&&("next"in(n=[].keys())?(t=a(a(n)))!==Object.prototype&&(e=t):d=!0),null==e||r(function(){var t={};return e[u].call(t)!==t})?e={}:l&&(e=i(e)),o(e[u])||s(e,u,function(){return this}),$r={IteratorPrototype:e,BUGGY_SAFARI_ITERATORS:d}}!function(){if(Wr)return ue;Wr=1;var e=Or(),t=de(),n=Mr(),r=gt(),o=kn(),i=Ee(),a=on(),s=sn(),c=Kr().IteratorPrototype,l=Xt(),u=s("toStringTag"),d=t.Iterator,m=l||!r(d)||d.prototype!==c||!i(function(){d({})}),p=function(){n(this,c)};a(c,u)||o(c,u,"Iterator"),!m&&a(c,"constructor")&&c.constructor!==Object||o(c,"constructor",p),p.prototype=c,e({global:!0,forced:m},{Iterator:p})}();var Qr,Yr,Zr,Jr,Xr,eo,to,no,ro,oo,io,ao,so,co,lo,uo,mo,po,fo,ho={};function go(){return Jr?Zr:(Jr=1,Zr={})}function bo(){if(eo)return Xr;eo=1;var e=sn(),t=go(),n=e("iterator"),r=Array.prototype;return Xr=function(e){return void 0!==e&&(t.Array===e||r[n]===e)}}function vo(){if(oo)return ro;oo=1;var e=de(),t=function(){if(no)return to;no=1;var e={};return e[sn()("toStringTag")]="z",to="[object z]"===String(e)}(),n=gt(),r=pt(),o=sn()("toStringTag"),i=e.Object,a="Arguments"==r(function(){return arguments}());return ro=t?r:function(e){var t,s,c;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(s=function(e,t){try{return e[t]}catch(e){}}(t=i(e),o))?s:a?r(t):"Object"==(c=r(t))&&n(t.callee)?"Arguments":c}}function yo(){if(ao)return io;ao=1;var e=vo(),t=Ot(),n=go(),r=sn()("iterator");return io=function(o){if(null!=o)return t(o,r)||t(o,"@@iterator")||n[e(o)]}}function wo(){if(co)return so;co=1;var e=de(),t=ke(),n=Ct(),r=Sn(),o=kt(),i=yo(),a=e.TypeError;return so=function(e,s){var c=arguments.length<2?i(e):s;if(n(c))return r(t(c,e));throw a(o(e)+" is not iterable")},so}function Eo(){if(uo)return lo;uo=1;var e=ke(),t=Sn(),n=Ot();return lo=function(r,o,i){var a,s;t(r);try{if(!(a=n(r,"return"))){if("throw"===o)throw i;return i}a=e(a,r)}catch(e){s=!0,a=e}if("throw"===o)throw i;if(s)throw a;return t(a),i}}function So(){if(po)return mo;po=1;var e=de(),t=function(){if(Yr)return Qr;Yr=1;var e=mt(),t=Ct(),n=xe(),r=e(e.bind);return Qr=function(e,o){return t(e),void 0===o?e:n?r(e,o):function(){return e.apply(o,arguments)}},Qr}(),n=ke(),r=Sn(),o=kt(),i=bo(),a=lr(),s=yt(),c=wo(),l=yo(),u=Eo(),d=e.TypeError,m=function(e,t){this.stopped=e,this.result=t},p=m.prototype;return mo=function(e,f,h){var g,b,v,y,w,E,S,x=h&&h.that,k=!(!h||!h.AS_ENTRIES),C=!(!h||!h.IS_ITERATOR),O=!(!h||!h.INTERRUPTED),M=t(f,x),R=function(e){return g&&u(g,"normal",e),new m(!0,e)},T=function(e){return k?(r(e),O?M(e[0],e[1],R):M(e[0],e[1])):O?M(e,R):M(e)};if(C)g=e;else{if(!(b=l(e)))throw d(o(e)+" is not iterable");if(i(b)){for(v=0,y=a(e);y>v;v++)if((w=T(e[v]))&&s(p,w))return w;return new m(!1)}g=c(e,b)}for(E=g.next;!(S=n(E,g)).done;){try{w=T(S.value)}catch(e){u(g,"throw",e)}if("object"==typeof w&&w&&s(p,w))return w}return new m(!1)}}!function(){if(fo)return ho;fo=1;var e=Or(),t=So(),n=Sn();e({target:"Iterator",proto:!0,real:!0},{forEach:function(e){t(n(this),e,{IS_ITERATOR:!0})}})}();var xo,ko={exports:{}};var Co=(xo||(xo=1,function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(e,t,r,i,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new o(r,i||e,a),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function a(e,t){0===--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,o=[];if(0===this._eventsCount)return o;for(r in e=this._events)t.call(e,r)&&o.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var o=0,i=r.length,a=new Array(i);o<i;o++)a[o]=r[o].fn;return a},s.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,o,i,a){var s=n?n+e:e;if(!this._events[s])return!1;var c,l,u=this._events[s],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,o),!0;case 5:return u.fn.call(u.context,t,r,o,i),!0;case 6:return u.fn.call(u.context,t,r,o,i,a),!0}for(l=1,c=new Array(d-1);l<d;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var m,p=u.length;for(l=0;l<p;l++)switch(u[l].once&&this.removeListener(e,u[l].fn,void 0,!0),d){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,t);break;case 3:u[l].fn.call(u[l].context,t,r);break;case 4:u[l].fn.call(u[l].context,t,r,o);break;default:if(!c)for(m=1,c=new Array(d-1);m<d;m++)c[m-1]=arguments[m];u[l].fn.apply(u[l].context,c)}}return!0},s.prototype.on=function(e,t,n){return i(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return i(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,r,o){var i=n?n+e:e;if(!this._events[i])return this;if(!t)return a(this,i),this;var s=this._events[i];if(s.fn)s.fn!==t||o&&!s.once||r&&s.context!==r||a(this,i);else{for(var c=0,l=[],u=s.length;c<u;c++)(s[c].fn!==t||o&&!s[c].once||r&&s[c].context!==r)&&l.push(s[c]);l.length?this._events[i]=1===l.length?l[0]:l:a(this,i)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s}(ko)),ko.exports);const Oo=new(Z(Co)),Mo={on:(e,t)=>Oo.on(e,t),once:(e,t)=>Oo.once(e,t),off:(e,t)=>Oo.off(e,t),emit:(e,...t)=>Oo.emit(e,...t)};Object.freeze(Mo);var Ro,To,Io,Ao,Do,Fo,Bo,No,_o,Po={};function Lo(){if(To)return Ro;To=1;var e=xe(),t=Function.prototype,n=t.apply,r=t.call;return Ro="object"==typeof Reflect&&Reflect.apply||(e?r.bind(n):function(){return r.apply(n,arguments)}),Ro}function $o(){if(Ao)return Io;Ao=1;var e=Un();return Io=function(t,n,r){for(var o in n)e(t,o,n[o],r);return t}}function jo(){if(Fo)return Do;Fo=1;var e=ke(),t=Ct(),n=Sn(),r=Hr(),o=kn(),i=$o(),a=sn(),s=zn(),c=Ot(),l=Kr().IteratorPrototype,u="IteratorProxy",d=s.set,m=s.getterFor(u),p=a("toStringTag");return Do=function(a,s){var f=function(e){e.type=u,e.next=t(e.iterator.next),e.done=!1,e.ignoreArg=!s,d(this,e)};return f.prototype=i(r(l),{next:function(t){var n=m(this),r=arguments.length?[n.ignoreArg?void 0:t]:s?[]:[void 0];n.ignoreArg=!1;var o=n.done?void 0:e(a,n,r);return{done:n.done,value:o}},return:function(t){var r=m(this),o=r.iterator;r.done=!0;var i=c(o,"return");return{done:!0,value:i?n(e(i,o,t)).value:t}},throw:function(t){var n=m(this),r=n.iterator;n.done=!0;var o=c(r,"throw");if(o)return e(o,r,t);throw t}}),s||o(f.prototype,p,"Generator"),f},Do}function Wo(){if(No)return Bo;No=1;var e=Sn(),t=Eo();return Bo=function(n,r,o,i){try{return i?r(e(o)[0],o[1]):r(o)}catch(e){t(n,"throw",e)}}}!function(){if(_o)return Po;_o=1;var e=Or(),t=Lo(),n=Ct(),r=Sn(),o=jo(),i=Wo(),a=o(function(e){for(var n,o,a=this.iterator,s=this.filterer,c=this.next;;){if(n=r(t(c,a,e)),this.done=!!n.done)return;if(o=n.value,i(a,s,o))return o}});e({target:"Iterator",proto:!0,real:!0},{filter:function(e){return new a({iterator:r(this),filterer:n(e)})}})}();var zo,Uo={};function Vo(e){return"function"==typeof e}function Ho(e){return null==e}function qo(e){return!Ho(e)&&"object"==typeof e&&!Array.isArray(e)}function Go(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Ko(e,n,r){return t.createElement("div",{style:{padding:"0 20px"}},e)}function Qo(e){return(e||window).document.documentElement.clientHeight}function Yo(e){return-1!==["available","attached","streaming"].indexOf(e)}!function(){if(zo)return Uo;zo=1;var e=Or(),t=Lo(),n=Ct(),r=Sn(),o=jo(),i=Wo(),a=o(function(e){var n=this.iterator,o=r(t(this.next,n,e));if(!(this.done=!!o.done))return i(n,this.mapper,o.value)});e({target:"Iterator",proto:!0,real:!0},{map:function(e){return new a({iterator:r(this),mapper:n(e)})}})}();const Zo={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},Jo={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},Xo={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},ei={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},ti={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class ni{static getFirstMatch(e,t){const n=t.match(e);return n&&n.length>0&&n[1]||""}static getSecondMatch(e,t){const n=t.match(e);return n&&n.length>1&&n[2]||""}static matchAndReturnConst(e,t,n){if(e.test(t))return n}static getWindowsVersionName(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(e){const t=e.split(".").splice(0,2).map(e=>parseInt(e,10)||0);if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}static getAndroidVersionName(e){const t=e.split(".").splice(0,2).map(e=>parseInt(e,10)||0);if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0}static getVersionPrecision(e){return e.split(".").length}static compareVersions(e,t,n=!1){const r=ni.getVersionPrecision(e),o=ni.getVersionPrecision(t);let i=Math.max(r,o),a=0;const s=ni.map([e,t],e=>{const t=i-ni.getVersionPrecision(e),n=e+new Array(t+1).join(".0");return ni.map(n.split("."),e=>new Array(20-e.length).join("0")+e).reverse()});for(n&&(a=i-Math.min(r,o)),i-=1;i>=a;){if(s[0][i]>s[1][i])return 1;if(s[0][i]===s[1][i]){if(i===a)return 0;i-=1}else if(s[0][i]<s[1][i])return-1}}static map(e,t){const n=[];let r;if(Array.prototype.map)return Array.prototype.map.call(e,t);for(r=0;r<e.length;r+=1)n.push(t(e[r]));return n}static find(e,t){let n,r;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,r=e.length;n<r;n+=1){const r=e[n];if(t(r,n))return r}}static assign(e,...t){const n=e;let r,o;if(Object.assign)return Object.assign(e,...t);for(r=0,o=t.length;r<o;r+=1){const e=t[r];if("object"==typeof e&&null!==e){Object.keys(e).forEach(t=>{n[t]=e[t]})}}return e}static getBrowserAlias(e){return Zo[e]}static getBrowserTypeByAlias(e){return Jo[e]||""}}const ri=/version\/(\d+(\.?_?\d+)+)/i,oi=[{test:[/googlebot/i],describe(e){const t={name:"Googlebot"},n=ni.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||ni.getFirstMatch(ri,e);return n&&(t.version=n),t}},{test:[/opera/i],describe(e){const t={name:"Opera"},n=ni.getFirstMatch(ri,e)||ni.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe(e){const t={name:"Opera"},n=ni.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||ni.getFirstMatch(ri,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe(e){const t={name:"Samsung Internet for Android"},n=ni.getFirstMatch(ri,e)||ni.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe(e){const t={name:"NAVER Whale Browser"},n=ni.getFirstMatch(ri,e)||ni.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe(e){const t={name:"MZ Browser"},n=ni.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||ni.getFirstMatch(ri,e);return n&&(t.version=n),t}},{test:[/focus/i],describe(e){const t={name:"Focus"},n=ni.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||ni.getFirstMatch(ri,e);return n&&(t.version=n),t}},{test:[/swing/i],describe(e){const t={name:"Swing"},n=ni.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||ni.getFirstMatch(ri,e);return n&&(t.version=n),t}},{test:[/coast/i],describe(e){const t={name:"Opera Coast"},n=ni.getFirstMatch(ri,e)||ni.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(e){const t={name:"Opera Touch"},n=ni.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||ni.getFirstMatch(ri,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe(e){const t={name:"Yandex Browser"},n=ni.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||ni.getFirstMatch(ri,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe(e){const t={name:"UC Browser"},n=ni.getFirstMatch(ri,e)||ni.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe(e){const t={name:"Maxthon"},n=ni.getFirstMatch(ri,e)||ni.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe(e){const t={name:"Epiphany"},n=ni.getFirstMatch(ri,e)||ni.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe(e){const t={name:"Puffin"},n=ni.getFirstMatch(ri,e)||ni.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe(e){const t={name:"Sleipnir"},n=ni.getFirstMatch(ri,e)||ni.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe(e){const t={name:"K-Meleon"},n=ni.getFirstMatch(ri,e)||ni.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe(e){const t={name:"WeChat"},n=ni.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||ni.getFirstMatch(ri,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe(e){const t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=ni.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||ni.getFirstMatch(ri,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe(e){const t={name:"Internet Explorer"},n=ni.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe(e){const t={name:"Microsoft Edge"},n=ni.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe(e){const t={name:"Microsoft Edge"},n=ni.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe(e){const t={name:"Vivaldi"},n=ni.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe(e){const t={name:"SeaMonkey"},n=ni.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe(e){const t={name:"Sailfish"},n=ni.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe(e){const t={name:"Amazon Silk"},n=ni.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe(e){const t={name:"PhantomJS"},n=ni.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe(e){const t={name:"SlimerJS"},n=ni.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t={name:"BlackBerry"},n=ni.getFirstMatch(ri,e)||ni.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe(e){const t={name:"WebOS Browser"},n=ni.getFirstMatch(ri,e)||ni.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe(e){const t={name:"Bada"},n=ni.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe(e){const t={name:"Tizen"},n=ni.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||ni.getFirstMatch(ri,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe(e){const t={name:"QupZilla"},n=ni.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||ni.getFirstMatch(ri,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe(e){const t={name:"Firefox"},n=ni.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe(e){const t={name:"Electron"},n=ni.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe(e){const t={name:"Miui"},n=ni.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe(e){const t={name:"Chromium"},n=ni.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||ni.getFirstMatch(ri,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe(e){const t={name:"Chrome"},n=ni.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe(e){const t={name:"Google Search"},n=ni.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t={name:"Android Browser"},n=ni.getFirstMatch(ri,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe(e){const t={name:"PlayStation 4"},n=ni.getFirstMatch(ri,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe(e){const t={name:"Safari"},n=ni.getFirstMatch(ri,e);return n&&(t.version=n),t}},{test:[/.*/i],describe(e){const t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:ni.getFirstMatch(t,e),version:ni.getSecondMatch(t,e)}}}];var ii=[{test:[/Roku\/DVP/],describe(e){const t=ni.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:ei.Roku,version:t}}},{test:[/windows phone/i],describe(e){const t=ni.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:ei.WindowsPhone,version:t}}},{test:[/windows /i],describe(e){const t=ni.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=ni.getWindowsVersionName(t);return{name:ei.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(e){const t={name:ei.iOS},n=ni.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe(e){const t=ni.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=ni.getMacOSVersionName(t),r={name:ei.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe(e){const t=ni.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:ei.iOS,version:t}}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t=ni.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=ni.getAndroidVersionName(t),r={name:ei.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe(e){const t=ni.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:ei.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t=ni.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||ni.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||ni.getFirstMatch(/\bbb(\d+)/i,e);return{name:ei.BlackBerry,version:t}}},{test:[/bada/i],describe(e){const t=ni.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:ei.Bada,version:t}}},{test:[/tizen/i],describe(e){const t=ni.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:ei.Tizen,version:t}}},{test:[/linux/i],describe:()=>({name:ei.Linux})},{test:[/CrOS/],describe:()=>({name:ei.ChromeOS})},{test:[/PlayStation 4/],describe(e){const t=ni.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:ei.PlayStation4,version:t}}}],ai=[{test:[/googlebot/i],describe:()=>({type:"bot",vendor:"Google"})},{test:[/huawei/i],describe(e){const t=ni.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:Xo.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:()=>({type:Xo.tablet,vendor:"Nexus"})},{test:[/ipad/i],describe:()=>({type:Xo.tablet,vendor:"Apple",model:"iPad"})},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:()=>({type:Xo.tablet,vendor:"Apple",model:"iPad"})},{test:[/kftt build/i],describe:()=>({type:Xo.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"})},{test:[/silk/i],describe:()=>({type:Xo.tablet,vendor:"Amazon"})},{test:[/tablet(?! pc)/i],describe:()=>({type:Xo.tablet})},{test(e){const t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe(e){const t=ni.getFirstMatch(/(ipod|iphone)/i,e);return{type:Xo.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:()=>({type:Xo.mobile,vendor:"Nexus"})},{test:[/[^-]mobi/i],describe:()=>({type:Xo.mobile})},{test:e=>"blackberry"===e.getBrowserName(!0),describe:()=>({type:Xo.mobile,vendor:"BlackBerry"})},{test:e=>"bada"===e.getBrowserName(!0),describe:()=>({type:Xo.mobile})},{test:e=>"windows phone"===e.getBrowserName(),describe:()=>({type:Xo.mobile,vendor:"Microsoft"})},{test(e){const t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:()=>({type:Xo.tablet})},{test:e=>"android"===e.getOSName(!0),describe:()=>({type:Xo.mobile})},{test:e=>"macos"===e.getOSName(!0),describe:()=>({type:Xo.desktop,vendor:"Apple"})},{test:e=>"windows"===e.getOSName(!0),describe:()=>({type:Xo.desktop})},{test:e=>"linux"===e.getOSName(!0),describe:()=>({type:Xo.desktop})},{test:e=>"playstation 4"===e.getOSName(!0),describe:()=>({type:Xo.tv})},{test:e=>"roku"===e.getOSName(!0),describe:()=>({type:Xo.tv})}],si=[{test:e=>"microsoft edge"===e.getBrowserName(!0),describe(e){if(/\sedg\//i.test(e))return{name:ti.Blink};const t=ni.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:ti.EdgeHTML,version:t}}},{test:[/trident/i],describe(e){const t={name:ti.Trident},n=ni.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:e=>e.test(/presto/i),describe(e){const t={name:ti.Presto},n=ni.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe(e){const t={name:ti.Gecko},n=ni.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:()=>({name:ti.Blink})},{test:[/(apple)?webkit/i],describe(e){const t={name:ti.WebKit},n=ni.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];class ci{constructor(e,t=!1){if(null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}getUA(){return this._ua}test(e){return e.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const e=ni.find(oi,e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.browser=e.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const e=ni.find(ii,e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.os=e.describe(this.getUA())),this.parsedResult.os}getOSName(e){const{name:t}=this.getOS();return e?String(t).toLowerCase()||"":t||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(e=!1){const{type:t}=this.getPlatform();return e?String(t).toLowerCase()||"":t||""}parsePlatform(){this.parsedResult.platform={};const e=ni.find(ai,e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.platform=e.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const e=ni.find(si,e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.engine=e.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return ni.assign({},this.parsedResult)}satisfies(e){const t={};let n=0;const r={};let o=0;if(Object.keys(e).forEach(i=>{const a=e[i];"string"==typeof a?(r[i]=a,o+=1):"object"==typeof a&&(t[i]=a,n+=1)}),n>0){const e=Object.keys(t),n=ni.find(e,e=>this.isOS(e));if(n){const e=this.satisfies(t[n]);if(void 0!==e)return e}const r=ni.find(e,e=>this.isPlatform(e));if(r){const e=this.satisfies(t[r]);if(void 0!==e)return e}}if(o>0){const e=Object.keys(r),t=ni.find(e,e=>this.isBrowser(e,!0));if(void 0!==t)return this.compareVersion(r[t])}}isBrowser(e,t=!1){const n=this.getBrowserName().toLowerCase();let r=e.toLowerCase();const o=ni.getBrowserTypeByAlias(r);return t&&o&&(r=o.toLowerCase()),r===n}compareVersion(e){let t=[0],n=e,r=!1;const o=this.getBrowserVersion();if("string"==typeof o)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),t.indexOf(ni.compareVersions(o,n,r))>-1}isOS(e){return this.getOSName(!0)===String(e).toLowerCase()}isPlatform(e){return this.getPlatformType(!0)===String(e).toLowerCase()}isEngine(e){return this.getEngineName(!0)===String(e).toLowerCase()}is(e,t=!1){return this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)}some(e=[]){return e.some(e=>this.is(e))}}
|
|
2
|
+
/*!
|
|
3
|
+
* Bowser - a browser detector
|
|
4
|
+
* https://github.com/lancedikson/bowser
|
|
5
|
+
* MIT License | (c) Dustin Diaz 2012-2015
|
|
6
|
+
* MIT License | (c) Denis Demchenko 2015-2019
|
|
7
|
+
*/const li=class{static getParser(e,t=!1){if("string"!=typeof e)throw new Error("UserAgent should be a string");return new ci(e,t)}static parse(e){return new ci(e).getResult()}static get BROWSER_MAP(){return Jo}static get ENGINE_MAP(){return ti}static get OS_MAP(){return ei}static get PLATFORMS_MAP(){return Xo}}.getParser(window.navigator.userAgent),ui="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,di=li.getOSName(!0);let mi=window.navigator.userAgent.match("; KF");function pi(){return function(){if("tablet"===li.getPlatformType(!0)||hi())return!0;return!1}()||"mobile"===li.getPlatformType(!0)}function fi(){return pi()&&navigator.userAgent.includes("Android")}function hi(){return!!li.satisfies({macos:{safari:">=13"}})&&ui}function gi(){return li}function bi(){return li.isBrowser("safari",!0)}function vi(){return"macos"===di}function yi(){return"ios"===di}function wi(e){window.navigator.userAgentData?.getHighEntropyValues&&window.navigator.userAgentData.getHighEntropyValues(["model"]).then(t=>{e.info(`Connection starting with device model: ${t.model}, platform: ${t.platform}`),mi=!!t.model.startsWith("KF")})}const Ei="auto-hide",Si="Auto-hide toolbar",xi="Automatically hide the toolbar and display it only moving the mouse to the top border.",ki="auto-hide-fullscreen",Ci="Auto-hide toolbar only in full screen",Oi="Fix the bar on the top only in windowed mode.",Mi="Always display the toolbar",Ri="Fix the bar on the top.",Ti="Light mode",Ii="Dark mode",Ai="System default",Di={label:"Best responsiveness",description:"Provide most fluid experience.",minQuality:20,maxQuality:90},Fi={label:"Best quality",description:"Provide best image quality.",minQuality:70,maxQuality:90},Bi="adaptive",Ni="current",_i=[{width:1920,height:1080},{width:1440,height:900},{width:1024,height:768},{width:800,height:600}],Pi=()=>[...pi()&&!mi?[{width:2560,height:1440},{width:2048,height:1080}]:[],{width:1920,height:1080},{width:1440,height:900},{width:1024,height:768},{width:800,height:600}],Li=()=>[...pi()&&!mi?[{width:1215,height:2160},{width:1080,height:2048}]:[],{width:1080,height:1920},{width:900,height:1440},{width:768,height:1024},{width:600,height:800}];let $i;function ji(){return window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)")&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener&&window.matchMedia("(prefers-color-scheme: dark)").removeEventListener}function Wi(){return $i}ji()&&($i=window.matchMedia("(prefers-color-scheme: dark)"));const zi=(e,t)=>{P(e.matches?L.Dark:L.Light,t)},Ui=(e,t)=>{switch(e){case Ai:$i&&zi($i,t);break;case Ti:P(L.Light,t);break;case Ii:P(L.Dark,t)}},Vi=se("Settings");let Hi=null;try{Hi=window.localStorage}catch(e){Vi.warn(`Settings persistence disabled. Error accessing local storage: ${e.message}`)}const qi={sessionId:"",authToken:"",extensionData:"",promptReconnect:!0,logLevel:"info",wss:!0,enabledChannels:[],customChannels:[],displayCodecs:[],enableQU:!0,minQuality:30,maxQuality:0,maxDisplayWidth:0,maxDisplayHeight:0,minDisplayWidth:640,minDisplayHeight:480,debugLayer:!1,enableGraphicsDebugLayer:!1,clientHiDpiScaling:!0,enableHighPixelDensity:!1,enableWebCodecs:!0,losslessColorspace:"rgb",dynamicResolution:!0,enableShortcutEditor:!1,enableWebAuthN:!1,scaleToFit:Boolean(pi()),volume:100,microphone:!1,webcam:!1,macOptionToAlt:!0,macCommandToControl:!1,controlToCommand:!0,appearanceMode:ji()?Ai:Ti,toolbarBehavior:Ci,displayQuality:Di.label,metricsEnabled:!1,selectedResolution:Bi,selectedWebcamId:null,highColorAccuracy:!1,forceKeyboardCombinations:!1,timezoneRedirectionEnabled:!1};function Gi(){Hi?.setItem("dcv-settings",JSON.stringify(qi))}function Ki(){return Ki=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ki.apply(null,arguments)}var Qi=function(t){return e.createElement("svg",Ki({xmlns:"http://www.w3.org/2000/svg",width:39,height:70,viewBox:"0 0 39 69"},t),e.createElement("path",{d:"M20.3 0v28.441H0C0 19.688.871 12.38 7.047 5.793 10.664 2.512 15.324 0 20.3 0M1.602 29.496H39c.031 3.8.066 7.606.102 11.524.02 1.78.02 1.78.043 3.601l.011 2.879.024 1.469c.004 5.89-1.73 10.855-5.875 15.16-4.442 3.988-8.883 5.082-14.785 5.012-5.645-.403-9.41-2.934-13.176-6.989-3.485-4.297-3.903-8.804-3.844-14.14v-1.43c.008-1.746.023-3.488.035-5.234.024-3.91.043-7.82.067-11.852m2.671 2.633c-.043 3.27-.085 6.539-.132 9.91-.02 1.02-.04 2.04-.059 3.09-.074 6.684.492 12.016 5.379 17.05 3.402 2.852 7.371 4.368 11.828 4.301 4.969-.496 8.555-3.59 11.871-7.011 3.754-5.567 3.43-11.274 3.3-17.696-.042-3.18-.085-6.363-.132-9.644zM21.371 5.266c5.68.625 10.29 2.14 14.211 6.394C39.437 16.723 39 20.762 39 27.39H21.371zm2.672 3.16v16.328h12.285c0-4.79-.66-7.832-3.738-11.586-2.824-2.57-4.742-3.668-8.547-4.742m0 0",style:{stroke:"none",fillRule:"nonzero",fillOpacity:1}}))};function Yi(){return Yi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yi.apply(null,arguments)}var Zi=function(t){return e.createElement("svg",Yi({xmlns:"http://www.w3.org/2000/svg",width:39,height:70,viewBox:"0 0 39 69"},t),e.createElement("path",{d:"M18.7 0c6.597.813 11.296 3.305 15.491 8.426C38.578 14.703 39 20.914 39 28.44H18.7zM0 29.496h37.398c.032 3.89.067 7.777.098 11.785l.047 3.688.012 2.941.023 1.504c.004 6.121-1.738 10.356-5.941 14.797-3.617 3.445-7.672 4.871-12.672 5.05-5.242-.183-9.813-1.945-13.621-5.527-3.43-3.773-5.418-7.879-5.406-13.011 0-.48.003-.961.003-1.457s.004-.996.008-1.508v-1.406q.008-2.585.016-5.168zm2.672 2.633c-.035 3.293-.067 6.586-.102 9.976-.015 1.028-.027 2.06-.043 3.118l-.011 2.492q-.011.626-.028 1.27c0 5.027 1.614 8.91 4.992 12.64 3.106 3.063 6.875 4.824 11.286 4.973 4.761-.227 9.214-2.45 12.527-5.828 2.953-3.77 3.68-7.997 3.59-12.645 0-.406-.004-.816-.004-1.238-.008-1.508-.031-3.012-.05-4.52-.036-3.379-.067-6.758-.102-10.238zM17.629 5.266V27.39H0c0-11.95 0-11.95 4.777-16.95C8.57 7.133 12.563 5.266 17.63 5.266M6.164 12.793c-3.21 3.523-3.492 7.324-3.492 11.96h12.285V8.427c-3.363 0-6.36 2.21-8.793 4.367m0 0",style:{stroke:"none",fillRule:"nonzero",fillOpacity:1}}))};let Ji,Xi,ea={},ta=[];function na(e){Xi.queryFeature(e).then(t=>{Vo(ea[e])&&ea[e](t)}).catch(t=>{Ji.info(`Query for ${e} denied with message: ${t.message}`)})}function ra(e){e.length>0&&function(e){e.forEach(e=>{-1!==Object.keys(ea).indexOf(e)?na(e):(ta.push(e),Ji&&Ji.info(`No callback for feature ${e} adding to pending.`))})}(e)}function oa(e,t){e&&Vo(t)?(ea[e]=t,Ji.info(`Added feature listener for: ${e}`),Ji.debug(`Callbacks ${Object.keys(ea)}`),Ji.debug(`Pending updates ${ta}`),-1!==ta.indexOf(e)&&(na(e),ta.splice(ta.indexOf(e),1))):Ji.warn("Wrong parameters for addFeatureListener")}const ia=vi()||yi()?"⌘":"CTRL",aa=pi()?"":`[${ia}+C]`,sa=pi()?"":`[${ia}+V]`,ca=`Press ${aa} to copy content from remote clipboard.`,la=`Press ${sa} to paste content to remote clipboard.`,ua="Clipboard synced",da="success",ma=se("Clipboard");let pa="",fa="",ha=!1;function ga({connection:e,copyEnabled:n,pasteEnabled:o,currentWindow:i}){const[a,s]=t.useState(!1),[c,l]=t.useState(""),[b,v]=t.useState({}),[y,w]=t.useState({}),E=()=>{s(!1),e.captureClipboardEvents(!1,i)},S=(e,t)=>{a?(v({status:e,message:t}),i.document.getElementById("modal-popover-trigger").click()):(w({status:e,message:t}),i.document.getElementById("icon-popover-trigger").click())},x=()=>{ha||(S(da,ua),("string"==typeof pa||pa instanceof String)&&l(pa))},k=()=>{ha||(S(da,ua),("string"==typeof fa||fa instanceof String)&&l(fa))},C=()=>{S("error","The clipboard data is too large to be transferred"),ha=!0},O=e=>{switch(ma.info(`Received clipboard event ${e.name}`),e.name){case"established":break;case"copy":case"autoCopyDone":x();break;case"paste":case"autoPasteDone":k();break;case"dataSizeAlert":C();break;case"remoteError":"dataSizeAlert"===e.error&&C();break;case"newDataAvailable":e.autoCopy||S("info","Use the clipboard to copy data locally or remotely."),pa=e.clipboardData["text/plain"],ha=!1;break;case"pasteAvailableData":fa=e.clipboardData,ha=!1;break;default:ma.info("Unknown clipboard event.")}};return r(()=>(Mo.on("clipboard",O),()=>{Mo.off("clipboard",O)}),[i,a]),t.createElement("div",null,t.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"start",alignItems:"start"}},t.createElement("div",{style:{height:0}},t.createElement(u,{dismissButton:!1,position:"bottom",size:"large",triggerType:"custom",content:t.createElement(d,{type:y.status},y.message)},t.createElement("div",{id:"icon-popover-trigger"}))),t.createElement("div",{title:"Clipboard"},t.createElement(m,{iconName:"copy",variant:"icon",onClick:()=>{s(!0),l(""),e.captureClipboardEvents(!0,i)}}))),t.createElement(p,{onDismiss:E,visible:a,size:"large",header:"Copy and paste",footer:t.createElement(f,{float:"right"},t.createElement(m,{variant:"primary",onClick:E},"Done")),modalRoot:i.document.body},t.createElement(h,{size:"xl"},pi()?t.createElement(h,{size:"m",direction:"horizontal"},n&&t.createElement(m,{onClick:()=>e.syncClipboards()},ca),o&&t.createElement(m,{onClick:async()=>{const e=await navigator.clipboard.readText().catch(()=>{ma.warn("There was an error trying to gather clipboard text")}),t=new ClipboardEvent("paste",{dataType:"text/plain",clipboardData:new DataTransfer});e&&(t.clipboardData.items.add(e,"text/plain"),i.document.dispatchEvent(t))}},la)):t.createElement(f,null,n&&t.createElement(f,{variant:"p"},ca),o&&t.createElement(f,{variant:"p"},la)),t.createElement(f,{variant:"p",margin:{bottom:"xs"}},"Content preview")),t.createElement("div",{style:{margin:"auto",width:"1px",height:0}},t.createElement(u,{dismissButton:!1,position:"top",size:"large",triggerType:"custom",content:t.createElement(d,{type:b.status},b.message)},t.createElement("div",{id:"modal-popover-trigger",style:{marginTop:"19.5px"}}))),t.createElement(g,{controlId:"textarea",value:(M=c,M.substring(0,5e3).replace(/\0/g,"").concat(M.length>5e3?" ...":"")),readOnly:!0,rows:10})));var M}ga.propTypes={connection:c.object,copyEnabled:c.bool,pasteEnabled:c.bool,currentWindow:c.object};var ba,va,ya,wa,Ea,Sa,xa,ka,Ca,Oa,Ma,Ra=n(ga),Ta={};function Ia(){if(va)return ba;va=1;var e=de(),t=lr(),n=ar(),r=e.RangeError;return ba=function(e,o,i,a){var s=t(e),c=n(i),l=c<0?s+c:c;if(l>=s||l<0)throw r("Incorrect index");for(var u=new o(s),d=0;d<s;d++)u[d]=d===l?a:e[d];return u}}function Aa(){if(Sa)return Ea;Sa=1;var e=de(),t=gt(),n=e.String,r=e.TypeError;return Ea=function(e){if("object"==typeof e||t(e))return e;throw r("Can't set "+n(e)+" as a prototype")}}function Da(){if(ka)return xa;ka=1;var e=mt(),t=Sn(),n=Aa();return xa=Object.setPrototypeOf||("__proto__"in{}?function(){var r,o=!1,i={};try{(r=e(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(i,[]),o=i instanceof Array}catch(e){}return function(e,i){return t(e),n(i),o?r(e,i):e.__proto__=i,e}}():void 0)}function Fa(){if(Oa)return Ca;Oa=1;var e,t,n,r=wa?ya:(wa=1,ya="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView),o=Se(),i=de(),a=gt(),s=bt(),c=on(),l=vo(),u=kt(),d=kn(),m=Un(),p=xn().f,f=yt(),h=Gr(),g=Da(),b=sn(),v=an(),y=i.Int8Array,w=y&&y.prototype,E=i.Uint8ClampedArray,S=E&&E.prototype,x=y&&h(y),k=w&&h(w),C=Object.prototype,O=i.TypeError,M=b("toStringTag"),R=v("TYPED_ARRAY_TAG"),T=v("TYPED_ARRAY_CONSTRUCTOR"),I=r&&!!g&&"Opera"!==l(i.opera),A=!1,D={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},F={BigInt64Array:8,BigUint64Array:8},B=function(e){if(!s(e))return!1;var t=l(e);return c(D,t)||c(F,t)};for(e in D)(n=(t=i[e])&&t.prototype)?d(n,T,t):I=!1;for(e in F)(n=(t=i[e])&&t.prototype)&&d(n,T,t);if((!I||!a(x)||x===Function.prototype)&&(x=function(){throw O("Incorrect invocation")},I))for(e in D)i[e]&&g(i[e],x);if((!I||!k||k===C)&&(k=x.prototype,I))for(e in D)i[e]&&g(i[e].prototype,k);if(I&&h(S)!==k&&g(S,k),o&&!c(k,M))for(e in A=!0,p(k,M,{get:function(){return s(this)?this[R]:void 0}}),D)i[e]&&d(i[e],R,e);return Ca={NATIVE_ARRAY_BUFFER_VIEWS:I,TYPED_ARRAY_CONSTRUCTOR:T,TYPED_ARRAY_TAG:A&&R,aTypedArray:function(e){if(B(e))return e;throw O("Target is not a typed array")},aTypedArrayConstructor:function(e){if(a(e)&&(!g||f(x,e)))return e;throw O(u(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,n,r){if(o){if(n)for(var a in D){var s=i[a];if(s&&c(s.prototype,e))try{delete s.prototype[e]}catch(n){try{s.prototype[e]=t}catch(e){}}}k[e]&&!n||m(k,e,n?t:I&&w[e]||t,r)}},exportTypedArrayStaticMethod:function(e,t,n){var r,a;if(o){if(g){if(n)for(r in D)if((a=i[r])&&c(a,e))try{delete a[e]}catch(e){}if(x[e]&&!n)return;try{return m(x,e,n?t:I&&x[e]||t)}catch(e){}}for(r in D)!(a=i[r])||a[e]&&!n||m(a,e,t)}},isView:function(e){if(!s(e))return!1;var t=l(e);return"DataView"===t||c(D,t)||c(F,t)},isTypedArray:B,TypedArray:x,TypedArrayPrototype:k}}!function(){if(Ma)return Ta;Ma=1;var e=Ia(),t=Fa(),n=t.aTypedArray,r=t.exportTypedArrayMethod,o=t.TYPED_ARRAY_CONSTRUCTOR;r("with",{with:function(t,r){return e(n(this),this[o],t,r)}}.with)}();var Ba,Na,_a,Pa,La,$a,ja,Wa,za,Ua,Va,Ha={};function qa(){if(Na)return Ba;Na=1;var e=gt(),t=bt(),n=Da();return Ba=function(r,o,i){var a,s;return n&&e(a=o.constructor)&&a!==i&&t(s=a.prototype)&&s!==i.prototype&&n(r,s),r}}function Ga(){if(Pa)return _a;Pa=1;var e=de(),t=vo(),n=e.String;return _a=function(e){if("Symbol"===t(e))throw TypeError("Cannot convert a Symbol value to a string");return n(e)}}function Ka(){if($a)return La;$a=1;var e=Ga();return La=function(t,n){return void 0===t?arguments.length<2?"":n:e(t)},La}function Qa(){if(Ua)return za;Ua=1;var e=mt()("".replace),t=String(Error("zxcasd").stack),n=/\n\s*at [^:]*:[^\n]*/,r=n.test(t);return za=function(t,o){if(r&&"string"==typeof t)for(;o--;)t=e(t,n,"");return t}}!function(){if(Va)return Ha;Va=1;var e=Or(),t=vt(),n=dt(),r=xn().f,o=on(),i=Mr(),a=qa(),s=Ka(),c=Wa?ja:(Wa=1,ja={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}),l=Qa(),u=Xt(),d="DOMException",m=t("Error"),p=t(d),f=function(){i(this,h);var e=arguments.length,t=s(e<1?void 0:arguments[0]),o=s(e<2?void 0:arguments[1],"Error"),c=new p(t,o),u=m(t);return u.name=d,r(c,"stack",n(1,l(u.stack,1))),a(c,this,f),c},h=f.prototype=p.prototype,g="stack"in m(d),b="stack"in new p(1,2),v=g&&!b;e({global:!0,forced:u||v},{DOMException:v?f:p});var y=t(d),w=y.prototype;if(w.constructor!==y)for(var E in u||r(w,"constructor",n(1,y)),c)if(o(c,E)){var S=c[E],x=S.s;o(y,x)||r(y,x,n(6,S.c))}}();const Ya=`OS: ${hi()?`iOS ${gi().getBrowserVersion()}(Desktop Mode on iOS Safari detected, estimating version from Safari)`:`${gi().getOSName()} ${gi().getOSVersion()}`}\nBrowser version: ${gi().getBrowserName()} ${gi().getBrowserVersion()} with ${gi().getEngineName()} engine\nPlatform: ${hi()?" Tablet (Desktop Mode on iOS Safari detected)":gi().getPlatformType()}\nWeb SDK version: ${l.version.versionStr}`,Za=se("About");function Ja(e){const[n,o]=t.useState(""),[i,a]=t.useState("");return r(()=>{null!==e.connection&&(o(Xa(e.connection.getServerInfo())),fetch("third-party-licenses.txt").then(e=>{const t=`Status code: ${e.status}, Status Text: ${e.statusText}`;if(Za.debug(`Received response. ${t}`),[...e.headers.entries()].forEach(e=>Za.debug(`Header: ${e[0]} with value: ${e[1]}`)),!e.ok)throw new Error(t);return e.text()}).then(e=>a(e)).catch(e=>Za.warn(`Failed to fetch resource. Error: ${e}`)))},[e.connection]),t.createElement(p,{onDismiss:e.onDismiss,visible:e.visible,size:"large",header:"About Amazon DCV",modalRoot:window.document.body,disableContentPaddings:!0,footer:t.createElement(b,{gridDefinition:[{colspan:7},{colspan:5}]},t.createElement(f,null,"Copyright © 2017-2024, NICE s.r.l. or its affiliates. All rights reserved."),t.createElement(f,{float:"right"},t.createElement(v,{external:!0,externalIconAriaLabel:"Opens in a new tab",href:"EULA.txt"},"End User License Agreement")))},t.createElement(y,{tabs:[{label:"Client",id:"about-client",content:Ko(t.createElement(g,{rows:10,readOnly:!0,value:Ya}))},{label:"Server",id:"about-server",content:Ko(t.createElement(g,{rows:10,readOnly:!0,value:n}))},{label:"Third party notices",id:"third-party-notices",content:Ko(t.createElement(g,{rows:10,readOnly:!0,value:i}))}]}))}function Xa(e,t){let n="";return Object.keys(e).forEach(r=>{"version"===r?n+=`${Go(r)}: ${e[r].major}.${e[r].minor}.${e[r].revision}\n`:qo(e[r])?n+=Xa(e[r],Go(r)):n+=t?`${t}-${r}: ${e[r]}\n`:`${Go(r)}: ${e[r]}\n`}),n}var es;function ts(){return ts=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ts.apply(null,arguments)}Ja.propTypes={connection:c.object,visible:c.bool,onDismiss:c.func};var ns=function(t){return e.createElement("svg",ts({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve","aria-hidden":"true",viewBox:"0 0 16 16"},t),es||(es=e.createElement("path",{d:"M15 6h-5V1M1 6h5V1M1 10h5v5M15 10h-5v5M1 1l5 5M15 1l-5 5M6 10l-5 5M10 10l5 5"})))};const rs=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],os=se("Fullscreen");function is(e){return Boolean(e.fullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||e.msFullscreenElement)}function as({setFullscreen:e,currentDocument:n}){const[o,i]=t.useState(!1),a=()=>{const t=is(n);i(t),e(t)},s=()=>n.fullscreenEnabled||n.webkitFullscreenEnabled||n.mozFullScreenEnabled||n.msFullscreenEnabled;return r(()=>(s()&&rs.forEach(e=>n.addEventListener(e,a)),()=>{s()&&rs.forEach(e=>n.removeEventListener(e,a))}),[n,e]),t.createElement("div",{title:"Full Screen"},t.createElement(m,K({},o?{iconSvg:t.createElement(ns,null)}:{iconName:"expand"},{variant:"icon",onClick:()=>{is(n)?(n.exitFullscreen&&n.exitFullscreen(),navigator?.keyboard?.unlock()):(()=>{const e=n.documentElement;e.requestFullscreen&&e.requestFullscreen(),navigator.permissions.query({name:"keyboard-lock"}).then(e=>{"denied"!==e?.state?(os.info("granted"===e?.state?"Keyboard lock enabled":"Requesting permission to lock keyboard"),navigator?.keyboard?.lock().catch(()=>{})):os.info("Keyboard lock permission denied")}).catch(()=>{os.debug("Keyboard-lock permission not supported by browser, defaulting to normal behaviour"),navigator?.keyboard?.lock()})})()}})))}as.propTypes={setFullscreen:c.func,currentDocument:c.object};var ss=n(as);const cs=se("Display Layout");let ls,us,ds,ms={},ps={},fs=null,hs=0,gs=0;const bs=(e,t,n)=>{const r=ks(e),o=xs(e),i=r>o?Pi()[0]:Li()[0],a=Math.max(qi.minDisplayWidth/r,qi.minDisplayHeight/o,1),s=Math.min(i.width/r,i.height/o);let c=r>o?n/o:t/r;return c<a?c=a:c>s&&(c=s),[Math.round(c*r),Math.round(c*o)]};function vs(){return us}function ys(e){return qi.dynamicResolution&&vs()&&qi.selectedResolution===Bi&&(e||ls&&ls.length>1)}function ws(e,t,n){let r,o;if(ls&&ls.length>0)1===ls.length||n?(r=ls[0].rect.width,o=ls[0].rect.height):ls.length>1&&!n&&(r=ls[1].rect.width,o=ls[1].rect.height);else{const e=t.document.getElementById("dcv-display");e?(r=e.getBoundingClientRect().width,o=e.getBoundingClientRect().height):(r=t.innerWidth,o=t.innerHeight)}ys(n)?(ms[n]&&(clearTimeout(ms[n]),ms[n]=null),ms[n]=setTimeout(()=>{!function(e,t,n){let r=ks(t),o=xs(t);if(r=Math.min(r,qi.maxDisplayWidth||r),r=Math.max(r,qi.minDisplayWidth||r),o=Math.min(o,qi.maxDisplayHeight||o),o=Math.max(o,qi.minDisplayHeight||o),pi()){const e=bs(t,r,o);r=e[0],o=e[1]}const i=()=>{const e=e=>Math.abs(ps[n].width-r)>e||Math.abs(ps[n].height-o)>e;return!is(t.document)&&!t.fullScreen||function(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}(ps[n])||e(2)};i()?(ps[n]={width:r,height:o},Is(e,r,o,n),vi()&&bi()&&Cs(t.document.getElementById("dcv-display-frame"),"hidden")):Cs(t.document.getElementById("dcv-display-frame"),"hidden")}(e,t,n),ms[n]=null},500)):(pi()&&(ms[n]&&(clearTimeout(ms[n]),ms[n]=null),ms[n]=setTimeout(()=>{const i=bs(t,r,o);Is(e,i[0],i[1],n),ms[n]=null},300)),Rs(r,o,t,n))}function Es(e,t){return`${e}x${t}`}function Ss(e){return e.split("x")}function xs(e,t=!1){let n=0,r=e.document.getElementById("dcv-container"),o=e.document.getElementById("dcv-toolbar-container"),i=e.document.getElementById("dcv-display-frame");return r&&i?(n=t&&o?o.getBoundingClientRect().height:i.getBoundingClientRect().top-r.getBoundingClientRect().top,r.getBoundingClientRect().height-n):Qo(e)}function ks(e){const t=e.document.getElementById("dcv-container");return t?t.getBoundingClientRect().width:e.innerWidth}function Cs(e,t){e&&(e.style.overflow=t)}function Os(e){const t=e.document.getElementById("dcv-display"),n=e.document.getElementById("dcv-display-frame");t&&n&&((()=>{const r=xs(e),o=t.getBoundingClientRect().height,i=o?`${Math.max(0,(r-o)/2).toString()}px`:0;t.style.marginTop=i,n.style.height=`${r.toString()}px`})(),(()=>{const r=ks(e),o=t.getBoundingClientRect().width,i=o?`${Math.max(0,(r-o)/2).toString()}px`:0;t.style.marginLeft=i,n.style.width=`${r.toString()}px`})())}function Ms(e){const t=pi()?function(){const e=ks(window),t=xs(window),n=[],r=e>t?Pi():Li(),o=r[0],i=bs(window,0,0),a=bs(window,o.width,o.height),s=i[0]/e,c=a[0]/e;return fs&&hs===e&&gs===t||(n.push({width:i[0],height:i[1]}),r.forEach(r=>{const o=r.height/t,i=r.width/e;o>s&&o<c&&-1===n.findIndex(t=>t.width===Math.round(o*e))&&n.push({width:Math.round(o*e),height:Math.round(o*t)}),i>s&&i<c&&-1===n.findIndex(t=>t.width===Math.round(i*e))&&n.push({width:Math.round(i*e),height:Math.round(i*t)})}),-1===n.findIndex(e=>e.width===a[0])&&n.push({width:a[0],height:a[1]}),hs=e,gs=t,fs=n.sort((e,t)=>t.width-e.width)),fs}():_i;return t.filter(t=>{let n=!0;if(qi.minDisplayWidth&&(n=t.width>=qi.minDisplayWidth),n&&qi.maxDisplayWidth&&(n=t.width<=qi.maxDisplayWidth),n&&qi.minDisplayHeight&&(n=t.height>=qi.minDisplayHeight),n&&qi.maxDisplayWidth&&(n=t.height<=qi.maxDisplayHeight),n){const r=Ss(e);t.width.toString()===r[0]&&t.height.toString()===r[1]&&(n=!1)}return n}).map(e=>({value:Es(e.width,e.height),label:Es(e.width,e.height)}))}function Rs(e,t,n,r){let o=1,i=1,a=1;const s=ks(n),c=xs(n);if(Os(n),Cs(n.document.getElementById("dcv-display-frame"),qi.scaleToFit?"hidden":"auto"),ys(r)||(ps[r]={}),qi.scaleToFit){if(i=s/e,a=c/t,o=Math.max(0,Math.floor(100*Math.min(1,i,a))/100),!o)return;cs.info(`Requesting a display scaling factor of ${o}`),!function(e,t){const n=`scale(${e})`,r=t.getElementById("dcv-display"),o=t.getElementById("dcv-container");ds||(ds=function(){const e=window.CSS&&window.CSS.supports||window.supportsCSS;if(e&&e("( transform: scale(1) )"))return"transform";if(e&&e("( zoom: 0.8 )"))return"zoom";return"no-scale"}());if("transform"===ds)return r.style.transform=n,r.style.transformOrigin="0 0",o.style.overflow="hidden",!0;if("zoom"===ds)return r.style.zoom=e,o.style.overflow="hidden",!0;return o.style.overflow="auto",!1}(o,n.document)?cs.info("CSS scaling or zoom unsupported!"):Os(n)}}function Ts(e){ls=e}function Is(e,t,n,r){let o,i,a=r?ls[0].name:ls[1].name,s=r?0:ls[0].rect.width;return ls&&ls.length>1?(o={name:a,rect:{x:s,y:0,width:t,height:n},primary:r},i=r?[o,ls[1]]:[ls[0],o],Ts(i),e.requestDisplayLayout(i)):e.requestResolution(t,n)}function As(e){const[n,o]=t.useState(qi.macOptionToAlt),[i,a]=t.useState(qi.macCommandToControl),[s,c]=t.useState(qi.controlToCommand),l=t=>{t?(qi.macOptionToAlt=n,qi.macCommandToControl=i,qi.controlToCommand=s,Gi(),e.connection.setKeyboardQuirks({macOptionToAlt:n,macCommandToControl:i,forceKeyboardCombinations:qi.forceKeyboardCombinations,controlToCommand:s})):(o(qi.macOptionToAlt),a(qi.macCommandToControl),c(qi.controlToCommand))};return r(()=>(Mo.on("close-preferences",l),()=>{Mo.off("close-preferences",l)}),[n,i,s]),t.createElement(h,{size:"xxl"},!e.isClientMacOS&&e.isServerMacOS&&t.createElement(f,null,t.createElement(f,{margin:{bottom:"s"}},"Control key setting"),t.createElement(w,{onChange:({detail:e})=>c(e.value),value:s,items:[{value:!0,label:"Use Control as remote Command key (⌘)"},{value:!1,label:"Use Control as remote Control (^)"}]})),e.isClientMacOS&&!e.isServerMacOS&&t.createElement(t.Fragment,null,t.createElement(f,null,t.createElement(f,{margin:{bottom:"s"}},"Option key setting"),t.createElement(w,{onChange:({detail:e})=>o(e.value),value:n,items:[{value:!0,label:"Use Option (⌥) as remote Alt key"},{value:!1,label:"Use Option (⌥) as local modifier"}]})),t.createElement(f,null,t.createElement(f,{margin:{bottom:"s"}},"Command key setting"),t.createElement(w,{onChange:({detail:e})=>a(e.value),value:i,items:[{value:!0,label:"Use Command (⌘) as remote Control key"},{value:!1,label:"Use Command (⌘) as remote Meta key"}]}))))}As.propTypes={connection:c.object,isClientMacOS:c.bool,isServerMacOS:c.bool};const Ds={ERROR:{status:"error",color:"red",importance:3},WARNING:{status:"warning",color:"red",importance:2},SUCCESS:{status:"success",color:"green",importance:1},INFO:{status:"info",color:"blue",importance:1}};let Fs=0,Bs=[];function Ns(e,t){let n,r=(e=>({id:Fs++,level:Ho(e.level)?Ds.INFO:e.level,header:Ho(e.header)?"":e.header,description:Ho(e.description)?null:e.description,progress:Ho(e.progress)?null:e.progress,uploadedBytes:Ho(e.progress)?null:e.uploadedBytes,totalBytes:Ho(e.progress)?null:e.totalBytes,uploadedFiles:Ho(e.progress)?null:e.uploadedFiles,totalFiles:Ho(e.progress)?null:e.totalFiles,actions:Ho(e.actions)?{}:e.actions,timestamp:Date.now()}))(e),o=-1;return Ho(t)||(o=Bs.findIndex(e=>e.id===t)),-1===o?n=[r].concat(Bs.map(e=>({...e}))):(n=Bs.map(e=>({...e})),n[o]=r),Bs=n,Mo.emit("notifications-update",Bs),r.id}function _s(e){const t=Bs.map(e=>({...e})).filter(t=>t.id!==e);Bs=t,Mo.emit("notifications-update",Bs)}function Ps(e,t,n,r,o,i){if(!Ho(t)){const a=Bs.findIndex(e=>e.id===t);if(-1!==a){const t=Bs.map(e=>({...e}));t[a].progress=e,t[a].uploadedBytes=n,t[a].totalBytes=r,t[a].uploadedFiles=o,t[a].totalFiles=i,Bs=t,Mo.emit("notifications-update",Bs)}}}const Ls=se("UI CameraSelect");let $s=null;function js(e){const[n,i]=t.useState(),[a,s]=t.useState([]),[c,l]=t.useState(),u=o(!0),d=e=>{Ns({level:Ds.ERROR,header:"Error getting devices.",description:e.message,actions:{dismissable:!0}},null)},p=e=>{const t=[];e.filter(e=>"videoinput"===e.kind).forEach((e,n)=>{t.push({label:e.label||`Camera ${n+1}`,value:e.deviceId})}),s(t)},g=()=>{e.connection.getConnectedDevices().then(p).catch(d)},b=()=>{navigator.permissions.query({name:"camera"}).then(t=>{$s&&($s.onchange=null),$s=t,n||(t.onchange=b,g()),i(t.state),"granted"===t.state&&Yo(e.webcamStatus)&&g()}).catch(e=>{e instanceof TypeError?Ls.info(e.message):Ls.warn(e.message)})},v=t=>{t?c&&(e.setWebcamId(c),qi.selectedWebcamId=c,Gi()):l(qi.selectedWebcamId)},y=()=>t.createElement(m,{iconAlign:"right",href:"https://docs.aws.amazon.com/dcv/latest/userguide/using-webcam.html",target:"_blank",iconName:"external"},"Read more");r(()=>{a.filter(t=>e.webcamId===t.value).length?l(e.webcamId):a.length&&(l(a[0].value),e.setWebcamId(a[0].value))},[e.webcamId,n,a]),r(()=>{e.webcamStatus&&(Ls.info(`Webcam enabled. Status: ${e.webcamStatus}`),u.current&&(b(),u.current=!1))},[e.webcamStatus]),r(()=>(Mo.on("close-preferences",v),Mo.on("device-change",g),()=>{Mo.off("close-preferences",v),Mo.off("device-change",g)}),[e.connection,e.setWebcamId,c]);const[w,x,k,C]=(()=>{let r="",o=null,i="info",a=!0;if("busy"===e.webcamStatus)r="Camera not available. Another user is already sharing a camera within the session.",o=y(),i="warning";else switch(n){case"prompt":r="Camera not available. Grant camera permission to use it.",o=t.createElement(m,{onClick:()=>navigator.mediaDevices.getUserMedia({video:!0})},"Allow detection"),i="info";break;case"denied":r="Camera not available. Grant camera permission to use it.",o=y(),i="warning";break;case"granted":"streaming"===e.webcamStatus?(r="The selected camera cannot be changed while the streaming is active.",o=y(),i="warning"):(r="Camera available. Check the browser settings to change this site's camera permission.",o=y(),i="info",a=!1)}return[r,o,i,a]})();return t.createElement(h,{size:"l"},t.createElement(E,{action:x,type:k},w),t.createElement("div",null,t.createElement(f,null,"Camera"),t.createElement(f,{color:"text-body-secondary",fontSize:"body-s",margin:{bottom:"s"}},"Select which camera to activate."),t.createElement("div",{style:{width:"70%"}},t.createElement(S,{selectedOption:(e=>{const t=a.filter(t=>e===t.value);return t.length?t[0]:null})(c),onChange:({detail:e})=>l(e.selectedOption.value),options:a,selectedAriaLabel:"Selected",disabled:C}))))}js.propTypes={connection:c.object,webcamStatus:c.string,webcamId:c.string,setWebcamId:c.func};const Ws=se("Preferences");function zs(e){const[n,o]=t.useState("general"),[i,a]=t.useState(qi.selectedResolution),[s,c]=t.useState(qi.metricsEnabled),[u,d]=t.useState(!1),[g,b]=t.useState(!1),[v,E]=t.useState(qi.enableHighPixelDensity),[S,C]=t.useState(qi.displayQuality),[O,M]=t.useState(qi.appearanceMode),[R,T]=t.useState(qi.toolbarBehavior),[I,A]=t.useState(260),[D,F]=t.useState(0),[B,N]=t.useState(qi.timezoneRedirectionEnabled),_=e.connection.getServerInfo().os.startsWith("Darwin"),P=e=>{Ns({level:Ds.WARNING,header:"Timezone Redirection config error.",description:t.createElement("div",null,"Failed to ",B?"enable":"disable",".",t.createElement("br",null),"Error: ",e.message," (code: ",e.code,")"),actions:{dismissable:!0}})},L=()=>{Mo.emit("close-preferences",!1),a(qi.selectedResolution),E(qi.enableHighPixelDensity),C(qi.displayQuality),M(qi.appearanceMode),T(qi.toolbarBehavior),c(qi.metricsEnabled),b(qi.highColorAccuracy),N(qi.timezoneRedirectionEnabled),e.onDismiss()};return r(()=>{e.connection&&oa("high-color-accuracy",e=>{d(e.available),b(e.enabled),A(e.available?350:300),e.available&&(qi.highColorAccuracy=e.enabled,Gi())})},[e.connection]),r(()=>{F(e.timezoneRedirectionSetting),e.connection&&e.timezoneRedirectionSetting===l.TimezoneRedirectionSetting.CLIENT_DECIDES&&e.connection.enableTimezoneRedirection(B).catch(P)},[e.connection,e.timezoneRedirectionSetting]),t.createElement(p,{onDismiss:L,visible:e.visible,size:"large",header:"Preferences",modalRoot:window.document.body,disableContentPaddings:!0,footer:t.createElement(f,{float:"right"},t.createElement(h,{direction:"horizontal",size:"xs"},t.createElement(m,{variant:"link",onClick:L},"Cancel"),t.createElement(m,{variant:"primary",onClick:()=>{Mo.emit("close-preferences",!0),(()=>{let t;S!==qi.displayQuality&&(t=S===Di.label?Di:Fi,e.connection.setDisplayQuality(t.minQuality,t.maxQuality),Ws.info(`Switching to ${S} display mode`),qi.displayQuality=S)})(),O!==qi.appearanceMode&&(qi.appearanceMode=O,e.submitAppearanceModePreferences(O)),R!==qi.toolbarBehavior&&(qi.toolbarBehavior=R,e.submitToolbarBehaviorPreferences(R)),s!==qi.metricsEnabled&&(qi.metricsEnabled=s,e.submitMetricsPreferences(s)),(()=>{if(!u)return;const n=g?"enable":"disable";e.connection.requestDisplayConfig(g).catch(e=>{Ns({level:Ds.WARNING,header:"Display config error.",description:t.createElement("div",null,"Failed to ",n," high color accuracy.",t.createElement("br",null),"Error: ",e.message," (code: ",e.code,")"),actions:{dismissable:!0}})})})(),i!==qi.selectedResolution&&(qi.selectedResolution=i===Bi?Bi:Ni,e.submitResolutionPreferences(i),a(qi.selectedResolution)),vi()&&v!==qi.enableHighPixelDensity&&(qi.enableHighPixelDensity=v,e.connection.enableHighPixelDensity(v)),B!==qi.timezoneRedirectionEnabled&&(qi.timezoneRedirectionEnabled=B,D===l.TimezoneRedirectionSetting.CLIENT_DECIDES&&e.connection.enableTimezoneRedirection(B).catch(P)),Gi(),e.onDismiss()}},"Save")))},t.createElement("div",{style:{height:I}},t.createElement(y,{activeTabId:n,onChange:({detail:e})=>o(e.activeTabId),tabs:[{label:"General",id:"general",content:Ko(t.createElement(x,{columns:2},t.createElement("div",null,t.createElement(h,{size:"xxl"},t.createElement(f,null,t.createElement(f,{margin:{bottom:"s"}},"Appearance"),t.createElement(w,{onChange:({detail:e})=>M(e.value),value:O,items:[...ji()?[{value:Ai,label:Ai+(e.systemDefaultAppearanceMode?` (${Go(e.systemDefaultAppearanceMode)})`:"")}]:[],{value:Ti,label:Ti},{value:Ii,label:Ii}]})),D===l.TimezoneRedirectionSetting.CLIENT_DECIDES?t.createElement(f,null,t.createElement(f,{margin:{bottom:"s"}},"Time Zone Redirection"),t.createElement(k,{onChange:({detail:e})=>N(e.checked),checked:B},B?"Enabled":"Disabled")):null)),t.createElement("div",null,t.createElement(f,{margin:{bottom:"s"}},"Toolbar behavior"),t.createElement(w,{onChange:({detail:e})=>T(e.value),value:R,items:[{value:Si,label:Si,description:xi},{value:Ci,label:Ci,description:Oi},{value:Mi,label:Mi,description:Ri}]}))))},{label:"Display",id:"display",content:Ko(t.createElement(x,{columns:2},t.createElement(h,{size:"xxl"},t.createElement(f,null,t.createElement(f,{margin:{bottom:"s"}},"Streaming mode"),t.createElement(w,{onChange:({detail:e})=>C(e.value),value:S,items:[{value:Di.label,label:Di.label,description:Di.description},{value:Fi.label,label:Fi.label,description:Fi.description}]})),u&&t.createElement(f,null,t.createElement(f,{margin:{bottom:"s"}},"High color accuracy (YUV 4:4:4)"),t.createElement(k,{onChange:({detail:e})=>b(e.checked),checked:g,description:"Streaming performance could be affected."},g?"Enabled":"Disabled")),t.createElement(f,null,t.createElement(f,{margin:{bottom:"s"}},"Streaming metrics in the toolbar"),t.createElement(k,{onChange:({detail:e})=>c(e.checked),checked:s},s?"Enabled":"Disabled"))),t.createElement(h,{size:"xxl"},vi()&&t.createElement(f,null,t.createElement(f,{margin:{bottom:"s"}},"High pixel density"),t.createElement(k,{onChange:({detail:e})=>E(e.checked),checked:v},v?"Enabled":"Disabled")),vs()?t.createElement(f,null,t.createElement(f,{margin:{bottom:"s"}},"Display resolution"),t.createElement(w,{onChange:({detail:e})=>a(e.value),value:i,items:[{value:Bi,label:"Adapt automatically"},{value:Ni,label:`${e.currentResolution} (Current)`},...Ms(e.currentResolution)]})):null)))},...(vi()?!_:_)?[{label:"Keyboard",id:"keyboard",content:Ko(t.createElement(As,{connection:e.connection,isClientMacOS:vi(),isServerMacOS:_}))}]:[],...e.webcamStatus&&"not-available"!==e.webcamStatus?[{label:"Camera",id:"camera",content:Ko(t.createElement(js,{connection:e.connection,webcamStatus:e.webcamStatus,webcamId:e.webcamId,setWebcamId:e.setWebcamId}))}]:[]]})))}zs.propTypes={connection:c.object,visible:c.bool,onDismiss:c.func,submitResolutionPreferences:c.func,currentResolution:c.string,submitMetricsPreferences:c.func,submitAppearanceModePreferences:c.func,submitToolbarBehaviorPreferences:c.func,webcamStatus:c.string,webcamId:c.string,setWebcamId:c.func,systemDefaultAppearanceMode:c.oneOf([L.Light,L.Dark]),timezoneRedirectionSetting:c.number};const Us=se("DropdownMenu");let Vs;function Hs({connection:e,relativeMouseModeEnabled:n,sasEnabled:o,focusDisplay:i,screenshotEnabled:a,currentResolution:s,submitResolutionPreferences:c,submitMetricsPreferences:l,submitAppearanceModePreferences:u,submitToolbarBehaviorPreferences:d,webcamStatus:m,webcamId:p,setWebcamId:f,systemDefaultAppearanceMode:h,timezoneRedirectionSetting:g}){const[b,v]=t.useState(""),[y,w]=t.useState(!1),[E,S]=t.useState(!1),[x,k]=t.useState(!1),[O,M]=t.useState(0),[R,T]=t.useState(!1),I=n=>{switch(n){case"relativeMouseMode":navigator.permissions.query({name:"pointer-lock"}).then(t=>{"denied"!==t?.state?(Us.info("granted"===t?.state?"Mouse lock enabled: enabling relative mouse":"Requesting permission to lock mouse, to enable relative mouse"),e.enterRelativeMouseMode()):(Us.info("Mouse lock permission denied, couldn't enable relative mouse"),Ns({level:Ds.WARNING,header:"Permissions to mouse lock was not granted.",description:"Enable mouse lock permissions and try again.",actions:{dismissable:!0}}))}).catch(()=>{Us.debug("Pointer-lock permission not supported by browser, defaulting to normal behaviour"),e.enterRelativeMouseMode()});break;case"trackpad-mode":e.setTrackpadMode(!E)&&(S(!E),Mo.emit("trackpadMode",!E));break;case"SAS":!function(e){e.sendKeyboardShortcut([{key:"Control",location:KeyboardEvent.DOM_KEY_LOCATION_LEFT},{key:"Alt",location:KeyboardEvent.DOM_KEY_LOCATION_LEFT},{key:"Delete",location:KeyboardEvent.DOM_KEY_LOCATION_STANDARD}])}(e),T(!0);break;case"preferences":k(!0);break;case"screenshot":!function(e){const n=e=>{Us.error(`Failed to capture screenshot: ${e.message}`),Ns({level:Ds.ERROR,header:"Screenshot error",description:t.createElement("div",null,"Failed to capture screenshot.",t.createElement("br",null),"Error: ",e.message),actions:{dismissable:!0}})};Vs=setTimeout(()=>{Us.warn("No response to the screenshot request"),n({message:"Timeout"}),Vs=null},2e4),e.getScreenshot().catch(e=>{Vs&&clearTimeout(Vs),n(e)})}(e);break;case"aboutDCV":w(!0);break;case"disconnection":e.disconnect()}};return r(()=>{null!==e&&v(e.getServerInfo().hostname)},[e]),r(()=>(Mo.on("screenshot",Gs),()=>{Mo.off("screenshot",Gs)}),[]),r(()=>{M(g)},[g]),r(()=>{R&&(i(),T(!1))},[R]),t.createElement("div",{title:"More"},t.createElement(C,{onItemClick:({detail:e})=>I(e.id),items:[...n&&!pi()?[{text:"Use relative mouse [Ctrl + Shift + F8]",id:"relativeMouseMode"}]:[],...pi()?[{text:(E?"Disable":"Enable")+" trackpad mode",id:"trackpad-mode"}]:[],...o?[{text:"Send Ctrl + Alt + Del",id:"SAS"}]:[],...a?[{text:"Save Screenshot",id:"screenshot"}]:[],{text:"Preferences",id:"preferences"},{text:"About Amazon DCV",id:"aboutDCV"},{text:"Disconnect",id:"disconnection"}]},b),t.createElement(Ja,{connection:e,visible:y,onDismiss:()=>{w(!1)}}),t.createElement(zs,{connection:e,currentResolution:s,submitResolutionPreferences:c,visible:x,onDismiss:()=>{k(!1)},submitMetricsPreferences:l,submitAppearanceModePreferences:u,submitToolbarBehaviorPreferences:d,webcamStatus:m,webcamId:p,setWebcamId:f,systemDefaultAppearanceMode:h,timezoneRedirectionSetting:O}))}function qs(e){return btoa(function(e){let t,n=32768,r=[];for(t=0;t<e.length;t+=n)r.push(String.fromCharCode.apply(null,e.subarray(t,t+n)));return r.join("")}(new Uint8Array(e)))}function Gs(e){Vs&&clearTimeout(Vs),null!==e?(Us.info("Retrieved screenshot"),Ns({level:Ds.INFO,header:"Screenshot captured.",description:"Screenshot ready to be downloaded.",actions:{accept:{text:"Download",callback:()=>function(e){const t=document.createElement("a");t.href=`data: image/png;base64,${qs(e)}`,"download"in t&&(t.download="connection.png"),t.target="_blank",t.click()}(e),remove:!0},decline:{text:"Decline",remove:!0}}})):(Us.warn("Failed to capture screenshot"),Ns({level:Ds.ERROR,header:"Screenshot error.",description:"Failed to capture screenshot.",actions:{dismissable:!0}}))}Hs.propTypes={connection:c.object,relativeMouseModeEnabled:c.bool,sasEnabled:c.bool,focusDisplay:c.func,screenshotEnabled:c.bool,currentResolution:c.string,submitResolutionPreferences:c.func,submitMetricsPreferences:c.func,submitAppearanceModePreferences:c.func,submitToolbarBehaviorPreferences:c.func,webcamStatus:c.string,webcamId:c.string,setWebcamId:c.func,systemDefaultAppearanceMode:c.oneOf([L.Light,L.Dark]),timezoneRedirectionSetting:c.number};var Ks,Qs,Ys=n(Hs);function Zs(){return Zs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zs.apply(null,arguments)}var Js=function(t){return e.createElement("svg",Zs({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve","aria-hidden":"true",viewBox:"0 0 16 16"},t),Ks||(Ks=e.createElement("rect",{width:4,height:8,x:4,y:1,rx:2})),Qs||(Qs=e.createElement("path",{d:"M1 6v1a5 5 0 0 0 8 4M6 12v3M1 15h10M15.12 5.75l-4.5 4.5M15.12 10.25l-4.5-4.5"})))};const Xs=se("Microphone");function ec({connection:e}){const[n,a]=i(qi.microphone),s=o(!1),c=t=>{s.current=t,a(t),qi.microphone=t,Gi(),e.setMicrophone(t).catch(e=>{const n=`Failed to ${t?"enable":"disable"} microphone.`;Xs.warn(`${n} Disabling microphone. Error (code: ${e.code}): ${e.message}`),qi.microphone=t,Gi(),Ns({level:Ds.ERROR,header:"Microphone error.",description:n,actions:{dismissable:!0}})}).finally(()=>{s.current=!1,Xs.info("[Audio] Setting microphone to "+(qi.microphone?"enabled":"disabled"))})};return r(()=>{c(qi.microphone)},[e]),t.createElement("div",{title:"Microphone"},t.createElement(m,K({},n?{iconName:"microphone"}:{iconSvg:t.createElement(Js,null)},{variant:"icon",onClick:()=>{s.current||c(!qi.microphone)}})))}ec.propTypes={connection:c.object};var tc,nc=n(ec);function rc(){return rc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rc.apply(null,arguments)}var oc,ic=function(t){return e.createElement("svg",rc({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve","aria-hidden":"true",viewBox:"0 0 16 16"},t),tc||(tc=e.createElement("path",{d:"M7 15V1L1 6v4zM15.01 5.75l-4.5 4.5M15.01 10.25l-4.5-4.5"})))};function ac(){return ac=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ac.apply(null,arguments)}var sc,cc=function(t){return e.createElement("svg",ac({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve","aria-hidden":"true",viewBox:"0 0 16 16"},t),oc||(oc=e.createElement("path",{d:"M7 15V1L1 6v4zM11 5v6"})))};function lc(){return lc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lc.apply(null,arguments)}var uc=function(t){return e.createElement("svg",lc({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve","aria-hidden":"true",viewBox:"0 0 16 16"},t),sc||(sc=e.createElement("path",{d:"M7 15V1L1 6v4zM15 3v10M11 5v6"})))};const dc=se("Audio");function mc({connection:e}){const[n,r]=t.useState(qi.volume),[o,i]=t.useState(qi.volume),a=t=>{r(t),qi.volume=t,Gi(),e.setVolume(t),dc.debug(`Client volume level set to ${t}`)};return t.createElement(u,{position:"bottom",size:"large",triggerType:"custom",header:"Volume",dismissButton:!1,content:t.createElement(h,{direction:"horizontal",size:"s"},t.createElement(m,{iconSvg:pc(n),variant:"icon",onClick:()=>{a(n?0:o)}}),t.createElement("input",{type:"range",style:{verticalAlign:"middle",width:"150px",height:"100%"},orient:"horizontal",min:"0",max:"100",step:"1",value:o,onChange:e=>{return t=Number(e.target.value),i(t),void a(t);var t}}),t.createElement("div",{style:{display:"flex",width:"3ch",textAlign:"center",alignItems:"center",justifyContent:"center",height:"100%"}},t.createElement("output",null,o)))},t.createElement("div",{title:"Audio"},t.createElement(m,{iconSvg:pc(n),variant:"icon"})))}function pc(e){return e<=0?t.createElement(ic,null):e<=50?t.createElement(cc,null):t.createElement(uc,null)}mc.propTypes={connection:c.object};var fc,hc=n(mc),gc={};function bc(e){return e<1e3?`${e.toFixed(1)} bps`:e<1e6?`${(e/1e3).toFixed(1)} kbps`:`${(e/1e6).toFixed(1)} Mbps`}!function(){if(fc)return gc;fc=1;var e=Or(),t=So(),n=Ct(),r=Sn();e({target:"Iterator",proto:!0,real:!0},{some:function(e){return r(this),n(e),t(this,function(t,n){if(e(t))return n()},{IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})}();const vc=({label:e,color:n,children:r})=>t.createElement("div",null,t.createElement(f,{margin:{bottom:"xxxs"}},t.createElement(h,{direction:"horizontal",size:"xxs"},n&&t.createElement(yc,{color:n}),t.createElement(f,{color:"text-label"},e))),t.createElement("div",null,r));vc.propTypes={label:c.string,color:c.string,children:c.node};const yc=({color:e})=>t.createElement("svg",{width:"12",height:"12"},t.createElement("rect",{width:"12",height:"12",style:{fill:e,strokeWidth:"1",stroke:"rgb(0,0,0)"}}));yc.propTypes={color:c.string};let wc=null,Ec=[];function Sc({connection:e}){const[n,i]=t.useState(0),[s,c]=t.useState(0),[l,u]=t.useState(0),[d,g]=t.useState(""),[y,w]=t.useState(""),[E,S]=t.useState([]),[x,k]=t.useState(!1),C=o();C.current=x;const R=()=>{const t=e.getStats();let n,r,o=0;if(Ec.length>60){for(n=[],r=0;r<Ec.length-1;r++)n.push(Ec[r]);Ec=n}for(0===Ec.length?Ec.push({x:0,y:t.traffic}):(Ec.forEach(e=>{e.x++}),Ec.unshift({x:0,y:t.traffic})),r=0;r<Ec.length;r++)o+=Ec[r].y;o/=Ec.length,C.current&&(S(Ec),i(t.traffic),c(o),u(t.peakTraffic)),g(t.latency>999?"> 1 s":`${Math.round(t.latency)} ms`),w(`${t.fps} fps`),wc=setTimeout(R,1e3)},T=a(()=>{k(!0)},[]);r(()=>(null!==e&&R(),()=>{clearTimeout(wc)}),[e]);const I=()=>t.createElement("div",{title:"Metrics"},t.createElement(m,{variant:"link",onClick:T},t.createElement(h,{direction:"horizontal",size:"m"},t.createElement(f,{fontWeight:"bold",color:"inherit"},y),t.createElement(f,{fontWeight:"bold",color:"inherit"},d))));return t.createElement("div",null,t.createElement(I,null),x&&t.createElement(p,{onDismiss:()=>{k(!1)},visible:x,size:"medium",header:"Streaming metrics",footer:t.createElement(b,{gridDefinition:[{colspan:4},{colspan:4},{colspan:4}]},t.createElement(vc,{label:"Current usage",color:W},bc(n)),t.createElement(vc,{label:"Average usage",color:z},bc(s)),t.createElement(vc,{label:"Peak usage",color:U},bc(l)))},t.createElement(h,{size:"xl"},t.createElement(b,{gridDefinition:[{colspan:6},{colspan:6}]},t.createElement(vc,{label:"Framerate"},y),t.createElement(vc,{label:"Network latency"},d)),t.createElement(O,{variant:"h3",actions:t.createElement(v,{external:!0,externalIconAriaLabel:"Opens in a new tab",href:"https://docs.aws.amazon.com/dcv/latest/userguide/using-streaming.html#using-streaming-metrics"},"Learn more")},"Download bandwidth"),t.createElement(M,{series:[{title:"Current usage",type:"line",data:E,color:W,valueFormatter:bc},{title:"Average usage",type:"threshold",y:s,color:z,valueFormatter:bc},...E.some(e=>e.y>=.8*l)?[{title:"Peak usage",type:"threshold",y:l,color:U,valueFormatter:bc}]:[]],i18nStrings:{xTickFormatter:e=>`${e} s`,yTickFormatter:bc},xDomain:[60,0],hideFilter:!0,hideLegend:!0,ariaLabel:"Single data series line chart",height:200,empty:t.createElement(f,{textAlign:"center",color:"inherit"},t.createElement("b",null,"No data available"),t.createElement(f,{variant:"p",color:"inherit"},"There is no data available"))}))))}Sc.propTypes={connection:c.object};var xc,kc,Cc,Oc=n(Sc);function Mc(){return Mc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mc.apply(null,arguments)}var Rc,Tc,Ic,Ac=function(t){return e.createElement("svg",Mc({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve","aria-hidden":"true",viewBox:"0 0 16 16"},t),xc||(xc=e.createElement("path",{d:"M8 12v3M3 15h10"})),kc||(kc=e.createElement("circle",{cx:8,cy:6.56,r:5.38})),Cc||(Cc=e.createElement("path",{d:"m10.25 4.25-4.5 4.5M10.25 8.75l-4.5-4.5"})))};function Dc(){return Dc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Dc.apply(null,arguments)}var Fc,Bc,Nc,_c=function(t){return e.createElement("svg",Dc({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve","aria-hidden":"true",viewBox:"0 0 16 16"},t),Rc||(Rc=e.createElement("path",{d:"M8 12v3M3 15h10"})),Tc||(Tc=e.createElement("circle",{cx:8,cy:6.56,r:5.38})),Ic||(Ic=e.createElement("path",{d:"M5 6.5h6"})))};function Pc(){return Pc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pc.apply(null,arguments)}var Lc=function(t){return e.createElement("svg",Pc({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve","aria-hidden":"true",viewBox:"0 0 16 16"},t),Fc||(Fc=e.createElement("path",{d:"M8 12v3M3 15h10"})),Bc||(Bc=e.createElement("circle",{cx:8,cy:6.56,r:5.38})),Nc||(Nc=e.createElement("circle",{cx:8,cy:6.5,r:2})))};const $c=se("Webcam");function jc({connection:e,status:n,selectedWebcam:i,setSelectedWebcam:a}){const s=o(!1),c=o(!1),l=t=>{qi.webcam=t,c.current?$c.debug(`Cannot set camera to ${t?"enabled":"disabled"} as a request is already in progress`):(c.current=!0,$c.info("Setting camera to "+(t?"enabled":"disabled")),e.setWebcam(t,i).then(e=>{t&&a(e)}).catch(e=>{const n=`Failed to ${t?"enable":"disable"} camera.`;$c.warn(`${n} Disabling camera. Error (code: ${e.code}): ${e.message}`),Ns({level:Ds.ERROR,header:"Camera error.",description:n,actions:{dismissable:!0}})}).finally(()=>{c.current=!1}))},u=()=>{l(!qi.webcam)};return r(()=>{"attached"===n&&(u(),s.current=!0)},[i]),r(()=>{"available"===n&&s.current&&(u(),s.current=!1)},[n]),r(()=>{l(qi.webcam)},[e]),t.createElement("div",{title:"Camera"},t.createElement(m,{iconSvg:Wc(n),variant:"icon",onClick:u}))}function Wc(e){switch(e){case"available":return t.createElement(Ac,null);case"attached":return t.createElement(_c,null);case"streaming":return t.createElement(Lc,null);default:throw new Error(`Illegal camera serviceStatus: ${e}`)}}jc.propTypes={connection:c.object,status:c.string,selectedWebcam:c.string,setSelectedWebcam:c.func};var zc,Uc,Vc=n(jc),Hc={};function qc(){return qc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qc.apply(null,arguments)}!function(){if(zc)return Hc;zc=1;var e=Or(),t=So(),n=Ct(),r=Sn();e({target:"Iterator",proto:!0,real:!0},{find:function(e){return r(this),n(e),t(this,function(t,n){if(e(t))return n(t)},{IS_ITERATOR:!0,INTERRUPTED:!0}).result}})}();var Gc=function(t){return e.createElement("svg",qc({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve","aria-hidden":"true",viewBox:"0 0 16 16"},t),Uc||(Uc=e.createElement("path",{d:"m14 6.5-3-3-3 3M11 4v10M8 9.5l-3 3-3-3M5 2v10"})))};const Kc=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",hour12:!0}),Qc={text:"Storage",href:null},Yc=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],Zc=se("Filestorage");let Jc,Xc=!1;function el({connection:e,downloadEnabled:n,uploadEnabled:i}){const[s,c]=t.useState(!1),l=o(!1),[u,d]=t.useState(!0),[g,b]=t.useState(!1),[y,w]=t.useState([]),[E,S]=t.useState([Qc]),[x,k]=t.useState(1),[O,M]=t.useState(Qc.href),F=o(Qc.href),[B,N]=t.useState([]),[_,P]=t.useState(""),[L,$]=t.useState(""),[j,W]=t.useState(!1),[z,U]=t.useState(!1),[V,H]=t.useState(!1),q=o(null),G=o(null),K=o(null),Q=()=>Math.max(5,Math.floor((window.innerHeight-320-86)/42)),Y=()=>B.slice((x-1)*Q(),x*Q()),Z=(e,n)=>t.createElement("div",{style:{display:"flex",alignItems:"center",height:"100%"}},t.createElement(A,{name:e}),n&&t.createElement("span",{style:{marginLeft:"5px"}},n)),J=e=>{let n,r=e&&"/"!==e&&"Storage"!==e?e:"",o=[];Zc.debug(`Changing to directory ${r}`),n=Jc.list(r),n.on("error",e=>{1===e.code||2===e.code?Zc.info(`Aborted listing of ${r} folder`):(Zc.warn(`Failed to list ${r} folder (${e.message})`),Ns({level:Ds.ERROR,header:"File storage error.",description:t.createElement("div",null,"Failed to list files in ",r," folder.",t.createElement("br",null),"Error: ",e.message," (code: ",e.code,")"),actions:{dismissable:!0}}),J())}).on("success",()=>{Zc.debug("List files succeeded"),N(o),e!==O&&w([]),(e=>{let t=e.split("/"),n=[Qc],r="";t.filter(e=>""!==e).forEach(e=>{r+=`/${e}`,n.push({text:e,path:r,href:null})}),S(n),M(e),F.current=e,k(1)})(r)}).on("newItems",e=>{Zc.debug(`New items ${e.length}`),Zc.debug(`update list folders ${O}`),o.push(...e)}).run()},X=()=>{Xc?J(O):J()},ee=()=>{c(!0),e.getFileExplorer().then(t=>{Jc=t,X(),e.setUploadBandwidth(102400)}).catch(()=>{d(!1)})},te=()=>{l.current=!1,c(!1),e.setUploadBandwidth(10240),Xc=!1,H(!1)},ne=(e,n)=>{let r,o,i=n||""===n?n:O;o=Ns({level:Ds.INFO,header:"Upload in progress.",description:`File ${e.name} is uploading to Storage ${O}`,progress:0,actions:{decline:{text:"Stop uploading",callback:()=>r.cancel(),remove:!0}}}),r=Jc.storeFile(e,i),r.on("error",n=>{1!==n.code&&Ns({level:Ds.ERROR,header:"Upload error.",description:t.createElement("div",null,"Failed to upload ",e.name," to Storage",i,".",t.createElement("br",null),"Error: ",n.message," (code: ",n.code,")"),actions:{dismissable:!0}},o)}).on("progress",(e,t)=>{Ps(Math.floor(100*e/t),o)}).on("success",()=>{Ns({level:Ds.SUCCESS,header:"File uploaded.",description:`File ${e.name} successfully uploaded to Storage${O}`,actions:{dismissable:!0}},o),Xc=!0,X()}).run()},re=e=>{const t=e.target.files;t&&t.length>0?(Zc.debug("A file to upload has been selected."),ne(t[0])):Zc.debug("No file to upload has been selected.")},oe=e=>{Jc.retrieveFile(e).on("error",n=>{Ns({level:Ds.ERROR,header:"Download error.",description:t.createElement("div",null,"Impossible to download file ",e,".",t.createElement("br",null),"Error: ",n.message," (code: ",n.code,")"),actions:{dismissable:!0}})}).on("success",()=>{Ns({level:Ds.SUCCESS,header:"File ready for download.",description:`File ${e} ready to be downloaded to your device.`,actions:{dismissable:!0}})}).run()},ie=()=>{_.length>0&&_!==L&&((()=>{let e,n="folder"===y[0].type,r=y[0].displayName,o=`${O}/${r}`,i=`${O}/${_}`;e=n?Jc.renameDirectory(o,i):Jc.renameFile(o,i),e.on("error",e=>{Ns({level:Ds.ERROR,header:"Rename error.",description:t.createElement("div",null,"Failed to rename ",(n?"folder ":"file ")+r," to ",_,".",t.createElement("br",null),"Error: ",e.message," (code: ",e.code,")"),actions:{dismissable:!0}})}).on("success",()=>{Zc.debug("Rename succeeded."),Ns({level:Ds.SUCCESS,header:(n?"Folder":"File")+" renamed.",description:`${n?"Folder":"File"} successfully renamed from ${r} to ${_}.`,actions:{dismissable:!0}}),Xc=!0,X()}).run()})(),w([])),U(!1),P("")},ae=()=>{const e=B.map(e=>({...e}));e.shift(),N(e)},se=()=>{_.length>0?Jc.createDirectory(`${O}/${_}`).on("error",e=>{ae(),Ns({level:Ds.ERROR,header:"Folder creation error.",description:t.createElement("div",null,"Failed to create folder ",_,".",t.createElement("br",null),"Error: ",e.message," (code: ",e.code,")"),actions:{dismissable:!0}})}).on("success",()=>{Zc.debug("Mkdir succeeded"),Ns({level:Ds.SUCCESS,header:"Folder created.",description:`Folder ${_} successfully created.`,actions:{dismissable:!0}}),Xc=!0,X()}).run():ae(),W(!1),P("")},ce=e=>{for(const t of e)if("file"!==t.kind)return!1;return!0},le=e=>{Xc=!0,!bi()&&!s&&i&&ce(e.dataTransfer.items)&&(l.current=!0,ee())},ue=a(e=>{e.stopPropagation(),!e.relatedTarget&&l.current&&s&&te()}),de=e=>{switch(e){case"download":oe(`${O}/${y[0].displayName}`);break;case"open":J(`${O}/${y[0].displayName}`);break;case"rename":$(y[0].displayName),P(y[0].displayName),U(!0);break;case"delete":Jc.deleteFile(`${O}/${y[0].displayName}`).on("error",e=>{Ns({level:Ds.ERROR,header:"Deletion error.",description:t.createElement("div",null,"Failed to delete file ",y[0].displayName,".",t.createElement("br",null),"Error: ",e.message," (code: ",e.code,")"),actions:{dismissable:!0}})}).on("success",()=>{Zc.debug("Remove succeeded"),Ns({level:Ds.SUCCESS,header:"File deleted.",description:`File ${y[0].displayName} successfully deleted.`,actions:{dismissable:!0}}),Xc=!0,X()}).run();break;default:Zc.warn("Invalid dropdown action selected")}},me=e=>t.createElement(m,{onClick:()=>e.current.click()},t.createElement("input",{style:{display:"none"},type:"file",ref:e,onChange:re,onClick:e=>{e.target.value=""}}),"Upload file"),pe=t.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},t.createElement(h,{direction:"horizontal",size:"s"},t.createElement(C,{disabled:!y.length,onItemClick:({detail:e})=>de(e.id),items:[...n?[{text:"Download",id:"download",disabled:y.length&&"file"!==y[0].type}]:[],{text:"Rename",id:"rename",disabled:y.length&&!Y().filter(e=>e.displayName===y[0].displayName).length}]},"Actions"),i&&me(q),t.createElement(m,{onClick:()=>{N([{displayName:null,type:"folder"}].concat(B.map(e=>({...e})))),w([]),W(!0),k(1)}},"Create folder")),t.createElement(R,{currentPageIndex:x,onChange:({detail:e})=>k(e.currentPageIndex),pagesCount:Math.ceil(B.length/Q()),ariaLabels:{nextPageLabel:"Next page",previousPageLabel:"Previous page",pageLabel:e=>`Page ${e}`}})),fe=[{id:"name",header:"Name",cell:function(e){return Z(e.type,(e=>{const r=(e,n)=>t.createElement(D,{ref:K,onChange:({detail:e})=>P(e.value),onBlur:e,onKeyUp:({detail:t})=>{13===t.keyCode&&e()},value:_,placeholder:n,disableBrowserAutocorrect:!0,inputMode:"text"});return z&&e.displayName===y[0].displayName?r(ie,e.displayName):j&&null===e.displayName?r(se,"New folder"):"file"===e.type?n?t.createElement(v,{ariaLabel:"Download",onFollow:()=>oe(`${O}/${e.displayName}`)},e.displayName):e.displayName:t.createElement(v,{ariaLabel:"Open",onFollow:g?()=>{}:()=>{J(`${O}/${e.displayName}`)}},e.displayName)})(e))},minWidth:380},{id:"lastModified",header:"Last modified",cell:function(e){return t.createElement(f,{variant:"p"},e.displayName&&e.lastModified?Kc.format(new Date(e.lastModified)):"-")},minWidth:180},{id:"size",header:"Size",cell:function(e){return t.createElement(f,{variant:"p"},"file"===e.type?tl(e.size):"-")},minWidth:140}],he=e=>{n&&(Zc.debug("Asking to download resource"),e.accept())};return r(()=>()=>{Xc=!1,Jc=null},[]),r(()=>{(z||j)&&(K.current.focus(),z&&K.current.select())},[z,j]),r(()=>(Mo.on("file-download",he),()=>{Mo.off("file-download",he)}),[n]),r(()=>(window.addEventListener("dragenter",le),window.addEventListener("dragleave",ue),()=>{window.removeEventListener("dragenter",le),window.removeEventListener("dragleave",ue)})),t.createElement("div",null,t.createElement("div",{title:"Filestorage"},t.createElement(m,{variant:"icon",iconSvg:t.createElement(Gc,null),onClick:ee})),t.createElement(p,{onDismiss:te,visible:s,header:"File storage",size:"large",modalRoot:window.document.body},u?t.createElement("div",{onDragEnter:e=>H(!bi()&&ce(e.dataTransfer.items))},t.createElement(f,{margin:{bottom:"xs"},padding:{bottom:"xs"}},t.createElement(h,{size:"xxs"},t.createElement(h,{direction:"horizontal",size:"s"},Z("folder-open",""),t.createElement(T,{items:E,onClick:g?()=>{}:({detail:e})=>J(e.item.path)})),t.createElement("div",{style:{height:42*Q()+86,position:"relative"}},t.createElement(I,{resizableColumns:!0,loadingText:"Loading resources",selectionType:"single",columnDefinitions:fe,items:Y(),selectedItems:y,onSelectionChange:({detail:e})=>w(e.selectedItems),header:pe,empty:t.createElement(f,{textAlign:"center",color:"inherit",variant:"h5",margin:"m"},i&&!bi()?t.createElement(t.Fragment,null,t.createElement("p",null,"Drag and drop a file to upload"),t.createElement("p",null," Or "),me(G)):t.createElement("p",null,"Folder ",E[E.length-1].text," is empty"))}),V&&i&&t.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",position:"absolute",alignItems:"center",bottom:"0px",width:"100%",height:42*Q(),opacity:"0.8",outline:"2px",border:"2px dashed gray",backgroundColor:"white"},onDrop:e=>{e.preventDefault(),H(!1),((e,n)=>{if(!e[0])return void Zc.debug("Dropped file is null");const r=e[0].webkitGetAsEntry()||e[0].getAsEntry();if(r)if(r.isFile&&1===e.length)r.file(e=>{e.name.startsWith(".")||ne(e,n)},()=>Zc.debug(`File not retrieved: ${r.name}`));else{b(!0);const r=Jc.uploadFiles(e,n),o=Ns({level:Ds.INFO,header:"Upload of dropped files in progress.",description:`Dropped files are uploading to Storage${n}`,progress:0,actions:{decline:{text:"Stop uploading",callback:()=>{r.cancel(),b(!1)},remove:!0}}});let i=0;r.on("error",e=>{1!==e.code&&(Ns({level:Ds.ERROR,header:"Upload dropped files error.",description:t.createElement("div",null,"Failed to upload dropped files",t.createElement("br",null),"Error: ",e.message," ",e.code?`(code: ${e.code})`:""),actions:{dismissable:!0}},o),b(!1))}).on("progress",(e,t,n,r,a,s,{destinationFolder:c,isDirectory:l})=>{Ps(Math.floor(e/t*100),o,e,t,n,r),F.current===c&&(l||n>i)&&J(c),i=n}).on("success",()=>{Ns({level:Ds.SUCCESS,header:"Dropped files uploaded.",description:`Dropped files successfully uploaded to Storage${n}`,actions:{dismissable:!0}},o),b(!1)}).run()}else Zc.debug("Dropped file is null")})(e.dataTransfer.items,O||"")},onDragOver:e=>e.preventDefault(),onDragLeave:()=>H(!1)},t.createElement(f,{textAlign:"center",color:"inherit",variant:"h5"},"Drag and drop your files to start uploading")))))):t.createElement(f,{textAlign:"center",color:"inherit",variant:"h5"},"File storage is not available")))}function tl(e){if(Ho(e))return"-";if(0===e)return`0 ${Yc[0]}`;const t=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,t)).toFixed(2))} ${Yc[t]}`}el.propTypes={connection:c.object,downloadEnabled:c.bool,uploadEnabled:c.bool};var nl=n(el);const rl=1e3,ol={MINUTE:60};ol.HOUR=ol.MINUTE**2,ol.DAY=24*ol.HOUR;const il=(e,t)=>Math.floor(e/t),al={just_now:{limit:10,updateInterval:1,text:e=>"now"},less_than_min:{limit:ol.MINUTE,updateInterval:1,text:e=>"< 1m ago"},n_min_ago:{limit:ol.HOUR,updateInterval:30,text:e=>`${il(e,ol.MINUTE)}m ago`},n_hours_ago:{limit:ol.DAY,updateInterval:15*ol.MINUTE,text:e=>`${il(e,ol.HOUR)}h ago`},n_days_ago:{text:e=>`${il(e,ol.DAY)}d ago`}};function sl(){const[e,n]=t.useState([]),o=e=>{return n=e,r=0,o=100,Number.isFinite(n)&&n>=r&&n<=o?t.createElement(N,{value:e}):null;var n,r,o};return r(()=>{const e=e=>n(Array.isArray(e)?e:[]);return Mo.on("notifications-update",e),()=>{Mo.off("notifications-update",e)}},[]),t.createElement(u,{position:"bottom",size:"medium",fixedWidth:!0,triggerType:"custom",dismissButton:!1,content:e.length?t.createElement("div",{style:{maxHeight:Math.floor(.8*window.innerHeight),overflow:"auto"}},t.createElement("div",{style:{display:"flex",justifyContent:"space-between",padding:"2px 0"}},t.createElement(f,{fontSize:"heading-s",fontWeight:"normal",variant:"h2"},"Notifications"),t.createElement(m,{onClick:()=>{e.forEach(e=>{e.actions&&(e.actions.decline&&("function"==typeof e.actions.decline.callback&&e.actions.decline.callback(),e.actions.decline.remove&&_s(e.id)),e.actions.dismissable&&_s(e.id))})}},"Clear all")),Object.values(Ds).map(e=>e.importance).sort((e,t)=>t-e).filter((e,t,n)=>!t||e!==n[t-1]).map(n=>e.filter(e=>e.level.importance===n).map(e=>t.createElement(f,{margin:{horizontal:"xxxs",vertical:"m"},key:e.id},t.createElement(F,null,t.createElement(f,null,(e=>{const n=t.createElement(d,{type:e.level.status},e.header||Go(e.level.status));return"dismissable"in e.actions?t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},n,t.createElement("div",{style:{paddingLeft:"10px"}},t.createElement(m,{variant:"icon",iconName:"close",iconAlign:"right",onClick:()=>_s(e.id)}))):n})(e)),e.timestamp&&t.createElement(ll,{timestamp:e.timestamp}),e.description&&t.createElement(f,{margin:{top:"xxs"}},e.description),e.uploadedFiles&&t.createElement(f,{margin:{top:"s"}},`Files uploaded: ${e.uploadedFiles} / ${e.totalFiles} `),e.uploadedBytes&&t.createElement(f,{margin:{top:"s"}},`Bytes uploaded: ${tl(e.uploadedBytes)} / ${tl(e.totalBytes)}`),null!==e.progress&&t.createElement(f,{margin:{top:"s"}},o(e.progress)),("decline"in e.actions||"accept"in e.actions)&&t.createElement(f,{margin:{top:"s"}},(e=>{const n=1===Object.keys(e.actions).filter(e=>-1!==["accept","decline"].indexOf(e)).length?"flex-start":"space-between";return t.createElement("div",{style:{display:"flex",justifyContent:n}},"decline"in e.actions&&t.createElement(m,{onClick:()=>{"function"==typeof e.actions.decline.callback&&e.actions.decline.callback(),e.actions.decline.remove&&_s(e.id)}},e.actions.decline.text),"accept"in e.actions&&t.createElement("div",null,t.createElement(m,{variant:"primary",onClick:()=>{"function"==typeof e.actions.accept.callback&&e.actions.accept.callback(),e.actions.accept.remove&&_s(e.id)}},e.actions.accept.text)))})(e))))))):t.createElement(f,{padding:{horizontal:"xxl",vertical:"m"},variant:"p",color:"text-status-inactive",textAlign:"center"},"No notifications to display")},t.createElement("div",{title:"Notifications"},t.createElement(B,{color:(()=>{let t="grey",n=-1;return e.forEach(e=>{e.level.importance>n&&(n=e.level.importance,t=e.level.color)}),t})()},e.length)))}var cl=n(sl);function ll(e){const[n,o]=t.useState((Date.now()-e.timestamp)/rl),i=e=>Object.values(al).find(t=>!("limit"in t)||e<t.limit),a=e=>{o((Date.now()-e)/rl)};return r(()=>{const t=i(n).updateInterval;let r=null;return t&&(r=setInterval(a,t*rl,e.timestamp)),()=>{r&&(clearInterval(r),r=null)}},[]),t.createElement(f,{variant:"small",textAlign:"right",display:"block",fontWeight:"light"},i(s=n).text(s));var s}function ul(){return ul=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ul.apply(null,arguments)}ll.propTypes={timestamp:c.number};var dl=function(t){return e.createElement("svg",ul({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},t),e.createElement("path",{d:"M12 8a3 3 0 0 1 3 3v3.14a.86.86 0 0 1-.86.86H9.86a.86.86 0 0 1-.86-.86V11a3 3 0 0 1 3-3Z",style:{fill:"none",stroke:"#545b64",strokeWidth:2,strokeLinejoin:"round"}}),e.createElement("circle",{cx:12,cy:3.5,r:2.5,style:{fill:"none",stroke:"#545b64",strokeWidth:2,strokeMiterlimit:10}}),e.createElement("circle",{cx:4,cy:3.5,r:2.5,style:{stroke:"#545b64",strokeWidth:2,strokeMiterlimit:10,fill:"#545b64"}}),e.createElement("path",{d:"M4 8a3 3 0 0 1 3 3v3.14a.86.86 0 0 1-.86.86H1.86a.86.86 0 0 1-.86-.86V11a3 3 0 0 1 3-3Z",style:{stroke:"#545b64",strokeWidth:2,strokeLinejoin:"round",fill:"#545b64"}}))};function ml(){return ml=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ml.apply(null,arguments)}var pl=function(t){return e.createElement("svg",ml({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},t),e.createElement("circle",{cx:8,cy:3.5,r:2.5,style:{fill:"none",stroke:"#545b64",strokeWidth:2,strokeMiterlimit:10}}),e.createElement("path",{d:"M8 8a3 3 0 0 1 3 3v3.14a.86.86 0 0 1-.86.86H5.86a.86.86 0 0 1-.86-.86V11a3 3 0 0 1 3-3Z",style:{fill:"none",stroke:"#545b64",strokeWidth:2,strokeLinejoin:"round"}}))};let fl=[];const hl=e=>({username:e.username,connectionIds:[e.connectionId],owner:e.owner}),gl=e=>{if(0!==fl.length){const t=e.map(e=>e.connectionId),n=fl.map(e=>e.connectionIds).flat();(e=>{let t,n;e.forEach(e=>{const r=fl.find(t=>t.connectionIds.includes(e));n=r.owner?"Session owner":"Collaborator",t=`${n} '${r.username}' has disconnected from this session.`,Ns({level:Ds.INFO,header:"Client disconnected.",description:t,actions:{dismissable:!0}})})})(n.filter(e=>!t.some(t=>e===t)));const r=e.filter(e=>!n.some(t=>e.connectionId===t));(e=>{let t,n;e.forEach(e=>{n=e.owner?"Session owner":"Collaborator",t=`${n} '${e.username}' has joined this session.`,Ns({level:Ds.INFO,header:"New client connected.",description:t,actions:{dismissable:!0}})})})(r)}};function bl(e){(e=>{Mo.emit("collaboration-status-update",e.length>1)})(e),gl(e),(e=>{fl=[];const t=e.length;for(let n=0;n<t;n++){const t=fl.find(t=>t.username===e[n].username);t?t.connectionIds.push(e[n].connectionId):fl.push(hl(e[n]))}fl.sort((e,t)=>e.username<t.username?-1:1)})(e),vl()}function vl(){Mo.emit("collaborator-list-update",fl)}function yl(e,t){t.forEach(t=>{t!==e.id&&e.disconnectCollaborator(t)})}function wl({connection:e}){const[n,o]=t.useState([]),[i,a]=t.useState(!1);return r(()=>{const t=t=>{a(t.some(t=>t.owner&&t.connectionIds.includes(e.id))),o(t)};return Mo.on("collaborator-list-update",t),vl(),()=>{Mo.off("collaborator-list-update",t)}},[]),t.createElement(u,{position:"bottom",size:"medium",triggerType:"custom",dismissButton:!1,content:n.length?t.createElement("div",{style:{maxHeight:Math.floor(.8*window.innerHeight),overflow:"auto"}},t.createElement("div",{style:{display:"flex",justifyContent:"space-between",padding:"2px 0 15px"}},t.createElement(f,{fontSize:"heading-s",fontWeight:"normal",variant:"h2"},"Collaborators"),i&&n.length>2&&t.createElement("div",{style:{marginLeft:"30px"}},t.createElement(m,{onClick:()=>function(e){fl.forEach(t=>yl(e,t.connectionIds))}(e)},"Disconnect all"))),t.createElement(F,null,n.map(n=>n.username&&(n=>{const r=n.connectionIds.length>1&&n.connectionIds.includes(e.id)||i&&n.connectionIds.includes(e.id)&&n.connectionIds.length>1||i&&!n.connectionIds.includes(e.id);return t.createElement(f,{key:n.username},t.createElement("div",{style:{display:"flex",justifyContent:"space-between",minWidth:"150px"}},t.createElement("div",{style:{display:"flex",alignItems:"center"}},t.createElement(A,{svg:t.createElement(pl,null),size:"small"}),t.createElement("div",{style:{maxWidth:"200px"}},t.createElement(f,{fontSize:"body-m",fontWeight:"normal",variant:"p",margin:{left:"xs",right:"s"}},`${n.username}${n.connectionIds.length>1?` (${n.connectionIds.length} clients)`:""}`))),r&&t.createElement(m,{variant:"icon",iconName:"close",onClick:()=>yl(e,n.connectionIds)})))})(n)))):t.createElement(f,{padding:{horizontal:"xxl",vertical:"m"},variant:"p",color:"text-status-inactive",textAlign:"center"},"No collaborators to display")},t.createElement("div",{title:"Collaborators"},t.createElement(A,{svg:t.createElement(dl,null)})))}wl.propTypes={connection:c.object};var El=n(wl);const Sl="soft-kbd-div";let xl;function kl({connection:e,softKeyboardVisible:n,setSoftKeyboardVisible:i}){const a=o(!1);a.current=n;const s=e=>{e.setSelectionRange(e.value.length,e.value.length)},c=()=>{i(!0),xl.focus(),(yi()||hi())&&(xl.click(),window.scrollTo(0,0),document.body.scrollTop=0,document.scrollingElement.scrollTop=0)},l=()=>{xl=document.getElementById("dcv-softkbd-hid-input"),xl&&c()},u=()=>{const e=document.createElement("input");e.setAttribute("id","dcv-softkbd-hid-input"),e.setAttribute("type","text"),e.style.caretColor="transparent",e.style.color="transparent",e.style.background="transparent",e.style.border="none",e.style.fontSize="1pt",e.style.height="1px",e.style.width="1px",e.defaultValue="&",e.value=fi()?"&":"",e.setAttribute("writingSuggestions",!1),e.setAttribute("autocomplete","off"),xl=e},d=()=>{a.current?(xl=document.getElementById("dcv-softkbd-hid-input"),xl&&(xl.blur(),document.getElementById(Sl).removeChild(xl)),i(!1)):(xl=document.getElementById("dcv-softkbd-hid-input"),xl||u(),document.getElementById(Sl).appendChild(xl),c())};return r(()=>{const t=e.sendKeyboardEvent.bind(e),r=e=>{if(xl=document.getElementById("dcv-softkbd-hid-input"),xl){s(xl);const n=new KeyboardEvent("keydown",{key:e.data??"Backspace",location:KeyboardEvent.DOM_KEY_LOCATION_STANDARD,code:""}),r=new KeyboardEvent("keyup",n);t(n),t(r),xl.value="&",s(xl)}},o=e=>{"Unidentified"!==e.key&&t(e)},i=e=>{xl=document.getElementById("dcv-softkbd-hid-input"),xl&&(s(xl),o(e))},a=fi()?o:t;return n&&((e,t,n)=>{xl=document.getElementById("dcv-softkbd-hid-input"),xl&&(xl.addEventListener("focusout",l),xl.addEventListener("keydown",e),xl.addEventListener("keyup",fi()?n:e),xl.addEventListener("keypress",e),fi()&&xl.addEventListener("input",t))})(a,r,i),()=>((e,t,n)=>{xl=document.getElementById("dcv-softkbd-hid-input"),xl&&(xl.removeEventListener("focusout",l),xl.removeEventListener("keydown",e),xl.removeEventListener("keyup",fi()?n:e),xl.removeEventListener("keypress",e),fi()&&xl.removeEventListener("input",t))})(a,r,i)},[e,n]),r(()=>(pi()&&Mo.on("toggle-keyboard",d),u(),()=>{pi()&&Mo.off("toggle-keyboard",d),xl=null,i(!1)}),[]),t.createElement(t.Fragment,null," ")}kl.propTypes={connection:c.object,softKeyboardVisible:c.bool,setSoftKeyboardVisible:c.func};var Cl=n(kl);function Ol(e,t){return Ol=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ol(e,t)}function Ml(e){return Ml="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ml(e)}function Rl(e,t){if(t&&("object"===Ml(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Tl(e){return Tl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Tl(e)}var Il,Al,Dl,Fl,Bl={exports:{}};function Nl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=Tl(e);if(t){var o=Tl(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Rl(this,n)}}Bl.exports=function(){if(Fl)return Dl;Fl=1;var e=Al?Il:(Al=1,Il="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");function t(){}function n(){}return n.resetWarningCache=t,Dl=function(){function r(t,n,r,o,i,a){if(a!==e){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function o(){return r}r.isRequired=r;var i={array:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i}}()();var _l,Pl,Ll,$l,jl,Wl=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ol(e,t)}(r,t.PureComponent);var e,n=Nl(r);function r(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(t=n.call(this,e)).container=null,t.window=null,t.windowCheckerInterval=null,t.released=!1,t.state={mounted:!1},t}return(e=[{key:"render",value:function(){return this.state.mounted?Q.createPortal(this.props.children,this.container):null}},{key:"componentDidMount",value:function(){this.window||this.container||(this.openChild(),this.setState({mounted:!0}))}},{key:"openChild",value:function(){var e,t=this,n=this.props,r=n.url,o=n.title,i=n.name,a=n.features,s=n.onBlock,c=n.onOpen,l=n.center;if("string"!=typeof l||void 0!==a.width&&void 0!==a.height){if("parent"===l)a.left=window.top.outerWidth/2+window.top.screenX-a.width/2,a.top=window.top.outerHeight/2+window.top.screenY-a.height/2;else if("screen"===l){var u=void 0!==window.screenLeft?window.screenLeft:window.screen.left,d=void 0!==window.screenTop?window.screenTop:window.screen.top,m=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:window.screen.width,p=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:window.screen.height;a.left=m/2-a.width/2+u,a.top=p/2-a.height/2+d}}else console.warn("width and height window features must be present when a center prop is provided");if(this.window=window.open(r,i,(e=a,Object.keys(e).reduce(function(t,n){var r=e[n];return"boolean"==typeof r?t.push("".concat(n,"=").concat(r?"yes":"no")):t.push("".concat(n,"=").concat(r)),t},[]).join(","))),this.container=this.window.document.createElement("div"),this.windowCheckerInterval=setInterval(function(){t.window&&!t.window.closed||t.release()},50),this.window){if(this.window.document.title=o,this.container=this.window.document.getElementById("new-window-container"),null===this.container)this.container=this.window.document.createElement("div"),this.container.setAttribute("id","new-window-container"),this.window.document.body.appendChild(this.container);else{var f=this.window.document.getElementById("new-window-container-static");this.window.document.body.removeChild(f)}this.props.copyStyles&&setTimeout(function(){return e=document,n=t.window.document,r=n.createDocumentFragment(),Array.from(e.styleSheets).forEach(function(e){var t;try{t=e.cssRules}catch(e){console.error(e)}if(t){var o=[];Array.from(e.cssRules).forEach(function(e){var t=e.type;if(t!==CSSRule.UNKNOWN_RULE){var n;n=t===CSSRule.KEYFRAMES_RULE?function(e){var t=["@keyframes",e.name,"{"];return Array.from(e.cssRules).forEach(function(e){t.push(e.keyText,"{",e.style.cssText,"}")}),t.push("}"),t.join(" ")}(e):[CSSRule.IMPORT_RULE,CSSRule.FONT_FACE_RULE].includes(t)?function(e){return e.cssText.split("url(").map(function(e){return"/"===e[1]?"".concat(e.slice(0,1)).concat(window.location.origin).concat(e.slice(1)):e}).join("url(")}(e):e.cssText,o.push(n)}});var i=n.createElement("style");i.textContent=o.join("\n"),r.appendChild(i)}else if(e.href){var a=n.createElement("link");a.rel="stylesheet",a.href=e.href,r.appendChild(a)}}),void n.head.appendChild(r);var e,n,r},0),"function"==typeof c&&c(this.window),this.window.addEventListener("beforeunload",function(){return t.release()})}else"function"==typeof s?s(null):console.warn("A new window could not be opened. Maybe it was blocked.")}},{key:"componentWillUnmount",value:function(){if(this.state.mounted&&this.window)if(this.props.closeOnUnmount)this.window.close();else if(this.props.children){var e=this.container.cloneNode(!0);e.setAttribute("id","new-window-container-static"),this.window.document.body.appendChild(e)}}},{key:"release",value:function(){if(!this.released){this.released=!0,clearInterval(this.windowCheckerInterval);var e=this.props.onUnload;"function"==typeof e&&e(null)}}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(r.prototype,e),r}();function zl(){return zl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zl.apply(null,arguments)}Ll={url:"",name:"",title:"",features:{width:"600px",height:"640px"},onBlock:null,onOpen:null,onUnload:null,center:"parent",copyStyles:!0,closeOnUnmount:!0},(Pl="defaultProps")in(_l=Wl)?Object.defineProperty(_l,Pl,{value:Ll,enumerable:!0,configurable:!0,writable:!0}):_l[Pl]=Ll,Wl.propTypes={children:Bl.exports.node,url:Bl.exports.string,name:Bl.exports.string,title:Bl.exports.string,features:Bl.exports.object,onUnload:Bl.exports.func,onBlock:Bl.exports.func,onOpen:Bl.exports.func,center:Bl.exports.oneOf(["parent","screen"]),copyStyles:Bl.exports.bool,closeOnUnmount:Bl.exports.bool};var Ul,Vl,Hl=function(t){return e.createElement("svg",zl({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve","aria-hidden":"true",viewBox:"0 0 16 16"},t),$l||($l=e.createElement("path",{d:"M5.5 12v3M.5 15h10M1 5h9v7H1z"})),jl||(jl=e.createElement("path",{d:"M5 4V1h9v7h-4"})))};function ql(){return ql=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ql.apply(null,arguments)}var Gl=function(t){return e.createElement("svg",ql({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve","aria-hidden":"true",viewBox:"0 0 16 16"},t),Ul||(Ul=e.createElement("path",{d:"M5.5 12v3M.5 15h10M5 1h9v7H5z"})),Vl||(Vl=e.createElement("path",{d:"M5 5H1v7h9V8M11.75 2.25l-4.5 4.5M11.75 6.75l-4.5-4.5"})))};const Kl=se("Multiscreen");function Ql({connection:e,copyEnabled:n,pasteEnabled:o,appearanceMode:i,toolbarBehavior:a,pendingDisplays:s}){const[c,l]=t.useState(!1),[u,d]=t.useState(null),p=()=>{Mo.emit("close-secondary-display")},f=()=>{const t=hu();l(!1),t&&e&&(fu(null),e.detachDisplay(t)),u&&!u.closed&&(u.close(),d(null))};return r(()=>(Mo.on("close-secondary-display",f),()=>{Mo.off("close-secondary-display",f)}),[u,e]),t.createElement(t.Fragment,null,t.createElement("div",{title:"Multiple screens"},t.createElement(m,{iconSvg:c?t.createElement(Gl,null):t.createElement(Hl,null),variant:"icon",onClick:()=>{c?f():l(!0)}})),c&&t.createElement(Wl,{features:{height:window.innerHeight,width:window.innerWidth},name:"DCV Secondary Window",title:`${e.getServerInfo().hostname} - Amazon DCV`,onUnload:p,onBlock:p,onOpen:t=>{t.opener=null,d(t),Mo.once("open-secondary-display",()=>(t=>{t?s.length?(fu(s[0]),e.attachDisplay(t,{displayDivName:"dcv-display",displayId:s[0]}).then(e=>fu(e)).catch(e=>{Kl.error(`Cannot open secondary display (Error: ${e.code} ${e.message})`),f()})):e.attachDisplay(t,{displayDivName:"dcv-display"}).then(e=>fu(e)).catch(e=>{Kl.error(`Cannot open secondary display (Error: ${e.code} ${e.message})`),f()}):f()})(t))},closeOnUnmount:!0},t.createElement(gu,{isPrimary:!1,connection:e,copyEnabled:n,pasteEnabled:o,window:u,appearanceMode:i,toolbarBehavior:a})))}Ql.propTypes={connection:c.object,copyEnabled:c.bool,pasteEnabled:c.bool,appearanceMode:c.oneOf([Ai,Ti,Ii]),toolbarBehavior:c.oneOf([Si,Ci,Mi]),pendingDisplays:c.arrayOf(c.number)};var Yl=n(Ql);const Zl=se("Viewer"),Jl={position:"relative",margin:"auto",outline:"none"},Xl={height:"100%",overflow:"hidden",position:"relative"},eu={position:"absolute",width:"100%",zIndex:1e3,pointerEvents:"all"},tu={display:"flex",flexFlow:"row wrap",alignItems:"center","--gap":"32px",marginLeft:"calc(var(--gap) / -2)",marginBottom:"calc(var(--gap) / -2)"},nu={marginLeft:"calc(var(--gap) / 2)",marginBottom:"calc(var(--gap) / 2)"},ru=li.satisfies({chrome:">=137"})?10:1;let ou,iu,au=[],su=null,cu=null,lu=null;function uu({isPrimary:e,connection:n,copyEnabled:i,pasteEnabled:c,window:u,appearanceMode:d,toolbarBehavior:p,uiConfig:g,divId:b="dcv-display"}){const[v,y]=t.useState(!0),[w,S]=t.useState(!1),[x,k]=t.useState(!1),[C,O]=t.useState(!1),[M,R]=t.useState(""),[T,I]=t.useState(""),[A,D]=t.useState(""),[F,B]=t.useState(""),[N,P]=t.useState(qi.selectedWebcamId),[W,z]=t.useState(i||!1),[U,K]=t.useState(!1),[Q,Y]=t.useState(c||!1),[Z,J]=t.useState(qi.metricsEnabled),[X,ee]=t.useState(!1),[te,ne]=t.useState(!1),[re,oe]=t.useState(!1),[ie,ae]=t.useState(!1),[ce,le]=t.useState(!1),[ue,de]=t.useState(!1),[me,pe]=t.useState(!1),[fe,he]=t.useState(!1),[ge,be]=t.useState(!1),[ve,ye]=t.useState(!1),[we,Ee]=t.useState(null),[Se,xe]=t.useState(qi.appearanceMode),[ke,Ce]=t.useState(qi.toolbarBehavior),[Oe,Me]=t.useState(0),[Re,Te]=t.useState(""),[Ie,Ae]=t.useState(!1),[De,Fe]=t.useState(!1),Be=o(null),Ne=o(null),_e=o(!1),Pe=o(null);_e.current=ge,r(()=>{pi()&&wi(Zl)},[]);const Le=a(e=>!g||!qo(g.toolbar)||!(e in g.toolbar)||g.toolbar[e],[g]),$e=()=>{ws(n,u,e)},je=e=>{Zl.info(`network interruption alert: ${e}`),Ae(e)},We=e=>{Zl.info(`network offline alert: ${e}`),Fe(e)},ze=e=>{ae(e)},Ue=(t,r,o)=>{(Ho(o)||0===o)&&(S(r),n.setDisplayQuality(qi.minQuality,qi.maxQuality),n.setMaxDisplayResolution(qi.maxDisplayWidth,qi.maxDisplayHeight),n.setMinDisplayResolution(qi.minDisplayWidth,qi.minDisplayHeight),us=t,n.setKeyboardQuirks({macOptionToAlt:qi.macOptionToAlt,macCommandToControl:qi.macCommandToControl,forceKeyboardCombinations:qi.forceKeyboardCombinations,controlToCommand:qi.controlToCommand})),e||ou?(be(!0),ye(!0)):Zl.info(`Received first frame for an unknown displayId: ${o}`)},Ve=e=>{Me(e.setting);const t=e.status;t&&Re!==t&&(Te(t),t===l.TimezoneRedirectionStatus.PERMISSION_ERROR?Ns({level:Ds.WARNING,header:"Time Zone Redirection.",description:"This user does not have permission to perform this operation.",actions:{dismissable:!0}}):t===l.TimezoneRedirectionStatus.GENERIC_ERROR&&Ns({level:Ds.WARNING,header:"Time Zone Redirection.",description:"The setting could not be saved. Please try again.",actions:{dismissable:!0}}))},He=(t,n,r)=>{const o=e||Ho(r)||1===r.length?t:r[1].rect.width,i=e||Ho(r)||1===r.length?n:r[1].rect.height;Ts(r),-1!==[Bi,Ni].indexOf(qi.selectedResolution)?R(Es(o,i)):R(qi.selectedResolution),Rs(o,i,u,e)},qe=a(t=>{!function(e,t,n,r){if(t===Bi)qi.dynamicResolution=!0,ws(e,n,r);else if(qi.dynamicResolution=!1,t!==Ni){const o=Ss(t),i=pi()?bs(n,o[0],o[1]):o;Is(e,i[0],i[1],r)}Gi()}(n,t,u,e)},[n,u,e]),Ge=e=>{I(e.remote),"busy"===e.remote?cu=Ns({level:Ds.WARNING,header:"Audio input unavailable.",description:"This browser or session does not support audio input.",actions:{dismissable:!0}},cu):mu()},Ke=e=>{D(e.remote),e.enabled?null!==lu&&(_s(lu),lu=null):(lu=Ns({level:Ds.WARNING,header:"Audio output unavailable.",description:"This browser or session does not support audio output.",actions:{dismissable:!0}},lu),mu())},Qe=e=>{B(e.serviceStatus)},Ye=({message:e,code:n})=>{Ns({level:Ds.ERROR,header:"Webcam error.",description:t.createElement("div",null,"Webcam could not be attached.",t.createElement("br",null),"Error: ",e," (code: ",n,")"),actions:{dismissable:!0}})},Ze=e=>{z(e.enabled)},Je=e=>{Y(e.enabled)},Xe=e=>{S(e.enabled)},et=e=>{ne(e.enabled)},tt=e=>{oe(e.enabled)},nt=e=>{O(e.enabled)},rt=e=>{const t=e.currentTarget.getBoundingClientRect();e.clientY<=t.top+ru&&null===Pe.current?Pe.current=setTimeout(()=>{be(!0),u.document.getElementById(b)?.blur(),Pe.current=null},1500):e.clientY>t.top+ru&&null!==Pe.current&&(clearTimeout(Pe.current),Pe.current=null)},ot=()=>{be(!1)},it=()=>{Ne.current=setTimeout(()=>{be(!1)},1500)},at=()=>{clearTimeout(Ne.current)},st=a(()=>{Be.current?.focus()},[Be]),ct=e=>{he(e)},lt=e=>{if(!e.enabled){const e=u.document.getElementById("dcv-softkbd-hid-input");e&&u.document.getElementById("soft-kbd-div").removeChild(e)}le(e.enabled)},ut=e=>{Ee(e.matches?L.Dark:L.Light),Se===Ai&&zi(e,u.document.body)},dt=()=>{Zl.info("Three finger click, showing toolbar"),be(!_e.current)},mt=(e,t)=>{const n=au.indexOf(e);t.closed?(-1!==n&&au.splice(n,1),e===iu&&Mo.emit("close-secondary-display")):t.enabled?ou=e===iu:-1===n&&au.push(e)},pt=()=>{Zl.error("Webgl rendering lost context, showing information banner."),Ns({level:Ds.ERROR,header:"There was an error with webgl rendering",description:"Webgl rendering lost context. Please refresh the page to reconnect.",actions:{dismissable:!1}})};r(()=>$(j.Compact,u.document.body),[u]),r(()=>(e&&Mo.on("filestorage-enabled",ee),()=>{e&&Mo.off("filestorage-enabled",ee)}),[e]),r(()=>(n&&(Mo.on("first-frame",Ue),Mo.on("network-quality-warning",je),Mo.on("network-quality-critical",We),Mo.on("trackpadMode",ze),e?(!function(e){Ji=se("Feature Handler"),Xi=e}(n),Mo.on("display-availability",mt),oa("audio-in",Ge),oa("audio-out",Ke),oa("webcam",Qe),oa("webcam-error",Ye),oa("clipboard-copy",Ze),oa("clipboard-paste",Je),oa("relative-mouse",Xe),oa("file-download",et),oa("file-upload",tt),oa("display-multi",e=>pe(e.enabled&&!pi())),oa("keyboard-sas",e=>k(e.enabled)),oa("screenshot",nt),oa("timezone-redirection",Ve)):Mo.emit("open-secondary-display")),()=>{Mo.off("first-frame",Ue),Mo.off("network-quality-warning",je),Mo.off("network-quality-critical",We),Mo.off("trackpadMode",ze),e&&(Mo.off("display-availability",mt),ea={})}),[n,e]),r(()=>{if(!v){const t=()=>ws(n,u,e);if(ou&&au.length){const e=au.indexOf(iu);-1!==e&&au.splice(e,1),setTimeout(t,500)}else e&&Ts([{name:"",rect:{x:0,y:0,width:ls&&ls[0]?ls[0].rect.width:800,height:ls&&ls[0]?ls[0].rect.height:600},primary:!1}]),t()}},[v]),r(()=>(Mo.on("collaboration-status-update",K),()=>{Mo.off("collaboration-status-update",K)})),r(()=>(Mo.on("display-layout",He),()=>{Mo.off("display-layout",He)}),[ke,n,u,e]),r(()=>{n&&pi()&&oa("keyboard",lt)},[n,u]),r(()=>{const t=()=>{Mo.emit("close-secondary-display"),n&&n.disconnect()};return e&&u.addEventListener("pagehide",t),()=>{e&&u.removeEventListener("pagehide",t)}},[n,u,e]),r(()=>(ve&&(u.addEventListener("resize",$e),su=u.document.getElementById(b)?.getElementsByTagName("canvas"),su&&su.length>0&&su[0].addEventListener("webglcontextlost",pt),u.matchMedia("(orientation: portrait)").addEventListener("change",$e),fe&&ke===Ci||ke===Si?(u.document.getElementById(`${b}-container`)&&u.document.getElementById(`${b}-container`).addEventListener("mousemove",rt),u.document.getElementById(b)&&(u.document.getElementById(b).addEventListener("focusin",ot),pi()&&u.document.getElementById(b).addEventListener("touchstart",ot)),u.document.getElementById(`${b}-toolbar-container`)&&(u.document.getElementById(`${b}-toolbar-container`).addEventListener("mouseleave",it),u.document.getElementById(`${b}-toolbar-container`).addEventListener("mousemove",at)),pi()&&Mo.on("toggle-toolbar",dt),be(!1)):(clearTimeout(Ne.current),clearTimeout(Pe.current),be(!0)),y(!1)),()=>{su&&su.length>0&&su[0].removeEventListener("webglcontextlost",pt),u.removeEventListener("resize",$e),u.matchMedia("(orientation: portrait)").removeEventListener("change",$e),clearTimeout(Ne.current),clearTimeout(Pe.current),u.document.getElementById(`${b}-container`)&&u.document.getElementById(`${b}-container`).removeEventListener("mousemove",rt),u.document.getElementById(b)&&(u.document.getElementById(b).removeEventListener("focusin",ot),pi()&&u.document.getElementById(b).removeEventListener("touchstart",ot)),u.document.getElementById(`${b}-toolbar-container`)&&(u.document.getElementById(`${b}-toolbar-container`).removeEventListener("mouseleave",it),u.document.getElementById(`${b}-toolbar-container`).removeEventListener("mousemove",at)),pi()&&Mo.off("toggle-toolbar",dt)}),[ve,ke,fe,n,e,u]),r(()=>{v&&!ge||ws(n,u,e)},[ke,fe]),r(()=>{const e=Wi();return Ui(Se,u.document.body),e&&(Ee(e.matches?L.Dark:L.Light),e.addEventListener("change",ut)),()=>{e&&e.removeEventListener("change",ut)}},[Se]),r(()=>{d&&xe(d)},[d]),r(()=>{p&&Ce(p)},[p]);const ft=s(()=>ce&&e&&pu(t.createElement(t.Fragment,null,t.createElement(m,{variant:ue?"primary":"normal",onClick:()=>{Mo.emit("toggle-keyboard")},ariaLabel:"Virtual keyboard"},(ue?"Close":"Open")+" keyboard"),t.createElement(Cl,{connection:n,softKeyboardVisible:ue,setSoftKeyboardVisible:de}))),[e,ue,ce]),ht=s(()=>t.createElement(h,{direction:"horizontal",size:"m"},e&&X&&t.createElement(nl,{connection:n,downloadEnabled:te,uploadEnabled:re}),(W||Q)&&t.createElement(Ra,{connection:n,copyEnabled:W,pasteEnabled:Q,currentWindow:u}),e&&du(T)&&du(A)&&t.createElement(nc,{connection:n}),e&&du(A)&&t.createElement(hc,{connection:n}),e&&Yo(F)&&t.createElement(Vc,{connection:n,status:F,selectedWebcam:N,setSelectedWebcam:P}),e&&me&&Le("multimonitorButton")&&t.createElement(Yl,{connection:n,copyEnabled:W,pasteEnabled:Q,appearanceMode:Se,toolbarBehavior:ke,pendingDisplays:au}),Le("fullscreenButton")&&u.document.documentElement.requestFullscreen&&!yi()&&!hi()&&t.createElement(ss,{setFullscreen:ct,currentDocument:u.document})),[e,X,n,te,re,W,Q,T,A,F,N,P,me,W,Q,Se,ke,au,ct,Le,u]),gt=s(()=>t.createElement(f,{textAlign:"center"},t.createElement(Oc,{connection:n})),[n]),bt=s(()=>t.createElement(f,{float:"right"},t.createElement("div",{style:tu},e&&ft,e&&U&&pu(t.createElement(El,{connection:n})),pu(t.createElement(cl,null)),pu(t.createElement(Ys,{connection:n,relativeMouseModeEnabled:w,sasEnabled:x,focusDisplay:st,screenshotEnabled:C,currentResolution:M,submitResolutionPreferences:qe,submitMetricsPreferences:J,submitAppearanceModePreferences:xe,submitToolbarBehaviorPreferences:Ce,webcamStatus:F,webcamId:N,setWebcamId:P,systemDefaultAppearanceMode:we,timezoneRedirectionSetting:Oe})))),[e,ft,n,U,w,x,C,M,F,N,we,Oe]),vt=s(()=>t.createElement(f,{display:ge?"block":"none",padding:{left:"s",right:"s",top:"xs",bottom:"xs"}},t.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},ht,e&&Z&>,e&&bt)),[ge,ht,e,Z,gt,bt,ft]),yt=s(()=>t.createElement("div",{id:"dcv-toolbar-container",style:{backgroundColor:H,borderBottom:`1px solid ${V}`,...ke===Si||fe&&ke===Ci?eu:{}}},vt),[ke,fe,vt]),wt=s(()=>t.createElement("div",{style:{backgroundColor:q}},t.createElement("div",{style:{height:Qo(u)-1}},t.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",WebkitTransform:"translate(-50%, -50%)",msTransform:"translate(-50%, -50%)"}},t.createElement(h,{size:"m"},t.createElement(f,{textAlign:"center"},t.createElement(_,{size:"large"})),t.createElement(f,{fontWeight:"light",variant:"h1"},"Connecting"))))),[u]),Et=s(()=>t.createElement("div",{style:{display:Ie?"block":"none",zIndex:"1009",position:"absolute",top:"4%",left:"50%",transform:"translate(-50%, -50%)",WebkitTransform:"translate(-50%, -50%)",msTransform:"translate(-50%, -50%)"}},t.createElement(E,{type:"warning",header:"Network connection is unstable"},"Please check your network connection or VPN.")),[u,Ie]),St=s(()=>t.createElement("div",{style:{display:De?"block":"none",zIndex:"1009",position:"absolute",top:"4%",left:"50%",transform:"translate(-50%, -50%)",WebkitTransform:"translate(-50%, -50%)",msTransform:"translate(-50%, -50%)"}},t.createElement(E,{type:"error",header:"Network connection is not available"},"Please check your network connection or VPN.")),[u,De]),xt=s(()=>{const e=u.document.getElementById("dcv-input");return n?.setTrackpadMode(ie),e?t.createElement("div",{id:"trackpad-mode-buttons",style:{position:"absolute",left:"87px",bottom:"87px",zIndex:"1",opacity:"0.7"},onMouseMove:t=>{const n=new MouseEvent(t.type,t);e.dispatchEvent(n),t.preventDefault()},onMouseDown:t=>{const n=new MouseEvent(t.type,t);e.dispatchEvent(n),t.preventDefault()},onMouseUp:t=>{const n=new MouseEvent(t.type,t);e.dispatchEvent(n),t.preventDefault()},onTouchStart:e=>e.preventDefault(),onTouchEnd:e=>e.preventDefault()},t.createElement("button",{"aria-label":"Left mouse button",onTouchStart:()=>{n.sendMouseButton(1,!0)},onTouchEnd:()=>{n.sendMouseButton(1,!1)},onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),style:{height:"100px",backgroundColor:q,fill:G}},t.createElement(Qi,null)),t.createElement("button",{"aria-label":"Right mouse button",onTouchStart:()=>{n.sendMouseButton(3,!0)},onTouchEnd:()=>{n.sendMouseButton(3,!1)},onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),style:{position:"relative",left:"17px",height:"100px",backgroundColor:q,fill:G}},t.createElement(Zi,null))):null},[ve]),kt=s(()=>xs(u,!(ke===Ei||fe&&ke===ki)),[u,ke,fe]),Ct=s(()=>ks(u),[u]);return t.createElement("div",{id:`${b}-container`,style:Xl},v&&!ge?wt:Le("visible")&&yt,Et,St,t.createElement("div",{style:{display:v&&!ge?"none":"block",backgroundColor:q}},!v&&ie&&xt,t.createElement("div",{id:`${b}-frame`,style:{height:kt,width:Ct,overflow:qi.scaleToFit?"hidden":"auto"}},t.createElement("div",{id:b,ref:Be,style:Jl})),t.createElement("div",{id:"dcv-resource",tabIndex:"-1"}),t.createElement("div",{id:"soft-kbd-div",style:{position:"absolute",top:0,zIndex:-1e3}})))}function du(e){return-1!==["available","attached","active"].indexOf(e)}function mu(){null!==cu&&(_s(cu),cu=null)}function pu(e){return t.createElement("div",{style:nu},e)}function fu(e){if(null===e){const e=au.indexOf(iu);-1!==e&&au.splice(e,1)}iu=e}function hu(){return iu}uu.propTypes={isPrimary:c.bool,connection:c.object,copyEnabled:c.bool,pasteEnabled:c.bool,window:c.object,appearanceMode:c.oneOf([Ai,Ti,Ii]),toolbarBehavior:c.oneOf([Si,Ci,Mi]),uiConfig:c.exact({toolbar:c.exact({visible:c.bool,fullscreenButton:c.bool,multimonitorButton:c.bool})}),divId:c.string};var gu=n(uu);const bu=se("License Handler");let vu=null;function yu(e){let t=365,n="",r={};e.licenses.forEach(e=>{e.isDemo&&bu.info(`License status: product '${e.product}' is using a demo license (${e.leftDays} days left)`),e.leftDays>0&&e.leftDays<t&&(t=e.leftDays,n=e.product)}),0===e.numUnlicensed?(bu.debug(`License status: ${e.licenses.length} products licensed`),r.level=Ds.INFO,"demo"===e.licensingMode&&t<7?r.header="DCV demo license.":r.header="DCV license.",t<7?(bu.info(`License status: product '${n}' will expire in ${t} days`),r.description=`License of '${n}' will expire in ${t} days.`):"demo"===e.licensingMode&&(r.description="DCV is running with a demo license.")):(bu.warn(`License error (mode: ${e.licensingMode}), ${e.numUnlicensed}/${e.licenses.length} products unlicensed: ${JSON.stringify(e.licenses)}`),r.header="No license available.","ec2"===e.licensingMode?(r.level=Ds.WARNING,r.description="Please, check your EC2 configuration.",null!==e.documentationUrl&&""!==e.documentationUrl&&(r.actions={},r.actions.accept={text:"See documentation",callback:()=>{const t=document.createElement("a");t.href=e.documentationUrl,t.target="_blank",t.click()}})):(r.level=Ds.ERROR,r.description="Please, contact the administrator.")),r.description&&(vu=Ns(r,vu))}const wu=se("Printer");function Eu(e){const t=e.clone();Ns({level:Ds.INFO,header:"File printed.",description:`${t.id} has been converted in printable format.`,actions:{accept:{text:"Download",callback:()=>{var e;e=t,wu.debug(`Accepting print resource ${e.id}`),e.accept({disposition:"attachment"})},remove:!0},decline:{text:"Decline",callback:()=>{return e=t,wu.debug(`Removing print resource ${e.id}`),void e.decline();var e},remove:!0}}}),wu.debug(`Added printer notification for resource ${e.id}`)}const Su=se("DCVBaseViewer");let xu,ku;function Cu(e){const[n,i]=t.useState(null),a=o(n),s=t=>{Vo(e.onDisconnect)&&e.onDisconnect(t),a.current=null},c=e=>{let t,r=`${Ho(e.namespace)?"":`${e.namespace}::`}${e.name}`;0!==qi.customChannels.length&&-1!==(()=>{const t=[];return qi.customChannels.forEach(n=>{if(Ho(e.namespace)){const e=n.split("::",2);t.push(e[e.length-1])}else t.push(n)}),t})().indexOf(r)?n.openChannel(e.name,e.authToken,{onMessageReceived:e=>{Su.info(`Custom channel: received message ${new TextDecoder("utf-8").decode(e)}`),t(e)},onClose:e=>Su.info(`Custom channel closed: ${JSON.stringify(e)}`)},e.namespace).then(e=>{Su.info(`Opened custom channel ${e.channelName}`),t=t=>{e.sendMessage(t).then(()=>{Su.info("Success sending message.")}).catch(e=>{Su.error(`Failed to send message: ${JSON.stringify(e)}`)})}}).catch(e=>{Su.error(`Failed to open custom channel: ${e.message}`)}):Su.info(`Custom channel '${r}' not supported`)},u=e=>{switch(e.name){case"TwoFingerTouch":Mo.emit("toggle-keyboard");break;case"ThreeFingerTouch":Mo.emit("toggle-toolbar")}},d=()=>{Su.info("Calling client.connect");const n={displayLayout:(e,t,n)=>{Mo.emit("display-layout",e,t,n)},firstFrame:(e,t,n)=>{Mo.emit("first-frame",e,t,n)},displayAvailability:(e,t)=>{Mo.emit("display-availability",e,t)},disconnect:s,licenseNotification:yu,idleWarningNotification:e=>{!function(e){let t;e?(t=`DCV connection is idle and is going to be disconnected at ${e.toString()}`,Su.info(t),xu=Ns({level:Ds.WARNING,header:"Idle timeout.",description:t,actions:{dismissable:!0}},xu)):xu&&(_s(xu),xu=null)}(e)},dataChannel:e=>{Mo.emit("custom-channel",e)},filePrinted:e=>{Eu(e)},fileDownload:e=>{Mo.emit("file-download",e)},qualityIndicatorState:e=>{Su.info(`Quality Indicators: ${JSON.stringify(e)}`),function(e){let n=0,r=[],o="Quality status update.";switch(e.indicators.forEach(e=>{r.push(t.createElement(f,{key:e.name},`${e.name.replace("_"," ")} status: ${e.status}`)),e.changed&&Su.info(`Indicator ${e.name} has changed to status ${e.status}`),e.status>n&&(n=e.status)}),Su.info(`Current Quality Indicator overall alarm state: ${n}`),n){case 1:ku=Ns({level:Ds.WARNING,header:o,description:r,actions:{dismissable:!0}},ku);break;case 2:ku=Ns({level:Ds.ERROR,header:o,description:r,actions:{dismissable:!0}},ku);break;default:ku&&(_s(ku),ku=null)}}(e)},filestorageEnabled:e=>{Mo.emit("filestorage-enabled",e)},...pi()&&{gestureEvent:u},clipboardEvent:e=>{Mo.emit("clipboard",e)},deviceChangeEvent:function(){Mo.emit("device-change")},featuresUpdate:ra,screenshot:e=>{Mo.emit("screenshot",e)},collaboratorList:e=>{bl(e)},networkQualityChange:e=>{!function(e){switch(Su.info(`Network Quality Change: ${e.quality}`),e.quality){case"WARNING":Ou("network-quality-warning");break;case"CRITICAL":Ou("network-quality-critical");break;default:Ou()}}(e)}},r={url:e.config.url,sessionId:e.config.sessionId,authToken:e.config.authToken,enabledChannels:e.config.enabledChannels??qi.enabledChannels,displayCodecs:e.config.displayCodecs??qi.displayCodecs,divId:e.config.divId??"dcv-display",showDebugLayer:e.config.showDebugLayer??qi.debugLayer,enableGraphicsDebugLayer:e.config.enableGraphicsDebugLayer??qi.enableGraphicsDebugLayer,clientHiDpiScaling:e.config.clientHiDpiScaling??qi.clientHiDpiScaling,enableHighPixelDensity:e.config.enableHighPixelDensity??qi.enableHighPixelDensity,enableWebCodecs:e.config.enableWebCodecs??qi.enableWebCodecs,enableWebAuthN:e.config.enableWebAuthN??qi.enableWebAuthN,highColorAccuracy:e.config.highColorAccuracy??qi.highColorAccuracy,losslessColorspace:e.config.losslessColorspace??qi.losslessColorspace,baseUrl:e.config.baseUrl,resourceBaseUrl:e.config.resourceBaseUrl??"",extensionData:e.config.extensionData??"",volumeLevel:e.config.volumeLevel??qi.volume,clipboardAutoSync:e.config.clipboardAutoSync,dynamicAudioTuning:e.config.dynamicAudioTuning,observers:{...n,...e.config.observers},callbacks:e.config.callbacks};Object.keys(r).forEach(e=>{Ho(r[e])&&delete r[e]}),l.connect(r).then(t=>{i(t),a.current=t;const n=e.customTitle||`${t.getServerInfo().hostname} - Amazon DCV`;document.title=n,e.customTitle&&Su.info(`Using custom browser title: ${e.customTitle}`),Vo(e.onConnectionEstablished)&&e.onConnectionEstablished(t)}).catch(t=>{Su.error(`client.connect was rejected (${t.message})`),Vo(e.onDisconnect)&&e.onDisconnect(t.message),a.current=null})};return r(()=>{e.config.sessionId&&e.config.authToken&&!n&&(oe.setLevel(e.logLevel),d())},[e.config.sessionId,e.config.authToken]),r(()=>()=>{Su.info("Calling connection.disconnect"),a.current&&a.current.disconnect()},[]),r(()=>(Mo.on("custom-channel",c),()=>{Mo.off("custom-channel",c)}),[n]),t.createElement(gu,{isPrimary:!0,connection:n,window:window,uiConfig:e.uiConfig,divId:e.config.divId??"dcv-display"})}function Ou(e=""){switch(Mo.emit("network-quality-warning",!1),Mo.emit("network-quality-critical",!1),e){case"network-quality-warning":case"network-quality-critical":Mo.emit(e,!0);break;case"":break;default:Su.warn(`Unknown input passed to emitNetworkQualitySignal: ${e}`)}}Cu.propTypes={config:c.shape({url:c.string.isRequired,sessionId:c.string.isRequired,authToken:c.string.isRequired,baseUrl:c.string,resourceBaseUrl:c.string,extensionData:c.string,connectionMetadata:c.object,enabledChannels:c.array,connectionFailureRetryAttempts:c.number,connectionBlockRetryAttempts:c.number,losslessColorspace:c.string,divId:c.string,volumeLevel:c.number,clipboardAutoSync:c.bool,dynamicAudioTuning:c.bool,clientHiDpiScaling:c.bool,highColorAccuracy:c.bool,enableHighPixelDensity:c.bool,enableWebCodecs:c.bool,enableWebAuthN:c.bool,enableGraphicsDebugLayer:c.bool,showDebugLayer:c.oneOfType([c.bool,c.number]),displayCodecs:c.array,observers:c.object,callbacks:c.object,httpExtraSearchParams:c.func}).isRequired,uiConfig:c.exact({toolbar:c.exact({visible:c.bool,fullscreenButton:c.bool,multimonitorButton:c.bool})}),onDisconnect:c.func,logLevel:c.oneOf(Object.values(oe.levels)),onConnectionEstablished:c.func,customTitle:c.string};const Mu=se("DCVViewer");function Ru(e){const n={url:e.dcv.serverUrl,sessionId:e.dcv.sessionId,authToken:e.dcv.authToken,baseUrl:e.dcv.baseUrl,resourceBaseUrl:e.dcv.resourceBaseUrl,extensionData:e.dcv.extensionData,clipboardAutoSync:!0,dynamicAudioTuning:!0,observers:e.dcv.observers,divId:e.dcv.divId};return Mu.info("Creating DCVViewer component."),t.createElement(Cu,{config:n,uiConfig:e.uiConfig,onDisconnect:e.dcv.onDisconnect,logLevel:e.dcv.logLevel,customTitle:e.dcv.customTitle,onConnectionEstablished:e.dcv.onConnectionEstablished})}Ru.propTypes={dcv:c.exact({sessionId:c.string.isRequired,authToken:c.string.isRequired,serverUrl:c.string.isRequired,baseUrl:c.string.isRequired,resourceBaseUrl:c.string,extensionData:c.string,onDisconnect:c.func,logLevel:c.oneOf(Object.values(oe.levels)),customTitle:c.string,observers:c.exact({httpExtraSearchParams:c.func,httpExtraHeaders:c.func}),onConnectionEstablished:c.func,divId:c.string}).isRequired,uiConfig:c.exact({toolbar:c.exact({visible:c.bool,fullscreenButton:c.bool,multimonitorButton:c.bool})})};export{Ru as DCVViewer};
|